{"version":3,"file":"index-BCRLzpgI.js","sources":["../../node_modules/@vue/shared/dist/shared.esm-bundler.js","../../node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js","../../node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js","../../node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js","../../node_modules/vue/dist/vue.runtime.esm-bundler.js","../../node_modules/pinia/node_modules/vue-demi/lib/index.mjs","../../node_modules/@vue/devtools-api/lib/esm/env.js","../../node_modules/@vue/devtools-api/lib/esm/const.js","../../node_modules/@vue/devtools-api/lib/esm/time.js","../../node_modules/@vue/devtools-api/lib/esm/proxy.js","../../node_modules/@vue/devtools-api/lib/esm/index.js","../../node_modules/pinia/dist/pinia.mjs","../../node_modules/vue-router/dist/vue-router.mjs","../../node_modules/axios/lib/helpers/bind.js","../../node_modules/axios/lib/utils.js","../../node_modules/axios/lib/core/AxiosError.js","../../node_modules/axios/lib/helpers/null.js","../../node_modules/axios/lib/helpers/toFormData.js","../../node_modules/axios/lib/helpers/AxiosURLSearchParams.js","../../node_modules/axios/lib/helpers/buildURL.js","../../node_modules/axios/lib/core/InterceptorManager.js","../../node_modules/axios/lib/defaults/transitional.js","../../node_modules/axios/lib/platform/browser/classes/URLSearchParams.js","../../node_modules/axios/lib/platform/browser/classes/FormData.js","../../node_modules/axios/lib/platform/browser/classes/Blob.js","../../node_modules/axios/lib/platform/browser/index.js","../../node_modules/axios/lib/platform/common/utils.js","../../node_modules/axios/lib/platform/index.js","../../node_modules/axios/lib/helpers/toURLEncodedForm.js","../../node_modules/axios/lib/helpers/formDataToJSON.js","../../node_modules/axios/lib/defaults/index.js","../../node_modules/axios/lib/helpers/parseHeaders.js","../../node_modules/axios/lib/core/AxiosHeaders.js","../../node_modules/axios/lib/core/transformData.js","../../node_modules/axios/lib/cancel/isCancel.js","../../node_modules/axios/lib/cancel/CanceledError.js","../../node_modules/axios/lib/core/settle.js","../../node_modules/axios/lib/helpers/parseProtocol.js","../../node_modules/axios/lib/helpers/speedometer.js","../../node_modules/axios/lib/helpers/throttle.js","../../node_modules/axios/lib/helpers/progressEventReducer.js","../../node_modules/axios/lib/helpers/isURLSameOrigin.js","../../node_modules/axios/lib/helpers/cookies.js","../../node_modules/axios/lib/helpers/isAbsoluteURL.js","../../node_modules/axios/lib/helpers/combineURLs.js","../../node_modules/axios/lib/core/buildFullPath.js","../../node_modules/axios/lib/core/mergeConfig.js","../../node_modules/axios/lib/helpers/resolveConfig.js","../../node_modules/axios/lib/adapters/xhr.js","../../node_modules/axios/lib/helpers/composeSignals.js","../../node_modules/axios/lib/helpers/trackStream.js","../../node_modules/axios/lib/adapters/fetch.js","../../node_modules/axios/lib/adapters/adapters.js","../../node_modules/axios/lib/core/dispatchRequest.js","../../node_modules/axios/lib/env/data.js","../../node_modules/axios/lib/helpers/validator.js","../../node_modules/axios/lib/core/Axios.js","../../node_modules/axios/lib/cancel/CancelToken.js","../../node_modules/axios/lib/helpers/spread.js","../../node_modules/axios/lib/helpers/isAxiosError.js","../../node_modules/axios/lib/helpers/HttpStatusCode.js","../../node_modules/axios/lib/axios.js","../../node_modules/@intlify/shared/dist/shared.mjs","../../node_modules/@intlify/message-compiler/dist/message-compiler.mjs","../../node_modules/@intlify/core-base/dist/core-base.mjs","../../node_modules/vue-i18n/dist/vue-i18n.mjs","../../src/assets/lang/en.ts","../../src/assets/lang/ja.ts","../../src/i18n/index.ts","../../src/common/webrootProductName.ts","../../src/define.ts","../../node_modules/base64-js/index.js","../../node_modules/ieee754/index.js","../../node_modules/buffer/index.js","../../src/i18n/brandMapper.ts","../../src/common/productsBySku.ts","../../src/globalEnums.ts","../../src/common/formatKeycode.ts","../../src/components/notifications/AccountLockedOutNotification.vue","../../src/components/notifications/LoginFailedNotification.vue","../../src/common/getUrl.ts","../../src/components/notifications/AddFraudKeyNotification.vue","../../src/components/notifications/PendingEmailVerificationNotification.vue","../../src/components/notifications/PrimaryEmailVerificationWebrootNotification.vue","../../src/components/notifications/KeycodeExpiredNotification.vue","../../src/components/notifications/AddKeycodeNotification.vue","../../src/components/notifications/LastPassProvisionSuccessNotification.vue","../../src/components/notifications/RfaEncryptedNotification.vue","../../src/components/notifications/RfaExpiredNotification.vue","../../src/components/notifications/OptInToAutomaticVideoBackupSuccessNotification.vue","../../src/components/notifications/AutoRenewTurnOnSuccessNotification.vue","../../src/components/notifications/AutoRenewTurnOffSuccessNotification.vue","../../src/components/notifications/AMZSErrorNotification.vue","../../src/components/notifications/EmailAlreadyInUseNotification.vue","../../src/components/notifications/MovePaymentMethodMRToARNotification.vue","../../src/components/shared/SvgIcon/SvgIcon.vue","../../src/components/shared/SvgIcon/SvgIcon.html?vue&type=template&src=true&lang.js","../../src/components/Buy/BuyEnums.ts","../../src/stores/subscriptions.ts","../../src/components/notifications/AllstateExpiredNotification.vue","../../src/components/notifications/DoubleAllstatePremiumErrorNotification.vue","../../src/components/notifications/NonMigratedLegacyWebrootNotification.vue","../../src/components/notifications/NonZuoraEcommWebrootNotification.vue","../../src/stores/allstateSubscriptions.ts","../../src/components/Allstate/AllstateHelper.ts","../../src/components/notifications/AllstateUpgradeNotification.vue","../../src/components/notifications/AllstateNonUsNotification.vue","../../src/components/notifications/LicenseDaysRemainingNotification.vue","../../src/components/notifications/AutoRenewDiscountEnabledNotification.vue","../../src/components/notifications/VPNBuyflowLimitSingleItemDeadEnd.vue","../../src/stores/notifications.ts","../../src/common/handleApiError.ts","../../src/components/shared/LanguageSelector/LanguageSelector.ts","../../src/common/subscriptionHelper.ts","../../src/common/api/unifiedPortal/requests.ts","../../src/common/cpuDetect.ts","../../src/stores/siteSettings.ts","../../src/common/logout.ts","../../src/common/api/unifiedPortal/index.ts","../../src/common/index.ts","../../src/common/logger.ts","../../node_modules/json5/dist/index.mjs","../../src/common/helper.ts","../../src/common/config.ts","../../src/stores/config.ts","../../src/common/pendo.ts","../../src/stores/user.ts","../../src/common/showPaymentHistory.ts","../../src/stores/security.ts","../../src/common/userDetails.ts","../../src/common/reloadSubscriberInfo.ts","../../src/components/Home/index.ts","../../src/components/notifications/NotificationContent.vue","../../src/components/shared/Notifications.vue","../../src/components/shared/LoadingSpinner.vue","../../src/components/shared/TileWrapper.vue","../../src/components/shared/TileDetails.vue","../../src/components/Home/RequiresInstallOrPurchase.vue","../../src/components/Backup/purgedComputer.ts","../../src/components/Home/BackupOverview.vue","../../src/common/securityDevices.ts","../../src/common/bestBuy.ts","../../src/components/Home/SecurityOverview.vue","../../src/components/Home/SubscriptionOverview.vue","../../node_modules/@vueuse/shared/index.mjs","../../node_modules/@vueuse/core/index.mjs","../../node_modules/tabbable/dist/index.esm.js","../../node_modules/focus-trap/dist/focus-trap.esm.js","../../node_modules/@vueuse/integrations/useFocusTrap.mjs","../../node_modules/vue-final-modal/dist/index.es.mjs","../../src/components/shared/dialogs/enums.ts","../../src/components/shared/dialogs/ModalWrapper.vue","../../src/components/shared/Spinner.vue","../../src/stores/personalInfo.ts","../../src/components/shared/dialogs/VerifyPrimaryEmail/VerifyPrimaryEmailAddress.vue","../../src/components/shared/PrimaryEmailVerificationWrapper.vue","../../src/common/featureDisplayAccess.ts","../../src/components/Home/AllStateOverviewComponent.vue","../../src/components/shared/dialogs/ManageResellerControlRequest/ManageResellerControlRequest.vue","../../src/components/Home/Home.vue","../../src/common/landingPage.ts","../../src/common/refreshSubscriber.ts","../../src/components/Home/HomeRoute.vue","../../node_modules/vue-recaptcha/dist/vue-recaptcha.es.js","../../src/common/validator.ts","../../src/globalRegex.ts","../../src/common/webrootKeycodes.ts","../../src/common/strongPassword.ts","../../src/common/validateEmail.ts","../../src/common/loginRedirect.ts","../../src/components/shared/PasswordRules.vue","../../src/components/shared/InputError.vue","../../src/components/shared/BestBuySupportSection.vue","../../src/components/Account/create/CreateAccount.vue","../../node_modules/detect-browser/es/index.js","../../src/common/browserDetect.ts","../../src/common/passwordReset.ts","../../src/components/shared/KbSearch.vue","../../src/components/Backup/CardComputer/CardComputerEnums.ts","../../src/components/Backup/CardComputer/CardComputerConfig.ts","../../src/common/productList.ts","../../src/common/safeClient.ts","../../src/components/shared/dialogs/DownloadProduct/Products/Safe.vue","../../src/components/FileAccess/FileAccessEnums.ts","../../src/components/FileAccess/consumerServerComm.ts","../../src/components/FileAccess/ersoServerComm.ts","../../src/components/FileAccess/downloadFn.ts","../../src/components/FileAccess/selectionFn.ts","../../src/components/FileAccess/sortFn.ts","../../src/components/FileAccess/searchFn.ts","../../src/components/FileAccess/navigationFn.ts","../../src/components/FileAccess/diskFn.ts","../../src/components/FileAccess/viewFn.ts","../../src/components/FileAccess/imagePreviewFn.ts","../../src/components/FileAccess/paginationFn.ts","../../src/components/FileAccess/cssbServerComm.ts","../../src/components/FileAccess/serverComm.ts","../../src/components/FileAccess/sessionFn.ts","../../src/components/FileAccess/commonFn.ts","../../src/common/dateFormat.ts","../../src/components/Downloads/isKeycodeExpired.ts","../../src/components/Downloads/Keycodes.vue","../../src/components/shared/dialogs/DownloadProduct/Selector.vue","../../src/components/shared/dialogs/DownloadProduct/Products/WSAP.vue","../../src/components/shared/dialogs/DownloadProduct/Products/WWTS.vue","../../src/common/copyCurrentURL.ts","../../src/components/shared/dialogs/DownloadProduct/Products/WRMS.vue","../../src/components/shared/dialogs/DownloadProduct/Products/WSCB.vue","../../src/components/shared/dialogs/DownloadProduct/Products/WIFI.vue","../../src/components/shared/dialogs/DownloadProduct/Products/LPPM.vue","../../src/components/shared/dialogs/DownloadProduct/Products/WSVPN.vue","../../src/components/shared/dialogs/DownloadProduct/Products/WSVPNM.vue","../../src/components/shared/dialogs/DownloadProduct/Products/WPCO.vue","../../src/components/shared/dialogs/DownloadProduct/Products/WTP.vue","../../src/components/shared/dialogs/DownloadProduct/Products/SAFEMOBILE.vue","../../src/assets/img/app-store.png","../../src/assets/img/play-store.png","../../src/components/shared/dialogs/DownloadProduct/DownloadProduct.vue","../../src/components/Backup/CardComputer/WebrootLicenseCardComputer.vue","../../src/components/Backup/CardComputer/DeviceStatus.vue","../../src/components/Backup/MacToMacMoveSubscription.vue","../../src/components/Backup/MacToWindowsMoveSubscription.vue","../../src/components/Backup/WindowsMoveSubscription.vue","../../src/components/Backup/CrossPlatformTrialMoveSubscription.vue","../../src/components/Backup/CardComputer/MoveMySubscription.vue","../../src/components/Backup/CardComputer/AddEncryptionKey.vue","../../src/components/Backup/CardComputer/ComputerDropDown.vue","../../src/components/Subscriptions/AutoRenewTurnOff.vue","../../src/components/Subscriptions/AutoRenewTurnOn.vue","../../src/components/Subscriptions/AutoRenewOffSurvey.vue","../../src/components/Subscriptions/WebrootAutoRenewOffSurvey.vue","../../src/components/Subscriptions/WebrootARTurnOn.vue","../../src/components/Subscriptions/WebrootARTurnOff.vue","../../src/stores/autoRenewal.ts","../../src/components/shared/dialogs/AutoRenewOption/AutoRenewOption.vue","../../src/components/Backup/CardComputer/CardComputerConstants.ts","../../src/components/Backup/CardComputer/ProductDetails.vue","../../src/components/Backup/CardComputer/ComputerName.vue","../../src/components/Buy/commonFn.ts","../../src/stores/unauthorizedBuyflow.ts","../../src/components/Buy/Payment/PaymentConfigs.ts","../../src/stores/paymentPage.ts","../../src/common/googleTagEvents.ts","../../src/components/Buy/Payment/ShippingFormValidation.ts","../../src/stores/payPal.ts","../../src/common/GroupedProducts.ts","../../src/components/Buy/BuyHelper.ts","../../src/stores/buyFlow.ts","../../src/components/Backup/CardComputer/CardComputer.vue","../../src/components/shared/kbSearchWebroot.vue","../../src/stores/backupPage.ts","../../src/components/Backup/WebrootTotalProtectionNotInstalled.vue","../../src/components/Backup/WebrootTotalProtectionSection.vue","../../src/common/carboniteActivationCodes.ts","../../src/components/shared/dialogs/ApplyActivationCode/ApplyActivationCode.vue","../../src/components/Backup/ApplyFloatingSubscription.vue","../../src/common/formatComputerName.ts","../../src/components/Backup/UpgradeSubscription.vue","../../src/components/Backup/CardUninstalledSub.vue","../../src/components/Backup/CardWsacSafeLite.vue","../../src/components/Backup/DownloadSafe.vue","../../src/components/Backup/BuyOrTryCarbonite.vue","../../src/components/CreditCards/CreditCards.ts","../../src/common/ShippingStatesAndProvinces.ts","../../src/components/Buy/Payment/ShippingForm.vue","../../node_modules/@castleio/castle-js/dist/castle.js","../../src/components/shared/AddPaymentMethodComponent.vue","../../src/components/CreditCards/AddCreditCard.vue","../../src/components/Subscriptions/SafeProductsInfo.vue","../../src/components/Subscriptions/WebrootProductsInfo.vue","../../src/components/Buy/Payment/Payment.ts","../../src/components/Buy/Payment/SelectPaymentAddress.vue","../../src/components/Buy/Payment/SelectPayment.vue","../../src/components/Buy/Payment/PaymentTypeSelector.vue","../../src/components/Subscriptions/InvoiceDetails.vue","../../src/components/Backup/Backup.vue","../../src/components/Downloads/VerifyPrimaryEmailAddressCtn.vue","../../src/components/Downloads/AddKeycode.vue","../../src/assets/img/lastPass.png","../../src/components/shared/dialogs/LastPass/LastPassDialog.vue","../../src/components/Downloads/LastPassDownloadsTab.vue","../../src/components/Downloads/AllStateDownloadsTab.vue","../../src/components/Downloads/Downloads.vue","../../src/components/Downloads/DownloadsRoute.vue","../../src/components/PersonalInformation/SetUserFields.vue","../../src/components/PersonalInformation/SetUserPassword.vue","../../src/common/validateSecurityAnswer.ts","../../src/components/PersonalInformation/SetSecurityQuestions.vue","../../src/components/PersonalInformation/SetTwoStepVerification.vue","../../src/common/Language.ts","../../src/components/shared/LanguageDropDown/LanguageDropDown.vue","../../src/components/PersonalInformation/PreferredEmailLanguage.vue","../../src/common/phoneCodeHelper.ts","../../src/components/PersonalInformation/UpdateEmailAddress.vue","../../src/components/PersonalInformation/VerifyPendingEmailAddress.vue","../../src/components/PersonalInformation/VerifyExistingEmailAddress.vue","../../src/components/PersonalInformation/EmailSection.vue","../../src/components/PersonalInformation/PersonalInformation.vue","../../src/components/shared/LoadingBox.vue","../../src/components/Subscriptions/SubscriptionsEnums.ts","../../src/components/Subscriptions/CancelSubscription.vue","../../src/components/Subscriptions/ManageSubscriptionColumn.vue","../../src/components/Subscriptions/ProductColumn.vue","../../src/components/Subscriptions/NextPaymentColumn.vue","../../src/components/Subscriptions/PaymentMethodColumn.vue","../../src/components/Subscriptions/SafeOutstandingInvoiceMessage.vue","../../src/components/Subscriptions/WebrootOutstandingInvoiceMessage.vue","../../src/components/Subscriptions/OutstandingInvoiceAlert.vue","../../src/components/CreditCards/CardCredit.vue","../../src/components/shared/dialogs/AddVatNumber/AddVatNumber.vue","../../src/components/UnderMaintenance/UnderMaintenance.vue","../../src/components/Subscriptions/SubscriptionInformation.vue","../../src/components/payment/PaymentHistoryPageHelper.ts","../../src/components/payment/SafeInvoiceProductInfo.vue","../../src/components/payment/WebrootInvoiceProductInfo.vue","../../src/components/shared/dialogs/RefundCdlpConfirmation/InPlaceCdlpRefundConfirmation.vue","../../src/components/payment/PaymentHistory.vue","../../src/components/Account/setup/Verify2FA.vue","../../src/components/Account/setup/AccountSetupEnums.ts","../../src/components/Account/setup/AccountSetup.vue","../../src/components/Backup/GetFilesWizard.vue","../../src/components/Backup/GetFilesRoute.vue","../../src/components/Backup/GetFilesCdlp.vue","../../src/components/Backup/DownloadWebrootTotalProtection.vue","../../src/components/CreditCards/CreditCards.vue","../../src/components/support/CarboniteSupportSection.vue","../../src/components/support/WebrootSupportSection.vue","../../src/components/support/ExpiredSubSupportSection.vue","../../src/components/support/AllstateSupportSection.vue","../../src/components/support/Support.vue","../../src/components/Account/email/EmailVerification.vue","../../src/components/Account/email/EmailVerificationNotComplete.vue","../../src/components/FileAccess/ImagePreview.vue","../../src/components/shared/dialogs/FileAccess/PassPhraseDialog.vue","../../src/components/shared/dialogs/DownloadRestrictedFiles/DownloadRestrictedFiles.vue","../../src/components/FileAccess/FileAccess.vue","../../src/components/FileAccess/FileAccessRoute.vue","../../src/components/courier/Courier.vue","../../src/components/shared/MaskedInput.vue","../../src/common/usStates.ts","../../src/components/courier/CourierFormValidations.ts","../../src/components/courier/CourierRecovery.vue","../../../../../../spinner.gif","../../src/components/courier/CourierRecoveryRoute.vue","../../src/components/Security/SetDeviceNickname.vue","../../src/components/Security/RemoveDevice.vue","../../src/components/Security/Device.vue","../../src/components/Security/LastPassSecurityTab.vue","../../src/components/Security/DeviceTile.vue","../../src/components/Security/Security.vue","../../src/components/error/Error.vue","../../src/components/error/ErrorRoute.vue","../../src/routes/Unknown.vue","../../src/components/Allstate/AllstateFormValidations.ts","../../src/components/Allstate/AllstateSignUpForm.vue","../../src/components/Allstate/AllstateAlreadySignedUp.vue","../../src/components/Allstate/features.ts","../../src/components/Allstate/AllstateUpgrade.vue","../../src/components/Allstate/AllstateNotPurchased.vue","../../src/components/Allstate/AllstateEnums.ts","../../src/components/Allstate/AllstateSignUp.vue","../../src/components/Allstate/AllstateRoute.vue","../../src/components/FileAccess/FileAccessCSSBRoute.vue","../../src/components/FileAccess/ProgressCircle.vue","../../src/components/shared/dialogs/CSSBCancelDownload/CSSBCancelDownload.vue","../../src/components/FileAccess/cssbDownloadWatcher.vue","../../src/components/Buy/OrderConfirmation/CarboniteNextStepsMac.vue","../../src/assets/img/nextsteps-mac-1.png","../../src/assets/img/nextsteps-mac-2.png","../../src/assets/img/nextsteps-mac-3.png","../../src/components/Buy/OrderConfirmation/CarboniteNextStepsWindows.vue","../../src/assets/img/nextsteps-win-1.png","../../src/assets/img/nextsteps-win-2.png","../../src/assets/img/nextsteps-win-3.png","../../src/components/Buy/OrderConfirmation/CarboniteInstallationInstructions.vue","../../src/components/Buy/SelectPlanLink.vue","../../src/components/Buy/BuyProgressbar.vue","../../src/components/Buy/ReviewOrder/VatInput.vue","../../src/components/Buy/Adjustments.vue","../../src/components/Buy/QuantityStepper.vue","../../src/components/Buy/Dialogs/SpecialOffersInfo.vue","../../src/components/Buy/Cart/BundleItems.vue","../../src/components/Buy/Cart/NotableFeature.vue","../../src/components/Buy/Cart/CartItem.vue","../../src/components/Buy/Cart/UndoRemove.vue","../../src/components/Buy/Cart/Cart.vue","../../node_modules/recaptcha-v3/dist/ReCaptchaInstance.js","../../node_modules/recaptcha-v3/dist/ReCaptchaLoader.js","../../node_modules/recaptcha-v3/dist/ReCaptcha.js","../../src/common/ReCaptchaV3.ts","../../src/stores/emailPage.ts","../../src/components/Buy/Email/EnterEmail.vue","../../src/components/Buy/Email/Email.vue","../../src/components/Buy/Payment/AddCreditCard.vue","../../src/components/Buy/Payment/SelectedCreditCard.vue","../../src/components/Buy/Payment/PayPalPayment.vue","../../src/components/Buy/Payment/Payment.vue","../../src/components/Buy/ReviewOrder/PromoCode.vue","../../src/components/Buy/BuyDisclaimers.vue","../../src/components/Buy/Dialogs/AutomaticRenew.vue","../../src/components/Buy/Dialogs/CheckHasRecentPurchase.vue","../../src/components/Buy/ReviewOrder/DisplayShippingInfo.vue","../../src/components/Buy/ReviewOrder/DisplayPayPalShippingInfo.vue","../../src/common/bazaarVoiceEvents.ts","../../src/components/Buy/ReviewOrder/ReviewOrder.vue","../../src/components/Buy/ReviewOrder/EditShipping.vue","../../src/components/Buy/AccountCreditEarned.vue","../../src/components/Buy/SpecialOffers.vue","../../src/components/Buy/PhoneAssistance.vue","../../src/components/Buy/Payment/EditPayment.vue","../../src/components/Buy/ChangeStateBtn.vue","../../src/components/Buy/Buy.vue","../../src/components/Buy/SelectPlan/choosePlan.vue","../../src/components/Buy/SelectPlan/recommendedPlan.vue","../../src/components/Buy/SelectPlan/config.ts","../../src/components/Buy/SelectPlan/FeatureRow.vue","../../src/components/Buy/SelectPlan/Pricing.vue","../../src/components/Buy/Dialogs/MonthlyToAnnualWarning.vue","../../src/components/Buy/SelectPlan/SelectPlan.vue","../../src/components/Buy/FinalizeAccount/FinalizeAccount.vue","../../src/components/Buy/OrderConfirmation/Receipt.vue","../../src/components/Buy/OrderConfirmation/CarboniteProvisional.vue","../../src/components/Buy/OrderConfirmation/CarboniteRenewUpgrade.vue","../../src/components/Buy/OrderConfirmation/CarboniteEstablishedAccount.vue","../../src/components/Buy/OrderConfirmation/WebrootThanks.vue","../../src/components/Buy/OrderConfirmation/WebrootNextStepsEstablished.vue","../../src/components/Buy/OrderConfirmation/WebrootNextStepsProvisional.vue","../../src/components/Buy/OrderConfirmation/WebrootNextStepsAllstate.vue","../../src/components/Buy/OrderConfirmation/DownloadCards/WebrootChromebook.vue","../../src/components/Buy/OrderConfirmation/DownloadCards/WebrootSecureVPN.vue","../../src/components/Buy/OrderConfirmation/DownloadCards/WebrootSecureVPNP.vue","../../src/components/Buy/OrderConfirmation/DownloadCards/WebrootAllOthers.vue","../../src/components/Buy/OrderConfirmation/DownloadCards/WebrootSunsetProducts.vue","../../src/components/Buy/OrderConfirmation/DownloadCards/WebrootTotalProtection.vue","../../src/components/Buy/OrderConfirmation/DownloadCards/WebrootPcOptimizer.vue","../../src/components/Buy/OrderConfirmation/WebrootNextStepsRenewUpgrade.vue","../../src/components/Buy/OrderConfirmation/OrderConfirmation.vue","../../src/components/Account/CreateNtp/SetNewUserPassword/SetNewUserPassword.vue","../../src/components/PayPal/Return.vue","../../src/components/PayPal/Notify.vue","../../src/components/PayPal/Cancel.vue","../../src/components/PayPal/PayPalRedirect.vue","../../src/components/Buy/Errors/FlatRateOfferMismatch.vue","../../src/components/Buy/Errors/FlatRateExpiredLicense.vue","../../src/components/Buy/Errors/FlatRateRemainingDaysInvalid.vue","../../src/components/shared/WindowsArmInfo.vue","../../src/assets/img/ARMwin11.png","../../src/assets/img/ARMwin10.png","../../src/components/Buy/Errors/SafeLongExpiredComputer.vue","../../src/components/Buy/Errors/UpgradeNotAllowed.vue","../../src/components/Invoice/Invoice.vue","../../src/components/Buy/Errors/RenewCuidAlreadyPresentForWtp.vue","../../src/routes/index.ts","../../node_modules/maska/dist/maska.mjs","../../node_modules/maska/dist/vue.mjs","../../src/components/shared/LanguageSelector/LanguageSelector.vue","../../src/components/shared/Header.vue","../../src/components/shared/dialogs/UpgradeToPro/UpgradeToPro.vue","../../src/common/legacyWebroot.ts","../../src/components/shared/Sidebar.vue","../../src/components/shared/Footer.vue","../../src/components/shared/dialogs/AutoLogout/AutoLogout.vue","../../src/App.vue","../../src/main.ts"],"sourcesContent":["/**\n* @vue/shared v3.5.13\n* (c) 2018-present Yuxi (Evan) You and Vue contributors\n* @license MIT\n**/\n/*! #__NO_SIDE_EFFECTS__ */\n// @__NO_SIDE_EFFECTS__\nfunction makeMap(str) {\n const map = /* @__PURE__ */ Object.create(null);\n for (const key of str.split(\",\")) map[key] = 1;\n return (val) => val in map;\n}\n\nconst EMPTY_OBJ = !!(process.env.NODE_ENV !== \"production\") ? Object.freeze({}) : {};\nconst EMPTY_ARR = !!(process.env.NODE_ENV !== \"production\") ? Object.freeze([]) : [];\nconst NOOP = () => {\n};\nconst NO = () => false;\nconst isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter\n(key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);\nconst isModelListener = (key) => key.startsWith(\"onUpdate:\");\nconst extend = Object.assign;\nconst remove = (arr, el) => {\n const i = arr.indexOf(el);\n if (i > -1) {\n arr.splice(i, 1);\n }\n};\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\nconst hasOwn = (val, key) => hasOwnProperty.call(val, key);\nconst isArray = Array.isArray;\nconst isMap = (val) => toTypeString(val) === \"[object Map]\";\nconst isSet = (val) => toTypeString(val) === \"[object Set]\";\nconst isDate = (val) => toTypeString(val) === \"[object Date]\";\nconst isRegExp = (val) => toTypeString(val) === \"[object RegExp]\";\nconst isFunction = (val) => typeof val === \"function\";\nconst isString = (val) => typeof val === \"string\";\nconst isSymbol = (val) => typeof val === \"symbol\";\nconst isObject = (val) => val !== null && typeof val === \"object\";\nconst isPromise = (val) => {\n return (isObject(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch);\n};\nconst objectToString = Object.prototype.toString;\nconst toTypeString = (value) => objectToString.call(value);\nconst toRawType = (value) => {\n return toTypeString(value).slice(8, -1);\n};\nconst isPlainObject = (val) => toTypeString(val) === \"[object Object]\";\nconst isIntegerKey = (key) => isString(key) && key !== \"NaN\" && key[0] !== \"-\" && \"\" + parseInt(key, 10) === key;\nconst isReservedProp = /* @__PURE__ */ makeMap(\n // the leading comma is intentional so empty string \"\" is also included\n \",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted\"\n);\nconst isBuiltInDirective = /* @__PURE__ */ makeMap(\n \"bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo\"\n);\nconst cacheStringFunction = (fn) => {\n const cache = /* @__PURE__ */ Object.create(null);\n return (str) => {\n const hit = cache[str];\n return hit || (cache[str] = fn(str));\n };\n};\nconst camelizeRE = /-(\\w)/g;\nconst camelize = cacheStringFunction(\n (str) => {\n return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : \"\");\n }\n);\nconst hyphenateRE = /\\B([A-Z])/g;\nconst hyphenate = cacheStringFunction(\n (str) => str.replace(hyphenateRE, \"-$1\").toLowerCase()\n);\nconst capitalize = cacheStringFunction((str) => {\n return str.charAt(0).toUpperCase() + str.slice(1);\n});\nconst toHandlerKey = cacheStringFunction(\n (str) => {\n const s = str ? `on${capitalize(str)}` : ``;\n return s;\n }\n);\nconst hasChanged = (value, oldValue) => !Object.is(value, oldValue);\nconst invokeArrayFns = (fns, ...arg) => {\n for (let i = 0; i < fns.length; i++) {\n fns[i](...arg);\n }\n};\nconst def = (obj, key, value, writable = false) => {\n Object.defineProperty(obj, key, {\n configurable: true,\n enumerable: false,\n writable,\n value\n });\n};\nconst looseToNumber = (val) => {\n const n = parseFloat(val);\n return isNaN(n) ? val : n;\n};\nconst toNumber = (val) => {\n const n = isString(val) ? Number(val) : NaN;\n return isNaN(n) ? val : n;\n};\nlet _globalThis;\nconst getGlobalThis = () => {\n return _globalThis || (_globalThis = typeof globalThis !== \"undefined\" ? globalThis : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : typeof global !== \"undefined\" ? global : {});\n};\nconst identRE = /^[_$a-zA-Z\\xA0-\\uFFFF][_$a-zA-Z0-9\\xA0-\\uFFFF]*$/;\nfunction genPropsAccessExp(name) {\n return identRE.test(name) ? `__props.${name}` : `__props[${JSON.stringify(name)}]`;\n}\nfunction genCacheKey(source, options) {\n return source + JSON.stringify(\n options,\n (_, val) => typeof val === \"function\" ? val.toString() : val\n );\n}\n\nconst PatchFlags = {\n \"TEXT\": 1,\n \"1\": \"TEXT\",\n \"CLASS\": 2,\n \"2\": \"CLASS\",\n \"STYLE\": 4,\n \"4\": \"STYLE\",\n \"PROPS\": 8,\n \"8\": \"PROPS\",\n \"FULL_PROPS\": 16,\n \"16\": \"FULL_PROPS\",\n \"NEED_HYDRATION\": 32,\n \"32\": \"NEED_HYDRATION\",\n \"STABLE_FRAGMENT\": 64,\n \"64\": \"STABLE_FRAGMENT\",\n \"KEYED_FRAGMENT\": 128,\n \"128\": \"KEYED_FRAGMENT\",\n \"UNKEYED_FRAGMENT\": 256,\n \"256\": \"UNKEYED_FRAGMENT\",\n \"NEED_PATCH\": 512,\n \"512\": \"NEED_PATCH\",\n \"DYNAMIC_SLOTS\": 1024,\n \"1024\": \"DYNAMIC_SLOTS\",\n \"DEV_ROOT_FRAGMENT\": 2048,\n \"2048\": \"DEV_ROOT_FRAGMENT\",\n \"CACHED\": -1,\n \"-1\": \"CACHED\",\n \"BAIL\": -2,\n \"-2\": \"BAIL\"\n};\nconst PatchFlagNames = {\n [1]: `TEXT`,\n [2]: `CLASS`,\n [4]: `STYLE`,\n [8]: `PROPS`,\n [16]: `FULL_PROPS`,\n [32]: `NEED_HYDRATION`,\n [64]: `STABLE_FRAGMENT`,\n [128]: `KEYED_FRAGMENT`,\n [256]: `UNKEYED_FRAGMENT`,\n [512]: `NEED_PATCH`,\n [1024]: `DYNAMIC_SLOTS`,\n [2048]: `DEV_ROOT_FRAGMENT`,\n [-1]: `HOISTED`,\n [-2]: `BAIL`\n};\n\nconst ShapeFlags = {\n \"ELEMENT\": 1,\n \"1\": \"ELEMENT\",\n \"FUNCTIONAL_COMPONENT\": 2,\n \"2\": \"FUNCTIONAL_COMPONENT\",\n \"STATEFUL_COMPONENT\": 4,\n \"4\": \"STATEFUL_COMPONENT\",\n \"TEXT_CHILDREN\": 8,\n \"8\": \"TEXT_CHILDREN\",\n \"ARRAY_CHILDREN\": 16,\n \"16\": \"ARRAY_CHILDREN\",\n \"SLOTS_CHILDREN\": 32,\n \"32\": \"SLOTS_CHILDREN\",\n \"TELEPORT\": 64,\n \"64\": \"TELEPORT\",\n \"SUSPENSE\": 128,\n \"128\": \"SUSPENSE\",\n \"COMPONENT_SHOULD_KEEP_ALIVE\": 256,\n \"256\": \"COMPONENT_SHOULD_KEEP_ALIVE\",\n \"COMPONENT_KEPT_ALIVE\": 512,\n \"512\": \"COMPONENT_KEPT_ALIVE\",\n \"COMPONENT\": 6,\n \"6\": \"COMPONENT\"\n};\n\nconst SlotFlags = {\n \"STABLE\": 1,\n \"1\": \"STABLE\",\n \"DYNAMIC\": 2,\n \"2\": \"DYNAMIC\",\n \"FORWARDED\": 3,\n \"3\": \"FORWARDED\"\n};\nconst slotFlagsText = {\n [1]: \"STABLE\",\n [2]: \"DYNAMIC\",\n [3]: \"FORWARDED\"\n};\n\nconst GLOBALS_ALLOWED = \"Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol\";\nconst isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED);\nconst isGloballyWhitelisted = isGloballyAllowed;\n\nconst range = 2;\nfunction generateCodeFrame(source, start = 0, end = source.length) {\n start = Math.max(0, Math.min(start, source.length));\n end = Math.max(0, Math.min(end, source.length));\n if (start > end) return \"\";\n let lines = source.split(/(\\r?\\n)/);\n const newlineSequences = lines.filter((_, idx) => idx % 2 === 1);\n lines = lines.filter((_, idx) => idx % 2 === 0);\n let count = 0;\n const res = [];\n for (let i = 0; i < lines.length; i++) {\n count += lines[i].length + (newlineSequences[i] && newlineSequences[i].length || 0);\n if (count >= start) {\n for (let j = i - range; j <= i + range || end > count; j++) {\n if (j < 0 || j >= lines.length) continue;\n const line = j + 1;\n res.push(\n `${line}${\" \".repeat(Math.max(3 - String(line).length, 0))}| ${lines[j]}`\n );\n const lineLength = lines[j].length;\n const newLineSeqLength = newlineSequences[j] && newlineSequences[j].length || 0;\n if (j === i) {\n const pad = start - (count - (lineLength + newLineSeqLength));\n const length = Math.max(\n 1,\n end > count ? lineLength - pad : end - start\n );\n res.push(` | ` + \" \".repeat(pad) + \"^\".repeat(length));\n } else if (j > i) {\n if (end > count) {\n const length = Math.max(Math.min(end - count, lineLength), 1);\n res.push(` | ` + \"^\".repeat(length));\n }\n count += lineLength + newLineSeqLength;\n }\n }\n break;\n }\n }\n return res.join(\"\\n\");\n}\n\nfunction normalizeStyle(value) {\n if (isArray(value)) {\n const res = {};\n for (let i = 0; i < value.length; i++) {\n const item = value[i];\n const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item);\n if (normalized) {\n for (const key in normalized) {\n res[key] = normalized[key];\n }\n }\n }\n return res;\n } else if (isString(value) || isObject(value)) {\n return value;\n }\n}\nconst listDelimiterRE = /;(?![^(]*\\))/g;\nconst propertyDelimiterRE = /:([^]+)/;\nconst styleCommentRE = /\\/\\*[^]*?\\*\\//g;\nfunction parseStringStyle(cssText) {\n const ret = {};\n cssText.replace(styleCommentRE, \"\").split(listDelimiterRE).forEach((item) => {\n if (item) {\n const tmp = item.split(propertyDelimiterRE);\n tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());\n }\n });\n return ret;\n}\nfunction stringifyStyle(styles) {\n if (!styles) return \"\";\n if (isString(styles)) return styles;\n let ret = \"\";\n for (const key in styles) {\n const value = styles[key];\n if (isString(value) || typeof value === \"number\") {\n const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);\n ret += `${normalizedKey}:${value};`;\n }\n }\n return ret;\n}\nfunction normalizeClass(value) {\n let res = \"\";\n if (isString(value)) {\n res = value;\n } else if (isArray(value)) {\n for (let i = 0; i < value.length; i++) {\n const normalized = normalizeClass(value[i]);\n if (normalized) {\n res += normalized + \" \";\n }\n }\n } else if (isObject(value)) {\n for (const name in value) {\n if (value[name]) {\n res += name + \" \";\n }\n }\n }\n return res.trim();\n}\nfunction normalizeProps(props) {\n if (!props) return null;\n let { class: klass, style } = props;\n if (klass && !isString(klass)) {\n props.class = normalizeClass(klass);\n }\n if (style) {\n props.style = normalizeStyle(style);\n }\n return props;\n}\n\nconst HTML_TAGS = \"html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot\";\nconst SVG_TAGS = \"svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view\";\nconst MATH_TAGS = \"annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics\";\nconst VOID_TAGS = \"area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr\";\nconst isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);\nconst isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);\nconst isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);\nconst isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);\n\nconst specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;\nconst isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);\nconst isBooleanAttr = /* @__PURE__ */ makeMap(\n specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`\n);\nfunction includeBooleanAttr(value) {\n return !!value || value === \"\";\n}\nconst unsafeAttrCharRE = /[>/=\"'\\u0009\\u000a\\u000c\\u0020]/;\nconst attrValidationCache = {};\nfunction isSSRSafeAttrName(name) {\n if (attrValidationCache.hasOwnProperty(name)) {\n return attrValidationCache[name];\n }\n const isUnsafe = unsafeAttrCharRE.test(name);\n if (isUnsafe) {\n console.error(`unsafe attribute name: ${name}`);\n }\n return attrValidationCache[name] = !isUnsafe;\n}\nconst propsToAttrMap = {\n acceptCharset: \"accept-charset\",\n className: \"class\",\n htmlFor: \"for\",\n httpEquiv: \"http-equiv\"\n};\nconst isKnownHtmlAttr = /* @__PURE__ */ makeMap(\n `accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap`\n);\nconst isKnownSvgAttr = /* @__PURE__ */ makeMap(\n `xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan`\n);\nconst isKnownMathMLAttr = /* @__PURE__ */ makeMap(\n `accent,accentunder,actiontype,align,alignmentscope,altimg,altimg-height,altimg-valign,altimg-width,alttext,bevelled,close,columnsalign,columnlines,columnspan,denomalign,depth,dir,display,displaystyle,encoding,equalcolumns,equalrows,fence,fontstyle,fontweight,form,frame,framespacing,groupalign,height,href,id,indentalign,indentalignfirst,indentalignlast,indentshift,indentshiftfirst,indentshiftlast,indextype,justify,largetop,largeop,lquote,lspace,mathbackground,mathcolor,mathsize,mathvariant,maxsize,minlabelspacing,mode,other,overflow,position,rowalign,rowlines,rowspan,rquote,rspace,scriptlevel,scriptminsize,scriptsizemultiplier,selection,separator,separators,shift,side,src,stackalign,stretchy,subscriptshift,superscriptshift,symmetric,voffset,width,widths,xlink:href,xlink:show,xlink:type,xmlns`\n);\nfunction isRenderableAttrValue(value) {\n if (value == null) {\n return false;\n }\n const type = typeof value;\n return type === \"string\" || type === \"number\" || type === \"boolean\";\n}\n\nconst escapeRE = /[\"'&<>]/;\nfunction escapeHtml(string) {\n const str = \"\" + string;\n const match = escapeRE.exec(str);\n if (!match) {\n return str;\n }\n let html = \"\";\n let escaped;\n let index;\n let lastIndex = 0;\n for (index = match.index; index < str.length; index++) {\n switch (str.charCodeAt(index)) {\n case 34:\n escaped = \""\";\n break;\n case 38:\n escaped = \"&\";\n break;\n case 39:\n escaped = \"'\";\n break;\n case 60:\n escaped = \"<\";\n break;\n case 62:\n escaped = \">\";\n break;\n default:\n continue;\n }\n if (lastIndex !== index) {\n html += str.slice(lastIndex, index);\n }\n lastIndex = index + 1;\n html += escaped;\n }\n return lastIndex !== index ? html + str.slice(lastIndex, index) : html;\n}\nconst commentStripRE = /^-?>||--!>|?@[\\\\\\]^`{|}~]/g;\nfunction getEscapedCssVarName(key, doubleEscape) {\n return key.replace(\n cssVarNameEscapeSymbolsRE,\n (s) => doubleEscape ? s === '\"' ? '\\\\\\\\\\\\\"' : `\\\\\\\\${s}` : `\\\\${s}`\n );\n}\n\nfunction looseCompareArrays(a, b) {\n if (a.length !== b.length) return false;\n let equal = true;\n for (let i = 0; equal && i < a.length; i++) {\n equal = looseEqual(a[i], b[i]);\n }\n return equal;\n}\nfunction looseEqual(a, b) {\n if (a === b) return true;\n let aValidType = isDate(a);\n let bValidType = isDate(b);\n if (aValidType || bValidType) {\n return aValidType && bValidType ? a.getTime() === b.getTime() : false;\n }\n aValidType = isSymbol(a);\n bValidType = isSymbol(b);\n if (aValidType || bValidType) {\n return a === b;\n }\n aValidType = isArray(a);\n bValidType = isArray(b);\n if (aValidType || bValidType) {\n return aValidType && bValidType ? looseCompareArrays(a, b) : false;\n }\n aValidType = isObject(a);\n bValidType = isObject(b);\n if (aValidType || bValidType) {\n if (!aValidType || !bValidType) {\n return false;\n }\n const aKeysCount = Object.keys(a).length;\n const bKeysCount = Object.keys(b).length;\n if (aKeysCount !== bKeysCount) {\n return false;\n }\n for (const key in a) {\n const aHasKey = a.hasOwnProperty(key);\n const bHasKey = b.hasOwnProperty(key);\n if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) {\n return false;\n }\n }\n }\n return String(a) === String(b);\n}\nfunction looseIndexOf(arr, val) {\n return arr.findIndex((item) => looseEqual(item, val));\n}\n\nconst isRef = (val) => {\n return !!(val && val[\"__v_isRef\"] === true);\n};\nconst toDisplayString = (val) => {\n return isString(val) ? val : val == null ? \"\" : isArray(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? isRef(val) ? toDisplayString(val.value) : JSON.stringify(val, replacer, 2) : String(val);\n};\nconst replacer = (_key, val) => {\n if (isRef(val)) {\n return replacer(_key, val.value);\n } else if (isMap(val)) {\n return {\n [`Map(${val.size})`]: [...val.entries()].reduce(\n (entries, [key, val2], i) => {\n entries[stringifySymbol(key, i) + \" =>\"] = val2;\n return entries;\n },\n {}\n )\n };\n } else if (isSet(val)) {\n return {\n [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v))\n };\n } else if (isSymbol(val)) {\n return stringifySymbol(val);\n } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {\n return String(val);\n }\n return val;\n};\nconst stringifySymbol = (v, i = \"\") => {\n var _a;\n return (\n // Symbol.description in es2019+ so we need to cast here to pass\n // the lib: es2016 check\n isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v\n );\n};\n\nexport { EMPTY_ARR, EMPTY_OBJ, NO, NOOP, PatchFlagNames, PatchFlags, ShapeFlags, SlotFlags, camelize, capitalize, cssVarNameEscapeSymbolsRE, def, escapeHtml, escapeHtmlComment, extend, genCacheKey, genPropsAccessExp, generateCodeFrame, getEscapedCssVarName, getGlobalThis, hasChanged, hasOwn, hyphenate, includeBooleanAttr, invokeArrayFns, isArray, isBooleanAttr, isBuiltInDirective, isDate, isFunction, isGloballyAllowed, isGloballyWhitelisted, isHTMLTag, isIntegerKey, isKnownHtmlAttr, isKnownMathMLAttr, isKnownSvgAttr, isMap, isMathMLTag, isModelListener, isObject, isOn, isPlainObject, isPromise, isRegExp, isRenderableAttrValue, isReservedProp, isSSRSafeAttrName, isSVGTag, isSet, isSpecialBooleanAttr, isString, isSymbol, isVoidTag, looseEqual, looseIndexOf, looseToNumber, makeMap, normalizeClass, normalizeProps, normalizeStyle, objectToString, parseStringStyle, propsToAttrMap, remove, slotFlagsText, stringifyStyle, toDisplayString, toHandlerKey, toNumber, toRawType, toTypeString };\n","/**\n* @vue/reactivity v3.5.13\n* (c) 2018-present Yuxi (Evan) You and Vue contributors\n* @license MIT\n**/\nimport { hasChanged, extend, isArray, isIntegerKey, isSymbol, isMap, hasOwn, isObject, makeMap, toRawType, capitalize, def, isFunction, EMPTY_OBJ, isSet, isPlainObject, NOOP, remove } from '@vue/shared';\n\nfunction warn(msg, ...args) {\n console.warn(`[Vue warn] ${msg}`, ...args);\n}\n\nlet activeEffectScope;\nclass EffectScope {\n constructor(detached = false) {\n this.detached = detached;\n /**\n * @internal\n */\n this._active = true;\n /**\n * @internal\n */\n this.effects = [];\n /**\n * @internal\n */\n this.cleanups = [];\n this._isPaused = false;\n this.parent = activeEffectScope;\n if (!detached && activeEffectScope) {\n this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(\n this\n ) - 1;\n }\n }\n get active() {\n return this._active;\n }\n pause() {\n if (this._active) {\n this._isPaused = true;\n let i, l;\n if (this.scopes) {\n for (i = 0, l = this.scopes.length; i < l; i++) {\n this.scopes[i].pause();\n }\n }\n for (i = 0, l = this.effects.length; i < l; i++) {\n this.effects[i].pause();\n }\n }\n }\n /**\n * Resumes the effect scope, including all child scopes and effects.\n */\n resume() {\n if (this._active) {\n if (this._isPaused) {\n this._isPaused = false;\n let i, l;\n if (this.scopes) {\n for (i = 0, l = this.scopes.length; i < l; i++) {\n this.scopes[i].resume();\n }\n }\n for (i = 0, l = this.effects.length; i < l; i++) {\n this.effects[i].resume();\n }\n }\n }\n }\n run(fn) {\n if (this._active) {\n const currentEffectScope = activeEffectScope;\n try {\n activeEffectScope = this;\n return fn();\n } finally {\n activeEffectScope = currentEffectScope;\n }\n } else if (!!(process.env.NODE_ENV !== \"production\")) {\n warn(`cannot run an inactive effect scope.`);\n }\n }\n /**\n * This should only be called on non-detached scopes\n * @internal\n */\n on() {\n activeEffectScope = this;\n }\n /**\n * This should only be called on non-detached scopes\n * @internal\n */\n off() {\n activeEffectScope = this.parent;\n }\n stop(fromParent) {\n if (this._active) {\n this._active = false;\n let i, l;\n for (i = 0, l = this.effects.length; i < l; i++) {\n this.effects[i].stop();\n }\n this.effects.length = 0;\n for (i = 0, l = this.cleanups.length; i < l; i++) {\n this.cleanups[i]();\n }\n this.cleanups.length = 0;\n if (this.scopes) {\n for (i = 0, l = this.scopes.length; i < l; i++) {\n this.scopes[i].stop(true);\n }\n this.scopes.length = 0;\n }\n if (!this.detached && this.parent && !fromParent) {\n const last = this.parent.scopes.pop();\n if (last && last !== this) {\n this.parent.scopes[this.index] = last;\n last.index = this.index;\n }\n }\n this.parent = void 0;\n }\n }\n}\nfunction effectScope(detached) {\n return new EffectScope(detached);\n}\nfunction getCurrentScope() {\n return activeEffectScope;\n}\nfunction onScopeDispose(fn, failSilently = false) {\n if (activeEffectScope) {\n activeEffectScope.cleanups.push(fn);\n } else if (!!(process.env.NODE_ENV !== \"production\") && !failSilently) {\n warn(\n `onScopeDispose() is called when there is no active effect scope to be associated with.`\n );\n }\n}\n\nlet activeSub;\nconst EffectFlags = {\n \"ACTIVE\": 1,\n \"1\": \"ACTIVE\",\n \"RUNNING\": 2,\n \"2\": \"RUNNING\",\n \"TRACKING\": 4,\n \"4\": \"TRACKING\",\n \"NOTIFIED\": 8,\n \"8\": \"NOTIFIED\",\n \"DIRTY\": 16,\n \"16\": \"DIRTY\",\n \"ALLOW_RECURSE\": 32,\n \"32\": \"ALLOW_RECURSE\",\n \"PAUSED\": 64,\n \"64\": \"PAUSED\"\n};\nconst pausedQueueEffects = /* @__PURE__ */ new WeakSet();\nclass ReactiveEffect {\n constructor(fn) {\n this.fn = fn;\n /**\n * @internal\n */\n this.deps = void 0;\n /**\n * @internal\n */\n this.depsTail = void 0;\n /**\n * @internal\n */\n this.flags = 1 | 4;\n /**\n * @internal\n */\n this.next = void 0;\n /**\n * @internal\n */\n this.cleanup = void 0;\n this.scheduler = void 0;\n if (activeEffectScope && activeEffectScope.active) {\n activeEffectScope.effects.push(this);\n }\n }\n pause() {\n this.flags |= 64;\n }\n resume() {\n if (this.flags & 64) {\n this.flags &= ~64;\n if (pausedQueueEffects.has(this)) {\n pausedQueueEffects.delete(this);\n this.trigger();\n }\n }\n }\n /**\n * @internal\n */\n notify() {\n if (this.flags & 2 && !(this.flags & 32)) {\n return;\n }\n if (!(this.flags & 8)) {\n batch(this);\n }\n }\n run() {\n if (!(this.flags & 1)) {\n return this.fn();\n }\n this.flags |= 2;\n cleanupEffect(this);\n prepareDeps(this);\n const prevEffect = activeSub;\n const prevShouldTrack = shouldTrack;\n activeSub = this;\n shouldTrack = true;\n try {\n return this.fn();\n } finally {\n if (!!(process.env.NODE_ENV !== \"production\") && activeSub !== this) {\n warn(\n \"Active effect was not restored correctly - this is likely a Vue internal bug.\"\n );\n }\n cleanupDeps(this);\n activeSub = prevEffect;\n shouldTrack = prevShouldTrack;\n this.flags &= ~2;\n }\n }\n stop() {\n if (this.flags & 1) {\n for (let link = this.deps; link; link = link.nextDep) {\n removeSub(link);\n }\n this.deps = this.depsTail = void 0;\n cleanupEffect(this);\n this.onStop && this.onStop();\n this.flags &= ~1;\n }\n }\n trigger() {\n if (this.flags & 64) {\n pausedQueueEffects.add(this);\n } else if (this.scheduler) {\n this.scheduler();\n } else {\n this.runIfDirty();\n }\n }\n /**\n * @internal\n */\n runIfDirty() {\n if (isDirty(this)) {\n this.run();\n }\n }\n get dirty() {\n return isDirty(this);\n }\n}\nlet batchDepth = 0;\nlet batchedSub;\nlet batchedComputed;\nfunction batch(sub, isComputed = false) {\n sub.flags |= 8;\n if (isComputed) {\n sub.next = batchedComputed;\n batchedComputed = sub;\n return;\n }\n sub.next = batchedSub;\n batchedSub = sub;\n}\nfunction startBatch() {\n batchDepth++;\n}\nfunction endBatch() {\n if (--batchDepth > 0) {\n return;\n }\n if (batchedComputed) {\n let e = batchedComputed;\n batchedComputed = void 0;\n while (e) {\n const next = e.next;\n e.next = void 0;\n e.flags &= ~8;\n e = next;\n }\n }\n let error;\n while (batchedSub) {\n let e = batchedSub;\n batchedSub = void 0;\n while (e) {\n const next = e.next;\n e.next = void 0;\n e.flags &= ~8;\n if (e.flags & 1) {\n try {\n ;\n e.trigger();\n } catch (err) {\n if (!error) error = err;\n }\n }\n e = next;\n }\n }\n if (error) throw error;\n}\nfunction prepareDeps(sub) {\n for (let link = sub.deps; link; link = link.nextDep) {\n link.version = -1;\n link.prevActiveLink = link.dep.activeLink;\n link.dep.activeLink = link;\n }\n}\nfunction cleanupDeps(sub) {\n let head;\n let tail = sub.depsTail;\n let link = tail;\n while (link) {\n const prev = link.prevDep;\n if (link.version === -1) {\n if (link === tail) tail = prev;\n removeSub(link);\n removeDep(link);\n } else {\n head = link;\n }\n link.dep.activeLink = link.prevActiveLink;\n link.prevActiveLink = void 0;\n link = prev;\n }\n sub.deps = head;\n sub.depsTail = tail;\n}\nfunction isDirty(sub) {\n for (let link = sub.deps; link; link = link.nextDep) {\n if (link.dep.version !== link.version || link.dep.computed && (refreshComputed(link.dep.computed) || link.dep.version !== link.version)) {\n return true;\n }\n }\n if (sub._dirty) {\n return true;\n }\n return false;\n}\nfunction refreshComputed(computed) {\n if (computed.flags & 4 && !(computed.flags & 16)) {\n return;\n }\n computed.flags &= ~16;\n if (computed.globalVersion === globalVersion) {\n return;\n }\n computed.globalVersion = globalVersion;\n const dep = computed.dep;\n computed.flags |= 2;\n if (dep.version > 0 && !computed.isSSR && computed.deps && !isDirty(computed)) {\n computed.flags &= ~2;\n return;\n }\n const prevSub = activeSub;\n const prevShouldTrack = shouldTrack;\n activeSub = computed;\n shouldTrack = true;\n try {\n prepareDeps(computed);\n const value = computed.fn(computed._value);\n if (dep.version === 0 || hasChanged(value, computed._value)) {\n computed._value = value;\n dep.version++;\n }\n } catch (err) {\n dep.version++;\n throw err;\n } finally {\n activeSub = prevSub;\n shouldTrack = prevShouldTrack;\n cleanupDeps(computed);\n computed.flags &= ~2;\n }\n}\nfunction removeSub(link, soft = false) {\n const { dep, prevSub, nextSub } = link;\n if (prevSub) {\n prevSub.nextSub = nextSub;\n link.prevSub = void 0;\n }\n if (nextSub) {\n nextSub.prevSub = prevSub;\n link.nextSub = void 0;\n }\n if (!!(process.env.NODE_ENV !== \"production\") && dep.subsHead === link) {\n dep.subsHead = nextSub;\n }\n if (dep.subs === link) {\n dep.subs = prevSub;\n if (!prevSub && dep.computed) {\n dep.computed.flags &= ~4;\n for (let l = dep.computed.deps; l; l = l.nextDep) {\n removeSub(l, true);\n }\n }\n }\n if (!soft && !--dep.sc && dep.map) {\n dep.map.delete(dep.key);\n }\n}\nfunction removeDep(link) {\n const { prevDep, nextDep } = link;\n if (prevDep) {\n prevDep.nextDep = nextDep;\n link.prevDep = void 0;\n }\n if (nextDep) {\n nextDep.prevDep = prevDep;\n link.nextDep = void 0;\n }\n}\nfunction effect(fn, options) {\n if (fn.effect instanceof ReactiveEffect) {\n fn = fn.effect.fn;\n }\n const e = new ReactiveEffect(fn);\n if (options) {\n extend(e, options);\n }\n try {\n e.run();\n } catch (err) {\n e.stop();\n throw err;\n }\n const runner = e.run.bind(e);\n runner.effect = e;\n return runner;\n}\nfunction stop(runner) {\n runner.effect.stop();\n}\nlet shouldTrack = true;\nconst trackStack = [];\nfunction pauseTracking() {\n trackStack.push(shouldTrack);\n shouldTrack = false;\n}\nfunction enableTracking() {\n trackStack.push(shouldTrack);\n shouldTrack = true;\n}\nfunction resetTracking() {\n const last = trackStack.pop();\n shouldTrack = last === void 0 ? true : last;\n}\nfunction onEffectCleanup(fn, failSilently = false) {\n if (activeSub instanceof ReactiveEffect) {\n activeSub.cleanup = fn;\n } else if (!!(process.env.NODE_ENV !== \"production\") && !failSilently) {\n warn(\n `onEffectCleanup() was called when there was no active effect to associate with.`\n );\n }\n}\nfunction cleanupEffect(e) {\n const { cleanup } = e;\n e.cleanup = void 0;\n if (cleanup) {\n const prevSub = activeSub;\n activeSub = void 0;\n try {\n cleanup();\n } finally {\n activeSub = prevSub;\n }\n }\n}\n\nlet globalVersion = 0;\nclass Link {\n constructor(sub, dep) {\n this.sub = sub;\n this.dep = dep;\n this.version = dep.version;\n this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0;\n }\n}\nclass Dep {\n constructor(computed) {\n this.computed = computed;\n this.version = 0;\n /**\n * Link between this dep and the current active effect\n */\n this.activeLink = void 0;\n /**\n * Doubly linked list representing the subscribing effects (tail)\n */\n this.subs = void 0;\n /**\n * For object property deps cleanup\n */\n this.map = void 0;\n this.key = void 0;\n /**\n * Subscriber counter\n */\n this.sc = 0;\n if (!!(process.env.NODE_ENV !== \"production\")) {\n this.subsHead = void 0;\n }\n }\n track(debugInfo) {\n if (!activeSub || !shouldTrack || activeSub === this.computed) {\n return;\n }\n let link = this.activeLink;\n if (link === void 0 || link.sub !== activeSub) {\n link = this.activeLink = new Link(activeSub, this);\n if (!activeSub.deps) {\n activeSub.deps = activeSub.depsTail = link;\n } else {\n link.prevDep = activeSub.depsTail;\n activeSub.depsTail.nextDep = link;\n activeSub.depsTail = link;\n }\n addSub(link);\n } else if (link.version === -1) {\n link.version = this.version;\n if (link.nextDep) {\n const next = link.nextDep;\n next.prevDep = link.prevDep;\n if (link.prevDep) {\n link.prevDep.nextDep = next;\n }\n link.prevDep = activeSub.depsTail;\n link.nextDep = void 0;\n activeSub.depsTail.nextDep = link;\n activeSub.depsTail = link;\n if (activeSub.deps === link) {\n activeSub.deps = next;\n }\n }\n }\n if (!!(process.env.NODE_ENV !== \"production\") && activeSub.onTrack) {\n activeSub.onTrack(\n extend(\n {\n effect: activeSub\n },\n debugInfo\n )\n );\n }\n return link;\n }\n trigger(debugInfo) {\n this.version++;\n globalVersion++;\n this.notify(debugInfo);\n }\n notify(debugInfo) {\n startBatch();\n try {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n for (let head = this.subsHead; head; head = head.nextSub) {\n if (head.sub.onTrigger && !(head.sub.flags & 8)) {\n head.sub.onTrigger(\n extend(\n {\n effect: head.sub\n },\n debugInfo\n )\n );\n }\n }\n }\n for (let link = this.subs; link; link = link.prevSub) {\n if (link.sub.notify()) {\n ;\n link.sub.dep.notify();\n }\n }\n } finally {\n endBatch();\n }\n }\n}\nfunction addSub(link) {\n link.dep.sc++;\n if (link.sub.flags & 4) {\n const computed = link.dep.computed;\n if (computed && !link.dep.subs) {\n computed.flags |= 4 | 16;\n for (let l = computed.deps; l; l = l.nextDep) {\n addSub(l);\n }\n }\n const currentTail = link.dep.subs;\n if (currentTail !== link) {\n link.prevSub = currentTail;\n if (currentTail) currentTail.nextSub = link;\n }\n if (!!(process.env.NODE_ENV !== \"production\") && link.dep.subsHead === void 0) {\n link.dep.subsHead = link;\n }\n link.dep.subs = link;\n }\n}\nconst targetMap = /* @__PURE__ */ new WeakMap();\nconst ITERATE_KEY = Symbol(\n !!(process.env.NODE_ENV !== \"production\") ? \"Object iterate\" : \"\"\n);\nconst MAP_KEY_ITERATE_KEY = Symbol(\n !!(process.env.NODE_ENV !== \"production\") ? \"Map keys iterate\" : \"\"\n);\nconst ARRAY_ITERATE_KEY = Symbol(\n !!(process.env.NODE_ENV !== \"production\") ? \"Array iterate\" : \"\"\n);\nfunction track(target, type, key) {\n if (shouldTrack && activeSub) {\n let depsMap = targetMap.get(target);\n if (!depsMap) {\n targetMap.set(target, depsMap = /* @__PURE__ */ new Map());\n }\n let dep = depsMap.get(key);\n if (!dep) {\n depsMap.set(key, dep = new Dep());\n dep.map = depsMap;\n dep.key = key;\n }\n if (!!(process.env.NODE_ENV !== \"production\")) {\n dep.track({\n target,\n type,\n key\n });\n } else {\n dep.track();\n }\n }\n}\nfunction trigger(target, type, key, newValue, oldValue, oldTarget) {\n const depsMap = targetMap.get(target);\n if (!depsMap) {\n globalVersion++;\n return;\n }\n const run = (dep) => {\n if (dep) {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n dep.trigger({\n target,\n type,\n key,\n newValue,\n oldValue,\n oldTarget\n });\n } else {\n dep.trigger();\n }\n }\n };\n startBatch();\n if (type === \"clear\") {\n depsMap.forEach(run);\n } else {\n const targetIsArray = isArray(target);\n const isArrayIndex = targetIsArray && isIntegerKey(key);\n if (targetIsArray && key === \"length\") {\n const newLength = Number(newValue);\n depsMap.forEach((dep, key2) => {\n if (key2 === \"length\" || key2 === ARRAY_ITERATE_KEY || !isSymbol(key2) && key2 >= newLength) {\n run(dep);\n }\n });\n } else {\n if (key !== void 0 || depsMap.has(void 0)) {\n run(depsMap.get(key));\n }\n if (isArrayIndex) {\n run(depsMap.get(ARRAY_ITERATE_KEY));\n }\n switch (type) {\n case \"add\":\n if (!targetIsArray) {\n run(depsMap.get(ITERATE_KEY));\n if (isMap(target)) {\n run(depsMap.get(MAP_KEY_ITERATE_KEY));\n }\n } else if (isArrayIndex) {\n run(depsMap.get(\"length\"));\n }\n break;\n case \"delete\":\n if (!targetIsArray) {\n run(depsMap.get(ITERATE_KEY));\n if (isMap(target)) {\n run(depsMap.get(MAP_KEY_ITERATE_KEY));\n }\n }\n break;\n case \"set\":\n if (isMap(target)) {\n run(depsMap.get(ITERATE_KEY));\n }\n break;\n }\n }\n }\n endBatch();\n}\nfunction getDepFromReactive(object, key) {\n const depMap = targetMap.get(object);\n return depMap && depMap.get(key);\n}\n\nfunction reactiveReadArray(array) {\n const raw = toRaw(array);\n if (raw === array) return raw;\n track(raw, \"iterate\", ARRAY_ITERATE_KEY);\n return isShallow(array) ? raw : raw.map(toReactive);\n}\nfunction shallowReadArray(arr) {\n track(arr = toRaw(arr), \"iterate\", ARRAY_ITERATE_KEY);\n return arr;\n}\nconst arrayInstrumentations = {\n __proto__: null,\n [Symbol.iterator]() {\n return iterator(this, Symbol.iterator, toReactive);\n },\n concat(...args) {\n return reactiveReadArray(this).concat(\n ...args.map((x) => isArray(x) ? reactiveReadArray(x) : x)\n );\n },\n entries() {\n return iterator(this, \"entries\", (value) => {\n value[1] = toReactive(value[1]);\n return value;\n });\n },\n every(fn, thisArg) {\n return apply(this, \"every\", fn, thisArg, void 0, arguments);\n },\n filter(fn, thisArg) {\n return apply(this, \"filter\", fn, thisArg, (v) => v.map(toReactive), arguments);\n },\n find(fn, thisArg) {\n return apply(this, \"find\", fn, thisArg, toReactive, arguments);\n },\n findIndex(fn, thisArg) {\n return apply(this, \"findIndex\", fn, thisArg, void 0, arguments);\n },\n findLast(fn, thisArg) {\n return apply(this, \"findLast\", fn, thisArg, toReactive, arguments);\n },\n findLastIndex(fn, thisArg) {\n return apply(this, \"findLastIndex\", fn, thisArg, void 0, arguments);\n },\n // flat, flatMap could benefit from ARRAY_ITERATE but are not straight-forward to implement\n forEach(fn, thisArg) {\n return apply(this, \"forEach\", fn, thisArg, void 0, arguments);\n },\n includes(...args) {\n return searchProxy(this, \"includes\", args);\n },\n indexOf(...args) {\n return searchProxy(this, \"indexOf\", args);\n },\n join(separator) {\n return reactiveReadArray(this).join(separator);\n },\n // keys() iterator only reads `length`, no optimisation required\n lastIndexOf(...args) {\n return searchProxy(this, \"lastIndexOf\", args);\n },\n map(fn, thisArg) {\n return apply(this, \"map\", fn, thisArg, void 0, arguments);\n },\n pop() {\n return noTracking(this, \"pop\");\n },\n push(...args) {\n return noTracking(this, \"push\", args);\n },\n reduce(fn, ...args) {\n return reduce(this, \"reduce\", fn, args);\n },\n reduceRight(fn, ...args) {\n return reduce(this, \"reduceRight\", fn, args);\n },\n shift() {\n return noTracking(this, \"shift\");\n },\n // slice could use ARRAY_ITERATE but also seems to beg for range tracking\n some(fn, thisArg) {\n return apply(this, \"some\", fn, thisArg, void 0, arguments);\n },\n splice(...args) {\n return noTracking(this, \"splice\", args);\n },\n toReversed() {\n return reactiveReadArray(this).toReversed();\n },\n toSorted(comparer) {\n return reactiveReadArray(this).toSorted(comparer);\n },\n toSpliced(...args) {\n return reactiveReadArray(this).toSpliced(...args);\n },\n unshift(...args) {\n return noTracking(this, \"unshift\", args);\n },\n values() {\n return iterator(this, \"values\", toReactive);\n }\n};\nfunction iterator(self, method, wrapValue) {\n const arr = shallowReadArray(self);\n const iter = arr[method]();\n if (arr !== self && !isShallow(self)) {\n iter._next = iter.next;\n iter.next = () => {\n const result = iter._next();\n if (result.value) {\n result.value = wrapValue(result.value);\n }\n return result;\n };\n }\n return iter;\n}\nconst arrayProto = Array.prototype;\nfunction apply(self, method, fn, thisArg, wrappedRetFn, args) {\n const arr = shallowReadArray(self);\n const needsWrap = arr !== self && !isShallow(self);\n const methodFn = arr[method];\n if (methodFn !== arrayProto[method]) {\n const result2 = methodFn.apply(self, args);\n return needsWrap ? toReactive(result2) : result2;\n }\n let wrappedFn = fn;\n if (arr !== self) {\n if (needsWrap) {\n wrappedFn = function(item, index) {\n return fn.call(this, toReactive(item), index, self);\n };\n } else if (fn.length > 2) {\n wrappedFn = function(item, index) {\n return fn.call(this, item, index, self);\n };\n }\n }\n const result = methodFn.call(arr, wrappedFn, thisArg);\n return needsWrap && wrappedRetFn ? wrappedRetFn(result) : result;\n}\nfunction reduce(self, method, fn, args) {\n const arr = shallowReadArray(self);\n let wrappedFn = fn;\n if (arr !== self) {\n if (!isShallow(self)) {\n wrappedFn = function(acc, item, index) {\n return fn.call(this, acc, toReactive(item), index, self);\n };\n } else if (fn.length > 3) {\n wrappedFn = function(acc, item, index) {\n return fn.call(this, acc, item, index, self);\n };\n }\n }\n return arr[method](wrappedFn, ...args);\n}\nfunction searchProxy(self, method, args) {\n const arr = toRaw(self);\n track(arr, \"iterate\", ARRAY_ITERATE_KEY);\n const res = arr[method](...args);\n if ((res === -1 || res === false) && isProxy(args[0])) {\n args[0] = toRaw(args[0]);\n return arr[method](...args);\n }\n return res;\n}\nfunction noTracking(self, method, args = []) {\n pauseTracking();\n startBatch();\n const res = toRaw(self)[method].apply(self, args);\n endBatch();\n resetTracking();\n return res;\n}\n\nconst isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);\nconst builtInSymbols = new Set(\n /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== \"arguments\" && key !== \"caller\").map((key) => Symbol[key]).filter(isSymbol)\n);\nfunction hasOwnProperty(key) {\n if (!isSymbol(key)) key = String(key);\n const obj = toRaw(this);\n track(obj, \"has\", key);\n return obj.hasOwnProperty(key);\n}\nclass BaseReactiveHandler {\n constructor(_isReadonly = false, _isShallow = false) {\n this._isReadonly = _isReadonly;\n this._isShallow = _isShallow;\n }\n get(target, key, receiver) {\n if (key === \"__v_skip\") return target[\"__v_skip\"];\n const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow;\n if (key === \"__v_isReactive\") {\n return !isReadonly2;\n } else if (key === \"__v_isReadonly\") {\n return isReadonly2;\n } else if (key === \"__v_isShallow\") {\n return isShallow2;\n } else if (key === \"__v_raw\") {\n if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype\n // this means the receiver is a user proxy of the reactive proxy\n Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {\n return target;\n }\n return;\n }\n const targetIsArray = isArray(target);\n if (!isReadonly2) {\n let fn;\n if (targetIsArray && (fn = arrayInstrumentations[key])) {\n return fn;\n }\n if (key === \"hasOwnProperty\") {\n return hasOwnProperty;\n }\n }\n const res = Reflect.get(\n target,\n key,\n // if this is a proxy wrapping a ref, return methods using the raw ref\n // as receiver so that we don't have to call `toRaw` on the ref in all\n // its class methods\n isRef(target) ? target : receiver\n );\n if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {\n return res;\n }\n if (!isReadonly2) {\n track(target, \"get\", key);\n }\n if (isShallow2) {\n return res;\n }\n if (isRef(res)) {\n return targetIsArray && isIntegerKey(key) ? res : res.value;\n }\n if (isObject(res)) {\n return isReadonly2 ? readonly(res) : reactive(res);\n }\n return res;\n }\n}\nclass MutableReactiveHandler extends BaseReactiveHandler {\n constructor(isShallow2 = false) {\n super(false, isShallow2);\n }\n set(target, key, value, receiver) {\n let oldValue = target[key];\n if (!this._isShallow) {\n const isOldValueReadonly = isReadonly(oldValue);\n if (!isShallow(value) && !isReadonly(value)) {\n oldValue = toRaw(oldValue);\n value = toRaw(value);\n }\n if (!isArray(target) && isRef(oldValue) && !isRef(value)) {\n if (isOldValueReadonly) {\n return false;\n } else {\n oldValue.value = value;\n return true;\n }\n }\n }\n const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key);\n const result = Reflect.set(\n target,\n key,\n value,\n isRef(target) ? target : receiver\n );\n if (target === toRaw(receiver)) {\n if (!hadKey) {\n trigger(target, \"add\", key, value);\n } else if (hasChanged(value, oldValue)) {\n trigger(target, \"set\", key, value, oldValue);\n }\n }\n return result;\n }\n deleteProperty(target, key) {\n const hadKey = hasOwn(target, key);\n const oldValue = target[key];\n const result = Reflect.deleteProperty(target, key);\n if (result && hadKey) {\n trigger(target, \"delete\", key, void 0, oldValue);\n }\n return result;\n }\n has(target, key) {\n const result = Reflect.has(target, key);\n if (!isSymbol(key) || !builtInSymbols.has(key)) {\n track(target, \"has\", key);\n }\n return result;\n }\n ownKeys(target) {\n track(\n target,\n \"iterate\",\n isArray(target) ? \"length\" : ITERATE_KEY\n );\n return Reflect.ownKeys(target);\n }\n}\nclass ReadonlyReactiveHandler extends BaseReactiveHandler {\n constructor(isShallow2 = false) {\n super(true, isShallow2);\n }\n set(target, key) {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n warn(\n `Set operation on key \"${String(key)}\" failed: target is readonly.`,\n target\n );\n }\n return true;\n }\n deleteProperty(target, key) {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n warn(\n `Delete operation on key \"${String(key)}\" failed: target is readonly.`,\n target\n );\n }\n return true;\n }\n}\nconst mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler();\nconst readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler();\nconst shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(true);\nconst shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true);\n\nconst toShallow = (value) => value;\nconst getProto = (v) => Reflect.getPrototypeOf(v);\nfunction createIterableMethod(method, isReadonly2, isShallow2) {\n return function(...args) {\n const target = this[\"__v_raw\"];\n const rawTarget = toRaw(target);\n const targetIsMap = isMap(rawTarget);\n const isPair = method === \"entries\" || method === Symbol.iterator && targetIsMap;\n const isKeyOnly = method === \"keys\" && targetIsMap;\n const innerIterator = target[method](...args);\n const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;\n !isReadonly2 && track(\n rawTarget,\n \"iterate\",\n isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY\n );\n return {\n // iterator protocol\n next() {\n const { value, done } = innerIterator.next();\n return done ? { value, done } : {\n value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),\n done\n };\n },\n // iterable protocol\n [Symbol.iterator]() {\n return this;\n }\n };\n };\n}\nfunction createReadonlyMethod(type) {\n return function(...args) {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n const key = args[0] ? `on key \"${args[0]}\" ` : ``;\n warn(\n `${capitalize(type)} operation ${key}failed: target is readonly.`,\n toRaw(this)\n );\n }\n return type === \"delete\" ? false : type === \"clear\" ? void 0 : this;\n };\n}\nfunction createInstrumentations(readonly, shallow) {\n const instrumentations = {\n get(key) {\n const target = this[\"__v_raw\"];\n const rawTarget = toRaw(target);\n const rawKey = toRaw(key);\n if (!readonly) {\n if (hasChanged(key, rawKey)) {\n track(rawTarget, \"get\", key);\n }\n track(rawTarget, \"get\", rawKey);\n }\n const { has } = getProto(rawTarget);\n const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive;\n if (has.call(rawTarget, key)) {\n return wrap(target.get(key));\n } else if (has.call(rawTarget, rawKey)) {\n return wrap(target.get(rawKey));\n } else if (target !== rawTarget) {\n target.get(key);\n }\n },\n get size() {\n const target = this[\"__v_raw\"];\n !readonly && track(toRaw(target), \"iterate\", ITERATE_KEY);\n return Reflect.get(target, \"size\", target);\n },\n has(key) {\n const target = this[\"__v_raw\"];\n const rawTarget = toRaw(target);\n const rawKey = toRaw(key);\n if (!readonly) {\n if (hasChanged(key, rawKey)) {\n track(rawTarget, \"has\", key);\n }\n track(rawTarget, \"has\", rawKey);\n }\n return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);\n },\n forEach(callback, thisArg) {\n const observed = this;\n const target = observed[\"__v_raw\"];\n const rawTarget = toRaw(target);\n const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive;\n !readonly && track(rawTarget, \"iterate\", ITERATE_KEY);\n return target.forEach((value, key) => {\n return callback.call(thisArg, wrap(value), wrap(key), observed);\n });\n }\n };\n extend(\n instrumentations,\n readonly ? {\n add: createReadonlyMethod(\"add\"),\n set: createReadonlyMethod(\"set\"),\n delete: createReadonlyMethod(\"delete\"),\n clear: createReadonlyMethod(\"clear\")\n } : {\n add(value) {\n if (!shallow && !isShallow(value) && !isReadonly(value)) {\n value = toRaw(value);\n }\n const target = toRaw(this);\n const proto = getProto(target);\n const hadKey = proto.has.call(target, value);\n if (!hadKey) {\n target.add(value);\n trigger(target, \"add\", value, value);\n }\n return this;\n },\n set(key, value) {\n if (!shallow && !isShallow(value) && !isReadonly(value)) {\n value = toRaw(value);\n }\n const target = toRaw(this);\n const { has, get } = getProto(target);\n let hadKey = has.call(target, key);\n if (!hadKey) {\n key = toRaw(key);\n hadKey = has.call(target, key);\n } else if (!!(process.env.NODE_ENV !== \"production\")) {\n checkIdentityKeys(target, has, key);\n }\n const oldValue = get.call(target, key);\n target.set(key, value);\n if (!hadKey) {\n trigger(target, \"add\", key, value);\n } else if (hasChanged(value, oldValue)) {\n trigger(target, \"set\", key, value, oldValue);\n }\n return this;\n },\n delete(key) {\n const target = toRaw(this);\n const { has, get } = getProto(target);\n let hadKey = has.call(target, key);\n if (!hadKey) {\n key = toRaw(key);\n hadKey = has.call(target, key);\n } else if (!!(process.env.NODE_ENV !== \"production\")) {\n checkIdentityKeys(target, has, key);\n }\n const oldValue = get ? get.call(target, key) : void 0;\n const result = target.delete(key);\n if (hadKey) {\n trigger(target, \"delete\", key, void 0, oldValue);\n }\n return result;\n },\n clear() {\n const target = toRaw(this);\n const hadItems = target.size !== 0;\n const oldTarget = !!(process.env.NODE_ENV !== \"production\") ? isMap(target) ? new Map(target) : new Set(target) : void 0;\n const result = target.clear();\n if (hadItems) {\n trigger(\n target,\n \"clear\",\n void 0,\n void 0,\n oldTarget\n );\n }\n return result;\n }\n }\n );\n const iteratorMethods = [\n \"keys\",\n \"values\",\n \"entries\",\n Symbol.iterator\n ];\n iteratorMethods.forEach((method) => {\n instrumentations[method] = createIterableMethod(method, readonly, shallow);\n });\n return instrumentations;\n}\nfunction createInstrumentationGetter(isReadonly2, shallow) {\n const instrumentations = createInstrumentations(isReadonly2, shallow);\n return (target, key, receiver) => {\n if (key === \"__v_isReactive\") {\n return !isReadonly2;\n } else if (key === \"__v_isReadonly\") {\n return isReadonly2;\n } else if (key === \"__v_raw\") {\n return target;\n }\n return Reflect.get(\n hasOwn(instrumentations, key) && key in target ? instrumentations : target,\n key,\n receiver\n );\n };\n}\nconst mutableCollectionHandlers = {\n get: /* @__PURE__ */ createInstrumentationGetter(false, false)\n};\nconst shallowCollectionHandlers = {\n get: /* @__PURE__ */ createInstrumentationGetter(false, true)\n};\nconst readonlyCollectionHandlers = {\n get: /* @__PURE__ */ createInstrumentationGetter(true, false)\n};\nconst shallowReadonlyCollectionHandlers = {\n get: /* @__PURE__ */ createInstrumentationGetter(true, true)\n};\nfunction checkIdentityKeys(target, has, key) {\n const rawKey = toRaw(key);\n if (rawKey !== key && has.call(target, rawKey)) {\n const type = toRawType(target);\n warn(\n `Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`\n );\n }\n}\n\nconst reactiveMap = /* @__PURE__ */ new WeakMap();\nconst shallowReactiveMap = /* @__PURE__ */ new WeakMap();\nconst readonlyMap = /* @__PURE__ */ new WeakMap();\nconst shallowReadonlyMap = /* @__PURE__ */ new WeakMap();\nfunction targetTypeMap(rawType) {\n switch (rawType) {\n case \"Object\":\n case \"Array\":\n return 1 /* COMMON */;\n case \"Map\":\n case \"Set\":\n case \"WeakMap\":\n case \"WeakSet\":\n return 2 /* COLLECTION */;\n default:\n return 0 /* INVALID */;\n }\n}\nfunction getTargetType(value) {\n return value[\"__v_skip\"] || !Object.isExtensible(value) ? 0 /* INVALID */ : targetTypeMap(toRawType(value));\n}\nfunction reactive(target) {\n if (isReadonly(target)) {\n return target;\n }\n return createReactiveObject(\n target,\n false,\n mutableHandlers,\n mutableCollectionHandlers,\n reactiveMap\n );\n}\nfunction shallowReactive(target) {\n return createReactiveObject(\n target,\n false,\n shallowReactiveHandlers,\n shallowCollectionHandlers,\n shallowReactiveMap\n );\n}\nfunction readonly(target) {\n return createReactiveObject(\n target,\n true,\n readonlyHandlers,\n readonlyCollectionHandlers,\n readonlyMap\n );\n}\nfunction shallowReadonly(target) {\n return createReactiveObject(\n target,\n true,\n shallowReadonlyHandlers,\n shallowReadonlyCollectionHandlers,\n shallowReadonlyMap\n );\n}\nfunction createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {\n if (!isObject(target)) {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n warn(\n `value cannot be made ${isReadonly2 ? \"readonly\" : \"reactive\"}: ${String(\n target\n )}`\n );\n }\n return target;\n }\n if (target[\"__v_raw\"] && !(isReadonly2 && target[\"__v_isReactive\"])) {\n return target;\n }\n const existingProxy = proxyMap.get(target);\n if (existingProxy) {\n return existingProxy;\n }\n const targetType = getTargetType(target);\n if (targetType === 0 /* INVALID */) {\n return target;\n }\n const proxy = new Proxy(\n target,\n targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers\n );\n proxyMap.set(target, proxy);\n return proxy;\n}\nfunction isReactive(value) {\n if (isReadonly(value)) {\n return isReactive(value[\"__v_raw\"]);\n }\n return !!(value && value[\"__v_isReactive\"]);\n}\nfunction isReadonly(value) {\n return !!(value && value[\"__v_isReadonly\"]);\n}\nfunction isShallow(value) {\n return !!(value && value[\"__v_isShallow\"]);\n}\nfunction isProxy(value) {\n return value ? !!value[\"__v_raw\"] : false;\n}\nfunction toRaw(observed) {\n const raw = observed && observed[\"__v_raw\"];\n return raw ? toRaw(raw) : observed;\n}\nfunction markRaw(value) {\n if (!hasOwn(value, \"__v_skip\") && Object.isExtensible(value)) {\n def(value, \"__v_skip\", true);\n }\n return value;\n}\nconst toReactive = (value) => isObject(value) ? reactive(value) : value;\nconst toReadonly = (value) => isObject(value) ? readonly(value) : value;\n\nfunction isRef(r) {\n return r ? r[\"__v_isRef\"] === true : false;\n}\nfunction ref(value) {\n return createRef(value, false);\n}\nfunction shallowRef(value) {\n return createRef(value, true);\n}\nfunction createRef(rawValue, shallow) {\n if (isRef(rawValue)) {\n return rawValue;\n }\n return new RefImpl(rawValue, shallow);\n}\nclass RefImpl {\n constructor(value, isShallow2) {\n this.dep = new Dep();\n this[\"__v_isRef\"] = true;\n this[\"__v_isShallow\"] = false;\n this._rawValue = isShallow2 ? value : toRaw(value);\n this._value = isShallow2 ? value : toReactive(value);\n this[\"__v_isShallow\"] = isShallow2;\n }\n get value() {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n this.dep.track({\n target: this,\n type: \"get\",\n key: \"value\"\n });\n } else {\n this.dep.track();\n }\n return this._value;\n }\n set value(newValue) {\n const oldValue = this._rawValue;\n const useDirectValue = this[\"__v_isShallow\"] || isShallow(newValue) || isReadonly(newValue);\n newValue = useDirectValue ? newValue : toRaw(newValue);\n if (hasChanged(newValue, oldValue)) {\n this._rawValue = newValue;\n this._value = useDirectValue ? newValue : toReactive(newValue);\n if (!!(process.env.NODE_ENV !== \"production\")) {\n this.dep.trigger({\n target: this,\n type: \"set\",\n key: \"value\",\n newValue,\n oldValue\n });\n } else {\n this.dep.trigger();\n }\n }\n }\n}\nfunction triggerRef(ref2) {\n if (ref2.dep) {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n ref2.dep.trigger({\n target: ref2,\n type: \"set\",\n key: \"value\",\n newValue: ref2._value\n });\n } else {\n ref2.dep.trigger();\n }\n }\n}\nfunction unref(ref2) {\n return isRef(ref2) ? ref2.value : ref2;\n}\nfunction toValue(source) {\n return isFunction(source) ? source() : unref(source);\n}\nconst shallowUnwrapHandlers = {\n get: (target, key, receiver) => key === \"__v_raw\" ? target : unref(Reflect.get(target, key, receiver)),\n set: (target, key, value, receiver) => {\n const oldValue = target[key];\n if (isRef(oldValue) && !isRef(value)) {\n oldValue.value = value;\n return true;\n } else {\n return Reflect.set(target, key, value, receiver);\n }\n }\n};\nfunction proxyRefs(objectWithRefs) {\n return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);\n}\nclass CustomRefImpl {\n constructor(factory) {\n this[\"__v_isRef\"] = true;\n this._value = void 0;\n const dep = this.dep = new Dep();\n const { get, set } = factory(dep.track.bind(dep), dep.trigger.bind(dep));\n this._get = get;\n this._set = set;\n }\n get value() {\n return this._value = this._get();\n }\n set value(newVal) {\n this._set(newVal);\n }\n}\nfunction customRef(factory) {\n return new CustomRefImpl(factory);\n}\nfunction toRefs(object) {\n if (!!(process.env.NODE_ENV !== \"production\") && !isProxy(object)) {\n warn(`toRefs() expects a reactive object but received a plain one.`);\n }\n const ret = isArray(object) ? new Array(object.length) : {};\n for (const key in object) {\n ret[key] = propertyToRef(object, key);\n }\n return ret;\n}\nclass ObjectRefImpl {\n constructor(_object, _key, _defaultValue) {\n this._object = _object;\n this._key = _key;\n this._defaultValue = _defaultValue;\n this[\"__v_isRef\"] = true;\n this._value = void 0;\n }\n get value() {\n const val = this._object[this._key];\n return this._value = val === void 0 ? this._defaultValue : val;\n }\n set value(newVal) {\n this._object[this._key] = newVal;\n }\n get dep() {\n return getDepFromReactive(toRaw(this._object), this._key);\n }\n}\nclass GetterRefImpl {\n constructor(_getter) {\n this._getter = _getter;\n this[\"__v_isRef\"] = true;\n this[\"__v_isReadonly\"] = true;\n this._value = void 0;\n }\n get value() {\n return this._value = this._getter();\n }\n}\nfunction toRef(source, key, defaultValue) {\n if (isRef(source)) {\n return source;\n } else if (isFunction(source)) {\n return new GetterRefImpl(source);\n } else if (isObject(source) && arguments.length > 1) {\n return propertyToRef(source, key, defaultValue);\n } else {\n return ref(source);\n }\n}\nfunction propertyToRef(source, key, defaultValue) {\n const val = source[key];\n return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue);\n}\n\nclass ComputedRefImpl {\n constructor(fn, setter, isSSR) {\n this.fn = fn;\n this.setter = setter;\n /**\n * @internal\n */\n this._value = void 0;\n /**\n * @internal\n */\n this.dep = new Dep(this);\n /**\n * @internal\n */\n this.__v_isRef = true;\n // TODO isolatedDeclarations \"__v_isReadonly\"\n // A computed is also a subscriber that tracks other deps\n /**\n * @internal\n */\n this.deps = void 0;\n /**\n * @internal\n */\n this.depsTail = void 0;\n /**\n * @internal\n */\n this.flags = 16;\n /**\n * @internal\n */\n this.globalVersion = globalVersion - 1;\n /**\n * @internal\n */\n this.next = void 0;\n // for backwards compat\n this.effect = this;\n this[\"__v_isReadonly\"] = !setter;\n this.isSSR = isSSR;\n }\n /**\n * @internal\n */\n notify() {\n this.flags |= 16;\n if (!(this.flags & 8) && // avoid infinite self recursion\n activeSub !== this) {\n batch(this, true);\n return true;\n } else if (!!(process.env.NODE_ENV !== \"production\")) ;\n }\n get value() {\n const link = !!(process.env.NODE_ENV !== \"production\") ? this.dep.track({\n target: this,\n type: \"get\",\n key: \"value\"\n }) : this.dep.track();\n refreshComputed(this);\n if (link) {\n link.version = this.dep.version;\n }\n return this._value;\n }\n set value(newValue) {\n if (this.setter) {\n this.setter(newValue);\n } else if (!!(process.env.NODE_ENV !== \"production\")) {\n warn(\"Write operation failed: computed value is readonly\");\n }\n }\n}\nfunction computed(getterOrOptions, debugOptions, isSSR = false) {\n let getter;\n let setter;\n if (isFunction(getterOrOptions)) {\n getter = getterOrOptions;\n } else {\n getter = getterOrOptions.get;\n setter = getterOrOptions.set;\n }\n const cRef = new ComputedRefImpl(getter, setter, isSSR);\n if (!!(process.env.NODE_ENV !== \"production\") && debugOptions && !isSSR) {\n cRef.onTrack = debugOptions.onTrack;\n cRef.onTrigger = debugOptions.onTrigger;\n }\n return cRef;\n}\n\nconst TrackOpTypes = {\n \"GET\": \"get\",\n \"HAS\": \"has\",\n \"ITERATE\": \"iterate\"\n};\nconst TriggerOpTypes = {\n \"SET\": \"set\",\n \"ADD\": \"add\",\n \"DELETE\": \"delete\",\n \"CLEAR\": \"clear\"\n};\nconst ReactiveFlags = {\n \"SKIP\": \"__v_skip\",\n \"IS_REACTIVE\": \"__v_isReactive\",\n \"IS_READONLY\": \"__v_isReadonly\",\n \"IS_SHALLOW\": \"__v_isShallow\",\n \"RAW\": \"__v_raw\",\n \"IS_REF\": \"__v_isRef\"\n};\n\nconst WatchErrorCodes = {\n \"WATCH_GETTER\": 2,\n \"2\": \"WATCH_GETTER\",\n \"WATCH_CALLBACK\": 3,\n \"3\": \"WATCH_CALLBACK\",\n \"WATCH_CLEANUP\": 4,\n \"4\": \"WATCH_CLEANUP\"\n};\nconst INITIAL_WATCHER_VALUE = {};\nconst cleanupMap = /* @__PURE__ */ new WeakMap();\nlet activeWatcher = void 0;\nfunction getCurrentWatcher() {\n return activeWatcher;\n}\nfunction onWatcherCleanup(cleanupFn, failSilently = false, owner = activeWatcher) {\n if (owner) {\n let cleanups = cleanupMap.get(owner);\n if (!cleanups) cleanupMap.set(owner, cleanups = []);\n cleanups.push(cleanupFn);\n } else if (!!(process.env.NODE_ENV !== \"production\") && !failSilently) {\n warn(\n `onWatcherCleanup() was called when there was no active watcher to associate with.`\n );\n }\n}\nfunction watch(source, cb, options = EMPTY_OBJ) {\n const { immediate, deep, once, scheduler, augmentJob, call } = options;\n const warnInvalidSource = (s) => {\n (options.onWarn || warn)(\n `Invalid watch source: `,\n s,\n `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.`\n );\n };\n const reactiveGetter = (source2) => {\n if (deep) return source2;\n if (isShallow(source2) || deep === false || deep === 0)\n return traverse(source2, 1);\n return traverse(source2);\n };\n let effect;\n let getter;\n let cleanup;\n let boundCleanup;\n let forceTrigger = false;\n let isMultiSource = false;\n if (isRef(source)) {\n getter = () => source.value;\n forceTrigger = isShallow(source);\n } else if (isReactive(source)) {\n getter = () => reactiveGetter(source);\n forceTrigger = true;\n } else if (isArray(source)) {\n isMultiSource = true;\n forceTrigger = source.some((s) => isReactive(s) || isShallow(s));\n getter = () => source.map((s) => {\n if (isRef(s)) {\n return s.value;\n } else if (isReactive(s)) {\n return reactiveGetter(s);\n } else if (isFunction(s)) {\n return call ? call(s, 2) : s();\n } else {\n !!(process.env.NODE_ENV !== \"production\") && warnInvalidSource(s);\n }\n });\n } else if (isFunction(source)) {\n if (cb) {\n getter = call ? () => call(source, 2) : source;\n } else {\n getter = () => {\n if (cleanup) {\n pauseTracking();\n try {\n cleanup();\n } finally {\n resetTracking();\n }\n }\n const currentEffect = activeWatcher;\n activeWatcher = effect;\n try {\n return call ? call(source, 3, [boundCleanup]) : source(boundCleanup);\n } finally {\n activeWatcher = currentEffect;\n }\n };\n }\n } else {\n getter = NOOP;\n !!(process.env.NODE_ENV !== \"production\") && warnInvalidSource(source);\n }\n if (cb && deep) {\n const baseGetter = getter;\n const depth = deep === true ? Infinity : deep;\n getter = () => traverse(baseGetter(), depth);\n }\n const scope = getCurrentScope();\n const watchHandle = () => {\n effect.stop();\n if (scope && scope.active) {\n remove(scope.effects, effect);\n }\n };\n if (once && cb) {\n const _cb = cb;\n cb = (...args) => {\n _cb(...args);\n watchHandle();\n };\n }\n let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;\n const job = (immediateFirstRun) => {\n if (!(effect.flags & 1) || !effect.dirty && !immediateFirstRun) {\n return;\n }\n if (cb) {\n const newValue = effect.run();\n if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {\n if (cleanup) {\n cleanup();\n }\n const currentWatcher = activeWatcher;\n activeWatcher = effect;\n try {\n const args = [\n newValue,\n // pass undefined as the old value when it's changed for the first time\n oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,\n boundCleanup\n ];\n call ? call(cb, 3, args) : (\n // @ts-expect-error\n cb(...args)\n );\n oldValue = newValue;\n } finally {\n activeWatcher = currentWatcher;\n }\n }\n } else {\n effect.run();\n }\n };\n if (augmentJob) {\n augmentJob(job);\n }\n effect = new ReactiveEffect(getter);\n effect.scheduler = scheduler ? () => scheduler(job, false) : job;\n boundCleanup = (fn) => onWatcherCleanup(fn, false, effect);\n cleanup = effect.onStop = () => {\n const cleanups = cleanupMap.get(effect);\n if (cleanups) {\n if (call) {\n call(cleanups, 4);\n } else {\n for (const cleanup2 of cleanups) cleanup2();\n }\n cleanupMap.delete(effect);\n }\n };\n if (!!(process.env.NODE_ENV !== \"production\")) {\n effect.onTrack = options.onTrack;\n effect.onTrigger = options.onTrigger;\n }\n if (cb) {\n if (immediate) {\n job(true);\n } else {\n oldValue = effect.run();\n }\n } else if (scheduler) {\n scheduler(job.bind(null, true), true);\n } else {\n effect.run();\n }\n watchHandle.pause = effect.pause.bind(effect);\n watchHandle.resume = effect.resume.bind(effect);\n watchHandle.stop = watchHandle;\n return watchHandle;\n}\nfunction traverse(value, depth = Infinity, seen) {\n if (depth <= 0 || !isObject(value) || value[\"__v_skip\"]) {\n return value;\n }\n seen = seen || /* @__PURE__ */ new Set();\n if (seen.has(value)) {\n return value;\n }\n seen.add(value);\n depth--;\n if (isRef(value)) {\n traverse(value.value, depth, seen);\n } else if (isArray(value)) {\n for (let i = 0; i < value.length; i++) {\n traverse(value[i], depth, seen);\n }\n } else if (isSet(value) || isMap(value)) {\n value.forEach((v) => {\n traverse(v, depth, seen);\n });\n } else if (isPlainObject(value)) {\n for (const key in value) {\n traverse(value[key], depth, seen);\n }\n for (const key of Object.getOwnPropertySymbols(value)) {\n if (Object.prototype.propertyIsEnumerable.call(value, key)) {\n traverse(value[key], depth, seen);\n }\n }\n }\n return value;\n}\n\nexport { ARRAY_ITERATE_KEY, EffectFlags, EffectScope, ITERATE_KEY, MAP_KEY_ITERATE_KEY, ReactiveEffect, ReactiveFlags, TrackOpTypes, TriggerOpTypes, WatchErrorCodes, computed, customRef, effect, effectScope, enableTracking, getCurrentScope, getCurrentWatcher, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onEffectCleanup, onScopeDispose, onWatcherCleanup, pauseTracking, proxyRefs, reactive, reactiveReadArray, readonly, ref, resetTracking, shallowReactive, shallowReadArray, shallowReadonly, shallowRef, stop, toRaw, toReactive, toReadonly, toRef, toRefs, toValue, track, traverse, trigger, triggerRef, unref, watch };\n","/**\n* @vue/runtime-core v3.5.13\n* (c) 2018-present Yuxi (Evan) You and Vue contributors\n* @license MIT\n**/\nimport { pauseTracking, resetTracking, isRef, toRaw, traverse, shallowRef, readonly, isReactive, ref, isShallow, shallowReadArray, toReactive, shallowReadonly, track, reactive, shallowReactive, trigger, ReactiveEffect, watch as watch$1, customRef, isProxy, proxyRefs, markRaw, EffectScope, computed as computed$1, isReadonly } from '@vue/reactivity';\nexport { EffectScope, ReactiveEffect, TrackOpTypes, TriggerOpTypes, customRef, effect, effectScope, getCurrentScope, getCurrentWatcher, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onScopeDispose, onWatcherCleanup, proxyRefs, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, stop, toRaw, toRef, toRefs, toValue, triggerRef, unref } from '@vue/reactivity';\nimport { isString, isFunction, isPromise, isArray, EMPTY_OBJ, NOOP, getGlobalThis, extend, isBuiltInDirective, hasOwn, remove, def, isOn, isReservedProp, normalizeClass, stringifyStyle, normalizeStyle, isKnownSvgAttr, isBooleanAttr, isKnownHtmlAttr, includeBooleanAttr, isRenderableAttrValue, getEscapedCssVarName, isObject, isRegExp, invokeArrayFns, toHandlerKey, capitalize, camelize, isSymbol, isGloballyAllowed, NO, hyphenate, EMPTY_ARR, toRawType, makeMap, hasChanged, looseToNumber, isModelListener, toNumber } from '@vue/shared';\nexport { camelize, capitalize, normalizeClass, normalizeProps, normalizeStyle, toDisplayString, toHandlerKey } from '@vue/shared';\n\nconst stack = [];\nfunction pushWarningContext(vnode) {\n stack.push(vnode);\n}\nfunction popWarningContext() {\n stack.pop();\n}\nlet isWarning = false;\nfunction warn$1(msg, ...args) {\n if (isWarning) return;\n isWarning = true;\n pauseTracking();\n const instance = stack.length ? stack[stack.length - 1].component : null;\n const appWarnHandler = instance && instance.appContext.config.warnHandler;\n const trace = getComponentTrace();\n if (appWarnHandler) {\n callWithErrorHandling(\n appWarnHandler,\n instance,\n 11,\n [\n // eslint-disable-next-line no-restricted-syntax\n msg + args.map((a) => {\n var _a, _b;\n return (_b = (_a = a.toString) == null ? void 0 : _a.call(a)) != null ? _b : JSON.stringify(a);\n }).join(\"\"),\n instance && instance.proxy,\n trace.map(\n ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`\n ).join(\"\\n\"),\n trace\n ]\n );\n } else {\n const warnArgs = [`[Vue warn]: ${msg}`, ...args];\n if (trace.length && // avoid spamming console during tests\n true) {\n warnArgs.push(`\n`, ...formatTrace(trace));\n }\n console.warn(...warnArgs);\n }\n resetTracking();\n isWarning = false;\n}\nfunction getComponentTrace() {\n let currentVNode = stack[stack.length - 1];\n if (!currentVNode) {\n return [];\n }\n const normalizedStack = [];\n while (currentVNode) {\n const last = normalizedStack[0];\n if (last && last.vnode === currentVNode) {\n last.recurseCount++;\n } else {\n normalizedStack.push({\n vnode: currentVNode,\n recurseCount: 0\n });\n }\n const parentInstance = currentVNode.component && currentVNode.component.parent;\n currentVNode = parentInstance && parentInstance.vnode;\n }\n return normalizedStack;\n}\nfunction formatTrace(trace) {\n const logs = [];\n trace.forEach((entry, i) => {\n logs.push(...i === 0 ? [] : [`\n`], ...formatTraceEntry(entry));\n });\n return logs;\n}\nfunction formatTraceEntry({ vnode, recurseCount }) {\n const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;\n const isRoot = vnode.component ? vnode.component.parent == null : false;\n const open = ` at <${formatComponentName(\n vnode.component,\n vnode.type,\n isRoot\n )}`;\n const close = `>` + postfix;\n return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close];\n}\nfunction formatProps(props) {\n const res = [];\n const keys = Object.keys(props);\n keys.slice(0, 3).forEach((key) => {\n res.push(...formatProp(key, props[key]));\n });\n if (keys.length > 3) {\n res.push(` ...`);\n }\n return res;\n}\nfunction formatProp(key, value, raw) {\n if (isString(value)) {\n value = JSON.stringify(value);\n return raw ? value : [`${key}=${value}`];\n } else if (typeof value === \"number\" || typeof value === \"boolean\" || value == null) {\n return raw ? value : [`${key}=${value}`];\n } else if (isRef(value)) {\n value = formatProp(key, toRaw(value.value), true);\n return raw ? value : [`${key}=Ref<`, value, `>`];\n } else if (isFunction(value)) {\n return [`${key}=fn${value.name ? `<${value.name}>` : ``}`];\n } else {\n value = toRaw(value);\n return raw ? value : [`${key}=`, value];\n }\n}\nfunction assertNumber(val, type) {\n if (!!!(process.env.NODE_ENV !== \"production\")) return;\n if (val === void 0) {\n return;\n } else if (typeof val !== \"number\") {\n warn$1(`${type} is not a valid number - got ${JSON.stringify(val)}.`);\n } else if (isNaN(val)) {\n warn$1(`${type} is NaN - the duration expression might be incorrect.`);\n }\n}\n\nconst ErrorCodes = {\n \"SETUP_FUNCTION\": 0,\n \"0\": \"SETUP_FUNCTION\",\n \"RENDER_FUNCTION\": 1,\n \"1\": \"RENDER_FUNCTION\",\n \"NATIVE_EVENT_HANDLER\": 5,\n \"5\": \"NATIVE_EVENT_HANDLER\",\n \"COMPONENT_EVENT_HANDLER\": 6,\n \"6\": \"COMPONENT_EVENT_HANDLER\",\n \"VNODE_HOOK\": 7,\n \"7\": \"VNODE_HOOK\",\n \"DIRECTIVE_HOOK\": 8,\n \"8\": \"DIRECTIVE_HOOK\",\n \"TRANSITION_HOOK\": 9,\n \"9\": \"TRANSITION_HOOK\",\n \"APP_ERROR_HANDLER\": 10,\n \"10\": \"APP_ERROR_HANDLER\",\n \"APP_WARN_HANDLER\": 11,\n \"11\": \"APP_WARN_HANDLER\",\n \"FUNCTION_REF\": 12,\n \"12\": \"FUNCTION_REF\",\n \"ASYNC_COMPONENT_LOADER\": 13,\n \"13\": \"ASYNC_COMPONENT_LOADER\",\n \"SCHEDULER\": 14,\n \"14\": \"SCHEDULER\",\n \"COMPONENT_UPDATE\": 15,\n \"15\": \"COMPONENT_UPDATE\",\n \"APP_UNMOUNT_CLEANUP\": 16,\n \"16\": \"APP_UNMOUNT_CLEANUP\"\n};\nconst ErrorTypeStrings$1 = {\n [\"sp\"]: \"serverPrefetch hook\",\n [\"bc\"]: \"beforeCreate hook\",\n [\"c\"]: \"created hook\",\n [\"bm\"]: \"beforeMount hook\",\n [\"m\"]: \"mounted hook\",\n [\"bu\"]: \"beforeUpdate hook\",\n [\"u\"]: \"updated\",\n [\"bum\"]: \"beforeUnmount hook\",\n [\"um\"]: \"unmounted hook\",\n [\"a\"]: \"activated hook\",\n [\"da\"]: \"deactivated hook\",\n [\"ec\"]: \"errorCaptured hook\",\n [\"rtc\"]: \"renderTracked hook\",\n [\"rtg\"]: \"renderTriggered hook\",\n [0]: \"setup function\",\n [1]: \"render function\",\n [2]: \"watcher getter\",\n [3]: \"watcher callback\",\n [4]: \"watcher cleanup function\",\n [5]: \"native event handler\",\n [6]: \"component event handler\",\n [7]: \"vnode hook\",\n [8]: \"directive hook\",\n [9]: \"transition hook\",\n [10]: \"app errorHandler\",\n [11]: \"app warnHandler\",\n [12]: \"ref function\",\n [13]: \"async component loader\",\n [14]: \"scheduler flush\",\n [15]: \"component update\",\n [16]: \"app unmount cleanup function\"\n};\nfunction callWithErrorHandling(fn, instance, type, args) {\n try {\n return args ? fn(...args) : fn();\n } catch (err) {\n handleError(err, instance, type);\n }\n}\nfunction callWithAsyncErrorHandling(fn, instance, type, args) {\n if (isFunction(fn)) {\n const res = callWithErrorHandling(fn, instance, type, args);\n if (res && isPromise(res)) {\n res.catch((err) => {\n handleError(err, instance, type);\n });\n }\n return res;\n }\n if (isArray(fn)) {\n const values = [];\n for (let i = 0; i < fn.length; i++) {\n values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));\n }\n return values;\n } else if (!!(process.env.NODE_ENV !== \"production\")) {\n warn$1(\n `Invalid value type passed to callWithAsyncErrorHandling(): ${typeof fn}`\n );\n }\n}\nfunction handleError(err, instance, type, throwInDev = true) {\n const contextVNode = instance ? instance.vnode : null;\n const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ;\n if (instance) {\n let cur = instance.parent;\n const exposedInstance = instance.proxy;\n const errorInfo = !!(process.env.NODE_ENV !== \"production\") ? ErrorTypeStrings$1[type] : `https://vuejs.org/error-reference/#runtime-${type}`;\n while (cur) {\n const errorCapturedHooks = cur.ec;\n if (errorCapturedHooks) {\n for (let i = 0; i < errorCapturedHooks.length; i++) {\n if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {\n return;\n }\n }\n }\n cur = cur.parent;\n }\n if (errorHandler) {\n pauseTracking();\n callWithErrorHandling(errorHandler, null, 10, [\n err,\n exposedInstance,\n errorInfo\n ]);\n resetTracking();\n return;\n }\n }\n logError(err, type, contextVNode, throwInDev, throwUnhandledErrorInProduction);\n}\nfunction logError(err, type, contextVNode, throwInDev = true, throwInProd = false) {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n const info = ErrorTypeStrings$1[type];\n if (contextVNode) {\n pushWarningContext(contextVNode);\n }\n warn$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`);\n if (contextVNode) {\n popWarningContext();\n }\n if (throwInDev) {\n throw err;\n } else {\n console.error(err);\n }\n } else if (throwInProd) {\n throw err;\n } else {\n console.error(err);\n }\n}\n\nconst queue = [];\nlet flushIndex = -1;\nconst pendingPostFlushCbs = [];\nlet activePostFlushCbs = null;\nlet postFlushIndex = 0;\nconst resolvedPromise = /* @__PURE__ */ Promise.resolve();\nlet currentFlushPromise = null;\nconst RECURSION_LIMIT = 100;\nfunction nextTick(fn) {\n const p = currentFlushPromise || resolvedPromise;\n return fn ? p.then(this ? fn.bind(this) : fn) : p;\n}\nfunction findInsertionIndex(id) {\n let start = flushIndex + 1;\n let end = queue.length;\n while (start < end) {\n const middle = start + end >>> 1;\n const middleJob = queue[middle];\n const middleJobId = getId(middleJob);\n if (middleJobId < id || middleJobId === id && middleJob.flags & 2) {\n start = middle + 1;\n } else {\n end = middle;\n }\n }\n return start;\n}\nfunction queueJob(job) {\n if (!(job.flags & 1)) {\n const jobId = getId(job);\n const lastJob = queue[queue.length - 1];\n if (!lastJob || // fast path when the job id is larger than the tail\n !(job.flags & 2) && jobId >= getId(lastJob)) {\n queue.push(job);\n } else {\n queue.splice(findInsertionIndex(jobId), 0, job);\n }\n job.flags |= 1;\n queueFlush();\n }\n}\nfunction queueFlush() {\n if (!currentFlushPromise) {\n currentFlushPromise = resolvedPromise.then(flushJobs);\n }\n}\nfunction queuePostFlushCb(cb) {\n if (!isArray(cb)) {\n if (activePostFlushCbs && cb.id === -1) {\n activePostFlushCbs.splice(postFlushIndex + 1, 0, cb);\n } else if (!(cb.flags & 1)) {\n pendingPostFlushCbs.push(cb);\n cb.flags |= 1;\n }\n } else {\n pendingPostFlushCbs.push(...cb);\n }\n queueFlush();\n}\nfunction flushPreFlushCbs(instance, seen, i = flushIndex + 1) {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n seen = seen || /* @__PURE__ */ new Map();\n }\n for (; i < queue.length; i++) {\n const cb = queue[i];\n if (cb && cb.flags & 2) {\n if (instance && cb.id !== instance.uid) {\n continue;\n }\n if (!!(process.env.NODE_ENV !== \"production\") && checkRecursiveUpdates(seen, cb)) {\n continue;\n }\n queue.splice(i, 1);\n i--;\n if (cb.flags & 4) {\n cb.flags &= ~1;\n }\n cb();\n if (!(cb.flags & 4)) {\n cb.flags &= ~1;\n }\n }\n }\n}\nfunction flushPostFlushCbs(seen) {\n if (pendingPostFlushCbs.length) {\n const deduped = [...new Set(pendingPostFlushCbs)].sort(\n (a, b) => getId(a) - getId(b)\n );\n pendingPostFlushCbs.length = 0;\n if (activePostFlushCbs) {\n activePostFlushCbs.push(...deduped);\n return;\n }\n activePostFlushCbs = deduped;\n if (!!(process.env.NODE_ENV !== \"production\")) {\n seen = seen || /* @__PURE__ */ new Map();\n }\n for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {\n const cb = activePostFlushCbs[postFlushIndex];\n if (!!(process.env.NODE_ENV !== \"production\") && checkRecursiveUpdates(seen, cb)) {\n continue;\n }\n if (cb.flags & 4) {\n cb.flags &= ~1;\n }\n if (!(cb.flags & 8)) cb();\n cb.flags &= ~1;\n }\n activePostFlushCbs = null;\n postFlushIndex = 0;\n }\n}\nconst getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id;\nfunction flushJobs(seen) {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n seen = seen || /* @__PURE__ */ new Map();\n }\n const check = !!(process.env.NODE_ENV !== \"production\") ? (job) => checkRecursiveUpdates(seen, job) : NOOP;\n try {\n for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {\n const job = queue[flushIndex];\n if (job && !(job.flags & 8)) {\n if (!!(process.env.NODE_ENV !== \"production\") && check(job)) {\n continue;\n }\n if (job.flags & 4) {\n job.flags &= ~1;\n }\n callWithErrorHandling(\n job,\n job.i,\n job.i ? 15 : 14\n );\n if (!(job.flags & 4)) {\n job.flags &= ~1;\n }\n }\n }\n } finally {\n for (; flushIndex < queue.length; flushIndex++) {\n const job = queue[flushIndex];\n if (job) {\n job.flags &= ~1;\n }\n }\n flushIndex = -1;\n queue.length = 0;\n flushPostFlushCbs(seen);\n currentFlushPromise = null;\n if (queue.length || pendingPostFlushCbs.length) {\n flushJobs(seen);\n }\n }\n}\nfunction checkRecursiveUpdates(seen, fn) {\n const count = seen.get(fn) || 0;\n if (count > RECURSION_LIMIT) {\n const instance = fn.i;\n const componentName = instance && getComponentName(instance.type);\n handleError(\n `Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,\n null,\n 10\n );\n return true;\n }\n seen.set(fn, count + 1);\n return false;\n}\n\nlet isHmrUpdating = false;\nconst hmrDirtyComponents = /* @__PURE__ */ new Map();\nif (!!(process.env.NODE_ENV !== \"production\")) {\n getGlobalThis().__VUE_HMR_RUNTIME__ = {\n createRecord: tryWrap(createRecord),\n rerender: tryWrap(rerender),\n reload: tryWrap(reload)\n };\n}\nconst map = /* @__PURE__ */ new Map();\nfunction registerHMR(instance) {\n const id = instance.type.__hmrId;\n let record = map.get(id);\n if (!record) {\n createRecord(id, instance.type);\n record = map.get(id);\n }\n record.instances.add(instance);\n}\nfunction unregisterHMR(instance) {\n map.get(instance.type.__hmrId).instances.delete(instance);\n}\nfunction createRecord(id, initialDef) {\n if (map.has(id)) {\n return false;\n }\n map.set(id, {\n initialDef: normalizeClassComponent(initialDef),\n instances: /* @__PURE__ */ new Set()\n });\n return true;\n}\nfunction normalizeClassComponent(component) {\n return isClassComponent(component) ? component.__vccOpts : component;\n}\nfunction rerender(id, newRender) {\n const record = map.get(id);\n if (!record) {\n return;\n }\n record.initialDef.render = newRender;\n [...record.instances].forEach((instance) => {\n if (newRender) {\n instance.render = newRender;\n normalizeClassComponent(instance.type).render = newRender;\n }\n instance.renderCache = [];\n isHmrUpdating = true;\n instance.update();\n isHmrUpdating = false;\n });\n}\nfunction reload(id, newComp) {\n const record = map.get(id);\n if (!record) return;\n newComp = normalizeClassComponent(newComp);\n updateComponentDef(record.initialDef, newComp);\n const instances = [...record.instances];\n for (let i = 0; i < instances.length; i++) {\n const instance = instances[i];\n const oldComp = normalizeClassComponent(instance.type);\n let dirtyInstances = hmrDirtyComponents.get(oldComp);\n if (!dirtyInstances) {\n if (oldComp !== record.initialDef) {\n updateComponentDef(oldComp, newComp);\n }\n hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());\n }\n dirtyInstances.add(instance);\n instance.appContext.propsCache.delete(instance.type);\n instance.appContext.emitsCache.delete(instance.type);\n instance.appContext.optionsCache.delete(instance.type);\n if (instance.ceReload) {\n dirtyInstances.add(instance);\n instance.ceReload(newComp.styles);\n dirtyInstances.delete(instance);\n } else if (instance.parent) {\n queueJob(() => {\n isHmrUpdating = true;\n instance.parent.update();\n isHmrUpdating = false;\n dirtyInstances.delete(instance);\n });\n } else if (instance.appContext.reload) {\n instance.appContext.reload();\n } else if (typeof window !== \"undefined\") {\n window.location.reload();\n } else {\n console.warn(\n \"[HMR] Root or manually mounted instance modified. Full reload required.\"\n );\n }\n if (instance.root.ce && instance !== instance.root) {\n instance.root.ce._removeChildStyle(oldComp);\n }\n }\n queuePostFlushCb(() => {\n hmrDirtyComponents.clear();\n });\n}\nfunction updateComponentDef(oldComp, newComp) {\n extend(oldComp, newComp);\n for (const key in oldComp) {\n if (key !== \"__file\" && !(key in newComp)) {\n delete oldComp[key];\n }\n }\n}\nfunction tryWrap(fn) {\n return (id, arg) => {\n try {\n return fn(id, arg);\n } catch (e) {\n console.error(e);\n console.warn(\n `[HMR] Something went wrong during Vue component hot-reload. Full reload required.`\n );\n }\n };\n}\n\nlet devtools$1;\nlet buffer = [];\nlet devtoolsNotInstalled = false;\nfunction emit$1(event, ...args) {\n if (devtools$1) {\n devtools$1.emit(event, ...args);\n } else if (!devtoolsNotInstalled) {\n buffer.push({ event, args });\n }\n}\nfunction setDevtoolsHook$1(hook, target) {\n var _a, _b;\n devtools$1 = hook;\n if (devtools$1) {\n devtools$1.enabled = true;\n buffer.forEach(({ event, args }) => devtools$1.emit(event, ...args));\n buffer = [];\n } else if (\n // handle late devtools injection - only do this if we are in an actual\n // browser environment to avoid the timer handle stalling test runner exit\n // (#4815)\n typeof window !== \"undefined\" && // some envs mock window but not fully\n window.HTMLElement && // also exclude jsdom\n // eslint-disable-next-line no-restricted-syntax\n !((_b = (_a = window.navigator) == null ? void 0 : _a.userAgent) == null ? void 0 : _b.includes(\"jsdom\"))\n ) {\n const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || [];\n replay.push((newHook) => {\n setDevtoolsHook$1(newHook, target);\n });\n setTimeout(() => {\n if (!devtools$1) {\n target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null;\n devtoolsNotInstalled = true;\n buffer = [];\n }\n }, 3e3);\n } else {\n devtoolsNotInstalled = true;\n buffer = [];\n }\n}\nfunction devtoolsInitApp(app, version) {\n emit$1(\"app:init\" /* APP_INIT */, app, version, {\n Fragment,\n Text,\n Comment,\n Static\n });\n}\nfunction devtoolsUnmountApp(app) {\n emit$1(\"app:unmount\" /* APP_UNMOUNT */, app);\n}\nconst devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook(\"component:added\" /* COMPONENT_ADDED */);\nconst devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook(\"component:updated\" /* COMPONENT_UPDATED */);\nconst _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook(\n \"component:removed\" /* COMPONENT_REMOVED */\n);\nconst devtoolsComponentRemoved = (component) => {\n if (devtools$1 && typeof devtools$1.cleanupBuffer === \"function\" && // remove the component if it wasn't buffered\n !devtools$1.cleanupBuffer(component)) {\n _devtoolsComponentRemoved(component);\n }\n};\n/*! #__NO_SIDE_EFFECTS__ */\n// @__NO_SIDE_EFFECTS__\nfunction createDevtoolsComponentHook(hook) {\n return (component) => {\n emit$1(\n hook,\n component.appContext.app,\n component.uid,\n component.parent ? component.parent.uid : void 0,\n component\n );\n };\n}\nconst devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook(\"perf:start\" /* PERFORMANCE_START */);\nconst devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook(\"perf:end\" /* PERFORMANCE_END */);\nfunction createDevtoolsPerformanceHook(hook) {\n return (component, type, time) => {\n emit$1(hook, component.appContext.app, component.uid, component, type, time);\n };\n}\nfunction devtoolsComponentEmit(component, event, params) {\n emit$1(\n \"component:emit\" /* COMPONENT_EMIT */,\n component.appContext.app,\n component,\n event,\n params\n );\n}\n\nlet currentRenderingInstance = null;\nlet currentScopeId = null;\nfunction setCurrentRenderingInstance(instance) {\n const prev = currentRenderingInstance;\n currentRenderingInstance = instance;\n currentScopeId = instance && instance.type.__scopeId || null;\n return prev;\n}\nfunction pushScopeId(id) {\n currentScopeId = id;\n}\nfunction popScopeId() {\n currentScopeId = null;\n}\nconst withScopeId = (_id) => withCtx;\nfunction withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {\n if (!ctx) return fn;\n if (fn._n) {\n return fn;\n }\n const renderFnWithContext = (...args) => {\n if (renderFnWithContext._d) {\n setBlockTracking(-1);\n }\n const prevInstance = setCurrentRenderingInstance(ctx);\n let res;\n try {\n res = fn(...args);\n } finally {\n setCurrentRenderingInstance(prevInstance);\n if (renderFnWithContext._d) {\n setBlockTracking(1);\n }\n }\n if (!!(process.env.NODE_ENV !== \"production\") || __VUE_PROD_DEVTOOLS__) {\n devtoolsComponentUpdated(ctx);\n }\n return res;\n };\n renderFnWithContext._n = true;\n renderFnWithContext._c = true;\n renderFnWithContext._d = true;\n return renderFnWithContext;\n}\n\nfunction validateDirectiveName(name) {\n if (isBuiltInDirective(name)) {\n warn$1(\"Do not use built-in directive ids as custom directive id: \" + name);\n }\n}\nfunction withDirectives(vnode, directives) {\n if (currentRenderingInstance === null) {\n !!(process.env.NODE_ENV !== \"production\") && warn$1(`withDirectives can only be used inside render functions.`);\n return vnode;\n }\n const instance = getComponentPublicInstance(currentRenderingInstance);\n const bindings = vnode.dirs || (vnode.dirs = []);\n for (let i = 0; i < directives.length; i++) {\n let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];\n if (dir) {\n if (isFunction(dir)) {\n dir = {\n mounted: dir,\n updated: dir\n };\n }\n if (dir.deep) {\n traverse(value);\n }\n bindings.push({\n dir,\n instance,\n value,\n oldValue: void 0,\n arg,\n modifiers\n });\n }\n }\n return vnode;\n}\nfunction invokeDirectiveHook(vnode, prevVNode, instance, name) {\n const bindings = vnode.dirs;\n const oldBindings = prevVNode && prevVNode.dirs;\n for (let i = 0; i < bindings.length; i++) {\n const binding = bindings[i];\n if (oldBindings) {\n binding.oldValue = oldBindings[i].value;\n }\n let hook = binding.dir[name];\n if (hook) {\n pauseTracking();\n callWithAsyncErrorHandling(hook, instance, 8, [\n vnode.el,\n binding,\n vnode,\n prevVNode\n ]);\n resetTracking();\n }\n }\n}\n\nconst TeleportEndKey = Symbol(\"_vte\");\nconst isTeleport = (type) => type.__isTeleport;\nconst isTeleportDisabled = (props) => props && (props.disabled || props.disabled === \"\");\nconst isTeleportDeferred = (props) => props && (props.defer || props.defer === \"\");\nconst isTargetSVG = (target) => typeof SVGElement !== \"undefined\" && target instanceof SVGElement;\nconst isTargetMathML = (target) => typeof MathMLElement === \"function\" && target instanceof MathMLElement;\nconst resolveTarget = (props, select) => {\n const targetSelector = props && props.to;\n if (isString(targetSelector)) {\n if (!select) {\n !!(process.env.NODE_ENV !== \"production\") && warn$1(\n `Current renderer does not support string target for Teleports. (missing querySelector renderer option)`\n );\n return null;\n } else {\n const target = select(targetSelector);\n if (!!(process.env.NODE_ENV !== \"production\") && !target && !isTeleportDisabled(props)) {\n warn$1(\n `Failed to locate Teleport target with selector \"${targetSelector}\". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.`\n );\n }\n return target;\n }\n } else {\n if (!!(process.env.NODE_ENV !== \"production\") && !targetSelector && !isTeleportDisabled(props)) {\n warn$1(`Invalid Teleport target: ${targetSelector}`);\n }\n return targetSelector;\n }\n};\nconst TeleportImpl = {\n name: \"Teleport\",\n __isTeleport: true,\n process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {\n const {\n mc: mountChildren,\n pc: patchChildren,\n pbc: patchBlockChildren,\n o: { insert, querySelector, createText, createComment }\n } = internals;\n const disabled = isTeleportDisabled(n2.props);\n let { shapeFlag, children, dynamicChildren } = n2;\n if (!!(process.env.NODE_ENV !== \"production\") && isHmrUpdating) {\n optimized = false;\n dynamicChildren = null;\n }\n if (n1 == null) {\n const placeholder = n2.el = !!(process.env.NODE_ENV !== \"production\") ? createComment(\"teleport start\") : createText(\"\");\n const mainAnchor = n2.anchor = !!(process.env.NODE_ENV !== \"production\") ? createComment(\"teleport end\") : createText(\"\");\n insert(placeholder, container, anchor);\n insert(mainAnchor, container, anchor);\n const mount = (container2, anchor2) => {\n if (shapeFlag & 16) {\n if (parentComponent && parentComponent.isCE) {\n parentComponent.ce._teleportTarget = container2;\n }\n mountChildren(\n children,\n container2,\n anchor2,\n parentComponent,\n parentSuspense,\n namespace,\n slotScopeIds,\n optimized\n );\n }\n };\n const mountToTarget = () => {\n const target = n2.target = resolveTarget(n2.props, querySelector);\n const targetAnchor = prepareAnchor(target, n2, createText, insert);\n if (target) {\n if (namespace !== \"svg\" && isTargetSVG(target)) {\n namespace = \"svg\";\n } else if (namespace !== \"mathml\" && isTargetMathML(target)) {\n namespace = \"mathml\";\n }\n if (!disabled) {\n mount(target, targetAnchor);\n updateCssVars(n2, false);\n }\n } else if (!!(process.env.NODE_ENV !== \"production\") && !disabled) {\n warn$1(\n \"Invalid Teleport target on mount:\",\n target,\n `(${typeof target})`\n );\n }\n };\n if (disabled) {\n mount(container, mainAnchor);\n updateCssVars(n2, true);\n }\n if (isTeleportDeferred(n2.props)) {\n queuePostRenderEffect(() => {\n mountToTarget();\n n2.el.__isMounted = true;\n }, parentSuspense);\n } else {\n mountToTarget();\n }\n } else {\n if (isTeleportDeferred(n2.props) && !n1.el.__isMounted) {\n queuePostRenderEffect(() => {\n TeleportImpl.process(\n n1,\n n2,\n container,\n anchor,\n parentComponent,\n parentSuspense,\n namespace,\n slotScopeIds,\n optimized,\n internals\n );\n delete n1.el.__isMounted;\n }, parentSuspense);\n return;\n }\n n2.el = n1.el;\n n2.targetStart = n1.targetStart;\n const mainAnchor = n2.anchor = n1.anchor;\n const target = n2.target = n1.target;\n const targetAnchor = n2.targetAnchor = n1.targetAnchor;\n const wasDisabled = isTeleportDisabled(n1.props);\n const currentContainer = wasDisabled ? container : target;\n const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;\n if (namespace === \"svg\" || isTargetSVG(target)) {\n namespace = \"svg\";\n } else if (namespace === \"mathml\" || isTargetMathML(target)) {\n namespace = \"mathml\";\n }\n if (dynamicChildren) {\n patchBlockChildren(\n n1.dynamicChildren,\n dynamicChildren,\n currentContainer,\n parentComponent,\n parentSuspense,\n namespace,\n slotScopeIds\n );\n traverseStaticChildren(n1, n2, true);\n } else if (!optimized) {\n patchChildren(\n n1,\n n2,\n currentContainer,\n currentAnchor,\n parentComponent,\n parentSuspense,\n namespace,\n slotScopeIds,\n false\n );\n }\n if (disabled) {\n if (!wasDisabled) {\n moveTeleport(\n n2,\n container,\n mainAnchor,\n internals,\n 1\n );\n } else {\n if (n2.props && n1.props && n2.props.to !== n1.props.to) {\n n2.props.to = n1.props.to;\n }\n }\n } else {\n if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {\n const nextTarget = n2.target = resolveTarget(\n n2.props,\n querySelector\n );\n if (nextTarget) {\n moveTeleport(\n n2,\n nextTarget,\n null,\n internals,\n 0\n );\n } else if (!!(process.env.NODE_ENV !== \"production\")) {\n warn$1(\n \"Invalid Teleport target on update:\",\n target,\n `(${typeof target})`\n );\n }\n } else if (wasDisabled) {\n moveTeleport(\n n2,\n target,\n targetAnchor,\n internals,\n 1\n );\n }\n }\n updateCssVars(n2, disabled);\n }\n },\n remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {\n const {\n shapeFlag,\n children,\n anchor,\n targetStart,\n targetAnchor,\n target,\n props\n } = vnode;\n if (target) {\n hostRemove(targetStart);\n hostRemove(targetAnchor);\n }\n doRemove && hostRemove(anchor);\n if (shapeFlag & 16) {\n const shouldRemove = doRemove || !isTeleportDisabled(props);\n for (let i = 0; i < children.length; i++) {\n const child = children[i];\n unmount(\n child,\n parentComponent,\n parentSuspense,\n shouldRemove,\n !!child.dynamicChildren\n );\n }\n }\n },\n move: moveTeleport,\n hydrate: hydrateTeleport\n};\nfunction moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) {\n if (moveType === 0) {\n insert(vnode.targetAnchor, container, parentAnchor);\n }\n const { el, anchor, shapeFlag, children, props } = vnode;\n const isReorder = moveType === 2;\n if (isReorder) {\n insert(el, container, parentAnchor);\n }\n if (!isReorder || isTeleportDisabled(props)) {\n if (shapeFlag & 16) {\n for (let i = 0; i < children.length; i++) {\n move(\n children[i],\n container,\n parentAnchor,\n 2\n );\n }\n }\n }\n if (isReorder) {\n insert(anchor, container, parentAnchor);\n }\n}\nfunction hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {\n o: { nextSibling, parentNode, querySelector, insert, createText }\n}, hydrateChildren) {\n const target = vnode.target = resolveTarget(\n vnode.props,\n querySelector\n );\n if (target) {\n const disabled = isTeleportDisabled(vnode.props);\n const targetNode = target._lpa || target.firstChild;\n if (vnode.shapeFlag & 16) {\n if (disabled) {\n vnode.anchor = hydrateChildren(\n nextSibling(node),\n vnode,\n parentNode(node),\n parentComponent,\n parentSuspense,\n slotScopeIds,\n optimized\n );\n vnode.targetStart = targetNode;\n vnode.targetAnchor = targetNode && nextSibling(targetNode);\n } else {\n vnode.anchor = nextSibling(node);\n let targetAnchor = targetNode;\n while (targetAnchor) {\n if (targetAnchor && targetAnchor.nodeType === 8) {\n if (targetAnchor.data === \"teleport start anchor\") {\n vnode.targetStart = targetAnchor;\n } else if (targetAnchor.data === \"teleport anchor\") {\n vnode.targetAnchor = targetAnchor;\n target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);\n break;\n }\n }\n targetAnchor = nextSibling(targetAnchor);\n }\n if (!vnode.targetAnchor) {\n prepareAnchor(target, vnode, createText, insert);\n }\n hydrateChildren(\n targetNode && nextSibling(targetNode),\n vnode,\n target,\n parentComponent,\n parentSuspense,\n slotScopeIds,\n optimized\n );\n }\n }\n updateCssVars(vnode, disabled);\n }\n return vnode.anchor && nextSibling(vnode.anchor);\n}\nconst Teleport = TeleportImpl;\nfunction updateCssVars(vnode, isDisabled) {\n const ctx = vnode.ctx;\n if (ctx && ctx.ut) {\n let node, anchor;\n if (isDisabled) {\n node = vnode.el;\n anchor = vnode.anchor;\n } else {\n node = vnode.targetStart;\n anchor = vnode.targetAnchor;\n }\n while (node && node !== anchor) {\n if (node.nodeType === 1) node.setAttribute(\"data-v-owner\", ctx.uid);\n node = node.nextSibling;\n }\n ctx.ut();\n }\n}\nfunction prepareAnchor(target, vnode, createText, insert) {\n const targetStart = vnode.targetStart = createText(\"\");\n const targetAnchor = vnode.targetAnchor = createText(\"\");\n targetStart[TeleportEndKey] = targetAnchor;\n if (target) {\n insert(targetStart, target);\n insert(targetAnchor, target);\n }\n return targetAnchor;\n}\n\nconst leaveCbKey = Symbol(\"_leaveCb\");\nconst enterCbKey = Symbol(\"_enterCb\");\nfunction useTransitionState() {\n const state = {\n isMounted: false,\n isLeaving: false,\n isUnmounting: false,\n leavingVNodes: /* @__PURE__ */ new Map()\n };\n onMounted(() => {\n state.isMounted = true;\n });\n onBeforeUnmount(() => {\n state.isUnmounting = true;\n });\n return state;\n}\nconst TransitionHookValidator = [Function, Array];\nconst BaseTransitionPropsValidators = {\n mode: String,\n appear: Boolean,\n persisted: Boolean,\n // enter\n onBeforeEnter: TransitionHookValidator,\n onEnter: TransitionHookValidator,\n onAfterEnter: TransitionHookValidator,\n onEnterCancelled: TransitionHookValidator,\n // leave\n onBeforeLeave: TransitionHookValidator,\n onLeave: TransitionHookValidator,\n onAfterLeave: TransitionHookValidator,\n onLeaveCancelled: TransitionHookValidator,\n // appear\n onBeforeAppear: TransitionHookValidator,\n onAppear: TransitionHookValidator,\n onAfterAppear: TransitionHookValidator,\n onAppearCancelled: TransitionHookValidator\n};\nconst recursiveGetSubtree = (instance) => {\n const subTree = instance.subTree;\n return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;\n};\nconst BaseTransitionImpl = {\n name: `BaseTransition`,\n props: BaseTransitionPropsValidators,\n setup(props, { slots }) {\n const instance = getCurrentInstance();\n const state = useTransitionState();\n return () => {\n const children = slots.default && getTransitionRawChildren(slots.default(), true);\n if (!children || !children.length) {\n return;\n }\n const child = findNonCommentChild(children);\n const rawProps = toRaw(props);\n const { mode } = rawProps;\n if (!!(process.env.NODE_ENV !== \"production\") && mode && mode !== \"in-out\" && mode !== \"out-in\" && mode !== \"default\") {\n warn$1(`invalid mode: ${mode}`);\n }\n if (state.isLeaving) {\n return emptyPlaceholder(child);\n }\n const innerChild = getInnerChild$1(child);\n if (!innerChild) {\n return emptyPlaceholder(child);\n }\n let enterHooks = resolveTransitionHooks(\n innerChild,\n rawProps,\n state,\n instance,\n // #11061, ensure enterHooks is fresh after clone\n (hooks) => enterHooks = hooks\n );\n if (innerChild.type !== Comment) {\n setTransitionHooks(innerChild, enterHooks);\n }\n let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);\n if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) {\n let leavingHooks = resolveTransitionHooks(\n oldInnerChild,\n rawProps,\n state,\n instance\n );\n setTransitionHooks(oldInnerChild, leavingHooks);\n if (mode === \"out-in\" && innerChild.type !== Comment) {\n state.isLeaving = true;\n leavingHooks.afterLeave = () => {\n state.isLeaving = false;\n if (!(instance.job.flags & 8)) {\n instance.update();\n }\n delete leavingHooks.afterLeave;\n oldInnerChild = void 0;\n };\n return emptyPlaceholder(child);\n } else if (mode === \"in-out\" && innerChild.type !== Comment) {\n leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {\n const leavingVNodesCache = getLeavingNodesForType(\n state,\n oldInnerChild\n );\n leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;\n el[leaveCbKey] = () => {\n earlyRemove();\n el[leaveCbKey] = void 0;\n delete enterHooks.delayedLeave;\n oldInnerChild = void 0;\n };\n enterHooks.delayedLeave = () => {\n delayedLeave();\n delete enterHooks.delayedLeave;\n oldInnerChild = void 0;\n };\n };\n } else {\n oldInnerChild = void 0;\n }\n } else if (oldInnerChild) {\n oldInnerChild = void 0;\n }\n return child;\n };\n }\n};\nfunction findNonCommentChild(children) {\n let child = children[0];\n if (children.length > 1) {\n let hasFound = false;\n for (const c of children) {\n if (c.type !== Comment) {\n if (!!(process.env.NODE_ENV !== \"production\") && hasFound) {\n warn$1(\n \" can only be used on a single element or component. Use for lists.\"\n );\n break;\n }\n child = c;\n hasFound = true;\n if (!!!(process.env.NODE_ENV !== \"production\")) break;\n }\n }\n }\n return child;\n}\nconst BaseTransition = BaseTransitionImpl;\nfunction getLeavingNodesForType(state, vnode) {\n const { leavingVNodes } = state;\n let leavingVNodesCache = leavingVNodes.get(vnode.type);\n if (!leavingVNodesCache) {\n leavingVNodesCache = /* @__PURE__ */ Object.create(null);\n leavingVNodes.set(vnode.type, leavingVNodesCache);\n }\n return leavingVNodesCache;\n}\nfunction resolveTransitionHooks(vnode, props, state, instance, postClone) {\n const {\n appear,\n mode,\n persisted = false,\n onBeforeEnter,\n onEnter,\n onAfterEnter,\n onEnterCancelled,\n onBeforeLeave,\n onLeave,\n onAfterLeave,\n onLeaveCancelled,\n onBeforeAppear,\n onAppear,\n onAfterAppear,\n onAppearCancelled\n } = props;\n const key = String(vnode.key);\n const leavingVNodesCache = getLeavingNodesForType(state, vnode);\n const callHook = (hook, args) => {\n hook && callWithAsyncErrorHandling(\n hook,\n instance,\n 9,\n args\n );\n };\n const callAsyncHook = (hook, args) => {\n const done = args[1];\n callHook(hook, args);\n if (isArray(hook)) {\n if (hook.every((hook2) => hook2.length <= 1)) done();\n } else if (hook.length <= 1) {\n done();\n }\n };\n const hooks = {\n mode,\n persisted,\n beforeEnter(el) {\n let hook = onBeforeEnter;\n if (!state.isMounted) {\n if (appear) {\n hook = onBeforeAppear || onBeforeEnter;\n } else {\n return;\n }\n }\n if (el[leaveCbKey]) {\n el[leaveCbKey](\n true\n /* cancelled */\n );\n }\n const leavingVNode = leavingVNodesCache[key];\n if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {\n leavingVNode.el[leaveCbKey]();\n }\n callHook(hook, [el]);\n },\n enter(el) {\n let hook = onEnter;\n let afterHook = onAfterEnter;\n let cancelHook = onEnterCancelled;\n if (!state.isMounted) {\n if (appear) {\n hook = onAppear || onEnter;\n afterHook = onAfterAppear || onAfterEnter;\n cancelHook = onAppearCancelled || onEnterCancelled;\n } else {\n return;\n }\n }\n let called = false;\n const done = el[enterCbKey] = (cancelled) => {\n if (called) return;\n called = true;\n if (cancelled) {\n callHook(cancelHook, [el]);\n } else {\n callHook(afterHook, [el]);\n }\n if (hooks.delayedLeave) {\n hooks.delayedLeave();\n }\n el[enterCbKey] = void 0;\n };\n if (hook) {\n callAsyncHook(hook, [el, done]);\n } else {\n done();\n }\n },\n leave(el, remove) {\n const key2 = String(vnode.key);\n if (el[enterCbKey]) {\n el[enterCbKey](\n true\n /* cancelled */\n );\n }\n if (state.isUnmounting) {\n return remove();\n }\n callHook(onBeforeLeave, [el]);\n let called = false;\n const done = el[leaveCbKey] = (cancelled) => {\n if (called) return;\n called = true;\n remove();\n if (cancelled) {\n callHook(onLeaveCancelled, [el]);\n } else {\n callHook(onAfterLeave, [el]);\n }\n el[leaveCbKey] = void 0;\n if (leavingVNodesCache[key2] === vnode) {\n delete leavingVNodesCache[key2];\n }\n };\n leavingVNodesCache[key2] = vnode;\n if (onLeave) {\n callAsyncHook(onLeave, [el, done]);\n } else {\n done();\n }\n },\n clone(vnode2) {\n const hooks2 = resolveTransitionHooks(\n vnode2,\n props,\n state,\n instance,\n postClone\n );\n if (postClone) postClone(hooks2);\n return hooks2;\n }\n };\n return hooks;\n}\nfunction emptyPlaceholder(vnode) {\n if (isKeepAlive(vnode)) {\n vnode = cloneVNode(vnode);\n vnode.children = null;\n return vnode;\n }\n}\nfunction getInnerChild$1(vnode) {\n if (!isKeepAlive(vnode)) {\n if (isTeleport(vnode.type) && vnode.children) {\n return findNonCommentChild(vnode.children);\n }\n return vnode;\n }\n if (!!(process.env.NODE_ENV !== \"production\") && vnode.component) {\n return vnode.component.subTree;\n }\n const { shapeFlag, children } = vnode;\n if (children) {\n if (shapeFlag & 16) {\n return children[0];\n }\n if (shapeFlag & 32 && isFunction(children.default)) {\n return children.default();\n }\n }\n}\nfunction setTransitionHooks(vnode, hooks) {\n if (vnode.shapeFlag & 6 && vnode.component) {\n vnode.transition = hooks;\n setTransitionHooks(vnode.component.subTree, hooks);\n } else if (vnode.shapeFlag & 128) {\n vnode.ssContent.transition = hooks.clone(vnode.ssContent);\n vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);\n } else {\n vnode.transition = hooks;\n }\n}\nfunction getTransitionRawChildren(children, keepComment = false, parentKey) {\n let ret = [];\n let keyedFragmentCount = 0;\n for (let i = 0; i < children.length; i++) {\n let child = children[i];\n const key = parentKey == null ? child.key : String(parentKey) + String(child.key != null ? child.key : i);\n if (child.type === Fragment) {\n if (child.patchFlag & 128) keyedFragmentCount++;\n ret = ret.concat(\n getTransitionRawChildren(child.children, keepComment, key)\n );\n } else if (keepComment || child.type !== Comment) {\n ret.push(key != null ? cloneVNode(child, { key }) : child);\n }\n }\n if (keyedFragmentCount > 1) {\n for (let i = 0; i < ret.length; i++) {\n ret[i].patchFlag = -2;\n }\n }\n return ret;\n}\n\n/*! #__NO_SIDE_EFFECTS__ */\n// @__NO_SIDE_EFFECTS__\nfunction defineComponent(options, extraOptions) {\n return isFunction(options) ? (\n // #8236: extend call and options.name access are considered side-effects\n // by Rollup, so we have to wrap it in a pure-annotated IIFE.\n /* @__PURE__ */ (() => extend({ name: options.name }, extraOptions, { setup: options }))()\n ) : options;\n}\n\nfunction useId() {\n const i = getCurrentInstance();\n if (i) {\n return (i.appContext.config.idPrefix || \"v\") + \"-\" + i.ids[0] + i.ids[1]++;\n } else if (!!(process.env.NODE_ENV !== \"production\")) {\n warn$1(\n `useId() is called when there is no active component instance to be associated with.`\n );\n }\n return \"\";\n}\nfunction markAsyncBoundary(instance) {\n instance.ids = [instance.ids[0] + instance.ids[2]++ + \"-\", 0, 0];\n}\n\nconst knownTemplateRefs = /* @__PURE__ */ new WeakSet();\nfunction useTemplateRef(key) {\n const i = getCurrentInstance();\n const r = shallowRef(null);\n if (i) {\n const refs = i.refs === EMPTY_OBJ ? i.refs = {} : i.refs;\n let desc;\n if (!!(process.env.NODE_ENV !== \"production\") && (desc = Object.getOwnPropertyDescriptor(refs, key)) && !desc.configurable) {\n warn$1(`useTemplateRef('${key}') already exists.`);\n } else {\n Object.defineProperty(refs, key, {\n enumerable: true,\n get: () => r.value,\n set: (val) => r.value = val\n });\n }\n } else if (!!(process.env.NODE_ENV !== \"production\")) {\n warn$1(\n `useTemplateRef() is called when there is no active component instance to be associated with.`\n );\n }\n const ret = !!(process.env.NODE_ENV !== \"production\") ? readonly(r) : r;\n if (!!(process.env.NODE_ENV !== \"production\")) {\n knownTemplateRefs.add(ret);\n }\n return ret;\n}\n\nfunction setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {\n if (isArray(rawRef)) {\n rawRef.forEach(\n (r, i) => setRef(\n r,\n oldRawRef && (isArray(oldRawRef) ? oldRawRef[i] : oldRawRef),\n parentSuspense,\n vnode,\n isUnmount\n )\n );\n return;\n }\n if (isAsyncWrapper(vnode) && !isUnmount) {\n if (vnode.shapeFlag & 512 && vnode.type.__asyncResolved && vnode.component.subTree.component) {\n setRef(rawRef, oldRawRef, parentSuspense, vnode.component.subTree);\n }\n return;\n }\n const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el;\n const value = isUnmount ? null : refValue;\n const { i: owner, r: ref } = rawRef;\n if (!!(process.env.NODE_ENV !== \"production\") && !owner) {\n warn$1(\n `Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.`\n );\n return;\n }\n const oldRef = oldRawRef && oldRawRef.r;\n const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;\n const setupState = owner.setupState;\n const rawSetupState = toRaw(setupState);\n const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) {\n warn$1(\n `Template ref \"${key}\" used on a non-ref value. It will not work in the production build.`\n );\n }\n if (knownTemplateRefs.has(rawSetupState[key])) {\n return false;\n }\n }\n return hasOwn(rawSetupState, key);\n };\n if (oldRef != null && oldRef !== ref) {\n if (isString(oldRef)) {\n refs[oldRef] = null;\n if (canSetSetupRef(oldRef)) {\n setupState[oldRef] = null;\n }\n } else if (isRef(oldRef)) {\n oldRef.value = null;\n }\n }\n if (isFunction(ref)) {\n callWithErrorHandling(ref, owner, 12, [value, refs]);\n } else {\n const _isString = isString(ref);\n const _isRef = isRef(ref);\n if (_isString || _isRef) {\n const doSet = () => {\n if (rawRef.f) {\n const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : ref.value;\n if (isUnmount) {\n isArray(existing) && remove(existing, refValue);\n } else {\n if (!isArray(existing)) {\n if (_isString) {\n refs[ref] = [refValue];\n if (canSetSetupRef(ref)) {\n setupState[ref] = refs[ref];\n }\n } else {\n ref.value = [refValue];\n if (rawRef.k) refs[rawRef.k] = ref.value;\n }\n } else if (!existing.includes(refValue)) {\n existing.push(refValue);\n }\n }\n } else if (_isString) {\n refs[ref] = value;\n if (canSetSetupRef(ref)) {\n setupState[ref] = value;\n }\n } else if (_isRef) {\n ref.value = value;\n if (rawRef.k) refs[rawRef.k] = value;\n } else if (!!(process.env.NODE_ENV !== \"production\")) {\n warn$1(\"Invalid template ref type:\", ref, `(${typeof ref})`);\n }\n };\n if (value) {\n doSet.id = -1;\n queuePostRenderEffect(doSet, parentSuspense);\n } else {\n doSet();\n }\n } else if (!!(process.env.NODE_ENV !== \"production\")) {\n warn$1(\"Invalid template ref type:\", ref, `(${typeof ref})`);\n }\n }\n}\n\nlet hasLoggedMismatchError = false;\nconst logMismatchError = () => {\n if (hasLoggedMismatchError) {\n return;\n }\n console.error(\"Hydration completed but contains mismatches.\");\n hasLoggedMismatchError = true;\n};\nconst isSVGContainer = (container) => container.namespaceURI.includes(\"svg\") && container.tagName !== \"foreignObject\";\nconst isMathMLContainer = (container) => container.namespaceURI.includes(\"MathML\");\nconst getContainerType = (container) => {\n if (container.nodeType !== 1) return void 0;\n if (isSVGContainer(container)) return \"svg\";\n if (isMathMLContainer(container)) return \"mathml\";\n return void 0;\n};\nconst isComment = (node) => node.nodeType === 8;\nfunction createHydrationFunctions(rendererInternals) {\n const {\n mt: mountComponent,\n p: patch,\n o: {\n patchProp,\n createText,\n nextSibling,\n parentNode,\n remove,\n insert,\n createComment\n }\n } = rendererInternals;\n const hydrate = (vnode, container) => {\n if (!container.hasChildNodes()) {\n (!!(process.env.NODE_ENV !== \"production\") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn$1(\n `Attempting to hydrate existing markup but container is empty. Performing full mount instead.`\n );\n patch(null, vnode, container);\n flushPostFlushCbs();\n container._vnode = vnode;\n return;\n }\n hydrateNode(container.firstChild, vnode, null, null, null);\n flushPostFlushCbs();\n container._vnode = vnode;\n };\n const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {\n optimized = optimized || !!vnode.dynamicChildren;\n const isFragmentStart = isComment(node) && node.data === \"[\";\n const onMismatch = () => handleMismatch(\n node,\n vnode,\n parentComponent,\n parentSuspense,\n slotScopeIds,\n isFragmentStart\n );\n const { type, ref, shapeFlag, patchFlag } = vnode;\n let domType = node.nodeType;\n vnode.el = node;\n if (!!(process.env.NODE_ENV !== \"production\") || __VUE_PROD_DEVTOOLS__) {\n def(node, \"__vnode\", vnode, true);\n def(node, \"__vueParentComponent\", parentComponent, true);\n }\n if (patchFlag === -2) {\n optimized = false;\n vnode.dynamicChildren = null;\n }\n let nextNode = null;\n switch (type) {\n case Text:\n if (domType !== 3) {\n if (vnode.children === \"\") {\n insert(vnode.el = createText(\"\"), parentNode(node), node);\n nextNode = node;\n } else {\n nextNode = onMismatch();\n }\n } else {\n if (node.data !== vnode.children) {\n (!!(process.env.NODE_ENV !== \"production\") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn$1(\n `Hydration text mismatch in`,\n node.parentNode,\n `\n - rendered on server: ${JSON.stringify(\n node.data\n )}\n - expected on client: ${JSON.stringify(vnode.children)}`\n );\n logMismatchError();\n node.data = vnode.children;\n }\n nextNode = nextSibling(node);\n }\n break;\n case Comment:\n if (isTemplateNode(node)) {\n nextNode = nextSibling(node);\n replaceNode(\n vnode.el = node.content.firstChild,\n node,\n parentComponent\n );\n } else if (domType !== 8 || isFragmentStart) {\n nextNode = onMismatch();\n } else {\n nextNode = nextSibling(node);\n }\n break;\n case Static:\n if (isFragmentStart) {\n node = nextSibling(node);\n domType = node.nodeType;\n }\n if (domType === 1 || domType === 3) {\n nextNode = node;\n const needToAdoptContent = !vnode.children.length;\n for (let i = 0; i < vnode.staticCount; i++) {\n if (needToAdoptContent)\n vnode.children += nextNode.nodeType === 1 ? nextNode.outerHTML : nextNode.data;\n if (i === vnode.staticCount - 1) {\n vnode.anchor = nextNode;\n }\n nextNode = nextSibling(nextNode);\n }\n return isFragmentStart ? nextSibling(nextNode) : nextNode;\n } else {\n onMismatch();\n }\n break;\n case Fragment:\n if (!isFragmentStart) {\n nextNode = onMismatch();\n } else {\n nextNode = hydrateFragment(\n node,\n vnode,\n parentComponent,\n parentSuspense,\n slotScopeIds,\n optimized\n );\n }\n break;\n default:\n if (shapeFlag & 1) {\n if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) {\n nextNode = onMismatch();\n } else {\n nextNode = hydrateElement(\n node,\n vnode,\n parentComponent,\n parentSuspense,\n slotScopeIds,\n optimized\n );\n }\n } else if (shapeFlag & 6) {\n vnode.slotScopeIds = slotScopeIds;\n const container = parentNode(node);\n if (isFragmentStart) {\n nextNode = locateClosingAnchor(node);\n } else if (isComment(node) && node.data === \"teleport start\") {\n nextNode = locateClosingAnchor(node, node.data, \"teleport end\");\n } else {\n nextNode = nextSibling(node);\n }\n mountComponent(\n vnode,\n container,\n null,\n parentComponent,\n parentSuspense,\n getContainerType(container),\n optimized\n );\n if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) {\n let subTree;\n if (isFragmentStart) {\n subTree = createVNode(Fragment);\n subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;\n } else {\n subTree = node.nodeType === 3 ? createTextVNode(\"\") : createVNode(\"div\");\n }\n subTree.el = node;\n vnode.component.subTree = subTree;\n }\n } else if (shapeFlag & 64) {\n if (domType !== 8) {\n nextNode = onMismatch();\n } else {\n nextNode = vnode.type.hydrate(\n node,\n vnode,\n parentComponent,\n parentSuspense,\n slotScopeIds,\n optimized,\n rendererInternals,\n hydrateChildren\n );\n }\n } else if (shapeFlag & 128) {\n nextNode = vnode.type.hydrate(\n node,\n vnode,\n parentComponent,\n parentSuspense,\n getContainerType(parentNode(node)),\n slotScopeIds,\n optimized,\n rendererInternals,\n hydrateNode\n );\n } else if (!!(process.env.NODE_ENV !== \"production\") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) {\n warn$1(\"Invalid HostVNode type:\", type, `(${typeof type})`);\n }\n }\n if (ref != null) {\n setRef(ref, null, parentSuspense, vnode);\n }\n return nextNode;\n };\n const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {\n optimized = optimized || !!vnode.dynamicChildren;\n const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;\n const forcePatch = type === \"input\" || type === \"option\";\n if (!!(process.env.NODE_ENV !== \"production\") || forcePatch || patchFlag !== -1) {\n if (dirs) {\n invokeDirectiveHook(vnode, null, parentComponent, \"created\");\n }\n let needCallTransitionHooks = false;\n if (isTemplateNode(el)) {\n needCallTransitionHooks = needTransition(\n null,\n // no need check parentSuspense in hydration\n transition\n ) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;\n const content = el.content.firstChild;\n if (needCallTransitionHooks) {\n transition.beforeEnter(content);\n }\n replaceNode(content, el, parentComponent);\n vnode.el = el = content;\n }\n if (shapeFlag & 16 && // skip if element has innerHTML / textContent\n !(props && (props.innerHTML || props.textContent))) {\n let next = hydrateChildren(\n el.firstChild,\n vnode,\n el,\n parentComponent,\n parentSuspense,\n slotScopeIds,\n optimized\n );\n let hasWarned = false;\n while (next) {\n if (!isMismatchAllowed(el, 1 /* CHILDREN */)) {\n if ((!!(process.env.NODE_ENV !== \"production\") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && !hasWarned) {\n warn$1(\n `Hydration children mismatch on`,\n el,\n `\nServer rendered element contains more child nodes than client vdom.`\n );\n hasWarned = true;\n }\n logMismatchError();\n }\n const cur = next;\n next = next.nextSibling;\n remove(cur);\n }\n } else if (shapeFlag & 8) {\n let clientText = vnode.children;\n if (clientText[0] === \"\\n\" && (el.tagName === \"PRE\" || el.tagName === \"TEXTAREA\")) {\n clientText = clientText.slice(1);\n }\n if (el.textContent !== clientText) {\n if (!isMismatchAllowed(el, 0 /* TEXT */)) {\n (!!(process.env.NODE_ENV !== \"production\") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn$1(\n `Hydration text content mismatch on`,\n el,\n `\n - rendered on server: ${el.textContent}\n - expected on client: ${vnode.children}`\n );\n logMismatchError();\n }\n el.textContent = vnode.children;\n }\n }\n if (props) {\n if (!!(process.env.NODE_ENV !== \"production\") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__ || forcePatch || !optimized || patchFlag & (16 | 32)) {\n const isCustomElement = el.tagName.includes(\"-\");\n for (const key in props) {\n if ((!!(process.env.NODE_ENV !== \"production\") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && // #11189 skip if this node has directives that have created hooks\n // as it could have mutated the DOM in any possible way\n !(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) {\n logMismatchError();\n }\n if (forcePatch && (key.endsWith(\"value\") || key === \"indeterminate\") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers\n key[0] === \".\" || isCustomElement) {\n patchProp(el, key, null, props[key], void 0, parentComponent);\n }\n }\n } else if (props.onClick) {\n patchProp(\n el,\n \"onClick\",\n null,\n props.onClick,\n void 0,\n parentComponent\n );\n } else if (patchFlag & 4 && isReactive(props.style)) {\n for (const key in props.style) props.style[key];\n }\n }\n let vnodeHooks;\n if (vnodeHooks = props && props.onVnodeBeforeMount) {\n invokeVNodeHook(vnodeHooks, parentComponent, vnode);\n }\n if (dirs) {\n invokeDirectiveHook(vnode, null, parentComponent, \"beforeMount\");\n }\n if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {\n queueEffectWithSuspense(() => {\n vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);\n needCallTransitionHooks && transition.enter(el);\n dirs && invokeDirectiveHook(vnode, null, parentComponent, \"mounted\");\n }, parentSuspense);\n }\n }\n return el.nextSibling;\n };\n const hydrateChildren = (node, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized) => {\n optimized = optimized || !!parentVNode.dynamicChildren;\n const children = parentVNode.children;\n const l = children.length;\n let hasWarned = false;\n for (let i = 0; i < l; i++) {\n const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);\n const isText = vnode.type === Text;\n if (node) {\n if (isText && !optimized) {\n if (i + 1 < l && normalizeVNode(children[i + 1]).type === Text) {\n insert(\n createText(\n node.data.slice(vnode.children.length)\n ),\n container,\n nextSibling(node)\n );\n node.data = vnode.children;\n }\n }\n node = hydrateNode(\n node,\n vnode,\n parentComponent,\n parentSuspense,\n slotScopeIds,\n optimized\n );\n } else if (isText && !vnode.children) {\n insert(vnode.el = createText(\"\"), container);\n } else {\n if (!isMismatchAllowed(container, 1 /* CHILDREN */)) {\n if ((!!(process.env.NODE_ENV !== \"production\") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && !hasWarned) {\n warn$1(\n `Hydration children mismatch on`,\n container,\n `\nServer rendered element contains fewer child nodes than client vdom.`\n );\n hasWarned = true;\n }\n logMismatchError();\n }\n patch(\n null,\n vnode,\n container,\n null,\n parentComponent,\n parentSuspense,\n getContainerType(container),\n slotScopeIds\n );\n }\n }\n return node;\n };\n const hydrateFragment = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {\n const { slotScopeIds: fragmentSlotScopeIds } = vnode;\n if (fragmentSlotScopeIds) {\n slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;\n }\n const container = parentNode(node);\n const next = hydrateChildren(\n nextSibling(node),\n vnode,\n container,\n parentComponent,\n parentSuspense,\n slotScopeIds,\n optimized\n );\n if (next && isComment(next) && next.data === \"]\") {\n return nextSibling(vnode.anchor = next);\n } else {\n logMismatchError();\n insert(vnode.anchor = createComment(`]`), container, next);\n return next;\n }\n };\n const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {\n if (!isMismatchAllowed(node.parentElement, 1 /* CHILDREN */)) {\n (!!(process.env.NODE_ENV !== \"production\") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn$1(\n `Hydration node mismatch:\n- rendered on server:`,\n node,\n node.nodeType === 3 ? `(text)` : isComment(node) && node.data === \"[\" ? `(start of fragment)` : ``,\n `\n- expected on client:`,\n vnode.type\n );\n logMismatchError();\n }\n vnode.el = null;\n if (isFragment) {\n const end = locateClosingAnchor(node);\n while (true) {\n const next2 = nextSibling(node);\n if (next2 && next2 !== end) {\n remove(next2);\n } else {\n break;\n }\n }\n }\n const next = nextSibling(node);\n const container = parentNode(node);\n remove(node);\n patch(\n null,\n vnode,\n container,\n next,\n parentComponent,\n parentSuspense,\n getContainerType(container),\n slotScopeIds\n );\n if (parentComponent) {\n parentComponent.vnode.el = vnode.el;\n updateHOCHostEl(parentComponent, vnode.el);\n }\n return next;\n };\n const locateClosingAnchor = (node, open = \"[\", close = \"]\") => {\n let match = 0;\n while (node) {\n node = nextSibling(node);\n if (node && isComment(node)) {\n if (node.data === open) match++;\n if (node.data === close) {\n if (match === 0) {\n return nextSibling(node);\n } else {\n match--;\n }\n }\n }\n }\n return node;\n };\n const replaceNode = (newNode, oldNode, parentComponent) => {\n const parentNode2 = oldNode.parentNode;\n if (parentNode2) {\n parentNode2.replaceChild(newNode, oldNode);\n }\n let parent = parentComponent;\n while (parent) {\n if (parent.vnode.el === oldNode) {\n parent.vnode.el = parent.subTree.el = newNode;\n }\n parent = parent.parent;\n }\n };\n const isTemplateNode = (node) => {\n return node.nodeType === 1 && node.tagName === \"TEMPLATE\";\n };\n return [hydrate, hydrateNode];\n}\nfunction propHasMismatch(el, key, clientValue, vnode, instance) {\n let mismatchType;\n let mismatchKey;\n let actual;\n let expected;\n if (key === \"class\") {\n actual = el.getAttribute(\"class\");\n expected = normalizeClass(clientValue);\n if (!isSetEqual(toClassSet(actual || \"\"), toClassSet(expected))) {\n mismatchType = 2 /* CLASS */;\n mismatchKey = `class`;\n }\n } else if (key === \"style\") {\n actual = el.getAttribute(\"style\") || \"\";\n expected = isString(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue));\n const actualMap = toStyleMap(actual);\n const expectedMap = toStyleMap(expected);\n if (vnode.dirs) {\n for (const { dir, value } of vnode.dirs) {\n if (dir.name === \"show\" && !value) {\n expectedMap.set(\"display\", \"none\");\n }\n }\n }\n if (instance) {\n resolveCssVars(instance, vnode, expectedMap);\n }\n if (!isMapEqual(actualMap, expectedMap)) {\n mismatchType = 3 /* STYLE */;\n mismatchKey = \"style\";\n }\n } else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {\n if (isBooleanAttr(key)) {\n actual = el.hasAttribute(key);\n expected = includeBooleanAttr(clientValue);\n } else if (clientValue == null) {\n actual = el.hasAttribute(key);\n expected = false;\n } else {\n if (el.hasAttribute(key)) {\n actual = el.getAttribute(key);\n } else if (key === \"value\" && el.tagName === \"TEXTAREA\") {\n actual = el.value;\n } else {\n actual = false;\n }\n expected = isRenderableAttrValue(clientValue) ? String(clientValue) : false;\n }\n if (actual !== expected) {\n mismatchType = 4 /* ATTRIBUTE */;\n mismatchKey = key;\n }\n }\n if (mismatchType != null && !isMismatchAllowed(el, mismatchType)) {\n const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}=\"${v}\"`;\n const preSegment = `Hydration ${MismatchTypeString[mismatchType]} mismatch on`;\n const postSegment = `\n - rendered on server: ${format(actual)}\n - expected on client: ${format(expected)}\n Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead.\n You should fix the source of the mismatch.`;\n {\n warn$1(preSegment, el, postSegment);\n }\n return true;\n }\n return false;\n}\nfunction toClassSet(str) {\n return new Set(str.trim().split(/\\s+/));\n}\nfunction isSetEqual(a, b) {\n if (a.size !== b.size) {\n return false;\n }\n for (const s of a) {\n if (!b.has(s)) {\n return false;\n }\n }\n return true;\n}\nfunction toStyleMap(str) {\n const styleMap = /* @__PURE__ */ new Map();\n for (const item of str.split(\";\")) {\n let [key, value] = item.split(\":\");\n key = key.trim();\n value = value && value.trim();\n if (key && value) {\n styleMap.set(key, value);\n }\n }\n return styleMap;\n}\nfunction isMapEqual(a, b) {\n if (a.size !== b.size) {\n return false;\n }\n for (const [key, value] of a) {\n if (value !== b.get(key)) {\n return false;\n }\n }\n return true;\n}\nfunction resolveCssVars(instance, vnode, expectedMap) {\n const root = instance.subTree;\n if (instance.getCssVars && (vnode === root || root && root.type === Fragment && root.children.includes(vnode))) {\n const cssVars = instance.getCssVars();\n for (const key in cssVars) {\n expectedMap.set(\n `--${getEscapedCssVarName(key, false)}`,\n String(cssVars[key])\n );\n }\n }\n if (vnode === root && instance.parent) {\n resolveCssVars(instance.parent, instance.vnode, expectedMap);\n }\n}\nconst allowMismatchAttr = \"data-allow-mismatch\";\nconst MismatchTypeString = {\n [0 /* TEXT */]: \"text\",\n [1 /* CHILDREN */]: \"children\",\n [2 /* CLASS */]: \"class\",\n [3 /* STYLE */]: \"style\",\n [4 /* ATTRIBUTE */]: \"attribute\"\n};\nfunction isMismatchAllowed(el, allowedType) {\n if (allowedType === 0 /* TEXT */ || allowedType === 1 /* CHILDREN */) {\n while (el && !el.hasAttribute(allowMismatchAttr)) {\n el = el.parentElement;\n }\n }\n const allowedAttr = el && el.getAttribute(allowMismatchAttr);\n if (allowedAttr == null) {\n return false;\n } else if (allowedAttr === \"\") {\n return true;\n } else {\n const list = allowedAttr.split(\",\");\n if (allowedType === 0 /* TEXT */ && list.includes(\"children\")) {\n return true;\n }\n return allowedAttr.split(\",\").includes(MismatchTypeString[allowedType]);\n }\n}\n\nconst requestIdleCallback = getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1));\nconst cancelIdleCallback = getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id));\nconst hydrateOnIdle = (timeout = 1e4) => (hydrate) => {\n const id = requestIdleCallback(hydrate, { timeout });\n return () => cancelIdleCallback(id);\n};\nfunction elementIsVisibleInViewport(el) {\n const { top, left, bottom, right } = el.getBoundingClientRect();\n const { innerHeight, innerWidth } = window;\n return (top > 0 && top < innerHeight || bottom > 0 && bottom < innerHeight) && (left > 0 && left < innerWidth || right > 0 && right < innerWidth);\n}\nconst hydrateOnVisible = (opts) => (hydrate, forEach) => {\n const ob = new IntersectionObserver((entries) => {\n for (const e of entries) {\n if (!e.isIntersecting) continue;\n ob.disconnect();\n hydrate();\n break;\n }\n }, opts);\n forEach((el) => {\n if (!(el instanceof Element)) return;\n if (elementIsVisibleInViewport(el)) {\n hydrate();\n ob.disconnect();\n return false;\n }\n ob.observe(el);\n });\n return () => ob.disconnect();\n};\nconst hydrateOnMediaQuery = (query) => (hydrate) => {\n if (query) {\n const mql = matchMedia(query);\n if (mql.matches) {\n hydrate();\n } else {\n mql.addEventListener(\"change\", hydrate, { once: true });\n return () => mql.removeEventListener(\"change\", hydrate);\n }\n }\n};\nconst hydrateOnInteraction = (interactions = []) => (hydrate, forEach) => {\n if (isString(interactions)) interactions = [interactions];\n let hasHydrated = false;\n const doHydrate = (e) => {\n if (!hasHydrated) {\n hasHydrated = true;\n teardown();\n hydrate();\n e.target.dispatchEvent(new e.constructor(e.type, e));\n }\n };\n const teardown = () => {\n forEach((el) => {\n for (const i of interactions) {\n el.removeEventListener(i, doHydrate);\n }\n });\n };\n forEach((el) => {\n for (const i of interactions) {\n el.addEventListener(i, doHydrate, { once: true });\n }\n });\n return teardown;\n};\nfunction forEachElement(node, cb) {\n if (isComment(node) && node.data === \"[\") {\n let depth = 1;\n let next = node.nextSibling;\n while (next) {\n if (next.nodeType === 1) {\n const result = cb(next);\n if (result === false) {\n break;\n }\n } else if (isComment(next)) {\n if (next.data === \"]\") {\n if (--depth === 0) break;\n } else if (next.data === \"[\") {\n depth++;\n }\n }\n next = next.nextSibling;\n }\n } else {\n cb(node);\n }\n}\n\nconst isAsyncWrapper = (i) => !!i.type.__asyncLoader;\n/*! #__NO_SIDE_EFFECTS__ */\n// @__NO_SIDE_EFFECTS__\nfunction defineAsyncComponent(source) {\n if (isFunction(source)) {\n source = { loader: source };\n }\n const {\n loader,\n loadingComponent,\n errorComponent,\n delay = 200,\n hydrate: hydrateStrategy,\n timeout,\n // undefined = never times out\n suspensible = true,\n onError: userOnError\n } = source;\n let pendingRequest = null;\n let resolvedComp;\n let retries = 0;\n const retry = () => {\n retries++;\n pendingRequest = null;\n return load();\n };\n const load = () => {\n let thisRequest;\n return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {\n err = err instanceof Error ? err : new Error(String(err));\n if (userOnError) {\n return new Promise((resolve, reject) => {\n const userRetry = () => resolve(retry());\n const userFail = () => reject(err);\n userOnError(err, userRetry, userFail, retries + 1);\n });\n } else {\n throw err;\n }\n }).then((comp) => {\n if (thisRequest !== pendingRequest && pendingRequest) {\n return pendingRequest;\n }\n if (!!(process.env.NODE_ENV !== \"production\") && !comp) {\n warn$1(\n `Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.`\n );\n }\n if (comp && (comp.__esModule || comp[Symbol.toStringTag] === \"Module\")) {\n comp = comp.default;\n }\n if (!!(process.env.NODE_ENV !== \"production\") && comp && !isObject(comp) && !isFunction(comp)) {\n throw new Error(`Invalid async component load result: ${comp}`);\n }\n resolvedComp = comp;\n return comp;\n }));\n };\n return defineComponent({\n name: \"AsyncComponentWrapper\",\n __asyncLoader: load,\n __asyncHydrate(el, instance, hydrate) {\n const doHydrate = hydrateStrategy ? () => {\n const teardown = hydrateStrategy(\n hydrate,\n (cb) => forEachElement(el, cb)\n );\n if (teardown) {\n (instance.bum || (instance.bum = [])).push(teardown);\n }\n } : hydrate;\n if (resolvedComp) {\n doHydrate();\n } else {\n load().then(() => !instance.isUnmounted && doHydrate());\n }\n },\n get __asyncResolved() {\n return resolvedComp;\n },\n setup() {\n const instance = currentInstance;\n markAsyncBoundary(instance);\n if (resolvedComp) {\n return () => createInnerComp(resolvedComp, instance);\n }\n const onError = (err) => {\n pendingRequest = null;\n handleError(\n err,\n instance,\n 13,\n !errorComponent\n );\n };\n if (suspensible && instance.suspense || isInSSRComponentSetup) {\n return load().then((comp) => {\n return () => createInnerComp(comp, instance);\n }).catch((err) => {\n onError(err);\n return () => errorComponent ? createVNode(errorComponent, {\n error: err\n }) : null;\n });\n }\n const loaded = ref(false);\n const error = ref();\n const delayed = ref(!!delay);\n if (delay) {\n setTimeout(() => {\n delayed.value = false;\n }, delay);\n }\n if (timeout != null) {\n setTimeout(() => {\n if (!loaded.value && !error.value) {\n const err = new Error(\n `Async component timed out after ${timeout}ms.`\n );\n onError(err);\n error.value = err;\n }\n }, timeout);\n }\n load().then(() => {\n loaded.value = true;\n if (instance.parent && isKeepAlive(instance.parent.vnode)) {\n instance.parent.update();\n }\n }).catch((err) => {\n onError(err);\n error.value = err;\n });\n return () => {\n if (loaded.value && resolvedComp) {\n return createInnerComp(resolvedComp, instance);\n } else if (error.value && errorComponent) {\n return createVNode(errorComponent, {\n error: error.value\n });\n } else if (loadingComponent && !delayed.value) {\n return createVNode(loadingComponent);\n }\n };\n }\n });\n}\nfunction createInnerComp(comp, parent) {\n const { ref: ref2, props, children, ce } = parent.vnode;\n const vnode = createVNode(comp, props, children);\n vnode.ref = ref2;\n vnode.ce = ce;\n delete parent.vnode.ce;\n return vnode;\n}\n\nconst isKeepAlive = (vnode) => vnode.type.__isKeepAlive;\nconst KeepAliveImpl = {\n name: `KeepAlive`,\n // Marker for special handling inside the renderer. We are not using a ===\n // check directly on KeepAlive in the renderer, because importing it directly\n // would prevent it from being tree-shaken.\n __isKeepAlive: true,\n props: {\n include: [String, RegExp, Array],\n exclude: [String, RegExp, Array],\n max: [String, Number]\n },\n setup(props, { slots }) {\n const instance = getCurrentInstance();\n const sharedContext = instance.ctx;\n if (!sharedContext.renderer) {\n return () => {\n const children = slots.default && slots.default();\n return children && children.length === 1 ? children[0] : children;\n };\n }\n const cache = /* @__PURE__ */ new Map();\n const keys = /* @__PURE__ */ new Set();\n let current = null;\n if (!!(process.env.NODE_ENV !== \"production\") || __VUE_PROD_DEVTOOLS__) {\n instance.__v_cache = cache;\n }\n const parentSuspense = instance.suspense;\n const {\n renderer: {\n p: patch,\n m: move,\n um: _unmount,\n o: { createElement }\n }\n } = sharedContext;\n const storageContainer = createElement(\"div\");\n sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {\n const instance2 = vnode.component;\n move(vnode, container, anchor, 0, parentSuspense);\n patch(\n instance2.vnode,\n vnode,\n container,\n anchor,\n instance2,\n parentSuspense,\n namespace,\n vnode.slotScopeIds,\n optimized\n );\n queuePostRenderEffect(() => {\n instance2.isDeactivated = false;\n if (instance2.a) {\n invokeArrayFns(instance2.a);\n }\n const vnodeHook = vnode.props && vnode.props.onVnodeMounted;\n if (vnodeHook) {\n invokeVNodeHook(vnodeHook, instance2.parent, vnode);\n }\n }, parentSuspense);\n if (!!(process.env.NODE_ENV !== \"production\") || __VUE_PROD_DEVTOOLS__) {\n devtoolsComponentAdded(instance2);\n }\n };\n sharedContext.deactivate = (vnode) => {\n const instance2 = vnode.component;\n invalidateMount(instance2.m);\n invalidateMount(instance2.a);\n move(vnode, storageContainer, null, 1, parentSuspense);\n queuePostRenderEffect(() => {\n if (instance2.da) {\n invokeArrayFns(instance2.da);\n }\n const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;\n if (vnodeHook) {\n invokeVNodeHook(vnodeHook, instance2.parent, vnode);\n }\n instance2.isDeactivated = true;\n }, parentSuspense);\n if (!!(process.env.NODE_ENV !== \"production\") || __VUE_PROD_DEVTOOLS__) {\n devtoolsComponentAdded(instance2);\n }\n };\n function unmount(vnode) {\n resetShapeFlag(vnode);\n _unmount(vnode, instance, parentSuspense, true);\n }\n function pruneCache(filter) {\n cache.forEach((vnode, key) => {\n const name = getComponentName(vnode.type);\n if (name && !filter(name)) {\n pruneCacheEntry(key);\n }\n });\n }\n function pruneCacheEntry(key) {\n const cached = cache.get(key);\n if (cached && (!current || !isSameVNodeType(cached, current))) {\n unmount(cached);\n } else if (current) {\n resetShapeFlag(current);\n }\n cache.delete(key);\n keys.delete(key);\n }\n watch(\n () => [props.include, props.exclude],\n ([include, exclude]) => {\n include && pruneCache((name) => matches(include, name));\n exclude && pruneCache((name) => !matches(exclude, name));\n },\n // prune post-render after `current` has been updated\n { flush: \"post\", deep: true }\n );\n let pendingCacheKey = null;\n const cacheSubtree = () => {\n if (pendingCacheKey != null) {\n if (isSuspense(instance.subTree.type)) {\n queuePostRenderEffect(() => {\n cache.set(pendingCacheKey, getInnerChild(instance.subTree));\n }, instance.subTree.suspense);\n } else {\n cache.set(pendingCacheKey, getInnerChild(instance.subTree));\n }\n }\n };\n onMounted(cacheSubtree);\n onUpdated(cacheSubtree);\n onBeforeUnmount(() => {\n cache.forEach((cached) => {\n const { subTree, suspense } = instance;\n const vnode = getInnerChild(subTree);\n if (cached.type === vnode.type && cached.key === vnode.key) {\n resetShapeFlag(vnode);\n const da = vnode.component.da;\n da && queuePostRenderEffect(da, suspense);\n return;\n }\n unmount(cached);\n });\n });\n return () => {\n pendingCacheKey = null;\n if (!slots.default) {\n return current = null;\n }\n const children = slots.default();\n const rawVNode = children[0];\n if (children.length > 1) {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n warn$1(`KeepAlive should contain exactly one component child.`);\n }\n current = null;\n return children;\n } else if (!isVNode(rawVNode) || !(rawVNode.shapeFlag & 4) && !(rawVNode.shapeFlag & 128)) {\n current = null;\n return rawVNode;\n }\n let vnode = getInnerChild(rawVNode);\n if (vnode.type === Comment) {\n current = null;\n return vnode;\n }\n const comp = vnode.type;\n const name = getComponentName(\n isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp\n );\n const { include, exclude, max } = props;\n if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) {\n vnode.shapeFlag &= ~256;\n current = vnode;\n return rawVNode;\n }\n const key = vnode.key == null ? comp : vnode.key;\n const cachedVNode = cache.get(key);\n if (vnode.el) {\n vnode = cloneVNode(vnode);\n if (rawVNode.shapeFlag & 128) {\n rawVNode.ssContent = vnode;\n }\n }\n pendingCacheKey = key;\n if (cachedVNode) {\n vnode.el = cachedVNode.el;\n vnode.component = cachedVNode.component;\n if (vnode.transition) {\n setTransitionHooks(vnode, vnode.transition);\n }\n vnode.shapeFlag |= 512;\n keys.delete(key);\n keys.add(key);\n } else {\n keys.add(key);\n if (max && keys.size > parseInt(max, 10)) {\n pruneCacheEntry(keys.values().next().value);\n }\n }\n vnode.shapeFlag |= 256;\n current = vnode;\n return isSuspense(rawVNode.type) ? rawVNode : vnode;\n };\n }\n};\nconst KeepAlive = KeepAliveImpl;\nfunction matches(pattern, name) {\n if (isArray(pattern)) {\n return pattern.some((p) => matches(p, name));\n } else if (isString(pattern)) {\n return pattern.split(\",\").includes(name);\n } else if (isRegExp(pattern)) {\n pattern.lastIndex = 0;\n return pattern.test(name);\n }\n return false;\n}\nfunction onActivated(hook, target) {\n registerKeepAliveHook(hook, \"a\", target);\n}\nfunction onDeactivated(hook, target) {\n registerKeepAliveHook(hook, \"da\", target);\n}\nfunction registerKeepAliveHook(hook, type, target = currentInstance) {\n const wrappedHook = hook.__wdc || (hook.__wdc = () => {\n let current = target;\n while (current) {\n if (current.isDeactivated) {\n return;\n }\n current = current.parent;\n }\n return hook();\n });\n injectHook(type, wrappedHook, target);\n if (target) {\n let current = target.parent;\n while (current && current.parent) {\n if (isKeepAlive(current.parent.vnode)) {\n injectToKeepAliveRoot(wrappedHook, type, target, current);\n }\n current = current.parent;\n }\n }\n}\nfunction injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {\n const injected = injectHook(\n type,\n hook,\n keepAliveRoot,\n true\n /* prepend */\n );\n onUnmounted(() => {\n remove(keepAliveRoot[type], injected);\n }, target);\n}\nfunction resetShapeFlag(vnode) {\n vnode.shapeFlag &= ~256;\n vnode.shapeFlag &= ~512;\n}\nfunction getInnerChild(vnode) {\n return vnode.shapeFlag & 128 ? vnode.ssContent : vnode;\n}\n\nfunction injectHook(type, hook, target = currentInstance, prepend = false) {\n if (target) {\n const hooks = target[type] || (target[type] = []);\n const wrappedHook = hook.__weh || (hook.__weh = (...args) => {\n pauseTracking();\n const reset = setCurrentInstance(target);\n const res = callWithAsyncErrorHandling(hook, target, type, args);\n reset();\n resetTracking();\n return res;\n });\n if (prepend) {\n hooks.unshift(wrappedHook);\n } else {\n hooks.push(wrappedHook);\n }\n return wrappedHook;\n } else if (!!(process.env.NODE_ENV !== \"production\")) {\n const apiName = toHandlerKey(ErrorTypeStrings$1[type].replace(/ hook$/, \"\"));\n warn$1(\n `${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup().` + (` If you are using async setup(), make sure to register lifecycle hooks before the first await statement.` )\n );\n }\n}\nconst createHook = (lifecycle) => (hook, target = currentInstance) => {\n if (!isInSSRComponentSetup || lifecycle === \"sp\") {\n injectHook(lifecycle, (...args) => hook(...args), target);\n }\n};\nconst onBeforeMount = createHook(\"bm\");\nconst onMounted = createHook(\"m\");\nconst onBeforeUpdate = createHook(\n \"bu\"\n);\nconst onUpdated = createHook(\"u\");\nconst onBeforeUnmount = createHook(\n \"bum\"\n);\nconst onUnmounted = createHook(\"um\");\nconst onServerPrefetch = createHook(\n \"sp\"\n);\nconst onRenderTriggered = createHook(\"rtg\");\nconst onRenderTracked = createHook(\"rtc\");\nfunction onErrorCaptured(hook, target = currentInstance) {\n injectHook(\"ec\", hook, target);\n}\n\nconst COMPONENTS = \"components\";\nconst DIRECTIVES = \"directives\";\nfunction resolveComponent(name, maybeSelfReference) {\n return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;\n}\nconst NULL_DYNAMIC_COMPONENT = Symbol.for(\"v-ndc\");\nfunction resolveDynamicComponent(component) {\n if (isString(component)) {\n return resolveAsset(COMPONENTS, component, false) || component;\n } else {\n return component || NULL_DYNAMIC_COMPONENT;\n }\n}\nfunction resolveDirective(name) {\n return resolveAsset(DIRECTIVES, name);\n}\nfunction resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {\n const instance = currentRenderingInstance || currentInstance;\n if (instance) {\n const Component = instance.type;\n if (type === COMPONENTS) {\n const selfName = getComponentName(\n Component,\n false\n );\n if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) {\n return Component;\n }\n }\n const res = (\n // local registration\n // check instance[type] first which is resolved for options API\n resolve(instance[type] || Component[type], name) || // global registration\n resolve(instance.appContext[type], name)\n );\n if (!res && maybeSelfReference) {\n return Component;\n }\n if (!!(process.env.NODE_ENV !== \"production\") && warnMissing && !res) {\n const extra = type === COMPONENTS ? `\nIf this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``;\n warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);\n }\n return res;\n } else if (!!(process.env.NODE_ENV !== \"production\")) {\n warn$1(\n `resolve${capitalize(type.slice(0, -1))} can only be used in render() or setup().`\n );\n }\n}\nfunction resolve(registry, name) {\n return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]);\n}\n\nfunction renderList(source, renderItem, cache, index) {\n let ret;\n const cached = cache && cache[index];\n const sourceIsArray = isArray(source);\n if (sourceIsArray || isString(source)) {\n const sourceIsReactiveArray = sourceIsArray && isReactive(source);\n let needsWrap = false;\n if (sourceIsReactiveArray) {\n needsWrap = !isShallow(source);\n source = shallowReadArray(source);\n }\n ret = new Array(source.length);\n for (let i = 0, l = source.length; i < l; i++) {\n ret[i] = renderItem(\n needsWrap ? toReactive(source[i]) : source[i],\n i,\n void 0,\n cached && cached[i]\n );\n }\n } else if (typeof source === \"number\") {\n if (!!(process.env.NODE_ENV !== \"production\") && !Number.isInteger(source)) {\n warn$1(`The v-for range expect an integer value but got ${source}.`);\n }\n ret = new Array(source);\n for (let i = 0; i < source; i++) {\n ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);\n }\n } else if (isObject(source)) {\n if (source[Symbol.iterator]) {\n ret = Array.from(\n source,\n (item, i) => renderItem(item, i, void 0, cached && cached[i])\n );\n } else {\n const keys = Object.keys(source);\n ret = new Array(keys.length);\n for (let i = 0, l = keys.length; i < l; i++) {\n const key = keys[i];\n ret[i] = renderItem(source[key], key, i, cached && cached[i]);\n }\n }\n } else {\n ret = [];\n }\n if (cache) {\n cache[index] = ret;\n }\n return ret;\n}\n\nfunction createSlots(slots, dynamicSlots) {\n for (let i = 0; i < dynamicSlots.length; i++) {\n const slot = dynamicSlots[i];\n if (isArray(slot)) {\n for (let j = 0; j < slot.length; j++) {\n slots[slot[j].name] = slot[j].fn;\n }\n } else if (slot) {\n slots[slot.name] = slot.key ? (...args) => {\n const res = slot.fn(...args);\n if (res) res.key = slot.key;\n return res;\n } : slot.fn;\n }\n }\n return slots;\n}\n\nfunction renderSlot(slots, name, props = {}, fallback, noSlotted) {\n if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {\n if (name !== \"default\") props.name = name;\n return openBlock(), createBlock(\n Fragment,\n null,\n [createVNode(\"slot\", props, fallback && fallback())],\n 64\n );\n }\n let slot = slots[name];\n if (!!(process.env.NODE_ENV !== \"production\") && slot && slot.length > 1) {\n warn$1(\n `SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template.`\n );\n slot = () => [];\n }\n if (slot && slot._c) {\n slot._d = false;\n }\n openBlock();\n const validSlotContent = slot && ensureValidVNode(slot(props));\n const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch\n // key attached in the `createSlots` helper, respect that\n validSlotContent && validSlotContent.key;\n const rendered = createBlock(\n Fragment,\n {\n key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content\n (!validSlotContent && fallback ? \"_fb\" : \"\")\n },\n validSlotContent || (fallback ? fallback() : []),\n validSlotContent && slots._ === 1 ? 64 : -2\n );\n if (!noSlotted && rendered.scopeId) {\n rendered.slotScopeIds = [rendered.scopeId + \"-s\"];\n }\n if (slot && slot._c) {\n slot._d = true;\n }\n return rendered;\n}\nfunction ensureValidVNode(vnodes) {\n return vnodes.some((child) => {\n if (!isVNode(child)) return true;\n if (child.type === Comment) return false;\n if (child.type === Fragment && !ensureValidVNode(child.children))\n return false;\n return true;\n }) ? vnodes : null;\n}\n\nfunction toHandlers(obj, preserveCaseIfNecessary) {\n const ret = {};\n if (!!(process.env.NODE_ENV !== \"production\") && !isObject(obj)) {\n warn$1(`v-on with no argument expects an object value.`);\n return ret;\n }\n for (const key in obj) {\n ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : toHandlerKey(key)] = obj[key];\n }\n return ret;\n}\n\nconst getPublicInstance = (i) => {\n if (!i) return null;\n if (isStatefulComponent(i)) return getComponentPublicInstance(i);\n return getPublicInstance(i.parent);\n};\nconst publicPropertiesMap = (\n // Move PURE marker to new line to workaround compiler discarding it\n // due to type annotation\n /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), {\n $: (i) => i,\n $el: (i) => i.vnode.el,\n $data: (i) => i.data,\n $props: (i) => !!(process.env.NODE_ENV !== \"production\") ? shallowReadonly(i.props) : i.props,\n $attrs: (i) => !!(process.env.NODE_ENV !== \"production\") ? shallowReadonly(i.attrs) : i.attrs,\n $slots: (i) => !!(process.env.NODE_ENV !== \"production\") ? shallowReadonly(i.slots) : i.slots,\n $refs: (i) => !!(process.env.NODE_ENV !== \"production\") ? shallowReadonly(i.refs) : i.refs,\n $parent: (i) => getPublicInstance(i.parent),\n $root: (i) => getPublicInstance(i.root),\n $host: (i) => i.ce,\n $emit: (i) => i.emit,\n $options: (i) => __VUE_OPTIONS_API__ ? resolveMergedOptions(i) : i.type,\n $forceUpdate: (i) => i.f || (i.f = () => {\n queueJob(i.update);\n }),\n $nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)),\n $watch: (i) => __VUE_OPTIONS_API__ ? instanceWatch.bind(i) : NOOP\n })\n);\nconst isReservedPrefix = (key) => key === \"_\" || key === \"$\";\nconst hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);\nconst PublicInstanceProxyHandlers = {\n get({ _: instance }, key) {\n if (key === \"__v_skip\") {\n return true;\n }\n const { ctx, setupState, data, props, accessCache, type, appContext } = instance;\n if (!!(process.env.NODE_ENV !== \"production\") && key === \"__isVue\") {\n return true;\n }\n let normalizedProps;\n if (key[0] !== \"$\") {\n const n = accessCache[key];\n if (n !== void 0) {\n switch (n) {\n case 1 /* SETUP */:\n return setupState[key];\n case 2 /* DATA */:\n return data[key];\n case 4 /* CONTEXT */:\n return ctx[key];\n case 3 /* PROPS */:\n return props[key];\n }\n } else if (hasSetupBinding(setupState, key)) {\n accessCache[key] = 1 /* SETUP */;\n return setupState[key];\n } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {\n accessCache[key] = 2 /* DATA */;\n return data[key];\n } else if (\n // only cache other properties when instance has declared (thus stable)\n // props\n (normalizedProps = instance.propsOptions[0]) && hasOwn(normalizedProps, key)\n ) {\n accessCache[key] = 3 /* PROPS */;\n return props[key];\n } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {\n accessCache[key] = 4 /* CONTEXT */;\n return ctx[key];\n } else if (!__VUE_OPTIONS_API__ || shouldCacheAccess) {\n accessCache[key] = 0 /* OTHER */;\n }\n }\n const publicGetter = publicPropertiesMap[key];\n let cssModule, globalProperties;\n if (publicGetter) {\n if (key === \"$attrs\") {\n track(instance.attrs, \"get\", \"\");\n !!(process.env.NODE_ENV !== \"production\") && markAttrsAccessed();\n } else if (!!(process.env.NODE_ENV !== \"production\") && key === \"$slots\") {\n track(instance, \"get\", key);\n }\n return publicGetter(instance);\n } else if (\n // css module (injected by vue-loader)\n (cssModule = type.__cssModules) && (cssModule = cssModule[key])\n ) {\n return cssModule;\n } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {\n accessCache[key] = 4 /* CONTEXT */;\n return ctx[key];\n } else if (\n // global properties\n globalProperties = appContext.config.globalProperties, hasOwn(globalProperties, key)\n ) {\n {\n return globalProperties[key];\n }\n } else if (!!(process.env.NODE_ENV !== \"production\") && currentRenderingInstance && (!isString(key) || // #1091 avoid internal isRef/isVNode checks on component instance leading\n // to infinite warning loop\n key.indexOf(\"__v\") !== 0)) {\n if (data !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn(data, key)) {\n warn$1(\n `Property ${JSON.stringify(\n key\n )} must be accessed via $data because it starts with a reserved character (\"$\" or \"_\") and is not proxied on the render context.`\n );\n } else if (instance === currentRenderingInstance) {\n warn$1(\n `Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.`\n );\n }\n }\n },\n set({ _: instance }, key, value) {\n const { data, setupState, ctx } = instance;\n if (hasSetupBinding(setupState, key)) {\n setupState[key] = value;\n return true;\n } else if (!!(process.env.NODE_ENV !== \"production\") && setupState.__isScriptSetup && hasOwn(setupState, key)) {\n warn$1(`Cannot mutate \r\n","\r\n\r\n\r\n","import { URLS, URLS_JA } from \"@/define\";\r\nexport function getUrl(val: string) {\r\n const lang = localStorage.getItem(\"selectedLanguage\") ?? \"en\";\r\n if (lang === \"en\") {\r\n return URLS[val];\r\n } else if (lang === \"ja\") {\r\n return URLS_JA[val];\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\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 \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 \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 \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\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 \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 \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 \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\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 \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\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\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\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 Download_on_the_App_Store_Badge_JP_RGB_blk_100317\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 \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 \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 \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 \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 \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 \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 \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 \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\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 TIME WINNER\r\n 23\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\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\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 \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\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 GUARANTEE\r\n 30-DAY MONEY-BACK\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 GUARANTEE\r\n 30-DAY MONEY-BACK\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\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 \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\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\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\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","export enum pageStates {\r\n payment = \"payment\",\r\n createAccount = \"createAccount\",\r\n orderConfirmation = \"orderConfirmation\",\r\n email = \"email\",\r\n reviewOrder = \"reviewOrder\",\r\n}\r\n\r\nexport enum layoutStates {\r\n purchase = \"purchase\",\r\n editShipping = \"editShipping\",\r\n editPayment = \"editPayment\",\r\n editPayPalShippingAddress = \"editPayPalShippingAddress\",\r\n}\r\n\r\nexport enum emailPageStates {\r\n enterEmail = \"enterEmail\",\r\n alreadyAnAccount = \"alreadyAnAccount\",\r\n addedEmail = \"addedEmail\",\r\n hideEmail = \"hideEmail\",\r\n}\r\n\r\nexport enum terms {\r\n monthToMonth = \"monthToMonth\",\r\n year = \"year\",\r\n years = \"years\",\r\n}\r\n\r\nexport enum productTypes {\r\n safeConsumer = \"safeConsumer\",\r\n webroot = \"webroot\",\r\n}\r\n\r\nexport enum adjustments {\r\n Tax = \"Tax\",\r\n UsedCreditBalance = \"UsedCreditBalance\",\r\n RemainingCreditBalance = \"RemainingCreditBalance\",\r\n PromoCodeAmt = \"PromoCodeAmt\",\r\n PromoCodePct = \"PromoCodePct\",\r\n PriorSubscriptionCredit = \"PriorSubscriptionCredit\",\r\n OneTimeAmt = \"OneTimeAmt\",\r\n BonusMonthsPromo = \"BonusMonthsPromo\",\r\n Discounts = \"Discounts\",\r\n TrialDaysRemaining = \"TrialDaysRemaining\",\r\n LicenseDaysRemaining = \"LicenseDaysRemaining\",\r\n}\r\n\r\nexport enum promoCodeStates {\r\n enter = \"Enter\",\r\n applied = \"Applied\",\r\n}\r\n\r\nexport enum purchaseErrors {\r\n CCAddress = \"CCAddress\",\r\n CCTransaction = \"CCTransaction\",\r\n InvalidUpgradePath = \"InvalidUpgradePath\",\r\n SubscriptionExpired = \"SubscriptionExpired\",\r\n InvalidRemainingDays = \"InvalidRemainingDays\",\r\n CartItemRatePlanIdInvalid = \"CartItemRatePlanIdInvalid\",\r\n SmbUserIneligible = \"SmbUserIneligible\",\r\n AlreadyHaveOneAllstateSku = \"AlreadyHaveOneAllstateSku\",\r\n AlreadyHasVPNPSku = \"AlreadyHasVPNPSku\",\r\n PurchaseFailureError = \"PurchaseFailureError\",\r\n NotEligibleForRenewal = \"NotEligibleForRenewal\",\r\n UnderMaintenance = \"UnderMaintenance\",\r\n OwnedByBestBuy = \"OwnedByBestBuy\",\r\n UpgradeOnRetailRenewalNotAllowed = \"UpgradeOnRetailRenewalNotAllowed\",\r\n InvalidPromotionCode = \"InvalidPromotionCode\",\r\n InvalidSubscription = \"InvalidSubscription\",\r\n InvalidComputerId = \"InvalidComputerId\",\r\n SmbComputerIneligible = \"SmbComputerIneligible\",\r\n UpgradeDuringFruWindowNotAllowed = \"UpgradeDuringFruWindowNotAllowed\",\r\n FruInFruWindowNotAllowed = \"FruInFruWindowNotAllowed\",\r\n HasOutstandingInvoices = \"HasOutstandingInvoices\",\r\n RetailUpgradeNotAllowed = \"RetailUpgradeNotAllowed\",\r\n BadLicenseKey = \"BadLicenseKey\",\r\n WTPUpgradeByComputerIdNotAllowed = \"WTPUpgradeByComputerIdNotAllowed\",\r\n}\r\n\r\nexport enum purchaseErrorsNotifications {\r\n CCAddress = \"CreditCardAddressError\",\r\n CCTransaction = \"CreditCardDeclinedError\",\r\n PurchaseFailureError = \"ServerErrors\",\r\n}\r\n\r\nexport enum SafeProductNames {\r\n PersonalBasic = \"PersonalBasic\",\r\n PersonalPlus = \"PersonalPlus\",\r\n PersonalPrime = \"PersonalPrime\",\r\n}\r\n\r\nexport enum paymentTypes {\r\n CreditCard = \"CreditCard\",\r\n PayPal = \"PayPal\",\r\n}\r\n\r\nexport enum openTextBrands {\r\n Carbonite = \"Carbonite\",\r\n Webroot = \"Webroot\",\r\n}\r\n\r\nexport enum showKeycodeState {\r\n loading,\r\n success,\r\n failed,\r\n}\r\n\r\nexport enum webrootTrialUnits {\r\n WSAV = 1,\r\n WSAI = 3,\r\n WSAC = 5,\r\n}\r\n\r\nexport enum PlanetOTErrors {\r\n InvalidGuid = \"InvalidGuid\",\r\n GuidAlreadyUsed = \"GuidAlreadyUsed\",\r\n GuidExpired = \"GuidExpired\",\r\n EnrollmentGuidExpired = \"EnrollmentGuidExpired\", //Used during update shopping cart\r\n}\r\n\r\nexport enum ProductCatalogPriceType {\r\n CatalogPrice = \"catalogPrice\",\r\n NewSubscriptionPrice = \"newSubscriptionPrice\",\r\n}\r\n","import { unifiedApi } from \"@/common\";\r\nimport { ISubscription } from \"@/common/api/unifiedPortal/interfaces\";\r\nimport { LAST_API_FETCH_INTERVAL } from \"@/define\";\r\nimport { logEvent } from \"@/common/logger\";\r\nimport { defineStore } from \"pinia\";\r\nimport { handleApiError } from \"@/common/handleApiError\";\r\nimport { AxiosError } from \"axios\";\r\nimport { ref } from \"vue\";\r\nimport { paymentTypes } from \"@/components/Buy/BuyEnums\";\r\nexport const useSubscriptionsStore = defineStore(\"subscriptions\", () => {\r\n const subscriptions = ref([]);\r\n const lastRequestTime = ref(0);\r\n const isRunning = ref(false);\r\n\r\n //This replaces get subscriptions going forward.\r\n //Separating the call to get the data and the return of the data is easier to unit test\r\n async function populateSubscriptions() {\r\n try {\r\n // Waits for the current call to finish before trying and get aborted (in case a simultaneous call)\r\n while (isRunning.value) {\r\n await new Promise(resolve => setTimeout(resolve, 100));\r\n }\r\n\r\n const currentTime = new Date().getTime();\r\n if (currentTime - lastRequestTime.value >= LAST_API_FETCH_INTERVAL) {\r\n lastRequestTime.value = new Date().getTime();\r\n isRunning.value = true;\r\n\r\n subscriptions.value = (await unifiedApi.getLatestSubscriptions()).data ?? [];\r\n const userPaymentMethods = (await unifiedApi.getUserPaymentMethods()).data;\r\n subscriptions.value.forEach(sub => {\r\n const paymentMethod = userPaymentMethods.paymentMethods.find(x => x.id == sub.zuoraPaymentMethodId);\r\n if (paymentMethod?.cardType !== paymentTypes.PayPal) {\r\n sub.paymentInfo = {\r\n cardLastFourDigits: paymentMethod?.lastDigits ?? \"\",\r\n cardType: paymentMethod?.cardType ?? \"\",\r\n paymentType: paymentMethod?.paymentMethodType ?? \"\",\r\n };\r\n } else {\r\n sub.paymentInfo = {\r\n payPalEmail: paymentMethod.email,\r\n cardType: paymentTypes.PayPal,\r\n };\r\n }\r\n });\r\n\r\n isRunning.value = false;\r\n logEvent(\"subscriptions state updated\", \"subscriptions store\", subscriptions.value);\r\n }\r\n } catch (err) {\r\n //redirect to error page\r\n handleApiError(err as AxiosError, false);\r\n }\r\n }\r\n\r\n //If the user has updated their subscriptions off site we want to refresh the store next time they come to the page\r\n function forceRefresh() {\r\n lastRequestTime.value = new Date().getTime() - LAST_API_FETCH_INTERVAL;\r\n logEvent(\"Force Subscriptions store refresh\");\r\n }\r\n\r\n async function forceRefreshAndPopulateSubscriptions() {\r\n forceRefresh();\r\n await populateSubscriptions();\r\n }\r\n\r\n return {\r\n subscriptions,\r\n lastRequestTime,\r\n isRunning,\r\n forceRefresh,\r\n forceRefreshAndPopulateSubscriptions,\r\n populateSubscriptions,\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","import { unifiedApi } from \"@/common\";\r\nimport { IAllstateState } from \"@/common/api/unifiedPortal/interfaces\";\r\nimport { LAST_API_FETCH_INTERVAL } from \"@/define\";\r\nimport { logEvent } from \"@/common/logger\";\r\nimport { defineStore } from \"pinia\";\r\nimport { handleApiError } from \"@/common/handleApiError\";\r\nimport { AxiosError } from \"axios\";\r\n\r\nexport const useAllstateSubscriptionsStore = defineStore(\"allstateSubscriptions\", {\r\n state: (): IAllstateState => ({\r\n allstateSubscriptions: [],\r\n lastRequestTime: 0,\r\n isRunning: false,\r\n }),\r\n actions: {\r\n async getAllstateSubscriptions() {\r\n try {\r\n // Waits for the current call to finish before trying and get aborted (in case a simultaneous call)\r\n while (this.$state.isRunning) {\r\n await new Promise(resolve => setTimeout(resolve, 100));\r\n }\r\n\r\n const currentTime = new Date().getTime();\r\n if (currentTime - this.lastRequestTime >= LAST_API_FETCH_INTERVAL) {\r\n this.lastRequestTime = new Date().getTime();\r\n this.isRunning = true;\r\n this.allstateSubscriptions = (await unifiedApi.getAllstateSubscriptions()).data;\r\n this.isRunning = false;\r\n logEvent(\"allstateSubscriptions state updated\", \"subscriptions store\", this.$state);\r\n return this.$state;\r\n }\r\n return this.$state;\r\n } catch (err) {\r\n //redirect to error page\r\n handleApiError(err as AxiosError, false);\r\n // return existing state to satisfy places it is called even though it will be redirected\r\n return this.$state;\r\n }\r\n },\r\n //If the user has updated their subscriptions off site we want to refresh the store next time they come to the page\r\n forceRefresh() {\r\n this.lastRequestTime = new Date().getTime() - LAST_API_FETCH_INTERVAL;\r\n logEvent(\"Force AllstateSubscriptions store refresh\");\r\n },\r\n async forceRefreshAndGetAllstateSubscriptions() {\r\n this.forceRefresh();\r\n return await this.getAllstateSubscriptions();\r\n },\r\n },\r\n});\r\n","import { useSubscriptionsStore } from \"@/stores/subscriptions\";\r\nimport {\r\n premiumLCNs,\r\n addOnLCNs,\r\n nonAllstateWebrootLCNs,\r\n allstateLCNs,\r\n allstatePremiumFamilyLCNs,\r\n webrootLicenseCategories,\r\n webrootCDLPcodes,\r\n} from \"@/common/webrootProductName\";\r\nimport { useAllstateSubscriptionsStore } from \"@/stores/allstateSubscriptions\";\r\nimport {\r\n SUBSCRIPTION_BESTBUY_RENEWAL_CONVERSION_DAY,\r\n SUBSCRIPTION_LAST_ALLSTATE_DAY,\r\n SUBSCRIPTION_MIN_ACTIVE_DAY,\r\n SUBSCRIPTION_MIN_EXPIRED_DAY,\r\n} from \"@/define\";\r\nimport { useNotificationsStore } from \"@/stores/notifications\";\r\nimport { unifiedApi } from \"@/common\";\r\nimport { getUrl } from \"@/common/getUrl\";\r\nimport { IAllstateResponse, ISubscription } from \"@/common/api/unifiedPortal/interfaces\";\r\nimport { KeyCodeSeller, KeycodeStatus } from \"@/globalEnums\";\r\n\r\nasync function getSubscriptions() {\r\n const subscriptionsStore = useSubscriptionsStore();\r\n await subscriptionsStore.populateSubscriptions();\r\n const subscriptions = subscriptionsStore.subscriptions;\r\n return subscriptions;\r\n}\r\n\r\nasync function getAllstateSubscriptions() {\r\n const allstateSubscriptionsStore = useAllstateSubscriptionsStore();\r\n const subscriptions = (await allstateSubscriptionsStore.getAllstateSubscriptions()).allstateSubscriptions;\r\n return subscriptions;\r\n}\r\n\r\n// Returns if the user has non-Allstate Webroot subscriptions\r\nexport async function hasWebrootSubscriptions() {\r\n const subscriptions = await getSubscriptions();\r\n const response =\r\n subscriptions &&\r\n subscriptions.some(\r\n l =>\r\n nonAllstateWebrootLCNs.includes(l.licenseCategoryName ?? \"\") && l.remainingDays > SUBSCRIPTION_MIN_EXPIRED_DAY\r\n );\r\n return response;\r\n}\r\n\r\nexport async function hasActivePremiumSubscriptions() {\r\n const subscriptions = await getSubscriptions();\r\n const response =\r\n subscriptions &&\r\n subscriptions.some(\r\n l =>\r\n premiumLCNs.includes(l.licenseCategoryName ?? \"\") &&\r\n l.remainingDays > 0 &&\r\n l.webrootStatusDescription.toLowerCase() === KeycodeStatus.Active\r\n );\r\n return response;\r\n}\r\n\r\nexport async function hasActivePremiumFamilySubscriptions() {\r\n const subscriptions = await getSubscriptions();\r\n const response =\r\n subscriptions &&\r\n subscriptions.some(\r\n l =>\r\n allstatePremiumFamilyLCNs.includes(l.licenseCategoryName ?? \"\") &&\r\n l.remainingDays > 0 &&\r\n l.webrootStatusDescription.toLowerCase() === KeycodeStatus.Active\r\n );\r\n return response;\r\n}\r\n\r\nexport async function hasActiveCDLPSubscriptions() {\r\n const subscriptions = await getSubscriptions();\r\n const response =\r\n subscriptions &&\r\n subscriptions.some(\r\n l =>\r\n webrootCDLPcodes.includes(l.licenseCategoryName ?? \"\") &&\r\n l.remainingDays > 0 &&\r\n l.webrootStatusDescription.toLowerCase() === KeycodeStatus.Active\r\n );\r\n return response;\r\n}\r\n\r\nexport async function hasInactivePremiumSubscriptions() {\r\n const subscriptions = await getSubscriptions();\r\n const response =\r\n subscriptions &&\r\n subscriptions.some(\r\n l =>\r\n premiumLCNs.includes(l.licenseCategoryName ?? \"\") &&\r\n l.webrootStatusDescription.toLowerCase() === KeycodeStatus.Inactive\r\n );\r\n return response;\r\n}\r\n\r\nexport async function hasExpiredPremiumSubscriptions() {\r\n const subscriptions = await getSubscriptions();\r\n const response =\r\n subscriptions &&\r\n subscriptions.some(\r\n l =>\r\n premiumLCNs.includes(l.licenseCategoryName ?? \"\") &&\r\n l.remainingDays < 0 &&\r\n l.remainingDays >= SUBSCRIPTION_LAST_ALLSTATE_DAY\r\n );\r\n return response;\r\n}\r\n\r\nexport async function hasAddOnSubscriptions() {\r\n const subscriptions = await getSubscriptions();\r\n const response =\r\n subscriptions &&\r\n subscriptions.some(\r\n l => addOnLCNs.includes(l.licenseCategoryName ?? \"\") && l.remainingDays > SUBSCRIPTION_MIN_EXPIRED_DAY\r\n );\r\n return response;\r\n}\r\n\r\nexport async function hasAllstateSubscriptions() {\r\n const subscriptions = await getSubscriptions();\r\n const response =\r\n subscriptions &&\r\n subscriptions.some(\r\n l => allstateLCNs.includes(l.licenseCategoryName ?? \"\") && l.remainingDays > SUBSCRIPTION_LAST_ALLSTATE_DAY\r\n );\r\n return response;\r\n}\r\n\r\nexport async function hasAllstateAccountSetup() {\r\n const allstateSubscriptions = await getAllstateSubscriptions();\r\n const response = allstateSubscriptions && allstateSubscriptions.some(a => a.canceledOnDate === null);\r\n return response;\r\n}\r\n\r\nexport async function hasAllstateUpgradeNotification() {\r\n const allstateSubscriptions = await getAllstateSubscriptions();\r\n const response = allstateSubscriptions && allstateSubscriptions.some(a => a.canceledOnDate === null);\r\n return response;\r\n}\r\n\r\nexport function dismissAllstateUpgradeNotification() {\r\n const notificationsStore = useNotificationsStore();\r\n notificationsStore.clearNotifications();\r\n unifiedApi.updateAllstateSubscriptions({ showUpgradedBanner: false });\r\n const allstateStore = useAllstateSubscriptionsStore();\r\n const allstateSubs = allstateStore.allstateSubscriptions;\r\n allstateSubs.forEach(l => {\r\n l.showUpgradedBanner = false;\r\n });\r\n allstateStore.allstateSubscriptions = allstateSubs;\r\n}\r\n\r\n// allstate upgrade banner displays if More than 90 days from sub expiring and api returns showUpgradedBanner and flag is set to show allstate family\r\nexport async function showAllstateBanner() {\r\n const notificationsStore = useNotificationsStore();\r\n const subscriptionsStore = useSubscriptionsStore();\r\n const allstateStore = useAllstateSubscriptionsStore();\r\n\r\n if (subscriptionsStore.subscriptions.length === 0) {\r\n await subscriptionsStore.populateSubscriptions();\r\n }\r\n const allstateSubscription = subscriptionsStore.subscriptions.find(l =>\r\n allstateLCNs.includes(l.licenseCategoryName ?? \"\")\r\n );\r\n if (\r\n allstateStore.allstateSubscriptions.some(l => l.showUpgradedBanner) &&\r\n allstateSubscription?.remainingDays &&\r\n allstateSubscription?.remainingDays > SUBSCRIPTION_MIN_ACTIVE_DAY\r\n ) {\r\n const lcn = allstateSubscription.licenseCategoryName;\r\n notificationsStore.clearNotifications();\r\n notificationsStore.addNotification({ type: \"AllstateUpgradeInfo\", params: { licenseCategoryName: lcn } });\r\n }\r\n}\r\n\r\nexport async function getUpgradeCartUrl(keycode: string) {\r\n const url = (await unifiedApi.getWebrootRenewUrl(keycode)).data.redirectUrl;\r\n if (url) {\r\n const queryString = url.split(\"?\")[1];\r\n // This URL will be only used here, so no need to add to env files.\r\n return `${getUrl(\"ALLSTATE_UPGRADE_CART\")}?${queryString}`;\r\n }\r\n}\r\n\r\nexport async function hasExpiredBestBuyAllState() {\r\n const subscriptions = await getSubscriptions();\r\n const allstateSubs = subscriptions.filter(s => allstateLCNs.includes(s.licenseCategoryName ?? \"\"));\r\n if (!allstateSubs || allstateSubs.length === 0) {\r\n return false;\r\n }\r\n\r\n const bestBuyAllStateSub = allstateSubs.find(l => l.licenseCategoryName === webrootLicenseCategories.WSAIA);\r\n //Use this check to make sure the user did not already buy a different AllState that would be the Active item\r\n const hasActiveNonBestBuyAllState = allstateSubs.find(l => l.remainingDays > SUBSCRIPTION_MIN_EXPIRED_DAY);\r\n\r\n if (!hasActiveNonBestBuyAllState && bestBuyAllStateSub) {\r\n //Sub is expired but not able to be recaptured\r\n return (\r\n bestBuyAllStateSub.remainingDays < SUBSCRIPTION_MIN_EXPIRED_DAY &&\r\n bestBuyAllStateSub.remainingDays > SUBSCRIPTION_BESTBUY_RENEWAL_CONVERSION_DAY\r\n );\r\n }\r\n\r\n return false;\r\n}\r\n\r\nexport function getActiveAllState(allstateSubscriptions: IAllstateResponse[], subscriptions: ISubscription[]) {\r\n return allstateSubscriptions.length > 0 &&\r\n subscriptions.some(\r\n l =>\r\n l.keyCode === allstateSubscriptions[0].keyCode &&\r\n l.keyCodeSellerType === KeyCodeSeller.Webroot &&\r\n !allstateSubscriptions[0].canceledOnDate\r\n )\r\n ? subscriptions.find(\r\n l =>\r\n l.keyCode === allstateSubscriptions[0].keyCode &&\r\n l.keyCodeSellerType === KeyCodeSeller.Webroot &&\r\n !allstateSubscriptions[0].canceledOnDate\r\n )\r\n : subscriptions.some(\r\n l => allstateLCNs.includes(l.licenseCategoryName ?? \"\") && l.remainingDays > SUBSCRIPTION_MIN_EXPIRED_DAY\r\n )\r\n ? subscriptions.find(\r\n l => allstateLCNs.includes(l.licenseCategoryName ?? \"\") && l.remainingDays > SUBSCRIPTION_MIN_EXPIRED_DAY\r\n )\r\n : subscriptions.find(\r\n l => allstateLCNs.includes(l.licenseCategoryName ?? \"\") && l.remainingDays <= SUBSCRIPTION_MIN_EXPIRED_DAY\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","import { defineStore } from \"pinia\";\r\nimport {\r\n INotificationsState,\r\n INotificationOptions,\r\n INotificationMetadata,\r\n NotificationType,\r\n INotificationParams,\r\n} from \"@/stores/notificationsInterfaces\";\r\nimport { NotificationIcon } from \"@/globalEnums\";\r\nimport { logEvent } from \"@/common/logger\";\r\n\r\nimport AccountLockedOutNotification from \"@/components/notifications/AccountLockedOutNotification.vue\";\r\nimport LoginFailedNotification from \"@/components/notifications/LoginFailedNotification.vue\";\r\nimport AddFraudKeyNotification from \"@/components/notifications/AddFraudKeyNotification.vue\";\r\nimport PendingEmailVerificationNotification from \"@/components/notifications/PendingEmailVerificationNotification.vue\";\r\nimport PrimaryEmailVerificationWebrootNotification from \"@/components/notifications/PrimaryEmailVerificationWebrootNotification.vue\";\r\nimport KeycodeExpiredNotification from \"@/components/notifications/KeycodeExpiredNotification.vue\";\r\nimport AddKeycodeNotification from \"@/components/notifications/AddKeycodeNotification.vue\";\r\nimport LastPassProvisionSuccessNotification from \"@/components/notifications/LastPassProvisionSuccessNotification.vue\";\r\nimport RfaEncryptedNotification from \"@/components/notifications/RfaEncryptedNotification.vue\";\r\nimport RfaExpiredNotification from \"@/components/notifications/RfaExpiredNotification.vue\";\r\nimport OptInToAutomaticVideoBackupSuccessNotification from \"@/components/notifications/OptInToAutomaticVideoBackupSuccessNotification.vue\";\r\nimport AutoRenewTurnOnSuccessNotification from \"@/components/notifications/AutoRenewTurnOnSuccessNotification.vue\";\r\nimport AutoRenewTurnOffSuccessNotification from \"@/components/notifications/AutoRenewTurnOffSuccessNotification.vue\";\r\nimport AMZErrorNotification from \"@/components/notifications/AMZSErrorNotification.vue\";\r\nimport EmailAlreadyInUse from \"@/components/notifications/EmailAlreadyInUseNotification.vue\";\r\nimport MovePaymentMethodMRToARNotification from \"@/components/notifications/MovePaymentMethodMRToARNotification.vue\";\r\nimport AllstateExpiredNotification from \"@/components/notifications/AllstateExpiredNotification.vue\";\r\nimport DoubleAllstatePremiumErrorNotification from \"@/components/notifications/DoubleAllstatePremiumErrorNotification.vue\";\r\nimport NonMigratedLegacyWebrootNotification from \"@/components/notifications/NonMigratedLegacyWebrootNotification.vue\";\r\nimport NonZuoraEcommWebrootNotification from \"@/components/notifications/NonZuoraEcommWebrootNotification.vue\";\r\nimport AllstateUpgradeNotification from \"@/components/notifications/AllstateUpgradeNotification.vue\";\r\nimport AllstateNonUsNotification from \"@/components/notifications/AllstateNonUsNotification.vue\";\r\nimport LicenseDaysRemainingNotification from \"@/components/notifications/LicenseDaysRemainingNotification.vue\";\r\nimport { computed, markRaw } from \"vue\";\r\nimport { useUserStore } from \"@/stores/user\";\r\nimport AutoRenewDiscountEnabledNotification from \"@/components/notifications/AutoRenewDiscountEnabledNotification.vue\";\r\nimport VPNBuyflowLimitSingleItemDeadEnd from \"@/components/notifications/VPNBuyflowLimitSingleItemDeadEnd.vue\";\r\n\r\nexport * from \"@/stores/notificationsInterfaces\";\r\n\r\n// When adding a new message here, please added it on the notificationPriority constant as well, if the context exists.\r\nexport const NotificationLookup: { [key in NotificationType]: INotificationMetadata } = {\r\n AddCreditCardFailed: {\r\n contexts: [\"AddCreditCardComponent\", \"SubscriptionInformationComponent\", \"BackupComponent\", \"BuyflowComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n AddCreditCardSuccess: {\r\n contexts: [\"CreditCardsComponent\", \"SubscriptionInformationComponent\", \"BackupComponent\"],\r\n icon: NotificationIcon.SUCCESS,\r\n },\r\n MovePaymentMethodMRToAR: {\r\n contexts: [\"CreditCardsComponent\", \"SubscriptionInformationComponent\", \"BackupComponent\"],\r\n icon: NotificationIcon.SUCCESS,\r\n component: markRaw(MovePaymentMethodMRToARNotification),\r\n },\r\n RemoveCreditCardFailed: {\r\n contexts: [\"CreditCardsComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n LicenseDaysRemaining: {\r\n contexts: [\"BuyflowComponent\"],\r\n icon: NotificationIcon.INFO,\r\n component: markRaw(LicenseDaysRemainingNotification),\r\n },\r\n LoginFailed: {\r\n contexts: [\"LoginTabLoginComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n component: markRaw(LoginFailedNotification),\r\n },\r\n LoginAccountExists: {\r\n contexts: [\"LoginTabLoginComponent\", \"CreateAccountTabLoginComponent\", \"CreateAccountNtpTabLoginComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n component: markRaw(LoginFailedNotification),\r\n },\r\n PendingEmailVerification: {\r\n contexts: [\"PersonalInformationComponent\"],\r\n icon: NotificationIcon.WARNING,\r\n component: markRaw(PendingEmailVerificationNotification),\r\n },\r\n PrimaryEmailVerificationWebroot: {\r\n contexts: [\r\n \"PersonalInformationComponent\",\r\n \"SubscriptionInformationComponent\",\r\n \"BackupComponent\",\r\n \"HomeComponent\",\r\n \"SecurityComponent\",\r\n \"DownloadsComponent\",\r\n \"PaymentHistoryComponent\",\r\n \"SupportComponent\",\r\n \"AllstateSignUpComponent\",\r\n ],\r\n icon: NotificationIcon.WARNING,\r\n component: markRaw(PrimaryEmailVerificationWebrootNotification),\r\n },\r\n UpdateEmailLanguagePreferenceSuccess: {\r\n contexts: [\"PersonalInformationComponent\"],\r\n icon: NotificationIcon.SUCCESS,\r\n },\r\n EmailVerificationComplete: {\r\n contexts: [\"PersonalInformationComponent\"],\r\n icon: NotificationIcon.SUCCESS,\r\n },\r\n LoginAccountExistsNoLoginLink: {\r\n contexts: [\"CreateAccountTabLoginComponent\", \"BuyflowComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n AllstateBuyflowLimit: {\r\n contexts: [\"BuyflowComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n SetSecurityQuestionsSuccess: {\r\n contexts: [\"PersonalInformationComponent\"],\r\n icon: NotificationIcon.SUCCESS,\r\n },\r\n SetPasswordSuccess: {\r\n contexts: [\"PersonalInformationComponent\"],\r\n icon: NotificationIcon.SUCCESS,\r\n },\r\n SetSecurityQuestionsFailure: {\r\n contexts: [\"PersonalInformationComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n SetPasswordFailure: {\r\n contexts: [\"PersonalInformationComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n SetUserFieldsSuccess: {\r\n contexts: [\"PersonalInformationComponent\"],\r\n icon: NotificationIcon.SUCCESS,\r\n },\r\n SetUserFieldsFailure: {\r\n contexts: [\"PersonalInformationComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n //TwoStepVerification Notifications:\r\n SetTwoStepVerificationFailure: {\r\n contexts: [\"TwoStepVerificationComponent\", \"SetTwoStepVerificationComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n SetTwoStepVerificationSuccess: {\r\n contexts: [\"PersonalInformationComponent\", \"DownloadsComponent\", \"BackupComponent\", \"HomeComponent\"],\r\n icon: NotificationIcon.SUCCESS,\r\n },\r\n SetTwoStepVerificationTooManyVerificationAttempts: {\r\n contexts: [\"TwoStepVerificationComponent\", \"SetTwoStepVerificationComponent\", \"DownloadRestrictedFilesComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n SetTwoStepVerificationLockOut: {\r\n contexts: [\"TwoStepVerificationComponent\", \"SetTwoStepVerificationComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n SetTwoStepVerificationNoPhoneToValidate: {\r\n contexts: [\"TwoStepVerificationComponent\", \"SetTwoStepVerificationComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n SetTwoStepVerificationPhoneAlreadyExists: {\r\n contexts: [\"TwoStepVerificationComponent\", \"SetTwoStepVerificationComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n SetTwoStepVerificationVerificationWindowExpired: {\r\n contexts: [\"TwoStepVerificationComponent\", \"SetTwoStepVerificationComponent\", \"DownloadRestrictedFilesComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n SetTwoStepVerificationInvalidPhoneType: {\r\n contexts: [\"TwoStepVerificationComponent\", \"SetTwoStepVerificationComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n SetTwoStepVerificationHighRiskScore: {\r\n contexts: [\"TwoStepVerificationComponent\", \"SetTwoStepVerificationComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n SetTwoStepVerificationEmptyPhone: {\r\n contexts: [\"TwoStepVerificationComponent\", \"SetTwoStepVerificationComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n SetTwoStepVerificationInvalidCountry: {\r\n contexts: [\"TwoStepVerificationComponent\", \"SetTwoStepVerificationComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n SetTwoStepVerificationDeletePhone: {\r\n contexts: [\"PersonalInformationComponent\"],\r\n icon: NotificationIcon.SUCCESS,\r\n },\r\n SetTwoStepVerificationUnverifiedPhone: {\r\n contexts: [\"PersonalInformationComponent\"],\r\n icon: NotificationIcon.WARNING,\r\n },\r\n SetTwoStepVerificationInvalidVerificationMethod: {\r\n contexts: [\"TwoStepVerificationComponent\", \"SetTwoStepVerificationComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n TwoStepVerificationFailed: {\r\n contexts: [\"TwoStepVerificationComponent\", \"SetTwoStepVerificationComponent\", \"DownloadRestrictedFilesComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n TwoStepVerificationExpired: {\r\n contexts: [\"TwoStepVerificationComponent\", \"SetTwoStepVerificationComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n TwoStepVerificationEmail: {\r\n contexts: [\"TwoStepVerificationComponent\", \"SetTwoStepVerificationComponent\"],\r\n icon: NotificationIcon.SUCCESS,\r\n },\r\n TwoStepVerificationCodeSent: {\r\n contexts: [\"TwoStepVerificationComponent\", \"SetTwoStepVerificationComponent\", \"DownloadRestrictedFilesComponent\"],\r\n icon: NotificationIcon.SUCCESS,\r\n },\r\n SecurityCodeSentToEmail: {\r\n contexts: [\"DownloadRestrictedFilesComponent\"],\r\n icon: NotificationIcon.SUCCESS,\r\n },\r\n PasswordReset: {\r\n contexts: [\"LoginTabLoginComponent\"],\r\n icon: NotificationIcon.SUCCESS,\r\n },\r\n PasswordResetNoLogin: {\r\n contexts: [\"BackupComponent\", \"DownloadsComponent\"],\r\n icon: NotificationIcon.SUCCESS,\r\n },\r\n CannotCreateAccount: {\r\n contexts: [\"CreateAccountTabLoginComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n AccountLockedOut: {\r\n contexts: [\"LoginTabLoginComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n component: markRaw(AccountLockedOutNotification),\r\n },\r\n ValidationError_FraudKeycode: {\r\n contexts: [\"AddKeycodeComponent\", \"CreateAccountTabLoginComponent\", \"DownloadsComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n component: markRaw(AddFraudKeyNotification),\r\n },\r\n ValidationError_LicenseStatusIneligible: {\r\n contexts: [\"AddKeycodeComponent\", \"CreateAccountTabLoginComponent\", \"DownloadsComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n component: markRaw(AddFraudKeyNotification),\r\n },\r\n ValidationError_KeycodeEmailMismatch: {\r\n contexts: [\"AddKeycodeComponent\", \"CreateAccountTabLoginComponent\", \"DownloadsComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n component: markRaw(AddKeycodeNotification),\r\n },\r\n ValidationError_KeycodeEmailMismatchDownloadsComponent: {\r\n contexts: [\"DownloadsComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n component: markRaw(AddKeycodeNotification),\r\n },\r\n ValidationError_KeycodeIneligible: {\r\n contexts: [\"AddKeycodeComponent\", \"CreateAccountTabLoginComponent\", \"DownloadsComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n component: markRaw(AddKeycodeNotification),\r\n },\r\n ValidationError_InvalidKeycode: {\r\n contexts: [\"AddKeycodeComponent\", \"CreateAccountTabLoginComponent\", \"DownloadsComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n component: markRaw(AddKeycodeNotification),\r\n },\r\n ValidationError_LicenseInfoAlreadyLinked: {\r\n contexts: [\"CreateAccountTabLoginComponent\", \"DownloadsComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n component: markRaw(AddKeycodeNotification),\r\n },\r\n ValidationError_AMZSLicense: {\r\n contexts: [\"CreateAccountTabLoginComponent\", \"DownloadsComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n component: markRaw(AMZErrorNotification),\r\n },\r\n RecaptchaValidation_invalid: {\r\n contexts: [\"CreateAccountTabLoginComponent\", \"CreateAccountNtpTabLoginComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n EmailAlreadyInUse: {\r\n contexts: [\"UpdateEmailAddressComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n component: markRaw(EmailAlreadyInUse),\r\n },\r\n ServerErrors: {\r\n contexts: [\r\n \"AccountSetup\",\r\n \"AddKeycodeComponent\",\r\n \"ApplyActivationCodeComponent\",\r\n \"AutoRenewOptionComponent\",\r\n \"BackupComponent\",\r\n \"CancelSubscriptionComponent\",\r\n \"ComputerNameComponent\",\r\n \"CreateAccountTabLoginComponent\",\r\n \"CreditCardsComponent\",\r\n \"FileAccessComponent\",\r\n \"SecurityComponent\",\r\n \"SetUserFieldsComponent\",\r\n \"SubscriptionInformationComponent\",\r\n \"CreateAccountNtpTabLoginComponent\",\r\n \"BuyflowComponent\",\r\n ],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n AddKeycodeSuccess: {\r\n contexts: [\"DownloadsComponent\"],\r\n icon: NotificationIcon.SUCCESS,\r\n component: markRaw(AddKeycodeNotification),\r\n },\r\n KeycodeAlreadyExists: {\r\n contexts: [\"DownloadsComponent\"],\r\n icon: NotificationIcon.WARNING,\r\n component: markRaw(AddKeycodeNotification),\r\n },\r\n EmailVerificationIncomplete: {\r\n contexts: [\"VerifyPrimaryEmailAddressCtnComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n KeycodeExpired: {\r\n contexts: [\"DownloadsComponent\"],\r\n icon: NotificationIcon.WARNING,\r\n component: markRaw(KeycodeExpiredNotification),\r\n },\r\n RetrieveKeycodesFailed: {\r\n contexts: [\"DownloadsComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n component: markRaw(AddFraudKeyNotification),\r\n },\r\n PartialRetrieveKeycodesFailed: {\r\n contexts: [\"DownloadsComponent\", \"BackupComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n UnsupportedOS: {\r\n contexts: [\"DownloadsSafeComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n DownloadSafeFailed: {\r\n contexts: [\"BackupComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n CardComputerBackupOutDated: {\r\n contexts: [\"BackupComponent\"],\r\n icon: NotificationIcon.WARNING,\r\n },\r\n CardComputerBackupOutDatedSevere: {\r\n contexts: [\"BackupComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n CardComputerSubscriptionWillExpire: {\r\n contexts: [\"BackupComponent\"],\r\n icon: NotificationIcon.WARNING,\r\n },\r\n CardComputerSubscriptionExpired: {\r\n contexts: [\"BackupComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n MoveMySubscriptionError: {\r\n contexts: [\"BackupComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n MoveMySubscriptionSuccess: {\r\n contexts: [\"BackupComponent\"],\r\n icon: NotificationIcon.SUCCESS,\r\n },\r\n MoveMySubscriptionComputerOrUser_Invalid: {\r\n contexts: [\"BackupComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n SubscriptionWillExpireTrial: {\r\n contexts: [\"BackupComponent\", \"SubscriptionInformationComponent\"],\r\n icon: NotificationIcon.WARNING,\r\n },\r\n SubscriptionsAlmostExpired: {\r\n contexts: [\"SubscriptionInformationComponent\", \"SecurityComponent\"],\r\n icon: NotificationIcon.WARNING,\r\n },\r\n ResellerSubscriptionsAlmostExpired: {\r\n contexts: [\"SubscriptionInformationComponent\", \"BackupComponent\"],\r\n icon: NotificationIcon.WARNING,\r\n },\r\n ResellerTrialSubscriptionsAlmostExpired: {\r\n contexts: [\"SubscriptionInformationComponent\", \"BackupComponent\"],\r\n icon: NotificationIcon.WARNING,\r\n },\r\n SubscriptionsExpired: {\r\n contexts: [\"SubscriptionInformationComponent\", \"BackupComponent\", \"SecurityComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n ResellerSubscriptionsExpired: {\r\n contexts: [\"SubscriptionInformationComponent\", \"BackupComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n LastPassProvisioned: {\r\n contexts: [\"LastPassDialogComponent\"],\r\n icon: NotificationIcon.SUCCESS,\r\n component: markRaw(LastPassProvisionSuccessNotification),\r\n },\r\n LastPassError: {\r\n contexts: [\"LastPassDialogComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n AutoRenewTurnOnSuccess: {\r\n contexts: [\"SubscriptionInformationComponent\", \"BackupComponent\"],\r\n icon: NotificationIcon.SUCCESS,\r\n component: markRaw(AutoRenewTurnOnSuccessNotification),\r\n },\r\n AutoRenewTurnOffSuccess: {\r\n contexts: [\"SubscriptionInformationComponent\"],\r\n icon: NotificationIcon.SUCCESS,\r\n component: markRaw(AutoRenewTurnOffSuccessNotification),\r\n },\r\n AutoRenewTurnOnOrOffFailure: {\r\n contexts: [\"SubscriptionInformationComponent\", \"BackupComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n AutoRenewDiscountEnabled: {\r\n contexts: [\"SubscriptionInformationComponent\"],\r\n icon: NotificationIcon.SUCCESS,\r\n component: markRaw(AutoRenewDiscountEnabledNotification),\r\n },\r\n ResellerTrialSubscriptionsExpired: {\r\n contexts: [\"SubscriptionInformationComponent\", \"BackupComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n CancelSubscriptionSuccess: {\r\n contexts: [\"SubscriptionInformationComponent\"],\r\n icon: NotificationIcon.SUCCESS,\r\n },\r\n CancelSubscriptionFailure: {\r\n contexts: [\"SubscriptionInformationComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n RenewSuccessMessage: {\r\n contexts: [\"SubscriptionInformationComponent\", \"BackupComponent\"],\r\n icon: NotificationIcon.SUCCESS,\r\n },\r\n RenewFailureMessage: {\r\n contexts: [\"SubscriptionInformationComponent\", \"BackupComponent\", \"InvoiceDetailsComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n InvalidActivationCode: {\r\n contexts: [\"ApplyActivationCodeComponent\", \"BackupComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n BusinessActivationCode: {\r\n contexts: [\"ApplyActivationCodeComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n InactiveActivationCode: {\r\n contexts: [\"ApplyActivationCodeComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n ExpiredActivationCode: {\r\n contexts: [\"ApplyActivationCodeComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n ActivationCodeAlreadyApplied: {\r\n contexts: [\"ApplyActivationCodeComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n ActivationCodeAppliedSuccess: {\r\n contexts: [\"SubscriptionInformationComponent\", \"BackupComponent\"],\r\n icon: NotificationIcon.SUCCESS,\r\n },\r\n ActivationCodeAppliedFailed: {\r\n contexts: [\"ApplyActivationCodeComponent\", \"BackupComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n DataAtRiskOutstandingInvoice: {\r\n contexts: [\"BackupComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n OptInToAutomaticVideoBackupSuccess: {\r\n contexts: [\"BackupComponent\"],\r\n icon: NotificationIcon.SUCCESS,\r\n component: markRaw(OptInToAutomaticVideoBackupSuccessNotification),\r\n },\r\n AlreadyUsedOrderHeaderToken: {\r\n contexts: [\"LoginTabLoginComponent\", \"CreateAccountTabLoginComponent\"],\r\n icon: NotificationIcon.SUCCESS,\r\n component: markRaw(LoginFailedNotification),\r\n },\r\n VatError_Default: {\r\n contexts: [\"AddVatNumberComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n VatError_INVALID_INPUT: {\r\n contexts: [\"AddVatNumberComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n VatError_FORMAT_INVALID: {\r\n contexts: [\"AddVatNumberComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n VatError_SERVICE_UNAVAILABLE: {\r\n contexts: [\"AddVatNumberComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n VatError_MS_UNAVAILABLE: {\r\n contexts: [\"AddVatNumberComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n VatError_TIMEOUT: {\r\n contexts: [\"AddVatNumberComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n VatError_SERVER_BUSY: {\r\n contexts: [\"AddVatNumberComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n VatError_BUY_GENERIC_ERROR: {\r\n contexts: [\"AddVatNumberComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n EncryptionKeySuccess: {\r\n contexts: [\"BackupComponent\", \"ComputerDropDownComponent\", \"AddEncryptionKeyComponent\"],\r\n icon: NotificationIcon.SUCCESS,\r\n },\r\n EncryptionKeyWrongPassword: {\r\n contexts: [\"AddEncryptionKeyComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n EncryptionKeyFailure: {\r\n contexts: [\"AddEncryptionKeyComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n EncryptionKeyInvalidFile: {\r\n contexts: [\"AddEncryptionKeyComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n SetEmailAddressFailure: {\r\n contexts: [\"PersonalInformationComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n EmailAddressFormSubmissionError: {\r\n contexts: [\"UpdateEmailAddressComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n RFA_ComputerHasPrivateKey: {\r\n contexts: [\"FileAccessComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n component: markRaw(RfaEncryptedNotification),\r\n },\r\n RFA_ExpiredSubscription: {\r\n contexts: [\"FileAccessComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n component: markRaw(RfaExpiredNotification),\r\n },\r\n ValidationError_DuplicateCustomerInEcommerce: {\r\n contexts: [\"CreateAccountTabLoginComponent\", \"AddKeycodeComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n AllstateSignUpComplete: {\r\n contexts: [\"AllstateSignUpComponent\"],\r\n icon: NotificationIcon.SUCCESS,\r\n },\r\n AllstateSignUpError: {\r\n contexts: [\"AllstateSignUpComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n AllstateConflictError: {\r\n contexts: [\"AllstateSignUpComponent\", \"SubscriptionInformationComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n BrowserNotSupportedError: {\r\n contexts: [\"App\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n RateLimitCreditCardError: {\r\n contexts: [\r\n \"CreditCardsComponent\",\r\n \"SubscriptionInformationComponent\",\r\n \"BuyflowComponent\",\r\n \"CourierRecoveryComponent\",\r\n ],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n GenericCreditCardError: {\r\n contexts: [\r\n \"CreditCardsComponent\",\r\n \"SubscriptionInformationComponent\",\r\n \"BuyflowComponent\",\r\n \"CourierRecoveryComponent\",\r\n ],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n AllstateExpiredError: {\r\n contexts: [\"AllstateSignUpComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n ignoreBaseLayout: true,\r\n component: markRaw(AllstateExpiredNotification),\r\n },\r\n AllstateExpiredErrorReEnroll: {\r\n contexts: [\"AllstateSignUpComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n ignoreBaseLayout: true,\r\n component: markRaw(AllstateExpiredNotification),\r\n },\r\n AllstateExpiringWarning: {\r\n contexts: [\"AllstateSignUpComponent\"],\r\n icon: NotificationIcon.WARNING,\r\n ignoreBaseLayout: true,\r\n component: markRaw(AllstateExpiredNotification),\r\n },\r\n AllstateExpiringWarningReEnroll: {\r\n contexts: [\"AllstateSignUpComponent\"],\r\n icon: NotificationIcon.WARNING,\r\n ignoreBaseLayout: true,\r\n component: markRaw(AllstateExpiredNotification),\r\n },\r\n AllstateUpgradeInfo: {\r\n contexts: [\r\n \"HomeComponent\",\r\n \"AllstateAlreadySignedUpComponent\",\r\n \"SecurityComponent\",\r\n \"SubscriptionInformationComponent\",\r\n \"DownloadsComponent\",\r\n ],\r\n icon: NotificationIcon.INFO_BG,\r\n ignoreBaseLayout: true,\r\n component: markRaw(AllstateUpgradeNotification),\r\n },\r\n unable_to_use_AllstateKeycode: {\r\n contexts: [\"AddKeycodeComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n DoubleAllstatePremiumError: {\r\n contexts: [\"AllstateSignUpComponent\"],\r\n icon: NotificationIcon.WARNING,\r\n component: markRaw(DoubleAllstatePremiumErrorNotification),\r\n },\r\n BuyflowAutoRenewMonthlyError: {\r\n contexts: [\"BuyflowComponent\", \"ReviewOrderComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n CreditCardDeclinedError: {\r\n contexts: [\"BuyflowComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n CreditCardAddressError: {\r\n contexts: [\"BuyflowComponent\", \"SubscriptionInformationComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n PayPalCreditCardAddressError: {\r\n contexts: [\"BuyflowComponent\", \"SubscriptionInformationComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n CreditCardInsufficientFunds: {\r\n contexts: [\"BuyflowComponent\", \"SubscriptionInformationComponent\", \"InvoiceDetailsComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n CreditCardInvalidExpirationDate: {\r\n contexts: [\"BuyflowComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n PurchaseFailureError: {\r\n contexts: [\"BuyflowComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n BuyCreateAccountSMBUserError: {\r\n contexts: [\"BuyflowComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n InvalidShippingAddress: {\r\n contexts: [\"BuyflowComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n InactiveKeycodeAllstateError: {\r\n contexts: [\"AllstateSignUpComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n NewAccountPasswordError: {\r\n contexts: [\"FinalizeAccount\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n PurchaseDoneContinueToMyAccountPage: {\r\n contexts: [\"BuyflowComponent\"],\r\n icon: NotificationIcon.WARNING,\r\n },\r\n PreliminaryUserTimeOut: {\r\n contexts: [\"BuyflowComponent\"],\r\n icon: NotificationIcon.INFO_BG,\r\n },\r\n PreliminaryUserOrderConfirmationTimeOut: {\r\n contexts: [\"BuyflowComponent\"],\r\n icon: NotificationIcon.INFO_BG,\r\n },\r\n NonMigratedLegacyWebrootError: {\r\n contexts: [\"SubscriptionInformationComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n ignoreBaseLayout: true,\r\n component: markRaw(NonMigratedLegacyWebrootNotification),\r\n },\r\n NonZuoraEcommWebrootError: {\r\n contexts: [\"SubscriptionInformationComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n ignoreBaseLayout: true,\r\n component: markRaw(NonZuoraEcommWebrootNotification),\r\n },\r\n AllstateNonUS: {\r\n contexts: [\"SubscriptionInformationComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n ignoreBaseLayout: true,\r\n component: markRaw(AllstateNonUsNotification),\r\n },\r\n UnderMaintenance: {\r\n contexts: [\"BackupComponent\", \"SecurityComponent\"],\r\n icon: NotificationIcon.INFO,\r\n },\r\n UpgradeOnRetailRenewalNotAllowed: {\r\n contexts: [\"BuyflowComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n PlanetOpenTextInvalidCart: {\r\n contexts: [\"BuyflowComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n PlanetOpenTextEnrollmentGuidError: {\r\n contexts: [\"BuyflowComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n FlatRateUpgradeWindowError: {\r\n contexts: [\"BuyflowComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n VPNPBuyflowLimit: {\r\n contexts: [\"BuyflowComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n WTPBuyflowLimit: {\r\n contexts: [\"BuyflowComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n VPNBuyflowLimitMultipleItems: {\r\n contexts: [\"BuyflowComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n },\r\n BadLicenseKey: {\r\n contexts: [\"BuyflowComponent\"],\r\n icon: NotificationIcon.INFO,\r\n },\r\n VPNBuyflowLimitSingleItemDeadEnd: {\r\n contexts: [\"BuyflowComponent\"],\r\n icon: NotificationIcon.DANGER,\r\n ignoreBaseLayout: true,\r\n component: markRaw(VPNBuyflowLimitSingleItemDeadEnd),\r\n },\r\n //END\r\n};\r\n\r\nexport const NOTIFICATION_SEQUENCE_LAST = 9999;\r\n\r\n// Configure notifications priority -- The order on notificationsInOrder is what we will get on screen\r\nexport const notificationPriority = [\r\n {\r\n context: \"BackupComponent\",\r\n notificationsInOrder: [\r\n \"AddCreditCardFailed\",\r\n \"AddCreditCardSuccess\",\r\n \"MovePaymentMethodMRToAR\",\r\n \"SetTwoStepVerificationSuccess\",\r\n \"PartialRetrieveKeycodesFailed\",\r\n \"DownloadSafeFailed\",\r\n \"MoveMySubscriptionError\",\r\n \"MoveMySubscriptionSuccess\",\r\n \"MoveMySubscriptionComputerOrUser_Invalid\",\r\n \"AutoRenewTurnOnSuccess\",\r\n \"AutoRenewTurnOnOrOffFailure\",\r\n \"RenewSuccessMessage\",\r\n \"RenewFailureMessage\",\r\n \"InvalidActivationCode\",\r\n \"ActivationCodeAppliedSuccess\",\r\n \"ActivationCodeAppliedFailed\",\r\n \"OptInToAutomaticVideoBackupSuccess\",\r\n \"EncryptionKeySuccess\",\r\n \"EncryptionKeyFailure\",\r\n\r\n \"CardComputerSubscriptionExpired\",\r\n \"SubscriptionsExpired\",\r\n \"ResellerSubscriptionsExpired\",\r\n \"ResellerTrialSubscriptionsExpired\",\r\n \"DataAtRiskOutstandingInvoice\",\r\n\r\n \"CardComputerSubscriptionWillExpire\",\r\n \"ResellerSubscriptionsAlmostExpired\",\r\n \"SubscriptionWillExpireTrial\",\r\n \"ResellerTrialSubscriptionsAlmostExpired\",\r\n\r\n \"CardComputerBackupOutDatedSevere\",\r\n \"CardComputerBackupOutDated\",\r\n ],\r\n },\r\n];\r\n\r\nexport const useNotificationsStore = defineStore(\"notifications\", {\r\n state: (): INotificationsState => ({\r\n notifications: [],\r\n notificationCounter: 0,\r\n //These should ONLY be used for cases where the user is in a dead end.\r\n persistedNotifications: [],\r\n }),\r\n getters: {\r\n getNotifications(state) {\r\n return (context?: string | string[]) => {\r\n if (!context) {\r\n // return all notifications... or global ones?\r\n return [];\r\n }\r\n\r\n if (typeof context === \"string\") context = [context];\r\n\r\n // return notifications requested by the provided contexts\r\n return state.notifications.filter(n => {\r\n for (const c1 of context as string[]) {\r\n for (const c2 of n.contexts) {\r\n if (c1 === c2) return true;\r\n }\r\n }\r\n return false;\r\n });\r\n };\r\n },\r\n },\r\n actions: {\r\n addNotification(options: INotificationOptions, persistAfterClear = false) {\r\n this.deleteNotificationByType(options.type);\r\n let metadata = NotificationLookup[options.type];\r\n //Check if the error returned is one we have an error for.\r\n //If not display a generic error\r\n if (!metadata) {\r\n metadata = NotificationLookup[\"ServerErrors\"];\r\n }\r\n\r\n const note = {\r\n id: this.notificationCounter++,\r\n type: options.type,\r\n icon: metadata.icon,\r\n contexts: metadata.contexts,\r\n datetime: Date.now(),\r\n dismissible: options.dismissible ?? true,\r\n dismissed: false,\r\n params: options.params as INotificationParams,\r\n component: metadata.component,\r\n order: NOTIFICATION_SEQUENCE_LAST,\r\n ignoreBaseLayout: metadata.ignoreBaseLayout,\r\n };\r\n logEvent(\"add notification\", \"addNotification\", note);\r\n\r\n if (options.timeout) {\r\n // queue timeout to delete notification when time comes\r\n setTimeout(() => {\r\n this.deleteNotification(note.id);\r\n }, options.timeout);\r\n }\r\n\r\n this.notifications.push(note);\r\n\r\n if (persistAfterClear) {\r\n this.persistedNotifications.push(note);\r\n }\r\n },\r\n dismissNotification(id: number) {\r\n const note = this.notifications.find(n => n.id === id);\r\n if (note) note.dismissed = true;\r\n logEvent(\"complete\", \"dismissNotification\", note);\r\n },\r\n deleteNotification(id: number) {\r\n const idx = this.notifications.findIndex(n => n.id === id);\r\n let found = false;\r\n if (idx >= 0) {\r\n this.notifications.splice(idx, 1);\r\n found = true;\r\n }\r\n logEvent(\"complete\", \"deleteNotification\", { id, found });\r\n },\r\n deleteNotificationByType(type: NotificationType) {\r\n const idx = this.notifications.findIndex(n => n.type === type);\r\n let found = false;\r\n if (idx >= 0) {\r\n this.notifications.splice(idx, 1);\r\n found = true;\r\n }\r\n logEvent(\"complete\", \"deleteNotificationByType\", { type, found });\r\n },\r\n deletePersistedNotification(type: NotificationType) {\r\n this.persistedNotifications = this.persistedNotifications.filter(l => l.type !== type);\r\n },\r\n clearNotifications() {\r\n const userStore = useUserStore();\r\n const notificationsStore = useNotificationsStore();\r\n const user = computed(() => userStore.currentUser);\r\n // We need to check if BrowserNotSupportError is being displayed\r\n const isDisplayingBrowserNotSupportedError = this.notifications.some(n => n.type === \"BrowserNotSupportedError\");\r\n\r\n this.notifications = [];\r\n this.notificationCounter = 0;\r\n //Add back the notifications that should persist after the clear\r\n if (this.persistedNotifications.length > 0) {\r\n this.notifications = [...this.persistedNotifications];\r\n }\r\n\r\n // Add BrowserNotSupportError back to keep displaying\r\n if (isDisplayingBrowserNotSupportedError)\r\n this.addNotification({ type: \"BrowserNotSupportedError\", dismissible: false });\r\n // Add PendingWebroot licenses notification if webroot licenses are pending and email is not validated\r\n if (user.value?.subscriberInfo?.hasPendingWebrootLicenses && !user.value?.subscriberInfo?.hasValidatedEmail) {\r\n notificationsStore.addNotification({ type: \"PrimaryEmailVerificationWebroot\" });\r\n }\r\n logEvent(\"complete\", \"clearNotifications\");\r\n },\r\n },\r\n});\r\n","import { AxiosError } from \"axios\";\r\nimport { logException } from \"./logger\";\r\nimport { useNotificationsStore } from \"@/stores/notifications\";\r\nimport { NotificationType, INotificationParams } from \"@/stores/notificationsInterfaces\";\r\nimport { HTTP_STATUS_FORBIDDEN, HTTP_STATUS_UNAUTHORIZED } from \"@/define\";\r\nimport router from \"@/routes\";\r\n\r\nexport function handleApiError(\r\n err: AxiosError,\r\n showNotification = true,\r\n notificationType: NotificationType = \"ServerErrors\",\r\n notificationParams?: INotificationParams\r\n) {\r\n let redirect = false;\r\n\r\n if (err && err.isAxiosError) {\r\n //decide what we're doing with axios errors, notification or redirection\r\n if (err.response && showNotification) {\r\n useNotificationsStore().addNotification({ type: notificationType, params: notificationParams });\r\n } else if (err.response?.status !== HTTP_STATUS_UNAUTHORIZED && err.response?.status !== HTTP_STATUS_FORBIDDEN) {\r\n redirect = true;\r\n }\r\n //log that this happened\r\n logException(err, { showNotification, redirect });\r\n } else {\r\n //mystery error, so log it and always redirect\r\n logException(err, \"unknown api error\");\r\n redirect = true;\r\n }\r\n //if the decision was to redirect, do it\r\n if (redirect) router.push(\"/error\");\r\n}\r\n","let refreshFunctions: unknown[] = [];\r\nconst refreshFunctionsGlobal: unknown[] = [];\r\n\r\nexport function refreshCachedStrings() {\r\n refreshFunctions.forEach(item => {\r\n if (item instanceof Function) {\r\n item();\r\n }\r\n });\r\n\r\n refreshFunctionsGlobal.forEach(item => {\r\n if (item instanceof Function) {\r\n item();\r\n }\r\n });\r\n}\r\n\r\n// refreshFunction is a function which are registered and called later when localization strings refresh is needed.\r\n// isGlobal flag determines whether refreshFunction which are registered through ts files which are done only once when the app loads/when ts files loads.\r\n// these refreshFunctionsGlobal are not cleared until full reloads of files happen.\r\n// Functions loaded when component(vue files) loads can be cleared out because there will be registered again when component is mounted again.\r\nexport function registerRefreshFunction(refreshFunction: unknown, isGlobal = false) {\r\n if (refreshFunction instanceof Function) {\r\n if (!isGlobal) {\r\n refreshFunctions.push(refreshFunction);\r\n } else {\r\n refreshFunctionsGlobal.push(refreshFunction);\r\n }\r\n }\r\n}\r\n\r\nexport function clearRefreshFunctions() {\r\n refreshFunctions = [];\r\n}\r\n","import {\r\n carboniteProducts,\r\n IProductDisplayRequest,\r\n getProductDisplayNameBySku,\r\n getCarboniteProductMapper,\r\n} from \"@/common/productsBySku\";\r\nimport { webrootLicenseCategories, webrootProducts as webrootProductNames } from \"@/common/webrootProductName\";\r\nimport { ISubscription } from \"@/common/api/unifiedPortal/interfaces\";\r\nimport { ExpirationState, KeyCodeSeller } from \"@/globalEnums\";\r\nimport {\r\n INVOICE_FIRST_OUTSTANDING_DAY,\r\n INVOICE_LAST_OUTSTANDING_DAY,\r\n SafeDataPurgeDays,\r\n SafeResellerConvertToDirectDay,\r\n SUBSCRIPTION_BASE_YEAR,\r\n SUBSCRIPTION_BESTBUY_RENEWAL_CONVERSION_DAY,\r\n SUBSCRIPTION_LAST_AMAZON_EXPIRED_DAY,\r\n SUBSCRIPTION_MIN_ACTIVE_DAY,\r\n SUBSCRIPTION_MIN_DATA_LOSS_DAY,\r\n SUBSCRIPTION_MIN_DAYS_TO_EXPIRATION_FOR_INACTIVE,\r\n SUBSCRIPTION_MIN_EXPIRED_DAY,\r\n SUBSCRIPTION_MIN_GRACE_PERIOD_DAY,\r\n SUBSCRIPTION_MIN_RENEWAL_DAY,\r\n SUBSCRIPTION_MIN_WARNING_DAY,\r\n WEBROOT_ANTI_VIRUS_SKU,\r\n INACTIVE_EXPIRATION_DAYS,\r\n TRIAL_HIDE_EXPIRATION_DAYS,\r\n cancelled,\r\n URLS_JA,\r\n} from \"@/define\";\r\nimport { t } from \"../i18n\";\r\nimport { formatKeycode } from \"@/common/formatKeycode\";\r\nimport { handleApiError } from \"@/common/handleApiError\";\r\nimport { AxiosError } from \"axios\";\r\nimport { useSubscriptionsStore } from \"@/stores/subscriptions\";\r\nimport { getUrl } from \"./getUrl\";\r\nimport { registerRefreshFunction } from \"@/components/shared/LanguageSelector/LanguageSelector\";\r\nimport { useUserStore } from \"@/stores/user\";\r\nimport { allstateLCNs } from \"@/common/webrootProductName\";\r\nimport { FLAGS } from \"@/define\";\r\nimport { portalDestination } from \"@/globalEnums\";\r\nimport { pageStates } from \"@/components/Buy/BuyEnums\";\r\nimport { logException } from \"./logger\";\r\nimport { unifiedApi } from \".\";\r\nimport { useNotificationsStore } from \"@/stores/notifications\";\r\n\r\nexport async function getSubscriptions() {\r\n try {\r\n const subscriptionsStore = useSubscriptionsStore();\r\n await subscriptionsStore.populateSubscriptions();\r\n const subscriptions = subscriptionsStore.subscriptions;\r\n for (const sub of subscriptions) {\r\n //Add productDisplayName column and translate as per the i18n\r\n if (sub?.sku && carboniteProducts.some(product => product.sku === sub.sku)) {\r\n sub.productDisplayName = t(`Brand.${getCarboniteProductMapper(sub.sku)}`);\r\n } else {\r\n sub.productDisplayName = t(`Brand.${sub.licenseCategoryName}`);\r\n }\r\n }\r\n return subscriptions;\r\n } catch (err) {\r\n handleApiError(err as AxiosError, false);\r\n }\r\n}\r\n\r\nexport function isSafeProduct(subscription: ISubscription): boolean {\r\n return !!carboniteProducts.find(product => product.sku === subscription.sku);\r\n}\r\n\r\nexport function isSafeSubscriptionClosed(subscription: ISubscription): boolean {\r\n const isSafeSKU = isSafeProduct(subscription);\r\n let isPurged = false;\r\n\r\n if (isSafeSKU) {\r\n if (subscription.isEvergreenMonthly) {\r\n isPurged =\r\n subscription.isCancelledEvergreenSubscription ||\r\n subscription.computer?.dataHasBeenPurged ||\r\n (!subscription.hasOutstandingInvoices && subscription.remainingDays <= SafeDataPurgeDays.Direct) ||\r\n (!!subscription.computer?.remainingDaysToPurge && subscription.computer?.remainingDaysToPurge <= 0);\r\n } else if (subscription.isTrial) {\r\n isPurged =\r\n subscription.remainingDays <= SafeDataPurgeDays.Trials || (subscription.computer?.dataHasBeenPurged ?? false);\r\n } else {\r\n if (subscription.isAutoRenewEnabled) {\r\n isPurged =\r\n (!subscription.hasOutstandingInvoices && subscription.remainingDays <= SafeDataPurgeDays.Direct) ||\r\n (subscription.computer?.dataHasBeenPurged ?? false);\r\n } else {\r\n isPurged =\r\n subscription.remainingDays <= SafeDataPurgeDays.Direct || (subscription.computer?.dataHasBeenPurged ?? false);\r\n }\r\n }\r\n }\r\n\r\n return isPurged;\r\n}\r\n\r\nexport function showWarning(subscription: ISubscription): boolean {\r\n return (\r\n subscription.expiration === ExpirationState.Upcoming &&\r\n !subscription.isAutoRenewEnabled &&\r\n !subscription.isEvergreenMonthly\r\n );\r\n}\r\n\r\nexport function showDanger(subscription: ISubscription): boolean {\r\n let showDanger = false;\r\n const isSafeSKU = isSafeProduct(subscription);\r\n\r\n //Amazon\r\n if (!isSafeSKU && subscription.keyCodeSellerType === KeyCodeSeller.Amazon) {\r\n showDanger =\r\n subscription.remainingDays <= SUBSCRIPTION_MIN_EXPIRED_DAY &&\r\n subscription.remainingDays > SUBSCRIPTION_LAST_AMAZON_EXPIRED_DAY;\r\n }\r\n\r\n //BestBuy\r\n if (!isSafeSKU && subscription.keyCodeSellerType === KeyCodeSeller.BestBuy && !isNotActiveYet(subscription)) {\r\n showDanger =\r\n subscription.remainingDays < SUBSCRIPTION_MIN_EXPIRED_DAY && subscription.expiration !== ExpirationState.Purged;\r\n }\r\n\r\n //Webroot\r\n if (!isSafeSKU && subscription.keyCodeSellerType === KeyCodeSeller.Webroot && !isNotActiveYet(subscription)) {\r\n showDanger = subscription.remainingDays <= SUBSCRIPTION_MIN_EXPIRED_DAY;\r\n }\r\n\r\n //Best Buy\r\n if (!isSafeSKU && subscription.keyCodeSellerType === KeyCodeSeller.BestBuy && !isNotActiveYet(subscription)) {\r\n showDanger = subscription.remainingDays <= SUBSCRIPTION_MIN_EXPIRED_DAY;\r\n }\r\n\r\n //Trial\r\n if (isSafeSKU && subscription.isTrial && subscription.remainingDays < SUBSCRIPTION_MIN_EXPIRED_DAY) {\r\n showDanger = subscription.remainingDays > SafeDataPurgeDays.Trials;\r\n }\r\n\r\n //Manual Renew\r\n if (\r\n isSafeSKU &&\r\n !subscription.isTrial &&\r\n !subscription.isAutoRenewEnabled &&\r\n subscription.remainingDays <= SUBSCRIPTION_MIN_EXPIRED_DAY &&\r\n !subscription.isEvergreenMonthly\r\n ) {\r\n showDanger = true; //subscription.expirationDays > SafeDataPurgeDays.Direct;\r\n }\r\n\r\n //Auto Renew\r\n if (\r\n isSafeSKU &&\r\n !subscription.isTrial &&\r\n subscription.isAutoRenewEnabled &&\r\n !isProcessingRenewal(subscription) &&\r\n subscription.remainingDays < SUBSCRIPTION_MIN_EXPIRED_DAY &&\r\n !subscription.isEvergreenMonthly\r\n ) {\r\n showDanger =\r\n subscription.remainingDays > SafeDataPurgeDays.Direct ||\r\n (!!subscription.computer?.remainingDaysToPurge &&\r\n subscription.computer?.remainingDaysToPurge > 0 &&\r\n !subscription.computer?.dataHasBeenPurged);\r\n }\r\n\r\n //Outstanding Invoice\r\n if (subscription.hasOutstandingInvoices) {\r\n if (subscription.outstandingInvoice) {\r\n const outstanding = subscription.outstandingInvoice.outstandingInvoiceDays;\r\n if (carboniteProducts.find(product => product.sku === subscription.sku)) {\r\n showDanger = outstanding <= INVOICE_FIRST_OUTSTANDING_DAY && outstanding >= INVOICE_LAST_OUTSTANDING_DAY;\r\n } else {\r\n showDanger = outstanding >= INVOICE_LAST_OUTSTANDING_DAY;\r\n }\r\n } else {\r\n showDanger = false;\r\n }\r\n }\r\n\r\n //Evergreen Monthly\r\n if (isSafeSKU && subscription.isEvergreenMonthly) {\r\n showDanger =\r\n !subscription.isCancelledEvergreenSubscription &&\r\n ((subscription.remainingDays <= SUBSCRIPTION_MIN_EXPIRED_DAY &&\r\n subscription.remainingDays > SafeDataPurgeDays.Direct) ||\r\n (!!subscription.computer?.remainingDaysToPurge &&\r\n subscription.computer?.remainingDaysToPurge > 0 &&\r\n !subscription.computer?.dataHasBeenPurged));\r\n }\r\n\r\n return showDanger;\r\n}\r\n\r\nexport function isNotActiveYet(subscription: ISubscription | undefined): boolean {\r\n if (subscription?.webrootStatusDescription?.toLowerCase() === \"inactive\") {\r\n return true;\r\n }\r\n\r\n if (subscription?.expirationDate) {\r\n return new Date(subscription.expirationDate).getFullYear() < SUBSCRIPTION_BASE_YEAR;\r\n }\r\n\r\n //check if its roughly 41 years ago if we don't have a date for some reason\r\n return subscription?.remainingDays\r\n ? subscription?.remainingDays > SUBSCRIPTION_MIN_DAYS_TO_EXPIRATION_FOR_INACTIVE\r\n : false;\r\n}\r\n\r\nexport function hideExpiredTrial(subscription: ISubscription): boolean {\r\n return (\r\n subscription?.isTrial &&\r\n subscription?.remainingDays <= TRIAL_HIDE_EXPIRATION_DAYS &&\r\n subscription?.remainingDays > INACTIVE_EXPIRATION_DAYS\r\n );\r\n}\r\n\r\nexport function isNotActiveYetByExpirationDate(expirationDate: string): boolean {\r\n return new Date(expirationDate).getFullYear() < SUBSCRIPTION_BASE_YEAR;\r\n}\r\n\r\nexport function isProcessingRenewal(subscription: ISubscription): boolean {\r\n return (\r\n isSafeProduct(subscription) &&\r\n subscription.isAutoRenewEnabled &&\r\n !subscription.isEvergreenMonthly &&\r\n subscription.remainingDays <= SUBSCRIPTION_MIN_RENEWAL_DAY &&\r\n subscription.remainingDays >= SUBSCRIPTION_MIN_EXPIRED_DAY\r\n );\r\n}\r\n\r\nexport function isWebrootProduct(subscription: ISubscription): boolean {\r\n return !!webrootProductNames.find(product => product.licenseCategory === subscription.licenseCategoryName);\r\n}\r\n\r\nexport function showSafeRenewLink(subscription: ISubscription | undefined): boolean {\r\n let showRenewLink = false;\r\n if (subscription?.keyCodeSellerType !== KeyCodeSeller.Safe) {\r\n return false;\r\n }\r\n\r\n if (subscription?.isEvergreenMonthly && !subscription.isCancelledEvergreenSubscription) {\r\n showRenewLink =\r\n !subscription.computer?.dataHasBeenPurged && subscription.remainingDays <= SUBSCRIPTION_MIN_EXPIRED_DAY;\r\n } else if (\r\n !subscription?.isTrial &&\r\n (!subscription?.resellerId || subscription?.isPartnerReferral) &&\r\n !subscription?.isEvergreenMonthly\r\n ) {\r\n if (subscription?.isAutoRenewEnabled) {\r\n showRenewLink =\r\n !subscription?.computer?.dataHasBeenPurged && subscription?.remainingDays < SUBSCRIPTION_MIN_EXPIRED_DAY;\r\n } else if (subscription) {\r\n showRenewLink =\r\n subscription?.expiration === ExpirationState.Upcoming ||\r\n (subscription.remainingDays <= SUBSCRIPTION_MIN_EXPIRED_DAY &&\r\n subscription.remainingDays > SafeDataPurgeDays.Direct &&\r\n !subscription?.computer?.dataHasBeenPurged);\r\n //Do not show renew button for expired SafeLite subs without an computer id\r\n //We should show the buy button in this case\r\n if (\r\n subscription?.isSafeLite &&\r\n !!subscription.computer &&\r\n subscription.computer.id <= 0 &&\r\n subscription.remainingDays <= SUBSCRIPTION_MIN_EXPIRED_DAY &&\r\n subscription.remainingDays > SafeDataPurgeDays.Direct &&\r\n !subscription.computer?.dataHasBeenPurged\r\n ) {\r\n showRenewLink = false;\r\n }\r\n }\r\n } else if (subscription.resellerId && subscription.resellerId > 0 && !subscription.isTrial) {\r\n if (subscription.isAutoRenewEnabled) {\r\n showRenewLink =\r\n (subscription.computer &&\r\n subscription.computer.remainingDaysToPurge &&\r\n subscription.computer.remainingDaysToPurge <= SafeDataPurgeDays.Reseller &&\r\n !subscription.computer.dataHasBeenPurged) ||\r\n (subscription.remainingDays <= SafeResellerConvertToDirectDay && subscription.hasOutstandingInvoices);\r\n } else {\r\n showRenewLink =\r\n subscription.remainingDays <= SafeResellerConvertToDirectDay &&\r\n subscription.remainingDays > SafeDataPurgeDays.Reseller;\r\n }\r\n }\r\n\r\n //If there is an Outstanding Invoice show the Renew Now Button\r\n if (subscription?.hasOutstandingInvoices && subscription.outstandingInvoice) {\r\n showRenewLink = true;\r\n }\r\n\r\n if (subscription && subscription.isActiveUntilCancelled && !subscription.isEvergreenMonthly) {\r\n showRenewLink = false;\r\n }\r\n\r\n return showRenewLink;\r\n}\r\n\r\nexport function showSafeBuyLink(subscription: ISubscription | undefined): boolean {\r\n let showLink = false;\r\n if (subscription?.isTrial && (!subscription.resellerId || subscription.isPartnerReferral)) {\r\n showLink = subscription.remainingDays > SafeDataPurgeDays.Trials && !subscription.computer?.dataHasBeenPurged;\r\n }\r\n //Show the buy button for SafeLite subs that do not have a computer id\r\n //This works as the second part to the showSafeRenewLink() for SafeLite subs that are expired with no computer id\r\n else if (subscription?.isSafeLite && !!subscription.computer && subscription.computer.id <= 0) {\r\n showLink = true;\r\n }\r\n\r\n return showLink;\r\n}\r\n\r\n// shows or hides the renew link for WR subs purchased via Carbonite\r\nexport function showCarbWebrootRenewLink(subscription: ISubscription | undefined): boolean {\r\n return (\r\n webrootProductNames.find(product => {\r\n return product.licenseCategory === subscription?.licenseCategoryName;\r\n }) !== undefined &&\r\n !isNotActiveYet(subscription) &&\r\n !subscription?.isAutoRenewEnabled &&\r\n subscription?.expiration !== ExpirationState.Normal &&\r\n subscription?.keyCodeSellerType === KeyCodeSeller.Safe\r\n );\r\n}\r\n\r\n// shows or hides the renew link for WR subs purchased outside of Carbonite\r\nexport function showWebrootRenewLink(subscription: ISubscription | undefined): boolean {\r\n if (subscription?.isPlanetOt) {\r\n return false;\r\n }\r\n\r\n //If there is an Outstanding Invoice show the Renew Now Button\r\n if (subscription?.hasOutstandingInvoices && subscription.outstandingInvoice) {\r\n return true;\r\n }\r\n\r\n //If the zuora status is \"Cancelled\" then that means the sub was refunded, we should still show the renew link for these subs\r\n if (subscription?.zuoraSubscriptionStatus && subscription?.zuoraSubscriptionStatus.toLowerCase() === cancelled) {\r\n return true;\r\n }\r\n\r\n return (\r\n (!subscription?.isAutoRenewEnabled ||\r\n (subscription?.isAutoRenewEnabled && subscription?.remainingDays < SUBSCRIPTION_MIN_EXPIRED_DAY)) &&\r\n !isNotActiveYet(subscription) &&\r\n subscription?.keyCodeSellerType === KeyCodeSeller.Webroot &&\r\n subscription?.remainingDays <= SUBSCRIPTION_MIN_ACTIVE_DAY\r\n );\r\n}\r\n\r\n//Only used for BBY atm\r\nexport function showConvertToWebRootBuyLink(subscription: ISubscription | undefined): boolean {\r\n return (\r\n subscription?.keyCodeSellerType === KeyCodeSeller.BestBuy &&\r\n subscription?.remainingDays < SUBSCRIPTION_BESTBUY_RENEWAL_CONVERSION_DAY &&\r\n !isNotActiveYet(subscription)\r\n );\r\n}\r\nexport function showWebrootBuyLinkForTrial(subscription: ISubscription | undefined): boolean {\r\n return showWebrootRenewLink(subscription) && (subscription?.isTrial ?? false);\r\n}\r\n\r\n//We only ever want to show the contact link for BBY\r\nexport function showContactBestBuyLink(subscription: ISubscription | undefined): boolean {\r\n return (\r\n subscription?.keyCodeSellerType === KeyCodeSeller.BestBuy &&\r\n subscription?.remainingDays > SUBSCRIPTION_BESTBUY_RENEWAL_CONVERSION_DAY\r\n );\r\n}\r\n\r\nlet carbBuyUrl = getUrl(\"CARBONITE_BUY_URL\");\r\n// renews WR subs purchased via UP\r\nexport function renewCarbWebrootSubscription(subscription: ISubscription | undefined) {\r\n //If this is a migrated Safe WR sub renew through UP with the new Zuora SKU\r\n if (subscription?.isLegacyWebroot && FLAGS.ENABLE_SAFE_WEBROOT_MIGRATION === \"true\") {\r\n window.location.href = `${carbBuyUrl}/paymentForm?sku=${WEBROOT_ANTI_VIRUS_SKU}&keycode=${subscription?.zuoraSubscriptionNumber}`;\r\n return;\r\n }\r\n\r\n window.location.href = `${carbBuyUrl}/paymentForm?sku=Webroot&keycode=${subscription?.zuoraSubscriptionNumber}`;\r\n}\r\n\r\nfunction isValidDelimiter(delimiter: string) {\r\n const allowedDelimiters = [\"?\", \"&\"];\r\n return allowedDelimiters.includes(delimiter);\r\n}\r\n\r\nexport function generateInterstitialReturnPortalDestination(delimiter: string = \"&\"): string {\r\n if (!isValidDelimiter(delimiter)) {\r\n return \"\";\r\n }\r\n const domain = new URL(window.location.href);\r\n const portal =\r\n getUrl(\"VITE_APP_WEBROOT_URL\") === domain.origin + \"/\" ? portalDestination.Webroot : portalDestination.Carbonite;\r\n\r\n //The page state should always be email. When a user comes back from the interstitial page\r\n //we make an API call to see if we have any candy rack items to display to them.\r\n //They will stay on the email step if there are candy rack items or move to payment if there are none.\r\n return `${delimiter}portalDest=${portal}-${pageStates.email}`;\r\n}\r\n\r\nfunction refreshSubscriptionHelperUrls() {\r\n carbBuyUrl = getUrl(\"CARBONITE_BUY_URL\");\r\n}\r\n\r\nregisterRefreshFunction(refreshSubscriptionHelperUrls, true);\r\n\r\n/**\r\n * Add any post data retrieval processing for each sub\r\n */\r\nexport function processSubscriptionDataForDisplay(subscriptions: ISubscription[]): ISubscription[] {\r\n // filter out Allstate subscriptions if Japanese Language is selected\r\n const userStore = useUserStore();\r\n if (userStore.selectedLanguage !== \"en\") {\r\n subscriptions = subscriptions.filter(s => !isAllstateSubscription(s));\r\n }\r\n\r\n for (const sub of subscriptions) {\r\n //Adding a display for the sku to the object for sorting\r\n if (sub?.sku && carboniteProducts.some(product => product.sku === sub.sku)) {\r\n if (sub.sku === \"PersonalBasic\" && !!sub.keyCode && !sub.isTrial) {\r\n sub.isSafeLite = true;\r\n }\r\n }\r\n\r\n const request: IProductDisplayRequest = {\r\n sku: sub.sku,\r\n webrootKeycode: sub.keyCode,\r\n isTrial: sub.isTrial,\r\n };\r\n\r\n sub.productDisplayName = t(getProductDisplayNameBySku(request));\r\n\r\n //Add an easier way to tell what state a sub is in\r\n if (sub.remainingDays > SUBSCRIPTION_MIN_ACTIVE_DAY) {\r\n sub.expiration = ExpirationState.Normal;\r\n } else if (sub.remainingDays > SUBSCRIPTION_MIN_EXPIRED_DAY) {\r\n sub.expiration = ExpirationState.Upcoming;\r\n } else if (sub.remainingDays >= SUBSCRIPTION_MIN_GRACE_PERIOD_DAY) {\r\n sub.expiration = ExpirationState.Expired;\r\n } else if (sub.remainingDays >= SUBSCRIPTION_MIN_DATA_LOSS_DAY) {\r\n sub.expiration = ExpirationState.FinalWarning;\r\n } else {\r\n sub.expiration = ExpirationState.Purged;\r\n }\r\n\r\n //Moved this from the ProductComponent because the table change made it so the component is not fully rendered again so the setup would not\r\n //be triggered again. This caused the array of keycodes to not be calculated again on sort.\r\n sub.displayKeycode = formatKeycode(\r\n !!sub.keycodeAlias && !!sub.keycodeAlias.trim() ? sub.keycodeAlias : (sub?.keyCode ?? \"\")\r\n );\r\n\r\n //Adding cardType and customExpirationDate field for sorting purpose\r\n sub.cardType = sub.paymentInfo?.cardType ? sub.paymentInfo.cardType : \" \";\r\n sub.customExpirationDate =\r\n sub.hasOutstandingInvoices &&\r\n sub.outstandingInvoice &&\r\n sub.outstandingInvoice?.outstandingInvoiceDays <= INVOICE_FIRST_OUTSTANDING_DAY &&\r\n sub.outstandingInvoice?.outstandingInvoiceDays >= INVOICE_LAST_OUTSTANDING_DAY\r\n ? \"1970-01-01Z00:00:00:000\"\r\n : sub.expirationDate;\r\n }\r\n\r\n return subscriptions.filter(l => {\r\n //Filter out Safe Lite subs that are not provisioned\r\n return l.sku !== null && l.packageName?.toLowerCase() !== \"safe lite\";\r\n });\r\n}\r\n\r\nexport function isAllstateSubscription(subscription: ISubscription): boolean {\r\n return allstateLCNs.includes(subscription?.licenseCategoryName ?? \"\");\r\n}\r\n\r\nexport function isExpiredAllstateWithNewSubscription(subscription: ISubscription | undefined): boolean {\r\n if (\r\n subscription &&\r\n subscription?.remainingDays <= SUBSCRIPTION_MIN_EXPIRED_DAY &&\r\n isAllstateSubscription(subscription)\r\n ) {\r\n return useSubscriptionsStore().subscriptions?.some(s => s.remainingDays > 0 && isAllstateSubscription(s));\r\n }\r\n return false;\r\n}\r\n\r\nexport function isAllExpiredAllstate(subscription: ISubscription | undefined): boolean {\r\n if (\r\n subscription &&\r\n subscription?.remainingDays <= SUBSCRIPTION_MIN_EXPIRED_DAY &&\r\n isAllstateSubscription(subscription)\r\n ) {\r\n return useSubscriptionsStore().subscriptions?.every(s => s.remainingDays <= 0 && isAllstateSubscription(s));\r\n }\r\n return false;\r\n}\r\n\r\n//This will check if the Renew or Upgrade link should be hidden for products\r\n//that the user can only have one active subscription\r\nexport function hideRenewOrUpgradeLinkForLimitedPurchaseSub(\r\n subscription: ISubscription | undefined,\r\n subscriptions: ISubscription[]\r\n) {\r\n return (\r\n isExpiredAllstateWithNewSubscription(subscription) ||\r\n isExpiredVPNWithNewSubscription(subscription, subscriptions) ||\r\n isExpiredWTPWithNewSubscription(subscription, subscriptions)\r\n );\r\n}\r\n\r\n//Checks if the given sub is an expired VPNP sub and the user\r\n//has another active sub that is either VPNP or WTP/WTPF\r\nexport function isExpiredVPNWithNewSubscription(\r\n subscription: ISubscription | undefined,\r\n subscriptions: ISubscription[]\r\n): boolean {\r\n if (subscription && isVPNSub(subscription)) {\r\n //Not Expired\r\n if (subscription?.remainingDays > SUBSCRIPTION_MIN_EXPIRED_DAY) {\r\n return false;\r\n }\r\n\r\n //Check for active Webroot Total Protection(it comes with VPNP) OR active VPNP subs\r\n return (\r\n hasActiveWTPSubscription(subscriptions) ||\r\n subscriptions.filter(l => isVPNSub(l)).some(l => l.remainingDays > SUBSCRIPTION_MIN_EXPIRED_DAY)\r\n );\r\n }\r\n\r\n return false;\r\n}\r\n\r\nexport function isVPNSub(sub: ISubscription) {\r\n return sub.licenseCategoryName === webrootLicenseCategories.WSVPN;\r\n}\r\n\r\nexport function hasActiveVPNSubscription(subscriptions: ISubscription[]) {\r\n return subscriptions.some(l => isVPNSub(l) && l.remainingDays > SUBSCRIPTION_MIN_EXPIRED_DAY);\r\n}\r\n\r\nexport function hasActiveWTPSubscription(subscriptions: ISubscription[]) {\r\n return subscriptions.some(l => isWebrootTotalProtection(l) && l.remainingDays > SUBSCRIPTION_MIN_EXPIRED_DAY);\r\n}\r\n\r\n//Checks if the given sub is an expired WTP/WTPF sub and the user\r\n//has another active sub that is either VPNP or WTP/WTPF\r\nexport function isExpiredWTPWithNewSubscription(\r\n subscription: ISubscription | undefined,\r\n subscriptions: ISubscription[]\r\n): boolean {\r\n if (subscription && isWebrootTotalProtection(subscription)) {\r\n //Not Expired\r\n if (subscription?.remainingDays > SUBSCRIPTION_MIN_EXPIRED_DAY) {\r\n return false;\r\n }\r\n\r\n //Check for active Webroot Total Protection(it comes with VPNP) OR active VPNP subs\r\n return (\r\n hasActiveVPNSubscription(subscriptions) ||\r\n subscriptions.filter(l => isWebrootTotalProtection(l)).some(l => l.remainingDays > SUBSCRIPTION_MIN_EXPIRED_DAY)\r\n );\r\n }\r\n\r\n return false;\r\n}\r\n\r\nexport function isWebrootTotalProtection(sub: ISubscription) {\r\n return (\r\n sub.licenseCategoryName === webrootLicenseCategories.WTP ||\r\n sub.licenseCategoryName === webrootLicenseCategories.WTPF\r\n );\r\n}\r\n\r\nexport function daysToDeleteBackup(sub: ISubscription) {\r\n let days = SUBSCRIPTION_MIN_WARNING_DAY;\r\n if (sub.outstandingInvoice) {\r\n days += sub.outstandingInvoice.outstandingInvoiceDays;\r\n }\r\n return Math.ceil(days);\r\n}\r\n\r\nexport function outstandingSubscriptionExpired(sub: ISubscription): boolean {\r\n if (sub.outstandingInvoice) {\r\n return Math.abs(sub.outstandingInvoice.outstandingInvoiceDays) > SUBSCRIPTION_MIN_WARNING_DAY;\r\n }\r\n return false;\r\n}\r\n\r\nexport async function redirectRenewWebrootToInterstitialPage(keyCode: string) {\r\n const userStore = useUserStore();\r\n const notificationsStore = useNotificationsStore();\r\n try {\r\n if (keyCode) {\r\n let url;\r\n if (userStore.selectedLanguage === \"ja\") {\r\n url = URLS_JA[\"WEBROOT_HOME_RENEWAL\"];\r\n } else {\r\n url = (await unifiedApi.getWebrootRenewUrl(keyCode)).data.redirectUrl;\r\n }\r\n window.open(url, \"_self\");\r\n }\r\n } catch (err) {\r\n notificationsStore.addNotification({ type: \"ServerErrors\" });\r\n logException(err as Error);\r\n }\r\n}\r\n","import { URLS } from \"@/define\";\r\nimport { AxiosRequestConfig } from \"axios\";\r\nimport { Buffer } from \"buffer\";\r\nimport { IEndpointConfig } from \"../interfaces\";\r\nimport {\r\n ISecurityQuestions,\r\n IUserSecurityPhoneRequest,\r\n IUpdateSubscriberRequest,\r\n IInstallRequest,\r\n IClientException,\r\n IUpdateWebrootDeviceRequest,\r\n IRemoveWebrootDeviceRequest,\r\n IAllstateRequest,\r\n ICourierRecoveryRequest,\r\n IManageCustomerByResellerRequest,\r\n IPayOutstandingInvoicesRequest,\r\n IAutoRenewUpdateRequest,\r\n IShoppingCart,\r\n ISetLanguagePreferenceRequest,\r\n ICheckEmailRequest,\r\n IPayPalAgreementTokenRequest,\r\n IActivationCodePurchaseRequest,\r\n IAllstateUpdateRequest,\r\n IAutoRenewRequest,\r\n IAutoRenewDiscountRequest,\r\n} from \"./interfaces\";\r\nimport {\r\n ICssbDetailsRequest,\r\n ICssbDownloadInfoRequest,\r\n ICssbDownloadUrlRequest,\r\n} from \"@/components/FileAccess/interfaces\";\r\nimport { generateInterstitialReturnPortalDestination } from \"@/common/subscriptionHelper\";\r\nimport { DeviceType } from \"@/globalEnums\";\r\n\r\nexport function hostUrl(endpoint: IEndpointConfig) {\r\n return !endpoint\r\n ? \"\" // null value for endpoint means requests will be relative\r\n : `${endpoint.protocol || \"http\"}://${endpoint.hostname}${endpoint.port ? \":\" + endpoint.port : \"\"}`;\r\n}\r\n\r\nexport function postLoginRequest(\r\n endpoint: IEndpointConfig,\r\n email: string,\r\n password: string,\r\n recaptchaToken?: string\r\n): AxiosRequestConfig {\r\n return {\r\n method: \"post\",\r\n url: `${hostUrl(endpoint)}/api/cp/auth/login`,\r\n data: { email, password, recaptchaResponse: recaptchaToken },\r\n };\r\n}\r\n\r\nexport function getUser(endpoint: IEndpointConfig): AxiosRequestConfig {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/Me`,\r\n };\r\n}\r\n\r\nexport function getUserDetails(endpoint: IEndpointConfig): AxiosRequestConfig {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/Me/account`,\r\n };\r\n}\r\n\r\nexport function getUserPaymentMethods(endpoint: IEndpointConfig): AxiosRequestConfig {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/payment/paymentMethods`,\r\n };\r\n}\r\n\r\nexport function getUserPaymentMethodGuest(\r\n endpoint: IEndpointConfig,\r\n userGuid: string,\r\n paymentMethodId: string\r\n): AxiosRequestConfig {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/payment/guestPaymentMethod/${userGuid}/${paymentMethodId}`,\r\n };\r\n}\r\n\r\nexport function getSubscriberDownloadsInfo(endpoint: IEndpointConfig): AxiosRequestConfig {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/Me/download`,\r\n };\r\n}\r\n\r\n//eslint does not like unused parameters, but we're saving language for later\r\nexport function getSecurityQuestionsList(endpoint: IEndpointConfig, language: string): AxiosRequestConfig {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/Me/getSecurityQuestionGroups/${language}`,\r\n };\r\n}\r\n\r\nexport function getCarboniteVersionNumber(endpoint: IEndpointConfig): AxiosRequestConfig {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/carboniteVersion`,\r\n };\r\n}\r\n\r\nexport function getShoppingCartByOrderCode(endpoint: IEndpointConfig, orderCode: string): AxiosRequestConfig {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/purchase/cart/${orderCode}`,\r\n };\r\n}\r\n\r\nexport function getShoppingCartByEnrollmentGuid(\r\n endpoint: IEndpointConfig,\r\n enrollmentGuid: string,\r\n requestToken: string\r\n): AxiosRequestConfig {\r\n return {\r\n method: \"post\",\r\n url: `${hostUrl(endpoint)}/api/cp/planetot/cart/${enrollmentGuid}?token=${requestToken}`,\r\n };\r\n}\r\n\r\n/* eslint-disable */\r\n//eslint does not like unused parameters, but we're saving language for later\r\nexport function setSecurityQuestions(\r\n endpoint: IEndpointConfig,\r\n securityQuestions: ISecurityQuestions,\r\n language: string\r\n): AxiosRequestConfig {\r\n return {\r\n method: \"put\",\r\n url: `${hostUrl(endpoint)}/api/cp/Me/securityQuestions`,\r\n data: {\r\n SecurityQuestionOne: securityQuestions.securityQuestionOne,\r\n SecurityQuestionTwo: securityQuestions.securityQuestionTwo,\r\n SecurityQuestionThree: securityQuestions.securityQuestionThree,\r\n SecurityAnswerOne: securityQuestions.securityAnswerOne,\r\n SecurityAnswerTwo: securityQuestions.securityAnswerTwo,\r\n SecurityAnswerThree: securityQuestions.securityAnswerThree,\r\n // Language: language\" // Re-enable this when enabling multi-language\r\n Language: \"EN\",\r\n },\r\n };\r\n}\r\n/* eslint-enable */\r\n\r\nexport function setDefaultCreditCard(endpoint: IEndpointConfig, creditCardId: string): AxiosRequestConfig {\r\n return {\r\n method: \"post\",\r\n url: `${hostUrl(endpoint)}/api/paymentMethods/default/set/${creditCardId}`,\r\n };\r\n}\r\n\r\nexport function removeCreditCard(endpoint: IEndpointConfig, creditCardId: string): AxiosRequestConfig {\r\n return {\r\n method: \"post\",\r\n url: `${hostUrl(endpoint)}/api/paymentMethods/${creditCardId}/delete`,\r\n };\r\n}\r\n\r\nexport function removeAndReplaceCreditCard(\r\n endpoint: IEndpointConfig,\r\n creditCardId: string,\r\n newDefaultCreditCardId: string\r\n): AxiosRequestConfig {\r\n return {\r\n method: \"post\",\r\n url: `${hostUrl(endpoint)}/api/paymentMethods/${creditCardId}/delete`,\r\n data: { ReplacementPaymentMethodId: newDefaultCreditCardId, SetAsDefault: true },\r\n };\r\n}\r\n\r\nexport function checkExistingEmail(endpoint: IEndpointConfig, emailRequest: ICheckEmailRequest): AxiosRequestConfig {\r\n return {\r\n method: \"post\",\r\n url: `${hostUrl(endpoint)}/api/cp/users`,\r\n data: emailRequest,\r\n };\r\n}\r\n\r\nexport function getUserPaymentHistory(endpoint: IEndpointConfig): AxiosRequestConfig {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/accounts/personal/paymenthistory`,\r\n };\r\n}\r\n\r\nexport function getInvoiceDetails(endpoint: IEndpointConfig, invoiceNumber: string): AxiosRequestConfig {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/payment/${invoiceNumber}/invoicedetails`,\r\n };\r\n}\r\n\r\n// export function getUserSecurityPhoneAnonymous(endpoint: IEndpointConfig, personId: number): AxiosRequestConfig {\r\n// return {\r\n// method: \"get\",\r\n// url: `${hostUrl(endpoint)}/api/cp/accounts/personal/GetSecurityPhone/${personId}`\r\n// }\r\n// }\r\n\r\nexport function getUserSecurityPhone(endpoint: IEndpointConfig): AxiosRequestConfig {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/Me/SecurityPhone`,\r\n };\r\n}\r\n\r\nexport function getSecurityQuestions(endpoint: IEndpointConfig): AxiosRequestConfig {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/Me/SecurityQuestions`,\r\n };\r\n}\r\n\r\nexport function validateAndUpdatePassword(\r\n endpoint: IEndpointConfig,\r\n currentPassword: string,\r\n newPassword: string\r\n): AxiosRequestConfig {\r\n return {\r\n method: \"put\",\r\n url: `${hostUrl(endpoint)}/api/cp/personal/UpdatePassword`,\r\n data: { CurrentPassword: currentPassword, NewPassword: newPassword },\r\n };\r\n}\r\n\r\nexport function validateCastleTokenForProtectedFiles(endpoint: IEndpointConfig, token: string): AxiosRequestConfig {\r\n return {\r\n method: \"post\",\r\n url: `${hostUrl(endpoint)}/api/cp/Me/CanDownloadProtectedFiles`,\r\n data: { Token: token },\r\n };\r\n}\r\n\r\nexport function updateUserPersonalInfo(endpoint: IEndpointConfig, user: IUpdateSubscriberRequest): AxiosRequestConfig {\r\n return {\r\n method: \"put\",\r\n url: `${hostUrl(endpoint)}/api/cp/Me/subscriberInfo`,\r\n data: {\r\n FirstName: user.firstName,\r\n LastName: user.lastName,\r\n Email: user.email,\r\n AlternateEmail: user.alternateEmail,\r\n },\r\n };\r\n}\r\n\r\nexport function updateComputerDescription(\r\n endpoint: IEndpointConfig,\r\n computerId: number,\r\n computerDescription: string\r\n): AxiosRequestConfig {\r\n return {\r\n method: \"put\",\r\n url: `${hostUrl(endpoint)}/api/cp/computers/${computerId}`,\r\n data: { ComputerDescription: computerDescription },\r\n };\r\n}\r\n\r\nexport function requestVerificationCode(endpoint: IEndpointConfig, method: string): AxiosRequestConfig {\r\n return {\r\n method: \"post\",\r\n url: `${hostUrl(endpoint)}/api/cp/accounts/personal/SendVerificationCode`,\r\n data: { SecurityPhoneVerificationMethod: method },\r\n };\r\n}\r\n\r\nexport function requestVerificationCodeWithCastleScore(\r\n endpoint: IEndpointConfig,\r\n method: string,\r\n castleToken: string\r\n): AxiosRequestConfig {\r\n return {\r\n method: \"post\",\r\n url: `${hostUrl(endpoint)}/api/cp/accounts/personal/SendVerificationCodeWithCastleScoreCheck`,\r\n data: { SecurityPhoneVerificationMethod: method, castleToken: castleToken },\r\n };\r\n}\r\n\r\nexport function sendVerificationCode(\r\n endpoint: IEndpointConfig,\r\n personId: number,\r\n verificationCode: string\r\n): AxiosRequestConfig {\r\n return {\r\n method: \"post\",\r\n url: `${hostUrl(endpoint)}/api/cp/accounts/personal/ValidateVerificationCode`,\r\n data: { PersonId: personId, VerificationCode: verificationCode },\r\n };\r\n}\r\n\r\nexport function validateCodeAndTrustClient(\r\n endpoint: IEndpointConfig,\r\n verificationCode: string,\r\n isTokenLongTrusted: boolean,\r\n source: string\r\n): AxiosRequestConfig {\r\n return {\r\n method: \"post\",\r\n url: `${hostUrl(endpoint)}/api/cp/accounts/personal/ValidateCodeAndTrustClient`,\r\n data: { VerificationCode: verificationCode, IsTokenLongTrusted: isTokenLongTrusted, Source: source },\r\n };\r\n}\r\n\r\nexport function setSecurityPhone(endpoint: IEndpointConfig, phone: IUserSecurityPhoneRequest): AxiosRequestConfig {\r\n return {\r\n method: \"put\",\r\n url: `${hostUrl(endpoint)}/api/cp/Me/securityPhone`,\r\n data: phone,\r\n };\r\n}\r\n\r\nexport function deleteSecurityPhone(endpoint: IEndpointConfig): AxiosRequestConfig {\r\n return {\r\n method: \"delete\",\r\n url: `${hostUrl(endpoint)}/api/cp/Me/SecurityPhone`,\r\n };\r\n}\r\n\r\nexport function GetNewAccountStatus(endpoint: IEndpointConfig, guid: string): AxiosRequestConfig {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/Me/AccountStatus/${guid}`,\r\n };\r\n}\r\n\r\nexport function setNewAccountPassword(\r\n endpoint: IEndpointConfig,\r\n guid: string,\r\n newPassword: string\r\n): AxiosRequestConfig {\r\n return {\r\n method: \"put\",\r\n url: `${hostUrl(endpoint)}/api/cp/Me/SetNewAccountPassword/${guid}`,\r\n data: { newPassword: newPassword },\r\n };\r\n}\r\n\r\nexport function getZuoraCreditCardFormParams(\r\n endpoint: IEndpointConfig,\r\n userGuid: string,\r\n formId: string,\r\n requestToken: string\r\n): AxiosRequestConfig {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/purchase/form/${userGuid}/${formId}?token=${requestToken}`,\r\n };\r\n}\r\n\r\nexport function getZuoraCreditCardFormEmailParams(\r\n endpoint: IEndpointConfig,\r\n email: string,\r\n formId: string,\r\n requestToken: string\r\n): AxiosRequestConfig {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/purchase/guestForm/${formId}?email=${encodeURIComponent(\r\n email\r\n )}&token=${requestToken}`,\r\n };\r\n}\r\n\r\nexport function getZuoraCreditCardFormComputerIdParams(\r\n endpoint: IEndpointConfig,\r\n computerId: number,\r\n formId: string,\r\n requestToken: string\r\n): AxiosRequestConfig {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/purchase/guestForm/${formId}?computerId=${computerId}&token=${requestToken}`,\r\n };\r\n}\r\n\r\nexport function getZuoraCreditCardFormLicenseKeyParams(\r\n endpoint: IEndpointConfig,\r\n licenseKey: string,\r\n formId: string,\r\n requestToken: string\r\n): AxiosRequestConfig {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/purchase/guestForm/${formId}?licenseKey=${licenseKey}&token=${requestToken}`,\r\n };\r\n}\r\n\r\nexport function getPhoneCountryCodes(endpoint: IEndpointConfig): AxiosRequestConfig {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/geography/phoneCountryCodes`,\r\n };\r\n}\r\n\r\nexport function resetPassword(endpoint: IEndpointConfig, personId: number, newPassword: string): AxiosRequestConfig {\r\n return {\r\n method: \"put\",\r\n url: `${hostUrl(endpoint)}/api/cp/personal/ResetPassword`,\r\n data: { PersonId: personId, Password: newPassword },\r\n };\r\n}\r\n\r\nexport function getWebrootUserInfo(endpoint: IEndpointConfig, webrootKey: string): AxiosRequestConfig {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/salesHeader/${webrootKey}`,\r\n };\r\n}\r\n\r\nexport function createAccount(\r\n endpoint: IEndpointConfig,\r\n email: string,\r\n password: string,\r\n keycode: string,\r\n ecommKey: string,\r\n recaptchaToken: string,\r\n languageCode: string\r\n): AxiosRequestConfig {\r\n return {\r\n method: \"post\",\r\n url: `${hostUrl(endpoint)}/api/cp/accounts`,\r\n data: {\r\n Email: email,\r\n Password: password,\r\n KeyCode: keycode,\r\n OrderHeaderToken: ecommKey,\r\n RecaptchaResponse: recaptchaToken,\r\n preferredLanguage: languageCode,\r\n },\r\n };\r\n}\r\n\r\nexport function getInvoice(endpoint: IEndpointConfig, invoiceId: string): AxiosRequestConfig {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/invoices/${invoiceId}`,\r\n };\r\n}\r\n\r\nexport function getCountries(endpoint: IEndpointConfig) {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/countries`,\r\n };\r\n}\r\n\r\nexport function addKeycode(endpoint: IEndpointConfig, keycode: string, orderHeaderToken?: string): AxiosRequestConfig {\r\n return {\r\n method: \"post\",\r\n url: `${hostUrl(endpoint)}/api/cp/Me/webroot/Licenses`,\r\n data: { Keycode: keycode, OrderHeaderToken: orderHeaderToken },\r\n };\r\n}\r\n\r\nexport function getSubscriberInfo(endpoint: IEndpointConfig): AxiosRequestConfig {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/Me/subscriberInfo`,\r\n };\r\n}\r\n\r\nexport function refreshSubscriber(endpoint: IEndpointConfig): AxiosRequestConfig {\r\n return {\r\n method: \"put\",\r\n url: `${hostUrl(endpoint)}/api/cp/Me/subscriberRefresh`,\r\n };\r\n}\r\n\r\nexport function updateAutoRenewOption(\r\n endpoint: IEndpointConfig,\r\n autoRenewUpdateRequest: IAutoRenewUpdateRequest\r\n): AxiosRequestConfig {\r\n return {\r\n method: \"put\",\r\n url: `${hostUrl(endpoint)}/api/cp/subscription/autoRenewal`,\r\n data: autoRenewUpdateRequest,\r\n };\r\n}\r\n\r\nexport function setRenewalDiscount(\r\n endpoint: IEndpointConfig,\r\n zuoraSubscriptionNumber: string,\r\n enableAutoRenewDiscount: IAutoRenewDiscountRequest\r\n): AxiosRequestConfig {\r\n return {\r\n method: \"put\",\r\n url: `${hostUrl(endpoint)}/api/cp/subscriptions/${zuoraSubscriptionNumber}/autorenewaldiscount`,\r\n data: enableAutoRenewDiscount,\r\n };\r\n}\r\n\r\nexport function cancelSubscription(endpoint: IEndpointConfig, subscriptionNumber: string): AxiosRequestConfig {\r\n return {\r\n method: \"delete\",\r\n url: `${hostUrl(endpoint)}/api/cp/subscription/${subscriptionNumber}`,\r\n };\r\n}\r\n\r\nexport function getSafeClientURL(request: IInstallRequest, endpoint: IEndpointConfig): AxiosRequestConfig {\r\n return {\r\n method: \"post\",\r\n url: `${hostUrl(endpoint)}/api/cp/safe/installer`,\r\n data: {\r\n ActivationCode: request.activationCode,\r\n OperatingSystem: request.operatingSystem,\r\n DeviceId: request.deviceId,\r\n OfferCode: request.offerCode,\r\n InstallType: request.installType,\r\n KeyCodeForSafeLite: request.keyCodeForSafeLite,\r\n },\r\n };\r\n}\r\n\r\nexport function getSubscriptions(endpoint: IEndpointConfig): AxiosRequestConfig {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/personal/subscriptions`,\r\n };\r\n}\r\n\r\nexport function getLatestSubscriptions(endpoint: IEndpointConfig): AxiosRequestConfig {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/Me/subscriptions`,\r\n };\r\n}\r\n\r\nexport function logout(endpoint: IEndpointConfig): AxiosRequestConfig {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/auth/logout?noRedirect=true`,\r\n };\r\n}\r\n\r\nexport function releaseSubscription(endpoint: IEndpointConfig, deviceId: number): AxiosRequestConfig {\r\n return {\r\n method: \"delete\",\r\n url: `${hostUrl(endpoint)}/api/cp/safe/computer/${deviceId}`,\r\n };\r\n}\r\n\r\nexport function provisionLastPass(endpoint: IEndpointConfig, keyCode: string): AxiosRequestConfig {\r\n return {\r\n method: \"post\",\r\n url: `${hostUrl(endpoint)}/api/cp/lastPass`,\r\n data: { keyCode },\r\n };\r\n}\r\n\r\nexport function getLastPassInfo(endpoint: IEndpointConfig): AxiosRequestConfig {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/lastPass`,\r\n };\r\n}\r\n\r\nexport function getWebrootKeycode(\r\n endpoint: IEndpointConfig,\r\n deviceId: number,\r\n zuoraSubscriptionNumber: string\r\n): AxiosRequestConfig {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(\r\n endpoint\r\n )}/api/accounts/keycode?deviceId=${deviceId}&zuoraSubscriptionNumber=${zuoraSubscriptionNumber}`,\r\n };\r\n}\r\n\r\nexport function getOutstandingInvoices(endpoint: IEndpointConfig): AxiosRequestConfig {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/accounts/GetOutstandingInvoices`,\r\n };\r\n}\r\n\r\nexport function payOutstandingInvoices(\r\n endpoint: IEndpointConfig,\r\n payOutstandingInvoicesRequest: IPayOutstandingInvoicesRequest\r\n): AxiosRequestConfig {\r\n return {\r\n method: \"put\",\r\n url: `${hostUrl(endpoint)}/api/orders/payOutstandingInvoices`,\r\n data: payOutstandingInvoicesRequest,\r\n };\r\n}\r\n\r\nexport function verifyActivationCode(endpoint: IEndpointConfig, activationCode: string): AxiosRequestConfig {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/activationCodes/${activationCode}/validate`,\r\n };\r\n}\r\n\r\nexport function applyActivationCode(\r\n endpoint: IEndpointConfig,\r\n activationCode: string,\r\n computerId: number\r\n): AxiosRequestConfig {\r\n return {\r\n method: \"post\",\r\n url: `${hostUrl(endpoint)}/api/cp/activationCodes/${activationCode}/apply?computerId=${computerId}`,\r\n };\r\n}\r\n\r\nexport function getWebrootRenewUrl(endpoint: IEndpointConfig, keycode: string): AxiosRequestConfig {\r\n const portalDestParam = generateInterstitialReturnPortalDestination(\"?\");\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/Me/webroot/Licenses/${keycode}/renewalUrl${portalDestParam}`,\r\n };\r\n}\r\n\r\nexport function getAvailableActivationCodes(endpoint: IEndpointConfig): AxiosRequestConfig {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/me/activationCodes`,\r\n };\r\n}\r\n\r\nexport function optInToAutomaticVideoBackup(endpoint: IEndpointConfig, deviceId: number): AxiosRequestConfig {\r\n return {\r\n method: \"put\",\r\n url: `${hostUrl(endpoint)}/api/cp/safe/computer/${deviceId}/avb`,\r\n };\r\n}\r\n\r\nexport function getConsumerVatInfoAsync(endpoint: IEndpointConfig, paymentMethodId: string | null): AxiosRequestConfig {\r\n const paymentMethodIdParameter = paymentMethodId ? `?paymentMethodId=${paymentMethodId}` : \"\";\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/personal/vatInfo${paymentMethodIdParameter}`,\r\n };\r\n}\r\n\r\nexport function setVatInfo(endpoint: IEndpointConfig, vatId: string, countryCode: string): AxiosRequestConfig {\r\n return {\r\n method: \"post\",\r\n url: `${hostUrl(endpoint)}/api/accounts/setVatInfo`,\r\n data: { VatId: vatId, CountryCode: countryCode },\r\n };\r\n}\r\n\r\nexport function getPendingVerificationEmail(endpoint: IEndpointConfig): AxiosRequestConfig {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/Me/email`,\r\n };\r\n}\r\n\r\nexport function cancelPendingEmailValidation(endpoint: IEndpointConfig): AxiosRequestConfig {\r\n return {\r\n method: \"delete\",\r\n url: `${hostUrl(endpoint)}/api/cp/Me/email`,\r\n };\r\n}\r\n\r\nexport function putClientException(endpoint: IEndpointConfig, ce: IClientException): AxiosRequestConfig {\r\n return {\r\n method: \"put\",\r\n url: `${hostUrl(endpoint)}/api/clientExceptions`,\r\n data: ce,\r\n };\r\n}\r\n\r\nexport function addEncryptionKey(\r\n endpoint: IEndpointConfig,\r\n computerId: number,\r\n encryptionKey: string,\r\n encryptionKeyPassword: string | null\r\n): AxiosRequestConfig {\r\n return {\r\n method: \"put\",\r\n url: `${hostUrl(endpoint)}/api/cp/computers/${computerId}/encryptionKey`,\r\n data: { EncryptionKey: encryptionKey, EncryptionPassword: encryptionKeyPassword },\r\n };\r\n}\r\n\r\nexport function getEncryptionKeyPasswordHint(endpoint: IEndpointConfig, computerId: number): AxiosRequestConfig {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/computers/${computerId}/passwordHint`,\r\n };\r\n}\r\n\r\nexport function verifyEmail(endpoint: IEndpointConfig, verificationCode: string): AxiosRequestConfig {\r\n return {\r\n method: \"put\",\r\n url: `${hostUrl(endpoint)}/api/cp/emailVerification/${verificationCode}`,\r\n };\r\n}\r\n\r\nexport function sendNewVerificationEmail(endpoint: IEndpointConfig, verificationCode: string): AxiosRequestConfig {\r\n return {\r\n method: \"put\",\r\n url: `${hostUrl(endpoint)}/api/cp/emailVerification/${verificationCode}/sendNew`,\r\n };\r\n}\r\n\r\nexport function updateEmail(endpoint: IEndpointConfig, email: string, password: string): AxiosRequestConfig {\r\n return {\r\n method: \"put\",\r\n url: `${hostUrl(endpoint)}/api/cp/Me/email`,\r\n data: { Email: email, Password: password },\r\n };\r\n}\r\n\r\nexport function resendVerificationEmail(endpoint: IEndpointConfig): AxiosRequestConfig {\r\n return {\r\n method: \"post\",\r\n url: `${hostUrl(endpoint)}/api/cp/Me/emailverification`,\r\n };\r\n}\r\n\r\nexport function getBackupSummary(endpoint: IEndpointConfig): AxiosRequestConfig {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/me/backupSummary`,\r\n };\r\n}\r\n\r\nexport function getRfaSession(endpoint: IEndpointConfig, computerId: string): AxiosRequestConfig {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/computers/${computerId}/rfasession`,\r\n };\r\n}\r\n\r\nexport function getSkyWebrootDevices(endpoint: IEndpointConfig): AxiosRequestConfig {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/Me/webroot/Licenses/devices`,\r\n };\r\n}\r\n\r\nexport function updateWebrootDevice(\r\n endpoint: IEndpointConfig,\r\n request: IUpdateWebrootDeviceRequest\r\n): AxiosRequestConfig {\r\n return {\r\n method: \"put\",\r\n url: `${hostUrl(endpoint)}/api/cp/webroot/device/${request.deviceId}/${request.instanceId}`,\r\n data: { Nickname: request.deviceNickname, IsVisible: request.isVisible, Keycode: request.keycode },\r\n };\r\n}\r\n\r\nexport function removeWebrootDevice(\r\n endpoint: IEndpointConfig,\r\n request: IRemoveWebrootDeviceRequest,\r\n keycode: string\r\n): AxiosRequestConfig {\r\n return {\r\n method: \"put\",\r\n url: `${hostUrl(endpoint)}/api/cp/me/webroot/license/${keycode}/device/deactivate`,\r\n data: {\r\n ...request,\r\n },\r\n };\r\n}\r\n\r\nexport function getAllstateSubscriptions(endpoint: IEndpointConfig): AxiosRequestConfig {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/allstate`,\r\n };\r\n}\r\n\r\nexport function addAllstateSubscription(endpoint: IEndpointConfig, request: IAllstateRequest): AxiosRequestConfig {\r\n return {\r\n method: \"post\",\r\n url: `${hostUrl(endpoint)}/api/cp/allstate`,\r\n data: {\r\n ...request,\r\n },\r\n };\r\n}\r\n\r\nexport function updateAllstateSubscriptions(\r\n endpoint: IEndpointConfig,\r\n request: IAllstateUpdateRequest\r\n): AxiosRequestConfig {\r\n return {\r\n method: \"put\",\r\n url: `${hostUrl(endpoint)}/api/cp/allstate`,\r\n data: {\r\n ...request,\r\n },\r\n };\r\n}\r\n\r\nexport function getCssbBackupSets(\r\n endpoint: IEndpointConfig,\r\n computerName: string,\r\n sort: string,\r\n orderBy: string\r\n): AxiosRequestConfig {\r\n const optionsParams = `?sort=${sort}&orderBy=${orderBy}`;\r\n\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/cssbRfa/computers/${computerName}/BackupSets/${optionsParams}`,\r\n };\r\n}\r\n\r\nexport function getCssbBackupRuns(\r\n endpoint: IEndpointConfig,\r\n computerName: string,\r\n backupSetName: string,\r\n sort: string,\r\n orderBy: string\r\n): AxiosRequestConfig {\r\n const optionsParams = `?sort=${sort}&orderBy=${orderBy}`;\r\n\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(\r\n endpoint\r\n )}/api/cp/cssbRfa/computers/${computerName}/backupSets/${backupSetName}/BackupRuns/${optionsParams}`,\r\n };\r\n}\r\n\r\nexport function getCssbBackupRunDetails(endpoint: IEndpointConfig, request: ICssbDetailsRequest): AxiosRequestConfig {\r\n let optionsParams = `?start=${request.pageStart}&numberOfFiles=${request.numberOfFilesPerPage}&sort=${request.sort}&orderBy=${request.orderBy}`;\r\n const browse = `browse=${!request.isSearch}`;\r\n\r\n if (request.timeStamp) {\r\n optionsParams = `${optionsParams}&backupRunTime=${request.timeStamp}`;\r\n }\r\n\r\n if (request.path) {\r\n const encodedPath = Buffer.from(request.path).toString(\"base64\");\r\n optionsParams = `${optionsParams}&filePathBase64=${encodedPath}`;\r\n }\r\n\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/cssbRfa/computers/${request.computerName}/backupSets/${\r\n request.backupSetName\r\n }/BackupDetails${optionsParams}&${browse}`,\r\n };\r\n}\r\n\r\nexport function addCssbDownloadInfo(endpoint: IEndpointConfig, request: ICssbDownloadInfoRequest): AxiosRequestConfig {\r\n return {\r\n method: \"post\",\r\n url: `${hostUrl(endpoint)}/api/cp/cssbRfa/BackupDownloadInfo`,\r\n data: request,\r\n };\r\n}\r\n\r\nexport function getCssbDownloadUrl(endpoint: IEndpointConfig, request: ICssbDownloadUrlRequest): AxiosRequestConfig {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/cssbRfa/computers/${request.computerName}/backupSets/${\r\n request.backupSetName\r\n }/RequestId/${request.requestId}/DownloadUrl`,\r\n data: request,\r\n };\r\n}\r\n\r\nexport function cancelCssbDownload(endpoint: IEndpointConfig, request: ICssbDownloadUrlRequest): AxiosRequestConfig {\r\n return {\r\n method: \"delete\",\r\n url: `${hostUrl(endpoint)}/api/cp/cssbRfa/computers/${request.computerName}/backupSets/${\r\n request.backupSetName\r\n }/RequestId/${request.requestId}/DownloadUrl`,\r\n data: request,\r\n };\r\n}\r\n\r\nexport function getInProgressCssbDownloadRequests(endpoint: IEndpointConfig): AxiosRequestConfig {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/cssbRfa/downloadUrls`,\r\n };\r\n}\r\n\r\nexport function getWebrootPIIInformation(endpoint: IEndpointConfig, keycode: string): AxiosRequestConfig {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/me/webroot/licenses/${keycode}/userInformation`,\r\n };\r\n}\r\n\r\nexport function getCssbServers(endpoint: IEndpointConfig): AxiosRequestConfig {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/cssbRfa/computers`,\r\n };\r\n}\r\n\r\nexport function setLangCookie(endpoint: IEndpointConfig, language: string): AxiosRequestConfig {\r\n let cookieValue: string;\r\n switch (language.toLocaleLowerCase()) {\r\n case \"ja\":\r\n cookieValue = \"ja-JP\";\r\n break;\r\n default:\r\n cookieValue = \"en\";\r\n break;\r\n }\r\n return {\r\n method: \"put\",\r\n url: `${hostUrl(endpoint)}/api/cp/auth/lang?lang=${cookieValue}`,\r\n };\r\n}\r\n\r\nexport function getLangCookie(endpoint: IEndpointConfig): AxiosRequestConfig {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/auth/lang`,\r\n };\r\n}\r\n\r\nexport function getBuyFlowSelectPlans(endpoint: IEndpointConfig): AxiosRequestConfig {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/buyflowSelectPlans`,\r\n };\r\n}\r\n\r\nexport function submitCourierRecovery(endpoint: IEndpointConfig, request: ICourierRecoveryRequest): AxiosRequestConfig {\r\n return {\r\n method: \"post\",\r\n url: `${hostUrl(endpoint)}/api/cp/courierrecovery`,\r\n data: request,\r\n };\r\n}\r\n\r\nexport function getPendingRequestToManageAsync(endpoint: IEndpointConfig): AxiosRequestConfig {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/Me/reseller/manage`,\r\n };\r\n}\r\n\r\nexport function manageCustomerByResellerAsync(\r\n endpoint: IEndpointConfig,\r\n request: IManageCustomerByResellerRequest\r\n): AxiosRequestConfig {\r\n return {\r\n method: \"post\",\r\n url: `${hostUrl(endpoint)}/api/cp/Me/reseller/manage`,\r\n data: request,\r\n };\r\n}\r\n\r\nexport function purchaseShoppingCart(endpoint: IEndpointConfig, request: IShoppingCart): AxiosRequestConfig {\r\n return {\r\n method: \"put\",\r\n url: `${hostUrl(endpoint)}/api/cp/purchase/${request.brand}`,\r\n data: request,\r\n };\r\n}\r\n\r\nexport function getPurchaseKeycodes(\r\n endpoint: IEndpointConfig,\r\n invoiceNumber: string,\r\n orderCode: string\r\n): AxiosRequestConfig {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/purchase/invoices/${invoiceNumber}/keycodes?orderCode=${orderCode}`,\r\n };\r\n}\r\n\r\nexport function getShoppingCart(endpoint: IEndpointConfig, brand: string): AxiosRequestConfig {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/purchase/${brand}/cart`,\r\n };\r\n}\r\n\r\nexport function getShoppingCartForUser(endpoint: IEndpointConfig, userGuid: string, brand: string): AxiosRequestConfig {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/users/${userGuid}/${brand}/cart`,\r\n };\r\n}\r\n\r\nexport function saveShoppingCart(endpoint: IEndpointConfig, request: IShoppingCart): AxiosRequestConfig {\r\n return {\r\n method: \"put\",\r\n url: `${hostUrl(endpoint)}/api/cp/purchase/${request.brand}/preview`,\r\n data: request,\r\n };\r\n}\r\n\r\nexport function getProductCatalog(endpoint: IEndpointConfig, type: string, campaignId?: number) {\r\n const campaignIdUrlComponent = typeof campaignId != \"undefined\" ? `${campaignId}` : \"\";\r\n const urlComponent = type + \"/\" + campaignIdUrlComponent;\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/products/${urlComponent}`,\r\n };\r\n}\r\n\r\nexport function setLanguagePreference(endpoint: IEndpointConfig, request: ISetLanguagePreferenceRequest) {\r\n return {\r\n method: \"post\",\r\n url: `${hostUrl(endpoint)}/api/cp/Me/language`,\r\n data: request,\r\n };\r\n}\r\n\r\nexport function getSubscriptionForUnauthorizedFlow(endpoint: IEndpointConfig, deviceId: number) {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/subscription/${deviceId}`,\r\n };\r\n}\r\n\r\nexport function silentLogout() {\r\n return {\r\n method: \"get\",\r\n url: `${URLS.UP_ENDPOINT.protocol}://${URLS.UP_ENDPOINT.hostname}/api/cp/auth/logout`,\r\n };\r\n}\r\n\r\nexport function checkHasRecentPurchase(endpoint: IEndpointConfig, computerId: number): AxiosRequestConfig {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/purchase/recent/${computerId}`,\r\n };\r\n}\r\n\r\nexport function getProspectId(endpoint: IEndpointConfig, prospectGuid: string): AxiosRequestConfig {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/accounts/${prospectGuid}/ProspectId`,\r\n };\r\n}\r\n\r\nexport function payPalApprove(endpoint: IEndpointConfig, tokenId: string, brand: string): AxiosRequestConfig {\r\n return {\r\n method: \"post\",\r\n url: `${hostUrl(endpoint)}/api/cp/paypal/billingAgreement?tokenId=${tokenId}&brand=${brand}`,\r\n };\r\n}\r\n\r\nexport function createPayPalAgreementToken(\r\n endpoint: IEndpointConfig,\r\n request: IPayPalAgreementTokenRequest\r\n): AxiosRequestConfig {\r\n return {\r\n method: \"post\",\r\n url: `${hostUrl(endpoint)}/api/cp/paypal/AgreementToken`,\r\n data: request,\r\n };\r\n}\r\n\r\nexport function getActivationCode(\r\n endpoint: IEndpointConfig,\r\n request: IActivationCodePurchaseRequest\r\n): AxiosRequestConfig {\r\n const subscriptionNumber =\r\n request.subscriptionNumber && typeof request.subscriptionNumber != \"undefined\"\r\n ? `subscriptionNumber=${request.subscriptionNumber}`\r\n : \"\";\r\n const userGuid = request.userGuid && typeof request.userGuid != \"undefined\" ? `&userGuid=${request.userGuid}` : \"\";\r\n const email = request.email && typeof request.email != \"undefined\" ? `&email=${request.email}` : \"\";\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/purchase/activationCode?${subscriptionNumber}${userGuid}${email}`,\r\n data: request,\r\n };\r\n}\r\n\r\nexport function setAutoRenew(endpoint: IEndpointConfig, request: IAutoRenewRequest): AxiosRequestConfig {\r\n return {\r\n method: \"put\",\r\n url: `${hostUrl(endpoint)}/api/cp/subscription/autorenewal`,\r\n data: request,\r\n };\r\n}\r\n\r\nexport function getLicenseKeyInfo(endpoint: IEndpointConfig, licenseKey: string, upgradeSku = \"\"): AxiosRequestConfig {\r\n let upgradeParam = \"\";\r\n if (upgradeSku) {\r\n upgradeParam = `?sku=${upgradeSku}`;\r\n }\r\n\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/subscription/licenseKeys/${licenseKey}/purchaseInfo${upgradeParam}`,\r\n };\r\n}\r\n\r\nexport function getLicenseKeyFromVendorKey(endpoint: IEndpointConfig, vendorKey: string): AxiosRequestConfig {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/vendor/${vendorKey}`,\r\n };\r\n}\r\n\r\nexport function getPureVpnLatestVersionDetails(endpoint: IEndpointConfig, deviceType: DeviceType): AxiosRequestConfig {\r\n return {\r\n method: \"get\",\r\n url: `${hostUrl(endpoint)}/api/cp/purevpn/app/latest/version/${deviceType}`,\r\n };\r\n}\r\n","export enum cpuArchitecture {\r\n windows64 = \"x86_64\",\r\n window32 = \"x86\",\r\n arm64 = \"ARM64\",\r\n arm = \"ARM32\",\r\n unknown = \"unknown\",\r\n}\r\n\r\nexport async function cpuDetect() {\r\n const data = await navigator?.userAgentData?.getHighEntropyValues([\"architecture\", \"bitness\"]);\r\n let platform = cpuArchitecture.unknown;\r\n if (data) {\r\n if (navigator?.userAgentData?.platform === \"Windows\") {\r\n if (data.architecture === \"x86\") {\r\n if (data.bitness === \"64\") {\r\n platform = cpuArchitecture.windows64;\r\n } else if (data.bitness === \"32\") {\r\n platform = cpuArchitecture.window32;\r\n }\r\n } else if (data.architecture === \"arm\") {\r\n if (data.bitness === \"64\") {\r\n platform = cpuArchitecture.arm64;\r\n } else if (data.bitness === \"32\") {\r\n platform = cpuArchitecture.arm;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return platform;\r\n}\r\n","import { cpuArchitecture, cpuDetect } from \"@/common/cpuDetect\";\r\nimport { defineStore } from \"pinia\";\r\nimport { ref } from \"vue\";\r\n\r\nexport const useSiteSettingsStore = defineStore(\"siteSettings\", () => {\r\n const hasPendingEmailVerification = ref(false);\r\n const installDeviceFromSubscriptionPage = ref(false);\r\n const activationCodeAppliedSuccess = ref(false);\r\n const moveMySubscriptionSuccess = ref(false);\r\n const activationCodeToInstall = ref(\"\");\r\n const redirectPreliminaryUserToBackup = ref(false);\r\n const userCpuArchitecture = ref();\r\n\r\n //Returns the user's CPU Architecture\r\n async function getUserCpuArchitecture() {\r\n if (!userCpuArchitecture.value) {\r\n userCpuArchitecture.value = await cpuDetect();\r\n }\r\n\r\n return userCpuArchitecture.value;\r\n }\r\n\r\n function getIsCreateAccountFlow(): boolean {\r\n return sessionStorage.getItem(\"isCreateAccountFlow\") === \"true\";\r\n }\r\n\r\n function setIsCreateAccountFlow(value: boolean) {\r\n sessionStorage.setItem(\"isCreateAccountFlow\", value ? \"true\" : \"false\");\r\n }\r\n\r\n function getShowedVerifyEmailDialogAfterCreateAccountFlow(): boolean {\r\n return sessionStorage.getItem(\"showedVerifyEmailDialogAfterCreateAccountFlow\") === \"true\";\r\n }\r\n\r\n function setShowedVerifyEmailDialogAfterCreateAccountFlow(value: boolean) {\r\n sessionStorage.setItem(\"showedVerifyEmailDialogAfterCreateAccountFlow\", value ? \"true\" : \"false\");\r\n }\r\n\r\n function getSubscriberRefreshedAfterLogin(): boolean {\r\n return sessionStorage.getItem(\"subscriberRefreshedAfterLogin\") === \"true\";\r\n }\r\n\r\n function setSubscriberRefreshedAfterLogin(value: boolean) {\r\n sessionStorage.setItem(\"subscriberRefreshedAfterLogin\", value ? \"true\" : \"false\");\r\n }\r\n\r\n function getSkipAccountSetup(): boolean {\r\n return sessionStorage.getItem(\"skipAccountSetup\") === \"true\";\r\n }\r\n\r\n function setSkipAccountSetup(value: boolean) {\r\n return sessionStorage.setItem(\"skipAccountSetup\", value ? \"true\" : \"false\");\r\n }\r\n\r\n // Since we are using setup instead of options, we need to create a function to reset the state\r\n // See more on: https://pinia.vuejs.org/core-concepts/state.html - Resetting the State\r\n function reset() {\r\n hasPendingEmailVerification.value = false;\r\n installDeviceFromSubscriptionPage.value = false;\r\n activationCodeAppliedSuccess.value = false;\r\n moveMySubscriptionSuccess.value = false;\r\n activationCodeToInstall.value = \"\";\r\n redirectPreliminaryUserToBackup.value = false;\r\n }\r\n\r\n return {\r\n hasPendingEmailVerification,\r\n installDeviceFromSubscriptionPage,\r\n activationCodeAppliedSuccess,\r\n moveMySubscriptionSuccess,\r\n activationCodeToInstall,\r\n getIsCreateAccountFlow,\r\n getShowedVerifyEmailDialogAfterCreateAccountFlow,\r\n getSubscriberRefreshedAfterLogin,\r\n setIsCreateAccountFlow,\r\n setShowedVerifyEmailDialogAfterCreateAccountFlow,\r\n setSubscriberRefreshedAfterLogin,\r\n getSkipAccountSetup,\r\n setSkipAccountSetup,\r\n redirectPreliminaryUserToBackup,\r\n reset,\r\n getUserCpuArchitecture,\r\n };\r\n});\r\n","import { URLS } from \"@/define\";\r\nimport { useSiteSettingsStore } from \"@/stores/siteSettings\";\r\nimport { clearSession as pendoClearSession } from \"./pendo\";\r\n\r\nexport const logoutURL = `${URLS.UP_ENDPOINT.protocol}://${URLS.UP_ENDPOINT.hostname}/api/cp/auth/logout`;\r\n\r\nexport async function clearSession() {\r\n await pendoClearSession(); // Clear session from Pendo\r\n const siteSettingsStore = useSiteSettingsStore();\r\n siteSettingsStore.setIsCreateAccountFlow(false);\r\n siteSettingsStore.setShowedVerifyEmailDialogAfterCreateAccountFlow(false);\r\n siteSettingsStore.setSubscriberRefreshedAfterLogin(false);\r\n siteSettingsStore.setSkipAccountSetup(false);\r\n siteSettingsStore.reset();\r\n\r\n // Delete all the keys starts with \"DownloadRestrictedFilesToken\" as user can have multiple computers\r\n for (let i = 0; i < sessionStorage.length; i++) {\r\n const key = sessionStorage.key(i);\r\n if (key && key.startsWith(\"DownloadRestrictedFilesToken\")) {\r\n sessionStorage.removeItem(key);\r\n }\r\n }\r\n\r\n // We used to reset the UserStore here,\r\n // but that causes API calls to happen after the logout,\r\n // which refreshes the token which logs the user back in.\r\n}\r\n\r\nexport async function redirectToLogoutURL() {\r\n window.location.replace(logoutURL);\r\n}\r\n\r\nexport async function logout() {\r\n await clearSession();\r\n redirectToLogoutURL();\r\n}\r\n","import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, AxiosError } from \"axios\";\r\nimport { logEvent } from \"@/common/logger\";\r\nimport { IEndpointConfig } from \"../interfaces\";\r\nimport * as Requests from \"./requests\";\r\nimport {\r\n // IUser,\r\n IUserDetails,\r\n ISecurityQuestions,\r\n IUserPaymentHistory,\r\n IUserSecurityPhone,\r\n IUserSecurityPhoneValidation,\r\n IZuoraCreditCardFormParams,\r\n IUserSecurityPhoneRequestCode,\r\n IUserSecurityPhoneRequest,\r\n IPhoneCountryCodes,\r\n ISecurityQuestionsList,\r\n ICrossSitePersonResponse,\r\n ITrialSignupResponse,\r\n IUpdateSubscriberResponse,\r\n IUpdateSubscriberRequest,\r\n ISubscriberInfo,\r\n ISubscriberDownloadsInfo,\r\n IAddKeycodeResponse,\r\n IInstallRequest,\r\n ISubscription,\r\n ILastPassInfo,\r\n ILastPassProvisionResponse,\r\n IOutstandingInvoices,\r\n IPayOutstandingInvoicesRequest,\r\n IPayOutstandingInvoicesResponse,\r\n IActivationCodeResponse,\r\n IAutoRenewUpdateRequest,\r\n IAutoRenewDiscountRequest,\r\n IApplyActivationCodeResponse,\r\n IWebrootRenewUrlResponse,\r\n ISubscriberVatInfo,\r\n IVatInfoResponse,\r\n IClientException,\r\n IPasswordHintResponse,\r\n IBackupSummaryResponse,\r\n IPendingVerificationEmailResponse,\r\n IRfaSessionResponse,\r\n ISkyWebrootDeviceResponse,\r\n IUpdateWebrootDeviceRequest,\r\n IAllstateResponse,\r\n IAllstateRequest,\r\n IAllstateUpdateRequest,\r\n ILoggedInUser,\r\n IRefreshSubscriberResponse,\r\n ILanguageResponse,\r\n IWebrootUserInformation,\r\n IProductCatalogResponse,\r\n ICountriesInfo,\r\n ICourierRecoveryRequest,\r\n ICourierRecoveryResponse,\r\n IGetPendingRequestToManageResponse,\r\n IManageCustomerByResellerRequest,\r\n IInvoiceResponse,\r\n IShoppingCart,\r\n ISetLanguagePreferenceRequest,\r\n IUnauthenticatedSubscription,\r\n IGetPaymentMethodsResponse,\r\n ICheckEmailRequest,\r\n IHasRecentPurchaseResponse,\r\n INewAccountInfoResponse,\r\n INewAccountUpdateResponse,\r\n IUserAccountCreationResponse,\r\n IPayPalApprovalResponse,\r\n IPayPalAgreementTokenResponse,\r\n IPayPalAgreementTokenRequest,\r\n IActivationCodePurchaseRequest,\r\n IActivationCodePurchaseResponse,\r\n IPaymentMethod,\r\n IAutoRenewRequest,\r\n ILicenseKeyInfo,\r\n IPurchaseKeycode,\r\n IUserSecurityPhoneValidationAndTrustClientResponse,\r\n IRemoveWebrootDeviceRequest,\r\n IVendorLicenseKey,\r\n IPureVpnLatestVersionDetailsResponse,\r\n IInvoice,\r\n} from \"./interfaces\";\r\n\r\nimport {\r\n ICssbDetailsRequest,\r\n ICssbDownloadInfoRequest,\r\n ICssbDownloadInfoResponse,\r\n ICssbDownloadUrlRequest,\r\n ICssbRfaInProgressDownloadInfoResponse,\r\n ICssbRfaResponse,\r\n ICssbServerName,\r\n} from \"@/components/FileAccess/interfaces\";\r\n\r\nimport { HTTP_STATUS_FORBIDDEN, HTTP_STATUS_UNAUTHORIZED, MAX_API_WAIT_DURATION } from \"@/define\";\r\nimport { useUserStore } from \"@/stores/user\";\r\nimport { getUrl } from \"@/common/getUrl\";\r\nimport { registerRefreshFunction } from \"@/components/shared/LanguageSelector/LanguageSelector\";\r\nimport { logout } from \"@/common/logout\";\r\nimport { DeviceType } from \"@/globalEnums\";\r\n\r\nlet cpLoginUrl = getUrl(\"CP_LOGIN\");\r\nfunction redirectToLogin(returnUrl?: string) {\r\n // If redirect is coming from verifyEmail, override redirect to root\r\n if (returnUrl?.includes(\"verifyEmail\")) {\r\n returnUrl = window.location.origin;\r\n }\r\n\r\n window.location.href = `${cpLoginUrl}${returnUrl ? \"?returnUrl=\" + encodeURIComponent(returnUrl) : \"\"}`;\r\n}\r\n\r\nfunction refreshApiIndexUrls() {\r\n cpLoginUrl = getUrl(\"CP_LOGIN\");\r\n}\r\n\r\nregisterRefreshFunction(refreshApiIndexUrls, true);\r\nexport interface IUnifiedPortalAPI {\r\n hasLoginCookie: () => boolean;\r\n // login: (email: string, password: string, captchaToken?: string) => Promise>;\r\n logout: () => Promise;\r\n // setToken: (token: string | IGetToken) => void;\r\n getUser: (fromCreateAccount?: boolean) => Promise>;\r\n getUserDetails: () => Promise>;\r\n getUserPaymentMethods: () => Promise>;\r\n getUserPaymentMethodGuest: (userGuid: string, paymentMethodId: string) => Promise>;\r\n getUserPaymentHistory: () => Promise>;\r\n\r\n getInvoiceDetails: (invoiceNumber: string) => Promise>;\r\n\r\n getSubscriberDownloadsInfo: () => Promise>;\r\n validateAndUpdatePassword: (currentPassword: string, newPassword: string) => Promise>;\r\n validateCastleTokenForProtectedFiles: (token: string) => Promise>;\r\n updateUserPersonalInfo: (user: IUpdateSubscriberRequest) => Promise>;\r\n updateComputerDescription: (computerId: number, computerDescription: string) => Promise>;\r\n updateAutoRenewOption: (autoRenewUpdateRequest: IAutoRenewUpdateRequest) => Promise>;\r\n setRenewalDiscount: (\r\n zuoraSubscriptionNumber: string,\r\n autoRenewDiscountRequest: IAutoRenewDiscountRequest\r\n ) => Promise>;\r\n cancelSubscription: (subscriptionNumber: string) => Promise>;\r\n getSecurityQuestionsList: (language: string) => Promise>;\r\n setSecurityQuestions: (securityQuestions: ISecurityQuestions, language: string) => Promise>;\r\n setDefaultCreditCard: (creditCardId: string) => Promise>;\r\n removeCreditCard: (creditCardId: string) => Promise>;\r\n removeAndReplaceCreditCard: (creditCardId: string, newDefaultCreditCardId: string) => Promise>;\r\n getSecurityQuestions: () => Promise>;\r\n getUserSecurityPhone: () => Promise>;\r\n requestVerificationCode: (method: string) => Promise>;\r\n requestVerificationCodeWithCastleScore: (\r\n method: string,\r\n token: string\r\n ) => Promise>;\r\n sendVerificationCode: (\r\n personId: number,\r\n verificationCode: string\r\n ) => Promise>;\r\n validateCodeAndTrustClient: (\r\n verificationCode: string,\r\n isTokenLongTrusted: boolean,\r\n source: string\r\n ) => Promise>;\r\n setSecurityPhone: (phone: IUserSecurityPhoneRequest) => Promise>;\r\n deleteSecurityPhone: () => Promise>;\r\n getNewAccountStatus: (guid: string) => Promise>;\r\n setNewAccountPassword: (guid: string, newPassword: string) => Promise>;\r\n getPhoneCountryCodes: () => Promise>;\r\n resetPassword: (personId: number, newPassword: string) => Promise>;\r\n addKeycode: (keycode: string, orderHeaderToken?: string) => Promise>;\r\n getZuoraCreditCardFormParams: (\r\n userGuid: string,\r\n formId: string,\r\n requestToken: string\r\n ) => Promise>;\r\n getZuoraCreditCardFormEmailParams: (\r\n email: string,\r\n formId: string,\r\n requestToken: string\r\n ) => Promise>;\r\n getZuoraCreditCardFormComputerIdParams: (\r\n computerId: number,\r\n formId: string,\r\n requestToken: string\r\n ) => Promise>;\r\n getZuoraCreditCardFormLicenseKeyParams: (\r\n licenseKey: string,\r\n formId: string,\r\n requestToken: string\r\n ) => Promise>;\r\n getCarboniteVersionNumber: () => Promise>;\r\n getWebrootUserInfo: (webrootKey: string) => Promise>;\r\n //used for create account for Webroot\r\n createAccount: (\r\n email: string,\r\n password: string,\r\n keycode: string,\r\n ecommKey: string,\r\n recaptchaToken: string,\r\n languageCode: string\r\n ) => Promise>;\r\n getSubscriberInfo: () => Promise>;\r\n getSafeClientURL: (request: IInstallRequest) => Promise>;\r\n getSubscriptions: () => Promise>;\r\n getLatestSubscriptions: () => Promise>;\r\n releaseSubscription: (deviceId: number) => Promise>;\r\n getLastPassInfo: () => Promise>;\r\n provisionLastPass: (keycode: string) => Promise>;\r\n getWebrootKeycode: (deviceId: number, zuoraSubscriptionNumber: string) => Promise>;\r\n getOutstandingInvoices: () => Promise>;\r\n payOutstandingInvoices: (\r\n payOutstandingInvoicesRequest: IPayOutstandingInvoicesRequest\r\n ) => Promise>;\r\n verifyActivationCode: (activationCode: string) => Promise>;\r\n applyActivationCode: (\r\n activationCode: string,\r\n computerId: number\r\n ) => Promise>;\r\n getWebrootRenewUrl: (keycode: string) => Promise>;\r\n getAvailableActivationCodes: () => Promise>;\r\n optInToAutomaticVideoBackup: (deviceId: number) => Promise>;\r\n getConsumerVatInfoAsync: (paymentMethodId: string | null) => Promise>;\r\n setVatInfo: (vatId: string, countryCode: string) => Promise>;\r\n putClientException: (ce: IClientException) => Promise>;\r\n addEncryptionKey: (\r\n computerId: number,\r\n encryptionKey: string,\r\n encryptionKeyPassword: string | null\r\n ) => Promise>;\r\n getEncryptionKeyPasswordHint: (computerId: number) => Promise>;\r\n verifyEmail: (verificationCode: string) => Promise>;\r\n sendNewVerificationEmail: (verificationCode: string) => Promise>;\r\n updateEmail: (email: string, password: string) => Promise>;\r\n resendVerificationEmail: () => Promise>;\r\n getBackupSummary: () => Promise>;\r\n getPendingVerificationEmail: () => Promise>;\r\n cancelPendingEmailValidation: () => Promise>;\r\n getRfaSession: (computerId: string) => Promise>;\r\n getSkyWebrootDevices: () => Promise>;\r\n updateWebrootDevice: (request: IUpdateWebrootDeviceRequest) => Promise>;\r\n removeWebrootDevice: (request: IRemoveWebrootDeviceRequest, keycode: string) => Promise>;\r\n getAllstateSubscriptions: () => Promise>;\r\n addAllstateSubscription: (request: IAllstateRequest) => Promise>;\r\n updateAllstateSubscriptions: (request: IAllstateUpdateRequest) => Promise>;\r\n getCssbBackupSets: (computerName: string, sort: string, orderBy: string) => Promise>;\r\n getCssbBackupRuns: (\r\n computerName: string,\r\n backupSetName: string,\r\n sort: string,\r\n orderBy: string\r\n ) => Promise>;\r\n getCssbBackupRunDetails: (request: ICssbDetailsRequest) => Promise>;\r\n addCssbDownloadInfo: (request: ICssbDownloadInfoRequest) => Promise>;\r\n getCssbDownloadUrl: (request: ICssbDownloadUrlRequest) => Promise>;\r\n cancelCssbDownload: (request: ICssbDownloadUrlRequest) => Promise>;\r\n getInProgressCssbDownloadRequests: () => Promise>;\r\n refreshSubscriber: () => Promise>;\r\n getWebrootPIIInformation: (keycode: string) => Promise>;\r\n getCssbServers: () => Promise>;\r\n setLangCookie: (lang: string) => Promise>;\r\n getLangCookie: () => Promise>;\r\n getCountries: () => Promise>;\r\n submitCourierRecovery: (request: ICourierRecoveryRequest) => Promise>;\r\n getPendingRequestToManageAsync: () => Promise>;\r\n manageCustomerByResellerAsync: (request: IManageCustomerByResellerRequest) => Promise>;\r\n getInvoice: (invoiceId: string) => Promise>;\r\n purchaseShoppingCart: (request: IShoppingCart) => Promise>;\r\n getShoppingCart: (brand: string, userGuid?: string) => Promise>;\r\n getShoppingCartByOrderCode: (orderCode: string) => Promise>;\r\n getShoppingCartByEnrollmentGuid: (\r\n enrollmentGuid: string,\r\n requestToken: string\r\n ) => Promise>;\r\n saveShoppingCart: (request: IShoppingCart) => Promise>;\r\n getProductCatalog: (type: string, campaignId?: number) => Promise>;\r\n setLanguagePreference: (request: ISetLanguagePreferenceRequest) => Promise>;\r\n getSubscriptionForUnauthorizedFlow: (deviceId: number) => Promise>;\r\n //used for create preliminary account for carbonite non trial purchase\r\n checkExistingEmail: (request: ICheckEmailRequest) => Promise>;\r\n silentLogout: () => Promise>;\r\n checkHasRecentPurchase: (computerId: number) => Promise>;\r\n getProspectId: (ProspectGuid: string) => Promise>;\r\n payPalApprove: (tokenId: string, brand: string) => Promise>;\r\n getActivationCode: (\r\n request: IActivationCodePurchaseRequest\r\n ) => Promise>;\r\n createPayPalAgreementToken: (\r\n request: IPayPalAgreementTokenRequest\r\n ) => Promise>;\r\n setAutoRenew: (request: IAutoRenewRequest) => Promise>;\r\n getLicenseKeyInfo: (licenseKey: string, upgradeSku?: string) => Promise>;\r\n getLicenseKeyFromVendorKey: (licenseKey: string) => Promise>;\r\n getPurchaseKeycodes: (invoiceNumber: string, orderCode: string) => Promise>;\r\n getPureVpnLatestVersionDetails: (\r\n deviceType: DeviceType\r\n ) => Promise>;\r\n}\r\n// export interface IUnifiedPortalAPIMockFlags {\r\n// login?: boolean;\r\n// getUser?: boolean;\r\n// getUserDetails?: boolean;\r\n// getSecurityQuestionsList?: boolean;\r\n// getSubscriberDownloadsInfo?: boolean;\r\n// getSubscriptions?: boolean;\r\n// verifyActivationCode?: boolean;\r\n// applyActivationCode?: boolean;\r\n// getWebrootRenewUrl?: boolean;\r\n// getAvailableActivationCodes?: boolean;\r\n// getSubscriberInfo?: boolean;\r\n// addCssbDownloadInfo?: boolean;\r\n// getCssbDownloadUrl?: boolean;\r\n// cancelCssbDownload?: boolean;\r\n// getInProgressCssbDownloadRequests?: boolean;\r\n// mockGetProductCatalog?: boolean;\r\n// }\r\nexport class UnifiedPortalAPI implements IUnifiedPortalAPI {\r\n public readonly axios: AxiosInstance;\r\n\r\n // flag set by the getUser call meant to signify the createAccount page is handling the redirect instead of\r\n // private fromCreateAccount: boolean = false;\r\n\r\n protected _hasLoginCookie = false;\r\n\r\n constructor(private upEndpoint: IEndpointConfig) {\r\n //logEvent(`Initializing`, \"UnifiedPortalAPI\", this.upEndpoint);\r\n this.axios = axios.create({\r\n withCredentials: true,\r\n withXSRFToken: true,\r\n });\r\n\r\n this.axios.interceptors.response.use(\r\n res => {\r\n if (!/api\\/cp\\/computers\\/\\d*\\/rfasession/.test(res.request.responseURL)) {\r\n const userStore = useUserStore();\r\n userStore.lastRequestTime = new Date().getTime();\r\n }\r\n this._hasLoginCookie = true; // do we HAVE any unauthenticated requests where this shouldn't happen?\r\n\r\n return res;\r\n },\r\n e => {\r\n const err = e as AxiosError;\r\n logEvent(\"failed call\", \"UnifiedPortalAPI\", { response: err.response, request: err.request });\r\n //both 'Unauthorized' and 'Forbidden' from Api could indicate that the user is not logged in\r\n if (err.response?.status === HTTP_STATUS_UNAUTHORIZED || err.response?.status === HTTP_STATUS_FORBIDDEN) {\r\n if (err.response?.status === HTTP_STATUS_FORBIDDEN && this._hasLoginCookie) {\r\n logout();\r\n }\r\n // if user is coming from create account page then this localStorage value will be true , otherwise it will be null\r\n this._hasLoginCookie = false; // sort of redundant as we are redirecting and ending the world...\r\n // do NOT handle redirect here if fromCreateAccount has been set\r\n if (err.response?.config?.headers) {\r\n const fromCreateAccount = err.response?.config?.headers[\"FROM_C_A\"];\r\n if (fromCreateAccount !== \"1\") {\r\n redirectToLogin(window.location.href);\r\n }\r\n }\r\n }\r\n // throw error so can be caught later on in router (or elsewhere)\r\n throw err;\r\n }\r\n );\r\n\r\n // add the xsrf token, if there is one\r\n this.axios.interceptors.request.use(config => {\r\n const cookies = document.cookie.split(\";\");\r\n\r\n if (config && config.headers) {\r\n for (const c of cookies) {\r\n const split = c?.split(\"=\");\r\n if (split[0] === \"XSRF-TOKEN\") {\r\n config.headers[\"X-XSRF-TOKEN\"] = split[1];\r\n break;\r\n }\r\n }\r\n }\r\n\r\n if (config && !config.timeout) {\r\n config.timeout = MAX_API_WAIT_DURATION;\r\n }\r\n return config;\r\n });\r\n }\r\n\r\n // doesn't do much now, but helpful to add in logging or other hooks\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n private send = async (request: AxiosRequestConfig) => {\r\n return this.axios.request(request);\r\n };\r\n\r\n public hasLoginCookie() {\r\n return this._hasLoginCookie;\r\n }\r\n\r\n // public login = async (email: string, password: string, recaptchaToken?: string) => {\r\n // const res = await this.send(Requests.postLoginRequest(this.upEndpoint, email, password, recaptchaToken));\r\n // this._authToken = res.data.authenticationToken;\r\n\r\n // // TODO: this is still ugly and would like to use cookies properly\r\n // // set __upauth as default param\r\n // this.axios.defaults.params = {\r\n // \"__upauth\": this._authToken,\r\n // \"__cpauth\": this._authToken\r\n // };\r\n\r\n // // this.axios.defaults.headers = {\r\n // // \"__upauth\": this._authToken,\r\n // // \"__cpauth\": this._authToken\r\n // // }\r\n\r\n // return res;\r\n // }\r\n\r\n public logout = async () => {\r\n this.send(Requests.logout(this.upEndpoint));\r\n };\r\n\r\n public getUser = async (fromCreateAccount = false) => {\r\n const req = Requests.getUser(this.upEndpoint);\r\n req.headers = req.headers || {};\r\n if (fromCreateAccount) req.headers[\"FROM_C_A\"] = \"1\"; // embed fromCreateAccount info in request headers to be picked up by interceptor for this request properly\r\n return this.send(req);\r\n };\r\n\r\n public getUserDetails = async () => {\r\n return this.send(Requests.getUserDetails(this.upEndpoint));\r\n };\r\n\r\n public getUserPaymentMethods = async () => {\r\n return this.send(Requests.getUserPaymentMethods(this.upEndpoint));\r\n };\r\n\r\n public getUserPaymentMethodGuest = async (userGuid: string, paymentMethodId: string) => {\r\n return this.send(Requests.getUserPaymentMethodGuest(this.upEndpoint, userGuid, paymentMethodId));\r\n };\r\n\r\n public getUserPaymentHistory = async () => {\r\n return this.send(Requests.getUserPaymentHistory(this.upEndpoint));\r\n };\r\n\r\n public getInvoiceDetails = async (invoiceNumber: string) => {\r\n return this.send(Requests.getInvoiceDetails(this.upEndpoint, invoiceNumber));\r\n };\r\n\r\n public getSubscriberDownloadsInfo = async () => {\r\n return this.send(Requests.getSubscriberDownloadsInfo(this.upEndpoint));\r\n };\r\n\r\n public getSecurityQuestionsList = async (language: string) => {\r\n return this.send(Requests.getSecurityQuestionsList(this.upEndpoint, language));\r\n };\r\n\r\n public getCarboniteVersionNumber = async () => {\r\n return this.send(Requests.getCarboniteVersionNumber(this.upEndpoint));\r\n };\r\n\r\n public setSecurityQuestions = async (securityQuestions: ISecurityQuestions, language: string) => {\r\n return this.send(Requests.setSecurityQuestions(this.upEndpoint, securityQuestions, language));\r\n };\r\n\r\n public setDefaultCreditCard = async (creditCardId: string) => {\r\n return this.send(Requests.setDefaultCreditCard(this.upEndpoint, creditCardId));\r\n };\r\n\r\n public removeCreditCard = async (creditCardId: string) => {\r\n return this.send(Requests.removeCreditCard(this.upEndpoint, creditCardId));\r\n };\r\n\r\n public removeAndReplaceCreditCard = async (creditCardId: string, newDefaultCreditCardId: string) => {\r\n return this.send(Requests.removeAndReplaceCreditCard(this.upEndpoint, creditCardId, newDefaultCreditCardId));\r\n };\r\n\r\n public checkExistingEmail = async (email: ICheckEmailRequest) => {\r\n return this.send(Requests.checkExistingEmail(this.upEndpoint, email));\r\n };\r\n\r\n public getSecurityQuestions = async () => {\r\n return this.send(Requests.getSecurityQuestions(this.upEndpoint));\r\n };\r\n\r\n public validateAndUpdatePassword = async (currentPassword: string, newPassword: string) => {\r\n return this.send(Requests.validateAndUpdatePassword(this.upEndpoint, currentPassword, newPassword));\r\n };\r\n\r\n public validateCastleTokenForProtectedFiles = async (token: string) => {\r\n return this.send(Requests.validateCastleTokenForProtectedFiles(this.upEndpoint, token));\r\n };\r\n\r\n public updateUserPersonalInfo = async (user: IUpdateSubscriberRequest) => {\r\n return this.send(Requests.updateUserPersonalInfo(this.upEndpoint, user));\r\n };\r\n\r\n public updateComputerDescription = async (computerId: number, computerDescription: string) => {\r\n return this.send(Requests.updateComputerDescription(this.upEndpoint, computerId, computerDescription));\r\n };\r\n\r\n public updateAutoRenewOption = async (autoRenewUpdateRequest: IAutoRenewUpdateRequest) => {\r\n return this.send(Requests.updateAutoRenewOption(this.upEndpoint, autoRenewUpdateRequest));\r\n };\r\n\r\n public setRenewalDiscount = async (\r\n zuoraSubscriptionNumber: string,\r\n enableAutoRenewDiscount: IAutoRenewDiscountRequest\r\n ) => {\r\n return this.send(\r\n Requests.setRenewalDiscount(this.upEndpoint, zuoraSubscriptionNumber, enableAutoRenewDiscount)\r\n // enableAutoRenewDiscount: true results in setting renewalDiscount: 25\r\n );\r\n };\r\n\r\n public cancelSubscription = async (subscriptionNumber: string) => {\r\n return this.send(Requests.cancelSubscription(this.upEndpoint, subscriptionNumber));\r\n };\r\n\r\n // public getUserSecurityPhoneAnonymous = async (personId: number) => {\r\n // return this.send(Requests.getUserSecurityPhoneAnonymous(this.upEndpoint, personId));\r\n // }\r\n\r\n public getUserSecurityPhone = async () => {\r\n return this.send(Requests.getUserSecurityPhone(this.upEndpoint));\r\n };\r\n\r\n public getZuoraCreditCardFormParams = async (userGuid: string, formId: string, requestToken: string) => {\r\n return this.send(\r\n Requests.getZuoraCreditCardFormParams(this.upEndpoint, userGuid, formId, requestToken)\r\n );\r\n };\r\n\r\n public getZuoraCreditCardFormEmailParams = async (email: string, formId: string, requestToken: string) => {\r\n return this.send(\r\n Requests.getZuoraCreditCardFormEmailParams(this.upEndpoint, email, formId, requestToken)\r\n );\r\n };\r\n\r\n public getZuoraCreditCardFormComputerIdParams = async (computerId: number, formId: string, requestToken: string) => {\r\n return this.send(\r\n Requests.getZuoraCreditCardFormComputerIdParams(this.upEndpoint, computerId, formId, requestToken)\r\n );\r\n };\r\n\r\n public getZuoraCreditCardFormLicenseKeyParams = async (licenseKey: string, formId: string, requestToken: string) => {\r\n return this.send(\r\n Requests.getZuoraCreditCardFormLicenseKeyParams(this.upEndpoint, licenseKey, formId, requestToken)\r\n );\r\n };\r\n\r\n public requestVerificationCode = async (method: string) => {\r\n return this.send(Requests.requestVerificationCode(this.upEndpoint, method));\r\n };\r\n\r\n public requestVerificationCodeWithCastleScore = async (method: string, castleToken: string) => {\r\n return this.send(\r\n Requests.requestVerificationCodeWithCastleScore(this.upEndpoint, method, castleToken)\r\n );\r\n };\r\n\r\n public sendVerificationCode = async (personId: number, verificationCode: string) => {\r\n return this.send(\r\n Requests.sendVerificationCode(this.upEndpoint, personId, verificationCode)\r\n );\r\n };\r\n\r\n public validateCodeAndTrustClient = async (verificationCode: string, isTokenLongTrusted: boolean, source: string) => {\r\n return this.send(\r\n Requests.validateCodeAndTrustClient(this.upEndpoint, verificationCode, isTokenLongTrusted, source)\r\n );\r\n };\r\n\r\n public setSecurityPhone = async (phone: IUserSecurityPhoneRequest) => {\r\n return this.send(Requests.setSecurityPhone(this.upEndpoint, phone));\r\n };\r\n\r\n public deleteSecurityPhone = async () => {\r\n return this.send(Requests.deleteSecurityPhone(this.upEndpoint));\r\n };\r\n\r\n public getNewAccountStatus = async (guid: string) => {\r\n return this.send(Requests.GetNewAccountStatus(this.upEndpoint, guid));\r\n };\r\n\r\n public setNewAccountPassword = async (guid: string, newPassword: string) => {\r\n return this.send(Requests.setNewAccountPassword(this.upEndpoint, guid, newPassword));\r\n };\r\n\r\n public getPhoneCountryCodes = async () => {\r\n return this.send(Requests.getPhoneCountryCodes(this.upEndpoint));\r\n };\r\n\r\n public resetPassword = async (personId: number, newPassword: string) => {\r\n return this.send(Requests.resetPassword(this.upEndpoint, personId, newPassword));\r\n };\r\n\r\n public getWebrootUserInfo = async (webrootKey: string) => {\r\n return this.send(Requests.getWebrootUserInfo(this.upEndpoint, webrootKey));\r\n };\r\n\r\n public createAccount = async (\r\n email: string,\r\n password: string,\r\n keycode: string,\r\n ecommKey: string,\r\n recaptchaToken: string,\r\n languageCode: string\r\n ) => {\r\n return this.send(\r\n Requests.createAccount(this.upEndpoint, email, password, keycode, ecommKey, recaptchaToken, languageCode)\r\n );\r\n };\r\n\r\n public getCountries = async () => {\r\n return this.send(Requests.getCountries(this.upEndpoint));\r\n };\r\n\r\n public getInvoice = async (invoiceId: string) => {\r\n return this.send(Requests.getInvoice(this.upEndpoint, invoiceId));\r\n };\r\n\r\n public addKeycode = async (keycode: string, orderHeaderToken?: string) => {\r\n return this.send(Requests.addKeycode(this.upEndpoint, keycode, orderHeaderToken));\r\n };\r\n\r\n public getSubscriberInfo = async () => {\r\n return this.send(Requests.getSubscriberInfo(this.upEndpoint));\r\n };\r\n\r\n public refreshSubscriber = async () => {\r\n return this.send(Requests.refreshSubscriber(this.upEndpoint));\r\n };\r\n\r\n public getSafeClientURL = async (request: IInstallRequest) => {\r\n return this.send(Requests.getSafeClientURL(request, this.upEndpoint));\r\n };\r\n\r\n public getSubscriptions = async () => {\r\n return this.send(Requests.getSubscriptions(this.upEndpoint));\r\n };\r\n\r\n public getLatestSubscriptions = async () => {\r\n return this.send(Requests.getLatestSubscriptions(this.upEndpoint));\r\n };\r\n\r\n public releaseSubscription = async (deviceId: number) => {\r\n return this.send(Requests.releaseSubscription(this.upEndpoint, deviceId));\r\n };\r\n\r\n public getLastPassInfo = async () => {\r\n return this.send(Requests.getLastPassInfo(this.upEndpoint));\r\n };\r\n\r\n public provisionLastPass = async (keyCode: string) => {\r\n return this.send(Requests.provisionLastPass(this.upEndpoint, keyCode));\r\n };\r\n public getWebrootKeycode = async (deviceId: number, zuoraSubscriptionNumber: string) => {\r\n return this.send(Requests.getWebrootKeycode(this.upEndpoint, deviceId, zuoraSubscriptionNumber));\r\n };\r\n public verifyActivationCode = async (activationCode: string) => {\r\n return this.send(Requests.verifyActivationCode(this.upEndpoint, activationCode));\r\n };\r\n public applyActivationCode = async (activationCode: string, computerId: number) => {\r\n return this.send(Requests.applyActivationCode(this.upEndpoint, activationCode, computerId));\r\n };\r\n\r\n public payOutstandingInvoices = async (payOutstandingInvoicesRequest: IPayOutstandingInvoicesRequest) => {\r\n return this.send(Requests.payOutstandingInvoices(this.upEndpoint, payOutstandingInvoicesRequest));\r\n };\r\n\r\n public getOutstandingInvoices = async () => {\r\n return this.send(Requests.getOutstandingInvoices(this.upEndpoint));\r\n };\r\n\r\n public getWebrootRenewUrl = async (keycode: string) => {\r\n return this.send(Requests.getWebrootRenewUrl(this.upEndpoint, keycode));\r\n };\r\n\r\n public getAvailableActivationCodes = async () => {\r\n return this.send(Requests.getAvailableActivationCodes(this.upEndpoint));\r\n };\r\n\r\n public optInToAutomaticVideoBackup = async (deviceId: number) => {\r\n return this.send(Requests.optInToAutomaticVideoBackup(this.upEndpoint, deviceId));\r\n };\r\n\r\n public getConsumerVatInfoAsync = async (paymentMethodId: string | null) => {\r\n return this.send(Requests.getConsumerVatInfoAsync(this.upEndpoint, paymentMethodId));\r\n };\r\n\r\n public setVatInfo = async (vatId: string, countryCode: string) => {\r\n return this.send(Requests.setVatInfo(this.upEndpoint, vatId, countryCode));\r\n };\r\n\r\n public putClientException = async (ce: IClientException) => {\r\n return this.send(Requests.putClientException(this.upEndpoint, ce));\r\n };\r\n\r\n public addEncryptionKey = async (computerId: number, encryptionKey: string, encryptionKeyPassword: string | null) => {\r\n return this.send(\r\n Requests.addEncryptionKey(this.upEndpoint, computerId, encryptionKey, encryptionKeyPassword)\r\n );\r\n };\r\n\r\n public getEncryptionKeyPasswordHint = async (computerId: number) => {\r\n return this.send(Requests.getEncryptionKeyPasswordHint(this.upEndpoint, computerId));\r\n };\r\n\r\n public verifyEmail = async (verificationCode: string) => {\r\n return this.send(Requests.verifyEmail(this.upEndpoint, verificationCode));\r\n };\r\n\r\n public sendNewVerificationEmail = async (verificationCode: string) => {\r\n return this.send(Requests.sendNewVerificationEmail(this.upEndpoint, verificationCode));\r\n };\r\n\r\n public cancelPendingEmailValidation = async () => {\r\n return this.send(Requests.cancelPendingEmailValidation(this.upEndpoint));\r\n };\r\n\r\n public updateEmail = async (email: string, password: string) => {\r\n return this.send(Requests.updateEmail(this.upEndpoint, email, password));\r\n };\r\n\r\n public resendVerificationEmail = async () => {\r\n return this.send(Requests.resendVerificationEmail(this.upEndpoint));\r\n };\r\n\r\n public getBackupSummary = async () => {\r\n return this.send(Requests.getBackupSummary(this.upEndpoint));\r\n };\r\n\r\n public getPendingVerificationEmail = async () => {\r\n return this.send(Requests.getPendingVerificationEmail(this.upEndpoint));\r\n };\r\n\r\n public getRfaSession = async (computerId: string) => {\r\n return this.send(Requests.getRfaSession(this.upEndpoint, computerId));\r\n };\r\n\r\n public getSkyWebrootDevices = async () => {\r\n return this.send(Requests.getSkyWebrootDevices(this.upEndpoint));\r\n };\r\n\r\n public updateWebrootDevice = async (request: IUpdateWebrootDeviceRequest) => {\r\n return this.send(Requests.updateWebrootDevice(this.upEndpoint, request));\r\n };\r\n\r\n public removeWebrootDevice = async (request: IRemoveWebrootDeviceRequest, keycode) => {\r\n return this.send(Requests.removeWebrootDevice(this.upEndpoint, request, keycode));\r\n };\r\n\r\n public getAllstateSubscriptions = async () => {\r\n return this.send(Requests.getAllstateSubscriptions(this.upEndpoint));\r\n };\r\n\r\n public addAllstateSubscription = async (request: IAllstateRequest) => {\r\n return this.send(Requests.addAllstateSubscription(this.upEndpoint, request));\r\n };\r\n\r\n public updateAllstateSubscriptions = async (request: IAllstateUpdateRequest) => {\r\n return this.send(Requests.updateAllstateSubscriptions(this.upEndpoint, request));\r\n };\r\n\r\n public getCssbBackupSets = async (computerName: string, sort: string, orderBy: string) => {\r\n return this.send(Requests.getCssbBackupSets(this.upEndpoint, computerName, sort, orderBy));\r\n };\r\n\r\n public getCssbBackupRuns = async (computerName: string, backupSetName: string, sort: string, orderBy: string) => {\r\n return this.send(\r\n Requests.getCssbBackupRuns(this.upEndpoint, computerName, backupSetName, sort, orderBy)\r\n );\r\n };\r\n\r\n public getCssbBackupRunDetails = async (request: ICssbDetailsRequest) => {\r\n return this.send(Requests.getCssbBackupRunDetails(this.upEndpoint, request));\r\n };\r\n\r\n public addCssbDownloadInfo = async (request: ICssbDownloadInfoRequest) => {\r\n return this.send(Requests.addCssbDownloadInfo(this.upEndpoint, request));\r\n };\r\n\r\n public getCssbDownloadUrl = async (request: ICssbDownloadUrlRequest) => {\r\n return this.send(Requests.getCssbDownloadUrl(this.upEndpoint, request));\r\n };\r\n\r\n public cancelCssbDownload = async (request: ICssbDownloadUrlRequest) => {\r\n return this.send(Requests.cancelCssbDownload(this.upEndpoint, request));\r\n };\r\n\r\n public getInProgressCssbDownloadRequests = async () => {\r\n return this.send(\r\n Requests.getInProgressCssbDownloadRequests(this.upEndpoint)\r\n );\r\n };\r\n\r\n public getWebrootPIIInformation = async (keycode: string) => {\r\n return this.send(Requests.getWebrootPIIInformation(this.upEndpoint, keycode));\r\n };\r\n\r\n public getCssbServers = async () => {\r\n return this.send(Requests.getCssbServers(this.upEndpoint));\r\n };\r\n\r\n public getLangCookie = async () => {\r\n return this.send(Requests.getLangCookie(this.upEndpoint));\r\n };\r\n\r\n public setLangCookie = async (lang: string) => {\r\n return this.send(Requests.setLangCookie(this.upEndpoint, lang));\r\n };\r\n\r\n public submitCourierRecovery = async (request: ICourierRecoveryRequest) => {\r\n return this.send(Requests.submitCourierRecovery(this.upEndpoint, request));\r\n };\r\n\r\n public getPendingRequestToManageAsync = async () => {\r\n return this.send(Requests.getPendingRequestToManageAsync(this.upEndpoint));\r\n };\r\n\r\n public manageCustomerByResellerAsync = async (request: IManageCustomerByResellerRequest) => {\r\n return this.send(Requests.manageCustomerByResellerAsync(this.upEndpoint, request));\r\n };\r\n\r\n public purchaseShoppingCart = async (request: IShoppingCart) => {\r\n return this.send(Requests.purchaseShoppingCart(this.upEndpoint, request));\r\n };\r\n\r\n public getPurchaseKeycodes = async (invoiceNumber: string, orderCode: string) => {\r\n return this.send(Requests.getPurchaseKeycodes(this.upEndpoint, invoiceNumber, orderCode));\r\n };\r\n\r\n public getShoppingCart = async (brand: string, userGuid?: string) => {\r\n if (userGuid) {\r\n return this.send(Requests.getShoppingCartForUser(this.upEndpoint, userGuid, brand));\r\n }\r\n\r\n return this.send(Requests.getShoppingCart(this.upEndpoint, brand));\r\n };\r\n\r\n public saveShoppingCart = async (request: IShoppingCart) => {\r\n return this.send(Requests.saveShoppingCart(this.upEndpoint, request));\r\n };\r\n\r\n public getProductCatalog = async (type: string, campaignId?: number) => {\r\n return this.send(Requests.getProductCatalog(this.upEndpoint, type, campaignId));\r\n };\r\n\r\n public setLanguagePreference = async (request: ISetLanguagePreferenceRequest) => {\r\n return this.send(Requests.setLanguagePreference(this.upEndpoint, request));\r\n };\r\n\r\n public getSubscriptionForUnauthorizedFlow = async (deviceId: number) => {\r\n return this.send(\r\n Requests.getSubscriptionForUnauthorizedFlow(this.upEndpoint, deviceId)\r\n );\r\n };\r\n\r\n public silentLogout = async () => {\r\n return this.send(Requests.silentLogout());\r\n };\r\n\r\n public checkHasRecentPurchase = async (computerId: number) => {\r\n return this.send(Requests.checkHasRecentPurchase(this.upEndpoint, computerId));\r\n };\r\n\r\n public getProspectId = async (prospectGuid: string) => {\r\n return this.send(Requests.getProspectId(this.upEndpoint, prospectGuid));\r\n };\r\n\r\n public payPalApprove = async (tokenId: string, brand: string) => {\r\n return this.send(Requests.payPalApprove(this.upEndpoint, tokenId, brand));\r\n };\r\n\r\n public createPayPalAgreementToken = async (request: IPayPalAgreementTokenRequest) => {\r\n return this.send(Requests.createPayPalAgreementToken(this.upEndpoint, request));\r\n };\r\n\r\n public getActivationCode = async (request: IActivationCodePurchaseRequest) => {\r\n return this.send(Requests.getActivationCode(this.upEndpoint, request));\r\n };\r\n\r\n public getShoppingCartByOrderCode(orderCode: string): Promise> {\r\n return this.send(Requests.getShoppingCartByOrderCode(this.upEndpoint, orderCode));\r\n }\r\n\r\n public getShoppingCartByEnrollmentGuid(\r\n enrollmentGuid: string,\r\n requestToken: string\r\n ): Promise> {\r\n return this.send(\r\n Requests.getShoppingCartByEnrollmentGuid(this.upEndpoint, enrollmentGuid, requestToken)\r\n );\r\n }\r\n\r\n public setAutoRenew = async (request: IAutoRenewRequest) => {\r\n return this.send(Requests.setAutoRenew(this.upEndpoint, request));\r\n };\r\n\r\n public getLicenseKeyInfo = (licenseKey: string, upgradeSku = \"\"): Promise> => {\r\n return this.send(Requests.getLicenseKeyInfo(this.upEndpoint, licenseKey, upgradeSku));\r\n };\r\n\r\n public getLicenseKeyFromVendorKey = (vendorKey: string): Promise> => {\r\n return this.send(Requests.getLicenseKeyFromVendorKey(this.upEndpoint, vendorKey));\r\n };\r\n\r\n public getPureVpnLatestVersionDetails = (\r\n deviceType: DeviceType\r\n ): Promise> => {\r\n return this.send(\r\n Requests.getPureVpnLatestVersionDetails(this.upEndpoint, deviceType)\r\n );\r\n };\r\n}\r\n\r\n//import { mockUserDetails, mockLoggedInUser } from \"@/__mocks__/userDetails\";\r\n// import { mockCreditCards } from \"@/__mocks__/CreditCards\";\r\n// import { mockPersonalInfoSecurityQuestionsList } from \"@/__mocks__/personalInfo\";\r\n// import { mockUserPaymentHistory } from \"@/__mocks__/userPaymentHistory\";\r\n// import { mockUserSecurityPhone } from \"@/__mocks__/SecurityPhone\";\r\n// import { mockSubscriberDownloadsInfo } from \"@/__mocks__/SubscriberInfo\";\r\n// import { mockSubscriptions } from \"@/__mocks__/subscriptions\";\r\n// import { mockActivationCodeResponse } from \"@/__mocks__/ActivationCodeResponse\";\r\n// import { mockSubscriberInfo } from \"@/__mocks__/SubscriberInfo\";\r\n// import {\r\n// mockAddCssbDownloadInfo,\r\n// mockCancelCssbDownload,\r\n// mockGetCssbDownloadUrl,\r\n// mockInProcessDownloads,\r\n// } from \"@/__mocks__/CssbDownloadResponses\";\r\n// import { mockPlans } from \"@/__mocks__/buyflow\";\r\n\r\n// export class UnifiedPortalAPIMock implements IUnifiedPortalAPI {\r\n// constructor(private upEndpoint: IEndpointConfig) {\r\n// console.debug(`Initializing UnifiedPortalAPIMock`, this.upEndpoint);\r\n// this.api = new UnifiedPortalAPI(this.upEndpoint);\r\n// }\r\n\r\n// private api: UnifiedPortalAPI;\r\n// public mock: boolean | IUnifiedPortalAPIMockFlags = {\r\n// //getWebrootRenewUrl: true,\r\n// //getSubscriptions: true,\r\n// //getAvailableActivationCodes: true\r\n// //getSubscriberInfo: true,\r\n// // addCssbDownloadInfo: true,\r\n// // getCssbDownloadUrl: true,\r\n// // getInProgressCssbDownloadRequests: true,\r\n// // cancelCssbDownload: true,\r\n// //mockGetProductCatalog: true,\r\n// };\r\n\r\n// private useMock = (functionName: string) => {\r\n// return this.mock && (typeof this.mock === \"boolean\" || (typeof this.mock === \"object\" && this.mock[functionName]));\r\n// };\r\n// private createAxiosResponse(data: T | void): AxiosResponse {\r\n// return {\r\n// status: HTTP_STATUS_OK,\r\n// statusText: \"OK\",\r\n// headers: {},\r\n// config: {},\r\n// request: {},\r\n// data: data as T,\r\n// };\r\n// }\r\n\r\n// public hasLoginCookie() {\r\n// return true;\r\n// }\r\n\r\n// // public login = (email: string, password: string, recaptchaToken?: string) => {\r\n// // if (this.useMock(\"login\")) {\r\n// // return Promise.resolve(this.createAxiosResponse({\r\n// // authenticationToken: \"fakeToken\"\r\n// // }));\r\n// // }\r\n// // else {\r\n// // return this.api.login(email, password, recaptchaToken);\r\n// // }\r\n// // }\r\n\r\n// public logout = async () => {\r\n// this.api.logout();\r\n// };\r\n\r\n// public getUser = async (fromCreateAccount = false) => {\r\n// return this.useMock(\"getUser\")\r\n// ? Promise.resolve(this.createAxiosResponse(mockLoggedInUser))\r\n// : this.api.getUser(fromCreateAccount);\r\n// };\r\n\r\n// public getUserDetails = async () => {\r\n// return this.useMock(\"getUserDetails\")\r\n// ? Promise.resolve(this.createAxiosResponse(mockUserDetails))\r\n// : this.api.getUserDetails();\r\n// };\r\n\r\n// public getUserCreditCardGuest = async (userGuid: string, paymentMethodId: string) => {\r\n// return this.useMock(\"getUserCreditCardGuest\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.getUserCreditCardGuest(userGuid, paymentMethodId);\r\n// };\r\n\r\n// public getUserPaymentHistory = async () => {\r\n// return this.useMock(\"getUserPaymentHistory\")\r\n// ? Promise.resolve(this.createAxiosResponse(mockUserPaymentHistory))\r\n// : this.api.getUserPaymentHistory();\r\n// };\r\n\r\n// public getSubscriberDownloadsInfo = async () => {\r\n// return this.useMock(\"getSubscriberDownloadsInfo\")\r\n// ? Promise.resolve(this.createAxiosResponse(mockSubscriberDownloadsInfo))\r\n// : this.api.getSubscriberDownloadsInfo();\r\n// };\r\n\r\n// public getSecurityQuestionsList = async (language: string) => {\r\n// return this.useMock(\"getSecurityQuestionsList\")\r\n// ? Promise.resolve(this.createAxiosResponse(mockPersonalInfoSecurityQuestionsList))\r\n// : this.api.getSecurityQuestionsList(language);\r\n// };\r\n\r\n// public getCarboniteVersionNumber = async () => {\r\n// return this.useMock(\"getCarboniteVersionNumber\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.getCarboniteVersionNumber();\r\n// };\r\n\r\n// public setSecurityQuestions = async (securityQuestions: ISecurityQuestions, language: string) => {\r\n// return this.useMock(\"setSecurityQuestions\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.setSecurityQuestions(securityQuestions, language);\r\n// };\r\n\r\n// public setDefaultCreditCard = async (creditCardId: string) => {\r\n// return this.useMock(\"setDefaultCreditCard\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.setDefaultCreditCard(creditCardId);\r\n// };\r\n\r\n// public removeCreditCard = async (creditCardId: string) => {\r\n// return this.useMock(\"removeCreditCard\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.removeCreditCard(creditCardId);\r\n// };\r\n\r\n// public removeAndReplaceCreditCard = async (creditCardId: string, newDefaultCreditCardId: string) => {\r\n// return this.useMock(\"removeAndReplaceCreditCard\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.removeAndReplaceCreditCard(creditCardId, newDefaultCreditCardId);\r\n// };\r\n\r\n// public checkExistingEmail = async (email: ICheckEmailRequest) => {\r\n// return this.useMock(\"checkExistingEmail\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.checkExistingEmail(email);\r\n// };\r\n\r\n// public getSecurityQuestions = async () => {\r\n// return this.useMock(\"getSecurityQuestions\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.getSecurityQuestions();\r\n// };\r\n\r\n// public validateAndUpdatePassword = async (currentPassword: string, newPassword: string) => {\r\n// return this.useMock(\"validateAndUpdatePassword\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.validateAndUpdatePassword(currentPassword, newPassword);\r\n// };\r\n\r\n// public updateUserPersonalInfo = async (user: IUpdateSubscriberRequest) => {\r\n// return this.useMock(\"updateUserPersonalInfo\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.updateUserPersonalInfo(user);\r\n// };\r\n\r\n// public updateComputerDescription = async (computerId: number, computerDescription: string) => {\r\n// return this.useMock(\"updateComputerDescription\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.updateComputerDescription(computerId, computerDescription);\r\n// };\r\n\r\n// public updateAutoRenewOption = async (autoRenewUpdateRequest: IAutoRenewUpdateRequest) => {\r\n// return this.useMock(\"updateAutoRenewOption\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.updateAutoRenewOption(autoRenewUpdateRequest);\r\n// };\r\n\r\n// public cancelSubscription = async (subscriptionNumber: string) => {\r\n// return this.useMock(\"cancelSubscription\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.cancelSubscription(subscriptionNumber);\r\n// };\r\n\r\n// // public getUserSecurityPhoneAnonymous = async (personId: number) => {\r\n// // return this.useMock(\"getUserSecurityPhone\") ?\r\n// // Promise.resolve(this.createAxiosResponse(mockUserSecurityPhone)) :\r\n// // this.api.getUserSecurityPhoneAnonymous(personId);\r\n// // }\r\n\r\n// public getUserSecurityPhone = async () => {\r\n// return this.useMock(\"getUserSecurityPhone\")\r\n// ? Promise.resolve(this.createAxiosResponse(mockUserSecurityPhone))\r\n// : this.api.getUserSecurityPhone();\r\n// };\r\n\r\n// public requestVerificationCode = async (personId: number, method: string) => {\r\n// return this.useMock(\"requestVerificationCode\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.requestVerificationCode(personId, method);\r\n// };\r\n\r\n// public sendVerificationCode = async (personId: number, verificationCode: string) => {\r\n// return this.useMock(\"sendVerificationCode\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.sendVerificationCode(personId, verificationCode);\r\n// };\r\n\r\n// public setSecurityPhone = async (phone: IUserSecurityPhoneRequest) => {\r\n// return this.useMock(\"setSecurityPhone\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.setSecurityPhone(phone);\r\n// };\r\n\r\n// public deleteSecurityPhone = async () => {\r\n// return this.useMock(\"deleteSecurityPhone\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.deleteSecurityPhone();\r\n// };\r\n\r\n// public getPhoneCountryCodes = async () => {\r\n// return this.useMock(\"getPhoneCountryCodes\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.getPhoneCountryCodes();\r\n// };\r\n\r\n// public getZuoraCreditCardFormParams = async (userGuid: string, formId: string) => {\r\n// return this.useMock(\"getZuoraCreditCardFormParams\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.getZuoraCreditCardFormParams(userGuid, formId);\r\n// };\r\n\r\n// public getZuoraCreditCardFormEmailParams = async (email: string, formId: string) => {\r\n// return this.useMock(\"getZuoraCreditCardFormEmailParams\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.getZuoraCreditCardFormEmailParams(email, formId);\r\n// };\r\n\r\n// public getZuoraCreditCardFormComputerIdParams = async (computerId: number, formId: string) => {\r\n// return this.useMock(\"getZuoraCreditCardFormComputerIdParams\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.getZuoraCreditCardFormComputerIdParams(computerId, formId);\r\n// };\r\n\r\n// public resetPassword = async (personId: number, newPassword: string) => {\r\n// return this.useMock(\"resetPassword\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.resetPassword(personId, newPassword);\r\n// };\r\n\r\n// public getWebrootUserInfo = async (webrootKey: string) => {\r\n// return this.useMock(\"getWebrootUserInfo\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.getWebrootUserInfo(webrootKey);\r\n// };\r\n\r\n// public createAccount = async (\r\n// email: string,\r\n// password: string,\r\n// keycode: string,\r\n// ecommKey: string,\r\n// recaptchaToken: string,\r\n// languageCode: string\r\n// ) => {\r\n// return this.useMock(\"createAccount\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.createAccount(email, password, keycode, ecommKey, recaptchaToken, languageCode);\r\n// };\r\n\r\n// public getCountries = async () => {\r\n// return this.useMock(\"getCountries\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.getCountries();\r\n// };\r\n\r\n// public getInvoice = async (invoiceId: string) => {\r\n// return this.useMock(\"getInvoice\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.getInvoice(invoiceId);\r\n// };\r\n\r\n// public addKeycode = async (keycode: string, orderHeaderToken?: string) => {\r\n// return this.useMock(\"addKeycode\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.addKeycode(keycode, orderHeaderToken);\r\n// };\r\n\r\n// public getSubscriberInfo = async () => {\r\n// return this.useMock(\"getSubscriberInfo\")\r\n// ? Promise.resolve(this.createAxiosResponse(mockSubscriberInfo))\r\n// : this.api.getSubscriberInfo();\r\n// };\r\n\r\n// public refreshSubscriber = async () => {\r\n// return this.useMock(\"refreshSubscriber\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.refreshSubscriber();\r\n// };\r\n\r\n// public getSafeClientURL = async (request: IInstallRequest) => {\r\n// return this.useMock(\"installResponse\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.getSafeClientURL(request);\r\n// };\r\n\r\n// public getSubscriptions = async () => {\r\n// return this.useMock(\"getSubscriptions\")\r\n// ? Promise.resolve(this.createAxiosResponse(mockSubscriptions))\r\n// : this.api.getSubscriptions();\r\n// };\r\n\r\n// public releaseSubscription = async (deviceId: number) => {\r\n// return this.useMock(\"releaseSubscription\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.releaseSubscription(deviceId);\r\n// };\r\n\r\n// public getLastPassInfo = async () => {\r\n// return this.useMock(\"mockLastPassProvisionResponse\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.getLastPassInfo();\r\n// };\r\n\r\n// public provisionLastPass = async (keyCode: string) => {\r\n// return this.useMock(\"mockLastPassInfo\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.provisionLastPass(keyCode);\r\n// };\r\n\r\n// public getWebrootKeycode = async (deviceId: number, zuoraSubscriptionNumber: string) => {\r\n// return this.useMock(\"getWebrootKeycode\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.getWebrootKeycode(deviceId, zuoraSubscriptionNumber);\r\n// };\r\n\r\n// public getOutstandingInvoices = async () => {\r\n// return this.useMock(\"getOutstandingInvoices\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.getOutstandingInvoices();\r\n// };\r\n\r\n// public payOutstandingInvoices = async (payOutstandingInvoicesRequest: IPayOutstandingInvoicesRequest) => {\r\n// return this.useMock(\"payOutstandingInvoices\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.payOutstandingInvoices(payOutstandingInvoicesRequest);\r\n// };\r\n\r\n// public verifyActivationCode = async (activationCode: string) => {\r\n// return this.useMock(\"verifyActivationCode\")\r\n// ? Promise.resolve(this.createAxiosResponse(mockActivationCodeResponse))\r\n// : this.api.verifyActivationCode(activationCode);\r\n// };\r\n\r\n// public applyActivationCode = async (activationCode: string, computerId: number) => {\r\n// return this.useMock(\"applyActivationCode\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.applyActivationCode(activationCode, computerId);\r\n// };\r\n\r\n// public getWebrootRenewUrl = async (keycode: string) => {\r\n// return this.useMock(\"getWebrootRenewUrl\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.getWebrootRenewUrl(keycode);\r\n// };\r\n\r\n// public getAvailableActivationCodes = async () => {\r\n// return this.useMock(\"getAvailableActivationCodes\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.getAvailableActivationCodes();\r\n// };\r\n\r\n// public optInToAutomaticVideoBackup = async (deviceId: number) => {\r\n// return this.useMock(\"optInToAutomaticVideoBackup\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.optInToAutomaticVideoBackup(deviceId);\r\n// };\r\n\r\n// public getConsumerVatInfoAsync = async () => {\r\n// return this.useMock(\"getConsumerVatInfoAsync\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.getConsumerVatInfoAsync();\r\n// };\r\n\r\n// public setVatInfo = async (vatId: string, countryCode: string) => {\r\n// return this.useMock(\"setVatInfo\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.setVatInfo(vatId, countryCode);\r\n// };\r\n\r\n// public putClientException = async (ce: IClientException) => {\r\n// return this.useMock(\"putClientException\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.putClientException(ce);\r\n// };\r\n\r\n// public addEncryptionKey = async (computerId: number, encryptionKey: string, encryptionKeyPassword: string | null) => {\r\n// return this.useMock(\"addEncryptionKey\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.addEncryptionKey(computerId, encryptionKey, encryptionKeyPassword);\r\n// };\r\n\r\n// public getEncryptionKeyPasswordHint = async (computerId: number) => {\r\n// return this.useMock(\"getEncryptionKeyPasswordHint\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.getEncryptionKeyPasswordHint(computerId);\r\n// };\r\n\r\n// public verifyEmail = async (verificationCode: string) => {\r\n// return this.useMock(\"verifyEmail\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.verifyEmail(verificationCode);\r\n// };\r\n\r\n// public sendNewVerificationEmail = async (verificationCode: string) => {\r\n// return this.useMock(\"sendNewVerificationEmail\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.sendNewVerificationEmail(verificationCode);\r\n// };\r\n\r\n// public cancelPendingEmailValidation = async () => {\r\n// return this.useMock(\"cancelPendingEmailValidation\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.cancelPendingEmailValidation();\r\n// };\r\n\r\n// public updateEmail = async (email: string, password: string) => {\r\n// return this.useMock(\"updateEmail\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.updateEmail(email, password);\r\n// };\r\n\r\n// public resendVerificationEmail = async () => {\r\n// return this.useMock(\"resendVerificationEmail\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.resendVerificationEmail();\r\n// };\r\n\r\n// public getBackupSummary = async () => {\r\n// return this.useMock(\"getBackupSummary\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.getBackupSummary();\r\n// };\r\n\r\n// public getPendingVerificationEmail = async () => {\r\n// return this.useMock(\"getPendingVerificationEmail\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.getPendingVerificationEmail();\r\n// };\r\n\r\n// public getRfaSession = async (computerId: string) => {\r\n// return this.useMock(\"getRfaSession\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.getRfaSession(computerId);\r\n// };\r\n\r\n// public getSkyWebrootDevices = async () => {\r\n// return this.useMock(\"getSkyWebrootDevices\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.getSkyWebrootDevices();\r\n// };\r\n\r\n// public updateWebrootDevice = async (request: IUpdateWebrootDeviceRequest) => {\r\n// return this.useMock(\"updateWebrootDevice\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.updateWebrootDevice(request);\r\n// };\r\n\r\n// public getAllstateSubscriptions = async () => {\r\n// return this.useMock(\"mockAllstateResponse\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.getAllstateSubscriptions();\r\n// };\r\n\r\n// public addAllstateSubscription = async (request: IAllstateRequest) => {\r\n// return this.useMock(\"mockAllstateAddResponse\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.addAllstateSubscription(request);\r\n// };\r\n\r\n// public getCssbBackupSets = async (computerName: string, sort: string, orderBy: string) => {\r\n// return this.useMock(\"mockCssbBackupSets\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.getCssbBackupSets(computerName, sort, orderBy);\r\n// };\r\n\r\n// public getCssbBackupRuns = async (computerName: string, backupSetName: string, sort: string, orderBy: string) => {\r\n// return this.useMock(\"mockCssbBackupRuns\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.getCssbBackupRuns(computerName, backupSetName, sort, orderBy);\r\n// };\r\n\r\n// public getCssbBackupRunDetails = async (request: ICssbDetailsRequest) => {\r\n// return this.useMock(\"mockCssbBackupRunsDetails\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.getCssbBackupRunDetails(request);\r\n// };\r\n\r\n// public addCssbDownloadInfo = async (request: ICssbDownloadInfoRequest) => {\r\n// return this.useMock(\"addCssbDownloadInfo\")\r\n// ? Promise.resolve(this.createAxiosResponse(mockAddCssbDownloadInfo()))\r\n// : this.api.addCssbDownloadInfo(request);\r\n// };\r\n\r\n// public getCssbDownloadUrl = async (request: ICssbDownloadUrlRequest) => {\r\n// return this.useMock(\"getCssbDownloadUrl\")\r\n// ? Promise.resolve(this.createAxiosResponse(mockGetCssbDownloadUrl(request)))\r\n// : this.api.getCssbDownloadUrl(request);\r\n// };\r\n\r\n// public cancelCssbDownload = async (request: ICssbDownloadUrlRequest) => {\r\n// return this.useMock(\"cancelCssbDownload\")\r\n// ? Promise.resolve(this.createAxiosResponse(mockCancelCssbDownload(request)))\r\n// : this.api.cancelCssbDownload(request);\r\n// };\r\n\r\n// public getInProgressCssbDownloadRequests = async () => {\r\n// return this.useMock(\"getInProgressCssbDownloadRequests\")\r\n// ? Promise.resolve(this.createAxiosResponse(mockInProcessDownloads))\r\n// : this.api.getInProgressCssbDownloadRequests();\r\n// };\r\n\r\n// public getWebrootPIIInformation = async (keycode: string) => {\r\n// return this.useMock(\"mockWebrootPIIInformation\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.getWebrootPIIInformation(keycode);\r\n// };\r\n\r\n// public getCssbServers = async () => {\r\n// return this.useMock(\"MockCssbServers\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.getCssbServers();\r\n// };\r\n\r\n// public getLangCookie = async () => {\r\n// return this.useMock(\"MockLanguageCookie\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.getLangCookie();\r\n// };\r\n\r\n// public setLangCookie = async (language: string) => {\r\n// return this.useMock(\"MockLanguageCookie\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.setLangCookie(language);\r\n// };\r\n\r\n// public submitCourierRecovery = async (request: ICourierRecoveryRequest) => {\r\n// return this.useMock(\"MockSubmitCourierRecovery\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.submitCourierRecovery(request);\r\n// };\r\n\r\n// public getPendingRequestToManageAsync = async () => {\r\n// return this.useMock(\"mockGetPendingRequestToManageAsync\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.getPendingRequestToManageAsync();\r\n// };\r\n\r\n// public manageCustomerByResellerAsync = async (request: IManageCustomerByResellerRequest) => {\r\n// return this.useMock(\"mockManageCustomerByResellerAsync\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.manageCustomerByResellerAsync(request);\r\n// };\r\n\r\n// public purchaseShoppingCart = async (request: IShoppingCart) => {\r\n// return this.useMock(\"mockPurchaseShoppingCart\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.purchaseShoppingCart(request);\r\n// };\r\n\r\n// public saveShoppingCart = async (request: IShoppingCart) => {\r\n// return this.useMock(\"mockSaveShoppingCart\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.saveShoppingCart(request);\r\n// };\r\n\r\n// public getProductCatalog = async (type: string, campaignId?: string) => {\r\n// return this.useMock(\"mockGetProductCatalog\")\r\n// ? Promise.resolve(this.createAxiosResponse(mockPlans))\r\n// : this.api.getProductCatalog(type, campaignId);\r\n// };\r\n\r\n// public setLanguagePreference = async (request: ISetLanguagePreferenceRequest) => {\r\n// return this.useMock(\"mockSetLanguagePreference\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.setLanguagePreference(request);\r\n// };\r\n\r\n// public getSubscriptionForUnauthorizedFlow = async (request: IUnauthenticatedSubscriptionRequest) => {\r\n// return this.useMock(\"mockGetSubscriptionForUnauthorizedFlow\")\r\n// ? Promise.resolve(this.createAxiosResponse())\r\n// : this.api.getSubscriptionForUnauthorizedFlow(request);\r\n// };\r\n// }\r\n","import { URLS } from \"../define\";\r\nimport { IUnifiedPortalAPI, UnifiedPortalAPI } from \"./api/unifiedPortal\";\r\nimport { useConfigStore } from \"@/stores/config\";\r\n\r\nexport const unifiedApi: IUnifiedPortalAPI = new UnifiedPortalAPI(URLS.UP_ENDPOINT);\r\n// export const unifiedApi: IUnifiedPortalAPI = FLAGS.IS_DEBUG\r\n// ? new UnifiedPortalAPIMock(URLS.UP_ENDPOINT)\r\n// : new UnifiedPortalAPI(URLS.UP_ENDPOINT);\r\n\r\nexport const initialize = async () => {\r\n const store = useConfigStore();\r\n await store.getConfig();\r\n};\r\n","import { useUserStore } from \"@/stores/user\";\r\nimport { unifiedApi } from \"@/common\";\r\nimport { IClientException } from \"./api/unifiedPortal/interfaces\";\r\nimport { BUILD_HASH, BUILD_HASH_DISPLAY_LENGTH, FLAGS } from \"@/define\";\r\n\r\nconst EVENT_ARRAY = \"event_array\";\r\nconst MAX_EVENTS = 10;\r\nconst MAX_EXTRA_LENGTH = 500;\r\nconst CLIENT_IDENTIFIER = \"VueDawn\";\r\n\r\ninterface eventData {\r\n ticks: number;\r\n file: string;\r\n message: string;\r\n extra: string;\r\n}\r\n\r\nexport function logEvent(message: string, file?: string | undefined, value?: unknown) {\r\n //create event object\r\n let extra = \"\";\r\n if (value instanceof String || typeof value == \"string\") extra = value as string;\r\n else if (value instanceof Object) extra = JSON.stringify(value);\r\n\r\n if (extra.length > MAX_EXTRA_LENGTH) {\r\n const first = extra.slice(0, MAX_EXTRA_LENGTH / 2);\r\n const last = extra.slice(extra.length - MAX_EXTRA_LENGTH / 2);\r\n extra = first + \" ... \" + last;\r\n }\r\n const ev: eventData = {\r\n ticks: new Date().getTime(),\r\n file: file || \"\",\r\n message,\r\n extra,\r\n };\r\n\r\n //read events from local storage, if any\r\n let events: eventData[] = [];\r\n const eventsString = localStorage.getItem(EVENT_ARRAY);\r\n if (eventsString) events = JSON.parse(eventsString) as eventData[];\r\n\r\n //add the new event\r\n events.push(ev);\r\n if (events.length > MAX_EVENTS) events.shift();\r\n\r\n //save the array\r\n localStorage.setItem(EVENT_ARRAY, JSON.stringify(events));\r\n\r\n //now log to the console\r\n if (FLAGS.IS_DEBUG) {\r\n console.log(`${new Date(ev.ticks).toISOString()} | ${ev.file} | ${ev.message}`);\r\n if (value) console.log(value);\r\n }\r\n}\r\n\r\nexport async function logException(err: Error, extra?: unknown) {\r\n const userStore = useUserStore();\r\n const user = userStore.currentUser;\r\n\r\n const errorMessage = new Date().getTime().toString();\r\n let extraString = \"\";\r\n if (extra) extraString = JSON.stringify(extra);\r\n\r\n let stackTrace = \"\";\r\n if (err.stack) stackTrace = JSON.stringify(err.stack.split(\"\\n\"));\r\n\r\n //create clientException message\r\n const ce: IClientException = {\r\n clientIdentifier: `${CLIENT_IDENTIFIER} ${BUILD_HASH.substring(0, BUILD_HASH_DISPLAY_LENGTH)}`,\r\n errorMessage,\r\n cause: localStorage.getItem(EVENT_ARRAY) || \"\",\r\n stackTrace,\r\n url: extraString,\r\n userAgent: \"isMobile: \" + !localStorage.getItem(\"isMobile\") + \" OS: \" + localStorage.getItem(\"getOS\"),\r\n ipAddress: \"\",\r\n personId: user?.personId || 0,\r\n resellerId: user?.subscriberInfo?.managingResellerID || 0,\r\n };\r\n\r\n if (FLAGS.IS_DEBUG) {\r\n console.log(`${new Date().toISOString()} | ${ce.personId} | ${ce.resellerId}`);\r\n console.log(ce.stackTrace);\r\n console.log(ce.userAgent);\r\n if (extra) console.log(extra);\r\n }\r\n\r\n //send it\r\n await unifiedApi.putClientException(ce);\r\n\r\n //delete the queue of events\r\n localStorage.removeItem(EVENT_ARRAY);\r\n}\r\n","// This is a generated file. Do not edit.\nvar Space_Separator = /[\\u1680\\u2000-\\u200A\\u202F\\u205F\\u3000]/;\nvar ID_Start = /[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086A\\u08A0-\\u08B4\\u08B6-\\u08BD\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u09FC\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C60\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u1884\\u1887-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C88\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312E\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FEA\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7AE\\uA7B0-\\uA7B7\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB65\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]|\\uD800[\\uDC00-\\uDC0B\\uDC0D-\\uDC26\\uDC28-\\uDC3A\\uDC3C\\uDC3D\\uDC3F-\\uDC4D\\uDC50-\\uDC5D\\uDC80-\\uDCFA\\uDD40-\\uDD74\\uDE80-\\uDE9C\\uDEA0-\\uDED0\\uDF00-\\uDF1F\\uDF2D-\\uDF4A\\uDF50-\\uDF75\\uDF80-\\uDF9D\\uDFA0-\\uDFC3\\uDFC8-\\uDFCF\\uDFD1-\\uDFD5]|\\uD801[\\uDC00-\\uDC9D\\uDCB0-\\uDCD3\\uDCD8-\\uDCFB\\uDD00-\\uDD27\\uDD30-\\uDD63\\uDE00-\\uDF36\\uDF40-\\uDF55\\uDF60-\\uDF67]|\\uD802[\\uDC00-\\uDC05\\uDC08\\uDC0A-\\uDC35\\uDC37\\uDC38\\uDC3C\\uDC3F-\\uDC55\\uDC60-\\uDC76\\uDC80-\\uDC9E\\uDCE0-\\uDCF2\\uDCF4\\uDCF5\\uDD00-\\uDD15\\uDD20-\\uDD39\\uDD80-\\uDDB7\\uDDBE\\uDDBF\\uDE00\\uDE10-\\uDE13\\uDE15-\\uDE17\\uDE19-\\uDE33\\uDE60-\\uDE7C\\uDE80-\\uDE9C\\uDEC0-\\uDEC7\\uDEC9-\\uDEE4\\uDF00-\\uDF35\\uDF40-\\uDF55\\uDF60-\\uDF72\\uDF80-\\uDF91]|\\uD803[\\uDC00-\\uDC48\\uDC80-\\uDCB2\\uDCC0-\\uDCF2]|\\uD804[\\uDC03-\\uDC37\\uDC83-\\uDCAF\\uDCD0-\\uDCE8\\uDD03-\\uDD26\\uDD50-\\uDD72\\uDD76\\uDD83-\\uDDB2\\uDDC1-\\uDDC4\\uDDDA\\uDDDC\\uDE00-\\uDE11\\uDE13-\\uDE2B\\uDE80-\\uDE86\\uDE88\\uDE8A-\\uDE8D\\uDE8F-\\uDE9D\\uDE9F-\\uDEA8\\uDEB0-\\uDEDE\\uDF05-\\uDF0C\\uDF0F\\uDF10\\uDF13-\\uDF28\\uDF2A-\\uDF30\\uDF32\\uDF33\\uDF35-\\uDF39\\uDF3D\\uDF50\\uDF5D-\\uDF61]|\\uD805[\\uDC00-\\uDC34\\uDC47-\\uDC4A\\uDC80-\\uDCAF\\uDCC4\\uDCC5\\uDCC7\\uDD80-\\uDDAE\\uDDD8-\\uDDDB\\uDE00-\\uDE2F\\uDE44\\uDE80-\\uDEAA\\uDF00-\\uDF19]|\\uD806[\\uDCA0-\\uDCDF\\uDCFF\\uDE00\\uDE0B-\\uDE32\\uDE3A\\uDE50\\uDE5C-\\uDE83\\uDE86-\\uDE89\\uDEC0-\\uDEF8]|\\uD807[\\uDC00-\\uDC08\\uDC0A-\\uDC2E\\uDC40\\uDC72-\\uDC8F\\uDD00-\\uDD06\\uDD08\\uDD09\\uDD0B-\\uDD30\\uDD46]|\\uD808[\\uDC00-\\uDF99]|\\uD809[\\uDC00-\\uDC6E\\uDC80-\\uDD43]|[\\uD80C\\uD81C-\\uD820\\uD840-\\uD868\\uD86A-\\uD86C\\uD86F-\\uD872\\uD874-\\uD879][\\uDC00-\\uDFFF]|\\uD80D[\\uDC00-\\uDC2E]|\\uD811[\\uDC00-\\uDE46]|\\uD81A[\\uDC00-\\uDE38\\uDE40-\\uDE5E\\uDED0-\\uDEED\\uDF00-\\uDF2F\\uDF40-\\uDF43\\uDF63-\\uDF77\\uDF7D-\\uDF8F]|\\uD81B[\\uDF00-\\uDF44\\uDF50\\uDF93-\\uDF9F\\uDFE0\\uDFE1]|\\uD821[\\uDC00-\\uDFEC]|\\uD822[\\uDC00-\\uDEF2]|\\uD82C[\\uDC00-\\uDD1E\\uDD70-\\uDEFB]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\uDC88\\uDC90-\\uDC99]|\\uD835[\\uDC00-\\uDC54\\uDC56-\\uDC9C\\uDC9E\\uDC9F\\uDCA2\\uDCA5\\uDCA6\\uDCA9-\\uDCAC\\uDCAE-\\uDCB9\\uDCBB\\uDCBD-\\uDCC3\\uDCC5-\\uDD05\\uDD07-\\uDD0A\\uDD0D-\\uDD14\\uDD16-\\uDD1C\\uDD1E-\\uDD39\\uDD3B-\\uDD3E\\uDD40-\\uDD44\\uDD46\\uDD4A-\\uDD50\\uDD52-\\uDEA5\\uDEA8-\\uDEC0\\uDEC2-\\uDEDA\\uDEDC-\\uDEFA\\uDEFC-\\uDF14\\uDF16-\\uDF34\\uDF36-\\uDF4E\\uDF50-\\uDF6E\\uDF70-\\uDF88\\uDF8A-\\uDFA8\\uDFAA-\\uDFC2\\uDFC4-\\uDFCB]|\\uD83A[\\uDC00-\\uDCC4\\uDD00-\\uDD43]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB]|\\uD869[\\uDC00-\\uDED6\\uDF00-\\uDFFF]|\\uD86D[\\uDC00-\\uDF34\\uDF40-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEA1\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0]|\\uD87E[\\uDC00-\\uDE1D]/;\nvar ID_Continue = /[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u0860-\\u086A\\u08A0-\\u08B4\\u08B6-\\u08BD\\u08D4-\\u08E1\\u08E3-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u09FC\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0AF9-\\u0AFF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58-\\u0C5A\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C80-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D00-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D54-\\u0D57\\u0D5F-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1C80-\\u1C88\\u1CD0-\\u1CD2\\u1CD4-\\u1CF9\\u1D00-\\u1DF9\\u1DFB-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312E\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FEA\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7AE\\uA7B0-\\uA7B7\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C5\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA8FD\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB65\\uAB70-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2F\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]|\\uD800[\\uDC00-\\uDC0B\\uDC0D-\\uDC26\\uDC28-\\uDC3A\\uDC3C\\uDC3D\\uDC3F-\\uDC4D\\uDC50-\\uDC5D\\uDC80-\\uDCFA\\uDD40-\\uDD74\\uDDFD\\uDE80-\\uDE9C\\uDEA0-\\uDED0\\uDEE0\\uDF00-\\uDF1F\\uDF2D-\\uDF4A\\uDF50-\\uDF7A\\uDF80-\\uDF9D\\uDFA0-\\uDFC3\\uDFC8-\\uDFCF\\uDFD1-\\uDFD5]|\\uD801[\\uDC00-\\uDC9D\\uDCA0-\\uDCA9\\uDCB0-\\uDCD3\\uDCD8-\\uDCFB\\uDD00-\\uDD27\\uDD30-\\uDD63\\uDE00-\\uDF36\\uDF40-\\uDF55\\uDF60-\\uDF67]|\\uD802[\\uDC00-\\uDC05\\uDC08\\uDC0A-\\uDC35\\uDC37\\uDC38\\uDC3C\\uDC3F-\\uDC55\\uDC60-\\uDC76\\uDC80-\\uDC9E\\uDCE0-\\uDCF2\\uDCF4\\uDCF5\\uDD00-\\uDD15\\uDD20-\\uDD39\\uDD80-\\uDDB7\\uDDBE\\uDDBF\\uDE00-\\uDE03\\uDE05\\uDE06\\uDE0C-\\uDE13\\uDE15-\\uDE17\\uDE19-\\uDE33\\uDE38-\\uDE3A\\uDE3F\\uDE60-\\uDE7C\\uDE80-\\uDE9C\\uDEC0-\\uDEC7\\uDEC9-\\uDEE6\\uDF00-\\uDF35\\uDF40-\\uDF55\\uDF60-\\uDF72\\uDF80-\\uDF91]|\\uD803[\\uDC00-\\uDC48\\uDC80-\\uDCB2\\uDCC0-\\uDCF2]|\\uD804[\\uDC00-\\uDC46\\uDC66-\\uDC6F\\uDC7F-\\uDCBA\\uDCD0-\\uDCE8\\uDCF0-\\uDCF9\\uDD00-\\uDD34\\uDD36-\\uDD3F\\uDD50-\\uDD73\\uDD76\\uDD80-\\uDDC4\\uDDCA-\\uDDCC\\uDDD0-\\uDDDA\\uDDDC\\uDE00-\\uDE11\\uDE13-\\uDE37\\uDE3E\\uDE80-\\uDE86\\uDE88\\uDE8A-\\uDE8D\\uDE8F-\\uDE9D\\uDE9F-\\uDEA8\\uDEB0-\\uDEEA\\uDEF0-\\uDEF9\\uDF00-\\uDF03\\uDF05-\\uDF0C\\uDF0F\\uDF10\\uDF13-\\uDF28\\uDF2A-\\uDF30\\uDF32\\uDF33\\uDF35-\\uDF39\\uDF3C-\\uDF44\\uDF47\\uDF48\\uDF4B-\\uDF4D\\uDF50\\uDF57\\uDF5D-\\uDF63\\uDF66-\\uDF6C\\uDF70-\\uDF74]|\\uD805[\\uDC00-\\uDC4A\\uDC50-\\uDC59\\uDC80-\\uDCC5\\uDCC7\\uDCD0-\\uDCD9\\uDD80-\\uDDB5\\uDDB8-\\uDDC0\\uDDD8-\\uDDDD\\uDE00-\\uDE40\\uDE44\\uDE50-\\uDE59\\uDE80-\\uDEB7\\uDEC0-\\uDEC9\\uDF00-\\uDF19\\uDF1D-\\uDF2B\\uDF30-\\uDF39]|\\uD806[\\uDCA0-\\uDCE9\\uDCFF\\uDE00-\\uDE3E\\uDE47\\uDE50-\\uDE83\\uDE86-\\uDE99\\uDEC0-\\uDEF8]|\\uD807[\\uDC00-\\uDC08\\uDC0A-\\uDC36\\uDC38-\\uDC40\\uDC50-\\uDC59\\uDC72-\\uDC8F\\uDC92-\\uDCA7\\uDCA9-\\uDCB6\\uDD00-\\uDD06\\uDD08\\uDD09\\uDD0B-\\uDD36\\uDD3A\\uDD3C\\uDD3D\\uDD3F-\\uDD47\\uDD50-\\uDD59]|\\uD808[\\uDC00-\\uDF99]|\\uD809[\\uDC00-\\uDC6E\\uDC80-\\uDD43]|[\\uD80C\\uD81C-\\uD820\\uD840-\\uD868\\uD86A-\\uD86C\\uD86F-\\uD872\\uD874-\\uD879][\\uDC00-\\uDFFF]|\\uD80D[\\uDC00-\\uDC2E]|\\uD811[\\uDC00-\\uDE46]|\\uD81A[\\uDC00-\\uDE38\\uDE40-\\uDE5E\\uDE60-\\uDE69\\uDED0-\\uDEED\\uDEF0-\\uDEF4\\uDF00-\\uDF36\\uDF40-\\uDF43\\uDF50-\\uDF59\\uDF63-\\uDF77\\uDF7D-\\uDF8F]|\\uD81B[\\uDF00-\\uDF44\\uDF50-\\uDF7E\\uDF8F-\\uDF9F\\uDFE0\\uDFE1]|\\uD821[\\uDC00-\\uDFEC]|\\uD822[\\uDC00-\\uDEF2]|\\uD82C[\\uDC00-\\uDD1E\\uDD70-\\uDEFB]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\uDC88\\uDC90-\\uDC99\\uDC9D\\uDC9E]|\\uD834[\\uDD65-\\uDD69\\uDD6D-\\uDD72\\uDD7B-\\uDD82\\uDD85-\\uDD8B\\uDDAA-\\uDDAD\\uDE42-\\uDE44]|\\uD835[\\uDC00-\\uDC54\\uDC56-\\uDC9C\\uDC9E\\uDC9F\\uDCA2\\uDCA5\\uDCA6\\uDCA9-\\uDCAC\\uDCAE-\\uDCB9\\uDCBB\\uDCBD-\\uDCC3\\uDCC5-\\uDD05\\uDD07-\\uDD0A\\uDD0D-\\uDD14\\uDD16-\\uDD1C\\uDD1E-\\uDD39\\uDD3B-\\uDD3E\\uDD40-\\uDD44\\uDD46\\uDD4A-\\uDD50\\uDD52-\\uDEA5\\uDEA8-\\uDEC0\\uDEC2-\\uDEDA\\uDEDC-\\uDEFA\\uDEFC-\\uDF14\\uDF16-\\uDF34\\uDF36-\\uDF4E\\uDF50-\\uDF6E\\uDF70-\\uDF88\\uDF8A-\\uDFA8\\uDFAA-\\uDFC2\\uDFC4-\\uDFCB\\uDFCE-\\uDFFF]|\\uD836[\\uDE00-\\uDE36\\uDE3B-\\uDE6C\\uDE75\\uDE84\\uDE9B-\\uDE9F\\uDEA1-\\uDEAF]|\\uD838[\\uDC00-\\uDC06\\uDC08-\\uDC18\\uDC1B-\\uDC21\\uDC23\\uDC24\\uDC26-\\uDC2A]|\\uD83A[\\uDC00-\\uDCC4\\uDCD0-\\uDCD6\\uDD00-\\uDD4A\\uDD50-\\uDD59]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB]|\\uD869[\\uDC00-\\uDED6\\uDF00-\\uDFFF]|\\uD86D[\\uDC00-\\uDF34\\uDF40-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEA1\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0]|\\uD87E[\\uDC00-\\uDE1D]|\\uDB40[\\uDD00-\\uDDEF]/;\n\nvar unicode = {\n\tSpace_Separator: Space_Separator,\n\tID_Start: ID_Start,\n\tID_Continue: ID_Continue\n};\n\nvar util = {\n isSpaceSeparator (c) {\n return typeof c === 'string' && unicode.Space_Separator.test(c)\n },\n\n isIdStartChar (c) {\n return typeof c === 'string' && (\n (c >= 'a' && c <= 'z') ||\n (c >= 'A' && c <= 'Z') ||\n (c === '$') || (c === '_') ||\n unicode.ID_Start.test(c)\n )\n },\n\n isIdContinueChar (c) {\n return typeof c === 'string' && (\n (c >= 'a' && c <= 'z') ||\n (c >= 'A' && c <= 'Z') ||\n (c >= '0' && c <= '9') ||\n (c === '$') || (c === '_') ||\n (c === '\\u200C') || (c === '\\u200D') ||\n unicode.ID_Continue.test(c)\n )\n },\n\n isDigit (c) {\n return typeof c === 'string' && /[0-9]/.test(c)\n },\n\n isHexDigit (c) {\n return typeof c === 'string' && /[0-9A-Fa-f]/.test(c)\n },\n};\n\nlet source;\nlet parseState;\nlet stack;\nlet pos;\nlet line;\nlet column;\nlet token;\nlet key;\nlet root;\n\nvar parse = function parse (text, reviver) {\n source = String(text);\n parseState = 'start';\n stack = [];\n pos = 0;\n line = 1;\n column = 0;\n token = undefined;\n key = undefined;\n root = undefined;\n\n do {\n token = lex();\n\n // This code is unreachable.\n // if (!parseStates[parseState]) {\n // throw invalidParseState()\n // }\n\n parseStates[parseState]();\n } while (token.type !== 'eof')\n\n if (typeof reviver === 'function') {\n return internalize({'': root}, '', reviver)\n }\n\n return root\n};\n\nfunction internalize (holder, name, reviver) {\n const value = holder[name];\n if (value != null && typeof value === 'object') {\n if (Array.isArray(value)) {\n for (let i = 0; i < value.length; i++) {\n const key = String(i);\n const replacement = internalize(value, key, reviver);\n if (replacement === undefined) {\n delete value[key];\n } else {\n Object.defineProperty(value, key, {\n value: replacement,\n writable: true,\n enumerable: true,\n configurable: true,\n });\n }\n }\n } else {\n for (const key in value) {\n const replacement = internalize(value, key, reviver);\n if (replacement === undefined) {\n delete value[key];\n } else {\n Object.defineProperty(value, key, {\n value: replacement,\n writable: true,\n enumerable: true,\n configurable: true,\n });\n }\n }\n }\n }\n\n return reviver.call(holder, name, value)\n}\n\nlet lexState;\nlet buffer;\nlet doubleQuote;\nlet sign;\nlet c;\n\nfunction lex () {\n lexState = 'default';\n buffer = '';\n doubleQuote = false;\n sign = 1;\n\n for (;;) {\n c = peek();\n\n // This code is unreachable.\n // if (!lexStates[lexState]) {\n // throw invalidLexState(lexState)\n // }\n\n const token = lexStates[lexState]();\n if (token) {\n return token\n }\n }\n}\n\nfunction peek () {\n if (source[pos]) {\n return String.fromCodePoint(source.codePointAt(pos))\n }\n}\n\nfunction read () {\n const c = peek();\n\n if (c === '\\n') {\n line++;\n column = 0;\n } else if (c) {\n column += c.length;\n } else {\n column++;\n }\n\n if (c) {\n pos += c.length;\n }\n\n return c\n}\n\nconst lexStates = {\n default () {\n switch (c) {\n case '\\t':\n case '\\v':\n case '\\f':\n case ' ':\n case '\\u00A0':\n case '\\uFEFF':\n case '\\n':\n case '\\r':\n case '\\u2028':\n case '\\u2029':\n read();\n return\n\n case '/':\n read();\n lexState = 'comment';\n return\n\n case undefined:\n read();\n return newToken('eof')\n }\n\n if (util.isSpaceSeparator(c)) {\n read();\n return\n }\n\n // This code is unreachable.\n // if (!lexStates[parseState]) {\n // throw invalidLexState(parseState)\n // }\n\n return lexStates[parseState]()\n },\n\n comment () {\n switch (c) {\n case '*':\n read();\n lexState = 'multiLineComment';\n return\n\n case '/':\n read();\n lexState = 'singleLineComment';\n return\n }\n\n throw invalidChar(read())\n },\n\n multiLineComment () {\n switch (c) {\n case '*':\n read();\n lexState = 'multiLineCommentAsterisk';\n return\n\n case undefined:\n throw invalidChar(read())\n }\n\n read();\n },\n\n multiLineCommentAsterisk () {\n switch (c) {\n case '*':\n read();\n return\n\n case '/':\n read();\n lexState = 'default';\n return\n\n case undefined:\n throw invalidChar(read())\n }\n\n read();\n lexState = 'multiLineComment';\n },\n\n singleLineComment () {\n switch (c) {\n case '\\n':\n case '\\r':\n case '\\u2028':\n case '\\u2029':\n read();\n lexState = 'default';\n return\n\n case undefined:\n read();\n return newToken('eof')\n }\n\n read();\n },\n\n value () {\n switch (c) {\n case '{':\n case '[':\n return newToken('punctuator', read())\n\n case 'n':\n read();\n literal('ull');\n return newToken('null', null)\n\n case 't':\n read();\n literal('rue');\n return newToken('boolean', true)\n\n case 'f':\n read();\n literal('alse');\n return newToken('boolean', false)\n\n case '-':\n case '+':\n if (read() === '-') {\n sign = -1;\n }\n\n lexState = 'sign';\n return\n\n case '.':\n buffer = read();\n lexState = 'decimalPointLeading';\n return\n\n case '0':\n buffer = read();\n lexState = 'zero';\n return\n\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 buffer = read();\n lexState = 'decimalInteger';\n return\n\n case 'I':\n read();\n literal('nfinity');\n return newToken('numeric', Infinity)\n\n case 'N':\n read();\n literal('aN');\n return newToken('numeric', NaN)\n\n case '\"':\n case \"'\":\n doubleQuote = (read() === '\"');\n buffer = '';\n lexState = 'string';\n return\n }\n\n throw invalidChar(read())\n },\n\n identifierNameStartEscape () {\n if (c !== 'u') {\n throw invalidChar(read())\n }\n\n read();\n const u = unicodeEscape();\n switch (u) {\n case '$':\n case '_':\n break\n\n default:\n if (!util.isIdStartChar(u)) {\n throw invalidIdentifier()\n }\n\n break\n }\n\n buffer += u;\n lexState = 'identifierName';\n },\n\n identifierName () {\n switch (c) {\n case '$':\n case '_':\n case '\\u200C':\n case '\\u200D':\n buffer += read();\n return\n\n case '\\\\':\n read();\n lexState = 'identifierNameEscape';\n return\n }\n\n if (util.isIdContinueChar(c)) {\n buffer += read();\n return\n }\n\n return newToken('identifier', buffer)\n },\n\n identifierNameEscape () {\n if (c !== 'u') {\n throw invalidChar(read())\n }\n\n read();\n const u = unicodeEscape();\n switch (u) {\n case '$':\n case '_':\n case '\\u200C':\n case '\\u200D':\n break\n\n default:\n if (!util.isIdContinueChar(u)) {\n throw invalidIdentifier()\n }\n\n break\n }\n\n buffer += u;\n lexState = 'identifierName';\n },\n\n sign () {\n switch (c) {\n case '.':\n buffer = read();\n lexState = 'decimalPointLeading';\n return\n\n case '0':\n buffer = read();\n lexState = 'zero';\n return\n\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 buffer = read();\n lexState = 'decimalInteger';\n return\n\n case 'I':\n read();\n literal('nfinity');\n return newToken('numeric', sign * Infinity)\n\n case 'N':\n read();\n literal('aN');\n return newToken('numeric', NaN)\n }\n\n throw invalidChar(read())\n },\n\n zero () {\n switch (c) {\n case '.':\n buffer += read();\n lexState = 'decimalPoint';\n return\n\n case 'e':\n case 'E':\n buffer += read();\n lexState = 'decimalExponent';\n return\n\n case 'x':\n case 'X':\n buffer += read();\n lexState = 'hexadecimal';\n return\n }\n\n return newToken('numeric', sign * 0)\n },\n\n decimalInteger () {\n switch (c) {\n case '.':\n buffer += read();\n lexState = 'decimalPoint';\n return\n\n case 'e':\n case 'E':\n buffer += read();\n lexState = 'decimalExponent';\n return\n }\n\n if (util.isDigit(c)) {\n buffer += read();\n return\n }\n\n return newToken('numeric', sign * Number(buffer))\n },\n\n decimalPointLeading () {\n if (util.isDigit(c)) {\n buffer += read();\n lexState = 'decimalFraction';\n return\n }\n\n throw invalidChar(read())\n },\n\n decimalPoint () {\n switch (c) {\n case 'e':\n case 'E':\n buffer += read();\n lexState = 'decimalExponent';\n return\n }\n\n if (util.isDigit(c)) {\n buffer += read();\n lexState = 'decimalFraction';\n return\n }\n\n return newToken('numeric', sign * Number(buffer))\n },\n\n decimalFraction () {\n switch (c) {\n case 'e':\n case 'E':\n buffer += read();\n lexState = 'decimalExponent';\n return\n }\n\n if (util.isDigit(c)) {\n buffer += read();\n return\n }\n\n return newToken('numeric', sign * Number(buffer))\n },\n\n decimalExponent () {\n switch (c) {\n case '+':\n case '-':\n buffer += read();\n lexState = 'decimalExponentSign';\n return\n }\n\n if (util.isDigit(c)) {\n buffer += read();\n lexState = 'decimalExponentInteger';\n return\n }\n\n throw invalidChar(read())\n },\n\n decimalExponentSign () {\n if (util.isDigit(c)) {\n buffer += read();\n lexState = 'decimalExponentInteger';\n return\n }\n\n throw invalidChar(read())\n },\n\n decimalExponentInteger () {\n if (util.isDigit(c)) {\n buffer += read();\n return\n }\n\n return newToken('numeric', sign * Number(buffer))\n },\n\n hexadecimal () {\n if (util.isHexDigit(c)) {\n buffer += read();\n lexState = 'hexadecimalInteger';\n return\n }\n\n throw invalidChar(read())\n },\n\n hexadecimalInteger () {\n if (util.isHexDigit(c)) {\n buffer += read();\n return\n }\n\n return newToken('numeric', sign * Number(buffer))\n },\n\n string () {\n switch (c) {\n case '\\\\':\n read();\n buffer += escape();\n return\n\n case '\"':\n if (doubleQuote) {\n read();\n return newToken('string', buffer)\n }\n\n buffer += read();\n return\n\n case \"'\":\n if (!doubleQuote) {\n read();\n return newToken('string', buffer)\n }\n\n buffer += read();\n return\n\n case '\\n':\n case '\\r':\n throw invalidChar(read())\n\n case '\\u2028':\n case '\\u2029':\n separatorChar(c);\n break\n\n case undefined:\n throw invalidChar(read())\n }\n\n buffer += read();\n },\n\n start () {\n switch (c) {\n case '{':\n case '[':\n return newToken('punctuator', read())\n\n // This code is unreachable since the default lexState handles eof.\n // case undefined:\n // return newToken('eof')\n }\n\n lexState = 'value';\n },\n\n beforePropertyName () {\n switch (c) {\n case '$':\n case '_':\n buffer = read();\n lexState = 'identifierName';\n return\n\n case '\\\\':\n read();\n lexState = 'identifierNameStartEscape';\n return\n\n case '}':\n return newToken('punctuator', read())\n\n case '\"':\n case \"'\":\n doubleQuote = (read() === '\"');\n lexState = 'string';\n return\n }\n\n if (util.isIdStartChar(c)) {\n buffer += read();\n lexState = 'identifierName';\n return\n }\n\n throw invalidChar(read())\n },\n\n afterPropertyName () {\n if (c === ':') {\n return newToken('punctuator', read())\n }\n\n throw invalidChar(read())\n },\n\n beforePropertyValue () {\n lexState = 'value';\n },\n\n afterPropertyValue () {\n switch (c) {\n case ',':\n case '}':\n return newToken('punctuator', read())\n }\n\n throw invalidChar(read())\n },\n\n beforeArrayValue () {\n if (c === ']') {\n return newToken('punctuator', read())\n }\n\n lexState = 'value';\n },\n\n afterArrayValue () {\n switch (c) {\n case ',':\n case ']':\n return newToken('punctuator', read())\n }\n\n throw invalidChar(read())\n },\n\n end () {\n // This code is unreachable since it's handled by the default lexState.\n // if (c === undefined) {\n // read()\n // return newToken('eof')\n // }\n\n throw invalidChar(read())\n },\n};\n\nfunction newToken (type, value) {\n return {\n type,\n value,\n line,\n column,\n }\n}\n\nfunction literal (s) {\n for (const c of s) {\n const p = peek();\n\n if (p !== c) {\n throw invalidChar(read())\n }\n\n read();\n }\n}\n\nfunction escape () {\n const c = peek();\n switch (c) {\n case 'b':\n read();\n return '\\b'\n\n case 'f':\n read();\n return '\\f'\n\n case 'n':\n read();\n return '\\n'\n\n case 'r':\n read();\n return '\\r'\n\n case 't':\n read();\n return '\\t'\n\n case 'v':\n read();\n return '\\v'\n\n case '0':\n read();\n if (util.isDigit(peek())) {\n throw invalidChar(read())\n }\n\n return '\\0'\n\n case 'x':\n read();\n return hexEscape()\n\n case 'u':\n read();\n return unicodeEscape()\n\n case '\\n':\n case '\\u2028':\n case '\\u2029':\n read();\n return ''\n\n case '\\r':\n read();\n if (peek() === '\\n') {\n read();\n }\n\n return ''\n\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 throw invalidChar(read())\n\n case undefined:\n throw invalidChar(read())\n }\n\n return read()\n}\n\nfunction hexEscape () {\n let buffer = '';\n let c = peek();\n\n if (!util.isHexDigit(c)) {\n throw invalidChar(read())\n }\n\n buffer += read();\n\n c = peek();\n if (!util.isHexDigit(c)) {\n throw invalidChar(read())\n }\n\n buffer += read();\n\n return String.fromCodePoint(parseInt(buffer, 16))\n}\n\nfunction unicodeEscape () {\n let buffer = '';\n let count = 4;\n\n while (count-- > 0) {\n const c = peek();\n if (!util.isHexDigit(c)) {\n throw invalidChar(read())\n }\n\n buffer += read();\n }\n\n return String.fromCodePoint(parseInt(buffer, 16))\n}\n\nconst parseStates = {\n start () {\n if (token.type === 'eof') {\n throw invalidEOF()\n }\n\n push();\n },\n\n beforePropertyName () {\n switch (token.type) {\n case 'identifier':\n case 'string':\n key = token.value;\n parseState = 'afterPropertyName';\n return\n\n case 'punctuator':\n // This code is unreachable since it's handled by the lexState.\n // if (token.value !== '}') {\n // throw invalidToken()\n // }\n\n pop();\n return\n\n case 'eof':\n throw invalidEOF()\n }\n\n // This code is unreachable since it's handled by the lexState.\n // throw invalidToken()\n },\n\n afterPropertyName () {\n // This code is unreachable since it's handled by the lexState.\n // if (token.type !== 'punctuator' || token.value !== ':') {\n // throw invalidToken()\n // }\n\n if (token.type === 'eof') {\n throw invalidEOF()\n }\n\n parseState = 'beforePropertyValue';\n },\n\n beforePropertyValue () {\n if (token.type === 'eof') {\n throw invalidEOF()\n }\n\n push();\n },\n\n beforeArrayValue () {\n if (token.type === 'eof') {\n throw invalidEOF()\n }\n\n if (token.type === 'punctuator' && token.value === ']') {\n pop();\n return\n }\n\n push();\n },\n\n afterPropertyValue () {\n // This code is unreachable since it's handled by the lexState.\n // if (token.type !== 'punctuator') {\n // throw invalidToken()\n // }\n\n if (token.type === 'eof') {\n throw invalidEOF()\n }\n\n switch (token.value) {\n case ',':\n parseState = 'beforePropertyName';\n return\n\n case '}':\n pop();\n }\n\n // This code is unreachable since it's handled by the lexState.\n // throw invalidToken()\n },\n\n afterArrayValue () {\n // This code is unreachable since it's handled by the lexState.\n // if (token.type !== 'punctuator') {\n // throw invalidToken()\n // }\n\n if (token.type === 'eof') {\n throw invalidEOF()\n }\n\n switch (token.value) {\n case ',':\n parseState = 'beforeArrayValue';\n return\n\n case ']':\n pop();\n }\n\n // This code is unreachable since it's handled by the lexState.\n // throw invalidToken()\n },\n\n end () {\n // This code is unreachable since it's handled by the lexState.\n // if (token.type !== 'eof') {\n // throw invalidToken()\n // }\n },\n};\n\nfunction push () {\n let value;\n\n switch (token.type) {\n case 'punctuator':\n switch (token.value) {\n case '{':\n value = {};\n break\n\n case '[':\n value = [];\n break\n }\n\n break\n\n case 'null':\n case 'boolean':\n case 'numeric':\n case 'string':\n value = token.value;\n break\n\n // This code is unreachable.\n // default:\n // throw invalidToken()\n }\n\n if (root === undefined) {\n root = value;\n } else {\n const parent = stack[stack.length - 1];\n if (Array.isArray(parent)) {\n parent.push(value);\n } else {\n Object.defineProperty(parent, key, {\n value,\n writable: true,\n enumerable: true,\n configurable: true,\n });\n }\n }\n\n if (value !== null && typeof value === 'object') {\n stack.push(value);\n\n if (Array.isArray(value)) {\n parseState = 'beforeArrayValue';\n } else {\n parseState = 'beforePropertyName';\n }\n } else {\n const current = stack[stack.length - 1];\n if (current == null) {\n parseState = 'end';\n } else if (Array.isArray(current)) {\n parseState = 'afterArrayValue';\n } else {\n parseState = 'afterPropertyValue';\n }\n }\n}\n\nfunction pop () {\n stack.pop();\n\n const current = stack[stack.length - 1];\n if (current == null) {\n parseState = 'end';\n } else if (Array.isArray(current)) {\n parseState = 'afterArrayValue';\n } else {\n parseState = 'afterPropertyValue';\n }\n}\n\n// This code is unreachable.\n// function invalidParseState () {\n// return new Error(`JSON5: invalid parse state '${parseState}'`)\n// }\n\n// This code is unreachable.\n// function invalidLexState (state) {\n// return new Error(`JSON5: invalid lex state '${state}'`)\n// }\n\nfunction invalidChar (c) {\n if (c === undefined) {\n return syntaxError(`JSON5: invalid end of input at ${line}:${column}`)\n }\n\n return syntaxError(`JSON5: invalid character '${formatChar(c)}' at ${line}:${column}`)\n}\n\nfunction invalidEOF () {\n return syntaxError(`JSON5: invalid end of input at ${line}:${column}`)\n}\n\n// This code is unreachable.\n// function invalidToken () {\n// if (token.type === 'eof') {\n// return syntaxError(`JSON5: invalid end of input at ${line}:${column}`)\n// }\n\n// const c = String.fromCodePoint(token.value.codePointAt(0))\n// return syntaxError(`JSON5: invalid character '${formatChar(c)}' at ${line}:${column}`)\n// }\n\nfunction invalidIdentifier () {\n column -= 5;\n return syntaxError(`JSON5: invalid identifier character at ${line}:${column}`)\n}\n\nfunction separatorChar (c) {\n console.warn(`JSON5: '${formatChar(c)}' in strings is not valid ECMAScript; consider escaping`);\n}\n\nfunction formatChar (c) {\n const replacements = {\n \"'\": \"\\\\'\",\n '\"': '\\\\\"',\n '\\\\': '\\\\\\\\',\n '\\b': '\\\\b',\n '\\f': '\\\\f',\n '\\n': '\\\\n',\n '\\r': '\\\\r',\n '\\t': '\\\\t',\n '\\v': '\\\\v',\n '\\0': '\\\\0',\n '\\u2028': '\\\\u2028',\n '\\u2029': '\\\\u2029',\n };\n\n if (replacements[c]) {\n return replacements[c]\n }\n\n if (c < ' ') {\n const hexString = c.charCodeAt(0).toString(16);\n return '\\\\x' + ('00' + hexString).substring(hexString.length)\n }\n\n return c\n}\n\nfunction syntaxError (message) {\n const err = new SyntaxError(message);\n err.lineNumber = line;\n err.columnNumber = column;\n return err\n}\n\nvar stringify = function stringify (value, replacer, space) {\n const stack = [];\n let indent = '';\n let propertyList;\n let replacerFunc;\n let gap = '';\n let quote;\n\n if (\n replacer != null &&\n typeof replacer === 'object' &&\n !Array.isArray(replacer)\n ) {\n space = replacer.space;\n quote = replacer.quote;\n replacer = replacer.replacer;\n }\n\n if (typeof replacer === 'function') {\n replacerFunc = replacer;\n } else if (Array.isArray(replacer)) {\n propertyList = [];\n for (const v of replacer) {\n let item;\n\n if (typeof v === 'string') {\n item = v;\n } else if (\n typeof v === 'number' ||\n v instanceof String ||\n v instanceof Number\n ) {\n item = String(v);\n }\n\n if (item !== undefined && propertyList.indexOf(item) < 0) {\n propertyList.push(item);\n }\n }\n }\n\n if (space instanceof Number) {\n space = Number(space);\n } else if (space instanceof String) {\n space = String(space);\n }\n\n if (typeof space === 'number') {\n if (space > 0) {\n space = Math.min(10, Math.floor(space));\n gap = ' '.substr(0, space);\n }\n } else if (typeof space === 'string') {\n gap = space.substr(0, 10);\n }\n\n return serializeProperty('', {'': value})\n\n function serializeProperty (key, holder) {\n let value = holder[key];\n if (value != null) {\n if (typeof value.toJSON5 === 'function') {\n value = value.toJSON5(key);\n } else if (typeof value.toJSON === 'function') {\n value = value.toJSON(key);\n }\n }\n\n if (replacerFunc) {\n value = replacerFunc.call(holder, key, value);\n }\n\n if (value instanceof Number) {\n value = Number(value);\n } else if (value instanceof String) {\n value = String(value);\n } else if (value instanceof Boolean) {\n value = value.valueOf();\n }\n\n switch (value) {\n case null: return 'null'\n case true: return 'true'\n case false: return 'false'\n }\n\n if (typeof value === 'string') {\n return quoteString(value, false)\n }\n\n if (typeof value === 'number') {\n return String(value)\n }\n\n if (typeof value === 'object') {\n return Array.isArray(value) ? serializeArray(value) : serializeObject(value)\n }\n\n return undefined\n }\n\n function quoteString (value) {\n const quotes = {\n \"'\": 0.1,\n '\"': 0.2,\n };\n\n const replacements = {\n \"'\": \"\\\\'\",\n '\"': '\\\\\"',\n '\\\\': '\\\\\\\\',\n '\\b': '\\\\b',\n '\\f': '\\\\f',\n '\\n': '\\\\n',\n '\\r': '\\\\r',\n '\\t': '\\\\t',\n '\\v': '\\\\v',\n '\\0': '\\\\0',\n '\\u2028': '\\\\u2028',\n '\\u2029': '\\\\u2029',\n };\n\n let product = '';\n\n for (let i = 0; i < value.length; i++) {\n const c = value[i];\n switch (c) {\n case \"'\":\n case '\"':\n quotes[c]++;\n product += c;\n continue\n\n case '\\0':\n if (util.isDigit(value[i + 1])) {\n product += '\\\\x00';\n continue\n }\n }\n\n if (replacements[c]) {\n product += replacements[c];\n continue\n }\n\n if (c < ' ') {\n let hexString = c.charCodeAt(0).toString(16);\n product += '\\\\x' + ('00' + hexString).substring(hexString.length);\n continue\n }\n\n product += c;\n }\n\n const quoteChar = quote || Object.keys(quotes).reduce((a, b) => (quotes[a] < quotes[b]) ? a : b);\n\n product = product.replace(new RegExp(quoteChar, 'g'), replacements[quoteChar]);\n\n return quoteChar + product + quoteChar\n }\n\n function serializeObject (value) {\n if (stack.indexOf(value) >= 0) {\n throw TypeError('Converting circular structure to JSON5')\n }\n\n stack.push(value);\n\n let stepback = indent;\n indent = indent + gap;\n\n let keys = propertyList || Object.keys(value);\n let partial = [];\n for (const key of keys) {\n const propertyString = serializeProperty(key, value);\n if (propertyString !== undefined) {\n let member = serializeKey(key) + ':';\n if (gap !== '') {\n member += ' ';\n }\n member += propertyString;\n partial.push(member);\n }\n }\n\n let final;\n if (partial.length === 0) {\n final = '{}';\n } else {\n let properties;\n if (gap === '') {\n properties = partial.join(',');\n final = '{' + properties + '}';\n } else {\n let separator = ',\\n' + indent;\n properties = partial.join(separator);\n final = '{\\n' + indent + properties + ',\\n' + stepback + '}';\n }\n }\n\n stack.pop();\n indent = stepback;\n return final\n }\n\n function serializeKey (key) {\n if (key.length === 0) {\n return quoteString(key, true)\n }\n\n const firstChar = String.fromCodePoint(key.codePointAt(0));\n if (!util.isIdStartChar(firstChar)) {\n return quoteString(key, true)\n }\n\n for (let i = firstChar.length; i < key.length; i++) {\n if (!util.isIdContinueChar(String.fromCodePoint(key.codePointAt(i)))) {\n return quoteString(key, true)\n }\n }\n\n return key\n }\n\n function serializeArray (value) {\n if (stack.indexOf(value) >= 0) {\n throw TypeError('Converting circular structure to JSON5')\n }\n\n stack.push(value);\n\n let stepback = indent;\n indent = indent + gap;\n\n let partial = [];\n for (let i = 0; i < value.length; i++) {\n const propertyString = serializeProperty(String(i), value);\n partial.push((propertyString !== undefined) ? propertyString : 'null');\n }\n\n let final;\n if (partial.length === 0) {\n final = '[]';\n } else {\n if (gap === '') {\n let properties = partial.join(',');\n final = '[' + properties + ']';\n } else {\n let separator = ',\\n' + indent;\n let properties = partial.join(separator);\n final = '[\\n' + indent + properties + ',\\n' + stepback + ']';\n }\n }\n\n stack.pop();\n indent = stepback;\n return final\n }\n};\n\nconst JSON5 = {\n parse,\n stringify,\n};\n\nvar lib = JSON5;\n\nexport default lib;\n","import { AxiosResponseHeaders, AxiosResponseTransformer } from \"axios\";\r\nimport { logException } from \"./logger\";\r\nimport JSON5 from \"json5\";\r\n\r\nexport const axiosTransformJSON5: AxiosResponseTransformer = (data, headers) => {\r\n if (isJson(headers)) {\r\n try {\r\n return JSON5.parse(data);\r\n } catch (err) {\r\n logException(err as Error, data);\r\n return data;\r\n }\r\n }\r\n return data;\r\n};\r\n\r\nfunction isJson(headers: AxiosResponseHeaders | undefined): boolean {\r\n if (!headers) return false;\r\n const content = headers[\"content-type\"] || headers[\"Content-Type\"];\r\n return content?.indexOf(\"application/json\") !== -1 || content?.indexOf(\"text/json\") !== -1;\r\n}\r\n\r\nexport function getLanguageUrlParm(lang: string) {\r\n switch (lang) {\r\n case \"ja\":\r\n return `jp/${lang}`;\r\n default:\r\n return `us/${lang}`;\r\n }\r\n}\r\n\r\nexport function debounce(fn, delay) {\r\n let timer;\r\n return () => {\r\n if (timer) clearTimeout(timer);\r\n timer = setTimeout(fn, delay);\r\n };\r\n}\r\n","import axios from \"axios\";\r\nimport { axiosTransformJSON5 } from \"@/common/helper\";\r\nimport { IZuoraFormConfig, ICaptchaConfig, IPendoConfig, IFooterLinksConfig } from \"./api/interfaces\";\r\n\r\nexport interface IConfig {\r\n zuoraForm: IZuoraFormConfig;\r\n captcha: ICaptchaConfig;\r\n pendo: IPendoConfig;\r\n footerLinks: IFooterLinksConfig;\r\n}\r\nconst origin = window.location.origin.toLowerCase();\r\n\r\nexport default function (): Promise {\r\n return axios({\r\n method: \"get\",\r\n url: `${origin}/config/config.json`,\r\n transformResponse: axiosTransformJSON5,\r\n }).then(res => {\r\n return res.data;\r\n });\r\n}\r\n","import { defineStore } from \"pinia\";\r\nimport loadConfig, { IConfig } from \"@/common/config\";\r\n\r\nexport interface IConfigStore {\r\n config: IConfig | null;\r\n}\r\n\r\nexport const useConfigStore = defineStore(\"config\", {\r\n state: (): IConfigStore => ({\r\n config: null,\r\n }),\r\n actions: {\r\n getConfig: async function getConfig() {\r\n if (!this.config) this.config = await loadConfig();\r\n },\r\n },\r\n});\r\n","import { useUserStore } from \"@/stores/user\";\r\nimport { useConfigStore } from \"@/stores/config\";\r\nimport { logEvent } from \"./logger\";\r\nimport { PENDO_LISTENER_INTERVAL_IN_MS, PENDO_LISTENER_TIMEOUT_IN_MS } from \"@/define\";\r\n\r\nconst pendo = \"Pendo\";\r\n\r\nexport async function initializePendo() {\r\n logEvent(\"Initializing...\", pendo);\r\n const command = `\r\n if (pendo) {\r\n pendo.initialize({\r\n visitor: {\r\n id: ''\r\n },\r\n \r\n account: {\r\n id: '0'\r\n }\r\n });\r\n } \r\n `;\r\n await run(command);\r\n}\r\n\r\nexport async function identifyPendo(userId: number) {\r\n logEvent(\"Identifying...\", pendo);\r\n const userStore = useUserStore();\r\n if (userStore.isPendoIdentified) {\r\n return;\r\n }\r\n\r\n const command = `\r\n if (pendo) {\r\n pendo.clearSession();\r\n pendo.identify({\r\n visitor: {\r\n id: \"${userId}\"\r\n },\r\n account: {\r\n id: \"0\",\r\n }\r\n });\r\n }\r\n `;\r\n await run(command);\r\n userStore.isPendoIdentified = true;\r\n}\r\n\r\nexport async function clearSession() {\r\n logEvent(\"Clearing Session...\", pendo);\r\n const command = `\r\n if (pendo) {\r\n pendo.clearSession();\r\n }`;\r\n await run(command);\r\n const userStore = useUserStore();\r\n userStore.isPendoIdentified = false;\r\n}\r\n\r\nexport async function validateInstallPendo() {\r\n logEvent(\"Validating Install...\", pendo);\r\n const command = `if (pendo) { pendo.validateInstall(); }`;\r\n await run(command);\r\n}\r\n\r\nexport async function installPendo() {\r\n logEvent(\"Installing...\", pendo);\r\n const configStore = useConfigStore();\r\n const apiKey = configStore.config?.pendo?.apiKey;\r\n\r\n // Pendo snippet\r\n const command = `\r\n (function(apiKey){\r\n (function(p,e,n,d,o){var v,w,x,y,z;o=p[d]=p[d]||{};o._q=o._q||[];\r\n v=['initialize','identify','updateOptions','pageLoad','track'];for(w=0,x=v.length;w 0) {\r\n await identifyPendo(currentUser.personId);\r\n }\r\n}\r\n\r\n// Access the script on Pendo's CDN\r\nexport async function run(command: string) {\r\n const configStore = useConfigStore();\r\n\r\n if (!configStore.config?.pendo?.enabled) {\r\n return;\r\n }\r\n\r\n const pendoRunner = \"pendoRunner\";\r\n const script: HTMLScriptElement = document.createElement(\"script\");\r\n script.id = pendoRunner;\r\n script.innerHTML = command;\r\n document.body.appendChild(script);\r\n document.body.removeChild(script); // Remove child so we don't expose Pendo's commands on Inspect.\r\n}\r\n\r\nexport async function removePendoToolTip() {\r\n // Listen if Pendo tooltip will be rendered\r\n const interval = setInterval(() => {\r\n const element = document.getElementById(\"pendo-base\");\r\n element?.remove();\r\n }, PENDO_LISTENER_INTERVAL_IN_MS);\r\n // Stops listening after 20 seconds\r\n setTimeout(() => {\r\n clearInterval(interval);\r\n }, PENDO_LISTENER_TIMEOUT_IN_MS);\r\n}\r\n","import { computed, ref } from \"vue\";\r\nimport {\r\n IUser,\r\n ILoggedInUser,\r\n IHomePageTiles,\r\n IUserDetails,\r\n ISubscriberInfo,\r\n} from \"@/common/api/unifiedPortal/interfaces\";\r\nimport { identifyPendo } from \"@/common/pendo\";\r\nimport { UserType } from \"@/globalEnums\";\r\nimport { defineStore } from \"pinia\";\r\n\r\nexport * from \"./userInterfaces\";\r\n\r\nexport const useUserStore = defineStore(\"user\", () => {\r\n const homeTilesInitialState = {\r\n backupOverview: true,\r\n securityOverview: true,\r\n securityZeroState: true,\r\n backupZeroState: true,\r\n subscriptions: true,\r\n };\r\n\r\n const email = ref(\"\");\r\n const currentUser = ref(null);\r\n const userType = ref(UserType.consumer);\r\n const selectedLanguage = ref(\"\");\r\n const isCreateAccountKeycodeExpired = ref(false);\r\n const createAccountEmailMismatchKeycode = ref(\"\");\r\n const isResellerManaged = ref(false);\r\n const checkUserSecurityQuestionsFilled = ref(false);\r\n const twoFactorAuthAddedFromFirstLogin = ref(false);\r\n const userDetails = ref(null);\r\n const lastRequestTime = ref(0);\r\n const displayedManageResellerControlRequest = ref(false);\r\n const showTile = ref(homeTilesInitialState);\r\n const isPendoIdentified = ref(false);\r\n const isCssbUser = ref(false);\r\n const preliminaryKeepAliveTimeInMinutes = ref(0);\r\n const preliminaryUserTimedOut = ref(false);\r\n const isSmbAccount = computed(() => {\r\n const id = currentUser.value?.subscriberInfo?.accountUID;\r\n if (!id) {\r\n return false;\r\n }\r\n\r\n return id > 0;\r\n });\r\n\r\n //Need to create our own reset function because this style of store doesn't support $reset\r\n function resetState() {\r\n email.value = \"\";\r\n currentUser.value = null;\r\n userType.value = UserType.consumer;\r\n selectedLanguage.value = \"\";\r\n isCreateAccountKeycodeExpired.value = false;\r\n createAccountEmailMismatchKeycode.value = \"\";\r\n isResellerManaged.value = false;\r\n checkUserSecurityQuestionsFilled.value = false;\r\n twoFactorAuthAddedFromFirstLogin.value = false;\r\n userDetails.value = null;\r\n lastRequestTime.value = 0;\r\n displayedManageResellerControlRequest.value = false;\r\n showTile.value = homeTilesInitialState;\r\n isPendoIdentified.value = false;\r\n isCssbUser.value = false;\r\n }\r\n\r\n const userFullName = computed(() => {\r\n let name = \"\";\r\n if (currentUser.value) {\r\n if (currentUser.value.firstName) {\r\n name = `${currentUser.value.firstName}`;\r\n }\r\n\r\n if (currentUser.value.lastName) {\r\n name = `${name} ${currentUser.value.lastName}`;\r\n }\r\n }\r\n\r\n return name;\r\n });\r\n\r\n const isEstablishedAccount = computed(() => {\r\n return (currentUser.value && currentUser.value.subscriberInfo?.hasPasswordSet) || false;\r\n });\r\n\r\n function setUser(user: IUser) {\r\n currentUser.value = user;\r\n\r\n // Initialize Pendo\r\n if (user?.personId != undefined && user?.personId > 0) {\r\n identifyPendo(user.personId);\r\n }\r\n }\r\n\r\n function setLoggedInUser(user: ILoggedInUser | null) {\r\n // fix: do not override subscriberInfo information:\r\n const subscriberInfo = currentUser.value?.subscriberInfo\r\n ? currentUser.value.subscriberInfo\r\n : ({} as ISubscriberInfo);\r\n subscriberInfo.hasValidatedEmail = user?.hasValidatedEmail ?? false;\r\n\r\n const updateCurrentUser = {\r\n personId: user?.personId,\r\n firstName: user?.firstName,\r\n lastName: user?.lastName,\r\n email: user?.email,\r\n alternateEmail: user?.alternateEmail,\r\n subscriberInfo: subscriberInfo,\r\n } as IUser;\r\n\r\n if (currentUser.value) {\r\n currentUser.value = Object.assign(currentUser.value, updateCurrentUser);\r\n } else {\r\n currentUser.value = updateCurrentUser;\r\n }\r\n }\r\n\r\n return {\r\n email,\r\n currentUser,\r\n userType,\r\n selectedLanguage,\r\n isCreateAccountKeycodeExpired,\r\n createAccountEmailMismatchKeycode,\r\n isResellerManaged,\r\n checkUserSecurityQuestionsFilled,\r\n twoFactorAuthAddedFromFirstLogin,\r\n userDetails,\r\n lastRequestTime,\r\n displayedManageResellerControlRequest,\r\n showTile,\r\n isPendoIdentified,\r\n isCssbUser,\r\n userFullName,\r\n setUser,\r\n setLoggedInUser,\r\n isEstablishedAccount,\r\n resetState,\r\n preliminaryKeepAliveTimeInMinutes,\r\n preliminaryUserTimedOut,\r\n isSmbAccount,\r\n };\r\n});\r\n","import { useUserStore } from \"@/stores/user\";\r\n\r\nexport function showPaymentHistory(): boolean {\r\n const userStore = useUserStore();\r\n const info = userStore.currentUser?.subscriberInfo;\r\n\r\n const hasSafeSub = !!info?.hasSafeSubscriptions;\r\n const hasECommWebroot = !!info?.hasEcommKeyCodes;\r\n const hasSafeWebroot = !!info?.hasSafeWebroot;\r\n const hasWsacRetail = !!info?.hasWsacRetail;\r\n\r\n if (hasECommWebroot && !hasSafeWebroot && !hasSafeSub && !hasWsacRetail) {\r\n return false;\r\n }\r\n\r\n const hasResellerUId = !!info?.managingResellerID && info.managingResellerID > 0;\r\n const hasOnlyResellerManagedDevice = !!info?.hasOnlyResellerComputers;\r\n const hasPartnerReferralDevice = !!info?.isPartnerReferral;\r\n const hasDirectACDevice = !!(!info?.hasOnlyResellerComputers && hasSafeSub);\r\n\r\n if (\r\n !hasECommWebroot &&\r\n hasOnlyResellerManagedDevice &&\r\n !hasPartnerReferralDevice &&\r\n !hasDirectACDevice &&\r\n hasResellerUId\r\n ) {\r\n return false;\r\n }\r\n return true;\r\n}\r\n","import { unifiedApi } from \"@/common\";\r\nimport { ISecurityState } from \"@/common/api/unifiedPortal/interfaces\";\r\nimport { LAST_API_FETCH_INTERVAL } from \"@/define\";\r\nimport { logEvent, logException } from \"@/common/logger\";\r\nimport { defineStore } from \"pinia\";\r\n\r\nexport const useSecurityStore = defineStore(\"security\", {\r\n state: (): ISecurityState => ({\r\n webrootDeviceResult: null,\r\n totalDevices: 0,\r\n totalShields: 0,\r\n totalEnabledShields: 0,\r\n hasExpiredLicenses: false,\r\n lastRequestTime: 0,\r\n }),\r\n actions: {\r\n async getSecurity() {\r\n try {\r\n const currentTime = new Date().getTime();\r\n if (currentTime - this.lastRequestTime >= LAST_API_FETCH_INTERVAL) {\r\n // API call\r\n const res = (await unifiedApi.getSkyWebrootDevices()).data;\r\n this.$state.webrootDeviceResult = res.webrootDeviceResult;\r\n this.$state.lastRequestTime = new Date().getTime();\r\n this.$state.totalDevices = res.totalDevices;\r\n this.$state.totalEnabledShields = res.totalEnabledShields;\r\n this.$state.totalShields = res.totalShields;\r\n this.$state.hasExpiredLicenses = res.hasExpiredLicenses;\r\n logEvent(\"security state updated\", \"security store\", this.$state);\r\n return this.$state;\r\n }\r\n return this.$state;\r\n } catch (err) {\r\n logException(err as Error);\r\n // throw err as it handled in calling method.\r\n throw err;\r\n }\r\n },\r\n //If the user has updated data we want to refresh the store next time they come to the page\r\n //This is a lot easier than trying to dig through 2 levels of arrays to update the store for the next time they come to the page\r\n forceRefresh() {\r\n this.lastRequestTime = new Date().getTime() - LAST_API_FETCH_INTERVAL;\r\n logEvent(\"Force Security store refresh\");\r\n },\r\n },\r\n});\r\n","import { unifiedApi } from \"@/common/index\";\r\nimport { useUserStore } from \"@/stores/user\";\r\nimport { handleApiError } from \"@/common/handleApiError\";\r\nimport { AxiosError } from \"axios\";\r\nimport { IDeviceInfo } from \"@/common/api/interfaces\";\r\n\r\nexport async function getUserDetailsFromStore(forceRefresh: boolean) {\r\n try {\r\n const userStore = useUserStore();\r\n let userDetails = userStore.userDetails;\r\n if (!userDetails || forceRefresh) {\r\n userDetails = (await unifiedApi.getUserDetails()).data;\r\n userStore.userDetails = userDetails;\r\n }\r\n return userDetails;\r\n } catch (err) {\r\n handleApiError(err as AxiosError);\r\n }\r\n}\r\n\r\nexport function getDeviceInfo(deviceId: number): IDeviceInfo {\r\n const di: IDeviceInfo = { userId: 0, device: undefined };\r\n const userStore = useUserStore();\r\n di.userId = userStore.currentUser?.personId;\r\n const userDetails = userStore.userDetails;\r\n\r\n if (di.userId && userDetails) di.device = userDetails?.devices.find(d => d.deviceId == deviceId);\r\n return di;\r\n}\r\n","import { useRouter } from \"vue-router\";\r\nimport { unifiedApi } from \".\";\r\nimport { AxiosError } from \"axios\";\r\nimport { handleApiError } from \"./handleApiError\";\r\nimport { useUserStore } from \"@/stores/user\";\r\nimport { UserType } from \"@/globalEnums\";\r\nimport { logEvent } from \"./logger\";\r\nimport { HTTP_STATUS_UNAUTHORIZED, HTTP_STATUS_FORBIDDEN } from \"@/define\";\r\nimport { useSecurityStore } from \"@/stores/security\";\r\nimport { useSubscriptionsStore } from \"@/stores/subscriptions\";\r\nimport { useAllstateSubscriptionsStore } from \"@/stores/allstateSubscriptions\";\r\nimport { getUserDetailsFromStore } from \"@/common/userDetails\";\r\n\r\nexport async function reloadSubscriberInfo() {\r\n const userStore = useUserStore();\r\n try {\r\n const subscriberLoginInfo = (await unifiedApi.getSubscriberInfo())?.data;\r\n if (subscriberLoginInfo) {\r\n const user = {\r\n userGuid: subscriberLoginInfo.userGuid,\r\n personId: subscriberLoginInfo.personId,\r\n firstName: subscriberLoginInfo.firstName,\r\n lastName: subscriberLoginInfo.lastName,\r\n email: subscriberLoginInfo.email,\r\n alternateEmail: subscriberLoginInfo.alternateEmail,\r\n subscriberInfo: subscriberLoginInfo,\r\n };\r\n userStore.setUser(user);\r\n userStore.userType = subscriberLoginInfo.accountUID ? UserType.smb : UserType.consumer;\r\n\r\n // Don't run below for SMB\r\n if (userStore.userType === UserType.consumer) {\r\n // user details is time consuming call starting it before-hand reduces load time.\r\n getUserDetailsFromStore(false);\r\n // This populate all we use for rendering in parallel to improve login speed\r\n // this is done in the side bar because it's the first to be rendered when user is logged in\r\n await Promise.all([\r\n useSubscriptionsStore().populateSubscriptions(),\r\n useSecurityStore().getSecurity(),\r\n useAllstateSubscriptionsStore().getAllstateSubscriptions(),\r\n ]);\r\n }\r\n } else {\r\n logEvent(\"reload subscriber got invalid data\", \"reloadSubscriberInfo\");\r\n useRouter().push(\"/error\");\r\n }\r\n } catch (err) {\r\n const error = err as AxiosError;\r\n if (error.response?.status === HTTP_STATUS_UNAUTHORIZED || error.response?.status === HTTP_STATUS_FORBIDDEN) {\r\n //Get out and let the Axios Interceptors redirect to the log in page\r\n return;\r\n }\r\n handleApiError(error, false);\r\n }\r\n}\r\n\r\n//This will only reload the user info and not subscriptions.\r\n//This will be used in the Return.vue as the pages afterwards will load the sub info\r\nexport async function reloadSubscriberInfoLite() {\r\n const userStore = useUserStore();\r\n try {\r\n const subscriberLoginInfo = (await unifiedApi.getSubscriberInfo())?.data;\r\n if (subscriberLoginInfo) {\r\n const user = {\r\n userGuid: subscriberLoginInfo.userGuid,\r\n personId: subscriberLoginInfo.personId,\r\n firstName: subscriberLoginInfo.firstName,\r\n lastName: subscriberLoginInfo.lastName,\r\n email: subscriberLoginInfo.email,\r\n alternateEmail: subscriberLoginInfo.alternateEmail,\r\n subscriberInfo: subscriberLoginInfo,\r\n };\r\n userStore.setUser(user);\r\n userStore.userType = subscriberLoginInfo.accountUID ? UserType.smb : UserType.consumer;\r\n if (userStore.userType === UserType.consumer) {\r\n // user details is time consuming call starting it before-hand reduces load time.\r\n getUserDetailsFromStore(false);\r\n }\r\n }\r\n } catch (err) {\r\n const error = err as AxiosError;\r\n if (error.response?.status === HTTP_STATUS_UNAUTHORIZED || error.response?.status === HTTP_STATUS_FORBIDDEN) {\r\n //Get out and let the Axios Interceptors redirect to the log in page\r\n return;\r\n }\r\n handleApiError(error, false);\r\n }\r\n}\r\n","import { BYTE_SCALE, COUNT_SCALE, NOMINAL_BYTE_SCALE } from \"@/define\";\r\nimport { UnitType, SubscriptionState } from \"@/globalEnums\";\r\nimport { t } from \"@/i18n\";\r\n\r\nexport const i18nRoot = \"HomeComponent.\";\r\nexport const MAX_UNIT_NAMES = 4;\r\n\r\nfunction getByteUnitNames() {\r\n return [\r\n \"\",\r\n t(`${i18nRoot}kilobytes`),\r\n t(`${i18nRoot}megabytes`),\r\n t(`${i18nRoot}gigabytes`),\r\n t(`${i18nRoot}terabytes`),\r\n ];\r\n}\r\n\r\nfunction getCountUnitNames() {\r\n return [\"\", t(`${i18nRoot}thousand`), t(`${i18nRoot}million`), t(`${i18nRoot}billion`), t(`${i18nRoot}trillion`)];\r\n}\r\n\r\nfunction getSubscriptionStateNames() {\r\n return [\r\n t(`${i18nRoot}expired`),\r\n t(`${i18nRoot}expiring`),\r\n t(`${i18nRoot}activateNow`),\r\n t(`${i18nRoot}inactive`),\r\n t(`${i18nRoot}active`),\r\n t(`${i18nRoot}cancelled`),\r\n ];\r\n}\r\n\r\nexport interface ITileData {\r\n title: string;\r\n type: string;\r\n status: string;\r\n state: string;\r\n installData?: ITileInstall;\r\n items?: ITileItemData[];\r\n detailsLink?: string;\r\n devices?: ISkyDevice[];\r\n keycode?: string;\r\n identifier?: string; //Used to append to HTML ids in the tileWrapper\r\n}\r\n\r\nexport interface ISkyDevice {\r\n name: string;\r\n keycode: string;\r\n instanceId: string;\r\n isVisible: boolean;\r\n shields: IShield[];\r\n id: string;\r\n operatingSystem: string;\r\n type: string;\r\n osBuild: string;\r\n osPlatform: number | null;\r\n nickname: string;\r\n version: string;\r\n isActive: boolean | null;\r\n}\r\n\r\nexport interface IShield {\r\n name: string;\r\n value: boolean;\r\n}\r\n\r\nexport interface ITileInstall {\r\n logo: string;\r\n mainText: string;\r\n auxText?: string;\r\n protectText?: string;\r\n installButtonText: string;\r\n installText: string;\r\n}\r\n\r\nexport interface ITileItemData {\r\n caption: string;\r\n value: number;\r\n maxValue?: number;\r\n unitType?: string;\r\n iconType?: string;\r\n}\r\n\r\nexport function convertAmount(item: ITileItemData): string {\r\n //if the value is something custom, just return that\r\n let result = item.value?.toString() ?? \"\";\r\n const intlNum = Intl.NumberFormat(\"en-US\", { maximumFractionDigits: 1, minimumFractionDigits: 0 });\r\n const subscriptionStateNames = getSubscriptionStateNames();\r\n //refreshCachedStrings();\r\n\r\n //however, if we have a unit type, then convert amount according to the type rules\r\n if (item.unitType) {\r\n switch (item.unitType) {\r\n case UnitType.bytes:\r\n case UnitType.count:\r\n const scale = item.unitType == UnitType.bytes ? BYTE_SCALE : COUNT_SCALE;\r\n let amount = item.value ?? 0;\r\n while (amount >= scale) {\r\n amount /= scale;\r\n }\r\n\r\n // If amount is between 1000 and 1024, round up for the next unitType\r\n if (amount >= NOMINAL_BYTE_SCALE) {\r\n amount /= scale;\r\n }\r\n\r\n result = intlNum.format(amount);\r\n break;\r\n case UnitType.subscriptionState:\r\n result = subscriptionStateNames[item.value];\r\n break;\r\n case UnitType.shields:\r\n if (item.maxValue) result = `${item.value} ${t(`${\"Common.of\"}`)} ${item.maxValue}`;\r\n break;\r\n }\r\n }\r\n\r\n return result;\r\n}\r\n\r\nexport function convertUnitType(item: ITileItemData): string {\r\n let unitText = \"\";\r\n //refreshCachedStrings();\r\n const byteUnitNames = getByteUnitNames();\r\n const countUnitNames = getCountUnitNames();\r\n\r\n if (item.unitType) {\r\n switch (item.unitType) {\r\n case UnitType.bytes:\r\n case UnitType.count:\r\n //if it is a number that must be scaled, then look up the appropriate unit\r\n const scale = item.unitType == UnitType.bytes ? BYTE_SCALE : COUNT_SCALE;\r\n let amount = item.value ?? 0;\r\n let unitIndex = 0;\r\n while (amount >= scale && unitIndex < MAX_UNIT_NAMES) {\r\n amount /= scale;\r\n unitIndex++;\r\n }\r\n\r\n // If amount is between 1000 and 1024, display the next unitType\r\n if (amount >= NOMINAL_BYTE_SCALE) {\r\n unitIndex++;\r\n }\r\n unitText = item.unitType == UnitType.bytes ? byteUnitNames[unitIndex] : countUnitNames[unitIndex];\r\n break;\r\n case UnitType.none:\r\n break;\r\n default:\r\n //if the unit is something arbitrary, then look up the unit in text\r\n unitText = t(`${i18nRoot}${item.unitType}`);\r\n break;\r\n }\r\n }\r\n\r\n return unitText;\r\n}\r\n\r\nexport function calcItemClass(item: ITileItemData): Record {\r\n const ic = {};\r\n\r\n if (item.iconType) ic[item.iconType] = true;\r\n\r\n if (item.unitType == UnitType.subscriptionState) {\r\n switch (item.value) {\r\n case SubscriptionState.expired:\r\n ic[\"danger\"] = true;\r\n break;\r\n case SubscriptionState.expiring:\r\n ic[\"warning\"] = true;\r\n break;\r\n }\r\n }\r\n\r\n return ic;\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","import { SafeDataPurgeDays } from \"@/define\";\r\n\r\nexport function isPurgedComputer(\r\n daysRemaining: number,\r\n isTrial: boolean,\r\n isResellerUser: boolean,\r\n dataHasBeenPurged: boolean,\r\n isEvergreen: boolean\r\n): boolean {\r\n return (\r\n dataHasBeenPurged ||\r\n (isTrial && daysRemaining <= SafeDataPurgeDays.Trials) || // trial\r\n (!isTrial && !isResellerUser && daysRemaining <= SafeDataPurgeDays.Direct) || // direct consumer\r\n (!isTrial && isResellerUser && daysRemaining <= SafeDataPurgeDays.Reseller) || // consumer under reseller\r\n (isEvergreen && daysRemaining <= 0)\r\n ); // Expired Evergreen\r\n}\r\n","\r\n\r\n\r\n","import {\r\n ISkyWebrootDevice,\r\n ISubscriberDownloadsInfo,\r\n IWebrootDeviceResult,\r\n} from \"@/common/api/unifiedPortal/interfaces\";\r\nimport { StatusType } from \"@/globalEnums\";\r\n\r\nexport const criticalShields = [\"realtimeShield\"];\r\n\r\nexport function getAllWebrootDevices(subscriberInfo: ISubscriberDownloadsInfo) {\r\n let allDevices: ISkyWebrootDevice[] = [];\r\n\r\n subscriberInfo.webrootSubscriptions.forEach(sub => {\r\n if (sub.devices && sub.devices.length > 0) {\r\n allDevices = [...allDevices, ...sub.devices];\r\n }\r\n });\r\n\r\n return allDevices;\r\n}\r\n\r\nexport function calculateStatus(results: IWebrootDeviceResult[]) {\r\n const devices: ISkyWebrootDevice[] = [];\r\n for (const result of results) {\r\n if (result.devices) {\r\n for (const device of result.devices) {\r\n devices.push(device);\r\n }\r\n }\r\n }\r\n\r\n const state = devices.some(d => !d.shields.realtimeShield)\r\n ? StatusType.danger\r\n : devices.some(\r\n d =>\r\n d.shields.phishingShield === false || // forcing false here, since the shields can be null\r\n d.shields.rootkitShield === false ||\r\n d.shields.webShield === false ||\r\n d.shields.usbShield === false ||\r\n d.shields.offlineShield === false ||\r\n d.shields.identityShield === false\r\n )\r\n ? StatusType.warning\r\n : StatusType.normal;\r\n return state;\r\n}\r\n\r\nexport function hasOnlyUninstalledDevices(results: IWebrootDeviceResult[]) {\r\n for (const result of results) {\r\n if (result.devices && result.devices.some(d => !d.uninstalled)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}\r\n\r\nexport function getInstalledDevices(results: IWebrootDeviceResult[]): ISkyWebrootDevice[] {\r\n const devices: ISkyWebrootDevice[] = [];\r\n results.forEach(result => {\r\n if (result.devices) {\r\n result.devices?.forEach(d => {\r\n if (d.uninstalled !== true) {\r\n devices.push(d);\r\n }\r\n });\r\n }\r\n });\r\n return devices;\r\n}\r\n","import { SUBSCRIPTION_BESTBUY_RENEWAL_CONVERSION_DAY } from \"@/define\";\r\nimport { useSubscriptionsStore } from \"@/stores/subscriptions\";\r\nimport { isNotActiveYet } from \"@/common/subscriptionHelper\";\r\nimport { useUserStore } from \"@/stores/user\";\r\nimport { webrootLicenseCategories } from \"./webrootProductName\";\r\n\r\nconst bestBuy = \"BestBuy\";\r\nexport const bestBuyRetailDistributionCodes = [\r\n \"ZCBB\",\r\n \"ZABB\",\r\n \"ZBBB\",\r\n \"SBWT\",\r\n \"ADBB\",\r\n \"ABBB\",\r\n \"TTBC\",\r\n \"TEBC\",\r\n \"TEBW\",\r\n \"SBWO\",\r\n \"WABB\",\r\n \"SBIT\",\r\n \"TTBW\",\r\n \"WIBB\",\r\n \"TTPP\",\r\n \"ECBB\",\r\n \"SBST\",\r\n \"GAMR\",\r\n \"ZEBB\",\r\n];\r\n\r\nexport async function hasOnlyBestBuyS2(): Promise {\r\n const userStore = useUserStore();\r\n const subscriptionsStore = useSubscriptionsStore();\r\n await subscriptionsStore.populateSubscriptions();\r\n const subscriptions = subscriptionsStore.subscriptions;\r\n if (subscriptions && subscriptions.length > 0) {\r\n const q = subscriptions.every(\r\n s =>\r\n s.keyCodeSellerType === bestBuy &&\r\n (s.remainingDays > SUBSCRIPTION_BESTBUY_RENEWAL_CONVERSION_DAY || isNotActiveYet(s)) &&\r\n s.licenseCategoryName !== webrootLicenseCategories.WSAIA\r\n );\r\n return q;\r\n }\r\n return userStore.currentUser?.subscriberInfo?.hasBestBuyS2 ?? false;\r\n}\r\n\r\nexport async function hasBestBuyS2(): Promise {\r\n const userStore = useUserStore();\r\n const subscriptionsStore = useSubscriptionsStore();\r\n await subscriptionsStore.populateSubscriptions();\r\n const subscriptions = subscriptionsStore.subscriptions;\r\n if (subscriptions && subscriptions.length > 0) {\r\n const q = subscriptions.some(\r\n s =>\r\n s.keyCodeSellerType === bestBuy &&\r\n (s.remainingDays > SUBSCRIPTION_BESTBUY_RENEWAL_CONVERSION_DAY || isNotActiveYet(s))\r\n );\r\n return q;\r\n }\r\n return userStore.currentUser?.subscriberInfo?.hasBestBuyS2 ?? false;\r\n}\r\n\r\n//Check if the user has any subs that were bought from BestBuy\r\n//This includes Retail, S2, and TTS\r\nexport async function hasAnyBestBuySubscriptions() {\r\n const subscriptions = useSubscriptionsStore().subscriptions ?? [];\r\n\r\n return subscriptions.some(\r\n l =>\r\n l.keyCodeSellerType === bestBuy ||\r\n bestBuyRetailDistributionCodes.find(k => k === getKeycodeDistributionMethodFromKeycode(l.keyCode ?? \"\"))\r\n );\r\n}\r\n\r\n//Distribution method is between characters 5th and 8th in the keycode\r\nfunction getKeycodeDistributionMethodFromKeycode(keycode: string) {\r\n return keycode.substring(4, 8);\r\n}\r\n","\r\n\r\n\r\n","\r\n\r\n\r\n\r\n\r\n","import { shallowRef, watchEffect, readonly, ref, watch, customRef, getCurrentScope, onScopeDispose, effectScope, getCurrentInstance, provide, inject, isVue3, version, isRef, unref, computed, reactive, toRefs as toRefs$1, toRef as toRef$1, isVue2, set as set$1, onBeforeMount, nextTick, onBeforeUnmount, onMounted, onUnmounted, isReactive } from 'vue-demi';\n\nfunction computedEager(fn, options) {\n var _a;\n const result = shallowRef();\n watchEffect(() => {\n result.value = fn();\n }, {\n ...options,\n flush: (_a = options == null ? void 0 : options.flush) != null ? _a : \"sync\"\n });\n return readonly(result);\n}\n\nfunction computedWithControl(source, fn) {\n let v = void 0;\n let track;\n let trigger;\n const dirty = ref(true);\n const update = () => {\n dirty.value = true;\n trigger();\n };\n watch(source, update, { flush: \"sync\" });\n const get = typeof fn === \"function\" ? fn : fn.get;\n const set = typeof fn === \"function\" ? void 0 : fn.set;\n const result = customRef((_track, _trigger) => {\n track = _track;\n trigger = _trigger;\n return {\n get() {\n if (dirty.value) {\n v = get();\n dirty.value = false;\n }\n track();\n return v;\n },\n set(v2) {\n set == null ? void 0 : set(v2);\n }\n };\n });\n if (Object.isExtensible(result))\n result.trigger = update;\n return result;\n}\n\nfunction tryOnScopeDispose(fn) {\n if (getCurrentScope()) {\n onScopeDispose(fn);\n return true;\n }\n return false;\n}\n\nfunction createEventHook() {\n const fns = /* @__PURE__ */ new Set();\n const off = (fn) => {\n fns.delete(fn);\n };\n const on = (fn) => {\n fns.add(fn);\n const offFn = () => off(fn);\n tryOnScopeDispose(offFn);\n return {\n off: offFn\n };\n };\n const trigger = (param) => {\n return Promise.all(Array.from(fns).map((fn) => param ? fn(param) : fn()));\n };\n return {\n on,\n off,\n trigger\n };\n}\n\nfunction createGlobalState(stateFactory) {\n let initialized = false;\n let state;\n const scope = effectScope(true);\n return (...args) => {\n if (!initialized) {\n state = scope.run(() => stateFactory(...args));\n initialized = true;\n }\n return state;\n };\n}\n\nconst localProvidedStateMap = /* @__PURE__ */ new WeakMap();\n\nconst provideLocal = (key, value) => {\n var _a;\n const instance = (_a = getCurrentInstance()) == null ? void 0 : _a.proxy;\n if (instance == null)\n throw new Error(\"provideLocal must be called in setup\");\n if (!localProvidedStateMap.has(instance))\n localProvidedStateMap.set(instance, /* @__PURE__ */ Object.create(null));\n const localProvidedState = localProvidedStateMap.get(instance);\n localProvidedState[key] = value;\n provide(key, value);\n};\n\nconst injectLocal = (...args) => {\n var _a;\n const key = args[0];\n const instance = (_a = getCurrentInstance()) == null ? void 0 : _a.proxy;\n if (instance == null)\n throw new Error(\"injectLocal must be called in setup\");\n if (localProvidedStateMap.has(instance) && key in localProvidedStateMap.get(instance))\n return localProvidedStateMap.get(instance)[key];\n return inject(...args);\n};\n\nfunction createInjectionState(composable, options) {\n const key = (options == null ? void 0 : options.injectionKey) || Symbol(\"InjectionState\");\n const useProvidingState = (...args) => {\n const state = composable(...args);\n provideLocal(key, state);\n return state;\n };\n const useInjectedState = () => injectLocal(key);\n return [useProvidingState, useInjectedState];\n}\n\nfunction createSharedComposable(composable) {\n let subscribers = 0;\n let state;\n let scope;\n const dispose = () => {\n subscribers -= 1;\n if (scope && subscribers <= 0) {\n scope.stop();\n state = void 0;\n scope = void 0;\n }\n };\n return (...args) => {\n subscribers += 1;\n if (!state) {\n scope = effectScope(true);\n state = scope.run(() => composable(...args));\n }\n tryOnScopeDispose(dispose);\n return state;\n };\n}\n\nfunction extendRef(ref, extend, { enumerable = false, unwrap = true } = {}) {\n if (!isVue3 && !version.startsWith(\"2.7.\")) {\n if (process.env.NODE_ENV !== \"production\")\n throw new Error(\"[VueUse] extendRef only works in Vue 2.7 or above.\");\n return;\n }\n for (const [key, value] of Object.entries(extend)) {\n if (key === \"value\")\n continue;\n if (isRef(value) && unwrap) {\n Object.defineProperty(ref, key, {\n get() {\n return value.value;\n },\n set(v) {\n value.value = v;\n },\n enumerable\n });\n } else {\n Object.defineProperty(ref, key, { value, enumerable });\n }\n }\n return ref;\n}\n\nfunction get(obj, key) {\n if (key == null)\n return unref(obj);\n return unref(obj)[key];\n}\n\nfunction isDefined(v) {\n return unref(v) != null;\n}\n\nfunction makeDestructurable(obj, arr) {\n if (typeof Symbol !== \"undefined\") {\n const clone = { ...obj };\n Object.defineProperty(clone, Symbol.iterator, {\n enumerable: false,\n value() {\n let index = 0;\n return {\n next: () => ({\n value: arr[index++],\n done: index > arr.length\n })\n };\n }\n });\n return clone;\n } else {\n return Object.assign([...arr], obj);\n }\n}\n\nfunction toValue(r) {\n return typeof r === \"function\" ? r() : unref(r);\n}\nconst resolveUnref = toValue;\n\nfunction reactify(fn, options) {\n const unrefFn = (options == null ? void 0 : options.computedGetter) === false ? unref : toValue;\n return function(...args) {\n return computed(() => fn.apply(this, args.map((i) => unrefFn(i))));\n };\n}\n\nfunction reactifyObject(obj, optionsOrKeys = {}) {\n let keys = [];\n let options;\n if (Array.isArray(optionsOrKeys)) {\n keys = optionsOrKeys;\n } else {\n options = optionsOrKeys;\n const { includeOwnProperties = true } = optionsOrKeys;\n keys.push(...Object.keys(obj));\n if (includeOwnProperties)\n keys.push(...Object.getOwnPropertyNames(obj));\n }\n return Object.fromEntries(\n keys.map((key) => {\n const value = obj[key];\n return [\n key,\n typeof value === \"function\" ? reactify(value.bind(obj), options) : value\n ];\n })\n );\n}\n\nfunction toReactive(objectRef) {\n if (!isRef(objectRef))\n return reactive(objectRef);\n const proxy = new Proxy({}, {\n get(_, p, receiver) {\n return unref(Reflect.get(objectRef.value, p, receiver));\n },\n set(_, p, value) {\n if (isRef(objectRef.value[p]) && !isRef(value))\n objectRef.value[p].value = value;\n else\n objectRef.value[p] = value;\n return true;\n },\n deleteProperty(_, p) {\n return Reflect.deleteProperty(objectRef.value, p);\n },\n has(_, p) {\n return Reflect.has(objectRef.value, p);\n },\n ownKeys() {\n return Object.keys(objectRef.value);\n },\n getOwnPropertyDescriptor() {\n return {\n enumerable: true,\n configurable: true\n };\n }\n });\n return reactive(proxy);\n}\n\nfunction reactiveComputed(fn) {\n return toReactive(computed(fn));\n}\n\nfunction reactiveOmit(obj, ...keys) {\n const flatKeys = keys.flat();\n const predicate = flatKeys[0];\n return reactiveComputed(() => typeof predicate === \"function\" ? Object.fromEntries(Object.entries(toRefs$1(obj)).filter(([k, v]) => !predicate(toValue(v), k))) : Object.fromEntries(Object.entries(toRefs$1(obj)).filter((e) => !flatKeys.includes(e[0]))));\n}\n\nconst isClient = typeof window !== \"undefined\" && typeof document !== \"undefined\";\nconst isWorker = typeof WorkerGlobalScope !== \"undefined\" && globalThis instanceof WorkerGlobalScope;\nconst isDef = (val) => typeof val !== \"undefined\";\nconst notNullish = (val) => val != null;\nconst assert = (condition, ...infos) => {\n if (!condition)\n console.warn(...infos);\n};\nconst toString = Object.prototype.toString;\nconst isObject = (val) => toString.call(val) === \"[object Object]\";\nconst now = () => Date.now();\nconst timestamp = () => +Date.now();\nconst clamp = (n, min, max) => Math.min(max, Math.max(min, n));\nconst noop = () => {\n};\nconst rand = (min, max) => {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n};\nconst hasOwn = (val, key) => Object.prototype.hasOwnProperty.call(val, key);\nconst isIOS = /* @__PURE__ */ getIsIOS();\nfunction getIsIOS() {\n var _a;\n return isClient && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.userAgent) && /* @__PURE__ */ /iP(ad|hone|od)/.test(window.navigator.userAgent);\n}\n\nfunction createFilterWrapper(filter, fn) {\n function wrapper(...args) {\n return new Promise((resolve, reject) => {\n Promise.resolve(filter(() => fn.apply(this, args), { fn, thisArg: this, args })).then(resolve).catch(reject);\n });\n }\n return wrapper;\n}\nconst bypassFilter = (invoke) => {\n return invoke();\n};\nfunction debounceFilter(ms, options = {}) {\n let timer;\n let maxTimer;\n let lastRejector = noop;\n const _clearTimeout = (timer2) => {\n clearTimeout(timer2);\n lastRejector();\n lastRejector = noop;\n };\n const filter = (invoke) => {\n const duration = toValue(ms);\n const maxDuration = toValue(options.maxWait);\n if (timer)\n _clearTimeout(timer);\n if (duration <= 0 || maxDuration !== void 0 && maxDuration <= 0) {\n if (maxTimer) {\n _clearTimeout(maxTimer);\n maxTimer = null;\n }\n return Promise.resolve(invoke());\n }\n return new Promise((resolve, reject) => {\n lastRejector = options.rejectOnCancel ? reject : resolve;\n if (maxDuration && !maxTimer) {\n maxTimer = setTimeout(() => {\n if (timer)\n _clearTimeout(timer);\n maxTimer = null;\n resolve(invoke());\n }, maxDuration);\n }\n timer = setTimeout(() => {\n if (maxTimer)\n _clearTimeout(maxTimer);\n maxTimer = null;\n resolve(invoke());\n }, duration);\n });\n };\n return filter;\n}\nfunction throttleFilter(ms, trailing = true, leading = true, rejectOnCancel = false) {\n let lastExec = 0;\n let timer;\n let isLeading = true;\n let lastRejector = noop;\n let lastValue;\n const clear = () => {\n if (timer) {\n clearTimeout(timer);\n timer = void 0;\n lastRejector();\n lastRejector = noop;\n }\n };\n const filter = (_invoke) => {\n const duration = toValue(ms);\n const elapsed = Date.now() - lastExec;\n const invoke = () => {\n return lastValue = _invoke();\n };\n clear();\n if (duration <= 0) {\n lastExec = Date.now();\n return invoke();\n }\n if (elapsed > duration && (leading || !isLeading)) {\n lastExec = Date.now();\n invoke();\n } else if (trailing) {\n lastValue = new Promise((resolve, reject) => {\n lastRejector = rejectOnCancel ? reject : resolve;\n timer = setTimeout(() => {\n lastExec = Date.now();\n isLeading = true;\n resolve(invoke());\n clear();\n }, Math.max(0, duration - elapsed));\n });\n }\n if (!leading && !timer)\n timer = setTimeout(() => isLeading = true, duration);\n isLeading = false;\n return lastValue;\n };\n return filter;\n}\nfunction pausableFilter(extendFilter = bypassFilter) {\n const isActive = ref(true);\n function pause() {\n isActive.value = false;\n }\n function resume() {\n isActive.value = true;\n }\n const eventFilter = (...args) => {\n if (isActive.value)\n extendFilter(...args);\n };\n return { isActive: readonly(isActive), pause, resume, eventFilter };\n}\n\nconst directiveHooks = {\n mounted: isVue3 ? \"mounted\" : \"inserted\",\n updated: isVue3 ? \"updated\" : \"componentUpdated\",\n unmounted: isVue3 ? \"unmounted\" : \"unbind\"\n};\n\nfunction cacheStringFunction(fn) {\n const cache = /* @__PURE__ */ Object.create(null);\n return (str) => {\n const hit = cache[str];\n return hit || (cache[str] = fn(str));\n };\n}\nconst hyphenateRE = /\\B([A-Z])/g;\nconst hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, \"-$1\").toLowerCase());\nconst camelizeRE = /-(\\w)/g;\nconst camelize = cacheStringFunction((str) => {\n return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : \"\");\n});\n\nfunction promiseTimeout(ms, throwOnTimeout = false, reason = \"Timeout\") {\n return new Promise((resolve, reject) => {\n if (throwOnTimeout)\n setTimeout(() => reject(reason), ms);\n else\n setTimeout(resolve, ms);\n });\n}\nfunction identity(arg) {\n return arg;\n}\nfunction createSingletonPromise(fn) {\n let _promise;\n function wrapper() {\n if (!_promise)\n _promise = fn();\n return _promise;\n }\n wrapper.reset = async () => {\n const _prev = _promise;\n _promise = void 0;\n if (_prev)\n await _prev;\n };\n return wrapper;\n}\nfunction invoke(fn) {\n return fn();\n}\nfunction containsProp(obj, ...props) {\n return props.some((k) => k in obj);\n}\nfunction increaseWithUnit(target, delta) {\n var _a;\n if (typeof target === \"number\")\n return target + delta;\n const value = ((_a = target.match(/^-?[0-9]+\\.?[0-9]*/)) == null ? void 0 : _a[0]) || \"\";\n const unit = target.slice(value.length);\n const result = Number.parseFloat(value) + delta;\n if (Number.isNaN(result))\n return target;\n return result + unit;\n}\nfunction objectPick(obj, keys, omitUndefined = false) {\n return keys.reduce((n, k) => {\n if (k in obj) {\n if (!omitUndefined || obj[k] !== void 0)\n n[k] = obj[k];\n }\n return n;\n }, {});\n}\nfunction objectOmit(obj, keys, omitUndefined = false) {\n return Object.fromEntries(Object.entries(obj).filter(([key, value]) => {\n return (!omitUndefined || value !== void 0) && !keys.includes(key);\n }));\n}\nfunction objectEntries(obj) {\n return Object.entries(obj);\n}\n\nfunction toRef(...args) {\n if (args.length !== 1)\n return toRef$1(...args);\n const r = args[0];\n return typeof r === \"function\" ? readonly(customRef(() => ({ get: r, set: noop }))) : ref(r);\n}\nconst resolveRef = toRef;\n\nfunction reactivePick(obj, ...keys) {\n const flatKeys = keys.flat();\n const predicate = flatKeys[0];\n return reactiveComputed(() => typeof predicate === \"function\" ? Object.fromEntries(Object.entries(toRefs$1(obj)).filter(([k, v]) => predicate(toValue(v), k))) : Object.fromEntries(flatKeys.map((k) => [k, toRef(obj, k)])));\n}\n\nfunction refAutoReset(defaultValue, afterMs = 1e4) {\n return customRef((track, trigger) => {\n let value = toValue(defaultValue);\n let timer;\n const resetAfter = () => setTimeout(() => {\n value = toValue(defaultValue);\n trigger();\n }, toValue(afterMs));\n tryOnScopeDispose(() => {\n clearTimeout(timer);\n });\n return {\n get() {\n track();\n return value;\n },\n set(newValue) {\n value = newValue;\n trigger();\n clearTimeout(timer);\n timer = resetAfter();\n }\n };\n });\n}\n\nfunction useDebounceFn(fn, ms = 200, options = {}) {\n return createFilterWrapper(\n debounceFilter(ms, options),\n fn\n );\n}\n\nfunction refDebounced(value, ms = 200, options = {}) {\n const debounced = ref(value.value);\n const updater = useDebounceFn(() => {\n debounced.value = value.value;\n }, ms, options);\n watch(value, () => updater());\n return debounced;\n}\n\nfunction refDefault(source, defaultValue) {\n return computed({\n get() {\n var _a;\n return (_a = source.value) != null ? _a : defaultValue;\n },\n set(value) {\n source.value = value;\n }\n });\n}\n\nfunction useThrottleFn(fn, ms = 200, trailing = false, leading = true, rejectOnCancel = false) {\n return createFilterWrapper(\n throttleFilter(ms, trailing, leading, rejectOnCancel),\n fn\n );\n}\n\nfunction refThrottled(value, delay = 200, trailing = true, leading = true) {\n if (delay <= 0)\n return value;\n const throttled = ref(value.value);\n const updater = useThrottleFn(() => {\n throttled.value = value.value;\n }, delay, trailing, leading);\n watch(value, () => updater());\n return throttled;\n}\n\nfunction refWithControl(initial, options = {}) {\n let source = initial;\n let track;\n let trigger;\n const ref = customRef((_track, _trigger) => {\n track = _track;\n trigger = _trigger;\n return {\n get() {\n return get();\n },\n set(v) {\n set(v);\n }\n };\n });\n function get(tracking = true) {\n if (tracking)\n track();\n return source;\n }\n function set(value, triggering = true) {\n var _a, _b;\n if (value === source)\n return;\n const old = source;\n if (((_a = options.onBeforeChange) == null ? void 0 : _a.call(options, value, old)) === false)\n return;\n source = value;\n (_b = options.onChanged) == null ? void 0 : _b.call(options, value, old);\n if (triggering)\n trigger();\n }\n const untrackedGet = () => get(false);\n const silentSet = (v) => set(v, false);\n const peek = () => get(false);\n const lay = (v) => set(v, false);\n return extendRef(\n ref,\n {\n get,\n set,\n untrackedGet,\n silentSet,\n peek,\n lay\n },\n { enumerable: true }\n );\n}\nconst controlledRef = refWithControl;\n\nfunction set(...args) {\n if (args.length === 2) {\n const [ref, value] = args;\n ref.value = value;\n }\n if (args.length === 3) {\n if (isVue2) {\n set$1(...args);\n } else {\n const [target, key, value] = args;\n target[key] = value;\n }\n }\n}\n\nfunction watchWithFilter(source, cb, options = {}) {\n const {\n eventFilter = bypassFilter,\n ...watchOptions\n } = options;\n return watch(\n source,\n createFilterWrapper(\n eventFilter,\n cb\n ),\n watchOptions\n );\n}\n\nfunction watchPausable(source, cb, options = {}) {\n const {\n eventFilter: filter,\n ...watchOptions\n } = options;\n const { eventFilter, pause, resume, isActive } = pausableFilter(filter);\n const stop = watchWithFilter(\n source,\n cb,\n {\n ...watchOptions,\n eventFilter\n }\n );\n return { stop, pause, resume, isActive };\n}\n\nfunction syncRef(left, right, ...[options]) {\n const {\n flush = \"sync\",\n deep = false,\n immediate = true,\n direction = \"both\",\n transform = {}\n } = options || {};\n const watchers = [];\n const transformLTR = \"ltr\" in transform && transform.ltr || ((v) => v);\n const transformRTL = \"rtl\" in transform && transform.rtl || ((v) => v);\n if (direction === \"both\" || direction === \"ltr\") {\n watchers.push(watchPausable(\n left,\n (newValue) => {\n watchers.forEach((w) => w.pause());\n right.value = transformLTR(newValue);\n watchers.forEach((w) => w.resume());\n },\n { flush, deep, immediate }\n ));\n }\n if (direction === \"both\" || direction === \"rtl\") {\n watchers.push(watchPausable(\n right,\n (newValue) => {\n watchers.forEach((w) => w.pause());\n left.value = transformRTL(newValue);\n watchers.forEach((w) => w.resume());\n },\n { flush, deep, immediate }\n ));\n }\n const stop = () => {\n watchers.forEach((w) => w.stop());\n };\n return stop;\n}\n\nfunction syncRefs(source, targets, options = {}) {\n const {\n flush = \"sync\",\n deep = false,\n immediate = true\n } = options;\n if (!Array.isArray(targets))\n targets = [targets];\n return watch(\n source,\n (newValue) => targets.forEach((target) => target.value = newValue),\n { flush, deep, immediate }\n );\n}\n\nfunction toRefs(objectRef, options = {}) {\n if (!isRef(objectRef))\n return toRefs$1(objectRef);\n const result = Array.isArray(objectRef.value) ? Array.from({ length: objectRef.value.length }) : {};\n for (const key in objectRef.value) {\n result[key] = customRef(() => ({\n get() {\n return objectRef.value[key];\n },\n set(v) {\n var _a;\n const replaceRef = (_a = toValue(options.replaceRef)) != null ? _a : true;\n if (replaceRef) {\n if (Array.isArray(objectRef.value)) {\n const copy = [...objectRef.value];\n copy[key] = v;\n objectRef.value = copy;\n } else {\n const newObject = { ...objectRef.value, [key]: v };\n Object.setPrototypeOf(newObject, Object.getPrototypeOf(objectRef.value));\n objectRef.value = newObject;\n }\n } else {\n objectRef.value[key] = v;\n }\n }\n }));\n }\n return result;\n}\n\nfunction tryOnBeforeMount(fn, sync = true) {\n if (getCurrentInstance())\n onBeforeMount(fn);\n else if (sync)\n fn();\n else\n nextTick(fn);\n}\n\nfunction tryOnBeforeUnmount(fn) {\n if (getCurrentInstance())\n onBeforeUnmount(fn);\n}\n\nfunction tryOnMounted(fn, sync = true) {\n if (getCurrentInstance())\n onMounted(fn);\n else if (sync)\n fn();\n else\n nextTick(fn);\n}\n\nfunction tryOnUnmounted(fn) {\n if (getCurrentInstance())\n onUnmounted(fn);\n}\n\nfunction createUntil(r, isNot = false) {\n function toMatch(condition, { flush = \"sync\", deep = false, timeout, throwOnTimeout } = {}) {\n let stop = null;\n const watcher = new Promise((resolve) => {\n stop = watch(\n r,\n (v) => {\n if (condition(v) !== isNot) {\n stop == null ? void 0 : stop();\n resolve(v);\n }\n },\n {\n flush,\n deep,\n immediate: true\n }\n );\n });\n const promises = [watcher];\n if (timeout != null) {\n promises.push(\n promiseTimeout(timeout, throwOnTimeout).then(() => toValue(r)).finally(() => stop == null ? void 0 : stop())\n );\n }\n return Promise.race(promises);\n }\n function toBe(value, options) {\n if (!isRef(value))\n return toMatch((v) => v === value, options);\n const { flush = \"sync\", deep = false, timeout, throwOnTimeout } = options != null ? options : {};\n let stop = null;\n const watcher = new Promise((resolve) => {\n stop = watch(\n [r, value],\n ([v1, v2]) => {\n if (isNot !== (v1 === v2)) {\n stop == null ? void 0 : stop();\n resolve(v1);\n }\n },\n {\n flush,\n deep,\n immediate: true\n }\n );\n });\n const promises = [watcher];\n if (timeout != null) {\n promises.push(\n promiseTimeout(timeout, throwOnTimeout).then(() => toValue(r)).finally(() => {\n stop == null ? void 0 : stop();\n return toValue(r);\n })\n );\n }\n return Promise.race(promises);\n }\n function toBeTruthy(options) {\n return toMatch((v) => Boolean(v), options);\n }\n function toBeNull(options) {\n return toBe(null, options);\n }\n function toBeUndefined(options) {\n return toBe(void 0, options);\n }\n function toBeNaN(options) {\n return toMatch(Number.isNaN, options);\n }\n function toContains(value, options) {\n return toMatch((v) => {\n const array = Array.from(v);\n return array.includes(value) || array.includes(toValue(value));\n }, options);\n }\n function changed(options) {\n return changedTimes(1, options);\n }\n function changedTimes(n = 1, options) {\n let count = -1;\n return toMatch(() => {\n count += 1;\n return count >= n;\n }, options);\n }\n if (Array.isArray(toValue(r))) {\n const instance = {\n toMatch,\n toContains,\n changed,\n changedTimes,\n get not() {\n return createUntil(r, !isNot);\n }\n };\n return instance;\n } else {\n const instance = {\n toMatch,\n toBe,\n toBeTruthy,\n toBeNull,\n toBeNaN,\n toBeUndefined,\n changed,\n changedTimes,\n get not() {\n return createUntil(r, !isNot);\n }\n };\n return instance;\n }\n}\nfunction until(r) {\n return createUntil(r);\n}\n\nfunction defaultComparator(value, othVal) {\n return value === othVal;\n}\nfunction useArrayDifference(...args) {\n var _a;\n const list = args[0];\n const values = args[1];\n let compareFn = (_a = args[2]) != null ? _a : defaultComparator;\n if (typeof compareFn === \"string\") {\n const key = compareFn;\n compareFn = (value, othVal) => value[key] === othVal[key];\n }\n return computed(() => toValue(list).filter((x) => toValue(values).findIndex((y) => compareFn(x, y)) === -1));\n}\n\nfunction useArrayEvery(list, fn) {\n return computed(() => toValue(list).every((element, index, array) => fn(toValue(element), index, array)));\n}\n\nfunction useArrayFilter(list, fn) {\n return computed(() => toValue(list).map((i) => toValue(i)).filter(fn));\n}\n\nfunction useArrayFind(list, fn) {\n return computed(() => toValue(\n toValue(list).find((element, index, array) => fn(toValue(element), index, array))\n ));\n}\n\nfunction useArrayFindIndex(list, fn) {\n return computed(() => toValue(list).findIndex((element, index, array) => fn(toValue(element), index, array)));\n}\n\nfunction findLast(arr, cb) {\n let index = arr.length;\n while (index-- > 0) {\n if (cb(arr[index], index, arr))\n return arr[index];\n }\n return void 0;\n}\nfunction useArrayFindLast(list, fn) {\n return computed(() => toValue(\n !Array.prototype.findLast ? findLast(toValue(list), (element, index, array) => fn(toValue(element), index, array)) : toValue(list).findLast((element, index, array) => fn(toValue(element), index, array))\n ));\n}\n\nfunction isArrayIncludesOptions(obj) {\n return isObject(obj) && containsProp(obj, \"formIndex\", \"comparator\");\n}\nfunction useArrayIncludes(...args) {\n var _a;\n const list = args[0];\n const value = args[1];\n let comparator = args[2];\n let formIndex = 0;\n if (isArrayIncludesOptions(comparator)) {\n formIndex = (_a = comparator.fromIndex) != null ? _a : 0;\n comparator = comparator.comparator;\n }\n if (typeof comparator === \"string\") {\n const key = comparator;\n comparator = (element, value2) => element[key] === toValue(value2);\n }\n comparator = comparator != null ? comparator : (element, value2) => element === toValue(value2);\n return computed(() => toValue(list).slice(formIndex).some((element, index, array) => comparator(\n toValue(element),\n toValue(value),\n index,\n toValue(array)\n )));\n}\n\nfunction useArrayJoin(list, separator) {\n return computed(() => toValue(list).map((i) => toValue(i)).join(toValue(separator)));\n}\n\nfunction useArrayMap(list, fn) {\n return computed(() => toValue(list).map((i) => toValue(i)).map(fn));\n}\n\nfunction useArrayReduce(list, reducer, ...args) {\n const reduceCallback = (sum, value, index) => reducer(toValue(sum), toValue(value), index);\n return computed(() => {\n const resolved = toValue(list);\n return args.length ? resolved.reduce(reduceCallback, toValue(args[0])) : resolved.reduce(reduceCallback);\n });\n}\n\nfunction useArraySome(list, fn) {\n return computed(() => toValue(list).some((element, index, array) => fn(toValue(element), index, array)));\n}\n\nfunction uniq(array) {\n return Array.from(new Set(array));\n}\nfunction uniqueElementsBy(array, fn) {\n return array.reduce((acc, v) => {\n if (!acc.some((x) => fn(v, x, array)))\n acc.push(v);\n return acc;\n }, []);\n}\nfunction useArrayUnique(list, compareFn) {\n return computed(() => {\n const resolvedList = toValue(list).map((element) => toValue(element));\n return compareFn ? uniqueElementsBy(resolvedList, compareFn) : uniq(resolvedList);\n });\n}\n\nfunction useCounter(initialValue = 0, options = {}) {\n let _initialValue = unref(initialValue);\n const count = ref(initialValue);\n const {\n max = Number.POSITIVE_INFINITY,\n min = Number.NEGATIVE_INFINITY\n } = options;\n const inc = (delta = 1) => count.value = Math.min(max, count.value + delta);\n const dec = (delta = 1) => count.value = Math.max(min, count.value - delta);\n const get = () => count.value;\n const set = (val) => count.value = Math.max(min, Math.min(max, val));\n const reset = (val = _initialValue) => {\n _initialValue = val;\n return set(val);\n };\n return { count, inc, dec, get, set, reset };\n}\n\nconst REGEX_PARSE = /^(\\d{4})[-/]?(\\d{1,2})?[-/]?(\\d{0,2})[Tt\\s]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?[.:]?(\\d+)?$/;\nconst REGEX_FORMAT = /[YMDHhms]o|\\[([^\\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a{1,2}|A{1,2}|m{1,2}|s{1,2}|Z{1,2}|SSS/g;\nfunction defaultMeridiem(hours, minutes, isLowercase, hasPeriod) {\n let m = hours < 12 ? \"AM\" : \"PM\";\n if (hasPeriod)\n m = m.split(\"\").reduce((acc, curr) => acc += `${curr}.`, \"\");\n return isLowercase ? m.toLowerCase() : m;\n}\nfunction formatOrdinal(num) {\n const suffixes = [\"th\", \"st\", \"nd\", \"rd\"];\n const v = num % 100;\n return num + (suffixes[(v - 20) % 10] || suffixes[v] || suffixes[0]);\n}\nfunction formatDate(date, formatStr, options = {}) {\n var _a;\n const years = date.getFullYear();\n const month = date.getMonth();\n const days = date.getDate();\n const hours = date.getHours();\n const minutes = date.getMinutes();\n const seconds = date.getSeconds();\n const milliseconds = date.getMilliseconds();\n const day = date.getDay();\n const meridiem = (_a = options.customMeridiem) != null ? _a : defaultMeridiem;\n const matches = {\n Yo: () => formatOrdinal(years),\n YY: () => String(years).slice(-2),\n YYYY: () => years,\n M: () => month + 1,\n Mo: () => formatOrdinal(month + 1),\n MM: () => `${month + 1}`.padStart(2, \"0\"),\n MMM: () => date.toLocaleDateString(options.locales, { month: \"short\" }),\n MMMM: () => date.toLocaleDateString(options.locales, { month: \"long\" }),\n D: () => String(days),\n Do: () => formatOrdinal(days),\n DD: () => `${days}`.padStart(2, \"0\"),\n H: () => String(hours),\n Ho: () => formatOrdinal(hours),\n HH: () => `${hours}`.padStart(2, \"0\"),\n h: () => `${hours % 12 || 12}`.padStart(1, \"0\"),\n ho: () => formatOrdinal(hours % 12 || 12),\n hh: () => `${hours % 12 || 12}`.padStart(2, \"0\"),\n m: () => String(minutes),\n mo: () => formatOrdinal(minutes),\n mm: () => `${minutes}`.padStart(2, \"0\"),\n s: () => String(seconds),\n so: () => formatOrdinal(seconds),\n ss: () => `${seconds}`.padStart(2, \"0\"),\n SSS: () => `${milliseconds}`.padStart(3, \"0\"),\n d: () => day,\n dd: () => date.toLocaleDateString(options.locales, { weekday: \"narrow\" }),\n ddd: () => date.toLocaleDateString(options.locales, { weekday: \"short\" }),\n dddd: () => date.toLocaleDateString(options.locales, { weekday: \"long\" }),\n A: () => meridiem(hours, minutes),\n AA: () => meridiem(hours, minutes, false, true),\n a: () => meridiem(hours, minutes, true),\n aa: () => meridiem(hours, minutes, true, true)\n };\n return formatStr.replace(REGEX_FORMAT, (match, $1) => {\n var _a2, _b;\n return (_b = $1 != null ? $1 : (_a2 = matches[match]) == null ? void 0 : _a2.call(matches)) != null ? _b : match;\n });\n}\nfunction normalizeDate(date) {\n if (date === null)\n return new Date(Number.NaN);\n if (date === void 0)\n return /* @__PURE__ */ new Date();\n if (date instanceof Date)\n return new Date(date);\n if (typeof date === \"string\" && !/Z$/i.test(date)) {\n const d = date.match(REGEX_PARSE);\n if (d) {\n const m = d[2] - 1 || 0;\n const ms = (d[7] || \"0\").substring(0, 3);\n return new Date(d[1], m, d[3] || 1, d[4] || 0, d[5] || 0, d[6] || 0, ms);\n }\n }\n return new Date(date);\n}\nfunction useDateFormat(date, formatStr = \"HH:mm:ss\", options = {}) {\n return computed(() => formatDate(normalizeDate(toValue(date)), toValue(formatStr), options));\n}\n\nfunction useIntervalFn(cb, interval = 1e3, options = {}) {\n const {\n immediate = true,\n immediateCallback = false\n } = options;\n let timer = null;\n const isActive = ref(false);\n function clean() {\n if (timer) {\n clearInterval(timer);\n timer = null;\n }\n }\n function pause() {\n isActive.value = false;\n clean();\n }\n function resume() {\n const intervalValue = toValue(interval);\n if (intervalValue <= 0)\n return;\n isActive.value = true;\n if (immediateCallback)\n cb();\n clean();\n timer = setInterval(cb, intervalValue);\n }\n if (immediate && isClient)\n resume();\n if (isRef(interval) || typeof interval === \"function\") {\n const stopWatch = watch(interval, () => {\n if (isActive.value && isClient)\n resume();\n });\n tryOnScopeDispose(stopWatch);\n }\n tryOnScopeDispose(pause);\n return {\n isActive,\n pause,\n resume\n };\n}\n\nfunction useInterval(interval = 1e3, options = {}) {\n const {\n controls: exposeControls = false,\n immediate = true,\n callback\n } = options;\n const counter = ref(0);\n const update = () => counter.value += 1;\n const reset = () => {\n counter.value = 0;\n };\n const controls = useIntervalFn(\n callback ? () => {\n update();\n callback(counter.value);\n } : update,\n interval,\n { immediate }\n );\n if (exposeControls) {\n return {\n counter,\n reset,\n ...controls\n };\n } else {\n return counter;\n }\n}\n\nfunction useLastChanged(source, options = {}) {\n var _a;\n const ms = ref((_a = options.initialValue) != null ? _a : null);\n watch(\n source,\n () => ms.value = timestamp(),\n options\n );\n return ms;\n}\n\nfunction useTimeoutFn(cb, interval, options = {}) {\n const {\n immediate = true\n } = options;\n const isPending = ref(false);\n let timer = null;\n function clear() {\n if (timer) {\n clearTimeout(timer);\n timer = null;\n }\n }\n function stop() {\n isPending.value = false;\n clear();\n }\n function start(...args) {\n clear();\n isPending.value = true;\n timer = setTimeout(() => {\n isPending.value = false;\n timer = null;\n cb(...args);\n }, toValue(interval));\n }\n if (immediate) {\n isPending.value = true;\n if (isClient)\n start();\n }\n tryOnScopeDispose(stop);\n return {\n isPending: readonly(isPending),\n start,\n stop\n };\n}\n\nfunction useTimeout(interval = 1e3, options = {}) {\n const {\n controls: exposeControls = false,\n callback\n } = options;\n const controls = useTimeoutFn(\n callback != null ? callback : noop,\n interval,\n options\n );\n const ready = computed(() => !controls.isPending.value);\n if (exposeControls) {\n return {\n ready,\n ...controls\n };\n } else {\n return ready;\n }\n}\n\nfunction useToNumber(value, options = {}) {\n const {\n method = \"parseFloat\",\n radix,\n nanToZero\n } = options;\n return computed(() => {\n let resolved = toValue(value);\n if (typeof resolved === \"string\")\n resolved = Number[method](resolved, radix);\n if (nanToZero && Number.isNaN(resolved))\n resolved = 0;\n return resolved;\n });\n}\n\nfunction useToString(value) {\n return computed(() => `${toValue(value)}`);\n}\n\nfunction useToggle(initialValue = false, options = {}) {\n const {\n truthyValue = true,\n falsyValue = false\n } = options;\n const valueIsRef = isRef(initialValue);\n const _value = ref(initialValue);\n function toggle(value) {\n if (arguments.length) {\n _value.value = value;\n return _value.value;\n } else {\n const truthy = toValue(truthyValue);\n _value.value = _value.value === truthy ? toValue(falsyValue) : truthy;\n return _value.value;\n }\n }\n if (valueIsRef)\n return toggle;\n else\n return [_value, toggle];\n}\n\nfunction watchArray(source, cb, options) {\n let oldList = (options == null ? void 0 : options.immediate) ? [] : [...source instanceof Function ? source() : Array.isArray(source) ? source : toValue(source)];\n return watch(source, (newList, _, onCleanup) => {\n const oldListRemains = Array.from({ length: oldList.length });\n const added = [];\n for (const obj of newList) {\n let found = false;\n for (let i = 0; i < oldList.length; i++) {\n if (!oldListRemains[i] && obj === oldList[i]) {\n oldListRemains[i] = true;\n found = true;\n break;\n }\n }\n if (!found)\n added.push(obj);\n }\n const removed = oldList.filter((_2, i) => !oldListRemains[i]);\n cb(newList, oldList, added, removed, onCleanup);\n oldList = [...newList];\n }, options);\n}\n\nfunction watchAtMost(source, cb, options) {\n const {\n count,\n ...watchOptions\n } = options;\n const current = ref(0);\n const stop = watchWithFilter(\n source,\n (...args) => {\n current.value += 1;\n if (current.value >= toValue(count))\n nextTick(() => stop());\n cb(...args);\n },\n watchOptions\n );\n return { count: current, stop };\n}\n\nfunction watchDebounced(source, cb, options = {}) {\n const {\n debounce = 0,\n maxWait = void 0,\n ...watchOptions\n } = options;\n return watchWithFilter(\n source,\n cb,\n {\n ...watchOptions,\n eventFilter: debounceFilter(debounce, { maxWait })\n }\n );\n}\n\nfunction watchDeep(source, cb, options) {\n return watch(\n source,\n cb,\n {\n ...options,\n deep: true\n }\n );\n}\n\nfunction watchIgnorable(source, cb, options = {}) {\n const {\n eventFilter = bypassFilter,\n ...watchOptions\n } = options;\n const filteredCb = createFilterWrapper(\n eventFilter,\n cb\n );\n let ignoreUpdates;\n let ignorePrevAsyncUpdates;\n let stop;\n if (watchOptions.flush === \"sync\") {\n const ignore = ref(false);\n ignorePrevAsyncUpdates = () => {\n };\n ignoreUpdates = (updater) => {\n ignore.value = true;\n updater();\n ignore.value = false;\n };\n stop = watch(\n source,\n (...args) => {\n if (!ignore.value)\n filteredCb(...args);\n },\n watchOptions\n );\n } else {\n const disposables = [];\n const ignoreCounter = ref(0);\n const syncCounter = ref(0);\n ignorePrevAsyncUpdates = () => {\n ignoreCounter.value = syncCounter.value;\n };\n disposables.push(\n watch(\n source,\n () => {\n syncCounter.value++;\n },\n { ...watchOptions, flush: \"sync\" }\n )\n );\n ignoreUpdates = (updater) => {\n const syncCounterPrev = syncCounter.value;\n updater();\n ignoreCounter.value += syncCounter.value - syncCounterPrev;\n };\n disposables.push(\n watch(\n source,\n (...args) => {\n const ignore = ignoreCounter.value > 0 && ignoreCounter.value === syncCounter.value;\n ignoreCounter.value = 0;\n syncCounter.value = 0;\n if (ignore)\n return;\n filteredCb(...args);\n },\n watchOptions\n )\n );\n stop = () => {\n disposables.forEach((fn) => fn());\n };\n }\n return { stop, ignoreUpdates, ignorePrevAsyncUpdates };\n}\n\nfunction watchImmediate(source, cb, options) {\n return watch(\n source,\n cb,\n {\n ...options,\n immediate: true\n }\n );\n}\n\nfunction watchOnce(source, cb, options) {\n const stop = watch(source, (...args) => {\n nextTick(() => stop());\n return cb(...args);\n }, options);\n return stop;\n}\n\nfunction watchThrottled(source, cb, options = {}) {\n const {\n throttle = 0,\n trailing = true,\n leading = true,\n ...watchOptions\n } = options;\n return watchWithFilter(\n source,\n cb,\n {\n ...watchOptions,\n eventFilter: throttleFilter(throttle, trailing, leading)\n }\n );\n}\n\nfunction watchTriggerable(source, cb, options = {}) {\n let cleanupFn;\n function onEffect() {\n if (!cleanupFn)\n return;\n const fn = cleanupFn;\n cleanupFn = void 0;\n fn();\n }\n function onCleanup(callback) {\n cleanupFn = callback;\n }\n const _cb = (value, oldValue) => {\n onEffect();\n return cb(value, oldValue, onCleanup);\n };\n const res = watchIgnorable(source, _cb, options);\n const { ignoreUpdates } = res;\n const trigger = () => {\n let res2;\n ignoreUpdates(() => {\n res2 = _cb(getWatchSources(source), getOldValue(source));\n });\n return res2;\n };\n return {\n ...res,\n trigger\n };\n}\nfunction getWatchSources(sources) {\n if (isReactive(sources))\n return sources;\n if (Array.isArray(sources))\n return sources.map((item) => toValue(item));\n return toValue(sources);\n}\nfunction getOldValue(source) {\n return Array.isArray(source) ? source.map(() => void 0) : void 0;\n}\n\nfunction whenever(source, cb, options) {\n return watch(\n source,\n (v, ov, onInvalidate) => {\n if (v)\n cb(v, ov, onInvalidate);\n },\n options\n );\n}\n\nexport { assert, refAutoReset as autoResetRef, bypassFilter, camelize, clamp, computedEager, computedWithControl, containsProp, computedWithControl as controlledComputed, controlledRef, createEventHook, createFilterWrapper, createGlobalState, createInjectionState, reactify as createReactiveFn, createSharedComposable, createSingletonPromise, debounceFilter, refDebounced as debouncedRef, watchDebounced as debouncedWatch, directiveHooks, computedEager as eagerComputed, extendRef, formatDate, get, hasOwn, hyphenate, identity, watchIgnorable as ignorableWatch, increaseWithUnit, injectLocal, invoke, isClient, isDef, isDefined, isIOS, isObject, isWorker, makeDestructurable, noop, normalizeDate, notNullish, now, objectEntries, objectOmit, objectPick, pausableFilter, watchPausable as pausableWatch, promiseTimeout, provideLocal, rand, reactify, reactifyObject, reactiveComputed, reactiveOmit, reactivePick, refAutoReset, refDebounced, refDefault, refThrottled, refWithControl, resolveRef, resolveUnref, set, syncRef, syncRefs, throttleFilter, refThrottled as throttledRef, watchThrottled as throttledWatch, timestamp, toReactive, toRef, toRefs, toValue, tryOnBeforeMount, tryOnBeforeUnmount, tryOnMounted, tryOnScopeDispose, tryOnUnmounted, until, useArrayDifference, useArrayEvery, useArrayFilter, useArrayFind, useArrayFindIndex, useArrayFindLast, useArrayIncludes, useArrayJoin, useArrayMap, useArrayReduce, useArraySome, useArrayUnique, useCounter, useDateFormat, refDebounced as useDebounce, useDebounceFn, useInterval, useIntervalFn, useLastChanged, refThrottled as useThrottle, useThrottleFn, useTimeout, useTimeoutFn, useToNumber, useToString, useToggle, watchArray, watchAtMost, watchDebounced, watchDeep, watchIgnorable, watchImmediate, watchOnce, watchPausable, watchThrottled, watchTriggerable, watchWithFilter, whenever };\n","import { noop, makeDestructurable, camelize, toValue, isClient, isObject, tryOnScopeDispose, isIOS, tryOnMounted, computedWithControl, objectOmit, promiseTimeout, until, increaseWithUnit, objectEntries, createSingletonPromise, useTimeoutFn, pausableWatch, toRef, createEventHook, timestamp, pausableFilter, watchIgnorable, debounceFilter, createFilterWrapper, bypassFilter, toRefs, useIntervalFn, notNullish, containsProp, hasOwn, throttleFilter, useDebounceFn, useThrottleFn, clamp, syncRef, objectPick, tryOnUnmounted, watchWithFilter, identity, isDef, isWorker } from '@vueuse/shared';\nexport * from '@vueuse/shared';\nimport { isRef, ref, shallowRef, watchEffect, computed, inject, isVue3, version, defineComponent, h, TransitionGroup, shallowReactive, Fragment, watch, getCurrentInstance, customRef, onUpdated, onMounted, readonly, nextTick, reactive, markRaw, unref, getCurrentScope, isVue2, set, del, isReadonly, onBeforeUpdate } from 'vue-demi';\nimport { useEventListener as useEventListener$1 } from '@vueuse/core';\n\nfunction computedAsync(evaluationCallback, initialState, optionsOrRef) {\n let options;\n if (isRef(optionsOrRef)) {\n options = {\n evaluating: optionsOrRef\n };\n } else {\n options = optionsOrRef || {};\n }\n const {\n lazy = false,\n evaluating = void 0,\n shallow = true,\n onError = noop\n } = options;\n const started = ref(!lazy);\n const current = shallow ? shallowRef(initialState) : ref(initialState);\n let counter = 0;\n watchEffect(async (onInvalidate) => {\n if (!started.value)\n return;\n counter++;\n const counterAtBeginning = counter;\n let hasFinished = false;\n if (evaluating) {\n Promise.resolve().then(() => {\n evaluating.value = true;\n });\n }\n try {\n const result = await evaluationCallback((cancelCallback) => {\n onInvalidate(() => {\n if (evaluating)\n evaluating.value = false;\n if (!hasFinished)\n cancelCallback();\n });\n });\n if (counterAtBeginning === counter)\n current.value = result;\n } catch (e) {\n onError(e);\n } finally {\n if (evaluating && counterAtBeginning === counter)\n evaluating.value = false;\n hasFinished = true;\n }\n });\n if (lazy) {\n return computed(() => {\n started.value = true;\n return current.value;\n });\n } else {\n return current;\n }\n}\n\nfunction computedInject(key, options, defaultSource, treatDefaultAsFactory) {\n let source = inject(key);\n if (defaultSource)\n source = inject(key, defaultSource);\n if (treatDefaultAsFactory)\n source = inject(key, defaultSource, treatDefaultAsFactory);\n if (typeof options === \"function\") {\n return computed((ctx) => options(source, ctx));\n } else {\n return computed({\n get: (ctx) => options.get(source, ctx),\n set: options.set\n });\n }\n}\n\nfunction createReusableTemplate(options = {}) {\n if (!isVue3 && !version.startsWith(\"2.7.\")) {\n if (process.env.NODE_ENV !== \"production\")\n throw new Error(\"[VueUse] createReusableTemplate only works in Vue 2.7 or above.\");\n return;\n }\n const {\n inheritAttrs = true\n } = options;\n const render = shallowRef();\n const define = /* #__PURE__ */ defineComponent({\n setup(_, { slots }) {\n return () => {\n render.value = slots.default;\n };\n }\n });\n const reuse = /* #__PURE__ */ defineComponent({\n inheritAttrs,\n setup(_, { attrs, slots }) {\n return () => {\n var _a;\n if (!render.value && process.env.NODE_ENV !== \"production\")\n throw new Error(\"[VueUse] Failed to find the definition of reusable template\");\n const vnode = (_a = render.value) == null ? void 0 : _a.call(render, { ...keysToCamelKebabCase(attrs), $slots: slots });\n return inheritAttrs && (vnode == null ? void 0 : vnode.length) === 1 ? vnode[0] : vnode;\n };\n }\n });\n return makeDestructurable(\n { define, reuse },\n [define, reuse]\n );\n}\nfunction keysToCamelKebabCase(obj) {\n const newObj = {};\n for (const key in obj)\n newObj[camelize(key)] = obj[key];\n return newObj;\n}\n\nfunction createTemplatePromise(options = {}) {\n if (!isVue3) {\n if (process.env.NODE_ENV !== \"production\")\n throw new Error(\"[VueUse] createTemplatePromise only works in Vue 3 or above.\");\n return;\n }\n let index = 0;\n const instances = ref([]);\n function create(...args) {\n const props = shallowReactive({\n key: index++,\n args,\n promise: void 0,\n resolve: () => {\n },\n reject: () => {\n },\n isResolving: false,\n options\n });\n instances.value.push(props);\n props.promise = new Promise((_resolve, _reject) => {\n props.resolve = (v) => {\n props.isResolving = true;\n return _resolve(v);\n };\n props.reject = _reject;\n }).finally(() => {\n props.promise = void 0;\n const index2 = instances.value.indexOf(props);\n if (index2 !== -1)\n instances.value.splice(index2, 1);\n });\n return props.promise;\n }\n function start(...args) {\n if (options.singleton && instances.value.length > 0)\n return instances.value[0].promise;\n return create(...args);\n }\n const component = /* #__PURE__ */ defineComponent((_, { slots }) => {\n const renderList = () => instances.value.map((props) => {\n var _a;\n return h(Fragment, { key: props.key }, (_a = slots.default) == null ? void 0 : _a.call(slots, props));\n });\n if (options.transition)\n return () => h(TransitionGroup, options.transition, renderList);\n return renderList;\n });\n component.start = start;\n return component;\n}\n\nfunction createUnrefFn(fn) {\n return function(...args) {\n return fn.apply(this, args.map((i) => toValue(i)));\n };\n}\n\nfunction unrefElement(elRef) {\n var _a;\n const plain = toValue(elRef);\n return (_a = plain == null ? void 0 : plain.$el) != null ? _a : plain;\n}\n\nconst defaultWindow = isClient ? window : void 0;\nconst defaultDocument = isClient ? window.document : void 0;\nconst defaultNavigator = isClient ? window.navigator : void 0;\nconst defaultLocation = isClient ? window.location : void 0;\n\nfunction useEventListener(...args) {\n let target;\n let events;\n let listeners;\n let options;\n if (typeof args[0] === \"string\" || Array.isArray(args[0])) {\n [events, listeners, options] = args;\n target = defaultWindow;\n } else {\n [target, events, listeners, options] = args;\n }\n if (!target)\n return noop;\n if (!Array.isArray(events))\n events = [events];\n if (!Array.isArray(listeners))\n listeners = [listeners];\n const cleanups = [];\n const cleanup = () => {\n cleanups.forEach((fn) => fn());\n cleanups.length = 0;\n };\n const register = (el, event, listener, options2) => {\n el.addEventListener(event, listener, options2);\n return () => el.removeEventListener(event, listener, options2);\n };\n const stopWatch = watch(\n () => [unrefElement(target), toValue(options)],\n ([el, options2]) => {\n cleanup();\n if (!el)\n return;\n const optionsClone = isObject(options2) ? { ...options2 } : options2;\n cleanups.push(\n ...events.flatMap((event) => {\n return listeners.map((listener) => register(el, event, listener, optionsClone));\n })\n );\n },\n { immediate: true, flush: \"post\" }\n );\n const stop = () => {\n stopWatch();\n cleanup();\n };\n tryOnScopeDispose(stop);\n return stop;\n}\n\nlet _iOSWorkaround = false;\nfunction onClickOutside(target, handler, options = {}) {\n const { window = defaultWindow, ignore = [], capture = true, detectIframe = false } = options;\n if (!window)\n return;\n if (isIOS && !_iOSWorkaround) {\n _iOSWorkaround = true;\n Array.from(window.document.body.children).forEach((el) => el.addEventListener(\"click\", noop));\n window.document.documentElement.addEventListener(\"click\", noop);\n }\n let shouldListen = true;\n const shouldIgnore = (event) => {\n return ignore.some((target2) => {\n if (typeof target2 === \"string\") {\n return Array.from(window.document.querySelectorAll(target2)).some((el) => el === event.target || event.composedPath().includes(el));\n } else {\n const el = unrefElement(target2);\n return el && (event.target === el || event.composedPath().includes(el));\n }\n });\n };\n const listener = (event) => {\n const el = unrefElement(target);\n if (!el || el === event.target || event.composedPath().includes(el))\n return;\n if (event.detail === 0)\n shouldListen = !shouldIgnore(event);\n if (!shouldListen) {\n shouldListen = true;\n return;\n }\n handler(event);\n };\n const cleanup = [\n useEventListener(window, \"click\", listener, { passive: true, capture }),\n useEventListener(window, \"pointerdown\", (e) => {\n const el = unrefElement(target);\n shouldListen = !shouldIgnore(e) && !!(el && !e.composedPath().includes(el));\n }, { passive: true }),\n detectIframe && useEventListener(window, \"blur\", (event) => {\n setTimeout(() => {\n var _a;\n const el = unrefElement(target);\n if (((_a = window.document.activeElement) == null ? void 0 : _a.tagName) === \"IFRAME\" && !(el == null ? void 0 : el.contains(window.document.activeElement)))\n handler(event);\n }, 0);\n })\n ].filter(Boolean);\n const stop = () => cleanup.forEach((fn) => fn());\n return stop;\n}\n\nfunction createKeyPredicate(keyFilter) {\n if (typeof keyFilter === \"function\")\n return keyFilter;\n else if (typeof keyFilter === \"string\")\n return (event) => event.key === keyFilter;\n else if (Array.isArray(keyFilter))\n return (event) => keyFilter.includes(event.key);\n return () => true;\n}\nfunction onKeyStroke(...args) {\n let key;\n let handler;\n let options = {};\n if (args.length === 3) {\n key = args[0];\n handler = args[1];\n options = args[2];\n } else if (args.length === 2) {\n if (typeof args[1] === \"object\") {\n key = true;\n handler = args[0];\n options = args[1];\n } else {\n key = args[0];\n handler = args[1];\n }\n } else {\n key = true;\n handler = args[0];\n }\n const {\n target = defaultWindow,\n eventName = \"keydown\",\n passive = false,\n dedupe = false\n } = options;\n const predicate = createKeyPredicate(key);\n const listener = (e) => {\n if (e.repeat && toValue(dedupe))\n return;\n if (predicate(e))\n handler(e);\n };\n return useEventListener(target, eventName, listener, passive);\n}\nfunction onKeyDown(key, handler, options = {}) {\n return onKeyStroke(key, handler, { ...options, eventName: \"keydown\" });\n}\nfunction onKeyPressed(key, handler, options = {}) {\n return onKeyStroke(key, handler, { ...options, eventName: \"keypress\" });\n}\nfunction onKeyUp(key, handler, options = {}) {\n return onKeyStroke(key, handler, { ...options, eventName: \"keyup\" });\n}\n\nconst DEFAULT_DELAY = 500;\nfunction onLongPress(target, handler, options) {\n var _a, _b;\n const elementRef = computed(() => unrefElement(target));\n let timeout;\n function clear() {\n if (timeout) {\n clearTimeout(timeout);\n timeout = void 0;\n }\n }\n function onDown(ev) {\n var _a2, _b2, _c, _d;\n if (((_a2 = options == null ? void 0 : options.modifiers) == null ? void 0 : _a2.self) && ev.target !== elementRef.value)\n return;\n clear();\n if ((_b2 = options == null ? void 0 : options.modifiers) == null ? void 0 : _b2.prevent)\n ev.preventDefault();\n if ((_c = options == null ? void 0 : options.modifiers) == null ? void 0 : _c.stop)\n ev.stopPropagation();\n timeout = setTimeout(\n () => handler(ev),\n (_d = options == null ? void 0 : options.delay) != null ? _d : DEFAULT_DELAY\n );\n }\n const listenerOptions = {\n capture: (_a = options == null ? void 0 : options.modifiers) == null ? void 0 : _a.capture,\n once: (_b = options == null ? void 0 : options.modifiers) == null ? void 0 : _b.once\n };\n const cleanup = [\n useEventListener(elementRef, \"pointerdown\", onDown, listenerOptions),\n useEventListener(elementRef, [\"pointerup\", \"pointerleave\"], clear, listenerOptions)\n ].filter(Boolean);\n const stop = () => cleanup.forEach((fn) => fn());\n return stop;\n}\n\nfunction isFocusedElementEditable() {\n const { activeElement, body } = document;\n if (!activeElement)\n return false;\n if (activeElement === body)\n return false;\n switch (activeElement.tagName) {\n case \"INPUT\":\n case \"TEXTAREA\":\n return true;\n }\n return activeElement.hasAttribute(\"contenteditable\");\n}\nfunction isTypedCharValid({\n keyCode,\n metaKey,\n ctrlKey,\n altKey\n}) {\n if (metaKey || ctrlKey || altKey)\n return false;\n if (keyCode >= 48 && keyCode <= 57)\n return true;\n if (keyCode >= 65 && keyCode <= 90)\n return true;\n if (keyCode >= 97 && keyCode <= 122)\n return true;\n return false;\n}\nfunction onStartTyping(callback, options = {}) {\n const { document: document2 = defaultDocument } = options;\n const keydown = (event) => {\n !isFocusedElementEditable() && isTypedCharValid(event) && callback(event);\n };\n if (document2)\n useEventListener(document2, \"keydown\", keydown, { passive: true });\n}\n\nfunction templateRef(key, initialValue = null) {\n const instance = getCurrentInstance();\n let _trigger = () => {\n };\n const element = customRef((track, trigger) => {\n _trigger = trigger;\n return {\n get() {\n var _a, _b;\n track();\n return (_b = (_a = instance == null ? void 0 : instance.proxy) == null ? void 0 : _a.$refs[key]) != null ? _b : initialValue;\n },\n set() {\n }\n };\n });\n tryOnMounted(_trigger);\n onUpdated(_trigger);\n return element;\n}\n\nfunction useActiveElement(options = {}) {\n var _a;\n const {\n window = defaultWindow,\n deep = true\n } = options;\n const document = (_a = options.document) != null ? _a : window == null ? void 0 : window.document;\n const getDeepActiveElement = () => {\n var _a2;\n let element = document == null ? void 0 : document.activeElement;\n if (deep) {\n while (element == null ? void 0 : element.shadowRoot)\n element = (_a2 = element == null ? void 0 : element.shadowRoot) == null ? void 0 : _a2.activeElement;\n }\n return element;\n };\n const activeElement = computedWithControl(\n () => null,\n () => getDeepActiveElement()\n );\n if (window) {\n useEventListener(window, \"blur\", (event) => {\n if (event.relatedTarget !== null)\n return;\n activeElement.trigger();\n }, true);\n useEventListener(window, \"focus\", activeElement.trigger, true);\n }\n return activeElement;\n}\n\nfunction useMounted() {\n const isMounted = ref(false);\n if (getCurrentInstance()) {\n onMounted(() => {\n isMounted.value = true;\n });\n }\n return isMounted;\n}\n\nfunction useSupported(callback) {\n const isMounted = useMounted();\n return computed(() => {\n isMounted.value;\n return Boolean(callback());\n });\n}\n\nfunction useRafFn(fn, options = {}) {\n const {\n immediate = true,\n fpsLimit = void 0,\n window = defaultWindow\n } = options;\n const isActive = ref(false);\n const intervalLimit = fpsLimit ? 1e3 / fpsLimit : null;\n let previousFrameTimestamp = 0;\n let rafId = null;\n function loop(timestamp) {\n if (!isActive.value || !window)\n return;\n const delta = timestamp - (previousFrameTimestamp || timestamp);\n if (intervalLimit && delta < intervalLimit) {\n rafId = window.requestAnimationFrame(loop);\n return;\n }\n fn({ delta, timestamp });\n previousFrameTimestamp = timestamp;\n rafId = window.requestAnimationFrame(loop);\n }\n function resume() {\n if (!isActive.value && window) {\n isActive.value = true;\n rafId = window.requestAnimationFrame(loop);\n }\n }\n function pause() {\n isActive.value = false;\n if (rafId != null && window) {\n window.cancelAnimationFrame(rafId);\n rafId = null;\n }\n }\n if (immediate)\n resume();\n tryOnScopeDispose(pause);\n return {\n isActive: readonly(isActive),\n pause,\n resume\n };\n}\n\nfunction useAnimate(target, keyframes, options) {\n let config;\n let animateOptions;\n if (isObject(options)) {\n config = options;\n animateOptions = objectOmit(options, [\"window\", \"immediate\", \"commitStyles\", \"persist\", \"onReady\", \"onError\"]);\n } else {\n config = { duration: options };\n animateOptions = options;\n }\n const {\n window = defaultWindow,\n immediate = true,\n commitStyles,\n persist,\n playbackRate: _playbackRate = 1,\n onReady,\n onError = (e) => {\n console.error(e);\n }\n } = config;\n const isSupported = useSupported(() => window && HTMLElement && \"animate\" in HTMLElement.prototype);\n const animate = shallowRef(void 0);\n const store = shallowReactive({\n startTime: null,\n currentTime: null,\n timeline: null,\n playbackRate: _playbackRate,\n pending: false,\n playState: immediate ? \"idle\" : \"paused\",\n replaceState: \"active\"\n });\n const pending = computed(() => store.pending);\n const playState = computed(() => store.playState);\n const replaceState = computed(() => store.replaceState);\n const startTime = computed({\n get() {\n return store.startTime;\n },\n set(value) {\n store.startTime = value;\n if (animate.value)\n animate.value.startTime = value;\n }\n });\n const currentTime = computed({\n get() {\n return store.currentTime;\n },\n set(value) {\n store.currentTime = value;\n if (animate.value) {\n animate.value.currentTime = value;\n syncResume();\n }\n }\n });\n const timeline = computed({\n get() {\n return store.timeline;\n },\n set(value) {\n store.timeline = value;\n if (animate.value)\n animate.value.timeline = value;\n }\n });\n const playbackRate = computed({\n get() {\n return store.playbackRate;\n },\n set(value) {\n store.playbackRate = value;\n if (animate.value)\n animate.value.playbackRate = value;\n }\n });\n const play = () => {\n if (animate.value) {\n try {\n animate.value.play();\n syncResume();\n } catch (e) {\n syncPause();\n onError(e);\n }\n } else {\n update();\n }\n };\n const pause = () => {\n var _a;\n try {\n (_a = animate.value) == null ? void 0 : _a.pause();\n syncPause();\n } catch (e) {\n onError(e);\n }\n };\n const reverse = () => {\n var _a;\n !animate.value && update();\n try {\n (_a = animate.value) == null ? void 0 : _a.reverse();\n syncResume();\n } catch (e) {\n syncPause();\n onError(e);\n }\n };\n const finish = () => {\n var _a;\n try {\n (_a = animate.value) == null ? void 0 : _a.finish();\n syncPause();\n } catch (e) {\n onError(e);\n }\n };\n const cancel = () => {\n var _a;\n try {\n (_a = animate.value) == null ? void 0 : _a.cancel();\n syncPause();\n } catch (e) {\n onError(e);\n }\n };\n watch(() => unrefElement(target), (el) => {\n el && update();\n });\n watch(() => keyframes, (value) => {\n !animate.value && update();\n if (!unrefElement(target) && animate.value) {\n animate.value.effect = new KeyframeEffect(\n unrefElement(target),\n toValue(value),\n animateOptions\n );\n }\n }, { deep: true });\n tryOnMounted(() => {\n nextTick(() => update(true));\n });\n tryOnScopeDispose(cancel);\n function update(init) {\n const el = unrefElement(target);\n if (!isSupported.value || !el)\n return;\n animate.value = el.animate(toValue(keyframes), animateOptions);\n if (commitStyles)\n animate.value.commitStyles();\n if (persist)\n animate.value.persist();\n if (_playbackRate !== 1)\n animate.value.playbackRate = _playbackRate;\n if (init && !immediate)\n animate.value.pause();\n else\n syncResume();\n onReady == null ? void 0 : onReady(animate.value);\n }\n useEventListener(animate, [\"cancel\", \"finish\", \"remove\"], syncPause);\n const { resume: resumeRef, pause: pauseRef } = useRafFn(() => {\n if (!animate.value)\n return;\n store.pending = animate.value.pending;\n store.playState = animate.value.playState;\n store.replaceState = animate.value.replaceState;\n store.startTime = animate.value.startTime;\n store.currentTime = animate.value.currentTime;\n store.timeline = animate.value.timeline;\n store.playbackRate = animate.value.playbackRate;\n }, { immediate: false });\n function syncResume() {\n if (isSupported.value)\n resumeRef();\n }\n function syncPause() {\n if (isSupported.value && window)\n window.requestAnimationFrame(pauseRef);\n }\n return {\n isSupported,\n animate,\n // actions\n play,\n pause,\n reverse,\n finish,\n cancel,\n // state\n pending,\n playState,\n replaceState,\n startTime,\n currentTime,\n timeline,\n playbackRate\n };\n}\n\nfunction useAsyncQueue(tasks, options) {\n const {\n interrupt = true,\n onError = noop,\n onFinished = noop,\n signal\n } = options || {};\n const promiseState = {\n aborted: \"aborted\",\n fulfilled: \"fulfilled\",\n pending: \"pending\",\n rejected: \"rejected\"\n };\n const initialResult = Array.from(Array.from({ length: tasks.length }), () => ({ state: promiseState.pending, data: null }));\n const result = reactive(initialResult);\n const activeIndex = ref(-1);\n if (!tasks || tasks.length === 0) {\n onFinished();\n return {\n activeIndex,\n result\n };\n }\n function updateResult(state, res) {\n activeIndex.value++;\n result[activeIndex.value].data = res;\n result[activeIndex.value].state = state;\n }\n tasks.reduce((prev, curr) => {\n return prev.then((prevRes) => {\n var _a;\n if (signal == null ? void 0 : signal.aborted) {\n updateResult(promiseState.aborted, new Error(\"aborted\"));\n return;\n }\n if (((_a = result[activeIndex.value]) == null ? void 0 : _a.state) === promiseState.rejected && interrupt) {\n onFinished();\n return;\n }\n const done = curr(prevRes).then((currentRes) => {\n updateResult(promiseState.fulfilled, currentRes);\n activeIndex.value === tasks.length - 1 && onFinished();\n return currentRes;\n });\n if (!signal)\n return done;\n return Promise.race([done, whenAborted(signal)]);\n }).catch((e) => {\n if (signal == null ? void 0 : signal.aborted) {\n updateResult(promiseState.aborted, e);\n return e;\n }\n updateResult(promiseState.rejected, e);\n onError();\n return e;\n });\n }, Promise.resolve());\n return {\n activeIndex,\n result\n };\n}\nfunction whenAborted(signal) {\n return new Promise((resolve, reject) => {\n const error = new Error(\"aborted\");\n if (signal.aborted)\n reject(error);\n else\n signal.addEventListener(\"abort\", () => reject(error), { once: true });\n });\n}\n\nfunction useAsyncState(promise, initialState, options) {\n const {\n immediate = true,\n delay = 0,\n onError = noop,\n onSuccess = noop,\n resetOnExecute = true,\n shallow = true,\n throwError\n } = options != null ? options : {};\n const state = shallow ? shallowRef(initialState) : ref(initialState);\n const isReady = ref(false);\n const isLoading = ref(false);\n const error = shallowRef(void 0);\n async function execute(delay2 = 0, ...args) {\n if (resetOnExecute)\n state.value = initialState;\n error.value = void 0;\n isReady.value = false;\n isLoading.value = true;\n if (delay2 > 0)\n await promiseTimeout(delay2);\n const _promise = typeof promise === \"function\" ? promise(...args) : promise;\n try {\n const data = await _promise;\n state.value = data;\n isReady.value = true;\n onSuccess(data);\n } catch (e) {\n error.value = e;\n onError(e);\n if (throwError)\n throw e;\n } finally {\n isLoading.value = false;\n }\n return state.value;\n }\n if (immediate)\n execute(delay);\n const shell = {\n state,\n isReady,\n isLoading,\n error,\n execute\n };\n function waitUntilIsLoaded() {\n return new Promise((resolve, reject) => {\n until(isLoading).toBe(false).then(() => resolve(shell)).catch(reject);\n });\n }\n return {\n ...shell,\n then(onFulfilled, onRejected) {\n return waitUntilIsLoaded().then(onFulfilled, onRejected);\n }\n };\n}\n\nconst defaults = {\n array: (v) => JSON.stringify(v),\n object: (v) => JSON.stringify(v),\n set: (v) => JSON.stringify(Array.from(v)),\n map: (v) => JSON.stringify(Object.fromEntries(v)),\n null: () => \"\"\n};\nfunction getDefaultSerialization(target) {\n if (!target)\n return defaults.null;\n if (target instanceof Map)\n return defaults.map;\n else if (target instanceof Set)\n return defaults.set;\n else if (Array.isArray(target))\n return defaults.array;\n else\n return defaults.object;\n}\n\nfunction useBase64(target, options) {\n const base64 = ref(\"\");\n const promise = ref();\n function execute() {\n if (!isClient)\n return;\n promise.value = new Promise((resolve, reject) => {\n try {\n const _target = toValue(target);\n if (_target == null) {\n resolve(\"\");\n } else if (typeof _target === \"string\") {\n resolve(blobToBase64(new Blob([_target], { type: \"text/plain\" })));\n } else if (_target instanceof Blob) {\n resolve(blobToBase64(_target));\n } else if (_target instanceof ArrayBuffer) {\n resolve(window.btoa(String.fromCharCode(...new Uint8Array(_target))));\n } else if (_target instanceof HTMLCanvasElement) {\n resolve(_target.toDataURL(options == null ? void 0 : options.type, options == null ? void 0 : options.quality));\n } else if (_target instanceof HTMLImageElement) {\n const img = _target.cloneNode(false);\n img.crossOrigin = \"Anonymous\";\n imgLoaded(img).then(() => {\n const canvas = document.createElement(\"canvas\");\n const ctx = canvas.getContext(\"2d\");\n canvas.width = img.width;\n canvas.height = img.height;\n ctx.drawImage(img, 0, 0, canvas.width, canvas.height);\n resolve(canvas.toDataURL(options == null ? void 0 : options.type, options == null ? void 0 : options.quality));\n }).catch(reject);\n } else if (typeof _target === \"object\") {\n const _serializeFn = (options == null ? void 0 : options.serializer) || getDefaultSerialization(_target);\n const serialized = _serializeFn(_target);\n return resolve(blobToBase64(new Blob([serialized], { type: \"application/json\" })));\n } else {\n reject(new Error(\"target is unsupported types\"));\n }\n } catch (error) {\n reject(error);\n }\n });\n promise.value.then((res) => base64.value = res);\n return promise.value;\n }\n if (isRef(target) || typeof target === \"function\")\n watch(target, execute, { immediate: true });\n else\n execute();\n return {\n base64,\n promise,\n execute\n };\n}\nfunction imgLoaded(img) {\n return new Promise((resolve, reject) => {\n if (!img.complete) {\n img.onload = () => {\n resolve();\n };\n img.onerror = reject;\n } else {\n resolve();\n }\n });\n}\nfunction blobToBase64(blob) {\n return new Promise((resolve, reject) => {\n const fr = new FileReader();\n fr.onload = (e) => {\n resolve(e.target.result);\n };\n fr.onerror = reject;\n fr.readAsDataURL(blob);\n });\n}\n\nfunction useBattery(options = {}) {\n const { navigator = defaultNavigator } = options;\n const events = [\"chargingchange\", \"chargingtimechange\", \"dischargingtimechange\", \"levelchange\"];\n const isSupported = useSupported(() => navigator && \"getBattery\" in navigator);\n const charging = ref(false);\n const chargingTime = ref(0);\n const dischargingTime = ref(0);\n const level = ref(1);\n let battery;\n function updateBatteryInfo() {\n charging.value = this.charging;\n chargingTime.value = this.chargingTime || 0;\n dischargingTime.value = this.dischargingTime || 0;\n level.value = this.level;\n }\n if (isSupported.value) {\n navigator.getBattery().then((_battery) => {\n battery = _battery;\n updateBatteryInfo.call(battery);\n useEventListener(battery, events, updateBatteryInfo, { passive: true });\n });\n }\n return {\n isSupported,\n charging,\n chargingTime,\n dischargingTime,\n level\n };\n}\n\nfunction useBluetooth(options) {\n let {\n acceptAllDevices = false\n } = options || {};\n const {\n filters = void 0,\n optionalServices = void 0,\n navigator = defaultNavigator\n } = options || {};\n const isSupported = useSupported(() => navigator && \"bluetooth\" in navigator);\n const device = shallowRef(void 0);\n const error = shallowRef(null);\n watch(device, () => {\n connectToBluetoothGATTServer();\n });\n async function requestDevice() {\n if (!isSupported.value)\n return;\n error.value = null;\n if (filters && filters.length > 0)\n acceptAllDevices = false;\n try {\n device.value = await (navigator == null ? void 0 : navigator.bluetooth.requestDevice({\n acceptAllDevices,\n filters,\n optionalServices\n }));\n } catch (err) {\n error.value = err;\n }\n }\n const server = ref();\n const isConnected = computed(() => {\n var _a;\n return ((_a = server.value) == null ? void 0 : _a.connected) || false;\n });\n async function connectToBluetoothGATTServer() {\n error.value = null;\n if (device.value && device.value.gatt) {\n device.value.addEventListener(\"gattserverdisconnected\", () => {\n });\n try {\n server.value = await device.value.gatt.connect();\n } catch (err) {\n error.value = err;\n }\n }\n }\n tryOnMounted(() => {\n var _a;\n if (device.value)\n (_a = device.value.gatt) == null ? void 0 : _a.connect();\n });\n tryOnScopeDispose(() => {\n var _a;\n if (device.value)\n (_a = device.value.gatt) == null ? void 0 : _a.disconnect();\n });\n return {\n isSupported,\n isConnected,\n // Device:\n device,\n requestDevice,\n // Server:\n server,\n // Errors:\n error\n };\n}\n\nfunction useMediaQuery(query, options = {}) {\n const { window = defaultWindow } = options;\n const isSupported = useSupported(() => window && \"matchMedia\" in window && typeof window.matchMedia === \"function\");\n let mediaQuery;\n const matches = ref(false);\n const handler = (event) => {\n matches.value = event.matches;\n };\n const cleanup = () => {\n if (!mediaQuery)\n return;\n if (\"removeEventListener\" in mediaQuery)\n mediaQuery.removeEventListener(\"change\", handler);\n else\n mediaQuery.removeListener(handler);\n };\n const stopWatch = watchEffect(() => {\n if (!isSupported.value)\n return;\n cleanup();\n mediaQuery = window.matchMedia(toValue(query));\n if (\"addEventListener\" in mediaQuery)\n mediaQuery.addEventListener(\"change\", handler);\n else\n mediaQuery.addListener(handler);\n matches.value = mediaQuery.matches;\n });\n tryOnScopeDispose(() => {\n stopWatch();\n cleanup();\n mediaQuery = void 0;\n });\n return matches;\n}\n\nconst breakpointsTailwind = {\n \"sm\": 640,\n \"md\": 768,\n \"lg\": 1024,\n \"xl\": 1280,\n \"2xl\": 1536\n};\nconst breakpointsBootstrapV5 = {\n xs: 0,\n sm: 576,\n md: 768,\n lg: 992,\n xl: 1200,\n xxl: 1400\n};\nconst breakpointsVuetify = {\n xs: 600,\n sm: 960,\n md: 1264,\n lg: 1904\n};\nconst breakpointsAntDesign = {\n xs: 480,\n sm: 576,\n md: 768,\n lg: 992,\n xl: 1200,\n xxl: 1600\n};\nconst breakpointsQuasar = {\n xs: 600,\n sm: 1024,\n md: 1440,\n lg: 1920\n};\nconst breakpointsSematic = {\n mobileS: 320,\n mobileM: 375,\n mobileL: 425,\n tablet: 768,\n laptop: 1024,\n laptopL: 1440,\n desktop4K: 2560\n};\nconst breakpointsMasterCss = {\n \"3xs\": 360,\n \"2xs\": 480,\n \"xs\": 600,\n \"sm\": 768,\n \"md\": 1024,\n \"lg\": 1280,\n \"xl\": 1440,\n \"2xl\": 1600,\n \"3xl\": 1920,\n \"4xl\": 2560\n};\nconst breakpointsPrimeFlex = {\n sm: 576,\n md: 768,\n lg: 992,\n xl: 1200\n};\n\nfunction useBreakpoints(breakpoints, options = {}) {\n function getValue(k, delta) {\n let v = breakpoints[k];\n if (delta != null)\n v = increaseWithUnit(v, delta);\n if (typeof v === \"number\")\n v = `${v}px`;\n return v;\n }\n const { window = defaultWindow } = options;\n function match(query) {\n if (!window)\n return false;\n return window.matchMedia(query).matches;\n }\n const greaterOrEqual = (k) => {\n return useMediaQuery(`(min-width: ${getValue(k)})`, options);\n };\n const shortcutMethods = Object.keys(breakpoints).reduce((shortcuts, k) => {\n Object.defineProperty(shortcuts, k, {\n get: () => greaterOrEqual(k),\n enumerable: true,\n configurable: true\n });\n return shortcuts;\n }, {});\n return Object.assign(shortcutMethods, {\n greater(k) {\n return useMediaQuery(`(min-width: ${getValue(k, 0.1)})`, options);\n },\n greaterOrEqual,\n smaller(k) {\n return useMediaQuery(`(max-width: ${getValue(k, -0.1)})`, options);\n },\n smallerOrEqual(k) {\n return useMediaQuery(`(max-width: ${getValue(k)})`, options);\n },\n between(a, b) {\n return useMediaQuery(`(min-width: ${getValue(a)}) and (max-width: ${getValue(b, -0.1)})`, options);\n },\n isGreater(k) {\n return match(`(min-width: ${getValue(k, 0.1)})`);\n },\n isGreaterOrEqual(k) {\n return match(`(min-width: ${getValue(k)})`);\n },\n isSmaller(k) {\n return match(`(max-width: ${getValue(k, -0.1)})`);\n },\n isSmallerOrEqual(k) {\n return match(`(max-width: ${getValue(k)})`);\n },\n isInBetween(a, b) {\n return match(`(min-width: ${getValue(a)}) and (max-width: ${getValue(b, -0.1)})`);\n },\n current() {\n const points = Object.keys(breakpoints).map((i) => [i, greaterOrEqual(i)]);\n return computed(() => points.filter(([, v]) => v.value).map(([k]) => k));\n }\n });\n}\n\nfunction useBroadcastChannel(options) {\n const {\n name,\n window = defaultWindow\n } = options;\n const isSupported = useSupported(() => window && \"BroadcastChannel\" in window);\n const isClosed = ref(false);\n const channel = ref();\n const data = ref();\n const error = shallowRef(null);\n const post = (data2) => {\n if (channel.value)\n channel.value.postMessage(data2);\n };\n const close = () => {\n if (channel.value)\n channel.value.close();\n isClosed.value = true;\n };\n if (isSupported.value) {\n tryOnMounted(() => {\n error.value = null;\n channel.value = new BroadcastChannel(name);\n channel.value.addEventListener(\"message\", (e) => {\n data.value = e.data;\n }, { passive: true });\n channel.value.addEventListener(\"messageerror\", (e) => {\n error.value = e;\n }, { passive: true });\n channel.value.addEventListener(\"close\", () => {\n isClosed.value = true;\n });\n });\n }\n tryOnScopeDispose(() => {\n close();\n });\n return {\n isSupported,\n channel,\n data,\n post,\n close,\n error,\n isClosed\n };\n}\n\nconst WRITABLE_PROPERTIES = [\n \"hash\",\n \"host\",\n \"hostname\",\n \"href\",\n \"pathname\",\n \"port\",\n \"protocol\",\n \"search\"\n];\nfunction useBrowserLocation(options = {}) {\n const { window = defaultWindow } = options;\n const refs = Object.fromEntries(\n WRITABLE_PROPERTIES.map((key) => [key, ref()])\n );\n for (const [key, ref2] of objectEntries(refs)) {\n watch(ref2, (value) => {\n if (!(window == null ? void 0 : window.location) || window.location[key] === value)\n return;\n window.location[key] = value;\n });\n }\n const buildState = (trigger) => {\n var _a;\n const { state: state2, length } = (window == null ? void 0 : window.history) || {};\n const { origin } = (window == null ? void 0 : window.location) || {};\n for (const key of WRITABLE_PROPERTIES)\n refs[key].value = (_a = window == null ? void 0 : window.location) == null ? void 0 : _a[key];\n return reactive({\n trigger,\n state: state2,\n length,\n origin,\n ...refs\n });\n };\n const state = ref(buildState(\"load\"));\n if (window) {\n useEventListener(window, \"popstate\", () => state.value = buildState(\"popstate\"), { passive: true });\n useEventListener(window, \"hashchange\", () => state.value = buildState(\"hashchange\"), { passive: true });\n }\n return state;\n}\n\nfunction useCached(refValue, comparator = (a, b) => a === b, watchOptions) {\n const cachedValue = ref(refValue.value);\n watch(() => refValue.value, (value) => {\n if (!comparator(value, cachedValue.value))\n cachedValue.value = value;\n }, watchOptions);\n return cachedValue;\n}\n\nfunction usePermission(permissionDesc, options = {}) {\n const {\n controls = false,\n navigator = defaultNavigator\n } = options;\n const isSupported = useSupported(() => navigator && \"permissions\" in navigator);\n let permissionStatus;\n const desc = typeof permissionDesc === \"string\" ? { name: permissionDesc } : permissionDesc;\n const state = ref();\n const onChange = () => {\n if (permissionStatus)\n state.value = permissionStatus.state;\n };\n const query = createSingletonPromise(async () => {\n if (!isSupported.value)\n return;\n if (!permissionStatus) {\n try {\n permissionStatus = await navigator.permissions.query(desc);\n useEventListener(permissionStatus, \"change\", onChange);\n onChange();\n } catch (e) {\n state.value = \"prompt\";\n }\n }\n return permissionStatus;\n });\n query();\n if (controls) {\n return {\n state,\n isSupported,\n query\n };\n } else {\n return state;\n }\n}\n\nfunction useClipboard(options = {}) {\n const {\n navigator = defaultNavigator,\n read = false,\n source,\n copiedDuring = 1500,\n legacy = false\n } = options;\n const isClipboardApiSupported = useSupported(() => navigator && \"clipboard\" in navigator);\n const permissionRead = usePermission(\"clipboard-read\");\n const permissionWrite = usePermission(\"clipboard-write\");\n const isSupported = computed(() => isClipboardApiSupported.value || legacy);\n const text = ref(\"\");\n const copied = ref(false);\n const timeout = useTimeoutFn(() => copied.value = false, copiedDuring);\n function updateText() {\n if (isClipboardApiSupported.value && permissionRead.value !== \"denied\") {\n navigator.clipboard.readText().then((value) => {\n text.value = value;\n });\n } else {\n text.value = legacyRead();\n }\n }\n if (isSupported.value && read)\n useEventListener([\"copy\", \"cut\"], updateText);\n async function copy(value = toValue(source)) {\n if (isSupported.value && value != null) {\n if (isClipboardApiSupported.value && permissionWrite.value !== \"denied\")\n await navigator.clipboard.writeText(value);\n else\n legacyCopy(value);\n text.value = value;\n copied.value = true;\n timeout.start();\n }\n }\n function legacyCopy(value) {\n const ta = document.createElement(\"textarea\");\n ta.value = value != null ? value : \"\";\n ta.style.position = \"absolute\";\n ta.style.opacity = \"0\";\n document.body.appendChild(ta);\n ta.select();\n document.execCommand(\"copy\");\n ta.remove();\n }\n function legacyRead() {\n var _a, _b, _c;\n return (_c = (_b = (_a = document == null ? void 0 : document.getSelection) == null ? void 0 : _a.call(document)) == null ? void 0 : _b.toString()) != null ? _c : \"\";\n }\n return {\n isSupported,\n text,\n copied,\n copy\n };\n}\n\nfunction useClipboardItems(options = {}) {\n const {\n navigator = defaultNavigator,\n read = false,\n source,\n copiedDuring = 1500\n } = options;\n const isSupported = useSupported(() => navigator && \"clipboard\" in navigator);\n const content = ref([]);\n const copied = ref(false);\n const timeout = useTimeoutFn(() => copied.value = false, copiedDuring);\n function updateContent() {\n if (isSupported.value) {\n navigator.clipboard.read().then((items) => {\n content.value = items;\n });\n }\n }\n if (isSupported.value && read)\n useEventListener([\"copy\", \"cut\"], updateContent);\n async function copy(value = toValue(source)) {\n if (isSupported.value && value != null) {\n await navigator.clipboard.write(value);\n content.value = value;\n copied.value = true;\n timeout.start();\n }\n }\n return {\n isSupported,\n content,\n copied,\n copy\n };\n}\n\nfunction cloneFnJSON(source) {\n return JSON.parse(JSON.stringify(source));\n}\nfunction useCloned(source, options = {}) {\n const cloned = ref({});\n const {\n manual,\n clone = cloneFnJSON,\n // watch options\n deep = true,\n immediate = true\n } = options;\n function sync() {\n cloned.value = clone(toValue(source));\n }\n if (!manual && (isRef(source) || typeof source === \"function\")) {\n watch(source, sync, {\n ...options,\n deep,\n immediate\n });\n } else {\n sync();\n }\n return { cloned, sync };\n}\n\nconst _global = typeof globalThis !== \"undefined\" ? globalThis : typeof window !== \"undefined\" ? window : typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : {};\nconst globalKey = \"__vueuse_ssr_handlers__\";\nconst handlers = /* @__PURE__ */ getHandlers();\nfunction getHandlers() {\n if (!(globalKey in _global))\n _global[globalKey] = _global[globalKey] || {};\n return _global[globalKey];\n}\nfunction getSSRHandler(key, fallback) {\n return handlers[key] || fallback;\n}\nfunction setSSRHandler(key, fn) {\n handlers[key] = fn;\n}\n\nfunction guessSerializerType(rawInit) {\n return rawInit == null ? \"any\" : rawInit instanceof Set ? \"set\" : rawInit instanceof Map ? \"map\" : rawInit instanceof Date ? \"date\" : typeof rawInit === \"boolean\" ? \"boolean\" : typeof rawInit === \"string\" ? \"string\" : typeof rawInit === \"object\" ? \"object\" : !Number.isNaN(rawInit) ? \"number\" : \"any\";\n}\n\nconst StorageSerializers = {\n boolean: {\n read: (v) => v === \"true\",\n write: (v) => String(v)\n },\n object: {\n read: (v) => JSON.parse(v),\n write: (v) => JSON.stringify(v)\n },\n number: {\n read: (v) => Number.parseFloat(v),\n write: (v) => String(v)\n },\n any: {\n read: (v) => v,\n write: (v) => String(v)\n },\n string: {\n read: (v) => v,\n write: (v) => String(v)\n },\n map: {\n read: (v) => new Map(JSON.parse(v)),\n write: (v) => JSON.stringify(Array.from(v.entries()))\n },\n set: {\n read: (v) => new Set(JSON.parse(v)),\n write: (v) => JSON.stringify(Array.from(v))\n },\n date: {\n read: (v) => new Date(v),\n write: (v) => v.toISOString()\n }\n};\nconst customStorageEventName = \"vueuse-storage\";\nfunction useStorage(key, defaults, storage, options = {}) {\n var _a;\n const {\n flush = \"pre\",\n deep = true,\n listenToStorageChanges = true,\n writeDefaults = true,\n mergeDefaults = false,\n shallow,\n window = defaultWindow,\n eventFilter,\n onError = (e) => {\n console.error(e);\n },\n initOnMounted\n } = options;\n const data = (shallow ? shallowRef : ref)(typeof defaults === \"function\" ? defaults() : defaults);\n if (!storage) {\n try {\n storage = getSSRHandler(\"getDefaultStorage\", () => {\n var _a2;\n return (_a2 = defaultWindow) == null ? void 0 : _a2.localStorage;\n })();\n } catch (e) {\n onError(e);\n }\n }\n if (!storage)\n return data;\n const rawInit = toValue(defaults);\n const type = guessSerializerType(rawInit);\n const serializer = (_a = options.serializer) != null ? _a : StorageSerializers[type];\n const { pause: pauseWatch, resume: resumeWatch } = pausableWatch(\n data,\n () => write(data.value),\n { flush, deep, eventFilter }\n );\n if (window && listenToStorageChanges) {\n tryOnMounted(() => {\n useEventListener(window, \"storage\", update);\n useEventListener(window, customStorageEventName, updateFromCustomEvent);\n if (initOnMounted)\n update();\n });\n }\n if (!initOnMounted)\n update();\n return data;\n function write(v) {\n try {\n if (v == null) {\n storage.removeItem(key);\n } else {\n const serialized = serializer.write(v);\n const oldValue = storage.getItem(key);\n if (oldValue !== serialized) {\n storage.setItem(key, serialized);\n if (window) {\n window.dispatchEvent(new CustomEvent(customStorageEventName, {\n detail: {\n key,\n oldValue,\n newValue: serialized,\n storageArea: storage\n }\n }));\n }\n }\n }\n } catch (e) {\n onError(e);\n }\n }\n function read(event) {\n const rawValue = event ? event.newValue : storage.getItem(key);\n if (rawValue == null) {\n if (writeDefaults && rawInit !== null)\n storage.setItem(key, serializer.write(rawInit));\n return rawInit;\n } else if (!event && mergeDefaults) {\n const value = serializer.read(rawValue);\n if (typeof mergeDefaults === \"function\")\n return mergeDefaults(value, rawInit);\n else if (type === \"object\" && !Array.isArray(value))\n return { ...rawInit, ...value };\n return value;\n } else if (typeof rawValue !== \"string\") {\n return rawValue;\n } else {\n return serializer.read(rawValue);\n }\n }\n function updateFromCustomEvent(event) {\n update(event.detail);\n }\n function update(event) {\n if (event && event.storageArea !== storage)\n return;\n if (event && event.key == null) {\n data.value = rawInit;\n return;\n }\n if (event && event.key !== key)\n return;\n pauseWatch();\n try {\n if ((event == null ? void 0 : event.newValue) !== serializer.write(data.value))\n data.value = read(event);\n } catch (e) {\n onError(e);\n } finally {\n if (event)\n nextTick(resumeWatch);\n else\n resumeWatch();\n }\n }\n}\n\nfunction usePreferredDark(options) {\n return useMediaQuery(\"(prefers-color-scheme: dark)\", options);\n}\n\nfunction useColorMode(options = {}) {\n const {\n selector = \"html\",\n attribute = \"class\",\n initialValue = \"auto\",\n window = defaultWindow,\n storage,\n storageKey = \"vueuse-color-scheme\",\n listenToStorageChanges = true,\n storageRef,\n emitAuto,\n disableTransition = true\n } = options;\n const modes = {\n auto: \"\",\n light: \"light\",\n dark: \"dark\",\n ...options.modes || {}\n };\n const preferredDark = usePreferredDark({ window });\n const system = computed(() => preferredDark.value ? \"dark\" : \"light\");\n const store = storageRef || (storageKey == null ? toRef(initialValue) : useStorage(storageKey, initialValue, storage, { window, listenToStorageChanges }));\n const state = computed(() => store.value === \"auto\" ? system.value : store.value);\n const updateHTMLAttrs = getSSRHandler(\n \"updateHTMLAttrs\",\n (selector2, attribute2, value) => {\n const el = typeof selector2 === \"string\" ? window == null ? void 0 : window.document.querySelector(selector2) : unrefElement(selector2);\n if (!el)\n return;\n let style;\n if (disableTransition) {\n style = window.document.createElement(\"style\");\n const styleString = \"*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}\";\n style.appendChild(document.createTextNode(styleString));\n window.document.head.appendChild(style);\n }\n if (attribute2 === \"class\") {\n const current = value.split(/\\s/g);\n Object.values(modes).flatMap((i) => (i || \"\").split(/\\s/g)).filter(Boolean).forEach((v) => {\n if (current.includes(v))\n el.classList.add(v);\n else\n el.classList.remove(v);\n });\n } else {\n el.setAttribute(attribute2, value);\n }\n if (disableTransition) {\n window.getComputedStyle(style).opacity;\n document.head.removeChild(style);\n }\n }\n );\n function defaultOnChanged(mode) {\n var _a;\n updateHTMLAttrs(selector, attribute, (_a = modes[mode]) != null ? _a : mode);\n }\n function onChanged(mode) {\n if (options.onChanged)\n options.onChanged(mode, defaultOnChanged);\n else\n defaultOnChanged(mode);\n }\n watch(state, onChanged, { flush: \"post\", immediate: true });\n tryOnMounted(() => onChanged(state.value));\n const auto = computed({\n get() {\n return emitAuto ? store.value : state.value;\n },\n set(v) {\n store.value = v;\n }\n });\n try {\n return Object.assign(auto, { store, system, state });\n } catch (e) {\n return auto;\n }\n}\n\nfunction useConfirmDialog(revealed = ref(false)) {\n const confirmHook = createEventHook();\n const cancelHook = createEventHook();\n const revealHook = createEventHook();\n let _resolve = noop;\n const reveal = (data) => {\n revealHook.trigger(data);\n revealed.value = true;\n return new Promise((resolve) => {\n _resolve = resolve;\n });\n };\n const confirm = (data) => {\n revealed.value = false;\n confirmHook.trigger(data);\n _resolve({ data, isCanceled: false });\n };\n const cancel = (data) => {\n revealed.value = false;\n cancelHook.trigger(data);\n _resolve({ data, isCanceled: true });\n };\n return {\n isRevealed: computed(() => revealed.value),\n reveal,\n confirm,\n cancel,\n onReveal: revealHook.on,\n onConfirm: confirmHook.on,\n onCancel: cancelHook.on\n };\n}\n\nfunction useMutationObserver(target, callback, options = {}) {\n const { window = defaultWindow, ...mutationOptions } = options;\n let observer;\n const isSupported = useSupported(() => window && \"MutationObserver\" in window);\n const cleanup = () => {\n if (observer) {\n observer.disconnect();\n observer = void 0;\n }\n };\n const stopWatch = watch(\n () => unrefElement(target),\n (el) => {\n cleanup();\n if (isSupported.value && window && el) {\n observer = new MutationObserver(callback);\n observer.observe(el, mutationOptions);\n }\n },\n { immediate: true }\n );\n const takeRecords = () => {\n return observer == null ? void 0 : observer.takeRecords();\n };\n const stop = () => {\n cleanup();\n stopWatch();\n };\n tryOnScopeDispose(stop);\n return {\n isSupported,\n stop,\n takeRecords\n };\n}\n\nfunction useCssVar(prop, target, options = {}) {\n const { window = defaultWindow, initialValue = \"\", observe = false } = options;\n const variable = ref(initialValue);\n const elRef = computed(() => {\n var _a;\n return unrefElement(target) || ((_a = window == null ? void 0 : window.document) == null ? void 0 : _a.documentElement);\n });\n function updateCssVar() {\n var _a;\n const key = toValue(prop);\n const el = toValue(elRef);\n if (el && window) {\n const value = (_a = window.getComputedStyle(el).getPropertyValue(key)) == null ? void 0 : _a.trim();\n variable.value = value || initialValue;\n }\n }\n if (observe) {\n useMutationObserver(elRef, updateCssVar, {\n attributeFilter: [\"style\", \"class\"],\n window\n });\n }\n watch(\n [elRef, () => toValue(prop)],\n updateCssVar,\n { immediate: true }\n );\n watch(\n variable,\n (val) => {\n var _a;\n if ((_a = elRef.value) == null ? void 0 : _a.style)\n elRef.value.style.setProperty(toValue(prop), val);\n }\n );\n return variable;\n}\n\nfunction useCurrentElement() {\n const vm = getCurrentInstance();\n const currentElement = computedWithControl(\n () => null,\n () => vm.proxy.$el\n );\n onUpdated(currentElement.trigger);\n onMounted(currentElement.trigger);\n return currentElement;\n}\n\nfunction useCycleList(list, options) {\n const state = shallowRef(getInitialValue());\n const listRef = toRef(list);\n const index = computed({\n get() {\n var _a;\n const targetList = listRef.value;\n let index2 = (options == null ? void 0 : options.getIndexOf) ? options.getIndexOf(state.value, targetList) : targetList.indexOf(state.value);\n if (index2 < 0)\n index2 = (_a = options == null ? void 0 : options.fallbackIndex) != null ? _a : 0;\n return index2;\n },\n set(v) {\n set(v);\n }\n });\n function set(i) {\n const targetList = listRef.value;\n const length = targetList.length;\n const index2 = (i % length + length) % length;\n const value = targetList[index2];\n state.value = value;\n return value;\n }\n function shift(delta = 1) {\n return set(index.value + delta);\n }\n function next(n = 1) {\n return shift(n);\n }\n function prev(n = 1) {\n return shift(-n);\n }\n function getInitialValue() {\n var _a, _b;\n return (_b = toValue((_a = options == null ? void 0 : options.initialValue) != null ? _a : toValue(list)[0])) != null ? _b : void 0;\n }\n watch(listRef, () => set(index.value));\n return {\n state,\n index,\n next,\n prev\n };\n}\n\nfunction useDark(options = {}) {\n const {\n valueDark = \"dark\",\n valueLight = \"\"\n } = options;\n const mode = useColorMode({\n ...options,\n onChanged: (mode2, defaultHandler) => {\n var _a;\n if (options.onChanged)\n (_a = options.onChanged) == null ? void 0 : _a.call(options, mode2 === \"dark\", defaultHandler, mode2);\n else\n defaultHandler(mode2);\n },\n modes: {\n dark: valueDark,\n light: valueLight\n }\n });\n const isDark = computed({\n get() {\n return mode.value === \"dark\";\n },\n set(v) {\n const modeVal = v ? \"dark\" : \"light\";\n if (mode.system.value === modeVal)\n mode.value = \"auto\";\n else\n mode.value = modeVal;\n }\n });\n return isDark;\n}\n\nfunction fnBypass(v) {\n return v;\n}\nfunction fnSetSource(source, value) {\n return source.value = value;\n}\nfunction defaultDump(clone) {\n return clone ? typeof clone === \"function\" ? clone : cloneFnJSON : fnBypass;\n}\nfunction defaultParse(clone) {\n return clone ? typeof clone === \"function\" ? clone : cloneFnJSON : fnBypass;\n}\nfunction useManualRefHistory(source, options = {}) {\n const {\n clone = false,\n dump = defaultDump(clone),\n parse = defaultParse(clone),\n setSource = fnSetSource\n } = options;\n function _createHistoryRecord() {\n return markRaw({\n snapshot: dump(source.value),\n timestamp: timestamp()\n });\n }\n const last = ref(_createHistoryRecord());\n const undoStack = ref([]);\n const redoStack = ref([]);\n const _setSource = (record) => {\n setSource(source, parse(record.snapshot));\n last.value = record;\n };\n const commit = () => {\n undoStack.value.unshift(last.value);\n last.value = _createHistoryRecord();\n if (options.capacity && undoStack.value.length > options.capacity)\n undoStack.value.splice(options.capacity, Number.POSITIVE_INFINITY);\n if (redoStack.value.length)\n redoStack.value.splice(0, redoStack.value.length);\n };\n const clear = () => {\n undoStack.value.splice(0, undoStack.value.length);\n redoStack.value.splice(0, redoStack.value.length);\n };\n const undo = () => {\n const state = undoStack.value.shift();\n if (state) {\n redoStack.value.unshift(last.value);\n _setSource(state);\n }\n };\n const redo = () => {\n const state = redoStack.value.shift();\n if (state) {\n undoStack.value.unshift(last.value);\n _setSource(state);\n }\n };\n const reset = () => {\n _setSource(last.value);\n };\n const history = computed(() => [last.value, ...undoStack.value]);\n const canUndo = computed(() => undoStack.value.length > 0);\n const canRedo = computed(() => redoStack.value.length > 0);\n return {\n source,\n undoStack,\n redoStack,\n last,\n history,\n canUndo,\n canRedo,\n clear,\n commit,\n reset,\n undo,\n redo\n };\n}\n\nfunction useRefHistory(source, options = {}) {\n const {\n deep = false,\n flush = \"pre\",\n eventFilter\n } = options;\n const {\n eventFilter: composedFilter,\n pause,\n resume: resumeTracking,\n isActive: isTracking\n } = pausableFilter(eventFilter);\n const {\n ignoreUpdates,\n ignorePrevAsyncUpdates,\n stop\n } = watchIgnorable(\n source,\n commit,\n { deep, flush, eventFilter: composedFilter }\n );\n function setSource(source2, value) {\n ignorePrevAsyncUpdates();\n ignoreUpdates(() => {\n source2.value = value;\n });\n }\n const manualHistory = useManualRefHistory(source, { ...options, clone: options.clone || deep, setSource });\n const { clear, commit: manualCommit } = manualHistory;\n function commit() {\n ignorePrevAsyncUpdates();\n manualCommit();\n }\n function resume(commitNow) {\n resumeTracking();\n if (commitNow)\n commit();\n }\n function batch(fn) {\n let canceled = false;\n const cancel = () => canceled = true;\n ignoreUpdates(() => {\n fn(cancel);\n });\n if (!canceled)\n commit();\n }\n function dispose() {\n stop();\n clear();\n }\n return {\n ...manualHistory,\n isTracking,\n pause,\n resume,\n commit,\n batch,\n dispose\n };\n}\n\nfunction useDebouncedRefHistory(source, options = {}) {\n const filter = options.debounce ? debounceFilter(options.debounce) : void 0;\n const history = useRefHistory(source, { ...options, eventFilter: filter });\n return {\n ...history\n };\n}\n\nfunction useDeviceMotion(options = {}) {\n const {\n window = defaultWindow,\n eventFilter = bypassFilter\n } = options;\n const acceleration = ref({ x: null, y: null, z: null });\n const rotationRate = ref({ alpha: null, beta: null, gamma: null });\n const interval = ref(0);\n const accelerationIncludingGravity = ref({\n x: null,\n y: null,\n z: null\n });\n if (window) {\n const onDeviceMotion = createFilterWrapper(\n eventFilter,\n (event) => {\n acceleration.value = event.acceleration;\n accelerationIncludingGravity.value = event.accelerationIncludingGravity;\n rotationRate.value = event.rotationRate;\n interval.value = event.interval;\n }\n );\n useEventListener(window, \"devicemotion\", onDeviceMotion);\n }\n return {\n acceleration,\n accelerationIncludingGravity,\n rotationRate,\n interval\n };\n}\n\nfunction useDeviceOrientation(options = {}) {\n const { window = defaultWindow } = options;\n const isSupported = useSupported(() => window && \"DeviceOrientationEvent\" in window);\n const isAbsolute = ref(false);\n const alpha = ref(null);\n const beta = ref(null);\n const gamma = ref(null);\n if (window && isSupported.value) {\n useEventListener(window, \"deviceorientation\", (event) => {\n isAbsolute.value = event.absolute;\n alpha.value = event.alpha;\n beta.value = event.beta;\n gamma.value = event.gamma;\n });\n }\n return {\n isSupported,\n isAbsolute,\n alpha,\n beta,\n gamma\n };\n}\n\nfunction useDevicePixelRatio(options = {}) {\n const {\n window = defaultWindow\n } = options;\n const pixelRatio = ref(1);\n if (window) {\n let observe2 = function() {\n pixelRatio.value = window.devicePixelRatio;\n cleanup2();\n media = window.matchMedia(`(resolution: ${pixelRatio.value}dppx)`);\n media.addEventListener(\"change\", observe2, { once: true });\n }, cleanup2 = function() {\n media == null ? void 0 : media.removeEventListener(\"change\", observe2);\n };\n let media;\n observe2();\n tryOnScopeDispose(cleanup2);\n }\n return { pixelRatio };\n}\n\nfunction useDevicesList(options = {}) {\n const {\n navigator = defaultNavigator,\n requestPermissions = false,\n constraints = { audio: true, video: true },\n onUpdated\n } = options;\n const devices = ref([]);\n const videoInputs = computed(() => devices.value.filter((i) => i.kind === \"videoinput\"));\n const audioInputs = computed(() => devices.value.filter((i) => i.kind === \"audioinput\"));\n const audioOutputs = computed(() => devices.value.filter((i) => i.kind === \"audiooutput\"));\n const isSupported = useSupported(() => navigator && navigator.mediaDevices && navigator.mediaDevices.enumerateDevices);\n const permissionGranted = ref(false);\n let stream;\n async function update() {\n if (!isSupported.value)\n return;\n devices.value = await navigator.mediaDevices.enumerateDevices();\n onUpdated == null ? void 0 : onUpdated(devices.value);\n if (stream) {\n stream.getTracks().forEach((t) => t.stop());\n stream = null;\n }\n }\n async function ensurePermissions() {\n if (!isSupported.value)\n return false;\n if (permissionGranted.value)\n return true;\n const { state, query } = usePermission(\"camera\", { controls: true });\n await query();\n if (state.value !== \"granted\") {\n stream = await navigator.mediaDevices.getUserMedia(constraints);\n update();\n permissionGranted.value = true;\n } else {\n permissionGranted.value = true;\n }\n return permissionGranted.value;\n }\n if (isSupported.value) {\n if (requestPermissions)\n ensurePermissions();\n useEventListener(navigator.mediaDevices, \"devicechange\", update);\n update();\n }\n return {\n devices,\n ensurePermissions,\n permissionGranted,\n videoInputs,\n audioInputs,\n audioOutputs,\n isSupported\n };\n}\n\nfunction useDisplayMedia(options = {}) {\n var _a;\n const enabled = ref((_a = options.enabled) != null ? _a : false);\n const video = options.video;\n const audio = options.audio;\n const { navigator = defaultNavigator } = options;\n const isSupported = useSupported(() => {\n var _a2;\n return (_a2 = navigator == null ? void 0 : navigator.mediaDevices) == null ? void 0 : _a2.getDisplayMedia;\n });\n const constraint = { audio, video };\n const stream = shallowRef();\n async function _start() {\n if (!isSupported.value || stream.value)\n return;\n stream.value = await navigator.mediaDevices.getDisplayMedia(constraint);\n return stream.value;\n }\n async function _stop() {\n var _a2;\n (_a2 = stream.value) == null ? void 0 : _a2.getTracks().forEach((t) => t.stop());\n stream.value = void 0;\n }\n function stop() {\n _stop();\n enabled.value = false;\n }\n async function start() {\n await _start();\n if (stream.value)\n enabled.value = true;\n return stream.value;\n }\n watch(\n enabled,\n (v) => {\n if (v)\n _start();\n else\n _stop();\n },\n { immediate: true }\n );\n return {\n isSupported,\n stream,\n start,\n stop,\n enabled\n };\n}\n\nfunction useDocumentVisibility(options = {}) {\n const { document = defaultDocument } = options;\n if (!document)\n return ref(\"visible\");\n const visibility = ref(document.visibilityState);\n useEventListener(document, \"visibilitychange\", () => {\n visibility.value = document.visibilityState;\n });\n return visibility;\n}\n\nfunction useDraggable(target, options = {}) {\n var _a, _b;\n const {\n pointerTypes,\n preventDefault,\n stopPropagation,\n exact,\n onMove,\n onEnd,\n onStart,\n initialValue,\n axis = \"both\",\n draggingElement = defaultWindow,\n containerElement,\n handle: draggingHandle = target\n } = options;\n const position = ref(\n (_a = toValue(initialValue)) != null ? _a : { x: 0, y: 0 }\n );\n const pressedDelta = ref();\n const filterEvent = (e) => {\n if (pointerTypes)\n return pointerTypes.includes(e.pointerType);\n return true;\n };\n const handleEvent = (e) => {\n if (toValue(preventDefault))\n e.preventDefault();\n if (toValue(stopPropagation))\n e.stopPropagation();\n };\n const start = (e) => {\n var _a2;\n if (!filterEvent(e))\n return;\n if (toValue(exact) && e.target !== toValue(target))\n return;\n const container = toValue(containerElement);\n const containerRect = (_a2 = container == null ? void 0 : container.getBoundingClientRect) == null ? void 0 : _a2.call(container);\n const targetRect = toValue(target).getBoundingClientRect();\n const pos = {\n x: e.clientX - (container ? targetRect.left - containerRect.left : targetRect.left),\n y: e.clientY - (container ? targetRect.top - containerRect.top : targetRect.top)\n };\n if ((onStart == null ? void 0 : onStart(pos, e)) === false)\n return;\n pressedDelta.value = pos;\n handleEvent(e);\n };\n const move = (e) => {\n var _a2;\n if (!filterEvent(e))\n return;\n if (!pressedDelta.value)\n return;\n const container = toValue(containerElement);\n const containerRect = (_a2 = container == null ? void 0 : container.getBoundingClientRect) == null ? void 0 : _a2.call(container);\n const targetRect = toValue(target).getBoundingClientRect();\n let { x, y } = position.value;\n if (axis === \"x\" || axis === \"both\") {\n x = e.clientX - pressedDelta.value.x;\n if (container)\n x = Math.min(Math.max(0, x), containerRect.width - targetRect.width);\n }\n if (axis === \"y\" || axis === \"both\") {\n y = e.clientY - pressedDelta.value.y;\n if (container)\n y = Math.min(Math.max(0, y), containerRect.height - targetRect.height);\n }\n position.value = {\n x,\n y\n };\n onMove == null ? void 0 : onMove(position.value, e);\n handleEvent(e);\n };\n const end = (e) => {\n if (!filterEvent(e))\n return;\n if (!pressedDelta.value)\n return;\n pressedDelta.value = void 0;\n onEnd == null ? void 0 : onEnd(position.value, e);\n handleEvent(e);\n };\n if (isClient) {\n const config = { capture: (_b = options.capture) != null ? _b : true };\n useEventListener(draggingHandle, \"pointerdown\", start, config);\n useEventListener(draggingElement, \"pointermove\", move, config);\n useEventListener(draggingElement, \"pointerup\", end, config);\n }\n return {\n ...toRefs(position),\n position,\n isDragging: computed(() => !!pressedDelta.value),\n style: computed(\n () => `left:${position.value.x}px;top:${position.value.y}px;`\n )\n };\n}\n\nfunction useDropZone(target, options = {}) {\n const isOverDropZone = ref(false);\n const files = shallowRef(null);\n let counter = 0;\n let isDataTypeIncluded = true;\n if (isClient) {\n const _options = typeof options === \"function\" ? { onDrop: options } : options;\n const getFiles = (event) => {\n var _a, _b;\n const list = Array.from((_b = (_a = event.dataTransfer) == null ? void 0 : _a.files) != null ? _b : []);\n return files.value = list.length === 0 ? null : list;\n };\n useEventListener$1(target, \"dragenter\", (event) => {\n var _a;\n if (_options.dataTypes && event.dataTransfer) {\n const dataTypes = unref(_options.dataTypes);\n isDataTypeIncluded = typeof dataTypes === \"function\" ? dataTypes(event.dataTransfer.types) : dataTypes ? dataTypes.some((item) => event.dataTransfer.types.includes(item)) : true;\n if (!isDataTypeIncluded)\n return;\n }\n event.preventDefault();\n counter += 1;\n isOverDropZone.value = true;\n (_a = _options.onEnter) == null ? void 0 : _a.call(_options, getFiles(event), event);\n });\n useEventListener$1(target, \"dragover\", (event) => {\n var _a;\n if (!isDataTypeIncluded)\n return;\n event.preventDefault();\n (_a = _options.onOver) == null ? void 0 : _a.call(_options, getFiles(event), event);\n });\n useEventListener$1(target, \"dragleave\", (event) => {\n var _a;\n if (!isDataTypeIncluded)\n return;\n event.preventDefault();\n counter -= 1;\n if (counter === 0)\n isOverDropZone.value = false;\n (_a = _options.onLeave) == null ? void 0 : _a.call(_options, getFiles(event), event);\n });\n useEventListener$1(target, \"drop\", (event) => {\n var _a;\n event.preventDefault();\n counter = 0;\n isOverDropZone.value = false;\n (_a = _options.onDrop) == null ? void 0 : _a.call(_options, getFiles(event), event);\n });\n }\n return {\n files,\n isOverDropZone\n };\n}\n\nfunction useResizeObserver(target, callback, options = {}) {\n const { window = defaultWindow, ...observerOptions } = options;\n let observer;\n const isSupported = useSupported(() => window && \"ResizeObserver\" in window);\n const cleanup = () => {\n if (observer) {\n observer.disconnect();\n observer = void 0;\n }\n };\n const targets = computed(() => Array.isArray(target) ? target.map((el) => unrefElement(el)) : [unrefElement(target)]);\n const stopWatch = watch(\n targets,\n (els) => {\n cleanup();\n if (isSupported.value && window) {\n observer = new ResizeObserver(callback);\n for (const _el of els)\n _el && observer.observe(_el, observerOptions);\n }\n },\n { immediate: true, flush: \"post\", deep: true }\n );\n const stop = () => {\n cleanup();\n stopWatch();\n };\n tryOnScopeDispose(stop);\n return {\n isSupported,\n stop\n };\n}\n\nfunction useElementBounding(target, options = {}) {\n const {\n reset = true,\n windowResize = true,\n windowScroll = true,\n immediate = true\n } = options;\n const height = ref(0);\n const bottom = ref(0);\n const left = ref(0);\n const right = ref(0);\n const top = ref(0);\n const width = ref(0);\n const x = ref(0);\n const y = ref(0);\n function update() {\n const el = unrefElement(target);\n if (!el) {\n if (reset) {\n height.value = 0;\n bottom.value = 0;\n left.value = 0;\n right.value = 0;\n top.value = 0;\n width.value = 0;\n x.value = 0;\n y.value = 0;\n }\n return;\n }\n const rect = el.getBoundingClientRect();\n height.value = rect.height;\n bottom.value = rect.bottom;\n left.value = rect.left;\n right.value = rect.right;\n top.value = rect.top;\n width.value = rect.width;\n x.value = rect.x;\n y.value = rect.y;\n }\n useResizeObserver(target, update);\n watch(() => unrefElement(target), (ele) => !ele && update());\n if (windowScroll)\n useEventListener(\"scroll\", update, { capture: true, passive: true });\n if (windowResize)\n useEventListener(\"resize\", update, { passive: true });\n tryOnMounted(() => {\n if (immediate)\n update();\n });\n return {\n height,\n bottom,\n left,\n right,\n top,\n width,\n x,\n y,\n update\n };\n}\n\nfunction useElementByPoint(options) {\n const {\n x,\n y,\n document = defaultDocument,\n multiple,\n interval = \"requestAnimationFrame\",\n immediate = true\n } = options;\n const isSupported = useSupported(() => {\n if (toValue(multiple))\n return document && \"elementsFromPoint\" in document;\n return document && \"elementFromPoint\" in document;\n });\n const element = ref(null);\n const cb = () => {\n var _a, _b;\n element.value = toValue(multiple) ? (_a = document == null ? void 0 : document.elementsFromPoint(toValue(x), toValue(y))) != null ? _a : [] : (_b = document == null ? void 0 : document.elementFromPoint(toValue(x), toValue(y))) != null ? _b : null;\n };\n const controls = interval === \"requestAnimationFrame\" ? useRafFn(cb, { immediate }) : useIntervalFn(cb, interval, { immediate });\n return {\n isSupported,\n element,\n ...controls\n };\n}\n\nfunction useElementHover(el, options = {}) {\n const {\n delayEnter = 0,\n delayLeave = 0,\n window = defaultWindow\n } = options;\n const isHovered = ref(false);\n let timer;\n const toggle = (entering) => {\n const delay = entering ? delayEnter : delayLeave;\n if (timer) {\n clearTimeout(timer);\n timer = void 0;\n }\n if (delay)\n timer = setTimeout(() => isHovered.value = entering, delay);\n else\n isHovered.value = entering;\n };\n if (!window)\n return isHovered;\n useEventListener(el, \"mouseenter\", () => toggle(true), { passive: true });\n useEventListener(el, \"mouseleave\", () => toggle(false), { passive: true });\n return isHovered;\n}\n\nfunction useElementSize(target, initialSize = { width: 0, height: 0 }, options = {}) {\n const { window = defaultWindow, box = \"content-box\" } = options;\n const isSVG = computed(() => {\n var _a, _b;\n return (_b = (_a = unrefElement(target)) == null ? void 0 : _a.namespaceURI) == null ? void 0 : _b.includes(\"svg\");\n });\n const width = ref(initialSize.width);\n const height = ref(initialSize.height);\n const { stop: stop1 } = useResizeObserver(\n target,\n ([entry]) => {\n const boxSize = box === \"border-box\" ? entry.borderBoxSize : box === \"content-box\" ? entry.contentBoxSize : entry.devicePixelContentBoxSize;\n if (window && isSVG.value) {\n const $elem = unrefElement(target);\n if ($elem) {\n const styles = window.getComputedStyle($elem);\n width.value = Number.parseFloat(styles.width);\n height.value = Number.parseFloat(styles.height);\n }\n } else {\n if (boxSize) {\n const formatBoxSize = Array.isArray(boxSize) ? boxSize : [boxSize];\n width.value = formatBoxSize.reduce((acc, { inlineSize }) => acc + inlineSize, 0);\n height.value = formatBoxSize.reduce((acc, { blockSize }) => acc + blockSize, 0);\n } else {\n width.value = entry.contentRect.width;\n height.value = entry.contentRect.height;\n }\n }\n },\n options\n );\n tryOnMounted(() => {\n const ele = unrefElement(target);\n if (ele) {\n width.value = \"offsetWidth\" in ele ? ele.offsetWidth : initialSize.width;\n height.value = \"offsetHeight\" in ele ? ele.offsetHeight : initialSize.height;\n }\n });\n const stop2 = watch(\n () => unrefElement(target),\n (ele) => {\n width.value = ele ? initialSize.width : 0;\n height.value = ele ? initialSize.height : 0;\n }\n );\n function stop() {\n stop1();\n stop2();\n }\n return {\n width,\n height,\n stop\n };\n}\n\nfunction useIntersectionObserver(target, callback, options = {}) {\n const {\n root,\n rootMargin = \"0px\",\n threshold = 0.1,\n window = defaultWindow,\n immediate = true\n } = options;\n const isSupported = useSupported(() => window && \"IntersectionObserver\" in window);\n const targets = computed(() => {\n const _target = toValue(target);\n return (Array.isArray(_target) ? _target : [_target]).map(unrefElement).filter(notNullish);\n });\n let cleanup = noop;\n const isActive = ref(immediate);\n const stopWatch = isSupported.value ? watch(\n () => [targets.value, unrefElement(root), isActive.value],\n ([targets2, root2]) => {\n cleanup();\n if (!isActive.value)\n return;\n if (!targets2.length)\n return;\n const observer = new IntersectionObserver(\n callback,\n {\n root: unrefElement(root2),\n rootMargin,\n threshold\n }\n );\n targets2.forEach((el) => el && observer.observe(el));\n cleanup = () => {\n observer.disconnect();\n cleanup = noop;\n };\n },\n { immediate, flush: \"post\" }\n ) : noop;\n const stop = () => {\n cleanup();\n stopWatch();\n isActive.value = false;\n };\n tryOnScopeDispose(stop);\n return {\n isSupported,\n isActive,\n pause() {\n cleanup();\n isActive.value = false;\n },\n resume() {\n isActive.value = true;\n },\n stop\n };\n}\n\nfunction useElementVisibility(element, options = {}) {\n const { window = defaultWindow, scrollTarget } = options;\n const elementIsVisible = ref(false);\n useIntersectionObserver(\n element,\n ([{ isIntersecting }]) => {\n elementIsVisible.value = isIntersecting;\n },\n {\n root: scrollTarget,\n window,\n threshold: 0\n }\n );\n return elementIsVisible;\n}\n\nconst events = /* @__PURE__ */ new Map();\n\nfunction useEventBus(key) {\n const scope = getCurrentScope();\n function on(listener) {\n var _a;\n const listeners = events.get(key) || /* @__PURE__ */ new Set();\n listeners.add(listener);\n events.set(key, listeners);\n const _off = () => off(listener);\n (_a = scope == null ? void 0 : scope.cleanups) == null ? void 0 : _a.push(_off);\n return _off;\n }\n function once(listener) {\n function _listener(...args) {\n off(_listener);\n listener(...args);\n }\n return on(_listener);\n }\n function off(listener) {\n const listeners = events.get(key);\n if (!listeners)\n return;\n listeners.delete(listener);\n if (!listeners.size)\n reset();\n }\n function reset() {\n events.delete(key);\n }\n function emit(event, payload) {\n var _a;\n (_a = events.get(key)) == null ? void 0 : _a.forEach((v) => v(event, payload));\n }\n return { on, once, off, emit, reset };\n}\n\nfunction useEventSource(url, events = [], options = {}) {\n const event = ref(null);\n const data = ref(null);\n const status = ref(\"CONNECTING\");\n const eventSource = ref(null);\n const error = shallowRef(null);\n const {\n withCredentials = false\n } = options;\n const close = () => {\n if (eventSource.value) {\n eventSource.value.close();\n eventSource.value = null;\n status.value = \"CLOSED\";\n }\n };\n const es = new EventSource(url, { withCredentials });\n eventSource.value = es;\n es.onopen = () => {\n status.value = \"OPEN\";\n error.value = null;\n };\n es.onerror = (e) => {\n status.value = \"CLOSED\";\n error.value = e;\n };\n es.onmessage = (e) => {\n event.value = null;\n data.value = e.data;\n };\n for (const event_name of events) {\n useEventListener(es, event_name, (e) => {\n event.value = event_name;\n data.value = e.data || null;\n });\n }\n tryOnScopeDispose(() => {\n close();\n });\n return {\n eventSource,\n event,\n data,\n status,\n error,\n close\n };\n}\n\nfunction useEyeDropper(options = {}) {\n const { initialValue = \"\" } = options;\n const isSupported = useSupported(() => typeof window !== \"undefined\" && \"EyeDropper\" in window);\n const sRGBHex = ref(initialValue);\n async function open(openOptions) {\n if (!isSupported.value)\n return;\n const eyeDropper = new window.EyeDropper();\n const result = await eyeDropper.open(openOptions);\n sRGBHex.value = result.sRGBHex;\n return result;\n }\n return { isSupported, sRGBHex, open };\n}\n\nfunction useFavicon(newIcon = null, options = {}) {\n const {\n baseUrl = \"\",\n rel = \"icon\",\n document = defaultDocument\n } = options;\n const favicon = toRef(newIcon);\n const applyIcon = (icon) => {\n const elements = document == null ? void 0 : document.head.querySelectorAll(`link[rel*=\"${rel}\"]`);\n if (!elements || elements.length === 0) {\n const link = document == null ? void 0 : document.createElement(\"link\");\n if (link) {\n link.rel = rel;\n link.href = `${baseUrl}${icon}`;\n link.type = `image/${icon.split(\".\").pop()}`;\n document == null ? void 0 : document.head.append(link);\n }\n return;\n }\n elements == null ? void 0 : elements.forEach((el) => el.href = `${baseUrl}${icon}`);\n };\n watch(\n favicon,\n (i, o) => {\n if (typeof i === \"string\" && i !== o)\n applyIcon(i);\n },\n { immediate: true }\n );\n return favicon;\n}\n\nconst payloadMapping = {\n json: \"application/json\",\n text: \"text/plain\"\n};\nfunction isFetchOptions(obj) {\n return obj && containsProp(obj, \"immediate\", \"refetch\", \"initialData\", \"timeout\", \"beforeFetch\", \"afterFetch\", \"onFetchError\", \"fetch\", \"updateDataOnError\");\n}\nfunction isAbsoluteURL(url) {\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n}\nfunction headersToObject(headers) {\n if (typeof Headers !== \"undefined\" && headers instanceof Headers)\n return Object.fromEntries([...headers.entries()]);\n return headers;\n}\nfunction combineCallbacks(combination, ...callbacks) {\n if (combination === \"overwrite\") {\n return async (ctx) => {\n const callback = callbacks[callbacks.length - 1];\n if (callback)\n return { ...ctx, ...await callback(ctx) };\n return ctx;\n };\n } else {\n return async (ctx) => {\n for (const callback of callbacks) {\n if (callback)\n ctx = { ...ctx, ...await callback(ctx) };\n }\n return ctx;\n };\n }\n}\nfunction createFetch(config = {}) {\n const _combination = config.combination || \"chain\";\n const _options = config.options || {};\n const _fetchOptions = config.fetchOptions || {};\n function useFactoryFetch(url, ...args) {\n const computedUrl = computed(() => {\n const baseUrl = toValue(config.baseUrl);\n const targetUrl = toValue(url);\n return baseUrl && !isAbsoluteURL(targetUrl) ? joinPaths(baseUrl, targetUrl) : targetUrl;\n });\n let options = _options;\n let fetchOptions = _fetchOptions;\n if (args.length > 0) {\n if (isFetchOptions(args[0])) {\n options = {\n ...options,\n ...args[0],\n beforeFetch: combineCallbacks(_combination, _options.beforeFetch, args[0].beforeFetch),\n afterFetch: combineCallbacks(_combination, _options.afterFetch, args[0].afterFetch),\n onFetchError: combineCallbacks(_combination, _options.onFetchError, args[0].onFetchError)\n };\n } else {\n fetchOptions = {\n ...fetchOptions,\n ...args[0],\n headers: {\n ...headersToObject(fetchOptions.headers) || {},\n ...headersToObject(args[0].headers) || {}\n }\n };\n }\n }\n if (args.length > 1 && isFetchOptions(args[1])) {\n options = {\n ...options,\n ...args[1],\n beforeFetch: combineCallbacks(_combination, _options.beforeFetch, args[1].beforeFetch),\n afterFetch: combineCallbacks(_combination, _options.afterFetch, args[1].afterFetch),\n onFetchError: combineCallbacks(_combination, _options.onFetchError, args[1].onFetchError)\n };\n }\n return useFetch(computedUrl, fetchOptions, options);\n }\n return useFactoryFetch;\n}\nfunction useFetch(url, ...args) {\n var _a;\n const supportsAbort = typeof AbortController === \"function\";\n let fetchOptions = {};\n let options = {\n immediate: true,\n refetch: false,\n timeout: 0,\n updateDataOnError: false\n };\n const config = {\n method: \"GET\",\n type: \"text\",\n payload: void 0\n };\n if (args.length > 0) {\n if (isFetchOptions(args[0]))\n options = { ...options, ...args[0] };\n else\n fetchOptions = args[0];\n }\n if (args.length > 1) {\n if (isFetchOptions(args[1]))\n options = { ...options, ...args[1] };\n }\n const {\n fetch = (_a = defaultWindow) == null ? void 0 : _a.fetch,\n initialData,\n timeout\n } = options;\n const responseEvent = createEventHook();\n const errorEvent = createEventHook();\n const finallyEvent = createEventHook();\n const isFinished = ref(false);\n const isFetching = ref(false);\n const aborted = ref(false);\n const statusCode = ref(null);\n const response = shallowRef(null);\n const error = shallowRef(null);\n const data = shallowRef(initialData || null);\n const canAbort = computed(() => supportsAbort && isFetching.value);\n let controller;\n let timer;\n const abort = () => {\n if (supportsAbort) {\n controller == null ? void 0 : controller.abort();\n controller = new AbortController();\n controller.signal.onabort = () => aborted.value = true;\n fetchOptions = {\n ...fetchOptions,\n signal: controller.signal\n };\n }\n };\n const loading = (isLoading) => {\n isFetching.value = isLoading;\n isFinished.value = !isLoading;\n };\n if (timeout)\n timer = useTimeoutFn(abort, timeout, { immediate: false });\n let executeCounter = 0;\n const execute = async (throwOnFailed = false) => {\n var _a2;\n abort();\n loading(true);\n error.value = null;\n statusCode.value = null;\n aborted.value = false;\n executeCounter += 1;\n const currentExecuteCounter = executeCounter;\n const defaultFetchOptions = {\n method: config.method,\n headers: {}\n };\n if (config.payload) {\n const headers = headersToObject(defaultFetchOptions.headers);\n const payload = toValue(config.payload);\n if (!config.payloadType && payload && Object.getPrototypeOf(payload) === Object.prototype && !(payload instanceof FormData))\n config.payloadType = \"json\";\n if (config.payloadType)\n headers[\"Content-Type\"] = (_a2 = payloadMapping[config.payloadType]) != null ? _a2 : config.payloadType;\n defaultFetchOptions.body = config.payloadType === \"json\" ? JSON.stringify(payload) : payload;\n }\n let isCanceled = false;\n const context = {\n url: toValue(url),\n options: {\n ...defaultFetchOptions,\n ...fetchOptions\n },\n cancel: () => {\n isCanceled = true;\n }\n };\n if (options.beforeFetch)\n Object.assign(context, await options.beforeFetch(context));\n if (isCanceled || !fetch) {\n loading(false);\n return Promise.resolve(null);\n }\n let responseData = null;\n if (timer)\n timer.start();\n return new Promise((resolve, reject) => {\n var _a3;\n fetch(\n context.url,\n {\n ...defaultFetchOptions,\n ...context.options,\n headers: {\n ...headersToObject(defaultFetchOptions.headers),\n ...headersToObject((_a3 = context.options) == null ? void 0 : _a3.headers)\n }\n }\n ).then(async (fetchResponse) => {\n response.value = fetchResponse;\n statusCode.value = fetchResponse.status;\n responseData = await fetchResponse[config.type]();\n if (!fetchResponse.ok) {\n data.value = initialData || null;\n throw new Error(fetchResponse.statusText);\n }\n if (options.afterFetch) {\n ({ data: responseData } = await options.afterFetch({\n data: responseData,\n response: fetchResponse\n }));\n }\n data.value = responseData;\n responseEvent.trigger(fetchResponse);\n return resolve(fetchResponse);\n }).catch(async (fetchError) => {\n let errorData = fetchError.message || fetchError.name;\n if (options.onFetchError) {\n ({ error: errorData, data: responseData } = await options.onFetchError({\n data: responseData,\n error: fetchError,\n response: response.value\n }));\n }\n error.value = errorData;\n if (options.updateDataOnError)\n data.value = responseData;\n errorEvent.trigger(fetchError);\n if (throwOnFailed)\n return reject(fetchError);\n return resolve(null);\n }).finally(() => {\n if (currentExecuteCounter === executeCounter)\n loading(false);\n if (timer)\n timer.stop();\n finallyEvent.trigger(null);\n });\n });\n };\n const refetch = toRef(options.refetch);\n watch(\n [\n refetch,\n toRef(url)\n ],\n ([refetch2]) => refetch2 && execute(),\n { deep: true }\n );\n const shell = {\n isFinished,\n statusCode,\n response,\n error,\n data,\n isFetching,\n canAbort,\n aborted,\n abort,\n execute,\n onFetchResponse: responseEvent.on,\n onFetchError: errorEvent.on,\n onFetchFinally: finallyEvent.on,\n // method\n get: setMethod(\"GET\"),\n put: setMethod(\"PUT\"),\n post: setMethod(\"POST\"),\n delete: setMethod(\"DELETE\"),\n patch: setMethod(\"PATCH\"),\n head: setMethod(\"HEAD\"),\n options: setMethod(\"OPTIONS\"),\n // type\n json: setType(\"json\"),\n text: setType(\"text\"),\n blob: setType(\"blob\"),\n arrayBuffer: setType(\"arrayBuffer\"),\n formData: setType(\"formData\")\n };\n function setMethod(method) {\n return (payload, payloadType) => {\n if (!isFetching.value) {\n config.method = method;\n config.payload = payload;\n config.payloadType = payloadType;\n if (isRef(config.payload)) {\n watch(\n [\n refetch,\n toRef(config.payload)\n ],\n ([refetch2]) => refetch2 && execute(),\n { deep: true }\n );\n }\n return {\n ...shell,\n then(onFulfilled, onRejected) {\n return waitUntilFinished().then(onFulfilled, onRejected);\n }\n };\n }\n return void 0;\n };\n }\n function waitUntilFinished() {\n return new Promise((resolve, reject) => {\n until(isFinished).toBe(true).then(() => resolve(shell)).catch((error2) => reject(error2));\n });\n }\n function setType(type) {\n return () => {\n if (!isFetching.value) {\n config.type = type;\n return {\n ...shell,\n then(onFulfilled, onRejected) {\n return waitUntilFinished().then(onFulfilled, onRejected);\n }\n };\n }\n return void 0;\n };\n }\n if (options.immediate)\n Promise.resolve().then(() => execute());\n return {\n ...shell,\n then(onFulfilled, onRejected) {\n return waitUntilFinished().then(onFulfilled, onRejected);\n }\n };\n}\nfunction joinPaths(start, end) {\n if (!start.endsWith(\"/\") && !end.startsWith(\"/\"))\n return `${start}/${end}`;\n return `${start}${end}`;\n}\n\nconst DEFAULT_OPTIONS = {\n multiple: true,\n accept: \"*\",\n reset: false,\n directory: false\n};\nfunction useFileDialog(options = {}) {\n const {\n document = defaultDocument\n } = options;\n const files = ref(null);\n const { on: onChange, trigger } = createEventHook();\n let input;\n if (document) {\n input = document.createElement(\"input\");\n input.type = \"file\";\n input.onchange = (event) => {\n const result = event.target;\n files.value = result.files;\n trigger(files.value);\n };\n }\n const reset = () => {\n files.value = null;\n if (input)\n input.value = \"\";\n };\n const open = (localOptions) => {\n if (!input)\n return;\n const _options = {\n ...DEFAULT_OPTIONS,\n ...options,\n ...localOptions\n };\n input.multiple = _options.multiple;\n input.accept = _options.accept;\n input.webkitdirectory = _options.directory;\n if (hasOwn(_options, \"capture\"))\n input.capture = _options.capture;\n if (_options.reset)\n reset();\n input.click();\n };\n return {\n files: readonly(files),\n open,\n reset,\n onChange\n };\n}\n\nfunction useFileSystemAccess(options = {}) {\n const {\n window: _window = defaultWindow,\n dataType = \"Text\"\n } = options;\n const window = _window;\n const isSupported = useSupported(() => window && \"showSaveFilePicker\" in window && \"showOpenFilePicker\" in window);\n const fileHandle = ref();\n const data = ref();\n const file = ref();\n const fileName = computed(() => {\n var _a, _b;\n return (_b = (_a = file.value) == null ? void 0 : _a.name) != null ? _b : \"\";\n });\n const fileMIME = computed(() => {\n var _a, _b;\n return (_b = (_a = file.value) == null ? void 0 : _a.type) != null ? _b : \"\";\n });\n const fileSize = computed(() => {\n var _a, _b;\n return (_b = (_a = file.value) == null ? void 0 : _a.size) != null ? _b : 0;\n });\n const fileLastModified = computed(() => {\n var _a, _b;\n return (_b = (_a = file.value) == null ? void 0 : _a.lastModified) != null ? _b : 0;\n });\n async function open(_options = {}) {\n if (!isSupported.value)\n return;\n const [handle] = await window.showOpenFilePicker({ ...toValue(options), ..._options });\n fileHandle.value = handle;\n await updateFile();\n await updateData();\n }\n async function create(_options = {}) {\n if (!isSupported.value)\n return;\n fileHandle.value = await window.showSaveFilePicker({ ...options, ..._options });\n data.value = void 0;\n await updateFile();\n await updateData();\n }\n async function save(_options = {}) {\n if (!isSupported.value)\n return;\n if (!fileHandle.value)\n return saveAs(_options);\n if (data.value) {\n const writableStream = await fileHandle.value.createWritable();\n await writableStream.write(data.value);\n await writableStream.close();\n }\n await updateFile();\n }\n async function saveAs(_options = {}) {\n if (!isSupported.value)\n return;\n fileHandle.value = await window.showSaveFilePicker({ ...options, ..._options });\n if (data.value) {\n const writableStream = await fileHandle.value.createWritable();\n await writableStream.write(data.value);\n await writableStream.close();\n }\n await updateFile();\n }\n async function updateFile() {\n var _a;\n file.value = await ((_a = fileHandle.value) == null ? void 0 : _a.getFile());\n }\n async function updateData() {\n var _a, _b;\n const type = toValue(dataType);\n if (type === \"Text\")\n data.value = await ((_a = file.value) == null ? void 0 : _a.text());\n else if (type === \"ArrayBuffer\")\n data.value = await ((_b = file.value) == null ? void 0 : _b.arrayBuffer());\n else if (type === \"Blob\")\n data.value = file.value;\n }\n watch(() => toValue(dataType), updateData);\n return {\n isSupported,\n data,\n file,\n fileName,\n fileMIME,\n fileSize,\n fileLastModified,\n open,\n create,\n save,\n saveAs,\n updateData\n };\n}\n\nfunction useFocus(target, options = {}) {\n const { initialValue = false, focusVisible = false } = options;\n const innerFocused = ref(false);\n const targetElement = computed(() => unrefElement(target));\n useEventListener(targetElement, \"focus\", (event) => {\n var _a, _b;\n if (!focusVisible || ((_b = (_a = event.target).matches) == null ? void 0 : _b.call(_a, \":focus-visible\")))\n innerFocused.value = true;\n });\n useEventListener(targetElement, \"blur\", () => innerFocused.value = false);\n const focused = computed({\n get: () => innerFocused.value,\n set(value) {\n var _a, _b;\n if (!value && innerFocused.value)\n (_a = targetElement.value) == null ? void 0 : _a.blur();\n else if (value && !innerFocused.value)\n (_b = targetElement.value) == null ? void 0 : _b.focus();\n }\n });\n watch(\n targetElement,\n () => {\n focused.value = initialValue;\n },\n { immediate: true, flush: \"post\" }\n );\n return { focused };\n}\n\nfunction useFocusWithin(target, options = {}) {\n const activeElement = useActiveElement(options);\n const targetElement = computed(() => unrefElement(target));\n const focused = computed(() => targetElement.value && activeElement.value ? targetElement.value.contains(activeElement.value) : false);\n return { focused };\n}\n\nfunction useFps(options) {\n var _a;\n const fps = ref(0);\n if (typeof performance === \"undefined\")\n return fps;\n const every = (_a = options == null ? void 0 : options.every) != null ? _a : 10;\n let last = performance.now();\n let ticks = 0;\n useRafFn(() => {\n ticks += 1;\n if (ticks >= every) {\n const now = performance.now();\n const diff = now - last;\n fps.value = Math.round(1e3 / (diff / ticks));\n last = now;\n ticks = 0;\n }\n });\n return fps;\n}\n\nconst eventHandlers = [\n \"fullscreenchange\",\n \"webkitfullscreenchange\",\n \"webkitendfullscreen\",\n \"mozfullscreenchange\",\n \"MSFullscreenChange\"\n];\nfunction useFullscreen(target, options = {}) {\n const {\n document = defaultDocument,\n autoExit = false\n } = options;\n const targetRef = computed(() => {\n var _a;\n return (_a = unrefElement(target)) != null ? _a : document == null ? void 0 : document.querySelector(\"html\");\n });\n const isFullscreen = ref(false);\n const requestMethod = computed(() => {\n return [\n \"requestFullscreen\",\n \"webkitRequestFullscreen\",\n \"webkitEnterFullscreen\",\n \"webkitEnterFullScreen\",\n \"webkitRequestFullScreen\",\n \"mozRequestFullScreen\",\n \"msRequestFullscreen\"\n ].find((m) => document && m in document || targetRef.value && m in targetRef.value);\n });\n const exitMethod = computed(() => {\n return [\n \"exitFullscreen\",\n \"webkitExitFullscreen\",\n \"webkitExitFullScreen\",\n \"webkitCancelFullScreen\",\n \"mozCancelFullScreen\",\n \"msExitFullscreen\"\n ].find((m) => document && m in document || targetRef.value && m in targetRef.value);\n });\n const fullscreenEnabled = computed(() => {\n return [\n \"fullScreen\",\n \"webkitIsFullScreen\",\n \"webkitDisplayingFullscreen\",\n \"mozFullScreen\",\n \"msFullscreenElement\"\n ].find((m) => document && m in document || targetRef.value && m in targetRef.value);\n });\n const fullscreenElementMethod = [\n \"fullscreenElement\",\n \"webkitFullscreenElement\",\n \"mozFullScreenElement\",\n \"msFullscreenElement\"\n ].find((m) => document && m in document);\n const isSupported = useSupported(() => targetRef.value && document && requestMethod.value !== void 0 && exitMethod.value !== void 0 && fullscreenEnabled.value !== void 0);\n const isCurrentElementFullScreen = () => {\n if (fullscreenElementMethod)\n return (document == null ? void 0 : document[fullscreenElementMethod]) === targetRef.value;\n return false;\n };\n const isElementFullScreen = () => {\n if (fullscreenEnabled.value) {\n if (document && document[fullscreenEnabled.value] != null) {\n return document[fullscreenEnabled.value];\n } else {\n const target2 = targetRef.value;\n if ((target2 == null ? void 0 : target2[fullscreenEnabled.value]) != null) {\n return Boolean(target2[fullscreenEnabled.value]);\n }\n }\n }\n return false;\n };\n async function exit() {\n if (!isSupported.value || !isFullscreen.value)\n return;\n if (exitMethod.value) {\n if ((document == null ? void 0 : document[exitMethod.value]) != null) {\n await document[exitMethod.value]();\n } else {\n const target2 = targetRef.value;\n if ((target2 == null ? void 0 : target2[exitMethod.value]) != null)\n await target2[exitMethod.value]();\n }\n }\n isFullscreen.value = false;\n }\n async function enter() {\n if (!isSupported.value || isFullscreen.value)\n return;\n if (isElementFullScreen())\n await exit();\n const target2 = targetRef.value;\n if (requestMethod.value && (target2 == null ? void 0 : target2[requestMethod.value]) != null) {\n await target2[requestMethod.value]();\n isFullscreen.value = true;\n }\n }\n async function toggle() {\n await (isFullscreen.value ? exit() : enter());\n }\n const handlerCallback = () => {\n const isElementFullScreenValue = isElementFullScreen();\n if (!isElementFullScreenValue || isElementFullScreenValue && isCurrentElementFullScreen())\n isFullscreen.value = isElementFullScreenValue;\n };\n useEventListener(document, eventHandlers, handlerCallback, false);\n useEventListener(() => unrefElement(targetRef), eventHandlers, handlerCallback, false);\n if (autoExit)\n tryOnScopeDispose(exit);\n return {\n isSupported,\n isFullscreen,\n enter,\n exit,\n toggle\n };\n}\n\nfunction mapGamepadToXbox360Controller(gamepad) {\n return computed(() => {\n if (gamepad.value) {\n return {\n buttons: {\n a: gamepad.value.buttons[0],\n b: gamepad.value.buttons[1],\n x: gamepad.value.buttons[2],\n y: gamepad.value.buttons[3]\n },\n bumper: {\n left: gamepad.value.buttons[4],\n right: gamepad.value.buttons[5]\n },\n triggers: {\n left: gamepad.value.buttons[6],\n right: gamepad.value.buttons[7]\n },\n stick: {\n left: {\n horizontal: gamepad.value.axes[0],\n vertical: gamepad.value.axes[1],\n button: gamepad.value.buttons[10]\n },\n right: {\n horizontal: gamepad.value.axes[2],\n vertical: gamepad.value.axes[3],\n button: gamepad.value.buttons[11]\n }\n },\n dpad: {\n up: gamepad.value.buttons[12],\n down: gamepad.value.buttons[13],\n left: gamepad.value.buttons[14],\n right: gamepad.value.buttons[15]\n },\n back: gamepad.value.buttons[8],\n start: gamepad.value.buttons[9]\n };\n }\n return null;\n });\n}\nfunction useGamepad(options = {}) {\n const {\n navigator = defaultNavigator\n } = options;\n const isSupported = useSupported(() => navigator && \"getGamepads\" in navigator);\n const gamepads = ref([]);\n const onConnectedHook = createEventHook();\n const onDisconnectedHook = createEventHook();\n const stateFromGamepad = (gamepad) => {\n const hapticActuators = [];\n const vibrationActuator = \"vibrationActuator\" in gamepad ? gamepad.vibrationActuator : null;\n if (vibrationActuator)\n hapticActuators.push(vibrationActuator);\n if (gamepad.hapticActuators)\n hapticActuators.push(...gamepad.hapticActuators);\n return {\n ...gamepad,\n id: gamepad.id,\n hapticActuators,\n axes: gamepad.axes.map((axes) => axes),\n buttons: gamepad.buttons.map((button) => ({ pressed: button.pressed, touched: button.touched, value: button.value }))\n };\n };\n const updateGamepadState = () => {\n const _gamepads = (navigator == null ? void 0 : navigator.getGamepads()) || [];\n for (let i = 0; i < _gamepads.length; ++i) {\n const gamepad = _gamepads[i];\n if (gamepad) {\n const index = gamepads.value.findIndex(({ index: index2 }) => index2 === gamepad.index);\n if (index > -1)\n gamepads.value[index] = stateFromGamepad(gamepad);\n }\n }\n };\n const { isActive, pause, resume } = useRafFn(updateGamepadState);\n const onGamepadConnected = (gamepad) => {\n if (!gamepads.value.some(({ index }) => index === gamepad.index)) {\n gamepads.value.push(stateFromGamepad(gamepad));\n onConnectedHook.trigger(gamepad.index);\n }\n resume();\n };\n const onGamepadDisconnected = (gamepad) => {\n gamepads.value = gamepads.value.filter((x) => x.index !== gamepad.index);\n onDisconnectedHook.trigger(gamepad.index);\n };\n useEventListener(\"gamepadconnected\", (e) => onGamepadConnected(e.gamepad));\n useEventListener(\"gamepaddisconnected\", (e) => onGamepadDisconnected(e.gamepad));\n tryOnMounted(() => {\n const _gamepads = (navigator == null ? void 0 : navigator.getGamepads()) || [];\n if (_gamepads) {\n for (let i = 0; i < _gamepads.length; ++i) {\n const gamepad = _gamepads[i];\n if (gamepad)\n onGamepadConnected(gamepad);\n }\n }\n });\n pause();\n return {\n isSupported,\n onConnected: onConnectedHook.on,\n onDisconnected: onDisconnectedHook.on,\n gamepads,\n pause,\n resume,\n isActive\n };\n}\n\nfunction useGeolocation(options = {}) {\n const {\n enableHighAccuracy = true,\n maximumAge = 3e4,\n timeout = 27e3,\n navigator = defaultNavigator,\n immediate = true\n } = options;\n const isSupported = useSupported(() => navigator && \"geolocation\" in navigator);\n const locatedAt = ref(null);\n const error = shallowRef(null);\n const coords = ref({\n accuracy: 0,\n latitude: Number.POSITIVE_INFINITY,\n longitude: Number.POSITIVE_INFINITY,\n altitude: null,\n altitudeAccuracy: null,\n heading: null,\n speed: null\n });\n function updatePosition(position) {\n locatedAt.value = position.timestamp;\n coords.value = position.coords;\n error.value = null;\n }\n let watcher;\n function resume() {\n if (isSupported.value) {\n watcher = navigator.geolocation.watchPosition(\n updatePosition,\n (err) => error.value = err,\n {\n enableHighAccuracy,\n maximumAge,\n timeout\n }\n );\n }\n }\n if (immediate)\n resume();\n function pause() {\n if (watcher && navigator)\n navigator.geolocation.clearWatch(watcher);\n }\n tryOnScopeDispose(() => {\n pause();\n });\n return {\n isSupported,\n coords,\n locatedAt,\n error,\n resume,\n pause\n };\n}\n\nconst defaultEvents$1 = [\"mousemove\", \"mousedown\", \"resize\", \"keydown\", \"touchstart\", \"wheel\"];\nconst oneMinute = 6e4;\nfunction useIdle(timeout = oneMinute, options = {}) {\n const {\n initialState = false,\n listenForVisibilityChange = true,\n events = defaultEvents$1,\n window = defaultWindow,\n eventFilter = throttleFilter(50)\n } = options;\n const idle = ref(initialState);\n const lastActive = ref(timestamp());\n let timer;\n const reset = () => {\n idle.value = false;\n clearTimeout(timer);\n timer = setTimeout(() => idle.value = true, timeout);\n };\n const onEvent = createFilterWrapper(\n eventFilter,\n () => {\n lastActive.value = timestamp();\n reset();\n }\n );\n if (window) {\n const document = window.document;\n for (const event of events)\n useEventListener(window, event, onEvent, { passive: true });\n if (listenForVisibilityChange) {\n useEventListener(document, \"visibilitychange\", () => {\n if (!document.hidden)\n onEvent();\n });\n }\n reset();\n }\n return {\n idle,\n lastActive,\n reset\n };\n}\n\nasync function loadImage(options) {\n return new Promise((resolve, reject) => {\n const img = new Image();\n const { src, srcset, sizes, class: clazz, loading, crossorigin, referrerPolicy } = options;\n img.src = src;\n if (srcset)\n img.srcset = srcset;\n if (sizes)\n img.sizes = sizes;\n if (clazz)\n img.className = clazz;\n if (loading)\n img.loading = loading;\n if (crossorigin)\n img.crossOrigin = crossorigin;\n if (referrerPolicy)\n img.referrerPolicy = referrerPolicy;\n img.onload = () => resolve(img);\n img.onerror = reject;\n });\n}\nfunction useImage(options, asyncStateOptions = {}) {\n const state = useAsyncState(\n () => loadImage(toValue(options)),\n void 0,\n {\n resetOnExecute: true,\n ...asyncStateOptions\n }\n );\n watch(\n () => toValue(options),\n () => state.execute(asyncStateOptions.delay),\n { deep: true }\n );\n return state;\n}\n\nconst ARRIVED_STATE_THRESHOLD_PIXELS = 1;\nfunction useScroll(element, options = {}) {\n const {\n throttle = 0,\n idle = 200,\n onStop = noop,\n onScroll = noop,\n offset = {\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n },\n eventListenerOptions = {\n capture: false,\n passive: true\n },\n behavior = \"auto\",\n window = defaultWindow\n } = options;\n const internalX = ref(0);\n const internalY = ref(0);\n const x = computed({\n get() {\n return internalX.value;\n },\n set(x2) {\n scrollTo(x2, void 0);\n }\n });\n const y = computed({\n get() {\n return internalY.value;\n },\n set(y2) {\n scrollTo(void 0, y2);\n }\n });\n function scrollTo(_x, _y) {\n var _a, _b, _c;\n if (!window)\n return;\n const _element = toValue(element);\n if (!_element)\n return;\n (_c = _element instanceof Document ? window.document.body : _element) == null ? void 0 : _c.scrollTo({\n top: (_a = toValue(_y)) != null ? _a : y.value,\n left: (_b = toValue(_x)) != null ? _b : x.value,\n behavior: toValue(behavior)\n });\n }\n const isScrolling = ref(false);\n const arrivedState = reactive({\n left: true,\n right: false,\n top: true,\n bottom: false\n });\n const directions = reactive({\n left: false,\n right: false,\n top: false,\n bottom: false\n });\n const onScrollEnd = (e) => {\n if (!isScrolling.value)\n return;\n isScrolling.value = false;\n directions.left = false;\n directions.right = false;\n directions.top = false;\n directions.bottom = false;\n onStop(e);\n };\n const onScrollEndDebounced = useDebounceFn(onScrollEnd, throttle + idle);\n const setArrivedState = (target) => {\n var _a;\n if (!window)\n return;\n const el = target.document ? target.document.documentElement : (_a = target.documentElement) != null ? _a : target;\n const { display, flexDirection } = getComputedStyle(el);\n const scrollLeft = el.scrollLeft;\n directions.left = scrollLeft < internalX.value;\n directions.right = scrollLeft > internalX.value;\n const left = Math.abs(scrollLeft) <= 0 + (offset.left || 0);\n const right = Math.abs(scrollLeft) + el.clientWidth >= el.scrollWidth - (offset.right || 0) - ARRIVED_STATE_THRESHOLD_PIXELS;\n if (display === \"flex\" && flexDirection === \"row-reverse\") {\n arrivedState.left = right;\n arrivedState.right = left;\n } else {\n arrivedState.left = left;\n arrivedState.right = right;\n }\n internalX.value = scrollLeft;\n let scrollTop = el.scrollTop;\n if (target === window.document && !scrollTop)\n scrollTop = window.document.body.scrollTop;\n directions.top = scrollTop < internalY.value;\n directions.bottom = scrollTop > internalY.value;\n const top = Math.abs(scrollTop) <= 0 + (offset.top || 0);\n const bottom = Math.abs(scrollTop) + el.clientHeight >= el.scrollHeight - (offset.bottom || 0) - ARRIVED_STATE_THRESHOLD_PIXELS;\n if (display === \"flex\" && flexDirection === \"column-reverse\") {\n arrivedState.top = bottom;\n arrivedState.bottom = top;\n } else {\n arrivedState.top = top;\n arrivedState.bottom = bottom;\n }\n internalY.value = scrollTop;\n };\n const onScrollHandler = (e) => {\n var _a;\n if (!window)\n return;\n const eventTarget = (_a = e.target.documentElement) != null ? _a : e.target;\n setArrivedState(eventTarget);\n isScrolling.value = true;\n onScrollEndDebounced(e);\n onScroll(e);\n };\n useEventListener(\n element,\n \"scroll\",\n throttle ? useThrottleFn(onScrollHandler, throttle, true, false) : onScrollHandler,\n eventListenerOptions\n );\n tryOnMounted(() => {\n const _element = toValue(element);\n if (!_element)\n return;\n setArrivedState(_element);\n });\n useEventListener(\n element,\n \"scrollend\",\n onScrollEnd,\n eventListenerOptions\n );\n return {\n x,\n y,\n isScrolling,\n arrivedState,\n directions,\n measure() {\n const _element = toValue(element);\n if (window && _element)\n setArrivedState(_element);\n }\n };\n}\n\nfunction resolveElement(el) {\n if (typeof Window !== \"undefined\" && el instanceof Window)\n return el.document.documentElement;\n if (typeof Document !== \"undefined\" && el instanceof Document)\n return el.documentElement;\n return el;\n}\n\nfunction useInfiniteScroll(element, onLoadMore, options = {}) {\n var _a;\n const {\n direction = \"bottom\",\n interval = 100\n } = options;\n const state = reactive(useScroll(\n element,\n {\n ...options,\n offset: {\n [direction]: (_a = options.distance) != null ? _a : 0,\n ...options.offset\n }\n }\n ));\n const promise = ref();\n const isLoading = computed(() => !!promise.value);\n const observedElement = computed(() => {\n return resolveElement(toValue(element));\n });\n const isElementVisible = useElementVisibility(observedElement);\n function checkAndLoad() {\n state.measure();\n if (!observedElement.value || !isElementVisible.value)\n return;\n const { scrollHeight, clientHeight, scrollWidth, clientWidth } = observedElement.value;\n const isNarrower = direction === \"bottom\" || direction === \"top\" ? scrollHeight <= clientHeight : scrollWidth <= clientWidth;\n if (state.arrivedState[direction] || isNarrower) {\n if (!promise.value) {\n promise.value = Promise.all([\n onLoadMore(state),\n new Promise((resolve) => setTimeout(resolve, interval))\n ]).finally(() => {\n promise.value = null;\n nextTick(() => checkAndLoad());\n });\n }\n }\n }\n watch(\n () => [state.arrivedState[direction], isElementVisible.value],\n checkAndLoad,\n { immediate: true }\n );\n return {\n isLoading\n };\n}\n\nconst defaultEvents = [\"mousedown\", \"mouseup\", \"keydown\", \"keyup\"];\nfunction useKeyModifier(modifier, options = {}) {\n const {\n events = defaultEvents,\n document = defaultDocument,\n initial = null\n } = options;\n const state = ref(initial);\n if (document) {\n events.forEach((listenerEvent) => {\n useEventListener(document, listenerEvent, (evt) => {\n if (typeof evt.getModifierState === \"function\")\n state.value = evt.getModifierState(modifier);\n });\n });\n }\n return state;\n}\n\nfunction useLocalStorage(key, initialValue, options = {}) {\n const { window = defaultWindow } = options;\n return useStorage(key, initialValue, window == null ? void 0 : window.localStorage, options);\n}\n\nconst DefaultMagicKeysAliasMap = {\n ctrl: \"control\",\n command: \"meta\",\n cmd: \"meta\",\n option: \"alt\",\n up: \"arrowup\",\n down: \"arrowdown\",\n left: \"arrowleft\",\n right: \"arrowright\"\n};\n\nfunction useMagicKeys(options = {}) {\n const {\n reactive: useReactive = false,\n target = defaultWindow,\n aliasMap = DefaultMagicKeysAliasMap,\n passive = true,\n onEventFired = noop\n } = options;\n const current = reactive(/* @__PURE__ */ new Set());\n const obj = {\n toJSON() {\n return {};\n },\n current\n };\n const refs = useReactive ? reactive(obj) : obj;\n const metaDeps = /* @__PURE__ */ new Set();\n const usedKeys = /* @__PURE__ */ new Set();\n function setRefs(key, value) {\n if (key in refs) {\n if (useReactive)\n refs[key] = value;\n else\n refs[key].value = value;\n }\n }\n function reset() {\n current.clear();\n for (const key of usedKeys)\n setRefs(key, false);\n }\n function updateRefs(e, value) {\n var _a, _b;\n const key = (_a = e.key) == null ? void 0 : _a.toLowerCase();\n const code = (_b = e.code) == null ? void 0 : _b.toLowerCase();\n const values = [code, key].filter(Boolean);\n if (key) {\n if (value)\n current.add(key);\n else\n current.delete(key);\n }\n for (const key2 of values) {\n usedKeys.add(key2);\n setRefs(key2, value);\n }\n if (key === \"meta\" && !value) {\n metaDeps.forEach((key2) => {\n current.delete(key2);\n setRefs(key2, false);\n });\n metaDeps.clear();\n } else if (typeof e.getModifierState === \"function\" && e.getModifierState(\"Meta\") && value) {\n [...current, ...values].forEach((key2) => metaDeps.add(key2));\n }\n }\n useEventListener(target, \"keydown\", (e) => {\n updateRefs(e, true);\n return onEventFired(e);\n }, { passive });\n useEventListener(target, \"keyup\", (e) => {\n updateRefs(e, false);\n return onEventFired(e);\n }, { passive });\n useEventListener(\"blur\", reset, { passive: true });\n useEventListener(\"focus\", reset, { passive: true });\n const proxy = new Proxy(\n refs,\n {\n get(target2, prop, rec) {\n if (typeof prop !== \"string\")\n return Reflect.get(target2, prop, rec);\n prop = prop.toLowerCase();\n if (prop in aliasMap)\n prop = aliasMap[prop];\n if (!(prop in refs)) {\n if (/[+_-]/.test(prop)) {\n const keys = prop.split(/[+_-]/g).map((i) => i.trim());\n refs[prop] = computed(() => keys.every((key) => toValue(proxy[key])));\n } else {\n refs[prop] = ref(false);\n }\n }\n const r = Reflect.get(target2, prop, rec);\n return useReactive ? toValue(r) : r;\n }\n }\n );\n return proxy;\n}\n\nfunction usingElRef(source, cb) {\n if (toValue(source))\n cb(toValue(source));\n}\nfunction timeRangeToArray(timeRanges) {\n let ranges = [];\n for (let i = 0; i < timeRanges.length; ++i)\n ranges = [...ranges, [timeRanges.start(i), timeRanges.end(i)]];\n return ranges;\n}\nfunction tracksToArray(tracks) {\n return Array.from(tracks).map(({ label, kind, language, mode, activeCues, cues, inBandMetadataTrackDispatchType }, id) => ({ id, label, kind, language, mode, activeCues, cues, inBandMetadataTrackDispatchType }));\n}\nconst defaultOptions = {\n src: \"\",\n tracks: []\n};\nfunction useMediaControls(target, options = {}) {\n options = {\n ...defaultOptions,\n ...options\n };\n const {\n document = defaultDocument\n } = options;\n const currentTime = ref(0);\n const duration = ref(0);\n const seeking = ref(false);\n const volume = ref(1);\n const waiting = ref(false);\n const ended = ref(false);\n const playing = ref(false);\n const rate = ref(1);\n const stalled = ref(false);\n const buffered = ref([]);\n const tracks = ref([]);\n const selectedTrack = ref(-1);\n const isPictureInPicture = ref(false);\n const muted = ref(false);\n const supportsPictureInPicture = document && \"pictureInPictureEnabled\" in document;\n const sourceErrorEvent = createEventHook();\n const disableTrack = (track) => {\n usingElRef(target, (el) => {\n if (track) {\n const id = typeof track === \"number\" ? track : track.id;\n el.textTracks[id].mode = \"disabled\";\n } else {\n for (let i = 0; i < el.textTracks.length; ++i)\n el.textTracks[i].mode = \"disabled\";\n }\n selectedTrack.value = -1;\n });\n };\n const enableTrack = (track, disableTracks = true) => {\n usingElRef(target, (el) => {\n const id = typeof track === \"number\" ? track : track.id;\n if (disableTracks)\n disableTrack();\n el.textTracks[id].mode = \"showing\";\n selectedTrack.value = id;\n });\n };\n const togglePictureInPicture = () => {\n return new Promise((resolve, reject) => {\n usingElRef(target, async (el) => {\n if (supportsPictureInPicture) {\n if (!isPictureInPicture.value) {\n el.requestPictureInPicture().then(resolve).catch(reject);\n } else {\n document.exitPictureInPicture().then(resolve).catch(reject);\n }\n }\n });\n });\n };\n watchEffect(() => {\n if (!document)\n return;\n const el = toValue(target);\n if (!el)\n return;\n const src = toValue(options.src);\n let sources = [];\n if (!src)\n return;\n if (typeof src === \"string\")\n sources = [{ src }];\n else if (Array.isArray(src))\n sources = src;\n else if (isObject(src))\n sources = [src];\n el.querySelectorAll(\"source\").forEach((e) => {\n e.removeEventListener(\"error\", sourceErrorEvent.trigger);\n e.remove();\n });\n sources.forEach(({ src: src2, type }) => {\n const source = document.createElement(\"source\");\n source.setAttribute(\"src\", src2);\n source.setAttribute(\"type\", type || \"\");\n source.addEventListener(\"error\", sourceErrorEvent.trigger);\n el.appendChild(source);\n });\n el.load();\n });\n tryOnScopeDispose(() => {\n const el = toValue(target);\n if (!el)\n return;\n el.querySelectorAll(\"source\").forEach((e) => e.removeEventListener(\"error\", sourceErrorEvent.trigger));\n });\n watch([target, volume], () => {\n const el = toValue(target);\n if (!el)\n return;\n el.volume = volume.value;\n });\n watch([target, muted], () => {\n const el = toValue(target);\n if (!el)\n return;\n el.muted = muted.value;\n });\n watch([target, rate], () => {\n const el = toValue(target);\n if (!el)\n return;\n el.playbackRate = rate.value;\n });\n watchEffect(() => {\n if (!document)\n return;\n const textTracks = toValue(options.tracks);\n const el = toValue(target);\n if (!textTracks || !textTracks.length || !el)\n return;\n el.querySelectorAll(\"track\").forEach((e) => e.remove());\n textTracks.forEach(({ default: isDefault, kind, label, src, srcLang }, i) => {\n const track = document.createElement(\"track\");\n track.default = isDefault || false;\n track.kind = kind;\n track.label = label;\n track.src = src;\n track.srclang = srcLang;\n if (track.default)\n selectedTrack.value = i;\n el.appendChild(track);\n });\n });\n const { ignoreUpdates: ignoreCurrentTimeUpdates } = watchIgnorable(currentTime, (time) => {\n const el = toValue(target);\n if (!el)\n return;\n el.currentTime = time;\n });\n const { ignoreUpdates: ignorePlayingUpdates } = watchIgnorable(playing, (isPlaying) => {\n const el = toValue(target);\n if (!el)\n return;\n isPlaying ? el.play() : el.pause();\n });\n useEventListener(target, \"timeupdate\", () => ignoreCurrentTimeUpdates(() => currentTime.value = toValue(target).currentTime));\n useEventListener(target, \"durationchange\", () => duration.value = toValue(target).duration);\n useEventListener(target, \"progress\", () => buffered.value = timeRangeToArray(toValue(target).buffered));\n useEventListener(target, \"seeking\", () => seeking.value = true);\n useEventListener(target, \"seeked\", () => seeking.value = false);\n useEventListener(target, [\"waiting\", \"loadstart\"], () => {\n waiting.value = true;\n ignorePlayingUpdates(() => playing.value = false);\n });\n useEventListener(target, \"loadeddata\", () => waiting.value = false);\n useEventListener(target, \"playing\", () => {\n waiting.value = false;\n ended.value = false;\n ignorePlayingUpdates(() => playing.value = true);\n });\n useEventListener(target, \"ratechange\", () => rate.value = toValue(target).playbackRate);\n useEventListener(target, \"stalled\", () => stalled.value = true);\n useEventListener(target, \"ended\", () => ended.value = true);\n useEventListener(target, \"pause\", () => ignorePlayingUpdates(() => playing.value = false));\n useEventListener(target, \"play\", () => ignorePlayingUpdates(() => playing.value = true));\n useEventListener(target, \"enterpictureinpicture\", () => isPictureInPicture.value = true);\n useEventListener(target, \"leavepictureinpicture\", () => isPictureInPicture.value = false);\n useEventListener(target, \"volumechange\", () => {\n const el = toValue(target);\n if (!el)\n return;\n volume.value = el.volume;\n muted.value = el.muted;\n });\n const listeners = [];\n const stop = watch([target], () => {\n const el = toValue(target);\n if (!el)\n return;\n stop();\n listeners[0] = useEventListener(el.textTracks, \"addtrack\", () => tracks.value = tracksToArray(el.textTracks));\n listeners[1] = useEventListener(el.textTracks, \"removetrack\", () => tracks.value = tracksToArray(el.textTracks));\n listeners[2] = useEventListener(el.textTracks, \"change\", () => tracks.value = tracksToArray(el.textTracks));\n });\n tryOnScopeDispose(() => listeners.forEach((listener) => listener()));\n return {\n currentTime,\n duration,\n waiting,\n seeking,\n ended,\n stalled,\n buffered,\n playing,\n rate,\n // Volume\n volume,\n muted,\n // Tracks\n tracks,\n selectedTrack,\n enableTrack,\n disableTrack,\n // Picture in Picture\n supportsPictureInPicture,\n togglePictureInPicture,\n isPictureInPicture,\n // Events\n onSourceError: sourceErrorEvent.on\n };\n}\n\nfunction getMapVue2Compat() {\n const data = reactive({});\n return {\n get: (key) => data[key],\n set: (key, value) => set(data, key, value),\n has: (key) => hasOwn(data, key),\n delete: (key) => del(data, key),\n clear: () => {\n Object.keys(data).forEach((key) => {\n del(data, key);\n });\n }\n };\n}\nfunction useMemoize(resolver, options) {\n const initCache = () => {\n if (options == null ? void 0 : options.cache)\n return reactive(options.cache);\n if (isVue2)\n return getMapVue2Compat();\n return reactive(/* @__PURE__ */ new Map());\n };\n const cache = initCache();\n const generateKey = (...args) => (options == null ? void 0 : options.getKey) ? options.getKey(...args) : JSON.stringify(args);\n const _loadData = (key, ...args) => {\n cache.set(key, resolver(...args));\n return cache.get(key);\n };\n const loadData = (...args) => _loadData(generateKey(...args), ...args);\n const deleteData = (...args) => {\n cache.delete(generateKey(...args));\n };\n const clearData = () => {\n cache.clear();\n };\n const memoized = (...args) => {\n const key = generateKey(...args);\n if (cache.has(key))\n return cache.get(key);\n return _loadData(key, ...args);\n };\n memoized.load = loadData;\n memoized.delete = deleteData;\n memoized.clear = clearData;\n memoized.generateKey = generateKey;\n memoized.cache = cache;\n return memoized;\n}\n\nfunction useMemory(options = {}) {\n const memory = ref();\n const isSupported = useSupported(() => typeof performance !== \"undefined\" && \"memory\" in performance);\n if (isSupported.value) {\n const { interval = 1e3 } = options;\n useIntervalFn(() => {\n memory.value = performance.memory;\n }, interval, { immediate: options.immediate, immediateCallback: options.immediateCallback });\n }\n return { isSupported, memory };\n}\n\nconst UseMouseBuiltinExtractors = {\n page: (event) => [event.pageX, event.pageY],\n client: (event) => [event.clientX, event.clientY],\n screen: (event) => [event.screenX, event.screenY],\n movement: (event) => event instanceof Touch ? null : [event.movementX, event.movementY]\n};\nfunction useMouse(options = {}) {\n const {\n type = \"page\",\n touch = true,\n resetOnTouchEnds = false,\n initialValue = { x: 0, y: 0 },\n window = defaultWindow,\n target = window,\n scroll = true,\n eventFilter\n } = options;\n let _prevMouseEvent = null;\n const x = ref(initialValue.x);\n const y = ref(initialValue.y);\n const sourceType = ref(null);\n const extractor = typeof type === \"function\" ? type : UseMouseBuiltinExtractors[type];\n const mouseHandler = (event) => {\n const result = extractor(event);\n _prevMouseEvent = event;\n if (result) {\n [x.value, y.value] = result;\n sourceType.value = \"mouse\";\n }\n };\n const touchHandler = (event) => {\n if (event.touches.length > 0) {\n const result = extractor(event.touches[0]);\n if (result) {\n [x.value, y.value] = result;\n sourceType.value = \"touch\";\n }\n }\n };\n const scrollHandler = () => {\n if (!_prevMouseEvent || !window)\n return;\n const pos = extractor(_prevMouseEvent);\n if (_prevMouseEvent instanceof MouseEvent && pos) {\n x.value = pos[0] + window.scrollX;\n y.value = pos[1] + window.scrollY;\n }\n };\n const reset = () => {\n x.value = initialValue.x;\n y.value = initialValue.y;\n };\n const mouseHandlerWrapper = eventFilter ? (event) => eventFilter(() => mouseHandler(event), {}) : (event) => mouseHandler(event);\n const touchHandlerWrapper = eventFilter ? (event) => eventFilter(() => touchHandler(event), {}) : (event) => touchHandler(event);\n const scrollHandlerWrapper = eventFilter ? () => eventFilter(() => scrollHandler(), {}) : () => scrollHandler();\n if (target) {\n const listenerOptions = { passive: true };\n useEventListener(target, [\"mousemove\", \"dragover\"], mouseHandlerWrapper, listenerOptions);\n if (touch && type !== \"movement\") {\n useEventListener(target, [\"touchstart\", \"touchmove\"], touchHandlerWrapper, listenerOptions);\n if (resetOnTouchEnds)\n useEventListener(target, \"touchend\", reset, listenerOptions);\n }\n if (scroll && type === \"page\")\n useEventListener(window, \"scroll\", scrollHandlerWrapper, { passive: true });\n }\n return {\n x,\n y,\n sourceType\n };\n}\n\nfunction useMouseInElement(target, options = {}) {\n const {\n handleOutside = true,\n window = defaultWindow\n } = options;\n const type = options.type || \"page\";\n const { x, y, sourceType } = useMouse(options);\n const targetRef = ref(target != null ? target : window == null ? void 0 : window.document.body);\n const elementX = ref(0);\n const elementY = ref(0);\n const elementPositionX = ref(0);\n const elementPositionY = ref(0);\n const elementHeight = ref(0);\n const elementWidth = ref(0);\n const isOutside = ref(true);\n let stop = () => {\n };\n if (window) {\n stop = watch(\n [targetRef, x, y],\n () => {\n const el = unrefElement(targetRef);\n if (!el)\n return;\n const {\n left,\n top,\n width,\n height\n } = el.getBoundingClientRect();\n elementPositionX.value = left + (type === \"page\" ? window.pageXOffset : 0);\n elementPositionY.value = top + (type === \"page\" ? window.pageYOffset : 0);\n elementHeight.value = height;\n elementWidth.value = width;\n const elX = x.value - elementPositionX.value;\n const elY = y.value - elementPositionY.value;\n isOutside.value = width === 0 || height === 0 || elX < 0 || elY < 0 || elX > width || elY > height;\n if (handleOutside || !isOutside.value) {\n elementX.value = elX;\n elementY.value = elY;\n }\n },\n { immediate: true }\n );\n useEventListener(document, \"mouseleave\", () => {\n isOutside.value = true;\n });\n }\n return {\n x,\n y,\n sourceType,\n elementX,\n elementY,\n elementPositionX,\n elementPositionY,\n elementHeight,\n elementWidth,\n isOutside,\n stop\n };\n}\n\nfunction useMousePressed(options = {}) {\n const {\n touch = true,\n drag = true,\n capture = false,\n initialValue = false,\n window = defaultWindow\n } = options;\n const pressed = ref(initialValue);\n const sourceType = ref(null);\n if (!window) {\n return {\n pressed,\n sourceType\n };\n }\n const onPressed = (srcType) => () => {\n pressed.value = true;\n sourceType.value = srcType;\n };\n const onReleased = () => {\n pressed.value = false;\n sourceType.value = null;\n };\n const target = computed(() => unrefElement(options.target) || window);\n useEventListener(target, \"mousedown\", onPressed(\"mouse\"), { passive: true, capture });\n useEventListener(window, \"mouseleave\", onReleased, { passive: true, capture });\n useEventListener(window, \"mouseup\", onReleased, { passive: true, capture });\n if (drag) {\n useEventListener(target, \"dragstart\", onPressed(\"mouse\"), { passive: true, capture });\n useEventListener(window, \"drop\", onReleased, { passive: true, capture });\n useEventListener(window, \"dragend\", onReleased, { passive: true, capture });\n }\n if (touch) {\n useEventListener(target, \"touchstart\", onPressed(\"touch\"), { passive: true, capture });\n useEventListener(window, \"touchend\", onReleased, { passive: true, capture });\n useEventListener(window, \"touchcancel\", onReleased, { passive: true, capture });\n }\n return {\n pressed,\n sourceType\n };\n}\n\nfunction useNavigatorLanguage(options = {}) {\n const { window = defaultWindow } = options;\n const navigator = window == null ? void 0 : window.navigator;\n const isSupported = useSupported(() => navigator && \"language\" in navigator);\n const language = ref(navigator == null ? void 0 : navigator.language);\n useEventListener(window, \"languagechange\", () => {\n if (navigator)\n language.value = navigator.language;\n });\n return {\n isSupported,\n language\n };\n}\n\nfunction useNetwork(options = {}) {\n const { window = defaultWindow } = options;\n const navigator = window == null ? void 0 : window.navigator;\n const isSupported = useSupported(() => navigator && \"connection\" in navigator);\n const isOnline = ref(true);\n const saveData = ref(false);\n const offlineAt = ref(void 0);\n const onlineAt = ref(void 0);\n const downlink = ref(void 0);\n const downlinkMax = ref(void 0);\n const rtt = ref(void 0);\n const effectiveType = ref(void 0);\n const type = ref(\"unknown\");\n const connection = isSupported.value && navigator.connection;\n function updateNetworkInformation() {\n if (!navigator)\n return;\n isOnline.value = navigator.onLine;\n offlineAt.value = isOnline.value ? void 0 : Date.now();\n onlineAt.value = isOnline.value ? Date.now() : void 0;\n if (connection) {\n downlink.value = connection.downlink;\n downlinkMax.value = connection.downlinkMax;\n effectiveType.value = connection.effectiveType;\n rtt.value = connection.rtt;\n saveData.value = connection.saveData;\n type.value = connection.type;\n }\n }\n if (window) {\n useEventListener(window, \"offline\", () => {\n isOnline.value = false;\n offlineAt.value = Date.now();\n });\n useEventListener(window, \"online\", () => {\n isOnline.value = true;\n onlineAt.value = Date.now();\n });\n }\n if (connection)\n useEventListener(connection, \"change\", updateNetworkInformation, false);\n updateNetworkInformation();\n return {\n isSupported,\n isOnline,\n saveData,\n offlineAt,\n onlineAt,\n downlink,\n downlinkMax,\n effectiveType,\n rtt,\n type\n };\n}\n\nfunction useNow(options = {}) {\n const {\n controls: exposeControls = false,\n interval = \"requestAnimationFrame\"\n } = options;\n const now = ref(/* @__PURE__ */ new Date());\n const update = () => now.value = /* @__PURE__ */ new Date();\n const controls = interval === \"requestAnimationFrame\" ? useRafFn(update, { immediate: true }) : useIntervalFn(update, interval, { immediate: true });\n if (exposeControls) {\n return {\n now,\n ...controls\n };\n } else {\n return now;\n }\n}\n\nfunction useObjectUrl(object) {\n const url = ref();\n const release = () => {\n if (url.value)\n URL.revokeObjectURL(url.value);\n url.value = void 0;\n };\n watch(\n () => toValue(object),\n (newObject) => {\n release();\n if (newObject)\n url.value = URL.createObjectURL(newObject);\n },\n { immediate: true }\n );\n tryOnScopeDispose(release);\n return readonly(url);\n}\n\nfunction useClamp(value, min, max) {\n if (typeof value === \"function\" || isReadonly(value))\n return computed(() => clamp(toValue(value), toValue(min), toValue(max)));\n const _value = ref(value);\n return computed({\n get() {\n return _value.value = clamp(_value.value, toValue(min), toValue(max));\n },\n set(value2) {\n _value.value = clamp(value2, toValue(min), toValue(max));\n }\n });\n}\n\nfunction useOffsetPagination(options) {\n const {\n total = Number.POSITIVE_INFINITY,\n pageSize = 10,\n page = 1,\n onPageChange = noop,\n onPageSizeChange = noop,\n onPageCountChange = noop\n } = options;\n const currentPageSize = useClamp(pageSize, 1, Number.POSITIVE_INFINITY);\n const pageCount = computed(() => Math.max(\n 1,\n Math.ceil(toValue(total) / toValue(currentPageSize))\n ));\n const currentPage = useClamp(page, 1, pageCount);\n const isFirstPage = computed(() => currentPage.value === 1);\n const isLastPage = computed(() => currentPage.value === pageCount.value);\n if (isRef(page))\n syncRef(page, currentPage);\n if (isRef(pageSize))\n syncRef(pageSize, currentPageSize);\n function prev() {\n currentPage.value--;\n }\n function next() {\n currentPage.value++;\n }\n const returnValue = {\n currentPage,\n currentPageSize,\n pageCount,\n isFirstPage,\n isLastPage,\n prev,\n next\n };\n watch(currentPage, () => {\n onPageChange(reactive(returnValue));\n });\n watch(currentPageSize, () => {\n onPageSizeChange(reactive(returnValue));\n });\n watch(pageCount, () => {\n onPageCountChange(reactive(returnValue));\n });\n return returnValue;\n}\n\nfunction useOnline(options = {}) {\n const { isOnline } = useNetwork(options);\n return isOnline;\n}\n\nfunction usePageLeave(options = {}) {\n const { window = defaultWindow } = options;\n const isLeft = ref(false);\n const handler = (event) => {\n if (!window)\n return;\n event = event || window.event;\n const from = event.relatedTarget || event.toElement;\n isLeft.value = !from;\n };\n if (window) {\n useEventListener(window, \"mouseout\", handler, { passive: true });\n useEventListener(window.document, \"mouseleave\", handler, { passive: true });\n useEventListener(window.document, \"mouseenter\", handler, { passive: true });\n }\n return isLeft;\n}\n\nfunction useParallax(target, options = {}) {\n const {\n deviceOrientationTiltAdjust = (i) => i,\n deviceOrientationRollAdjust = (i) => i,\n mouseTiltAdjust = (i) => i,\n mouseRollAdjust = (i) => i,\n window = defaultWindow\n } = options;\n const orientation = reactive(useDeviceOrientation({ window }));\n const {\n elementX: x,\n elementY: y,\n elementWidth: width,\n elementHeight: height\n } = useMouseInElement(target, { handleOutside: false, window });\n const source = computed(() => {\n if (orientation.isSupported && (orientation.alpha != null && orientation.alpha !== 0 || orientation.gamma != null && orientation.gamma !== 0))\n return \"deviceOrientation\";\n return \"mouse\";\n });\n const roll = computed(() => {\n if (source.value === \"deviceOrientation\") {\n const value = -orientation.beta / 90;\n return deviceOrientationRollAdjust(value);\n } else {\n const value = -(y.value - height.value / 2) / height.value;\n return mouseRollAdjust(value);\n }\n });\n const tilt = computed(() => {\n if (source.value === \"deviceOrientation\") {\n const value = orientation.gamma / 90;\n return deviceOrientationTiltAdjust(value);\n } else {\n const value = (x.value - width.value / 2) / width.value;\n return mouseTiltAdjust(value);\n }\n });\n return { roll, tilt, source };\n}\n\nfunction useParentElement(element = useCurrentElement()) {\n const parentElement = shallowRef();\n const update = () => {\n const el = unrefElement(element);\n if (el)\n parentElement.value = el.parentElement;\n };\n tryOnMounted(update);\n watch(() => toValue(element), update);\n return parentElement;\n}\n\nfunction usePerformanceObserver(options, callback) {\n const {\n window = defaultWindow,\n immediate = true,\n ...performanceOptions\n } = options;\n const isSupported = useSupported(() => window && \"PerformanceObserver\" in window);\n let observer;\n const stop = () => {\n observer == null ? void 0 : observer.disconnect();\n };\n const start = () => {\n if (isSupported.value) {\n stop();\n observer = new PerformanceObserver(callback);\n observer.observe(performanceOptions);\n }\n };\n tryOnScopeDispose(stop);\n if (immediate)\n start();\n return {\n isSupported,\n start,\n stop\n };\n}\n\nconst defaultState = {\n x: 0,\n y: 0,\n pointerId: 0,\n pressure: 0,\n tiltX: 0,\n tiltY: 0,\n width: 0,\n height: 0,\n twist: 0,\n pointerType: null\n};\nconst keys = /* @__PURE__ */ Object.keys(defaultState);\nfunction usePointer(options = {}) {\n const {\n target = defaultWindow\n } = options;\n const isInside = ref(false);\n const state = ref(options.initialValue || {});\n Object.assign(state.value, defaultState, state.value);\n const handler = (event) => {\n isInside.value = true;\n if (options.pointerTypes && !options.pointerTypes.includes(event.pointerType))\n return;\n state.value = objectPick(event, keys, false);\n };\n if (target) {\n const listenerOptions = { passive: true };\n useEventListener(target, [\"pointerdown\", \"pointermove\", \"pointerup\"], handler, listenerOptions);\n useEventListener(target, \"pointerleave\", () => isInside.value = false, listenerOptions);\n }\n return {\n ...toRefs(state),\n isInside\n };\n}\n\nfunction usePointerLock(target, options = {}) {\n const { document = defaultDocument, pointerLockOptions } = options;\n const isSupported = useSupported(() => document && \"pointerLockElement\" in document);\n const element = ref();\n const triggerElement = ref();\n let targetElement;\n if (isSupported.value) {\n useEventListener(document, \"pointerlockchange\", () => {\n var _a;\n const currentElement = (_a = document.pointerLockElement) != null ? _a : element.value;\n if (targetElement && currentElement === targetElement) {\n element.value = document.pointerLockElement;\n if (!element.value)\n targetElement = triggerElement.value = null;\n }\n });\n useEventListener(document, \"pointerlockerror\", () => {\n var _a;\n const currentElement = (_a = document.pointerLockElement) != null ? _a : element.value;\n if (targetElement && currentElement === targetElement) {\n const action = document.pointerLockElement ? \"release\" : \"acquire\";\n throw new Error(`Failed to ${action} pointer lock.`);\n }\n });\n }\n async function lock(e, options2) {\n var _a;\n if (!isSupported.value)\n throw new Error(\"Pointer Lock API is not supported by your browser.\");\n triggerElement.value = e instanceof Event ? e.currentTarget : null;\n targetElement = e instanceof Event ? (_a = unrefElement(target)) != null ? _a : triggerElement.value : unrefElement(e);\n if (!targetElement)\n throw new Error(\"Target element undefined.\");\n targetElement.requestPointerLock(options2 != null ? options2 : pointerLockOptions);\n return await until(element).toBe(targetElement);\n }\n async function unlock() {\n if (!element.value)\n return false;\n document.exitPointerLock();\n await until(element).toBeNull();\n return true;\n }\n return {\n isSupported,\n element,\n triggerElement,\n lock,\n unlock\n };\n}\n\nfunction usePointerSwipe(target, options = {}) {\n const targetRef = toRef(target);\n const {\n threshold = 50,\n onSwipe,\n onSwipeEnd,\n onSwipeStart\n } = options;\n const posStart = reactive({ x: 0, y: 0 });\n const updatePosStart = (x, y) => {\n posStart.x = x;\n posStart.y = y;\n };\n const posEnd = reactive({ x: 0, y: 0 });\n const updatePosEnd = (x, y) => {\n posEnd.x = x;\n posEnd.y = y;\n };\n const distanceX = computed(() => posStart.x - posEnd.x);\n const distanceY = computed(() => posStart.y - posEnd.y);\n const { max, abs } = Math;\n const isThresholdExceeded = computed(() => max(abs(distanceX.value), abs(distanceY.value)) >= threshold);\n const isSwiping = ref(false);\n const isPointerDown = ref(false);\n const direction = computed(() => {\n if (!isThresholdExceeded.value)\n return \"none\";\n if (abs(distanceX.value) > abs(distanceY.value)) {\n return distanceX.value > 0 ? \"left\" : \"right\";\n } else {\n return distanceY.value > 0 ? \"up\" : \"down\";\n }\n });\n const eventIsAllowed = (e) => {\n var _a, _b, _c;\n const isReleasingButton = e.buttons === 0;\n const isPrimaryButton = e.buttons === 1;\n return (_c = (_b = (_a = options.pointerTypes) == null ? void 0 : _a.includes(e.pointerType)) != null ? _b : isReleasingButton || isPrimaryButton) != null ? _c : true;\n };\n const stops = [\n useEventListener(target, \"pointerdown\", (e) => {\n var _a, _b;\n if (!eventIsAllowed(e))\n return;\n isPointerDown.value = true;\n (_b = (_a = targetRef.value) == null ? void 0 : _a.style) == null ? void 0 : _b.setProperty(\"touch-action\", \"none\");\n const eventTarget = e.target;\n eventTarget == null ? void 0 : eventTarget.setPointerCapture(e.pointerId);\n const { clientX: x, clientY: y } = e;\n updatePosStart(x, y);\n updatePosEnd(x, y);\n onSwipeStart == null ? void 0 : onSwipeStart(e);\n }),\n useEventListener(target, \"pointermove\", (e) => {\n if (!eventIsAllowed(e))\n return;\n if (!isPointerDown.value)\n return;\n const { clientX: x, clientY: y } = e;\n updatePosEnd(x, y);\n if (!isSwiping.value && isThresholdExceeded.value)\n isSwiping.value = true;\n if (isSwiping.value)\n onSwipe == null ? void 0 : onSwipe(e);\n }),\n useEventListener(target, \"pointerup\", (e) => {\n var _a, _b;\n if (!eventIsAllowed(e))\n return;\n if (isSwiping.value)\n onSwipeEnd == null ? void 0 : onSwipeEnd(e, direction.value);\n isPointerDown.value = false;\n isSwiping.value = false;\n (_b = (_a = targetRef.value) == null ? void 0 : _a.style) == null ? void 0 : _b.setProperty(\"touch-action\", \"initial\");\n })\n ];\n const stop = () => stops.forEach((s) => s());\n return {\n isSwiping: readonly(isSwiping),\n direction: readonly(direction),\n posStart: readonly(posStart),\n posEnd: readonly(posEnd),\n distanceX,\n distanceY,\n stop\n };\n}\n\nfunction usePreferredColorScheme(options) {\n const isLight = useMediaQuery(\"(prefers-color-scheme: light)\", options);\n const isDark = useMediaQuery(\"(prefers-color-scheme: dark)\", options);\n return computed(() => {\n if (isDark.value)\n return \"dark\";\n if (isLight.value)\n return \"light\";\n return \"no-preference\";\n });\n}\n\nfunction usePreferredContrast(options) {\n const isMore = useMediaQuery(\"(prefers-contrast: more)\", options);\n const isLess = useMediaQuery(\"(prefers-contrast: less)\", options);\n const isCustom = useMediaQuery(\"(prefers-contrast: custom)\", options);\n return computed(() => {\n if (isMore.value)\n return \"more\";\n if (isLess.value)\n return \"less\";\n if (isCustom.value)\n return \"custom\";\n return \"no-preference\";\n });\n}\n\nfunction usePreferredLanguages(options = {}) {\n const { window = defaultWindow } = options;\n if (!window)\n return ref([\"en\"]);\n const navigator = window.navigator;\n const value = ref(navigator.languages);\n useEventListener(window, \"languagechange\", () => {\n value.value = navigator.languages;\n });\n return value;\n}\n\nfunction usePreferredReducedMotion(options) {\n const isReduced = useMediaQuery(\"(prefers-reduced-motion: reduce)\", options);\n return computed(() => {\n if (isReduced.value)\n return \"reduce\";\n return \"no-preference\";\n });\n}\n\nfunction usePrevious(value, initialValue) {\n const previous = shallowRef(initialValue);\n watch(\n toRef(value),\n (_, oldValue) => {\n previous.value = oldValue;\n },\n { flush: \"sync\" }\n );\n return readonly(previous);\n}\n\nfunction useScreenOrientation(options = {}) {\n const {\n window = defaultWindow\n } = options;\n const isSupported = useSupported(() => window && \"screen\" in window && \"orientation\" in window.screen);\n const screenOrientation = isSupported.value ? window.screen.orientation : {};\n const orientation = ref(screenOrientation.type);\n const angle = ref(screenOrientation.angle || 0);\n if (isSupported.value) {\n useEventListener(window, \"orientationchange\", () => {\n orientation.value = screenOrientation.type;\n angle.value = screenOrientation.angle;\n });\n }\n const lockOrientation = (type) => {\n if (!isSupported.value)\n return Promise.reject(new Error(\"Not supported\"));\n return screenOrientation.lock(type);\n };\n const unlockOrientation = () => {\n if (isSupported.value)\n screenOrientation.unlock();\n };\n return {\n isSupported,\n orientation,\n angle,\n lockOrientation,\n unlockOrientation\n };\n}\n\nconst topVarName = \"--vueuse-safe-area-top\";\nconst rightVarName = \"--vueuse-safe-area-right\";\nconst bottomVarName = \"--vueuse-safe-area-bottom\";\nconst leftVarName = \"--vueuse-safe-area-left\";\nfunction useScreenSafeArea() {\n const top = ref(\"\");\n const right = ref(\"\");\n const bottom = ref(\"\");\n const left = ref(\"\");\n if (isClient) {\n const topCssVar = useCssVar(topVarName);\n const rightCssVar = useCssVar(rightVarName);\n const bottomCssVar = useCssVar(bottomVarName);\n const leftCssVar = useCssVar(leftVarName);\n topCssVar.value = \"env(safe-area-inset-top, 0px)\";\n rightCssVar.value = \"env(safe-area-inset-right, 0px)\";\n bottomCssVar.value = \"env(safe-area-inset-bottom, 0px)\";\n leftCssVar.value = \"env(safe-area-inset-left, 0px)\";\n update();\n useEventListener(\"resize\", useDebounceFn(update));\n }\n function update() {\n top.value = getValue(topVarName);\n right.value = getValue(rightVarName);\n bottom.value = getValue(bottomVarName);\n left.value = getValue(leftVarName);\n }\n return {\n top,\n right,\n bottom,\n left,\n update\n };\n}\nfunction getValue(position) {\n return getComputedStyle(document.documentElement).getPropertyValue(position);\n}\n\nfunction useScriptTag(src, onLoaded = noop, options = {}) {\n const {\n immediate = true,\n manual = false,\n type = \"text/javascript\",\n async = true,\n crossOrigin,\n referrerPolicy,\n noModule,\n defer,\n document = defaultDocument,\n attrs = {}\n } = options;\n const scriptTag = ref(null);\n let _promise = null;\n const loadScript = (waitForScriptLoad) => new Promise((resolve, reject) => {\n const resolveWithElement = (el2) => {\n scriptTag.value = el2;\n resolve(el2);\n return el2;\n };\n if (!document) {\n resolve(false);\n return;\n }\n let shouldAppend = false;\n let el = document.querySelector(`script[src=\"${toValue(src)}\"]`);\n if (!el) {\n el = document.createElement(\"script\");\n el.type = type;\n el.async = async;\n el.src = toValue(src);\n if (defer)\n el.defer = defer;\n if (crossOrigin)\n el.crossOrigin = crossOrigin;\n if (noModule)\n el.noModule = noModule;\n if (referrerPolicy)\n el.referrerPolicy = referrerPolicy;\n Object.entries(attrs).forEach(([name, value]) => el == null ? void 0 : el.setAttribute(name, value));\n shouldAppend = true;\n } else if (el.hasAttribute(\"data-loaded\")) {\n resolveWithElement(el);\n }\n el.addEventListener(\"error\", (event) => reject(event));\n el.addEventListener(\"abort\", (event) => reject(event));\n el.addEventListener(\"load\", () => {\n el.setAttribute(\"data-loaded\", \"true\");\n onLoaded(el);\n resolveWithElement(el);\n });\n if (shouldAppend)\n el = document.head.appendChild(el);\n if (!waitForScriptLoad)\n resolveWithElement(el);\n });\n const load = (waitForScriptLoad = true) => {\n if (!_promise)\n _promise = loadScript(waitForScriptLoad);\n return _promise;\n };\n const unload = () => {\n if (!document)\n return;\n _promise = null;\n if (scriptTag.value)\n scriptTag.value = null;\n const el = document.querySelector(`script[src=\"${toValue(src)}\"]`);\n if (el)\n document.head.removeChild(el);\n };\n if (immediate && !manual)\n tryOnMounted(load);\n if (!manual)\n tryOnUnmounted(unload);\n return { scriptTag, load, unload };\n}\n\nfunction checkOverflowScroll(ele) {\n const style = window.getComputedStyle(ele);\n if (style.overflowX === \"scroll\" || style.overflowY === \"scroll\" || style.overflowX === \"auto\" && ele.clientWidth < ele.scrollWidth || style.overflowY === \"auto\" && ele.clientHeight < ele.scrollHeight) {\n return true;\n } else {\n const parent = ele.parentNode;\n if (!parent || parent.tagName === \"BODY\")\n return false;\n return checkOverflowScroll(parent);\n }\n}\nfunction preventDefault(rawEvent) {\n const e = rawEvent || window.event;\n const _target = e.target;\n if (checkOverflowScroll(_target))\n return false;\n if (e.touches.length > 1)\n return true;\n if (e.preventDefault)\n e.preventDefault();\n return false;\n}\nconst elInitialOverflow = /* @__PURE__ */ new WeakMap();\nfunction useScrollLock(element, initialState = false) {\n const isLocked = ref(initialState);\n let stopTouchMoveListener = null;\n let initialOverflow;\n watch(toRef(element), (el) => {\n const target = resolveElement(toValue(el));\n if (target) {\n const ele = target;\n if (!elInitialOverflow.get(ele))\n elInitialOverflow.set(ele, initialOverflow);\n if (isLocked.value)\n ele.style.overflow = \"hidden\";\n }\n }, {\n immediate: true\n });\n const lock = () => {\n const el = resolveElement(toValue(element));\n if (!el || isLocked.value)\n return;\n if (isIOS) {\n stopTouchMoveListener = useEventListener(\n el,\n \"touchmove\",\n (e) => {\n preventDefault(e);\n },\n { passive: false }\n );\n }\n el.style.overflow = \"hidden\";\n isLocked.value = true;\n };\n const unlock = () => {\n var _a;\n const el = resolveElement(toValue(element));\n if (!el || !isLocked.value)\n return;\n isIOS && (stopTouchMoveListener == null ? void 0 : stopTouchMoveListener());\n el.style.overflow = (_a = elInitialOverflow.get(el)) != null ? _a : \"\";\n elInitialOverflow.delete(el);\n isLocked.value = false;\n };\n tryOnScopeDispose(unlock);\n return computed({\n get() {\n return isLocked.value;\n },\n set(v) {\n if (v)\n lock();\n else\n unlock();\n }\n });\n}\n\nfunction useSessionStorage(key, initialValue, options = {}) {\n const { window = defaultWindow } = options;\n return useStorage(key, initialValue, window == null ? void 0 : window.sessionStorage, options);\n}\n\nfunction useShare(shareOptions = {}, options = {}) {\n const { navigator = defaultNavigator } = options;\n const _navigator = navigator;\n const isSupported = useSupported(() => _navigator && \"canShare\" in _navigator);\n const share = async (overrideOptions = {}) => {\n if (isSupported.value) {\n const data = {\n ...toValue(shareOptions),\n ...toValue(overrideOptions)\n };\n let granted = true;\n if (data.files && _navigator.canShare)\n granted = _navigator.canShare({ files: data.files });\n if (granted)\n return _navigator.share(data);\n }\n };\n return {\n isSupported,\n share\n };\n}\n\nconst defaultSortFn = (source, compareFn) => source.sort(compareFn);\nconst defaultCompare = (a, b) => a - b;\nfunction useSorted(...args) {\n var _a, _b, _c, _d;\n const [source] = args;\n let compareFn = defaultCompare;\n let options = {};\n if (args.length === 2) {\n if (typeof args[1] === \"object\") {\n options = args[1];\n compareFn = (_a = options.compareFn) != null ? _a : defaultCompare;\n } else {\n compareFn = (_b = args[1]) != null ? _b : defaultCompare;\n }\n } else if (args.length > 2) {\n compareFn = (_c = args[1]) != null ? _c : defaultCompare;\n options = (_d = args[2]) != null ? _d : {};\n }\n const {\n dirty = false,\n sortFn = defaultSortFn\n } = options;\n if (!dirty)\n return computed(() => sortFn([...toValue(source)], compareFn));\n watchEffect(() => {\n const result = sortFn(toValue(source), compareFn);\n if (isRef(source))\n source.value = result;\n else\n source.splice(0, source.length, ...result);\n });\n return source;\n}\n\nfunction useSpeechRecognition(options = {}) {\n const {\n interimResults = true,\n continuous = true,\n window = defaultWindow\n } = options;\n const lang = toRef(options.lang || \"en-US\");\n const isListening = ref(false);\n const isFinal = ref(false);\n const result = ref(\"\");\n const error = shallowRef(void 0);\n const toggle = (value = !isListening.value) => {\n isListening.value = value;\n };\n const start = () => {\n isListening.value = true;\n };\n const stop = () => {\n isListening.value = false;\n };\n const SpeechRecognition = window && (window.SpeechRecognition || window.webkitSpeechRecognition);\n const isSupported = useSupported(() => SpeechRecognition);\n let recognition;\n if (isSupported.value) {\n recognition = new SpeechRecognition();\n recognition.continuous = continuous;\n recognition.interimResults = interimResults;\n recognition.lang = toValue(lang);\n recognition.onstart = () => {\n isFinal.value = false;\n };\n watch(lang, (lang2) => {\n if (recognition && !isListening.value)\n recognition.lang = lang2;\n });\n recognition.onresult = (event) => {\n const transcript = Array.from(event.results).map((result2) => {\n isFinal.value = result2.isFinal;\n return result2[0];\n }).map((result2) => result2.transcript).join(\"\");\n result.value = transcript;\n error.value = void 0;\n };\n recognition.onerror = (event) => {\n error.value = event;\n };\n recognition.onend = () => {\n isListening.value = false;\n recognition.lang = toValue(lang);\n };\n watch(isListening, () => {\n if (isListening.value)\n recognition.start();\n else\n recognition.stop();\n });\n }\n tryOnScopeDispose(() => {\n isListening.value = false;\n });\n return {\n isSupported,\n isListening,\n isFinal,\n recognition,\n result,\n error,\n toggle,\n start,\n stop\n };\n}\n\nfunction useSpeechSynthesis(text, options = {}) {\n const {\n pitch = 1,\n rate = 1,\n volume = 1,\n window = defaultWindow\n } = options;\n const synth = window && window.speechSynthesis;\n const isSupported = useSupported(() => synth);\n const isPlaying = ref(false);\n const status = ref(\"init\");\n const spokenText = toRef(text || \"\");\n const lang = toRef(options.lang || \"en-US\");\n const error = shallowRef(void 0);\n const toggle = (value = !isPlaying.value) => {\n isPlaying.value = value;\n };\n const bindEventsForUtterance = (utterance2) => {\n utterance2.lang = toValue(lang);\n utterance2.voice = toValue(options.voice) || null;\n utterance2.pitch = toValue(pitch);\n utterance2.rate = toValue(rate);\n utterance2.volume = volume;\n utterance2.onstart = () => {\n isPlaying.value = true;\n status.value = \"play\";\n };\n utterance2.onpause = () => {\n isPlaying.value = false;\n status.value = \"pause\";\n };\n utterance2.onresume = () => {\n isPlaying.value = true;\n status.value = \"play\";\n };\n utterance2.onend = () => {\n isPlaying.value = false;\n status.value = \"end\";\n };\n utterance2.onerror = (event) => {\n error.value = event;\n };\n };\n const utterance = computed(() => {\n isPlaying.value = false;\n status.value = \"init\";\n const newUtterance = new SpeechSynthesisUtterance(spokenText.value);\n bindEventsForUtterance(newUtterance);\n return newUtterance;\n });\n const speak = () => {\n synth.cancel();\n utterance && synth.speak(utterance.value);\n };\n const stop = () => {\n synth.cancel();\n isPlaying.value = false;\n };\n if (isSupported.value) {\n bindEventsForUtterance(utterance.value);\n watch(lang, (lang2) => {\n if (utterance.value && !isPlaying.value)\n utterance.value.lang = lang2;\n });\n if (options.voice) {\n watch(options.voice, () => {\n synth.cancel();\n });\n }\n watch(isPlaying, () => {\n if (isPlaying.value)\n synth.resume();\n else\n synth.pause();\n });\n }\n tryOnScopeDispose(() => {\n isPlaying.value = false;\n });\n return {\n isSupported,\n isPlaying,\n status,\n utterance,\n error,\n stop,\n toggle,\n speak\n };\n}\n\nfunction useStepper(steps, initialStep) {\n const stepsRef = ref(steps);\n const stepNames = computed(() => Array.isArray(stepsRef.value) ? stepsRef.value : Object.keys(stepsRef.value));\n const index = ref(stepNames.value.indexOf(initialStep != null ? initialStep : stepNames.value[0]));\n const current = computed(() => at(index.value));\n const isFirst = computed(() => index.value === 0);\n const isLast = computed(() => index.value === stepNames.value.length - 1);\n const next = computed(() => stepNames.value[index.value + 1]);\n const previous = computed(() => stepNames.value[index.value - 1]);\n function at(index2) {\n if (Array.isArray(stepsRef.value))\n return stepsRef.value[index2];\n return stepsRef.value[stepNames.value[index2]];\n }\n function get(step) {\n if (!stepNames.value.includes(step))\n return;\n return at(stepNames.value.indexOf(step));\n }\n function goTo(step) {\n if (stepNames.value.includes(step))\n index.value = stepNames.value.indexOf(step);\n }\n function goToNext() {\n if (isLast.value)\n return;\n index.value++;\n }\n function goToPrevious() {\n if (isFirst.value)\n return;\n index.value--;\n }\n function goBackTo(step) {\n if (isAfter(step))\n goTo(step);\n }\n function isNext(step) {\n return stepNames.value.indexOf(step) === index.value + 1;\n }\n function isPrevious(step) {\n return stepNames.value.indexOf(step) === index.value - 1;\n }\n function isCurrent(step) {\n return stepNames.value.indexOf(step) === index.value;\n }\n function isBefore(step) {\n return index.value < stepNames.value.indexOf(step);\n }\n function isAfter(step) {\n return index.value > stepNames.value.indexOf(step);\n }\n return {\n steps: stepsRef,\n stepNames,\n index,\n current,\n next,\n previous,\n isFirst,\n isLast,\n at,\n get,\n goTo,\n goToNext,\n goToPrevious,\n goBackTo,\n isNext,\n isPrevious,\n isCurrent,\n isBefore,\n isAfter\n };\n}\n\nfunction useStorageAsync(key, initialValue, storage, options = {}) {\n var _a;\n const {\n flush = \"pre\",\n deep = true,\n listenToStorageChanges = true,\n writeDefaults = true,\n mergeDefaults = false,\n shallow,\n window = defaultWindow,\n eventFilter,\n onError = (e) => {\n console.error(e);\n }\n } = options;\n const rawInit = toValue(initialValue);\n const type = guessSerializerType(rawInit);\n const data = (shallow ? shallowRef : ref)(initialValue);\n const serializer = (_a = options.serializer) != null ? _a : StorageSerializers[type];\n if (!storage) {\n try {\n storage = getSSRHandler(\"getDefaultStorage\", () => {\n var _a2;\n return (_a2 = defaultWindow) == null ? void 0 : _a2.localStorage;\n })();\n } catch (e) {\n onError(e);\n }\n }\n async function read(event) {\n if (!storage || event && event.key !== key)\n return;\n try {\n const rawValue = event ? event.newValue : await storage.getItem(key);\n if (rawValue == null) {\n data.value = rawInit;\n if (writeDefaults && rawInit !== null)\n await storage.setItem(key, await serializer.write(rawInit));\n } else if (mergeDefaults) {\n const value = await serializer.read(rawValue);\n if (typeof mergeDefaults === \"function\")\n data.value = mergeDefaults(value, rawInit);\n else if (type === \"object\" && !Array.isArray(value))\n data.value = { ...rawInit, ...value };\n else\n data.value = value;\n } else {\n data.value = await serializer.read(rawValue);\n }\n } catch (e) {\n onError(e);\n }\n }\n read();\n if (window && listenToStorageChanges)\n useEventListener(window, \"storage\", (e) => Promise.resolve().then(() => read(e)));\n if (storage) {\n watchWithFilter(\n data,\n async () => {\n try {\n if (data.value == null)\n await storage.removeItem(key);\n else\n await storage.setItem(key, await serializer.write(data.value));\n } catch (e) {\n onError(e);\n }\n },\n {\n flush,\n deep,\n eventFilter\n }\n );\n }\n return data;\n}\n\nlet _id = 0;\nfunction useStyleTag(css, options = {}) {\n const isLoaded = ref(false);\n const {\n document = defaultDocument,\n immediate = true,\n manual = false,\n id = `vueuse_styletag_${++_id}`\n } = options;\n const cssRef = ref(css);\n let stop = () => {\n };\n const load = () => {\n if (!document)\n return;\n const el = document.getElementById(id) || document.createElement(\"style\");\n if (!el.isConnected) {\n el.id = id;\n if (options.media)\n el.media = options.media;\n document.head.appendChild(el);\n }\n if (isLoaded.value)\n return;\n stop = watch(\n cssRef,\n (value) => {\n el.textContent = value;\n },\n { immediate: true }\n );\n isLoaded.value = true;\n };\n const unload = () => {\n if (!document || !isLoaded.value)\n return;\n stop();\n document.head.removeChild(document.getElementById(id));\n isLoaded.value = false;\n };\n if (immediate && !manual)\n tryOnMounted(load);\n if (!manual)\n tryOnScopeDispose(unload);\n return {\n id,\n css: cssRef,\n unload,\n load,\n isLoaded: readonly(isLoaded)\n };\n}\n\nfunction useSwipe(target, options = {}) {\n const {\n threshold = 50,\n onSwipe,\n onSwipeEnd,\n onSwipeStart,\n passive = true,\n window = defaultWindow\n } = options;\n const coordsStart = reactive({ x: 0, y: 0 });\n const coordsEnd = reactive({ x: 0, y: 0 });\n const diffX = computed(() => coordsStart.x - coordsEnd.x);\n const diffY = computed(() => coordsStart.y - coordsEnd.y);\n const { max, abs } = Math;\n const isThresholdExceeded = computed(() => max(abs(diffX.value), abs(diffY.value)) >= threshold);\n const isSwiping = ref(false);\n const direction = computed(() => {\n if (!isThresholdExceeded.value)\n return \"none\";\n if (abs(diffX.value) > abs(diffY.value)) {\n return diffX.value > 0 ? \"left\" : \"right\";\n } else {\n return diffY.value > 0 ? \"up\" : \"down\";\n }\n });\n const getTouchEventCoords = (e) => [e.touches[0].clientX, e.touches[0].clientY];\n const updateCoordsStart = (x, y) => {\n coordsStart.x = x;\n coordsStart.y = y;\n };\n const updateCoordsEnd = (x, y) => {\n coordsEnd.x = x;\n coordsEnd.y = y;\n };\n let listenerOptions;\n const isPassiveEventSupported = checkPassiveEventSupport(window == null ? void 0 : window.document);\n if (!passive)\n listenerOptions = isPassiveEventSupported ? { passive: false, capture: true } : { capture: true };\n else\n listenerOptions = isPassiveEventSupported ? { passive: true } : { capture: false };\n const onTouchEnd = (e) => {\n if (isSwiping.value)\n onSwipeEnd == null ? void 0 : onSwipeEnd(e, direction.value);\n isSwiping.value = false;\n };\n const stops = [\n useEventListener(target, \"touchstart\", (e) => {\n if (e.touches.length !== 1)\n return;\n if (listenerOptions.capture && !listenerOptions.passive)\n e.preventDefault();\n const [x, y] = getTouchEventCoords(e);\n updateCoordsStart(x, y);\n updateCoordsEnd(x, y);\n onSwipeStart == null ? void 0 : onSwipeStart(e);\n }, listenerOptions),\n useEventListener(target, \"touchmove\", (e) => {\n if (e.touches.length !== 1)\n return;\n const [x, y] = getTouchEventCoords(e);\n updateCoordsEnd(x, y);\n if (!isSwiping.value && isThresholdExceeded.value)\n isSwiping.value = true;\n if (isSwiping.value)\n onSwipe == null ? void 0 : onSwipe(e);\n }, listenerOptions),\n useEventListener(target, [\"touchend\", \"touchcancel\"], onTouchEnd, listenerOptions)\n ];\n const stop = () => stops.forEach((s) => s());\n return {\n isPassiveEventSupported,\n isSwiping,\n direction,\n coordsStart,\n coordsEnd,\n lengthX: diffX,\n lengthY: diffY,\n stop\n };\n}\nfunction checkPassiveEventSupport(document) {\n if (!document)\n return false;\n let supportsPassive = false;\n const optionsBlock = {\n get passive() {\n supportsPassive = true;\n return false;\n }\n };\n document.addEventListener(\"x\", noop, optionsBlock);\n document.removeEventListener(\"x\", noop);\n return supportsPassive;\n}\n\nfunction useTemplateRefsList() {\n const refs = ref([]);\n refs.value.set = (el) => {\n if (el)\n refs.value.push(el);\n };\n onBeforeUpdate(() => {\n refs.value.length = 0;\n });\n return refs;\n}\n\nfunction useTextDirection(options = {}) {\n const {\n document = defaultDocument,\n selector = \"html\",\n observe = false,\n initialValue = \"ltr\"\n } = options;\n function getValue() {\n var _a, _b;\n return (_b = (_a = document == null ? void 0 : document.querySelector(selector)) == null ? void 0 : _a.getAttribute(\"dir\")) != null ? _b : initialValue;\n }\n const dir = ref(getValue());\n tryOnMounted(() => dir.value = getValue());\n if (observe && document) {\n useMutationObserver(\n document.querySelector(selector),\n () => dir.value = getValue(),\n { attributes: true }\n );\n }\n return computed({\n get() {\n return dir.value;\n },\n set(v) {\n var _a, _b;\n dir.value = v;\n if (!document)\n return;\n if (dir.value)\n (_a = document.querySelector(selector)) == null ? void 0 : _a.setAttribute(\"dir\", dir.value);\n else\n (_b = document.querySelector(selector)) == null ? void 0 : _b.removeAttribute(\"dir\");\n }\n });\n}\n\nfunction getRangesFromSelection(selection) {\n var _a;\n const rangeCount = (_a = selection.rangeCount) != null ? _a : 0;\n return Array.from({ length: rangeCount }, (_, i) => selection.getRangeAt(i));\n}\nfunction useTextSelection(options = {}) {\n const {\n window = defaultWindow\n } = options;\n const selection = ref(null);\n const text = computed(() => {\n var _a, _b;\n return (_b = (_a = selection.value) == null ? void 0 : _a.toString()) != null ? _b : \"\";\n });\n const ranges = computed(() => selection.value ? getRangesFromSelection(selection.value) : []);\n const rects = computed(() => ranges.value.map((range) => range.getBoundingClientRect()));\n function onSelectionChange() {\n selection.value = null;\n if (window)\n selection.value = window.getSelection();\n }\n if (window)\n useEventListener(window.document, \"selectionchange\", onSelectionChange);\n return {\n text,\n rects,\n ranges,\n selection\n };\n}\n\nfunction useTextareaAutosize(options) {\n const textarea = ref(options == null ? void 0 : options.element);\n const input = ref(options == null ? void 0 : options.input);\n const textareaScrollHeight = ref(1);\n function triggerResize() {\n var _a, _b;\n if (!textarea.value)\n return;\n let height = \"\";\n textarea.value.style.height = \"1px\";\n textareaScrollHeight.value = (_a = textarea.value) == null ? void 0 : _a.scrollHeight;\n if (options == null ? void 0 : options.styleTarget)\n toValue(options.styleTarget).style.height = `${textareaScrollHeight.value}px`;\n else\n height = `${textareaScrollHeight.value}px`;\n textarea.value.style.height = height;\n (_b = options == null ? void 0 : options.onResize) == null ? void 0 : _b.call(options);\n }\n watch([input, textarea], () => nextTick(triggerResize), { immediate: true });\n useResizeObserver(textarea, () => triggerResize());\n if (options == null ? void 0 : options.watch)\n watch(options.watch, triggerResize, { immediate: true, deep: true });\n return {\n textarea,\n input,\n triggerResize\n };\n}\n\nfunction useThrottledRefHistory(source, options = {}) {\n const { throttle = 200, trailing = true } = options;\n const filter = throttleFilter(throttle, trailing);\n const history = useRefHistory(source, { ...options, eventFilter: filter });\n return {\n ...history\n };\n}\n\nconst DEFAULT_UNITS = [\n { max: 6e4, value: 1e3, name: \"second\" },\n { max: 276e4, value: 6e4, name: \"minute\" },\n { max: 72e6, value: 36e5, name: \"hour\" },\n { max: 5184e5, value: 864e5, name: \"day\" },\n { max: 24192e5, value: 6048e5, name: \"week\" },\n { max: 28512e6, value: 2592e6, name: \"month\" },\n { max: Number.POSITIVE_INFINITY, value: 31536e6, name: \"year\" }\n];\nconst DEFAULT_MESSAGES = {\n justNow: \"just now\",\n past: (n) => n.match(/\\d/) ? `${n} ago` : n,\n future: (n) => n.match(/\\d/) ? `in ${n}` : n,\n month: (n, past) => n === 1 ? past ? \"last month\" : \"next month\" : `${n} month${n > 1 ? \"s\" : \"\"}`,\n year: (n, past) => n === 1 ? past ? \"last year\" : \"next year\" : `${n} year${n > 1 ? \"s\" : \"\"}`,\n day: (n, past) => n === 1 ? past ? \"yesterday\" : \"tomorrow\" : `${n} day${n > 1 ? \"s\" : \"\"}`,\n week: (n, past) => n === 1 ? past ? \"last week\" : \"next week\" : `${n} week${n > 1 ? \"s\" : \"\"}`,\n hour: (n) => `${n} hour${n > 1 ? \"s\" : \"\"}`,\n minute: (n) => `${n} minute${n > 1 ? \"s\" : \"\"}`,\n second: (n) => `${n} second${n > 1 ? \"s\" : \"\"}`,\n invalid: \"\"\n};\nfunction DEFAULT_FORMATTER(date) {\n return date.toISOString().slice(0, 10);\n}\nfunction useTimeAgo(time, options = {}) {\n const {\n controls: exposeControls = false,\n updateInterval = 3e4\n } = options;\n const { now, ...controls } = useNow({ interval: updateInterval, controls: true });\n const timeAgo = computed(() => formatTimeAgo(new Date(toValue(time)), options, toValue(now)));\n if (exposeControls) {\n return {\n timeAgo,\n ...controls\n };\n } else {\n return timeAgo;\n }\n}\nfunction formatTimeAgo(from, options = {}, now = Date.now()) {\n var _a;\n const {\n max,\n messages = DEFAULT_MESSAGES,\n fullDateFormatter = DEFAULT_FORMATTER,\n units = DEFAULT_UNITS,\n showSecond = false,\n rounding = \"round\"\n } = options;\n const roundFn = typeof rounding === \"number\" ? (n) => +n.toFixed(rounding) : Math[rounding];\n const diff = +now - +from;\n const absDiff = Math.abs(diff);\n function getValue(diff2, unit) {\n return roundFn(Math.abs(diff2) / unit.value);\n }\n function format(diff2, unit) {\n const val = getValue(diff2, unit);\n const past = diff2 > 0;\n const str = applyFormat(unit.name, val, past);\n return applyFormat(past ? \"past\" : \"future\", str, past);\n }\n function applyFormat(name, val, isPast) {\n const formatter = messages[name];\n if (typeof formatter === \"function\")\n return formatter(val, isPast);\n return formatter.replace(\"{0}\", val.toString());\n }\n if (absDiff < 6e4 && !showSecond)\n return messages.justNow;\n if (typeof max === \"number\" && absDiff > max)\n return fullDateFormatter(new Date(from));\n if (typeof max === \"string\") {\n const unitMax = (_a = units.find((i) => i.name === max)) == null ? void 0 : _a.max;\n if (unitMax && absDiff > unitMax)\n return fullDateFormatter(new Date(from));\n }\n for (const [idx, unit] of units.entries()) {\n const val = getValue(diff, unit);\n if (val <= 0 && units[idx - 1])\n return format(diff, units[idx - 1]);\n if (absDiff < unit.max)\n return format(diff, unit);\n }\n return messages.invalid;\n}\n\nfunction useTimeoutPoll(fn, interval, timeoutPollOptions) {\n const { start } = useTimeoutFn(loop, interval, { immediate: false });\n const isActive = ref(false);\n async function loop() {\n if (!isActive.value)\n return;\n await fn();\n start();\n }\n function resume() {\n if (!isActive.value) {\n isActive.value = true;\n loop();\n }\n }\n function pause() {\n isActive.value = false;\n }\n if (timeoutPollOptions == null ? void 0 : timeoutPollOptions.immediate)\n resume();\n tryOnScopeDispose(pause);\n return {\n isActive,\n pause,\n resume\n };\n}\n\nfunction useTimestamp(options = {}) {\n const {\n controls: exposeControls = false,\n offset = 0,\n immediate = true,\n interval = \"requestAnimationFrame\",\n callback\n } = options;\n const ts = ref(timestamp() + offset);\n const update = () => ts.value = timestamp() + offset;\n const cb = callback ? () => {\n update();\n callback(ts.value);\n } : update;\n const controls = interval === \"requestAnimationFrame\" ? useRafFn(cb, { immediate }) : useIntervalFn(cb, interval, { immediate });\n if (exposeControls) {\n return {\n timestamp: ts,\n ...controls\n };\n } else {\n return ts;\n }\n}\n\nfunction useTitle(newTitle = null, options = {}) {\n var _a, _b;\n const {\n document = defaultDocument\n } = options;\n const title = toRef((_a = newTitle != null ? newTitle : document == null ? void 0 : document.title) != null ? _a : null);\n const isReadonly = newTitle && typeof newTitle === \"function\";\n function format(t) {\n if (!(\"titleTemplate\" in options))\n return t;\n const template = options.titleTemplate || \"%s\";\n return typeof template === \"function\" ? template(t) : toValue(template).replace(/%s/g, t);\n }\n watch(\n title,\n (t, o) => {\n if (t !== o && document)\n document.title = format(typeof t === \"string\" ? t : \"\");\n },\n { immediate: true }\n );\n if (options.observe && !options.titleTemplate && document && !isReadonly) {\n useMutationObserver(\n (_b = document.head) == null ? void 0 : _b.querySelector(\"title\"),\n () => {\n if (document && document.title !== title.value)\n title.value = format(document.title);\n },\n { childList: true }\n );\n }\n return title;\n}\n\nconst _TransitionPresets = {\n easeInSine: [0.12, 0, 0.39, 0],\n easeOutSine: [0.61, 1, 0.88, 1],\n easeInOutSine: [0.37, 0, 0.63, 1],\n easeInQuad: [0.11, 0, 0.5, 0],\n easeOutQuad: [0.5, 1, 0.89, 1],\n easeInOutQuad: [0.45, 0, 0.55, 1],\n easeInCubic: [0.32, 0, 0.67, 0],\n easeOutCubic: [0.33, 1, 0.68, 1],\n easeInOutCubic: [0.65, 0, 0.35, 1],\n easeInQuart: [0.5, 0, 0.75, 0],\n easeOutQuart: [0.25, 1, 0.5, 1],\n easeInOutQuart: [0.76, 0, 0.24, 1],\n easeInQuint: [0.64, 0, 0.78, 0],\n easeOutQuint: [0.22, 1, 0.36, 1],\n easeInOutQuint: [0.83, 0, 0.17, 1],\n easeInExpo: [0.7, 0, 0.84, 0],\n easeOutExpo: [0.16, 1, 0.3, 1],\n easeInOutExpo: [0.87, 0, 0.13, 1],\n easeInCirc: [0.55, 0, 1, 0.45],\n easeOutCirc: [0, 0.55, 0.45, 1],\n easeInOutCirc: [0.85, 0, 0.15, 1],\n easeInBack: [0.36, 0, 0.66, -0.56],\n easeOutBack: [0.34, 1.56, 0.64, 1],\n easeInOutBack: [0.68, -0.6, 0.32, 1.6]\n};\nconst TransitionPresets = /* @__PURE__ */ Object.assign({}, { linear: identity }, _TransitionPresets);\nfunction createEasingFunction([p0, p1, p2, p3]) {\n const a = (a1, a2) => 1 - 3 * a2 + 3 * a1;\n const b = (a1, a2) => 3 * a2 - 6 * a1;\n const c = (a1) => 3 * a1;\n const calcBezier = (t, a1, a2) => ((a(a1, a2) * t + b(a1, a2)) * t + c(a1)) * t;\n const getSlope = (t, a1, a2) => 3 * a(a1, a2) * t * t + 2 * b(a1, a2) * t + c(a1);\n const getTforX = (x) => {\n let aGuessT = x;\n for (let i = 0; i < 4; ++i) {\n const currentSlope = getSlope(aGuessT, p0, p2);\n if (currentSlope === 0)\n return aGuessT;\n const currentX = calcBezier(aGuessT, p0, p2) - x;\n aGuessT -= currentX / currentSlope;\n }\n return aGuessT;\n };\n return (x) => p0 === p1 && p2 === p3 ? x : calcBezier(getTforX(x), p1, p3);\n}\nfunction lerp(a, b, alpha) {\n return a + alpha * (b - a);\n}\nfunction toVec(t) {\n return (typeof t === \"number\" ? [t] : t) || [];\n}\nfunction executeTransition(source, from, to, options = {}) {\n var _a, _b;\n const fromVal = toValue(from);\n const toVal = toValue(to);\n const v1 = toVec(fromVal);\n const v2 = toVec(toVal);\n const duration = (_a = toValue(options.duration)) != null ? _a : 1e3;\n const startedAt = Date.now();\n const endAt = Date.now() + duration;\n const trans = typeof options.transition === \"function\" ? options.transition : (_b = toValue(options.transition)) != null ? _b : identity;\n const ease = typeof trans === \"function\" ? trans : createEasingFunction(trans);\n return new Promise((resolve) => {\n source.value = fromVal;\n const tick = () => {\n var _a2;\n if ((_a2 = options.abort) == null ? void 0 : _a2.call(options)) {\n resolve();\n return;\n }\n const now = Date.now();\n const alpha = ease((now - startedAt) / duration);\n const arr = toVec(source.value).map((n, i) => lerp(v1[i], v2[i], alpha));\n if (Array.isArray(source.value))\n source.value = arr.map((n, i) => {\n var _a3, _b2;\n return lerp((_a3 = v1[i]) != null ? _a3 : 0, (_b2 = v2[i]) != null ? _b2 : 0, alpha);\n });\n else if (typeof source.value === \"number\")\n source.value = arr[0];\n if (now < endAt) {\n requestAnimationFrame(tick);\n } else {\n source.value = toVal;\n resolve();\n }\n };\n tick();\n });\n}\nfunction useTransition(source, options = {}) {\n let currentId = 0;\n const sourceVal = () => {\n const v = toValue(source);\n return typeof v === \"number\" ? v : v.map(toValue);\n };\n const outputRef = ref(sourceVal());\n watch(sourceVal, async (to) => {\n var _a, _b;\n if (toValue(options.disabled))\n return;\n const id = ++currentId;\n if (options.delay)\n await promiseTimeout(toValue(options.delay));\n if (id !== currentId)\n return;\n const toVal = Array.isArray(to) ? to.map(toValue) : toValue(to);\n (_a = options.onStarted) == null ? void 0 : _a.call(options);\n await executeTransition(outputRef, outputRef.value, toVal, {\n ...options,\n abort: () => {\n var _a2;\n return id !== currentId || ((_a2 = options.abort) == null ? void 0 : _a2.call(options));\n }\n });\n (_b = options.onFinished) == null ? void 0 : _b.call(options);\n }, { deep: true });\n watch(() => toValue(options.disabled), (disabled) => {\n if (disabled) {\n currentId++;\n outputRef.value = sourceVal();\n }\n });\n tryOnScopeDispose(() => {\n currentId++;\n });\n return computed(() => toValue(options.disabled) ? sourceVal() : outputRef.value);\n}\n\nfunction useUrlSearchParams(mode = \"history\", options = {}) {\n const {\n initialValue = {},\n removeNullishValues = true,\n removeFalsyValues = false,\n write: enableWrite = true,\n window = defaultWindow\n } = options;\n if (!window)\n return reactive(initialValue);\n const state = reactive({});\n function getRawParams() {\n if (mode === \"history\") {\n return window.location.search || \"\";\n } else if (mode === \"hash\") {\n const hash = window.location.hash || \"\";\n const index = hash.indexOf(\"?\");\n return index > 0 ? hash.slice(index) : \"\";\n } else {\n return (window.location.hash || \"\").replace(/^#/, \"\");\n }\n }\n function constructQuery(params) {\n const stringified = params.toString();\n if (mode === \"history\")\n return `${stringified ? `?${stringified}` : \"\"}${window.location.hash || \"\"}`;\n if (mode === \"hash-params\")\n return `${window.location.search || \"\"}${stringified ? `#${stringified}` : \"\"}`;\n const hash = window.location.hash || \"#\";\n const index = hash.indexOf(\"?\");\n if (index > 0)\n return `${hash.slice(0, index)}${stringified ? `?${stringified}` : \"\"}`;\n return `${hash}${stringified ? `?${stringified}` : \"\"}`;\n }\n function read() {\n return new URLSearchParams(getRawParams());\n }\n function updateState(params) {\n const unusedKeys = new Set(Object.keys(state));\n for (const key of params.keys()) {\n const paramsForKey = params.getAll(key);\n state[key] = paramsForKey.length > 1 ? paramsForKey : params.get(key) || \"\";\n unusedKeys.delete(key);\n }\n Array.from(unusedKeys).forEach((key) => delete state[key]);\n }\n const { pause, resume } = pausableWatch(\n state,\n () => {\n const params = new URLSearchParams(\"\");\n Object.keys(state).forEach((key) => {\n const mapEntry = state[key];\n if (Array.isArray(mapEntry))\n mapEntry.forEach((value) => params.append(key, value));\n else if (removeNullishValues && mapEntry == null)\n params.delete(key);\n else if (removeFalsyValues && !mapEntry)\n params.delete(key);\n else\n params.set(key, mapEntry);\n });\n write(params);\n },\n { deep: true }\n );\n function write(params, shouldUpdate) {\n pause();\n if (shouldUpdate)\n updateState(params);\n window.history.replaceState(\n window.history.state,\n window.document.title,\n window.location.pathname + constructQuery(params)\n );\n resume();\n }\n function onChanged() {\n if (!enableWrite)\n return;\n write(read(), true);\n }\n useEventListener(window, \"popstate\", onChanged, false);\n if (mode !== \"history\")\n useEventListener(window, \"hashchange\", onChanged, false);\n const initial = read();\n if (initial.keys().next().value)\n updateState(initial);\n else\n Object.assign(state, initialValue);\n return state;\n}\n\nfunction useUserMedia(options = {}) {\n var _a, _b;\n const enabled = ref((_a = options.enabled) != null ? _a : false);\n const autoSwitch = ref((_b = options.autoSwitch) != null ? _b : true);\n const constraints = ref(options.constraints);\n const { navigator = defaultNavigator } = options;\n const isSupported = useSupported(() => {\n var _a2;\n return (_a2 = navigator == null ? void 0 : navigator.mediaDevices) == null ? void 0 : _a2.getUserMedia;\n });\n const stream = shallowRef();\n function getDeviceOptions(type) {\n switch (type) {\n case \"video\": {\n if (constraints.value)\n return constraints.value.video || false;\n break;\n }\n case \"audio\": {\n if (constraints.value)\n return constraints.value.audio || false;\n break;\n }\n }\n }\n async function _start() {\n if (!isSupported.value || stream.value)\n return;\n stream.value = await navigator.mediaDevices.getUserMedia({\n video: getDeviceOptions(\"video\"),\n audio: getDeviceOptions(\"audio\")\n });\n return stream.value;\n }\n function _stop() {\n var _a2;\n (_a2 = stream.value) == null ? void 0 : _a2.getTracks().forEach((t) => t.stop());\n stream.value = void 0;\n }\n function stop() {\n _stop();\n enabled.value = false;\n }\n async function start() {\n await _start();\n if (stream.value)\n enabled.value = true;\n return stream.value;\n }\n async function restart() {\n _stop();\n return await start();\n }\n watch(\n enabled,\n (v) => {\n if (v)\n _start();\n else\n _stop();\n },\n { immediate: true }\n );\n watch(\n constraints,\n () => {\n if (autoSwitch.value && stream.value)\n restart();\n },\n { immediate: true }\n );\n return {\n isSupported,\n stream,\n start,\n stop,\n restart,\n constraints,\n enabled,\n autoSwitch\n };\n}\n\nfunction useVModel(props, key, emit, options = {}) {\n var _a, _b, _c, _d, _e;\n const {\n clone = false,\n passive = false,\n eventName,\n deep = false,\n defaultValue,\n shouldEmit\n } = options;\n const vm = getCurrentInstance();\n const _emit = emit || (vm == null ? void 0 : vm.emit) || ((_a = vm == null ? void 0 : vm.$emit) == null ? void 0 : _a.bind(vm)) || ((_c = (_b = vm == null ? void 0 : vm.proxy) == null ? void 0 : _b.$emit) == null ? void 0 : _c.bind(vm == null ? void 0 : vm.proxy));\n let event = eventName;\n if (!key) {\n if (isVue2) {\n const modelOptions = (_e = (_d = vm == null ? void 0 : vm.proxy) == null ? void 0 : _d.$options) == null ? void 0 : _e.model;\n key = (modelOptions == null ? void 0 : modelOptions.value) || \"value\";\n if (!eventName)\n event = (modelOptions == null ? void 0 : modelOptions.event) || \"input\";\n } else {\n key = \"modelValue\";\n }\n }\n event = event || `update:${key.toString()}`;\n const cloneFn = (val) => !clone ? val : typeof clone === \"function\" ? clone(val) : cloneFnJSON(val);\n const getValue = () => isDef(props[key]) ? cloneFn(props[key]) : defaultValue;\n const triggerEmit = (value) => {\n if (shouldEmit) {\n if (shouldEmit(value))\n _emit(event, value);\n } else {\n _emit(event, value);\n }\n };\n if (passive) {\n const initialValue = getValue();\n const proxy = ref(initialValue);\n let isUpdating = false;\n watch(\n () => props[key],\n (v) => {\n if (!isUpdating) {\n isUpdating = true;\n proxy.value = cloneFn(v);\n nextTick(() => isUpdating = false);\n }\n }\n );\n watch(\n proxy,\n (v) => {\n if (!isUpdating && (v !== props[key] || deep))\n triggerEmit(v);\n },\n { deep }\n );\n return proxy;\n } else {\n return computed({\n get() {\n return getValue();\n },\n set(value) {\n triggerEmit(value);\n }\n });\n }\n}\n\nfunction useVModels(props, emit, options = {}) {\n const ret = {};\n for (const key in props) {\n ret[key] = useVModel(\n props,\n key,\n emit,\n options\n );\n }\n return ret;\n}\n\nfunction useVibrate(options) {\n const {\n pattern = [],\n interval = 0,\n navigator = defaultNavigator\n } = options || {};\n const isSupported = useSupported(() => typeof navigator !== \"undefined\" && \"vibrate\" in navigator);\n const patternRef = toRef(pattern);\n let intervalControls;\n const vibrate = (pattern2 = patternRef.value) => {\n if (isSupported.value)\n navigator.vibrate(pattern2);\n };\n const stop = () => {\n if (isSupported.value)\n navigator.vibrate(0);\n intervalControls == null ? void 0 : intervalControls.pause();\n };\n if (interval > 0) {\n intervalControls = useIntervalFn(\n vibrate,\n interval,\n {\n immediate: false,\n immediateCallback: false\n }\n );\n }\n return {\n isSupported,\n pattern,\n intervalControls,\n vibrate,\n stop\n };\n}\n\nfunction useVirtualList(list, options) {\n const { containerStyle, wrapperProps, scrollTo, calculateRange, currentList, containerRef } = \"itemHeight\" in options ? useVerticalVirtualList(options, list) : useHorizontalVirtualList(options, list);\n return {\n list: currentList,\n scrollTo,\n containerProps: {\n ref: containerRef,\n onScroll: () => {\n calculateRange();\n },\n style: containerStyle\n },\n wrapperProps\n };\n}\nfunction useVirtualListResources(list) {\n const containerRef = ref(null);\n const size = useElementSize(containerRef);\n const currentList = ref([]);\n const source = shallowRef(list);\n const state = ref({ start: 0, end: 10 });\n return { state, source, currentList, size, containerRef };\n}\nfunction createGetViewCapacity(state, source, itemSize) {\n return (containerSize) => {\n if (typeof itemSize === \"number\")\n return Math.ceil(containerSize / itemSize);\n const { start = 0 } = state.value;\n let sum = 0;\n let capacity = 0;\n for (let i = start; i < source.value.length; i++) {\n const size = itemSize(i);\n sum += size;\n capacity = i;\n if (sum > containerSize)\n break;\n }\n return capacity - start;\n };\n}\nfunction createGetOffset(source, itemSize) {\n return (scrollDirection) => {\n if (typeof itemSize === \"number\")\n return Math.floor(scrollDirection / itemSize) + 1;\n let sum = 0;\n let offset = 0;\n for (let i = 0; i < source.value.length; i++) {\n const size = itemSize(i);\n sum += size;\n if (sum >= scrollDirection) {\n offset = i;\n break;\n }\n }\n return offset + 1;\n };\n}\nfunction createCalculateRange(type, overscan, getOffset, getViewCapacity, { containerRef, state, currentList, source }) {\n return () => {\n const element = containerRef.value;\n if (element) {\n const offset = getOffset(type === \"vertical\" ? element.scrollTop : element.scrollLeft);\n const viewCapacity = getViewCapacity(type === \"vertical\" ? element.clientHeight : element.clientWidth);\n const from = offset - overscan;\n const to = offset + viewCapacity + overscan;\n state.value = {\n start: from < 0 ? 0 : from,\n end: to > source.value.length ? source.value.length : to\n };\n currentList.value = source.value.slice(state.value.start, state.value.end).map((ele, index) => ({\n data: ele,\n index: index + state.value.start\n }));\n }\n };\n}\nfunction createGetDistance(itemSize, source) {\n return (index) => {\n if (typeof itemSize === \"number\") {\n const size2 = index * itemSize;\n return size2;\n }\n const size = source.value.slice(0, index).reduce((sum, _, i) => sum + itemSize(i), 0);\n return size;\n };\n}\nfunction useWatchForSizes(size, list, calculateRange) {\n watch([size.width, size.height, list], () => {\n calculateRange();\n });\n}\nfunction createComputedTotalSize(itemSize, source) {\n return computed(() => {\n if (typeof itemSize === \"number\")\n return source.value.length * itemSize;\n return source.value.reduce((sum, _, index) => sum + itemSize(index), 0);\n });\n}\nconst scrollToDictionaryForElementScrollKey = {\n horizontal: \"scrollLeft\",\n vertical: \"scrollTop\"\n};\nfunction createScrollTo(type, calculateRange, getDistance, containerRef) {\n return (index) => {\n if (containerRef.value) {\n containerRef.value[scrollToDictionaryForElementScrollKey[type]] = getDistance(index);\n calculateRange();\n }\n };\n}\nfunction useHorizontalVirtualList(options, list) {\n const resources = useVirtualListResources(list);\n const { state, source, currentList, size, containerRef } = resources;\n const containerStyle = { overflowX: \"auto\" };\n const { itemWidth, overscan = 5 } = options;\n const getViewCapacity = createGetViewCapacity(state, source, itemWidth);\n const getOffset = createGetOffset(source, itemWidth);\n const calculateRange = createCalculateRange(\"horizontal\", overscan, getOffset, getViewCapacity, resources);\n const getDistanceLeft = createGetDistance(itemWidth, source);\n const offsetLeft = computed(() => getDistanceLeft(state.value.start));\n const totalWidth = createComputedTotalSize(itemWidth, source);\n useWatchForSizes(size, list, calculateRange);\n const scrollTo = createScrollTo(\"horizontal\", calculateRange, getDistanceLeft, containerRef);\n const wrapperProps = computed(() => {\n return {\n style: {\n height: \"100%\",\n width: `${totalWidth.value - offsetLeft.value}px`,\n marginLeft: `${offsetLeft.value}px`,\n display: \"flex\"\n }\n };\n });\n return {\n scrollTo,\n calculateRange,\n wrapperProps,\n containerStyle,\n currentList,\n containerRef\n };\n}\nfunction useVerticalVirtualList(options, list) {\n const resources = useVirtualListResources(list);\n const { state, source, currentList, size, containerRef } = resources;\n const containerStyle = { overflowY: \"auto\" };\n const { itemHeight, overscan = 5 } = options;\n const getViewCapacity = createGetViewCapacity(state, source, itemHeight);\n const getOffset = createGetOffset(source, itemHeight);\n const calculateRange = createCalculateRange(\"vertical\", overscan, getOffset, getViewCapacity, resources);\n const getDistanceTop = createGetDistance(itemHeight, source);\n const offsetTop = computed(() => getDistanceTop(state.value.start));\n const totalHeight = createComputedTotalSize(itemHeight, source);\n useWatchForSizes(size, list, calculateRange);\n const scrollTo = createScrollTo(\"vertical\", calculateRange, getDistanceTop, containerRef);\n const wrapperProps = computed(() => {\n return {\n style: {\n width: \"100%\",\n height: `${totalHeight.value - offsetTop.value}px`,\n marginTop: `${offsetTop.value}px`\n }\n };\n });\n return {\n calculateRange,\n scrollTo,\n containerStyle,\n wrapperProps,\n currentList,\n containerRef\n };\n}\n\nfunction useWakeLock(options = {}) {\n const {\n navigator = defaultNavigator,\n document = defaultDocument\n } = options;\n let wakeLock;\n const isSupported = useSupported(() => navigator && \"wakeLock\" in navigator);\n const isActive = ref(false);\n async function onVisibilityChange() {\n if (!isSupported.value || !wakeLock)\n return;\n if (document && document.visibilityState === \"visible\")\n wakeLock = await navigator.wakeLock.request(\"screen\");\n isActive.value = !wakeLock.released;\n }\n if (document)\n useEventListener(document, \"visibilitychange\", onVisibilityChange, { passive: true });\n async function request(type) {\n if (!isSupported.value)\n return;\n wakeLock = await navigator.wakeLock.request(type);\n isActive.value = !wakeLock.released;\n }\n async function release() {\n if (!isSupported.value || !wakeLock)\n return;\n await wakeLock.release();\n isActive.value = !wakeLock.released;\n wakeLock = null;\n }\n return {\n isSupported,\n isActive,\n request,\n release\n };\n}\n\nfunction useWebNotification(options = {}) {\n const {\n window = defaultWindow,\n requestPermissions: _requestForPermissions = true\n } = options;\n const defaultWebNotificationOptions = options;\n const isSupported = useSupported(() => !!window && \"Notification\" in window);\n const permissionGranted = ref(isSupported.value && \"permission\" in Notification && Notification.permission === \"granted\");\n const notification = ref(null);\n const ensurePermissions = async () => {\n if (!isSupported.value)\n return;\n if (!permissionGranted.value && Notification.permission !== \"denied\") {\n const result = await Notification.requestPermission();\n if (result === \"granted\")\n permissionGranted.value = true;\n }\n return permissionGranted.value;\n };\n const { on: onClick, trigger: clickTrigger } = createEventHook();\n const { on: onShow, trigger: showTrigger } = createEventHook();\n const { on: onError, trigger: errorTrigger } = createEventHook();\n const { on: onClose, trigger: closeTrigger } = createEventHook();\n const show = async (overrides) => {\n if (!isSupported.value || !permissionGranted.value)\n return;\n const options2 = Object.assign({}, defaultWebNotificationOptions, overrides);\n notification.value = new Notification(options2.title || \"\", options2);\n notification.value.onclick = clickTrigger;\n notification.value.onshow = showTrigger;\n notification.value.onerror = errorTrigger;\n notification.value.onclose = closeTrigger;\n return notification.value;\n };\n const close = () => {\n if (notification.value)\n notification.value.close();\n notification.value = null;\n };\n if (_requestForPermissions)\n tryOnMounted(ensurePermissions);\n tryOnScopeDispose(close);\n if (isSupported.value && window) {\n const document = window.document;\n useEventListener(document, \"visibilitychange\", (e) => {\n e.preventDefault();\n if (document.visibilityState === \"visible\") {\n close();\n }\n });\n }\n return {\n isSupported,\n notification,\n ensurePermissions,\n permissionGranted,\n show,\n close,\n onClick,\n onShow,\n onError,\n onClose\n };\n}\n\nconst DEFAULT_PING_MESSAGE = \"ping\";\nfunction resolveNestedOptions(options) {\n if (options === true)\n return {};\n return options;\n}\nfunction useWebSocket(url, options = {}) {\n const {\n onConnected,\n onDisconnected,\n onError,\n onMessage,\n immediate = true,\n autoClose = true,\n protocols = []\n } = options;\n const data = ref(null);\n const status = ref(\"CLOSED\");\n const wsRef = ref();\n const urlRef = toRef(url);\n let heartbeatPause;\n let heartbeatResume;\n let explicitlyClosed = false;\n let retried = 0;\n let bufferedData = [];\n let pongTimeoutWait;\n const _sendBuffer = () => {\n if (bufferedData.length && wsRef.value && status.value === \"OPEN\") {\n for (const buffer of bufferedData)\n wsRef.value.send(buffer);\n bufferedData = [];\n }\n };\n const resetHeartbeat = () => {\n clearTimeout(pongTimeoutWait);\n pongTimeoutWait = void 0;\n };\n const close = (code = 1e3, reason) => {\n if (!isClient || !wsRef.value)\n return;\n explicitlyClosed = true;\n resetHeartbeat();\n heartbeatPause == null ? void 0 : heartbeatPause();\n wsRef.value.close(code, reason);\n };\n const send = (data2, useBuffer = true) => {\n if (!wsRef.value || status.value !== \"OPEN\") {\n if (useBuffer)\n bufferedData.push(data2);\n return false;\n }\n _sendBuffer();\n wsRef.value.send(data2);\n return true;\n };\n const _init = () => {\n if (explicitlyClosed || typeof urlRef.value === \"undefined\")\n return;\n const ws = new WebSocket(urlRef.value, protocols);\n wsRef.value = ws;\n status.value = \"CONNECTING\";\n ws.onopen = () => {\n status.value = \"OPEN\";\n onConnected == null ? void 0 : onConnected(ws);\n heartbeatResume == null ? void 0 : heartbeatResume();\n _sendBuffer();\n };\n ws.onclose = (ev) => {\n status.value = \"CLOSED\";\n wsRef.value = void 0;\n onDisconnected == null ? void 0 : onDisconnected(ws, ev);\n if (!explicitlyClosed && options.autoReconnect) {\n const {\n retries = -1,\n delay = 1e3,\n onFailed\n } = resolveNestedOptions(options.autoReconnect);\n retried += 1;\n if (typeof retries === \"number\" && (retries < 0 || retried < retries))\n setTimeout(_init, delay);\n else if (typeof retries === \"function\" && retries())\n setTimeout(_init, delay);\n else\n onFailed == null ? void 0 : onFailed();\n }\n };\n ws.onerror = (e) => {\n onError == null ? void 0 : onError(ws, e);\n };\n ws.onmessage = (e) => {\n if (options.heartbeat) {\n resetHeartbeat();\n const {\n message = DEFAULT_PING_MESSAGE\n } = resolveNestedOptions(options.heartbeat);\n if (e.data === message)\n return;\n }\n data.value = e.data;\n onMessage == null ? void 0 : onMessage(ws, e);\n };\n };\n if (options.heartbeat) {\n const {\n message = DEFAULT_PING_MESSAGE,\n interval = 1e3,\n pongTimeout = 1e3\n } = resolveNestedOptions(options.heartbeat);\n const { pause, resume } = useIntervalFn(\n () => {\n send(message, false);\n if (pongTimeoutWait != null)\n return;\n pongTimeoutWait = setTimeout(() => {\n close();\n explicitlyClosed = false;\n }, pongTimeout);\n },\n interval,\n { immediate: false }\n );\n heartbeatPause = pause;\n heartbeatResume = resume;\n }\n if (autoClose) {\n if (isClient)\n useEventListener(\"beforeunload\", () => close());\n tryOnScopeDispose(close);\n }\n const open = () => {\n if (!isClient && !isWorker)\n return;\n close();\n explicitlyClosed = false;\n retried = 0;\n _init();\n };\n if (immediate)\n watch(urlRef, open, { immediate: true });\n return {\n data,\n status,\n close,\n send,\n open,\n ws: wsRef\n };\n}\n\nfunction useWebWorker(arg0, workerOptions, options) {\n const {\n window = defaultWindow\n } = options != null ? options : {};\n const data = ref(null);\n const worker = shallowRef();\n const post = (...args) => {\n if (!worker.value)\n return;\n worker.value.postMessage(...args);\n };\n const terminate = function terminate2() {\n if (!worker.value)\n return;\n worker.value.terminate();\n };\n if (window) {\n if (typeof arg0 === \"string\")\n worker.value = new Worker(arg0, workerOptions);\n else if (typeof arg0 === \"function\")\n worker.value = arg0();\n else\n worker.value = arg0;\n worker.value.onmessage = (e) => {\n data.value = e.data;\n };\n tryOnScopeDispose(() => {\n if (worker.value)\n worker.value.terminate();\n });\n }\n return {\n data,\n post,\n terminate,\n worker\n };\n}\n\nfunction jobRunner(userFunc) {\n return (e) => {\n const userFuncArgs = e.data[0];\n return Promise.resolve(userFunc.apply(void 0, userFuncArgs)).then((result) => {\n postMessage([\"SUCCESS\", result]);\n }).catch((error) => {\n postMessage([\"ERROR\", error]);\n });\n };\n}\n\nfunction depsParser(deps) {\n if (deps.length === 0)\n return \"\";\n const depsString = deps.map((dep) => `'${dep}'`).toString();\n return `importScripts(${depsString})`;\n}\n\nfunction createWorkerBlobUrl(fn, deps) {\n const blobCode = `${depsParser(deps)}; onmessage=(${jobRunner})(${fn})`;\n const blob = new Blob([blobCode], { type: \"text/javascript\" });\n const url = URL.createObjectURL(blob);\n return url;\n}\n\nfunction useWebWorkerFn(fn, options = {}) {\n const {\n dependencies = [],\n timeout,\n window = defaultWindow\n } = options;\n const worker = ref();\n const workerStatus = ref(\"PENDING\");\n const promise = ref({});\n const timeoutId = ref();\n const workerTerminate = (status = \"PENDING\") => {\n if (worker.value && worker.value._url && window) {\n worker.value.terminate();\n URL.revokeObjectURL(worker.value._url);\n promise.value = {};\n worker.value = void 0;\n window.clearTimeout(timeoutId.value);\n workerStatus.value = status;\n }\n };\n workerTerminate();\n tryOnScopeDispose(workerTerminate);\n const generateWorker = () => {\n const blobUrl = createWorkerBlobUrl(fn, dependencies);\n const newWorker = new Worker(blobUrl);\n newWorker._url = blobUrl;\n newWorker.onmessage = (e) => {\n const { resolve = () => {\n }, reject = () => {\n } } = promise.value;\n const [status, result] = e.data;\n switch (status) {\n case \"SUCCESS\":\n resolve(result);\n workerTerminate(status);\n break;\n default:\n reject(result);\n workerTerminate(\"ERROR\");\n break;\n }\n };\n newWorker.onerror = (e) => {\n const { reject = () => {\n } } = promise.value;\n e.preventDefault();\n reject(e);\n workerTerminate(\"ERROR\");\n };\n if (timeout) {\n timeoutId.value = setTimeout(\n () => workerTerminate(\"TIMEOUT_EXPIRED\"),\n timeout\n );\n }\n return newWorker;\n };\n const callWorker = (...fnArgs) => new Promise((resolve, reject) => {\n promise.value = {\n resolve,\n reject\n };\n worker.value && worker.value.postMessage([[...fnArgs]]);\n workerStatus.value = \"RUNNING\";\n });\n const workerFn = (...fnArgs) => {\n if (workerStatus.value === \"RUNNING\") {\n console.error(\n \"[useWebWorkerFn] You can only run one instance of the worker at a time.\"\n );\n return Promise.reject();\n }\n worker.value = generateWorker();\n return callWorker(...fnArgs);\n };\n return {\n workerFn,\n workerStatus,\n workerTerminate\n };\n}\n\nfunction useWindowFocus(options = {}) {\n const { window = defaultWindow } = options;\n if (!window)\n return ref(false);\n const focused = ref(window.document.hasFocus());\n useEventListener(window, \"blur\", () => {\n focused.value = false;\n });\n useEventListener(window, \"focus\", () => {\n focused.value = true;\n });\n return focused;\n}\n\nfunction useWindowScroll(options = {}) {\n const { window = defaultWindow, behavior = \"auto\" } = options;\n if (!window) {\n return {\n x: ref(0),\n y: ref(0)\n };\n }\n const internalX = ref(window.scrollX);\n const internalY = ref(window.scrollY);\n const x = computed({\n get() {\n return internalX.value;\n },\n set(x2) {\n scrollTo({ left: x2, behavior });\n }\n });\n const y = computed({\n get() {\n return internalY.value;\n },\n set(y2) {\n scrollTo({ top: y2, behavior });\n }\n });\n useEventListener(\n window,\n \"scroll\",\n () => {\n internalX.value = window.scrollX;\n internalY.value = window.scrollY;\n },\n {\n capture: false,\n passive: true\n }\n );\n return { x, y };\n}\n\nfunction useWindowSize(options = {}) {\n const {\n window = defaultWindow,\n initialWidth = Number.POSITIVE_INFINITY,\n initialHeight = Number.POSITIVE_INFINITY,\n listenOrientation = true,\n includeScrollbar = true\n } = options;\n const width = ref(initialWidth);\n const height = ref(initialHeight);\n const update = () => {\n if (window) {\n if (includeScrollbar) {\n width.value = window.innerWidth;\n height.value = window.innerHeight;\n } else {\n width.value = window.document.documentElement.clientWidth;\n height.value = window.document.documentElement.clientHeight;\n }\n }\n };\n update();\n tryOnMounted(update);\n useEventListener(\"resize\", update, { passive: true });\n if (listenOrientation) {\n const matches = useMediaQuery(\"(orientation: portrait)\");\n watch(matches, () => update());\n }\n return { width, height };\n}\n\nexport { DefaultMagicKeysAliasMap, StorageSerializers, TransitionPresets, computedAsync as asyncComputed, breakpointsAntDesign, breakpointsBootstrapV5, breakpointsMasterCss, breakpointsPrimeFlex, breakpointsQuasar, breakpointsSematic, breakpointsTailwind, breakpointsVuetify, cloneFnJSON, computedAsync, computedInject, createFetch, createReusableTemplate, createTemplatePromise, createUnrefFn, customStorageEventName, defaultDocument, defaultLocation, defaultNavigator, defaultWindow, executeTransition, formatTimeAgo, getSSRHandler, mapGamepadToXbox360Controller, onClickOutside, onKeyDown, onKeyPressed, onKeyStroke, onKeyUp, onLongPress, onStartTyping, setSSRHandler, templateRef, unrefElement, useActiveElement, useAnimate, useAsyncQueue, useAsyncState, useBase64, useBattery, useBluetooth, useBreakpoints, useBroadcastChannel, useBrowserLocation, useCached, useClipboard, useClipboardItems, useCloned, useColorMode, useConfirmDialog, useCssVar, useCurrentElement, useCycleList, useDark, useDebouncedRefHistory, useDeviceMotion, useDeviceOrientation, useDevicePixelRatio, useDevicesList, useDisplayMedia, useDocumentVisibility, useDraggable, useDropZone, useElementBounding, useElementByPoint, useElementHover, useElementSize, useElementVisibility, useEventBus, useEventListener, useEventSource, useEyeDropper, useFavicon, useFetch, useFileDialog, useFileSystemAccess, useFocus, useFocusWithin, useFps, useFullscreen, useGamepad, useGeolocation, useIdle, useImage, useInfiniteScroll, useIntersectionObserver, useKeyModifier, useLocalStorage, useMagicKeys, useManualRefHistory, useMediaControls, useMediaQuery, useMemoize, useMemory, useMounted, useMouse, useMouseInElement, useMousePressed, useMutationObserver, useNavigatorLanguage, useNetwork, useNow, useObjectUrl, useOffsetPagination, useOnline, usePageLeave, useParallax, useParentElement, usePerformanceObserver, usePermission, usePointer, usePointerLock, usePointerSwipe, usePreferredColorScheme, usePreferredContrast, usePreferredDark, usePreferredLanguages, usePreferredReducedMotion, usePrevious, useRafFn, useRefHistory, useResizeObserver, useScreenOrientation, useScreenSafeArea, useScriptTag, useScroll, useScrollLock, useSessionStorage, useShare, useSorted, useSpeechRecognition, useSpeechSynthesis, useStepper, useStorage, useStorageAsync, useStyleTag, useSupported, useSwipe, useTemplateRefsList, useTextDirection, useTextSelection, useTextareaAutosize, useThrottledRefHistory, useTimeAgo, useTimeoutPoll, useTimestamp, useTitle, useTransition, useUrlSearchParams, useUserMedia, useVModel, useVModels, useVibrate, useVirtualList, useWakeLock, useWebNotification, useWebSocket, useWebWorker, useWebWorkerFn, useWindowFocus, useWindowScroll, useWindowSize };\n","/*!\n* tabbable 6.2.0\n* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE\n*/\n// NOTE: separate `:not()` selectors has broader browser support than the newer\n// `:not([inert], [inert] *)` (Feb 2023)\n// CAREFUL: JSDom does not support `:not([inert] *)` as a selector; using it causes\n// the entire query to fail, resulting in no nodes found, which will break a lot\n// of things... so we have to rely on JS to identify nodes inside an inert container\nvar candidateSelectors = ['input:not([inert])', 'select:not([inert])', 'textarea:not([inert])', 'a[href]:not([inert])', 'button:not([inert])', '[tabindex]:not(slot):not([inert])', 'audio[controls]:not([inert])', 'video[controls]:not([inert])', '[contenteditable]:not([contenteditable=\"false\"]):not([inert])', 'details>summary:first-of-type:not([inert])', 'details:not([inert])'];\nvar candidateSelector = /* #__PURE__ */candidateSelectors.join(',');\nvar NoElement = typeof Element === 'undefined';\nvar matches = NoElement ? function () {} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;\nvar getRootNode = !NoElement && Element.prototype.getRootNode ? function (element) {\n var _element$getRootNode;\n return element === null || element === void 0 ? void 0 : (_element$getRootNode = element.getRootNode) === null || _element$getRootNode === void 0 ? void 0 : _element$getRootNode.call(element);\n} : function (element) {\n return element === null || element === void 0 ? void 0 : element.ownerDocument;\n};\n\n/**\n * Determines if a node is inert or in an inert ancestor.\n * @param {Element} [node]\n * @param {boolean} [lookUp] If true and `node` is not inert, looks up at ancestors to\n * see if any of them are inert. If false, only `node` itself is considered.\n * @returns {boolean} True if inert itself or by way of being in an inert ancestor.\n * False if `node` is falsy.\n */\nvar isInert = function isInert(node, lookUp) {\n var _node$getAttribute;\n if (lookUp === void 0) {\n lookUp = true;\n }\n // CAREFUL: JSDom does not support inert at all, so we can't use the `HTMLElement.inert`\n // JS API property; we have to check the attribute, which can either be empty or 'true';\n // if it's `null` (not specified) or 'false', it's an active element\n var inertAtt = node === null || node === void 0 ? void 0 : (_node$getAttribute = node.getAttribute) === null || _node$getAttribute === void 0 ? void 0 : _node$getAttribute.call(node, 'inert');\n var inert = inertAtt === '' || inertAtt === 'true';\n\n // NOTE: this could also be handled with `node.matches('[inert], :is([inert] *)')`\n // if it weren't for `matches()` not being a function on shadow roots; the following\n // code works for any kind of node\n // CAREFUL: JSDom does not appear to support certain selectors like `:not([inert] *)`\n // so it likely would not support `:is([inert] *)` either...\n var result = inert || lookUp && node && isInert(node.parentNode); // recursive\n\n return result;\n};\n\n/**\n * Determines if a node's content is editable.\n * @param {Element} [node]\n * @returns True if it's content-editable; false if it's not or `node` is falsy.\n */\nvar isContentEditable = function isContentEditable(node) {\n var _node$getAttribute2;\n // CAREFUL: JSDom does not support the `HTMLElement.isContentEditable` API so we have\n // to use the attribute directly to check for this, which can either be empty or 'true';\n // if it's `null` (not specified) or 'false', it's a non-editable element\n var attValue = node === null || node === void 0 ? void 0 : (_node$getAttribute2 = node.getAttribute) === null || _node$getAttribute2 === void 0 ? void 0 : _node$getAttribute2.call(node, 'contenteditable');\n return attValue === '' || attValue === 'true';\n};\n\n/**\n * @param {Element} el container to check in\n * @param {boolean} includeContainer add container to check\n * @param {(node: Element) => boolean} filter filter candidates\n * @returns {Element[]}\n */\nvar getCandidates = function getCandidates(el, includeContainer, filter) {\n // even if `includeContainer=false`, we still have to check it for inertness because\n // if it's inert, all its children are inert\n if (isInert(el)) {\n return [];\n }\n var candidates = Array.prototype.slice.apply(el.querySelectorAll(candidateSelector));\n if (includeContainer && matches.call(el, candidateSelector)) {\n candidates.unshift(el);\n }\n candidates = candidates.filter(filter);\n return candidates;\n};\n\n/**\n * @callback GetShadowRoot\n * @param {Element} element to check for shadow root\n * @returns {ShadowRoot|boolean} ShadowRoot if available or boolean indicating if a shadowRoot is attached but not available.\n */\n\n/**\n * @callback ShadowRootFilter\n * @param {Element} shadowHostNode the element which contains shadow content\n * @returns {boolean} true if a shadow root could potentially contain valid candidates.\n */\n\n/**\n * @typedef {Object} CandidateScope\n * @property {Element} scopeParent contains inner candidates\n * @property {Element[]} candidates list of candidates found in the scope parent\n */\n\n/**\n * @typedef {Object} IterativeOptions\n * @property {GetShadowRoot|boolean} getShadowRoot true if shadow support is enabled; falsy if not;\n * if a function, implies shadow support is enabled and either returns the shadow root of an element\n * or a boolean stating if it has an undisclosed shadow root\n * @property {(node: Element) => boolean} filter filter candidates\n * @property {boolean} flatten if true then result will flatten any CandidateScope into the returned list\n * @property {ShadowRootFilter} shadowRootFilter filter shadow roots;\n */\n\n/**\n * @param {Element[]} elements list of element containers to match candidates from\n * @param {boolean} includeContainer add container list to check\n * @param {IterativeOptions} options\n * @returns {Array.}\n */\nvar getCandidatesIteratively = function getCandidatesIteratively(elements, includeContainer, options) {\n var candidates = [];\n var elementsToCheck = Array.from(elements);\n while (elementsToCheck.length) {\n var element = elementsToCheck.shift();\n if (isInert(element, false)) {\n // no need to look up since we're drilling down\n // anything inside this container will also be inert\n continue;\n }\n if (element.tagName === 'SLOT') {\n // add shadow dom slot scope (slot itself cannot be focusable)\n var assigned = element.assignedElements();\n var content = assigned.length ? assigned : element.children;\n var nestedCandidates = getCandidatesIteratively(content, true, options);\n if (options.flatten) {\n candidates.push.apply(candidates, nestedCandidates);\n } else {\n candidates.push({\n scopeParent: element,\n candidates: nestedCandidates\n });\n }\n } else {\n // check candidate element\n var validCandidate = matches.call(element, candidateSelector);\n if (validCandidate && options.filter(element) && (includeContainer || !elements.includes(element))) {\n candidates.push(element);\n }\n\n // iterate over shadow content if possible\n var shadowRoot = element.shadowRoot ||\n // check for an undisclosed shadow\n typeof options.getShadowRoot === 'function' && options.getShadowRoot(element);\n\n // no inert look up because we're already drilling down and checking for inertness\n // on the way down, so all containers to this root node should have already been\n // vetted as non-inert\n var validShadowRoot = !isInert(shadowRoot, false) && (!options.shadowRootFilter || options.shadowRootFilter(element));\n if (shadowRoot && validShadowRoot) {\n // add shadow dom scope IIF a shadow root node was given; otherwise, an undisclosed\n // shadow exists, so look at light dom children as fallback BUT create a scope for any\n // child candidates found because they're likely slotted elements (elements that are\n // children of the web component element (which has the shadow), in the light dom, but\n // slotted somewhere _inside_ the undisclosed shadow) -- the scope is created below,\n // _after_ we return from this recursive call\n var _nestedCandidates = getCandidatesIteratively(shadowRoot === true ? element.children : shadowRoot.children, true, options);\n if (options.flatten) {\n candidates.push.apply(candidates, _nestedCandidates);\n } else {\n candidates.push({\n scopeParent: element,\n candidates: _nestedCandidates\n });\n }\n } else {\n // there's not shadow so just dig into the element's (light dom) children\n // __without__ giving the element special scope treatment\n elementsToCheck.unshift.apply(elementsToCheck, element.children);\n }\n }\n }\n return candidates;\n};\n\n/**\n * @private\n * Determines if the node has an explicitly specified `tabindex` attribute.\n * @param {HTMLElement} node\n * @returns {boolean} True if so; false if not.\n */\nvar hasTabIndex = function hasTabIndex(node) {\n return !isNaN(parseInt(node.getAttribute('tabindex'), 10));\n};\n\n/**\n * Determine the tab index of a given node.\n * @param {HTMLElement} node\n * @returns {number} Tab order (negative, 0, or positive number).\n * @throws {Error} If `node` is falsy.\n */\nvar getTabIndex = function getTabIndex(node) {\n if (!node) {\n throw new Error('No node provided');\n }\n if (node.tabIndex < 0) {\n // in Chrome,
,