(()=>{var nP={9336:(a,l,se)=>{"use strict";se.d(l,{A:()=>Ie,L:()=>Re});var we=se(2096),Te=se(6419);const ae=JSON.parse('{"header":{"openMenu":"Open menu"},"dataTable":{"noResults":"No results found","resultsPerPage":"Results per page","pagination":"Page {{currentPage}} of {{totalPage}}","goToFirstPage":"Go to first page","goToPreviousPage":"Go to previous page","goToNextPage":"Go to next page","goToLastPage":"Go to last page"},"sidebar":{"closeSidebar":"Close sidebar"},"spinner":{"loading":"Loading..."},"combobox":{"emptyValue":"Select ...","searchPlaceholder":"Search","noResults":"No result"},"imageUploaderDialog":{"dropYourFile":"Drop your file here","clickToSelectAFile":"Or click to select a file","zoom":"Zoom"},"actions":{"save":"Save","confirm":"Confirm","cancel":"Cancel","discardChanges":"Discard Changes"},"formValidation":{"default":"This field is invalid.","required":"This field is required.","oneOf":"This field must be one of the following values: {{values}}.","notOneOf":"This field must not be one of the following values: {{values}}.","length":"This field must be exactly {{length}} characters.","minlength":"This field must be at least {{min}} characters.","maxlength":"This field must be at most {{max}} characters.","email":"This field must be a valid email.","url":"This field must be a valid URL.","min":"This field must be greater than or equal to {{min}}.","max":"This field must be less than or equal to {{max}}.","lessThan":"This field must be less than {{less}}.","moreThan":"This field must be greater than {{more}}.","positive":"This field must be a positive number.","negative":"This field must be a negative number.","integer":"This field must be an integer.","minDate":"This field must be later than {{min}}.","maxDate":"This field must be at earlier than {{max}}.","itemLength":"This field must have {{length}} items.","minItems":"This field must have at least {{min}} items.","maxItems":"This field must have less than or equal to {{max}} items."},"errors":{"generic":"An error has occurred. Try Again. If this error persists, please contact us.","unexpected":{"error":"An error has occurred. Try Again. If this error persists, please contact us."},"already.has.role":"A user with this email already exists.","server":{"title":"An error has occurred","description":"Sorry, an unexpected error has occurred. Please try again or contact us if the error persists."},"insufficient.api.key.permissions":"The API keys provided do not have sufficient permissions. Please update the permissions and try again.","invalid.api.keys":"The API keys provided are invalid. Please verify the public/private API keys and try again.","invalid.url":"Invalid ConnectWise API URL. Please verify the URL and try again.","place.order.error":"Failed to create order. Please try again.","already.admin":"You cannot invite an administrator as an organization user."},"theme":{"darkModeToggle":{"enableDarkModeTooltip":"Enable dark mode","disableDarkModeTooltip":"Disable dark mode"}},"notification":{"all":"All"},"prompt":{"unSavedChangesMessage":"Are you sure you want to exit? Any unsaved changes will be lost"},"orders":{"types":{"purchase":"Purchase","update":"Update"},"status":{"failed":"Failed","pending":"Processing","completed":"Completed","waitingForApproval":"Waiting For Approval","rejected":"Rejected"},"detail":{"title":"Order {{orderId}}","orderId":"Order Id","createdOn":"Created On","organizationName":"Organization Name","createdBy":"Created By","orderValue":"Value","status":"Status","type":"Type","quantity":"Quantity","serverError":"Service provider error","productName":"Product name","comment":"Comment"}},"loader":{"title":"Refresh","loading":"Refreshing"}}'),ie=JSON.parse(`{"header":{"openMenu":"Ouvrir le menu"},"dataTable":{"noResults":"Aucun r\xE9sultat trouv\xE9","resultsPerPage":"R\xE9sultats par page","pagination":"Page {{currentPage}} de {{totalPage}}","goToFirstPage":"Aller \xE0 la premi\xE8re page","goToPreviousPage":"Aller \xE0 la page pr\xE9c\xE9dente","goToNextPage":"Aller \xE0 la page suivante","goToLastPage":"Aller \xE0 la derni\xE8re page"},"sidebar":{"closeSidebar":"Fermer la barre lat\xE9rale"},"spinner":{"loading":"Chargement..."},"combobox":{"emptyValue":"S\xE9lectionnez ...","searchPlaceholder":"Recherche","noResults":"Aucun r\xE9sultat"},"imageUploaderDialog":{"dropYourFile":"D\xE9posez votre fichier ici","clickToSelectAFile":"Ou cliquez pour s\xE9lectionner un fichier","zoom":"Zoom"},"actions":{"save":"Sauvegarder","confirm":"Confirmer","cancel":"Annuler","discardChanges":"Ignorer les modifications"},"formValidation":{"default":"Ce champ n'est pas valide.","required":"Ce champ est obligatoire.","oneOf":"Ce champ doit contenir l'une des valeurs suivantes : {{values}}.","notOneOf":"Ce champ ne doit contenir aucune des valeurs suivantes : {{values}}.","length":"Ce champ doit contenir exactement {{length}} caract\xE8res.","minlength":"Ce champ doit contenir au moins {{min}} caract\xE8res.","maxlength":"Ce champ doit contenir {{max}} caract\xE8res maximum.","email":"Ce champ doit correspondre \xE0 une adresse de courriel valide.","url":"Ce champ doit \xEAtre une URL valide.","min":"Ce champ doit avoir une valeur sup\xE9rieure ou \xE9gale \xE0 {{min}}.","max":"Ce champ doit avoir une valeur inf\xE9rieure ou \xE9gale \xE0 {{max}}.","lessThan":"Ce champ doit avoir une valeur inf\xE9rieure \xE0 {{less}}.","moreThan":"Ce champ doit \xEAtre sup\xE9rieur \xE0 {{more}}.","positive":"Ce champ doit \xEAtre un nombre positif.","negative":"Ce champ doit \xEAtre un nombre n\xE9gatif.","integer":"Ce champ doit \xEAtre un nombre entier.","minDate":"Ce champ doit \xEAtre ult\xE9rieur \xE0 {{min}}.","maxDate":"Ce champ doit \xEAtre ant\xE9rieur \xE0 {{max}}.","itemLength":"Ce champ doit \xEAtre ant\xE9rieur {{length}} items.","minItems":"Ce champ doit contenir au moins {{min}} \xE9l\xE9ments.","maxItems":"Ce champ ne doit pas contenir plus de {{max}} \xE9l\xE9ments."},"errors":{"generic":"Une erreur est survenue. Essayer \xE0 nouveau. Si cette erreur persiste, veuillez nous contacter.","unexpected":{"error":"Une erreur est survenue. Essayer \xE0 nouveau. Si cette erreur persiste, veuillez nous contacter."},"already.has.role":"Un utilisateur avec cette adresse courriel existe d\xE9j\xE0.","server":{"title":"Une erreur s'est produite","description":"D\xE9sol\xE9, une erreur est survenue. Veuillez r\xE9essayer ou contactez-nous si l'erreur persiste."},"insufficient.api.key.permissions":"Les cl\xE9s API fournies n'ont pas les autorisations suffisantes. Veuillez mettre \xE0 jour les autorisations et r\xE9essayer.","invalid.api.keys":"Les cl\xE9s API fournies sont invalides. Veuilllez v\xE9rifier les cl\xE9s API publique/priv\xE9e et r\xE9essayer.","invalid.url":"URL ConnectWise invalide. Veuilllez v\xE9rifier l'URL et r\xE9essayer.","place.order.error":"\xC9chec lors de la cr\xE9ation de la commande. Veuillez r\xE9essayer.","already.admin":"Vous ne pouvez pas inviter un administrateur en tant qu'utilisateur de l'organisation."},"theme":{"darkModeToggle":{"enableDarkModeTooltip":"Activer le mode sombre","disableDarkModeTooltip":"D\xE9sactiver le monde sombre"}},"notification":{"all":"Tous"},"prompt":{"unSavedChangesMessage":"\xCAtes-vous s\xFBr de vouloir quitter ? Toutes les modifications non enregistr\xE9es seront perdues."},"orders":{"types":{"purchase":"Achat","update":"Mise \xE0 jour"},"status":{"failed":"Echec","pending":"En cours","completed":"Completed","waitingForApproval":"En attente d'approbation","rejected":"Rejet\xE9"},"detail":{"title":"Command {{orderId}}","orderId":"Num\xE9ro de commande","createdOn":"Cr\xE9\xE9e le","organizationName":"Nom de l'organisation","createdBy":"Cr\xE9\xE9 par","orderValue":"Valeur","status":"Statut","type":"Type","quantity":"Quantit\xE9","productName":"Nom du produit","comment":"Commentaire"}},"loader":{"title":"Rafra\xEEchir","loading":"Rafra\xEEchissement"}}`),W=JSON.parse(`{"layout":{"menu":{"dashboard":"Dashboard","integrations":"Integrations","organizations":"Organizations","orders":"Orders","marketplace":"Marketplace","settings":"Settings"},"userMenu":{"profile":"Your profile","settings":"Settings","signOut":"Sign out","languageToggle":{"label":"Language","switchToFrenchTooltip":"Display in french","switchToEnglishTooltip":"Display in english","languages":{"french":"French","english":"English"}},"darkModeToggle":{"label":"Dark mode"},"goToPortal":"Access the portal"}},"pages":{"401":{"title":"Unauthorized access","description":"Sorry, you are not authorized to view this page.","backToLogin":"Back to login"},"403":{"title":"Forbidden access","description":"Sorry, you don't have permissions to view this page.","backToHomepage":"Back to the homepage"},"404":{"title":"This page does not exist","description":"Sorry, we couldn't find the page you're looking for.","backToHomepage":"Back to the homepage"},"500":{"title":"An error has occurred","description":"Sorry, an unexpected error has occurred. Please try again or contact us if the error persists.","reloadApplication":"Reload application"},"login":{"signIn":"Sign In"},"onboarding":{"nextStep":"Next","previousStep":"Previous","skip":"Skip","complete":"Access your self-service portal","portalConfiguration":{"stepTitle":"Portal configuration","title":"Portal configuration","description":"To get the most out of your self-service portal, take a moment to complete the onboarding process.","labels":{"uploadLogo":"Upload your company logo","portalUrl":"Your company self-service portal Url","resellerName":"Your company name"}},"serviceProviderConfiguration":{"stepTitle":"Service provider","title":"Service provider","description":"Connect Cumulus to your self-service portal by adding the necessary API information below. <0>How to generate your API keys</0>","placeholders":{"serviceProvider":"Select service provider"},"labels":{"clientIdKey":"Client Id","clientSecretKey":"Client Secret","subscriptionKey":"Subscription Key","serviceProvider":"Service Provider","clientIdKeyPlaceholder":"Provide your Sherweb client Id","clientSecretKeyPlaceholder":"Provide your Sherweb client secret","subscriptionKeyPlaceholder":"Provide your Sherweb subscription key"}},"supportInformation":{"stepTitle":"Support information","title":"Support information","description":"Provide your customers with points of contact through your self-service portal by providing the following information","placeholders":{"supportEmail":"Email address where your clients can contact you","supportPhoneNumber":"Phone number where your clients can call you"},"labels":{"supportEmail":"Support email","supportPhoneNumber":"Support phone number"},"error":{"supportEmail":"You cannot use a Sherweb email address for your support contact email."}},"onboardingComplete":{"title":"Congratulations!","description":"You successfully configured your self-service portal!","labels":{"seeOrganizations":"You will be able to view your organization's subscriptions.","inviteCustomers":"You will also have the ability to invite your customers to use the portal to manage their subscription licenses.","moreFeature":"More exciting features will be coming soon!"}}},"settings":{"title":"Settings","subtitle":"Customize the experience you provide to your customers","labels":{"save":"Save","saving":"Saving","changesApplied":"Changes applied"},"resellerSettings":{"title":"Reseller settings","subscriptions":{"title":"Subscriptions","description":"Control the way the subscriptions are going to behave and be displayed","labels":{"priceToggle":"Display retail or MSRP prices to your customers","thresholdToggle":"Set threshold for subscription update","allowSubscriptionCancellation":"Allow subscription cancellation"}},"subresellers":{"title":"Subresellers","description":"Manage the organization settings for your resellers and customize how the application displays them.","labels":{"displaySubresellers":"Display subreseller's organizations"}},"applicationFeatures":{"title":"Application Features","description":"Manage what features of the application you want you and your customers to be able to use.","labels":{"showSubscriptionsManagement":"Show Subscriptions Management","showUsersManagement":"Show Users Management","showLicensesManagement":"Show Licenses Management","showBillingManagement":"Show Billing Management"}},"userManagement":{"title":"User management","description":"Control how your users can manage their own users.","labels":{"createNewUsers":"Allow organization admins to create new users"}}},"serviceProviders":{"title":"Service providers","labels":{"save":"Save"},"general":{"title":"Sherweb Service Provider","description":"Sherweb service provider APIs allows you to manage Sherweb subscriptions and have access to some PSA advanced integrations","labels":{"enable":"Enable Sherweb service provider APIs"}}},"customizationsSettings":{"title":"Appearance & Customization","labels":{"save":"Save"},"logo":{"title":"Your logo","description":"Upload your logo to display your brand in your self-service portal","updateModal":{"title":"Update your logo"},"updateSuccess":"The logo has been updated successfully"},"favicon":{"title":"Your favicon","updateModal":{"title":"Update favicon"},"updateSuccess":"The favicon has been updated successfully"},"theme":{"title":"Theme","description":"Customize your customers' experience by selecting a theme that best matches your organization.","settingSuccessToastMessage":"New settings successfully saved and applied!","settingsFailureToastMessage":"Failure to save and apply new settings.","colorPicker":{"default":"Default","blue":"Blue","green":"Green"}}},"orderSettings":{"title":"Orders","labels":{"save":"Save"},"orders":{"title":"Orders","description":"Manage the organization settings for your resellers and customize how the application displays them.","labels":{"orderApprovalToggle":"All customer orders require approval"},"notifications":{"title":"Orders Notifications","description":"Manage how you receive orders notifications for your customers","teams":{"labels":{"orderSend":"Send in MS Teams"},"webhook":{"placeholder":"http://webhooktoteamschannel.site","label":"Your teams channel to receive orders","testConnection":"Send test notification","connectionSuccess":"Test notification sent successfully","connectionFailed":"Failed to connect to the webhook"}},"emails":{"labels":{"orderSend":"Send by email"},"placeholderInput":"user1@example.com, user2@example.com","sendAll":"Send to all of my users that have access to the self-service portal","listOfUsers":"List of recipients for orders notifications","emailNotFound":"No user(s) associated with: {{emails}}"}}}}},"orders":{"title":"Orders","noOrders":"No orders available.","list":{"orderId":"Order Id","createdOn":"Created On","organizationName":"Organization Name","createdBy":"Created By","orderValue":"Value","status":"Status","comment":"Comment","filterPlaceholder":"Find an order","searchFieldDescription":"Enter an order Id, the name of the organization or the requestor to find an order.","actions":{"label":"Actions","viewSubscription":"View subscription","viewSubscriptionMobile":"Subscription","viewDetailsMobile":"Details","viewDetails":"View details","approve":"Approve","reject":"Reject","confirmationModal":{"approveTitle":"Order Approval Confirmation","rejectTitle":"Order Rejection Confirmation","approveBody":"<p>You are about to approve order <strong>#{{orderId}}</strong> created for <strong>{{organizationName}}</strong>. <1></1> Are you sure you want to approve this order?</p>","rejectBody":"<p>You are about to reject order <strong>#{{orderId}}</strong> created for <strong>{{organizationName}}</strong>. <1></1> Are you sure you want to reject this order?</p>","decisionNotePlaceholder":"Feel free to provide a reason for the rejection (optional). This explanation will be visible to the user."}}},"orderAlreadyReviewed":{"title":"Order already approved | rejected","content":"This order has already been approved|rejected. Please find more information in the order list."},"orderApprovalDecisionErrors":{"orderInTheWrongStatus":"Sorry, the order is in the wrong status.","notFound":"Sorry, we couldn't find the order you're looking for."},"status":{"failed":"Failed","pending":"Processing","completed":"Completed","waitingForApproval":"Waiting For Approval","rejected":"Rejected"}},"organizations":{"title":"Organizations","noOrganization":"No organization found.","subtitle":"Get an overview of your organizations","refresh":{"failureMessage":"Unable to refresh. Please try again in a few minutes.","successMessage":"Organizations data has been refreshed successfully"},"list":{"name":"Name","users":"Users","subscriptions":"Subscriptions","settings":"Settings","settingsTooltip":"The settings type tells you which organization(s) have your default configuration and the ones with custom configuration.","settingsTypes":{"default":"Default","custom":"Custom"},"status":"Status","statuses":{"active":"Active","suspended":"Suspended"},"filterPlaceholder":"Find an organization","searchFieldDescription":"Enter the name of the organization to find an organization.","actions":{"label":"Actions","viewSettingsMobile":"Settings","viewSettings":"View settings","openOrganization":"Open organization","openOrganizationMobile":"Organization","resetSettings":"Reset to default settings","resetSettingsconfirmationModal":{"title":"Reset to default settings","confirmationButtonText":"Reset settings","description":"Are you sure you want to reset this organization's settings to your default configuration?"}}},"detail":{"subTitle":"Manage your organization settings","portalFeatures":{"title":"Portal features","toggles":{"userManagement":"Show User Management","subscriptionManagement":"Show Subscription Management","licenseManagement":"Show Licenses management","helpDeskManagement":"Show Support Management"}},"subscriptionFeatures":{"title":"Subscription settings","toggles":{"orderApproval":"All orders require approval","displayPrices":"Display prices","allowSubscriptionCancellation":"Allow subscription cancellation"}},"userSettings":{"title":"User settings","toggles":{"orgAdminCanCreateUsers":"Allow organization admins to create new users"}},"actions":{"cancel":"Cancel","save":"Save","saving":"Saving"},"confirmationModal":{"title":"Pending changes","confirmationButtonText":"Discard changes","description":"Are you sure you want to exit ? Any unsaved changes will be lost"}}},"marketplace":{"title":"Marketplace","subtitle":"Manage your catalogs and products and assign them to your organizations.","labels":{"organizations":"Organizations","skus":"SKUs"},"catalogs":{"allProducts":"All Products","searchInputPlaceholder":"Search products in catalog","searchInputHelper":"Find product in your catalog by product name, vendor or SKU","manageCatalog":"Manage catalog","manageProducts":"Manage products","manageAssignedOrganizations":"Manage assigned organizations","billingCycle":"Cycle","commitmentTerm":"Commitment","backToCatalogs":"Back to Catalogs","addProducts":"Add products","startingPrice":"Starting Price","commitmentValues":{"Annual":"Annual","Biennial":"Biennial","Triennial":"Triennial","Monthly":"Monthly","Unknown":"N/A","Open":"No commitment"},"billingCycleValues":{"None":"None","Daily":"Daily","Weekly":"Weekly","Monthly":"Monthly","Yearly":"Yearly","Unknown":"None (one-time purchase)","Once":"Once"}},"addProducts":{"title":"Manage {{name}} products","description":"Use the list of products below in order to add or remove products from the catalog","updateCatalog":"Update catalog","table":{"vendor":"Vendor","sku":"SKU","productName":"Product name","price":"Price"},"confirmation":{"title":"Update Catalog Products","updateCatalog":"Update catalog","body_one":"<p>Are you sure you want to update the catalog <strong>{{catalogName}}</strong> with the new product selection? </p><br /><p> After this update, this catalog will have: <strong>{{count}}</strong> product</p>","body_other":"<p>Are you sure you want to update the catalog <strong>{{catalogName}}</strong> with the new products selection? </p><br /><p> After this update, this catalog will have: <strong>{{count}}</strong> products</p>","updateCatalogSuccessMessage":"Catalog updated successfully","updateCatalogFailureMessage":"Catalog update failed"}},"manageOrganizations":{"title":"Manage catalog assigned organizations","notFound":"No organization found","searchPlaceholder":"Filter organizations","updateCatalog":"Update catalog"}},"integrations":{"title":"Integrations","tabs":{"all":"All Integrations","billing":"Billing","serviceProvider":"Service Provider","support":"Support"},"backLink":"Back to Integrations","cards":{"connectWise":{"title":"ConnectWise PSA","description":"Provide your customers with a support integration that is directly connected to your ConnectWise PSA."},"sherweb":{"title":"Sherweb","description":"Allow your customers to interact with their subscriptions and services."}},"buttons":{"setup":"Setup","connected":"Connected"},"serviceProvider":{"sherweb":{"title":"Sherweb Integration","subTitle":"Allow your customers to manage their subscriptions and products using the self-service portal from Sherweb's partner portal application.","keysTitle":"Sherweb API keys","keysDescription":"In order to allow your customers handling their subscription you need generate a Service Provider API key information. <0>Need help?</0>","form":{"title":"Sherweb","clientIdKey":"Client Id","clientSecretKey":"Client Secret","clientIdKeyPlaceholder":"Provide your Sherweb client Id","clientSecretKeyPlaceholder":"Provide your Sherweb client secret","subscriptionKey":"Subscription Key","subscriptionKeyPlaceholder":"Provide your Sherweb subscription key","errorClientIdFormat":"Please enter a valid Sheweb client Id"},"updateSuccessMessage":"The service provider configuration was successful","updateFailureMessage":"The service provider configuration was failed"}},"helpdesk":{"connectWise":{"title":"ConnectWise service desk integration","tabs":{"apiInformation":"Information API","boardConfiguration":"Board Configuration","organizationMapping":"Organization/Company Mapping"},"apiInformation":{"title":"ConnectWise Service Desk","enabled":{"title":"ConnectWise service desk for SSP","description":"By enabling the ConnectWise service desk integration in the self-service portal, your customers will be able to create and view support requests directly through the portal.","label":"Enable ConnectWise APIs for service desk"},"configuration":{"title":"ConnectWise Helpdesk API information","description":"Allow the self-service portal to interact with you PSA by creating and adding those API information. Need help? See your <0>PSA documentation</0>.","publicKey":"Public key:","fields":{"companyNameLabel":"Company Name","companyNamePlaceholder":"Enter you ConnectWise Company Id","publicApiKeyLabel":"Public API key","publicApiKeyPlaceholder":"********1234","privateApiKeyLabel":"Private API key","privateApiKeyPlaceholder":"********1234","clientIdLabel":"Client Id","clientIdPlaceholder":"Your ConnectWise client Id","urlLabel":"ConnectWise URL","urlPlaceholder":"Enter your ConnectWise company name","errorClientIdFormat":"Please enter a valid ConnectWise client Id"},"updateSuccess":"The ConnectWise Integration API information were successfully updated."},"permssionError":{"title":"Please ensure the following permissions are set for the API key:","companyPermssion":{"missing":"Add, Inquire:","label":"Companies/contact"},"servicePermission":{"missing":"Add, Inquire, and Edit:","label":"Service desk/service ticket"}}},"boardConfiguration":{"serviceBoard":{"title":"ConnectWise Service Board","description":"Select the service board you want your clients to use when interacting with you through the self-service portal.","label":"Select Service Board","placeholder":"Professional Services Placeholder"},"statusMapping":{"title":"Service desk statuses","description":"Map ConnectWise's service board statuses with those of the self-service portal to allow better communication with your customers.","showMoreStatuses":"More statuses","showLessStatuses":"Less statuses"},"ticketTypes":{"title":"Supported Ticket Types","description":"Among your ConnectWise ticket types, select the ones you want to display to your clients."},"oneTicketTypeAtleast":"At least one ticket type should be selected.","updateSuccess":"Your self-service portal service desk integration has been successfully configured","updateFailed":"We were not able to properly configure your self-service portal service desk integration. Please verify the information and try again.","modal":{"title":"Are you sure you want to save this configuration?","description":"This action will override the current configuration and cannot be reverted."}},"organizationMapping":{"pageHeading":"Please provide the mapping for the following organization(s) to enable their helpdesk feature.","title":"Unmapped Organizations","titleTooltip":"You can find the company Id in ConnectWise by going go Companies > Compagnies and you will find a column called \\"Company ID\\"","description":"Here you will find the list of organizations that we were not able to map to any company in your PSA.","organizationIdPlaceholder":"Enter the company ID associated with that organization","failedMappingError":"Unable to complete mapping. Please try another company Id","allOrganizationsMappedTitle":"There is no mapping to be done"}}}}},"actions":{"edit":"Edit","reset":"Reset","upload":"Upload","cancel":"Cancel","save":"Save"},"validations":{"mixed":{"required":"This field is required."},"email":{"format":"Please enter a valid email address."},"phoneNumber":{"invalid":"Invalid phone number"}},"errors":{"generic":"An error has occurred. Try Again. If this error persists, please contact us.","forbidden":"Sorry, you don't have permissions.","unexpected":{"error":"An error has occurred. Try Again. If this error persists, please contact us."}}}`),ee=JSON.parse(`{"layout":{"menu":{"dashboard":"Tableau de bord","integrations":"Int\xE9grations","organizations":"Organisations","orders":"Commandes","marketplace":"Place de March\xE9","settings":"Param\xE8tres"},"userMenu":{"profile":"Votre profil","settings":"Param\xE8tres","signOut":"D\xE9connexion","languageToggle":{"label":"Langue","switchToFrenchTooltip":"Afficher en fran\xE7ais","switchToEnglishTooltip":"Afficher en anglais","languages":{"french":"Fran\xE7ais","english":"Anglais"}},"darkModeToggle":{"label":"Mode sombre"},"goToPortal":"Acc\xE9der au portail"}},"pages":{"401":{"title":"Acc\xE8s non autoris\xE9","description":"D\xE9sol\xE9, vous n\u2019\xEAtes pas autoris\xE9 \xE0 consulter cette page.","backToLogin":"Retour \xE0 la connexion"},"403":{"title":"Acc\xE8s interdit","description":"D\xE9sol\xE9, vous n\u2019\xEAtes pas autoris\xE9 \xE0 afficher cette page.","backToHomepage":"Retour \xE0 la page d'accueil"},"404":{"title":"Cette page n'existe pas","description":"D\xE9sol\xE9, nous n'avons pas trouv\xE9 la page que vous recherchez.","backToHomepage":"Retour \xE0 la page d'accueil"},"500":{"title":"Une erreur s'est produite","description":"D\xE9sol\xE9, une erreur est survenue. Veuillez r\xE9essayer ou contactez-nous si l'erreur persiste.","reloadApplication":"Recharger l'application"},"login":{"signIn":"Connexion"},"onboarding":{"nextStep":"Suivant","previousStep":"Pr\xE9c\xE9dent","skip":"Sauter","complete":"Acc\xE9der \xE0 votre portail libre-service","portalConfiguration":{"stepTitle":"Configuration du portail","title":"Configuration du portail","description":"Afin de tirer le meilleur parti de votre portail libre-service, prenez un moment pour terminer le processus d'int\xE9gration.","labels":{"uploadLogo":"T\xE9l\xE9versez le logo de votre entreprise","portalUrl":"L'URL du portail libre-service de votre entreprise","resellerName":"Nom de votre compagnie"}},"serviceProviderConfiguration":{"stepTitle":"Fournisseur de services","title":"Fournisseur de services","description":"Connectez Cumulus \xE0 votre portail libre-service en ajoutant ci-dessous les informations d'API n\xE9cessaires. <0>Comment g\xE9n\xE9rer vos cl\xE9s d'API</0>","placeholders":{"serviceProvider":"S\xE9lectionnez un fournisseur de services"},"labels":{"clientIdKey":"Cl\xE9 API publique","clientSecretKey":"Cl\xE9 API priv\xE9e","subscriptionKey":"Cl\xE9 d'abonnement","serviceProvider":"Fournisseur de services","clientIdKeyPlaceholder":"Fournissez votre identifiant client Sherweb","clientSecretKeyPlaceholder":"Fournissez votre secret client Sherweb","subscriptionKeyPlaceholder":"Fournissez votre cl\xE9 d'abonnement Sherweb"}},"supportInformation":{"stepTitle":"Information de support","title":"Information de support","description":"Offrez \xE0 vos clients des points de contact via votre portail libre-service en fournissant les informations suivantes.","placeholders":{"supportEmail":"Adresse e-mail \xE0 laquelle vos clients peuvent vous contacter","supportPhoneNumber":"Num\xE9ro de t\xE9l\xE9phone sur lequel vos clients peuvent vous appeler"},"labels":{"supportEmail":"Adresse courriel d'assistance","supportPhoneNumber":"Num\xE9ro de t\xE9l\xE9phone d'assistance"},"error":{"supportEmail":"Vous ne pouvez pas utiliser une adresse courriel Sherweb comme adresse de contact pour le support."}},"onboardingComplete":{"title":"F\xE9licitations!","description":"Vous avez configur\xE9 votre portail libre-service avec succ\xE8s!","labels":{"seeOrganizations":"Vous pourrez consulter les abonnements de votre organisation.","inviteCustomers":"Vous aurez \xE9galement la possibilit\xE9 d'inviter vos clients \xE0 utiliser le portail pour g\xE9rer leurs licences d'abonnement.","moreFeature":"D'autres fonctionnalit\xE9s passionnantes arriveront bient\xF4t!"}}},"settings":{"title":"Param\xE8tres","subtitle":"Personnalisez l'exp\xE9rience que vous offrez \xE0 vos clients.","labels":{"save":"Sauvegarder","saving":"Sauvegarde","changesApplied":"Modifications appliqu\xE9es"},"resellerSettings":{"title":"Param\xE8tres du revendeur","subscriptions":{"title":"Abonnements","description":"Contr\xF4lez la mani\xE8re dont les abonnements vont se comporter et \xEAtre affich\xE9s.","labels":{"priceToggle":"Affichez les prix de d\xE9tail (Retail) ou les prix publics sugg\xE9r\xE9s (MSRP) \xE0 vos clients.","thresholdToggle":"D\xE9finissez un seuil pour la mise \xE0 jour de l'abonnement.","allowSubscriptionCancellation":"Autoriser l\u2019annulation de l\u2019abonnement"}},"subresellers":{"title":"Sous-revendeurs","description":"G\xE9rez les param\xE8tres des organisations de vos revendeurs et personnalisez l'affichage dans l'application.","labels":{"displaySubresellers":"Afficher les organizations de sous-revendeurs"}},"applicationFeatures":{"title":"Caract\xE9ristiques de l\u2019application","description":"G\xE9rez les fonctionnalit\xE9s de l\u2019application que vous souhaitez que vous et vos clients puissiez utiliser.","labels":{"showSubscriptionsManagement":"Afficher la gestion des abonnements","showUsersManagement":"Afficher la gestion des utilisateurs","showLicensesManagement":"Afficher la gestion des licences","showBillingManagement":"Afficher la gestion de la facturation"}},"userManagement":{"title":"Gestion d'utilisateurs","description":"Contr\xF4lez comment vos utilisateurs peuvent g\xE9rer leurs propres utilisateurs.","labels":{"createNewUsers":"Permettre aux administrateurs de l'organisation de cr\xE9er de nouveaux utilisateurs."}}},"serviceProviders":{"title":"Fournisseurs de service","labels":{"save":"Sauveguarder"},"general":{"title":"Fournisseur de service Sherweb","description":"Les API du fournisseur de services Sherweb vous permettent de g\xE9rer les abonnements Sherweb et d'avoir acc\xE8s \xE0 certaines int\xE9grations avanc\xE9es avec un PSA (Professional Services Automation).","labels":{"enable":"Activer les API du fournisseur de services Sherweb."}}},"customizationsSettings":{"title":"Apparence et Personnalisation.","labels":{"save":"Sauveguarder"},"logo":{"title":"Votre logo","description":"T\xE9l\xE9chargez votre logo pour afficher votre marque sur votre portail en libre-service.","updateModal":{"title":"Mettre \xE0 jour mon logo"},"updateSuccess":"Votre logo a \xE9t\xE9 mis \xE0 jour avec succ\xE8s."},"favicon":{"title":"Votre favicon","updateModal":{"title":"Mettre \xE0 jour le favicon"},"updateSuccess":"Le favicon a \xE9t\xE9 mis \xE0 jour avec succ\xE8s."},"theme":{"title":"Th\xE8me","description":"Personnalisez l'exp\xE9rience de vos clients en s\xE9lectionnant un th\xE8me qui correspond le mieux \xE0 votre organisation.","settingSuccessToastMessage":"Nouveaux param\xE8tres enregistr\xE9s et appliqu\xE9s avec succ\xE8s !","settingsFailureToastMessage":"\xC9chec de l'enregistrement et de l'application des nouveaux param\xE8tres.","colorPicker":{"default":"Par D\xE9faut","blue":"Bleu","green":"Vert"}}},"orderSettings":{"title":"Commandes","labels":{"save":"Sauveguarder"},"orders":{"title":"Commandes","description":"G\xE9rez les param\xE8tres des organisations de vos revendeurs et personnalisez l'affichage dans l'application.","labels":{"orderApprovalToggle":"Toutes les commandes des clients doivent \xEAtre approuv\xE9s"},"notifications":{"title":"Notifications de commandes","description":"G\xE9rez la mani\xE8re dont vous recevez les notifications de commandes pour vos clients","teams":{"labels":{"orderSend":"Envoyer dans MS Teams"},"webhook":{"placeholder":"http://url-webhook-vers-canal-teams","label":"Votre canal Teams pour recevoir les notifications de commandes","testConnection":"Envoyer un test de notification","connectionSuccess":"Notification de test envoy\xE9e avec succ\xE8s","connectionFailed":"\xC9chec de la connexion au webhook"}},"emails":{"labels":{"orderSend":"Envoyer par courriel"},"placeholderInput":"utilisateur1@exemple.com, utilisateur2@exemple.com","sendAll":"Envoyez \xE0 tous mes utilisateurs qui ont acc\xE8s au portail en libre-service.","listOfUsers":"Liste des destinataires pour les notifications de commandes","emailNotFound":"Aucun utilisateur(s) associ\xE9(s) \xE0 : {{emails}}"}}}}},"orders":{"title":"Commandes","noOrders":"Aucune commande disponible.","list":{"orderId":"Num\xE9ro de commande","createdOn":"Cr\xE9\xE9e le","organizationName":"Nom de l'organisation","createdBy":"Cr\xE9\xE9 par","orderValue":"Valeur","status":"Statut","comment":"Commentaire","filterPlaceholder":"Trouver une commande","searchFieldDescription":"Saisissez un num\xE9ro de commande , un nom d'organisation ou un demandeur afin de trouver une commande.","actions":{"label":"Actions","viewSubscription":"Afficher l'abonnement","viewSubscriptionMobile":"Abonnement","viewDetailsMobile":"D\xE9tails","viewDetails":"Afficher d\xE9tails","approve":"Approuver la commande","reject":"Rejeter la commande","confirmationModal":{"approveTitle":"Confirmation d'Approbation de commande","rejectTitle":"Confirmation de Rejet de Commande","approveBody":"<p>Vous \xEAtes sur le point d'approuver la commande <strong>n\xB0{{orderId}}</strong> cr\xE9\xE9e pour <strong>{{organizationName}}</strong>. <1></1> \xCAtes-vous s\xFBr(e) de vouloir approuver cette commande ?</p>","rejectBody":"<p>Vous \xEAtes sur le point de refuser la commande <strong>n\xB0{{orderId}}</strong> cr\xE9\xE9e pour <strong>{{organizationName}}</strong>. <1></1> \xCAtes-vous s\xFBr(e) de vouloir rejeter cette commande ?</p>","decisionNotePlaceholder":"N'h\xE9sitez pas \xE0 fournir une raison pour le refus (facultatif). Cette explication sera visible par l'utilisateur."}}},"orderAlreadyReviewed":{"title":"Commande d\xE9j\xE0 approuv\xE9e | rejet\xE9e","content":"Veuillez consulter la liste des commandes pour plus d'informations."},"orderApprovalDecisionErrors":{"orderInTheWrongStatus":"D\xE9sol\xE9, le statut de la commande est incorrect.","notFound":"D\xE9sol\xE9, nous n'avons pas trouv\xE9 la commande que vous recherchez."},"status":{"failed":"Echec","pending":"En cours","completed":"Completed","waitingForApproval":"En attente d'approbation","rejected":"Rejet\xE9"}},"organizations":{"title":"Organisations","noOrganization":"Aucune organisation trouv\xE9.","subtitle":"Obtenez un aper\xE7u de vos organisations","refresh":{"failureMessage":"Impossible de rafra\xEEchir. Veuillez r\xE9essayer dans quelques minutes.","successMessage":"Les donn\xE9es des organisations ont \xE9t\xE9 actualis\xE9es avec succ\xE8s !"},"list":{"name":"Nom","users":"Utilisateurs","subscriptions":"Abonnements","settings":"Param\xE8tres","settingsTooltip":"Le type de param\xE8tre vous indique quelles organisations ont votre configuration par d\xE9faut et celles ayant une configuration personnalis\xE9e.","settingsTypes":{"default":"Par d\xE9faut","custom":"Personnalis\xE9"},"status":"Statut","statuses":{"active":"Actif","suspended":"Suspendu"},"filterPlaceholder":"Trouver une organisation","searchFieldDescription":"Entrez le nom de l'organisation pour trouver une organisation.","actions":{"label":"Actions","viewSettingsMobile":"Param\xE8tres","viewSettings":"Mettre \xE0 jour les param\xE8tres","openOrganization":"Ouvrir l'organisation","openOrganizationMobile":"Organisation","resetSettings":"R\xE9tablir les param\xE8tres par default","resetSettingsconfirmationModal":{"title":"R\xE9tablir les param\xE8tres par default","confirmationButtonText":"Reinitialiser les param\xE8tres","description":"\xCAtes-vous s\xFBr de vouloir r\xE9initialiser les param\xE8tres de cette organisation \xE0 votre configuration par d\xE9faut?"}}},"detail":{"subTitle":"G\xE9rez les param\xE8tres de votre organisation","portalFeatures":{"title":"Fonctionnalit\xE9s du portail","toggles":{"userManagement":"Afficher la gestion des utilisateurs","subscriptionManagement":"Afficher la gestion des abonnements","licenseManagement":"Afficher la gestion des licences","helpDeskManagement":"Afficher la gestion du support"}},"subscriptionFeatures":{"title":"Param\xE8tres d'abonnement","toggles":{"orderApproval":"Toutes les commandes des clients doivent \xEAtre approuv\xE9s","displayPrices":"Afficher les prix","allowSubscriptionCancellation":"Autoriser l'annulation d'abonnements"}},"userSettings":{"title":"Param\xE8tres utilisateur","toggles":{"orgAdminCanCreateUsers":"Permettre aux administrateurs de l'organisation de cr\xE9er de nouveaux utilisateurs."}},"actions":{"cancel":"Annuler","save":"Sauvegarder","saving":"Sauvegarde"},"confirmationModal":{"title":"Modifications en cours","description":"\xCAtes-vous s\xFBr de vouloir quitter? Les modifications actuelles seront perdues","confirmationButtonText":"Ignorer les modifications"}}},"marketplace":{"title":"Place de March\xE9","subtitle":"G\xE9rez vos catalogues et produits et assignez les a vos organisations","labels":{"organizations":"Organisations","skus":"SKU"},"catalogs":{"allProducts":"Tous les produits","searchInputPlaceholder":"Rechercher des produits dans le catalogue","searchInputHelper":"Trouvez des produits dans votre catalogue par nom, fournisseur ou SKU","manageCatalog":"G\xE9rer le catalogue","manageProducts":"G\xE9rer les produits","manageAssignedOrganizations":"G\xE9rer les organisations assign\xE9es","billingCycle":"Cycle","commitmentTerm":"Engagement","backToCatalogs":"Retour aux catalogues","addProducts":"Ajouter des produits","commitmentValues":{"Annual":"Annuel","Biennial":"Biennal","Triennial":"Triennal","Monthly":"Mensuel","Unknown":"N/D","Open":"Aucun engagement"},"billingCycleValues":{"None":"Aucun","Daily":"Quotidien","Weekly":"Hebdomadaire","Monthly":"Mensuel","Yearly":"Annuel","Unknown":"Aucun (Achat unique)","Once":"Une fois"},"startingPrice":"Prix de d\xE9part"},"addProducts":{"title":"G\xE9rer {{name}} produits","description":"Utilisez la liste de produits ci-dessous afin d'ajouter ou retirer des produits du catalogue","updateCatalog":"Mettre \xE0 jour le catalogue","table":{"vendor":"Fournisseur","sku":"SKU","productName":"Nom du produit","price":"Prix"},"confirmation":{"title":"Mettre \xE0 jour les produits du catalogue","updateCatalog":"Mettre \xE0 jour le catalogue","body_one":"<p>\xCAtes-vous s\xFBr de vouloir mettre \xE0 jour le catalogue <strong>{{catalogName}} </strong>avec la nouvelle s\xE9lection de produit ?</p><br /><p>Apr\xE8s cette mise \xE0 jour, ce catalogue contiendra: <strong>{{count}}</strong> produit</p>","body_other":"<p>\xCAtes-vous s\xFBr de vouloir mettre \xE0 jour le catalogue <strong>{{catalogName}} </strong>avec la nouvelle s\xE9lection de produits ?</p><br /><p>Apr\xE8s cette mise \xE0 jour, ce catalogue contiendra: <strong>{{count}}</strong> produits</p>","updateCatalogSuccessMessage":"Catalogue mis \xE0 jour avec succ\xE8s","updateCatalogFailureMessage":"La mise \xE0 jour du catalogue a \xE9chou\xE9"}},"manageOrganizations":{"title":"G\xE9rer les organisations assign\xE9es au catalogue","notFound":"Aucune organisation trouv\xE9e","searchPlaceholder":"filtrer les organisations","updateCatalog":"Mettre \xE0 jour le catalogue"}},"integrations":{"title":"Int\xE9grations","tabs":{"all":"Toutes les int\xE9grations","billing":"Facturation","serviceProvider":"Fournisseur de services","support":"Support"},"backLink":"Retour aux int\xE9grations","cards":{"connectWise":{"title":"ConnectWise PSA","description":"Offrez \xE0 vos clients une int\xE9gration de support directement connect\xE9e \xE0 votre instance ConnectWise PSA."},"sherweb":{"title":"Sherweb","description":"Permettez \xE0 vos clients d'interagir avec leurs abonnements et services."}},"buttons":{"setup":"Configurer","connected":"Connect\xE9"},"serviceProvider":{"sherweb":{"title":"Int\xE9gration de Sherweb","subTitle":"Permettez \xE0 vos clients de g\xE9rer leurs abonnements et produits en utilisant le portail libre-service de l'application portail partenaire de Sherweb.","keysTitle":"Cl\xE9fs d'API sherweb","keysDescription":"Afin de permettre \xE0 vos clients de g\xE9rer leur abonnement, vous devez g\xE9n\xE9rer les informations de cl\xE9 API du fournisseur de services. <0>Besoin d'aide ?</0>","form":{"title":"Sherweb","clientIdKey":"Client Id","clientSecretKey":"Client Secret","clientIdKeyPlaceholder":"Fournissez votre identifiant client Sherweb","clientSecretKeyPlaceholder":"Fournissez votre secret client Sherweb","subscriptionKey":"Subscription Key","subscriptionKeyPlaceholder":"Fournissez votre cl\xE9 d'abonnement Sherweb","errorClientIdFormat":"Veuillez entrer un(e) identifiant client Sherweb valide"},"updateSuccessMessage":"La configuration du fournisseur de services a \xE9t\xE9 r\xE9ussie!","updateFailureMessage":"La configuration du fournisseur de services a \xE9chou\xE9."}},"helpdesk":{"connectWise":{"title":"Int\xE9gration du service d'assistance ConnectWise","tabs":{"apiInformation":"Information d'API","boardConfiguration":"Configuration du tableau de service","organizationMapping":"Cartographie des organisations/compagnies"},"apiInformation":{"title":"Service d'assistance de ConnectWise","enabled":{"title":"Service d'assistance de ConnectWise dans SSP","description":"En activant l'int\xE9gration du service d'assistance ConnectWise dans le portail en libre-service, vos clients pourront cr\xE9er et consulter des demandes de support directement via le portail.","label":"Activer les API ConnectWise pour le service d'assistance"},"configuration":{"title":"Information d'API pour ConnectWise","description":"Permettez au portail en libre-service d'interagir avec votre PSA en cr\xE9ant et en ajoutant ces informations API. Besoin d'aide ? Consultez votre documentation <0>PSA</0>.","publicKey":"Cl\xE9 publique:","fields":{"companyNameLabel":"Identifiant de compagnie","companyNamePlaceholder":"Entrez votre identifiant de compagnie ConnectWise","publicApiKeyLabel":"Cl\xE9 d'API publique","publicApiKeyPlaceholder":"********1234","privateApiKeyLabel":"Cl\xE9 d'API priv\xE9e","privateApiKeyPlaceholder":"********1234","clientIdLabel":"Identifiant client","clientIdPlaceholder":"Votre identifiant (client Id) ConnectWise","urlLabel":"URL ConnectWise","urlPlaceholder":"Entrez le nom de compagnie ConnectWise","errorClientIdFormat":"Veuillez saisir un identifiant de client ConnectWise valide"},"updateSuccess":"Les informations de l'API d'int\xE9gration de ConnectWise ont \xE9t\xE9 mises \xE0 jour avec succ\xE8s."},"permssionError":{"title":"Veuillez vous assurer que les permissions suivantes sont d\xE9finies pour la cl\xE9 API :","companyPermssion":{"missing":"Add, Inquire:","label":"Companies/contact"},"servicePermission":{"missing":"Add, Inquire, and Edit:","label":"Service desk/service ticket"}}},"boardConfiguration":{"serviceBoard":{"title":"Tableau de service ConnectWise","description":"S\xE9lectionnez le tableau de service que vous souhaitez que vos clients utilisent lorsqu'ils interagissent avec vous \xE0 travers le portail libre-service.","label":"Selectionnez un tableau de service","placeholder":"Professional Services Placeholder"},"statusMapping":{"title":"Statuts du service d'assistance","description":"Associez les statuts du tableau de service ConnectWise avec ceux du portail libre-service afin de mieux communiquer avec vos clients.","showMoreStatuses":"Plus de statuts","showLessStatuses":"Moins de status"},"ticketTypes":{"title":"Types de tickets support\xE9s","description":"Parmi vos types de tickets de ConnectWise, s\xE9lectionnez ceux que vous souhaitez afficher \xE0 vos clients."},"oneTicketTypeAtleast":"Au moins un type de billet doit \xEAtre s\xE9lectionn\xE9.","updateSuccess":"Votre int\xE9gration du service d'assistance du portail libre-service a \xE9t\xE9 configur\xE9e avec succ\xE8s.","updateFailed":"Nous n'avons pas pu configurer correctement l'int\xE9gration du service d'assistance de votre portail en libre-service. Veuillez v\xE9rifier les informations et r\xE9essayer.","modal":{"title":"\xCAtes-vous s\xFBr de vouloir sauvegarder cette configuration ?","description":"Cette action va remplacer la configuration actuelle et ne pourra pas \xEAtre annul\xE9e."}},"organizationMapping":{"pageHeading":"Veuillez fournir la cartographie des organisations suivantes afin d'activer leur fonction de support.","title":"Organisations non cartographi\xE9es","titleTooltip":"Vous pouvez trouver l'identifiant de l'entreprise dans ConnectWise en allant dans Compagnies > Compagnies, o\xF9 vous trouverez une colonne intitul\xE9e \\"Company ID\\"","description":"Voici la liste des organisations que nous n'avons pas pu associer \xE0 une entreprise dans votre PSA.","organizationIdPlaceholder":"Entrez l'identifiant de l'entreprise associ\xE9 \xE0 cette organisation","failedMappingError":"Impossible de terminer la cartographie. Veuillez essayer un autre identifiant d'entreprise","allOrganizationsMappedTitle":"Il n'y a aucune association \xE0 faire"}}}}},"actions":{"edit":"Modifier","reset":"R\xE9initialiser","upload":"T\xE9l\xE9charger","cancel":"Annuler","save":"Sauvegarder"},"validations":{"mixed":{"required":"Ce champ est obligatoire."},"email":{"format":"S'il vous pla\xEEt, entrez une adresse courriel valide."},"phoneNumber":{"invalid":"Num\xE9ro de t\xE9l\xE9phone invalide"}},"errors":{"generic":"Une erreur est survenue. Essayer \xE0 nouveau. Si cette erreur persiste, veuillez nous contacter.","unexpected":{"error":"Une erreur est survenue. Essayer \xE0 nouveau. Si cette erreur persiste, veuillez nous contacter."},"forbidden":"D\xE9sol\xE9, vous n\u2019\xEAtes pas autoris\xE9."}}`),q=JSON.parse(`{"layout":{"menu":{"dashboard":"Dashboard","users":"Users","subscriptions":"Subscriptions","licenses":"Licenses","billing":"Billing","reporting":"Reporting","support":"Support","settings":"Settings","marketplace":"Marketplace","orders":"Orders","tags":{"comingSoon":"Coming soon!"}},"notifications":{"iconTooltip":"View notifications"},"userMenu":{"profile":"Manage my profile","settings":"Settings","signOut":"Sign out","languageToggle":{"label":"Language","switchToFrenchTooltip":"Display in french","switchToEnglishTooltip":"Display in english","languages":{"french":"French","english":"English"}},"darkModeToggle":{"label":"Dark mode"},"goToAdmin":"Go to admin"}},"pages":{"401":{"title":"Unauthorized access","description":"Sorry, you are not authorized to view this page.","backToLogin":"Back to Login"},"403":{"title":"Forbidden access","description":"Sorry, you don't have permissions to view this page.","backToHomepage":"Back to Homepage"},"404":{"title":"This page does not exist","description":"Sorry, we couldn't find the page you're looking for.","backToHomepage":"Back to Homepage"},"500":{"title":"An error has occurred","description":"Sorry, an unexpected error has occurred. Please try again or contact us if the error persists.","reloadApplication":"Reload application"},"dashboard":{"title":"Hi, {{userFirstName}}!","pageDescription":"Welcome to {{resellerName}}'s Self-Service Portal","widgets":{"SubscriptionCountWidget":{"title":"Number of subscriptions","viewAll":"View all"},"CurrentUserLicenseCountWidget":{"title":"Your licenses","viewAll":"View licenses","more_one":"{{count}} more...","more":"{{count}} more..."},"UnusedLicenseCountWidget":{"title":"Unused licenses","viewAll":"View licenses","more_one":"{{count}} more...","more":"{{count}} more..."},"UserCountWidget":{"title":"Number of users","addUser":"Invite User","viewAll":"View all"}}},"login":{"resellerLogoAlternative":"{{resellerName}} logo","signInTo":"Welcome","welcomeBack":"Login to continue to {{resellerName}} self-service portal","loginform":{"username":{"label":"Username","placeholder":"Please enter your username","tooltip":"Enter your username in order to access the portal","errors":{"format":""}},"signIn":"Sign In","signingIn":"Signing In","or":"Or","signInAsAdmin":"Continue as admin"}},"subscriptions":{"title":"Subscriptions","pageDescription":"Manage and update the subscriptions to provide licenses to your users","list":{"filterPlaceholder":"Find a subscription","searchFieldDescription":"Search your subscriptions by subscription name or product.","columns":{"productName":"Name","billingCycle":"Cycle","quantity":"Quantity","price":"Price","total":"Total","status":"Status"},"renewsOn":"Renews on","pendingQuantity":"Pending quantity: {{pendingQuantity}}","pendingQuantityError":"Error during changing quantity to {{pendingQuantity}}. {{error}}","edit":"Edit"},"noSubscriptions":"No subscriptions just yet, contact your reseller to add subscriptions"},"subscription":{"backlink":"Back to Subscriptions","manageYourSubscriptionTitle":"Manage your subscription","updateSuccess":"Subscription update successfully initiated!","bilingCycle":"Billing cycle","renewalDate":"Renewal date","commitmentTerm":"Commitment","fieldNotAvailable":"That field is not available for this subscription","fieldNA":"N/A","currentQuantity":"Current quantity","total":"Total","quantityForm":{"quantity":"Change quantity","disclaimer":"Disclamer: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.","pendingQuantityWarning":"An order for this subscription is currently processing. Please wait or contact reseller for help.","lastOrderPendingQuantityError":"<strong>{{subscriptionName}}</strong> subscription update initiated on {{subscriptionUpdateDate}} to {{subscriptionUpdateOperation}} {{subscriptionUpdateDelta}} license(s) has failed. Please <0>contact us</0> for support.","cannotDecreaseSubscription":"You have reached the minimum quantity for this subscription due to the commitment.","cannotCancelSubscription":"You are not allowed to cancel this subscription, please contact your reseller for assistance.","orderOperation":{"add":"add","remove":"remove"},"actionBtnTooltip":{"pendingChanges":"An update for this subscription is currently being processed.","noChangesToSubmit":"You need to adjust your subscription quantities before attempting to submit an update.","updateQuantity":"Click here to update your subscription"},"actions":{"updateSubscription":"Update","updateProcessing":"Update Processing"},"confirmationModal":{"title":"New subscription update","body_one":"<p>Are you sure you want to {{operation}} <strong>{{quantityDelta}}</strong> license to this subscription? </p><1></1><p> After this update your total licenses quantity for this subscription will be: <strong>{{newQuantity}}</strong></p><p>{{orderApprovalSection}}</p>","body_other":"<p>Are you sure you want to {{operation}} <strong>{{quantityDelta}}</strong> licenses to this subscription? </p><1></1><p> After this update your total licenses quantity for this subscription will be: <strong>{{newQuantity}}</strong></p><p>{{orderApprovalSection}}</p>","addOperation":"add","removeOperation":"remove","confirmationButtonText":"Update subscription","proceedButtonText":"Proceed","orderApprovalSection":"<1></1>Once you click on <strong>Proceed</strong>, your order will be reviewed by your reseller before being approved."}},"summary":{"updatedTotalTitle":"Your new total after changes","autoRenewalOn":"Auto-renews on"},"details":{"tabs":{"subscriptionDetails":{"title":"Subscription details"},"history":{"title":"History"},"manageSubscription":{"title":"Manage subscription","getHelp":{"title":"Get Help","description":"Request help regarding this subscription"},"cancel":{"title":"Cancel subscription","description":"Canceling a subscription will remove access to the services included to all users","confirmationDialog":{"title":"Canceling {{productName}} subscription","content":"Are you sure you want to cancel your subscription for {{productName}}?","contentHelper":"Once you proceed you won't be able to use the services associated to this subscription anymore.","confirmButtonText":"Cancel subscription","dismissButtonText":"Keep subscription"}}}},"descriptionTitle":"Description"}},"licenses":{"title":"License Management","pageDescription":"Assign licenses to your user, so they can access and use your subscribed services efficiently","list":{"filterPlaceholder":"Find a license","searchFieldDescription":"Search your licenses by product name.","availableLicenses":"Available:","columns":{"productName":"Product","vendorName":"Vendor","licenses":"Licenses","users":"Users","action":"Action"}},"subscribersDialog":{"title":"Manage subscribers","filterPlaceholder":"Search a user","searchFieldDescription":"Search your subscribers by email.","createSubscriberButton":"Create Subscriber","creatingSubscriberButton":"Creating Subscriber","noSubscriber":"No subscribers found","confirmationButton":"Update","confirmationButtonLoading":"Updating","confirmationButtonDisableMessage":"No subscriber selected or insufficient number of licenses","updateSuccess":"Subscribers were successfully assigned/removed to the current license.","created":"Subscriber created successfully","requestSentWithSuccess":"Your request was sent successfully and will now be processed.","actions":{"addSubscriber":"Add subscriber to license","subscriberToBeAdded":"Subscriber has been marked for addition","removeSubscriber":"Revoke the license of this user.","subscriberToBeDeleted":"Subscriber has been marked for deletion","updateInProgress":"Update currently in progress"},"confirmationModal":{"title":"Pending changes","description":"Are you sure you want to exit? Any unsaved changes will be lost","confirmationButtonText":"Discard changes"}},"createSubcriberForm":{"title":"Assign this product to a new user","default":"default","email":"Email:","errors":{"subscriberAlreadyExists":"Cannot create subscriber. Subscriber with that email address already exists."},"placeholders":{"firstName":"First Name","lastName":"Last name","username":"Username"}},"refresh":{"failureMessage":"Unable to refresh. Please try again in a few minutes.","successMessage":"Licenses datas successfully refreshed!"},"manage":"Subscribers","noLicenses":"No licenses just yet, contact your reseller to add licenses","errors":{"licenseUpdateFailed":"{{licenseName}} license update for {{subscriberName}} has failed. Please try again."}},"support":{"title":"Help desk","summaryTitle":"Summary","showCase":{"title":"Coming Soon..."},"allTicketsTitle":"All tickets","list":{"columns":{"id":"#","createdAt":"Creation Date","updatedAt":"Last Updated","type":"Type","status":"Status","subject":"Subject","openedBy":"Opened by","assignedTo":"Assigned to","priority":"Priority"}}},"users":{"noUsers":"No users just yet, you can check back later or invite new users.","title":"Users","pageDescription":"Manage your users and allow them to take advantage of the portal.","list":{"filterPlaceholder":"Find a user","searchFieldDescription":"Enter a user name, email or job title to find a user.","columns":{"user":"User","firstName":"First name","lastName":"Last name","jobTitle":"Title","roles":"Role","createdOn":"Created on","email":"Email","status":"Status"},"delete":"Delete","edit":"Edit","resendInvitation":"Resend invitation","resendInvitationSuccessMessage":"The invitation was sent successfully!","resendInvitationFailureMessage":"We were unable to send the invitation. Please check the user information and try again."},"inviteUser":"Add User","status":{"Inactive":"Inactive","Active":"Active","InvitationSent":"Invitation sent"},"userDeletionDialog":{"title":"Delete user","description":"Are you sure you want to delete user <strong>{{user}}</strong>?","success":"User was deleted successfully"}},"user":{"new":{"title":"Invite a new user","pageDescription":"Grant access to the portal and empower users to manage their services.","submit":"Invite user","success":"The user has been successfully invited!"},"edit":{"tab":{"licenses":"Licenses"},"submit":"Update","submitting":"Updating","success":"The user has been updated successfully!"},"backlink":"Back to Users","form":{"fields":{"firstName":{"label":"First Name","placeholder":""},"lastName":{"label":"Last Name","placeholder":""},"jobTitle":{"label":"Job Title","placeholder":""},"role":{"label":"Role","placeholder":"User role in the application","organizationAdmin":{"description":"Has full access to manage {{organizationName}}."},"basicUser":{"description":"Has view-only access to {{organizationName}}."}},"email":{"label":"Email","placeholder":""},"preferredCulture":{"label":"Communication Language","placeholder":"Preferred language of communication"}}}},"billing":{"title":"Billing","pageDescription":"Pay and see your invoices and consult your transaction history","showCase":{"title":"Coming Soon..."},"amountDueWidget":{"title":"Total Amount Due","dueDate":"Due on {{dueDate}}","payNowButton":"Pay Now"},"tabs":{"invoices":{"title":"Invoices"},"transactions":{"title":"Transactions"}},"invoices":{"table":{"headers":{"invoice":"Invoice","customerName":"Customer","dueDate":"Due Date","status":"Status","amount":"Amount"},"status":{"paid":"Paid","unpaid":"Unpaid","overdue":"Overdue","new":"New"}}}},"organizationsNotActivated":{"title":"No organization found","content":"It seems you haven't enabled any organizations yet. To use the self-service portal, you must enable it for your organization(s) within your service provider's platform."},"organizationSuspended":{"title":"Suspended organization","content":"Your organization is currently suspended. To regain access to your organization please contact your reseller."},"helpdesk":{"notReady":{"title":"Your helpdesk is not ready yet","description":"We were unable to load your helpdesk information. Please try again later or contact your reseller for assistance.","contact":"Contact my reseller"},"emptyMessage":"No tickets just yet, if you need help create a new support request.","title":"Helpdesk","subTitle":"Contact our helpdesk for any technical or non-technical queries and get the support you need.","list":{"columns":{"ticketId":"Id","subject":"Issue","createdBy":"Created by","lastUpdated":"Last updated","ticketType":"Ticket type","status":"Status"}},"create":{"newRequest":"New request","requestType":"Request type","requestTypePlaceholder":"Select request type","title":"What do you need help with?","titlePlaceholder":"Try to describe your request in few words","titleMaxCharactersError":"Maximum 100 characters allowed","description":"Additional information","descriptionPlaceholder":"Use this field to provide additional details regarding your request","descriptionMaxCharactersError":"Maximum 700 characters allowed","send":"Send request","successMessage":"The request has been successfully created","failureMessage":"We were not able to send your request, please try again later","prompt":{"title":"Discard request","body":"Are you sure you want to discard that request creation?","cancel":"Cancel","ignore":"Discard"}},"detail":{"id":"# Id","status":"Status","createdBy":"Created by","createdAt":"Created at","type":"Type","lastUpdate":"Last update","replyPlaceholder":"Add reply","show":"Show","failureMessage":"Failed to send reply, please try again later"}},"shop":{"title":"Marketplace","subTitle":"Discover and integrate the perfect products for your needs","searchPlaceholder":"Search for products...","card":{"startingPrice":"Starting Price"},"subHeading":"All Products","filters":{"vendor":"Vendor","categories":"Categories","category":"Category","billingCycle":"Billing cycle","commitment":"Commitment","commitmentValues":{"Annual":"Annual","Biennial":"Biennial","Triennial":"Triennial","Monthly":"Monthly","Unknown":"N/A","Open":"No commitment"},"billingCycleValues":{"None":"None","Daily":"Daily","Weekly":"Weekly","Monthly":"Monthly","Yearly":"Yearly","Unknown":"None (one-time purchase)","Once":"Once"},"reset":"Reset filters"},"sort":{"productNameAscending":"Product Name: ascending","productNameDescending":"Product Name: descending","priceAscending":"Price: low to high","priceDescending":"Price: high to low"},"detail":{"billingCycle":"Billing cycle","commitmentTerm":"Available commitments","create":"Create new subscription","creating":"Creating new subscription","quantity":"Quantity","total":"Total","alreadyActiveSubscription":"You already have an active subscription or order for this product.","commitmentSummary":{"summary":"Billed {{billingCycle}} and committed for {{commitmentTerm}}","summaryWithoutCommitment":"Billed {{billingCycle}} with no commitment","summaryWithoutBillingCycle":"Billed one-time with commitment {{commitmentTerm}}","summaryWithoutBillingCycleAndCommitment":"Billed one-time with no commitment","billingCycleValues":{"None":"-","Daily":"daily","Monthly":"monthly","Weekly":"weekly","Yearly":"yearly","Unknown":"-","Once":"one time"},"billingCyclePeriodValues":{"None":"none","Daily":"day","Monthly":"month","Weekly":"week","Yearly":"year","Unknown":"-","Once":"one time"},"commitmentTermValues":{"Monthly":"1 month","Annual":"1 year","Biennial":"2 years","Triennial":"3 years","Unknown":"-","Open":"No commitment"}},"billingCycleValues":{"None":"none","Daily":"Daily","Monthly":"Monthly","Weekly":"Weekly","Yearly":"Yearly","Unknown":"No billing cycle","Once":"One time"},"commitmentTermValues":{"Monthly":"1 Month","Annual":"1 Year","Biennial":"2 Years","Triennial":"3 Years","Unknown":"No commitment term","Open":"No commitment"},"contractDurationCommitmentTermValues":{"Monthly":"one month","Annual":"one year","Biennial":"two year","Triennial":"three year","Unknown":"-","Open":"no commitment"},"confirmationModal":{"title":"Confirm new order creation","bodyWithCommitmentTerm_one":"<p>This order will create a new {{billingCycle}} subscription with a {{commitmentTerm}} contract for <2>{{productName}}</2>.</p><1></1> <br/>A new charge of {{totalAmount}}$ will be created each {{billingCyclePeriod}} for {{count}} license of this product.","bodyWithCommitmentTerm_other":"<p>This order will create a new {{billingCycle}} subscription with a {{commitmentTerm}} contract for <2>{{productName}}</2>.</p><1></1> <br/>A new charge of {{totalAmount}}$ will be created each {{billingCyclePeriod}} for {{count}} licenses of this product.","bodyWithoutCommitmentTerm_one":"<p>This order will create a new subscription for <2>{{productName}}</2></p><1></1><p>A new charge of {{totalAmount}}$ will be created for {{count}} license of this product.</p>","bodyWithoutCommitmentTerm_other":"<p>This order will create a new subscription for <2>{{productName}}</2></p><1></1><p>A new charge of {{totalAmount}}$ will be created for {{count}} licenses of this product.</p>","createOrder":"Create new order","creatingOrder":"Creating new order"},"order":{"success":"Order created successfully!","successContent":"You can check the status of this order by going to the Orders page or continue shopping.","failed":"Your order has failed","failedContent":"We were unable to place this order at this time. Please try again later or contact your reseller for assistance.","status":"Check order status","continueShopping":"Shop more","ok":"Ok"}}},"orders":{"title":"Orders","subtitle":"Manage and update the subscriptions in order to be able to provide licenses to your users","list":{"id":"Id","productName":"Product name","createdOn":"Created On","type":"Type","types":{"purchase":"Purchase","update":"Update"},"initialQuantity":"Initial Quantity","requestedQuantity":"Requested Quantity","quantity":"Quantity","status":"Status","statuses":{"pending":"Processing","complete":"Complete","failed":"Failed","rejected":"Rejected","waitingForApproval":"Waiting for approval"}},"noOrder":"No order available.","filterPlaceholder":"Find an order","fieldDescription":"Enter an Id or the name of the product to find an order."}},"subscription":{"status":{"new":"New","processing":"Processing","active":"Active","inactive":"Inactive","suspended":"Suspended","failed":"Attention required","pending":"Processing changes","waitingForApproval":"Waiting for approval"},"cycle":{"daily":"Daily","weekly":"Weekly","monthly":"Monthly","yearly":"Yearly"},"cycleBilling":{"daily":"Daily","weekly":"Weekly","monthly":"Monthly","yearly":"Yearly"},"cycleBillingFull":{"daily":"Billed every day","weekly":"Billed every week","monthly":"Billed every month","yearly":"Billed every Year"},"commitmentRenewal":{"annual":"Annual commitment","biennial":"Biennial commitment","triennial":"Triennial commitment","monthly":"Monthly commitment"},"order":{"label":"Last pending or failed order","status":{"failed":"Failed","pending":"Processing","waitingForApproval":"Waiting for approval","rejected":"Rejected"},"decision":{"approve":"Approve","reject":"Reject","confirmationModal":{"title":"Subscription update confirmation","approveBody":"<p>Are you sure you want to approve this command? </p>","rejectBody":"<p>Are you sure you want to reject this command? </p>","decisionNotePlaceholder":"Please provide a reason for rejecting that order."}},"tableHeader":{"id":"Order Id","date":"Date","operations":"Operations","status":"Status"}}},"supportTicket":{"status":{"new":"New","open":"Open","closed":"Closed"},"type":{"issue":"Issue"},"priority":{"1":"Low","2":"Medium","3":"High"}},"user":{"userRole":{"basicUser":"Basic user","organizationAdmin":"Organization administrator","resellerAdmin":"Reseller administrator","internalAdmin":"Internal admin","resellerGuest":"Reseller guest"}},"actions":{"update":"Update","edit":"Edit","delete":"Delete","cancel":"Cancel","refresh":"Refresh"},"validations":{"mixed":{"required":"{{path}} is a required field"},"string":{"min":"{{path}} must be at least {{min}} characters","max":"{{path}} must be at most {{max}} characters","email":"{{path}} must be a valid email"}},"errors":{"generic":"An error has occurred. Try Again. If this error persists, please contact us.","unexpected":{"error":"An error has occurred. Try Again. If this error persists, please contact us."}},"organization":{"suspended":"Suspended"},"warnings":{"noLicensesAvailable":"No licenses remaining. Please add licenses or remove users from the product to assign new ones."},"unSavedChanges":{"description":"Are you sure you want to exit? Any unsaved changes will be lost"}}`),Z=JSON.parse(`{"layout":{"menu":{"dashboard":"Tableau de bord","users":"Utilisateurs","subscriptions":"Abonnements","licenses":"Licences","billing":"Facturation","reporting":"Rapports","support":"Support","settings":"Param\xE8tres","marketplace":"Marketplace","orders":"Commandes","tags":{"comingSoon":"Prochainement!"}},"notifications":{"iconTooltip":"Voir les notifications"},"userMenu":{"profile":"G\xE9rer mon profil","settings":"Param\xE8tres","signOut":"D\xE9connexion","languageToggle":{"label":"Langue","switchToFrenchTooltip":"Afficher en fran\xE7ais","switchToEnglishTooltip":"Afficher en anglais","languages":{"french":"Fran\xE7ais","english":"Anglais"}},"darkModeToggle":{"label":"Mode sombre"},"goToAdmin":"Acc\xE9der \xE0 l'administration"}},"pages":{"401":{"title":"Acc\xE8s non autoris\xE9","description":"D\xE9sol\xE9, vous n\u2019\xEAtes pas autoris\xE9 \xE0 consulter cette page.","backToLogin":"Retour \xE0 la connexion"},"403":{"title":"Acc\xE8s interdit","description":"D\xE9sol\xE9, vous n\u2019\xEAtes pas autoris\xE9 \xE0 afficher cette page.","backToHomepage":"Retour \xE0 la page d'accueil"},"404":{"title":"Cette page n'existe pas","description":"D\xE9sol\xE9, nous n'avons pas trouv\xE9 la page que vous recherchez.","backToHomepage":"Retour \xE0 la page d'accueil"},"500":{"title":"Une erreur s'est produite","description":"D\xE9sol\xE9, une erreur est survenue. Veuillez r\xE9essayer ou contactez-nous si l'erreur persiste.","reloadApplication":"Recharger l'application"},"dashboard":{"title":"Bonjour, {{userFirstName}}!","pageDescription":"Bienvenue dans le portail libre-service {{resellerName}}","widgets":{"SubscriptionCountWidget":{"title":"Nombre total d'abonnements","viewAll":"Voir tout"},"CurrentUserLicenseCountWidget":{"title":"Vos licences","viewAll":"Voir tout","more_one":"{{count}} autre...","more_other":"{{count}} autres..."},"UnusedLicenseCountWidget":{"title":"Licences inutilis\xE9es","viewAll":"Voir tout","more_one":"{{count}} autre...","more_other":"{{count}} autres..."},"UserCountWidget":{"title":"Nombre total d'utilisateurs","addUser":"Inviter un utilisateur","viewAll":"Voir tout"}}},"login":{"resellerLogoAlternative":"Logo de {{resellerName}}","signInTo":"Bienvenue","welcomeBack":"Veuillez vous connecter pour acc\xE9der au portal de {{resellerName}}","loginform":{"username":{"label":"Nom d'utilisateur","placeholder":"Veuillez saisir votre nom d'utilisateur","tooltip":"Entrez votre nom d'utilisateur afin d'acc\xE9der au portail","errors":{"format":""}},"signIn":"Connexion","signingIn":"Connexion","or":"Ou","signInAsAdmin":"Continuer en tant qu'administrateur"}},"subscriptions":{"title":"Abonnements","pageDescription":"G\xE9rer et mettre \xE0 jour les abonnements afin de pouvoir fournir des licences \xE0 vos utilisateurs","list":{"filterPlaceholder":"Trouver un abonnement","searchFieldDescription":"Rechercher vos abonnements : par nom d'abonnement ou produit.","columns":{"productName":"Nom","billingCycle":"Cycle","quantity":"Quantit\xE9","price":"Prix","total":"Total","status":"Status"},"renewsOn":"Renouvellement le","pendingQuantity":"Changement en cours : {{pendingQuantity}}","pendingQuantityError":"Erreur lors du changement de quantit\xE9 en {{pendingQuantity}}. {{error}}","edit":"Modifier"},"noSubscriptions":"Aucun abonnement pour le moment, contactez votre revendeur pour ajouter des abonnements"},"subscription":{"backlink":"Retour aux abonnements","manageYourSubscriptionTitle":"G\xE9rez votre abonnement","updateSuccess":"Mise \xE0 jour de l'abonnement initi\xE9e avec succ\xE8s!","bilingCycle":"Cycle de facturation","renewalDate":"Date de renouvellement","commitmentTerm":"Engagement","currentQuantity":"Quantit\xE9 actuelle","fieldNotAvailable":"Ce champ n'est pas disponible pour cet abonnement","fieldNA":"N/D","total":"Total","quantityForm":{"quantity":"Mettre \xE0 jour les quantit\xE9s","disclaimer":"Avertissement: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.","pendingQuantityWarning":"Une commande pour cet abonnement est en cours de traitement. Veuillez patienter ou contacter le revendeur pour obtenir de l'aide.","lastOrderPendingQuantityError":"la mise \xE0 jour de l'abonnement <strong>{{subscriptionName}}</strong> initi\xE9 le {{subscriptionUpdateDate}} pour {{subscriptionUpdateOperation}} {{subscriptionUpdateDelta}} licence(s) a \xE9chou\xE9. Veuillez <0>nous contacter</0> pour obtenir de l'aide.","cannotDecreaseSubscription":"Vous avez atteint la quantit\xE9 minimale pour cet abonnement en raison de l'engagement.","cannotCancelSubscription":"Vous n'\xEAtes pas autoris\xE9 \xE0 annuler cet abonnement, veuillez contacter votre revendeur pour obtenir de l'aide.","orderOperation":{"add":"ajouter","remove":"retirer"},"actionBtnTooltip":{"pendingChanges":"Une mise \xE0 jour pour cet abonnement est actuellement en cours de traitement.","noChangesToSubmit":"Vous devez ajuster les quantit\xE9s de vos abonnements avant de tenter de soumettre une mise \xE0 jour.","updateQuantity":"Cliquez ici afin de soumettre vos changements."},"actions":{"updateSubscription":"Mettre \xE0 jour","updateProcessing":"Mise \xE0 jour en cours"},"confirmationModal":{"title":"Nouvelle mise \xE0 jour de l'abonnement","body_one":"<p>\xCAtes-vous s\xFBr de vouloir {{operation}} <strong>{{quantityDelta}}</strong> licence \xE0 cet abonnement? </p><1></1><p> Apr\xE8s cette mise \xE0 jour, la quantit\xE9 totale de licences pour cet abonnement sera de : <strong>{{newQuantity}}</strong></p><p>{{orderApprovalSection}}</p>","body_other":"<p>\xCAtes-vous s\xFBre de vouloir {{operation}} <strong>{{quantityDelta}}</strong> licences \xE0 cet abonnement? </p><1></1><p> Apr\xE8s cette mise \xE0 jour, la quantit\xE9 totale de licences pour cet abonnement sera de : <strong>{{newQuantity}}</strong></p><p>{{orderApprovalSection}}</p>","addOperation":"ajouter","removeOperation":"retirer","confirmationButtonText":"Mettre \xE0 jour l'abonnement","proceedButtonText":"Continuer","orderApprovalSection":"<1></1>Apr\xE8s avoir cliqu\xE9 sur <strong>Continuer</strong>, votre commande sera examin\xE9e par votre revendeur avant d'\xEAtre approuv\xE9e."}},"summary":{"updatedTotalTitle":"Votre nouveau total apr\xE8s modifications","autoRenewalOn":"Renouvellement automatique le : "},"details":{"tabs":{"subscriptionDetails":{"title":"D\xE9tails de l'abonnement"},"history":{"title":"Historique"},"manageSubscription":{"title":"G\xE9rer l'abonnement","getHelp":{"title":"Obtenir de l'aide","description":"Demandez de l'aide au sujet de cet abonnement."},"cancel":{"title":"Annuler l\u2019abonnement","description":"L\u2019annulation d\u2019un abonnement supprimera l\u2019acc\xE8s aux services pour tous les utilisateurs.","confirmationDialog":{"title":"Annulation de l\u2019abonnement {{productName}}","content":"\xCAtes-vous s\xFBr de vouloir annuler votre abonnement pour {{productName}}?","contentHelper":"Une fois l'annulation compl\xE9t\xE9e, vous ne pourrez plus utiliser les services associ\xE9s \xE0 cet abonnement.","confirmButtonText":"Annuler l'abonnement","dismissButtonText":"Garder l'abonnement"}}}},"descriptionTitle":"Description"}},"licenses":{"title":"Gestion des licences","pageDescription":"Attribuez des licences \xE0 vos utilisateurs afin qu'ils puissent acc\xE9der et utiliser efficacement vos services souscrits","list":{"filterPlaceholder":"Trouver une licence","searchFieldDescription":"Recherchez vos licences par nom de produit.","availableLicenses":"Disponible :","columns":{"productName":"Produit","vendorName":"Fournisseur","licenses":"Licences","users":"Utilisateurs","action":"Action"}},"subscribersDialog":{"title":"Liste des abonn\xE9s","filterPlaceholder":"Rechercher un utilisateur","searchFieldDescription":"Recherchez vos abonn\xE9s par adresse courriel.","createSubscriberButton":"Cr\xE9er un abonn\xE9","creatingSubscriberButton":"Cr\xE9ation de l'abonn\xE9","noSubscriber":"Aucun abonn\xE9 trouv\xE9","confirmationButton":"Mettre \xE0 jour","confirmationButtonLoading":"Mise \xE0 jour","confirmationButtonDisableMessage":"Aucun abonn\xE9 s\xE9lectionn\xE9 ou nombre insuffisant de licences","updateSuccess":"Les abonn\xE9s ont \xE9t\xE9 attribu\xE9s/supprim\xE9s avec succ\xE8s \xE0 la licence actuelle.","created":"L'abonn\xE9 a \xE9t\xE9 cr\xE9e avec succ\xE8s","requestSentWithSuccess":"Votre demande a \xE9t\xE9 envoy\xE9e avec succ\xE8s et sera bient\xF4t trait\xE9e.","actions":{"addSubscriber":"Ajouter un abonn\xE9 \xE0 la licence","subscriberToBeAdded":"L'abonn\xE9 a \xE9t\xE9 marqu\xE9 pour \xEAtre ajout\xE9","removeSubscriber":"R\xE9voquer la licence \xE0 cet utilisateur","subscriberToBeDeleted":"L'abonn\xE9 a \xE9t\xE9 marqu\xE9 pour suppression","updateInProgress":"Mise \xE0 jour actuellement en cours"},"confirmationModal":{"title":"Modifications en cours","description":"\xCAtes-vous s\xFBr de vouloir quitter? Les modifications actuelles seront perdues","confirmationButtonText":"Ignorer les modifications"}},"createSubcriberForm":{"title":"Assigner ce produit \xE0 un nouvel abonn\xE9","default":"d\xE9faut","email":"Courriel:","errors":{"subscriberAlreadyExists":"Impossible de cr\xE9er l'abonn\xE9. Un abonn\xE9 avec cette adresse courriel existe d\xE9j\xE0."},"placeholders":{"firstName":"Pr\xE9nom","lastName":"Nom de famille","username":"Nom d'utilisateur"}},"refresh":{"failureMessage":"Impossible de rafra\xEEchir. Veuillez r\xE9essayer dans quelques minutes.","successMessage":"Les licences ont \xE9t\xE9 actualis\xE9es avec succ\xE8s !"},"manage":"Abonn\xE9s","noLicenses":"Aucune licence pour l'instant, contactez votre revendeur pour ajouter des licences","errors":{"licenseUpdateFailed":"La mise \xE0 jour de la licence de {{licenseName}} pour {{subscriberName}} a \xE9chou\xE9. Veuillez r\xE9essayer."}},"support":{"title":"Support","summaryTitle":"R\xE9sum\xE9","showCase":{"title":"Prochainement..."},"allTicketsTitle":"Tous les billets","list":{"columns":{"id":"#","createdAt":"Date de cr\xE9ation","updatedAt":"Derni\xE8re modification","type":"Type","status":"Status","subject":"Sujet","openedBy":"Ouvert par","assignedTo":"Assign\xE9 \xE0","priority":"Priorit\xE9"}}},"users":{"noUsers":"Aucun utilisateur pour l'instant, vous pouvez revenir plus tard ou inviter de nouveaux utilisateurs.","title":"Utilisateurs","pageDescription":"Invitez et g\xE9rez vous utilisateurs afin de leur permettre de tirer profit du portail.","list":{"filterPlaceholder":"Trouver un utilisateur","searchFieldDescription":"Saisissez un nom d'utilisateur, une adresse courriel ou un titre d'emploi pour trouver un utilisateur.","columns":{"user":"Utilisateur","firstName":"Pr\xE9nom","lastName":"Nom","jobTitle":"Titre","roles":"R\xF4le","createdOn":"Cr\xE9\xE9 le","email":"Courriel \xC9lectronique","status":"\xC9tat"},"delete":"Supprimer","edit":"Modifier","resendInvitation":"Renvoyer l'invitation","resendInvitationSuccessMessage":"L'invitation a \xE9t\xE9 renvoy\xE9e avec succ\xE8s!","resendInvitationFailureMessage":"Nous n'avons pas pu envoyer l'invitation. Veuillez v\xE9rifier les informations de l'utilisateur et r\xE9essayer."},"inviteUser":"Nouvel utilisateur","status":{"Inactive":"Inactif","Active":"Actif","InvitationSent":"Invitation envoy\xE9e"},"userDeletionDialog":{"title":"Supprimer utilisateur","description":"\xCAtes-vous s\xFBr de vouloir supprimer l'utilisateur <strong>{{user}}</strong>?","success":"L'utilisateur a \xE9t\xE9 supprim\xE9 avec succ\xE8s"}},"user":{"new":{"title":"Inviter un nouvel utilisateur","pageDescription":"Donne acc\xE8s au portail et permet la gestion des services.","submit":"Inviter","success":"L'utilisateur a \xE9t\xE9 invit\xE9 avec succ\xE8s!"},"edit":{"tab":{"licenses":"Licences"},"submit":"Modifier","submitting":"Modification","success":"L'utilisateur a \xE9t\xE9 modifi\xE9 avec succ\xE8s!"},"backlink":"Retour aux utilisateurs","form":{"fields":{"firstName":{"label":"Pr\xE9nom","placeholder":""},"lastName":{"label":"Nom","placeholder":""},"jobTitle":{"label":"Emploi","placeholder":""},"role":{"label":"R\xF4le","placeholder":"R\xF4le de l'utilisateur dans l'application","organizationAdmin":{"description":"Permet un acc\xE8s complet pour la gestion de {{organizationName}}."},"basicUser":{"description":"Fourni un acc\xE8s en lecture seule \xE0 {{organizationName}}."}},"email":{"label":"Courriel","placeholder":""},"preferredCulture":{"label":"Langue de communication","placeholder":"Langue de communication"}}}},"billing":{"title":"Facturation","pageDescription":"Pay and see your invoices and consult your transaction history","showCase":{"title":"Prochainement..."},"amountDueWidget":{"title":"Montant total d\xFB","dueDate":"D\xFB le {{dueDate}}","payNowButton":"Payer Maintenant"},"tabs":{"invoices":{"title":"Factures"},"transactions":{"title":"Transactions"}},"invoices":{"table":{"headers":{"invoice":"Facture","customerName":"Client","dueDate":"Date d'\xE9ch\xE9ance","status":"Status","amount":"Montant"},"status":{"paid":"Pay\xE9","unpaid":"Non pay\xE9","overdue":"En retard","new":"Nouvelle"}}}},"organizationsNotActivated":{"title":"Aucune organisation trouv\xE9e","content":"Il semble que vous n'ayez pas encore activ\xE9 d'organisations. Pour utiliser le portail libre-service, vous devez l'activer pour votre/vos organisation(s) au sein de votre fournisseur de services."},"organizationSuspended":{"title":"Organisation suspendue","content":"Votre organisation est actuellement suspendue. Pour regagner l'acc\xE8s \xE0 votre organisation, veuillez contacter votre revendeur."},"helpdesk":{"notReady":{"title":"Votre service d'assistance n'est pas encore pr\xEAt","description":"Nous n'avons pas pu charger vos informations de service d'assistance. Veuillez r\xE9essayer ult\xE9rieurement ou contacter votre revendeur pour obtenir de l'aide.","contact":"Contact my reseller"},"emptyMessage":" Aucun tickets pour l'instant, si vous avez besoin d'aide, cr\xE9ez une nouvelle demande de support.","title":"Support","subTitle":"Contactez nos equipes de support pour toute question technique ou non technique et obtenez le soutien dont vous avez besoin.","list":{"columns":{"ticketId":"Id","subject":"Probl\xE8me","createdBy":"Cr\xE9\xE9 par","lastUpdated":"Derni\xE8re mise \xE0 jour","ticketType":"Type de ticket","status":"Statut"}},"create":{"newRequest":"Nouvelle demande","requestType":"Type de demande","requestTypePlaceholder":"S\xE9lectionnez le type de demande","title":"Comment pouvons-nous vous aider?","titlePlaceholder":"Essayez de d\xE9crire votre demande en quelques mots","titleMaxCharactersError":"Nombre de caract\xE8res limit\xE9 \xE0 100","description":"Informations suppl\xE9mentaires","descriptionPlaceholder":"Utilisez ce champ pour fournir des d\xE9tails suppl\xE9mentaires concernant votre demande","descriptionMaxCharactersError":"Nombre de caract\xE8res limit\xE9 \xE0 700","send":"Envoyer la demande","successMessage":"La demande a \xE9t\xE9 cr\xE9\xE9e avec succ\xE8s","failureMessage":"Nous n'avons pas pu envoyer votre demande, veuillez r\xE9essayer ult\xE9rieurement","prompt":{"title":"Abandonner la demande","body":"\xCAtes-vous s\xFBr de vouloir abandonner la cr\xE9ation de cette demande?","cancel":"Abandonner","ignore":"Ignorer"}},"detail":{"id":"# Id","status":"Statut","createdBy":"Cr\xE9e par","createdAt":"Cr\xE9e le","type":"Type","lastUpdate":"Derni\xE8re mise \xE0 jour","replyPlaceholder":"Ajouter une r\xE9ponse","show":"Afficher","failureMessage":"\xC9chec de l'envoi de la r\xE9ponse, veuillez r\xE9essayer plus tard"}},"shop":{"title":"Place de march\xE9","subTitle":"D\xE9couvrez et int\xE9grez les produits r\xE9pondant \xE0 vos besoins","searchPlaceholder":"Rechercher des produits...","card":{"startingPrice":"Prix de d\xE9part"},"subHeading":"Tous les produits","filters":{"vendor":"Fournisseur","categories":"Cat\xE9gories","category":"Cat\xE9gorie","billingCycle":"Cycle de facturation","commitment":"Engagement","commitmentValues":{"Annual":"Annuel","Biennial":"Biennal","Triennial":"Triennal","Monthly":"Mensuel","Unknown":"N/D","Open":"Aucun engagement"},"billingCycleValues":{"None":"Aucun","Daily":"Quotidien","Weekly":"Hebdomadaire","Monthly":"Mensuel","Yearly":"Annuel","Unknown":"Aucun (Achat unique)","Once":"Une fois"},"reset":"R\xE9initialiser les filtres"},"sort":{"productNameAscending":"Nom du produit : ordre croissant","productNameDescending":"Nom du produit : ordre d\xE9croissant","priceAscending":"Prix: ordre croissant","priceDescending":"Prix: ordre d\xE9croissant"},"detail":{"billingCycle":"Cycle de facturation","create":"Ajouter un abonnement","creating":"Ajout de l'abonnement","commitmentTerm":"Engagements disponibles","quantity":"Quantit\xE9","total":"Total","alreadyActiveSubscription":"Vous avez d\xE9j\xE0 un abonnement ou une commande en cours pour ce produit.","commitmentSummary":{"summary":"Factur\xE9 {{billingCycle}} avec un engagement de {{commitmentTerm}}","summaryWithoutCommitment":"Factur\xE9 {{billingCycle}} sans engagement","summaryWithoutBillingCycle":"Factur\xE9 une seule fois avec engagement {{commitmentTerm}}","summaryWithoutBillingCycleAndCommitment":"Factur\xE9 une seule fois sans engagement","billingCycleValues":{"None":"-","Daily":"quotidiennement","Monthly":"mensuellement","Weekly":"hebdomadairement","Yearly":"annuellement","Unknown":"-","Once":"une seule fois"},"billingCyclePeriodValues":{"None":"-","Daily":"jour","Monthly":"mois","Weekly":"semaine","Yearly":"ann\xE9e","Unknown":"-","Once":"une seule fois"},"commitmentTermValues":{"Monthly":"1 mois","Annual":"1 an","Biennial":"2 ans","Triennial":"3 ans","Unknown":"-","Open":"Aucun engagement"}},"billingCycleValues":{"None":"Aucun","Daily":"Quotidien","Monthly":"Mensuel","Weekly":"Hebdomadaire","Yearly":"Annuel","Unknown":"Aucun","Once":"Une fois"},"commitmentTermValues":{"Monthly":"1 Mois","Annual":"1 An","Biennial":"2 Ans","Triennial":"3 Ans","Unknown":"Aucun","Open":"Aucun engagement"},"contractDurationCommitmentTermValues":{"Monthly":"one month","Annual":"one year","Biennial":"two year","Triennial":"three year","Unknown":"aucun","Open":"aucun engagement"},"confirmationModal":{"title":"Confirmer la cr\xE9ation d'une nouvelle commande","bodyWithCommitmentTerm_one":"<p>Cette commande cr\xE9era un nouvel abonnement {{billingCycle}} avec un contrat de {{commitmentTerm}} pour <2>{{productName}}</2>.</p><1></1><p>Une nouvelle charge de {{totalAmount}}$ sera cr\xE9\xE9e chaque {{billingCyclePeriod}} pour {{count}} licence de ce produit.</p>","bodyWithCommitmentTerm_other":"<p>Cette commande cr\xE9era un nouvel abonnement {{billingCycle}} avec un contrat de {{commitmentTerm}} pour <2>{{productName}}</2>.</p><1></1><p>Une nouvelle charge de {{totalAmount}}$ sera cr\xE9\xE9e chaque {{billingCyclePeriod}} pour {{count}} licences de ce produit.</p>","bodyWithoutCommitmentTerm_one":"<p>Cette commande cr\xE9era un nouvel abonnement {{billingCycle}} pour <2>{{productName}}</2>.</p><1></1><p>Une nouvelle charge de {{totalAmount}}$ sera cr\xE9\xE9e pour {{count}} licence de ce produit.</p>","bodyWithoutCommitmentTerm_other":"<p>Cette commande cr\xE9era un nouvel abonnement {{billingCycle}} pour <2>{{productName}}</2>.</p><1></1><p>Une nouvelle charge de {{totalAmount}}$ sera cr\xE9\xE9e pour {{count}} licences de ce produit.</p>","createOrder":"Cr\xE9er une nouvelle commande","creatingOrder":"Cr\xE9ation de la nouvelle commande"},"order":{"success":"Commande cr\xE9\xE9e avec succ\xE8s!","successContent":"Vous pouvez v\xE9rifier le statut de cette commande en allant \xE0 la page Commandes ou continuer vos achats.","failed":"Votre commande a \xE9chou\xE9.","failedContent":"Nous n'avons pas pu passer cette commande pour le moment. Veuillez r\xE9essayer plus tard ou contacter votre revendeur pour obtenir de l'aide.","status":"Voir l'\xE9tat de la commande","continueShopping":"Continuer vos achats","ok":"D'accord"}}},"orders":{"title":"Commandes","subtitle":"G\xE9rer et mettre \xE0 jour les abonnements afin de pouvoir fournir des licences \xE0 vos utilisateurs","list":{"id":"Id","productName":"Nom du produit","createdOn":"Cr\xE9\xE9 le","type":"Type","types":{"purchase":"Achat","update":"Mise \xE0 jour"},"initialQuantity":"Quantit\xE9 Initiale","requestedQuantity":"Quantit\xE9e demand\xE9e","quantity":"Quantit\xE9","status":"Statut","statuses":{"pending":"En cours","complete":"Compl\xE8te","failed":"\xC9chou\xE9e","rejected":"Rejet\xE9","waitingForApproval":"En attente d'approbation"}},"noOrder":"Aucune commande disponible.","filterPlaceholder":"Trouver une commande","fieldDescription":"Entrer un Id ou le nom du produit pour trouver une commande."}},"subscription":{"status":{"new":"Nouvelle","processing":"En traitement","active":"Actif","inactive":"Inactive","suspended":"Suspendue","failed":"Attention requise","pending":"Changements en cours","waitingForApproval":"En attente d'approbation"},"cycle":{"daily":"Journalier","weekly":"Hebdomadaire","monthly":"Mensuel","yearly":"Annuel"},"cycleBilling":{"daily":"Quotidiennement","weekly":"Hebdomadairement","monthly":"Mensuellement","yearly":"Annuellement"},"cycleBillingFull":{"daily":"Factur\xE9 chaque jour","weekly":"Factur\xE9 chaque semaine","monthly":"Factur\xE9 chaque mois","yearly":"Factur\xE9 chaque ann\xE9e"},"commitmentRenewal":{"annual":"Engagement annuel","biennial":"Engagement biennal","triennial":"Engagement triennal","monthly":"Engagement mensuel"},"order":{"label":"Derni\xE8res commandes en cours ou \xE9chou\xE9es","status":{"failed":"Echec","pending":"En cours","waitingForApproval":"En attente d'approbation","rejected":"Rejet\xE9"},"decision":{"approve":"Approuver","reject":"Rejeter","confirmationModal":{"title":"Confirmation de mise \xE0 jour de l'abonnement","approveBody":"<p>\xCAtes-vous s\xFBr de vouloir confirmer cette commande? </p>","rejectBody":"<p>\xCAtes-vous s\xFBr de vouloir refuser cette commande? </p>","decisionNotePlaceholder":"Veuillez fournir une raison du rejet de cette commande."}},"tableHeader":{"id":"Id de commande","date":"Date","operations":"Op\xE9rations","status":"Statut"}}},"supportTicket":{"status":{"new":"Nouveau","open":"Ouvert","closed":"Ferm\xE9"},"type":{"issue":"Probl\xE8me"},"priority":{"1":"Faible","2":"Moyen","3":"\xC9lev\xE9"}},"user":{"userRole":{"basicUser":"Utilisateur de base","organizationAdmin":"Administrateur pour l'organisation","resellerAdmin":"Administrateur de revendeur","internalAdmin":"Admin interne","resellerGuest":"Revendeur invit\xE9"}},"actions":{"update":"Modifier","edit":"Modifier","delete":"Supprimer","cancel":"Annuler","refresh":"Rafra\xEEchir"},"validations":{"mixed":{"required":"{{path}} est un champ requis"},"string":{"min":"{{path}} doit \xEAtre au moins {{min}} caract\xE8res","max":"{{path}} doit \xEAtre au plus {{min}} caract\xE8res","email":"{{path}} doit \xEAtre une addresse courriel valide"}},"organization":{"suspended":"Suspendue"},"errors":{"generic":"Une erreur est survenue. Essayer \xE0 nouveau. Si cette erreur persiste, veuillez nous contacter.","unexpected":{"error":"Une erreur est survenue. Essayer \xE0 nouveau. Si cette erreur persiste, veuillez nous contacter."}},"warnings":{"noLicensesAvailable":"Il ne reste plus de licences. Veuillez ajouter des licences ou supprimer des utilisateurs du produit pour en attribuer de nouvelles."},"unSavedChanges":{"description":"\xCAtes-vous s\xFBr de vouloir quitter? Toutes les modifications non enregistr\xE9es seront perdues."}}`),U="production",ge=U.includes("PLACEHOLDERTOREPLACEENV"),ne={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_ENV:""}.REACT_APP_LOCAL_ENV??U,ve=ne==="production",V=["local","development"].includes(ne),te={env:ne,isProduction:ve,isDevelopment:V,googleAnalyticsTrackingId:{NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_ENV:""}.REACT_APP_GOOGLE_ANALYTICS_TRACKING_ID??"G-FVJ6W6ZK2E",appName:"ssp",bff:{url:{NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_ENV:""}.REACT_APP_LOCAL_BFF??"https://bff.serviceportal.site",signInPath:"/Account/SignIn?portalType=SSP&login_hint=",signOutPath:"/Account/SignOut",includeCredentials:!0},i18n:{locales:{[Te.T.EN]:{ssp:q,core:ae,rsp:W},[Te.T.FR]:{ssp:Z,core:ie,rsp:ee}},defaultLanguage:Te.T.EN,defaultNs:"ssp",fallbackNs:"core"},datadog:{enabled:!ge,applicationId:"97972d51-5596-4be9-9e6f-d49a0b33803a",clientToken:"pubdd8b617b9b6efd8b60d28026d00c79fb",site:"datadoghq.com",service:"ssp.ssp",sessionSampleRate:100,sessionReplaySampleRate:20,trackUserInteractions:!0,trackResources:!0,trackLongTasks:!0,defaultPrivacyLevel:we.W.MASK_USER_INPUT},whiteListed401Paths:["/login","/admin/login","/401","/admin/401"]},Re=()=>`${te.bff.url}${te.bff.signOutPath}`,Ie=te},9052:(a,l,se)=>{"use strict";se.d(l,{_:()=>we});var we=(Te=>(Te.InternalError="/500",Te.UnauthorizedAccess="/401",Te.AdminUnauthorizedAccess="/admin/401",Te.ForbiddenAccess="/403",Te.AdminNotFound="/admin/404",Te.NotFound="/404",Te.AdminForbiddenAccess="/admin/403",Te.Admin="/admin",Te))(we||{})},6419:(a,l,se)=>{"use strict";se.d(l,{T:()=>we});var we=(Te=>(Te.EN="en",Te.FR="fr",Te))(we||{})},1993:(a,l,se)=>{"use strict";se.d(l,{N9:()=>Yn,A2:()=>Zr,JA:()=>Bs,v0:()=>wr});var we=se(8810),Te=se(6194),ae=se(9583);const ie=rt=>typeof rt=="number"&&!isNaN(rt),W=rt=>typeof rt=="string",ee=rt=>typeof rt=="function",q=rt=>W(rt)||ee(rt)?rt:null,Z=rt=>(0,Te.isValidElement)(rt)||W(rt)||ee(rt)||ie(rt);function U(rt,zt,Hn){Hn===void 0&&(Hn=300);const{scrollHeight:Nr,style:kr}=rt;requestAnimationFrame(()=>{kr.minHeight="initial",kr.height=Nr+"px",kr.transition=`all ${Hn}ms`,requestAnimationFrame(()=>{kr.height="0",kr.padding="0",kr.margin="0",setTimeout(zt,Hn)})})}function ge(rt){let{enter:zt,exit:Hn,appendPosition:Nr=!1,collapse:kr=!0,collapseDuration:Xn=300}=rt;return function(Jt){let{children:Xt,position:qn,preventExitTransition:bn,done:sr,nodeRef:Jn,isIn:fs}=Jt;const Kn=Nr?`${zt}--${qn}`:zt,Ir=Nr?`${Hn}--${qn}`:Hn,Rr=(0,Te.useRef)(0);return(0,Te.useLayoutEffect)(()=>{const pr=Jn.current,Tr=Kn.split(" "),gt=_s=>{_s.target===Jn.current&&(pr.dispatchEvent(new Event("d")),pr.removeEventListener("animationend",gt),pr.removeEventListener("animationcancel",gt),Rr.current===0&&_s.type!=="animationcancel"&&pr.classList.remove(...Tr))};pr.classList.add(...Tr),pr.addEventListener("animationend",gt),pr.addEventListener("animationcancel",gt)},[]),(0,Te.useEffect)(()=>{const pr=Jn.current,Tr=()=>{pr.removeEventListener("animationend",Tr),kr?U(pr,sr,Xn):sr()};fs||(bn?Tr():(Rr.current=1,pr.className+=` ${Ir}`,pr.addEventListener("animationend",Tr)))},[fs]),Te.createElement(Te.Fragment,null,Xt)}}function ne(rt,zt){return rt!=null?{content:rt.content,containerId:rt.props.containerId,id:rt.props.toastId,theme:rt.props.theme,type:rt.props.type,data:rt.props.data||{},isLoading:rt.props.isLoading,icon:rt.props.icon,status:zt}:{}}const ve={list:new Map,emitQueue:new Map,on(rt,zt){return this.list.has(rt)||this.list.set(rt,[]),this.list.get(rt).push(zt),this},off(rt,zt){if(zt){const Hn=this.list.get(rt).filter(Nr=>Nr!==zt);return this.list.set(rt,Hn),this}return this.list.delete(rt),this},cancelEmit(rt){const zt=this.emitQueue.get(rt);return zt&&(zt.forEach(clearTimeout),this.emitQueue.delete(rt)),this},emit(rt){this.list.has(rt)&&this.list.get(rt).forEach(zt=>{const Hn=setTimeout(()=>{zt(...[].slice.call(arguments,1))},0);this.emitQueue.has(rt)||this.emitQueue.set(rt,[]),this.emitQueue.get(rt).push(Hn)})}},V=rt=>{let{theme:zt,type:Hn,...Nr}=rt;return Te.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:zt==="colored"?"currentColor":`var(--toastify-icon-color-${Hn})`,...Nr})},te={info:function(rt){return Te.createElement(V,{...rt},Te.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(rt){return Te.createElement(V,{...rt},Te.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(rt){return Te.createElement(V,{...rt},Te.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(rt){return Te.createElement(V,{...rt},Te.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return Te.createElement("div",{className:"Toastify__spinner"})}};function Re(rt){const[,zt]=(0,Te.useReducer)(Kn=>Kn+1,0),[Hn,Nr]=(0,Te.useState)([]),kr=(0,Te.useRef)(null),Xn=(0,Te.useRef)(new Map).current,Jt=Kn=>Hn.indexOf(Kn)!==-1,Xt=(0,Te.useRef)({toastKey:1,displayedToast:0,count:0,queue:[],props:rt,containerId:null,isToastActive:Jt,getToast:Kn=>Xn.get(Kn)}).current;function qn(Kn){let{containerId:Ir}=Kn;const{limit:Rr}=Xt.props;!Rr||Ir&&Xt.containerId!==Ir||(Xt.count-=Xt.queue.length,Xt.queue=[])}function bn(Kn){Nr(Ir=>Kn==null?[]:Ir.filter(Rr=>Rr!==Kn))}function sr(){const{toastContent:Kn,toastProps:Ir,staleId:Rr}=Xt.queue.shift();fs(Kn,Ir,Rr)}function Jn(Kn,Ir){let{delay:Rr,staleId:pr,...Tr}=Ir;if(!Z(Kn)||function(_o){return!kr.current||Xt.props.enableMultiContainer&&_o.containerId!==Xt.props.containerId||Xn.has(_o.toastId)&&_o.updateId==null}(Tr))return;const{toastId:gt,updateId:_s,data:cs}=Tr,{props:Gr}=Xt,xr=()=>bn(gt),no=_s==null;no&&Xt.count++;const ps={...Gr,style:Gr.toastStyle,key:Xt.toastKey++,...Object.fromEntries(Object.entries(Tr).filter(_o=>{let[ao,Ls]=_o;return Ls!=null})),toastId:gt,updateId:_s,data:cs,closeToast:xr,isIn:!1,className:q(Tr.className||Gr.toastClassName),bodyClassName:q(Tr.bodyClassName||Gr.bodyClassName),progressClassName:q(Tr.progressClassName||Gr.progressClassName),autoClose:!Tr.isLoading&&(ns=Tr.autoClose,ss=Gr.autoClose,ns===!1||ie(ns)&&ns>0?ns:ss),deleteToast(){const _o=ne(Xn.get(gt),"removed");Xn.delete(gt),ve.emit(4,_o);const ao=Xt.queue.length;if(Xt.count=gt==null?Xt.count-Xt.displayedToast:Xt.count-1,Xt.count<0&&(Xt.count=0),ao>0){const Ls=gt==null?Xt.props.limit:1;if(ao===1||Ls===1)Xt.displayedToast++,sr();else{const So=Ls>ao?ao:Ls;Xt.displayedToast=So;for(let jr=0;jr<So;jr++)sr()}}else zt()}};var ns,ss;ps.iconOut=function(_o){let{theme:ao,type:Ls,isLoading:So,icon:jr}=_o,Dn=null;const Dr={theme:ao,type:Ls};return jr===!1||(ee(jr)?Dn=jr(Dr):(0,Te.isValidElement)(jr)?Dn=(0,Te.cloneElement)(jr,Dr):W(jr)||ie(jr)?Dn=jr:So?Dn=te.spinner():(Vs=>Vs in te)(Ls)&&(Dn=te[Ls](Dr))),Dn}(ps),ee(Tr.onOpen)&&(ps.onOpen=Tr.onOpen),ee(Tr.onClose)&&(ps.onClose=Tr.onClose),ps.closeButton=Gr.closeButton,Tr.closeButton===!1||Z(Tr.closeButton)?ps.closeButton=Tr.closeButton:Tr.closeButton===!0&&(ps.closeButton=!Z(Gr.closeButton)||Gr.closeButton);let Wo=Kn;(0,Te.isValidElement)(Kn)&&!W(Kn.type)?Wo=(0,Te.cloneElement)(Kn,{closeToast:xr,toastProps:ps,data:cs}):ee(Kn)&&(Wo=Kn({closeToast:xr,toastProps:ps,data:cs})),Gr.limit&&Gr.limit>0&&Xt.count>Gr.limit&&no?Xt.queue.push({toastContent:Wo,toastProps:ps,staleId:pr}):ie(Rr)?setTimeout(()=>{fs(Wo,ps,pr)},Rr):fs(Wo,ps,pr)}function fs(Kn,Ir,Rr){const{toastId:pr}=Ir;Rr&&Xn.delete(Rr);const Tr={content:Kn,props:Ir};Xn.set(pr,Tr),Nr(gt=>[...gt,pr].filter(_s=>_s!==Rr)),ve.emit(4,ne(Tr,Tr.props.updateId==null?"added":"updated"))}return(0,Te.useEffect)(()=>(Xt.containerId=rt.containerId,ve.cancelEmit(3).on(0,Jn).on(1,Kn=>kr.current&&bn(Kn)).on(5,qn).emit(2,Xt),()=>{Xn.clear(),ve.emit(3,Xt)}),[]),(0,Te.useEffect)(()=>{Xt.props=rt,Xt.isToastActive=Jt,Xt.displayedToast=Hn.length}),{getToastToRender:function(Kn){const Ir=new Map,Rr=Array.from(Xn.values());return rt.newestOnTop&&Rr.reverse(),Rr.forEach(pr=>{const{position:Tr}=pr.props;Ir.has(Tr)||Ir.set(Tr,[]),Ir.get(Tr).push(pr)}),Array.from(Ir,pr=>Kn(pr[0],pr[1]))},containerRef:kr,isToastActive:Jt}}function Ie(rt){return rt.targetTouches&&rt.targetTouches.length>=1?rt.targetTouches[0].clientX:rt.clientX}function $e(rt){return rt.targetTouches&&rt.targetTouches.length>=1?rt.targetTouches[0].clientY:rt.clientY}function vt(rt){const[zt,Hn]=(0,Te.useState)(!1),[Nr,kr]=(0,Te.useState)(!1),Xn=(0,Te.useRef)(null),Jt=(0,Te.useRef)({start:0,x:0,y:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,boundingRect:null,didMove:!1}).current,Xt=(0,Te.useRef)(rt),{autoClose:qn,pauseOnHover:bn,closeToast:sr,onClick:Jn,closeOnClick:fs}=rt;function Kn(cs){if(rt.draggable){cs.nativeEvent.type==="touchstart"&&cs.nativeEvent.preventDefault(),Jt.didMove=!1,document.addEventListener("mousemove",Tr),document.addEventListener("mouseup",gt),document.addEventListener("touchmove",Tr),document.addEventListener("touchend",gt);const Gr=Xn.current;Jt.canCloseOnClick=!0,Jt.canDrag=!0,Jt.boundingRect=Gr.getBoundingClientRect(),Gr.style.transition="",Jt.x=Ie(cs.nativeEvent),Jt.y=$e(cs.nativeEvent),rt.draggableDirection==="x"?(Jt.start=Jt.x,Jt.removalDistance=Gr.offsetWidth*(rt.draggablePercent/100)):(Jt.start=Jt.y,Jt.removalDistance=Gr.offsetHeight*(rt.draggablePercent===80?1.5*rt.draggablePercent:rt.draggablePercent/100))}}function Ir(cs){if(Jt.boundingRect){const{top:Gr,bottom:xr,left:no,right:ps}=Jt.boundingRect;cs.nativeEvent.type!=="touchend"&&rt.pauseOnHover&&Jt.x>=no&&Jt.x<=ps&&Jt.y>=Gr&&Jt.y<=xr?pr():Rr()}}function Rr(){Hn(!0)}function pr(){Hn(!1)}function Tr(cs){const Gr=Xn.current;Jt.canDrag&&Gr&&(Jt.didMove=!0,zt&&pr(),Jt.x=Ie(cs),Jt.y=$e(cs),Jt.delta=rt.draggableDirection==="x"?Jt.x-Jt.start:Jt.y-Jt.start,Jt.start!==Jt.x&&(Jt.canCloseOnClick=!1),Gr.style.transform=`translate${rt.draggableDirection}(${Jt.delta}px)`,Gr.style.opacity=""+(1-Math.abs(Jt.delta/Jt.removalDistance)))}function gt(){document.removeEventListener("mousemove",Tr),document.removeEventListener("mouseup",gt),document.removeEventListener("touchmove",Tr),document.removeEventListener("touchend",gt);const cs=Xn.current;if(Jt.canDrag&&Jt.didMove&&cs){if(Jt.canDrag=!1,Math.abs(Jt.delta)>Jt.removalDistance)return kr(!0),void rt.closeToast();cs.style.transition="transform 0.2s, opacity 0.2s",cs.style.transform=`translate${rt.draggableDirection}(0)`,cs.style.opacity="1"}}(0,Te.useEffect)(()=>{Xt.current=rt}),(0,Te.useEffect)(()=>(Xn.current&&Xn.current.addEventListener("d",Rr,{once:!0}),ee(rt.onOpen)&&rt.onOpen((0,Te.isValidElement)(rt.children)&&rt.children.props),()=>{const cs=Xt.current;ee(cs.onClose)&&cs.onClose((0,Te.isValidElement)(cs.children)&&cs.children.props)}),[]),(0,Te.useEffect)(()=>(rt.pauseOnFocusLoss&&(document.hasFocus()||pr(),window.addEventListener("focus",Rr),window.addEventListener("blur",pr)),()=>{rt.pauseOnFocusLoss&&(window.removeEventListener("focus",Rr),window.removeEventListener("blur",pr))}),[rt.pauseOnFocusLoss]);const _s={onMouseDown:Kn,onTouchStart:Kn,onMouseUp:Ir,onTouchEnd:Ir};return qn&&bn&&(_s.onMouseEnter=pr,_s.onMouseLeave=Rr),fs&&(_s.onClick=cs=>{Jn&&Jn(cs),Jt.canCloseOnClick&&sr()}),{playToast:Rr,pauseToast:pr,isRunning:zt,preventExitTransition:Nr,toastRef:Xn,eventHandlers:_s}}function mt(rt){let{closeToast:zt,theme:Hn,ariaLabel:Nr="close"}=rt;return Te.createElement("button",{className:`Toastify__close-button Toastify__close-button--${Hn}`,type:"button",onClick:kr=>{kr.stopPropagation(),zt(kr)},"aria-label":Nr},Te.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},Te.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function It(rt){let{delay:zt,isRunning:Hn,closeToast:Nr,type:kr="default",hide:Xn,className:Jt,style:Xt,controlledProgress:qn,progress:bn,rtl:sr,isIn:Jn,theme:fs}=rt;const Kn=Xn||qn&&bn===0,Ir={...Xt,animationDuration:`${zt}ms`,animationPlayState:Hn?"running":"paused",opacity:Kn?0:1};qn&&(Ir.transform=`scaleX(${bn})`);const Rr=(0,ae.A)("Toastify__progress-bar",qn?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${fs}`,`Toastify__progress-bar--${kr}`,{"Toastify__progress-bar--rtl":sr}),pr=ee(Jt)?Jt({rtl:sr,type:kr,defaultClassName:Rr}):(0,ae.A)(Rr,Jt);return Te.createElement("div",{role:"progressbar","aria-hidden":Kn?"true":"false","aria-label":"notification timer",className:pr,style:Ir,[qn&&bn>=1?"onTransitionEnd":"onAnimationEnd"]:qn&&bn<1?null:()=>{Jn&&Nr()}})}const qe=rt=>{const{isRunning:zt,preventExitTransition:Hn,toastRef:Nr,eventHandlers:kr}=vt(rt),{closeButton:Xn,children:Jt,autoClose:Xt,onClick:qn,type:bn,hideProgressBar:sr,closeToast:Jn,transition:fs,position:Kn,className:Ir,style:Rr,bodyClassName:pr,bodyStyle:Tr,progressClassName:gt,progressStyle:_s,updateId:cs,role:Gr,progress:xr,rtl:no,toastId:ps,deleteToast:ns,isIn:ss,isLoading:Wo,iconOut:_o,closeOnClick:ao,theme:Ls}=rt,So=(0,ae.A)("Toastify__toast",`Toastify__toast-theme--${Ls}`,`Toastify__toast--${bn}`,{"Toastify__toast--rtl":no},{"Toastify__toast--close-on-click":ao}),jr=ee(Ir)?Ir({rtl:no,position:Kn,type:bn,defaultClassName:So}):(0,ae.A)(So,Ir),Dn=!!xr||!Xt,Dr={closeToast:Jn,type:bn,theme:Ls};let Vs=null;return Xn===!1||(Vs=ee(Xn)?Xn(Dr):(0,Te.isValidElement)(Xn)?(0,Te.cloneElement)(Xn,Dr):mt(Dr)),Te.createElement(fs,{isIn:ss,done:ns,position:Kn,preventExitTransition:Hn,nodeRef:Nr},Te.createElement("div",{id:ps,onClick:qn,className:jr,...kr,style:Rr,ref:Nr},Te.createElement("div",{...ss&&{role:Gr},className:ee(pr)?pr({type:bn}):(0,ae.A)("Toastify__toast-body",pr),style:Tr},_o!=null&&Te.createElement("div",{className:(0,ae.A)("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!Wo})},_o),Te.createElement("div",null,Jt)),Vs,Te.createElement(It,{...cs&&!Dn?{key:`pb-${cs}`}:{},rtl:no,theme:Ls,delay:Xt,isRunning:zt,isIn:ss,closeToast:Jn,hide:sr,type:bn,style:_s,className:gt,controlledProgress:Dn,progress:xr||0})))},nn=function(rt,zt){return zt===void 0&&(zt=!1),{enter:`Toastify--animate Toastify__${rt}-enter`,exit:`Toastify--animate Toastify__${rt}-exit`,appendPosition:zt}},Ut=ge(nn("bounce",!0)),Xe=ge(nn("slide",!0)),Ft=ge(nn("zoom")),rn=ge(nn("flip")),Vt=(0,Te.forwardRef)((rt,zt)=>{const{getToastToRender:Hn,containerRef:Nr,isToastActive:kr}=Re(rt),{className:Xn,style:Jt,rtl:Xt,containerId:qn}=rt;function bn(sr){const Jn=(0,ae.A)("Toastify__toast-container",`Toastify__toast-container--${sr}`,{"Toastify__toast-container--rtl":Xt});return ee(Xn)?Xn({position:sr,rtl:Xt,defaultClassName:Jn}):(0,ae.A)(Jn,q(Xn))}return(0,Te.useEffect)(()=>{zt&&(zt.current=Nr.current)},[]),Te.createElement("div",{ref:Nr,className:"Toastify",id:qn},Hn((sr,Jn)=>{const fs=Jn.length?{...Jt}:{...Jt,pointerEvents:"none"};return Te.createElement("div",{className:bn(sr),style:fs,key:`container-${sr}`},Jn.map((Kn,Ir)=>{let{content:Rr,props:pr}=Kn;return Te.createElement(qe,{...pr,isIn:kr(pr.toastId),style:{...pr.style,"--nth":Ir+1,"--len":Jn.length},key:`toast-${pr.key}`},Rr)}))}))});Vt.displayName="ToastContainer",Vt.defaultProps={position:"top-right",transition:Ut,autoClose:5e3,closeButton:mt,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,draggable:!0,draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};let ze,je=new Map,De=[],ct=1;function qt(){return""+ct++}function z(rt){return rt&&(W(rt.toastId)||ie(rt.toastId))?rt.toastId:qt()}function He(rt,zt){return je.size>0?ve.emit(0,rt,zt):De.push({content:rt,options:zt}),zt.toastId}function Ct(rt,zt){return{...zt,type:zt&&zt.type||rt,toastId:z(zt)}}function kt(rt){return(zt,Hn)=>He(zt,Ct(rt,Hn))}function Pe(rt,zt){return He(rt,Ct("default",zt))}Pe.loading=(rt,zt)=>He(rt,Ct("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...zt})),Pe.promise=function(rt,zt,Hn){let Nr,{pending:kr,error:Xn,success:Jt}=zt;kr&&(Nr=W(kr)?Pe.loading(kr,Hn):Pe.loading(kr.render,{...Hn,...kr}));const Xt={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},qn=(sr,Jn,fs)=>{if(Jn==null)return void Pe.dismiss(Nr);const Kn={type:sr,...Xt,...Hn,data:fs},Ir=W(Jn)?{render:Jn}:Jn;return Nr?Pe.update(Nr,{...Kn,...Ir}):Pe(Ir.render,{...Kn,...Ir}),fs},bn=ee(rt)?rt():rt;return bn.then(sr=>qn("success",Jt,sr)).catch(sr=>qn("error",Xn,sr)),bn},Pe.success=kt("success"),Pe.info=kt("info"),Pe.error=kt("error"),Pe.warning=kt("warning"),Pe.warn=Pe.warning,Pe.dark=(rt,zt)=>He(rt,Ct("default",{theme:"dark",...zt})),Pe.dismiss=rt=>{je.size>0?ve.emit(1,rt):De=De.filter(zt=>rt!=null&&zt.options.toastId!==rt)},Pe.clearWaitingQueue=function(rt){return rt===void 0&&(rt={}),ve.emit(5,rt)},Pe.isActive=rt=>{let zt=!1;return je.forEach(Hn=>{Hn.isToastActive&&Hn.isToastActive(rt)&&(zt=!0)}),zt},Pe.update=function(rt,zt){zt===void 0&&(zt={}),setTimeout(()=>{const Hn=function(Nr,kr){let{containerId:Xn}=kr;const Jt=je.get(Xn||ze);return Jt&&Jt.getToast(Nr)}(rt,zt);if(Hn){const{props:Nr,content:kr}=Hn,Xn={delay:100,...Nr,...zt,toastId:zt.toastId||rt,updateId:qt()};Xn.toastId!==rt&&(Xn.staleId=rt);const Jt=Xn.render||kr;delete Xn.render,He(Jt,Xn)}},0)},Pe.done=rt=>{Pe.update(rt,{progress:1})},Pe.onChange=rt=>(ve.on(4,rt),()=>{ve.off(4,rt)}),Pe.POSITION={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},Pe.TYPE={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},ve.on(2,rt=>{ze=rt.containerId||rt,je.set(ze,rt),De.forEach(zt=>{ve.emit(0,zt.content,zt.options)}),De=[]}).on(3,rt=>{je.delete(rt.containerId||rt),je.size===0&&ve.off(0).off(1).off(5)});const yt={},un={},Yn=({darkMode:rt=!1,...zt})=>(0,we.jsx)("div",{"data-testid":"toastContainer",children:(0,we.jsx)(Vt,{position:"top-right",autoClose:5e3,className:"toastContainer",theme:rt?"dark":"light",...zt})});var nr=se(1642),rr=se(5734);const ar=(rt,zt)=>{toast.info(rt,zt)},wr=(rt,zt)=>{Pe.success(rt,zt)},Ts=(rt,zt)=>{toast.warning(rt,zt)},Zr=(rt,zt)=>{Pe.error(rt,zt)},Bs=(rt,zt)=>{const Hn=(0,rr.Co)(rt);if(Hn){let Nr=Hn;Nr=`core:errors.${Nr??"generic"}`;const kr=(0,nr.t)(Nr);if(kr!==Nr){Zr((0,nr.t)(kr),zt);return}}Zr((0,nr.t)("core:errors.generic"),zt)}},9387:(a,l,se)=>{"use strict";se.d(l,{m:()=>q,Z:()=>Z});var we=se(2215),Te=se(1048),ae=se(8782),ie=se(1520);class W{static accountIsSignedIn(ge={}){return new Promise((ne,ve)=>{let V=ie.Jp+"/Account/IsSignedIn";const te=(0,ie.Y_)("get","application/json",V,ge);(0,ie.pY)(te,ne,ve)})}static accountSignIn(ge={},ne={}){return new Promise((ve,V)=>{let te=ie.Jp+"/Account/SignIn";const Re=(0,ie.Y_)("get","application/json",te,ne);Re.params={portalType:ge.portalType,redirectTo:ge.redirectTo},(0,ie.pY)(Re,ve,V)})}static accountSignOut(ge={}){return new Promise((ne,ve)=>{let V=ie.Jp+"/Account/SignOut";const te=(0,ie.Y_)("get","application/json",V,ge);(0,ie.pY)(te,ne,ve)})}static accountError(ge={}){return new Promise((ne,ve)=>{let V=ie.Jp+"/Account/Error";const te=(0,ie.Y_)("get","application/json",V,ge);(0,ie.pY)(te,ne,ve)})}}const ee={queryKey:()=>["AccountService/accountIsSignedIn"],queryFn:async()=>await W.accountIsSignedIn().then(ge=>ge).catch(()=>!1),staleTime:5*60*1e3},q=(U=!1)=>{const ge=(0,ae.canLocationMakeCallForCheckIsUserAuth)()||U,{data:ne,isLoading:ve,isFetching:V}=(0,we.I)({queryKey:ee.queryKey(),queryFn:async()=>await ee.queryFn(),staleTime:ee.staleTime,enabled:ge,refetchOnWindowFocus:"always"});return{isLoggedIn:!!ne,isLoading:ve,isFetching:V}},Z=()=>{const{data:U,isFetched:ge,isLoading:ne}=(0,Te.useCurrentUser)(),{isLoggedIn:ve}=q();return{isAuthenticated:!!U&&ve,isFetched:ge&&!ne}}},6664:(a,l,se)=>{"use strict";se.d(l,{X:()=>we});var we=(Te=>(Te.BasicUser="BasicUser",Te.OrganizationAdmin="OrganizationAdmin",Te.ResellerAdmin="ResellerAdmin",Te.InternalAdmin="InternalAdmin",Te.ResellerGuest="ResellerGuest",Te))(we||{})},1191:(a,l,se)=>{"use strict";se.d(l,{W:()=>rn});var we=se(1642),Te=se(3029),ae=se(2901),ie=[],W=ie.forEach,ee=ie.slice;function q(Vt){return W.call(ee.call(arguments,1),function(ze){if(ze)for(var je in ze)Vt[je]===void 0&&(Vt[je]=ze[je])}),Vt}var Z=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,U=function(ze,je,De){var ct=De||{};ct.path=ct.path||"/";var qt=encodeURIComponent(je),z="".concat(ze,"=").concat(qt);if(ct.maxAge>0){var He=ct.maxAge-0;if(Number.isNaN(He))throw new Error("maxAge should be a Number");z+="; Max-Age=".concat(Math.floor(He))}if(ct.domain){if(!Z.test(ct.domain))throw new TypeError("option domain is invalid");z+="; Domain=".concat(ct.domain)}if(ct.path){if(!Z.test(ct.path))throw new TypeError("option path is invalid");z+="; Path=".concat(ct.path)}if(ct.expires){if(typeof ct.expires.toUTCString!="function")throw new TypeError("option expires is invalid");z+="; Expires=".concat(ct.expires.toUTCString())}if(ct.httpOnly&&(z+="; HttpOnly"),ct.secure&&(z+="; Secure"),ct.sameSite){var Ct=typeof ct.sameSite=="string"?ct.sameSite.toLowerCase():ct.sameSite;switch(Ct){case!0:z+="; SameSite=Strict";break;case"lax":z+="; SameSite=Lax";break;case"strict":z+="; SameSite=Strict";break;case"none":z+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return z},ge={create:function(ze,je,De,ct){var qt=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};De&&(qt.expires=new Date,qt.expires.setTime(qt.expires.getTime()+De*60*1e3)),ct&&(qt.domain=ct),document.cookie=U(ze,encodeURIComponent(je),qt)},read:function(ze){for(var je="".concat(ze,"="),De=document.cookie.split(";"),ct=0;ct<De.length;ct++){for(var qt=De[ct];qt.charAt(0)===" ";)qt=qt.substring(1,qt.length);if(qt.indexOf(je)===0)return qt.substring(je.length,qt.length)}return null},remove:function(ze){this.create(ze,"",-1)}},ne={name:"cookie",lookup:function(ze){var je;if(ze.lookupCookie&&typeof document<"u"){var De=ge.read(ze.lookupCookie);De&&(je=De)}return je},cacheUserLanguage:function(ze,je){je.lookupCookie&&typeof document<"u"&&ge.create(je.lookupCookie,ze,je.cookieMinutes,je.cookieDomain,je.cookieOptions)}},ve={name:"querystring",lookup:function(ze){var je;if(typeof window<"u"){var De=window.location.search;!window.location.search&&window.location.hash&&window.location.hash.indexOf("?")>-1&&(De=window.location.hash.substring(window.location.hash.indexOf("?")));for(var ct=De.substring(1),qt=ct.split("&"),z=0;z<qt.length;z++){var He=qt[z].indexOf("=");if(He>0){var Ct=qt[z].substring(0,He);Ct===ze.lookupQuerystring&&(je=qt[z].substring(He+1))}}}return je}},V=null,te=function(){if(V!==null)return V;try{V=window!=="undefined"&&window.localStorage!==null;var ze="i18next.translate.boo";window.localStorage.setItem(ze,"foo"),window.localStorage.removeItem(ze)}catch{V=!1}return V},Re={name:"localStorage",lookup:function(ze){var je;if(ze.lookupLocalStorage&&te()){var De=window.localStorage.getItem(ze.lookupLocalStorage);De&&(je=De)}return je},cacheUserLanguage:function(ze,je){je.lookupLocalStorage&&te()&&window.localStorage.setItem(je.lookupLocalStorage,ze)}},Ie=null,$e=function(){if(Ie!==null)return Ie;try{Ie=window!=="undefined"&&window.sessionStorage!==null;var ze="i18next.translate.boo";window.sessionStorage.setItem(ze,"foo"),window.sessionStorage.removeItem(ze)}catch{Ie=!1}return Ie},vt={name:"sessionStorage",lookup:function(ze){var je;if(ze.lookupSessionStorage&&$e()){var De=window.sessionStorage.getItem(ze.lookupSessionStorage);De&&(je=De)}return je},cacheUserLanguage:function(ze,je){je.lookupSessionStorage&&$e()&&window.sessionStorage.setItem(je.lookupSessionStorage,ze)}},mt={name:"navigator",lookup:function(ze){var je=[];if(typeof navigator<"u"){if(navigator.languages)for(var De=0;De<navigator.languages.length;De++)je.push(navigator.languages[De]);navigator.userLanguage&&je.push(navigator.userLanguage),navigator.language&&je.push(navigator.language)}return je.length>0?je:void 0}},It={name:"htmlTag",lookup:function(ze){var je,De=ze.htmlTag||(typeof document<"u"?document.documentElement:null);return De&&typeof De.getAttribute=="function"&&(je=De.getAttribute("lang")),je}},qe={name:"path",lookup:function(ze){var je;if(typeof window<"u"){var De=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(De instanceof Array)if(typeof ze.lookupFromPathIndex=="number"){if(typeof De[ze.lookupFromPathIndex]!="string")return;je=De[ze.lookupFromPathIndex].replace("/","")}else je=De[0].replace("/","")}return je}},nn={name:"subdomain",lookup:function(ze){var je=typeof ze.lookupFromSubdomainIndex=="number"?ze.lookupFromSubdomainIndex+1:1,De=typeof window<"u"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(De)return De[je]}};function Ut(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:function(ze){return ze}}}var Xe=function(){function Vt(ze){var je=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(0,Te.A)(this,Vt),this.type="languageDetector",this.detectors={},this.init(ze,je)}return(0,ae.A)(Vt,[{key:"init",value:function(je){var De=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ct=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=je||{languageUtils:{}},this.options=q(De,this.options||{},Ut()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=function(qt){return qt.replace("-","_")}),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=ct,this.addDetector(ne),this.addDetector(ve),this.addDetector(Re),this.addDetector(vt),this.addDetector(mt),this.addDetector(It),this.addDetector(qe),this.addDetector(nn)}},{key:"addDetector",value:function(je){return this.detectors[je.name]=je,this}},{key:"detect",value:function(je){var De=this;je||(je=this.options.order);var ct=[];return je.forEach(function(qt){if(De.detectors[qt]){var z=De.detectors[qt].lookup(De.options);z&&typeof z=="string"&&(z=[z]),z&&(ct=ct.concat(z))}}),ct=ct.map(function(qt){return De.options.convertDetectedLanguage(qt)}),this.services.languageUtils.getBestMatchFromCodes?ct:ct.length>0?ct[0]:null}},{key:"cacheUserLanguage",value:function(je,De){var ct=this;De||(De=this.options.caches),De&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(je)>-1||De.forEach(function(qt){ct.detectors[qt]&&ct.detectors[qt].cacheUserLanguage(je,ct.options)}))}}]),Vt}();Xe.type="languageDetector";var Ft=se(3254);const rn=({locales:Vt,defaultLanguage:ze,defaultNs:je,fallbackNs:De})=>(we.Ay.use(Xe).use(Ft.r9).init({supportedLngs:Object.keys(Vt),nonExplicitSupportedLngs:!0,resources:Vt,fallbackLng:ze,defaultNS:je,fallbackNS:De,interpolation:{escapeValue:!1}}),we.Ay)},5873:(a,l,se)=>{"use strict";se.d(l,{Mb:()=>q,ok:()=>W,Jt:()=>ee});var we=se(8138),Te=se(3254),ae=se(9336),ie=se(5167);const W=()=>{const{i18n:U}=(0,Te.Bd)();return U.resolvedLanguage??ae.A.i18n.defaultLanguage},ee=()=>{const{i18n:U}=(0,Te.Bd)();return Object.keys(U.options.resources)},q=()=>{const{i18n:U}=(0,Te.Bd)(),ge=(0,we.jE)();return ne=>{U.changeLanguage(ne).then(()=>{ge.invalidateQueries({queryKey:[ie.bd]})})}};var Z=se(1191)},6225:(a,l,se)=>{"use strict";se.d(l,{gd:()=>ee,uy:()=>W});const we="#ffffff!important",Te="#4f46e5!important",ae={layout:{root:{background:"rgba(255, 255, 255, 0.5)",backdropFilter:"blur(32px) brightness(1)",padding:"8px"}},unseenBadge:{root:{color:we,background:Te}},tabs:{tabLabel:{"::after":{background:Te}}},bellButton:{dot:{rect:{fill:Te,strokeWidth:"0"}}},notifications:{listItem:{unread:{fontWeight:"300",fontSize:"14px",":before":{background:"transparent"},color:"#0f172a"},read:{background:"#f1f5f9"},timestamp:{color:"#0f172a",marginTop:"4px"},dotsButton:{stopColor:Te}}}},ie={layout:{root:{background:"rgb(15, 23, 42)",backdropFilter:"blur(32px) brightness(1)",border:"1px solid rgb(30, 41, 59)",padding:"8px"}},unseenBadge:{root:{color:we,background:Te}},tabs:{tabLabel:{"::after":{background:Te}}},bellButton:{dot:{rect:{fill:we,strokeWidth:"2",stroke:"#828299"}}},notifications:{listItem:{unread:{fontWeight:"300",fontSize:"14px",":before":{background:"transparent"},background:"rgb(2, 6, 23)",border:"1px solid #94a3b8"},read:{background:"rgb(2, 6, 23)"},timestamp:{color:"#828299",marginTop:"4px"},dotsButton:{stopColor:Te}}}};var W=(q=>(q.Light="light",q.Dark="dark",q))(W||{});const ee=q=>{switch(q){case"dark":return ie;case"light":default:return ae}}},716:()=>{"use strict"},5167:(a,l,se)=>{"use strict";se.d(l,{RF:()=>ae,XO:()=>ee,bd:()=>we,cR:()=>q,cq:()=>ie,oq:()=>W});const we="Localized",Te=Z=>Z.filter(U=>!!U),ae=Z=>Te([we,...Z]),ie=Z=>Z?.isLoading||Z?.data===void 0,W=Z=>!Z?.isLoading&&!!Z?.data&&Z?.data?.length===0,ee=Z=>!Z.isLoading&&!!Z.data&&Z.data?.pages?.[0]?.results?.length===0,q=Z=>Z?.data?.pages?.flatMap(({results:U})=>U)},276:()=>{"use strict"},8782:(a,l,se)=>{"use strict";se.d(l,{canLocationMakeCallForCheckIsUserAuth:()=>xu,canLocationMakeCallForData:()=>Hd,createClient:()=>wu,getAllPagesResults:()=>zi.cR,getLocalizedQueryKey:()=>zi.RF,isInfiniteScrollRequestHavingNoResults:()=>zi.XO,isRequestHavingNoResults:()=>zi.oq,isRequestLoading:()=>zi.cq,skipHeaders:()=>Vd,useInvalidateQuery:()=>Ju});var we={};se.r(we),se.d(we,{hasBrowserEnv:()=>Wt,hasStandardBrowserEnv:()=>Qt,hasStandardBrowserWebWorkerEnv:()=>be,navigator:()=>cn,origin:()=>pe});var Te=se(7367),ae=se(8919),ie=se(4255);function W(J,re){return function(){return J.apply(re,arguments)}}const{toString:ee}=Object.prototype,{getPrototypeOf:q}=Object,Z=(J=>re=>{const Se=ee.call(re);return J[Se]||(J[Se]=Se.slice(8,-1).toLowerCase())})(Object.create(null)),U=J=>(J=J.toLowerCase(),re=>Z(re)===J),ge=J=>re=>typeof re===J,{isArray:ne}=Array,ve=ge("undefined");function V(J){return J!==null&&!ve(J)&&J.constructor!==null&&!ve(J.constructor)&&$e(J.constructor.isBuffer)&&J.constructor.isBuffer(J)}const te=U("ArrayBuffer");function Re(J){let re;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?re=ArrayBuffer.isView(J):re=J&&J.buffer&&te(J.buffer),re}const Ie=ge("string"),$e=ge("function"),vt=ge("number"),mt=J=>J!==null&&typeof J=="object",It=J=>J===!0||J===!1,qe=J=>{if(Z(J)!=="object")return!1;const re=q(J);return(re===null||re===Object.prototype||Object.getPrototypeOf(re)===null)&&!(Symbol.toStringTag in J)&&!(Symbol.iterator in J)},nn=U("Date"),Ut=U("File"),Xe=U("Blob"),Ft=U("FileList"),rn=J=>mt(J)&&$e(J.pipe),Vt=J=>{let re;return J&&(typeof FormData=="function"&&J instanceof FormData||$e(J.append)&&((re=Z(J))==="formdata"||re==="object"&&$e(J.toString)&&J.toString()==="[object FormData]"))},ze=U("URLSearchParams"),[je,De,ct,qt]=["ReadableStream","Request","Response","Headers"].map(U),z=J=>J.trim?J.trim():J.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function He(J,re,{allOwnKeys:Se=!1}={}){if(J===null||typeof J>"u")return;let ke,Ue;if(typeof J!="object"&&(J=[J]),ne(J))for(ke=0,Ue=J.length;ke<Ue;ke++)re.call(null,J[ke],ke,J);else{const lt=Se?Object.getOwnPropertyNames(J):Object.keys(J),ot=lt.length;let en;for(ke=0;ke<ot;ke++)en=lt[ke],re.call(null,J[en],en,J)}}function Ct(J,re){re=re.toLowerCase();const Se=Object.keys(J);let ke=Se.length,Ue;for(;ke-- >0;)if(Ue=Se[ke],re===Ue.toLowerCase())return Ue;return null}const kt=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),Pe=J=>!ve(J)&&J!==kt;function yt(){const{caseless:J}=Pe(this)&&this||{},re={},Se=(ke,Ue)=>{const lt=J&&Ct(re,Ue)||Ue;qe(re[lt])&&qe(ke)?re[lt]=yt(re[lt],ke):qe(ke)?re[lt]=yt({},ke):ne(ke)?re[lt]=ke.slice():re[lt]=ke};for(let ke=0,Ue=arguments.length;ke<Ue;ke++)arguments[ke]&&He(arguments[ke],Se);return re}const un=(J,re,Se,{allOwnKeys:ke}={})=>(He(re,(Ue,lt)=>{Se&&$e(Ue)?J[lt]=W(Ue,Se):J[lt]=Ue},{allOwnKeys:ke}),J),Rn=J=>(J.charCodeAt(0)===65279&&(J=J.slice(1)),J),Yn=(J,re,Se,ke)=>{J.prototype=Object.create(re.prototype,ke),J.prototype.constructor=J,Object.defineProperty(J,"super",{value:re.prototype}),Se&&Object.assign(J.prototype,Se)},nr=(J,re,Se,ke)=>{let Ue,lt,ot;const en={};if(re=re||{},J==null)return re;do{for(Ue=Object.getOwnPropertyNames(J),lt=Ue.length;lt-- >0;)ot=Ue[lt],(!ke||ke(ot,J,re))&&!en[ot]&&(re[ot]=J[ot],en[ot]=!0);J=Se!==!1&&q(J)}while(J&&(!Se||Se(J,re))&&J!==Object.prototype);return re},rr=(J,re,Se)=>{J=String(J),(Se===void 0||Se>J.length)&&(Se=J.length),Se-=re.length;const ke=J.indexOf(re,Se);return ke!==-1&&ke===Se},ar=J=>{if(!J)return null;if(ne(J))return J;let re=J.length;if(!vt(re))return null;const Se=new Array(re);for(;re-- >0;)Se[re]=J[re];return Se},wr=(J=>re=>J&&re instanceof J)(typeof Uint8Array<"u"&&q(Uint8Array)),Ts=(J,re)=>{const ke=(J&&J[Symbol.iterator]).call(J);let Ue;for(;(Ue=ke.next())&&!Ue.done;){const lt=Ue.value;re.call(J,lt[0],lt[1])}},Zr=(J,re)=>{let Se;const ke=[];for(;(Se=J.exec(re))!==null;)ke.push(Se);return ke},Bs=U("HTMLFormElement"),rt=J=>J.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(Se,ke,Ue){return ke.toUpperCase()+Ue}),zt=(({hasOwnProperty:J})=>(re,Se)=>J.call(re,Se))(Object.prototype),Hn=U("RegExp"),Nr=(J,re)=>{const Se=Object.getOwnPropertyDescriptors(J),ke={};He(Se,(Ue,lt)=>{let ot;(ot=re(Ue,lt,J))!==!1&&(ke[lt]=ot||Ue)}),Object.defineProperties(J,ke)},kr=J=>{Nr(J,(re,Se)=>{if($e(J)&&["arguments","caller","callee"].indexOf(Se)!==-1)return!1;const ke=J[Se];if($e(ke)){if(re.enumerable=!1,"writable"in re){re.writable=!1;return}re.set||(re.set=()=>{throw Error("Can not rewrite read-only method '"+Se+"'")})}})},Xn=(J,re)=>{const Se={},ke=Ue=>{Ue.forEach(lt=>{Se[lt]=!0})};return ne(J)?ke(J):ke(String(J).split(re)),Se},Jt=()=>{},Xt=(J,re)=>J!=null&&Number.isFinite(J=+J)?J:re,qn="abcdefghijklmnopqrstuvwxyz",bn="0123456789",sr={DIGIT:bn,ALPHA:qn,ALPHA_DIGIT:qn+qn.toUpperCase()+bn},Jn=(J=16,re=sr.ALPHA_DIGIT)=>{let Se="";const{length:ke}=re;for(;J--;)Se+=re[Math.random()*ke|0];return Se};function fs(J){return!!(J&&$e(J.append)&&J[Symbol.toStringTag]==="FormData"&&J[Symbol.iterator])}const Kn=J=>{const re=new Array(10),Se=(ke,Ue)=>{if(mt(ke)){if(re.indexOf(ke)>=0)return;if(!("toJSON"in ke)){re[Ue]=ke;const lt=ne(ke)?[]:{};return He(ke,(ot,en)=>{const or=Se(ot,Ue+1);!ve(or)&&(lt[en]=or)}),re[Ue]=void 0,lt}}return ke};return Se(J,0)},Ir=U("AsyncFunction"),Rr=J=>J&&(mt(J)||$e(J))&&$e(J.then)&&$e(J.catch),pr=((J,re)=>J?setImmediate:re?((Se,ke)=>(kt.addEventListener("message",({source:Ue,data:lt})=>{Ue===kt&&lt===Se&&ke.length&&ke.shift()()},!1),Ue=>{ke.push(Ue),kt.postMessage(Se,"*")}))(`axios@${Math.random()}`,[]):Se=>setTimeout(Se))(typeof setImmediate=="function",$e(kt.postMessage)),Tr=typeof queueMicrotask<"u"?queueMicrotask.bind(kt):typeof process<"u"&&process.nextTick||pr,gt={isArray:ne,isArrayBuffer:te,isBuffer:V,isFormData:Vt,isArrayBufferView:Re,isString:Ie,isNumber:vt,isBoolean:It,isObject:mt,isPlainObject:qe,isReadableStream:je,isRequest:De,isResponse:ct,isHeaders:qt,isUndefined:ve,isDate:nn,isFile:Ut,isBlob:Xe,isRegExp:Hn,isFunction:$e,isStream:rn,isURLSearchParams:ze,isTypedArray:wr,isFileList:Ft,forEach:He,merge:yt,extend:un,trim:z,stripBOM:Rn,inherits:Yn,toFlatObject:nr,kindOf:Z,kindOfTest:U,endsWith:rr,toArray:ar,forEachEntry:Ts,matchAll:Zr,isHTMLForm:Bs,hasOwnProperty:zt,hasOwnProp:zt,reduceDescriptors:Nr,freezeMethods:kr,toObjectSet:Xn,toCamelCase:rt,noop:Jt,toFiniteNumber:Xt,findKey:Ct,global:kt,isContextDefined:Pe,ALPHABET:sr,generateString:Jn,isSpecCompliantForm:fs,toJSONObject:Kn,isAsyncFn:Ir,isThenable:Rr,setImmediate:pr,asap:Tr};function _s(J,re,Se,ke,Ue){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=J,this.name="AxiosError",re&&(this.code=re),Se&&(this.config=Se),ke&&(this.request=ke),Ue&&(this.response=Ue,this.status=Ue.status?Ue.status:null)}gt.inherits(_s,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:gt.toJSONObject(this.config),code:this.code,status:this.status}}});const cs=_s.prototype,Gr={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(J=>{Gr[J]={value:J}}),Object.defineProperties(_s,Gr),Object.defineProperty(cs,"isAxiosError",{value:!0}),_s.from=(J,re,Se,ke,Ue,lt)=>{const ot=Object.create(cs);return gt.toFlatObject(J,ot,function(or){return or!==Error.prototype},en=>en!=="isAxiosError"),_s.call(ot,J.message,re,Se,ke,Ue),ot.cause=J,ot.name=J.name,lt&&Object.assign(ot,lt),ot};const xr=_s,no=null;function ps(J){return gt.isPlainObject(J)||gt.isArray(J)}function ns(J){return gt.endsWith(J,"[]")?J.slice(0,-2):J}function ss(J,re,Se){return J?J.concat(re).map(function(Ue,lt){return Ue=ns(Ue),!Se&&lt?"["+Ue+"]":Ue}).join(Se?".":""):re}function Wo(J){return gt.isArray(J)&&!J.some(ps)}const _o=gt.toFlatObject(gt,{},null,function(re){return/^is[A-Z]/.test(re)});function ao(J,re,Se){if(!gt.isObject(J))throw new TypeError("target must be an object");re=re||new(no||FormData),Se=gt.toFlatObject(Se,{metaTokens:!0,dots:!1,indexes:!1},!1,function(ms,Pr){return!gt.isUndefined(Pr[ms])});const ke=Se.metaTokens,Ue=Se.visitor||$n,lt=Se.dots,ot=Se.indexes,or=(Se.Blob||typeof Blob<"u"&&Blob)&&gt.isSpecCompliantForm(re);if(!gt.isFunction(Ue))throw new TypeError("visitor must be a function");function Tn(Mr){if(Mr===null)return"";if(gt.isDate(Mr))return Mr.toISOString();if(!or&&gt.isBlob(Mr))throw new xr("Blob is not supported. Use a Buffer instead.");return gt.isArrayBuffer(Mr)||gt.isTypedArray(Mr)?or&&typeof Blob=="function"?new Blob([Mr]):Buffer.from(Mr):Mr}function $n(Mr,ms,Pr){let Qs=Mr;if(Mr&&!Pr&&typeof Mr=="object"){if(gt.endsWith(ms,"{}"))ms=ke?ms:ms.slice(0,-2),Mr=JSON.stringify(Mr);else if(gt.isArray(Mr)&&Wo(Mr)||(gt.isFileList(Mr)||gt.endsWith(ms,"[]"))&&(Qs=gt.toArray(Mr)))return ms=ns(ms),Qs.forEach(function(zo,Nc){!(gt.isUndefined(zo)||zo===null)&&re.append(ot===!0?ss([ms],Nc,lt):ot===null?ms:ms+"[]",Tn(zo))}),!1}return ps(Mr)?!0:(re.append(ss(Pr,ms,lt),Tn(Mr)),!1)}const vr=[],ks=Object.assign(_o,{defaultVisitor:$n,convertValue:Tn,isVisitable:ps});function Ea(Mr,ms){if(!gt.isUndefined(Mr)){if(vr.indexOf(Mr)!==-1)throw Error("Circular reference detected in "+ms.join("."));vr.push(Mr),gt.forEach(Mr,function(Qs,Fo){(!(gt.isUndefined(Qs)||Qs===null)&&Ue.call(re,Qs,gt.isString(Fo)?Fo.trim():Fo,ms,ks))===!0&&Ea(Qs,ms?ms.concat(Fo):[Fo])}),vr.pop()}}if(!gt.isObject(J))throw new TypeError("data must be an object");return Ea(J),re}const Ls=ao;function So(J){const re={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(J).replace(/[!'()~]|%20|%00/g,function(ke){return re[ke]})}function jr(J,re){this._pairs=[],J&&Ls(J,this,re)}const Dn=jr.prototype;Dn.append=function(re,Se){this._pairs.push([re,Se])},Dn.toString=function(re){const Se=re?function(ke){return re.call(this,ke,So)}:So;return this._pairs.map(function(Ue){return Se(Ue[0])+"="+Se(Ue[1])},"").join("&")};const Dr=jr;function Vs(J){return encodeURIComponent(J).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Mo(J,re,Se){if(!re)return J;const ke=Se&&Se.encode||Vs,Ue=Se&&Se.serialize;let lt;if(Ue?lt=Ue(re,Se):lt=gt.isURLSearchParams(re)?re.toString():new Dr(re,Se).toString(ke),lt){const ot=J.indexOf("#");ot!==-1&&(J=J.slice(0,ot)),J+=(J.indexOf("?")===-1?"?":"&")+lt}return J}class qo{constructor(){this.handlers=[]}use(re,Se,ke){return this.handlers.push({fulfilled:re,rejected:Se,synchronous:ke?ke.synchronous:!1,runWhen:ke?ke.runWhen:null}),this.handlers.length-1}eject(re){this.handlers[re]&&(this.handlers[re]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(re){gt.forEach(this.handlers,function(ke){ke!==null&&re(ke)})}}const ui=qo,Wn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ut={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Dr,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Wt=typeof window<"u"&&typeof document<"u",cn=typeof navigator=="object"&&navigator||void 0,Qt=Wt&&(!cn||["ReactNative","NativeScript","NS"].indexOf(cn.product)<0),be=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),pe=Wt&&window.location.href||"http://localhost",le={...we,...ut};function ue(J,re){return Ls(J,new le.classes.URLSearchParams,Object.assign({visitor:function(Se,ke,Ue,lt){return le.isNode&&gt.isBuffer(Se)?(this.append(ke,Se.toString("base64")),!1):lt.defaultVisitor.apply(this,arguments)}},re))}function K(J){return gt.matchAll(/\w+|\[(\w*)]/g,J).map(re=>re[0]==="[]"?"":re[1]||re[0])}function fe(J){const re={},Se=Object.keys(J);let ke;const Ue=Se.length;let lt;for(ke=0;ke<Ue;ke++)lt=Se[ke],re[lt]=J[lt];return re}function _e(J){function re(Se,ke,Ue,lt){let ot=Se[lt++];if(ot==="__proto__")return!0;const en=Number.isFinite(+ot),or=lt>=Se.length;return ot=!ot&&gt.isArray(Ue)?Ue.length:ot,or?(gt.hasOwnProp(Ue,ot)?Ue[ot]=[Ue[ot],ke]:Ue[ot]=ke,!en):((!Ue[ot]||!gt.isObject(Ue[ot]))&&(Ue[ot]=[]),re(Se,ke,Ue[ot],lt)&&gt.isArray(Ue[ot])&&(Ue[ot]=fe(Ue[ot])),!en)}if(gt.isFormData(J)&&gt.isFunction(J.entries)){const Se={};return gt.forEachEntry(J,(ke,Ue)=>{re(K(ke),Ue,Se,0)}),Se}return null}const Ve=_e;function X(J,re,Se){if(gt.isString(J))try{return(re||JSON.parse)(J),gt.trim(J)}catch(ke){if(ke.name!=="SyntaxError")throw ke}return(Se||JSON.stringify)(J)}const xe={transitional:Wn,adapter:["xhr","http","fetch"],transformRequest:[function(re,Se){const ke=Se.getContentType()||"",Ue=ke.indexOf("application/json")>-1,lt=gt.isObject(re);if(lt&&gt.isHTMLForm(re)&&(re=new FormData(re)),gt.isFormData(re))return Ue?JSON.stringify(Ve(re)):re;if(gt.isArrayBuffer(re)||gt.isBuffer(re)||gt.isStream(re)||gt.isFile(re)||gt.isBlob(re)||gt.isReadableStream(re))return re;if(gt.isArrayBufferView(re))return re.buffer;if(gt.isURLSearchParams(re))return Se.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),re.toString();let en;if(lt){if(ke.indexOf("application/x-www-form-urlencoded")>-1)return ue(re,this.formSerializer).toString();if((en=gt.isFileList(re))||ke.indexOf("multipart/form-data")>-1){const or=this.env&&this.env.FormData;return Ls(en?{"files[]":re}:re,or&&new or,this.formSerializer)}}return lt||Ue?(Se.setContentType("application/json",!1),X(re)):re}],transformResponse:[function(re){const Se=this.transitional||xe.transitional,ke=Se&&Se.forcedJSONParsing,Ue=this.responseType==="json";if(gt.isResponse(re)||gt.isReadableStream(re))return re;if(re&&gt.isString(re)&&(ke&&!this.responseType||Ue)){const ot=!(Se&&Se.silentJSONParsing)&&Ue;try{return JSON.parse(re)}catch(en){if(ot)throw en.name==="SyntaxError"?xr.from(en,xr.ERR_BAD_RESPONSE,this,null,this.response):en}}return re}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:le.classes.FormData,Blob:le.classes.Blob},validateStatus:function(re){return re>=200&&re<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};gt.forEach(["delete","get","head","post","put","patch"],J=>{xe.headers[J]={}});const Ne=xe,Ee=gt.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Oe=J=>{const re={};let Se,ke,Ue;return J&&J.split(`
`).forEach(function(ot){Ue=ot.indexOf(":"),Se=ot.substring(0,Ue).trim().toLowerCase(),ke=ot.substring(Ue+1).trim(),!(!Se||re[Se]&&Ee[Se])&&(Se==="set-cookie"?re[Se]?re[Se].push(ke):re[Se]=[ke]:re[Se]=re[Se]?re[Se]+", "+ke:ke)}),re},Be=Symbol("internals");function et(J){return J&&String(J).trim().toLowerCase()}function dt(J){return J===!1||J==null?J:gt.isArray(J)?J.map(dt):String(J)}function bt(J){const re=Object.create(null),Se=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let ke;for(;ke=Se.exec(J);)re[ke[1]]=ke[2];return re}const ft=J=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(J.trim());function pt(J,re,Se,ke,Ue){if(gt.isFunction(ke))return ke.call(this,re,Se);if(Ue&&(re=Se),!!gt.isString(re)){if(gt.isString(ke))return re.indexOf(ke)!==-1;if(gt.isRegExp(ke))return ke.test(re)}}function _t(J){return J.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(re,Se,ke)=>Se.toUpperCase()+ke)}function Kt(J,re){const Se=gt.toCamelCase(" "+re);["get","set","has"].forEach(ke=>{Object.defineProperty(J,ke+Se,{value:function(Ue,lt,ot){return this[ke].call(this,re,Ue,lt,ot)},configurable:!0})})}class fn{constructor(re){re&&this.set(re)}set(re,Se,ke){const Ue=this;function lt(en,or,Tn){const $n=et(or);if(!$n)throw new Error("header name must be a non-empty string");const vr=gt.findKey(Ue,$n);(!vr||Ue[vr]===void 0||Tn===!0||Tn===void 0&&Ue[vr]!==!1)&&(Ue[vr||or]=dt(en))}const ot=(en,or)=>gt.forEach(en,(Tn,$n)=>lt(Tn,$n,or));if(gt.isPlainObject(re)||re instanceof this.constructor)ot(re,Se);else if(gt.isString(re)&&(re=re.trim())&&!ft(re))ot(Oe(re),Se);else if(gt.isHeaders(re))for(const[en,or]of re.entries())lt(or,en,ke);else re!=null&&lt(Se,re,ke);return this}get(re,Se){if(re=et(re),re){const ke=gt.findKey(this,re);if(ke){const Ue=this[ke];if(!Se)return Ue;if(Se===!0)return bt(Ue);if(gt.isFunction(Se))return Se.call(this,Ue,ke);if(gt.isRegExp(Se))return Se.exec(Ue);throw new TypeError("parser must be boolean|regexp|function")}}}has(re,Se){if(re=et(re),re){const ke=gt.findKey(this,re);return!!(ke&&this[ke]!==void 0&&(!Se||pt(this,this[ke],ke,Se)))}return!1}delete(re,Se){const ke=this;let Ue=!1;function lt(ot){if(ot=et(ot),ot){const en=gt.findKey(ke,ot);en&&(!Se||pt(ke,ke[en],en,Se))&&(delete ke[en],Ue=!0)}}return gt.isArray(re)?re.forEach(lt):lt(re),Ue}clear(re){const Se=Object.keys(this);let ke=Se.length,Ue=!1;for(;ke--;){const lt=Se[ke];(!re||pt(this,this[lt],lt,re,!0))&&(delete this[lt],Ue=!0)}return Ue}normalize(re){const Se=this,ke={};return gt.forEach(this,(Ue,lt)=>{const ot=gt.findKey(ke,lt);if(ot){Se[ot]=dt(Ue),delete Se[lt];return}const en=re?_t(lt):String(lt).trim();en!==lt&&delete Se[lt],Se[en]=dt(Ue),ke[en]=!0}),this}concat(...re){return this.constructor.concat(this,...re)}toJSON(re){const Se=Object.create(null);return gt.forEach(this,(ke,Ue)=>{ke!=null&&ke!==!1&&(Se[Ue]=re&&gt.isArray(ke)?ke.join(", "):ke)}),Se}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([re,Se])=>re+": "+Se).join(`
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(re){return re instanceof this?re:new this(re)}static concat(re,...Se){const ke=new this(re);return Se.forEach(Ue=>ke.set(Ue)),ke}static accessor(re){const ke=(this[Be]=this[Be]={accessors:{}}).accessors,Ue=this.prototype;function lt(ot){const en=et(ot);ke[en]||(Kt(Ue,ot),ke[en]=!0)}return gt.isArray(re)?re.forEach(lt):lt(re),this}}fn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),gt.reduceDescriptors(fn.prototype,({value:J},re)=>{let Se=re[0].toUpperCase()+re.slice(1);return{get:()=>J,set(ke){this[Se]=ke}}}),gt.freezeMethods(fn);const hn=fn;function In(J,re){const Se=this||Ne,ke=re||Se,Ue=hn.from(ke.headers);let lt=ke.data;return gt.forEach(J,function(en){lt=en.call(Se,lt,Ue.normalize(),re?re.status:void 0)}),Ue.normalize(),lt}function lr(J){return!!(J&&J.__CANCEL__)}function Gn(J,re,Se){xr.call(this,J??"canceled",xr.ERR_CANCELED,re,Se),this.name="CanceledError"}gt.inherits(Gn,xr,{__CANCEL__:!0});const Mn=Gn;function gr(J,re,Se){const ke=Se.config.validateStatus;!Se.status||!ke||ke(Se.status)?J(Se):re(new xr("Request failed with status code "+Se.status,[xr.ERR_BAD_REQUEST,xr.ERR_BAD_RESPONSE][Math.floor(Se.status/100)-4],Se.config,Se.request,Se))}function er(J){const re=/^([-+\w]{1,25})(:?\/\/|:)/.exec(J);return re&&re[1]||""}function _r(J,re){J=J||10;const Se=new Array(J),ke=new Array(J);let Ue=0,lt=0,ot;return re=re!==void 0?re:1e3,function(or){const Tn=Date.now(),$n=ke[lt];ot||(ot=Tn),Se[Ue]=or,ke[Ue]=Tn;let vr=lt,ks=0;for(;vr!==Ue;)ks+=Se[vr++],vr=vr%J;if(Ue=(Ue+1)%J,Ue===lt&&(lt=(lt+1)%J),Tn-ot<re)return;const Ea=$n&&Tn-$n;return Ea?Math.round(ks*1e3/Ea):void 0}}const vs=_r;function ys(J,re){let Se=0,ke=1e3/re,Ue,lt;const ot=(Tn,$n=Date.now())=>{Se=$n,Ue=null,lt&&(clearTimeout(lt),lt=null),J.apply(null,Tn)};return[(...Tn)=>{const $n=Date.now(),vr=$n-Se;vr>=ke?ot(Tn,$n):(Ue=Tn,lt||(lt=setTimeout(()=>{lt=null,ot(Ue)},ke-vr)))},()=>Ue&&ot(Ue)]}const ro=ys,qs=(J,re,Se=3)=>{let ke=0;const Ue=vs(50,250);return ro(lt=>{const ot=lt.loaded,en=lt.lengthComputable?lt.total:void 0,or=ot-ke,Tn=Ue(or),$n=ot<=en;ke=ot;const vr={loaded:ot,total:en,progress:en?ot/en:void 0,bytes:or,rate:Tn||void 0,estimated:Tn&&en&&$n?(en-ot)/Tn:void 0,event:lt,lengthComputable:en!=null,[re?"download":"upload"]:!0};J(vr)},Se)},hs=(J,re)=>{const Se=J!=null;return[ke=>re[0]({lengthComputable:Se,total:J,loaded:ke}),re[1]]},Ks=J=>(...re)=>gt.asap(()=>J(...re)),os=le.hasStandardBrowserEnv?function(){const re=le.navigator&&/(msie|trident)/i.test(le.navigator.userAgent),Se=document.createElement("a");let ke;function Ue(lt){let ot=lt;return re&&(Se.setAttribute("href",ot),ot=Se.href),Se.setAttribute("href",ot),{href:Se.href,protocol:Se.protocol?Se.protocol.replace(/:$/,""):"",host:Se.host,search:Se.search?Se.search.replace(/^\?/,""):"",hash:Se.hash?Se.hash.replace(/^#/,""):"",hostname:Se.hostname,port:Se.port,pathname:Se.pathname.charAt(0)==="/"?Se.pathname:"/"+Se.pathname}}return ke=Ue(window.location.href),function(ot){const en=gt.isString(ot)?Ue(ot):ot;return en.protocol===ke.protocol&&en.host===ke.host}}():function(){return function(){return!0}}(),Gs=le.hasStandardBrowserEnv?{write(J,re,Se,ke,Ue,lt){const ot=[J+"="+encodeURIComponent(re)];gt.isNumber(Se)&&ot.push("expires="+new Date(Se).toGMTString()),gt.isString(ke)&&ot.push("path="+ke),gt.isString(Ue)&&ot.push("domain="+Ue),lt===!0&&ot.push("secure"),document.cookie=ot.join("; ")},read(J){const re=document.cookie.match(new RegExp("(^|;\\s*)("+J+")=([^;]*)"));return re?decodeURIComponent(re[3]):null},remove(J){this.write(J,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Ar(J){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(J)}function bo(J,re){return re?J.replace(/\/?\/$/,"")+"/"+re.replace(/^\/+/,""):J}function io(J,re){return J&&!Ar(re)?bo(J,re):re}const ho=J=>J instanceof hn?{...J}:J;function $o(J,re){re=re||{};const Se={};function ke(Tn,$n,vr){return gt.isPlainObject(Tn)&&gt.isPlainObject($n)?gt.merge.call({caseless:vr},Tn,$n):gt.isPlainObject($n)?gt.merge({},$n):gt.isArray($n)?$n.slice():$n}function Ue(Tn,$n,vr){if(gt.isUndefined($n)){if(!gt.isUndefined(Tn))return ke(void 0,Tn,vr)}else return ke(Tn,$n,vr)}function lt(Tn,$n){if(!gt.isUndefined($n))return ke(void 0,$n)}function ot(Tn,$n){if(gt.isUndefined($n)){if(!gt.isUndefined(Tn))return ke(void 0,Tn)}else return ke(void 0,$n)}function en(Tn,$n,vr){if(vr in re)return ke(Tn,$n);if(vr in J)return ke(void 0,Tn)}const or={url:lt,method:lt,data:lt,baseURL:ot,transformRequest:ot,transformResponse:ot,paramsSerializer:ot,timeout:ot,timeoutMessage:ot,withCredentials:ot,withXSRFToken:ot,adapter:ot,responseType:ot,xsrfCookieName:ot,xsrfHeaderName:ot,onUploadProgress:ot,onDownloadProgress:ot,decompress:ot,maxContentLength:ot,maxBodyLength:ot,beforeRedirect:ot,transport:ot,httpAgent:ot,httpsAgent:ot,cancelToken:ot,socketPath:ot,responseEncoding:ot,validateStatus:en,headers:(Tn,$n)=>Ue(ho(Tn),ho($n),!0)};return gt.forEach(Object.keys(Object.assign({},J,re)),function($n){const vr=or[$n]||Ue,ks=vr(J[$n],re[$n],$n);gt.isUndefined(ks)&&vr!==en||(Se[$n]=ks)}),Se}const Ka=J=>{const re=$o({},J);let{data:Se,withXSRFToken:ke,xsrfHeaderName:Ue,xsrfCookieName:lt,headers:ot,auth:en}=re;re.headers=ot=hn.from(ot),re.url=Mo(io(re.baseURL,re.url),J.params,J.paramsSerializer),en&&ot.set("Authorization","Basic "+btoa((en.username||"")+":"+(en.password?unescape(encodeURIComponent(en.password)):"")));let or;if(gt.isFormData(Se)){if(le.hasStandardBrowserEnv||le.hasStandardBrowserWebWorkerEnv)ot.setContentType(void 0);else if((or=ot.getContentType())!==!1){const[Tn,...$n]=or?or.split(";").map(vr=>vr.trim()).filter(Boolean):[];ot.setContentType([Tn||"multipart/form-data",...$n].join("; "))}}if(le.hasStandardBrowserEnv&&(ke&&gt.isFunction(ke)&&(ke=ke(re)),ke||ke!==!1&&os(re.url))){const Tn=Ue&&lt&&Gs.read(lt);Tn&&ot.set(Ue,Tn)}return re},Ma=typeof XMLHttpRequest<"u"&&function(J){return new Promise(function(Se,ke){const Ue=Ka(J);let lt=Ue.data;const ot=hn.from(Ue.headers).normalize();let{responseType:en,onUploadProgress:or,onDownloadProgress:Tn}=Ue,$n,vr,ks,Ea,Mr;function ms(){Ea&&Ea(),Mr&&Mr(),Ue.cancelToken&&Ue.cancelToken.unsubscribe($n),Ue.signal&&Ue.signal.removeEventListener("abort",$n)}let Pr=new XMLHttpRequest;Pr.open(Ue.method.toUpperCase(),Ue.url,!0),Pr.timeout=Ue.timeout;function Qs(){if(!Pr)return;const zo=hn.from("getAllResponseHeaders"in Pr&&Pr.getAllResponseHeaders()),La={data:!en||en==="text"||en==="json"?Pr.responseText:Pr.response,status:Pr.status,statusText:Pr.statusText,headers:zo,config:J,request:Pr};gr(function(Ql){Se(Ql),ms()},function(Ql){ke(Ql),ms()},La),Pr=null}"onloadend"in Pr?Pr.onloadend=Qs:Pr.onreadystatechange=function(){!Pr||Pr.readyState!==4||Pr.status===0&&!(Pr.responseURL&&Pr.responseURL.indexOf("file:")===0)||setTimeout(Qs)},Pr.onabort=function(){Pr&&(ke(new xr("Request aborted",xr.ECONNABORTED,J,Pr)),Pr=null)},Pr.onerror=function(){ke(new xr("Network Error",xr.ERR_NETWORK,J,Pr)),Pr=null},Pr.ontimeout=function(){let Nc=Ue.timeout?"timeout of "+Ue.timeout+"ms exceeded":"timeout exceeded";const La=Ue.transitional||Wn;Ue.timeoutErrorMessage&&(Nc=Ue.timeoutErrorMessage),ke(new xr(Nc,La.clarifyTimeoutError?xr.ETIMEDOUT:xr.ECONNABORTED,J,Pr)),Pr=null},lt===void 0&&ot.setContentType(null),"setRequestHeader"in Pr&&gt.forEach(ot.toJSON(),function(Nc,La){Pr.setRequestHeader(La,Nc)}),gt.isUndefined(Ue.withCredentials)||(Pr.withCredentials=!!Ue.withCredentials),en&&en!=="json"&&(Pr.responseType=Ue.responseType),Tn&&([ks,Mr]=qs(Tn,!0),Pr.addEventListener("progress",ks)),or&&Pr.upload&&([vr,Ea]=qs(or),Pr.upload.addEventListener("progress",vr),Pr.upload.addEventListener("loadend",Ea)),(Ue.cancelToken||Ue.signal)&&($n=zo=>{Pr&&(ke(!zo||zo.type?new Mn(null,J,Pr):zo),Pr.abort(),Pr=null)},Ue.cancelToken&&Ue.cancelToken.subscribe($n),Ue.signal&&(Ue.signal.aborted?$n():Ue.signal.addEventListener("abort",$n)));const Fo=er(Ue.url);if(Fo&&le.protocols.indexOf(Fo)===-1){ke(new xr("Unsupported protocol "+Fo+":",xr.ERR_BAD_REQUEST,J));return}Pr.send(lt||null)})},Qo=(J,re)=>{const{length:Se}=J=J?J.filter(Boolean):[];if(re||Se){let ke=new AbortController,Ue;const lt=function(Tn){if(!Ue){Ue=!0,en();const $n=Tn instanceof Error?Tn:this.reason;ke.abort($n instanceof xr?$n:new Mn($n instanceof Error?$n.message:$n))}};let ot=re&&setTimeout(()=>{ot=null,lt(new xr(`timeout ${re} of ms exceeded`,xr.ETIMEDOUT))},re);const en=()=>{J&&(ot&&clearTimeout(ot),ot=null,J.forEach(Tn=>{Tn.unsubscribe?Tn.unsubscribe(lt):Tn.removeEventListener("abort",lt)}),J=null)};J.forEach(Tn=>Tn.addEventListener("abort",lt));const{signal:or}=ke;return or.unsubscribe=()=>gt.asap(en),or}},so=function*(J,re){let Se=J.byteLength;if(!re||Se<re){yield J;return}let ke=0,Ue;for(;ke<Se;)Ue=ke+re,yield J.slice(ke,Ue),ke=Ue},pa=async function*(J,re){for await(const Se of di(J))yield*so(Se,re)},di=async function*(J){if(J[Symbol.asyncIterator]){yield*J;return}const re=J.getReader();try{for(;;){const{done:Se,value:ke}=await re.read();if(Se)break;yield ke}}finally{await re.cancel()}},Ce=(J,re,Se,ke)=>{const Ue=pa(J,re);let lt=0,ot,en=or=>{ot||(ot=!0,ke&&ke(or))};return new ReadableStream({async pull(or){try{const{done:Tn,value:$n}=await Ue.next();if(Tn){en(),or.close();return}let vr=$n.byteLength;if(Se){let ks=lt+=vr;Se(ks)}or.enqueue(new Uint8Array($n))}catch(Tn){throw en(Tn),Tn}},cancel(or){return en(or),Ue.return()}},{highWaterMark:2})},I=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",$a=I&&typeof ReadableStream=="function",Yo=I&&(typeof TextEncoder=="function"?(J=>re=>J.encode(re))(new TextEncoder):async J=>new Uint8Array(await new Response(J).arrayBuffer())),ko=(J,...re)=>{try{return!!J(...re)}catch{return!1}},Ud=$a&&ko(()=>{let J=!1;const re=new Request(le.origin,{body:new ReadableStream,method:"POST",get duplex(){return J=!0,"half"}}).headers.has("Content-Type");return J&&!re}),yu=64*1024,_i=$a&&ko(()=>gt.isReadableStream(new Response("").body)),Cc={stream:_i&&(J=>J.body)};I&&(J=>{["text","arrayBuffer","blob","formData","stream"].forEach(re=>{!Cc[re]&&(Cc[re]=gt.isFunction(J[re])?Se=>Se[re]():(Se,ke)=>{throw new xr(`Response type '${re}' is not supported`,xr.ERR_NOT_SUPPORT,ke)})})})(new Response);const cr=async J=>{if(J==null)return 0;if(gt.isBlob(J))return J.size;if(gt.isSpecCompliantForm(J))return(await new Request(le.origin,{method:"POST",body:J}).arrayBuffer()).byteLength;if(gt.isArrayBufferView(J)||gt.isArrayBuffer(J))return J.byteLength;if(gt.isURLSearchParams(J)&&(J=J+""),gt.isString(J))return(await Yo(J)).byteLength},tt=async(J,re)=>{const Se=gt.toFiniteNumber(J.getContentLength());return Se??cr(re)},Fn={http:no,xhr:Ma,fetch:I&&(async J=>{let{url:re,method:Se,data:ke,signal:Ue,cancelToken:lt,timeout:ot,onDownloadProgress:en,onUploadProgress:or,responseType:Tn,headers:$n,withCredentials:vr="same-origin",fetchOptions:ks}=Ka(J);Tn=Tn?(Tn+"").toLowerCase():"text";let Ea=Qo([Ue,lt&&lt.toAbortSignal()],ot),Mr;const ms=Ea&&Ea.unsubscribe&&(()=>{Ea.unsubscribe()});let Pr;try{if(or&&Ud&&Se!=="get"&&Se!=="head"&&(Pr=await tt($n,ke))!==0){let La=new Request(re,{method:"POST",body:ke,duplex:"half"}),ma;if(gt.isFormData(ke)&&(ma=La.headers.get("content-type"))&&$n.setContentType(ma),La.body){const[Ql,_u]=hs(Pr,qs(Ks(or)));ke=Ce(La.body,yu,Ql,_u)}}gt.isString(vr)||(vr=vr?"include":"omit");const Qs="credentials"in Request.prototype;Mr=new Request(re,{...ks,signal:Ea,method:Se.toUpperCase(),headers:$n.normalize().toJSON(),body:ke,duplex:"half",credentials:Qs?vr:void 0});let Fo=await fetch(Mr);const zo=_i&&(Tn==="stream"||Tn==="response");if(_i&&(en||zo&&ms)){const La={};["status","statusText","headers"].forEach(Su=>{La[Su]=Fo[Su]});const ma=gt.toFiniteNumber(Fo.headers.get("content-length")),[Ql,_u]=en&&hs(ma,qs(Ks(en),!0))||[];Fo=new Response(Ce(Fo.body,yu,Ql,()=>{_u&&_u(),ms&&ms()}),La)}Tn=Tn||"text";let Nc=await Cc[gt.findKey(Cc,Tn)||"text"](Fo,J);return!zo&&ms&&ms(),await new Promise((La,ma)=>{gr(La,ma,{data:Nc,headers:hn.from(Fo.headers),status:Fo.status,statusText:Fo.statusText,config:J,request:Mr})})}catch(Qs){throw ms&&ms(),Qs&&Qs.name==="TypeError"&&/fetch/i.test(Qs.message)?Object.assign(new xr("Network Error",xr.ERR_NETWORK,J,Mr),{cause:Qs.cause||Qs}):xr.from(Qs,Qs&&Qs.code,J,Mr)}})};gt.forEach(Fn,(J,re)=>{if(J){try{Object.defineProperty(J,"name",{value:re})}catch{}Object.defineProperty(J,"adapterName",{value:re})}});const Ur=J=>`- ${J}`,ha=J=>gt.isFunction(J)||J===null||J===!1,Ro={getAdapter:J=>{J=gt.isArray(J)?J:[J];const{length:re}=J;let Se,ke;const Ue={};for(let lt=0;lt<re;lt++){Se=J[lt];let ot;if(ke=Se,!ha(Se)&&(ke=Fn[(ot=String(Se)).toLowerCase()],ke===void 0))throw new xr(`Unknown adapter '${ot}'`);if(ke)break;Ue[ot||"#"+lt]=ke}if(!ke){const lt=Object.entries(Ue).map(([en,or])=>`adapter ${en} `+(or===!1?"is not supported by the environment":"is not available in the build"));let ot=re?lt.length>1?`since :
`+lt.map(Ur).join(`
`):" "+Ur(lt[0]):"as no adapter specified";throw new xr("There is no suitable adapter to dispatch the request "+ot,"ERR_NOT_SUPPORT")}return ke},adapters:Fn};function aa(J){if(J.cancelToken&&J.cancelToken.throwIfRequested(),J.signal&&J.signal.aborted)throw new Mn(null,J)}function Po(J){return aa(J),J.headers=hn.from(J.headers),J.data=In.call(J,J.transformRequest),["post","put","patch"].indexOf(J.method)!==-1&&J.headers.setContentType("application/x-www-form-urlencoded",!1),Ro.getAdapter(J.adapter||Ne.adapter)(J).then(function(ke){return aa(J),ke.data=In.call(J,J.transformResponse,ke),ke.headers=hn.from(ke.headers),ke},function(ke){return lr(ke)||(aa(J),ke&&ke.response&&(ke.response.data=In.call(J,J.transformResponse,ke.response),ke.response.headers=hn.from(ke.response.headers))),Promise.reject(ke)})}const rl="1.7.7",mo={};["object","boolean","number","function","string","symbol"].forEach((J,re)=>{mo[J]=function(ke){return typeof ke===J||"a"+(re<1?"n ":" ")+J}});const fi={};mo.transitional=function(re,Se,ke){function Ue(lt,ot){return"[Axios v"+rl+"] Transitional option '"+lt+"'"+ot+(ke?". "+ke:"")}return(lt,ot,en)=>{if(re===!1)throw new xr(Ue(ot," has been removed"+(Se?" in "+Se:"")),xr.ERR_DEPRECATED);return Se&&!fi[ot]&&(fi[ot]=!0,console.warn(Ue(ot," has been deprecated since v"+Se+" and will be removed in the near future"))),re?re(lt,ot,en):!0}};function Wl(J,re,Se){if(typeof J!="object")throw new xr("options must be an object",xr.ERR_BAD_OPTION_VALUE);const ke=Object.keys(J);let Ue=ke.length;for(;Ue-- >0;){const lt=ke[Ue],ot=re[lt];if(ot){const en=J[lt],or=en===void 0||ot(en,lt,J);if(or!==!0)throw new xr("option "+lt+" must be "+or,xr.ERR_BAD_OPTION_VALUE);continue}if(Se!==!0)throw new xr("Unknown option "+lt,xr.ERR_BAD_OPTION)}}const Ec={assertOptions:Wl,validators:mo},sl=Ec.validators;class ql{constructor(re){this.defaults=re,this.interceptors={request:new ui,response:new ui}}async request(re,Se){try{return await this._request(re,Se)}catch(ke){if(ke instanceof Error){let Ue;Error.captureStackTrace?Error.captureStackTrace(Ue={}):Ue=new Error;const lt=Ue.stack?Ue.stack.replace(/^.+\n/,""):"";try{ke.stack?lt&&!String(ke.stack).endsWith(lt.replace(/^.+\n.+\n/,""))&&(ke.stack+=`
`+lt):ke.stack=lt}catch{}}throw ke}}_request(re,Se){typeof re=="string"?(Se=Se||{},Se.url=re):Se=re||{},Se=$o(this.defaults,Se);const{transitional:ke,paramsSerializer:Ue,headers:lt}=Se;ke!==void 0&&Ec.assertOptions(ke,{silentJSONParsing:sl.transitional(sl.boolean),forcedJSONParsing:sl.transitional(sl.boolean),clarifyTimeoutError:sl.transitional(sl.boolean)},!1),Ue!=null&&(gt.isFunction(Ue)?Se.paramsSerializer={serialize:Ue}:Ec.assertOptions(Ue,{encode:sl.function,serialize:sl.function},!0)),Se.method=(Se.method||this.defaults.method||"get").toLowerCase();let ot=lt&&gt.merge(lt.common,lt[Se.method]);lt&&gt.forEach(["delete","get","head","post","put","patch","common"],Mr=>{delete lt[Mr]}),Se.headers=hn.concat(ot,lt);const en=[];let or=!0;this.interceptors.request.forEach(function(ms){typeof ms.runWhen=="function"&&ms.runWhen(Se)===!1||(or=or&&ms.synchronous,en.unshift(ms.fulfilled,ms.rejected))});const Tn=[];this.interceptors.response.forEach(function(ms){Tn.push(ms.fulfilled,ms.rejected)});let $n,vr=0,ks;if(!or){const Mr=[Po.bind(this),void 0];for(Mr.unshift.apply(Mr,en),Mr.push.apply(Mr,Tn),ks=Mr.length,$n=Promise.resolve(Se);vr<ks;)$n=$n.then(Mr[vr++],Mr[vr++]);return $n}ks=en.length;let Ea=Se;for(vr=0;vr<ks;){const Mr=en[vr++],ms=en[vr++];try{Ea=Mr(Ea)}catch(Pr){ms.call(this,Pr);break}}try{$n=Po.call(this,Ea)}catch(Mr){return Promise.reject(Mr)}for(vr=0,ks=Tn.length;vr<ks;)$n=$n.then(Tn[vr++],Tn[vr++]);return $n}getUri(re){re=$o(this.defaults,re);const Se=io(re.baseURL,re.url);return Mo(Se,re.params,re.paramsSerializer)}}gt.forEach(["delete","get","head","options"],function(re){ql.prototype[re]=function(Se,ke){return this.request($o(ke||{},{method:re,url:Se,data:(ke||{}).data}))}}),gt.forEach(["post","put","patch"],function(re){function Se(ke){return function(lt,ot,en){return this.request($o(en||{},{method:re,headers:ke?{"Content-Type":"multipart/form-data"}:{},url:lt,data:ot}))}}ql.prototype[re]=Se(),ql.prototype[re+"Form"]=Se(!0)});const Kl=ql;class Gl{constructor(re){if(typeof re!="function")throw new TypeError("executor must be a function.");let Se;this.promise=new Promise(function(lt){Se=lt});const ke=this;this.promise.then(Ue=>{if(!ke._listeners)return;let lt=ke._listeners.length;for(;lt-- >0;)ke._listeners[lt](Ue);ke._listeners=null}),this.promise.then=Ue=>{let lt;const ot=new Promise(en=>{ke.subscribe(en),lt=en}).then(Ue);return ot.cancel=function(){ke.unsubscribe(lt)},ot},re(function(lt,ot,en){ke.reason||(ke.reason=new Mn(lt,ot,en),Se(ke.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(re){if(this.reason){re(this.reason);return}this._listeners?this._listeners.push(re):this._listeners=[re]}unsubscribe(re){if(!this._listeners)return;const Se=this._listeners.indexOf(re);Se!==-1&&this._listeners.splice(Se,1)}toAbortSignal(){const re=new AbortController,Se=ke=>{re.abort(ke)};return this.subscribe(Se),re.signal.unsubscribe=()=>this.unsubscribe(Se),re.signal}static source(){let re;return{token:new Gl(function(Ue){re=Ue}),cancel:re}}}const ti=Gl;function Yc(J){return function(Se){return J.apply(null,Se)}}function Bd(J){return gt.isObject(J)&&J.isAxiosError===!0}const Tc={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Tc).forEach(([J,re])=>{Tc[re]=J});const eh=Tc;function Xu(J){const re=new Kl(J),Se=W(Kl.prototype.request,re);return gt.extend(Se,Kl.prototype,re,{allOwnKeys:!0}),gt.extend(Se,re,null,{allOwnKeys:!0}),Se.create=function(Ue){return Xu($o(J,Ue))},Se}const go=Xu(Ne);go.Axios=Kl,go.CanceledError=Mn,go.CancelToken=ti,go.isCancel=lr,go.VERSION=rl,go.toFormData=Ls,go.AxiosError=xr,go.Cancel=go.CanceledError,go.all=function(re){return Promise.all(re)},go.spread=Yc,go.isAxiosError=Bd,go.mergeConfig=$o,go.AxiosHeaders=hn,go.formToJSON=J=>Ve(gt.isHTMLForm(J)?new FormData(J):J),go.getAdapter=Ro.getAdapter,go.HttpStatusCode=eh,go.default=go;const kc=go;var Oo=se(1642),Qf=se(6194),th=se(5734),pi=se(9052),Mm=se(6419),bu=se(1993),Rc=se(1520);const Lo={UNAUTHORIZED:401,FORBIDDEN:403,NOT_FOUND:404},Pc=Object.values(Lo),$m={[Lo.UNAUTHORIZED]:{status:Lo.UNAUTHORIZED,adminLocation:pi._.AdminUnauthorizedAccess,nonAdminLocation:pi._.UnauthorizedAccess},[Lo.FORBIDDEN]:{status:Lo.FORBIDDEN,adminLocation:pi._.AdminForbiddenAccess,nonAdminLocation:pi._.ForbiddenAccess},[Lo.NOT_FOUND]:{status:Lo.NOT_FOUND,adminLocation:pi._.AdminNotFound,nonAdminLocation:pi._.NotFound}},Oc=(J,re)=>{const Se=$m[J],ke=window.location.href;Se.status===Lo.UNAUTHORIZED&&re?.includes(window.location.pathname)||(document.location=ke.includes(pi._.Admin)?Se.adminLocation:Se.nonAdminLocation)},Yf="skip404",Vd=J=>({...J,headers:{[Yf]:!0}}),ni=J=>{const re={[Yf]:404},Se=[];return J&&Object.entries(re).forEach(([ke,Ue])=>{J.has(ke)&&J.get(ke)&&Se.push(Ue)}),Se};let Xc=[];const Zu=()=>new Te.E({queryCache:new ae.$({onError:(J,re)=>{if(re?.meta?.errorMessage){(0,bu.A2)(re?.meta?.errorMessage);return}return(0,bu.JA)(J)}}),mutationCache:new ie.q({onError:(J,re,Se,ke)=>{if(ke?.options?.onError)return null;(0,bu.JA)(J)}})}),wu=({api:J,whiteListed401Paths:re=[]})=>{const Se=kc.create({baseURL:J.url,timeout:3e4,withCredentials:J.includeCredentials}),ke=Zu();return Se.interceptors.request.use(Ue=>(Ue.headers.set("Accept-Language",Oo.Ay.language??Mm.T.EN),Ue)),Se.interceptors.response.use(Ue=>Ue,async Ue=>{if(!Ue||typeof window>"u")return;if((0,th.y1)(Ue))return await ed(ke);const ot=Ue.response?Ue.response.status:null;throw ot&&Pc.includes(ot)&&!ni(Ue?.config?.headers).some(en=>en===ot)&&Oc(ot,re),Ue}),Xc=re,Rc.eh.axios=Se,ke},xu=()=>!Xc.includes(window.location.pathname)&&Hd(),nh=[pi._.AdminForbiddenAccess.toString(),pi._.AdminNotFound.toString(),pi._.AdminUnauthorizedAccess.toString(),pi._.ForbiddenAccess.toString(),pi._.NotFound.toString(),pi._.UnauthorizedAccess.toString(),pi._.InternalError.toString()],Hd=()=>!nh.includes(window.location.pathname),Ju=(J,re,Se)=>{(0,Qf.useEffect)(()=>{re&&(async()=>{await Se.invalidateQueries(J)})().catch(console.error)},[Se,re,J])},ed=async J=>{await J.cancelQueries(),J.removeQueries(),J.clear()};var Lm=se(276),zi=se(5167)},1048:(a,l,se)=>{"use strict";se.d(l,{useCurrentUser:()=>Z});var we=se(2215),Te=se(9387),ae=se(1520),ie=se(6664);const W=U=>U?{id:U?.id??"",createdAt:U?.createdAt,email:U?.email,firstName:U?.firstName,lastName:U?.lastName,lastSeen:U?.lastSeen,jobTitle:U?.jobTitle,updatedAt:U?.updatedAt,isResellerAdminOrInternalAdmin:U.roles?.some(({userRole:ge})=>ge===ae.gG.InternalAdmin||ge===ae.gG.ResellerAdmin)??!1,roles:U?.roles?.map(ge=>({id:ge.id,organizationId:ge.organizationId,resellerId:ge.resellerId,userRole:ie.X[ge.userRole]}))}:null;var ee=se(9269);const q={queryKey:()=>["currentUser"],queryFn:async()=>await ee.g.getCurrentUserAsync(),staleTime:10*60*1e3},Z=({...U}={})=>{const{isLoggedIn:ge}=(0,Te.m)(),{data:ne,isLoading:ve,isFetching:V,...te}=(0,we.I)({queryKey:q.queryKey(),queryFn:async()=>await q.queryFn(),enabled:ge,staleTime:q.staleTime});return{data:W(ne),isLoading:ve&&V,...te}}},1169:(a,l,se)=>{"use strict";se.d(l,{I:()=>Te});var we=se(1520);class Te{static getNotificationsConnectionData(ie={}){return new Promise((W,ee)=>{let q=we.Jp+"/Notifications/connection-data";const Z=(0,we.Y_)("get","application/json",q,ie);(0,we.pY)(Z,W,ee)})}static validateWebhook(ie={},W={}){return new Promise((ee,q)=>{let Z=we.Jp+"/Notifications/validate-webhook";const U=(0,we.Y_)("post","application/json",Z,W);let ge=ie.command;U.data=ge,(0,we.pY)(U,ee,q)})}}},9269:(a,l,se)=>{"use strict";se.d(l,{g:()=>Te});var we=se(1520);class Te{static getCurrentUserAsync(ie={}){return new Promise((W,ee)=>{let q=we.Jp+"/Users/current";const Z=(0,we.Y_)("get","application/json",q,ie);(0,we.pY)(Z,W,ee)})}static invite(ie={},W={}){return new Promise((ee,q)=>{let Z=we.Jp+"/Users/invite";const U=(0,we.Y_)("post","application/json",Z,W);let ge=ie.command;U.data=ge,(0,we.pY)(U,ee,q)})}static reInvite(ie={},W={}){return new Promise((ee,q)=>{let Z=we.Jp+"/Users/{emailAddress}/reinvite";Z=Z.replace("{emailAddress}",ie.emailAddress+"");const U=(0,we.Y_)("post","application/json",Z,W);let ge=ie.command;U.data=ge,(0,we.pY)(U,ee,q)})}static delete(ie={},W={}){return new Promise((ee,q)=>{let Z=we.Jp+"/Users";const U=(0,we.Y_)("delete","application/json",Z,W);let ge=ie.command;U.data=ge,(0,we.pY)(U,ee,q)})}}},1520:(a,l,se)=>{"use strict";se.d(l,{B_:()=>ei,CD:()=>$o,Eh:()=>ho,F2:()=>Qo,Jp:()=>ie,Lo:()=>bo,Re:()=>_r,Sj:()=>er,Sq:()=>pa,Sx:()=>Ar,Y_:()=>ae,ZN:()=>hs,_O:()=>Ks,aX:()=>so,cX:()=>ys,eh:()=>we,fC:()=>Fi,gG:()=>os,mV:()=>Gn,pY:()=>Te,pq:()=>Ka,ut:()=>Mn,yj:()=>Gs});const we={};function Te(Ce,I,$a){if(we.axios)return we.axios.request(Ce).then(Yo=>{I(Yo.data)}).catch(Yo=>{$a(Yo)});throw new Error("please inject yourself instance like axios  ")}function ae(Ce,I,$a,Yo){const ko={loading:we.loading,showError:we.showError,...Yo,method:Ce,url:$a};return ko.headers={...Yo.headers,"Content-Type":I},ko}const ie="";class W{items}class ee{totalCount;items}class q{id;sku;productName;description;commitmentType;billingCycle;status;commitmentEndDate;renewalDate;scheduledQuantity;quantity;organizationId;price;lastPendingOrFailedOrder;orderApprovalSettings;humanReadableId;committedMinimalQuantity;constructor(I={}){this.id=I.id,this.sku=I.sku,this.productName=I.productName,this.description=I.description,this.commitmentType=I.commitmentType,this.billingCycle=I.billingCycle,this.status=I.status,this.commitmentEndDate=I.commitmentEndDate,this.renewalDate=I.renewalDate,this.scheduledQuantity=I.scheduledQuantity,this.quantity=I.quantity,this.organizationId=I.organizationId,this.price=I.price,this.lastPendingOrFailedOrder=I.lastPendingOrFailedOrder,this.orderApprovalSettings=I.orderApprovalSettings,this.humanReadableId=I.humanReadableId,this.committedMinimalQuantity=I.committedMinimalQuantity}}class Z{amount;currency;constructor(I={}){this.amount=I.amount,this.currency=I.currency}}class U{orderId;status;createdAt;updatedAt;completedAt;quantity;error;initialQuantity;decisionNote;humanReadableId;constructor(I={}){this.orderId=I.orderId,this.status=I.status,this.createdAt=I.createdAt,this.updatedAt=I.updatedAt,this.completedAt=I.completedAt,this.quantity=I.quantity,this.error=I.error,this.initialQuantity=I.initialQuantity,this.decisionNote=I.decisionNote,this.humanReadableId=I.humanReadableId}}class ge{content;dismissed;constructor(I={}){this.content=I.content,this.dismissed=I.dismissed}}class ne{isOrderApprovalRequired;constructor(I={}){this.isOrderApprovalRequired=I.isOrderApprovalRequired}}class ve{constructor(I={}){}}class V{code;message;property;type;constructor(I={}){this.code=I.code,this.message=I.message,this.property=I.property,this.type=I.type}}class te{type;title;status;detail;instance;constructor(I={}){this.type=I.type,this.title=I.title,this.status=I.status,this.detail=I.detail,this.instance=I.instance}}class Re{organizationId;scheduledDate;orderLines;constructor(I={}){this.organizationId=I.organizationId,this.scheduledDate=I.scheduledDate,this.orderLines=I.orderLines}}class Ie{quantity;subscriptionId;constructor(I={}){this.quantity=I.quantity,this.subscriptionId=I.subscriptionId}}class $e{organizationId;orderLines;constructor(I={}){this.organizationId=I.organizationId,this.orderLines=I.orderLines}}class vt{orderId;subscriptionId;constructor(I={}){this.orderId=I.orderId,this.subscriptionId=I.subscriptionId}}class mt{organizationId;decision;decisionNote;orderIds;constructor(I={}){this.organizationId=I.organizationId,this.decision=I.decision,this.decisionNote=I.decisionNote,this.orderIds=I.orderIds}}class It{subscriberId;appId;connectionHash;constructor(I={}){this.subscriberId=I.subscriberId,this.appId=I.appId,this.connectionHash=I.connectionHash}}class qe{isValid;constructor(I={}){this.isValid=I.isValid}}class nn{webhookUrl;constructor(I={}){this.webhookUrl=I.webhookUrl}}class Ut{vendorName;accessible;lastSyncedOn;licenses;constructor(I={}){this.vendorName=I.vendorName,this.accessible=I.accessible,this.lastSyncedOn=I.lastSyncedOn,this.licenses=I.licenses}}class Xe{id;productName;availableQuantity;numberUsers;constructor(I={}){this.id=I.id,this.productName=I.productName,this.availableQuantity=I.availableQuantity,this.numberUsers=I.numberUsers}}class Ft{vendorName;domains;subscribers;constructor(I={}){this.vendorName=I.vendorName,this.domains=I.domains,this.subscribers=I.subscribers}}class rn{domain;isDefault;constructor(I={}){this.domain=I.domain,this.isDefault=I.isDefault}}class Vt{id;firstName;lastName;email;type;assignedLicenses;licenseUpdates;constructor(I={}){this.id=I.id,this.firstName=I.firstName,this.lastName=I.lastName,this.email=I.email,this.type=I.type,this.assignedLicenses=I.assignedLicenses,this.licenseUpdates=I.licenseUpdates}}class ze{licenseId;licenseUpdateId;updateStatus;constructor(I={}){this.licenseId=I.licenseId,this.licenseUpdateId=I.licenseUpdateId,this.updateStatus=I.updateStatus}}class je{currentUserLicenses;currentUserLicensesCount;isRecalculating;constructor(I={}){this.currentUserLicenses=I.currentUserLicenses,this.currentUserLicensesCount=I.currentUserLicensesCount,this.isRecalculating=I.isRecalculating}}class De{unusedLicenses;unusedLicensesCount;isRecalculating;constructor(I={}){this.unusedLicenses=I.unusedLicenses,this.unusedLicensesCount=I.unusedLicensesCount,this.isRecalculating=I.isRecalculating}}class ct{name;unusedLicenseCount;constructor(I={}){this.name=I.name,this.unusedLicenseCount=I.unusedLicenseCount}}class qt{licenseId;subscriberIdsOrUsersToBeAdded;subscriberIdsToBeRemoved;constructor(I={}){this.licenseId=I.licenseId,this.subscriberIdsOrUsersToBeAdded=I.subscriberIdsOrUsersToBeAdded,this.subscriberIdsToBeRemoved=I.subscriberIdsToBeRemoved}}class z{id;firstName;lastName;email;constructor(I={}){this.id=I.id,this.firstName=I.firstName,this.lastName=I.lastName,this.email=I.email}}class He{productName;subscriberName;licenseUpdateId;constructor(I={}){this.productName=I.productName,this.subscriberName=I.subscriberName,this.licenseUpdateId=I.licenseUpdateId}}class Ct{orderId;productName;createdOn;type;initialQuantity;requestedQuantity;orderStatus;humanReadableId;constructor(I={}){this.orderId=I.orderId,this.productName=I.productName,this.createdOn=I.createdOn,this.type=I.type,this.initialQuantity=I.initialQuantity,this.requestedQuantity=I.requestedQuantity,this.orderStatus=I.orderStatus,this.humanReadableId=I.humanReadableId}}class kt{orderId;orderType;createdAt;organizationName;userEmail;userFirstName;userLastName;orderStatus;organizationUniqueName;organizationId;decisionNote;humanReadableId;errorResult;value;items;constructor(I={}){this.orderId=I.orderId,this.orderType=I.orderType,this.createdAt=I.createdAt,this.organizationName=I.organizationName,this.userEmail=I.userEmail,this.userFirstName=I.userFirstName,this.userLastName=I.userLastName,this.orderStatus=I.orderStatus,this.organizationUniqueName=I.organizationUniqueName,this.organizationId=I.organizationId,this.decisionNote=I.decisionNote,this.humanReadableId=I.humanReadableId,this.errorResult=I.errorResult,this.value=I.value,this.items=I.items}}class Pe{detail;title;message;constructor(I={}){this.detail=I.detail,this.title=I.title,this.message=I.message}}class yt{quantity;productName;subscriptionId;price;subscriptionStatus;constructor(I={}){this.quantity=I.quantity,this.productName=I.productName,this.subscriptionId=I.subscriptionId,this.price=I.price,this.subscriptionStatus=I.subscriptionStatus}}class un{serviceProviderId;scheduledDate;orderItems;constructor(I={}){this.serviceProviderId=I.serviceProviderId,this.scheduledDate=I.scheduledDate,this.orderItems=I.orderItems}}class Rn{sku;productName;vendorId;vendorName;quantity;totalPrice;constructor(I={}){this.sku=I.sku,this.productName=I.productName,this.vendorId=I.vendorId,this.vendorName=I.vendorName,this.quantity=I.quantity,this.totalPrice=I.totalPrice}}class Yn{organizationId;organizationName;uniqueName;userCount;isSuspended;settings;constructor(I={}){this.organizationId=I.organizationId,this.organizationName=I.organizationName,this.uniqueName=I.uniqueName,this.userCount=I.userCount,this.isSuspended=I.isSuspended,this.settings=I.settings}}class nr{showHelpDesk;showSubscriptions;showUsers;showLicenses;showBilling;orgAdminCanCreateUsers;isPriceVisible;isOrderApprovalRequired;usesDefaultSettings;allowSubscriptionCancellation;constructor(I={}){this.showHelpDesk=I.showHelpDesk,this.showSubscriptions=I.showSubscriptions,this.showUsers=I.showUsers,this.showLicenses=I.showLicenses,this.showBilling=I.showBilling,this.orgAdminCanCreateUsers=I.orgAdminCanCreateUsers,this.isPriceVisible=I.isPriceVisible,this.isOrderApprovalRequired=I.isOrderApprovalRequired,this.usesDefaultSettings=I.usesDefaultSettings,this.allowSubscriptionCancellation=I.allowSubscriptionCancellation}}class rr{showHelpDesk;showSubscriptions;showUsers;showLicenses;showBilling;orgAdminCanCreateUsers;isPriceVisible;allowSubscriptionCancellation;isOrderApprovalRequired;constructor(I={}){this.showHelpDesk=I.showHelpDesk,this.showSubscriptions=I.showSubscriptions,this.showUsers=I.showUsers,this.showLicenses=I.showLicenses,this.showBilling=I.showBilling,this.orgAdminCanCreateUsers=I.orgAdminCanCreateUsers,this.isPriceVisible=I.isPriceVisible,this.allowSubscriptionCancellation=I.allowSubscriptionCancellation,this.isOrderApprovalRequired=I.isOrderApprovalRequired}}class ar{count;isRecalculating;constructor(I={}){this.count=I.count,this.isRecalculating=I.isRecalculating}}class wr{id;firstName;lastName;email;jobTitle;status;isVerified;createdAt;updatedAt;lastSeen;roles;preferredCulture;constructor(I={}){this.id=I.id,this.firstName=I.firstName,this.lastName=I.lastName,this.email=I.email,this.jobTitle=I.jobTitle,this.status=I.status,this.isVerified=I.isVerified,this.createdAt=I.createdAt,this.updatedAt=I.updatedAt,this.lastSeen=I.lastSeen,this.roles=I.roles,this.preferredCulture=I.preferredCulture}}class Ts{id;userRole;organizationId;resellerId;constructor(I={}){this.id=I.id,this.userRole=I.userRole,this.organizationId=I.organizationId,this.resellerId=I.resellerId}}class Zr{id;firstName;lastName;email;jobTitle;status;isVerified;createdAt;updatedAt;lastSeen;roles;preferredCulture;licenses;constructor(I={}){this.id=I.id,this.firstName=I.firstName,this.lastName=I.lastName,this.email=I.email,this.jobTitle=I.jobTitle,this.status=I.status,this.isVerified=I.isVerified,this.createdAt=I.createdAt,this.updatedAt=I.updatedAt,this.lastSeen=I.lastSeen,this.roles=I.roles,this.preferredCulture=I.preferredCulture,this.licenses=I.licenses}}class Bs{id;productName;constructor(I={}){this.id=I.id,this.productName=I.productName}}class rt{firstName;lastName;jobTitle;preferredCulture;role;constructor(I={}){this.firstName=I.firstName,this.lastName=I.lastName,this.jobTitle=I.jobTitle,this.preferredCulture=I.preferredCulture,this.role=I.role}}class zt{resellerName;name;shortName;resellerHostName;images;theme;themeColor;constructor(I={}){this.resellerName=I.resellerName,this.name=I.name,this.shortName=I.shortName,this.resellerHostName=I.resellerHostName,this.images=I.images,this.theme=I.theme,this.themeColor=I.themeColor}}class Hn{url;size;type;constructor(I={}){this.url=I.url,this.size=I.size,this.type=I.type}}class Nr{theme;hostName;logoHash;images;constructor(I={}){this.theme=I.theme,this.hostName=I.hostName,this.logoHash=I.logoHash,this.images=I.images}}class kr{type;url;size;constructor(I={}){this.type=I.type,this.url=I.url,this.size=I.size}}class Xn{id;name;isOnboarded;portalSettings;resellerSettings;supportInformation;orderSettings;constructor(I={}){this.id=I.id,this.name=I.name,this.isOnboarded=I.isOnboarded,this.portalSettings=I.portalSettings,this.resellerSettings=I.resellerSettings,this.supportInformation=I.supportInformation,this.orderSettings=I.orderSettings}}class Jt{priceVisible;isSubresellerShown;showSubscriptions;showUsers;showLicenses;showBilling;orgAdminCanCreateUsers;allowSubscriptionCancellation;constructor(I={}){this.priceVisible=I.priceVisible,this.isSubresellerShown=I.isSubresellerShown,this.showSubscriptions=I.showSubscriptions,this.showUsers=I.showUsers,this.showLicenses=I.showLicenses,this.showBilling=I.showBilling,this.orgAdminCanCreateUsers=I.orgAdminCanCreateUsers,this.allowSubscriptionCancellation=I.allowSubscriptionCancellation}}class Xt{address;email;phoneNumber;constructor(I={}){this.address=I.address,this.email=I.email,this.phoneNumber=I.phoneNumber}}class qn{isOrderApprovalRequired;teamsNotificationsEnabled;teamsIncomingWebhook;emailNotificationsEnabled;emailRecipientsList;constructor(I={}){this.isOrderApprovalRequired=I.isOrderApprovalRequired,this.teamsNotificationsEnabled=I.teamsNotificationsEnabled,this.teamsIncomingWebhook=I.teamsIncomingWebhook,this.emailNotificationsEnabled=I.emailNotificationsEnabled,this.emailRecipientsList=I.emailRecipientsList}}class bn{resellerId;theme;constructor(I={}){this.resellerId=I.resellerId,this.theme=I.theme}}class sr{id;name;description;serviceProviderId;vendorId;vendor;currency;isProductAvailable;categories;offers;constructor(I={}){this.id=I.id,this.name=I.name,this.description=I.description,this.serviceProviderId=I.serviceProviderId,this.vendorId=I.vendorId,this.vendor=I.vendor,this.currency=I.currency,this.isProductAvailable=I.isProductAvailable,this.categories=I.categories,this.offers=I.offers}}class Jn{slug;name;constructor(I={}){this.slug=I.slug,this.name=I.name}}class fs{sku;billingCycle;commitmentTermType;pricingModelType;price;constructor(I={}){this.sku=I.sku,this.billingCycle=I.billingCycle,this.commitmentTermType=I.commitmentTermType,this.pricingModelType=I.pricingModelType,this.price=I.price}}class Kn{foundProducts;page;total;products;facets;constructor(I={}){this.foundProducts=I.foundProducts,this.page=I.page,this.total=I.total,this.products=I.products,this.facets=I.facets}}class Ir{id;name;vendorId;vendor;startingPrice;categories;constructor(I={}){this.id=I.id,this.name=I.name,this.vendorId=I.vendorId,this.vendor=I.vendor,this.startingPrice=I.startingPrice,this.categories=I.categories}}class Rr{fieldName;countsByValue;constructor(I={}){this.fieldName=I.fieldName,this.countsByValue=I.countsByValue}}class pr{count;highlighted;value;constructor(I={}){this.count=I.count,this.highlighted=I.highlighted,this.value=I.value}}class Tr{organizationId;page;pageSize;query;sortBy;filters;constructor(I={}){this.organizationId=I.organizationId,this.page=I.page,this.pageSize=I.pageSize,this.query=I.query,this.sortBy=I.sortBy,this.filters=I.filters}}class gt{billingCycleFilter;commitmentTermFilter;vendorFilter;categoryFilter;constructor(I={}){this.billingCycleFilter=I.billingCycleFilter,this.commitmentTermFilter=I.commitmentTermFilter,this.vendorFilter=I.vendorFilter,this.categoryFilter=I.categoryFilter}}class _s{nextCallAvailableTime;constructor(I={}){this.nextCallAvailableTime=I.nextCallAvailableTime}}class cs{id;uniqueName;name;subreseller;isSuspended;constructor(I={}){this.id=I.id,this.uniqueName=I.uniqueName,this.name=I.name,this.subreseller=I.subreseller,this.isSuspended=I.isSuspended}}class Gr{pageIndex;totalPages;totalItemsCount;results;hasPreviousPage;hasNextPage;constructor(I={}){this.pageIndex=I.pageIndex,this.totalPages=I.totalPages,this.totalItemsCount=I.totalItemsCount,this.results=I.results,this.hasPreviousPage=I.hasPreviousPage,this.hasNextPage=I.hasNextPage}}class xr{organizationId;organizationName;uniqueName;userCount;isSuspended;usesDefaultSettings;constructor(I={}){this.organizationId=I.organizationId,this.organizationName=I.organizationName,this.uniqueName=I.uniqueName,this.userCount=I.userCount,this.isSuspended=I.isSuspended,this.usesDefaultSettings=I.usesDefaultSettings}}class no{page;pageSize;searchTerm;sort;constructor(I={}){this.page=I.page,this.pageSize=I.pageSize,this.searchTerm=I.searchTerm,this.sort=I.sort}}class ps{field;ascending;constructor(I={}){this.field=I.field,this.ascending=I.ascending}}class ns{email;phoneNumber;address;constructor(I={}){this.email=I.email,this.phoneNumber=I.phoneNumber,this.address=I.address}}class ss{priceVisible;isSubresellerShown;showSubscriptions;showUsers;showLicenses;showBilling;orgAdminCanCreateUsers;allowSubscriptionCancellation;constructor(I={}){this.priceVisible=I.priceVisible,this.isSubresellerShown=I.isSubresellerShown,this.showSubscriptions=I.showSubscriptions,this.showUsers=I.showUsers,this.showLicenses=I.showLicenses,this.showBilling=I.showBilling,this.orgAdminCanCreateUsers=I.orgAdminCanCreateUsers,this.allowSubscriptionCancellation=I.allowSubscriptionCancellation}}class Wo{isOrderApprovalRequired;teamsNotificationsEnabled;teamsIncomingWebhook;emailNotificationsEnabled;emailRecipientsList;constructor(I={}){this.isOrderApprovalRequired=I.isOrderApprovalRequired,this.teamsNotificationsEnabled=I.teamsNotificationsEnabled,this.teamsIncomingWebhook=I.teamsIncomingWebhook,this.emailNotificationsEnabled=I.emailNotificationsEnabled,this.emailRecipientsList=I.emailRecipientsList}}class _o{id;email;constructor(I={}){this.id=I.id,this.email=I.email}}class ao{serviceProviderId;clientId;constructor(I={}){this.serviceProviderId=I.serviceProviderId,this.clientId=I.clientId}}class Ls{serviceProviderId;publicApiKey;privateApiKey;subscriptionKey;constructor(I={}){this.serviceProviderId=I.serviceProviderId,this.publicApiKey=I.publicApiKey,this.privateApiKey=I.privateApiKey,this.subscriptionKey=I.subscriptionKey}}class So{id;name;constructor(I={}){this.id=I.id,this.name=I.name}}class jr{invitedUserEmailAddress;firstName;lastName;jobTitle;role;organizationsIds;resellerId;preferredCulture;constructor(I={}){this.invitedUserEmailAddress=I.invitedUserEmailAddress,this.firstName=I.firstName,this.lastName=I.lastName,this.jobTitle=I.jobTitle,this.role=I.role,this.organizationsIds=I.organizationsIds,this.resellerId=I.resellerId,this.preferredCulture=I.preferredCulture}}class Dn{organizationId;constructor(I={}){this.organizationId=I.organizationId}}class Dr{userId;organizationId;constructor(I={}){this.userId=I.userId,this.organizationId=I.organizationId}}class Vs{billing;helpDesk;serviceProvider;constructor(I={}){this.billing=I.billing,this.helpDesk=I.helpDesk,this.serviceProvider=I.serviceProvider}}class Mo{isEnabled;constructor(I={}){this.isEnabled=I.isEnabled}}class qo{billing;helpDesk;serviceProvider;constructor(I={}){this.billing=I.billing,this.helpDesk=I.helpDesk,this.serviceProvider=I.serviceProvider}}class ui{id;integrationType;configured;constructor(I={}){this.id=I.id,this.integrationType=I.integrationType,this.configured=I.configured}}class Wn{isPsaAvailable;constructor(I={}){this.isPsaAvailable=I.isPsaAvailable}}class Me{id;subject;statusId;ticketTypeId;createdAt;openedByName;openedByEmail;lastUpdated;constructor(I={}){this.id=I.id,this.subject=I.subject,this.statusId=I.statusId,this.ticketTypeId=I.ticketTypeId,this.createdAt=I.createdAt,this.openedByName=I.openedByName,this.openedByEmail=I.openedByEmail,this.lastUpdated=I.lastUpdated}}class Qe{ticketTypeId;title;description;constructor(I={}){this.ticketTypeId=I.ticketTypeId,this.title=I.title,this.description=I.description}}class Ke{id;integrationId;name;configured;constructor(I={}){this.id=I.id,this.integrationId=I.integrationId,this.name=I.name,this.configured=I.configured}}class ut{id;name;placeholder;isRequired;type;constructor(I={}){this.id=I.id,this.name=I.name,this.placeholder=I.placeholder,this.isRequired=I.isRequired,this.type=I.type}}class Wt{id;subject;statusId;ticketTypeId;createdAt;openedByName;openedByEmail;lastUpdated;notes;constructor(I={}){this.id=I.id,this.subject=I.subject,this.statusId=I.statusId,this.ticketTypeId=I.ticketTypeId,this.createdAt=I.createdAt,this.openedByName=I.openedByName,this.openedByEmail=I.openedByEmail,this.lastUpdated=I.lastUpdated,this.notes=I.notes}}class cn{id;createdByName;createdByEmail;createdDate;text;isCurrentUserNote;constructor(I={}){this.id=I.id,this.createdByName=I.createdByName,this.createdByEmail=I.createdByEmail,this.createdDate=I.createdDate,this.text=I.text,this.isCurrentUserNote=I.isCurrentUserNote}}class Qt{text;constructor(I={}){this.text=I.text}}class be{integrationType;companyName;enabled;publicApiKey;clientId;url;constructor(I={}){this.integrationType=I.integrationType,this.companyName=I.companyName,this.enabled=I.enabled,this.publicApiKey=I.publicApiKey,this.clientId=I.clientId,this.url=I.url}}class pe{enabled;companyName;publicApiKey;privateApiKey;clientId;url;constructor(I={}){this.enabled=I.enabled,this.companyName=I.companyName,this.publicApiKey=I.publicApiKey,this.privateApiKey=I.privateApiKey,this.clientId=I.clientId,this.url=I.url}}class le{ticketStatusMappingList;integrationStatuses;constructor(I={}){this.ticketStatusMappingList=I.ticketStatusMappingList,this.integrationStatuses=I.integrationStatuses}}class ue{ticketStatusId;integrationTicketStatusId;constructor(I={}){this.ticketStatusId=I.ticketStatusId,this.integrationTicketStatusId=I.integrationTicketStatusId}}class K{integrationTicketStatusId;integrationTicketStatusName;constructor(I={}){this.integrationTicketStatusId=I.integrationTicketStatusId,this.integrationTicketStatusName=I.integrationTicketStatusName}}class fe{id;name;active;constructor(I={}){this.id=I.id,this.name=I.name,this.active=I.active}}class _e{serviceBoardId;ticketStatusMappings;ticketTypeMappings;constructor(I={}){this.serviceBoardId=I.serviceBoardId,this.ticketStatusMappings=I.ticketStatusMappings,this.ticketTypeMappings=I.ticketTypeMappings}}class Ve{ticketStatusId;integrationTicketStatusId;constructor(I={}){this.ticketStatusId=I.ticketStatusId,this.integrationTicketStatusId=I.integrationTicketStatusId}}class X{id;name;constructor(I={}){this.id=I.id,this.name=I.name}}class xe{organizationMappingResults;constructor(I={}){this.organizationMappingResults=I.organizationMappingResults}}class Ne{id;name;isMapped;constructor(I={}){this.id=I.id,this.name=I.name,this.isMapped=I.isMapped}}class Ee{setOrganizationMappings;constructor(I={}){this.setOrganizationMappings=I.setOrganizationMappings}}class Oe{organizationId;companyId;constructor(I={}){this.organizationId=I.organizationId,this.companyId=I.companyId}}class Be{id;name;description;numberSkus;numberOrganizations;createdOn;updatedOn;constructor(I={}){this.id=I.id,this.name=I.name,this.description=I.description,this.numberSkus=I.numberSkus,this.numberOrganizations=I.numberOrganizations,this.createdOn=I.createdOn,this.updatedOn=I.updatedOn}}class et{availableCatalogProducts;facets;constructor(I={}){this.availableCatalogProducts=I.availableCatalogProducts,this.facets=I.facets}}class dt{id;name;description;vendorId;vendorName;categories;offers;constructor(I={}){this.id=I.id,this.name=I.name,this.description=I.description,this.vendorId=I.vendorId,this.vendorName=I.vendorName,this.categories=I.categories,this.offers=I.offers}}class bt{slug;name;constructor(I={}){this.slug=I.slug,this.name=I.name}}class ft{name;isSelected;vendor;sku;billingCycle;commitmentTermType;pricingModelType;price;constructor(I={}){this.name=I.name,this.isSelected=I.isSelected,this.vendor=I.vendor,this.sku=I.sku,this.billingCycle=I.billingCycle,this.commitmentTermType=I.commitmentTermType,this.pricingModelType=I.pricingModelType,this.price=I.price}}class pt{id;name;description;vendorId;vendorName;startingPrice;categories;offers;constructor(I={}){this.id=I.id,this.name=I.name,this.description=I.description,this.vendorId=I.vendorId,this.vendorName=I.vendorName,this.startingPrice=I.startingPrice,this.categories=I.categories,this.offers=I.offers}}class _t{slug;name;constructor(I={}){this.slug=I.slug,this.name=I.name}}class Kt{sku;billingCycle;commitmentTermType;pricingModelType;constructor(I={}){this.sku=I.sku,this.billingCycle=I.billingCycle,this.commitmentTermType=I.commitmentTermType,this.pricingModelType=I.pricingModelType}}class fn{skusToAdd;skusToRemove;constructor(I={}){this.skusToAdd=I.skusToAdd,this.skusToRemove=I.skusToRemove}}class hn{pageIndex;totalPages;totalItemsCount;results;hasPreviousPage;hasNextPage;constructor(I={}){this.pageIndex=I.pageIndex,this.totalPages=I.totalPages,this.totalItemsCount=I.totalItemsCount,this.results=I.results,this.hasPreviousPage=I.hasPreviousPage,this.hasNextPage=I.hasNextPage}}class In{organizationId;name;isAssigned;constructor(I={}){this.organizationId=I.organizationId,this.name=I.name,this.isAssigned=I.isAssigned}}class lr{page;pageSize;query;sortBy;filter;constructor(I={}){this.page=I.page,this.pageSize=I.pageSize,this.query=I.query,this.sortBy=I.sortBy,this.filter=I.filter}}var Gn=(Ce=>(Ce.Annual="Annual",Ce.Biennial="Biennial",Ce.Triennial="Triennial",Ce.Monthly="Monthly",Ce.Unknown="Unknown",Ce.Open="Open",Ce))(Gn||{}),Mn=(Ce=>(Ce.None="None",Ce.Daily="Daily",Ce.Weekly="Weekly",Ce.Monthly="Monthly",Ce.Yearly="Yearly",Ce.Unknown="Unknown",Ce.Once="Once",Ce))(Mn||{}),gr=(Ce=>(Ce.New="New",Ce.Processing="Processing",Ce.Active="Active",Ce.Suspended="Suspended",Ce.Inactive="Inactive",Ce))(gr||{}),er=(Ce=>(Ce.Cad="Cad",Ce.Usd="Usd",Ce.Eur="Eur",Ce.Gbp="Gbp",Ce))(er||{}),_r=(Ce=>(Ce.Completed="Completed",Ce.Pending="Pending",Ce.Failed="Failed",Ce.WaitingForApproval="WaitingForApproval",Ce.Rejected="Rejected",Ce))(_r||{}),vs=(Ce=>(Ce.Validation="Validation",Ce.Business="Business",Ce.System="System",Ce))(vs||{}),ys=(Ce=>(Ce.Approve="Approve",Ce.Reject="Reject",Ce))(ys||{}),ro=(Ce=>(Ce.Subscriber="Subscriber",Ce.User="User",Ce.LicenseUpdate="LicenseUpdate",Ce))(ro||{}),qs=(Ce=>(Ce.NotApplicable="NotApplicable",Ce.Pending="Pending",Ce.Failure="Failure",Ce))(qs||{}),hs=(Ce=>(Ce.Amendment="Amendment",Ce.Purchase="Purchase",Ce))(hs||{}),Ks=(Ce=>(Ce.Inactive="Inactive",Ce.Active="Active",Ce.InvitationSent="InvitationSent",Ce))(Ks||{}),os=(Ce=>(Ce.BasicUser="BasicUser",Ce.OrganizationAdmin="OrganizationAdmin",Ce.ResellerAdmin="ResellerAdmin",Ce.InternalAdmin="InternalAdmin",Ce.ResellerGuest="ResellerGuest",Ce))(os||{}),Gs=(Ce=>(Ce.Logo="Logo",Ce.Icon="Icon",Ce.Other="Other",Ce))(Gs||{}),Ar=(Ce=>(Ce.Default="Default",Ce.Green="Green",Ce.Blue="Blue",Ce))(Ar||{}),bo=(Ce=>(Ce.SSP="SSP",Ce.RSP="RSP",Ce))(bo||{}),io=(Ce=>(Ce.Subscription="Subscription",Ce.OneTimePurchase="OneTimePurchase",Ce.Unknown="Unknown",Ce))(io||{}),ho=(Ce=>(Ce.ProductNameAscending="ProductNameAscending",Ce.ProductNameDescending="ProductNameDescending",Ce.PriceAscending="PriceAscending",Ce.PriceDescending="PriceDescending",Ce))(ho||{}),$o=(Ce=>(Ce.None="None",Ce.OrganizationName="OrganizationName",Ce.UsersCount="UsersCount",Ce.SettingsType="SettingsType",Ce.Status="Status",Ce))($o||{}),Ka=(Ce=>(Ce.None="None",Ce.Autotask="Autotask",Ce.ConnectWise="ConnectWise",Ce.Paypal="Paypal",Ce.Sherweb="Sherweb",Ce))(Ka||{}),ei=(Ce=>(Ce.Closed="Closed",Ce.New="New",Ce.Processing="Processing",Ce.Resolved="Resolved",Ce.WaitingForCustomer="WaitingForCustomer",Ce))(ei||{}),Ma=(Ce=>(Ce.Subscription="Subscription",Ce.OneTimePurchase="OneTimePurchase",Ce.Unknown="Unknown",Ce))(Ma||{}),Fi=(Ce=>(Ce.NameAscending="NameAscending",Ce.NameDescending="NameDescending",Ce))(Fi||{}),Qo=(Ce=>(Ce.All="All",Ce.Assigned="Assigned",Ce.Unassigned="Unassigned",Ce))(Qo||{}),so=(Ce=>(Ce.SubscriptionList="SubscriptionList",Ce.SubscriptionPrices="SubscriptionPrices",Ce.SubscriptionDetails="SubscriptionDetails",Ce.SubscriptionEdit="SubscriptionEdit",Ce.SubscriptionCancel="SubscriptionCancel",Ce.OrderApproval="OrderApproval",Ce.UsersList="UsersList",Ce.UsersEdit="UsersEdit",Ce.UsersCreate="UsersCreate",Ce.UsersDelete="UsersDelete",Ce.UserActivity="UserActivity",Ce.UserSubscriptions="UserSubscriptions",Ce.UserTickets="UserTickets",Ce.DashboardAccess="DashboardAccess",Ce.DashboardEdit="DashboardEdit",Ce.DashboardAddWidget="DashboardAddWidget",Ce.DashboardDeleteWidget="DashboardDeleteWidget",Ce.ActivitiesUser="ActivitiesUser",Ce.ActivitiesUsers="ActivitiesUsers",Ce.ResellerAdmin="ResellerAdmin",Ce.LicenseList="LicenseList",Ce.LicenseDetails="LicenseDetails",Ce.LicenseAssign="LicenseAssign",Ce.IntegrationList="IntegrationList",Ce.IntegrationDetails="IntegrationDetails",Ce.IntegrationConfigure="IntegrationConfigure",Ce.HelpDeskList="HelpDeskList",Ce.HelpDeskDetails="HelpDeskDetails",Ce.HelpDeskEdit="HelpDeskEdit",Ce.AdminOrderList="AdminOrderList",Ce.AdminOrderDetails="AdminOrderDetails",Ce.OrderList="OrderList",Ce.OrderDetails="OrderDetails",Ce.AccessToSuspendedOrganization="AccessToSuspendedOrganization",Ce.MarketplaceProductList="MarketplaceProductList",Ce.MarketplaceProductDetail="MarketplaceProductDetail",Ce.MarketplaceProductEdit="MarketplaceProductEdit",Ce.CatalogManagementList="CatalogManagementList",Ce.CatalogProductsList="CatalogProductsList",Ce.CatalogProductsEdit="CatalogProductsEdit",Ce.CatalogOrganizationsList="CatalogOrganizationsList",Ce))(so||{}),pa=(Ce=>(Ce.RefreshOrganizationSubscriptions="RefreshOrganizationSubscriptions",Ce.LogOutUser="LogOutUser",Ce.RefreshLicenses="RefreshLicenses",Ce.RefreshOrganizations="RefreshOrganizations",Ce.RefreshPermissions="RefreshPermissions",Ce.Notify="Notify",Ce.RefreshOrders="RefreshOrders",Ce.RefreshAdminOrders="RefreshAdminOrders",Ce.AssignToOrganizationGroup="AssignToOrganizationGroup",Ce.AssignToResellerGroup="AssignToResellerGroup",Ce))(pa||{}),di=(Ce=>(Ce.Info="Info",Ce.Success="Success",Ce.Warning="Warning",Ce.Error="Error",Ce))(di||{})},5734:(a,l,se)=>{"use strict";se.d(l,{Co:()=>ie,Ui:()=>ae,XY:()=>Te,er:()=>we,y1:()=>W});const we=ee=>new Error(ee),Te=()=>we("Missing parameters"),ae=async()=>await Promise.reject(Te()),ie=ee=>{if(ee)return ee.response?.data.Errors?.at(0)?.Code},W=ee=>{const q=ee;return q?.message?.includes("Network Error")&&q.code==="ERR_NETWORK"}},9153:()=>{"use strict"},2096:(a,l,se)=>{"use strict";se.d(l,{W:()=>td,L:()=>zg});var we={log:"log",debug:"debug",info:"info",warn:"warn",error:"error"},Te=console,ae={};Object.keys(we).forEach(function(h){ae[h]=Te[h]});var ie="Datadog Browser SDK:",W={debug:ae.debug.bind(Te,ie),log:ae.log.bind(Te,ie),info:ae.info.bind(Te,ie),warn:ae.warn.bind(Te,ie),error:ae.error.bind(Te,ie)};function ee(h,b){return function(){for(var _=[],P=0;P<arguments.length;P++)_[P]=arguments[P];try{return h.apply(void 0,_)}catch(A){W.error(b,A)}}}var q=function(h,b,_){if(_||arguments.length===2)for(var P=0,A=b.length,$;P<A;P++)($||!(P in b))&&($||($=Array.prototype.slice.call(b,0,P)),$[P]=b[P]);return h.concat($||Array.prototype.slice.call(b))},Z,U=!1;function ge(h){Z=h}function ne(h){U=h}function ve(){Z=void 0,U=!1}function V(h,b,_){var P=_.value;_.value=function(){for(var A=[],$=0;$<arguments.length;$++)A[$]=arguments[$];var Y=Z?te(P):P;return Y.apply(this,A)}}function te(h){return function(){return Re(h,this,arguments)}}function Re(h,b,_){try{return h.apply(b,_)}catch(P){if(Ie(P),Z)try{Z(P)}catch(A){Ie(A)}}}function Ie(){for(var h=[],b=0;b<arguments.length;b++)h[b]=arguments[b];U&&W.error.apply(W,q(["[MONITOR]"],h,!1))}function $e(h,b){return h.indexOf(b)!==-1}function vt(h){if(Array.from)return Array.from(h);var b=[];if(h instanceof Set)h.forEach(function(P){return b.push(P)});else for(var _=0;_<h.length;_++)b.push(h[_]);return b}function mt(h,b){for(var _=0;_<h.length;_+=1){var P=h[_];if(b(P,_))return P}}function It(h,b){for(var _=h.length-1;_>=0;_-=1){var P=h[_];if(b(P,_,h))return P}}function qe(h,b){Array.prototype.forEach.call(h,b)}function nn(h){return Object.keys(h).map(function(b){return h[b]})}function Ut(h){return Object.keys(h).map(function(b){return[b,h[b]]})}function Xe(h,b){return h.slice(0,b.length)===b}function Ft(h,b){return h.slice(-b.length)===b}function rn(h,b){return h.matches?h.matches(b):h.msMatchesSelector?h.msMatchesSelector(b):!1}function Vt(h){return window.CSS&&window.CSS.escape?window.CSS.escape(h):h.replace(/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,function(b,_){return _?b==="\0"?"\uFFFD":"".concat(b.slice(0,-1),"\\").concat(b.charCodeAt(b.length-1).toString(16)," "):"\\".concat(b)})}function ze(h){for(var b=[],_=1;_<arguments.length;_++)b[_-1]=arguments[_];return b.forEach(function(P){for(var A in P)Object.prototype.hasOwnProperty.call(P,A)&&(h[A]=P[A])}),h}function je(h){var b=ze({version:"4.50.1",onReady:function(_){_()}},h);return Object.defineProperty(b,"_setDebug",{get:function(){return ne},enumerable:!1}),b}function De(h,b,_){var P=h[b];h[b]=_,P&&P.q&&P.q.forEach(function(A){return ee(A,"onReady callback threw an error:")()})}function ct(){if(typeof globalThis=="object")return globalThis;Object.defineProperty(Object.prototype,"_dd_temp_",{get:function(){return this},configurable:!0});var h=_dd_temp_;return delete Object.prototype._dd_temp_,typeof h!="object"&&(typeof self=="object"?h=self:typeof window=="object"?h=window:h={}),h}var qt=1024,z=1024*qt,He=/[^\u0000-\u007F]/;function Ct(h){return He.test(h)?window.TextEncoder!==void 0?new TextEncoder().encode(h).length:new Blob([h]).size:h.length}function kt(h){for(var b=h.reduce(function(he,me){return he+me.length},0),_=new Uint8Array(b),P=0,A=0,$=h;A<$.length;A++){var Y=$[A];_.set(Y,P),P+=Y.length}return _}function Pe(h,b){var _=ct(),P;return _.Zone&&typeof _.Zone.__symbol__=="function"&&(P=h[_.Zone.__symbol__(b)]),P||(P=h[b]),P}function yt(h,b){return Pe(ct(),"setTimeout")(te(h),b)}function un(h){Pe(ct(),"clearTimeout")(h)}function Rn(h,b){return Pe(ct(),"setInterval")(te(h),b)}function Yn(h){Pe(ct(),"clearInterval")(h)}function nr(h,b,_){var P=_&&_.leading!==void 0?_.leading:!0,A=_&&_.trailing!==void 0?_.trailing:!0,$=!1,Y,he;return{throttled:function(){for(var me=[],Ae=0;Ae<arguments.length;Ae++)me[Ae]=arguments[Ae];if($){Y=me;return}P?h.apply(void 0,me):Y=me,$=!0,he=yt(function(){A&&Y&&h.apply(void 0,Y),$=!1,Y=void 0},b)},cancel:function(){un(he),$=!1,Y=void 0}}}function rr(){}function ar(h){return h===null?"null":Array.isArray(h)?"array":typeof h}function wr(h,b,_){if(_===void 0&&(_=Bs()),b===void 0)return h;if(typeof b!="object"||b===null)return b;if(b instanceof Date)return new Date(b.getTime());if(b instanceof RegExp){var P=b.flags||[b.global?"g":"",b.ignoreCase?"i":"",b.multiline?"m":"",b.sticky?"y":"",b.unicode?"u":""].join("");return new RegExp(b.source,P)}if(!_.hasAlreadyBeenSeen(b)){if(Array.isArray(b)){for(var A=Array.isArray(h)?h:[],$=0;$<b.length;++$)A[$]=wr(A[$],b[$],_);return A}var Y=ar(h)==="object"?h:{};for(var he in b)Object.prototype.hasOwnProperty.call(b,he)&&(Y[he]=wr(Y[he],b[he],_));return Y}}function Ts(h){return wr(void 0,h)}function Zr(){for(var h=[],b=0;b<arguments.length;b++)h[b]=arguments[b];for(var _,P=0,A=h;P<A.length;P++){var $=A[P];$!=null&&(_=wr(_,$))}return _}function Bs(){if(typeof WeakSet<"u"){var h=new WeakSet;return{hasAlreadyBeenSeen:function(_){var P=h.has(_);return P||h.add(_),P}}}var b=[];return{hasAlreadyBeenSeen:function(_){var P=b.indexOf(_)>=0;return P||b.push(_),P}}}function rt(h,b,_){if(typeof h!="object"||h===null)return JSON.stringify(h);var P=zt(Object.prototype),A=zt(Array.prototype),$=zt(Object.getPrototypeOf(h)),Y=zt(h);try{return JSON.stringify(h,b,_)}catch{return"<error: unable to serialize object>"}finally{P(),A(),$(),Y()}}function zt(h){var b=h,_=b.toJSON;return _?(delete b.toJSON,function(){b.toJSON=_}):rr}var Hn=220*qt,Nr="$",kr=3;function Xn(h,b){var _;b===void 0&&(b=Hn);var P=zt(Object.prototype),A=zt(Array.prototype),$=[],Y=new WeakMap,he=Jt(h,Nr,void 0,$,Y),me=((_=JSON.stringify(he))===null||_===void 0?void 0:_.length)||0;if(me>b){sr(b,"discarded",h);return}for(;$.length>0&&me<b;){var Ae=$.shift(),Ge=0;if(Array.isArray(Ae.source))for(var ht=0;ht<Ae.source.length;ht++){var jt=Jt(Ae.source[ht],Ae.path,ht,$,Y);if(jt!==void 0?me+=JSON.stringify(jt).length:me+=4,me+=Ge,Ge=1,me>b){sr(b,"truncated",h);break}Ae.target[ht]=jt}else for(var ht in Ae.source)if(Object.prototype.hasOwnProperty.call(Ae.source,ht)){var jt=Jt(Ae.source[ht],Ae.path,ht,$,Y);if(jt!==void 0&&(me+=JSON.stringify(jt).length+Ge+ht.length+kr,Ge=1),me>b){sr(b,"truncated",h);break}Ae.target[ht]=jt}}return P(),A(),he}function Jt(h,b,_,P,A){var $=bn(h);if(!$||typeof $!="object")return Xt($);var Y=qn($);if(Y!=="[Object]"&&Y!=="[Array]"&&Y!=="[Error]")return Y;var he=h;if(A.has(he))return"[Reference seen at ".concat(A.get(he),"]");var me=_!==void 0?"".concat(b,".").concat(_):b,Ae=Array.isArray($)?[]:{};return A.set(he,me),P.push({source:$,target:Ae,path:me}),Ae}function Xt(h){return typeof h=="bigint"?"[BigInt] ".concat(h.toString()):typeof h=="function"?"[Function] ".concat(h.name||"unknown"):typeof h=="symbol"?"[Symbol] ".concat(h.description||h.toString()):h}function qn(h){try{if(h instanceof Event)return{isTrusted:h.isTrusted};var b=Object.prototype.toString.call(h),_=b.match(/\[object (.*)\]/);if(_&&_[1])return"[".concat(_[1],"]")}catch{}return"[Unserializable]"}function bn(h){var b=h;if(b&&typeof b.toJSON=="function")try{return b.toJSON()}catch{}return h}function sr(h,b,_){W.warn("The data provided has been ".concat(b," as it is over the limit of ").concat(h," characters:"),_)}var Jn=function(){function h(b){this.onFirstSubscribe=b,this.observers=[]}return h.prototype.subscribe=function(b){var _=this;return!this.observers.length&&this.onFirstSubscribe&&(this.onLastUnsubscribe=this.onFirstSubscribe()||void 0),this.observers.push(b),{unsubscribe:function(){_.observers=_.observers.filter(function(P){return b!==P}),!_.observers.length&&_.onLastUnsubscribe&&_.onLastUnsubscribe()}}},h.prototype.notify=function(b){this.observers.forEach(function(_){return _(b)})},h}();function fs(){for(var h=[],b=0;b<arguments.length;b++)h[b]=arguments[b];var _=new Jn(function(){var P=h.map(function(A){return A.subscribe(function($){return _.notify($)})});return function(){return P.forEach(function(A){return A.unsubscribe()})}});return _}var Kn,Ir=3*qt,Rr=(Kn={},Kn[0]="feature flag evaluation",Kn[1]="user",Kn[2]="global context",Kn[3]="logger context",Kn);function pr(h,b){return h>Ir?(W.warn("The ".concat(Rr[b]," data exceeds the recommended ").concat(Ir/qt,"KiB threshold. More details: https://docs.datadoghq.com/real_user_monitoring/browser/troubleshooting/#customer-data-exceeds-the-recommended-3kib-warning")),!0):!1}var Tr=200;function gt(h,b){b===void 0&&(b=Ct);var _={},P,A=!1,$=new Jn,Y=nr(function(me){P=b(rt(me)),A||(A=pr(P,h))},Tr).throttled,he={getBytesCount:function(){return P},get:function(){return _},add:function(me,Ae){_[me]=Ae,Y(_),$.notify()},remove:function(me){delete _[me],Y(_),$.notify()},set:function(me){_=me,Y(_),$.notify()},getContext:function(){return Ts(_)},setContext:function(me){ar(me)==="object"?(_=Xn(me),Y(_)):he.clearContext(),$.notify()},setContextProperty:function(me,Ae){_[me]=Xn(Ae),Y(_),$.notify()},removeContextProperty:function(me){delete _[me],Y(_),$.notify()},clearContext:function(){_={},P=0,$.notify()},changeObservable:$};return he}var _s=500,cs=function(){function h(){this.buffer=[]}return h.prototype.add=function(b){var _=this.buffer.push(b);_>_s&&this.buffer.splice(0,1)},h.prototype.drain=function(){this.buffer.forEach(function(b){return b()}),this.buffer.length=0},h}();function Gr(h){return h!==0&&Math.random()*100<=h}function xr(h,b){return+h.toFixed(b)}function no(h){return ps(h)&&h>=0&&h<=100}function ps(h){return typeof h=="number"}var ns=1e3,ss=60*ns,Wo=60*ss,_o=24*Wo,ao=365*_o;function Ls(h){return{relative:h,timeStamp:So(h)}}function So(h){var b=Dr()-performance.now();return b>cn()?Math.round(Me(b,h)):Ke(h)}function jr(){return Math.round(Dr()-Me(cn(),performance.now()))}function Dn(h){return ps(h)?xr(h*1e6,0):h}function Dr(){return new Date().getTime()}function Vs(){return Dr()}function Mo(){return performance.now()}function qo(){return{relative:Mo(),timeStamp:Vs()}}function ui(){return{relative:0,timeStamp:cn()}}function Wn(h,b){return b-h}function Me(h,b){return h+b}function Qe(h){return h-cn()}function Ke(h){return Math.round(Me(cn(),h))}function ut(h){return h<ao}var Wt;function cn(){return Wt===void 0&&(Wt=performance.timing.navigationStart),Wt}function Qt(){Wt=void 0}function be(h){return h?(parseInt(h,10)^Math.random()*16>>parseInt(h,10)/4).toString(16):"".concat(1e7,"-").concat(1e3,"-").concat(4e3,"-").concat(8e3,"-").concat(1e11).replace(/[018]/g,be)}function pe(h,b){var _=new RegExp("(?:^|;)\\s*".concat(b,"\\s*=\\s*([^;]+)")),P=_.exec(h);return P?P[1]:void 0}function le(h,b,_){_===void 0&&(_="");var P=h.charCodeAt(b-1),A=P>=55296&&P<=56319,$=A?b+1:b;return h.length<=$?h:"".concat(h.slice(0,$)).concat(_)}function ue(h,b,_,P){var A=new Date;A.setTime(A.getTime()+_);var $="expires=".concat(A.toUTCString()),Y=P&&P.crossSite?"none":"strict",he=P&&P.domain?";domain=".concat(P.domain):"",me=P&&P.secure?";secure":"";document.cookie="".concat(h,"=").concat(b,";").concat($,";path=/;samesite=").concat(Y).concat(he).concat(me)}function K(h){return pe(document.cookie,h)}function fe(h,b){ue(h,"",0,b)}function _e(h){if(document.cookie===void 0||document.cookie===null)return!1;try{var b="dd_cookie_test_".concat(be()),_="test";ue(b,_,ss,h);var P=K(b)===_;return fe(b,h),P}catch(A){return W.error(A),!1}}var Ve;function X(){if(Ve===void 0){for(var h="dd_site_test_".concat(be()),b="test",_=window.location.hostname.split("."),P=_.pop();_.length&&!K(h);)P="".concat(_.pop(),".").concat(P),ue(h,b,ns,{domain:P});fe(h,{domain:P}),Ve=P}return Ve}var xe="datadog-synthetics-public-id",Ne="datadog-synthetics-result-id",Ee="datadog-synthetics-injects-rum";function Oe(){return Boolean(window._DATADOG_SYNTHETICS_INJECTS_RUM||K(Ee))}function Be(){var h=window._DATADOG_SYNTHETICS_PUBLIC_ID||K(xe);return typeof h=="string"?h:void 0}function et(){var h=window._DATADOG_SYNTHETICS_RESULT_ID||K(Ne);return typeof h=="string"?h:void 0}function dt(){var h=ft();if(h)return{getAllowedWebViewHosts:function(){return JSON.parse(h.getAllowedWebViewHosts())},send:function(b,_){h.send(JSON.stringify({eventType:b,event:_}))}}}function bt(h){var b;h===void 0&&(h=(b=ct().location)===null||b===void 0?void 0:b.hostname);var _=dt();return!!_&&_.getAllowedWebViewHosts().some(function(P){return h===P||Ft(h,".".concat(P))})}function ft(){return ct().DatadogEventBridge}function pt(h,b,_,P,A){return _t(h,b,[_],P,A)}function _t(h,b,_,P,A){var $=A===void 0?{}:A,Y=$.once,he=$.capture,me=$.passive,Ae=te(Y?function(an){jt(),P(an)}:P),Ge=me?{capture:he,passive:me}:he,ht=Pe(b,"addEventListener");_.forEach(function(an){return ht.call(b,an,Ae,Ge)});function jt(){var an=Pe(b,"removeEventListener");_.forEach(function(sn){return an.call(b,sn,Ae,Ge)})}return{stop:jt}}var Kt="_dd_c",fn=[];function hn(h,b,_,P){P===void 0&&(P=Ct);var A=In(b,_),$=gt(_,P);return Y(),fn.push(pt(h,window,"storage",function(me){var Ae=me.key;A===Ae&&Y()})),$.changeObservable.subscribe(he),$;function Y(){var me=localStorage.getItem(A),Ae=me!==null?JSON.parse(me):{};$.setContext(Ae)}function he(){localStorage.setItem(A,JSON.stringify($.getContext()))}}function In(h,b){return"".concat(Kt,"_").concat(h,"_").concat(b)}function lr(){fn.map(function(h){return h.stop()})}var Gn="?";function Mn(h){var b=[],_=bo(h,"stack"),P=String(h);return _&&Xe(_,P)&&(_=_.slice(P.length)),_&&_.split(`
`).forEach(function(A){var $=ys(A)||qs(A)||Ks(A)||Ar(A);$&&(!$.func&&$.line&&($.func=Gn),b.push($))}),{message:bo(h,"message"),name:bo(h,"name"),stack:b}}var gr="((?:file|https?|blob|chrome-extension|native|eval|webpack|snippet|<anonymous>|\\w+\\.|\\/).*?)",er="(?::(\\d+))",_r=new RegExp("^\\s*at (.*?) ?\\(".concat(gr).concat(er,"?").concat(er,"?\\)?\\s*$"),"i"),vs=new RegExp("\\((\\S*)".concat(er).concat(er,"\\)"));function ys(h){var b=_r.exec(h);if(b){var _=b[2]&&b[2].indexOf("native")===0,P=b[2]&&b[2].indexOf("eval")===0,A=vs.exec(b[2]);return P&&A&&(b[2]=A[1],b[3]=A[2],b[4]=A[3]),{args:_?[b[2]]:[],column:b[4]?+b[4]:void 0,func:b[1]||Gn,line:b[3]?+b[3]:void 0,url:_?void 0:b[2]}}}var ro=new RegExp("^\\s*at ?".concat(gr).concat(er,"?").concat(er,"??\\s*$"),"i");function qs(h){var b=ro.exec(h);if(b)return{args:[],column:b[3]?+b[3]:void 0,func:Gn,line:b[2]?+b[2]:void 0,url:b[1]}}var hs=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function Ks(h){var b=hs.exec(h);if(b)return{args:[],column:b[4]?+b[4]:void 0,func:b[1]||Gn,line:+b[3],url:b[2]}}var os=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,Gs=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function Ar(h){var b=os.exec(h);if(b){var _=b[3]&&b[3].indexOf(" > eval")>-1,P=Gs.exec(b[3]);return _&&P&&(b[3]=P[1],b[4]=P[2],b[5]=void 0),{args:b[2]?b[2].split(","):[],column:b[5]?+b[5]:void 0,func:b[1]||Gn,line:b[4]?+b[4]:void 0,url:b[3]}}}function bo(h,b){if(!(typeof h!="object"||!h||!(b in h))){var _=h[b];return typeof _=="string"?_:void 0}}var io="No stack, consider using an instance of Error";function ho(h){var b=h.stackTrace,_=h.originalError,P=h.handlingStack,A=h.startClocks,$=h.nonErrorPrefix,Y=h.source,he=h.handling,me=_ instanceof Error,Ae=$o(b,me,$,_),Ge=Ka(me,b)?Ma(b):io,ht=me?pa(_,Y):void 0,jt=b?.name,an=ei(_);return{startClocks:A,source:Y,handling:he,handlingStack:P,originalError:_,type:jt,message:Ae,stack:Ge,causes:ht,fingerprint:an}}function $o(h,b,_,P){return h?.message&&h?.name?h.message:b?"Empty message":"".concat(_," ").concat(rt(Xn(P)))}function Ka(h,b){return b===void 0?!1:h?!0:b.stack.length>0&&(b.stack.length>1||b.stack[0].url!==void 0)}function ei(h){return h instanceof Error&&"dd_fingerprint"in h?String(h.dd_fingerprint):void 0}function Ma(h){var b=Qo(h);return h.stack.forEach(function(_){var P=_.func==="?"?"<anonymous>":_.func,A=_.args&&_.args.length>0?"(".concat(_.args.join(", "),")"):"",$=_.line?":".concat(_.line):"",Y=_.line&&_.column?":".concat(_.column):"";b+=`
  at `.concat(P).concat(A," @ ").concat(_.url).concat($).concat(Y)}),b}function Fi(h){var b;return(b=/@ (.+)/.exec(h))===null||b===void 0?void 0:b[1]}function Qo(h){return"".concat(h.name||"Error",": ").concat(h.message)}function so(){var h=2,b=new Error,_;if(!b.stack)try{throw b}catch{}return Re(function(){var P=Mn(b);P.stack=P.stack.slice(h),_=Ma(P)}),_}function pa(h,b){for(var _=h,P=[];_?.cause instanceof Error&&P.length<10;){var A=Mn(_.cause);P.push({message:_.cause.message,source:b,type:A?.name,stack:A&&Ma(A)}),_=_.cause}return P.length?P:void 0}function di(h){var b=ze({},h),_=["id","name","email"];return _.forEach(function(P){P in b&&(b[P]=String(b[P]))}),b}function Ce(h){var b=ar(h)==="object";return b||W.error("Unsupported user:",h),b}var I;(function(h){h.PAGEHIDE="pagehide",h.FEATURE_FLAGS="feature_flags",h.RESOURCE_PAGE_STATES="resource_page_states",h.PAGE_STATES="page_states",h.COLLECT_FLUSH_REASON="collect_flush_reason",h.NO_RESOURCE_DURATION_FROZEN_STATE="no_resource_duration_frozen_state",h.SCROLLMAP="scrollmap",h.INTERACTION_TO_NEXT_PAINT="interaction_to_next_paint",h.WEB_VITALS_ATTRIBUTION="web_vitals_attribution",h.DISABLE_REPLAY_INLINE_CSS="disable_replay_inline_css"})(I||(I={}));var $a=new Set;function Yo(h){h.forEach(function(b){$a.add(b)})}function ko(h){return $a.has(h)}function Ud(){$a.clear()}function yu(){return $a}function _i(h){return ze({},h)}function Cc(h,b){return Object.keys(h).some(function(_){return h[_]===b})}function cr(h){return Object.keys(h).length===0}function tt(h,b){for(var _={},P=0,A=Object.keys(h);P<A.length;P++){var $=A[P];_[$]=b(h[$])}return _}var tn=4*Wo,Fn=15*ss,Ur;function ha(){return Ur??(Ur=Boolean(document.documentMode))}var Ro;function aa(){return Ro??(Ro=!!window.chrome||/HeadlessChrome/.test(window.navigator.userAgent))}var Po;function rl(){return Po??(Po=/^((?!chrome|android).)*safari/i.test(navigator.userAgent))}var mo="_dd_s",fi=/^([a-z]+)=([a-z0-9-]+)$/,Wl="&";function Ec(h){return cr(h)}function sl(h){h.expire=String(Dr()+Fn)}function ql(h){return Ut(h).map(function(b){var _=b[0],P=b[1];return"".concat(_,"=").concat(P)}).join(Wl)}function Kl(h){var b={};return Gl(h)&&h.split(Wl).forEach(function(_){var P=fi.exec(_);if(P!==null){var A=P[1],$=P[2];b[A]=$}}),b}function Gl(h){return!!h&&(h.indexOf(Wl)!==-1||fi.test(h))}var ti="_dd",Yc="_dd_r",Bd="_dd_l",Tc="rum",eh="logs";function Xu(h){var b=K(mo);if(!b){var _=K(ti),P=K(Yc),A=K(Bd),$={};_&&($.id=_),A&&/^[01]$/.test(A)&&($[eh]=A),P&&/^[012]$/.test(P)&&($[Tc]=P),Ec($)||(sl($),h.persistSession($))}}function go(h){var b=pi(h);return _e(b)?{type:"Cookie",cookieOptions:b}:void 0}function kc(h){var b={isLockEnabled:aa(),persistSession:Oo(h),retrieveSession:Qf,clearSession:th(h)};return Xu(b),b}function Oo(h){return function(b){ue(mo,ql(b),Fn,h)}}function Qf(){var h=K(mo);return Kl(h)}function th(h){return function(){fe(mo,h)}}function pi(h){var b={};return b.secure=!!h.useSecureSessionCookie||!!h.useCrossSiteSessionCookie,b.crossSite=!!h.useCrossSiteSessionCookie,h.trackSessionAcrossSubdomains&&(b.domain=X()),b}var Mm="_dd_test_";function bu(){try{var h=be(),b="".concat(Mm).concat(h);localStorage.setItem(b,h);var _=localStorage.getItem(b);return localStorage.removeItem(b),h===_?{type:"LocalStorage"}:void 0}catch{return}}function Rc(){return{isLockEnabled:!1,persistSession:Lo,retrieveSession:Pc,clearSession:$m}}function Lo(h){localStorage.setItem(mo,ql(h))}function Pc(){var h=localStorage.getItem(mo);return Kl(h)}function $m(){localStorage.removeItem(mo)}var Oc=10,Yf=100,Vd=[],ni;function Xc(h,b,_){var P;_===void 0&&(_=0);var A=b.isLockEnabled,$=b.retrieveSession,Y=b.persistSession,he=b.clearSession;if(ni||(ni=h),h!==ni){Vd.push(h);return}if(A&&_>=Yf){wu(b);return}var me,Ae=$();if(A){if(Ae.lock){Zu(h,b,_);return}if(me=be(),Ae.lock=me,Y(Ae),Ae=$(),Ae.lock!==me){Zu(h,b,_);return}}var Ge=h.process(Ae);if(A&&(Ae=$(),Ae.lock!==me)){Zu(h,b,_);return}if(Ge&&(Ec(Ge)?he():(sl(Ge),Y(Ge))),A&&!(Ge&&Ec(Ge))){if(Ae=$(),Ae.lock!==me){Zu(h,b,_);return}delete Ae.lock,Y(Ae),Ge=Ae}(P=h.after)===null||P===void 0||P.call(h,Ge||Ae),wu(b)}function Zu(h,b,_){yt(function(){Xc(h,b,_+1)},Oc)}function wu(h){ni=void 0;var b=Vd.shift();b&&Xc(b,h)}var xu=ns;function nh(h){var b=go(h);return!b&&h.allowFallbackToLocalStorage&&(b=bu()),b}function Hd(h,b,_){var P=new Jn,A=new Jn,$=h.type==="Cookie"?kc(h.cookieOptions):Rc(),Y=$.clearSession,he=$.retrieveSession,me=Rn(jt,xu),Ae=da();function Ge(){var Fr;Xc({process:function(zr){var vi=an(zr);return Fr=sn(vi),vi},after:function(zr){Fr&&!kn()&&co(zr),Ae=zr}},$)}function ht(){Xc({process:function(Fr){return kn()?an(Fr):void 0}},$)}function jt(){Xc({process:function(Fr){return Go(Fr)?void 0:{}},after:an},$)}function an(Fr){return Go(Fr)||(Fr={}),kn()&&(is(Fr)?Ns():Ae=Fr),Fr}function sn(Fr){var zr=_(Fr[b]),vi=zr.trackingType,Yr=zr.isTracked;return Fr[b]=vi,Yr&&!Fr.id&&(Fr.id=be(),Fr.created=String(Dr())),Yr}function kn(){return Ae[b]!==void 0}function is(Fr){return Ae.id!==Fr.id||Ae[b]!==Fr[b]}function Ns(){Ae={},A.notify()}function co(Fr){Ae=Fr,P.notify()}function da(){var Fr=he();return Go(Fr)?Fr:{}}function Go(Fr){return(Fr.created===void 0||Dr()-Number(Fr.created)<tn)&&(Fr.expire===void 0||Dr()<Number(Fr.expire))}return{expandOrRenewSession:nr(Ge,xu).throttled,expandSession:ht,getSession:function(){return Ae},renewObservable:P,expireObservable:A,expire:function(){Y(),an({})},stop:function(){Yn(me)}}}function Ju(h){return Se(h,ot()).href}function ed(h){try{return!!Se(h)}catch{return!1}}function Lm(h){return en(Se(h))}function zi(h){var b=Se(h).pathname;return b[0]==="/"?b:"/".concat(b)}function J(h){return Se(h).search}function re(h){return Se(h).hash}function Se(h,b){var _=lt();if(_)try{return b!==void 0?new _(h,b):new _(h)}catch(Y){throw new Error("Failed to construct URL: ".concat(String(Y)," ").concat(rt({url:h,base:b})))}if(b===void 0&&!/:/.test(h))throw new Error("Invalid URL: '".concat(h,"'"));var P=document,A=P.createElement("a");if(b!==void 0){P=document.implementation.createHTMLDocument("");var $=P.createElement("base");$.href=b,P.head.appendChild($),P.body.appendChild(A)}return A.href=h,A}var ke=URL,Ue;function lt(){if(Ue===void 0)try{var h=new ke("http://test/path");Ue=h.href==="http://test/path"}catch{Ue=!1}return Ue?ke:void 0}function ot(){return en(window.location)}function en(h){if(h.origin&&h.origin!=="null")return h.origin;var b=h.host.replace(/(:80|:443)$/,"");return"".concat(h.protocol,"//").concat(b)}var or="datad0g.com",Tn="datadoghq.com",$n="datadoghq.eu",vr="ap1.datadoghq.com",ks="ddog-gov.com",Ea={logs:"logs",rum:"rum",sessionReplay:"session-replay"},Mr={logs:"logs",rum:"rum",sessionReplay:"replay"};function ms(h,b,_){var P=Pr(h,b);return{build:function(A,$){var Y=Fo(h,b,_,A,$);return P(Y)},urlPrefix:P(""),endpointType:b}}function Pr(h,b){var _="/api/v2/".concat(Mr[b]),P=h.proxy,A=h.proxyUrl;if(P){var $=Ju(P);return function(me){return"".concat($,"?ddforward=").concat(encodeURIComponent("".concat(_,"?").concat(me)))}}var Y=Qs(h,b);if(P===void 0&&A){var he=Ju(A);return function(me){return"".concat(he,"?ddforward=").concat(encodeURIComponent("https://".concat(Y).concat(_,"?").concat(me)))}}return function(me){return"https://".concat(Y).concat(_,"?").concat(me)}}function Qs(h,b){var _=h.site,P=_===void 0?Tn:_,A=h.internalAnalyticsSubdomain;if(A&&P===Tn)return"".concat(A,".").concat(Tn);var $=P.split("."),Y=$.pop(),he=P!==vr?"".concat(Ea[b],"."):"";return"".concat(he,"browser-intake-").concat($.join("-"),".").concat(Y)}function Fo(h,b,_,P,A){var $=h.clientToken,Y=h.internalAnalyticsSubdomain,he=A.retry,me=A.flushReason,Ae=A.encoding,Ge=["sdk_version:".concat("4.50.1"),"api:".concat(P)].concat(_);me&&ko(I.COLLECT_FLUSH_REASON)&&Ge.push("flush_reason:".concat(me)),he&&Ge.push("retry_count:".concat(he.count),"retry_after:".concat(he.lastFailureStatus));var ht=["ddsource=browser","ddtags=".concat(encodeURIComponent(Ge.join(","))),"dd-api-key=".concat($),"dd-evp-origin-version=".concat(encodeURIComponent("4.50.1")),"dd-evp-origin=browser","dd-request-id=".concat(be())];return Ae&&ht.push("dd-evp-encoding=".concat(Ae)),b==="rum"&&ht.push("batch_time=".concat(Vs())),Y&&ht.reverse(),ht.join("&")}var zo=200;function Nc(h){var b=h.env,_=h.service,P=h.version,A=h.datacenter,$=[];return b&&$.push(ma("env",b)),_&&$.push(ma("service",_)),P&&$.push(ma("version",P)),A&&$.push(ma("datacenter",A)),$}var La=/[^a-z0-9_:./-]/;function ma(h,b){var _=zo-h.length-1;(b.length>_||La.test(b))&&W.warn("".concat(h," value doesn't meet tag requirements and will be sanitized"));var P=b.replace(/,/g,"_");return"".concat(h,":").concat(P)}function Ql(h){var b=Nc(h),_=_u(h,b),P=nn(_).map(function($){return $.urlPrefix}),A=Su(h,P,b);return ze({isIntakeUrl:function($){return P.some(function(Y){return $.indexOf(Y)===0})},replica:A,site:h.site||Tn},_)}function _u(h,b){return{logsEndpointBuilder:ms(h,"logs",b),rumEndpointBuilder:ms(h,"rum",b),sessionReplayEndpointBuilder:ms(h,"sessionReplay",b)}}function Su(h,b,_){if(h.replica){var P=ze({},h,{site:Tn,clientToken:h.replica.clientToken}),A={logsEndpointBuilder:ms(P,"logs",_),rumEndpointBuilder:ms(P,"rum",_)};return b.push.apply(b,nn(A).map(function($){return $.urlPrefix})),ze({applicationId:h.replica.applicationId},A)}}var td={ALLOW:"allow",MASK:"mask",MASK_USER_INPUT:"mask-user-input"};function I0(h){var b,_,P;if(!h||!h.clientToken){W.error("Client Token is not configured, we will not send any data.");return}var A=(b=h.sessionSampleRate)!==null&&b!==void 0?b:h.sampleRate;if(A!==void 0&&!no(A)){W.error("Session Sample Rate should be a number between 0 and 100");return}if(h.telemetrySampleRate!==void 0&&!no(h.telemetrySampleRate)){W.error("Telemetry Sample Rate should be a number between 0 and 100");return}if(h.telemetryConfigurationSampleRate!==void 0&&!no(h.telemetryConfigurationSampleRate)){W.error("Telemetry Configuration Sample Rate should be a number between 0 and 100");return}return Array.isArray(h.enableExperimentalFeatures)&&Yo(h.enableExperimentalFeatures.filter(function($){return Cc(I,$)})),ze({beforeSend:h.beforeSend&&ee(h.beforeSend,"beforeSend threw an error:"),sessionStoreStrategyType:nh(h),sessionSampleRate:A??100,telemetrySampleRate:(_=h.telemetrySampleRate)!==null&&_!==void 0?_:20,telemetryConfigurationSampleRate:(P=h.telemetryConfigurationSampleRate)!==null&&P!==void 0?P:5,service:h.service,silentMultipleInit:!!h.silentMultipleInit,batchBytesLimit:16*qt,eventRateLimiterThreshold:3e3,maxTelemetryEventsPerPage:15,flushTimeout:30*ns,batchMessagesLimit:50,messageBytesLimit:256*qt},Ql(h))}function j0(h){var b,_,P=(b=h.proxy)!==null&&b!==void 0?b:h.proxyUrl;return{session_sample_rate:(_=h.sessionSampleRate)!==null&&_!==void 0?_:h.sampleRate,telemetry_sample_rate:h.telemetrySampleRate,telemetry_configuration_sample_rate:h.telemetryConfigurationSampleRate,use_before_send:!!h.beforeSend,use_cross_site_session_cookie:h.useCrossSiteSessionCookie,use_secure_session_cookie:h.useSecureSessionCookie,use_proxy:P!==void 0?!!P:void 0,silent_multiple_init:h.silentMultipleInit,track_session_across_subdomains:h.trackSessionAcrossSubdomains,track_resources:h.trackResources,track_long_task:h.trackLongTasks,allow_fallback_to_local_storage:!!h.allowFallbackToLocalStorage,store_contexts_across_pages:!!h.storeContextsAcrossPages}}function Fm(h){var b=ar(h);return b==="string"||b==="function"||h instanceof RegExp}function zm(h,b,_){return _===void 0&&(_=!1),h.some(function(P){try{if(typeof P=="function")return P(b);if(P instanceof RegExp)return P.test(b);if(typeof P=="string")return _?Xe(b,P):P===b}catch(A){W.error(A)}return!1})}function rh(h){var b=h;return ar(b)==="object"&&Fm(b.match)&&Array.isArray(b.propagatorTypes)}function Ui(h){h.status===0&&!h.isAborted&&(h.traceId=void 0,h.spanId=void 0,h.traceSampled=void 0)}function Bw(h,b){return{clearTracingIfNeeded:Ui,traceFetch:function(_){return Bi(h,_,b,function(P){var A;if(_.input instanceof Request&&!(!((A=_.init)===null||A===void 0)&&A.headers))_.input=new Request(_.input),Object.keys(P).forEach(function(Y){_.input.headers.append(Y,P[Y])});else{_.init=_i(_.init);var $=[];_.init.headers instanceof Headers?_.init.headers.forEach(function(Y,he){$.push([he,Y])}):Array.isArray(_.init.headers)?_.init.headers.forEach(function(Y){$.push(Y)}):_.init.headers&&Object.keys(_.init.headers).forEach(function(Y){$.push([Y,_.init.headers[Y]])}),_.init.headers=$.concat(Ut(P))}})},traceXhr:function(_,P){return Bi(h,_,b,function(A){Object.keys(A).forEach(function($){P.setRequestHeader($,A[$])})})}}}function Bi(h,b,_,P){if(!(!El()||!_.findTrackedSession())){var A=mt(h.allowedTracingUrls,function($){return zm([$.match],b.url,!0)});A&&(b.traceId=new D0,b.spanId=new D0,b.traceSampled=!ps(h.traceSampleRate)||Gr(h.traceSampleRate),P(Wd(b.traceId,b.spanId,b.traceSampled,A.propagatorTypes)))}}function El(){return Um()!==void 0}function Um(){return window.crypto||window.msCrypto}function Wd(h,b,_,P){var A={};return P.forEach(function($){switch($){case"datadog":{ze(A,{"x-datadog-origin":"rum","x-datadog-parent-id":b.toDecimalString(),"x-datadog-sampling-priority":_?"1":"0","x-datadog-trace-id":h.toDecimalString()});break}case"tracecontext":{ze(A,{traceparent:"00-0000000000000000".concat(h.toPaddedHexadecimalString(),"-").concat(b.toPaddedHexadecimalString(),"-0").concat(_?"1":"0")});break}case"b3":{ze(A,{b3:"".concat(h.toPaddedHexadecimalString(),"-").concat(b.toPaddedHexadecimalString(),"-").concat(_?"1":"0")});break}case"b3multi":{ze(A,{"X-B3-TraceId":h.toPaddedHexadecimalString(),"X-B3-SpanId":b.toPaddedHexadecimalString(),"X-B3-Sampled":_?"1":"0"});break}}}),A}var D0=function(){function h(){this.buffer=new Uint8Array(8),Um().getRandomValues(this.buffer),this.buffer[0]=this.buffer[0]&127}return h.prototype.toString=function(b){var _=this.readInt32(0),P=this.readInt32(4),A="";do{var $=_%b*4294967296+P;_=Math.floor(_/b),P=Math.floor($/b),A=($%b).toString(b)+A}while(_||P);return A},h.prototype.toDecimalString=function(){return this.toString(10)},h.prototype.toPaddedHexadecimalString=function(){var b=this.toString(16);return Array(17-b.length).join("0")+b},h.prototype.readInt32=function(b){return this.buffer[b]*16777216+(this.buffer[b+1]<<16)+(this.buffer[b+2]<<8)+this.buffer[b+3]},h}();function Dy(h){var b,_,P,A,$,Y;if(!h.applicationId){W.error("Application ID is not configured, no RUM data will be collected.");return}if(h.sessionReplaySampleRate!==void 0&&!no(h.sessionReplaySampleRate)){W.error("Session Replay Sample Rate should be a number between 0 and 100");return}var he=(b=h.premiumSampleRate)!==null&&b!==void 0?b:h.replaySampleRate;if(he!==void 0&&h.sessionReplaySampleRate!==void 0&&(W.warn("Ignoring Premium Sample Rate because Session Replay Sample Rate is set"),he=void 0),he!==void 0&&!no(he)){W.error("Premium Sample Rate should be a number between 0 and 100");return}var me=(_=h.traceSampleRate)!==null&&_!==void 0?_:h.tracingSampleRate;if(me!==void 0&&!no(me)){W.error("Trace Sample Rate should be a number between 0 and 100");return}if(h.excludedActivityUrls!==void 0&&!Array.isArray(h.excludedActivityUrls)){W.error("Excluded Activity Urls should be an array");return}var Ae=M0(h);if(Ae){var Ge=I0(h);if(Ge){var ht=!!((P=h.trackUserInteractions)!==null&&P!==void 0?P:h.trackInteractions),jt=!!h.trackFrustrations;return ze({applicationId:h.applicationId,version:h.version,actionNameAttribute:h.actionNameAttribute,sessionReplaySampleRate:($=(A=h.sessionReplaySampleRate)!==null&&A!==void 0?A:he)!==null&&$!==void 0?$:100,oldPlansBehavior:h.sessionReplaySampleRate===void 0,traceSampleRate:me,allowedTracingUrls:Ae,excludedActivityUrls:(Y=h.excludedActivityUrls)!==null&&Y!==void 0?Y:[],workerUrl:h.workerUrl,trackUserInteractions:ht||jt,trackFrustrations:jt,trackViewsManually:!!h.trackViewsManually,trackResources:h.trackResources,trackLongTasks:h.trackLongTasks,subdomain:h.subdomain,defaultPrivacyLevel:Cc(td,h.defaultPrivacyLevel)?h.defaultPrivacyLevel:td.MASK_USER_INPUT,customerDataTelemetrySampleRate:1},Ge)}}}function M0(h){if(h.allowedTracingUrls!==void 0&&h.allowedTracingOrigins!==void 0&&W.warn("Both allowedTracingUrls and allowedTracingOrigins (deprecated) have been defined. The parameter allowedTracingUrls will override allowedTracingOrigins."),h.allowedTracingUrls!==void 0){if(!Array.isArray(h.allowedTracingUrls)){W.error("Allowed Tracing URLs should be an array");return}if(h.allowedTracingUrls.length!==0&&h.service===void 0){W.error("Service needs to be configured when tracing is enabled");return}var b=[];return h.allowedTracingUrls.forEach(function(P){Fm(P)?b.push({match:P,propagatorTypes:["datadog"]}):rh(P)?b.push(P):W.warn("Allowed Tracing Urls parameters should be a string, RegExp, function, or an object. Ignoring parameter",P)}),b}if(h.allowedTracingOrigins!==void 0){if(!Array.isArray(h.allowedTracingOrigins)){W.error("Allowed Tracing Origins should be an array");return}if(h.allowedTracingOrigins.length!==0&&h.service===void 0){W.error("Service needs to be configured when tracing is enabled");return}var _=[];return h.allowedTracingOrigins.forEach(function(P){var A=Vw(P);A&&_.push(A)}),_}return[]}function Vw(h){var b;if(typeof h=="string"?b=h:h instanceof RegExp?b=function(_){return h.test(Lm(_))}:typeof h=="function"&&(b=function(_){return h(Lm(_))}),b===void 0){W.warn("Allowed Tracing Origins parameters should be a string, RegExp or function. Ignoring parameter",h);return}return{match:b,propagatorTypes:["datadog"]}}function Hw(h){var b=new Set;return Array.isArray(h.allowedTracingUrls)&&h.allowedTracingUrls.length>0&&h.allowedTracingUrls.forEach(function(_){Fm(_)?b.add("datadog"):ar(_)==="object"&&Array.isArray(_.propagatorTypes)&&_.propagatorTypes.forEach(function(P){return b.add(P)})}),Array.isArray(h.allowedTracingOrigins)&&h.allowedTracingOrigins.length>0&&b.add("datadog"),vt(b)}function Xf(h){var b,_,P=j0(h);return ze({premium_sample_rate:h.premiumSampleRate,replay_sample_rate:h.replaySampleRate,session_replay_sample_rate:h.sessionReplaySampleRate,trace_sample_rate:(b=h.traceSampleRate)!==null&&b!==void 0?b:h.tracingSampleRate,action_name_attribute:h.actionNameAttribute,use_allowed_tracing_origins:Array.isArray(h.allowedTracingOrigins)&&h.allowedTracingOrigins.length>0,use_allowed_tracing_urls:Array.isArray(h.allowedTracingUrls)&&h.allowedTracingUrls.length>0,selected_tracing_propagators:Hw(h),default_privacy_level:h.defaultPrivacyLevel,use_excluded_activity_urls:Array.isArray(h.excludedActivityUrls)&&h.excludedActivityUrls.length>0,use_worker_url:!!h.workerUrl,track_frustrations:h.trackFrustrations,track_views_manually:h.trackViewsManually,track_user_interactions:(_=h.trackUserInteractions)!==null&&_!==void 0?_:h.trackInteractions},P)}function sh(h,b,_){return{context:h.getContext(),user:b.getContext(),hasReplay:_.isRecording()?!0:void 0}}var qd="rum";function Bm(h,b,_){var P=_===void 0?{}:_,A=P.ignoreInitIfSyntheticsWillInjectRum,$=A===void 0?!0:A,Y=!1,he=gt(2),me=gt(1),Ae=function(){},Ge=function(){},ht=rr,jt=function(){},an=new cs,sn=function(ur,Br){Br===void 0&&(Br=Vs()),an.add(function(){return sn(ur,Br)})},kn=function(ur,Br){Br===void 0&&(Br=qo()),an.add(function(){return kn(ur,Br)})},is=function(ur,Br){Br===void 0&&(Br=sh(he,me,b)),an.add(function(){return is(ur,Br)})},Ns=function(ur,Br){Br===void 0&&(Br=sh(he,me,b)),an.add(function(){return Ns(ur,Br)})},co=function(ur,Br){an.add(function(){return co(ur,Br)})};function da(ur){if(!ur){W.error("Missing configuration");return}if(Ge=function(){return Ts(ur)},!($&&Oe())){var Br=bt();if(Br&&(ur=Yr(ur)),!!vi(ur)){var yi=Dy(ur);if(yi){if(!Br&&!yi.sessionStoreStrategyType){W.warn("No storage available for session. We will not send any data.");return}if(!yi.trackViewsManually)Go(ur,yi);else{var lu=an;an=new cs,kn=function(cu){Go(ur,yi,cu)},lu.drain()}Y=!0}}}}function Go(ur,Br,yi){if(ur.storeContextsAcrossPages){var lu=he.getContext();he=hn(Br,qd,2),he.setContext(Zr(he.getContext(),lu));var cu=me.getContext();me=hn(Br,qd,1),me.setContext(Zr(me.getContext(),cu))}var Or=h(ur,Br,b,he,me,yi);jt=function(){return b.getSessionReplayLink(Br,Or.session,Or.viewContexts)},kn=Or.startView,is=Or.addAction,Ns=Or.addError,sn=Or.addTiming,co=Or.addFeatureFlagEvaluation,Ae=Or.getInternalContext,ht=Or.stopSession,an.drain(),b.onRumStart(Or.lifeCycle,Br,Or.session,Or.viewContexts)}var Fr=te(function(ur){var Br=typeof ur=="object"?ur:{name:ur};kn(Br)}),zr=je({init:te(da),addRumGlobalContext:te(function(ur,Br){return he.add(ur,Br)}),setGlobalContextProperty:te(function(ur,Br){return he.setContextProperty(ur,Br)}),removeRumGlobalContext:te(function(ur){return he.remove(ur)}),removeGlobalContextProperty:te(function(ur){return he.removeContextProperty(ur)}),getRumGlobalContext:te(function(){return he.get()}),getGlobalContext:te(function(){return he.getContext()}),setRumGlobalContext:te(function(ur){return he.set(ur)}),setGlobalContext:te(function(ur){return he.setContext(ur)}),clearGlobalContext:te(function(){return he.clearContext()}),getInternalContext:te(function(ur){return Ae(ur)}),getInitConfiguration:te(function(){return Ge()}),addAction:te(function(ur,Br){is({name:Xn(ur),context:Xn(Br),startClocks:qo(),type:"custom"})}),addError:function(ur,Br){var yi=so();Re(function(){Ns({error:ur,handlingStack:yi,context:Xn(Br),startClocks:qo()})})},addTiming:te(function(ur,Br){sn(Xn(ur),Br)}),setUser:te(function(ur){Ce(ur)&&me.setContext(di(ur))}),getUser:te(function(){return me.getContext()}),setUserProperty:te(function(ur,Br){var yi,lu=di((yi={},yi[ur]=Br,yi))[ur];me.setContextProperty(ur,lu)}),removeUserProperty:te(function(ur){return me.removeContextProperty(ur)}),removeUser:te(function(){return me.clearContext()}),clearUser:te(function(){return me.clearContext()}),startView:Fr,stopSession:te(function(){ht()}),startSessionReplayRecording:te(b.start),stopSessionReplayRecording:te(b.stop),addFeatureFlagEvaluation:te(function(ur,Br){co(Xn(ur),Xn(Br))}),getSessionReplayLink:te(function(){return jt()})});return zr;function vi(ur){return Y?(ur.silentMultipleInit||W.error("DD_RUM is already initialized."),!1):!0}function Yr(ur){return ze({},ur,{applicationId:"00000000-aaaa-0000-aaaa-000000000000",clientToken:"empty",sessionSampleRate:100})}}function Vm(h,b){var _=window.__ddBrowserSdkExtensionCallback;_&&_({type:h,payload:b})}var Kd={log:"log",configuration:"configuration"},Gd=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","https://d3uc069fcn7uxw.cloudfront.net","https://d20xtzwzcl0ceb.cloudfront.net","http://localhost","<anonymous>"],Hm=[ks],ol={maxEventsPerPage:0,sentEventCount:0,telemetryEnabled:!1,telemetryConfigurationEnabled:!1},Cu;function My(h,b){var _,P=new Jn;ol.telemetryEnabled=!$e(Hm,b.site)&&Gr(b.telemetrySampleRate),ol.telemetryConfigurationEnabled=ol.telemetryEnabled&&Gr(b.telemetryConfigurationSampleRate);var A=Zf();Cu=function(Y){if(ol.telemetryEnabled){var he=$(h,Y,A);P.notify(he),Vm("telemetry",he)}},ge(Ta),ze(ol,{maxEventsPerPage:b.maxTelemetryEventsPerPage,sentEventCount:0});function $(Y,he,me){return Zr({type:"telemetry",date:Vs(),service:Y,version:"4.50.1",source:"browser",_dd:{format_version:2},telemetry:Zr(he,{runtime_env:me}),experimental_features:vt(yu())},_!==void 0?_():{})}return{setContextProvider:function(Y){_=Y},observable:P,enabled:ol.telemetryEnabled}}function Zf(){return{is_local_file:window.location.protocol==="file:",is_worker:"WorkerGlobalScope"in self}}function Ww(){var h=[];return assign(ol,{maxEventsPerPage:1/0,sentEventCount:0}),Cu=function(b){h.push(b)},h}function $y(){Cu=void 0}function Ly(h){return h.site===or}function hi(h,b){Ie(we.debug,h,b),nd(ze({type:Kd.log,message:h,status:"debug"},b))}function Ta(h,b){nd(ze({type:Kd.log,status:"error"},qw(h),b))}function $r(h){ol.telemetryConfigurationEnabled&&nd({type:Kd.configuration,configuration:h})}function nd(h){Cu&&ol.sentEventCount<ol.maxEventsPerPage&&(ol.sentEventCount+=1,Cu(h))}function qw(h){if(h instanceof Error){var b=Mn(h);return{error:{kind:b.name,stack:Ma(Kw(b))},message:b.message}}return{error:{stack:io},message:"".concat("Uncaught"," ").concat(rt(h))}}function Kw(h){return h.stack=h.stack.filter(function(b){return!b.url||Gd.some(function(_){return Xe(b.url,_)})}),h}var ia={HIDDEN:"visibility_hidden",UNLOADING:"before_unload",PAGEHIDE:"page_hide",FROZEN:"page_frozen"};function Fy(h){var b=new Jn(function(){var _=ko(I.PAGEHIDE),P=_t(h,window,["visibilitychange","freeze","pagehide"],function($){$.type==="pagehide"&&_?b.notify({reason:ia.PAGEHIDE}):$.type==="visibilitychange"&&document.visibilityState==="hidden"?b.notify({reason:ia.HIDDEN}):$.type==="freeze"&&b.notify({reason:ia.FROZEN})},{capture:!0}).stop,A=rr;return _||(A=pt(h,window,"beforeunload",function(){b.notify({reason:ia.UNLOADING})}).stop),function(){P(),A()}});return b}function Wm(h){return $e(nn(ia),h)}function $0(){var h=vo(),b=new Jn(function(){if(h){var _=new h(te(function(){return b.notify()}));return _.observe(document,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),function(){return _.disconnect()}}});return b}function vo(){var h,b=window;if(b.Zone&&(h=Pe(b,"MutationObserver"),b.MutationObserver&&h===b.MutationObserver)){var _=new b.MutationObserver(rr),P=Pe(_,"originalInstance");h=P&&P.constructor}return h||(h=b.MutationObserver),h}function oh(h,b,_){if(document.readyState===b||document.readyState==="complete")_();else{var P=b==="complete"?"load":"DOMContentLoaded";pt(h,window,P,_,{once:!0})}}var Qd="initial_document",ah=[["document",function(h){return Qd===h}],["xhr",function(h){return h==="xmlhttprequest"}],["fetch",function(h){return h==="fetch"}],["beacon",function(h){return h==="beacon"}],["css",function(h,b){return/\.css$/i.test(b)}],["js",function(h,b){return/\.js$/i.test(b)}],["image",function(h,b){return $e(["image","img","icon"],h)||/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i.exec(b)!==null}],["font",function(h,b){return/\.(woff|eot|woff2|ttf)$/i.exec(b)!==null}],["media",function(h,b){return $e(["audio","video"],h)||/\.(mp3|mp4)$/i.exec(b)!==null}]];function al(h){var b=h.name;if(!ed(b))return hi('Failed to construct URL for "'.concat(h.name,'"')),"other";for(var _=zi(b),P=0,A=ah;P<A.length;P++){var $=A[P],Y=$[0],he=$[1];if(he(h.initiatorType,_))return Y}return"other"}function Jf(){for(var h=[],b=0;b<arguments.length;b++)h[b]=arguments[b];for(var _=1;_<h.length;_+=1)if(h[_-1]>h[_])return!1;return!0}function rd(h){return h.initiatorType==="xmlhttprequest"||h.initiatorType==="fetch"}function Yd(h){var b=h.duration,_=h.startTime,P=h.responseEnd;return b===0&&_<P?Dn(Wn(_,P)):Dn(b)}function Zc(h){var b=qm(h);if(b){var _=b.startTime,P=b.fetchStart,A=b.redirectStart,$=b.redirectEnd,Y=b.domainLookupStart,he=b.domainLookupEnd,me=b.connectStart,Ae=b.secureConnectionStart,Ge=b.connectEnd,ht=b.requestStart,jt=b.responseStart,an=b.responseEnd,sn={download:Xd(_,jt,an),first_byte:Xd(_,ht,jt)};return Ge!==P&&(sn.connect=Xd(_,me,Ge),Jf(me,Ae,Ge)&&(sn.ssl=Xd(_,Ae,Ge))),he!==P&&(sn.dns=Xd(_,Y,he)),L0(h)&&(sn.redirect=Xd(_,A,$)),sn}}function qm(h){if(Jf(h.startTime,h.fetchStart,h.domainLookupStart,h.domainLookupEnd,h.connectStart,h.connectEnd,h.requestStart,h.responseStart,h.responseEnd)){if(!L0(h))return h;var b=h.redirectStart,_=h.redirectEnd;if(b<h.startTime&&(b=h.startTime),_<h.startTime&&(_=h.fetchStart),!!Jf(h.startTime,b,_,h.fetchStart))return ze({},h,{redirectEnd:_,redirectStart:b})}}function L0(h){return h.fetchStart!==h.startTime}function Xd(h,b,_){return{duration:Dn(Wn(b,_)),start:Dn(Wn(h,b))}}function F0(h){if(h.startTime<h.responseStart)return h.decodedBodySize}function Zd(h,b){return b&&!h.isIntakeUrl(b)}function Eu(h){return h.nodeType===Node.TEXT_NODE}function Km(h){return h.nodeType===Node.COMMENT_NODE}function Yl(h){return h.nodeType===Node.ELEMENT_NODE}function Jd(h){return Yl(h)&&Boolean(h.shadowRoot)}function ep(h){var b=h;return!!b.host&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&Yl(b.host)}function Gm(h){return h.childNodes.length>0||Jd(h)}function Qm(h,b){h.childNodes.forEach(b),Jd(h)&&b(h.shadowRoot)}function ih(h){return ep(h)?h.host:h.parentNode}var Gw=2*ss;function z0(h){var b=Tu(h)||U0(h);if(!(!b||b.traceTime<=Dr()-Gw))return b.traceId}function Tu(h){var b=h.querySelector("meta[name=dd-trace-id]"),_=h.querySelector("meta[name=dd-trace-time]");return ef(b&&b.content,_&&_.content)}function U0(h){var b=Xl(h);if(b)return ef(pe(b,"trace-id"),pe(b,"trace-time"))}function ef(h,b){var _=b&&Number(b);if(!(!h||!_))return{traceId:h,traceTime:_}}function Xl(h){for(var b=0;b<h.childNodes.length;b+=1){var _=tf(h.childNodes[b]);if(_)return _}if(h.body)for(var b=h.body.childNodes.length-1;b>=0;b-=1){var P=h.body.childNodes[b],_=tf(P);if(_)return _;if(!Eu(P))break}}function tf(h){if(h&&Km(h)){var b=/^\s*DATADOG;(.*?)\s*$/.exec(h.data);if(b)return b[1]}}var Ss;(function(h){h.EVENT="event",h.FIRST_INPUT="first-input",h.LARGEST_CONTENTFUL_PAINT="largest-contentful-paint",h.LAYOUT_SHIFT="layout-shift",h.LONG_TASK="longtask",h.NAVIGATION="navigation",h.PAINT="paint",h.RESOURCE="resource"})(Ss||(Ss={}));function tp(){return window.performance!==void 0&&"getEntries"in performance}function lh(h){return window.PerformanceObserver&&PerformanceObserver.supportedEntryTypes!==void 0&&PerformanceObserver.supportedEntryTypes.includes(h)}function ku(h,b){if(nf(b,function(he){sd(h,b,[he])}),tp()){var _=performance.getEntries();yt(function(){return sd(h,b,_)})}if(window.PerformanceObserver){var P=te(function(he){return sd(h,b,he.getEntries())}),A=[Ss.RESOURCE,Ss.NAVIGATION,Ss.LONG_TASK,Ss.PAINT],$=[Ss.LARGEST_CONTENTFUL_PAINT,Ss.FIRST_INPUT,Ss.LAYOUT_SHIFT,Ss.EVENT];try{$.forEach(function(he){var me=new window.PerformanceObserver(P);me.observe({type:he,buffered:!0,durationThreshold:40})})}catch{A.push.apply(A,$)}var Y=new PerformanceObserver(P);Y.observe({entryTypes:A}),tp()&&"addEventListener"in performance&&pt(b,performance,"resourcetimingbufferfull",function(){performance.clearResourceTimings()})}lh(Ss.NAVIGATION)||rf(b,function(he){sd(h,b,[he])}),lh(Ss.FIRST_INPUT)||np(b,function(he){sd(h,b,[he])})}function nf(h,b){oh(h,"interactive",function(){var _,P={entryType:Ss.RESOURCE,initiatorType:Qd,traceId:z0(document),toJSON:function(){return ze({},_,{toJSON:void 0})}};if(lh(Ss.NAVIGATION)&&performance.getEntriesByType(Ss.NAVIGATION).length>0){var A=performance.getEntriesByType(Ss.NAVIGATION)[0];_=ze(A.toJSON(),P)}else{var $=sf();_=ze($,{decodedBodySize:0,duration:$.responseEnd,name:window.location.href,startTime:0},P)}b(_)})}function rf(h,b){function _(){b(ze(sf(),{entryType:Ss.NAVIGATION}))}oh(h,"complete",function(){yt(_)})}function np(h,b){var _=Dr(),P=!1,A=_t(h,window,["click","mousedown","keydown","touchstart","pointerdown"],function(he){if(he.cancelable){var me={entryType:Ss.FIRST_INPUT,processingStart:Mo(),processingEnd:Mo(),startTime:he.timeStamp,duration:0,name:""};he.type==="pointerdown"?$(h,me):Y(me)}},{passive:!0,capture:!0}).stop;function $(he,me){_t(he,window,["pointerup","pointercancel"],function(Ae){Ae.type==="pointerup"&&Y(me)},{once:!0})}function Y(he){if(!P){P=!0,A();var me=he.processingStart-he.startTime;me>=0&&me<Dr()-_&&b(he)}}}function sf(){var h={},b=performance.timing;for(var _ in b)if(ps(b[_])){var P=_,A=b[P];h[P]=A===0?0:Qe(A)}return h}function sd(h,b,_){var P=_.filter(function($){return Cc(Ss,$.entryType)}),A=P.filter(function($){return!Ac($)&&!Ru(b,$)});A.length&&h.notify(0,A)}function Ac(h){return h.entryType===Ss.NAVIGATION&&h.loadEventEnd<=0}function Ru(h,b){return b.entryType===Ss.RESOURCE&&!Zd(h,b.name)}var lo={AGENT:"agent",CONSOLE:"console",CUSTOM:"custom",LOGGER:"logger",NETWORK:"network",SOURCE:"source",REPORT:"report"};function Co(h,b,_){var P=0,A=!1;return{isLimitReached:function(){if(P===0&&yt(function(){P=0},ss),P+=1,P<=b||A)return A=!1,!1;if(P===b+1){A=!0;try{_({message:"Reached max number of ".concat(h,"s by minute: ").concat(b),source:lo.AGENT,startClocks:qo()})}finally{A=!1}}return!0}}}function od(){var h=Be(),b=et();if(h&&b)return{test_id:h,result_id:b,injected:Oe()}}function Si(){var h,b=(h=window.Cypress)===null||h===void 0?void 0:h.env("traceId");if(typeof b=="string")return{test_execution_id:b}}function il(h,b,_){var P=Ts(h),A=_(P);return Ut(b).forEach(function($){var Y=$[0],he=$[1],me=ad(P,Y),Ae=ar(me);Ae===he?id(h,Y,Xn(me)):he==="object"&&(Ae==="undefined"||Ae==="null")&&id(h,Y,{})}),A}function ad(h,b){for(var _=h,P=0,A=b.split(".");P<A.length;P++){var $=A[P];if(!Ym(_,$))return;_=_[$]}return _}function id(h,b,_){for(var P=h,A=b.split("."),$=0;$<A.length;$+=1){var Y=A[$];if(!ka(P))return;$!==A.length-1?P=P[Y]:P[Y]=_}}function ka(h){return ar(h)==="object"}function Ym(h,b){return ka(h)&&Object.prototype.hasOwnProperty.call(h,b)}var of={"view.name":"string","view.url":"string","view.referrer":"string"},ch={context:"object"},Ic;function af(h,b,_,P,A,$,Y,he,me){var Ae,Ge;Ic=(Ae={},Ae.view=of,Ae.error=ze({"error.message":"string","error.stack":"string","error.resource.url":"string","error.fingerprint":"string"},ch,of),Ae.resource=ze({"resource.url":"string"},ch,of),Ae.action=ze({"action.target.name":"string"},ch,of),Ae.long_task=ze({},ch,of),Ae);var ht=(Ge={},Ge.error=Co("error",h.eventRateLimiterThreshold,me),Ge.action=Co("action",h.eventRateLimiterThreshold,me),Ge),jt=od(),an=Si();b.subscribe(10,function(sn){var kn=sn.startTime,is=sn.rawRumEvent,Ns=sn.domainContext,co=sn.savedCommonContext,da=sn.customerContext,Go=P.findView(kn),Fr=A.findUrl(kn),zr=_.findTrackedSession(kn);if(zr&&Go&&Fr){var vi=co||he(),Yr=$.findActionId(kn),ur={_dd:{format_version:2,drift:jr(),session:{plan:zr.plan},configuration:{session_sample_rate:xr(h.sessionSampleRate,3),session_replay_sample_rate:xr(h.sessionReplaySampleRate,3)},browser_sdk_version:bt()?"4.50.1":void 0},application:{id:h.applicationId},date:Vs(),service:Go.service||h.service,version:Go.version||h.version,source:"browser",session:{id:zr.id,type:jt?"synthetics":an?"ci_test":"user"},view:{id:Go.id,name:Go.name,url:Fr.url,referrer:Fr.referrer},action:ld(is)&&Yr?{id:Yr}:void 0,synthetics:jt,ci_test:an,display:Y.get()},Br=Zr(ur,is);Br.context=Zr(vi.context,da),"has_replay"in Br.session||(Br.session.has_replay=vi.hasReplay),cr(vi.user)||(Br.usr=vi.user),Pu(Br,h.beforeSend,Ns,ht)&&(cr(Br.context)&&delete Br.context,b.notify(11,Br))}})}function Pu(h,b,_,P){var A;if(b){var $=il(h,Ic[h.type],function(he){return b(he,_)});if($===!1&&h.type!=="view")return!1;$===!1&&W.warn("Can't dismiss view events using beforeSend!")}var Y=(A=P[h.type])===null||A===void 0?void 0:A.isLimitReached();return!Y}function ld(h){return["error","resource","long_task"].indexOf(h.type)!==-1}function rp(h,b,_,P,A){return{get:function($){var Y=_.findView($),he=A.findUrl($),me=b.findTrackedSession($);if(me&&Y&&he){var Ae=P.findActionId($);return{application_id:h,session_id:me.id,user_action:Ae?{id:Ae}:void 0,view:{id:Y.id,name:Y.name,referrer:he.referrer,url:he.url}}}}}}var B0=function(){function h(){this.callbacks={}}return h.prototype.notify=function(b,_){var P=this.callbacks[b];P&&P.forEach(function(A){return A(_)})},h.prototype.subscribe=function(b,_){var P=this;return this.callbacks[b]||(this.callbacks[b]=[]),this.callbacks[b].push(_),{unsubscribe:function(){P.callbacks[b]=P.callbacks[b].filter(function(A){return _!==A})}}},h}(),zy=B0,Zl=1/0,lf=ss,Tl=function(){function h(b,_){var P=this;this.expireDelay=b,this.maxEntries=_,this.entries=[],this.clearOldValuesInterval=Rn(function(){return P.clearOldValues()},lf)}return h.prototype.add=function(b,_){var P=this,A={value:b,startTime:_,endTime:Zl,remove:function(){var $=P.entries.indexOf(A);$>=0&&P.entries.splice($,1)},close:function($){A.endTime=$}};return this.maxEntries&&this.entries.length>=this.maxEntries&&this.entries.pop(),this.entries.unshift(A),A},h.prototype.find=function(b){b===void 0&&(b=Zl);for(var _=0,P=this.entries;_<P.length;_++){var A=P[_];if(A.startTime<=b){if(b<=A.endTime)return A.value;break}}},h.prototype.closeActive=function(b){var _=this.entries[0];_&&_.endTime===Zl&&_.close(b)},h.prototype.findAll=function(b,_){b===void 0&&(b=Zl),_===void 0&&(_=0);var P=Me(b,_);return this.entries.filter(function(A){return A.startTime<=P&&b<=A.endTime}).map(function(A){return A.value})},h.prototype.reset=function(){this.entries=[]},h.prototype.stop=function(){Yn(this.clearOldValuesInterval)},h.prototype.clearOldValues=function(){for(var b=Mo()-this.expireDelay;this.entries.length>0&&this.entries[this.entries.length-1].endTime<b;)this.entries.pop()},h}(),uh=tn;function Xm(h){var b=new Tl(uh);h.subscribe(2,function(P){b.add(_(P),P.startClocks.relative)}),h.subscribe(4,function(P){var A=P.endClocks;b.closeActive(A.relative)}),h.subscribe(8,function(){b.reset()});function _(P){return{service:P.service,version:P.version,id:P.id,name:P.name,startClocks:P.startClocks}}return{findView:function(P){return b.find(P)},stop:function(){b.stop()}}}function kl(h,b,_){var P=h[b],A=_(P),$=function(){if(typeof A=="function")return A.apply(this,arguments)};return h[b]=$,{stop:function(){h[b]===$?h[b]=P:A=P}}}function Xo(h,b,_){var P=_.before,A=_.after;return kl(h,b,function($){return function(){var Y=arguments,he;return P&&Re(P,this,Y),typeof $=="function"&&(he=$.apply(this,Y)),A&&Re(A,this,Y),he}})}function Rl(h,b,_){var P=Object.getOwnPropertyDescriptor(h,b);if(!P||!P.set||!P.configurable)return{stop:rr};var A=function(Y,he){yt(function(){_(Y,he)},0)},$=function(Y){P.set.call(this,Y),A(this,Y)};return Object.defineProperty(h,b,{set:$}),{stop:function(){var Y;((Y=Object.getOwnPropertyDescriptor(h,b))===null||Y===void 0?void 0:Y.set)===$?Object.defineProperty(h,b,P):A=rr}}}var Vi,Jl=new WeakMap;function cf(h){return Vi||(Vi=V0(h)),Vi}function V0(h){var b=new Jn(function(){var _=Xo(XMLHttpRequest.prototype,"open",{before:H0}).stop,P=Xo(XMLHttpRequest.prototype,"send",{before:function(){W0.call(this,h,b)}}).stop,A=Xo(XMLHttpRequest.prototype,"abort",{before:mi}).stop;return function(){_(),P(),A()}});return b}function H0(h,b){Jl.set(this,{state:"open",method:h,url:Ju(String(b))})}function W0(h,b){var _=this,P=Jl.get(this);if(P){var A=P;A.state="start",A.startTime=Mo(),A.startClocks=qo(),A.isAborted=!1,A.xhr=this;var $=!1,Y=Xo(this,"onreadystatechange",{before:function(){this.readyState===XMLHttpRequest.DONE&&he()}}).stop,he=function(){if(me(),Y(),!$){$=!0;var Ae=P;Ae.state="complete",Ae.duration=Wn(A.startClocks.timeStamp,Vs()),Ae.status=_.status,b.notify(_i(Ae))}},me=pt(h,this,"loadend",he).stop;b.notify(A)}}function mi(){var h=Jl.get(this);h&&(h.isAborted=!0)}var Ci;function Uo(){return Ci||(Ci=ec()),Ci}function ec(){var h=new Jn(function(){if(window.fetch){var b=kl(window,"fetch",function(_){return function(P,A){var $,Y=Re(q0,null,[h,P,A]);return Y?($=_.call(this,Y.input,Y.init),Re(dh,null,[h,$,Y])):$=_.call(this,P,A),$}}).stop;return b}});return h}function q0(h,b,_){var P=_&&_.method||b instanceof Request&&b.method||"GET",A=b instanceof Request?b.url:Ju(String(b)),$=qo(),Y={state:"start",init:_,input:b,method:P,startClocks:$,url:A};return h.notify(Y),Y}function dh(h,b,_){var P=function(A){var $=_;$.state="resolve","stack"in A||A instanceof Error?($.status=0,$.isAborted=A instanceof DOMException&&A.code===DOMException.ABORT_ERR,$.error=A):"status"in A&&($.response=A,$.responseType=A.type,$.status=A.status,$.isAborted=!1),h.notify($)};b.then(te(P),te(P))}function uf(h){return h>=500}function Zm(h){try{return h.clone()}catch{return}}function fh(h,b,_){var P=h.getReader(),A=[],$=0;Y();function Y(){P.read().then(te(function(me){if(me.done){he();return}_.collectStreamBody&&A.push(me.value),$+=me.value.length,$>_.bytesLimit?he():Y()}),te(function(me){return b(me)}))}function he(){P.cancel().catch(rr);var me,Ae;if(_.collectStreamBody){var Ge;if(A.length===1)Ge=A[0];else{Ge=new Uint8Array($);var ht=0;A.forEach(function(jt){Ge.set(jt,ht),ht+=jt.length})}me=Ge.slice(0,_.bytesLimit),Ae=Ge.length>_.bytesLimit}b(void 0,me,Ae)}}var Ou=1;function Jm(h,b,_){var P=Bw(b,_);df(h,b,P),eg(h,b,P)}function df(h,b,_){var P=cf(b).subscribe(function(A){var $=A;if(Zd(b,$.url))switch($.state){case"start":_.traceXhr($,$.xhr),$.requestIndex=Uy(),h.notify(5,{requestIndex:$.requestIndex,url:$.url});break;case"complete":_.clearTracingIfNeeded($),h.notify(6,{duration:$.duration,method:$.method,requestIndex:$.requestIndex,spanId:$.spanId,startClocks:$.startClocks,status:$.status,traceId:$.traceId,traceSampled:$.traceSampled,type:"xhr",url:$.url,xhr:$.xhr});break}});return{stop:function(){return P.unsubscribe()}}}function eg(h,b,_){var P=Uo().subscribe(function(A){var $=A;if(Zd(b,$.url))switch($.state){case"start":_.traceFetch($),$.requestIndex=Uy(),h.notify(5,{requestIndex:$.requestIndex,url:$.url});break;case"resolve":Eo($,function(Y){_.clearTracingIfNeeded($),h.notify(6,{duration:Y,method:$.method,requestIndex:$.requestIndex,responseType:$.responseType,spanId:$.spanId,startClocks:$.startClocks,status:$.status,traceId:$.traceId,traceSampled:$.traceSampled,type:"fetch",url:$.url,response:$.response,init:$.init,input:$.input})});break}});return{stop:function(){return P.unsubscribe()}}}function Uy(){var h=Ou;return Ou+=1,h}function Eo(h,b){var _=h.response&&Zm(h.response);!_||!_.body?b(Wn(h.startClocks.timeStamp,Vs())):fh(_.body,function(){b(Wn(h.startClocks.timeStamp,Vs()))},{bytesLimit:Number.POSITIVE_INFINITY,collectStreamBody:!1})}function jc(h){var b=h.lifeCycle,_=h.isChildEvent,P=h.onChange,A=P===void 0?rr:P,$={errorCount:0,longTaskCount:0,resourceCount:0,actionCount:0,frustrationCount:0},Y=b.subscribe(11,function(he){var me;if(!(he.type==="view"||!_(he)))switch(he.type){case"error":$.errorCount+=1,A();break;case"action":$.actionCount+=1,he.action.frustration&&($.frustrationCount+=he.action.frustration.type.length),A();break;case"long_task":$.longTaskCount+=1,A();break;case"resource":!((me=he._dd)===null||me===void 0)&&me.discarded||($.resourceCount+=1,A());break}});return{stop:function(){Y.unsubscribe()},eventCounts:$}}var sp=100,K0=100;function Jc(h,b,_,P,A){var $=ph(h,b,_);return tg($,P,A)}function tg(h,b,_){var P,A=!1,$=yt(te(function(){return Ae({hadActivity:!1})}),sp),Y=_!==void 0?yt(te(function(){return Ae({hadActivity:!0,end:Vs()})}),_):void 0,he=h.subscribe(function(Ge){var ht=Ge.isBusy;un($),un(P);var jt=Vs();ht||(P=yt(te(function(){return Ae({hadActivity:!0,end:jt})}),K0))}),me=function(){A=!0,un($),un(P),un(Y),he.unsubscribe()};function Ae(Ge){A||(me(),b(Ge))}return{stop:me}}function ph(h,b,_){var P=new Jn(function(){var A=[],$,Y=0;A.push(b.subscribe(me),h.subscribe(0,function(Ae){Ae.some(function(Ge){return Ge.entryType===Ss.RESOURCE&&!ff(_,Ge.name)})&&me()}),h.subscribe(5,function(Ae){ff(_,Ae.url)||($===void 0&&($=Ae.requestIndex),Y+=1,me())}),h.subscribe(6,function(Ae){ff(_,Ae.url)||$===void 0||Ae.requestIndex<$||(Y-=1,me())}));var he=Nu(me).stop;return function(){he(),A.forEach(function(Ae){return Ae.unsubscribe()})};function me(){P.notify({isBusy:Y>0})}});return P}function ff(h,b){return zm(h.excludedActivityUrls,b)}function Nu(h){return Xo(window,"open",{before:h})}var pf="data-dd-action-name";function ng(h,b){return hh(h,pf)||b&&hh(h,b)||Au(h,b,rg)||Au(h,b,cd)||""}function hh(h,b){var _;if(yh())_=h.closest("[".concat(b,"]"));else for(var P=h;P;){if(P.hasAttribute(b)){_=P;break}P=P.parentElement}if(_){var A=_.getAttribute(b);return sg(mh(A.trim()))}}var rg=[function(h,b){if(Ys()){if("labels"in h&&h.labels&&h.labels.length>0)return ll(h.labels[0],b)}else if(h.id){var _=h.ownerDocument&&mt(h.ownerDocument.querySelectorAll("label"),function(P){return P.htmlFor===h.id});return _&&ll(_,b)}},function(h){if(h.nodeName==="INPUT"){var b=h,_=b.getAttribute("type");if(_==="button"||_==="submit"||_==="reset")return b.value}},function(h,b){if(h.nodeName==="BUTTON"||h.nodeName==="LABEL"||h.getAttribute("role")==="button")return ll(h,b)},function(h){return h.getAttribute("aria-label")},function(h,b){var _=h.getAttribute("aria-labelledby");if(_)return _.split(/\s+/).map(function(P){return eu(h,P)}).filter(function(P){return Boolean(P)}).map(function(P){return ll(P,b)}).join(" ")},function(h){return h.getAttribute("alt")},function(h){return h.getAttribute("name")},function(h){return h.getAttribute("title")},function(h){return h.getAttribute("placeholder")},function(h,b){if("options"in h&&h.options.length>0)return ll(h.options[0],b)}],cd=[function(h,b){return ll(h,b)}],Pl=10;function Au(h,b,_){for(var P=h,A=0;A<=Pl&&P&&P.nodeName!=="BODY"&&P.nodeName!=="HTML"&&P.nodeName!=="HEAD";){for(var $=0,Y=_;$<Y.length;$++){var he=Y[$],me=he(P,b);if(typeof me=="string"){var Ae=me.trim();if(Ae)return sg(mh(Ae))}}if(P.nodeName==="FORM")break;P=P.parentElement,A+=1}}function mh(h){return h.replace(/\s+/g," ")}function sg(h){return h.length>100?"".concat(le(h,100)," [...]"):h}function eu(h,b){return h.ownerDocument?h.ownerDocument.getElementById(b):null}function ll(h,b){if(!h.isContentEditable){if("innerText"in h){var _=h.innerText,P=function(A){for(var $=h.querySelectorAll(A),Y=0;Y<$.length;Y+=1){var he=$[Y];if("innerText"in he){var me=he.innerText;me&&me.trim().length>0&&(_=_.replace(me,""))}}};return gh()||P("script, style"),P("[".concat(pf,"]")),b&&P("[".concat(b,"]")),_}return h.textContent}}function gh(){return!ha()}var vh;function Ys(){return vh===void 0&&(vh="labels"in HTMLInputElement.prototype),vh}var tc;function yh(){return tc===void 0&&(tc="closest"in HTMLElement.prototype),tc}var og=[pf,"data-testid","data-test","data-qa","data-cy","data-test-id","data-qa-id","data-testing","data-component","data-element","data-source-file"],bh=[wh,ud],G0=[wh,op,dd];function tu(h,b){for(var _="",P=h;P&&P.nodeName!=="HTML";){var A=Q0(P,bh,ru,b,_);if(A)return A;var $=Q0(P,G0,Zo,b,_);_=$||Dc(nu(P),_),P=P.parentElement}return _}function ga(h){return/[0-9]/.test(h)}function ud(h){if(h.id&&!ga(h.id))return"#".concat(Vt(h.id))}function op(h){if(h.tagName!=="BODY"&&h.classList.length>0)for(var b=0;b<h.classList.length;b+=1){var _=h.classList[b];if(!ga(_))return"".concat(Vt(h.tagName),".").concat(Vt(_))}}function dd(h){return Vt(h.tagName)}function wh(h,b){if(b){var _=Y(b);if(_)return _}for(var P=0,A=og;P<A.length;P++){var $=A[P],_=Y($);if(_)return _}function Y(he){if(h.hasAttribute(he))return"".concat(Vt(h.tagName),"[").concat(he,'="').concat(Vt(h.getAttribute(he)),'"]')}}function nu(h){for(var b=h.parentElement.firstElementChild,_=1;b&&b!==h;)b.tagName===h.tagName&&(_+=1),b=b.nextElementSibling;return"".concat(Vt(h.tagName),":nth-of-type(").concat(_,")")}function Q0(h,b,_,P,A){for(var $=0,Y=b;$<Y.length;$++){var he=Y[$],me=he(h,P);if(me){var Ae=Dc(me,A);if(_(h,Ae))return Ae}}}function ru(h,b){return h.ownerDocument.querySelectorAll(b).length===1}function Zo(h,b){return h.parentElement.querySelectorAll(fd()?Dc(":scope",b):b).length===1}function Dc(h,b){return b?"".concat(h,">").concat(b):h}var Rs;function fd(){if(Rs===void 0)try{document.querySelector(":scope"),Rs=!0}catch{Rs=!1}return Rs}var Ol=ns,ag=100;function cl(h,b){var _=[],P=0,A;$(h);function $(me){me.stopObservable.subscribe(Y),_.push(me),un(A),A=yt(he,Ol)}function Y(){P===1&&_.every(function(me){return me.isStopped()})&&(P=2,b(_))}function he(){un(A),P===0&&(P=1,Y())}return{tryAppend:function(me){return P!==0?!1:_.length>0&&!Jo(_[_.length-1].event,me.event)?(he(),!1):($(me),!0)},stop:function(){he()}}}function Jo(h,b){return h.target===b.target&&Ra(h,b)<=ag&&h.timeStamp-b.timeStamp<=Ol}function Ra(h,b){return Math.sqrt(Math.pow(h.clientX-b.clientX,2)+Math.pow(h.clientY-b.clientY,2))}function Ga(h,b){var _=b.onPointerDown,P=b.onPointerUp,A,$={selection:!1,input:!1},Y,he=[pt(h,window,"pointerdown",function(me){mf(me)&&(A=hf(),$={selection:!1,input:!1},Y=_(me))},{capture:!0}),pt(h,window,"selectionchange",function(){(!A||!hf())&&($.selection=!0)},{capture:!0}),pt(h,window,"pointerup",function(me){if(mf(me)&&Y){var Ae=$;P(Y,me,function(){return Ae}),Y=void 0}},{capture:!0}),pt(h,window,"input",function(){$.input=!0},{capture:!0})];return{stop:function(){he.forEach(function(me){return me.stop()})}}}function hf(){var h=window.getSelection();return!h||h.isCollapsed}function mf(h){return h.target instanceof Element&&h.isPrimary!==!1}var gf=3;function Y0(h,b){if(st(h))return b.addFrustration("rage_click"),h.some(ap)&&b.addFrustration("dead_click"),b.hasError&&b.addFrustration("error_click"),{isRage:!0};var _=h.some(function(P){return P.getUserActivity().selection});return h.forEach(function(P){P.hasError&&P.addFrustration("error_click"),ap(P)&&!_&&P.addFrustration("dead_click")}),{isRage:!1}}function st(h){if(h.some(function(_){return _.getUserActivity().selection}))return!1;for(var b=0;b<h.length-(gf-1);b+=1)if(h[b+gf-1].event.timeStamp-h[b].event.timeStamp<=ns)return!0;return!1}var ig='input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="range"]),textarea,select,[contenteditable],[contenteditable] *,canvas,a[href],a[href] *';function ap(h){return h.hasPageActivity||h.getUserActivity().input?!1:!rn(h.event.target,ig)}var X0=10*ns,Qa=5*ss;function Hi(h,b,_){var P=new Tl(Qa),A=new Jn,$;h.subscribe(8,function(){P.reset()}),h.subscribe(4,Ae);var Y=Ga(_,{onPointerDown:function(Ge){return ip(_,h,b,P,Ge)},onPointerUp:function(Ge,ht,jt){var an=Ge.clickActionBase,sn=Ge.hadActivityOnPointerDown;return lg(_,h,b,P,A,me,an,ht,jt,sn)}}).stop,he={findActionId:function(Ge){return _.trackFrustrations?P.findAll(Ge):P.find(Ge)}};return{stop:function(){Ae(),A.notify(),Y()},actionContexts:he};function me(Ge){if(!$||!$.tryAppend(Ge)){var ht=Ge.clone();$=cl(Ge,function(jt){By(jt,ht)})}}function Ae(){$&&$.stop()}}function ip(h,b,_,P,A){if(!(!h.trackFrustrations&&P.find())){var $=cg(A,h.actionNameAttribute);if(!(!h.trackFrustrations&&!$.name)){var Y=!1;return Jc(b,_,h,function(he){Y=he.hadActivity},sp),{clickActionBase:$,hadActivityOnPointerDown:function(){return Y}}}}}function lg(h,b,_,P,A,$,Y,he,me,Ae){var Ge=ug(b,P,me,Y,he);h.trackFrustrations&&$(Ge);var ht=Jc(b,_,h,function(sn){sn.hadActivity&&sn.end<Ge.startClocks.timeStamp?Ge.discard():(sn.hadActivity?Ge.stop(sn.end):Ae()?Ge.stop(Ge.startClocks.timeStamp):Ge.stop(),h.trackFrustrations||(sn.hadActivity?Ge.validate():Ge.discard()))},X0).stop,jt=b.subscribe(4,function(sn){var kn=sn.endClocks;Ge.stop(kn.timeStamp)}),an=A.subscribe(function(){Ge.stop()});Ge.stopObservable.subscribe(function(){jt.unsubscribe(),ht(),an.unsubscribe()})}function cg(h,b){var _=h.target.getBoundingClientRect();return{type:"click",target:{width:Math.round(_.width),height:Math.round(_.height),selector:tu(h.target,b)},position:{x:Math.round(h.clientX-_.left),y:Math.round(h.clientY-_.top)},name:ng(h.target,b)}}function ug(h,b,_,P,A){var $=be(),Y=qo(),he=b.add($,Y.relative),me=jc({lifeCycle:h,isChildEvent:function(sn){return sn.action!==void 0&&(Array.isArray(sn.action.id)?$e(sn.action.id,$):sn.action.id===$)}}),Ae=0,Ge,ht=[],jt=new Jn;function an(sn){Ae===0&&(Ge=sn,Ae=1,Ge?he.close(Qe(Ge)):he.remove(),me.stop(),jt.notify())}return{event:A,stop:an,stopObservable:jt,get hasError(){return me.eventCounts.errorCount>0},get hasPageActivity(){return Ge!==void 0},getUserActivity:_,addFrustration:function(sn){ht.push(sn)},startClocks:Y,isStopped:function(){return Ae===1||Ae===2},clone:function(){return ug(h,b,_,P,A)},validate:function(sn){if(an(),Ae===1){var kn=me.eventCounts,is=kn.resourceCount,Ns=kn.errorCount,co=kn.longTaskCount,da=ze({type:"click",duration:Ge&&Wn(Y.timeStamp,Ge),startClocks:Y,id:$,frustrationTypes:ht,counts:{resourceCount:is,errorCount:Ns,longTaskCount:co},events:sn??[A],event:A},P);h.notify(1,da),Ae=2}},discard:function(){an(),Ae=2}}}function By(h,b){var _=Y0(h,b).isRage;_?(h.forEach(function(P){return P.discard()}),b.stop(Vs()),b.validate(h.map(function(P){return P.event}))):(b.discard(),h.forEach(function(P){return P.validate()}))}function dg(h,b,_,P){h.subscribe(1,function($){return h.notify(10,xh($,P))});var A={findActionId:rr};return _.trackUserInteractions&&(A=Hi(h,b,_).actionContexts),{addAction:function($,Y){h.notify(10,ze({savedCommonContext:Y},xh($,P)))},actionContexts:A}}function xh(h,b){var _=Nl(h)?{action:{id:h.id,loading_time:Dn(h.duration),frustration:{type:h.frustrationTypes},error:{count:h.counts.errorCount},long_task:{count:h.counts.longTaskCount},resource:{count:h.counts.resourceCount}},_dd:{action:{target:h.target,position:h.position}}}:void 0,P=Nl(h)?void 0:h.context,A=Zr({action:{id:be(),target:{name:h.name},type:h.type},date:h.startClocks.timeStamp,type:"action",view:{in_foreground:b.isInActivePageStateAt(h.startClocks.relative)}},_);return{customerContext:P,rawRumEvent:A,startTime:h.startClocks.relative,domainContext:Nl(h)?{event:h.event,events:h.events}:{}}}function Nl(h){return h.type!=="custom"}var No=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?([\s\S]*)$/;function Z0(h){var b=J0(h).stop,_=mn(h).stop;return{stop:function(){b(),_()}}}function J0(h){return Xo(window,"onerror",{before:function(b,_,P,A,$){var Y;if($ instanceof Error)Y=Mn($);else{var he=[{url:_,column:A,line:P}],me=vf(b),Ae=me.name,Ge=me.message;Y={name:Ae,message:Ge,stack:he}}h(Y,$??b)}})}function vf(h){var b,_,P;return{}.toString.call(h)==="[object String]"&&(b=No.exec(h),_=b[1],P=b[2]),{name:_,message:P}}function mn(h){return Xo(window,"onunhandledrejection",{before:function(b){var _=b.reason||"Empty reason",P=Mn(_);h(P,_)}})}function _h(h){return Z0(function(b,_){h.notify(ho({stackTrace:b,originalError:_,startClocks:qo(),nonErrorPrefix:"Uncaught",source:lo.SOURCE,handling:"unhandled"}))})}var yf={};function su(h){var b=h.map(function(_){return yf[_]||(yf[_]=gn(_)),yf[_]});return fs.apply(void 0,b)}function Je(){yf={}}function gn(h){var b=new Jn(function(){var _=Te[h];return Te[h]=function(){for(var P=[],A=0;A<arguments.length;A++)P[A]=arguments[A];_.apply(console,P);var $=so();Re(function(){b.notify(ev(P,h,$))})},function(){Te[h]=_}});return b}function ev(h,b,_){var P=h.map(function(he){return nc(he)}).join(" "),A,$;if(b===we.error){var Y=mt(h,function(he){return he instanceof Error});A=Y?Ma(Mn(Y)):void 0,$=ei(Y),P="console error: ".concat(P)}return{api:b,message:P,stack:A,handlingStack:_,fingerprint:$}}function nc(h){return typeof h=="string"?Xn(h):h instanceof Error?Qo(Mn(h)):rt(Xn(h),void 0,2)}function Lr(h){var b=su([we.error]).subscribe(function(_){return h.notify({startClocks:qo(),message:_.message,stack:_.stack,fingerprint:_.fingerprint,source:lo.CONSOLE,handling:"handled",handlingStack:_.handlingStack})});return{stop:function(){b.unsubscribe()}}}var Iu={intervention:"intervention",deprecation:"deprecation",cspViolation:"csp_violation"};function va(h,b){var _=[];$e(b,Iu.cspViolation)&&_.push(ya(h));var P=b.filter(function(A){return A!==Iu.cspViolation});return P.length&&_.push(tv(P)),fs.apply(void 0,_)}function tv(h){var b=new Jn(function(){if(window.ReportingObserver){var _=te(function(A,$){return A.forEach(function(Y){b.notify(Vy(Y))})}),P=new window.ReportingObserver(_,{types:h,buffered:!0});return P.observe(),function(){P.disconnect()}}});return b}function ya(h){var b=new Jn(function(){var _=pt(h,document,"securitypolicyviolation",function(P){b.notify(nv(P))}).stop;return _});return b}function Vy(h){var b=h.type,_=h.body;return{type:b,subtype:_.id,message:"".concat(b,": ").concat(_.message),stack:ri(_.id,_.message,_.sourceFile,_.lineNumber,_.columnNumber)}}function nv(h){var b=Iu.cspViolation,_="'".concat(h.blockedURI,"' blocked by '").concat(h.effectiveDirective,"' directive");return{type:Iu.cspViolation,subtype:h.effectiveDirective,message:"".concat(b,": ").concat(_),stack:ri(h.effectiveDirective,h.originalPolicy?"".concat(_,' of the policy "').concat(le(h.originalPolicy,100,"..."),'"'):"no policy",h.sourceFile,h.lineNumber,h.columnNumber)}}function ri(h,b,_,P,A){return _?Ma({name:h,message:b,stack:[{func:"?",url:_,line:P??void 0,column:A??void 0}]}):void 0}function Ao(h,b){var _=va(h,[Iu.cspViolation,Iu.intervention]).subscribe(function(P){return b.notify({startClocks:qo(),message:P.message,stack:P.stack,type:P.subtype,source:lo.REPORT,handling:"unhandled"})});return{stop:function(){_.unsubscribe()}}}function si(h,b,_,P){var A=new Jn;return Lr(A),_h(A),Ao(b,A),A.subscribe(function($){return h.notify(12,{error:$})}),rv(h,_,P)}function rv(h,b,_){return h.subscribe(12,function(P){var A=P.error,$=P.customerContext,Y=P.savedCommonContext;h.notify(10,ze({customerContext:$,savedCommonContext:Y},fg(A,b,_)))}),{addError:function(P,A){var $=P.error,Y=P.handlingStack,he=P.startClocks,me=P.context,Ae=$ instanceof Error?Mn($):void 0,Ge=ho({stackTrace:Ae,originalError:$,handlingStack:Y,startClocks:he,nonErrorPrefix:"Provided",source:lo.CUSTOM,handling:"handled"});h.notify(12,{customerContext:me,savedCommonContext:A,error:Ge})}}}function fg(h,b,_){var P={date:h.startClocks.timeStamp,error:{id:be(),message:h.message,source:h.source,stack:h.stack,handling_stack:h.handlingStack,type:h.type,handling:h.handling,causes:h.causes,source_type:"browser",fingerprint:h.fingerprint},type:"error",view:{in_foreground:b.isInActivePageStateAt(h.startClocks.relative)}},A=_.findFeatureFlagEvaluations(h.startClocks.relative);return A&&!cr(A)&&(P.feature_flags=A),{rawRumEvent:P,startTime:h.startClocks.relative,domainContext:{error:h.originalError}}}function bf(h,b){h.subscribe(0,function(_){for(var P=0,A=_;P<A.length;P++){var $=A[P];if($.entryType!==Ss.LONG_TASK)break;var Y=b.findTrackedSession($.startTime);if(!Y||!Y.longTaskAllowed)break;var he=Ls($.startTime),me={date:he.timeStamp,long_task:{id:be(),duration:Dn($.duration)},type:"long_task",_dd:{discarded:!1}};h.notify(10,{rawRumEvent:me,startTime:he.relative,domainContext:{performanceEntry:$.toJSON()}})}})}function Hy(h){if(!(!performance||!("getEntriesByName"in performance))){var b=performance.getEntriesByName(h.url,"resource");if(!(!b.length||!("toJSON"in b[0]))){var _=b.map(function(P){return P.toJSON()}).filter(qm).filter(function(P){return Wy(P,h.startClocks.relative,sv({startTime:h.startClocks.relative,duration:h.duration}))});if(_.length===1)return _[0]}}}function sv(h){return Me(h.startTime,h.duration)}function Wy(h,b,_){var P=1;return h.startTime>=b-P&&sv(h)<=Me(_,P)}function Mc(h,b,_,P){h.subscribe(6,function(A){h.notify(10,ov(A,b,_,P))}),h.subscribe(0,function(A){for(var $=0,Y=A;$<Y.length;$++){var he=Y[$];he.entryType===Ss.RESOURCE&&!rd(he)&&h.notify(10,zn(he,b,_,P))}})}function ov(h,b,_,P){var A,$=h.type==="xhr"?"xhr":"fetch",Y=Hy(h),he=Y?Ls(Y.startTime):h.startClocks,me=Y?lp(Y):void 0,Ae=qy(h,b),Ge=Sh(_,he),ht=iv(P,he,h.duration),jt=Ch(P,he,(A=Y?.duration)!==null&&A!==void 0?A:h.duration),an=Zr({date:he.timeStamp,resource:{id:be(),type:$,duration:ht,method:h.method,status_code:h.status,url:h.url},type:"resource"},Ae,me,Ge,jt);return{startTime:he.relative,rawRumEvent:an,domainContext:{performanceEntry:Y&&Y,xhr:h.xhr,response:h.response,requestInput:h.input,requestInit:h.init,error:h.error}}}function zn(h,b,_,P){var A=al(h),$=lp(h),Y=Ls(h.startTime),he=pg(h,b),me=Sh(_,Y),Ae=Ch(P,Y,h.duration),Ge=Zr({date:Y.timeStamp,resource:{id:be(),type:A,url:h.name},type:"resource"},he,$,me,Ae);return{startTime:Y.relative,rawRumEvent:Ge,domainContext:{performanceEntry:h}}}function lp(h){return{resource:ze({duration:Yd(h),size:F0(h)},Zc(h))}}function qy(h,b){var _=h.traceSampled&&h.traceId&&h.spanId;if(_)return{_dd:{span_id:h.spanId.toDecimalString(),trace_id:h.traceId.toDecimalString(),rule_psr:ou(b)}}}function pg(h,b){var _=h.traceId;if(_)return{_dd:{trace_id:h.traceId,rule_psr:ou(b)}}}function av(h){return h}function ou(h){return ps(h.traceSampleRate)?h.traceSampleRate/100:void 0}function Sh(h,b){var _=h.findTrackedSession(b.relative);return{_dd:{discarded:!_||!_.resourceAllowed}}}function Ch(h,b,_){if(ko(I.RESOURCE_PAGE_STATES))return{_dd:{page_states:h.findAll(b.relative,_),page_was_discarded:String(document.wasDiscarded)}}}function iv(h,b,_){var P;if(!ko(I.NO_RESOURCE_DURATION_FROZEN_STATE))return Dn(_);var A=(P=h.findAll(b.relative,_))===null||P===void 0?void 0:P.some(function($){return $.state==="frozen"});return A?void 0:Dn(_)}function hg(h,b){for(var _=[],P=0;P<h.length;P++){var A=h[P],$=h[P+1];if(A.state==="active"){var Y=A.start>=0?A.start:0,he=$?$.start:Dn(b);_.push({start:Y,duration:he-Y})}}return _}function wf(h,b,_){var P=jc({lifeCycle:h,isChildEvent:function(Y){return Y.view.id===b},onChange:_}),A=P.stop,$=P.eventCounts;return{stop:A,eventCounts:$}}var lv=10*ss;function cv(h,b,_){var P=h.subscribe(0,function(A){var $=mt(A,function(Y){return Y.entryType===Ss.PAINT&&Y.name==="first-contentful-paint"&&Y.startTime<b.timeStamp&&Y.startTime<lv});$&&_($.startTime)}).unsubscribe;return{stop:P}}function uv(h,b,_,P){var A=h.subscribe(0,function($){var Y=mt($,function(Ae){return Ae.entryType===Ss.FIRST_INPUT&&Ae.startTime<_.timeStamp});if(Y){var he=Wn(Y.startTime,Y.processingStart),me=void 0;ko(I.WEB_VITALS_ATTRIBUTION)&&Y.target&&Yl(Y.target)&&(me=tu(Y.target,b.actionNameAttribute)),P({delay:he>=0?he:0,time:Y.startTime,targetSelector:me})}}).unsubscribe;return{stop:A}}function Ky(h,b){var _=h.subscribe(0,function(P){for(var A=0,$=P;A<$.length;A++){var Y=$[A];Y.entryType===Ss.NAVIGATION&&b({domComplete:Y.domComplete,domContentLoaded:Y.domContentLoadedEventEnd,domInteractive:Y.domInteractive,loadEvent:Y.loadEventEnd,firstByte:Y.responseStart>=0&&Y.responseStart<=Mo()?Y.responseStart:void 0})}}).unsubscribe;return{stop:_}}var Ei=10*ss;function gi(h,b,_,P,A){var $=1/0,Y=_t(b,P,["pointerdown","keydown"],function(me){$=me.timeStamp},{capture:!0,once:!0}).stop,he=h.subscribe(0,function(me){var Ae=It(me,function(ht){return ht.entryType===Ss.LARGEST_CONTENTFUL_PAINT&&ht.startTime<$&&ht.startTime<_.timeStamp&&ht.startTime<Ei});if(Ae){var Ge=void 0;ko(I.WEB_VITALS_ATTRIBUTION)&&Ae.element&&(Ge=tu(Ae.element,b.actionNameAttribute)),A({value:Ae.startTime,targetSelector:Ge})}}).unsubscribe;return{stop:function(){Y(),he()}}}function Gy(h,b){b===void 0&&(b=window);var _,P;return document.visibilityState==="hidden"?_=0:(_=1/0,P=_t(h,b,["pagehide","visibilitychange"],function(A){(A.type==="pagehide"||document.visibilityState==="hidden")&&(_=A.timeStamp,P())},{capture:!0}).stop),{get timeStamp(){return _},stop:function(){P?.()}}}function Qy(h,b,_,P){var A={},$=Ky(h,function(ht){_(ht.loadEvent),A.navigationTimings=ht,P()}).stop,Y=Gy(b),he=cv(h,Y,function(ht){A.firstContentfulPaint=ht,P()}).stop,me=gi(h,b,Y,window,function(ht){A.largestContentfulPaint=ht,P()}).stop,Ae=uv(h,b,Y,function(ht){A.firstInput=ht,P()}).stop;function Ge(){$(),he(),me(),Ae(),Y.stop()}return{stop:Ge,initialViewMetrics:A}}function Eh(h,b,_){if(!mg())return{stop:rr};var P=0;_({value:0});var A=Th(),$=b.subscribe(0,function(Y){for(var he=0,me=Y;he<me.length;he++){var Ae=me[he];if(Ae.entryType===Ss.LAYOUT_SHIFT&&!Ae.hadRecentInput&&(A.update(Ae),A.value()>P)){P=A.value();var Ge=xr(P,4),ht=A.largestLayoutShiftTarget(),jt=void 0;ko(I.WEB_VITALS_ATTRIBUTION)&&ht&&(jt=tu(ht,h.actionNameAttribute)),_({value:Ge,targetSelector:jt})}}}).unsubscribe;return{stop:$}}function Th(){var h=0,b,_,P=0,A,$;return{update:function(Y){var he,me,Ae=b===void 0||Y.startTime-_>=ns||Y.startTime-b>=5*ns;Ae?(b=_=Y.startTime,h=Y.value,P=0,A=void 0):(h+=Y.value,_=Y.startTime),Y.value>P&&(P=Y.value,$=Y.startTime,!((he=Y.sources)===null||he===void 0)&&he.length?A=(me=mt(Y.sources,function(Ge){return!!Ge.node&&Yl(Ge.node)}))===null||me===void 0?void 0:me.node:A=void 0)},value:function(){return h},largestLayoutShiftTarget:function(){return A},largestLayoutShiftTime:function(){return $}}}function mg(){return lh(Ss.LAYOUT_SHIFT)}var xf,_f=0,cp=1/0,kh=0;function gg(){"interactionCount"in performance||xf||(xf=new window.PerformanceObserver(te(function(h){h.getEntries().forEach(function(b){var _=b;_.interactionId&&(cp=Math.min(cp,_.interactionId),kh=Math.max(kh,_.interactionId),_f=(kh-cp)/7+1)})})),xf.observe({type:"event",buffered:!0,durationThreshold:0}))}var up=function(){return xf?_f:window.performance.interactionCount||0},Rh=10;function dv(h,b,_,P){if(!Yy()||!ko(I.INTERACTION_TO_NEXT_PAINT))return{getInteractionToNextPaint:function(){},stop:rr};var A=dp(_).getViewInteractionCount,$=$c(A),Y=-1,he,me=!1,Ae=P.subscribe(0,function(Ge){for(var ht,jt=0,an=Ge;jt<an.length;jt++){var sn=an[jt];(sn.entryType===Ss.EVENT||sn.entryType===Ss.FIRST_INPUT)&&sn.interactionId&&$.process(sn)}var kn=$.estimateP98Interaction();kn&&(Y=kn.duration,Y>10*ss&&!me&&(me=!0,hi("INP outlier",{inp:Y,interaction:{timeFromViewStart:Wn(b.relative,kn.startTime),duration:kn.duration,startTime:kn.startTime,processingStart:kn.processingStart,processingEnd:kn.processingEnd,interactionId:kn.interactionId,name:kn.name,targetNodeName:(ht=kn.target)===null||ht===void 0?void 0:ht.nodeName}})),ko(I.WEB_VITALS_ATTRIBUTION)&&kn.target&&Yl(kn.target)?he=tu(kn.target,h.actionNameAttribute):he=void 0)}).unsubscribe;return{getInteractionToNextPaint:function(){if(Y>=0)return{value:Y,targetSelector:he};if(A())return{value:0}},stop:Ae}}function $c(h){var b=[];function _(){b.sort(function(P,A){return A.duration-P.duration}).splice(Rh)}return{process:function(P){var A=b.findIndex(function(Y){return P.interactionId===Y.interactionId}),$=b[b.length-1];A!==-1?P.duration>b[A].duration&&(b[A]=P,_()):(b.length<Rh||P.duration>$.duration)&&(b.push(P),_())},estimateP98Interaction:function(){var P=Math.min(b.length-1,Math.floor(h()/50));return b[P]}}}function dp(h){gg();var b=h==="initial_load"?0:up();return{getViewInteractionCount:function(){return up()-b}}}function Yy(){return lh(Ss.EVENT)&&window.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype}function vg(h,b,_,P,A,$){var Y=P==="initial_load",he=!0,me=[];function Ae(){!he&&!Y&&me.length>0&&$(Math.max.apply(Math,me))}var Ge=Jc(h,b,_,function(ht){he&&(he=!1,ht.hadActivity&&me.push(Wn(A.timeStamp,ht.end)),Ae())}).stop;return{stop:Ge,setLoadEvent:function(ht){Y&&(Y=!1,me.push(ht),Ae())}}}function Ph(){var h,b=window.visualViewport;return b?h=b.pageLeft-b.offsetLeft:window.scrollX!==void 0?h=window.scrollX:h=window.pageXOffset||0,Math.round(h)}function yg(){var h,b=window.visualViewport;return b?h=b.pageTop-b.offsetTop:window.scrollY!==void 0?h=window.scrollY:h=window.pageYOffset||0,Math.round(h)}var Sf;function Wi(h){return Sf||(Sf=Qw(h)),Sf}function Qw(h){var b=new Jn(function(){var _=nr(function(){b.notify(fp())},200).throttled;return pt(h,window,"resize",_,{capture:!0,passive:!0}).stop});return b}function fp(){var h=window.visualViewport;return h?{width:Number(h.width*h.scale),height:Number(h.height*h.scale)}:{width:Number(window.innerWidth||0),height:Number(window.innerHeight||0)}}var la=ns;function fv(h,b,_,P){P===void 0&&(P=pd(h));var A=0,$=0,Y=0,he=P.subscribe(function(me){var Ae=me.scrollDepth,Ge=me.scrollTop,ht=me.scrollHeight,jt=!1;if(Ae>A&&(A=Ae,jt=!0),ht>$){$=ht;var an=Mo();Y=Wn(b.relative,an),jt=!0}jt&&_({maxDepth:Math.min(A,$),maxDepthScrollTop:Ge,maxScrollHeight:$,maxScrollHeightTime:Y})});return{stop:function(){return he.unsubscribe()}}}function pp(){var h=yg(),b=fp().height,_=Math.round((document.scrollingElement||document.documentElement).scrollHeight),P=Math.round(b+h);return{scrollHeight:_,scrollDepth:P,scrollTop:h}}function pd(h,b){b===void 0&&(b=la);var _=new Jn(function(){function P(){_.notify(pp())}if(window.ResizeObserver){var A=nr(P,b,{leading:!1,trailing:!0}),$=document.scrollingElement||document.documentElement,Y=new ResizeObserver(te(A.throttled));Y.observe($);var he=pt(h,window,"scroll",A.throttled,{passive:!0});return function(){A.cancel(),Y.unobserve($),he.stop()}}});return _}function Ti(h,b,_,P,A,$){var Y={},he=vg(h,b,_,A,$,function(kn){Y.loadingTime=kn,P()}),me=he.stop,Ae=he.setLoadEvent,Ge=fv(_,$,function(kn){Y.scroll=kn}).stop,ht=Eh(_,h,function(kn){Y.cumulativeLayoutShift=kn,P()}).stop,jt=dv(_,$,A,h),an=jt.stop,sn=jt.getInteractionToNextPaint;return{stop:function(){me(),ht(),Ge(),an()},setLoadEvent:Ae,getCommonViewMetrics:function(){return Y.interactionToNextPaint=sn(),Y}}}var hp=3e3,pv=5*ss,bg=5*ss;function Ya(h,b,_,P,A,$,Y){var he=new Set,me=Ge("initial_load",ui(),Y);ht();var Ae;$&&(Ae=jt(A));function Ge(an,sn,kn){var is=Xy(b,_,P,h,an,sn,kn);return he.add(is),is.stopObservable.subscribe(function(){he.delete(is)}),is}function ht(){b.subscribe(8,function(){me=Ge("route_change",void 0,{name:me.name,service:me.service,version:me.version})}),b.subscribe(7,function(){me.end({sessionIsActive:!1})}),b.subscribe(9,function(an){(an.reason===ia.UNLOADING||an.reason===ia.PAGEHIDE)&&me.end()})}function jt(an){return an.subscribe(function(sn){var kn=sn.oldLocation,is=sn.newLocation;Lc(kn,is)&&(me.end(),me=Ge("route_change"))})}return{addTiming:function(an,sn){sn===void 0&&(sn=Vs()),me.addTiming(an,sn)},startView:function(an,sn){me.end({endClocks:sn}),me=Ge("route_change",sn,an)},stop:function(){Ae?.unsubscribe(),me.end(),he.forEach(function(an){return an.stop()})}}}function Xy(h,b,_,P,A,$,Y){$===void 0&&($=qo());var he=be(),me=new Jn,Ae={},Ge=0,ht,jt=_i(P),an=!0,sn,kn,is;Y&&(sn=Y.name,kn=Y.service,is=Y.version),h.notify(2,{id:he,name:sn,startClocks:$,service:kn,version:is});var Ns=nr(Ep,hp,{leading:!1}),co=Ns.throttled,da=Ns.cancel,Go=Ti(h,b,_,co,A,$),Fr=Go.setLoadEvent,zr=Go.stop,vi=Go.getCommonViewMetrics,Yr=A==="initial_load"?Qy(h,_,Fr,co):{stop:rr,initialViewMetrics:{}},ur=Yr.stop,Br=Yr.initialViewMetrics,yi=wf(h,he,co),lu=yi.stop,cu=yi.eventCounts,Or=Rn(Ep,pv);Ep();function Ep(){da(),Ge+=1;var na=ht===void 0?Vs():ht.timeStamp;h.notify(3,{customTimings:Ae,documentVersion:Ge,id:he,name:sn,service:kn,version:is,loadingType:A,location:jt,startClocks:$,commonViewMetrics:vi(),initialViewMetrics:Br,duration:Wn($.timeStamp,na),isActive:ht===void 0,sessionIsActive:an,eventCounts:cu})}return{name:sn,service:kn,version:is,stopObservable:me,end:function(na){var uu=this,cc,Hc;na===void 0&&(na={}),!ht&&(ht=(cc=na.endClocks)!==null&&cc!==void 0?cc:qo(),an=(Hc=na.sessionIsActive)!==null&&Hc!==void 0?Hc:!0,h.notify(4,{endClocks:ht}),Yn(Or),zr(),Ep(),yt(function(){uu.stop()},bg))},stop:function(){ur(),lu(),me.notify()},addTiming:function(na,uu){if(!ht){var cc=ut(uu)?uu:Wn($.timeStamp,uu);Ae[Cn(na)]=cc,co()}}}}function Cn(h){var b=h.replace(/[^a-zA-Z0-9-_.@$]/g,"_");return b!==h&&W.warn("Invalid timing name: ".concat(h,", sanitized to: ").concat(b)),b}function Lc(h,b){return h.pathname!==b.pathname||!wg(b.hash)&&xg(b.hash)!==xg(h.hash)}function wg(h){var b=h.substr(1);return!!document.getElementById(b)}function xg(h){var b=h.indexOf("?");return b<0?h:h.slice(0,b)}function Yw(h,b,_,P,A,$,Y,he,me){return h.subscribe(3,function(Ae){return h.notify(10,Oh(Ae,b,$,he,Y))}),Ya(_,h,P,b,A,!b.trackViewsManually,me)}function Oh(h,b,_,P,A){var $,Y,he,me,Ae,Ge,ht,jt,an,sn,kn,is,Ns,co,da=P.getReplayStats(h.id),Go=_.findFeatureFlagEvaluations(h.startClocks.relative),Fr=ko(I.PAGE_STATES),zr=A.findAll(h.startClocks.relative,h.duration),vi={_dd:{document_version:h.documentVersion,replay_stats:da,page_states:Fr?zr:void 0},date:h.startClocks.timeStamp,type:"view",view:{action:{count:h.eventCounts.actionCount},frustration:{count:h.eventCounts.frustrationCount},cumulative_layout_shift:($=h.commonViewMetrics.cumulativeLayoutShift)===null||$===void 0?void 0:$.value,cumulative_layout_shift_target_selector:(Y=h.commonViewMetrics.cumulativeLayoutShift)===null||Y===void 0?void 0:Y.targetSelector,first_byte:Dn((he=h.initialViewMetrics.navigationTimings)===null||he===void 0?void 0:he.firstByte),dom_complete:Dn((me=h.initialViewMetrics.navigationTimings)===null||me===void 0?void 0:me.domComplete),dom_content_loaded:Dn((Ae=h.initialViewMetrics.navigationTimings)===null||Ae===void 0?void 0:Ae.domContentLoaded),dom_interactive:Dn((Ge=h.initialViewMetrics.navigationTimings)===null||Ge===void 0?void 0:Ge.domInteractive),error:{count:h.eventCounts.errorCount},first_contentful_paint:Dn(h.initialViewMetrics.firstContentfulPaint),first_input_delay:Dn((ht=h.initialViewMetrics.firstInput)===null||ht===void 0?void 0:ht.delay),first_input_time:Dn((jt=h.initialViewMetrics.firstInput)===null||jt===void 0?void 0:jt.time),first_input_target_selector:(an=h.initialViewMetrics.firstInput)===null||an===void 0?void 0:an.targetSelector,interaction_to_next_paint:Dn((sn=h.commonViewMetrics.interactionToNextPaint)===null||sn===void 0?void 0:sn.value),interaction_to_next_paint_target_selector:(kn=h.commonViewMetrics.interactionToNextPaint)===null||kn===void 0?void 0:kn.targetSelector,is_active:h.isActive,name:h.name,largest_contentful_paint:Dn((is=h.initialViewMetrics.largestContentfulPaint)===null||is===void 0?void 0:is.value),largest_contentful_paint_target_selector:(Ns=h.initialViewMetrics.largestContentfulPaint)===null||Ns===void 0?void 0:Ns.targetSelector,load_event:Dn((co=h.initialViewMetrics.navigationTimings)===null||co===void 0?void 0:co.loadEvent),loading_time:_g(Dn(h.commonViewMetrics.loadingTime)),loading_type:h.loadingType,long_task:{count:h.eventCounts.longTaskCount},resource:{count:h.eventCounts.resourceCount},time_spent:Dn(h.duration),in_foreground_periods:!Fr&&zr?hg(zr,h.duration):void 0},feature_flags:Go&&!cr(Go)?Go:void 0,display:h.commonViewMetrics.scroll?{scroll:{max_depth:h.commonViewMetrics.scroll.maxDepth,max_depth_scroll_top:h.commonViewMetrics.scroll.maxDepthScrollTop,max_scroll_height:h.commonViewMetrics.scroll.maxScrollHeight,max_scroll_height_time:Dn(h.commonViewMetrics.scroll.maxScrollHeightTime)}}:void 0,session:{has_replay:da?!0:void 0,is_active:h.sessionIsActive?void 0:!1},privacy:{replay_level:b.defaultPrivacyLevel}};return cr(h.customTimings)||(vi.view.custom_timings=tt(h.customTimings,Dn)),{rawRumEvent:vi,startTime:h.startClocks.relative,domainContext:{location:h.location}}}function _g(h){return ps(h)&&h<0?void 0:h}var hv=ss,mv=tn,qi=[];function ju(h,b,_){var P=Hd(h.sessionStoreStrategyType,b,_);qi.push(function(){return P.stop()});var A=new Tl(mv);qi.push(function(){return A.stop()}),P.renewObservable.subscribe(function(){A.add($(),Mo())}),P.expireObservable.subscribe(function(){A.closeActive(Mo())}),P.expandOrRenewSession(),A.add($(),ui().relative),Sg(h,function(){return P.expandOrRenewSession()}),Fa(h,function(){return P.expandSession()});function $(){return{id:P.getSession().id,trackingType:P.getSession()[b]}}return{findActiveSession:function(Y){return A.find(Y)},renewObservable:P.renewObservable,expireObservable:P.expireObservable,expire:P.expire}}function Nh(){qi.forEach(function(h){return h()}),qi=[]}function Sg(h,b){var _=_t(h,window,["click","touchstart","keydown","scroll"],b,{capture:!0,passive:!0}).stop;qi.push(_)}function Fa(h,b){var _=function(){document.visibilityState==="visible"&&b()},P=pt(h,document,"visibilitychange",_).stop;qi.push(P);var A=Rn(_,hv);qi.push(function(){Yn(A)})}var Ki="rum";function Du(h,b){var _=ju(h,Ki,function(P){return hd(h,P)});return _.expireObservable.subscribe(function(){b.notify(7)}),_.renewObservable.subscribe(function(){b.notify(8)}),{findTrackedSession:function(P){var A=_.findActiveSession(P);if(!(!A||!Cg(A.trackingType))){var $=A.trackingType==="1"?2:1;return{id:A.id,plan:$,sessionReplayAllowed:$===2,longTaskAllowed:h.trackLongTasks!==void 0?h.trackLongTasks:h.oldPlansBehavior&&$===2,resourceAllowed:h.trackResources!==void 0?h.trackResources:h.oldPlansBehavior&&$===2}}},expire:_.expire,expireObservable:_.expireObservable}}function gv(){var h={id:"00000000-aaaa-0000-aaaa-000000000000",plan:1,sessionReplayAllowed:!1,longTaskAllowed:!0,resourceAllowed:!0};return{findTrackedSession:function(){return h},expire:rr,expireObservable:new Jn}}function hd(h,b){var _;return ki(b)?_=b:Gr(h.sessionSampleRate)?Gr(h.sessionReplaySampleRate)?_="1":_="2":_="0",{trackingType:_,isTracked:Cg(_)}}function ki(h){return h==="0"||h==="1"||h==="2"}function Cg(h){return h==="2"||h==="1"}var Fc=function(){function h(b,_,P){var A=this;this.request=b,this.flushController=_,this.messageBytesLimit=P,this.pushOnlyBuffer=[],this.upsertBuffer={},this.flushSubscription=this.flushController.flushObservable.subscribe(function($){return A.flush($)})}return h.prototype.add=function(b){this.addOrUpdate(b)},h.prototype.upsert=function(b,_){this.addOrUpdate(b,_)},h.prototype.stop=function(){this.flushSubscription.unsubscribe()},h.prototype.flush=function(b){var _=this.pushOnlyBuffer.concat(nn(this.upsertBuffer));this.pushOnlyBuffer=[],this.upsertBuffer={};var P={data:_.join(`
`),bytesCount:b.bytesCount,flushReason:b.reason};Wm(b.reason)?this.request.sendOnExit(P):this.request.send(P)},h.prototype.addOrUpdate=function(b,_){var P=this.process(b),A=P.processedMessage,$=P.messageBytesCount;if($>=this.messageBytesLimit){W.warn("Discarded a message whose size was bigger than the maximum allowed size ".concat(this.messageBytesLimit,"KB."));return}this.hasMessageFor(_)&&this.remove(_),this.push(A,$,_)},h.prototype.process=function(b){var _=rt(b),P=Ct(_);return{processedMessage:_,messageBytesCount:P}},h.prototype.push=function(b,_,P){var A=this.flushController.messagesCount>0?1:0;this.flushController.notifyBeforeAddMessage(_+A),P!==void 0?this.upsertBuffer[P]=b:this.pushOnlyBuffer.push(b),this.flushController.notifyAfterAddMessage()},h.prototype.remove=function(b){var _=this.upsertBuffer[b];delete this.upsertBuffer[b];var P=Ct(_),A=this.flushController.messagesCount>1?1:0;this.flushController.notifyAfterRemoveMessage(P+A)},h.prototype.hasMessageFor=function(b){return b!==void 0&&this.upsertBuffer[b]!==void 0},h}(),Zy=80*qt,vv=32,Eg=3*z,yv=ss,Tg=ns;function bv(h,b,_,P,A){b.transportStatus===0&&b.queuedPayloads.size()===0&&b.bandwidthMonitor.canHandle(h)?Ah(h,b,_,{onSuccess:function(){return ul(0,b,_,P,A)},onFailure:function(){b.queuedPayloads.enqueue(h),mp(b,_,P,A)}}):b.queuedPayloads.enqueue(h)}function mp(h,b,_,P){h.transportStatus===2&&yt(function(){var A=h.queuedPayloads.first();Ah(A,h,b,{onSuccess:function(){h.queuedPayloads.dequeue(),h.currentBackoffTime=Tg,ul(1,h,b,_,P)},onFailure:function(){h.currentBackoffTime=Math.min(yv,h.currentBackoffTime*2),mp(h,b,_,P)}})},h.currentBackoffTime)}function Ah(h,b,_,P){var A=P.onSuccess,$=P.onFailure;b.bandwidthMonitor.add(h),_(h,function(Y){b.bandwidthMonitor.remove(h),Xs(Y)?(b.transportStatus=b.bandwidthMonitor.ongoingRequestCount>0?1:2,h.retry={count:h.retry?h.retry.count+1:1,lastFailureStatus:Y.status},$()):(b.transportStatus=0,A())})}function ul(h,b,_,P,A){h===0&&b.queuedPayloads.isFull()&&!b.queueFullReported&&(A({message:"Reached max ".concat(P," events size queued for upload: ").concat(Eg/z,"MiB"),source:lo.AGENT,startClocks:qo()}),b.queueFullReported=!0);var $=b.queuedPayloads;for(b.queuedPayloads=Pa();$.size()>0;)bv($.dequeue(),b,_,P,A)}function Xs(h){return h.type!=="opaque"&&(h.status===0&&!navigator.onLine||h.status===408||h.status===429||uf(h.status))}function Xa(){return{transportStatus:0,currentBackoffTime:Tg,bandwidthMonitor:ca(),queuedPayloads:Pa(),queueFullReported:!1}}function Pa(){var h=[];return{bytesCount:0,enqueue:function(b){this.isFull()||(h.push(b),this.bytesCount+=b.bytesCount)},first:function(){return h[0]},dequeue:function(){var b=h.shift();return b&&(this.bytesCount-=b.bytesCount),b},size:function(){return h.length},isFull:function(){return this.bytesCount>=Eg}}}function ca(){return{ongoingRequestCount:0,ongoingByteCount:0,canHandle:function(h){return this.ongoingRequestCount===0||this.ongoingByteCount+h.bytesCount<=Zy&&this.ongoingRequestCount<vv},add:function(h){this.ongoingRequestCount+=1,this.ongoingByteCount+=h.bytesCount},remove:function(h){this.ongoingRequestCount-=1,this.ongoingByteCount-=h.bytesCount}}}function za(h,b,_,P){var A=Xa(),$=function(Y,he){return gd(h,b,_,Y,he)};return{send:function(Y){bv(Y,A,$,b.endpointType,P)},sendOnExit:function(Y){Cf(h,b,_,Y)}}}function Cf(h,b,_,P){var A=!!navigator.sendBeacon&&P.bytesCount<_;if(A)try{var $=b.build("beacon",P),Y=navigator.sendBeacon($,P.data);if(Y)return}catch(me){md(me)}var he=b.build("xhr",P);Ef(h,he,P.data)}var Oa=!1;function md(h){Oa||(Oa=!0,Ta(h))}function gd(h,b,_,P,A){var $=Ih()&&P.bytesCount<_;if($){var Y=b.build("fetch",P);fetch(Y,{method:"POST",body:P.data,keepalive:!0,mode:"cors"}).then(te(function(me){return A?.({status:me.status,type:me.type})}),te(function(){var me=b.build("xhr",P);Ef(h,me,P.data,A)}))}else{var he=b.build("xhr",P);Ef(h,he,P.data,A)}}function Ih(){try{return window.Request&&"keepalive"in new Request("http://a")}catch{return!1}}function Ef(h,b,_,P){var A=new XMLHttpRequest;A.open("POST",b,!0),pt(h,A,"loadend",function(){P?.({status:A.status})},{once:!0}),A.send(_)}function vd(h){var b=h.messagesLimit,_=h.bytesLimit,P=h.durationLimit,A=h.pageExitObservable,$=h.sessionExpireObservable,Y=A.subscribe(function(kn){return ht(kn.reason)}),he=$.subscribe(function(){return ht("session_expire")}),me=new Jn(function(){return function(){Y.unsubscribe(),he.unsubscribe()}}),Ae=0,Ge=0;function ht(kn){if(Ge!==0){var is=Ge,Ns=Ae;Ge=0,Ae=0,sn(),me.notify({reason:kn,messagesCount:is,bytesCount:Ns})}}var jt;function an(){jt===void 0&&(jt=yt(function(){ht("duration_limit")},P))}function sn(){un(jt),jt=void 0}return{flushObservable:me,get messagesCount(){return Ge},notifyBeforeAddMessage:function(kn){Ae+kn>=_&&ht("bytes_limit"),Ge+=1,Ae+=kn,an()},notifyAfterAddMessage:function(){Ge>=b?ht("messages_limit"):Ae>=_&&ht("bytes_limit")},notifyAfterRemoveMessage:function(kn){Ae-=kn,Ge-=1,Ge===0&&sn()}}}function Ri(h,b,_,P,A,$){var Y=me(h,b.endpoint),he=_&&me(h,_.endpoint);function me(Ae,Ge){return new Fc(za(Ae,Ge,Ae.batchBytesLimit,P),vd({messagesLimit:Ae.batchMessagesLimit,bytesLimit:Ae.batchBytesLimit,durationLimit:Ae.flushTimeout,pageExitObservable:A,sessionExpireObservable:$}),Ae.messageBytesLimit)}return{flushObservable:Y.flushController.flushObservable,add:function(Ae,Ge){Ge===void 0&&(Ge=!0),Y.add(Ae),he&&Ge&&he.add(_.transformMessage?_.transformMessage(Ae):Ae)},upsert:function(Ae,Ge){Y.upsert(Ae,Ge),he&&he.upsert(_.transformMessage?_.transformMessage(Ae):Ae,Ge)},stop:function(){Y.stop(),he?.stop()}}}function jh(h,b,_,P,A,$){var Y=h.replica,he=Ri(h,{endpoint:h.rumEndpointBuilder},Y&&{endpoint:Y.rumEndpointBuilder,transformMessage:function(me){return Zr(me,{application:{id:Y.applicationId}})}},P,A,$);return b.subscribe(11,function(me){me.type==="view"?he.upsert(me,me.view.id):he.add(me)}),_.subscribe(function(me){return he.add(me,Ly(h))}),he}function gp(h){var b=dt();h.subscribe(11,function(_){b.send("rum",_)})}var rc=tn;function vp(h,b,_){var P=new Tl(rc),A;h.subscribe(4,function(he){var me=he.endClocks;P.closeActive(me.relative)}),h.subscribe(2,function(he){var me=he.startClocks,Ae=_.href;P.add(Y({url:Ae,referrer:A||document.referrer}),me.relative),A=Ae});var $=b.subscribe(function(he){var me=he.newLocation,Ae=P.find();if(Ae){var Ge=Mo();P.closeActive(Ge),P.add(Y({url:me.href,referrer:Ae.referrer}),Ge)}});function Y(he){var me=he.url,Ae=he.referrer;return{url:me,referrer:Ae}}return{findUrl:function(he){return P.find(he)},stop:function(){$.unsubscribe(),P.stop()}}}function yp(h,b){var _=_i(b),P=new Jn(function(){var $=sc(h,A).stop,Y=bp(h,A).stop;return function(){$(),Y()}});function A(){if(_.href!==b.href){var $=_i(b);P.notify({newLocation:$,oldLocation:_}),_=$}}return P}function sc(h,b){var _=Xo(history,"pushState",{after:b}).stop,P=Xo(history,"replaceState",{after:b}).stop,A=pt(h,window,"popstate",b).stop;return{stop:function(){_(),P(),A()}}}function bp(h,b){return pt(h,window,"hashchange",b)}var zc=tn,Tf=200;function Dh(h,b){if(b===void 0&&(b=Ct),!ko(I.FEATURE_FLAGS))return{findFeatureFlagEvaluations:function(){},getFeatureFlagBytesCount:function(){return 0},addFeatureFlagEvaluation:rr,stop:rr};var _=new Tl(zc),P=0,A=!1;h.subscribe(4,function(me){var Ae=me.endClocks;_.closeActive(Ae.relative)}),h.subscribe(2,function(me){var Ae=me.startClocks;_.add({},Ae.relative),P=0});var $=nr(function(me){P=b(rt(me)),A||(A=pr(P,0))},Tf),Y=$.throttled,he=$.cancel;return{findFeatureFlagEvaluations:function(me){return _.find(me)},getFeatureFlagBytesCount:function(){var me=_.find();return me?P:0},addFeatureFlagEvaluation:function(me,Ae){var Ge=_.find();Ge&&(Ge[me]=Ae,Y(Ge))},stop:he}}var kg=10*ns,Al,Uc,oi;function Mu(h,b,_,P,A,$,Y){var he=b.enabled&&Gr(h.customerDataTelemetrySampleRate);he&&(Mh(),wv(),_.subscribe(11,function(me){oi=!0,kf(Uc.globalContextBytes,cr(P.get())?0:P.getBytesCount()),kf(Uc.userContextBytes,cr(A.get())?0:A.getBytesCount());var Ae=$.findFeatureFlagEvaluations(),Ge=$e(["view","error"],me.type)&&Ae&&!cr(Ae);kf(Uc.featureFlagBytes,Ge?$.getFeatureFlagBytesCount():0)}),Y.subscribe(function(me){var Ae=me.bytesCount,Ge=me.messagesCount;oi&&(Al.batchCount+=1,kf(Al.batchBytesCount,Ae),kf(Al.batchMessagesCount,Ge),yd(Al.globalContextBytes,Uc.globalContextBytes),yd(Al.userContextBytes,Uc.userContextBytes),yd(Al.featureFlagBytes,Uc.featureFlagBytes),wv())}),Rn(oc,kg))}function oc(){Al.batchCount!==0&&(hi("Customer data measures",Al),Mh())}function Ko(){return{min:1/0,max:0,sum:0}}function kf(h,b){h.sum+=b,h.min=Math.min(h.min,b),h.max=Math.max(h.max,b)}function yd(h,b){h.sum+=b.sum,h.min=Math.min(h.min,b.min),h.max=Math.max(h.max,b.max)}function Mh(){Al={batchCount:0,batchBytesCount:Ko(),batchMessagesCount:Ko(),globalContextBytes:Ko(),userContextBytes:Ko(),featureFlagBytes:Ko()}}function wv(){oi=!1,Uc={globalContextBytes:Ko(),userContextBytes:Ko(),featureFlagBytes:Ko()}}var $u=4e3,bd=500,Rg=tn;function Lu(h,b){b===void 0&&(b=bd);var _=new Tl(Rg,$u),P;$(Bc(),Mo());var A=_t(h,window,["pageshow","focus","blur","visibilitychange","resume","freeze","pagehide"],function(Y){Y.isTrusted&&$(Pg(Y),Y.timeStamp)},{capture:!0}).stop;function $(Y,he){he===void 0&&(he=Mo()),Y!==P&&(P=Y,_.closeActive(he),_.add({state:P,startTime:he},he))}return{findAll:function(Y,he){var me=_.findAll(Y,he);if(me.length!==0){for(var Ae=[],Ge=Math.max(0,me.length-b),ht=me.length-1;ht>=Ge;ht--){var jt=me[ht],an=Wn(Y,jt.startTime);Ae.push({state:jt.state,start:Dn(an)})}return Ae}},isInActivePageStateAt:function(Y){var he=_.find(Y);return he!==void 0&&he.state==="active"},addPageState:$,stop:function(){A(),_.stop()}}}function Pg(h){return h.type==="freeze"?"frozen":h.type==="pagehide"?h.persisted?"frozen":"terminated":Bc()}function Bc(){return document.visibilityState==="hidden"?"hidden":document.hasFocus()?"active":"passive"}function $h(h){var b=fp(),_=Wi(h).subscribe(function(P){b=P}).unsubscribe;return{get:function(){return{viewport:b}},stop:_}}function wp(h,b,_,P,A,$){var Y=[],he=new zy;he.subscribe(11,function(Or){return Vm("rum",Or)});var me=Fu(b);me.setContextProvider(function(){var Or,Ep;return{application:{id:b.applicationId},session:{id:(Or=an.findTrackedSession())===null||Or===void 0?void 0:Or.id},view:{id:(Ep=co.findView())===null||Ep===void 0?void 0:Ep.id},action:{id:Fr.findActionId()}}});var Ae=function(Or){he.notify(12,{error:Or}),hi("Error reported to customer",{"error.message":Or.message})},Ge=Dh(he),ht=Fy(b),jt=ht.subscribe(function(Or){he.notify(9,Or)});Y.push(function(){return jt.unsubscribe()});var an=bt()?gv():Du(b,he);if(bt())gp(he);else{var sn=jh(b,he,me.observable,Ae,ht,an.expireObservable);Y.push(function(){return sn.stop()}),Mu(b,me,he,P,A,Ge,sn.flushObservable)}var kn=$0(),is=yp(b,location),Ns=Lh(he,b,location,an,is,kn,function(){return sh(P,A,_)},Ae),co=Ns.viewContexts,da=Ns.pageStateHistory,Go=Ns.urlContexts,Fr=Ns.actionContexts,zr=Ns.addAction,vi=Ns.stop;Y.push(vi),$r(Xf(h)),bf(he,an),Mc(he,b,an,da);var Yr=Yw(he,b,location,kn,is,Ge,da,_,$),ur=Yr.addTiming,Br=Yr.startView,yi=Yr.stop;Y.push(yi);var lu=si(he,b,da,Ge).addError;Jm(he,b,an),ku(he,b);var cu=rp(b.applicationId,an,co,Fr,Go);return{addAction:zr,addError:lu,addTiming:ur,addFeatureFlagEvaluation:Ge.addFeatureFlagEvaluation,startView:Br,lifeCycle:he,viewContexts:co,session:an,stopSession:function(){return an.expire()},getInternalContext:cu.get,stop:function(){Y.forEach(function(Or){return Or()})}}}function Fu(h){var b=My("browser-rum-sdk",h);if(bt()){var _=dt();b.observable.subscribe(function(P){return _.send("internal_telemetry",P)})}return b}function Lh(h,b,_,P,A,$,Y,he){var me=Xm(h),Ae=vp(h,A,_),Ge=Lu(b),ht=dg(h,$,b,Ge),jt=ht.addAction,an=ht.actionContexts,sn=$h(b);return af(b,h,P,me,Ae,an,sn,Y,he),{viewContexts:me,pageStateHistory:Ge,urlContexts:Ae,addAction:jt,actionContexts:an,stop:function(){sn.stop(),Ge.stop(),Ae.stop(),me.stop(),Ge.stop()}}}function xv(h,b){var _=b.session,P=b.viewContext,A=b.errorType,$=_?_.id:"no-session-id",Y=[];A!==void 0&&Y.push("error-type=".concat(A)),P&&(Y.push("seed=".concat(P.id)),Y.push("from=".concat(P.startClocks.timeStamp)));var he=Jy(h),me="/rum/replay/sessions/".concat($);return"".concat(he).concat(me,"?").concat(Y.join("&"))}function Jy(h){var b=h.site,_=h.subdomain||_v(h);return"https://".concat(_?"".concat(_,"."):"").concat(b)}function _v(h){switch(h.site){case Tn:case $n:return"app";case or:return"dd";default:return}}var Il={FullSnapshot:2,IncrementalSnapshot:3,Meta:4,Focus:6,ViewEnd:7,VisualViewport:8,FrustrationRecord:9},dl={Document:0,DocumentType:1,Element:2,Text:3,CDATA:4,DocumentFragment:11},au={Mutation:0,MouseMove:1,MouseInteraction:2,Scroll:3,ViewportResize:4,Input:5,TouchMove:6,MediaInteraction:7,StyleSheetRule:8},ai={MouseUp:0,MouseDown:1,Click:2,ContextMenu:3,DblClick:4,Focus:5,Blur:6,TouchStart:7,TouchEnd:9},Fh={Play:0,Pause:1};function yo(h,b){return{data:ze({source:h},b),type:Il.IncrementalSnapshot,timestamp:Vs()}}var Fs={IGNORE:"ignore",HIDDEN:"hidden",ALLOW:td.ALLOW,MASK:td.MASK,MASK_USER_INPUT:td.MASK_USER_INPUT},wd="data-dd-privacy",Sv="allow",Cv="mask",Ev="mask-user-input",Og="hidden",eb="dd-privacy-allow",ii="dd-privacy-mask",Ng="dd-privacy-mask-user-input",tb="dd-privacy-hidden",Pi="***",xd="data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",zu={INPUT:!0,OUTPUT:!0,TEXTAREA:!0,SELECT:!0,OPTION:!0,DATALIST:!0,OPTGROUP:!0},iu=1e5,Rf="x";function Gi(h,b){var _=ih(h),P=_?Gi(_,b):b,A=xp(h);return zh(A,P)}function zh(h,b){switch(b){case Fs.HIDDEN:case Fs.IGNORE:return b}switch(h){case Fs.ALLOW:case Fs.MASK:case Fs.MASK_USER_INPUT:case Fs.HIDDEN:case Fs.IGNORE:return h;default:return b}}function xp(h){if(Yl(h)){var b=h.getAttribute(wd);if(h.tagName==="BASE")return Fs.ALLOW;if(h.tagName==="INPUT"){var _=h;if(_.type==="password"||_.type==="email"||_.type==="tel"||_.type==="hidden")return Fs.MASK;var P=_.getAttribute("autocomplete");if(P&&P.indexOf("cc-")===0)return Fs.MASK}if(b===Og||h.classList.contains(tb))return Fs.HIDDEN;if(b===Cv||h.classList.contains(ii))return Fs.MASK;if(b===Ev||h.classList.contains(Ng))return Fs.MASK_USER_INPUT;if(b===Sv||h.classList.contains(eb))return Fs.ALLOW;if(Vh(h))return Fs.IGNORE}}function Uh(h,b){switch(b){case Fs.MASK:case Fs.HIDDEN:case Fs.IGNORE:return!0;case Fs.MASK_USER_INPUT:return Eu(h)?Bh(h.parentNode):Bh(h);default:return!1}}function Bh(h){if(!h||h.nodeType!==h.ELEMENT_NODE)return!1;var b=h;if(b.tagName==="INPUT")switch(b.type){case"button":case"color":case"reset":case"submit":return!1}return!!zu[b.tagName]}var Uu=function(h){return h.replace(/\S/g,Rf)};function _p(h,b,_){var P,A=(P=h.parentElement)===null||P===void 0?void 0:P.tagName,$=h.textContent||"";if(!(b&&!$.trim())){var Y=_,he=A==="SCRIPT";if(he)$=Pi;else if(Y===Fs.HIDDEN)$=Pi;else if(Uh(h,Y))if(A==="DATALIST"||A==="SELECT"||A==="OPTGROUP"){if(!$.trim())return}else A==="OPTION"?$=Pi:$=Uu($);return $}}function Vh(h){if(h.nodeName==="SCRIPT")return!0;if(h.nodeName==="LINK"){var b=A("rel");return/preload|prefetch/i.test(b)&&A("as")==="script"||b==="shortcut icon"||b==="icon"}if(h.nodeName==="META"){var _=A("name"),b=A("rel"),P=A("property");return/^msapplication-tile(image|color)$/.test(_)||_==="application-name"||b==="icon"||b==="apple-touch-icon"||b==="shortcut icon"||_==="keywords"||_==="description"||/^(og|twitter|fb):/.test(P)||/^(og|twitter):/.test(_)||_==="pinterest"||_==="robots"||_==="googlebot"||_==="bingbot"||h.hasAttribute("http-equiv")||_==="author"||_==="generator"||_==="framework"||_==="publisher"||_==="progid"||/^article:/.test(P)||/^product:/.test(P)||_==="google-site-verification"||_==="yandex-verification"||_==="csrf-token"||_==="p:domain_verify"||_==="verify-v1"||_==="verification"||_==="shopify-checkout-api-token"}function A($){return(h.getAttribute($)||"").toLowerCase()}return!1}var Ag=new WeakMap;function fl(h){return Ag.has(h)}function Ig(h){for(var b=h;b;){if(!fl(b)&&!ep(b))return!1;b=ih(b)}return!0}function Oi(h){return Ag.get(h)}function jg(h,b){Ag.set(h,b)}function Pf(h,b){var _=h.tagName,P=h.value;if(Uh(h,b)){var A=h.type;return _==="INPUT"&&(A==="button"||A==="submit"||A==="reset")?P:!P||_==="OPTION"?void 0:Pi}if(_==="OPTION"||_==="SELECT")return h.value;if(!(_!=="INPUT"&&_!=="TEXTAREA"))return P}var Tv=/url\((?:(')([^']*)'|(")([^"]*)"|([^)]*))\)/gm,Of=/^[A-Za-z]+:|^\/\//,Dg=/^data:.*,/i;function Xw(h,b){return h.replace(Tv,function(_,P,A,$,Y,he){var me=A||Y||he;if(!b||!me||Of.test(me)||Dg.test(me))return _;var Ae=P||$||"";return"url(".concat(Ae).concat(Hh(me,b)).concat(Ae,")")})}function Hh(h,b){try{return Se(h,b).href}catch{return h}}var ac=/[^a-z1-6-_]/;function _d(h){var b=h.toLowerCase().trim();return ac.test(b)?"div":b}function Mg(h){if(!(h===void 0||h.length===0))return h.map(function(b){var _=b.cssRules||b.rules,P=Array.from(_,function($){return $.cssText}),A={cssRules:P,disabled:b.disabled||void 0,media:b.media.length>0?Array.from(b.media):void 0};return A})}function Nf(h,b,_,P){if(b===Fs.HIDDEN)return null;var A=h.getAttribute(_);if(b===Fs.MASK&&_!==wd&&!og.includes(_)&&_!==P.actionNameAttribute){var $=h.tagName;switch(_){case"title":case"alt":case"placeholder":return Pi}if(($==="IMG"||$==="SOURCE")&&(_==="src"||_==="srcset"))return xd;if($==="A"&&_==="href"||A&&Xe(_,"data-"))return Pi}return!A||typeof A!="string"?A:A.length>iu&&A.slice(0,5)==="data:"?"data:truncated":A}function c(h,b,_){var P;if(b===Fs.HIDDEN)return{};for(var A={},$=_d(h.tagName),Y=h.ownerDocument,he=0;he<h.attributes.length;he+=1){var me=h.attributes.item(he),Ae=me.name,Ge=Nf(h,b,Ae,_.configuration);Ge!==null&&(A[Ae]=Ge)}if(h.value&&($==="textarea"||$==="select"||$==="option"||$==="input")){var ht=Pf(h,b);ht!==void 0&&(A.value=ht)}if($==="option"&&b===Fs.ALLOW){var jt=h;jt.selected&&(A.selected=jt.selected)}if($==="link"){var an=Array.from(Y.styleSheets).find(function(Go){return Go.href===h.href}),sn=f(an);sn&&an&&!ko(I.DISABLE_REPLAY_INLINE_CSS)&&(A._cssText=sn)}if($==="style"&&h.sheet){var sn=f(h.sheet);sn&&(A._cssText=sn)}var kn=h;if($==="input"&&(kn.type==="radio"||kn.type==="checkbox")&&(b===Fs.ALLOW?A.checked=!!kn.checked:Uh(kn,b)&&delete A.checked),$==="audio"||$==="video"){var is=h;A.rr_mediaState=is.paused?"paused":"played"}var Ns,co,da=_.serializationContext;switch(da.status){case 0:Ns=Math.round(h.scrollTop),co=Math.round(h.scrollLeft),(Ns||co)&&da.elementsScrollPositions.set(h,{scrollTop:Ns,scrollLeft:co});break;case 1:da.elementsScrollPositions.has(h)&&(P=da.elementsScrollPositions.get(h),Ns=P.scrollTop,co=P.scrollLeft);break}return co&&(A.rr_scrollLeft=co),Ns&&(A.rr_scrollTop=Ns),A}function f(h){if(!h)return null;var b;try{b=h.rules||h.cssRules}catch{}if(!b)return null;var _=Array.from(b,rl()?y:C).join("");return Xw(_,h.href)}function y(h){if(F(h)&&h.selectorText.includes(":")){var b=/(\[[\w-]+[^\\])(:[^\]]+\])/g;return h.cssText.replace(b,"$1\\$2")}return C(h)}function C(h){return O(h)&&f(h.styleSheet)||h.cssText}function O(h){return"styleSheet"in h}function F(h){return"selectorText"in h}function de(h,b){var _=dn(h,b);if(!_)return null;var P=Oi(h)||Ye(),A=_;return A.id=P,jg(h,P),b.serializedNodeIds&&b.serializedNodeIds.add(P),A}var Fe=1;function Ye(){return Fe++}function Ot(h,b){var _=[];return Qm(h,function(P){var A=de(P,b);A&&_.push(A)}),_}function dn(h,b){switch(h.nodeType){case h.DOCUMENT_NODE:return pn(h,b);case h.DOCUMENT_FRAGMENT_NODE:return on(h,b);case h.DOCUMENT_TYPE_NODE:return Zn(h);case h.ELEMENT_NODE:return dr(h,b);case h.TEXT_NODE:return ua(h,b);case h.CDATA_SECTION_NODE:return wt()}}function pn(h,b){return{type:dl.Document,childNodes:Ot(h,b),adoptedStyleSheets:Mg(h.adoptedStyleSheets)}}function on(h,b){var _=ep(h);return _&&b.serializationContext.shadowRootsController.addShadowRoot(h),{type:dl.DocumentFragment,childNodes:Ot(h,b),isShadowRoot:_,adoptedStyleSheets:_?Mg(h.adoptedStyleSheets):void 0}}function Zn(h){return{type:dl.DocumentType,name:h.name,publicId:h.publicId,systemId:h.systemId}}function dr(h,b){var _,P=_d(h.tagName),A=hr(h)||void 0,$=zh(xp(h),b.parentNodePrivacyLevel);if($===Fs.HIDDEN){var Y=h.getBoundingClientRect(),he=Y.width,me=Y.height;return{type:dl.Element,tagName:P,attributes:(_={rr_width:"".concat(he,"px"),rr_height:"".concat(me,"px")},_[wd]=Og,_),childNodes:[],isSVG:A}}if($!==Fs.IGNORE){var Ae=c(h,$,b),Ge=[];if(Gm(h)&&P!=="style"){var ht=void 0;b.parentNodePrivacyLevel===$&&b.ignoreWhiteSpace===(P==="head")?ht=b:ht=ze({},b,{parentNodePrivacyLevel:$,ignoreWhiteSpace:P==="head"}),Ge=Ot(h,ht)}return{type:dl.Element,tagName:P,attributes:Ae,childNodes:Ge,isSVG:A}}}function hr(h){return h.tagName==="svg"||h instanceof SVGElement}function ua(h,b){var _=_p(h,b.ignoreWhiteSpace||!1,b.parentNodePrivacyLevel);if(_!==void 0)return{type:dl.Text,textContent:_}}function wt(){return{type:dl.CDATA,textContent:""}}function nt(h,b,_){return de(h,{serializationContext:_,parentNodePrivacyLevel:b.defaultPrivacyLevel,configuration:b})}function Et(h){return Boolean(h.changedTouches)}function vn(h){return h.composed===!0&&Jd(h.target)?h.composedPath()[0]:h.target}var yr=25;function Qr(h){return Math.abs(h.pageTop-h.offsetTop-window.scrollY)>yr||Math.abs(h.pageLeft-h.offsetLeft-window.scrollX)>yr}var Wr=function(h,b){var _=window.visualViewport,P={layoutViewportX:h,layoutViewportY:b,visualViewportX:h,visualViewportY:b};if(_)Qr(_)?(P.layoutViewportX=Math.round(h+_.offsetLeft),P.layoutViewportY=Math.round(b+_.offsetTop)):(P.visualViewportX=Math.round(h-_.offsetLeft),P.visualViewportY=Math.round(b-_.offsetTop));else return P;return P},as=function(h){return{scale:h.scale,offsetLeft:h.offsetLeft,offsetTop:h.offsetTop,pageLeft:h.pageLeft,pageTop:h.pageTop,height:h.height,width:h.width}},Ua=50;function eo(h,b){var _=nr(function(P){var A=vn(P);if(fl(A)){var $=ic(P);if(!$)return;var Y={id:Oi(A),timeOffset:0,x:$.x,y:$.y};b([Y],Et(P)?au.TouchMove:au.MouseMove)}},Ua,{trailing:!1}).throttled;return _t(h,document,["mousemove","touchmove"],_,{capture:!0,passive:!0}).stop}function ic(h){var b=Et(h)?h.changedTouches[0]:h,_=b.clientX,P=b.clientY;if(window.visualViewport){var A=Wr(_,P),$=A.visualViewportX,Y=A.visualViewportY;_=$,P=Y}if(!Number.isFinite(_)||!Number.isFinite(P)){h.isTrusted&&hi("mouse/touch event without x/y");return}return{x:_,y:P}}var Wh=100;function kv(h,b,_,P){var A=nr(function($){var Y=vn($);if(!(!Y||Gi(Y,_)===Fs.HIDDEN||!fl(Y))){var he=Oi(Y),me=Y===document?{scrollTop:yg(),scrollLeft:Ph()}:{scrollTop:Math.round(Y.scrollTop),scrollLeft:Math.round(Y.scrollLeft)};P.set(Y,me),b({id:he,x:me.scrollLeft,y:me.scrollTop})}},Wh).throttled;return pt(h,document,"scroll",A,{capture:!0,passive:!0}).stop}var jl,$g=(jl={},jl.pointerup=ai.MouseUp,jl.mousedown=ai.MouseDown,jl.click=ai.Click,jl.contextmenu=ai.ContextMenu,jl.dblclick=ai.DblClick,jl.focus=ai.Focus,jl.blur=ai.Blur,jl.touchstart=ai.TouchStart,jl.touchend=ai.TouchEnd,jl);function Zw(h,b,_){var P=function(A){var $=vn(A);if(!(Gi($,h.defaultPrivacyLevel)===Fs.HIDDEN||!fl($))){var Y=Oi($),he=$g[A.type],me;if(he!==ai.Blur&&he!==ai.Focus){var Ae=ic(A);if(!Ae)return;me={id:Y,type:he,x:Ae.x,y:Ae.y}}else me={id:Y,type:he};var Ge=ze({id:_.getIdForEvent(A)},yo(au.MouseInteraction,me));b(Ge)}};return _t(h,document,Object.keys($g),P,{capture:!0,passive:!0}).stop}function Rv(h,b,_){_===void 0&&(_=document);var P=h.defaultPrivacyLevel,A=new WeakMap,$=_!==document,Y=_t(h,_,$?["change"]:["input","change"],function(ht){var jt=vn(ht);(jt instanceof HTMLInputElement||jt instanceof HTMLTextAreaElement||jt instanceof HTMLSelectElement)&&Ae(jt)},{capture:!0,passive:!0}).stop,he;if($)he=rr;else{var me=[Rl(HTMLInputElement.prototype,"value",Ae),Rl(HTMLInputElement.prototype,"checked",Ae),Rl(HTMLSelectElement.prototype,"value",Ae),Rl(HTMLTextAreaElement.prototype,"value",Ae),Rl(HTMLSelectElement.prototype,"selectedIndex",Ae)];he=function(){me.forEach(function(ht){return ht.stop()})}}return function(){he(),Y()};function Ae(ht){var jt=Gi(ht,P);if(jt!==Fs.HIDDEN){var an=ht.type,sn;if(an==="radio"||an==="checkbox"){if(Uh(ht,jt))return;sn={isChecked:ht.checked}}else{var kn=Pf(ht,jt);if(kn===void 0)return;sn={text:kn}}Ge(ht,sn);var is=ht.name;an==="radio"&&is&&ht.checked&&qe(document.querySelectorAll('input[type="radio"][name="'.concat(Vt(is),'"]')),function(Ns){Ns!==ht&&Ge(Ns,{isChecked:!1})})}}function Ge(ht,jt){if(fl(ht)){var an=A.get(ht);(!an||an.text!==jt.text||an.isChecked!==jt.isChecked)&&(A.set(ht,jt),b(ze({id:Oi(ht)},jt)))}}}function Jw(h){function b(A,$){A&&fl(A.ownerNode)&&$(Oi(A.ownerNode))}var _=[Xo(CSSStyleSheet.prototype,"insertRule",{before:function(A,$){b(this,function(Y){return h({id:Y,adds:[{rule:A,index:$}]})})}}),Xo(CSSStyleSheet.prototype,"deleteRule",{before:function(A){b(this,function($){return h({id:$,removes:[{index:A}]})})}})];typeof CSSGroupingRule<"u"?P(CSSGroupingRule):(P(CSSMediaRule),P(CSSSupportsRule));function P(A){_.push(Xo(A.prototype,"insertRule",{before:function($,Y){var he=this;b(this.parentStyleSheet,function(me){var Ae=nb(he);Ae&&(Ae.push(Y||0),h({id:me,adds:[{rule:$,index:Ae}]}))})}}),Xo(A.prototype,"deleteRule",{before:function($){var Y=this;b(this.parentStyleSheet,function(he){var me=nb(Y);me&&(me.push($),h({id:he,removes:[{index:me}]}))})}}))}return function(){return _.forEach(function(A){return A.stop()})}}function nb(h){for(var b=[],_=h;_.parentRule;){var P=Array.from(_.parentRule.cssRules),A=P.indexOf(_);b.unshift(A),_=_.parentRule}if(_.parentStyleSheet){var $=Array.from(_.parentStyleSheet.cssRules),Y=$.indexOf(_);return b.unshift(Y),b}}function Pv(h,b,_){return _t(h,document,["play","pause"],function(P){var A=vn(P);!A||Gi(A,_)===Fs.HIDDEN||!fl(A)||b({id:Oi(A),type:P.type==="play"?Fh.Play:Fh.Pause})},{capture:!0,passive:!0}).stop}function rb(h,b,_){return h.subscribe(10,function(P){var A,$,Y;P.rawRumEvent.type==="action"&&P.rawRumEvent.action.type==="click"&&(!(($=(A=P.rawRumEvent.action.frustration)===null||A===void 0?void 0:A.type)===null||$===void 0)&&$.length)&&"events"in P.domainContext&&(!((Y=P.domainContext.events)===null||Y===void 0)&&Y.length)&&b({timestamp:P.rawRumEvent.date,type:Il.FrustrationRecord,data:{frustrationTypes:P.rawRumEvent.action.frustration.type,recordIds:P.domainContext.events.map(function(he){return _.getIdForEvent(he)})}})}).unsubscribe}var Ov=200;function Nv(h,b){return Wi(h).subscribe(b).unsubscribe}function Av(h,b){var _=window.visualViewport;if(!_)return rr;var P=nr(function(){b(as(_))},Ov,{trailing:!1}),A=P.throttled,$=P.cancel,Y=_t(h,_,["resize","scroll"],A,{capture:!0,passive:!0}).stop;return function(){Y(),$()}}var sP=100;function Vc(h){var b=rr,_=[];function P(){b(),h(_),_=[]}return{addMutations:function(A){_.length===0&&(b=ex(P,{timeout:sP})),_.push.apply(_,A)},flush:P,stop:function(){b()}}}function ex(h,b){if(window.requestIdleCallback&&window.cancelIdleCallback){var _=window.requestIdleCallback(te(h),b);return function(){return window.cancelIdleCallback(_)}}var P=window.requestAnimationFrame(te(h));return function(){return window.cancelAnimationFrame(P)}}function tx(h,b,_,P){var A=vo();if(!A)return{stop:rr,flush:rr};var $=Vc(function(he){s1(he.concat(Y.takeRecords()),h,b,_)}),Y=new A(te($.addMutations));return Y.observe(P,{attributeOldValue:!0,attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),{stop:function(){Y.disconnect(),$.stop()},flush:function(){$.flush()}}}function s1(h,b,_,P){h.filter(function(ht){return ht.type==="childList"}).forEach(function(ht){ht.removedNodes.forEach(function(jt){sb(jt,P.removeShadowRoot)})});var A=h.filter(function(ht){return ht.target.isConnected&&Ig(ht.target)&&Gi(ht.target,_.defaultPrivacyLevel)!==Fs.HIDDEN}),$=Af(A.filter(function(ht){return ht.type==="childList"}),_,P),Y=$.adds,he=$.removes,me=$.hasBeenSerialized,Ae=o1(A.filter(function(ht){return ht.type==="characterData"&&!me(ht.target)}),_),Ge=oP(A.filter(function(ht){return ht.type==="attributes"&&!me(ht.target)}),_);!Ae.length&&!Ge.length&&!he.length&&!Y.length||b({adds:Y,removes:he,texts:Ae,attributes:Ge})}function Af(h,b,_){for(var P=new Set,A=new Map,$=function(Fr){Fr.addedNodes.forEach(function(zr){P.add(zr)}),Fr.removedNodes.forEach(function(zr){P.has(zr)||A.set(zr,Fr.target),P.delete(zr)})},Y=0,he=h;Y<he.length;Y++){var me=he[Y];$(me)}var Ae=Array.from(P);a1(Ae);for(var Ge=new Set,ht=[],jt=0,an=Ae;jt<an.length;jt++){var sn=an[jt];if(!da(sn)){var kn=Gi(sn.parentNode,b.defaultPrivacyLevel);if(!(kn===Fs.HIDDEN||kn===Fs.IGNORE)){var is=de(sn,{serializedNodeIds:Ge,parentNodePrivacyLevel:kn,serializationContext:{status:2,shadowRootsController:_},configuration:b});if(is){var Ns=ih(sn);ht.push({nextId:Go(sn),parentId:Oi(Ns),node:is})}}}}var co=[];return A.forEach(function(Fr,zr){fl(zr)&&co.push({parentId:Oi(Fr),id:Oi(zr)})}),{adds:ht,removes:co,hasBeenSerialized:da};function da(Fr){return fl(Fr)&&Ge.has(Oi(Fr))}function Go(Fr){for(var zr=Fr.nextSibling;zr;){if(fl(zr))return Oi(zr);zr=zr.nextSibling}return null}}function o1(h,b){for(var _,P=[],A=new Set,$=h.filter(function(ht){return A.has(ht.target)?!1:(A.add(ht.target),!0)}),Y=0,he=$;Y<he.length;Y++){var me=he[Y],Ae=me.target.textContent;if(Ae!==me.oldValue){var Ge=Gi(ih(me.target),b.defaultPrivacyLevel);Ge===Fs.HIDDEN||Ge===Fs.IGNORE||P.push({id:Oi(me.target),value:(_=_p(me.target,!1,Ge))!==null&&_!==void 0?_:null})}}return P}function oP(h,b){for(var _=[],P=new Map,A=h.filter(function(kn){var is=P.get(kn.target);return is?.has(kn.attributeName)?!1:(is?is.add(kn.attributeName):P.set(kn.target,new Set([kn.attributeName])),!0)}),$=new Map,Y=0,he=A;Y<he.length;Y++){var me=he[Y],Ae=me.target.getAttribute(me.attributeName);if(Ae!==me.oldValue){var Ge=Gi(me.target,b.defaultPrivacyLevel),ht=Nf(me.target,Ge,me.attributeName,b),jt=void 0;if(me.attributeName==="value"){var an=Pf(me.target,Ge);if(an===void 0)continue;jt=an}else typeof ht=="string"?jt=ht:jt=null;var sn=$.get(me.target);sn||(sn={id:Oi(me.target),attributes:{}},_.push(sn),$.set(me.target,sn)),sn.attributes[me.attributeName]=jt}}return _}function a1(h){h.sort(function(b,_){var P=b.compareDocumentPosition(_);return P&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:P&Node.DOCUMENT_POSITION_CONTAINS||P&Node.DOCUMENT_POSITION_FOLLOWING?1:P&Node.DOCUMENT_POSITION_PRECEDING?-1:0})}function sb(h,b){Jd(h)&&b(h.shadowRoot),Qm(h,function(_){return sb(_,b)})}function lc(h,b){return _t(h,window,["focus","blur"],function(){b({has_focus:document.hasFocus()})}).stop}function Yt(){var h=new WeakMap,b=1;return{getIdForEvent:function(_){return h.has(_)||h.set(_,b++),h.get(_)}}}function Lg(h,b){var _=Yt(),P=tx(b.mutationCb,b.configuration,b.shadowRootsController,document),A=eo(h,b.mousemoveCb),$=Zw(h,b.mouseInteractionCb,_),Y=kv(h,b.scrollCb,b.configuration.defaultPrivacyLevel,b.elementsScrollPositions),he=Nv(h,b.viewportResizeCb),me=Rv(h,b.inputCb),Ae=Pv(h,b.mediaInteractionCb,b.configuration.defaultPrivacyLevel),Ge=Jw(b.styleSheetCb),ht=lc(h,b.focusCb),jt=Av(h,b.visualViewportResizeCb),an=rb(b.lifeCycle,b.frustrationCb,_);return{flush:function(){P.flush()},stop:function(){P.stop(),A(),$(),Y(),he(),me(),Ae(),Ge(),ht(),jt(),an()}}}function i1(){var h=new WeakMap;return{set:function(b,_){b===document&&!document.scrollingElement||h.set(b===document?document.scrollingElement:b,_)},get:function(b){return h.get(b)},has:function(b){return h.has(b)}}}var Za=function(h,b){var _=b.mutationCb,P=b.inputCb,A=new Map,$={addShadowRoot:function(Y){var he=tx(_,h,$,Y),me=he.stop,Ae=he.flush,Ge=Rv(h,P,Y);A.set(Y,{flush:Ae,stop:function(){me(),Ge()}})},removeShadowRoot:function(Y){var he=A.get(Y);he&&(he.stop(),A.delete(Y))},stop:function(){A.forEach(function(Y){var he=Y.stop;return he()})},flush:function(){A.forEach(function(Y){var he=Y.flush;return he()})}};return $};function ba(h){var b=h.emit,_=h.configuration;if(!b)throw new Error("emit function is required");var P=i1(),A=function(jt){b(yo(au.Mutation,jt))},$=function(jt){return b(yo(au.Input,jt))},Y=Za(_,{mutationCb:A,inputCb:$}),he=function(jt,an){jt===void 0&&(jt=Vs()),an===void 0&&(an={status:0,elementsScrollPositions:P,shadowRootsController:Y});var sn=fp(),kn=sn.width,is=sn.height;b({data:{height:is,href:window.location.href,width:kn},type:Il.Meta,timestamp:jt}),b({data:{has_focus:document.hasFocus()},type:Il.Focus,timestamp:jt}),b({data:{node:nt(document,_,an),initialOffset:{left:Ph(),top:yg()}},type:Il.FullSnapshot,timestamp:jt}),window.visualViewport&&b({data:as(window.visualViewport),type:Il.VisualViewport,timestamp:jt})};he();var me=Lg(_,{lifeCycle:h.lifeCycle,configuration:_,elementsScrollPositions:P,inputCb:$,mediaInteractionCb:function(jt){return b(yo(au.MediaInteraction,jt))},mouseInteractionCb:function(jt){return b(jt)},mousemoveCb:function(jt,an){return b(yo(an,{positions:jt}))},mutationCb:A,scrollCb:function(jt){return b(yo(au.Scroll,jt))},styleSheetCb:function(jt){return b(yo(au.StyleSheetRule,jt))},viewportResizeCb:function(jt){return b(yo(au.ViewportResize,jt))},frustrationCb:function(jt){return b(jt)},focusCb:function(jt){return b({data:jt,type:Il.Focus,timestamp:Vs()})},visualViewportResizeCb:function(jt){b({data:jt,type:Il.VisualViewport,timestamp:Vs()})},shadowRootsController:Y}),Ae=me.stop,Ge=me.flush;function ht(){Y.flush(),Ge()}return{stop:function(){Y.stop(),Ae()},takeSubsequentFullSnapshot:function(jt){ht(),he(jt,{shadowRootsController:Y,status:1,elementsScrollPositions:P})},flushMutations:ht,shadowRootsController:Y}}function Fg(h,b,_){var P=new FormData;P.append("segment",new Blob([h],{type:"application/octet-stream"}),"".concat(b.session.id,"-").concat(b.start));var A=ze({raw_segment_size:_,compressed_segment_size:h.byteLength},b),$=JSON.stringify(A);return P.append("event",new Blob([$],{type:"application/json"})),{data:P,bytesCount:h.byteLength}}var l1=10,Na;function nx(h){return jv(h).segments_count}function c1(h){jv(h).segments_count+=1}function u1(h){jv(h).records_count+=1}function Iv(h,b){jv(h).segments_total_raw_size+=b}function qh(h){return Na?.get(h)}function aP(){Na=void 0}function jv(h){Na||(Na=new Map);var b;return Na.has(h)?b=Na.get(h):(b={records_count:0,segments_count:0,segments_total_raw_size:0},Na.set(h,b),Na.size>l1&&d1()),b}function d1(){if(Na)if(Na.keys)Na.delete(Na.keys().next().value);else{var h=!0;Na.forEach(function(b,_){h&&(Na.delete(_),h=!1)})}}var f1=function(){function h(b,_,P){this.encoder=b;var A=_.view.id;this.metadata=ze({start:1/0,end:-1/0,creation_reason:P,records_count:0,has_full_snapshot:!1,index_in_view:nx(A),source:"browser"},_),c1(A)}return h.prototype.addRecord=function(b,_){var P;this.metadata.start=Math.min(this.metadata.start,b.timestamp),this.metadata.end=Math.max(this.metadata.end,b.timestamp),this.metadata.records_count+=1,(P=this.metadata).has_full_snapshot||(P.has_full_snapshot=b.type===Il.FullSnapshot),Vm("record",{record:b,segment:this.metadata}),u1(this.metadata.view.id);var A=this.metadata.records_count===1?'{"records":[':",";this.encoder.write(A+JSON.stringify(b),_)},h.prototype.flush=function(b){var _=this;if(this.metadata.records_count===0)throw new Error("Empty segment flushed");this.encoder.write("],".concat(JSON.stringify(this.metadata).slice(1),`
`),function(){Iv(_.metadata.view.id,_.encoder.rawBytesCount),b(_.metadata)}),this.encoder.reset()},h}(),ob=30*ns,ab=6e4;function p1(h,b,_,P,A,$){return Sp(h,function(){return ib(b.applicationId,_,P)},A,$)}function Sp(h,b,_,P){var A={status:0,nextSegmentCreationReason:"init"},$=h.subscribe(2,function(){he("view_change")}).unsubscribe,Y=h.subscribe(9,function(me){he(me.reason)}).unsubscribe;function he(me){A.status===1&&(A.segment.flush(function(Ae){var Ge=Fg(P.encodedBytes,Ae,P.rawBytesCount);Wm(me)?_.sendOnExit(Ge):_.send(Ge)}),un(A.expirationTimeoutId)),me!=="stop"?A={status:0,nextSegmentCreationReason:me}:A={status:2}}return{addRecord:function(me){if(A.status!==2){if(A.status===0){var Ae=b();if(!Ae)return;A={status:1,segment:new f1(P,Ae,A.nextSegmentCreationReason),expirationTimeoutId:yt(function(){he("segment_duration_limit")},ob)}}var Ge=A.segment;Ge.addRecord(me,function(){A.status===1&&A.segment===Ge&&P.encodedBytesCount>ab&&he("segment_bytes_limit")})}},stop:function(){he("stop"),$(),Y()}}}function ib(h,b,_){var P=b.findTrackedSession(),A=_.findView();if(!(!P||!A))return{application:{id:h},session:{id:P.id},view:{id:A.id}}}function Bu(h){h===void 0&&(h=6e4),ab=h}function h1(h,b,_,P,A,$){var Y=function(Ns){h.notify(12,{error:Ns}),hi("Error reported to customer",{"error.message":Ns.message})},he=$||za(b,b.sessionReplayEndpointBuilder,ab,Y),me=p1(h,b,_,P,he,A),Ae=me.addRecord,Ge=me.stop,ht=ba({emit:Ae,configuration:b,lifeCycle:h}),jt=ht.stop,an=ht.takeSubsequentFullSnapshot,sn=ht.flushMutations,kn=h.subscribe(4,function(){sn(),Ae({timestamp:Vs(),type:Il.ViewEnd})}).unsubscribe,is=h.subscribe(2,function(Ns){an(Ns.startClocks.timeStamp)}).unsubscribe;return{stop:function(){kn(),is(),jt(),Ge()}}}function rx(){return typeof Array.from=="function"&&typeof CSSSupportsRule=="function"&&typeof URL.createObjectURL=="function"&&"forEach"in NodeList.prototype}function m1(h,b,_,P){var A=b.findTrackedSession(),$=sx(A,P),Y=_.findView();return xv(h,{viewContext:Y,errorType:$,session:A})}function sx(h,b){if(!rx())return"browser-not-supported";if(!h)return"rum-not-tracked";if(!h.sessionReplayAllowed)return"incorrect-session-plan";if(!b)return"replay-not-started"}function g1(h,b,_){var P=0,A=[],$,Y=0,he=[],me=pt(h,b,"message",function(Ae){var Ge=Ae.data;if(!(Ge.type!=="wrote"||Ge.streamId!==_)){var ht=he.shift();ht&&ht.id===Ge.id?(Ge.id===0?(P=Ge.additionalBytesCount,A=[Ge.result]):(P+=Ge.additionalBytesCount,A.push(Ge.result)),$=Ge.trailer,ht.callback()):(me(),hi("Worker responses received out of order."))}}).stop;return{get encodedBytes(){return A.length?kt(A.concat($)):new Uint8Array(0)},get encodedBytesCount(){return A.length?A.reduce(function(Ae,Ge){return Ae+Ge.length},0)+$.length:0},get rawBytesCount(){return P},write:function(Ae,Ge){b.postMessage({action:"write",id:Y,data:Ae,streamId:_}),he.push({id:Y,callback:Ge}),Y+=1},reset:function(){b.postMessage({action:"reset",streamId:_}),Y=0},stop:function(){me()}}}var Ps=10*ns;function ox(h){return new Worker(h.workerUrl||URL.createObjectURL(new Blob(['!function(){"use strict";function t(t){for(var e=t.reduce((function(t,e){return t+e.length}),0),a=new Uint8Array(e),n=0,r=0,i=t;r<i.length;r++){var s=i[r];a.set(s,n),n+=s.length}return a}function e(t){for(var e=t.length;--e>=0;)t[e]=0}var a=256,n=286,r=30,i=15,s=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),_=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),h=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),l=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),o=new Array(576);e(o);var d=new Array(60);e(d);var u=new Array(512);e(u);var f=new Array(256);e(f);var c=new Array(29);e(c);var p,g,w,v=new Array(r);function b(t,e,a,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}function m(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(v);var y=function(t){return t<256?u[t]:u[256+(t>>>7)]},k=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},z=function(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,k(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},x=function(t,e,a){z(t,a[2*e],a[2*e+1])},A=function(t,e){var a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},E=function(t,e,a){var n,r,s=new Array(16),_=0;for(n=1;n<=i;n++)s[n]=_=_+a[n-1]<<1;for(r=0;r<=e;r++){var h=t[2*r+1];0!==h&&(t[2*r]=A(s[h]++,h))}},Z=function(t){var e;for(e=0;e<n;e++)t.dyn_ltree[2*e]=0;for(e=0;e<r;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0},U=function(t){t.bi_valid>8?k(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},S=function(t,e,a,n){var r=2*e,i=2*a;return t[r]<t[i]||t[r]===t[i]&&n[e]<=n[a]},R=function(t,e,a){for(var n=t.heap[a],r=a<<1;r<=t.heap_len&&(r<t.heap_len&&S(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!S(e,n,t.heap[r],t.depth));)t.heap[a]=t.heap[r],a=r,r<<=1;t.heap[a]=n},L=function(t,e,n){var r,i,h,l,o=0;if(0!==t.last_lit)do{r=t.pending_buf[t.d_buf+2*o]<<8|t.pending_buf[t.d_buf+2*o+1],i=t.pending_buf[t.l_buf+o],o++,0===r?x(t,i,e):(h=f[i],x(t,h+a+1,e),0!==(l=s[h])&&(i-=c[h],z(t,i,l)),r--,h=y(r),x(t,h,n),0!==(l=_[h])&&(r-=v[h],z(t,r,l)))}while(o<t.last_lit);x(t,256,e)},F=function(t,e){var a,n,r,s=e.dyn_tree,_=e.stat_desc.static_tree,h=e.stat_desc.has_stree,l=e.stat_desc.elems,o=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<l;a++)0!==s[2*a]?(t.heap[++t.heap_len]=o=a,t.depth[a]=0):s[2*a+1]=0;for(;t.heap_len<2;)s[2*(r=t.heap[++t.heap_len]=o<2?++o:0)]=1,t.depth[r]=0,t.opt_len--,h&&(t.static_len-=_[2*r+1]);for(e.max_code=o,a=t.heap_len>>1;a>=1;a--)R(t,s,a);r=l;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],R(t,s,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,s[2*r]=s[2*a]+s[2*n],t.depth[r]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,s[2*a+1]=s[2*n+1]=r,t.heap[1]=r++,R(t,s,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,n,r,s,_,h,l=e.dyn_tree,o=e.max_code,d=e.stat_desc.static_tree,u=e.stat_desc.has_stree,f=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,p=e.stat_desc.max_length,g=0;for(s=0;s<=i;s++)t.bl_count[s]=0;for(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(s=l[2*l[2*(n=t.heap[a])+1]+1]+1)>p&&(s=p,g++),l[2*n+1]=s,n>o||(t.bl_count[s]++,_=0,n>=c&&(_=f[n-c]),h=l[2*n],t.opt_len+=h*(s+_),u&&(t.static_len+=h*(d[2*n+1]+_)));if(0!==g){do{for(s=p-1;0===t.bl_count[s];)s--;t.bl_count[s]--,t.bl_count[s+1]+=2,t.bl_count[p]--,g-=2}while(g>0);for(s=p;0!==s;s--)for(n=t.bl_count[s];0!==n;)(r=t.heap[--a])>o||(l[2*r+1]!==s&&(t.opt_len+=(s-l[2*r+1])*l[2*r],l[2*r+1]=s),n--)}}(t,e),E(s,o,t.bl_count)},T=function(t,e,a){var n,r,i=-1,s=e[1],_=0,h=7,l=4;for(0===s&&(h=138,l=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++_<h&&r===s||(_<l?t.bl_tree[2*r]+=_:0!==r?(r!==i&&t.bl_tree[2*r]++,t.bl_tree[32]++):_<=10?t.bl_tree[34]++:t.bl_tree[36]++,_=0,i=r,0===s?(h=138,l=3):r===s?(h=6,l=3):(h=7,l=4))},I=function(t,e,a){var n,r,i=-1,s=e[1],_=0,h=7,l=4;for(0===s&&(h=138,l=3),n=0;n<=a;n++)if(r=s,s=e[2*(n+1)+1],!(++_<h&&r===s)){if(_<l)do{x(t,r,t.bl_tree)}while(0!=--_);else 0!==r?(r!==i&&(x(t,r,t.bl_tree),_--),x(t,16,t.bl_tree),z(t,_-3,2)):_<=10?(x(t,17,t.bl_tree),z(t,_-3,3)):(x(t,18,t.bl_tree),z(t,_-11,7));_=0,i=r,0===s?(h=138,l=3):r===s?(h=6,l=3):(h=7,l=4)}},N=!1,O=function(t,e,a,n){z(t,0+(n?1:0),3),function(t,e,a,n){U(t),n&&(k(t,a),k(t,~a)),t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a}(t,e,a,!0)},D=function(t,e,n,r){var i,s,_=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,n=4093624447;for(e=0;e<=31;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<a;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),F(t,t.l_desc),F(t,t.d_desc),_=function(t){var e;for(T(t,t.dyn_ltree,t.l_desc.max_code),T(t,t.dyn_dtree,t.d_desc.max_code),F(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*l[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),i=t.opt_len+3+7>>>3,(s=t.static_len+3+7>>>3)<=i&&(i=s)):i=s=n+5,n+4<=i&&-1!==e?O(t,e,n,r):4===t.strategy||s===i?(z(t,2+(r?1:0),3),L(t,o,d)):(z(t,4+(r?1:0),3),function(t,e,a,n){var r;for(z(t,e-257,5),z(t,a-1,5),z(t,n-4,4),r=0;r<n;r++)z(t,t.bl_tree[2*l[r]+1],3);I(t,t.dyn_ltree,e-1),I(t,t.dyn_dtree,a-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,_+1),L(t,t.dyn_ltree,t.dyn_dtree)),Z(t),r&&U(t)},B={_tr_init:function(t){N||(!function(){var t,e,a,l,m,y=new Array(16);for(a=0,l=0;l<28;l++)for(c[l]=a,t=0;t<1<<s[l];t++)f[a++]=l;for(f[a-1]=l,m=0,l=0;l<16;l++)for(v[l]=m,t=0;t<1<<_[l];t++)u[m++]=l;for(m>>=7;l<r;l++)for(v[l]=m<<7,t=0;t<1<<_[l]-7;t++)u[256+m++]=l;for(e=0;e<=i;e++)y[e]=0;for(t=0;t<=143;)o[2*t+1]=8,t++,y[8]++;for(;t<=255;)o[2*t+1]=9,t++,y[9]++;for(;t<=279;)o[2*t+1]=7,t++,y[7]++;for(;t<=287;)o[2*t+1]=8,t++,y[8]++;for(E(o,287,y),t=0;t<r;t++)d[2*t+1]=5,d[2*t]=A(t,5);p=new b(o,s,257,n,i),g=new b(d,_,0,r,i),w=new b(new Array(0),h,0,19,7)}(),N=!0),t.l_desc=new m(t.dyn_ltree,p),t.d_desc=new m(t.dyn_dtree,g),t.bl_desc=new m(t.bl_tree,w),t.bi_buf=0,t.bi_valid=0,Z(t)},_tr_stored_block:O,_tr_flush_block:D,_tr_tally:function(t,e,n){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&n,t.last_lit++,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(f[n]+a+1)]++,t.dyn_dtree[2*y(e)]++),t.last_lit===t.lit_bufsize-1},_tr_align:function(t){z(t,2,3),x(t,256,o),function(t){16===t.bi_valid?(k(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},C=function(t,e,a,n){for(var r=65535&t|0,i=t>>>16&65535|0,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{i=i+(r=r+e[n++]|0)|0}while(--s);r%=65521,i%=65521}return r|i<<16|0},H=new Uint32Array(function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}()),M=function(t,e,a,n){var r=H,i=n+a;t^=-1;for(var s=n;s<i;s++)t=t>>>8^r[255&(t^e[s])];return-1^t},Y={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},K={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},P=B._tr_init,j=B._tr_stored_block,G=B._tr_flush_block,X=B._tr_tally,W=B._tr_align,q=K.Z_NO_FLUSH,J=K.Z_PARTIAL_FLUSH,Q=K.Z_FULL_FLUSH,V=K.Z_FINISH,$=K.Z_BLOCK,tt=K.Z_OK,et=K.Z_STREAM_END,at=K.Z_STREAM_ERROR,nt=K.Z_DATA_ERROR,rt=K.Z_BUF_ERROR,it=K.Z_DEFAULT_COMPRESSION,st=K.Z_FILTERED,_t=K.Z_HUFFMAN_ONLY,ht=K.Z_RLE,lt=K.Z_FIXED,ot=K.Z_DEFAULT_STRATEGY,dt=K.Z_UNKNOWN,ut=K.Z_DEFLATED,ft=258,ct=262,pt=103,gt=113,wt=666,vt=function(t,e){return t.msg=Y[e],e},bt=function(t){return(t<<1)-(t>4?9:0)},mt=function(t){for(var e=t.length;--e>=0;)t[e]=0},yt=function(t,e,a){return(e<<t.hash_shift^a)&t.hash_mask},kt=function(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},zt=function(t,e){G(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,kt(t.strm)},xt=function(t,e){t.pending_buf[t.pending++]=e},At=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},Et=function(t,e){var a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,_=t.nice_match,h=t.strstart>t.w_size-ct?t.strstart-(t.w_size-ct):0,l=t.window,o=t.w_mask,d=t.prev,u=t.strstart+ft,f=l[i+s-1],c=l[i+s];t.prev_length>=t.good_match&&(r>>=2),_>t.lookahead&&(_=t.lookahead);do{if(l[(a=e)+s]===c&&l[a+s-1]===f&&l[a]===l[i]&&l[++a]===l[i+1]){i+=2,a++;do{}while(l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&i<u);if(n=ft-(u-i),i=u-ft,n>s){if(t.match_start=e,s=n,n>=_)break;f=l[i+s-1],c=l[i+s]}}}while((e=d[e&o])>h&&0!=--r);return s<=t.lookahead?s:t.lookahead},Zt=function(t){var e,a,n,r,i,s,_,h,l,o,d=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=d+(d-ct)){t.window.set(t.window.subarray(d,d+d),0),t.match_start-=d,t.strstart-=d,t.block_start-=d,e=a=t.hash_size;do{n=t.head[--e],t.head[e]=n>=d?n-d:0}while(--a);e=a=d;do{n=t.prev[--e],t.prev[e]=n>=d?n-d:0}while(--a);r+=d}if(0===t.strm.avail_in)break;if(s=t.strm,_=t.window,h=t.strstart+t.lookahead,l=r,o=void 0,(o=s.avail_in)>l&&(o=l),a=0===o?0:(s.avail_in-=o,_.set(s.input.subarray(s.next_in,s.next_in+o),h),1===s.state.wrap?s.adler=C(s.adler,_,o,h):2===s.state.wrap&&(s.adler=M(s.adler,_,o,h)),s.next_in+=o,s.total_in+=o,o),t.lookahead+=a,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=yt(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=yt(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<ct&&0!==t.strm.avail_in)},Ut=function(t,e){for(var a,n;;){if(t.lookahead<ct){if(Zt(t),t.lookahead<ct&&e===q)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=yt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-ct&&(t.match_length=Et(t,a)),t.match_length>=3)if(n=X(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=yt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=yt(t,t.ins_h,t.window[t.strstart+1]);else n=X(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(zt(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===V?(zt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(zt(t,!1),0===t.strm.avail_out)?1:2},St=function(t,e){for(var a,n,r;;){if(t.lookahead<ct){if(Zt(t),t.lookahead<ct&&e===q)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=yt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-ct&&(t.match_length=Et(t,a),t.match_length<=5&&(t.strategy===st||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,n=X(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=yt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(zt(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=X(t,0,t.window[t.strstart-1]))&&zt(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=X(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===V?(zt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(zt(t,!1),0===t.strm.avail_out)?1:2};function Rt(t,e,a,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=r}var Lt=[new Rt(0,0,0,0,(function(t,e){var a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(Zt(t),0===t.lookahead&&e===q)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+a;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,zt(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-ct&&(zt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===V?(zt(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(zt(t,!1),t.strm.avail_out),1)})),new Rt(4,4,8,4,Ut),new Rt(4,5,16,8,Ut),new Rt(4,6,32,32,Ut),new Rt(4,4,16,16,St),new Rt(8,16,32,32,St),new Rt(8,16,128,128,St),new Rt(8,32,128,256,St),new Rt(32,128,258,1024,St),new Rt(32,258,258,4096,St)];function Ft(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ut,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),mt(this.dyn_ltree),mt(this.dyn_dtree),mt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),mt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),mt(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var Tt=function(t){if(!t||!t.state)return vt(t,at);t.total_in=t.total_out=0,t.data_type=dt;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:gt,t.adler=2===e.wrap?0:1,e.last_flush=q,P(e),tt},It=function(t){var e,a=Tt(t);return a===tt&&((e=t.state).window_size=2*e.w_size,mt(e.head),e.max_lazy_match=Lt[e.level].max_lazy,e.good_match=Lt[e.level].good_length,e.nice_match=Lt[e.level].nice_length,e.max_chain_length=Lt[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),a},Nt=function(t,e,a,n,r,i){if(!t)return at;var s=1;if(e===it&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>9||a!==ut||n<8||n>15||e<0||e>9||i<0||i>lt)return vt(t,at);8===n&&(n=9);var _=new Ft;return t.state=_,_.strm=t,_.wrap=s,_.gzhead=null,_.w_bits=n,_.w_size=1<<_.w_bits,_.w_mask=_.w_size-1,_.hash_bits=r+7,_.hash_size=1<<_.hash_bits,_.hash_mask=_.hash_size-1,_.hash_shift=~~((_.hash_bits+3-1)/3),_.window=new Uint8Array(2*_.w_size),_.head=new Uint16Array(_.hash_size),_.prev=new Uint16Array(_.w_size),_.lit_bufsize=1<<r+6,_.pending_buf_size=4*_.lit_bufsize,_.pending_buf=new Uint8Array(_.pending_buf_size),_.d_buf=1*_.lit_bufsize,_.l_buf=3*_.lit_bufsize,_.level=e,_.strategy=i,_.method=a,It(t)},Ot={deflateInit:function(t,e){return Nt(t,e,ut,15,8,ot)},deflateInit2:Nt,deflateReset:It,deflateResetKeep:Tt,deflateSetHeader:function(t,e){return t&&t.state?2!==t.state.wrap?at:(t.state.gzhead=e,tt):at},deflate:function(t,e){var a,n;if(!t||!t.state||e>$||e<0)return t?vt(t,at):at;var r=t.state;if(!t.output||!t.input&&0!==t.avail_in||r.status===wt&&e!==V)return vt(t,0===t.avail_out?rt:at);r.strm=t;var i=r.last_flush;if(r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,xt(r,31),xt(r,139),xt(r,8),r.gzhead?(xt(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),xt(r,255&r.gzhead.time),xt(r,r.gzhead.time>>8&255),xt(r,r.gzhead.time>>16&255),xt(r,r.gzhead.time>>24&255),xt(r,9===r.level?2:r.strategy>=_t||r.level<2?4:0),xt(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(xt(r,255&r.gzhead.extra.length),xt(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=M(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(xt(r,0),xt(r,0),xt(r,0),xt(r,0),xt(r,0),xt(r,9===r.level?2:r.strategy>=_t||r.level<2?4:0),xt(r,3),r.status=gt);else{var s=ut+(r.w_bits-8<<4)<<8;s|=(r.strategy>=_t||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(s|=32),s+=31-s%31,r.status=gt,At(r,s),0!==r.strstart&&(At(r,t.adler>>>16),At(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(a=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>a&&(t.adler=M(t.adler,r.pending_buf,r.pending-a,a)),kt(t),a=r.pending,r.pending!==r.pending_buf_size));)xt(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>a&&(t.adler=M(t.adler,r.pending_buf,r.pending-a,a)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=M(t.adler,r.pending_buf,r.pending-a,a)),kt(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,xt(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=M(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=M(t.adler,r.pending_buf,r.pending-a,a)),kt(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,xt(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=M(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.status=pt)}else r.status=pt;if(r.status===pt&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&kt(t),r.pending+2<=r.pending_buf_size&&(xt(r,255&t.adler),xt(r,t.adler>>8&255),t.adler=0,r.status=gt)):r.status=gt),0!==r.pending){if(kt(t),0===t.avail_out)return r.last_flush=-1,tt}else if(0===t.avail_in&&bt(e)<=bt(i)&&e!==V)return vt(t,rt);if(r.status===wt&&0!==t.avail_in)return vt(t,rt);if(0!==t.avail_in||0!==r.lookahead||e!==q&&r.status!==wt){var _=r.strategy===_t?function(t,e){for(var a;;){if(0===t.lookahead&&(Zt(t),0===t.lookahead)){if(e===q)return 1;break}if(t.match_length=0,a=X(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(zt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===V?(zt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(zt(t,!1),0===t.strm.avail_out)?1:2}(r,e):r.strategy===ht?function(t,e){for(var a,n,r,i,s=t.window;;){if(t.lookahead<=ft){if(Zt(t),t.lookahead<=ft&&e===q)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[r=t.strstart-1])===s[++r]&&n===s[++r]&&n===s[++r]){i=t.strstart+ft;do{}while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&r<i);t.match_length=ft-(i-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=X(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=X(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(zt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===V?(zt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(zt(t,!1),0===t.strm.avail_out)?1:2}(r,e):Lt[r.level].func(r,e);if(3!==_&&4!==_||(r.status=wt),1===_||3===_)return 0===t.avail_out&&(r.last_flush=-1),tt;if(2===_&&(e===J?W(r):e!==$&&(j(r,0,0,!1),e===Q&&(mt(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),kt(t),0===t.avail_out))return r.last_flush=-1,tt}return e!==V?tt:r.wrap<=0?et:(2===r.wrap?(xt(r,255&t.adler),xt(r,t.adler>>8&255),xt(r,t.adler>>16&255),xt(r,t.adler>>24&255),xt(r,255&t.total_in),xt(r,t.total_in>>8&255),xt(r,t.total_in>>16&255),xt(r,t.total_in>>24&255)):(At(r,t.adler>>>16),At(r,65535&t.adler)),kt(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?tt:et)},deflateEnd:function(t){if(!t||!t.state)return at;var e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==pt&&e!==gt&&e!==wt?vt(t,at):(t.state=null,e===gt?vt(t,nt):tt)},deflateSetDictionary:function(t,e){var a=e.length;if(!t||!t.state)return at;var n=t.state,r=n.wrap;if(2===r||1===r&&42!==n.status||n.lookahead)return at;if(1===r&&(t.adler=C(t.adler,e,a,0)),n.wrap=0,a>=n.w_size){0===r&&(mt(n.head),n.strstart=0,n.block_start=0,n.insert=0);var i=new Uint8Array(n.w_size);i.set(e.subarray(a-n.w_size,a),0),e=i,a=n.w_size}var s=t.avail_in,_=t.next_in,h=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,Zt(n);n.lookahead>=3;){var l=n.strstart,o=n.lookahead-2;do{n.ins_h=yt(n,n.ins_h,n.window[l+3-1]),n.prev[l&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=l,l++}while(--o);n.strstart=l,n.lookahead=2,Zt(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=_,t.input=h,t.avail_in=s,n.wrap=r,tt},deflateInfo:"pako deflate (from Nodeca project)"};for(var Dt=new Uint8Array(256),Bt=0;Bt<256;Bt++)Dt[Bt]=Bt>=252?6:Bt>=248?5:Bt>=240?4:Bt>=224?3:Bt>=192?2:1;Dt[254]=Dt[254]=1;var Ct=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},Ht=Object.prototype.toString,Mt=K.Z_NO_FLUSH,Yt=K.Z_SYNC_FLUSH,Kt=K.Z_FULL_FLUSH,Pt=K.Z_FINISH,jt=K.Z_OK,Gt=K.Z_STREAM_END,Xt=K.Z_DEFAULT_COMPRESSION,Wt=K.Z_DEFAULT_STRATEGY,qt=K.Z_DEFLATED;function Jt(){this.options={level:Xt,method:qt,chunkSize:16384,windowBits:15,memLevel:8,strategy:Wt};var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ct,this.strm.avail_out=0;var e=Ot.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(e!==jt)throw new Error(Y[e]);if(t.header&&Ot.deflateSetHeader(this.strm,t.header),t.dictionary){var a;if(a="[object ArrayBuffer]"===Ht.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(e=Ot.deflateSetDictionary(this.strm,a))!==jt)throw new Error(Y[e]);this._dict_set=!0}}function Qt(t,e,a){try{t.postMessage({type:"errored",error:e,streamId:a})}catch(n){t.postMessage({type:"errored",error:String(e),streamId:a})}}function Vt(t){var e=t.strm.adler;return new Uint8Array([3,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e])}Jt.prototype.push=function(t,e){var a,n,r=this.strm,i=this.options.chunkSize;if(this.ended)return!1;for(n=e===~~e?e:!0===e?Pt:Mt,"[object ArrayBuffer]"===Ht.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(n===Yt||n===Kt)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if((a=Ot.deflate(r,n))===Gt)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=Ot.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===jt;if(0!==r.avail_out){if(n>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},Jt.prototype.onData=function(t){this.chunks.push(t)},Jt.prototype.onEnd=function(t){t===jt&&(this.result=function(t){for(var e=0,a=0,n=t.length;a<n;a++)e+=t[a].length;for(var r=new Uint8Array(e),i=0,s=0,_=t.length;i<_;i++){var h=t[i];r.set(h,s),s+=h.length}return r}(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},function(e){void 0===e&&(e=self);try{var a=new Map;e.addEventListener("message",(function(n){try{var r=function(e,a){switch(a.action){case"init":return{type:"initialized",version:"4.50.1"};case"write":var n=e.get(a.streamId);n||(n=new Jt,e.set(a.streamId,n));var r=n.chunks.length,i=function(t){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);var e,a,n,r,i,s=t.length,_=0;for(r=0;r<s;r++)55296==(64512&(a=t.charCodeAt(r)))&&r+1<s&&56320==(64512&(n=t.charCodeAt(r+1)))&&(a=65536+(a-55296<<10)+(n-56320),r++),_+=a<128?1:a<2048?2:a<65536?3:4;for(e=new Uint8Array(_),i=0,r=0;i<_;r++)55296==(64512&(a=t.charCodeAt(r)))&&r+1<s&&56320==(64512&(n=t.charCodeAt(r+1)))&&(a=65536+(a-55296<<10)+(n-56320),r++),a<128?e[i++]=a:a<2048?(e[i++]=192|a>>>6,e[i++]=128|63&a):a<65536?(e[i++]=224|a>>>12,e[i++]=128|a>>>6&63,e[i++]=128|63&a):(e[i++]=240|a>>>18,e[i++]=128|a>>>12&63,e[i++]=128|a>>>6&63,e[i++]=128|63&a);return e}(a.data);return n.push(i,K.Z_SYNC_FLUSH),{type:"wrote",id:a.id,streamId:a.streamId,result:t(n.chunks.slice(r)),trailer:Vt(n),additionalBytesCount:i.length};case"reset":e.delete(a.streamId)}}(a,n.data);r&&e.postMessage(r)}catch(t){Qt(e,t,n.data&&"streamId"in n.data?n.data.streamId:void 0)}}))}catch(t){Qt(e,t)}}()}();'])))}var ea={status:0};function v1(h,b,_,P){switch(P===void 0&&(P=ox),ea.status===0&&y1(h,b,P),ea.status){case 1:return ea.initializationFailureCallbacks.push(_),ea.worker;case 3:return ea.worker}}function iP(){(ea.status===3||ea.status===1)&&ea.stop(),ea={status:0}}function ax(){return ea.status}function y1(h,b,_){_===void 0&&(_=ox);try{var P=_(h),A=pt(h,P,"error",function(he){cb(h,b,he)}).stop,$=pt(h,P,"message",function(he){var me=he.data;me.type==="errored"?cb(h,b,me.error,me.streamId):me.type==="initialized"&&lb(me.version)}).stop;P.postMessage({action:"init"}),yt(function(){return ta(b)},Ps);var Y=function(){A(),$()};ea={status:1,worker:P,stop:Y,initializationFailureCallbacks:[]}}catch(he){cb(h,b,he)}}function ta(h){ea.status===1&&(W.error("".concat(h," failed to start: a timeout occurred while initializing the Worker")),ea.initializationFailureCallbacks.forEach(function(b){return b()}),ea={status:2})}function lb(h){ea.status===1&&(ea={status:3,worker:ea.worker,stop:ea.stop,version:h})}function cb(h,b,_,P){if(ea.status===1||ea.status===0){if(W.error("".concat(b," failed to start: an error occurred while creating the Worker:"),_),_ instanceof Event||_ instanceof Error&&ix(_.message)){var A=void 0;h.workerUrl?A="Please make sure the Worker URL ".concat(h.workerUrl," is correct and CSP is correctly configured."):A="Please make sure CSP is correctly configured.",W.error("".concat(A," See documentation at https://docs.datadoghq.com/integrations/content_security_policy_logs/#use-csp-with-real-user-monitoring-and-session-replay"))}else Ta(_);ea.status===1&&ea.initializationFailureCallbacks.forEach(function($){return $()}),ea={status:2}}else Ta(_,{worker_version:ea.status===3&&ea.version,stream_id:P})}function ix(h){return $e(h,"Content Security Policy")||$e(h,"requires 'TrustedScriptURL'")}function Cp(h,b){if(bt()||!rx())return{start:rr,stop:rr,getReplayStats:function(){},onRumStart:rr,isRecording:function(){return!1},getSessionReplayLink:function(){}};var _={status:0},P=function(){_={status:1}},A=function(){_={status:0}};return{start:function(){return P()},stop:function(){return A()},getSessionReplayLink:function($,Y,he){return m1($,Y,he,_.status!==0)},onRumStart:function($,Y,he,me){$.subscribe(7,function(){(_.status===2||_.status===3)&&(A(),_={status:1})}),$.subscribe(8,function(){_.status===1&&P()}),P=function(){var Ae=he.findTrackedSession();if(!Ae||!Ae.sessionReplayAllowed){_={status:1};return}_.status===2||_.status===3||(_={status:2},oh(Y,"interactive",function(){if(_.status===2){var Ge=v1(Y,"Datadog Session Replay",function(){A()},b);if(!Ge){_={status:0};return}var ht=h($,Y,he,me,g1(Y,Ge,1)).stop;_={status:3,stopRecording:ht}}}))},A=function(){_.status!==0&&(_.status===3&&_.stopRecording(),_={status:0})},_.status===1&&P()},isRecording:function(){return ax()===3&&_.status===3},getReplayStats:function($){return ax()===3?qh($):void 0}}}var lx=Cp(h1),zg=Bm(wp,lx);De(ct(),"DD_RUM",zg)},6721:(a,l)=>{"use strict";var se;se=!0,l.A=function(we,Te){if(we&&Te){var ae=Array.isArray(Te)?Te:Te.split(","),ie=we.name||"",W=(we.type||"").toLowerCase(),ee=W.replace(/\/.*$/,"");return ae.some(function(q){var Z=q.trim().toLowerCase();return Z.charAt(0)==="."?ie.toLowerCase().endsWith(Z):Z.endsWith("/*")?ee===Z.replace(/\/.*$/,""):W===Z})}return!0}},9583:(a,l,se)=>{"use strict";se.d(l,{$:()=>Te,A:()=>ae});function we(ie){var W,ee,q="";if(typeof ie=="string"||typeof ie=="number")q+=ie;else if(typeof ie=="object")if(Array.isArray(ie))for(W=0;W<ie.length;W++)ie[W]&&(ee=we(ie[W]))&&(q&&(q+=" "),q+=ee);else for(W in ie)ie[W]&&(q&&(q+=" "),q+=W);return q}function Te(){for(var ie,W,ee=0,q="";ee<arguments.length;)(ie=arguments[ee++])&&(W=we(ie))&&(q&&(q+=" "),q+=W);return q}const ae=Te},3933:(a,l,se)=>{const we=se(5554),Te={};for(const W of Object.keys(we))Te[we[W]]=W;const ae={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};a.exports=ae;for(const W of Object.keys(ae)){if(!("channels"in ae[W]))throw new Error("missing channels property: "+W);if(!("labels"in ae[W]))throw new Error("missing channel labels property: "+W);if(ae[W].labels.length!==ae[W].channels)throw new Error("channel and label counts mismatch: "+W);const{channels:ee,labels:q}=ae[W];delete ae[W].channels,delete ae[W].labels,Object.defineProperty(ae[W],"channels",{value:ee}),Object.defineProperty(ae[W],"labels",{value:q})}ae.rgb.hsl=function(W){const ee=W[0]/255,q=W[1]/255,Z=W[2]/255,U=Math.min(ee,q,Z),ge=Math.max(ee,q,Z),ne=ge-U;let ve,V;ge===U?ve=0:ee===ge?ve=(q-Z)/ne:q===ge?ve=2+(Z-ee)/ne:Z===ge&&(ve=4+(ee-q)/ne),ve=Math.min(ve*60,360),ve<0&&(ve+=360);const te=(U+ge)/2;return ge===U?V=0:te<=.5?V=ne/(ge+U):V=ne/(2-ge-U),[ve,V*100,te*100]},ae.rgb.hsv=function(W){let ee,q,Z,U,ge;const ne=W[0]/255,ve=W[1]/255,V=W[2]/255,te=Math.max(ne,ve,V),Re=te-Math.min(ne,ve,V),Ie=function($e){return(te-$e)/6/Re+1/2};return Re===0?(U=0,ge=0):(ge=Re/te,ee=Ie(ne),q=Ie(ve),Z=Ie(V),ne===te?U=Z-q:ve===te?U=.3333333333333333+ee-Z:V===te&&(U=.6666666666666666+q-ee),U<0?U+=1:U>1&&(U-=1)),[U*360,ge*100,te*100]},ae.rgb.hwb=function(W){const ee=W[0],q=W[1];let Z=W[2];const U=ae.rgb.hsl(W)[0],ge=1/255*Math.min(ee,Math.min(q,Z));return Z=1-.00392156862745098*Math.max(ee,Math.max(q,Z)),[U,ge*100,Z*100]},ae.rgb.cmyk=function(W){const ee=W[0]/255,q=W[1]/255,Z=W[2]/255,U=Math.min(1-ee,1-q,1-Z),ge=(1-ee-U)/(1-U)||0,ne=(1-q-U)/(1-U)||0,ve=(1-Z-U)/(1-U)||0;return[ge*100,ne*100,ve*100,U*100]};function ie(W,ee){return(W[0]-ee[0])**2+(W[1]-ee[1])**2+(W[2]-ee[2])**2}ae.rgb.keyword=function(W){const ee=Te[W];if(ee)return ee;let q=1/0,Z;for(const U of Object.keys(we)){const ge=we[U],ne=ie(W,ge);ne<q&&(q=ne,Z=U)}return Z},ae.keyword.rgb=function(W){return we[W]},ae.rgb.xyz=function(W){let ee=W[0]/255,q=W[1]/255,Z=W[2]/255;ee=ee>.04045?((ee+.055)/1.055)**2.4:ee/12.92,q=q>.04045?((q+.055)/1.055)**2.4:q/12.92,Z=Z>.04045?((Z+.055)/1.055)**2.4:Z/12.92;const U=ee*.4124+q*.3576+Z*.1805,ge=ee*.2126+q*.7152+Z*.0722,ne=ee*.0193+q*.1192+Z*.9505;return[U*100,ge*100,ne*100]},ae.rgb.lab=function(W){const ee=ae.rgb.xyz(W);let q=ee[0],Z=ee[1],U=ee[2];q/=95.047,Z/=100,U/=108.883,q=q>.008856?q**.3333333333333333:7.787*q+.13793103448275862,Z=Z>.008856?Z**.3333333333333333:7.787*Z+.13793103448275862,U=U>.008856?U**.3333333333333333:7.787*U+.13793103448275862;const ge=116*Z-16,ne=500*(q-Z),ve=200*(Z-U);return[ge,ne,ve]},ae.hsl.rgb=function(W){const ee=W[0]/360,q=W[1]/100,Z=W[2]/100;let U,ge,ne;if(q===0)return ne=Z*255,[ne,ne,ne];Z<.5?U=Z*(1+q):U=Z+q-Z*q;const ve=2*Z-U,V=[0,0,0];for(let te=0;te<3;te++)ge=ee+.3333333333333333*-(te-1),ge<0&&ge++,ge>1&&ge--,6*ge<1?ne=ve+(U-ve)*6*ge:2*ge<1?ne=U:3*ge<2?ne=ve+(U-ve)*(.6666666666666666-ge)*6:ne=ve,V[te]=ne*255;return V},ae.hsl.hsv=function(W){const ee=W[0];let q=W[1]/100,Z=W[2]/100,U=q;const ge=Math.max(Z,.01);Z*=2,q*=Z<=1?Z:2-Z,U*=ge<=1?ge:2-ge;const ne=(Z+q)/2,ve=Z===0?2*U/(ge+U):2*q/(Z+q);return[ee,ve*100,ne*100]},ae.hsv.rgb=function(W){const ee=W[0]/60,q=W[1]/100;let Z=W[2]/100;const U=Math.floor(ee)%6,ge=ee-Math.floor(ee),ne=255*Z*(1-q),ve=255*Z*(1-q*ge),V=255*Z*(1-q*(1-ge));switch(Z*=255,U){case 0:return[Z,V,ne];case 1:return[ve,Z,ne];case 2:return[ne,Z,V];case 3:return[ne,ve,Z];case 4:return[V,ne,Z];case 5:return[Z,ne,ve]}},ae.hsv.hsl=function(W){const ee=W[0],q=W[1]/100,Z=W[2]/100,U=Math.max(Z,.01);let ge,ne;ne=(2-q)*Z;const ve=(2-q)*U;return ge=q*U,ge/=ve<=1?ve:2-ve,ge=ge||0,ne/=2,[ee,ge*100,ne*100]},ae.hwb.rgb=function(W){const ee=W[0]/360;let q=W[1]/100,Z=W[2]/100;const U=q+Z;let ge;U>1&&(q/=U,Z/=U);const ne=Math.floor(6*ee),ve=1-Z;ge=6*ee-ne,ne&1&&(ge=1-ge);const V=q+ge*(ve-q);let te,Re,Ie;switch(ne){default:case 6:case 0:te=ve,Re=V,Ie=q;break;case 1:te=V,Re=ve,Ie=q;break;case 2:te=q,Re=ve,Ie=V;break;case 3:te=q,Re=V,Ie=ve;break;case 4:te=V,Re=q,Ie=ve;break;case 5:te=ve,Re=q,Ie=V;break}return[te*255,Re*255,Ie*255]},ae.cmyk.rgb=function(W){const ee=W[0]/100,q=W[1]/100,Z=W[2]/100,U=W[3]/100,ge=1-Math.min(1,ee*(1-U)+U),ne=1-Math.min(1,q*(1-U)+U),ve=1-Math.min(1,Z*(1-U)+U);return[ge*255,ne*255,ve*255]},ae.xyz.rgb=function(W){const ee=W[0]/100,q=W[1]/100,Z=W[2]/100;let U,ge,ne;return U=ee*3.2406+q*-1.5372+Z*-.4986,ge=ee*-.9689+q*1.8758+Z*.0415,ne=ee*.0557+q*-.204+Z*1.057,U=U>.0031308?1.055*U**.4166666666666667-.055:U*12.92,ge=ge>.0031308?1.055*ge**.4166666666666667-.055:ge*12.92,ne=ne>.0031308?1.055*ne**.4166666666666667-.055:ne*12.92,U=Math.min(Math.max(0,U),1),ge=Math.min(Math.max(0,ge),1),ne=Math.min(Math.max(0,ne),1),[U*255,ge*255,ne*255]},ae.xyz.lab=function(W){let ee=W[0],q=W[1],Z=W[2];ee/=95.047,q/=100,Z/=108.883,ee=ee>.008856?ee**.3333333333333333:7.787*ee+.13793103448275862,q=q>.008856?q**.3333333333333333:7.787*q+.13793103448275862,Z=Z>.008856?Z**.3333333333333333:7.787*Z+.13793103448275862;const U=116*q-16,ge=500*(ee-q),ne=200*(q-Z);return[U,ge,ne]},ae.lab.xyz=function(W){const ee=W[0],q=W[1],Z=W[2];let U,ge,ne;ge=(ee+16)/116,U=q/500+ge,ne=ge-Z/200;const ve=ge**3,V=U**3,te=ne**3;return ge=ve>.008856?ve:(ge-.13793103448275862)/7.787,U=V>.008856?V:(U-.13793103448275862)/7.787,ne=te>.008856?te:(ne-.13793103448275862)/7.787,U*=95.047,ge*=100,ne*=108.883,[U,ge,ne]},ae.lab.lch=function(W){const ee=W[0],q=W[1],Z=W[2];let U;U=Math.atan2(Z,q)*360/2/Math.PI,U<0&&(U+=360);const ne=Math.sqrt(q*q+Z*Z);return[ee,ne,U]},ae.lch.lab=function(W){const ee=W[0],q=W[1],U=W[2]/360*2*Math.PI,ge=q*Math.cos(U),ne=q*Math.sin(U);return[ee,ge,ne]},ae.rgb.ansi16=function(W,ee=null){const[q,Z,U]=W;let ge=ee===null?ae.rgb.hsv(W)[2]:ee;if(ge=Math.round(ge/50),ge===0)return 30;let ne=30+(Math.round(U/255)<<2|Math.round(Z/255)<<1|Math.round(q/255));return ge===2&&(ne+=60),ne},ae.hsv.ansi16=function(W){return ae.rgb.ansi16(ae.hsv.rgb(W),W[2])},ae.rgb.ansi256=function(W){const ee=W[0],q=W[1],Z=W[2];return ee===q&&q===Z?ee<8?16:ee>248?231:Math.round((ee-8)/247*24)+232:16+36*Math.round(ee/255*5)+6*Math.round(q/255*5)+Math.round(Z/255*5)},ae.ansi16.rgb=function(W){let ee=W%10;if(ee===0||ee===7)return W>50&&(ee+=3.5),ee=ee/10.5*255,[ee,ee,ee];const q=(~~(W>50)+1)*.5,Z=(ee&1)*q*255,U=(ee>>1&1)*q*255,ge=(ee>>2&1)*q*255;return[Z,U,ge]},ae.ansi256.rgb=function(W){if(W>=232){const ge=(W-232)*10+8;return[ge,ge,ge]}W-=16;let ee;const q=Math.floor(W/36)/5*255,Z=Math.floor((ee=W%36)/6)/5*255,U=ee%6/5*255;return[q,Z,U]},ae.rgb.hex=function(W){const q=(((Math.round(W[0])&255)<<16)+((Math.round(W[1])&255)<<8)+(Math.round(W[2])&255)).toString(16).toUpperCase();return"000000".substring(q.length)+q},ae.hex.rgb=function(W){const ee=W.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!ee)return[0,0,0];let q=ee[0];ee[0].length===3&&(q=q.split("").map(ve=>ve+ve).join(""));const Z=parseInt(q,16),U=Z>>16&255,ge=Z>>8&255,ne=Z&255;return[U,ge,ne]},ae.rgb.hcg=function(W){const ee=W[0]/255,q=W[1]/255,Z=W[2]/255,U=Math.max(Math.max(ee,q),Z),ge=Math.min(Math.min(ee,q),Z),ne=U-ge;let ve,V;return ne<1?ve=ge/(1-ne):ve=0,ne<=0?V=0:U===ee?V=(q-Z)/ne%6:U===q?V=2+(Z-ee)/ne:V=4+(ee-q)/ne,V/=6,V%=1,[V*360,ne*100,ve*100]},ae.hsl.hcg=function(W){const ee=W[1]/100,q=W[2]/100,Z=q<.5?2*ee*q:2*ee*(1-q);let U=0;return Z<1&&(U=(q-.5*Z)/(1-Z)),[W[0],Z*100,U*100]},ae.hsv.hcg=function(W){const ee=W[1]/100,q=W[2]/100,Z=ee*q;let U=0;return Z<1&&(U=(q-Z)/(1-Z)),[W[0],Z*100,U*100]},ae.hcg.rgb=function(W){const ee=W[0]/360,q=W[1]/100,Z=W[2]/100;if(q===0)return[Z*255,Z*255,Z*255];const U=[0,0,0],ge=ee%1*6,ne=ge%1,ve=1-ne;let V=0;switch(Math.floor(ge)){case 0:U[0]=1,U[1]=ne,U[2]=0;break;case 1:U[0]=ve,U[1]=1,U[2]=0;break;case 2:U[0]=0,U[1]=1,U[2]=ne;break;case 3:U[0]=0,U[1]=ve,U[2]=1;break;case 4:U[0]=ne,U[1]=0,U[2]=1;break;default:U[0]=1,U[1]=0,U[2]=ve}return V=(1-q)*Z,[(q*U[0]+V)*255,(q*U[1]+V)*255,(q*U[2]+V)*255]},ae.hcg.hsv=function(W){const ee=W[1]/100,q=W[2]/100,Z=ee+q*(1-ee);let U=0;return Z>0&&(U=ee/Z),[W[0],U*100,Z*100]},ae.hcg.hsl=function(W){const ee=W[1]/100,Z=W[2]/100*(1-ee)+.5*ee;let U=0;return Z>0&&Z<.5?U=ee/(2*Z):Z>=.5&&Z<1&&(U=ee/(2*(1-Z))),[W[0],U*100,Z*100]},ae.hcg.hwb=function(W){const ee=W[1]/100,q=W[2]/100,Z=ee+q*(1-ee);return[W[0],(Z-ee)*100,(1-Z)*100]},ae.hwb.hcg=function(W){const ee=W[1]/100,Z=1-W[2]/100,U=Z-ee;let ge=0;return U<1&&(ge=(Z-U)/(1-U)),[W[0],U*100,ge*100]},ae.apple.rgb=function(W){return[W[0]/65535*255,W[1]/65535*255,W[2]/65535*255]},ae.rgb.apple=function(W){return[W[0]/255*65535,W[1]/255*65535,W[2]/255*65535]},ae.gray.rgb=function(W){return[W[0]/100*255,W[0]/100*255,W[0]/100*255]},ae.gray.hsl=function(W){return[0,0,W[0]]},ae.gray.hsv=ae.gray.hsl,ae.gray.hwb=function(W){return[0,100,W[0]]},ae.gray.cmyk=function(W){return[0,0,0,W[0]]},ae.gray.lab=function(W){return[W[0],0,0]},ae.gray.hex=function(W){const ee=Math.round(W[0]/100*255)&255,Z=((ee<<16)+(ee<<8)+ee).toString(16).toUpperCase();return"000000".substring(Z.length)+Z},ae.rgb.gray=function(W){return[(W[0]+W[1]+W[2])/3/255*100]}},5920:(a,l,se)=>{const we=se(3933),Te=se(1729),ae={},ie=Object.keys(we);function W(q){const Z=function(...U){const ge=U[0];return ge==null?ge:(ge.length>1&&(U=ge),q(U))};return"conversion"in q&&(Z.conversion=q.conversion),Z}function ee(q){const Z=function(...U){const ge=U[0];if(ge==null)return ge;ge.length>1&&(U=ge);const ne=q(U);if(typeof ne=="object")for(let ve=ne.length,V=0;V<ve;V++)ne[V]=Math.round(ne[V]);return ne};return"conversion"in q&&(Z.conversion=q.conversion),Z}ie.forEach(q=>{ae[q]={},Object.defineProperty(ae[q],"channels",{value:we[q].channels}),Object.defineProperty(ae[q],"labels",{value:we[q].labels});const Z=Te(q);Object.keys(Z).forEach(ge=>{const ne=Z[ge];ae[q][ge]=ee(ne),ae[q][ge].raw=W(ne)})}),a.exports=ae},1729:(a,l,se)=>{const we=se(3933);function Te(){const ee={},q=Object.keys(we);for(let Z=q.length,U=0;U<Z;U++)ee[q[U]]={distance:-1,parent:null};return ee}function ae(ee){const q=Te(),Z=[ee];for(q[ee].distance=0;Z.length;){const U=Z.pop(),ge=Object.keys(we[U]);for(let ne=ge.length,ve=0;ve<ne;ve++){const V=ge[ve],te=q[V];te.distance===-1&&(te.distance=q[U].distance+1,te.parent=U,Z.unshift(V))}}return q}function ie(ee,q){return function(Z){return q(ee(Z))}}function W(ee,q){const Z=[q[ee].parent,ee];let U=we[q[ee].parent][ee],ge=q[ee].parent;for(;q[ge].parent;)Z.unshift(q[ge].parent),U=ie(we[q[ge].parent][ge],U),ge=q[ge].parent;return U.conversion=Z,U}a.exports=function(ee){const q=ae(ee),Z={},U=Object.keys(q);for(let ge=U.length,ne=0;ne<ge;ne++){const ve=U[ne];q[ve].parent!==null&&(Z[ve]=W(ve,q))}return Z}},5554:a=>{"use strict";a.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},4744:(a,l,se)=>{var we=se(5554),Te=se(846),ae=Object.hasOwnProperty,ie=Object.create(null);for(var W in we)ae.call(we,W)&&(ie[we[W]]=W);var ee=a.exports={to:{},get:{}};ee.get=function(U){var ge=U.substring(0,3).toLowerCase(),ne,ve;switch(ge){case"hsl":ne=ee.get.hsl(U),ve="hsl";break;case"hwb":ne=ee.get.hwb(U),ve="hwb";break;default:ne=ee.get.rgb(U),ve="rgb";break}return ne?{model:ve,value:ne}:null},ee.get.rgb=function(U){if(!U)return null;var ge=/^#([a-f0-9]{3,4})$/i,ne=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,ve=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,V=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,te=/^(\w+)$/,Re=[0,0,0,1],Ie,$e,vt;if(Ie=U.match(ne)){for(vt=Ie[2],Ie=Ie[1],$e=0;$e<3;$e++){var mt=$e*2;Re[$e]=parseInt(Ie.slice(mt,mt+2),16)}vt&&(Re[3]=parseInt(vt,16)/255)}else if(Ie=U.match(ge)){for(Ie=Ie[1],vt=Ie[3],$e=0;$e<3;$e++)Re[$e]=parseInt(Ie[$e]+Ie[$e],16);vt&&(Re[3]=parseInt(vt+vt,16)/255)}else if(Ie=U.match(ve)){for($e=0;$e<3;$e++)Re[$e]=parseInt(Ie[$e+1],0);Ie[4]&&(Ie[5]?Re[3]=parseFloat(Ie[4])*.01:Re[3]=parseFloat(Ie[4]))}else if(Ie=U.match(V)){for($e=0;$e<3;$e++)Re[$e]=Math.round(parseFloat(Ie[$e+1])*2.55);Ie[4]&&(Ie[5]?Re[3]=parseFloat(Ie[4])*.01:Re[3]=parseFloat(Ie[4]))}else return(Ie=U.match(te))?Ie[1]==="transparent"?[0,0,0,0]:ae.call(we,Ie[1])?(Re=we[Ie[1]],Re[3]=1,Re):null:null;for($e=0;$e<3;$e++)Re[$e]=q(Re[$e],0,255);return Re[3]=q(Re[3],0,1),Re},ee.get.hsl=function(U){if(!U)return null;var ge=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,ne=U.match(ge);if(ne){var ve=parseFloat(ne[4]),V=(parseFloat(ne[1])%360+360)%360,te=q(parseFloat(ne[2]),0,100),Re=q(parseFloat(ne[3]),0,100),Ie=q(isNaN(ve)?1:ve,0,1);return[V,te,Re,Ie]}return null},ee.get.hwb=function(U){if(!U)return null;var ge=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,ne=U.match(ge);if(ne){var ve=parseFloat(ne[4]),V=(parseFloat(ne[1])%360+360)%360,te=q(parseFloat(ne[2]),0,100),Re=q(parseFloat(ne[3]),0,100),Ie=q(isNaN(ve)?1:ve,0,1);return[V,te,Re,Ie]}return null},ee.to.hex=function(){var U=Te(arguments);return"#"+Z(U[0])+Z(U[1])+Z(U[2])+(U[3]<1?Z(Math.round(U[3]*255)):"")},ee.to.rgb=function(){var U=Te(arguments);return U.length<4||U[3]===1?"rgb("+Math.round(U[0])+", "+Math.round(U[1])+", "+Math.round(U[2])+")":"rgba("+Math.round(U[0])+", "+Math.round(U[1])+", "+Math.round(U[2])+", "+U[3]+")"},ee.to.rgb.percent=function(){var U=Te(arguments),ge=Math.round(U[0]/255*100),ne=Math.round(U[1]/255*100),ve=Math.round(U[2]/255*100);return U.length<4||U[3]===1?"rgb("+ge+"%, "+ne+"%, "+ve+"%)":"rgba("+ge+"%, "+ne+"%, "+ve+"%, "+U[3]+")"},ee.to.hsl=function(){var U=Te(arguments);return U.length<4||U[3]===1?"hsl("+U[0]+", "+U[1]+"%, "+U[2]+"%)":"hsla("+U[0]+", "+U[1]+"%, "+U[2]+"%, "+U[3]+")"},ee.to.hwb=function(){var U=Te(arguments),ge="";return U.length>=4&&U[3]!==1&&(ge=", "+U[3]),"hwb("+U[0]+", "+U[1]+"%, "+U[2]+"%"+ge+")"},ee.to.keyword=function(U){return ie[U.slice(0,3)]};function q(U,ge,ne){return Math.min(Math.max(ge,U),ne)}function Z(U){var ge=Math.round(U).toString(16).toUpperCase();return ge.length<2?"0"+ge:ge}},9462:(a,l,se)=>{const we=se(4744),Te=se(5920),ae=["keyword","gray","hex"],ie={};for(const V of Object.keys(Te))ie[[...Te[V].labels].sort().join("")]=V;const W={};function ee(V,te){if(!(this instanceof ee))return new ee(V,te);if(te&&te in ae&&(te=null),te&&!(te in Te))throw new Error("Unknown model: "+te);let Re,Ie;if(V==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(V instanceof ee)this.model=V.model,this.color=[...V.color],this.valpha=V.valpha;else if(typeof V=="string"){const $e=we.get(V);if($e===null)throw new Error("Unable to parse color from string: "+V);this.model=$e.model,Ie=Te[this.model].channels,this.color=$e.value.slice(0,Ie),this.valpha=typeof $e.value[Ie]=="number"?$e.value[Ie]:1}else if(V.length>0){this.model=te||"rgb",Ie=Te[this.model].channels;const $e=Array.prototype.slice.call(V,0,Ie);this.color=ve($e,Ie),this.valpha=typeof V[Ie]=="number"?V[Ie]:1}else if(typeof V=="number")this.model="rgb",this.color=[V>>16&255,V>>8&255,V&255],this.valpha=1;else{this.valpha=1;const $e=Object.keys(V);"alpha"in V&&($e.splice($e.indexOf("alpha"),1),this.valpha=typeof V.alpha=="number"?V.alpha:0);const vt=$e.sort().join("");if(!(vt in ie))throw new Error("Unable to parse color from object: "+JSON.stringify(V));this.model=ie[vt];const{labels:mt}=Te[this.model],It=[];for(Re=0;Re<mt.length;Re++)It.push(V[mt[Re]]);this.color=ve(It)}if(W[this.model])for(Ie=Te[this.model].channels,Re=0;Re<Ie;Re++){const $e=W[this.model][Re];$e&&(this.color[Re]=$e(this.color[Re]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}ee.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(V){let te=this.model in we.to?this:this.rgb();te=te.round(typeof V=="number"?V:1);const Re=te.valpha===1?te.color:[...te.color,this.valpha];return we.to[te.model](Re)},percentString(V){const te=this.rgb().round(typeof V=="number"?V:1),Re=te.valpha===1?te.color:[...te.color,this.valpha];return we.to.rgb.percent(Re)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){const V={},{channels:te}=Te[this.model],{labels:Re}=Te[this.model];for(let Ie=0;Ie<te;Ie++)V[Re[Ie]]=this.color[Ie];return this.valpha!==1&&(V.alpha=this.valpha),V},unitArray(){const V=this.rgb().color;return V[0]/=255,V[1]/=255,V[2]/=255,this.valpha!==1&&V.push(this.valpha),V},unitObject(){const V=this.rgb().object();return V.r/=255,V.g/=255,V.b/=255,this.valpha!==1&&(V.alpha=this.valpha),V},round(V){return V=Math.max(V||0,0),new ee([...this.color.map(Z(V)),this.valpha],this.model)},alpha(V){return V!==void 0?new ee([...this.color,Math.max(0,Math.min(1,V))],this.model):this.valpha},red:U("rgb",0,ge(255)),green:U("rgb",1,ge(255)),blue:U("rgb",2,ge(255)),hue:U(["hsl","hsv","hsl","hwb","hcg"],0,V=>(V%360+360)%360),saturationl:U("hsl",1,ge(100)),lightness:U("hsl",2,ge(100)),saturationv:U("hsv",1,ge(100)),value:U("hsv",2,ge(100)),chroma:U("hcg",1,ge(100)),gray:U("hcg",2,ge(100)),white:U("hwb",1,ge(100)),wblack:U("hwb",2,ge(100)),cyan:U("cmyk",0,ge(100)),magenta:U("cmyk",1,ge(100)),yellow:U("cmyk",2,ge(100)),black:U("cmyk",3,ge(100)),x:U("xyz",0,ge(95.047)),y:U("xyz",1,ge(100)),z:U("xyz",2,ge(108.833)),l:U("lab",0,ge(100)),a:U("lab",1),b:U("lab",2),keyword(V){return V!==void 0?new ee(V):Te[this.model].keyword(this.color)},hex(V){return V!==void 0?new ee(V):we.to.hex(this.rgb().round().color)},hexa(V){if(V!==void 0)return new ee(V);const te=this.rgb().round().color;let Re=Math.round(this.valpha*255).toString(16).toUpperCase();return Re.length===1&&(Re="0"+Re),we.to.hex(te)+Re},rgbNumber(){const V=this.rgb().color;return(V[0]&255)<<16|(V[1]&255)<<8|V[2]&255},luminosity(){const V=this.rgb().color,te=[];for(const[Re,Ie]of V.entries()){const $e=Ie/255;te[Re]=$e<=.04045?$e/12.92:(($e+.055)/1.055)**2.4}return .2126*te[0]+.7152*te[1]+.0722*te[2]},contrast(V){const te=this.luminosity(),Re=V.luminosity();return te>Re?(te+.05)/(Re+.05):(Re+.05)/(te+.05)},level(V){const te=this.contrast(V);return te>=7?"AAA":te>=4.5?"AA":""},isDark(){const V=this.rgb().color;return(V[0]*2126+V[1]*7152+V[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){const V=this.rgb();for(let te=0;te<3;te++)V.color[te]=255-V.color[te];return V},lighten(V){const te=this.hsl();return te.color[2]+=te.color[2]*V,te},darken(V){const te=this.hsl();return te.color[2]-=te.color[2]*V,te},saturate(V){const te=this.hsl();return te.color[1]+=te.color[1]*V,te},desaturate(V){const te=this.hsl();return te.color[1]-=te.color[1]*V,te},whiten(V){const te=this.hwb();return te.color[1]+=te.color[1]*V,te},blacken(V){const te=this.hwb();return te.color[2]+=te.color[2]*V,te},grayscale(){const V=this.rgb().color,te=V[0]*.3+V[1]*.59+V[2]*.11;return ee.rgb(te,te,te)},fade(V){return this.alpha(this.valpha-this.valpha*V)},opaquer(V){return this.alpha(this.valpha+this.valpha*V)},rotate(V){const te=this.hsl();let Re=te.color[0];return Re=(Re+V)%360,Re=Re<0?360+Re:Re,te.color[0]=Re,te},mix(V,te){if(!V||!V.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof V);const Re=V.rgb(),Ie=this.rgb(),$e=te===void 0?.5:te,vt=2*$e-1,mt=Re.alpha()-Ie.alpha(),It=((vt*mt===-1?vt:(vt+mt)/(1+vt*mt))+1)/2,qe=1-It;return ee.rgb(It*Re.red()+qe*Ie.red(),It*Re.green()+qe*Ie.green(),It*Re.blue()+qe*Ie.blue(),Re.alpha()*$e+Ie.alpha()*(1-$e))}};for(const V of Object.keys(Te)){if(ae.includes(V))continue;const{channels:te}=Te[V];ee.prototype[V]=function(...Re){return this.model===V?new ee(this):Re.length>0?new ee(Re,V):new ee([...ne(Te[this.model][V].raw(this.color)),this.valpha],V)},ee[V]=function(...Re){let Ie=Re[0];return typeof Ie=="number"&&(Ie=ve(Re,te)),new ee(Ie,V)}}function q(V,te){return Number(V.toFixed(te))}function Z(V){return function(te){return q(te,V)}}function U(V,te,Re){V=Array.isArray(V)?V:[V];for(const Ie of V)(W[Ie]||(W[Ie]=[]))[te]=Re;return V=V[0],function(Ie){let $e;return Ie!==void 0?(Re&&(Ie=Re(Ie)),$e=this[V](),$e.color[te]=Ie,$e):($e=this[V]().color[te],Re&&($e=Re($e)),$e)}}function ge(V){return function(te){return Math.max(0,Math.min(V,te))}}function ne(V){return Array.isArray(V)?V:[V]}function ve(V,te){for(let Re=0;Re<te;Re++)typeof V[Re]!="number"&&(V[Re]=0);return V}a.exports=ee},3764:function(a){/*! @license DOMPurify 3.1.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.3/LICENSE */(function(l,se){a.exports=se()})(this,function(){"use strict";const{entries:l,setPrototypeOf:se,isFrozen:we,getPrototypeOf:Te,getOwnPropertyDescriptor:ae}=Object;let{freeze:ie,seal:W,create:ee}=Object,{apply:q,construct:Z}=typeof Reflect<"u"&&Reflect;ie||(ie=function(Xt){return Xt}),W||(W=function(Xt){return Xt}),q||(q=function(Xt,qn,bn){return Xt.apply(qn,bn)}),Z||(Z=function(Xt,qn){return new Xt(...qn)});const U=nn(Array.prototype.forEach),ge=nn(Array.prototype.pop),ne=nn(Array.prototype.push),ve=nn(String.prototype.toLowerCase),V=nn(String.prototype.toString),te=nn(String.prototype.match),Re=nn(String.prototype.replace),Ie=nn(String.prototype.indexOf),$e=nn(String.prototype.trim),vt=nn(Object.prototype.hasOwnProperty),mt=nn(RegExp.prototype.test),It=Ut(TypeError),qe=nn(Number.isNaN);function nn(Jt){return function(Xt){for(var qn=arguments.length,bn=new Array(qn>1?qn-1:0),sr=1;sr<qn;sr++)bn[sr-1]=arguments[sr];return q(Jt,Xt,bn)}}function Ut(Jt){return function(){for(var Xt=arguments.length,qn=new Array(Xt),bn=0;bn<Xt;bn++)qn[bn]=arguments[bn];return Z(Jt,qn)}}function Xe(Jt,Xt){let qn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ve;se&&se(Jt,null);let bn=Xt.length;for(;bn--;){let sr=Xt[bn];if(typeof sr=="string"){const Jn=qn(sr);Jn!==sr&&(we(Xt)||(Xt[bn]=Jn),sr=Jn)}Jt[sr]=!0}return Jt}function Ft(Jt){for(let Xt=0;Xt<Jt.length;Xt++)vt(Jt,Xt)||(Jt[Xt]=null);return Jt}function rn(Jt){const Xt=ee(null);for(const[qn,bn]of l(Jt))vt(Jt,qn)&&(Array.isArray(bn)?Xt[qn]=Ft(bn):bn&&typeof bn=="object"&&bn.constructor===Object?Xt[qn]=rn(bn):Xt[qn]=bn);return Xt}function Vt(Jt,Xt){for(;Jt!==null;){const bn=ae(Jt,Xt);if(bn){if(bn.get)return nn(bn.get);if(typeof bn.value=="function")return nn(bn.value)}Jt=Te(Jt)}function qn(){return null}return qn}const ze=ie(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),je=ie(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),De=ie(["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"]),ct=ie(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),qt=ie(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),z=ie(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),He=ie(["#text"]),Ct=ie(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),kt=ie(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Pe=ie(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),yt=ie(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),un=W(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Rn=W(/<%[\w\W]*|[\w\W]*%>/gm),Yn=W(/\${[\w\W]*}/gm),nr=W(/^data-[\-\w.\u00B7-\uFFFF]/),rr=W(/^aria-[\-\w]+$/),ar=W(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),wr=W(/^(?:\w+script|data):/i),Ts=W(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Zr=W(/^html$/i),Bs=W(/^[a-z][.\w]*(-[.\w]+)+$/i);var rt=Object.freeze({__proto__:null,MUSTACHE_EXPR:un,ERB_EXPR:Rn,TMPLIT_EXPR:Yn,DATA_ATTR:nr,ARIA_ATTR:rr,IS_ALLOWED_URI:ar,IS_SCRIPT_OR_DATA:wr,ATTR_WHITESPACE:Ts,DOCTYPE_NAME:Zr,CUSTOM_ELEMENT:Bs});const zt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Hn=function(){return typeof window>"u"?null:window},Nr=function(Xt,qn){if(typeof Xt!="object"||typeof Xt.createPolicy!="function")return null;let bn=null;const sr="data-tt-policy-suffix";qn&&qn.hasAttribute(sr)&&(bn=qn.getAttribute(sr));const Jn="dompurify"+(bn?"#"+bn:"");try{return Xt.createPolicy(Jn,{createHTML(fs){return fs},createScriptURL(fs){return fs}})}catch{return console.warn("TrustedTypes policy "+Jn+" could not be created."),null}};function kr(){let Jt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Hn();const Xt=cr=>kr(cr);if(Xt.version="3.1.3",Xt.removed=[],!Jt||!Jt.document||Jt.document.nodeType!==zt.document)return Xt.isSupported=!1,Xt;let{document:qn}=Jt;const bn=qn,sr=bn.currentScript,{DocumentFragment:Jn,HTMLTemplateElement:fs,Node:Kn,Element:Ir,NodeFilter:Rr,NamedNodeMap:pr=Jt.NamedNodeMap||Jt.MozNamedAttrMap,HTMLFormElement:Tr,DOMParser:gt,trustedTypes:_s}=Jt,cs=Ir.prototype,Gr=Vt(cs,"cloneNode"),xr=Vt(cs,"nextSibling"),no=Vt(cs,"childNodes"),ps=Vt(cs,"parentNode");if(typeof fs=="function"){const cr=qn.createElement("template");cr.content&&cr.content.ownerDocument&&(qn=cr.content.ownerDocument)}let ns,ss="";const{implementation:Wo,createNodeIterator:_o,createDocumentFragment:ao,getElementsByTagName:Ls}=qn,{importNode:So}=bn;let jr={};Xt.isSupported=typeof l=="function"&&typeof ps=="function"&&Wo&&Wo.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Dn,ERB_EXPR:Dr,TMPLIT_EXPR:Vs,DATA_ATTR:Mo,ARIA_ATTR:qo,IS_SCRIPT_OR_DATA:ui,ATTR_WHITESPACE:Wn,CUSTOM_ELEMENT:Me}=rt;let{IS_ALLOWED_URI:Qe}=rt,Ke=null;const ut=Xe({},[...ze,...je,...De,...qt,...He]);let Wt=null;const cn=Xe({},[...Ct,...kt,...Pe,...yt]);let Qt=Object.seal(ee(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),be=null,pe=null,le=!0,ue=!0,K=!1,fe=!0,_e=!1,Ve=!0,X=!1,xe=!1,Ne=!1,Ee=!1,Oe=!1,Be=!1,et=!0,dt=!1;const bt="user-content-";let ft=!0,pt=!1,_t={},Kt=null;const fn=Xe({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let hn=null;const In=Xe({},["audio","video","img","source","image","track"]);let lr=null;const Gn=Xe({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Mn="http://www.w3.org/1998/Math/MathML",gr="http://www.w3.org/2000/svg",er="http://www.w3.org/1999/xhtml";let _r=er,vs=!1,ys=null;const ro=Xe({},[Mn,gr,er],V);let qs=null;const hs=["application/xhtml+xml","text/html"],Ks="text/html";let os=null,Gs=null;const Ar=255,bo=qn.createElement("form"),io=function(tt){return tt instanceof RegExp||tt instanceof Function},ho=function(){let tt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Gs&&Gs===tt)){if((!tt||typeof tt!="object")&&(tt={}),tt=rn(tt),qs=hs.indexOf(tt.PARSER_MEDIA_TYPE)===-1?Ks:tt.PARSER_MEDIA_TYPE,os=qs==="application/xhtml+xml"?V:ve,Ke=vt(tt,"ALLOWED_TAGS")?Xe({},tt.ALLOWED_TAGS,os):ut,Wt=vt(tt,"ALLOWED_ATTR")?Xe({},tt.ALLOWED_ATTR,os):cn,ys=vt(tt,"ALLOWED_NAMESPACES")?Xe({},tt.ALLOWED_NAMESPACES,V):ro,lr=vt(tt,"ADD_URI_SAFE_ATTR")?Xe(rn(Gn),tt.ADD_URI_SAFE_ATTR,os):Gn,hn=vt(tt,"ADD_DATA_URI_TAGS")?Xe(rn(In),tt.ADD_DATA_URI_TAGS,os):In,Kt=vt(tt,"FORBID_CONTENTS")?Xe({},tt.FORBID_CONTENTS,os):fn,be=vt(tt,"FORBID_TAGS")?Xe({},tt.FORBID_TAGS,os):{},pe=vt(tt,"FORBID_ATTR")?Xe({},tt.FORBID_ATTR,os):{},_t=vt(tt,"USE_PROFILES")?tt.USE_PROFILES:!1,le=tt.ALLOW_ARIA_ATTR!==!1,ue=tt.ALLOW_DATA_ATTR!==!1,K=tt.ALLOW_UNKNOWN_PROTOCOLS||!1,fe=tt.ALLOW_SELF_CLOSE_IN_ATTR!==!1,_e=tt.SAFE_FOR_TEMPLATES||!1,Ve=tt.SAFE_FOR_XML!==!1,X=tt.WHOLE_DOCUMENT||!1,Ee=tt.RETURN_DOM||!1,Oe=tt.RETURN_DOM_FRAGMENT||!1,Be=tt.RETURN_TRUSTED_TYPE||!1,Ne=tt.FORCE_BODY||!1,et=tt.SANITIZE_DOM!==!1,dt=tt.SANITIZE_NAMED_PROPS||!1,ft=tt.KEEP_CONTENT!==!1,pt=tt.IN_PLACE||!1,Qe=tt.ALLOWED_URI_REGEXP||ar,_r=tt.NAMESPACE||er,Qt=tt.CUSTOM_ELEMENT_HANDLING||{},tt.CUSTOM_ELEMENT_HANDLING&&io(tt.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Qt.tagNameCheck=tt.CUSTOM_ELEMENT_HANDLING.tagNameCheck),tt.CUSTOM_ELEMENT_HANDLING&&io(tt.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Qt.attributeNameCheck=tt.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),tt.CUSTOM_ELEMENT_HANDLING&&typeof tt.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Qt.allowCustomizedBuiltInElements=tt.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),_e&&(ue=!1),Oe&&(Ee=!0),_t&&(Ke=Xe({},He),Wt=[],_t.html===!0&&(Xe(Ke,ze),Xe(Wt,Ct)),_t.svg===!0&&(Xe(Ke,je),Xe(Wt,kt),Xe(Wt,yt)),_t.svgFilters===!0&&(Xe(Ke,De),Xe(Wt,kt),Xe(Wt,yt)),_t.mathMl===!0&&(Xe(Ke,qt),Xe(Wt,Pe),Xe(Wt,yt))),tt.ADD_TAGS&&(Ke===ut&&(Ke=rn(Ke)),Xe(Ke,tt.ADD_TAGS,os)),tt.ADD_ATTR&&(Wt===cn&&(Wt=rn(Wt)),Xe(Wt,tt.ADD_ATTR,os)),tt.ADD_URI_SAFE_ATTR&&Xe(lr,tt.ADD_URI_SAFE_ATTR,os),tt.FORBID_CONTENTS&&(Kt===fn&&(Kt=rn(Kt)),Xe(Kt,tt.FORBID_CONTENTS,os)),ft&&(Ke["#text"]=!0),X&&Xe(Ke,["html","head","body"]),Ke.table&&(Xe(Ke,["tbody"]),delete be.tbody),tt.TRUSTED_TYPES_POLICY){if(typeof tt.TRUSTED_TYPES_POLICY.createHTML!="function")throw It('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof tt.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw It('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');ns=tt.TRUSTED_TYPES_POLICY,ss=ns.createHTML("")}else ns===void 0&&(ns=Nr(_s,sr)),ns!==null&&typeof ss=="string"&&(ss=ns.createHTML(""));ie&&ie(tt),Gs=tt}},$o=Xe({},["mi","mo","mn","ms","mtext"]),Ka=Xe({},["foreignobject","annotation-xml"]),ei=Xe({},["title","style","font","a","script"]),Ma=Xe({},[...je,...De,...ct]),Fi=Xe({},[...qt,...z]),Qo=function(tt){let tn=ps(tt);(!tn||!tn.tagName)&&(tn={namespaceURI:_r,tagName:"template"});const Fn=ve(tt.tagName),Ur=ve(tn.tagName);return ys[tt.namespaceURI]?tt.namespaceURI===gr?tn.namespaceURI===er?Fn==="svg":tn.namespaceURI===Mn?Fn==="svg"&&(Ur==="annotation-xml"||$o[Ur]):Boolean(Ma[Fn]):tt.namespaceURI===Mn?tn.namespaceURI===er?Fn==="math":tn.namespaceURI===gr?Fn==="math"&&Ka[Ur]:Boolean(Fi[Fn]):tt.namespaceURI===er?tn.namespaceURI===gr&&!Ka[Ur]||tn.namespaceURI===Mn&&!$o[Ur]?!1:!Fi[Fn]&&(ei[Fn]||!Ma[Fn]):!!(qs==="application/xhtml+xml"&&ys[tt.namespaceURI]):!1},so=function(tt){ne(Xt.removed,{element:tt});try{tt.parentNode.removeChild(tt)}catch{tt.remove()}},pa=function(tt,tn){try{ne(Xt.removed,{attribute:tn.getAttributeNode(tt),from:tn})}catch{ne(Xt.removed,{attribute:null,from:tn})}if(tn.removeAttribute(tt),tt==="is"&&!Wt[tt])if(Ee||Oe)try{so(tn)}catch{}else try{tn.setAttribute(tt,"")}catch{}},di=function(tt){let tn=null,Fn=null;if(Ne)tt="<remove></remove>"+tt;else{const Ro=te(tt,/^[\r\n\t ]+/);Fn=Ro&&Ro[0]}qs==="application/xhtml+xml"&&_r===er&&(tt='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+tt+"</body></html>");const Ur=ns?ns.createHTML(tt):tt;if(_r===er)try{tn=new gt().parseFromString(Ur,qs)}catch{}if(!tn||!tn.documentElement){tn=Wo.createDocument(_r,"template",null);try{tn.documentElement.innerHTML=vs?ss:Ur}catch{}}const ha=tn.body||tn.documentElement;return tt&&Fn&&ha.insertBefore(qn.createTextNode(Fn),ha.childNodes[0]||null),_r===er?Ls.call(tn,X?"html":"body")[0]:X?tn.documentElement:ha},Ce=function(tt){return _o.call(tt.ownerDocument||tt,tt,Rr.SHOW_ELEMENT|Rr.SHOW_COMMENT|Rr.SHOW_TEXT|Rr.SHOW_PROCESSING_INSTRUCTION|Rr.SHOW_CDATA_SECTION,null)},I=function(tt){return tt instanceof Tr&&(typeof tt.__depth<"u"&&typeof tt.__depth!="number"||typeof tt.__removalCount<"u"&&typeof tt.__removalCount!="number"||typeof tt.nodeName!="string"||typeof tt.textContent!="string"||typeof tt.removeChild!="function"||!(tt.attributes instanceof pr)||typeof tt.removeAttribute!="function"||typeof tt.setAttribute!="function"||typeof tt.namespaceURI!="string"||typeof tt.insertBefore!="function"||typeof tt.hasChildNodes!="function")},$a=function(tt){return typeof Kn=="function"&&tt instanceof Kn},Yo=function(tt,tn,Fn){jr[tt]&&U(jr[tt],Ur=>{Ur.call(Xt,tn,Fn,Gs)})},ko=function(tt){let tn=null;if(Yo("beforeSanitizeElements",tt,null),I(tt))return so(tt),!0;const Fn=os(tt.nodeName);if(Yo("uponSanitizeElement",tt,{tagName:Fn,allowedTags:Ke}),tt.hasChildNodes()&&!$a(tt.firstElementChild)&&mt(/<[/\w]/g,tt.innerHTML)&&mt(/<[/\w]/g,tt.textContent)||tt.nodeType===zt.progressingInstruction||Ve&&tt.nodeType===zt.comment&&mt(/<[/\w]/g,tt.data))return so(tt),!0;if(!Ke[Fn]||be[Fn]){if(!be[Fn]&&yu(Fn)&&(Qt.tagNameCheck instanceof RegExp&&mt(Qt.tagNameCheck,Fn)||Qt.tagNameCheck instanceof Function&&Qt.tagNameCheck(Fn)))return!1;if(ft&&!Kt[Fn]){const Ur=ps(tt)||tt.parentNode,ha=no(tt)||tt.childNodes;if(ha&&Ur){const Ro=ha.length;for(let aa=Ro-1;aa>=0;--aa){const Po=Gr(ha[aa],!0);Po.__removalCount=(tt.__removalCount||0)+1,Ur.insertBefore(Po,xr(tt))}}}return so(tt),!0}return tt instanceof Ir&&!Qo(tt)||(Fn==="noscript"||Fn==="noembed"||Fn==="noframes")&&mt(/<\/no(script|embed|frames)/i,tt.innerHTML)?(so(tt),!0):(_e&&tt.nodeType===zt.text&&(tn=tt.textContent,U([Dn,Dr,Vs],Ur=>{tn=Re(tn,Ur," ")}),tt.textContent!==tn&&(ne(Xt.removed,{element:tt.cloneNode()}),tt.textContent=tn)),Yo("afterSanitizeElements",tt,null),!1)},Ud=function(tt,tn,Fn){if(et&&(tn==="id"||tn==="name")&&(Fn in qn||Fn in bo||Fn==="__depth"||Fn==="__removalCount"))return!1;if(!(ue&&!pe[tn]&&mt(Mo,tn))){if(!(le&&mt(qo,tn))){if(!Wt[tn]||pe[tn]){if(!(yu(tt)&&(Qt.tagNameCheck instanceof RegExp&&mt(Qt.tagNameCheck,tt)||Qt.tagNameCheck instanceof Function&&Qt.tagNameCheck(tt))&&(Qt.attributeNameCheck instanceof RegExp&&mt(Qt.attributeNameCheck,tn)||Qt.attributeNameCheck instanceof Function&&Qt.attributeNameCheck(tn))||tn==="is"&&Qt.allowCustomizedBuiltInElements&&(Qt.tagNameCheck instanceof RegExp&&mt(Qt.tagNameCheck,Fn)||Qt.tagNameCheck instanceof Function&&Qt.tagNameCheck(Fn))))return!1}else if(!lr[tn]){if(!mt(Qe,Re(Fn,Wn,""))){if(!((tn==="src"||tn==="xlink:href"||tn==="href")&&tt!=="script"&&Ie(Fn,"data:")===0&&hn[tt])){if(!(K&&!mt(ui,Re(Fn,Wn,"")))){if(Fn)return!1}}}}}}return!0},yu=function(tt){return tt!=="annotation-xml"&&te(tt,Me)},_i=function(tt){Yo("beforeSanitizeAttributes",tt,null);const{attributes:tn}=tt;if(!tn)return;const Fn={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Wt};let Ur=tn.length;for(;Ur--;){const ha=tn[Ur],{name:Ro,namespaceURI:aa,value:Po}=ha,rl=os(Ro);let mo=Ro==="value"?Po:$e(Po);if(Fn.attrName=rl,Fn.attrValue=mo,Fn.keepAttr=!0,Fn.forceKeepAttr=void 0,Yo("uponSanitizeAttribute",tt,Fn),mo=Fn.attrValue,Fn.forceKeepAttr||(pa(Ro,tt),!Fn.keepAttr))continue;if(!fe&&mt(/\/>/i,mo)){pa(Ro,tt);continue}if(Ve&&mt(/((--!?|])>)|<\/(style|title)/i,mo)){pa(Ro,tt);continue}_e&&U([Dn,Dr,Vs],Wl=>{mo=Re(mo,Wl," ")});const fi=os(tt.nodeName);if(Ud(fi,rl,mo)){if(dt&&(rl==="id"||rl==="name")&&(pa(Ro,tt),mo=bt+mo),ns&&typeof _s=="object"&&typeof _s.getAttributeType=="function"&&!aa)switch(_s.getAttributeType(fi,rl)){case"TrustedHTML":{mo=ns.createHTML(mo);break}case"TrustedScriptURL":{mo=ns.createScriptURL(mo);break}}try{aa?tt.setAttributeNS(aa,Ro,mo):tt.setAttribute(Ro,mo),I(tt)?so(tt):ge(Xt.removed)}catch{}}}Yo("afterSanitizeAttributes",tt,null)},Cc=function cr(tt){let tn=null;const Fn=Ce(tt);for(Yo("beforeSanitizeShadowDOM",tt,null);tn=Fn.nextNode();){if(Yo("uponSanitizeShadowNode",tn,null),ko(tn))continue;const Ur=ps(tn);tn.nodeType===zt.element&&(Ur&&Ur.__depth?tn.__depth=(tn.__removalCount||0)+Ur.__depth+1:tn.__depth=1),(tn.__depth>=Ar||tn.__depth<0||qe(tn.__depth))&&so(tn),tn.content instanceof Jn&&(tn.content.__depth=tn.__depth,cr(tn.content)),_i(tn)}Yo("afterSanitizeShadowDOM",tt,null)};return Xt.sanitize=function(cr){let tt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},tn=null,Fn=null,Ur=null,ha=null;if(vs=!cr,vs&&(cr="<!-->"),typeof cr!="string"&&!$a(cr))if(typeof cr.toString=="function"){if(cr=cr.toString(),typeof cr!="string")throw It("dirty is not a string, aborting")}else throw It("toString is not a function");if(!Xt.isSupported)return cr;if(xe||ho(tt),Xt.removed=[],typeof cr=="string"&&(pt=!1),pt){if(cr.nodeName){const Po=os(cr.nodeName);if(!Ke[Po]||be[Po])throw It("root node is forbidden and cannot be sanitized in-place")}}else if(cr instanceof Kn)tn=di("<!---->"),Fn=tn.ownerDocument.importNode(cr,!0),Fn.nodeType===zt.element&&Fn.nodeName==="BODY"||Fn.nodeName==="HTML"?tn=Fn:tn.appendChild(Fn);else{if(!Ee&&!_e&&!X&&cr.indexOf("<")===-1)return ns&&Be?ns.createHTML(cr):cr;if(tn=di(cr),!tn)return Ee?null:Be?ss:""}tn&&Ne&&so(tn.firstChild);const Ro=Ce(pt?cr:tn);for(;Ur=Ro.nextNode();){if(ko(Ur))continue;const Po=ps(Ur);Ur.nodeType===zt.element&&(Po&&Po.__depth?Ur.__depth=(Ur.__removalCount||0)+Po.__depth+1:Ur.__depth=1),(Ur.__depth>=Ar||Ur.__depth<0||qe(Ur.__depth))&&so(Ur),Ur.content instanceof Jn&&(Ur.content.__depth=Ur.__depth,Cc(Ur.content)),_i(Ur)}if(pt)return cr;if(Ee){if(Oe)for(ha=ao.call(tn.ownerDocument);tn.firstChild;)ha.appendChild(tn.firstChild);else ha=tn;return(Wt.shadowroot||Wt.shadowrootmode)&&(ha=So.call(bn,ha,!0)),ha}let aa=X?tn.outerHTML:tn.innerHTML;return X&&Ke["!doctype"]&&tn.ownerDocument&&tn.ownerDocument.doctype&&tn.ownerDocument.doctype.name&&mt(Zr,tn.ownerDocument.doctype.name)&&(aa="<!DOCTYPE "+tn.ownerDocument.doctype.name+`>
`+aa),_e&&U([Dn,Dr,Vs],Po=>{aa=Re(aa,Po," ")}),ns&&Be?ns.createHTML(aa):aa},Xt.setConfig=function(){let cr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ho(cr),xe=!0},Xt.clearConfig=function(){Gs=null,xe=!1},Xt.isValidAttribute=function(cr,tt,tn){Gs||ho({});const Fn=os(cr),Ur=os(tt);return Ud(Fn,Ur,tn)},Xt.addHook=function(cr,tt){typeof tt=="function"&&(jr[cr]=jr[cr]||[],ne(jr[cr],tt))},Xt.removeHook=function(cr){if(jr[cr])return ge(jr[cr])},Xt.removeHooks=function(cr){jr[cr]&&(jr[cr]=[])},Xt.removeAllHooks=function(){jr={}},Xt}var Xn=kr();return Xn})},4072:(a,l,se)=>{"use strict";var we=se(1402),Te={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},ae={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},ie={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},W={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},ee={};ee[we.ForwardRef]=ie,ee[we.Memo]=W;function q(Re){return we.isMemo(Re)?W:ee[Re.$$typeof]||Te}var Z=Object.defineProperty,U=Object.getOwnPropertyNames,ge=Object.getOwnPropertySymbols,ne=Object.getOwnPropertyDescriptor,ve=Object.getPrototypeOf,V=Object.prototype;function te(Re,Ie,$e){if(typeof Ie!="string"){if(V){var vt=ve(Ie);vt&&vt!==V&&te(Re,vt,$e)}var mt=U(Ie);ge&&(mt=mt.concat(ge(Ie)));for(var It=q(Re),qe=q(Ie),nn=0;nn<mt.length;++nn){var Ut=mt[nn];if(!ae[Ut]&&!($e&&$e[Ut])&&!(qe&&qe[Ut])&&!(It&&It[Ut])){var Xe=ne(Ie,Ut);try{Z(Re,Ut,Xe)}catch{}}}}return Re}a.exports=te},2342:(a,l)=>{"use strict";/** @license React v16.13.1
 * react-is.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var se=typeof Symbol=="function"&&Symbol.for,we=se?Symbol.for("react.element"):60103,Te=se?Symbol.for("react.portal"):60106,ae=se?Symbol.for("react.fragment"):60107,ie=se?Symbol.for("react.strict_mode"):60108,W=se?Symbol.for("react.profiler"):60114,ee=se?Symbol.for("react.provider"):60109,q=se?Symbol.for("react.context"):60110,Z=se?Symbol.for("react.async_mode"):60111,U=se?Symbol.for("react.concurrent_mode"):60111,ge=se?Symbol.for("react.forward_ref"):60112,ne=se?Symbol.for("react.suspense"):60113,ve=se?Symbol.for("react.suspense_list"):60120,V=se?Symbol.for("react.memo"):60115,te=se?Symbol.for("react.lazy"):60116,Re=se?Symbol.for("react.block"):60121,Ie=se?Symbol.for("react.fundamental"):60117,$e=se?Symbol.for("react.responder"):60118,vt=se?Symbol.for("react.scope"):60119;function mt(qe){if(typeof qe=="object"&&qe!==null){var nn=qe.$$typeof;switch(nn){case we:switch(qe=qe.type,qe){case Z:case U:case ae:case W:case ie:case ne:return qe;default:switch(qe=qe&&qe.$$typeof,qe){case q:case ge:case te:case V:case ee:return qe;default:return nn}}case Te:return nn}}}function It(qe){return mt(qe)===U}l.AsyncMode=Z,l.ConcurrentMode=U,l.ContextConsumer=q,l.ContextProvider=ee,l.Element=we,l.ForwardRef=ge,l.Fragment=ae,l.Lazy=te,l.Memo=V,l.Portal=Te,l.Profiler=W,l.StrictMode=ie,l.Suspense=ne,l.isAsyncMode=function(qe){return It(qe)||mt(qe)===Z},l.isConcurrentMode=It,l.isContextConsumer=function(qe){return mt(qe)===q},l.isContextProvider=function(qe){return mt(qe)===ee},l.isElement=function(qe){return typeof qe=="object"&&qe!==null&&qe.$$typeof===we},l.isForwardRef=function(qe){return mt(qe)===ge},l.isFragment=function(qe){return mt(qe)===ae},l.isLazy=function(qe){return mt(qe)===te},l.isMemo=function(qe){return mt(qe)===V},l.isPortal=function(qe){return mt(qe)===Te},l.isProfiler=function(qe){return mt(qe)===W},l.isStrictMode=function(qe){return mt(qe)===ie},l.isSuspense=function(qe){return mt(qe)===ne},l.isValidElementType=function(qe){return typeof qe=="string"||typeof qe=="function"||qe===ae||qe===U||qe===W||qe===ie||qe===ne||qe===ve||typeof qe=="object"&&qe!==null&&(qe.$$typeof===te||qe.$$typeof===V||qe.$$typeof===ee||qe.$$typeof===q||qe.$$typeof===ge||qe.$$typeof===Ie||qe.$$typeof===$e||qe.$$typeof===vt||qe.$$typeof===Re)},l.typeOf=mt},1402:(a,l,se)=>{"use strict";a.exports=se(2342)},9348:(a,l,se)=>{"use strict";var we=se(4995);function Te(){}function ae(){}ae.resetWarningCache=Te,a.exports=function(){function ie(q,Z,U,ge,ne,ve){if(ve!==we){var V=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw V.name="Invariant Violation",V}}ie.isRequired=ie;function W(){return ie}var ee={array:ie,bigint:ie,bool:ie,func:ie,number:ie,object:ie,string:ie,symbol:ie,any:ie,arrayOf:W,element:ie,elementType:ie,instanceOf:W,node:ie,objectOf:W,oneOf:W,oneOfType:W,shape:W,exact:W,checkPropTypes:ae,resetWarningCache:Te};return ee.PropTypes=ee,ee}},6882:(a,l,se)=>{if(!1)var we,Te;else a.exports=se(9348)()},4995:a=>{"use strict";var l="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";a.exports=l},8379:function(a,l,se){(function(we,Te){a.exports=Te(se(6882),se(6194))})(this,function(we,Te){"use strict";function ae(ze){return ze&&typeof ze=="object"&&"default"in ze?ze:{default:ze}}var ie=ae(we),W=ae(Te);function ee(ze,je){for(var De=0;De<je.length;De++){var ct=je[De];ct.enumerable=ct.enumerable||!1,ct.configurable=!0,"value"in ct&&(ct.writable=!0),Object.defineProperty(ze,ct.key,ct)}}function q(ze,je,De){return je in ze?Object.defineProperty(ze,je,{value:De,enumerable:!0,configurable:!0,writable:!0}):ze[je]=De,ze}function Z(){return(Z=Object.assign||function(ze){for(var je=1;je<arguments.length;je++){var De=arguments[je];for(var ct in De)Object.prototype.hasOwnProperty.call(De,ct)&&(ze[ct]=De[ct])}return ze}).apply(this,arguments)}function U(ze,je){var De,ct=Object.keys(ze);return Object.getOwnPropertySymbols&&(De=Object.getOwnPropertySymbols(ze),je&&(De=De.filter(function(qt){return Object.getOwnPropertyDescriptor(ze,qt).enumerable})),ct.push.apply(ct,De)),ct}function ge(ze){for(var je=1;je<arguments.length;je++){var De=arguments[je]!=null?arguments[je]:{};je%2?U(Object(De),!0).forEach(function(ct){q(ze,ct,De[ct])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ze,Object.getOwnPropertyDescriptors(De)):U(Object(De)).forEach(function(ct){Object.defineProperty(ze,ct,Object.getOwnPropertyDescriptor(De,ct))})}return ze}function ne(ze){return(ne=Object.setPrototypeOf?Object.getPrototypeOf:function(je){return je.__proto__||Object.getPrototypeOf(je)})(ze)}function ve(ze,je){return(ve=Object.setPrototypeOf||function(De,ct){return De.__proto__=ct,De})(ze,je)}function V(ze,je){if(ze==null)return{};var De,ct=function(He,Ct){if(He==null)return{};for(var kt,Pe={},yt=Object.keys(He),un=0;un<yt.length;un++)kt=yt[un],0<=Ct.indexOf(kt)||(Pe[kt]=He[kt]);return Pe}(ze,je);if(Object.getOwnPropertySymbols)for(var qt=Object.getOwnPropertySymbols(ze),z=0;z<qt.length;z++)De=qt[z],0<=je.indexOf(De)||Object.prototype.propertyIsEnumerable.call(ze,De)&&(ct[De]=ze[De]);return ct}function te(ze){if(ze===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return ze}function Re(ze){var je=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var De,ct,qt,z,He=ne(ze);return ct=je?(De=ne(this).constructor,Reflect.construct(He,arguments,De)):He.apply(this,arguments),qt=this,!(z=ct)||typeof z!="object"&&typeof z!="function"?te(qt):z}}function Ie(ze,je){return function(De){if(Array.isArray(De))return De}(ze)||function(De,ct){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(De)))){var qt=[],z=!0,He=!1,Ct=void 0;try{for(var kt,Pe=De[Symbol.iterator]();!(z=(kt=Pe.next()).done)&&(qt.push(kt.value),!ct||qt.length!==ct);z=!0);}catch(yt){He=!0,Ct=yt}finally{try{z||Pe.return==null||Pe.return()}finally{if(He)throw Ct}}return qt}}(ze,je)||$e(ze,je)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function $e(ze,je){if(ze){if(typeof ze=="string")return vt(ze,je);var De=Object.prototype.toString.call(ze).slice(8,-1);return De==="Object"&&ze.constructor&&(De=ze.constructor.name),De==="Map"||De==="Set"?Array.from(ze):De==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(De)?vt(ze,je):void 0}}function vt(ze,je){(je==null||je>ze.length)&&(je=ze.length);for(var De=0,ct=new Array(je);De<je;De++)ct[De]=ze[De];return ct}function mt(ze,je){return new Promise(function(De,ct){var qt,z=new Image;z.onload=function(){return De(z)},z.onerror=ct,!((qt=ze)!==null&&qt.match(/^\s*data:([a-z]+\/[a-z]+(;[a-z-]+=[a-z-]+)?)?(;base64)?,[a-z0-9!$&',()*+;=\-._~:@/?%\s]*\s*$/i))&&je&&(z.crossOrigin=je),z.src=ze})}var It,qe=!(typeof window>"u"||typeof navigator>"u"||!("ontouchstart"in window||0<navigator.msMaxTouchPoints)),nn=typeof File<"u",Ut={touch:{react:{down:"onTouchStart",mouseDown:"onMouseDown",drag:"onTouchMove",move:"onTouchMove",mouseMove:"onMouseMove",up:"onTouchEnd",mouseUp:"onMouseUp"},native:{down:"touchstart",mouseDown:"mousedown",drag:"touchmove",move:"touchmove",mouseMove:"mousemove",up:"touchend",mouseUp:"mouseup"}},desktop:{react:{down:"onMouseDown",drag:"onDragOver",move:"onMouseMove",up:"onMouseUp"},native:{down:"mousedown",drag:"dragStart",move:"mousemove",up:"mouseup"}}},Xe=qe?Ut.touch:Ut.desktop,Ft=typeof window<"u"&&window.devicePixelRatio?window.devicePixelRatio:1,rn={x:.5,y:.5},Vt=function(){(function(z,He){if(typeof He!="function"&&He!==null)throw new TypeError("Super expression must either be null or a function");z.prototype=Object.create(He&&He.prototype,{constructor:{value:z,writable:!0,configurable:!0}}),He&&ve(z,He)})(qt,W.default.Component);var ze,je,De,ct=Re(qt);function qt(z){var He;return function(Ct,kt){if(!(Ct instanceof kt))throw new TypeError("Cannot call a class as a function")}(this,qt),q(te(He=ct.call(this,z)),"state",{drag:!1,my:null,mx:null,image:rn}),q(te(He),"handleImageReady",function(Ct){var kt=He.getInitialSize(Ct.width,Ct.height);kt.resource=Ct,kt.x=.5,kt.y=.5,kt.backgroundColor=He.props.backgroundColor,He.setState({drag:!1,image:kt},He.props.onImageReady),He.props.onLoadSuccess(kt)}),q(te(He),"clearImage",function(){He.canvas.getContext("2d").clearRect(0,0,He.canvas.width,He.canvas.height),He.setState({image:rn})}),q(te(He),"handleMouseDown",function(Ct){(Ct=Ct||window.event).preventDefault(),He.setState({drag:!0,mx:null,my:null})}),q(te(He),"handleMouseUp",function(){He.state.drag&&(He.setState({drag:!1}),He.props.onMouseUp())}),q(te(He),"handleMouseMove",function(Ct){var kt,Pe,yt,un,Rn,Yn,nr,rr,ar,wr,Ts,Zr,Bs,rt,zt,Hn;Ct=Ct||window.event,He.state.drag!==!1&&(Ct.preventDefault(),yt={mx:kt=Ct.targetTouches?Ct.targetTouches[0].pageX:Ct.clientX,my:Pe=Ct.targetTouches?Ct.targetTouches[0].pageY:Ct.clientY},Hn=He.props.rotate,Hn=(Hn%=360)<0?Hn+360:Hn,He.state.mx&&He.state.my&&(un=He.state.mx-kt,Rn=He.state.my-Pe,Yn=He.state.image.width*He.props.scale,nr=He.state.image.height*He.props.scale,ar=(rr=He.getCroppingRect()).x,wr=rr.y,ar*=Yn,wr*=nr,Ts=function(Nr){return Nr*(Math.PI/180)},Zr=Math.cos(Ts(Hn)),rt=wr+-un*(Bs=Math.sin(Ts(Hn)))+Rn*Zr,zt={x:(ar+un*Zr+Rn*Bs)/Yn+1/He.props.scale*He.getXScale()/2,y:rt/nr+1/He.props.scale*He.getYScale()/2},He.props.onPositionChange(zt),yt.image=ge(ge({},He.state.image),zt)),He.setState(yt),He.props.onMouseMove(Ct))}),q(te(He),"setCanvas",function(Ct){He.canvas=Ct}),He.canvas=null,He}return ze=qt,(je=[{key:"componentDidMount",value:function(){this.props.disableHiDPIScaling&&(Ft=1);var z,He,Ct=this.canvas.getContext("2d");this.props.image&&this.loadImage(this.props.image),this.paint(Ct),document&&(z=!!function(){var kt=!1;try{var Pe=Object.defineProperty({},"passive",{get:function(){kt=!0}});window.addEventListener("test",Pe,Pe),window.removeEventListener("test",Pe,Pe)}catch{kt=!1}return kt}()&&{passive:!1},He=Xe.native,document.addEventListener(He.move,this.handleMouseMove,z),document.addEventListener(He.up,this.handleMouseUp,z),qe&&(document.addEventListener(He.mouseMove,this.handleMouseMove,z),document.addEventListener(He.mouseUp,this.handleMouseUp,z)))}},{key:"componentDidUpdate",value:function(z,He){this.props.image&&this.props.image!==z.image||this.props.width!==z.width||this.props.height!==z.height||this.props.backgroundColor!==z.backgroundColor?this.loadImage(this.props.image):this.props.image||He.image===rn||this.clearImage();var Ct=this.canvas.getContext("2d");Ct.clearRect(0,0,this.canvas.width,this.canvas.height),this.paint(Ct),this.paintImage(Ct,this.state.image,this.props.border),z.image===this.props.image&&z.width===this.props.width&&z.height===this.props.height&&z.position===this.props.position&&z.scale===this.props.scale&&z.rotate===this.props.rotate&&He.my===this.state.my&&He.mx===this.state.mx&&He.image.x===this.state.image.x&&He.image.y===this.state.image.y&&He.backgroundColor===this.state.backgroundColor||this.props.onImageChange()}},{key:"componentWillUnmount",value:function(){var z;document&&(z=Xe.native,document.removeEventListener(z.move,this.handleMouseMove,!1),document.removeEventListener(z.up,this.handleMouseUp,!1),qe&&(document.removeEventListener(z.mouseMove,this.handleMouseMove,!1),document.removeEventListener(z.mouseUp,this.handleMouseUp,!1)))}},{key:"isVertical",value:function(){return!this.props.disableCanvasRotation&&this.props.rotate%180!=0}},{key:"getBorders",value:function(z){var He=0<arguments.length&&z!==void 0?z:this.props.border;return Array.isArray(He)?He:[He,He]}},{key:"getDimensions",value:function(){var z=this.props,He=z.width,Ct=z.height,kt=z.rotate,Pe=z.border,yt={},un=Ie(this.getBorders(Pe),2),Rn=un[0],Yn=un[1],nr=He,rr=Ct;return this.isVertical()?(yt.width=rr,yt.height=nr):(yt.width=nr,yt.height=rr),yt.width+=2*Rn,yt.height+=2*Yn,{canvas:yt,rotate:kt,width:He,height:Ct,border:Pe}}},{key:"getImage",value:function(){var z=this.getCroppingRect(),He=this.state.image;z.x*=He.resource.width,z.y*=He.resource.height,z.width*=He.resource.width,z.height*=He.resource.height;var Ct=document.createElement("canvas");this.isVertical()?(Ct.width=z.height,Ct.height=z.width):(Ct.width=z.width,Ct.height=z.height);var kt=Ct.getContext("2d");return kt.translate(Ct.width/2,Ct.height/2),kt.rotate(this.props.rotate*Math.PI/180),kt.translate(-Ct.width/2,-Ct.height/2),this.isVertical()&&kt.translate((Ct.width-Ct.height)/2,(Ct.height-Ct.width)/2),He.backgroundColor&&(kt.fillStyle=He.backgroundColor,kt.fillRect(-z.x,-z.y,He.resource.width,He.resource.height)),kt.drawImage(He.resource,-z.x,-z.y),Ct}},{key:"getImageScaledToCanvas",value:function(){var z=this.getDimensions(),He=z.width,Ct=z.height,kt=document.createElement("canvas");return this.isVertical()?(kt.width=Ct,kt.height=He):(kt.width=He,kt.height=Ct),this.paintImage(kt.getContext("2d"),this.state.image,0,1),kt}},{key:"getXScale",value:function(){var z=this.props.width/this.props.height,He=this.state.image.width/this.state.image.height;return Math.min(1,z/He)}},{key:"getYScale",value:function(){var z=this.props.height/this.props.width,He=this.state.image.height/this.state.image.width;return Math.min(1,z/He)}},{key:"getCroppingRect",value:function(){var z=this.props.position||{x:this.state.image.x,y:this.state.image.y},He=1/this.props.scale*this.getXScale(),Ct=1/this.props.scale*this.getYScale(),kt={x:z.x-He/2,y:z.y-Ct/2,width:He,height:Ct},Pe=0,yt=1-kt.width,un=0,Rn=1-kt.height;return(this.props.disableBoundaryChecks||1<He||1<Ct)&&(Pe=-kt.width,un=-kt.height,Rn=yt=1),ge(ge({},kt),{},{x:Math.max(Pe,Math.min(kt.x,yt)),y:Math.max(un,Math.min(kt.y,Rn))})}},{key:"loadImage",value:function(z){var He;nn&&z instanceof File?this.loadingImage=(He=z,new Promise(function(Ct,kt){var Pe=new FileReader;Pe.onload=function(yt){try{var un=mt(yt.target.result);Ct(un)}catch(Rn){kt(Rn)}},Pe.readAsDataURL(He)}).then(this.handleImageReady).catch(this.props.onLoadFailure)):typeof z=="string"&&(this.loadingImage=mt(z,this.props.crossOrigin).then(this.handleImageReady).catch(this.props.onLoadFailure))}},{key:"getInitialSize",value:function(z,He){var Ct,kt,Pe=this.getDimensions();return He/z<Pe.height/Pe.width?kt=z*((Ct=this.getDimensions().height)/He):Ct=He*((kt=this.getDimensions().width)/z),{height:Ct,width:kt}}},{key:"paintImage",value:function(z,He,Ct,kt){var Pe,yt=3<arguments.length&&kt!==void 0?kt:Ft;He.resource&&(Pe=this.calculatePosition(He,Ct),z.save(),z.translate(z.canvas.width/2,z.canvas.height/2),z.rotate(this.props.rotate*Math.PI/180),z.translate(-z.canvas.width/2,-z.canvas.height/2),this.isVertical()&&z.translate((z.canvas.width-z.canvas.height)/2,(z.canvas.height-z.canvas.width)/2),z.scale(yt,yt),z.globalCompositeOperation="destination-over",z.drawImage(He.resource,Pe.x,Pe.y,Pe.width,Pe.height),He.backgroundColor&&(z.fillStyle=He.backgroundColor,z.fillRect(Pe.x,Pe.y,Pe.width,Pe.height)),z.restore())}},{key:"calculatePosition",value:function(z,He){z=z||this.state.image;var Ct=Ie(this.getBorders(He),2),kt=Ct[0],Pe=Ct[1],yt=this.getCroppingRect(),un=z.width*this.props.scale,Rn=z.height*this.props.scale,Yn=-yt.x*un,nr=-yt.y*Rn;return this.isVertical()?(Yn+=Pe,nr+=kt):(Yn+=kt,nr+=Pe),{x:Yn,y:nr,height:Rn,width:un}}},{key:"paint",value:function(z){z.save(),z.scale(Ft,Ft),z.translate(0,0),z.fillStyle="rgba("+this.props.color.slice(0,4).join(",")+")";var He,Ct,kt,Pe,yt,un,Rn,Yn,Bs=this.props.borderRadius,nr=this.getDimensions(),rr=Ie(this.getBorders(nr.border),2),ar=rr[0],wr=rr[1],Ts=nr.canvas.height,Zr=nr.canvas.width,Bs=Math.max(Bs,0);Bs=Math.min(Bs,Zr/2-ar,Ts/2-wr),z.beginPath(),He=z,Pe=Zr-2*(Ct=ar),yt=Ts-2*(kt=wr),(un=Bs)===0?He.rect(Ct,kt,Pe,yt):(Rn=Pe-un,Yn=yt-un,He.translate(Ct,kt),He.arc(un,un,un,Math.PI,1.5*Math.PI),He.lineTo(Rn,0),He.arc(Rn,un,un,1.5*Math.PI,2*Math.PI),He.lineTo(Pe,Yn),He.arc(Rn,Yn,un,2*Math.PI,.5*Math.PI),He.lineTo(un,yt),He.arc(un,Yn,un,.5*Math.PI,Math.PI),He.translate(-Ct,-kt)),z.rect(Zr,0,-Zr,Ts),z.fill("evenodd"),z.restore()}},{key:"render",value:function(){var z=this.props,He=(z.scale,z.rotate,z.image,z.border,z.borderRadius,z.width,z.height,z.position,z.color,z.backgroundColor,z.style),Ct=(z.crossOrigin,z.onLoadFailure,z.onLoadSuccess,z.onImageReady,z.onImageChange,z.onMouseUp,z.onMouseMove,z.onPositionChange,z.disableBoundaryChecks,z.disableHiDPIScaling,z.disableCanvasRotation,V(z,["scale","rotate","image","border","borderRadius","width","height","position","color","backgroundColor","style","crossOrigin","onLoadFailure","onLoadSuccess","onImageReady","onImageChange","onMouseUp","onMouseMove","onPositionChange","disableBoundaryChecks","disableHiDPIScaling","disableCanvasRotation"])),kt=this.getDimensions(),Pe={width:kt.canvas.width,height:kt.canvas.height,cursor:this.state.drag?"grabbing":"grab",touchAction:"none"},yt={width:kt.canvas.width*Ft,height:kt.canvas.height*Ft,style:ge(ge({},Pe),He)};return yt[Xe.react.down]=this.handleMouseDown,qe&&(yt[Xe.react.mouseDown]=this.handleMouseDown),W.default.createElement("canvas",Z({ref:this.setCanvas},yt,Ct))}}])&&ee(ze.prototype,je),De&&ee(ze,De),qt}();return q(Vt,"propTypes",{scale:ie.default.number,rotate:ie.default.number,image:ie.default.oneOfType([ie.default.string].concat(function(ze){if(Array.isArray(ze))return vt(ze)}(It=nn?[ie.default.instanceOf(File)]:[])||function(ze){if(typeof Symbol<"u"&&Symbol.iterator in Object(ze))return Array.from(ze)}(It)||$e(It)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}())),border:ie.default.oneOfType([ie.default.number,ie.default.arrayOf(ie.default.number)]),borderRadius:ie.default.number,width:ie.default.number,height:ie.default.number,position:ie.default.shape({x:ie.default.number,y:ie.default.number}),color:ie.default.arrayOf(ie.default.number),backgroundColor:ie.default.string,crossOrigin:ie.default.oneOf(["","anonymous","use-credentials"]),onLoadFailure:ie.default.func,onLoadSuccess:ie.default.func,onImageReady:ie.default.func,onImageChange:ie.default.func,onMouseUp:ie.default.func,onMouseMove:ie.default.func,onPositionChange:ie.default.func,disableBoundaryChecks:ie.default.bool,disableHiDPIScaling:ie.default.bool,disableCanvasRotation:ie.default.bool}),q(Vt,"defaultProps",{scale:1,rotate:0,border:25,borderRadius:0,width:200,height:200,color:[0,0,0,.5],onLoadFailure:function(){},onLoadSuccess:function(){},onImageReady:function(){},onImageChange:function(){},onMouseUp:function(){},onMouseMove:function(){},onPositionChange:function(){},disableBoundaryChecks:!1,disableHiDPIScaling:!1,disableCanvasRotation:!0}),Vt})},7925:(a,l,se)=>{"use strict";/**
 * @license React
 * react-dom.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var we=se(6194),Te=se(2552);function ae(c){for(var f="https://reactjs.org/docs/error-decoder.html?invariant="+c,y=1;y<arguments.length;y++)f+="&args[]="+encodeURIComponent(arguments[y]);return"Minified React error #"+c+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var ie=new Set,W={};function ee(c,f){q(c,f),q(c+"Capture",f)}function q(c,f){for(W[c]=f,c=0;c<f.length;c++)ie.add(f[c])}var Z=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),U=Object.prototype.hasOwnProperty,ge=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,ne={},ve={};function V(c){return U.call(ve,c)?!0:U.call(ne,c)?!1:ge.test(c)?ve[c]=!0:(ne[c]=!0,!1)}function te(c,f,y,C){if(y!==null&&y.type===0)return!1;switch(typeof f){case"function":case"symbol":return!0;case"boolean":return C?!1:y!==null?!y.acceptsBooleans:(c=c.toLowerCase().slice(0,5),c!=="data-"&&c!=="aria-");default:return!1}}function Re(c,f,y,C){if(f===null||typeof f>"u"||te(c,f,y,C))return!0;if(C)return!1;if(y!==null)switch(y.type){case 3:return!f;case 4:return f===!1;case 5:return isNaN(f);case 6:return isNaN(f)||1>f}return!1}function Ie(c,f,y,C,O,F,de){this.acceptsBooleans=f===2||f===3||f===4,this.attributeName=C,this.attributeNamespace=O,this.mustUseProperty=y,this.propertyName=c,this.type=f,this.sanitizeURL=F,this.removeEmptyString=de}var $e={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(c){$e[c]=new Ie(c,0,!1,c,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(c){var f=c[0];$e[f]=new Ie(f,1,!1,c[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(c){$e[c]=new Ie(c,2,!1,c.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(c){$e[c]=new Ie(c,2,!1,c,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(c){$e[c]=new Ie(c,3,!1,c.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(c){$e[c]=new Ie(c,3,!0,c,null,!1,!1)}),["capture","download"].forEach(function(c){$e[c]=new Ie(c,4,!1,c,null,!1,!1)}),["cols","rows","size","span"].forEach(function(c){$e[c]=new Ie(c,6,!1,c,null,!1,!1)}),["rowSpan","start"].forEach(function(c){$e[c]=new Ie(c,5,!1,c.toLowerCase(),null,!1,!1)});var vt=/[\-:]([a-z])/g;function mt(c){return c[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(c){var f=c.replace(vt,mt);$e[f]=new Ie(f,1,!1,c,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(c){var f=c.replace(vt,mt);$e[f]=new Ie(f,1,!1,c,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(c){var f=c.replace(vt,mt);$e[f]=new Ie(f,1,!1,c,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(c){$e[c]=new Ie(c,1,!1,c.toLowerCase(),null,!1,!1)}),$e.xlinkHref=new Ie("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(c){$e[c]=new Ie(c,1,!1,c.toLowerCase(),null,!0,!0)});function It(c,f,y,C){var O=$e.hasOwnProperty(f)?$e[f]:null;(O!==null?O.type!==0:C||!(2<f.length)||f[0]!=="o"&&f[0]!=="O"||f[1]!=="n"&&f[1]!=="N")&&(Re(f,y,O,C)&&(y=null),C||O===null?V(f)&&(y===null?c.removeAttribute(f):c.setAttribute(f,""+y)):O.mustUseProperty?c[O.propertyName]=y===null?O.type===3?!1:"":y:(f=O.attributeName,C=O.attributeNamespace,y===null?c.removeAttribute(f):(O=O.type,y=O===3||O===4&&y===!0?"":""+y,C?c.setAttributeNS(C,f,y):c.setAttribute(f,y))))}var qe=we.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,nn=Symbol.for("react.element"),Ut=Symbol.for("react.portal"),Xe=Symbol.for("react.fragment"),Ft=Symbol.for("react.strict_mode"),rn=Symbol.for("react.profiler"),Vt=Symbol.for("react.provider"),ze=Symbol.for("react.context"),je=Symbol.for("react.forward_ref"),De=Symbol.for("react.suspense"),ct=Symbol.for("react.suspense_list"),qt=Symbol.for("react.memo"),z=Symbol.for("react.lazy");Symbol.for("react.scope"),Symbol.for("react.debug_trace_mode");var He=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden"),Symbol.for("react.cache"),Symbol.for("react.tracing_marker");var Ct=Symbol.iterator;function kt(c){return c===null||typeof c!="object"?null:(c=Ct&&c[Ct]||c["@@iterator"],typeof c=="function"?c:null)}var Pe=Object.assign,yt;function un(c){if(yt===void 0)try{throw Error()}catch(y){var f=y.stack.trim().match(/\n( *(at )?)/);yt=f&&f[1]||""}return`
`+yt+c}var Rn=!1;function Yn(c,f){if(!c||Rn)return"";Rn=!0;var y=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(f)if(f=function(){throw Error()},Object.defineProperty(f.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(f,[])}catch(Ot){var C=Ot}Reflect.construct(c,[],f)}else{try{f.call()}catch(Ot){C=Ot}c.call(f.prototype)}else{try{throw Error()}catch(Ot){C=Ot}c()}}catch(Ot){if(Ot&&C&&typeof Ot.stack=="string"){for(var O=Ot.stack.split(`
`),F=C.stack.split(`
`),de=O.length-1,Fe=F.length-1;1<=de&&0<=Fe&&O[de]!==F[Fe];)Fe--;for(;1<=de&&0<=Fe;de--,Fe--)if(O[de]!==F[Fe]){if(de!==1||Fe!==1)do if(de--,Fe--,0>Fe||O[de]!==F[Fe]){var Ye=`
`+O[de].replace(" at new "," at ");return c.displayName&&Ye.includes("<anonymous>")&&(Ye=Ye.replace("<anonymous>",c.displayName)),Ye}while(1<=de&&0<=Fe);break}}}finally{Rn=!1,Error.prepareStackTrace=y}return(c=c?c.displayName||c.name:"")?un(c):""}function nr(c){switch(c.tag){case 5:return un(c.type);case 16:return un("Lazy");case 13:return un("Suspense");case 19:return un("SuspenseList");case 0:case 2:case 15:return c=Yn(c.type,!1),c;case 11:return c=Yn(c.type.render,!1),c;case 1:return c=Yn(c.type,!0),c;default:return""}}function rr(c){if(c==null)return null;if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case Xe:return"Fragment";case Ut:return"Portal";case rn:return"Profiler";case Ft:return"StrictMode";case De:return"Suspense";case ct:return"SuspenseList"}if(typeof c=="object")switch(c.$$typeof){case ze:return(c.displayName||"Context")+".Consumer";case Vt:return(c._context.displayName||"Context")+".Provider";case je:var f=c.render;return c=c.displayName,c||(c=f.displayName||f.name||"",c=c!==""?"ForwardRef("+c+")":"ForwardRef"),c;case qt:return f=c.displayName||null,f!==null?f:rr(c.type)||"Memo";case z:f=c._payload,c=c._init;try{return rr(c(f))}catch{}}return null}function ar(c){var f=c.type;switch(c.tag){case 24:return"Cache";case 9:return(f.displayName||"Context")+".Consumer";case 10:return(f._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return c=f.render,c=c.displayName||c.name||"",f.displayName||(c!==""?"ForwardRef("+c+")":"ForwardRef");case 7:return"Fragment";case 5:return f;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return rr(f);case 8:return f===Ft?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof f=="function")return f.displayName||f.name||null;if(typeof f=="string")return f}return null}function wr(c){switch(typeof c){case"boolean":case"number":case"string":case"undefined":return c;case"object":return c;default:return""}}function Ts(c){var f=c.type;return(c=c.nodeName)&&c.toLowerCase()==="input"&&(f==="checkbox"||f==="radio")}function Zr(c){var f=Ts(c)?"checked":"value",y=Object.getOwnPropertyDescriptor(c.constructor.prototype,f),C=""+c[f];if(!c.hasOwnProperty(f)&&typeof y<"u"&&typeof y.get=="function"&&typeof y.set=="function"){var O=y.get,F=y.set;return Object.defineProperty(c,f,{configurable:!0,get:function(){return O.call(this)},set:function(de){C=""+de,F.call(this,de)}}),Object.defineProperty(c,f,{enumerable:y.enumerable}),{getValue:function(){return C},setValue:function(de){C=""+de},stopTracking:function(){c._valueTracker=null,delete c[f]}}}}function Bs(c){c._valueTracker||(c._valueTracker=Zr(c))}function rt(c){if(!c)return!1;var f=c._valueTracker;if(!f)return!0;var y=f.getValue(),C="";return c&&(C=Ts(c)?c.checked?"true":"false":c.value),c=C,c!==y?(f.setValue(c),!0):!1}function zt(c){if(c=c||(typeof document<"u"?document:void 0),typeof c>"u")return null;try{return c.activeElement||c.body}catch{return c.body}}function Hn(c,f){var y=f.checked;return Pe({},f,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:y??c._wrapperState.initialChecked})}function Nr(c,f){var y=f.defaultValue==null?"":f.defaultValue,C=f.checked!=null?f.checked:f.defaultChecked;y=wr(f.value!=null?f.value:y),c._wrapperState={initialChecked:C,initialValue:y,controlled:f.type==="checkbox"||f.type==="radio"?f.checked!=null:f.value!=null}}function kr(c,f){f=f.checked,f!=null&&It(c,"checked",f,!1)}function Xn(c,f){kr(c,f);var y=wr(f.value),C=f.type;if(y!=null)C==="number"?(y===0&&c.value===""||c.value!=y)&&(c.value=""+y):c.value!==""+y&&(c.value=""+y);else if(C==="submit"||C==="reset"){c.removeAttribute("value");return}f.hasOwnProperty("value")?Xt(c,f.type,y):f.hasOwnProperty("defaultValue")&&Xt(c,f.type,wr(f.defaultValue)),f.checked==null&&f.defaultChecked!=null&&(c.defaultChecked=!!f.defaultChecked)}function Jt(c,f,y){if(f.hasOwnProperty("value")||f.hasOwnProperty("defaultValue")){var C=f.type;if(!(C!=="submit"&&C!=="reset"||f.value!==void 0&&f.value!==null))return;f=""+c._wrapperState.initialValue,y||f===c.value||(c.value=f),c.defaultValue=f}y=c.name,y!==""&&(c.name=""),c.defaultChecked=!!c._wrapperState.initialChecked,y!==""&&(c.name=y)}function Xt(c,f,y){(f!=="number"||zt(c.ownerDocument)!==c)&&(y==null?c.defaultValue=""+c._wrapperState.initialValue:c.defaultValue!==""+y&&(c.defaultValue=""+y))}var qn=Array.isArray;function bn(c,f,y,C){if(c=c.options,f){f={};for(var O=0;O<y.length;O++)f["$"+y[O]]=!0;for(y=0;y<c.length;y++)O=f.hasOwnProperty("$"+c[y].value),c[y].selected!==O&&(c[y].selected=O),O&&C&&(c[y].defaultSelected=!0)}else{for(y=""+wr(y),f=null,O=0;O<c.length;O++){if(c[O].value===y){c[O].selected=!0,C&&(c[O].defaultSelected=!0);return}f!==null||c[O].disabled||(f=c[O])}f!==null&&(f.selected=!0)}}function sr(c,f){if(f.dangerouslySetInnerHTML!=null)throw Error(ae(91));return Pe({},f,{value:void 0,defaultValue:void 0,children:""+c._wrapperState.initialValue})}function Jn(c,f){var y=f.value;if(y==null){if(y=f.children,f=f.defaultValue,y!=null){if(f!=null)throw Error(ae(92));if(qn(y)){if(1<y.length)throw Error(ae(93));y=y[0]}f=y}f==null&&(f=""),y=f}c._wrapperState={initialValue:wr(y)}}function fs(c,f){var y=wr(f.value),C=wr(f.defaultValue);y!=null&&(y=""+y,y!==c.value&&(c.value=y),f.defaultValue==null&&c.defaultValue!==y&&(c.defaultValue=y)),C!=null&&(c.defaultValue=""+C)}function Kn(c){var f=c.textContent;f===c._wrapperState.initialValue&&f!==""&&f!==null&&(c.value=f)}function Ir(c){switch(c){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Rr(c,f){return c==null||c==="http://www.w3.org/1999/xhtml"?Ir(f):c==="http://www.w3.org/2000/svg"&&f==="foreignObject"?"http://www.w3.org/1999/xhtml":c}var pr,Tr=function(c){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(f,y,C,O){MSApp.execUnsafeLocalFunction(function(){return c(f,y,C,O)})}:c}(function(c,f){if(c.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in c)c.innerHTML=f;else{for(pr=pr||document.createElement("div"),pr.innerHTML="<svg>"+f.valueOf().toString()+"</svg>",f=pr.firstChild;c.firstChild;)c.removeChild(c.firstChild);for(;f.firstChild;)c.appendChild(f.firstChild)}});function gt(c,f){if(f){var y=c.firstChild;if(y&&y===c.lastChild&&y.nodeType===3){y.nodeValue=f;return}}c.textContent=f}var _s={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},cs=["Webkit","ms","Moz","O"];Object.keys(_s).forEach(function(c){cs.forEach(function(f){f=f+c.charAt(0).toUpperCase()+c.substring(1),_s[f]=_s[c]})});function Gr(c,f,y){return f==null||typeof f=="boolean"||f===""?"":y||typeof f!="number"||f===0||_s.hasOwnProperty(c)&&_s[c]?(""+f).trim():f+"px"}function xr(c,f){c=c.style;for(var y in f)if(f.hasOwnProperty(y)){var C=y.indexOf("--")===0,O=Gr(y,f[y],C);y==="float"&&(y="cssFloat"),C?c.setProperty(y,O):c[y]=O}}var no=Pe({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ps(c,f){if(f){if(no[c]&&(f.children!=null||f.dangerouslySetInnerHTML!=null))throw Error(ae(137,c));if(f.dangerouslySetInnerHTML!=null){if(f.children!=null)throw Error(ae(60));if(typeof f.dangerouslySetInnerHTML!="object"||!("__html"in f.dangerouslySetInnerHTML))throw Error(ae(61))}if(f.style!=null&&typeof f.style!="object")throw Error(ae(62))}}function ns(c,f){if(c.indexOf("-")===-1)return typeof f.is=="string";switch(c){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ss=null;function Wo(c){return c=c.target||c.srcElement||window,c.correspondingUseElement&&(c=c.correspondingUseElement),c.nodeType===3?c.parentNode:c}var _o=null,ao=null,Ls=null;function So(c){if(c=rf(c)){if(typeof _o!="function")throw Error(ae(280));var f=c.stateNode;f&&(f=sf(f),_o(c.stateNode,c.type,f))}}function jr(c){ao?Ls?Ls.push(c):Ls=[c]:ao=c}function Dn(){if(ao){var c=ao,f=Ls;if(Ls=ao=null,So(c),f)for(c=0;c<f.length;c++)So(f[c])}}function Dr(c,f){return c(f)}function Vs(){}var Mo=!1;function qo(c,f,y){if(Mo)return c(f,y);Mo=!0;try{return Dr(c,f,y)}finally{Mo=!1,(ao!==null||Ls!==null)&&(Vs(),Dn())}}function ui(c,f){var y=c.stateNode;if(y===null)return null;var C=sf(y);if(C===null)return null;y=C[f];e:switch(f){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(C=!C.disabled)||(c=c.type,C=!(c==="button"||c==="input"||c==="select"||c==="textarea")),c=!C;break e;default:c=!1}if(c)return null;if(y&&typeof y!="function")throw Error(ae(231,f,typeof y));return y}var Wn=!1;if(Z)try{var Me={};Object.defineProperty(Me,"passive",{get:function(){Wn=!0}}),window.addEventListener("test",Me,Me),window.removeEventListener("test",Me,Me)}catch{Wn=!1}function Qe(c,f,y,C,O,F,de,Fe,Ye){var Ot=Array.prototype.slice.call(arguments,3);try{f.apply(y,Ot)}catch(dn){this.onError(dn)}}var Ke=!1,ut=null,Wt=!1,cn=null,Qt={onError:function(c){Ke=!0,ut=c}};function be(c,f,y,C,O,F,de,Fe,Ye){Ke=!1,ut=null,Qe.apply(Qt,arguments)}function pe(c,f,y,C,O,F,de,Fe,Ye){if(be.apply(this,arguments),Ke){if(Ke){var Ot=ut;Ke=!1,ut=null}else throw Error(ae(198));Wt||(Wt=!0,cn=Ot)}}function le(c){var f=c,y=c;if(c.alternate)for(;f.return;)f=f.return;else{c=f;do f=c,f.flags&4098&&(y=f.return),c=f.return;while(c)}return f.tag===3?y:null}function ue(c){if(c.tag===13){var f=c.memoizedState;if(f===null&&(c=c.alternate,c!==null&&(f=c.memoizedState)),f!==null)return f.dehydrated}return null}function K(c){if(le(c)!==c)throw Error(ae(188))}function fe(c){var f=c.alternate;if(!f){if(f=le(c),f===null)throw Error(ae(188));return f!==c?null:c}for(var y=c,C=f;;){var O=y.return;if(O===null)break;var F=O.alternate;if(F===null){if(C=O.return,C!==null){y=C;continue}break}if(O.child===F.child){for(F=O.child;F;){if(F===y)return K(O),c;if(F===C)return K(O),f;F=F.sibling}throw Error(ae(188))}if(y.return!==C.return)y=O,C=F;else{for(var de=!1,Fe=O.child;Fe;){if(Fe===y){de=!0,y=O,C=F;break}if(Fe===C){de=!0,C=O,y=F;break}Fe=Fe.sibling}if(!de){for(Fe=F.child;Fe;){if(Fe===y){de=!0,y=F,C=O;break}if(Fe===C){de=!0,C=F,y=O;break}Fe=Fe.sibling}if(!de)throw Error(ae(189))}}if(y.alternate!==C)throw Error(ae(190))}if(y.tag!==3)throw Error(ae(188));return y.stateNode.current===y?c:f}function _e(c){return c=fe(c),c!==null?Ve(c):null}function Ve(c){if(c.tag===5||c.tag===6)return c;for(c=c.child;c!==null;){var f=Ve(c);if(f!==null)return f;c=c.sibling}return null}var X=Te.unstable_scheduleCallback,xe=Te.unstable_cancelCallback,Ne=Te.unstable_shouldYield,Ee=Te.unstable_requestPaint,Oe=Te.unstable_now,Be=Te.unstable_getCurrentPriorityLevel,et=Te.unstable_ImmediatePriority,dt=Te.unstable_UserBlockingPriority,bt=Te.unstable_NormalPriority,ft=Te.unstable_LowPriority,pt=Te.unstable_IdlePriority,_t=null,Kt=null;function fn(c){if(Kt&&typeof Kt.onCommitFiberRoot=="function")try{Kt.onCommitFiberRoot(_t,c,void 0,(c.current.flags&128)===128)}catch{}}var hn=Math.clz32?Math.clz32:Gn,In=Math.log,lr=Math.LN2;function Gn(c){return c>>>=0,c===0?32:31-(In(c)/lr|0)|0}var Mn=64,gr=4194304;function er(c){switch(c&-c){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return c&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return c}}function _r(c,f){var y=c.pendingLanes;if(y===0)return 0;var C=0,O=c.suspendedLanes,F=c.pingedLanes,de=y&268435455;if(de!==0){var Fe=de&~O;Fe!==0?C=er(Fe):(F&=de,F!==0&&(C=er(F)))}else de=y&~O,de!==0?C=er(de):F!==0&&(C=er(F));if(C===0)return 0;if(f!==0&&f!==C&&!(f&O)&&(O=C&-C,F=f&-f,O>=F||O===16&&(F&4194240)!==0))return f;if(C&4&&(C|=y&16),f=c.entangledLanes,f!==0)for(c=c.entanglements,f&=C;0<f;)y=31-hn(f),O=1<<y,C|=c[y],f&=~O;return C}function vs(c,f){switch(c){case 1:case 2:case 4:return f+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return f+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ys(c,f){for(var y=c.suspendedLanes,C=c.pingedLanes,O=c.expirationTimes,F=c.pendingLanes;0<F;){var de=31-hn(F),Fe=1<<de,Ye=O[de];Ye===-1?(!(Fe&y)||Fe&C)&&(O[de]=vs(Fe,f)):Ye<=f&&(c.expiredLanes|=Fe),F&=~Fe}}function ro(c){return c=c.pendingLanes&-1073741825,c!==0?c:c&1073741824?1073741824:0}function qs(){var c=Mn;return Mn<<=1,!(Mn&4194240)&&(Mn=64),c}function hs(c){for(var f=[],y=0;31>y;y++)f.push(c);return f}function Ks(c,f,y){c.pendingLanes|=f,f!==536870912&&(c.suspendedLanes=0,c.pingedLanes=0),c=c.eventTimes,f=31-hn(f),c[f]=y}function os(c,f){var y=c.pendingLanes&~f;c.pendingLanes=f,c.suspendedLanes=0,c.pingedLanes=0,c.expiredLanes&=f,c.mutableReadLanes&=f,c.entangledLanes&=f,f=c.entanglements;var C=c.eventTimes;for(c=c.expirationTimes;0<y;){var O=31-hn(y),F=1<<O;f[O]=0,C[O]=-1,c[O]=-1,y&=~F}}function Gs(c,f){var y=c.entangledLanes|=f;for(c=c.entanglements;y;){var C=31-hn(y),O=1<<C;O&f|c[C]&f&&(c[C]|=f),y&=~O}}var Ar=0;function bo(c){return c&=-c,1<c?4<c?c&268435455?16:536870912:4:1}var io,ho,$o,Ka,ei,Ma=!1,Fi=[],Qo=null,so=null,pa=null,di=new Map,Ce=new Map,I=[],$a="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Yo(c,f){switch(c){case"focusin":case"focusout":Qo=null;break;case"dragenter":case"dragleave":so=null;break;case"mouseover":case"mouseout":pa=null;break;case"pointerover":case"pointerout":di.delete(f.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ce.delete(f.pointerId)}}function ko(c,f,y,C,O,F){return c===null||c.nativeEvent!==F?(c={blockedOn:f,domEventName:y,eventSystemFlags:C,nativeEvent:F,targetContainers:[O]},f!==null&&(f=rf(f),f!==null&&ho(f)),c):(c.eventSystemFlags|=C,f=c.targetContainers,O!==null&&f.indexOf(O)===-1&&f.push(O),c)}function Ud(c,f,y,C,O){switch(f){case"focusin":return Qo=ko(Qo,c,f,y,C,O),!0;case"dragenter":return so=ko(so,c,f,y,C,O),!0;case"mouseover":return pa=ko(pa,c,f,y,C,O),!0;case"pointerover":var F=O.pointerId;return di.set(F,ko(di.get(F)||null,c,f,y,C,O)),!0;case"gotpointercapture":return F=O.pointerId,Ce.set(F,ko(Ce.get(F)||null,c,f,y,C,O)),!0}return!1}function yu(c){var f=nf(c.target);if(f!==null){var y=le(f);if(y!==null){if(f=y.tag,f===13){if(f=ue(y),f!==null){c.blockedOn=f,ei(c.priority,function(){$o(y)});return}}else if(f===3&&y.stateNode.current.memoizedState.isDehydrated){c.blockedOn=y.tag===3?y.stateNode.containerInfo:null;return}}}c.blockedOn=null}function _i(c){if(c.blockedOn!==null)return!1;for(var f=c.targetContainers;0<f.length;){var y=rl(c.domEventName,c.eventSystemFlags,f[0],c.nativeEvent);if(y===null){y=c.nativeEvent;var C=new y.constructor(y.type,y);ss=C,y.target.dispatchEvent(C),ss=null}else return f=rf(y),f!==null&&ho(f),c.blockedOn=y,!1;f.shift()}return!0}function Cc(c,f,y){_i(c)&&y.delete(f)}function cr(){Ma=!1,Qo!==null&&_i(Qo)&&(Qo=null),so!==null&&_i(so)&&(so=null),pa!==null&&_i(pa)&&(pa=null),di.forEach(Cc),Ce.forEach(Cc)}function tt(c,f){c.blockedOn===f&&(c.blockedOn=null,Ma||(Ma=!0,Te.unstable_scheduleCallback(Te.unstable_NormalPriority,cr)))}function tn(c){function f(O){return tt(O,c)}if(0<Fi.length){tt(Fi[0],c);for(var y=1;y<Fi.length;y++){var C=Fi[y];C.blockedOn===c&&(C.blockedOn=null)}}for(Qo!==null&&tt(Qo,c),so!==null&&tt(so,c),pa!==null&&tt(pa,c),di.forEach(f),Ce.forEach(f),y=0;y<I.length;y++)C=I[y],C.blockedOn===c&&(C.blockedOn=null);for(;0<I.length&&(y=I[0],y.blockedOn===null);)yu(y),y.blockedOn===null&&I.shift()}var Fn=qe.ReactCurrentBatchConfig,Ur=!0;function ha(c,f,y,C){var O=Ar,F=Fn.transition;Fn.transition=null;try{Ar=1,aa(c,f,y,C)}finally{Ar=O,Fn.transition=F}}function Ro(c,f,y,C){var O=Ar,F=Fn.transition;Fn.transition=null;try{Ar=4,aa(c,f,y,C)}finally{Ar=O,Fn.transition=F}}function aa(c,f,y,C){if(Ur){var O=rl(c,f,y,C);if(O===null)Jf(c,f,C,Po,y),Yo(c,C);else if(Ud(O,c,f,y,C))C.stopPropagation();else if(Yo(c,C),f&4&&-1<$a.indexOf(c)){for(;O!==null;){var F=rf(O);if(F!==null&&io(F),F=rl(c,f,y,C),F===null&&Jf(c,f,C,Po,y),F===O)break;O=F}O!==null&&C.stopPropagation()}else Jf(c,f,C,null,y)}}var Po=null;function rl(c,f,y,C){if(Po=null,c=Wo(C),c=nf(c),c!==null)if(f=le(c),f===null)c=null;else if(y=f.tag,y===13){if(c=ue(f),c!==null)return c;c=null}else if(y===3){if(f.stateNode.current.memoizedState.isDehydrated)return f.tag===3?f.stateNode.containerInfo:null;c=null}else f!==c&&(c=null);return Po=c,null}function mo(c){switch(c){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Be()){case et:return 1;case dt:return 4;case bt:case ft:return 16;case pt:return 536870912;default:return 16}default:return 16}}var fi=null,Wl=null,Ec=null;function sl(){if(Ec)return Ec;var c,f=Wl,y=f.length,C,O="value"in fi?fi.value:fi.textContent,F=O.length;for(c=0;c<y&&f[c]===O[c];c++);var de=y-c;for(C=1;C<=de&&f[y-C]===O[F-C];C++);return Ec=O.slice(c,1<C?1-C:void 0)}function ql(c){var f=c.keyCode;return"charCode"in c?(c=c.charCode,c===0&&f===13&&(c=13)):c=f,c===10&&(c=13),32<=c||c===13?c:0}function Kl(){return!0}function Gl(){return!1}function ti(c){function f(y,C,O,F,de){this._reactName=y,this._targetInst=O,this.type=C,this.nativeEvent=F,this.target=de,this.currentTarget=null;for(var Fe in c)c.hasOwnProperty(Fe)&&(y=c[Fe],this[Fe]=y?y(F):F[Fe]);return this.isDefaultPrevented=(F.defaultPrevented!=null?F.defaultPrevented:F.returnValue===!1)?Kl:Gl,this.isPropagationStopped=Gl,this}return Pe(f.prototype,{preventDefault:function(){this.defaultPrevented=!0;var y=this.nativeEvent;y&&(y.preventDefault?y.preventDefault():typeof y.returnValue!="unknown"&&(y.returnValue=!1),this.isDefaultPrevented=Kl)},stopPropagation:function(){var y=this.nativeEvent;y&&(y.stopPropagation?y.stopPropagation():typeof y.cancelBubble!="unknown"&&(y.cancelBubble=!0),this.isPropagationStopped=Kl)},persist:function(){},isPersistent:Kl}),f}var Yc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(c){return c.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bd=ti(Yc),Tc=Pe({},Yc,{view:0,detail:0}),eh=ti(Tc),Xu,go,kc,Oo=Pe({},Tc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:wu,button:0,buttons:0,relatedTarget:function(c){return c.relatedTarget===void 0?c.fromElement===c.srcElement?c.toElement:c.fromElement:c.relatedTarget},movementX:function(c){return"movementX"in c?c.movementX:(c!==kc&&(kc&&c.type==="mousemove"?(Xu=c.screenX-kc.screenX,go=c.screenY-kc.screenY):go=Xu=0,kc=c),Xu)},movementY:function(c){return"movementY"in c?c.movementY:go}}),Qf=ti(Oo),th=Pe({},Oo,{dataTransfer:0}),pi=ti(th),Mm=Pe({},Tc,{relatedTarget:0}),bu=ti(Mm),Rc=Pe({},Yc,{animationName:0,elapsedTime:0,pseudoElement:0}),Lo=ti(Rc),Pc=Pe({},Yc,{clipboardData:function(c){return"clipboardData"in c?c.clipboardData:window.clipboardData}}),$m=ti(Pc),Oc=Pe({},Yc,{data:0}),Yf=ti(Oc),Vd={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ni={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Xc={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Zu(c){var f=this.nativeEvent;return f.getModifierState?f.getModifierState(c):(c=Xc[c])?!!f[c]:!1}function wu(){return Zu}var xu=Pe({},Tc,{key:function(c){if(c.key){var f=Vd[c.key]||c.key;if(f!=="Unidentified")return f}return c.type==="keypress"?(c=ql(c),c===13?"Enter":String.fromCharCode(c)):c.type==="keydown"||c.type==="keyup"?ni[c.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:wu,charCode:function(c){return c.type==="keypress"?ql(c):0},keyCode:function(c){return c.type==="keydown"||c.type==="keyup"?c.keyCode:0},which:function(c){return c.type==="keypress"?ql(c):c.type==="keydown"||c.type==="keyup"?c.keyCode:0}}),nh=ti(xu),Hd=Pe({},Oo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ju=ti(Hd),ed=Pe({},Tc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:wu}),Lm=ti(ed),zi=Pe({},Yc,{propertyName:0,elapsedTime:0,pseudoElement:0}),J=ti(zi),re=Pe({},Oo,{deltaX:function(c){return"deltaX"in c?c.deltaX:"wheelDeltaX"in c?-c.wheelDeltaX:0},deltaY:function(c){return"deltaY"in c?c.deltaY:"wheelDeltaY"in c?-c.wheelDeltaY:"wheelDelta"in c?-c.wheelDelta:0},deltaZ:0,deltaMode:0}),Se=ti(re),ke=[9,13,27,32],Ue=Z&&"CompositionEvent"in window,lt=null;Z&&"documentMode"in document&&(lt=document.documentMode);var ot=Z&&"TextEvent"in window&&!lt,en=Z&&(!Ue||lt&&8<lt&&11>=lt),or=String.fromCharCode(32),Tn=!1;function $n(c,f){switch(c){case"keyup":return ke.indexOf(f.keyCode)!==-1;case"keydown":return f.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function vr(c){return c=c.detail,typeof c=="object"&&"data"in c?c.data:null}var ks=!1;function Ea(c,f){switch(c){case"compositionend":return vr(f);case"keypress":return f.which!==32?null:(Tn=!0,or);case"textInput":return c=f.data,c===or&&Tn?null:c;default:return null}}function Mr(c,f){if(ks)return c==="compositionend"||!Ue&&$n(c,f)?(c=sl(),Ec=Wl=fi=null,ks=!1,c):null;switch(c){case"paste":return null;case"keypress":if(!(f.ctrlKey||f.altKey||f.metaKey)||f.ctrlKey&&f.altKey){if(f.char&&1<f.char.length)return f.char;if(f.which)return String.fromCharCode(f.which)}return null;case"compositionend":return en&&f.locale!=="ko"?null:f.data;default:return null}}var ms={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Pr(c){var f=c&&c.nodeName&&c.nodeName.toLowerCase();return f==="input"?!!ms[c.type]:f==="textarea"}function Qs(c,f,y,C){jr(C),f=Yd(f,"onChange"),0<f.length&&(y=new Bd("onChange","change",null,y,C),c.push({event:y,listeners:f}))}var Fo=null,zo=null;function Nc(c){$0(c,0)}function La(c){var f=np(c);if(rt(f))return c}function ma(c,f){if(c==="change")return f}var Ql=!1;if(Z){var _u;if(Z){var Su="oninput"in document;if(!Su){var td=document.createElement("div");td.setAttribute("oninput","return;"),Su=typeof td.oninput=="function"}_u=Su}else _u=!1;Ql=_u&&(!document.documentMode||9<document.documentMode)}function I0(){Fo&&(Fo.detachEvent("onpropertychange",j0),zo=Fo=null)}function j0(c){if(c.propertyName==="value"&&La(zo)){var f=[];Qs(f,zo,c,Wo(c)),qo(Nc,f)}}function Fm(c,f,y){c==="focusin"?(I0(),Fo=f,zo=y,Fo.attachEvent("onpropertychange",j0)):c==="focusout"&&I0()}function zm(c){if(c==="selectionchange"||c==="keyup"||c==="keydown")return La(zo)}function rh(c,f){if(c==="click")return La(f)}function Ui(c,f){if(c==="input"||c==="change")return La(f)}function Bw(c,f){return c===f&&(c!==0||1/c===1/f)||c!==c&&f!==f}var Bi=typeof Object.is=="function"?Object.is:Bw;function El(c,f){if(Bi(c,f))return!0;if(typeof c!="object"||c===null||typeof f!="object"||f===null)return!1;var y=Object.keys(c),C=Object.keys(f);if(y.length!==C.length)return!1;for(C=0;C<y.length;C++){var O=y[C];if(!U.call(f,O)||!Bi(c[O],f[O]))return!1}return!0}function Um(c){for(;c&&c.firstChild;)c=c.firstChild;return c}function Wd(c,f){var y=Um(c);c=0;for(var C;y;){if(y.nodeType===3){if(C=c+y.textContent.length,c<=f&&C>=f)return{node:y,offset:f-c};c=C}e:{for(;y;){if(y.nextSibling){y=y.nextSibling;break e}y=y.parentNode}y=void 0}y=Um(y)}}function D0(c,f){return c&&f?c===f?!0:c&&c.nodeType===3?!1:f&&f.nodeType===3?D0(c,f.parentNode):"contains"in c?c.contains(f):c.compareDocumentPosition?!!(c.compareDocumentPosition(f)&16):!1:!1}function Dy(){for(var c=window,f=zt();f instanceof c.HTMLIFrameElement;){try{var y=typeof f.contentWindow.location.href=="string"}catch{y=!1}if(y)c=f.contentWindow;else break;f=zt(c.document)}return f}function M0(c){var f=c&&c.nodeName&&c.nodeName.toLowerCase();return f&&(f==="input"&&(c.type==="text"||c.type==="search"||c.type==="tel"||c.type==="url"||c.type==="password")||f==="textarea"||c.contentEditable==="true")}function Vw(c){var f=Dy(),y=c.focusedElem,C=c.selectionRange;if(f!==y&&y&&y.ownerDocument&&D0(y.ownerDocument.documentElement,y)){if(C!==null&&M0(y)){if(f=C.start,c=C.end,c===void 0&&(c=f),"selectionStart"in y)y.selectionStart=f,y.selectionEnd=Math.min(c,y.value.length);else if(c=(f=y.ownerDocument||document)&&f.defaultView||window,c.getSelection){c=c.getSelection();var O=y.textContent.length,F=Math.min(C.start,O);C=C.end===void 0?F:Math.min(C.end,O),!c.extend&&F>C&&(O=C,C=F,F=O),O=Wd(y,F);var de=Wd(y,C);O&&de&&(c.rangeCount!==1||c.anchorNode!==O.node||c.anchorOffset!==O.offset||c.focusNode!==de.node||c.focusOffset!==de.offset)&&(f=f.createRange(),f.setStart(O.node,O.offset),c.removeAllRanges(),F>C?(c.addRange(f),c.extend(de.node,de.offset)):(f.setEnd(de.node,de.offset),c.addRange(f)))}}for(f=[],c=y;c=c.parentNode;)c.nodeType===1&&f.push({element:c,left:c.scrollLeft,top:c.scrollTop});for(typeof y.focus=="function"&&y.focus(),y=0;y<f.length;y++)c=f[y],c.element.scrollLeft=c.left,c.element.scrollTop=c.top}}var Hw=Z&&"documentMode"in document&&11>=document.documentMode,Xf=null,sh=null,qd=null,Bm=!1;function Vm(c,f,y){var C=y.window===y?y.document:y.nodeType===9?y:y.ownerDocument;Bm||Xf==null||Xf!==zt(C)||(C=Xf,"selectionStart"in C&&M0(C)?C={start:C.selectionStart,end:C.selectionEnd}:(C=(C.ownerDocument&&C.ownerDocument.defaultView||window).getSelection(),C={anchorNode:C.anchorNode,anchorOffset:C.anchorOffset,focusNode:C.focusNode,focusOffset:C.focusOffset}),qd&&El(qd,C)||(qd=C,C=Yd(sh,"onSelect"),0<C.length&&(f=new Bd("onSelect","select",null,f,y),c.push({event:f,listeners:C}),f.target=Xf)))}function Kd(c,f){var y={};return y[c.toLowerCase()]=f.toLowerCase(),y["Webkit"+c]="webkit"+f,y["Moz"+c]="moz"+f,y}var Gd={animationend:Kd("Animation","AnimationEnd"),animationiteration:Kd("Animation","AnimationIteration"),animationstart:Kd("Animation","AnimationStart"),transitionend:Kd("Transition","TransitionEnd")},Hm={},ol={};Z&&(ol=document.createElement("div").style,"AnimationEvent"in window||(delete Gd.animationend.animation,delete Gd.animationiteration.animation,delete Gd.animationstart.animation),"TransitionEvent"in window||delete Gd.transitionend.transition);function Cu(c){if(Hm[c])return Hm[c];if(!Gd[c])return c;var f=Gd[c],y;for(y in f)if(f.hasOwnProperty(y)&&y in ol)return Hm[c]=f[y];return c}var My=Cu("animationend"),Zf=Cu("animationiteration"),Ww=Cu("animationstart"),$y=Cu("transitionend"),Ly=new Map,hi="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Ta(c,f){Ly.set(c,f),ee(f,[c])}for(var $r=0;$r<hi.length;$r++){var nd=hi[$r],qw=nd.toLowerCase(),Kw=nd[0].toUpperCase()+nd.slice(1);Ta(qw,"on"+Kw)}Ta(My,"onAnimationEnd"),Ta(Zf,"onAnimationIteration"),Ta(Ww,"onAnimationStart"),Ta("dblclick","onDoubleClick"),Ta("focusin","onFocus"),Ta("focusout","onBlur"),Ta($y,"onTransitionEnd"),q("onMouseEnter",["mouseout","mouseover"]),q("onMouseLeave",["mouseout","mouseover"]),q("onPointerEnter",["pointerout","pointerover"]),q("onPointerLeave",["pointerout","pointerover"]),ee("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ee("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ee("onBeforeInput",["compositionend","keypress","textInput","paste"]),ee("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ee("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ee("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ia="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Fy=new Set("cancel close invalid load scroll toggle".split(" ").concat(ia));function Wm(c,f,y){var C=c.type||"unknown-event";c.currentTarget=y,pe(C,f,void 0,c),c.currentTarget=null}function $0(c,f){f=(f&4)!==0;for(var y=0;y<c.length;y++){var C=c[y],O=C.event;C=C.listeners;e:{var F=void 0;if(f)for(var de=C.length-1;0<=de;de--){var Fe=C[de],Ye=Fe.instance,Ot=Fe.currentTarget;if(Fe=Fe.listener,Ye!==F&&O.isPropagationStopped())break e;Wm(O,Fe,Ot),F=Ye}else for(de=0;de<C.length;de++){if(Fe=C[de],Ye=Fe.instance,Ot=Fe.currentTarget,Fe=Fe.listener,Ye!==F&&O.isPropagationStopped())break e;Wm(O,Fe,Ot),F=Ye}}}if(Wt)throw c=cn,Wt=!1,cn=null,c}function vo(c,f){var y=f[tp];y===void 0&&(y=f[tp]=new Set);var C=c+"__bubble";y.has(C)||(al(f,c,2,!1),y.add(C))}function oh(c,f,y){var C=0;f&&(C|=4),al(y,c,C,f)}var Qd="_reactListening"+Math.random().toString(36).slice(2);function ah(c){if(!c[Qd]){c[Qd]=!0,ie.forEach(function(y){y!=="selectionchange"&&(Fy.has(y)||oh(y,!1,c),oh(y,!0,c))});var f=c.nodeType===9?c:c.ownerDocument;f===null||f[Qd]||(f[Qd]=!0,oh("selectionchange",!1,f))}}function al(c,f,y,C){switch(mo(f)){case 1:var O=ha;break;case 4:O=Ro;break;default:O=aa}y=O.bind(null,f,y,c),O=void 0,!Wn||f!=="touchstart"&&f!=="touchmove"&&f!=="wheel"||(O=!0),C?O!==void 0?c.addEventListener(f,y,{capture:!0,passive:O}):c.addEventListener(f,y,!0):O!==void 0?c.addEventListener(f,y,{passive:O}):c.addEventListener(f,y,!1)}function Jf(c,f,y,C,O){var F=C;if(!(f&1)&&!(f&2)&&C!==null)e:for(;;){if(C===null)return;var de=C.tag;if(de===3||de===4){var Fe=C.stateNode.containerInfo;if(Fe===O||Fe.nodeType===8&&Fe.parentNode===O)break;if(de===4)for(de=C.return;de!==null;){var Ye=de.tag;if((Ye===3||Ye===4)&&(Ye=de.stateNode.containerInfo,Ye===O||Ye.nodeType===8&&Ye.parentNode===O))return;de=de.return}for(;Fe!==null;){if(de=nf(Fe),de===null)return;if(Ye=de.tag,Ye===5||Ye===6){C=F=de;continue e}Fe=Fe.parentNode}}C=C.return}qo(function(){var Ot=F,dn=Wo(y),pn=[];e:{var on=Ly.get(c);if(on!==void 0){var Zn=Bd,dr=c;switch(c){case"keypress":if(ql(y)===0)break e;case"keydown":case"keyup":Zn=nh;break;case"focusin":dr="focus",Zn=bu;break;case"focusout":dr="blur",Zn=bu;break;case"beforeblur":case"afterblur":Zn=bu;break;case"click":if(y.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Zn=Qf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Zn=pi;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Zn=Lm;break;case My:case Zf:case Ww:Zn=Lo;break;case $y:Zn=J;break;case"scroll":Zn=eh;break;case"wheel":Zn=Se;break;case"copy":case"cut":case"paste":Zn=$m;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Zn=Ju}var hr=(f&4)!==0,ua=!hr&&c==="scroll",wt=hr?on!==null?on+"Capture":null:on;hr=[];for(var nt=Ot,Et;nt!==null;){Et=nt;var vn=Et.stateNode;if(Et.tag===5&&vn!==null&&(Et=vn,wt!==null&&(vn=ui(nt,wt),vn!=null&&hr.push(rd(nt,vn,Et)))),ua)break;nt=nt.return}0<hr.length&&(on=new Zn(on,dr,null,y,dn),pn.push({event:on,listeners:hr}))}}if(!(f&7)){e:{if(on=c==="mouseover"||c==="pointerover",Zn=c==="mouseout"||c==="pointerout",on&&y!==ss&&(dr=y.relatedTarget||y.fromElement)&&(nf(dr)||dr[Ss]))break e;if((Zn||on)&&(on=dn.window===dn?dn:(on=dn.ownerDocument)?on.defaultView||on.parentWindow:window,Zn?(dr=y.relatedTarget||y.toElement,Zn=Ot,dr=dr?nf(dr):null,dr!==null&&(ua=le(dr),dr!==ua||dr.tag!==5&&dr.tag!==6)&&(dr=null)):(Zn=null,dr=Ot),Zn!==dr)){if(hr=Qf,vn="onMouseLeave",wt="onMouseEnter",nt="mouse",(c==="pointerout"||c==="pointerover")&&(hr=Ju,vn="onPointerLeave",wt="onPointerEnter",nt="pointer"),ua=Zn==null?on:np(Zn),Et=dr==null?on:np(dr),on=new hr(vn,nt+"leave",Zn,y,dn),on.target=ua,on.relatedTarget=Et,vn=null,nf(dn)===Ot&&(hr=new hr(wt,nt+"enter",dr,y,dn),hr.target=Et,hr.relatedTarget=ua,vn=hr),ua=vn,Zn&&dr)t:{for(hr=Zn,wt=dr,nt=0,Et=hr;Et;Et=Zc(Et))nt++;for(Et=0,vn=wt;vn;vn=Zc(vn))Et++;for(;0<nt-Et;)hr=Zc(hr),nt--;for(;0<Et-nt;)wt=Zc(wt),Et--;for(;nt--;){if(hr===wt||wt!==null&&hr===wt.alternate)break t;hr=Zc(hr),wt=Zc(wt)}hr=null}else hr=null;Zn!==null&&qm(pn,on,Zn,hr,!1),dr!==null&&ua!==null&&qm(pn,ua,dr,hr,!0)}}e:{if(on=Ot?np(Ot):window,Zn=on.nodeName&&on.nodeName.toLowerCase(),Zn==="select"||Zn==="input"&&on.type==="file")var yr=ma;else if(Pr(on))if(Ql)yr=Ui;else{yr=zm;var Qr=Fm}else(Zn=on.nodeName)&&Zn.toLowerCase()==="input"&&(on.type==="checkbox"||on.type==="radio")&&(yr=rh);if(yr&&(yr=yr(c,Ot))){Qs(pn,yr,y,dn);break e}Qr&&Qr(c,on,Ot),c==="focusout"&&(Qr=on._wrapperState)&&Qr.controlled&&on.type==="number"&&Xt(on,"number",on.value)}switch(Qr=Ot?np(Ot):window,c){case"focusin":(Pr(Qr)||Qr.contentEditable==="true")&&(Xf=Qr,sh=Ot,qd=null);break;case"focusout":qd=sh=Xf=null;break;case"mousedown":Bm=!0;break;case"contextmenu":case"mouseup":case"dragend":Bm=!1,Vm(pn,y,dn);break;case"selectionchange":if(Hw)break;case"keydown":case"keyup":Vm(pn,y,dn)}var Wr;if(Ue)e:{switch(c){case"compositionstart":var as="onCompositionStart";break e;case"compositionend":as="onCompositionEnd";break e;case"compositionupdate":as="onCompositionUpdate";break e}as=void 0}else ks?$n(c,y)&&(as="onCompositionEnd"):c==="keydown"&&y.keyCode===229&&(as="onCompositionStart");as&&(en&&y.locale!=="ko"&&(ks||as!=="onCompositionStart"?as==="onCompositionEnd"&&ks&&(Wr=sl()):(fi=dn,Wl="value"in fi?fi.value:fi.textContent,ks=!0)),Qr=Yd(Ot,as),0<Qr.length&&(as=new Yf(as,c,null,y,dn),pn.push({event:as,listeners:Qr}),Wr?as.data=Wr:(Wr=vr(y),Wr!==null&&(as.data=Wr)))),(Wr=ot?Ea(c,y):Mr(c,y))&&(Ot=Yd(Ot,"onBeforeInput"),0<Ot.length&&(dn=new Yf("onBeforeInput","beforeinput",null,y,dn),pn.push({event:dn,listeners:Ot}),dn.data=Wr))}$0(pn,f)})}function rd(c,f,y){return{instance:c,listener:f,currentTarget:y}}function Yd(c,f){for(var y=f+"Capture",C=[];c!==null;){var O=c,F=O.stateNode;O.tag===5&&F!==null&&(O=F,F=ui(c,y),F!=null&&C.unshift(rd(c,F,O)),F=ui(c,f),F!=null&&C.push(rd(c,F,O))),c=c.return}return C}function Zc(c){if(c===null)return null;do c=c.return;while(c&&c.tag!==5);return c||null}function qm(c,f,y,C,O){for(var F=f._reactName,de=[];y!==null&&y!==C;){var Fe=y,Ye=Fe.alternate,Ot=Fe.stateNode;if(Ye!==null&&Ye===C)break;Fe.tag===5&&Ot!==null&&(Fe=Ot,O?(Ye=ui(y,F),Ye!=null&&de.unshift(rd(y,Ye,Fe))):O||(Ye=ui(y,F),Ye!=null&&de.push(rd(y,Ye,Fe)))),y=y.return}de.length!==0&&c.push({event:f,listeners:de})}var L0=/\r\n?/g,Xd=/\u0000|\uFFFD/g;function F0(c){return(typeof c=="string"?c:""+c).replace(L0,`
`).replace(Xd,"")}function Zd(c,f,y){if(f=F0(f),F0(c)!==f&&y)throw Error(ae(425))}function Eu(){}var Km=null,Yl=null;function Jd(c,f){return c==="textarea"||c==="noscript"||typeof f.children=="string"||typeof f.children=="number"||typeof f.dangerouslySetInnerHTML=="object"&&f.dangerouslySetInnerHTML!==null&&f.dangerouslySetInnerHTML.__html!=null}var ep=typeof setTimeout=="function"?setTimeout:void 0,Gm=typeof clearTimeout=="function"?clearTimeout:void 0,Qm=typeof Promise=="function"?Promise:void 0,ih=typeof queueMicrotask=="function"?queueMicrotask:typeof Qm<"u"?function(c){return Qm.resolve(null).then(c).catch(Gw)}:ep;function Gw(c){setTimeout(function(){throw c})}function z0(c,f){var y=f,C=0;do{var O=y.nextSibling;if(c.removeChild(y),O&&O.nodeType===8)if(y=O.data,y==="/$"){if(C===0){c.removeChild(O),tn(f);return}C--}else y!=="$"&&y!=="$?"&&y!=="$!"||C++;y=O}while(y);tn(f)}function Tu(c){for(;c!=null;c=c.nextSibling){var f=c.nodeType;if(f===1||f===3)break;if(f===8){if(f=c.data,f==="$"||f==="$!"||f==="$?")break;if(f==="/$")return null}}return c}function U0(c){c=c.previousSibling;for(var f=0;c;){if(c.nodeType===8){var y=c.data;if(y==="$"||y==="$!"||y==="$?"){if(f===0)return c;f--}else y==="/$"&&f++}c=c.previousSibling}return null}var ef=Math.random().toString(36).slice(2),Xl="__reactFiber$"+ef,tf="__reactProps$"+ef,Ss="__reactContainer$"+ef,tp="__reactEvents$"+ef,lh="__reactListeners$"+ef,ku="__reactHandles$"+ef;function nf(c){var f=c[Xl];if(f)return f;for(var y=c.parentNode;y;){if(f=y[Ss]||y[Xl]){if(y=f.alternate,f.child!==null||y!==null&&y.child!==null)for(c=U0(c);c!==null;){if(y=c[Xl])return y;c=U0(c)}return f}c=y,y=c.parentNode}return null}function rf(c){return c=c[Xl]||c[Ss],!c||c.tag!==5&&c.tag!==6&&c.tag!==13&&c.tag!==3?null:c}function np(c){if(c.tag===5||c.tag===6)return c.stateNode;throw Error(ae(33))}function sf(c){return c[tf]||null}var sd=[],Ac=-1;function Ru(c){return{current:c}}function lo(c){0>Ac||(c.current=sd[Ac],sd[Ac]=null,Ac--)}function Co(c,f){Ac++,sd[Ac]=c.current,c.current=f}var od={},Si=Ru(od),il=Ru(!1),ad=od;function id(c,f){var y=c.type.contextTypes;if(!y)return od;var C=c.stateNode;if(C&&C.__reactInternalMemoizedUnmaskedChildContext===f)return C.__reactInternalMemoizedMaskedChildContext;var O={},F;for(F in y)O[F]=f[F];return C&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=f,c.__reactInternalMemoizedMaskedChildContext=O),O}function ka(c){return c=c.childContextTypes,c!=null}function Ym(){lo(il),lo(Si)}function of(c,f,y){if(Si.current!==od)throw Error(ae(168));Co(Si,f),Co(il,y)}function ch(c,f,y){var C=c.stateNode;if(f=f.childContextTypes,typeof C.getChildContext!="function")return y;C=C.getChildContext();for(var O in C)if(!(O in f))throw Error(ae(108,ar(c)||"Unknown",O));return Pe({},y,C)}function Ic(c){return c=(c=c.stateNode)&&c.__reactInternalMemoizedMergedChildContext||od,ad=Si.current,Co(Si,c),Co(il,il.current),!0}function af(c,f,y){var C=c.stateNode;if(!C)throw Error(ae(169));y?(c=ch(c,f,ad),C.__reactInternalMemoizedMergedChildContext=c,lo(il),lo(Si),Co(Si,c)):lo(il),Co(il,y)}var Pu=null,ld=!1,rp=!1;function B0(c){Pu===null?Pu=[c]:Pu.push(c)}function zy(c){ld=!0,B0(c)}function Zl(){if(!rp&&Pu!==null){rp=!0;var c=0,f=Ar;try{var y=Pu;for(Ar=1;c<y.length;c++){var C=y[c];do C=C(!0);while(C!==null)}Pu=null,ld=!1}catch(O){throw Pu!==null&&(Pu=Pu.slice(c+1)),X(et,Zl),O}finally{Ar=f,rp=!1}}return null}var lf=[],Tl=0,uh=null,Xm=0,kl=[],Xo=0,Rl=null,Vi=1,Jl="";function cf(c,f){lf[Tl++]=Xm,lf[Tl++]=uh,uh=c,Xm=f}function V0(c,f,y){kl[Xo++]=Vi,kl[Xo++]=Jl,kl[Xo++]=Rl,Rl=c;var C=Vi;c=Jl;var O=32-hn(C)-1;C&=~(1<<O),y+=1;var F=32-hn(f)+O;if(30<F){var de=O-O%5;F=(C&(1<<de)-1).toString(32),C>>=de,O-=de,Vi=1<<32-hn(f)+O|y<<O|C,Jl=F+c}else Vi=1<<F|y<<O|C,Jl=c}function H0(c){c.return!==null&&(cf(c,1),V0(c,1,0))}function W0(c){for(;c===uh;)uh=lf[--Tl],lf[Tl]=null,Xm=lf[--Tl],lf[Tl]=null;for(;c===Rl;)Rl=kl[--Xo],kl[Xo]=null,Jl=kl[--Xo],kl[Xo]=null,Vi=kl[--Xo],kl[Xo]=null}var mi=null,Ci=null,Uo=!1,ec=null;function q0(c,f){var y=ii(5,null,null,0);y.elementType="DELETED",y.stateNode=f,y.return=c,f=c.deletions,f===null?(c.deletions=[y],c.flags|=16):f.push(y)}function dh(c,f){switch(c.tag){case 5:var y=c.type;return f=f.nodeType!==1||y.toLowerCase()!==f.nodeName.toLowerCase()?null:f,f!==null?(c.stateNode=f,mi=c,Ci=Tu(f.firstChild),!0):!1;case 6:return f=c.pendingProps===""||f.nodeType!==3?null:f,f!==null?(c.stateNode=f,mi=c,Ci=null,!0):!1;case 13:return f=f.nodeType!==8?null:f,f!==null?(y=Rl!==null?{id:Vi,overflow:Jl}:null,c.memoizedState={dehydrated:f,treeContext:y,retryLane:1073741824},y=ii(18,null,null,0),y.stateNode=f,y.return=c,c.child=y,mi=c,Ci=null,!0):!1;default:return!1}}function uf(c){return(c.mode&1)!==0&&(c.flags&128)===0}function Zm(c){if(Uo){var f=Ci;if(f){var y=f;if(!dh(c,f)){if(uf(c))throw Error(ae(418));f=Tu(y.nextSibling);var C=mi;f&&dh(c,f)?q0(C,y):(c.flags=c.flags&-4097|2,Uo=!1,mi=c)}}else{if(uf(c))throw Error(ae(418));c.flags=c.flags&-4097|2,Uo=!1,mi=c}}}function fh(c){for(c=c.return;c!==null&&c.tag!==5&&c.tag!==3&&c.tag!==13;)c=c.return;mi=c}function Ou(c){if(c!==mi)return!1;if(!Uo)return fh(c),Uo=!0,!1;var f;if((f=c.tag!==3)&&!(f=c.tag!==5)&&(f=c.type,f=f!=="head"&&f!=="body"&&!Jd(c.type,c.memoizedProps)),f&&(f=Ci)){if(uf(c))throw Jm(),Error(ae(418));for(;f;)q0(c,f),f=Tu(f.nextSibling)}if(fh(c),c.tag===13){if(c=c.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(ae(317));e:{for(c=c.nextSibling,f=0;c;){if(c.nodeType===8){var y=c.data;if(y==="/$"){if(f===0){Ci=Tu(c.nextSibling);break e}f--}else y!=="$"&&y!=="$!"&&y!=="$?"||f++}c=c.nextSibling}Ci=null}}else Ci=mi?Tu(c.stateNode.nextSibling):null;return!0}function Jm(){for(var c=Ci;c;)c=Tu(c.nextSibling)}function df(){Ci=mi=null,Uo=!1}function eg(c){ec===null?ec=[c]:ec.push(c)}var Uy=qe.ReactCurrentBatchConfig;function Eo(c,f,y){if(c=y.ref,c!==null&&typeof c!="function"&&typeof c!="object"){if(y._owner){if(y=y._owner,y){if(y.tag!==1)throw Error(ae(309));var C=y.stateNode}if(!C)throw Error(ae(147,c));var O=C,F=""+c;return f!==null&&f.ref!==null&&typeof f.ref=="function"&&f.ref._stringRef===F?f.ref:(f=function(de){var Fe=O.refs;de===null?delete Fe[F]:Fe[F]=de},f._stringRef=F,f)}if(typeof c!="string")throw Error(ae(284));if(!y._owner)throw Error(ae(290,c))}return c}function jc(c,f){throw c=Object.prototype.toString.call(f),Error(ae(31,c==="[object Object]"?"object with keys {"+Object.keys(f).join(", ")+"}":c))}function sp(c){var f=c._init;return f(c._payload)}function K0(c){function f(wt,nt){if(c){var Et=wt.deletions;Et===null?(wt.deletions=[nt],wt.flags|=16):Et.push(nt)}}function y(wt,nt){if(!c)return null;for(;nt!==null;)f(wt,nt),nt=nt.sibling;return null}function C(wt,nt){for(wt=new Map;nt!==null;)nt.key!==null?wt.set(nt.key,nt):wt.set(nt.index,nt),nt=nt.sibling;return wt}function O(wt,nt){return wt=Pi(wt,nt),wt.index=0,wt.sibling=null,wt}function F(wt,nt,Et){return wt.index=Et,c?(Et=wt.alternate,Et!==null?(Et=Et.index,Et<nt?(wt.flags|=2,nt):Et):(wt.flags|=2,nt)):(wt.flags|=1048576,nt)}function de(wt){return c&&wt.alternate===null&&(wt.flags|=2),wt}function Fe(wt,nt,Et,vn){return nt===null||nt.tag!==6?(nt=Rf(Et,wt.mode,vn),nt.return=wt,nt):(nt=O(nt,Et),nt.return=wt,nt)}function Ye(wt,nt,Et,vn){var yr=Et.type;return yr===Xe?dn(wt,nt,Et.props.children,vn,Et.key):nt!==null&&(nt.elementType===yr||typeof yr=="object"&&yr!==null&&yr.$$typeof===z&&sp(yr)===nt.type)?(vn=O(nt,Et.props),vn.ref=Eo(wt,nt,Et),vn.return=wt,vn):(vn=xd(Et.type,Et.key,Et.props,null,wt.mode,vn),vn.ref=Eo(wt,nt,Et),vn.return=wt,vn)}function Ot(wt,nt,Et,vn){return nt===null||nt.tag!==4||nt.stateNode.containerInfo!==Et.containerInfo||nt.stateNode.implementation!==Et.implementation?(nt=Gi(Et,wt.mode,vn),nt.return=wt,nt):(nt=O(nt,Et.children||[]),nt.return=wt,nt)}function dn(wt,nt,Et,vn,yr){return nt===null||nt.tag!==7?(nt=zu(Et,wt.mode,vn,yr),nt.return=wt,nt):(nt=O(nt,Et),nt.return=wt,nt)}function pn(wt,nt,Et){if(typeof nt=="string"&&nt!==""||typeof nt=="number")return nt=Rf(""+nt,wt.mode,Et),nt.return=wt,nt;if(typeof nt=="object"&&nt!==null){switch(nt.$$typeof){case nn:return Et=xd(nt.type,nt.key,nt.props,null,wt.mode,Et),Et.ref=Eo(wt,null,nt),Et.return=wt,Et;case Ut:return nt=Gi(nt,wt.mode,Et),nt.return=wt,nt;case z:var vn=nt._init;return pn(wt,vn(nt._payload),Et)}if(qn(nt)||kt(nt))return nt=zu(nt,wt.mode,Et,null),nt.return=wt,nt;jc(wt,nt)}return null}function on(wt,nt,Et,vn){var yr=nt!==null?nt.key:null;if(typeof Et=="string"&&Et!==""||typeof Et=="number")return yr!==null?null:Fe(wt,nt,""+Et,vn);if(typeof Et=="object"&&Et!==null){switch(Et.$$typeof){case nn:return Et.key===yr?Ye(wt,nt,Et,vn):null;case Ut:return Et.key===yr?Ot(wt,nt,Et,vn):null;case z:return yr=Et._init,on(wt,nt,yr(Et._payload),vn)}if(qn(Et)||kt(Et))return yr!==null?null:dn(wt,nt,Et,vn,null);jc(wt,Et)}return null}function Zn(wt,nt,Et,vn,yr){if(typeof vn=="string"&&vn!==""||typeof vn=="number")return wt=wt.get(Et)||null,Fe(nt,wt,""+vn,yr);if(typeof vn=="object"&&vn!==null){switch(vn.$$typeof){case nn:return wt=wt.get(vn.key===null?Et:vn.key)||null,Ye(nt,wt,vn,yr);case Ut:return wt=wt.get(vn.key===null?Et:vn.key)||null,Ot(nt,wt,vn,yr);case z:var Qr=vn._init;return Zn(wt,nt,Et,Qr(vn._payload),yr)}if(qn(vn)||kt(vn))return wt=wt.get(Et)||null,dn(nt,wt,vn,yr,null);jc(nt,vn)}return null}function dr(wt,nt,Et,vn){for(var yr=null,Qr=null,Wr=nt,as=nt=0,Ua=null;Wr!==null&&as<Et.length;as++){Wr.index>as?(Ua=Wr,Wr=null):Ua=Wr.sibling;var eo=on(wt,Wr,Et[as],vn);if(eo===null){Wr===null&&(Wr=Ua);break}c&&Wr&&eo.alternate===null&&f(wt,Wr),nt=F(eo,nt,as),Qr===null?yr=eo:Qr.sibling=eo,Qr=eo,Wr=Ua}if(as===Et.length)return y(wt,Wr),Uo&&cf(wt,as),yr;if(Wr===null){for(;as<Et.length;as++)Wr=pn(wt,Et[as],vn),Wr!==null&&(nt=F(Wr,nt,as),Qr===null?yr=Wr:Qr.sibling=Wr,Qr=Wr);return Uo&&cf(wt,as),yr}for(Wr=C(wt,Wr);as<Et.length;as++)Ua=Zn(Wr,wt,as,Et[as],vn),Ua!==null&&(c&&Ua.alternate!==null&&Wr.delete(Ua.key===null?as:Ua.key),nt=F(Ua,nt,as),Qr===null?yr=Ua:Qr.sibling=Ua,Qr=Ua);return c&&Wr.forEach(function(ic){return f(wt,ic)}),Uo&&cf(wt,as),yr}function hr(wt,nt,Et,vn){var yr=kt(Et);if(typeof yr!="function")throw Error(ae(150));if(Et=yr.call(Et),Et==null)throw Error(ae(151));for(var Qr=yr=null,Wr=nt,as=nt=0,Ua=null,eo=Et.next();Wr!==null&&!eo.done;as++,eo=Et.next()){Wr.index>as?(Ua=Wr,Wr=null):Ua=Wr.sibling;var ic=on(wt,Wr,eo.value,vn);if(ic===null){Wr===null&&(Wr=Ua);break}c&&Wr&&ic.alternate===null&&f(wt,Wr),nt=F(ic,nt,as),Qr===null?yr=ic:Qr.sibling=ic,Qr=ic,Wr=Ua}if(eo.done)return y(wt,Wr),Uo&&cf(wt,as),yr;if(Wr===null){for(;!eo.done;as++,eo=Et.next())eo=pn(wt,eo.value,vn),eo!==null&&(nt=F(eo,nt,as),Qr===null?yr=eo:Qr.sibling=eo,Qr=eo);return Uo&&cf(wt,as),yr}for(Wr=C(wt,Wr);!eo.done;as++,eo=Et.next())eo=Zn(Wr,wt,as,eo.value,vn),eo!==null&&(c&&eo.alternate!==null&&Wr.delete(eo.key===null?as:eo.key),nt=F(eo,nt,as),Qr===null?yr=eo:Qr.sibling=eo,Qr=eo);return c&&Wr.forEach(function(Wh){return f(wt,Wh)}),Uo&&cf(wt,as),yr}function ua(wt,nt,Et,vn){if(typeof Et=="object"&&Et!==null&&Et.type===Xe&&Et.key===null&&(Et=Et.props.children),typeof Et=="object"&&Et!==null){switch(Et.$$typeof){case nn:e:{for(var yr=Et.key,Qr=nt;Qr!==null;){if(Qr.key===yr){if(yr=Et.type,yr===Xe){if(Qr.tag===7){y(wt,Qr.sibling),nt=O(Qr,Et.props.children),nt.return=wt,wt=nt;break e}}else if(Qr.elementType===yr||typeof yr=="object"&&yr!==null&&yr.$$typeof===z&&sp(yr)===Qr.type){y(wt,Qr.sibling),nt=O(Qr,Et.props),nt.ref=Eo(wt,Qr,Et),nt.return=wt,wt=nt;break e}y(wt,Qr);break}else f(wt,Qr);Qr=Qr.sibling}Et.type===Xe?(nt=zu(Et.props.children,wt.mode,vn,Et.key),nt.return=wt,wt=nt):(vn=xd(Et.type,Et.key,Et.props,null,wt.mode,vn),vn.ref=Eo(wt,nt,Et),vn.return=wt,wt=vn)}return de(wt);case Ut:e:{for(Qr=Et.key;nt!==null;){if(nt.key===Qr)if(nt.tag===4&&nt.stateNode.containerInfo===Et.containerInfo&&nt.stateNode.implementation===Et.implementation){y(wt,nt.sibling),nt=O(nt,Et.children||[]),nt.return=wt,wt=nt;break e}else{y(wt,nt);break}else f(wt,nt);nt=nt.sibling}nt=Gi(Et,wt.mode,vn),nt.return=wt,wt=nt}return de(wt);case z:return Qr=Et._init,ua(wt,nt,Qr(Et._payload),vn)}if(qn(Et))return dr(wt,nt,Et,vn);if(kt(Et))return hr(wt,nt,Et,vn);jc(wt,Et)}return typeof Et=="string"&&Et!==""||typeof Et=="number"?(Et=""+Et,nt!==null&&nt.tag===6?(y(wt,nt.sibling),nt=O(nt,Et),nt.return=wt,wt=nt):(y(wt,nt),nt=Rf(Et,wt.mode,vn),nt.return=wt,wt=nt),de(wt)):y(wt,nt)}return ua}var Jc=K0(!0),tg=K0(!1),ph=Ru(null),ff=null,Nu=null,pf=null;function ng(){pf=Nu=ff=null}function hh(c){var f=ph.current;lo(ph),c._currentValue=f}function rg(c,f,y){for(;c!==null;){var C=c.alternate;if((c.childLanes&f)!==f?(c.childLanes|=f,C!==null&&(C.childLanes|=f)):C!==null&&(C.childLanes&f)!==f&&(C.childLanes|=f),c===y)break;c=c.return}}function cd(c,f){ff=c,pf=Nu=null,c=c.dependencies,c!==null&&c.firstContext!==null&&(c.lanes&f&&(Ei=!0),c.firstContext=null)}function Pl(c){var f=c._currentValue;if(pf!==c)if(c={context:c,memoizedValue:f,next:null},Nu===null){if(ff===null)throw Error(ae(308));Nu=c,ff.dependencies={lanes:0,firstContext:c}}else Nu=Nu.next=c;return f}var Au=null;function mh(c){Au===null?Au=[c]:Au.push(c)}function sg(c,f,y,C){var O=f.interleaved;return O===null?(y.next=y,mh(f)):(y.next=O.next,O.next=y),f.interleaved=y,eu(c,C)}function eu(c,f){c.lanes|=f;var y=c.alternate;for(y!==null&&(y.lanes|=f),y=c,c=c.return;c!==null;)c.childLanes|=f,y=c.alternate,y!==null&&(y.childLanes|=f),y=c,c=c.return;return y.tag===3?y.stateNode:null}var ll=!1;function gh(c){c.updateQueue={baseState:c.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function vh(c,f){c=c.updateQueue,f.updateQueue===c&&(f.updateQueue={baseState:c.baseState,firstBaseUpdate:c.firstBaseUpdate,lastBaseUpdate:c.lastBaseUpdate,shared:c.shared,effects:c.effects})}function Ys(c,f){return{eventTime:c,lane:f,tag:0,payload:null,callback:null,next:null}}function tc(c,f,y){var C=c.updateQueue;if(C===null)return null;if(C=C.shared,Xs&2){var O=C.pending;return O===null?f.next=f:(f.next=O.next,O.next=f),C.pending=f,eu(c,y)}return O=C.interleaved,O===null?(f.next=f,mh(C)):(f.next=O.next,O.next=f),C.interleaved=f,eu(c,y)}function yh(c,f,y){if(f=f.updateQueue,f!==null&&(f=f.shared,(y&4194240)!==0)){var C=f.lanes;C&=c.pendingLanes,y|=C,f.lanes=y,Gs(c,y)}}function og(c,f){var y=c.updateQueue,C=c.alternate;if(C!==null&&(C=C.updateQueue,y===C)){var O=null,F=null;if(y=y.firstBaseUpdate,y!==null){do{var de={eventTime:y.eventTime,lane:y.lane,tag:y.tag,payload:y.payload,callback:y.callback,next:null};F===null?O=F=de:F=F.next=de,y=y.next}while(y!==null);F===null?O=F=f:F=F.next=f}else O=F=f;y={baseState:C.baseState,firstBaseUpdate:O,lastBaseUpdate:F,shared:C.shared,effects:C.effects},c.updateQueue=y;return}c=y.lastBaseUpdate,c===null?y.firstBaseUpdate=f:c.next=f,y.lastBaseUpdate=f}function bh(c,f,y,C){var O=c.updateQueue;ll=!1;var F=O.firstBaseUpdate,de=O.lastBaseUpdate,Fe=O.shared.pending;if(Fe!==null){O.shared.pending=null;var Ye=Fe,Ot=Ye.next;Ye.next=null,de===null?F=Ot:de.next=Ot,de=Ye;var dn=c.alternate;dn!==null&&(dn=dn.updateQueue,Fe=dn.lastBaseUpdate,Fe!==de&&(Fe===null?dn.firstBaseUpdate=Ot:Fe.next=Ot,dn.lastBaseUpdate=Ye))}if(F!==null){var pn=O.baseState;de=0,dn=Ot=Ye=null,Fe=F;do{var on=Fe.lane,Zn=Fe.eventTime;if((C&on)===on){dn!==null&&(dn=dn.next={eventTime:Zn,lane:0,tag:Fe.tag,payload:Fe.payload,callback:Fe.callback,next:null});e:{var dr=c,hr=Fe;switch(on=f,Zn=y,hr.tag){case 1:if(dr=hr.payload,typeof dr=="function"){pn=dr.call(Zn,pn,on);break e}pn=dr;break e;case 3:dr.flags=dr.flags&-65537|128;case 0:if(dr=hr.payload,on=typeof dr=="function"?dr.call(Zn,pn,on):dr,on==null)break e;pn=Pe({},pn,on);break e;case 2:ll=!0}}Fe.callback!==null&&Fe.lane!==0&&(c.flags|=64,on=O.effects,on===null?O.effects=[Fe]:on.push(Fe))}else Zn={eventTime:Zn,lane:on,tag:Fe.tag,payload:Fe.payload,callback:Fe.callback,next:null},dn===null?(Ot=dn=Zn,Ye=pn):dn=dn.next=Zn,de|=on;if(Fe=Fe.next,Fe===null){if(Fe=O.shared.pending,Fe===null)break;on=Fe,Fe=on.next,on.next=null,O.lastBaseUpdate=on,O.shared.pending=null}}while(1);if(dn===null&&(Ye=pn),O.baseState=Ye,O.firstBaseUpdate=Ot,O.lastBaseUpdate=dn,f=O.shared.interleaved,f!==null){O=f;do de|=O.lane,O=O.next;while(O!==f)}else F===null&&(O.shared.lanes=0);gd|=de,c.lanes=de,c.memoizedState=pn}}function G0(c,f,y){if(c=f.effects,f.effects=null,c!==null)for(f=0;f<c.length;f++){var C=c[f],O=C.callback;if(O!==null){if(C.callback=null,C=y,typeof O!="function")throw Error(ae(191,O));O.call(C)}}}var tu={},ga=Ru(tu),ud=Ru(tu),op=Ru(tu);function dd(c){if(c===tu)throw Error(ae(174));return c}function wh(c,f){switch(Co(op,f),Co(ud,c),Co(ga,tu),c=f.nodeType,c){case 9:case 11:f=(f=f.documentElement)?f.namespaceURI:Rr(null,"");break;default:c=c===8?f.parentNode:f,f=c.namespaceURI||null,c=c.tagName,f=Rr(f,c)}lo(ga),Co(ga,f)}function nu(){lo(ga),lo(ud),lo(op)}function Q0(c){dd(op.current);var f=dd(ga.current),y=Rr(f,c.type);f!==y&&(Co(ud,c),Co(ga,y))}function ru(c){ud.current===c&&(lo(ga),lo(ud))}var Zo=Ru(0);function Dc(c){for(var f=c;f!==null;){if(f.tag===13){var y=f.memoizedState;if(y!==null&&(y=y.dehydrated,y===null||y.data==="$?"||y.data==="$!"))return f}else if(f.tag===19&&f.memoizedProps.revealOrder!==void 0){if(f.flags&128)return f}else if(f.child!==null){f.child.return=f,f=f.child;continue}if(f===c)break;for(;f.sibling===null;){if(f.return===null||f.return===c)return null;f=f.return}f.sibling.return=f.return,f=f.sibling}return null}var Rs=[];function fd(){for(var c=0;c<Rs.length;c++)Rs[c]._workInProgressVersionPrimary=null;Rs.length=0}var Ol=qe.ReactCurrentDispatcher,ag=qe.ReactCurrentBatchConfig,cl=0,Jo=null,Ra=null,Ga=null,hf=!1,mf=!1,gf=0,Y0=0;function st(){throw Error(ae(321))}function ig(c,f){if(f===null)return!1;for(var y=0;y<f.length&&y<c.length;y++)if(!Bi(c[y],f[y]))return!1;return!0}function ap(c,f,y,C,O,F){if(cl=F,Jo=f,f.memoizedState=null,f.updateQueue=null,f.lanes=0,Ol.current=c===null||c.memoizedState===null?Hy:sv,c=y(C,O),mf){F=0;do{if(mf=!1,gf=0,25<=F)throw Error(ae(301));F+=1,Ga=Ra=null,f.updateQueue=null,Ol.current=Wy,c=y(C,O)}while(mf)}if(Ol.current=bf,f=Ra!==null&&Ra.next!==null,cl=0,Ga=Ra=Jo=null,hf=!1,f)throw Error(ae(300));return c}function X0(){var c=gf!==0;return gf=0,c}function Qa(){var c={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ga===null?Jo.memoizedState=Ga=c:Ga=Ga.next=c,Ga}function Hi(){if(Ra===null){var c=Jo.alternate;c=c!==null?c.memoizedState:null}else c=Ra.next;var f=Ga===null?Jo.memoizedState:Ga.next;if(f!==null)Ga=f,Ra=c;else{if(c===null)throw Error(ae(310));Ra=c,c={memoizedState:Ra.memoizedState,baseState:Ra.baseState,baseQueue:Ra.baseQueue,queue:Ra.queue,next:null},Ga===null?Jo.memoizedState=Ga=c:Ga=Ga.next=c}return Ga}function ip(c,f){return typeof f=="function"?f(c):f}function lg(c){var f=Hi(),y=f.queue;if(y===null)throw Error(ae(311));y.lastRenderedReducer=c;var C=Ra,O=C.baseQueue,F=y.pending;if(F!==null){if(O!==null){var de=O.next;O.next=F.next,F.next=de}C.baseQueue=O=F,y.pending=null}if(O!==null){F=O.next,C=C.baseState;var Fe=de=null,Ye=null,Ot=F;do{var dn=Ot.lane;if((cl&dn)===dn)Ye!==null&&(Ye=Ye.next={lane:0,action:Ot.action,hasEagerState:Ot.hasEagerState,eagerState:Ot.eagerState,next:null}),C=Ot.hasEagerState?Ot.eagerState:c(C,Ot.action);else{var pn={lane:dn,action:Ot.action,hasEagerState:Ot.hasEagerState,eagerState:Ot.eagerState,next:null};Ye===null?(Fe=Ye=pn,de=C):Ye=Ye.next=pn,Jo.lanes|=dn,gd|=dn}Ot=Ot.next}while(Ot!==null&&Ot!==F);Ye===null?de=C:Ye.next=Fe,Bi(C,f.memoizedState)||(Ei=!0),f.memoizedState=C,f.baseState=de,f.baseQueue=Ye,y.lastRenderedState=C}if(c=y.interleaved,c!==null){O=c;do F=O.lane,Jo.lanes|=F,gd|=F,O=O.next;while(O!==c)}else O===null&&(y.lanes=0);return[f.memoizedState,y.dispatch]}function cg(c){var f=Hi(),y=f.queue;if(y===null)throw Error(ae(311));y.lastRenderedReducer=c;var C=y.dispatch,O=y.pending,F=f.memoizedState;if(O!==null){y.pending=null;var de=O=O.next;do F=c(F,de.action),de=de.next;while(de!==O);Bi(F,f.memoizedState)||(Ei=!0),f.memoizedState=F,f.baseQueue===null&&(f.baseState=F),y.lastRenderedState=F}return[F,C]}function ug(){}function By(c,f){var y=Jo,C=Hi(),O=f(),F=!Bi(C.memoizedState,O);if(F&&(C.memoizedState=O,Ei=!0),C=C.queue,Je(Nl.bind(null,y,C,c),[c]),C.getSnapshot!==f||F||Ga!==null&&Ga.memoizedState.tag&1){if(y.flags|=2048,vf(9,xh.bind(null,y,C,O,f),void 0,null),Xa===null)throw Error(ae(349));cl&30||dg(y,f,O)}return O}function dg(c,f,y){c.flags|=16384,c={getSnapshot:f,value:y},f=Jo.updateQueue,f===null?(f={lastEffect:null,stores:null},Jo.updateQueue=f,f.stores=[c]):(y=f.stores,y===null?f.stores=[c]:y.push(c))}function xh(c,f,y,C){f.value=y,f.getSnapshot=C,No(f)&&Z0(c)}function Nl(c,f,y){return y(function(){No(f)&&Z0(c)})}function No(c){var f=c.getSnapshot;c=c.value;try{var y=f();return!Bi(c,y)}catch{return!0}}function Z0(c){var f=eu(c,1);f!==null&&oc(f,c,1,-1)}function J0(c){var f=Qa();return typeof c=="function"&&(c=c()),f.memoizedState=f.baseState=c,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ip,lastRenderedState:c},f.queue=c,c=c.dispatch=Ao.bind(null,Jo,c),[f.memoizedState,c]}function vf(c,f,y,C){return c={tag:c,create:f,destroy:y,deps:C,next:null},f=Jo.updateQueue,f===null?(f={lastEffect:null,stores:null},Jo.updateQueue=f,f.lastEffect=c.next=c):(y=f.lastEffect,y===null?f.lastEffect=c.next=c:(C=y.next,y.next=c,c.next=C,f.lastEffect=c)),c}function mn(){return Hi().memoizedState}function _h(c,f,y,C){var O=Qa();Jo.flags|=c,O.memoizedState=vf(1|f,y,void 0,C===void 0?null:C)}function yf(c,f,y,C){var O=Hi();C=C===void 0?null:C;var F=void 0;if(Ra!==null){var de=Ra.memoizedState;if(F=de.destroy,C!==null&&ig(C,de.deps)){O.memoizedState=vf(f,y,F,C);return}}Jo.flags|=c,O.memoizedState=vf(1|f,y,F,C)}function su(c,f){return _h(8390656,8,c,f)}function Je(c,f){return yf(2048,8,c,f)}function gn(c,f){return yf(4,2,c,f)}function ev(c,f){return yf(4,4,c,f)}function nc(c,f){if(typeof f=="function")return c=c(),f(c),function(){f(null)};if(f!=null)return c=c(),f.current=c,function(){f.current=null}}function Lr(c,f,y){return y=y!=null?y.concat([c]):null,yf(4,4,nc.bind(null,f,c),y)}function Iu(){}function va(c,f){var y=Hi();f=f===void 0?null:f;var C=y.memoizedState;return C!==null&&f!==null&&ig(f,C[1])?C[0]:(y.memoizedState=[c,f],c)}function tv(c,f){var y=Hi();f=f===void 0?null:f;var C=y.memoizedState;return C!==null&&f!==null&&ig(f,C[1])?C[0]:(c=c(),y.memoizedState=[c,f],c)}function ya(c,f,y){return cl&21?(Bi(y,f)||(y=qs(),Jo.lanes|=y,gd|=y,c.baseState=!0),f):(c.baseState&&(c.baseState=!1,Ei=!0),c.memoizedState=y)}function Vy(c,f){var y=Ar;Ar=y!==0&&4>y?y:4,c(!0);var C=ag.transition;ag.transition={};try{c(!1),f()}finally{Ar=y,ag.transition=C}}function nv(){return Hi().memoizedState}function ri(c,f,y){var C=Mu(c);if(y={lane:C,action:y,hasEagerState:!1,eagerState:null,next:null},si(c))rv(f,y);else if(y=sg(c,f,y,C),y!==null){var O=oi();oc(y,c,C,O),fg(y,f,C)}}function Ao(c,f,y){var C=Mu(c),O={lane:C,action:y,hasEagerState:!1,eagerState:null,next:null};if(si(c))rv(f,O);else{var F=c.alternate;if(c.lanes===0&&(F===null||F.lanes===0)&&(F=f.lastRenderedReducer,F!==null))try{var de=f.lastRenderedState,Fe=F(de,y);if(O.hasEagerState=!0,O.eagerState=Fe,Bi(Fe,de)){var Ye=f.interleaved;Ye===null?(O.next=O,mh(f)):(O.next=Ye.next,Ye.next=O),f.interleaved=O;return}}catch{}finally{}y=sg(c,f,O,C),y!==null&&(O=oi(),oc(y,c,C,O),fg(y,f,C))}}function si(c){var f=c.alternate;return c===Jo||f!==null&&f===Jo}function rv(c,f){mf=hf=!0;var y=c.pending;y===null?f.next=f:(f.next=y.next,y.next=f),c.pending=f}function fg(c,f,y){if(y&4194240){var C=f.lanes;C&=c.pendingLanes,y|=C,f.lanes=y,Gs(c,y)}}var bf={readContext:Pl,useCallback:st,useContext:st,useEffect:st,useImperativeHandle:st,useInsertionEffect:st,useLayoutEffect:st,useMemo:st,useReducer:st,useRef:st,useState:st,useDebugValue:st,useDeferredValue:st,useTransition:st,useMutableSource:st,useSyncExternalStore:st,useId:st,unstable_isNewReconciler:!1},Hy={readContext:Pl,useCallback:function(c,f){return Qa().memoizedState=[c,f===void 0?null:f],c},useContext:Pl,useEffect:su,useImperativeHandle:function(c,f,y){return y=y!=null?y.concat([c]):null,_h(4194308,4,nc.bind(null,f,c),y)},useLayoutEffect:function(c,f){return _h(4194308,4,c,f)},useInsertionEffect:function(c,f){return _h(4,2,c,f)},useMemo:function(c,f){var y=Qa();return f=f===void 0?null:f,c=c(),y.memoizedState=[c,f],c},useReducer:function(c,f,y){var C=Qa();return f=y!==void 0?y(f):f,C.memoizedState=C.baseState=f,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:f},C.queue=c,c=c.dispatch=ri.bind(null,Jo,c),[C.memoizedState,c]},useRef:function(c){var f=Qa();return c={current:c},f.memoizedState=c},useState:J0,useDebugValue:Iu,useDeferredValue:function(c){return Qa().memoizedState=c},useTransition:function(){var c=J0(!1),f=c[0];return c=Vy.bind(null,c[1]),Qa().memoizedState=c,[f,c]},useMutableSource:function(){},useSyncExternalStore:function(c,f,y){var C=Jo,O=Qa();if(Uo){if(y===void 0)throw Error(ae(407));y=y()}else{if(y=f(),Xa===null)throw Error(ae(349));cl&30||dg(C,f,y)}O.memoizedState=y;var F={value:y,getSnapshot:f};return O.queue=F,su(Nl.bind(null,C,F,c),[c]),C.flags|=2048,vf(9,xh.bind(null,C,F,y,f),void 0,null),y},useId:function(){var c=Qa(),f=Xa.identifierPrefix;if(Uo){var y=Jl,C=Vi;y=(C&~(1<<32-hn(C)-1)).toString(32)+y,f=":"+f+"R"+y,y=gf++,0<y&&(f+="H"+y.toString(32)),f+=":"}else y=Y0++,f=":"+f+"r"+y.toString(32)+":";return c.memoizedState=f},unstable_isNewReconciler:!1},sv={readContext:Pl,useCallback:va,useContext:Pl,useEffect:Je,useImperativeHandle:Lr,useInsertionEffect:gn,useLayoutEffect:ev,useMemo:tv,useReducer:lg,useRef:mn,useState:function(){return lg(ip)},useDebugValue:Iu,useDeferredValue:function(c){var f=Hi();return ya(f,Ra.memoizedState,c)},useTransition:function(){var c=lg(ip)[0],f=Hi().memoizedState;return[c,f]},useMutableSource:ug,useSyncExternalStore:By,useId:nv,unstable_isNewReconciler:!1},Wy={readContext:Pl,useCallback:va,useContext:Pl,useEffect:Je,useImperativeHandle:Lr,useInsertionEffect:gn,useLayoutEffect:ev,useMemo:tv,useReducer:cg,useRef:mn,useState:function(){return cg(ip)},useDebugValue:Iu,useDeferredValue:function(c){var f=Hi();return Ra===null?f.memoizedState=c:ya(f,Ra.memoizedState,c)},useTransition:function(){var c=cg(ip)[0],f=Hi().memoizedState;return[c,f]},useMutableSource:ug,useSyncExternalStore:By,useId:nv,unstable_isNewReconciler:!1};function Mc(c,f){if(c&&c.defaultProps){f=Pe({},f),c=c.defaultProps;for(var y in c)f[y]===void 0&&(f[y]=c[y]);return f}return f}function ov(c,f,y,C){f=c.memoizedState,y=y(C,f),y=y==null?f:Pe({},f,y),c.memoizedState=y,c.lanes===0&&(c.updateQueue.baseState=y)}var zn={isMounted:function(c){return(c=c._reactInternals)?le(c)===c:!1},enqueueSetState:function(c,f,y){c=c._reactInternals;var C=oi(),O=Mu(c),F=Ys(C,O);F.payload=f,y!=null&&(F.callback=y),f=tc(c,F,O),f!==null&&(oc(f,c,O,C),yh(f,c,O))},enqueueReplaceState:function(c,f,y){c=c._reactInternals;var C=oi(),O=Mu(c),F=Ys(C,O);F.tag=1,F.payload=f,y!=null&&(F.callback=y),f=tc(c,F,O),f!==null&&(oc(f,c,O,C),yh(f,c,O))},enqueueForceUpdate:function(c,f){c=c._reactInternals;var y=oi(),C=Mu(c),O=Ys(y,C);O.tag=2,f!=null&&(O.callback=f),f=tc(c,O,C),f!==null&&(oc(f,c,C,y),yh(f,c,C))}};function lp(c,f,y,C,O,F,de){return c=c.stateNode,typeof c.shouldComponentUpdate=="function"?c.shouldComponentUpdate(C,F,de):f.prototype&&f.prototype.isPureReactComponent?!El(y,C)||!El(O,F):!0}function qy(c,f,y){var C=!1,O=od,F=f.contextType;return typeof F=="object"&&F!==null?F=Pl(F):(O=ka(f)?ad:Si.current,C=f.contextTypes,F=(C=C!=null)?id(c,O):od),f=new f(y,F),c.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=zn,c.stateNode=f,f._reactInternals=c,C&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=O,c.__reactInternalMemoizedMaskedChildContext=F),f}function pg(c,f,y,C){c=f.state,typeof f.componentWillReceiveProps=="function"&&f.componentWillReceiveProps(y,C),typeof f.UNSAFE_componentWillReceiveProps=="function"&&f.UNSAFE_componentWillReceiveProps(y,C),f.state!==c&&zn.enqueueReplaceState(f,f.state,null)}function av(c,f,y,C){var O=c.stateNode;O.props=y,O.state=c.memoizedState,O.refs={},gh(c);var F=f.contextType;typeof F=="object"&&F!==null?O.context=Pl(F):(F=ka(f)?ad:Si.current,O.context=id(c,F)),O.state=c.memoizedState,F=f.getDerivedStateFromProps,typeof F=="function"&&(ov(c,f,F,y),O.state=c.memoizedState),typeof f.getDerivedStateFromProps=="function"||typeof O.getSnapshotBeforeUpdate=="function"||typeof O.UNSAFE_componentWillMount!="function"&&typeof O.componentWillMount!="function"||(f=O.state,typeof O.componentWillMount=="function"&&O.componentWillMount(),typeof O.UNSAFE_componentWillMount=="function"&&O.UNSAFE_componentWillMount(),f!==O.state&&zn.enqueueReplaceState(O,O.state,null),bh(c,y,O,C),O.state=c.memoizedState),typeof O.componentDidMount=="function"&&(c.flags|=4194308)}function ou(c,f){try{var y="",C=f;do y+=nr(C),C=C.return;while(C);var O=y}catch(F){O=`
Error generating stack: `+F.message+`
`+F.stack}return{value:c,source:f,stack:O,digest:null}}function Sh(c,f,y){return{value:c,source:null,stack:y??null,digest:f??null}}function Ch(c,f){try{console.error(f.value)}catch(y){setTimeout(function(){throw y})}}var iv=typeof WeakMap=="function"?WeakMap:Map;function hg(c,f,y){y=Ys(-1,y),y.tag=3,y.payload={element:null};var C=f.value;return y.callback=function(){vp||(vp=!0,yp=C),Ch(c,f)},y}function wf(c,f,y){y=Ys(-1,y),y.tag=3;var C=c.type.getDerivedStateFromError;if(typeof C=="function"){var O=f.value;y.payload=function(){return C(O)},y.callback=function(){Ch(c,f)}}var F=c.stateNode;return F!==null&&typeof F.componentDidCatch=="function"&&(y.callback=function(){Ch(c,f),typeof C!="function"&&(sc===null?sc=new Set([this]):sc.add(this));var de=f.stack;this.componentDidCatch(f.value,{componentStack:de!==null?de:""})}),y}function lv(c,f,y){var C=c.pingCache;if(C===null){C=c.pingCache=new iv;var O=new Set;C.set(f,O)}else O=C.get(f),O===void 0&&(O=new Set,C.set(f,O));O.has(y)||(O.add(y),c=Fs.bind(null,c,f,y),f.then(c,c))}function cv(c){do{var f;if((f=c.tag===13)&&(f=c.memoizedState,f=f!==null?f.dehydrated!==null:!0),f)return c;c=c.return}while(c!==null);return null}function uv(c,f,y,C,O){return c.mode&1?(c.flags|=65536,c.lanes=O,c):(c===f?c.flags|=65536:(c.flags|=128,y.flags|=131072,y.flags&=-52805,y.tag===1&&(y.alternate===null?y.tag=17:(f=Ys(-1,1),f.tag=2,tc(y,f,1))),y.lanes|=1),c)}var Ky=qe.ReactCurrentOwner,Ei=!1;function gi(c,f,y,C){f.child=c===null?tg(f,null,y,C):Jc(f,c.child,y,C)}function Gy(c,f,y,C,O){y=y.render;var F=f.ref;return cd(f,O),C=ap(c,f,y,C,F,O),y=X0(),c!==null&&!Ei?(f.updateQueue=c.updateQueue,f.flags&=-2053,c.lanes&=~O,Wi(c,f,O)):(Uo&&y&&H0(f),f.flags|=1,gi(c,f,C,O),f.child)}function Qy(c,f,y,C,O){if(c===null){var F=y.type;return typeof F=="function"&&!Ng(F)&&F.defaultProps===void 0&&y.compare===null&&y.defaultProps===void 0?(f.tag=15,f.type=F,Eh(c,f,F,C,O)):(c=xd(y.type,null,C,f,f.mode,O),c.ref=f.ref,c.return=f,f.child=c)}if(F=c.child,!(c.lanes&O)){var de=F.memoizedProps;if(y=y.compare,y=y!==null?y:El,y(de,C)&&c.ref===f.ref)return Wi(c,f,O)}return f.flags|=1,c=Pi(F,C),c.ref=f.ref,c.return=f,f.child=c}function Eh(c,f,y,C,O){if(c!==null){var F=c.memoizedProps;if(El(F,C)&&c.ref===f.ref)if(Ei=!1,f.pendingProps=C=F,(c.lanes&O)!==0)c.flags&131072&&(Ei=!0);else return f.lanes=c.lanes,Wi(c,f,O)}return xf(c,f,y,C,O)}function Th(c,f,y){var C=f.pendingProps,O=C.children,F=c!==null?c.memoizedState:null;if(C.mode==="hidden")if(!(f.mode&1))f.memoizedState={baseLanes:0,cachePool:null,transitions:null},Co(Cf,za),za|=y;else{if(!(y&1073741824))return c=F!==null?F.baseLanes|y:y,f.lanes=f.childLanes=1073741824,f.memoizedState={baseLanes:c,cachePool:null,transitions:null},f.updateQueue=null,Co(Cf,za),za|=c,null;f.memoizedState={baseLanes:0,cachePool:null,transitions:null},C=F!==null?F.baseLanes:y,Co(Cf,za),za|=C}else F!==null?(C=F.baseLanes|y,f.memoizedState=null):C=y,Co(Cf,za),za|=C;return gi(c,f,O,y),f.child}function mg(c,f){var y=f.ref;(c===null&&y!==null||c!==null&&c.ref!==y)&&(f.flags|=512,f.flags|=2097152)}function xf(c,f,y,C,O){var F=ka(y)?ad:Si.current;return F=id(f,F),cd(f,O),y=ap(c,f,y,C,F,O),C=X0(),c!==null&&!Ei?(f.updateQueue=c.updateQueue,f.flags&=-2053,c.lanes&=~O,Wi(c,f,O)):(Uo&&C&&H0(f),f.flags|=1,gi(c,f,y,O),f.child)}function _f(c,f,y,C,O){if(ka(y)){var F=!0;Ic(f)}else F=!1;if(cd(f,O),f.stateNode===null)Sf(c,f),qy(f,y,C),av(f,y,C,O),C=!0;else if(c===null){var de=f.stateNode,Fe=f.memoizedProps;de.props=Fe;var Ye=de.context,Ot=y.contextType;typeof Ot=="object"&&Ot!==null?Ot=Pl(Ot):(Ot=ka(y)?ad:Si.current,Ot=id(f,Ot));var dn=y.getDerivedStateFromProps,pn=typeof dn=="function"||typeof de.getSnapshotBeforeUpdate=="function";pn||typeof de.UNSAFE_componentWillReceiveProps!="function"&&typeof de.componentWillReceiveProps!="function"||(Fe!==C||Ye!==Ot)&&pg(f,de,C,Ot),ll=!1;var on=f.memoizedState;de.state=on,bh(f,C,de,O),Ye=f.memoizedState,Fe!==C||on!==Ye||il.current||ll?(typeof dn=="function"&&(ov(f,y,dn,C),Ye=f.memoizedState),(Fe=ll||lp(f,y,Fe,C,on,Ye,Ot))?(pn||typeof de.UNSAFE_componentWillMount!="function"&&typeof de.componentWillMount!="function"||(typeof de.componentWillMount=="function"&&de.componentWillMount(),typeof de.UNSAFE_componentWillMount=="function"&&de.UNSAFE_componentWillMount()),typeof de.componentDidMount=="function"&&(f.flags|=4194308)):(typeof de.componentDidMount=="function"&&(f.flags|=4194308),f.memoizedProps=C,f.memoizedState=Ye),de.props=C,de.state=Ye,de.context=Ot,C=Fe):(typeof de.componentDidMount=="function"&&(f.flags|=4194308),C=!1)}else{de=f.stateNode,vh(c,f),Fe=f.memoizedProps,Ot=f.type===f.elementType?Fe:Mc(f.type,Fe),de.props=Ot,pn=f.pendingProps,on=de.context,Ye=y.contextType,typeof Ye=="object"&&Ye!==null?Ye=Pl(Ye):(Ye=ka(y)?ad:Si.current,Ye=id(f,Ye));var Zn=y.getDerivedStateFromProps;(dn=typeof Zn=="function"||typeof de.getSnapshotBeforeUpdate=="function")||typeof de.UNSAFE_componentWillReceiveProps!="function"&&typeof de.componentWillReceiveProps!="function"||(Fe!==pn||on!==Ye)&&pg(f,de,C,Ye),ll=!1,on=f.memoizedState,de.state=on,bh(f,C,de,O);var dr=f.memoizedState;Fe!==pn||on!==dr||il.current||ll?(typeof Zn=="function"&&(ov(f,y,Zn,C),dr=f.memoizedState),(Ot=ll||lp(f,y,Ot,C,on,dr,Ye)||!1)?(dn||typeof de.UNSAFE_componentWillUpdate!="function"&&typeof de.componentWillUpdate!="function"||(typeof de.componentWillUpdate=="function"&&de.componentWillUpdate(C,dr,Ye),typeof de.UNSAFE_componentWillUpdate=="function"&&de.UNSAFE_componentWillUpdate(C,dr,Ye)),typeof de.componentDidUpdate=="function"&&(f.flags|=4),typeof de.getSnapshotBeforeUpdate=="function"&&(f.flags|=1024)):(typeof de.componentDidUpdate!="function"||Fe===c.memoizedProps&&on===c.memoizedState||(f.flags|=4),typeof de.getSnapshotBeforeUpdate!="function"||Fe===c.memoizedProps&&on===c.memoizedState||(f.flags|=1024),f.memoizedProps=C,f.memoizedState=dr),de.props=C,de.state=dr,de.context=Ye,C=Ot):(typeof de.componentDidUpdate!="function"||Fe===c.memoizedProps&&on===c.memoizedState||(f.flags|=4),typeof de.getSnapshotBeforeUpdate!="function"||Fe===c.memoizedProps&&on===c.memoizedState||(f.flags|=1024),C=!1)}return cp(c,f,y,C,F,O)}function cp(c,f,y,C,O,F){mg(c,f);var de=(f.flags&128)!==0;if(!C&&!de)return O&&af(f,y,!1),Wi(c,f,F);C=f.stateNode,Ky.current=f;var Fe=de&&typeof y.getDerivedStateFromError!="function"?null:C.render();return f.flags|=1,c!==null&&de?(f.child=Jc(f,c.child,null,F),f.child=Jc(f,null,Fe,F)):gi(c,f,Fe,F),f.memoizedState=C.state,O&&af(f,y,!0),f.child}function kh(c){var f=c.stateNode;f.pendingContext?of(c,f.pendingContext,f.pendingContext!==f.context):f.context&&of(c,f.context,!1),wh(c,f.containerInfo)}function gg(c,f,y,C,O){return df(),eg(O),f.flags|=256,gi(c,f,y,C),f.child}var up={dehydrated:null,treeContext:null,retryLane:0};function Rh(c){return{baseLanes:c,cachePool:null,transitions:null}}function dv(c,f,y){var C=f.pendingProps,O=Zo.current,F=!1,de=(f.flags&128)!==0,Fe;if((Fe=de)||(Fe=c!==null&&c.memoizedState===null?!1:(O&2)!==0),Fe?(F=!0,f.flags&=-129):(c===null||c.memoizedState!==null)&&(O|=1),Co(Zo,O&1),c===null)return Zm(f),c=f.memoizedState,c!==null&&(c=c.dehydrated,c!==null)?(f.mode&1?c.data==="$!"?f.lanes=8:f.lanes=1073741824:f.lanes=1,null):(de=C.children,c=C.fallback,F?(C=f.mode,F=f.child,de={mode:"hidden",children:de},!(C&1)&&F!==null?(F.childLanes=0,F.pendingProps=de):F=iu(de,C,0,null),c=zu(c,C,y,null),F.return=f,c.return=f,F.sibling=c,f.child=F,f.child.memoizedState=Rh(y),f.memoizedState=up,c):$c(f,de));if(O=c.memoizedState,O!==null&&(Fe=O.dehydrated,Fe!==null))return Yy(c,f,de,C,Fe,O,y);if(F){F=C.fallback,de=f.mode,O=c.child,Fe=O.sibling;var Ye={mode:"hidden",children:C.children};return!(de&1)&&f.child!==O?(C=f.child,C.childLanes=0,C.pendingProps=Ye,f.deletions=null):(C=Pi(O,Ye),C.subtreeFlags=O.subtreeFlags&14680064),Fe!==null?F=Pi(Fe,F):(F=zu(F,de,y,null),F.flags|=2),F.return=f,C.return=f,C.sibling=F,f.child=C,C=F,F=f.child,de=c.child.memoizedState,de=de===null?Rh(y):{baseLanes:de.baseLanes|y,cachePool:null,transitions:de.transitions},F.memoizedState=de,F.childLanes=c.childLanes&~y,f.memoizedState=up,C}return F=c.child,c=F.sibling,C=Pi(F,{mode:"visible",children:C.children}),!(f.mode&1)&&(C.lanes=y),C.return=f,C.sibling=null,c!==null&&(y=f.deletions,y===null?(f.deletions=[c],f.flags|=16):y.push(c)),f.child=C,f.memoizedState=null,C}function $c(c,f){return f=iu({mode:"visible",children:f},c.mode,0,null),f.return=c,c.child=f}function dp(c,f,y,C){return C!==null&&eg(C),Jc(f,c.child,null,y),c=$c(f,f.pendingProps.children),c.flags|=2,f.memoizedState=null,c}function Yy(c,f,y,C,O,F,de){if(y)return f.flags&256?(f.flags&=-257,C=Sh(Error(ae(422))),dp(c,f,de,C)):f.memoizedState!==null?(f.child=c.child,f.flags|=128,null):(F=C.fallback,O=f.mode,C=iu({mode:"visible",children:C.children},O,0,null),F=zu(F,O,de,null),F.flags|=2,C.return=f,F.return=f,C.sibling=F,f.child=C,f.mode&1&&Jc(f,c.child,null,de),f.child.memoizedState=Rh(de),f.memoizedState=up,F);if(!(f.mode&1))return dp(c,f,de,null);if(O.data==="$!"){if(C=O.nextSibling&&O.nextSibling.dataset,C)var Fe=C.dgst;return C=Fe,F=Error(ae(419)),C=Sh(F,C,void 0),dp(c,f,de,C)}if(Fe=(de&c.childLanes)!==0,Ei||Fe){if(C=Xa,C!==null){switch(de&-de){case 4:O=2;break;case 16:O=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:O=32;break;case 536870912:O=268435456;break;default:O=0}O=O&(C.suspendedLanes|de)?0:O,O!==0&&O!==F.retryLane&&(F.retryLane=O,eu(c,O),oc(C,c,O,-1))}return Fu(),C=Sh(Error(ae(421))),dp(c,f,de,C)}return O.data==="$?"?(f.flags|=128,f.child=c.child,f=Sv.bind(null,c),O._reactRetry=f,null):(c=F.treeContext,Ci=Tu(O.nextSibling),mi=f,Uo=!0,ec=null,c!==null&&(kl[Xo++]=Vi,kl[Xo++]=Jl,kl[Xo++]=Rl,Vi=c.id,Jl=c.overflow,Rl=f),f=$c(f,C.children),f.flags|=4096,f)}function vg(c,f,y){c.lanes|=f;var C=c.alternate;C!==null&&(C.lanes|=f),rg(c.return,f,y)}function Ph(c,f,y,C,O){var F=c.memoizedState;F===null?c.memoizedState={isBackwards:f,rendering:null,renderingStartTime:0,last:C,tail:y,tailMode:O}:(F.isBackwards=f,F.rendering=null,F.renderingStartTime=0,F.last=C,F.tail=y,F.tailMode=O)}function yg(c,f,y){var C=f.pendingProps,O=C.revealOrder,F=C.tail;if(gi(c,f,C.children,y),C=Zo.current,C&2)C=C&1|2,f.flags|=128;else{if(c!==null&&c.flags&128)e:for(c=f.child;c!==null;){if(c.tag===13)c.memoizedState!==null&&vg(c,y,f);else if(c.tag===19)vg(c,y,f);else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===f)break e;for(;c.sibling===null;){if(c.return===null||c.return===f)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}C&=1}if(Co(Zo,C),!(f.mode&1))f.memoizedState=null;else switch(O){case"forwards":for(y=f.child,O=null;y!==null;)c=y.alternate,c!==null&&Dc(c)===null&&(O=y),y=y.sibling;y=O,y===null?(O=f.child,f.child=null):(O=y.sibling,y.sibling=null),Ph(f,!1,O,y,F);break;case"backwards":for(y=null,O=f.child,f.child=null;O!==null;){if(c=O.alternate,c!==null&&Dc(c)===null){f.child=O;break}c=O.sibling,O.sibling=y,y=O,O=c}Ph(f,!0,y,null,F);break;case"together":Ph(f,!1,null,null,void 0);break;default:f.memoizedState=null}return f.child}function Sf(c,f){!(f.mode&1)&&c!==null&&(c.alternate=null,f.alternate=null,f.flags|=2)}function Wi(c,f,y){if(c!==null&&(f.dependencies=c.dependencies),gd|=f.lanes,!(y&f.childLanes))return null;if(c!==null&&f.child!==c.child)throw Error(ae(153));if(f.child!==null){for(c=f.child,y=Pi(c,c.pendingProps),f.child=y,y.return=f;c.sibling!==null;)c=c.sibling,y=y.sibling=Pi(c,c.pendingProps),y.return=f;y.sibling=null}return f.child}function Qw(c,f,y){switch(f.tag){case 3:kh(f),df();break;case 5:Q0(f);break;case 1:ka(f.type)&&Ic(f);break;case 4:wh(f,f.stateNode.containerInfo);break;case 10:var C=f.type._context,O=f.memoizedProps.value;Co(ph,C._currentValue),C._currentValue=O;break;case 13:if(C=f.memoizedState,C!==null)return C.dehydrated!==null?(Co(Zo,Zo.current&1),f.flags|=128,null):y&f.child.childLanes?dv(c,f,y):(Co(Zo,Zo.current&1),c=Wi(c,f,y),c!==null?c.sibling:null);Co(Zo,Zo.current&1);break;case 19:if(C=(y&f.childLanes)!==0,c.flags&128){if(C)return yg(c,f,y);f.flags|=128}if(O=f.memoizedState,O!==null&&(O.rendering=null,O.tail=null,O.lastEffect=null),Co(Zo,Zo.current),C)break;return null;case 22:case 23:return f.lanes=0,Th(c,f,y)}return Wi(c,f,y)}var fp,la,fv,pp;fp=function(c,f){for(var y=f.child;y!==null;){if(y.tag===5||y.tag===6)c.appendChild(y.stateNode);else if(y.tag!==4&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===f)break;for(;y.sibling===null;){if(y.return===null||y.return===f)return;y=y.return}y.sibling.return=y.return,y=y.sibling}},la=function(){},fv=function(c,f,y,C){var O=c.memoizedProps;if(O!==C){c=f.stateNode,dd(ga.current);var F=null;switch(y){case"input":O=Hn(c,O),C=Hn(c,C),F=[];break;case"select":O=Pe({},O,{value:void 0}),C=Pe({},C,{value:void 0}),F=[];break;case"textarea":O=sr(c,O),C=sr(c,C),F=[];break;default:typeof O.onClick!="function"&&typeof C.onClick=="function"&&(c.onclick=Eu)}ps(y,C);var de;y=null;for(Ot in O)if(!C.hasOwnProperty(Ot)&&O.hasOwnProperty(Ot)&&O[Ot]!=null)if(Ot==="style"){var Fe=O[Ot];for(de in Fe)Fe.hasOwnProperty(de)&&(y||(y={}),y[de]="")}else Ot!=="dangerouslySetInnerHTML"&&Ot!=="children"&&Ot!=="suppressContentEditableWarning"&&Ot!=="suppressHydrationWarning"&&Ot!=="autoFocus"&&(W.hasOwnProperty(Ot)?F||(F=[]):(F=F||[]).push(Ot,null));for(Ot in C){var Ye=C[Ot];if(Fe=O?.[Ot],C.hasOwnProperty(Ot)&&Ye!==Fe&&(Ye!=null||Fe!=null))if(Ot==="style")if(Fe){for(de in Fe)!Fe.hasOwnProperty(de)||Ye&&Ye.hasOwnProperty(de)||(y||(y={}),y[de]="");for(de in Ye)Ye.hasOwnProperty(de)&&Fe[de]!==Ye[de]&&(y||(y={}),y[de]=Ye[de])}else y||(F||(F=[]),F.push(Ot,y)),y=Ye;else Ot==="dangerouslySetInnerHTML"?(Ye=Ye?Ye.__html:void 0,Fe=Fe?Fe.__html:void 0,Ye!=null&&Fe!==Ye&&(F=F||[]).push(Ot,Ye)):Ot==="children"?typeof Ye!="string"&&typeof Ye!="number"||(F=F||[]).push(Ot,""+Ye):Ot!=="suppressContentEditableWarning"&&Ot!=="suppressHydrationWarning"&&(W.hasOwnProperty(Ot)?(Ye!=null&&Ot==="onScroll"&&vo("scroll",c),F||Fe===Ye||(F=[])):(F=F||[]).push(Ot,Ye))}y&&(F=F||[]).push("style",y);var Ot=F;(f.updateQueue=Ot)&&(f.flags|=4)}},pp=function(c,f,y,C){y!==C&&(f.flags|=4)};function pd(c,f){if(!Uo)switch(c.tailMode){case"hidden":f=c.tail;for(var y=null;f!==null;)f.alternate!==null&&(y=f),f=f.sibling;y===null?c.tail=null:y.sibling=null;break;case"collapsed":y=c.tail;for(var C=null;y!==null;)y.alternate!==null&&(C=y),y=y.sibling;C===null?f||c.tail===null?c.tail=null:c.tail.sibling=null:C.sibling=null}}function Ti(c){var f=c.alternate!==null&&c.alternate.child===c.child,y=0,C=0;if(f)for(var O=c.child;O!==null;)y|=O.lanes|O.childLanes,C|=O.subtreeFlags&14680064,C|=O.flags&14680064,O.return=c,O=O.sibling;else for(O=c.child;O!==null;)y|=O.lanes|O.childLanes,C|=O.subtreeFlags,C|=O.flags,O.return=c,O=O.sibling;return c.subtreeFlags|=C,c.childLanes=y,f}function hp(c,f,y){var C=f.pendingProps;switch(W0(f),f.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ti(f),null;case 1:return ka(f.type)&&Ym(),Ti(f),null;case 3:return C=f.stateNode,nu(),lo(il),lo(Si),fd(),C.pendingContext&&(C.context=C.pendingContext,C.pendingContext=null),(c===null||c.child===null)&&(Ou(f)?f.flags|=4:c===null||c.memoizedState.isDehydrated&&!(f.flags&256)||(f.flags|=1024,ec!==null&&(Mh(ec),ec=null))),la(c,f),Ti(f),null;case 5:ru(f);var O=dd(op.current);if(y=f.type,c!==null&&f.stateNode!=null)fv(c,f,y,C,O),c.ref!==f.ref&&(f.flags|=512,f.flags|=2097152);else{if(!C){if(f.stateNode===null)throw Error(ae(166));return Ti(f),null}if(c=dd(ga.current),Ou(f)){C=f.stateNode,y=f.type;var F=f.memoizedProps;switch(C[Xl]=f,C[tf]=F,c=(f.mode&1)!==0,y){case"dialog":vo("cancel",C),vo("close",C);break;case"iframe":case"object":case"embed":vo("load",C);break;case"video":case"audio":for(O=0;O<ia.length;O++)vo(ia[O],C);break;case"source":vo("error",C);break;case"img":case"image":case"link":vo("error",C),vo("load",C);break;case"details":vo("toggle",C);break;case"input":Nr(C,F),vo("invalid",C);break;case"select":C._wrapperState={wasMultiple:!!F.multiple},vo("invalid",C);break;case"textarea":Jn(C,F),vo("invalid",C)}ps(y,F),O=null;for(var de in F)if(F.hasOwnProperty(de)){var Fe=F[de];de==="children"?typeof Fe=="string"?C.textContent!==Fe&&(F.suppressHydrationWarning!==!0&&Zd(C.textContent,Fe,c),O=["children",Fe]):typeof Fe=="number"&&C.textContent!==""+Fe&&(F.suppressHydrationWarning!==!0&&Zd(C.textContent,Fe,c),O=["children",""+Fe]):W.hasOwnProperty(de)&&Fe!=null&&de==="onScroll"&&vo("scroll",C)}switch(y){case"input":Bs(C),Jt(C,F,!0);break;case"textarea":Bs(C),Kn(C);break;case"select":case"option":break;default:typeof F.onClick=="function"&&(C.onclick=Eu)}C=O,f.updateQueue=C,C!==null&&(f.flags|=4)}else{de=O.nodeType===9?O:O.ownerDocument,c==="http://www.w3.org/1999/xhtml"&&(c=Ir(y)),c==="http://www.w3.org/1999/xhtml"?y==="script"?(c=de.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild)):typeof C.is=="string"?c=de.createElement(y,{is:C.is}):(c=de.createElement(y),y==="select"&&(de=c,C.multiple?de.multiple=!0:C.size&&(de.size=C.size))):c=de.createElementNS(c,y),c[Xl]=f,c[tf]=C,fp(c,f,!1,!1),f.stateNode=c;e:{switch(de=ns(y,C),y){case"dialog":vo("cancel",c),vo("close",c),O=C;break;case"iframe":case"object":case"embed":vo("load",c),O=C;break;case"video":case"audio":for(O=0;O<ia.length;O++)vo(ia[O],c);O=C;break;case"source":vo("error",c),O=C;break;case"img":case"image":case"link":vo("error",c),vo("load",c),O=C;break;case"details":vo("toggle",c),O=C;break;case"input":Nr(c,C),O=Hn(c,C),vo("invalid",c);break;case"option":O=C;break;case"select":c._wrapperState={wasMultiple:!!C.multiple},O=Pe({},C,{value:void 0}),vo("invalid",c);break;case"textarea":Jn(c,C),O=sr(c,C),vo("invalid",c);break;default:O=C}ps(y,O),Fe=O;for(F in Fe)if(Fe.hasOwnProperty(F)){var Ye=Fe[F];F==="style"?xr(c,Ye):F==="dangerouslySetInnerHTML"?(Ye=Ye?Ye.__html:void 0,Ye!=null&&Tr(c,Ye)):F==="children"?typeof Ye=="string"?(y!=="textarea"||Ye!=="")&&gt(c,Ye):typeof Ye=="number"&&gt(c,""+Ye):F!=="suppressContentEditableWarning"&&F!=="suppressHydrationWarning"&&F!=="autoFocus"&&(W.hasOwnProperty(F)?Ye!=null&&F==="onScroll"&&vo("scroll",c):Ye!=null&&It(c,F,Ye,de))}switch(y){case"input":Bs(c),Jt(c,C,!1);break;case"textarea":Bs(c),Kn(c);break;case"option":C.value!=null&&c.setAttribute("value",""+wr(C.value));break;case"select":c.multiple=!!C.multiple,F=C.value,F!=null?bn(c,!!C.multiple,F,!1):C.defaultValue!=null&&bn(c,!!C.multiple,C.defaultValue,!0);break;default:typeof O.onClick=="function"&&(c.onclick=Eu)}switch(y){case"button":case"input":case"select":case"textarea":C=!!C.autoFocus;break e;case"img":C=!0;break e;default:C=!1}}C&&(f.flags|=4)}f.ref!==null&&(f.flags|=512,f.flags|=2097152)}return Ti(f),null;case 6:if(c&&f.stateNode!=null)pp(c,f,c.memoizedProps,C);else{if(typeof C!="string"&&f.stateNode===null)throw Error(ae(166));if(y=dd(op.current),dd(ga.current),Ou(f)){if(C=f.stateNode,y=f.memoizedProps,C[Xl]=f,(F=C.nodeValue!==y)&&(c=mi,c!==null))switch(c.tag){case 3:Zd(C.nodeValue,y,(c.mode&1)!==0);break;case 5:c.memoizedProps.suppressHydrationWarning!==!0&&Zd(C.nodeValue,y,(c.mode&1)!==0)}F&&(f.flags|=4)}else C=(y.nodeType===9?y:y.ownerDocument).createTextNode(C),C[Xl]=f,f.stateNode=C}return Ti(f),null;case 13:if(lo(Zo),C=f.memoizedState,c===null||c.memoizedState!==null&&c.memoizedState.dehydrated!==null){if(Uo&&Ci!==null&&f.mode&1&&!(f.flags&128))Jm(),df(),f.flags|=98560,F=!1;else if(F=Ou(f),C!==null&&C.dehydrated!==null){if(c===null){if(!F)throw Error(ae(318));if(F=f.memoizedState,F=F!==null?F.dehydrated:null,!F)throw Error(ae(317));F[Xl]=f}else df(),!(f.flags&128)&&(f.memoizedState=null),f.flags|=4;Ti(f),F=!1}else ec!==null&&(Mh(ec),ec=null),F=!0;if(!F)return f.flags&65536?f:null}return f.flags&128?(f.lanes=y,f):(C=C!==null,C!==(c!==null&&c.memoizedState!==null)&&C&&(f.child.flags|=8192,f.mode&1&&(c===null||Zo.current&1?Oa===0&&(Oa=3):Fu())),f.updateQueue!==null&&(f.flags|=4),Ti(f),null);case 4:return nu(),la(c,f),c===null&&ah(f.stateNode.containerInfo),Ti(f),null;case 10:return hh(f.type._context),Ti(f),null;case 17:return ka(f.type)&&Ym(),Ti(f),null;case 19:if(lo(Zo),F=f.memoizedState,F===null)return Ti(f),null;if(C=(f.flags&128)!==0,de=F.rendering,de===null)if(C)pd(F,!1);else{if(Oa!==0||c!==null&&c.flags&128)for(c=f.child;c!==null;){if(de=Dc(c),de!==null){for(f.flags|=128,pd(F,!1),C=de.updateQueue,C!==null&&(f.updateQueue=C,f.flags|=4),f.subtreeFlags=0,C=y,y=f.child;y!==null;)F=y,c=C,F.flags&=14680066,de=F.alternate,de===null?(F.childLanes=0,F.lanes=c,F.child=null,F.subtreeFlags=0,F.memoizedProps=null,F.memoizedState=null,F.updateQueue=null,F.dependencies=null,F.stateNode=null):(F.childLanes=de.childLanes,F.lanes=de.lanes,F.child=de.child,F.subtreeFlags=0,F.deletions=null,F.memoizedProps=de.memoizedProps,F.memoizedState=de.memoizedState,F.updateQueue=de.updateQueue,F.type=de.type,c=de.dependencies,F.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext}),y=y.sibling;return Co(Zo,Zo.current&1|2),f.child}c=c.sibling}F.tail!==null&&Oe()>gp&&(f.flags|=128,C=!0,pd(F,!1),f.lanes=4194304)}else{if(!C)if(c=Dc(de),c!==null){if(f.flags|=128,C=!0,y=c.updateQueue,y!==null&&(f.updateQueue=y,f.flags|=4),pd(F,!0),F.tail===null&&F.tailMode==="hidden"&&!de.alternate&&!Uo)return Ti(f),null}else 2*Oe()-F.renderingStartTime>gp&&y!==1073741824&&(f.flags|=128,C=!0,pd(F,!1),f.lanes=4194304);F.isBackwards?(de.sibling=f.child,f.child=de):(y=F.last,y!==null?y.sibling=de:f.child=de,F.last=de)}return F.tail!==null?(f=F.tail,F.rendering=f,F.tail=f.sibling,F.renderingStartTime=Oe(),f.sibling=null,y=Zo.current,Co(Zo,C?y&1|2:y&1),f):(Ti(f),null);case 22:case 23:return Pg(),C=f.memoizedState!==null,c!==null&&c.memoizedState!==null!==C&&(f.flags|=8192),C&&f.mode&1?za&1073741824&&(Ti(f),f.subtreeFlags&6&&(f.flags|=8192)):Ti(f),null;case 24:return null;case 25:return null}throw Error(ae(156,f.tag))}function pv(c,f){switch(W0(f),f.tag){case 1:return ka(f.type)&&Ym(),c=f.flags,c&65536?(f.flags=c&-65537|128,f):null;case 3:return nu(),lo(il),lo(Si),fd(),c=f.flags,c&65536&&!(c&128)?(f.flags=c&-65537|128,f):null;case 5:return ru(f),null;case 13:if(lo(Zo),c=f.memoizedState,c!==null&&c.dehydrated!==null){if(f.alternate===null)throw Error(ae(340));df()}return c=f.flags,c&65536?(f.flags=c&-65537|128,f):null;case 19:return lo(Zo),null;case 4:return nu(),null;case 10:return hh(f.type._context),null;case 22:case 23:return Pg(),null;case 24:return null;default:return null}}var bg=!1,Ya=!1,Xy=typeof WeakSet=="function"?WeakSet:Set,Cn=null;function Lc(c,f){var y=c.ref;if(y!==null)if(typeof y=="function")try{y(null)}catch(C){yo(c,f,C)}else y.current=null}function wg(c,f,y){try{y()}catch(C){yo(c,f,C)}}var xg=!1;function Yw(c,f){if(Km=Ur,c=Dy(),M0(c)){if("selectionStart"in c)var y={start:c.selectionStart,end:c.selectionEnd};else e:{y=(y=c.ownerDocument)&&y.defaultView||window;var C=y.getSelection&&y.getSelection();if(C&&C.rangeCount!==0){y=C.anchorNode;var O=C.anchorOffset,F=C.focusNode;C=C.focusOffset;try{y.nodeType,F.nodeType}catch{y=null;break e}var de=0,Fe=-1,Ye=-1,Ot=0,dn=0,pn=c,on=null;t:for(;;){for(var Zn;pn!==y||O!==0&&pn.nodeType!==3||(Fe=de+O),pn!==F||C!==0&&pn.nodeType!==3||(Ye=de+C),pn.nodeType===3&&(de+=pn.nodeValue.length),(Zn=pn.firstChild)!==null;)on=pn,pn=Zn;for(;;){if(pn===c)break t;if(on===y&&++Ot===O&&(Fe=de),on===F&&++dn===C&&(Ye=de),(Zn=pn.nextSibling)!==null)break;pn=on,on=pn.parentNode}pn=Zn}y=Fe===-1||Ye===-1?null:{start:Fe,end:Ye}}else y=null}y=y||{start:0,end:0}}else y=null;for(Yl={focusedElem:c,selectionRange:y},Ur=!1,Cn=f;Cn!==null;)if(f=Cn,c=f.child,(f.subtreeFlags&1028)!==0&&c!==null)c.return=f,Cn=c;else for(;Cn!==null;){f=Cn;try{var dr=f.alternate;if(f.flags&1024)switch(f.tag){case 0:case 11:case 15:break;case 1:if(dr!==null){var hr=dr.memoizedProps,ua=dr.memoizedState,wt=f.stateNode,nt=wt.getSnapshotBeforeUpdate(f.elementType===f.type?hr:Mc(f.type,hr),ua);wt.__reactInternalSnapshotBeforeUpdate=nt}break;case 3:var Et=f.stateNode.containerInfo;Et.nodeType===1?Et.textContent="":Et.nodeType===9&&Et.documentElement&&Et.removeChild(Et.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ae(163))}}catch(vn){yo(f,f.return,vn)}if(c=f.sibling,c!==null){c.return=f.return,Cn=c;break}Cn=f.return}return dr=xg,xg=!1,dr}function Oh(c,f,y){var C=f.updateQueue;if(C=C!==null?C.lastEffect:null,C!==null){var O=C=C.next;do{if((O.tag&c)===c){var F=O.destroy;O.destroy=void 0,F!==void 0&&wg(f,y,F)}O=O.next}while(O!==C)}}function _g(c,f){if(f=f.updateQueue,f=f!==null?f.lastEffect:null,f!==null){var y=f=f.next;do{if((y.tag&c)===c){var C=y.create;y.destroy=C()}y=y.next}while(y!==f)}}function hv(c){var f=c.ref;if(f!==null){var y=c.stateNode;switch(c.tag){case 5:c=y;break;default:c=y}typeof f=="function"?f(c):f.current=c}}function mv(c){var f=c.alternate;f!==null&&(c.alternate=null,mv(f)),c.child=null,c.deletions=null,c.sibling=null,c.tag===5&&(f=c.stateNode,f!==null&&(delete f[Xl],delete f[tf],delete f[tp],delete f[lh],delete f[ku])),c.stateNode=null,c.return=null,c.dependencies=null,c.memoizedProps=null,c.memoizedState=null,c.pendingProps=null,c.stateNode=null,c.updateQueue=null}function qi(c){return c.tag===5||c.tag===3||c.tag===4}function ju(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||qi(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function Nh(c,f,y){var C=c.tag;if(C===5||C===6)c=c.stateNode,f?y.nodeType===8?y.parentNode.insertBefore(c,f):y.insertBefore(c,f):(y.nodeType===8?(f=y.parentNode,f.insertBefore(c,y)):(f=y,f.appendChild(c)),y=y._reactRootContainer,y!=null||f.onclick!==null||(f.onclick=Eu));else if(C!==4&&(c=c.child,c!==null))for(Nh(c,f,y),c=c.sibling;c!==null;)Nh(c,f,y),c=c.sibling}function Sg(c,f,y){var C=c.tag;if(C===5||C===6)c=c.stateNode,f?y.insertBefore(c,f):y.appendChild(c);else if(C!==4&&(c=c.child,c!==null))for(Sg(c,f,y),c=c.sibling;c!==null;)Sg(c,f,y),c=c.sibling}var Fa=null,Ki=!1;function Du(c,f,y){for(y=y.child;y!==null;)gv(c,f,y),y=y.sibling}function gv(c,f,y){if(Kt&&typeof Kt.onCommitFiberUnmount=="function")try{Kt.onCommitFiberUnmount(_t,y)}catch{}switch(y.tag){case 5:Ya||Lc(y,f);case 6:var C=Fa,O=Ki;Fa=null,Du(c,f,y),Fa=C,Ki=O,Fa!==null&&(Ki?(c=Fa,y=y.stateNode,c.nodeType===8?c.parentNode.removeChild(y):c.removeChild(y)):Fa.removeChild(y.stateNode));break;case 18:Fa!==null&&(Ki?(c=Fa,y=y.stateNode,c.nodeType===8?z0(c.parentNode,y):c.nodeType===1&&z0(c,y),tn(c)):z0(Fa,y.stateNode));break;case 4:C=Fa,O=Ki,Fa=y.stateNode.containerInfo,Ki=!0,Du(c,f,y),Fa=C,Ki=O;break;case 0:case 11:case 14:case 15:if(!Ya&&(C=y.updateQueue,C!==null&&(C=C.lastEffect,C!==null))){O=C=C.next;do{var F=O,de=F.destroy;F=F.tag,de!==void 0&&(F&2||F&4)&&wg(y,f,de),O=O.next}while(O!==C)}Du(c,f,y);break;case 1:if(!Ya&&(Lc(y,f),C=y.stateNode,typeof C.componentWillUnmount=="function"))try{C.props=y.memoizedProps,C.state=y.memoizedState,C.componentWillUnmount()}catch(Fe){yo(y,f,Fe)}Du(c,f,y);break;case 21:Du(c,f,y);break;case 22:y.mode&1?(Ya=(C=Ya)||y.memoizedState!==null,Du(c,f,y),Ya=C):Du(c,f,y);break;default:Du(c,f,y)}}function hd(c){var f=c.updateQueue;if(f!==null){c.updateQueue=null;var y=c.stateNode;y===null&&(y=c.stateNode=new Xy),f.forEach(function(C){var O=Cv.bind(null,c,C);y.has(C)||(y.add(C),C.then(O,O))})}}function ki(c,f){var y=f.deletions;if(y!==null)for(var C=0;C<y.length;C++){var O=y[C];try{var F=c,de=f,Fe=de;e:for(;Fe!==null;){switch(Fe.tag){case 5:Fa=Fe.stateNode,Ki=!1;break e;case 3:Fa=Fe.stateNode.containerInfo,Ki=!0;break e;case 4:Fa=Fe.stateNode.containerInfo,Ki=!0;break e}Fe=Fe.return}if(Fa===null)throw Error(ae(160));gv(F,de,O),Fa=null,Ki=!1;var Ye=O.alternate;Ye!==null&&(Ye.return=null),O.return=null}catch(Ot){yo(O,f,Ot)}}if(f.subtreeFlags&12854)for(f=f.child;f!==null;)Cg(f,c),f=f.sibling}function Cg(c,f){var y=c.alternate,C=c.flags;switch(c.tag){case 0:case 11:case 14:case 15:if(ki(f,c),Fc(c),C&4){try{Oh(3,c,c.return),_g(3,c)}catch(hr){yo(c,c.return,hr)}try{Oh(5,c,c.return)}catch(hr){yo(c,c.return,hr)}}break;case 1:ki(f,c),Fc(c),C&512&&y!==null&&Lc(y,y.return);break;case 5:if(ki(f,c),Fc(c),C&512&&y!==null&&Lc(y,y.return),c.flags&32){var O=c.stateNode;try{gt(O,"")}catch(hr){yo(c,c.return,hr)}}if(C&4&&(O=c.stateNode,O!=null)){var F=c.memoizedProps,de=y!==null?y.memoizedProps:F,Fe=c.type,Ye=c.updateQueue;if(c.updateQueue=null,Ye!==null)try{Fe==="input"&&F.type==="radio"&&F.name!=null&&kr(O,F),ns(Fe,de);var Ot=ns(Fe,F);for(de=0;de<Ye.length;de+=2){var dn=Ye[de],pn=Ye[de+1];dn==="style"?xr(O,pn):dn==="dangerouslySetInnerHTML"?Tr(O,pn):dn==="children"?gt(O,pn):It(O,dn,pn,Ot)}switch(Fe){case"input":Xn(O,F);break;case"textarea":fs(O,F);break;case"select":var on=O._wrapperState.wasMultiple;O._wrapperState.wasMultiple=!!F.multiple;var Zn=F.value;Zn!=null?bn(O,!!F.multiple,Zn,!1):on!==!!F.multiple&&(F.defaultValue!=null?bn(O,!!F.multiple,F.defaultValue,!0):bn(O,!!F.multiple,F.multiple?[]:"",!1))}O[tf]=F}catch(hr){yo(c,c.return,hr)}}break;case 6:if(ki(f,c),Fc(c),C&4){if(c.stateNode===null)throw Error(ae(162));O=c.stateNode,F=c.memoizedProps;try{O.nodeValue=F}catch(hr){yo(c,c.return,hr)}}break;case 3:if(ki(f,c),Fc(c),C&4&&y!==null&&y.memoizedState.isDehydrated)try{tn(f.containerInfo)}catch(hr){yo(c,c.return,hr)}break;case 4:ki(f,c),Fc(c);break;case 13:ki(f,c),Fc(c),O=c.child,O.flags&8192&&(F=O.memoizedState!==null,O.stateNode.isHidden=F,!F||O.alternate!==null&&O.alternate.memoizedState!==null||(jh=Oe())),C&4&&hd(c);break;case 22:if(dn=y!==null&&y.memoizedState!==null,c.mode&1?(Ya=(Ot=Ya)||dn,ki(f,c),Ya=Ot):ki(f,c),Fc(c),C&8192){if(Ot=c.memoizedState!==null,(c.stateNode.isHidden=Ot)&&!dn&&c.mode&1)for(Cn=c,dn=c.child;dn!==null;){for(pn=Cn=dn;Cn!==null;){switch(on=Cn,Zn=on.child,on.tag){case 0:case 11:case 14:case 15:Oh(4,on,on.return);break;case 1:Lc(on,on.return);var dr=on.stateNode;if(typeof dr.componentWillUnmount=="function"){C=on,y=on.return;try{f=C,dr.props=f.memoizedProps,dr.state=f.memoizedState,dr.componentWillUnmount()}catch(hr){yo(C,y,hr)}}break;case 5:Lc(on,on.return);break;case 22:if(on.memoizedState!==null){yv(pn);continue}}Zn!==null?(Zn.return=on,Cn=Zn):yv(pn)}dn=dn.sibling}e:for(dn=null,pn=c;;){if(pn.tag===5){if(dn===null){dn=pn;try{O=pn.stateNode,Ot?(F=O.style,typeof F.setProperty=="function"?F.setProperty("display","none","important"):F.display="none"):(Fe=pn.stateNode,Ye=pn.memoizedProps.style,de=Ye!=null&&Ye.hasOwnProperty("display")?Ye.display:null,Fe.style.display=Gr("display",de))}catch(hr){yo(c,c.return,hr)}}}else if(pn.tag===6){if(dn===null)try{pn.stateNode.nodeValue=Ot?"":pn.memoizedProps}catch(hr){yo(c,c.return,hr)}}else if((pn.tag!==22&&pn.tag!==23||pn.memoizedState===null||pn===c)&&pn.child!==null){pn.child.return=pn,pn=pn.child;continue}if(pn===c)break e;for(;pn.sibling===null;){if(pn.return===null||pn.return===c)break e;dn===pn&&(dn=null),pn=pn.return}dn===pn&&(dn=null),pn.sibling.return=pn.return,pn=pn.sibling}}break;case 19:ki(f,c),Fc(c),C&4&&hd(c);break;case 21:break;default:ki(f,c),Fc(c)}}function Fc(c){var f=c.flags;if(f&2){try{e:{for(var y=c.return;y!==null;){if(qi(y)){var C=y;break e}y=y.return}throw Error(ae(160))}switch(C.tag){case 5:var O=C.stateNode;C.flags&32&&(gt(O,""),C.flags&=-33);var F=ju(c);Sg(c,F,O);break;case 3:case 4:var de=C.stateNode.containerInfo,Fe=ju(c);Nh(c,Fe,de);break;default:throw Error(ae(161))}}catch(Ye){yo(c,c.return,Ye)}c.flags&=-3}f&4096&&(c.flags&=-4097)}function Zy(c,f,y){Cn=c,vv(c,f,y)}function vv(c,f,y){for(var C=(c.mode&1)!==0;Cn!==null;){var O=Cn,F=O.child;if(O.tag===22&&C){var de=O.memoizedState!==null||bg;if(!de){var Fe=O.alternate,Ye=Fe!==null&&Fe.memoizedState!==null||Ya;Fe=bg;var Ot=Ya;if(bg=de,(Ya=Ye)&&!Ot)for(Cn=O;Cn!==null;)de=Cn,Ye=de.child,de.tag===22&&de.memoizedState!==null?Tg(O):Ye!==null?(Ye.return=de,Cn=Ye):Tg(O);for(;F!==null;)Cn=F,vv(F,f,y),F=F.sibling;Cn=O,bg=Fe,Ya=Ot}Eg(c,f,y)}else O.subtreeFlags&8772&&F!==null?(F.return=O,Cn=F):Eg(c,f,y)}}function Eg(c){for(;Cn!==null;){var f=Cn;if(f.flags&8772){var y=f.alternate;try{if(f.flags&8772)switch(f.tag){case 0:case 11:case 15:Ya||_g(5,f);break;case 1:var C=f.stateNode;if(f.flags&4&&!Ya)if(y===null)C.componentDidMount();else{var O=f.elementType===f.type?y.memoizedProps:Mc(f.type,y.memoizedProps);C.componentDidUpdate(O,y.memoizedState,C.__reactInternalSnapshotBeforeUpdate)}var F=f.updateQueue;F!==null&&G0(f,F,C);break;case 3:var de=f.updateQueue;if(de!==null){if(y=null,f.child!==null)switch(f.child.tag){case 5:y=f.child.stateNode;break;case 1:y=f.child.stateNode}G0(f,de,y)}break;case 5:var Fe=f.stateNode;if(y===null&&f.flags&4){y=Fe;var Ye=f.memoizedProps;switch(f.type){case"button":case"input":case"select":case"textarea":Ye.autoFocus&&y.focus();break;case"img":Ye.src&&(y.src=Ye.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(f.memoizedState===null){var Ot=f.alternate;if(Ot!==null){var dn=Ot.memoizedState;if(dn!==null){var pn=dn.dehydrated;pn!==null&&tn(pn)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(ae(163))}Ya||f.flags&512&&hv(f)}catch(on){yo(f,f.return,on)}}if(f===c){Cn=null;break}if(y=f.sibling,y!==null){y.return=f.return,Cn=y;break}Cn=f.return}}function yv(c){for(;Cn!==null;){var f=Cn;if(f===c){Cn=null;break}var y=f.sibling;if(y!==null){y.return=f.return,Cn=y;break}Cn=f.return}}function Tg(c){for(;Cn!==null;){var f=Cn;try{switch(f.tag){case 0:case 11:case 15:var y=f.return;try{_g(4,f)}catch(Ye){yo(f,y,Ye)}break;case 1:var C=f.stateNode;if(typeof C.componentDidMount=="function"){var O=f.return;try{C.componentDidMount()}catch(Ye){yo(f,O,Ye)}}var F=f.return;try{hv(f)}catch(Ye){yo(f,F,Ye)}break;case 5:var de=f.return;try{hv(f)}catch(Ye){yo(f,de,Ye)}}}catch(Ye){yo(f,f.return,Ye)}if(f===c){Cn=null;break}var Fe=f.sibling;if(Fe!==null){Fe.return=f.return,Cn=Fe;break}Cn=f.return}}var bv=Math.ceil,mp=qe.ReactCurrentDispatcher,Ah=qe.ReactCurrentOwner,ul=qe.ReactCurrentBatchConfig,Xs=0,Xa=null,Pa=null,ca=0,za=0,Cf=Ru(0),Oa=0,md=null,gd=0,Ih=0,Ef=0,vd=null,Ri=null,jh=0,gp=1/0,rc=null,vp=!1,yp=null,sc=null,bp=!1,zc=null,Tf=0,Dh=0,kg=null,Al=-1,Uc=0;function oi(){return Xs&6?Oe():Al!==-1?Al:Al=Oe()}function Mu(c){return c.mode&1?Xs&2&&ca!==0?ca&-ca:Uy.transition!==null?(Uc===0&&(Uc=qs()),Uc):(c=Ar,c!==0||(c=window.event,c=c===void 0?16:mo(c.type)),c):1}function oc(c,f,y,C){if(50<Dh)throw Dh=0,kg=null,Error(ae(185));Ks(c,y,C),(!(Xs&2)||c!==Xa)&&(c===Xa&&(!(Xs&2)&&(Ih|=y),Oa===4&&$u(c,ca)),Ko(c,C),y===1&&Xs===0&&!(f.mode&1)&&(gp=Oe()+500,ld&&Zl()))}function Ko(c,f){var y=c.callbackNode;ys(c,f);var C=_r(c,c===Xa?ca:0);if(C===0)y!==null&&xe(y),c.callbackNode=null,c.callbackPriority=0;else if(f=C&-C,c.callbackPriority!==f){if(y!=null&&xe(y),f===1)c.tag===0?zy(bd.bind(null,c)):B0(bd.bind(null,c)),ih(function(){!(Xs&6)&&Zl()}),y=null;else{switch(bo(C)){case 1:y=et;break;case 4:y=dt;break;case 16:y=bt;break;case 536870912:y=pt;break;default:y=bt}y=Og(y,kf.bind(null,c))}c.callbackPriority=f,c.callbackNode=y}}function kf(c,f){if(Al=-1,Uc=0,Xs&6)throw Error(ae(327));var y=c.callbackNode;if(ai()&&c.callbackNode!==y)return null;var C=_r(c,c===Xa?ca:0);if(C===0)return null;if(C&30||C&c.expiredLanes||f)f=Lh(c,C);else{f=C;var O=Xs;Xs|=2;var F=wp();(Xa!==c||ca!==f)&&(rc=null,gp=Oe()+500,Bc(c,f));do try{Jy();break}catch(Fe){$h(c,Fe)}while(1);ng(),mp.current=F,Xs=O,Pa!==null?f=0:(Xa=null,ca=0,f=Oa)}if(f!==0){if(f===2&&(O=ro(c),O!==0&&(C=O,f=yd(c,O))),f===1)throw y=md,Bc(c,0),$u(c,C),Ko(c,Oe()),y;if(f===6)$u(c,C);else{if(O=c.current.alternate,!(C&30)&&!wv(O)&&(f=Lh(c,C),f===2&&(F=ro(c),F!==0&&(C=F,f=yd(c,F))),f===1))throw y=md,Bc(c,0),$u(c,C),Ko(c,Oe()),y;switch(c.finishedWork=O,c.finishedLanes=C,f){case 0:case 1:throw Error(ae(345));case 2:dl(c,Ri,rc);break;case 3:if($u(c,C),(C&130023424)===C&&(f=jh+500-Oe(),10<f)){if(_r(c,0)!==0)break;if(O=c.suspendedLanes,(O&C)!==C){oi(),c.pingedLanes|=c.suspendedLanes&O;break}c.timeoutHandle=ep(dl.bind(null,c,Ri,rc),f);break}dl(c,Ri,rc);break;case 4:if($u(c,C),(C&4194240)===C)break;for(f=c.eventTimes,O=-1;0<C;){var de=31-hn(C);F=1<<de,de=f[de],de>O&&(O=de),C&=~F}if(C=O,C=Oe()-C,C=(120>C?120:480>C?480:1080>C?1080:1920>C?1920:3e3>C?3e3:4320>C?4320:1960*bv(C/1960))-C,10<C){c.timeoutHandle=ep(dl.bind(null,c,Ri,rc),C);break}dl(c,Ri,rc);break;case 5:dl(c,Ri,rc);break;default:throw Error(ae(329))}}}return Ko(c,Oe()),c.callbackNode===y?kf.bind(null,c):null}function yd(c,f){var y=vd;return c.current.memoizedState.isDehydrated&&(Bc(c,f).flags|=256),c=Lh(c,f),c!==2&&(f=Ri,Ri=y,f!==null&&Mh(f)),c}function Mh(c){Ri===null?Ri=c:Ri.push.apply(Ri,c)}function wv(c){for(var f=c;;){if(f.flags&16384){var y=f.updateQueue;if(y!==null&&(y=y.stores,y!==null))for(var C=0;C<y.length;C++){var O=y[C],F=O.getSnapshot;O=O.value;try{if(!Bi(F(),O))return!1}catch{return!1}}}if(y=f.child,f.subtreeFlags&16384&&y!==null)y.return=f,f=y;else{if(f===c)break;for(;f.sibling===null;){if(f.return===null||f.return===c)return!0;f=f.return}f.sibling.return=f.return,f=f.sibling}}return!0}function $u(c,f){for(f&=~Ef,f&=~Ih,c.suspendedLanes|=f,c.pingedLanes&=~f,c=c.expirationTimes;0<f;){var y=31-hn(f),C=1<<y;c[y]=-1,f&=~C}}function bd(c){if(Xs&6)throw Error(ae(327));ai();var f=_r(c,0);if(!(f&1))return Ko(c,Oe()),null;var y=Lh(c,f);if(c.tag!==0&&y===2){var C=ro(c);C!==0&&(f=C,y=yd(c,C))}if(y===1)throw y=md,Bc(c,0),$u(c,f),Ko(c,Oe()),y;if(y===6)throw Error(ae(345));return c.finishedWork=c.current.alternate,c.finishedLanes=f,dl(c,Ri,rc),Ko(c,Oe()),null}function Rg(c,f){var y=Xs;Xs|=1;try{return c(f)}finally{Xs=y,Xs===0&&(gp=Oe()+500,ld&&Zl())}}function Lu(c){zc!==null&&zc.tag===0&&!(Xs&6)&&ai();var f=Xs;Xs|=1;var y=ul.transition,C=Ar;try{if(ul.transition=null,Ar=1,c)return c()}finally{Ar=C,ul.transition=y,Xs=f,!(Xs&6)&&Zl()}}function Pg(){za=Cf.current,lo(Cf)}function Bc(c,f){c.finishedWork=null,c.finishedLanes=0;var y=c.timeoutHandle;if(y!==-1&&(c.timeoutHandle=-1,Gm(y)),Pa!==null)for(y=Pa.return;y!==null;){var C=y;switch(W0(C),C.tag){case 1:C=C.type.childContextTypes,C!=null&&Ym();break;case 3:nu(),lo(il),lo(Si),fd();break;case 5:ru(C);break;case 4:nu();break;case 13:lo(Zo);break;case 19:lo(Zo);break;case 10:hh(C.type._context);break;case 22:case 23:Pg()}y=y.return}if(Xa=c,Pa=c=Pi(c.current,null),ca=za=f,Oa=0,md=null,Ef=Ih=gd=0,Ri=vd=null,Au!==null){for(f=0;f<Au.length;f++)if(y=Au[f],C=y.interleaved,C!==null){y.interleaved=null;var O=C.next,F=y.pending;if(F!==null){var de=F.next;F.next=O,C.next=de}y.pending=C}Au=null}return c}function $h(c,f){do{var y=Pa;try{if(ng(),Ol.current=bf,hf){for(var C=Jo.memoizedState;C!==null;){var O=C.queue;O!==null&&(O.pending=null),C=C.next}hf=!1}if(cl=0,Ga=Ra=Jo=null,mf=!1,gf=0,Ah.current=null,y===null||y.return===null){Oa=1,md=f,Pa=null;break}e:{var F=c,de=y.return,Fe=y,Ye=f;if(f=ca,Fe.flags|=32768,Ye!==null&&typeof Ye=="object"&&typeof Ye.then=="function"){var Ot=Ye,dn=Fe,pn=dn.tag;if(!(dn.mode&1)&&(pn===0||pn===11||pn===15)){var on=dn.alternate;on?(dn.updateQueue=on.updateQueue,dn.memoizedState=on.memoizedState,dn.lanes=on.lanes):(dn.updateQueue=null,dn.memoizedState=null)}var Zn=cv(de);if(Zn!==null){Zn.flags&=-257,uv(Zn,de,Fe,F,f),Zn.mode&1&&lv(F,Ot,f),f=Zn,Ye=Ot;var dr=f.updateQueue;if(dr===null){var hr=new Set;hr.add(Ye),f.updateQueue=hr}else dr.add(Ye);break e}else{if(!(f&1)){lv(F,Ot,f),Fu();break e}Ye=Error(ae(426))}}else if(Uo&&Fe.mode&1){var ua=cv(de);if(ua!==null){!(ua.flags&65536)&&(ua.flags|=256),uv(ua,de,Fe,F,f),eg(ou(Ye,Fe));break e}}F=Ye=ou(Ye,Fe),Oa!==4&&(Oa=2),vd===null?vd=[F]:vd.push(F),F=de;do{switch(F.tag){case 3:F.flags|=65536,f&=-f,F.lanes|=f;var wt=hg(F,Ye,f);og(F,wt);break e;case 1:Fe=Ye;var nt=F.type,Et=F.stateNode;if(!(F.flags&128)&&(typeof nt.getDerivedStateFromError=="function"||Et!==null&&typeof Et.componentDidCatch=="function"&&(sc===null||!sc.has(Et)))){F.flags|=65536,f&=-f,F.lanes|=f;var vn=wf(F,Fe,f);og(F,vn);break e}}F=F.return}while(F!==null)}Il(y)}catch(yr){f=yr,Pa===y&&y!==null&&(Pa=y=y.return);continue}break}while(1)}function wp(){var c=mp.current;return mp.current=bf,c===null?bf:c}function Fu(){(Oa===0||Oa===3||Oa===2)&&(Oa=4),Xa===null||!(gd&268435455)&&!(Ih&268435455)||$u(Xa,ca)}function Lh(c,f){var y=Xs;Xs|=2;var C=wp();(Xa!==c||ca!==f)&&(rc=null,Bc(c,f));do try{xv();break}catch(O){$h(c,O)}while(1);if(ng(),Xs=y,mp.current=C,Pa!==null)throw Error(ae(261));return Xa=null,ca=0,Oa}function xv(){for(;Pa!==null;)_v(Pa)}function Jy(){for(;Pa!==null&&!Ne();)_v(Pa)}function _v(c){var f=Ev(c.alternate,c,za);c.memoizedProps=c.pendingProps,f===null?Il(c):Pa=f,Ah.current=null}function Il(c){var f=c;do{var y=f.alternate;if(c=f.return,f.flags&32768){if(y=pv(y,f),y!==null){y.flags&=32767,Pa=y;return}if(c!==null)c.flags|=32768,c.subtreeFlags=0,c.deletions=null;else{Oa=6,Pa=null;return}}else if(y=hp(y,f,za),y!==null){Pa=y;return}if(f=f.sibling,f!==null){Pa=f;return}Pa=f=c}while(f!==null);Oa===0&&(Oa=5)}function dl(c,f,y){var C=Ar,O=ul.transition;try{ul.transition=null,Ar=1,au(c,f,y,C)}finally{ul.transition=O,Ar=C}return null}function au(c,f,y,C){do ai();while(zc!==null);if(Xs&6)throw Error(ae(327));y=c.finishedWork;var O=c.finishedLanes;if(y===null)return null;if(c.finishedWork=null,c.finishedLanes=0,y===c.current)throw Error(ae(177));c.callbackNode=null,c.callbackPriority=0;var F=y.lanes|y.childLanes;if(os(c,F),c===Xa&&(Pa=Xa=null,ca=0),!(y.subtreeFlags&2064)&&!(y.flags&2064)||bp||(bp=!0,Og(bt,function(){return ai(),null})),F=(y.flags&15990)!==0,y.subtreeFlags&15990||F){F=ul.transition,ul.transition=null;var de=Ar;Ar=1;var Fe=Xs;Xs|=4,Ah.current=null,Yw(c,y),Cg(y,c),Vw(Yl),Ur=!!Km,Yl=Km=null,c.current=y,Zy(y,c,O),Ee(),Xs=Fe,Ar=de,ul.transition=F}else c.current=y;if(bp&&(bp=!1,zc=c,Tf=O),F=c.pendingLanes,F===0&&(sc=null),fn(y.stateNode,C),Ko(c,Oe()),f!==null)for(C=c.onRecoverableError,y=0;y<f.length;y++)O=f[y],C(O.value,{componentStack:O.stack,digest:O.digest});if(vp)throw vp=!1,c=yp,yp=null,c;return Tf&1&&c.tag!==0&&ai(),F=c.pendingLanes,F&1?c===kg?Dh++:(Dh=0,kg=c):Dh=0,Zl(),null}function ai(){if(zc!==null){var c=bo(Tf),f=ul.transition,y=Ar;try{if(ul.transition=null,Ar=16>c?16:c,zc===null)var C=!1;else{if(c=zc,zc=null,Tf=0,Xs&6)throw Error(ae(331));var O=Xs;for(Xs|=4,Cn=c.current;Cn!==null;){var F=Cn,de=F.child;if(Cn.flags&16){var Fe=F.deletions;if(Fe!==null){for(var Ye=0;Ye<Fe.length;Ye++){var Ot=Fe[Ye];for(Cn=Ot;Cn!==null;){var dn=Cn;switch(dn.tag){case 0:case 11:case 15:Oh(8,dn,F)}var pn=dn.child;if(pn!==null)pn.return=dn,Cn=pn;else for(;Cn!==null;){dn=Cn;var on=dn.sibling,Zn=dn.return;if(mv(dn),dn===Ot){Cn=null;break}if(on!==null){on.return=Zn,Cn=on;break}Cn=Zn}}}var dr=F.alternate;if(dr!==null){var hr=dr.child;if(hr!==null){dr.child=null;do{var ua=hr.sibling;hr.sibling=null,hr=ua}while(hr!==null)}}Cn=F}}if(F.subtreeFlags&2064&&de!==null)de.return=F,Cn=de;else e:for(;Cn!==null;){if(F=Cn,F.flags&2048)switch(F.tag){case 0:case 11:case 15:Oh(9,F,F.return)}var wt=F.sibling;if(wt!==null){wt.return=F.return,Cn=wt;break e}Cn=F.return}}var nt=c.current;for(Cn=nt;Cn!==null;){de=Cn;var Et=de.child;if(de.subtreeFlags&2064&&Et!==null)Et.return=de,Cn=Et;else e:for(de=nt;Cn!==null;){if(Fe=Cn,Fe.flags&2048)try{switch(Fe.tag){case 0:case 11:case 15:_g(9,Fe)}}catch(yr){yo(Fe,Fe.return,yr)}if(Fe===de){Cn=null;break e}var vn=Fe.sibling;if(vn!==null){vn.return=Fe.return,Cn=vn;break e}Cn=Fe.return}}if(Xs=O,Zl(),Kt&&typeof Kt.onPostCommitFiberRoot=="function")try{Kt.onPostCommitFiberRoot(_t,c)}catch{}C=!0}return C}finally{Ar=y,ul.transition=f}}return!1}function Fh(c,f,y){f=ou(y,f),f=hg(c,f,1),c=tc(c,f,1),f=oi(),c!==null&&(Ks(c,1,f),Ko(c,f))}function yo(c,f,y){if(c.tag===3)Fh(c,c,y);else for(;f!==null;){if(f.tag===3){Fh(f,c,y);break}else if(f.tag===1){var C=f.stateNode;if(typeof f.type.getDerivedStateFromError=="function"||typeof C.componentDidCatch=="function"&&(sc===null||!sc.has(C))){c=ou(y,c),c=wf(f,c,1),f=tc(f,c,1),c=oi(),f!==null&&(Ks(f,1,c),Ko(f,c));break}}f=f.return}}function Fs(c,f,y){var C=c.pingCache;C!==null&&C.delete(f),f=oi(),c.pingedLanes|=c.suspendedLanes&y,Xa===c&&(ca&y)===y&&(Oa===4||Oa===3&&(ca&130023424)===ca&&500>Oe()-jh?Bc(c,0):Ef|=y),Ko(c,f)}function wd(c,f){f===0&&(c.mode&1?(f=gr,gr<<=1,!(gr&130023424)&&(gr=4194304)):f=1);var y=oi();c=eu(c,f),c!==null&&(Ks(c,f,y),Ko(c,y))}function Sv(c){var f=c.memoizedState,y=0;f!==null&&(y=f.retryLane),wd(c,y)}function Cv(c,f){var y=0;switch(c.tag){case 13:var C=c.stateNode,O=c.memoizedState;O!==null&&(y=O.retryLane);break;case 19:C=c.stateNode;break;default:throw Error(ae(314))}C!==null&&C.delete(f),wd(c,y)}var Ev;Ev=function(c,f,y){if(c!==null)if(c.memoizedProps!==f.pendingProps||il.current)Ei=!0;else{if(!(c.lanes&y)&&!(f.flags&128))return Ei=!1,Qw(c,f,y);Ei=!!(c.flags&131072)}else Ei=!1,Uo&&f.flags&1048576&&V0(f,Xm,f.index);switch(f.lanes=0,f.tag){case 2:var C=f.type;Sf(c,f),c=f.pendingProps;var O=id(f,Si.current);cd(f,y),O=ap(null,f,C,c,O,y);var F=X0();return f.flags|=1,typeof O=="object"&&O!==null&&typeof O.render=="function"&&O.$$typeof===void 0?(f.tag=1,f.memoizedState=null,f.updateQueue=null,ka(C)?(F=!0,Ic(f)):F=!1,f.memoizedState=O.state!==null&&O.state!==void 0?O.state:null,gh(f),O.updater=zn,f.stateNode=O,O._reactInternals=f,av(f,C,c,y),f=cp(null,f,C,!0,F,y)):(f.tag=0,Uo&&F&&H0(f),gi(null,f,O,y),f=f.child),f;case 16:C=f.elementType;e:{switch(Sf(c,f),c=f.pendingProps,O=C._init,C=O(C._payload),f.type=C,O=f.tag=tb(C),c=Mc(C,c),O){case 0:f=xf(null,f,C,c,y);break e;case 1:f=_f(null,f,C,c,y);break e;case 11:f=Gy(null,f,C,c,y);break e;case 14:f=Qy(null,f,C,Mc(C.type,c),y);break e}throw Error(ae(306,C,""))}return f;case 0:return C=f.type,O=f.pendingProps,O=f.elementType===C?O:Mc(C,O),xf(c,f,C,O,y);case 1:return C=f.type,O=f.pendingProps,O=f.elementType===C?O:Mc(C,O),_f(c,f,C,O,y);case 3:e:{if(kh(f),c===null)throw Error(ae(387));C=f.pendingProps,F=f.memoizedState,O=F.element,vh(c,f),bh(f,C,null,y);var de=f.memoizedState;if(C=de.element,F.isDehydrated)if(F={element:C,isDehydrated:!1,cache:de.cache,pendingSuspenseBoundaries:de.pendingSuspenseBoundaries,transitions:de.transitions},f.updateQueue.baseState=F,f.memoizedState=F,f.flags&256){O=ou(Error(ae(423)),f),f=gg(c,f,C,y,O);break e}else if(C!==O){O=ou(Error(ae(424)),f),f=gg(c,f,C,y,O);break e}else for(Ci=Tu(f.stateNode.containerInfo.firstChild),mi=f,Uo=!0,ec=null,y=tg(f,null,C,y),f.child=y;y;)y.flags=y.flags&-3|4096,y=y.sibling;else{if(df(),C===O){f=Wi(c,f,y);break e}gi(c,f,C,y)}f=f.child}return f;case 5:return Q0(f),c===null&&Zm(f),C=f.type,O=f.pendingProps,F=c!==null?c.memoizedProps:null,de=O.children,Jd(C,O)?de=null:F!==null&&Jd(C,F)&&(f.flags|=32),mg(c,f),gi(c,f,de,y),f.child;case 6:return c===null&&Zm(f),null;case 13:return dv(c,f,y);case 4:return wh(f,f.stateNode.containerInfo),C=f.pendingProps,c===null?f.child=Jc(f,null,C,y):gi(c,f,C,y),f.child;case 11:return C=f.type,O=f.pendingProps,O=f.elementType===C?O:Mc(C,O),Gy(c,f,C,O,y);case 7:return gi(c,f,f.pendingProps,y),f.child;case 8:return gi(c,f,f.pendingProps.children,y),f.child;case 12:return gi(c,f,f.pendingProps.children,y),f.child;case 10:e:{if(C=f.type._context,O=f.pendingProps,F=f.memoizedProps,de=O.value,Co(ph,C._currentValue),C._currentValue=de,F!==null)if(Bi(F.value,de)){if(F.children===O.children&&!il.current){f=Wi(c,f,y);break e}}else for(F=f.child,F!==null&&(F.return=f);F!==null;){var Fe=F.dependencies;if(Fe!==null){de=F.child;for(var Ye=Fe.firstContext;Ye!==null;){if(Ye.context===C){if(F.tag===1){Ye=Ys(-1,y&-y),Ye.tag=2;var Ot=F.updateQueue;if(Ot!==null){Ot=Ot.shared;var dn=Ot.pending;dn===null?Ye.next=Ye:(Ye.next=dn.next,dn.next=Ye),Ot.pending=Ye}}F.lanes|=y,Ye=F.alternate,Ye!==null&&(Ye.lanes|=y),rg(F.return,y,f),Fe.lanes|=y;break}Ye=Ye.next}}else if(F.tag===10)de=F.type===f.type?null:F.child;else if(F.tag===18){if(de=F.return,de===null)throw Error(ae(341));de.lanes|=y,Fe=de.alternate,Fe!==null&&(Fe.lanes|=y),rg(de,y,f),de=F.sibling}else de=F.child;if(de!==null)de.return=F;else for(de=F;de!==null;){if(de===f){de=null;break}if(F=de.sibling,F!==null){F.return=de.return,de=F;break}de=de.return}F=de}gi(c,f,O.children,y),f=f.child}return f;case 9:return O=f.type,C=f.pendingProps.children,cd(f,y),O=Pl(O),C=C(O),f.flags|=1,gi(c,f,C,y),f.child;case 14:return C=f.type,O=Mc(C,f.pendingProps),O=Mc(C.type,O),Qy(c,f,C,O,y);case 15:return Eh(c,f,f.type,f.pendingProps,y);case 17:return C=f.type,O=f.pendingProps,O=f.elementType===C?O:Mc(C,O),Sf(c,f),f.tag=1,ka(C)?(c=!0,Ic(f)):c=!1,cd(f,y),qy(f,C,O),av(f,C,O,y),cp(null,f,C,!0,c,y);case 19:return yg(c,f,y);case 22:return Th(c,f,y)}throw Error(ae(156,f.tag))};function Og(c,f){return X(c,f)}function eb(c,f,y,C){this.tag=c,this.key=y,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=f,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=C,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ii(c,f,y,C){return new eb(c,f,y,C)}function Ng(c){return c=c.prototype,!(!c||!c.isReactComponent)}function tb(c){if(typeof c=="function")return Ng(c)?1:0;if(c!=null){if(c=c.$$typeof,c===je)return 11;if(c===qt)return 14}return 2}function Pi(c,f){var y=c.alternate;return y===null?(y=ii(c.tag,f,c.key,c.mode),y.elementType=c.elementType,y.type=c.type,y.stateNode=c.stateNode,y.alternate=c,c.alternate=y):(y.pendingProps=f,y.type=c.type,y.flags=0,y.subtreeFlags=0,y.deletions=null),y.flags=c.flags&14680064,y.childLanes=c.childLanes,y.lanes=c.lanes,y.child=c.child,y.memoizedProps=c.memoizedProps,y.memoizedState=c.memoizedState,y.updateQueue=c.updateQueue,f=c.dependencies,y.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext},y.sibling=c.sibling,y.index=c.index,y.ref=c.ref,y}function xd(c,f,y,C,O,F){var de=2;if(C=c,typeof c=="function")Ng(c)&&(de=1);else if(typeof c=="string")de=5;else e:switch(c){case Xe:return zu(y.children,O,F,f);case Ft:de=8,O|=8;break;case rn:return c=ii(12,y,f,O|2),c.elementType=rn,c.lanes=F,c;case De:return c=ii(13,y,f,O),c.elementType=De,c.lanes=F,c;case ct:return c=ii(19,y,f,O),c.elementType=ct,c.lanes=F,c;case He:return iu(y,O,F,f);default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case Vt:de=10;break e;case ze:de=9;break e;case je:de=11;break e;case qt:de=14;break e;case z:de=16,C=null;break e}throw Error(ae(130,c==null?c:typeof c,""))}return f=ii(de,y,f,O),f.elementType=c,f.type=C,f.lanes=F,f}function zu(c,f,y,C){return c=ii(7,c,C,f),c.lanes=y,c}function iu(c,f,y,C){return c=ii(22,c,C,f),c.elementType=He,c.lanes=y,c.stateNode={isHidden:!1},c}function Rf(c,f,y){return c=ii(6,c,null,f),c.lanes=y,c}function Gi(c,f,y){return f=ii(4,c.children!==null?c.children:[],c.key,f),f.lanes=y,f.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},f}function zh(c,f,y,C,O){this.tag=f,this.containerInfo=c,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=hs(0),this.expirationTimes=hs(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=hs(0),this.identifierPrefix=C,this.onRecoverableError=O,this.mutableSourceEagerHydrationData=null}function xp(c,f,y,C,O,F,de,Fe,Ye){return c=new zh(c,f,y,Fe,Ye),f===1?(f=1,F===!0&&(f|=8)):f=0,F=ii(3,null,null,f),c.current=F,F.stateNode=c,F.memoizedState={element:C,isDehydrated:y,cache:null,transitions:null,pendingSuspenseBoundaries:null},gh(F),c}function Uh(c,f,y){var C=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ut,key:C==null?null:""+C,children:c,containerInfo:f,implementation:y}}function Bh(c){if(!c)return od;c=c._reactInternals;e:{if(le(c)!==c||c.tag!==1)throw Error(ae(170));var f=c;do{switch(f.tag){case 3:f=f.stateNode.context;break e;case 1:if(ka(f.type)){f=f.stateNode.__reactInternalMemoizedMergedChildContext;break e}}f=f.return}while(f!==null);throw Error(ae(171))}if(c.tag===1){var y=c.type;if(ka(y))return ch(c,y,f)}return f}function Uu(c,f,y,C,O,F,de,Fe,Ye){return c=xp(y,C,!0,c,O,F,de,Fe,Ye),c.context=Bh(null),y=c.current,C=oi(),O=Mu(y),F=Ys(C,O),F.callback=f??null,tc(y,F,O),c.current.lanes=O,Ks(c,O,C),Ko(c,C),c}function _p(c,f,y,C){var O=f.current,F=oi(),de=Mu(O);return y=Bh(y),f.context===null?f.context=y:f.pendingContext=y,f=Ys(F,de),f.payload={element:c},C=C===void 0?null:C,C!==null&&(f.callback=C),c=tc(O,f,de),c!==null&&(oc(c,O,de,F),yh(c,O,de)),de}function Vh(c){if(c=c.current,!c.child)return null;switch(c.child.tag){case 5:return c.child.stateNode;default:return c.child.stateNode}}function Ag(c,f){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var y=c.retryLane;c.retryLane=y!==0&&y<f?y:f}}function fl(c,f){Ag(c,f),(c=c.alternate)&&Ag(c,f)}function Ig(){return null}var Oi=typeof reportError=="function"?reportError:function(c){console.error(c)};function jg(c){this._internalRoot=c}Pf.prototype.render=jg.prototype.render=function(c){var f=this._internalRoot;if(f===null)throw Error(ae(409));_p(c,f,null,null)},Pf.prototype.unmount=jg.prototype.unmount=function(){var c=this._internalRoot;if(c!==null){this._internalRoot=null;var f=c.containerInfo;Lu(function(){_p(null,c,null,null)}),f[Ss]=null}};function Pf(c){this._internalRoot=c}Pf.prototype.unstable_scheduleHydration=function(c){if(c){var f=Ka();c={blockedOn:null,target:c,priority:f};for(var y=0;y<I.length&&f!==0&&f<I[y].priority;y++);I.splice(y,0,c),y===0&&yu(c)}};function Tv(c){return!(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11)}function Of(c){return!(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11&&(c.nodeType!==8||c.nodeValue!==" react-mount-point-unstable "))}function Dg(){}function Xw(c,f,y,C,O){if(O){if(typeof C=="function"){var F=C;C=function(){var Ot=Vh(de);F.call(Ot)}}var de=Uu(f,C,c,0,null,!1,!1,"",Dg);return c._reactRootContainer=de,c[Ss]=de.current,ah(c.nodeType===8?c.parentNode:c),Lu(),de}for(;O=c.lastChild;)c.removeChild(O);if(typeof C=="function"){var Fe=C;C=function(){var Ot=Vh(Ye);Fe.call(Ot)}}var Ye=xp(c,0,!1,null,null,!1,!1,"",Dg);return c._reactRootContainer=Ye,c[Ss]=Ye.current,ah(c.nodeType===8?c.parentNode:c),Lu(function(){_p(f,Ye,y,C)}),Ye}function Hh(c,f,y,C,O){var F=y._reactRootContainer;if(F){var de=F;if(typeof O=="function"){var Fe=O;O=function(){var Ye=Vh(de);Fe.call(Ye)}}_p(f,de,c,O)}else de=Xw(y,f,c,O,C);return Vh(de)}io=function(c){switch(c.tag){case 3:var f=c.stateNode;if(f.current.memoizedState.isDehydrated){var y=er(f.pendingLanes);y!==0&&(Gs(f,y|1),Ko(f,Oe()),!(Xs&6)&&(gp=Oe()+500,Zl()))}break;case 13:Lu(function(){var C=eu(c,1);if(C!==null){var O=oi();oc(C,c,1,O)}}),fl(c,1)}},ho=function(c){if(c.tag===13){var f=eu(c,134217728);if(f!==null){var y=oi();oc(f,c,134217728,y)}fl(c,134217728)}},$o=function(c){if(c.tag===13){var f=Mu(c),y=eu(c,f);if(y!==null){var C=oi();oc(y,c,f,C)}fl(c,f)}},Ka=function(){return Ar},ei=function(c,f){var y=Ar;try{return Ar=c,f()}finally{Ar=y}},_o=function(c,f,y){switch(f){case"input":if(Xn(c,y),f=y.name,y.type==="radio"&&f!=null){for(y=c;y.parentNode;)y=y.parentNode;for(y=y.querySelectorAll("input[name="+JSON.stringify(""+f)+'][type="radio"]'),f=0;f<y.length;f++){var C=y[f];if(C!==c&&C.form===c.form){var O=sf(C);if(!O)throw Error(ae(90));rt(C),Xn(C,O)}}}break;case"textarea":fs(c,y);break;case"select":f=y.value,f!=null&&bn(c,!!y.multiple,f,!1)}},Dr=Rg,Vs=Lu;var ac={usingClientEntryPoint:!1,Events:[rf,np,sf,jr,Dn,Rg]},_d={findFiberByHostInstance:nf,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Mg={bundleType:_d.bundleType,version:_d.version,rendererPackageName:_d.rendererPackageName,rendererConfig:_d.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:qe.ReactCurrentDispatcher,findHostInstanceByFiber:function(c){return c=_e(c),c===null?null:c.stateNode},findFiberByHostInstance:_d.findFiberByHostInstance||Ig,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Nf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Nf.isDisabled&&Nf.supportsFiber)try{_t=Nf.inject(Mg),Kt=Nf}catch{}}l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ac,l.createPortal=function(c,f){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Tv(f))throw Error(ae(200));return Uh(c,f,null,y)},l.createRoot=function(c,f){if(!Tv(c))throw Error(ae(299));var y=!1,C="",O=Oi;return f!=null&&(f.unstable_strictMode===!0&&(y=!0),f.identifierPrefix!==void 0&&(C=f.identifierPrefix),f.onRecoverableError!==void 0&&(O=f.onRecoverableError)),f=xp(c,1,!1,null,null,y,!1,C,O),c[Ss]=f.current,ah(c.nodeType===8?c.parentNode:c),new jg(f)},l.findDOMNode=function(c){if(c==null)return null;if(c.nodeType===1)return c;var f=c._reactInternals;if(f===void 0)throw typeof c.render=="function"?Error(ae(188)):(c=Object.keys(c).join(","),Error(ae(268,c)));return c=_e(f),c=c===null?null:c.stateNode,c},l.flushSync=function(c){return Lu(c)},l.hydrate=function(c,f,y){if(!Of(f))throw Error(ae(200));return Hh(null,c,f,!0,y)},l.hydrateRoot=function(c,f,y){if(!Tv(c))throw Error(ae(405));var C=y!=null&&y.hydratedSources||null,O=!1,F="",de=Oi;if(y!=null&&(y.unstable_strictMode===!0&&(O=!0),y.identifierPrefix!==void 0&&(F=y.identifierPrefix),y.onRecoverableError!==void 0&&(de=y.onRecoverableError)),f=Uu(f,null,c,1,y??null,O,!1,F,de),c[Ss]=f.current,ah(c),C)for(c=0;c<C.length;c++)y=C[c],O=y._getVersion,O=O(y._source),f.mutableSourceEagerHydrationData==null?f.mutableSourceEagerHydrationData=[y,O]:f.mutableSourceEagerHydrationData.push(y,O);return new Pf(f)},l.render=function(c,f,y){if(!Of(f))throw Error(ae(200));return Hh(null,c,f,!1,y)},l.unmountComponentAtNode=function(c){if(!Of(c))throw Error(ae(40));return c._reactRootContainer?(Lu(function(){Hh(null,null,c,!1,function(){c._reactRootContainer=null,c[Ss]=null})}),!0):!1},l.unstable_batchedUpdates=Rg,l.unstable_renderSubtreeIntoContainer=function(c,f,y,C){if(!Of(y))throw Error(ae(200));if(c==null||c._reactInternals===void 0)throw Error(ae(38));return Hh(c,f,y,!1,C)},l.version="18.3.1-next-f1338f8080-20240426"},9580:(a,l,se)=>{"use strict";var we=se(2963);if(!0)l.createRoot=we.createRoot,l.hydrateRoot=we.hydrateRoot;else var Te},2963:(a,l,se)=>{"use strict";function we(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(we)}catch(Te){console.error(Te)}}we(),a.exports=se(7925)},4841:a=>{var l=typeof Element<"u",se=typeof Map=="function",we=typeof Set=="function",Te=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function ae(ie,W){if(ie===W)return!0;if(ie&&W&&typeof ie=="object"&&typeof W=="object"){if(ie.constructor!==W.constructor)return!1;var ee,q,Z;if(Array.isArray(ie)){if(ee=ie.length,ee!=W.length)return!1;for(q=ee;q--!==0;)if(!ae(ie[q],W[q]))return!1;return!0}var U;if(se&&ie instanceof Map&&W instanceof Map){if(ie.size!==W.size)return!1;for(U=ie.entries();!(q=U.next()).done;)if(!W.has(q.value[0]))return!1;for(U=ie.entries();!(q=U.next()).done;)if(!ae(q.value[1],W.get(q.value[0])))return!1;return!0}if(we&&ie instanceof Set&&W instanceof Set){if(ie.size!==W.size)return!1;for(U=ie.entries();!(q=U.next()).done;)if(!W.has(q.value[0]))return!1;return!0}if(Te&&ArrayBuffer.isView(ie)&&ArrayBuffer.isView(W)){if(ee=ie.length,ee!=W.length)return!1;for(q=ee;q--!==0;)if(ie[q]!==W[q])return!1;return!0}if(ie.constructor===RegExp)return ie.source===W.source&&ie.flags===W.flags;if(ie.valueOf!==Object.prototype.valueOf&&typeof ie.valueOf=="function"&&typeof W.valueOf=="function")return ie.valueOf()===W.valueOf();if(ie.toString!==Object.prototype.toString&&typeof ie.toString=="function"&&typeof W.toString=="function")return ie.toString()===W.toString();if(Z=Object.keys(ie),ee=Z.length,ee!==Object.keys(W).length)return!1;for(q=ee;q--!==0;)if(!Object.prototype.hasOwnProperty.call(W,Z[q]))return!1;if(l&&ie instanceof Element)return!1;for(q=ee;q--!==0;)if(!((Z[q]==="_owner"||Z[q]==="__v"||Z[q]==="__o")&&ie.$$typeof)&&!ae(ie[Z[q]],W[Z[q]]))return!1;return!0}return ie!==ie&&W!==W}a.exports=function(W,ee){try{return ae(W,ee)}catch(q){if((q.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw q}}},8861:(a,l)=>{"use strict";var se;/**
 * @license React
 * react-is.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var we=Symbol.for("react.element"),Te=Symbol.for("react.portal"),ae=Symbol.for("react.fragment"),ie=Symbol.for("react.strict_mode"),W=Symbol.for("react.profiler"),ee=Symbol.for("react.provider"),q=Symbol.for("react.context"),Z=Symbol.for("react.server_context"),U=Symbol.for("react.forward_ref"),ge=Symbol.for("react.suspense"),ne=Symbol.for("react.suspense_list"),ve=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),te=Symbol.for("react.offscreen"),Re;Re=Symbol.for("react.module.reference");function Ie($e){if(typeof $e=="object"&&$e!==null){var vt=$e.$$typeof;switch(vt){case we:switch($e=$e.type,$e){case ae:case W:case ie:case ge:case ne:return $e;default:switch($e=$e&&$e.$$typeof,$e){case Z:case q:case U:case V:case ve:case ee:return $e;default:return vt}}case Te:return vt}}}se=q,se=ee,se=we,se=U,se=ae,se=V,se=ve,se=Te,se=W,se=ie,se=ge,se=ne,se=function(){return!1},se=function(){return!1},se=function($e){return Ie($e)===q},se=function($e){return Ie($e)===ee},se=function($e){return typeof $e=="object"&&$e!==null&&$e.$$typeof===we},se=function($e){return Ie($e)===U},se=function($e){return Ie($e)===ae},se=function($e){return Ie($e)===V},se=function($e){return Ie($e)===ve},se=function($e){return Ie($e)===Te},se=function($e){return Ie($e)===W},se=function($e){return Ie($e)===ie},se=function($e){return Ie($e)===ge},se=function($e){return Ie($e)===ne},se=function($e){return typeof $e=="string"||typeof $e=="function"||$e===ae||$e===W||$e===ie||$e===ge||$e===ne||$e===te||typeof $e=="object"&&$e!==null&&($e.$$typeof===V||$e.$$typeof===ve||$e.$$typeof===ee||$e.$$typeof===q||$e.$$typeof===U||$e.$$typeof===Re||$e.getModuleId!==void 0)},se=Ie},9249:(a,l,se)=>{"use strict";se(8861)},4044:function(a,l,se){(function(we,Te){Te(l,se(6194))})(this,function(we,Te){"use strict";var ae="default"in Te?Te.default:Te;function ie(vt){return(ie=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(mt){return typeof mt}:function(mt){return mt&&typeof Symbol=="function"&&mt.constructor===Symbol&&mt!==Symbol.prototype?"symbol":typeof mt})(vt)}function W(vt,mt){for(var It=0;It<mt.length;It++){var qe=mt[It];qe.enumerable=qe.enumerable||!1,qe.configurable=!0,"value"in qe&&(qe.writable=!0),Object.defineProperty(vt,qe.key,qe)}}function ee(vt,mt,It){return mt in vt?Object.defineProperty(vt,mt,{value:It,enumerable:!0,configurable:!0,writable:!0}):vt[mt]=It,vt}function q(vt){return(q=Object.setPrototypeOf?Object.getPrototypeOf:function(mt){return mt.__proto__||Object.getPrototypeOf(mt)})(vt)}function Z(vt,mt){return(Z=Object.setPrototypeOf||function(It,qe){return It.__proto__=qe,It})(vt,mt)}function U(vt){if(vt===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return vt}function ge(vt){var mt=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var It,qe=q(vt);return It=mt?(It=q(this).constructor,Reflect.construct(qe,arguments,It)):qe.apply(this,arguments),qe=this,!(It=It)||typeof It!="object"&&typeof It!="function"?U(qe):It}}function ne(vt,mt){var It,qe=(mt=mt===void 0?{}:mt).insertAt;vt&&typeof document<"u"&&(It=document.head||document.getElementsByTagName("head")[0],(mt=document.createElement("style")).type="text/css",qe==="top"&&It.firstChild?It.insertBefore(mt,It.firstChild):It.appendChild(mt),mt.styleSheet?mt.styleSheet.cssText=vt:mt.appendChild(document.createTextNode(vt)))}var ve={animated:"rsw_1z",fadeInRight:"rsw_1M",fadeInLeft:"rsw_19",fadeOutRight:"rsw_3C",fadeOutLeft:"rsw_1u"};ne(`/**
 * Snippets from animate.css
 * Credit goes to https://github.com/daneden
 * github.com/daneden/animate.css
*/
.rsw_1z {
  -webkit-animation-duration: .8192s;
  animation-duration: .8192s;
  -webkit-animation-fill-mode: backwards;
  animation-fill-mode: backwards;
}

/** fadeInRight */
@-webkit-keyframes rsw_1M {
  from {
    opacity: 0;
    -webkit-transform: translate3d(100%, 0, 0);
    transform: translate3d(100%, 0, 0);
  }

  to {
    opacity: 1;
    -webkit-transform: none;
    transform: none;
  }
}

@keyframes rsw_1M {
  from {
    opacity: 0;
    -webkit-transform: translate3d(100%, 0, 0);
    transform: translate3d(100%, 0, 0);
  }

  to {
    opacity: 1;
    -webkit-transform: none;
    transform: none;
  }
}

.rsw_1M {
  -webkit-animation-name: rsw_1M;
  animation-name: rsw_1M;
}

/** fadeInLeft */
@-webkit-keyframes rsw_19 {
  from {
    opacity: 0;
    -webkit-transform: translate3d(-100%, 0, 0);
    transform: translate3d(-100%, 0, 0);
  }

  to {
    opacity: 1;
    -webkit-transform: none;
    transform: none;
  }
}

@keyframes rsw_19 {
  from {
    opacity: 0;
    -webkit-transform: translate3d(-100%, 0, 0);
    transform: translate3d(-100%, 0, 0);
  }

  to {
    opacity: 1;
    -webkit-transform: none;
    transform: none;
  }
}

.rsw_19 {
  -webkit-animation-name: rsw_19;
  animation-name: rsw_19;
}

/** fadeOutRight */
@-webkit-keyframes rsw_3C {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
    -webkit-transform: translate3d(100%, 0, 0);
    transform: translate3d(100%, 0, 0);
  }
}

@keyframes rsw_3C {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
    -webkit-transform: translate3d(100%, 0, 0);
    transform: translate3d(100%, 0, 0);
  }
}

.rsw_3C {
  -webkit-animation-name: rsw_3C;
  animation-name: rsw_3C;
}

/** fadeOutLeft */
@-webkit-keyframes rsw_1u {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
    -webkit-transform: translate3d(-100%, 0, 0);
    transform: translate3d(-100%, 0, 0);
  }
}

@keyframes rsw_1u {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
    -webkit-transform: translate3d(-100%, 0, 0);
    transform: translate3d(-100%, 0, 0);
  }
}

.rsw_1u {
  -webkit-animation-name: rsw_1u;
  animation-name: rsw_1u;
}
`);var V="rsw_2Y",te="rsw_2f",Re="rsw_3G";ne(`/** Step Wizard */
.rsw_2Y {
    position: relative;
}

.rsw_2f {
    opacity: 0;
    pointer-events: none;
    position: absolute;
    top: 0;
    width: 100%;
    z-index: 0;
}

.rsw_3G {
    opacity: 1;
    pointer-events: inherit;
    position: relative;
    z-index: 1;
}
`);var Ie=function(){(function(Ut,Xe){if(typeof Xe!="function"&&Xe!==null)throw new TypeError("Super expression must either be null or a function");Ut.prototype=Object.create(Xe&&Xe.prototype,{constructor:{value:Ut,writable:!0,configurable:!0}}),Xe&&Z(Ut,Xe)})(nn,Te.PureComponent);var vt,mt,It,qe=ge(nn);function nn(Ut){var Xe;return function(Ft,rn){if(!(Ft instanceof rn))throw new TypeError("Cannot call a class as a function")}(this,nn),ee(U(Xe=qe.call(this,Ut)),"initialState",function(){var Ft={activeStep:0,classes:{},hashKeys:{},namedSteps:{}},rn=(typeof window>"u"?"undefined":ie(window))==="object"?Xe.getHash():"",Vt=Xe.getSteps();Vt.forEach(function(je,De){Ft.hashKeys[De]=je.props&&je.props.hashKey||"step".concat(De+1),Ft.hashKeys[Ft.hashKeys[De]]=De,Ft.namedSteps[De]=je.props&&je.props.stepName||"step".concat(De+1),Ft.namedSteps[Ft.namedSteps[De]]=De});var ze=Xe.props.initialStep-1;return ze&&Vt[ze]&&(Ft.activeStep=ze),Xe.props.isHashEnabled&&rn&&Ft.hashKeys[rn]!==void 0&&(Ft.activeStep=Ft.hashKeys[rn]),Xe.props.transitions&&(Ft.classes[Ft.activeStep]=Xe.props.transitions.intro||""),Ft}),ee(U(Xe),"getHash",function(){return decodeURI(window.location.hash).replace(/^#/,"")}),ee(U(Xe),"getTransitions",function(){return Xe.props.transitions||{enterRight:"".concat(ve.animated," ").concat(ve.fadeInRight),enterLeft:"".concat(ve.animated," ").concat(ve.fadeInLeft),exitRight:"".concat(ve.animated," ").concat(ve.fadeOutRight),exitLeft:"".concat(ve.animated," ").concat(ve.fadeOutLeft)}}),ee(U(Xe),"onHashChange",function(){Xe.setActiveStep(Xe.state.hashKeys[Xe.getHash()]||0)}),ee(U(Xe),"isInvalidStep",function(Ft){return Ft<0||Ft>=Xe.totalSteps}),ee(U(Xe),"setActiveStep",function(Ft){var rn,Vt,ze=Xe.state.activeStep;ze!==Ft&&(Xe.isInvalidStep(Ft)||(rn=Xe.state.classes,Vt=Xe.getTransitions(),ze<Ft?(rn[ze]=Vt.exitLeft,rn[Ft]=Vt.enterRight):(rn[ze]=Vt.exitRight,rn[Ft]=Vt.enterLeft),Xe.setState({activeStep:Ft,classes:rn},function(){Xe.onStepChange({previousStep:ze+1,activeStep:Ft+1})})))}),ee(U(Xe),"onStepChange",function(Ft){Xe.props.onStepChange(Ft),Xe.props.isHashEnabled&&Xe.updateHash(Xe.state.activeStep)}),ee(U(Xe),"getSteps",function(){return ae.Children.toArray(Xe.props.children)}),ee(U(Xe),"firstStep",function(){return Xe.goToStep(1)}),ee(U(Xe),"lastStep",function(){return Xe.goToStep(Xe.totalSteps)}),ee(U(Xe),"nextStep",function(){return Xe.setActiveStep(Xe.state.activeStep+1)}),ee(U(Xe),"previousStep",function(){return Xe.setActiveStep(Xe.state.activeStep-1)}),ee(U(Xe),"goToStep",function(Ft){Xe.props.isHashEnabled&&typeof Ft=="string"&&Xe.state.hashKeys[Ft]!==void 0?Xe.setActiveStep(Xe.state.hashKeys[Ft]):Xe.setActiveStep(Ft-1)}),ee(U(Xe),"goToNamedStep",function(Ft){typeof Ft=="string"&&Xe.state.namedSteps[Ft]!==void 0?Xe.setActiveStep(Xe.state.namedSteps[Ft]):console.error('Cannot find step with name "'.concat(Ft,'"'))}),ee(U(Xe),"updateHash",function(Ft){window.location.hash=Xe.state.hashKeys[Ft]}),ee(U(Xe),"isReactComponent",function(Ft){return Ft=Ft.type,typeof Ft=="function"||ie(Ft)==="object"}),Xe.state=Xe.initialState(),Xe}return vt=nn,(mt=[{key:"componentDidMount",value:function(){this.props.isHashEnabled&&window.addEventListener("hashchange",this.onHashChange),this.props.instance(this)}},{key:"componentWillUnmount",value:function(){this.props.isHashEnabled&&window.removeEventListener("hashchange",this.onHashChange)}},{key:"currentStep",get:function(){return this.state.activeStep+1}},{key:"totalSteps",get:function(){return this.getSteps().length}},{key:"render",value:function(){var Ut=this,Xe={currentStep:this.currentStep,totalSteps:this.totalSteps,nextStep:this.nextStep,previousStep:this.previousStep,goToStep:this.goToStep,goToNamedStep:this.goToNamedStep,firstStep:this.firstStep,lastStep:this.lastStep},Ft=this.state.classes,rn=ae.Children.map(this.getSteps(),function(Vt,ze){return Vt?(Xe.isActive=ze===Ut.state.activeStep,Xe.transitions=Ft[ze],!Ut.props.isLazyMount||Ut.props.isLazyMount&&Xe.isActive?ae.createElement($e,Xe,Ut.isReactComponent(Vt)?ae.cloneElement(Vt,Xe):Vt):null):null});return ae.createElement("div",{className:this.props.className},this.props.nav&&ae.cloneElement(this.props.nav,Xe),ae.createElement("div",{className:V},rn))}}])&&W(vt.prototype,mt),It&&W(vt,It),nn}();Ie.defaultProps={children:[],className:null,initialStep:1,instance:function(){},isHashEnabled:!1,isLazyMount:!1,nav:null,onStepChange:function(){},transitions:void 0};var $e=function(qe){var mt=qe.children,It=qe.isActive,qe=qe.transitions;return ae.createElement("div",{className:"".concat(te," ").concat(qe," ").concat(It?Re:"").trim()},mt)};$e.defaultProps={children:[],isActive:!1,transitions:""},we.Step=$e,we.default=Ie,Object.defineProperty(we,"__esModule",{value:!0})})},1634:(a,l,se)=>{"use strict";/**
 * @license React
 * react-jsx-runtime.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var we=se(6194),Te=Symbol.for("react.element"),ae=Symbol.for("react.fragment"),ie=Object.prototype.hasOwnProperty,W=we.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,ee={key:!0,ref:!0,__self:!0,__source:!0};function q(Z,U,ge){var ne,ve={},V=null,te=null;ge!==void 0&&(V=""+ge),U.key!==void 0&&(V=""+U.key),U.ref!==void 0&&(te=U.ref);for(ne in U)ie.call(U,ne)&&!ee.hasOwnProperty(ne)&&(ve[ne]=U[ne]);if(Z&&Z.defaultProps)for(ne in U=Z.defaultProps,U)ve[ne]===void 0&&(ve[ne]=U[ne]);return{$$typeof:Te,type:Z,key:V,ref:te,props:ve,_owner:W.current}}l.Fragment=ae,l.jsx=q,l.jsxs=q},9165:(a,l)=>{"use strict";/**
 * @license React
 * react.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var se=Symbol.for("react.element"),we=Symbol.for("react.portal"),Te=Symbol.for("react.fragment"),ae=Symbol.for("react.strict_mode"),ie=Symbol.for("react.profiler"),W=Symbol.for("react.provider"),ee=Symbol.for("react.context"),q=Symbol.for("react.forward_ref"),Z=Symbol.for("react.suspense"),U=Symbol.for("react.memo"),ge=Symbol.for("react.lazy"),ne=Symbol.iterator;function ve(Pe){return Pe===null||typeof Pe!="object"?null:(Pe=ne&&Pe[ne]||Pe["@@iterator"],typeof Pe=="function"?Pe:null)}var V={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},te=Object.assign,Re={};function Ie(Pe,yt,un){this.props=Pe,this.context=yt,this.refs=Re,this.updater=un||V}Ie.prototype.isReactComponent={},Ie.prototype.setState=function(Pe,yt){if(typeof Pe!="object"&&typeof Pe!="function"&&Pe!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,Pe,yt,"setState")},Ie.prototype.forceUpdate=function(Pe){this.updater.enqueueForceUpdate(this,Pe,"forceUpdate")};function $e(){}$e.prototype=Ie.prototype;function vt(Pe,yt,un){this.props=Pe,this.context=yt,this.refs=Re,this.updater=un||V}var mt=vt.prototype=new $e;mt.constructor=vt,te(mt,Ie.prototype),mt.isPureReactComponent=!0;var It=Array.isArray,qe=Object.prototype.hasOwnProperty,nn={current:null},Ut={key:!0,ref:!0,__self:!0,__source:!0};function Xe(Pe,yt,un){var Rn,Yn={},nr=null,rr=null;if(yt!=null)for(Rn in yt.ref!==void 0&&(rr=yt.ref),yt.key!==void 0&&(nr=""+yt.key),yt)qe.call(yt,Rn)&&!Ut.hasOwnProperty(Rn)&&(Yn[Rn]=yt[Rn]);var ar=arguments.length-2;if(ar===1)Yn.children=un;else if(1<ar){for(var wr=Array(ar),Ts=0;Ts<ar;Ts++)wr[Ts]=arguments[Ts+2];Yn.children=wr}if(Pe&&Pe.defaultProps)for(Rn in ar=Pe.defaultProps,ar)Yn[Rn]===void 0&&(Yn[Rn]=ar[Rn]);return{$$typeof:se,type:Pe,key:nr,ref:rr,props:Yn,_owner:nn.current}}function Ft(Pe,yt){return{$$typeof:se,type:Pe.type,key:yt,ref:Pe.ref,props:Pe.props,_owner:Pe._owner}}function rn(Pe){return typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===se}function Vt(Pe){var yt={"=":"=0",":":"=2"};return"$"+Pe.replace(/[=:]/g,function(un){return yt[un]})}var ze=/\/+/g;function je(Pe,yt){return typeof Pe=="object"&&Pe!==null&&Pe.key!=null?Vt(""+Pe.key):yt.toString(36)}function De(Pe,yt,un,Rn,Yn){var nr=typeof Pe;(nr==="undefined"||nr==="boolean")&&(Pe=null);var rr=!1;if(Pe===null)rr=!0;else switch(nr){case"string":case"number":rr=!0;break;case"object":switch(Pe.$$typeof){case se:case we:rr=!0}}if(rr)return rr=Pe,Yn=Yn(rr),Pe=Rn===""?"."+je(rr,0):Rn,It(Yn)?(un="",Pe!=null&&(un=Pe.replace(ze,"$&/")+"/"),De(Yn,yt,un,"",function(Ts){return Ts})):Yn!=null&&(rn(Yn)&&(Yn=Ft(Yn,un+(!Yn.key||rr&&rr.key===Yn.key?"":(""+Yn.key).replace(ze,"$&/")+"/")+Pe)),yt.push(Yn)),1;if(rr=0,Rn=Rn===""?".":Rn+":",It(Pe))for(var ar=0;ar<Pe.length;ar++){nr=Pe[ar];var wr=Rn+je(nr,ar);rr+=De(nr,yt,un,wr,Yn)}else if(wr=ve(Pe),typeof wr=="function")for(Pe=wr.call(Pe),ar=0;!(nr=Pe.next()).done;)nr=nr.value,wr=Rn+je(nr,ar++),rr+=De(nr,yt,un,wr,Yn);else if(nr==="object")throw yt=String(Pe),Error("Objects are not valid as a React child (found: "+(yt==="[object Object]"?"object with keys {"+Object.keys(Pe).join(", ")+"}":yt)+"). If you meant to render a collection of children, use an array instead.");return rr}function ct(Pe,yt,un){if(Pe==null)return Pe;var Rn=[],Yn=0;return De(Pe,Rn,"","",function(nr){return yt.call(un,nr,Yn++)}),Rn}function qt(Pe){if(Pe._status===-1){var yt=Pe._result;yt=yt(),yt.then(function(un){(Pe._status===0||Pe._status===-1)&&(Pe._status=1,Pe._result=un)},function(un){(Pe._status===0||Pe._status===-1)&&(Pe._status=2,Pe._result=un)}),Pe._status===-1&&(Pe._status=0,Pe._result=yt)}if(Pe._status===1)return Pe._result.default;throw Pe._result}var z={current:null},He={transition:null},Ct={ReactCurrentDispatcher:z,ReactCurrentBatchConfig:He,ReactCurrentOwner:nn};function kt(){throw Error("act(...) is not supported in production builds of React.")}l.Children={map:ct,forEach:function(Pe,yt,un){ct(Pe,function(){yt.apply(this,arguments)},un)},count:function(Pe){var yt=0;return ct(Pe,function(){yt++}),yt},toArray:function(Pe){return ct(Pe,function(yt){return yt})||[]},only:function(Pe){if(!rn(Pe))throw Error("React.Children.only expected to receive a single React element child.");return Pe}},l.Component=Ie,l.Fragment=Te,l.Profiler=ie,l.PureComponent=vt,l.StrictMode=ae,l.Suspense=Z,l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ct,l.act=kt,l.cloneElement=function(Pe,yt,un){if(Pe==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+Pe+".");var Rn=te({},Pe.props),Yn=Pe.key,nr=Pe.ref,rr=Pe._owner;if(yt!=null){if(yt.ref!==void 0&&(nr=yt.ref,rr=nn.current),yt.key!==void 0&&(Yn=""+yt.key),Pe.type&&Pe.type.defaultProps)var ar=Pe.type.defaultProps;for(wr in yt)qe.call(yt,wr)&&!Ut.hasOwnProperty(wr)&&(Rn[wr]=yt[wr]===void 0&&ar!==void 0?ar[wr]:yt[wr])}var wr=arguments.length-2;if(wr===1)Rn.children=un;else if(1<wr){ar=Array(wr);for(var Ts=0;Ts<wr;Ts++)ar[Ts]=arguments[Ts+2];Rn.children=ar}return{$$typeof:se,type:Pe.type,key:Yn,ref:nr,props:Rn,_owner:rr}},l.createContext=function(Pe){return Pe={$$typeof:ee,_currentValue:Pe,_currentValue2:Pe,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},Pe.Provider={$$typeof:W,_context:Pe},Pe.Consumer=Pe},l.createElement=Xe,l.createFactory=function(Pe){var yt=Xe.bind(null,Pe);return yt.type=Pe,yt},l.createRef=function(){return{current:null}},l.forwardRef=function(Pe){return{$$typeof:q,render:Pe}},l.isValidElement=rn,l.lazy=function(Pe){return{$$typeof:ge,_payload:{_status:-1,_result:Pe},_init:qt}},l.memo=function(Pe,yt){return{$$typeof:U,type:Pe,compare:yt===void 0?null:yt}},l.startTransition=function(Pe){var yt=He.transition;He.transition={};try{Pe()}finally{He.transition=yt}},l.unstable_act=kt,l.useCallback=function(Pe,yt){return z.current.useCallback(Pe,yt)},l.useContext=function(Pe){return z.current.useContext(Pe)},l.useDebugValue=function(){},l.useDeferredValue=function(Pe){return z.current.useDeferredValue(Pe)},l.useEffect=function(Pe,yt){return z.current.useEffect(Pe,yt)},l.useId=function(){return z.current.useId()},l.useImperativeHandle=function(Pe,yt,un){return z.current.useImperativeHandle(Pe,yt,un)},l.useInsertionEffect=function(Pe,yt){return z.current.useInsertionEffect(Pe,yt)},l.useLayoutEffect=function(Pe,yt){return z.current.useLayoutEffect(Pe,yt)},l.useMemo=function(Pe,yt){return z.current.useMemo(Pe,yt)},l.useReducer=function(Pe,yt,un){return z.current.useReducer(Pe,yt,un)},l.useRef=function(Pe){return z.current.useRef(Pe)},l.useState=function(Pe){return z.current.useState(Pe)},l.useSyncExternalStore=function(Pe,yt,un){return z.current.useSyncExternalStore(Pe,yt,un)},l.useTransition=function(){return z.current.useTransition()},l.version="18.3.1"},6194:(a,l,se)=>{"use strict";a.exports=se(9165)},8810:(a,l,se)=>{"use strict";a.exports=se(1634)},9873:(a,l,se)=>{"use strict";l.__esModule=!0,l.default=ae;var we=Te(se(1871));function Te(ie){return ie&&ie.__esModule?ie:{default:ie}}function ae(ie){var W=(0,we.default)(ie);return{getItem:function(q){return new Promise(function(Z,U){Z(W.getItem(q))})},setItem:function(q,Z){return new Promise(function(U,ge){U(W.setItem(q,Z))})},removeItem:function(q){return new Promise(function(Z,U){Z(W.removeItem(q))})}}}},1871:(a,l)=>{"use strict";l.__esModule=!0,l.default=ie;function se(W){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?se=function(q){return typeof q}:se=function(q){return q&&typeof Symbol=="function"&&q.constructor===Symbol&&q!==Symbol.prototype?"symbol":typeof q},se(W)}function we(){}var Te={getItem:we,setItem:we,removeItem:we};function ae(W){if((typeof self>"u"?"undefined":se(self))!=="object"||!(W in self))return!1;try{var ee=self[W],q="redux-persist ".concat(W," test");ee.setItem(q,"test"),ee.getItem(q),ee.removeItem(q)}catch{return!1}return!0}function ie(W){var ee="".concat(W,"Storage");return ae(ee)?self[ee]:Te}},7484:(a,l,se)=>{"use strict";var we;we=!0,l.A=void 0;var Te=ae(se(9873));function ae(W){return W&&W.__esModule?W:{default:W}}var ie=(0,Te.default)("local");l.A=ie},2109:(a,l)=>{"use strict";/**
 * @license React
 * scheduler.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */function se(z,He){var Ct=z.length;z.push(He);e:for(;0<Ct;){var kt=Ct-1>>>1,Pe=z[kt];if(0<ae(Pe,He))z[kt]=He,z[Ct]=Pe,Ct=kt;else break e}}function we(z){return z.length===0?null:z[0]}function Te(z){if(z.length===0)return null;var He=z[0],Ct=z.pop();if(Ct!==He){z[0]=Ct;e:for(var kt=0,Pe=z.length,yt=Pe>>>1;kt<yt;){var un=2*(kt+1)-1,Rn=z[un],Yn=un+1,nr=z[Yn];if(0>ae(Rn,Ct))Yn<Pe&&0>ae(nr,Rn)?(z[kt]=nr,z[Yn]=Ct,kt=Yn):(z[kt]=Rn,z[un]=Ct,kt=un);else if(Yn<Pe&&0>ae(nr,Ct))z[kt]=nr,z[Yn]=Ct,kt=Yn;else break e}}return He}function ae(z,He){var Ct=z.sortIndex-He.sortIndex;return Ct!==0?Ct:z.id-He.id}if(typeof performance=="object"&&typeof performance.now=="function"){var ie=performance;l.unstable_now=function(){return ie.now()}}else{var W=Date,ee=W.now();l.unstable_now=function(){return W.now()-ee}}var q=[],Z=[],U=1,ge=null,ne=3,ve=!1,V=!1,te=!1,Re=typeof setTimeout=="function"?setTimeout:null,Ie=typeof clearTimeout=="function"?clearTimeout:null,$e=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function vt(z){for(var He=we(Z);He!==null;){if(He.callback===null)Te(Z);else if(He.startTime<=z)Te(Z),He.sortIndex=He.expirationTime,se(q,He);else break;He=we(Z)}}function mt(z){if(te=!1,vt(z),!V)if(we(q)!==null)V=!0,ct(It);else{var He=we(Z);He!==null&&qt(mt,He.startTime-z)}}function It(z,He){V=!1,te&&(te=!1,Ie(Ut),Ut=-1),ve=!0;var Ct=ne;try{for(vt(He),ge=we(q);ge!==null&&(!(ge.expirationTime>He)||z&&!rn());){var kt=ge.callback;if(typeof kt=="function"){ge.callback=null,ne=ge.priorityLevel;var Pe=kt(ge.expirationTime<=He);He=l.unstable_now(),typeof Pe=="function"?ge.callback=Pe:ge===we(q)&&Te(q),vt(He)}else Te(q);ge=we(q)}if(ge!==null)var yt=!0;else{var un=we(Z);un!==null&&qt(mt,un.startTime-He),yt=!1}return yt}finally{ge=null,ne=Ct,ve=!1}}var qe=!1,nn=null,Ut=-1,Xe=5,Ft=-1;function rn(){return!(l.unstable_now()-Ft<Xe)}function Vt(){if(nn!==null){var z=l.unstable_now();Ft=z;var He=!0;try{He=nn(!0,z)}finally{He?ze():(qe=!1,nn=null)}}else qe=!1}var ze;if(typeof $e=="function")ze=function(){$e(Vt)};else if(typeof MessageChannel<"u"){var je=new MessageChannel,De=je.port2;je.port1.onmessage=Vt,ze=function(){De.postMessage(null)}}else ze=function(){Re(Vt,0)};function ct(z){nn=z,qe||(qe=!0,ze())}function qt(z,He){Ut=Re(function(){z(l.unstable_now())},He)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(z){z.callback=null},l.unstable_continueExecution=function(){V||ve||(V=!0,ct(It))},l.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Xe=0<z?Math.floor(1e3/z):5},l.unstable_getCurrentPriorityLevel=function(){return ne},l.unstable_getFirstCallbackNode=function(){return we(q)},l.unstable_next=function(z){switch(ne){case 1:case 2:case 3:var He=3;break;default:He=ne}var Ct=ne;ne=He;try{return z()}finally{ne=Ct}},l.unstable_pauseExecution=function(){},l.unstable_requestPaint=function(){},l.unstable_runWithPriority=function(z,He){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var Ct=ne;ne=z;try{return He()}finally{ne=Ct}},l.unstable_scheduleCallback=function(z,He,Ct){var kt=l.unstable_now();switch(typeof Ct=="object"&&Ct!==null?(Ct=Ct.delay,Ct=typeof Ct=="number"&&0<Ct?kt+Ct:kt):Ct=kt,z){case 1:var Pe=-1;break;case 2:Pe=250;break;case 5:Pe=1073741823;break;case 4:Pe=1e4;break;default:Pe=5e3}return Pe=Ct+Pe,z={id:U++,callback:He,priorityLevel:z,startTime:Ct,expirationTime:Pe,sortIndex:-1},Ct>kt?(z.sortIndex=Ct,se(Z,z),we(q)===null&&z===we(Z)&&(te?(Ie(Ut),Ut=-1):te=!0,qt(mt,Ct-kt))):(z.sortIndex=Pe,se(q,z),V||ve||(V=!0,ct(It))),z},l.unstable_shouldYield=rn,l.unstable_wrapCallback=function(z){var He=ne;return function(){var Ct=ne;ne=He;try{return z.apply(this,arguments)}finally{ne=Ct}}}},2552:(a,l,se)=>{"use strict";a.exports=se(2109)},846:(a,l,se)=>{"use strict";var we=se(5174),Te=Array.prototype.concat,ae=Array.prototype.slice,ie=a.exports=function(ee){for(var q=[],Z=0,U=ee.length;Z<U;Z++){var ge=ee[Z];we(ge)?q=Te.call(q,ae.call(ge)):q.push(ge)}return q};ie.wrap=function(W){return function(){return W(ie(arguments))}}},5174:a=>{a.exports=function(se){return!se||typeof se=="string"?!1:se instanceof Array||Array.isArray(se)||se.length>=0&&(se.splice instanceof Function||Object.getOwnPropertyDescriptor(se,se.length-1)&&se.constructor.name!=="String")}},603:(a,l)=>{"use strict";/*!
 * cookie
 * Copyright(c) 2012-2014 Roman Shtylman
 * Copyright(c) 2015 Douglas Christopher Wilson
 * MIT Licensed
 */l.q=ae,l.l=ie;var se=decodeURIComponent,we=encodeURIComponent,Te=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function ae(ee,q){if(typeof ee!="string")throw new TypeError("argument str must be a string");for(var Z={},U=q||{},ge=ee.split(";"),ne=U.decode||se,ve=0;ve<ge.length;ve++){var V=ge[ve],te=V.indexOf("=");if(!(te<0)){var Re=V.substring(0,te).trim();if(Z[Re]==null){var Ie=V.substring(te+1,V.length).trim();Ie[0]==='"'&&(Ie=Ie.slice(1,-1)),Z[Re]=W(Ie,ne)}}}return Z}function ie(ee,q,Z){var U=Z||{},ge=U.encode||we;if(typeof ge!="function")throw new TypeError("option encode is invalid");if(!Te.test(ee))throw new TypeError("argument name is invalid");var ne=ge(q);if(ne&&!Te.test(ne))throw new TypeError("argument val is invalid");var ve=ee+"="+ne;if(U.maxAge!=null){var V=U.maxAge-0;if(isNaN(V)||!isFinite(V))throw new TypeError("option maxAge is invalid");ve+="; Max-Age="+Math.floor(V)}if(U.domain){if(!Te.test(U.domain))throw new TypeError("option domain is invalid");ve+="; Domain="+U.domain}if(U.path){if(!Te.test(U.path))throw new TypeError("option path is invalid");ve+="; Path="+U.path}if(U.expires){if(typeof U.expires.toUTCString!="function")throw new TypeError("option expires is invalid");ve+="; Expires="+U.expires.toUTCString()}if(U.httpOnly&&(ve+="; HttpOnly"),U.secure&&(ve+="; Secure"),U.sameSite){var te=typeof U.sameSite=="string"?U.sameSite.toLowerCase():U.sameSite;switch(te){case!0:ve+="; SameSite=Strict";break;case"lax":ve+="; SameSite=Lax";break;case"strict":ve+="; SameSite=Strict";break;case"none":ve+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return ve}function W(ee,q){try{return q(ee)}catch{return ee}}},1741:(a,l,se)=>{"use strict";/**
 * @license React
 * use-sync-external-store-shim.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var we=se(6194);function Te(ve,V){return ve===V&&(ve!==0||1/ve===1/V)||ve!==ve&&V!==V}var ae=typeof Object.is=="function"?Object.is:Te,ie=we.useState,W=we.useEffect,ee=we.useLayoutEffect,q=we.useDebugValue;function Z(ve,V){var te=V(),Re=ie({inst:{value:te,getSnapshot:V}}),Ie=Re[0].inst,$e=Re[1];return ee(function(){Ie.value=te,Ie.getSnapshot=V,U(Ie)&&$e({inst:Ie})},[ve,te,V]),W(function(){return U(Ie)&&$e({inst:Ie}),ve(function(){U(Ie)&&$e({inst:Ie})})},[ve]),q(te),te}function U(ve){var V=ve.getSnapshot;ve=ve.value;try{var te=V();return!ae(ve,te)}catch{return!0}}function ge(ve,V){return V()}var ne=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?ge:Z;l.useSyncExternalStore=we.useSyncExternalStore!==void 0?we.useSyncExternalStore:ne},5874:(a,l,se)=>{"use strict";/**
 * @license React
 * use-sync-external-store-shim/with-selector.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var we=se(6194),Te=se(7030);function ae(ge,ne){return ge===ne&&(ge!==0||1/ge===1/ne)||ge!==ge&&ne!==ne}var ie=typeof Object.is=="function"?Object.is:ae,W=Te.useSyncExternalStore,ee=we.useRef,q=we.useEffect,Z=we.useMemo,U=we.useDebugValue;l.useSyncExternalStoreWithSelector=function(ge,ne,ve,V,te){var Re=ee(null);if(Re.current===null){var Ie={hasValue:!1,value:null};Re.current=Ie}else Ie=Re.current;Re=Z(function(){function vt(Ut){if(!mt){if(mt=!0,It=Ut,Ut=V(Ut),te!==void 0&&Ie.hasValue){var Xe=Ie.value;if(te(Xe,Ut))return qe=Xe}return qe=Ut}if(Xe=qe,ie(It,Ut))return Xe;var Ft=V(Ut);return te!==void 0&&te(Xe,Ft)?Xe:(It=Ut,qe=Ft)}var mt=!1,It,qe,nn=ve===void 0?null:ve;return[function(){return vt(ne())},nn===null?void 0:function(){return vt(nn())}]},[ne,ve,V,te]);var $e=W(ge,Re[0],Re[1]);return q(function(){Ie.hasValue=!0,Ie.value=$e},[$e]),U($e),$e}},7030:(a,l,se)=>{"use strict";a.exports=se(1741)},8072:(a,l,se)=>{"use strict";a.exports=se(5874)},3761:a=>{a.exports={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}},6369:(a,l,se)=>{"use strict";se.d(l,{A:()=>we});function we(Te){if(Array.isArray(Te))return Te}},3029:(a,l,se)=>{"use strict";se.d(l,{A:()=>we});function we(Te,ae){if(!(Te instanceof ae))throw new TypeError("Cannot call a class as a function")}},2901:(a,l,se)=>{"use strict";se.d(l,{A:()=>ae});var we=se(816);function Te(ie,W){for(var ee=0;ee<W.length;ee++){var q=W[ee];q.enumerable=q.enumerable||!1,q.configurable=!0,"value"in q&&(q.writable=!0),Object.defineProperty(ie,(0,we.A)(q.key),q)}}function ae(ie,W,ee){return W&&Te(ie.prototype,W),ee&&Te(ie,ee),Object.defineProperty(ie,"prototype",{writable:!1}),ie}},4467:(a,l,se)=>{"use strict";se.d(l,{A:()=>Te});var we=se(816);function Te(ae,ie,W){return ie=(0,we.A)(ie),ie in ae?Object.defineProperty(ae,ie,{value:W,enumerable:!0,configurable:!0,writable:!0}):ae[ie]=W,ae}},8168:(a,l,se)=>{"use strict";se.d(l,{A:()=>we});function we(){return we=Object.assign?Object.assign.bind():function(Te){for(var ae=1;ae<arguments.length;ae++){var ie=arguments[ae];for(var W in ie)Object.prototype.hasOwnProperty.call(ie,W)&&(Te[W]=ie[W])}return Te},we.apply(this,arguments)}},6562:(a,l,se)=>{"use strict";se.d(l,{A:()=>we});function we(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}},816:(a,l,se)=>{"use strict";se.d(l,{A:()=>ae});var we=se(2284);function Te(ie,W){if((0,we.A)(ie)!="object"||!ie)return ie;var ee=ie[Symbol.toPrimitive];if(ee!==void 0){var q=ee.call(ie,W||"default");if((0,we.A)(q)!="object")return q;throw new TypeError("@@toPrimitive must return a primitive value.")}return(W==="string"?String:Number)(ie)}function ae(ie){var W=Te(ie,"string");return(0,we.A)(W)=="symbol"?W:W+""}},2284:(a,l,se)=>{"use strict";se.d(l,{A:()=>we});function we(Te){return we=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ae){return typeof ae}:function(ae){return ae&&typeof Symbol=="function"&&ae.constructor===Symbol&&ae!==Symbol.prototype?"symbol":typeof ae},we(Te)}},8394:(a,l,se)=>{"use strict";se.d(l,{A:()=>Te});function we(ae,ie){(ie==null||ie>ae.length)&&(ie=ae.length);for(var W=0,ee=new Array(ie);W<ie;W++)ee[W]=ae[W];return ee}function Te(ae,ie){if(ae){if(typeof ae=="string")return we(ae,ie);var W=Object.prototype.toString.call(ae).slice(8,-1);if(W==="Object"&&ae.constructor&&(W=ae.constructor.name),W==="Map"||W==="Set")return Array.from(ae);if(W==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(W))return we(ae,ie)}}},3554:(a,l,se)=>{"use strict";se.d(l,{UE:()=>K,ll:()=>ut,rD:()=>Ve,UU:()=>pe,jD:()=>ue,mG:()=>fe,ER:()=>_e,cY:()=>cn,BN:()=>be,Ej:()=>le});const we=["top","right","bottom","left"],Te=null,ae=null,ie=Math.min,W=Math.max,ee=Math.round,q=Math.floor,Z=X=>({x:X,y:X}),U={left:"right",right:"left",bottom:"top",top:"bottom"},ge={start:"end",end:"start"};function ne(X,xe,Ne){return W(X,ie(xe,Ne))}function ve(X,xe){return typeof X=="function"?X(xe):X}function V(X){return X.split("-")[0]}function te(X){return X.split("-")[1]}function Re(X){return X==="x"?"y":"x"}function Ie(X){return X==="y"?"height":"width"}function $e(X){return["top","bottom"].includes(V(X))?"y":"x"}function vt(X){return Re($e(X))}function mt(X,xe,Ne){Ne===void 0&&(Ne=!1);const Ee=te(X),Oe=vt(X),Be=Ie(Oe);let et=Oe==="x"?Ee===(Ne?"end":"start")?"right":"left":Ee==="start"?"bottom":"top";return xe.reference[Be]>xe.floating[Be]&&(et=Xe(et)),[et,Xe(et)]}function It(X){const xe=Xe(X);return[qe(X),xe,qe(xe)]}function qe(X){return X.replace(/start|end/g,xe=>ge[xe])}function nn(X,xe,Ne){const Ee=["left","right"],Oe=["right","left"],Be=["top","bottom"],et=["bottom","top"];switch(X){case"top":case"bottom":return Ne?xe?Oe:Ee:xe?Ee:Oe;case"left":case"right":return xe?Be:et;default:return[]}}function Ut(X,xe,Ne,Ee){const Oe=te(X);let Be=nn(V(X),Ne==="start",Ee);return Oe&&(Be=Be.map(et=>et+"-"+Oe),xe&&(Be=Be.concat(Be.map(qe)))),Be}function Xe(X){return X.replace(/left|right|bottom|top/g,xe=>U[xe])}function Ft(X){return{top:0,right:0,bottom:0,left:0,...X}}function rn(X){return typeof X!="number"?Ft(X):{top:X,right:X,bottom:X,left:X}}function Vt(X){const{x:xe,y:Ne,width:Ee,height:Oe}=X;return{width:Ee,height:Oe,top:Ne,left:xe,right:xe+Ee,bottom:Ne+Oe,x:xe,y:Ne}}function ze(X,xe,Ne){let{reference:Ee,floating:Oe}=X;const Be=$e(xe),et=vt(xe),dt=Ie(et),bt=V(xe),ft=Be==="y",pt=Ee.x+Ee.width/2-Oe.width/2,_t=Ee.y+Ee.height/2-Oe.height/2,Kt=Ee[dt]/2-Oe[dt]/2;let fn;switch(bt){case"top":fn={x:pt,y:Ee.y-Oe.height};break;case"bottom":fn={x:pt,y:Ee.y+Ee.height};break;case"right":fn={x:Ee.x+Ee.width,y:_t};break;case"left":fn={x:Ee.x-Oe.width,y:_t};break;default:fn={x:Ee.x,y:Ee.y}}switch(te(xe)){case"start":fn[et]-=Kt*(Ne&&ft?-1:1);break;case"end":fn[et]+=Kt*(Ne&&ft?-1:1);break}return fn}const je=async(X,xe,Ne)=>{const{placement:Ee="bottom",strategy:Oe="absolute",middleware:Be=[],platform:et}=Ne,dt=Be.filter(Boolean),bt=await(et.isRTL==null?void 0:et.isRTL(xe));let ft=await et.getElementRects({reference:X,floating:xe,strategy:Oe}),{x:pt,y:_t}=ze(ft,Ee,bt),Kt=Ee,fn={},hn=0;for(let In=0;In<dt.length;In++){const{name:lr,fn:Gn}=dt[In],{x:Mn,y:gr,data:er,reset:_r}=await Gn({x:pt,y:_t,initialPlacement:Ee,placement:Kt,strategy:Oe,middlewareData:fn,rects:ft,platform:et,elements:{reference:X,floating:xe}});pt=Mn??pt,_t=gr??_t,fn={...fn,[lr]:{...fn[lr],...er}},_r&&hn<=50&&(hn++,typeof _r=="object"&&(_r.placement&&(Kt=_r.placement),_r.rects&&(ft=_r.rects===!0?await et.getElementRects({reference:X,floating:xe,strategy:Oe}):_r.rects),{x:pt,y:_t}=ze(ft,Kt,bt)),In=-1)}return{x:pt,y:_t,placement:Kt,strategy:Oe,middlewareData:fn}};async function De(X,xe){var Ne;xe===void 0&&(xe={});const{x:Ee,y:Oe,platform:Be,rects:et,elements:dt,strategy:bt}=X,{boundary:ft="clippingAncestors",rootBoundary:pt="viewport",elementContext:_t="floating",altBoundary:Kt=!1,padding:fn=0}=ve(xe,X),hn=rn(fn),lr=dt[Kt?_t==="floating"?"reference":"floating":_t],Gn=Vt(await Be.getClippingRect({element:(Ne=await(Be.isElement==null?void 0:Be.isElement(lr)))==null||Ne?lr:lr.contextElement||await(Be.getDocumentElement==null?void 0:Be.getDocumentElement(dt.floating)),boundary:ft,rootBoundary:pt,strategy:bt})),Mn=_t==="floating"?{x:Ee,y:Oe,width:et.floating.width,height:et.floating.height}:et.reference,gr=await(Be.getOffsetParent==null?void 0:Be.getOffsetParent(dt.floating)),er=await(Be.isElement==null?void 0:Be.isElement(gr))?await(Be.getScale==null?void 0:Be.getScale(gr))||{x:1,y:1}:{x:1,y:1},_r=Vt(Be.convertOffsetParentRelativeRectToViewportRelativeRect?await Be.convertOffsetParentRelativeRectToViewportRelativeRect({elements:dt,rect:Mn,offsetParent:gr,strategy:bt}):Mn);return{top:(Gn.top-_r.top+hn.top)/er.y,bottom:(_r.bottom-Gn.bottom+hn.bottom)/er.y,left:(Gn.left-_r.left+hn.left)/er.x,right:(_r.right-Gn.right+hn.right)/er.x}}const ct=X=>({name:"arrow",options:X,async fn(xe){const{x:Ne,y:Ee,placement:Oe,rects:Be,platform:et,elements:dt,middlewareData:bt}=xe,{element:ft,padding:pt=0}=ve(X,xe)||{};if(ft==null)return{};const _t=rn(pt),Kt={x:Ne,y:Ee},fn=vt(Oe),hn=Ie(fn),In=await et.getDimensions(ft),lr=fn==="y",Gn=lr?"top":"left",Mn=lr?"bottom":"right",gr=lr?"clientHeight":"clientWidth",er=Be.reference[hn]+Be.reference[fn]-Kt[fn]-Be.floating[hn],_r=Kt[fn]-Be.reference[fn],vs=await(et.getOffsetParent==null?void 0:et.getOffsetParent(ft));let ys=vs?vs[gr]:0;(!ys||!await(et.isElement==null?void 0:et.isElement(vs)))&&(ys=dt.floating[gr]||Be.floating[hn]);const ro=er/2-_r/2,qs=ys/2-In[hn]/2-1,hs=ie(_t[Gn],qs),Ks=ie(_t[Mn],qs),os=hs,Gs=ys-In[hn]-Ks,Ar=ys/2-In[hn]/2+ro,bo=ne(os,Ar,Gs),io=!bt.arrow&&te(Oe)!=null&&Ar!==bo&&Be.reference[hn]/2-(Ar<os?hs:Ks)-In[hn]/2<0,ho=io?Ar<os?Ar-os:Ar-Gs:0;return{[fn]:Kt[fn]+ho,data:{[fn]:bo,centerOffset:Ar-bo-ho,...io&&{alignmentOffset:ho}},reset:io}}});function qt(X,xe,Ne){return(X?[...Ne.filter(Oe=>getAlignment(Oe)===X),...Ne.filter(Oe=>getAlignment(Oe)!==X)]:Ne.filter(Oe=>getSide(Oe)===Oe)).filter(Oe=>X?getAlignment(Oe)===X||(xe?getOppositeAlignmentPlacement(Oe)!==Oe:!1):!0)}const z=function(X){return X===void 0&&(X={}),{name:"autoPlacement",options:X,async fn(xe){var Ne,Ee,Oe;const{rects:Be,middlewareData:et,placement:dt,platform:bt,elements:ft}=xe,{crossAxis:pt=!1,alignment:_t,allowedPlacements:Kt=placements,autoAlignment:fn=!0,...hn}=evaluate(X,xe),In=_t!==void 0||Kt===placements?qt(_t||null,fn,Kt):Kt,lr=await De(xe,hn),Gn=((Ne=et.autoPlacement)==null?void 0:Ne.index)||0,Mn=In[Gn];if(Mn==null)return{};const gr=getAlignmentSides(Mn,Be,await(bt.isRTL==null?void 0:bt.isRTL(ft.floating)));if(dt!==Mn)return{reset:{placement:In[0]}};const er=[lr[getSide(Mn)],lr[gr[0]],lr[gr[1]]],_r=[...((Ee=et.autoPlacement)==null?void 0:Ee.overflows)||[],{placement:Mn,overflows:er}],vs=In[Gn+1];if(vs)return{data:{index:Gn+1,overflows:_r},reset:{placement:vs}};const ys=_r.map(hs=>{const Ks=getAlignment(hs.placement);return[hs.placement,Ks&&pt?hs.overflows.slice(0,2).reduce((os,Gs)=>os+Gs,0):hs.overflows[0],hs.overflows]}).sort((hs,Ks)=>hs[1]-Ks[1]),qs=((Oe=ys.filter(hs=>hs[2].slice(0,getAlignment(hs[0])?2:3).every(Ks=>Ks<=0))[0])==null?void 0:Oe[0])||ys[0][0];return qs!==dt?{data:{index:Gn+1,overflows:_r},reset:{placement:qs}}:{}}}},He=function(X){return X===void 0&&(X={}),{name:"flip",options:X,async fn(xe){var Ne,Ee;const{placement:Oe,middlewareData:Be,rects:et,initialPlacement:dt,platform:bt,elements:ft}=xe,{mainAxis:pt=!0,crossAxis:_t=!0,fallbackPlacements:Kt,fallbackStrategy:fn="bestFit",fallbackAxisSideDirection:hn="none",flipAlignment:In=!0,...lr}=ve(X,xe);if((Ne=Be.arrow)!=null&&Ne.alignmentOffset)return{};const Gn=V(Oe),Mn=V(dt)===dt,gr=await(bt.isRTL==null?void 0:bt.isRTL(ft.floating)),er=Kt||(Mn||!In?[Xe(dt)]:It(dt));!Kt&&hn!=="none"&&er.push(...Ut(dt,In,hn,gr));const _r=[dt,...er],vs=await De(xe,lr),ys=[];let ro=((Ee=Be.flip)==null?void 0:Ee.overflows)||[];if(pt&&ys.push(vs[Gn]),_t){const os=mt(Oe,et,gr);ys.push(vs[os[0]],vs[os[1]])}if(ro=[...ro,{placement:Oe,overflows:ys}],!ys.every(os=>os<=0)){var qs,hs;const os=(((qs=Be.flip)==null?void 0:qs.index)||0)+1,Gs=_r[os];if(Gs)return{data:{index:os,overflows:ro},reset:{placement:Gs}};let Ar=(hs=ro.filter(bo=>bo.overflows[0]<=0).sort((bo,io)=>bo.overflows[1]-io.overflows[1])[0])==null?void 0:hs.placement;if(!Ar)switch(fn){case"bestFit":{var Ks;const bo=(Ks=ro.map(io=>[io.placement,io.overflows.filter(ho=>ho>0).reduce((ho,$o)=>ho+$o,0)]).sort((io,ho)=>io[1]-ho[1])[0])==null?void 0:Ks[0];bo&&(Ar=bo);break}case"initialPlacement":Ar=dt;break}if(Oe!==Ar)return{reset:{placement:Ar}}}return{}}}};function Ct(X,xe){return{top:X.top-xe.height,right:X.right-xe.width,bottom:X.bottom-xe.height,left:X.left-xe.width}}function kt(X){return we.some(xe=>X[xe]>=0)}const Pe=function(X){return X===void 0&&(X={}),{name:"hide",options:X,async fn(xe){const{rects:Ne}=xe,{strategy:Ee="referenceHidden",...Oe}=ve(X,xe);switch(Ee){case"referenceHidden":{const Be=await De(xe,{...Oe,elementContext:"reference"}),et=Ct(Be,Ne.reference);return{data:{referenceHiddenOffsets:et,referenceHidden:kt(et)}}}case"escaped":{const Be=await De(xe,{...Oe,altBoundary:!0}),et=Ct(Be,Ne.floating);return{data:{escapedOffsets:et,escaped:kt(et)}}}default:return{}}}}};function yt(X){const xe=ie(...X.map(Be=>Be.left)),Ne=ie(...X.map(Be=>Be.top)),Ee=W(...X.map(Be=>Be.right)),Oe=W(...X.map(Be=>Be.bottom));return{x:xe,y:Ne,width:Ee-xe,height:Oe-Ne}}function un(X){const xe=X.slice().sort((Oe,Be)=>Oe.y-Be.y),Ne=[];let Ee=null;for(let Oe=0;Oe<xe.length;Oe++){const Be=xe[Oe];!Ee||Be.y-Ee.y>Ee.height/2?Ne.push([Be]):Ne[Ne.length-1].push(Be),Ee=Be}return Ne.map(Oe=>Vt(yt(Oe)))}const Rn=function(X){return X===void 0&&(X={}),{name:"inline",options:X,async fn(xe){const{placement:Ne,elements:Ee,rects:Oe,platform:Be,strategy:et}=xe,{padding:dt=2,x:bt,y:ft}=ve(X,xe),pt=Array.from(await(Be.getClientRects==null?void 0:Be.getClientRects(Ee.reference))||[]),_t=un(pt),Kt=Vt(yt(pt)),fn=rn(dt);function hn(){if(_t.length===2&&_t[0].left>_t[1].right&&bt!=null&&ft!=null)return _t.find(lr=>bt>lr.left-fn.left&&bt<lr.right+fn.right&&ft>lr.top-fn.top&&ft<lr.bottom+fn.bottom)||Kt;if(_t.length>=2){if($e(Ne)==="y"){const hs=_t[0],Ks=_t[_t.length-1],os=V(Ne)==="top",Gs=hs.top,Ar=Ks.bottom,bo=os?hs.left:Ks.left,io=os?hs.right:Ks.right,ho=io-bo,$o=Ar-Gs;return{top:Gs,bottom:Ar,left:bo,right:io,width:ho,height:$o,x:bo,y:Gs}}const lr=V(Ne)==="left",Gn=W(..._t.map(hs=>hs.right)),Mn=ie(..._t.map(hs=>hs.left)),gr=_t.filter(hs=>lr?hs.left===Mn:hs.right===Gn),er=gr[0].top,_r=gr[gr.length-1].bottom,vs=Mn,ys=Gn,ro=ys-vs,qs=_r-er;return{top:er,bottom:_r,left:vs,right:ys,width:ro,height:qs,x:vs,y:er}}return Kt}const In=await Be.getElementRects({reference:{getBoundingClientRect:hn},floating:Ee.floating,strategy:et});return Oe.reference.x!==In.reference.x||Oe.reference.y!==In.reference.y||Oe.reference.width!==In.reference.width||Oe.reference.height!==In.reference.height?{reset:{rects:In}}:{}}}};async function Yn(X,xe){const{placement:Ne,platform:Ee,elements:Oe}=X,Be=await(Ee.isRTL==null?void 0:Ee.isRTL(Oe.floating)),et=V(Ne),dt=te(Ne),bt=$e(Ne)==="y",ft=["left","top"].includes(et)?-1:1,pt=Be&&bt?-1:1,_t=ve(xe,X);let{mainAxis:Kt,crossAxis:fn,alignmentAxis:hn}=typeof _t=="number"?{mainAxis:_t,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,..._t};return dt&&typeof hn=="number"&&(fn=dt==="end"?hn*-1:hn),bt?{x:fn*pt,y:Kt*ft}:{x:Kt*ft,y:fn*pt}}const nr=function(X){return X===void 0&&(X=0),{name:"offset",options:X,async fn(xe){var Ne,Ee;const{x:Oe,y:Be,placement:et,middlewareData:dt}=xe,bt=await Yn(xe,X);return et===((Ne=dt.offset)==null?void 0:Ne.placement)&&(Ee=dt.arrow)!=null&&Ee.alignmentOffset?{}:{x:Oe+bt.x,y:Be+bt.y,data:{...bt,placement:et}}}}},rr=function(X){return X===void 0&&(X={}),{name:"shift",options:X,async fn(xe){const{x:Ne,y:Ee,placement:Oe}=xe,{mainAxis:Be=!0,crossAxis:et=!1,limiter:dt={fn:lr=>{let{x:Gn,y:Mn}=lr;return{x:Gn,y:Mn}}},...bt}=ve(X,xe),ft={x:Ne,y:Ee},pt=await De(xe,bt),_t=$e(V(Oe)),Kt=Re(_t);let fn=ft[Kt],hn=ft[_t];if(Be){const lr=Kt==="y"?"top":"left",Gn=Kt==="y"?"bottom":"right",Mn=fn+pt[lr],gr=fn-pt[Gn];fn=ne(Mn,fn,gr)}if(et){const lr=_t==="y"?"top":"left",Gn=_t==="y"?"bottom":"right",Mn=hn+pt[lr],gr=hn-pt[Gn];hn=ne(Mn,hn,gr)}const In=dt.fn({...xe,[Kt]:fn,[_t]:hn});return{...In,data:{x:In.x-Ne,y:In.y-Ee}}}}},ar=function(X){return X===void 0&&(X={}),{options:X,fn(xe){const{x:Ne,y:Ee,placement:Oe,rects:Be,middlewareData:et}=xe,{offset:dt=0,mainAxis:bt=!0,crossAxis:ft=!0}=ve(X,xe),pt={x:Ne,y:Ee},_t=$e(Oe),Kt=Re(_t);let fn=pt[Kt],hn=pt[_t];const In=ve(dt,xe),lr=typeof In=="number"?{mainAxis:In,crossAxis:0}:{mainAxis:0,crossAxis:0,...In};if(bt){const gr=Kt==="y"?"height":"width",er=Be.reference[Kt]-Be.floating[gr]+lr.mainAxis,_r=Be.reference[Kt]+Be.reference[gr]-lr.mainAxis;fn<er?fn=er:fn>_r&&(fn=_r)}if(ft){var Gn,Mn;const gr=Kt==="y"?"width":"height",er=["top","left"].includes(V(Oe)),_r=Be.reference[_t]-Be.floating[gr]+(er&&((Gn=et.offset)==null?void 0:Gn[_t])||0)+(er?0:lr.crossAxis),vs=Be.reference[_t]+Be.reference[gr]+(er?0:((Mn=et.offset)==null?void 0:Mn[_t])||0)-(er?lr.crossAxis:0);hn<_r?hn=_r:hn>vs&&(hn=vs)}return{[Kt]:fn,[_t]:hn}}}},wr=function(X){return X===void 0&&(X={}),{name:"size",options:X,async fn(xe){const{placement:Ne,rects:Ee,platform:Oe,elements:Be}=xe,{apply:et=()=>{},...dt}=ve(X,xe),bt=await De(xe,dt),ft=V(Ne),pt=te(Ne),_t=$e(Ne)==="y",{width:Kt,height:fn}=Ee.floating;let hn,In;ft==="top"||ft==="bottom"?(hn=ft,In=pt===(await(Oe.isRTL==null?void 0:Oe.isRTL(Be.floating))?"start":"end")?"left":"right"):(In=ft,hn=pt==="end"?"top":"bottom");const lr=fn-bt.top-bt.bottom,Gn=Kt-bt.left-bt.right,Mn=ie(fn-bt[hn],lr),gr=ie(Kt-bt[In],Gn),er=!xe.middlewareData.shift;let _r=Mn,vs=gr;if(_t?vs=pt||er?ie(gr,Gn):Gn:_r=pt||er?ie(Mn,lr):lr,er&&!pt){const ro=W(bt.left,0),qs=W(bt.right,0),hs=W(bt.top,0),Ks=W(bt.bottom,0);_t?vs=Kt-2*(ro!==0||qs!==0?ro+qs:W(bt.left,bt.right)):_r=fn-2*(hs!==0||Ks!==0?hs+Ks:W(bt.top,bt.bottom))}await et({...xe,availableWidth:vs,availableHeight:_r});const ys=await Oe.getDimensions(Be.floating);return Kt!==ys.width||fn!==ys.height?{reset:{rects:!0}}:{}}}};function Ts(X){return rt(X)?(X.nodeName||"").toLowerCase():"#document"}function Zr(X){var xe;return(X==null||(xe=X.ownerDocument)==null?void 0:xe.defaultView)||window}function Bs(X){var xe;return(xe=(rt(X)?X.ownerDocument:X.document)||window.document)==null?void 0:xe.documentElement}function rt(X){return X instanceof Node||X instanceof Zr(X).Node}function zt(X){return X instanceof Element||X instanceof Zr(X).Element}function Hn(X){return X instanceof HTMLElement||X instanceof Zr(X).HTMLElement}function Nr(X){return typeof ShadowRoot>"u"?!1:X instanceof ShadowRoot||X instanceof Zr(X).ShadowRoot}function kr(X){const{overflow:xe,overflowX:Ne,overflowY:Ee,display:Oe}=sr(X);return/auto|scroll|overlay|hidden|clip/.test(xe+Ee+Ne)&&!["inline","contents"].includes(Oe)}function Xn(X){return["table","td","th"].includes(Ts(X))}function Jt(X){const xe=qn(),Ne=sr(X);return Ne.transform!=="none"||Ne.perspective!=="none"||(Ne.containerType?Ne.containerType!=="normal":!1)||!xe&&(Ne.backdropFilter?Ne.backdropFilter!=="none":!1)||!xe&&(Ne.filter?Ne.filter!=="none":!1)||["transform","perspective","filter"].some(Ee=>(Ne.willChange||"").includes(Ee))||["paint","layout","strict","content"].some(Ee=>(Ne.contain||"").includes(Ee))}function Xt(X){let xe=fs(X);for(;Hn(xe)&&!bn(xe);){if(Jt(xe))return xe;xe=fs(xe)}return null}function qn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function bn(X){return["html","body","#document"].includes(Ts(X))}function sr(X){return Zr(X).getComputedStyle(X)}function Jn(X){return zt(X)?{scrollLeft:X.scrollLeft,scrollTop:X.scrollTop}:{scrollLeft:X.pageXOffset,scrollTop:X.pageYOffset}}function fs(X){if(Ts(X)==="html")return X;const xe=X.assignedSlot||X.parentNode||Nr(X)&&X.host||Bs(X);return Nr(xe)?xe.host:xe}function Kn(X){const xe=fs(X);return bn(xe)?X.ownerDocument?X.ownerDocument.body:X.body:Hn(xe)&&kr(xe)?xe:Kn(xe)}function Ir(X,xe,Ne){var Ee;xe===void 0&&(xe=[]),Ne===void 0&&(Ne=!0);const Oe=Kn(X),Be=Oe===((Ee=X.ownerDocument)==null?void 0:Ee.body),et=Zr(Oe);return Be?xe.concat(et,et.visualViewport||[],kr(Oe)?Oe:[],et.frameElement&&Ne?Ir(et.frameElement):[]):xe.concat(Oe,Ir(Oe,[],Ne))}function Rr(X){const xe=sr(X);let Ne=parseFloat(xe.width)||0,Ee=parseFloat(xe.height)||0;const Oe=Hn(X),Be=Oe?X.offsetWidth:Ne,et=Oe?X.offsetHeight:Ee,dt=ee(Ne)!==Be||ee(Ee)!==et;return dt&&(Ne=Be,Ee=et),{width:Ne,height:Ee,$:dt}}function pr(X){return zt(X)?X:X.contextElement}function Tr(X){const xe=pr(X);if(!Hn(xe))return Z(1);const Ne=xe.getBoundingClientRect(),{width:Ee,height:Oe,$:Be}=Rr(xe);let et=(Be?ee(Ne.width):Ne.width)/Ee,dt=(Be?ee(Ne.height):Ne.height)/Oe;return(!et||!Number.isFinite(et))&&(et=1),(!dt||!Number.isFinite(dt))&&(dt=1),{x:et,y:dt}}const gt=Z(0);function _s(X){const xe=Zr(X);return!qn()||!xe.visualViewport?gt:{x:xe.visualViewport.offsetLeft,y:xe.visualViewport.offsetTop}}function cs(X,xe,Ne){return xe===void 0&&(xe=!1),!Ne||xe&&Ne!==Zr(X)?!1:xe}function Gr(X,xe,Ne,Ee){xe===void 0&&(xe=!1),Ne===void 0&&(Ne=!1);const Oe=X.getBoundingClientRect(),Be=pr(X);let et=Z(1);xe&&(Ee?zt(Ee)&&(et=Tr(Ee)):et=Tr(X));const dt=cs(Be,Ne,Ee)?_s(Be):Z(0);let bt=(Oe.left+dt.x)/et.x,ft=(Oe.top+dt.y)/et.y,pt=Oe.width/et.x,_t=Oe.height/et.y;if(Be){const Kt=Zr(Be),fn=Ee&&zt(Ee)?Zr(Ee):Ee;let hn=Kt,In=hn.frameElement;for(;In&&Ee&&fn!==hn;){const lr=Tr(In),Gn=In.getBoundingClientRect(),Mn=sr(In),gr=Gn.left+(In.clientLeft+parseFloat(Mn.paddingLeft))*lr.x,er=Gn.top+(In.clientTop+parseFloat(Mn.paddingTop))*lr.y;bt*=lr.x,ft*=lr.y,pt*=lr.x,_t*=lr.y,bt+=gr,ft+=er,hn=Zr(In),In=hn.frameElement}}return Vt({width:pt,height:_t,x:bt,y:ft})}const xr=[":popover-open",":modal"];function no(X){return xr.some(xe=>{try{return X.matches(xe)}catch{return!1}})}function ps(X){let{elements:xe,rect:Ne,offsetParent:Ee,strategy:Oe}=X;const Be=Oe==="fixed",et=Bs(Ee),dt=xe?no(xe.floating):!1;if(Ee===et||dt&&Be)return Ne;let bt={scrollLeft:0,scrollTop:0},ft=Z(1);const pt=Z(0),_t=Hn(Ee);if((_t||!_t&&!Be)&&((Ts(Ee)!=="body"||kr(et))&&(bt=Jn(Ee)),Hn(Ee))){const Kt=Gr(Ee);ft=Tr(Ee),pt.x=Kt.x+Ee.clientLeft,pt.y=Kt.y+Ee.clientTop}return{width:Ne.width*ft.x,height:Ne.height*ft.y,x:Ne.x*ft.x-bt.scrollLeft*ft.x+pt.x,y:Ne.y*ft.y-bt.scrollTop*ft.y+pt.y}}function ns(X){return Array.from(X.getClientRects())}function ss(X){return Gr(Bs(X)).left+Jn(X).scrollLeft}function Wo(X){const xe=Bs(X),Ne=Jn(X),Ee=X.ownerDocument.body,Oe=W(xe.scrollWidth,xe.clientWidth,Ee.scrollWidth,Ee.clientWidth),Be=W(xe.scrollHeight,xe.clientHeight,Ee.scrollHeight,Ee.clientHeight);let et=-Ne.scrollLeft+ss(X);const dt=-Ne.scrollTop;return sr(Ee).direction==="rtl"&&(et+=W(xe.clientWidth,Ee.clientWidth)-Oe),{width:Oe,height:Be,x:et,y:dt}}function _o(X,xe){const Ne=Zr(X),Ee=Bs(X),Oe=Ne.visualViewport;let Be=Ee.clientWidth,et=Ee.clientHeight,dt=0,bt=0;if(Oe){Be=Oe.width,et=Oe.height;const ft=qn();(!ft||ft&&xe==="fixed")&&(dt=Oe.offsetLeft,bt=Oe.offsetTop)}return{width:Be,height:et,x:dt,y:bt}}function ao(X,xe){const Ne=Gr(X,!0,xe==="fixed"),Ee=Ne.top+X.clientTop,Oe=Ne.left+X.clientLeft,Be=Hn(X)?Tr(X):Z(1),et=X.clientWidth*Be.x,dt=X.clientHeight*Be.y,bt=Oe*Be.x,ft=Ee*Be.y;return{width:et,height:dt,x:bt,y:ft}}function Ls(X,xe,Ne){let Ee;if(xe==="viewport")Ee=_o(X,Ne);else if(xe==="document")Ee=Wo(Bs(X));else if(zt(xe))Ee=ao(xe,Ne);else{const Oe=_s(X);Ee={...xe,x:xe.x-Oe.x,y:xe.y-Oe.y}}return Vt(Ee)}function So(X,xe){const Ne=fs(X);return Ne===xe||!zt(Ne)||bn(Ne)?!1:sr(Ne).position==="fixed"||So(Ne,xe)}function jr(X,xe){const Ne=xe.get(X);if(Ne)return Ne;let Ee=Ir(X,[],!1).filter(dt=>zt(dt)&&Ts(dt)!=="body"),Oe=null;const Be=sr(X).position==="fixed";let et=Be?fs(X):X;for(;zt(et)&&!bn(et);){const dt=sr(et),bt=Jt(et);!bt&&dt.position==="fixed"&&(Oe=null),(Be?!bt&&!Oe:!bt&&dt.position==="static"&&!!Oe&&["absolute","fixed"].includes(Oe.position)||kr(et)&&!bt&&So(X,et))?Ee=Ee.filter(pt=>pt!==et):Oe=dt,et=fs(et)}return xe.set(X,Ee),Ee}function Dn(X){let{element:xe,boundary:Ne,rootBoundary:Ee,strategy:Oe}=X;const et=[...Ne==="clippingAncestors"?no(xe)?[]:jr(xe,this._c):[].concat(Ne),Ee],dt=et[0],bt=et.reduce((ft,pt)=>{const _t=Ls(xe,pt,Oe);return ft.top=W(_t.top,ft.top),ft.right=ie(_t.right,ft.right),ft.bottom=ie(_t.bottom,ft.bottom),ft.left=W(_t.left,ft.left),ft},Ls(xe,dt,Oe));return{width:bt.right-bt.left,height:bt.bottom-bt.top,x:bt.left,y:bt.top}}function Dr(X){const{width:xe,height:Ne}=Rr(X);return{width:xe,height:Ne}}function Vs(X,xe,Ne){const Ee=Hn(xe),Oe=Bs(xe),Be=Ne==="fixed",et=Gr(X,!0,Be,xe);let dt={scrollLeft:0,scrollTop:0};const bt=Z(0);if(Ee||!Ee&&!Be)if((Ts(xe)!=="body"||kr(Oe))&&(dt=Jn(xe)),Ee){const _t=Gr(xe,!0,Be,xe);bt.x=_t.x+xe.clientLeft,bt.y=_t.y+xe.clientTop}else Oe&&(bt.x=ss(Oe));const ft=et.left+dt.scrollLeft-bt.x,pt=et.top+dt.scrollTop-bt.y;return{x:ft,y:pt,width:et.width,height:et.height}}function Mo(X){return sr(X).position==="static"}function qo(X,xe){return!Hn(X)||sr(X).position==="fixed"?null:xe?xe(X):X.offsetParent}function ui(X,xe){const Ne=Zr(X);if(no(X))return Ne;if(!Hn(X)){let Oe=fs(X);for(;Oe&&!bn(Oe);){if(zt(Oe)&&!Mo(Oe))return Oe;Oe=fs(Oe)}return Ne}let Ee=qo(X,xe);for(;Ee&&Xn(Ee)&&Mo(Ee);)Ee=qo(Ee,xe);return Ee&&bn(Ee)&&Mo(Ee)&&!Jt(Ee)?Ne:Ee||Xt(X)||Ne}const Wn=async function(X){const xe=this.getOffsetParent||ui,Ne=this.getDimensions,Ee=await Ne(X.floating);return{reference:Vs(X.reference,await xe(X.floating),X.strategy),floating:{x:0,y:0,width:Ee.width,height:Ee.height}}};function Me(X){return sr(X).direction==="rtl"}const Qe={convertOffsetParentRelativeRectToViewportRelativeRect:ps,getDocumentElement:Bs,getClippingRect:Dn,getOffsetParent:ui,getElementRects:Wn,getClientRects:ns,getDimensions:Dr,getScale:Tr,isElement:zt,isRTL:Me};function Ke(X,xe){let Ne=null,Ee;const Oe=Bs(X);function Be(){var dt;clearTimeout(Ee),(dt=Ne)==null||dt.disconnect(),Ne=null}function et(dt,bt){dt===void 0&&(dt=!1),bt===void 0&&(bt=1),Be();const{left:ft,top:pt,width:_t,height:Kt}=X.getBoundingClientRect();if(dt||xe(),!_t||!Kt)return;const fn=q(pt),hn=q(Oe.clientWidth-(ft+_t)),In=q(Oe.clientHeight-(pt+Kt)),lr=q(ft),Mn={rootMargin:-fn+"px "+-hn+"px "+-In+"px "+-lr+"px",threshold:W(0,ie(1,bt))||1};let gr=!0;function er(_r){const vs=_r[0].intersectionRatio;if(vs!==bt){if(!gr)return et();vs?et(!1,vs):Ee=setTimeout(()=>{et(!1,1e-7)},1e3)}gr=!1}try{Ne=new IntersectionObserver(er,{...Mn,root:Oe.ownerDocument})}catch{Ne=new IntersectionObserver(er,Mn)}Ne.observe(X)}return et(!0),Be}function ut(X,xe,Ne,Ee){Ee===void 0&&(Ee={});const{ancestorScroll:Oe=!0,ancestorResize:Be=!0,elementResize:et=typeof ResizeObserver=="function",layoutShift:dt=typeof IntersectionObserver=="function",animationFrame:bt=!1}=Ee,ft=pr(X),pt=Oe||Be?[...ft?Ir(ft):[],...Ir(xe)]:[];pt.forEach(Gn=>{Oe&&Gn.addEventListener("scroll",Ne,{passive:!0}),Be&&Gn.addEventListener("resize",Ne)});const _t=ft&&dt?Ke(ft,Ne):null;let Kt=-1,fn=null;et&&(fn=new ResizeObserver(Gn=>{let[Mn]=Gn;Mn&&Mn.target===ft&&fn&&(fn.unobserve(xe),cancelAnimationFrame(Kt),Kt=requestAnimationFrame(()=>{var gr;(gr=fn)==null||gr.observe(xe)})),Ne()}),ft&&!bt&&fn.observe(ft),fn.observe(xe));let hn,In=bt?Gr(X):null;bt&&lr();function lr(){const Gn=Gr(X);In&&(Gn.x!==In.x||Gn.y!==In.y||Gn.width!==In.width||Gn.height!==In.height)&&Ne(),In=Gn,hn=requestAnimationFrame(lr)}return Ne(),()=>{var Gn;pt.forEach(Mn=>{Oe&&Mn.removeEventListener("scroll",Ne),Be&&Mn.removeEventListener("resize",Ne)}),_t?.(),(Gn=fn)==null||Gn.disconnect(),fn=null,bt&&cancelAnimationFrame(hn)}}const Wt=null,cn=nr,Qt=null,be=rr,pe=He,le=wr,ue=Pe,K=ct,fe=Rn,_e=ar,Ve=(X,xe,Ne)=>{const Ee=new Map,Oe={platform:Qe,...Ne},Be={...Oe.platform,_c:Ee};return je(X,xe,{...Oe,platform:Be})}},6291:(a,l,se)=>{"use strict";se.d(l,{m:()=>ie});var we=se(6249),Te=se(7753);class ae extends we.Q{constructor(){super(),this.setup=ee=>{if(!Te.S$&&window.addEventListener){const q=()=>ee();return window.addEventListener("visibilitychange",q,!1),window.addEventListener("focus",q,!1),()=>{window.removeEventListener("visibilitychange",q),window.removeEventListener("focus",q)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var ee;(ee=this.cleanup)==null||ee.call(this),this.cleanup=void 0}}setEventListener(ee){var q;this.setup=ee,(q=this.cleanup)==null||q.call(this),this.cleanup=ee(Z=>{typeof Z=="boolean"?this.setFocused(Z):this.onFocus()})}setFocused(ee){this.focused!==ee&&(this.focused=ee,this.onFocus())}onFocus(){this.listeners.forEach(({listener:ee})=>{ee()})}isFocused(){return typeof this.focused=="boolean"?this.focused:typeof document>"u"?!0:[void 0,"visible","prerender"].includes(document.visibilityState)}}const ie=new ae},4876:(a,l,se)=>{"use strict";se.d(l,{PL:()=>we,RQ:()=>W,rB:()=>ie});function we(){return{onFetch:ee=>{ee.fetchFn=()=>{var q,Z,U,ge,ne,ve;const V=(q=ee.fetchOptions)==null||(Z=q.meta)==null?void 0:Z.refetchPage,te=(U=ee.fetchOptions)==null||(ge=U.meta)==null?void 0:ge.fetchMore,Re=te?.pageParam,Ie=te?.direction==="forward",$e=te?.direction==="backward",vt=((ne=ee.state.data)==null?void 0:ne.pages)||[],mt=((ve=ee.state.data)==null?void 0:ve.pageParams)||[];let It=mt,qe=!1;const nn=ze=>{Object.defineProperty(ze,"signal",{enumerable:!0,get:()=>{var je;if((je=ee.signal)!=null&&je.aborted)qe=!0;else{var De;(De=ee.signal)==null||De.addEventListener("abort",()=>{qe=!0})}return ee.signal}})},Ut=ee.options.queryFn||(()=>Promise.reject("Missing queryFn for queryKey '"+ee.options.queryHash+"'")),Xe=(ze,je,De,ct)=>(It=ct?[je,...It]:[...It,je],ct?[De,...ze]:[...ze,De]),Ft=(ze,je,De,ct)=>{if(qe)return Promise.reject("Cancelled");if(typeof De>"u"&&!je&&ze.length)return Promise.resolve(ze);const qt={queryKey:ee.queryKey,pageParam:De,meta:ee.options.meta};nn(qt);const z=Ut(qt);return Promise.resolve(z).then(Ct=>Xe(ze,De,Ct,ct))};let rn;if(!vt.length)rn=Ft([]);else if(Ie){const ze=typeof Re<"u",je=ze?Re:Te(ee.options,vt);rn=Ft(vt,ze,je)}else if($e){const ze=typeof Re<"u",je=ze?Re:ae(ee.options,vt);rn=Ft(vt,ze,je,!0)}else{It=[];const ze=typeof ee.options.getNextPageParam>"u";rn=(V&&vt[0]?V(vt[0],0,vt):!0)?Ft([],ze,mt[0]):Promise.resolve(Xe([],mt[0],vt[0]));for(let De=1;De<vt.length;De++)rn=rn.then(ct=>{if(V&&vt[De]?V(vt[De],De,vt):!0){const z=ze?mt[De]:Te(ee.options,ct);return Ft(ct,ze,z)}return Promise.resolve(Xe(ct,mt[De],vt[De]))})}return rn.then(ze=>({pages:ze,pageParams:It}))}}}}function Te(ee,q){return ee.getNextPageParam==null?void 0:ee.getNextPageParam(q[q.length-1],q)}function ae(ee,q){return ee.getPreviousPageParam==null?void 0:ee.getPreviousPageParam(q[0],q)}function ie(ee,q){if(ee.getNextPageParam&&Array.isArray(q)){const Z=Te(ee,q);return typeof Z<"u"&&Z!==null&&Z!==!1}}function W(ee,q){if(ee.getPreviousPageParam&&Array.isArray(q)){const Z=ae(ee,q);return typeof Z<"u"&&Z!==null&&Z!==!1}}},8250:(a,l,se)=>{"use strict";se.d(l,{U:()=>we});const we=console},1955:(a,l,se)=>{"use strict";se.d(l,{$:()=>ee,s:()=>W});var we=se(8250),Te=se(3190),ae=se(7273),ie=se(5265);class W extends ae.k{constructor(Z){super(),this.defaultOptions=Z.defaultOptions,this.mutationId=Z.mutationId,this.mutationCache=Z.mutationCache,this.logger=Z.logger||we.U,this.observers=[],this.state=Z.state||ee(),this.setOptions(Z.options),this.scheduleGc()}setOptions(Z){this.options={...this.defaultOptions,...Z},this.updateCacheTime(this.options.cacheTime)}get meta(){return this.options.meta}setState(Z){this.dispatch({type:"setState",state:Z})}addObserver(Z){this.observers.includes(Z)||(this.observers.push(Z),this.clearGcTimeout(),this.mutationCache.notify({type:"observerAdded",mutation:this,observer:Z}))}removeObserver(Z){this.observers=this.observers.filter(U=>U!==Z),this.scheduleGc(),this.mutationCache.notify({type:"observerRemoved",mutation:this,observer:Z})}optionalRemove(){this.observers.length||(this.state.status==="loading"?this.scheduleGc():this.mutationCache.remove(this))}continue(){var Z,U;return(Z=(U=this.retryer)==null?void 0:U.continue())!=null?Z:this.execute()}async execute(){const Z=()=>{var De;return this.retryer=(0,ie.II)({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:(ct,qt)=>{this.dispatch({type:"failed",failureCount:ct,error:qt})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:(De=this.options.retry)!=null?De:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise},U=this.state.status==="loading";try{var ge,ne,ve,V,te,Re,Ie,$e;if(!U){var vt,mt,It,qe;this.dispatch({type:"loading",variables:this.options.variables}),await((vt=(mt=this.mutationCache.config).onMutate)==null?void 0:vt.call(mt,this.state.variables,this));const ct=await((It=(qe=this.options).onMutate)==null?void 0:It.call(qe,this.state.variables));ct!==this.state.context&&this.dispatch({type:"loading",context:ct,variables:this.state.variables})}const De=await Z();return await((ge=(ne=this.mutationCache.config).onSuccess)==null?void 0:ge.call(ne,De,this.state.variables,this.state.context,this)),await((ve=(V=this.options).onSuccess)==null?void 0:ve.call(V,De,this.state.variables,this.state.context)),await((te=(Re=this.mutationCache.config).onSettled)==null?void 0:te.call(Re,De,null,this.state.variables,this.state.context,this)),await((Ie=($e=this.options).onSettled)==null?void 0:Ie.call($e,De,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:De}),De}catch(De){try{var nn,Ut,Xe,Ft,rn,Vt,ze,je;throw await((nn=(Ut=this.mutationCache.config).onError)==null?void 0:nn.call(Ut,De,this.state.variables,this.state.context,this)),await((Xe=(Ft=this.options).onError)==null?void 0:Xe.call(Ft,De,this.state.variables,this.state.context)),await((rn=(Vt=this.mutationCache.config).onSettled)==null?void 0:rn.call(Vt,void 0,De,this.state.variables,this.state.context,this)),await((ze=(je=this.options).onSettled)==null?void 0:ze.call(je,void 0,De,this.state.variables,this.state.context)),De}finally{this.dispatch({type:"error",error:De})}}}dispatch(Z){const U=ge=>{switch(Z.type){case"failed":return{...ge,failureCount:Z.failureCount,failureReason:Z.error};case"pause":return{...ge,isPaused:!0};case"continue":return{...ge,isPaused:!1};case"loading":return{...ge,context:Z.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!(0,ie.v_)(this.options.networkMode),status:"loading",variables:Z.variables};case"success":return{...ge,data:Z.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...ge,data:void 0,error:Z.error,failureCount:ge.failureCount+1,failureReason:Z.error,isPaused:!1,status:"error"};case"setState":return{...ge,...Z.state}}};this.state=U(this.state),Te.j.batch(()=>{this.observers.forEach(ge=>{ge.onMutationUpdate(Z)}),this.mutationCache.notify({mutation:this,type:"updated",action:Z})})}}function ee(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}},4255:(a,l,se)=>{"use strict";se.d(l,{q:()=>W});var we=se(3190),Te=se(1955),ae=se(7753),ie=se(6249);class W extends ie.Q{constructor(q){super(),this.config=q||{},this.mutations=[],this.mutationId=0}build(q,Z,U){const ge=new Te.s({mutationCache:this,logger:q.getLogger(),mutationId:++this.mutationId,options:q.defaultMutationOptions(Z),state:U,defaultOptions:Z.mutationKey?q.getMutationDefaults(Z.mutationKey):void 0});return this.add(ge),ge}add(q){this.mutations.push(q),this.notify({type:"added",mutation:q})}remove(q){this.mutations=this.mutations.filter(Z=>Z!==q),this.notify({type:"removed",mutation:q})}clear(){we.j.batch(()=>{this.mutations.forEach(q=>{this.remove(q)})})}getAll(){return this.mutations}find(q){return typeof q.exact>"u"&&(q.exact=!0),this.mutations.find(Z=>(0,ae.nJ)(q,Z))}findAll(q){return this.mutations.filter(Z=>(0,ae.nJ)(q,Z))}notify(q){we.j.batch(()=>{this.listeners.forEach(({listener:Z})=>{Z(q)})})}resumePausedMutations(){var q;return this.resuming=((q=this.resuming)!=null?q:Promise.resolve()).then(()=>{const Z=this.mutations.filter(U=>U.state.isPaused);return we.j.batch(()=>Z.reduce((U,ge)=>U.then(()=>ge.continue().catch(ae.lQ)),Promise.resolve()))}).then(()=>{this.resuming=void 0}),this.resuming}}},3190:(a,l,se)=>{"use strict";se.d(l,{j:()=>ae});var we=se(7753);function Te(){let ie=[],W=0,ee=te=>{te()},q=te=>{te()};const Z=te=>{let Re;W++;try{Re=te()}finally{W--,W||ne()}return Re},U=te=>{W?ie.push(te):(0,we.G6)(()=>{ee(te)})},ge=te=>(...Re)=>{U(()=>{te(...Re)})},ne=()=>{const te=ie;ie=[],te.length&&(0,we.G6)(()=>{q(()=>{te.forEach(Re=>{ee(Re)})})})};return{batch:Z,batchCalls:ge,schedule:U,setNotifyFunction:te=>{ee=te},setBatchNotifyFunction:te=>{q=te}}}const ae=Te()},7200:(a,l,se)=>{"use strict";se.d(l,{t:()=>W});var we=se(6249),Te=se(7753);const ae=["online","offline"];class ie extends we.Q{constructor(){super(),this.setup=q=>{if(!Te.S$&&window.addEventListener){const Z=()=>q();return ae.forEach(U=>{window.addEventListener(U,Z,!1)}),()=>{ae.forEach(U=>{window.removeEventListener(U,Z)})}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var q;(q=this.cleanup)==null||q.call(this),this.cleanup=void 0}}setEventListener(q){var Z;this.setup=q,(Z=this.cleanup)==null||Z.call(this),this.cleanup=q(U=>{typeof U=="boolean"?this.setOnline(U):this.onOnline()})}setOnline(q){this.online!==q&&(this.online=q,this.onOnline())}onOnline(){this.listeners.forEach(({listener:q})=>{q()})}isOnline(){return typeof this.online=="boolean"?this.online:typeof navigator>"u"||typeof navigator.onLine>"u"?!0:navigator.onLine}}const W=new ie},8919:(a,l,se)=>{"use strict";se.d(l,{$:()=>U});var we=se(7753),Te=se(8250),ae=se(3190),ie=se(5265),W=se(7273);class ee extends W.k{constructor(ne){super(),this.abortSignalConsumed=!1,this.defaultOptions=ne.defaultOptions,this.setOptions(ne.options),this.observers=[],this.cache=ne.cache,this.logger=ne.logger||Te.U,this.queryKey=ne.queryKey,this.queryHash=ne.queryHash,this.initialState=ne.state||q(this.options),this.state=this.initialState,this.scheduleGc()}get meta(){return this.options.meta}setOptions(ne){this.options={...this.defaultOptions,...ne},this.updateCacheTime(this.options.cacheTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.cache.remove(this)}setData(ne,ve){const V=(0,we.pl)(this.state.data,ne,this.options);return this.dispatch({data:V,type:"success",dataUpdatedAt:ve?.updatedAt,manual:ve?.manual}),V}setState(ne,ve){this.dispatch({type:"setState",state:ne,setStateOptions:ve})}cancel(ne){var ve;const V=this.promise;return(ve=this.retryer)==null||ve.cancel(ne),V?V.then(we.lQ).catch(we.lQ):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.initialState)}isActive(){return this.observers.some(ne=>ne.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.observers.some(ne=>ne.getCurrentResult().isStale)}isStaleByTime(ne=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!(0,we.j3)(this.state.dataUpdatedAt,ne)}onFocus(){var ne;const ve=this.observers.find(V=>V.shouldFetchOnWindowFocus());ve&&ve.refetch({cancelRefetch:!1}),(ne=this.retryer)==null||ne.continue()}onOnline(){var ne;const ve=this.observers.find(V=>V.shouldFetchOnReconnect());ve&&ve.refetch({cancelRefetch:!1}),(ne=this.retryer)==null||ne.continue()}addObserver(ne){this.observers.includes(ne)||(this.observers.push(ne),this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:ne}))}removeObserver(ne){this.observers.includes(ne)&&(this.observers=this.observers.filter(ve=>ve!==ne),this.observers.length||(this.retryer&&(this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.scheduleGc()),this.cache.notify({type:"observerRemoved",query:this,observer:ne}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.dispatch({type:"invalidate"})}fetch(ne,ve){var V,te;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&ve!=null&&ve.cancelRefetch)this.cancel({silent:!0});else if(this.promise){var Re;return(Re=this.retryer)==null||Re.continueRetry(),this.promise}}if(ne&&this.setOptions(ne),!this.options.queryFn){const Ut=this.observers.find(Xe=>Xe.options.queryFn);Ut&&this.setOptions(Ut.options)}const Ie=(0,we.jY)(),$e={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},vt=Ut=>{Object.defineProperty(Ut,"signal",{enumerable:!0,get:()=>{if(Ie)return this.abortSignalConsumed=!0,Ie.signal}})};vt($e);const mt=()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn($e)):Promise.reject("Missing queryFn for queryKey '"+this.options.queryHash+"'"),It={fetchOptions:ve,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:mt};if(vt(It),(V=this.options.behavior)==null||V.onFetch(It),this.revertState=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==((te=It.fetchOptions)==null?void 0:te.meta)){var qe;this.dispatch({type:"fetch",meta:(qe=It.fetchOptions)==null?void 0:qe.meta})}const nn=Ut=>{if((0,ie.wm)(Ut)&&Ut.silent||this.dispatch({type:"error",error:Ut}),!(0,ie.wm)(Ut)){var Xe,Ft,rn,Vt;(Xe=(Ft=this.cache.config).onError)==null||Xe.call(Ft,Ut,this),(rn=(Vt=this.cache.config).onSettled)==null||rn.call(Vt,this.state.data,Ut,this)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=(0,ie.II)({fn:It.fetchFn,abort:Ie?.abort.bind(Ie),onSuccess:Ut=>{var Xe,Ft,rn,Vt;if(typeof Ut>"u"){nn(new Error(this.queryHash+" data is undefined"));return}this.setData(Ut),(Xe=(Ft=this.cache.config).onSuccess)==null||Xe.call(Ft,Ut,this),(rn=(Vt=this.cache.config).onSettled)==null||rn.call(Vt,Ut,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:nn,onFail:(Ut,Xe)=>{this.dispatch({type:"failed",failureCount:Ut,error:Xe})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:It.options.retry,retryDelay:It.options.retryDelay,networkMode:It.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(ne){const ve=V=>{var te,Re;switch(ne.type){case"failed":return{...V,fetchFailureCount:ne.failureCount,fetchFailureReason:ne.error};case"pause":return{...V,fetchStatus:"paused"};case"continue":return{...V,fetchStatus:"fetching"};case"fetch":return{...V,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:(te=ne.meta)!=null?te:null,fetchStatus:(0,ie.v_)(this.options.networkMode)?"fetching":"paused",...!V.dataUpdatedAt&&{error:null,status:"loading"}};case"success":return{...V,data:ne.data,dataUpdateCount:V.dataUpdateCount+1,dataUpdatedAt:(Re=ne.dataUpdatedAt)!=null?Re:Date.now(),error:null,isInvalidated:!1,status:"success",...!ne.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const Ie=ne.error;return(0,ie.wm)(Ie)&&Ie.revert&&this.revertState?{...this.revertState,fetchStatus:"idle"}:{...V,error:Ie,errorUpdateCount:V.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:V.fetchFailureCount+1,fetchFailureReason:Ie,fetchStatus:"idle",status:"error"};case"invalidate":return{...V,isInvalidated:!0};case"setState":return{...V,...ne.state}}};this.state=ve(this.state),ae.j.batch(()=>{this.observers.forEach(V=>{V.onQueryUpdate(ne)}),this.cache.notify({query:this,type:"updated",action:ne})})}}function q(ge){const ne=typeof ge.initialData=="function"?ge.initialData():ge.initialData,ve=typeof ne<"u",V=ve?typeof ge.initialDataUpdatedAt=="function"?ge.initialDataUpdatedAt():ge.initialDataUpdatedAt:0;return{data:ne,dataUpdateCount:0,dataUpdatedAt:ve?V??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:ve?"success":"loading",fetchStatus:"idle"}}var Z=se(6249);class U extends Z.Q{constructor(ne){super(),this.config=ne||{},this.queries=[],this.queriesMap={}}build(ne,ve,V){var te;const Re=ve.queryKey,Ie=(te=ve.queryHash)!=null?te:(0,we.F$)(Re,ve);let $e=this.get(Ie);return $e||($e=new ee({cache:this,logger:ne.getLogger(),queryKey:Re,queryHash:Ie,options:ne.defaultQueryOptions(ve),state:V,defaultOptions:ne.getQueryDefaults(Re)}),this.add($e)),$e}add(ne){this.queriesMap[ne.queryHash]||(this.queriesMap[ne.queryHash]=ne,this.queries.push(ne),this.notify({type:"added",query:ne}))}remove(ne){const ve=this.queriesMap[ne.queryHash];ve&&(ne.destroy(),this.queries=this.queries.filter(V=>V!==ne),ve===ne&&delete this.queriesMap[ne.queryHash],this.notify({type:"removed",query:ne}))}clear(){ae.j.batch(()=>{this.queries.forEach(ne=>{this.remove(ne)})})}get(ne){return this.queriesMap[ne]}getAll(){return this.queries}find(ne,ve){const[V]=(0,we.b_)(ne,ve);return typeof V.exact>"u"&&(V.exact=!0),this.queries.find(te=>(0,we.MK)(V,te))}findAll(ne,ve){const[V]=(0,we.b_)(ne,ve);return Object.keys(V).length>0?this.queries.filter(te=>(0,we.MK)(V,te)):this.queries}notify(ne){ae.j.batch(()=>{this.listeners.forEach(({listener:ve})=>{ve(ne)})})}onFocus(){ae.j.batch(()=>{this.queries.forEach(ne=>{ne.onFocus()})})}onOnline(){ae.j.batch(()=>{this.queries.forEach(ne=>{ne.onOnline()})})}}},7367:(a,l,se)=>{"use strict";se.d(l,{E:()=>U});var we=se(7753),Te=se(8919),ae=se(4255),ie=se(6291),W=se(7200),ee=se(3190),q=se(4876),Z=se(8250);class U{constructor(ne={}){this.queryCache=ne.queryCache||new Te.$,this.mutationCache=ne.mutationCache||new ae.q,this.logger=ne.logger||Z.U,this.defaultOptions=ne.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[],this.mountCount=0}mount(){this.mountCount++,this.mountCount===1&&(this.unsubscribeFocus=ie.m.subscribe(()=>{ie.m.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=W.t.subscribe(()=>{W.t.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())}))}unmount(){var ne,ve;this.mountCount--,this.mountCount===0&&((ne=this.unsubscribeFocus)==null||ne.call(this),this.unsubscribeFocus=void 0,(ve=this.unsubscribeOnline)==null||ve.call(this),this.unsubscribeOnline=void 0)}isFetching(ne,ve){const[V]=(0,we.b_)(ne,ve);return V.fetchStatus="fetching",this.queryCache.findAll(V).length}isMutating(ne){return this.mutationCache.findAll({...ne,fetching:!0}).length}getQueryData(ne,ve){var V;return(V=this.queryCache.find(ne,ve))==null?void 0:V.state.data}ensureQueryData(ne,ve,V){const te=(0,we.vh)(ne,ve,V),Re=this.getQueryData(te.queryKey);return Re?Promise.resolve(Re):this.fetchQuery(te)}getQueriesData(ne){return this.getQueryCache().findAll(ne).map(({queryKey:ve,state:V})=>{const te=V.data;return[ve,te]})}setQueryData(ne,ve,V){const te=this.queryCache.find(ne),Re=te?.state.data,Ie=(0,we.Zw)(ve,Re);if(typeof Ie>"u")return;const $e=(0,we.vh)(ne),vt=this.defaultQueryOptions($e);return this.queryCache.build(this,vt).setData(Ie,{...V,manual:!0})}setQueriesData(ne,ve,V){return ee.j.batch(()=>this.getQueryCache().findAll(ne).map(({queryKey:te})=>[te,this.setQueryData(te,ve,V)]))}getQueryState(ne,ve){var V;return(V=this.queryCache.find(ne,ve))==null?void 0:V.state}removeQueries(ne,ve){const[V]=(0,we.b_)(ne,ve),te=this.queryCache;ee.j.batch(()=>{te.findAll(V).forEach(Re=>{te.remove(Re)})})}resetQueries(ne,ve,V){const[te,Re]=(0,we.b_)(ne,ve,V),Ie=this.queryCache,$e={type:"active",...te};return ee.j.batch(()=>(Ie.findAll(te).forEach(vt=>{vt.reset()}),this.refetchQueries($e,Re)))}cancelQueries(ne,ve,V){const[te,Re={}]=(0,we.b_)(ne,ve,V);typeof Re.revert>"u"&&(Re.revert=!0);const Ie=ee.j.batch(()=>this.queryCache.findAll(te).map($e=>$e.cancel(Re)));return Promise.all(Ie).then(we.lQ).catch(we.lQ)}invalidateQueries(ne,ve,V){const[te,Re]=(0,we.b_)(ne,ve,V);return ee.j.batch(()=>{var Ie,$e;if(this.queryCache.findAll(te).forEach(mt=>{mt.invalidate()}),te.refetchType==="none")return Promise.resolve();const vt={...te,type:(Ie=($e=te.refetchType)!=null?$e:te.type)!=null?Ie:"active"};return this.refetchQueries(vt,Re)})}refetchQueries(ne,ve,V){const[te,Re]=(0,we.b_)(ne,ve,V),Ie=ee.j.batch(()=>this.queryCache.findAll(te).filter(vt=>!vt.isDisabled()).map(vt=>{var mt;return vt.fetch(void 0,{...Re,cancelRefetch:(mt=Re?.cancelRefetch)!=null?mt:!0,meta:{refetchPage:te.refetchPage}})}));let $e=Promise.all(Ie).then(we.lQ);return Re!=null&&Re.throwOnError||($e=$e.catch(we.lQ)),$e}fetchQuery(ne,ve,V){const te=(0,we.vh)(ne,ve,V),Re=this.defaultQueryOptions(te);typeof Re.retry>"u"&&(Re.retry=!1);const Ie=this.queryCache.build(this,Re);return Ie.isStaleByTime(Re.staleTime)?Ie.fetch(Re):Promise.resolve(Ie.state.data)}prefetchQuery(ne,ve,V){return this.fetchQuery(ne,ve,V).then(we.lQ).catch(we.lQ)}fetchInfiniteQuery(ne,ve,V){const te=(0,we.vh)(ne,ve,V);return te.behavior=(0,q.PL)(),this.fetchQuery(te)}prefetchInfiniteQuery(ne,ve,V){return this.fetchInfiniteQuery(ne,ve,V).then(we.lQ).catch(we.lQ)}resumePausedMutations(){return this.mutationCache.resumePausedMutations()}getQueryCache(){return this.queryCache}getMutationCache(){return this.mutationCache}getLogger(){return this.logger}getDefaultOptions(){return this.defaultOptions}setDefaultOptions(ne){this.defaultOptions=ne}setQueryDefaults(ne,ve){const V=this.queryDefaults.find(te=>(0,we.Od)(ne)===(0,we.Od)(te.queryKey));V?V.defaultOptions=ve:this.queryDefaults.push({queryKey:ne,defaultOptions:ve})}getQueryDefaults(ne){if(!ne)return;const ve=this.queryDefaults.find(V=>(0,we.Cp)(ne,V.queryKey));return ve?.defaultOptions}setMutationDefaults(ne,ve){const V=this.mutationDefaults.find(te=>(0,we.Od)(ne)===(0,we.Od)(te.mutationKey));V?V.defaultOptions=ve:this.mutationDefaults.push({mutationKey:ne,defaultOptions:ve})}getMutationDefaults(ne){if(!ne)return;const ve=this.mutationDefaults.find(V=>(0,we.Cp)(ne,V.mutationKey));return ve?.defaultOptions}defaultQueryOptions(ne){if(ne!=null&&ne._defaulted)return ne;const ve={...this.defaultOptions.queries,...this.getQueryDefaults(ne?.queryKey),...ne,_defaulted:!0};return!ve.queryHash&&ve.queryKey&&(ve.queryHash=(0,we.F$)(ve.queryKey,ve)),typeof ve.refetchOnReconnect>"u"&&(ve.refetchOnReconnect=ve.networkMode!=="always"),typeof ve.useErrorBoundary>"u"&&(ve.useErrorBoundary=!!ve.suspense),ve}defaultMutationOptions(ne){return ne!=null&&ne._defaulted?ne:{...this.defaultOptions.mutations,...this.getMutationDefaults(ne?.mutationKey),...ne,_defaulted:!0}}clear(){this.queryCache.clear(),this.mutationCache.clear()}}},2532:(a,l,se)=>{"use strict";se.d(l,{$:()=>ee});var we=se(7753),Te=se(3190),ae=se(6291),ie=se(6249),W=se(5265);class ee extends ie.Q{constructor(te,Re){super(),this.client=te,this.options=Re,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(Re)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.currentQuery.addObserver(this),Z(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return U(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return U(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(te,Re){const Ie=this.options,$e=this.currentQuery;if(this.options=this.client.defaultQueryOptions(te),(0,we.f8)(Ie,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=Ie.queryKey),this.updateQuery();const vt=this.hasListeners();vt&&ge(this.currentQuery,$e,this.options,Ie)&&this.executeFetch(),this.updateResult(Re),vt&&(this.currentQuery!==$e||this.options.enabled!==Ie.enabled||this.options.staleTime!==Ie.staleTime)&&this.updateStaleTimeout();const mt=this.computeRefetchInterval();vt&&(this.currentQuery!==$e||this.options.enabled!==Ie.enabled||mt!==this.currentRefetchInterval)&&this.updateRefetchInterval(mt)}getOptimisticResult(te){const Re=this.client.getQueryCache().build(this.client,te),Ie=this.createResult(Re,te);return ve(this,Ie,te)&&(this.currentResult=Ie,this.currentResultOptions=this.options,this.currentResultState=this.currentQuery.state),Ie}getCurrentResult(){return this.currentResult}trackResult(te){const Re={};return Object.keys(te).forEach(Ie=>{Object.defineProperty(Re,Ie,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(Ie),te[Ie])})}),Re}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch({refetchPage:te,...Re}={}){return this.fetch({...Re,meta:{refetchPage:te}})}fetchOptimistic(te){const Re=this.client.defaultQueryOptions(te),Ie=this.client.getQueryCache().build(this.client,Re);return Ie.isFetchingOptimistic=!0,Ie.fetch().then(()=>this.createResult(Ie,Re))}fetch(te){var Re;return this.executeFetch({...te,cancelRefetch:(Re=te.cancelRefetch)!=null?Re:!0}).then(()=>(this.updateResult(),this.currentResult))}executeFetch(te){this.updateQuery();let Re=this.currentQuery.fetch(this.options,te);return te!=null&&te.throwOnError||(Re=Re.catch(we.lQ)),Re}updateStaleTimeout(){if(this.clearStaleTimeout(),we.S$||this.currentResult.isStale||!(0,we.gn)(this.options.staleTime))return;const Re=(0,we.j3)(this.currentResult.dataUpdatedAt,this.options.staleTime)+1;this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},Re)}computeRefetchInterval(){var te;return typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.currentResult.data,this.currentQuery):(te=this.options.refetchInterval)!=null?te:!1}updateRefetchInterval(te){this.clearRefetchInterval(),this.currentRefetchInterval=te,!(we.S$||this.options.enabled===!1||!(0,we.gn)(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||ae.m.isFocused())&&this.executeFetch()},this.currentRefetchInterval))}updateTimers(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}clearStaleTimeout(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}clearRefetchInterval(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}createResult(te,Re){const Ie=this.currentQuery,$e=this.options,vt=this.currentResult,mt=this.currentResultState,It=this.currentResultOptions,qe=te!==Ie,nn=qe?te.state:this.currentQueryInitialState,Ut=qe?this.currentResult:this.previousQueryResult,{state:Xe}=te;let{dataUpdatedAt:Ft,error:rn,errorUpdatedAt:Vt,fetchStatus:ze,status:je}=Xe,De=!1,ct=!1,qt;if(Re._optimisticResults){const Pe=this.hasListeners(),yt=!Pe&&Z(te,Re),un=Pe&&ge(te,Ie,Re,$e);(yt||un)&&(ze=(0,W.v_)(te.options.networkMode)?"fetching":"paused",Ft||(je="loading")),Re._optimisticResults==="isRestoring"&&(ze="idle")}if(Re.keepPreviousData&&!Xe.dataUpdatedAt&&Ut!=null&&Ut.isSuccess&&je!=="error")qt=Ut.data,Ft=Ut.dataUpdatedAt,je=Ut.status,De=!0;else if(Re.select&&typeof Xe.data<"u")if(vt&&Xe.data===mt?.data&&Re.select===this.selectFn)qt=this.selectResult;else try{this.selectFn=Re.select,qt=Re.select(Xe.data),qt=(0,we.pl)(vt?.data,qt,Re),this.selectResult=qt,this.selectError=null}catch(Pe){this.selectError=Pe}else qt=Xe.data;if(typeof Re.placeholderData<"u"&&typeof qt>"u"&&je==="loading"){let Pe;if(vt!=null&&vt.isPlaceholderData&&Re.placeholderData===It?.placeholderData)Pe=vt.data;else if(Pe=typeof Re.placeholderData=="function"?Re.placeholderData():Re.placeholderData,Re.select&&typeof Pe<"u")try{Pe=Re.select(Pe),this.selectError=null}catch(yt){this.selectError=yt}typeof Pe<"u"&&(je="success",qt=(0,we.pl)(vt?.data,Pe,Re),ct=!0)}this.selectError&&(rn=this.selectError,qt=this.selectResult,Vt=Date.now(),je="error");const z=ze==="fetching",He=je==="loading",Ct=je==="error";return{status:je,fetchStatus:ze,isLoading:He,isSuccess:je==="success",isError:Ct,isInitialLoading:He&&z,data:qt,dataUpdatedAt:Ft,error:rn,errorUpdatedAt:Vt,failureCount:Xe.fetchFailureCount,failureReason:Xe.fetchFailureReason,errorUpdateCount:Xe.errorUpdateCount,isFetched:Xe.dataUpdateCount>0||Xe.errorUpdateCount>0,isFetchedAfterMount:Xe.dataUpdateCount>nn.dataUpdateCount||Xe.errorUpdateCount>nn.errorUpdateCount,isFetching:z,isRefetching:z&&!He,isLoadingError:Ct&&Xe.dataUpdatedAt===0,isPaused:ze==="paused",isPlaceholderData:ct,isPreviousData:De,isRefetchError:Ct&&Xe.dataUpdatedAt!==0,isStale:ne(te,Re),refetch:this.refetch,remove:this.remove}}updateResult(te){const Re=this.currentResult,Ie=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,(0,we.f8)(Ie,Re))return;this.currentResult=Ie;const $e={cache:!0},vt=()=>{if(!Re)return!0;const{notifyOnChangeProps:mt}=this.options,It=typeof mt=="function"?mt():mt;if(It==="all"||!It&&!this.trackedProps.size)return!0;const qe=new Set(It??this.trackedProps);return this.options.useErrorBoundary&&qe.add("error"),Object.keys(this.currentResult).some(nn=>{const Ut=nn;return this.currentResult[Ut]!==Re[Ut]&&qe.has(Ut)})};te?.listeners!==!1&&vt()&&($e.listeners=!0),this.notify({...$e,...te})}updateQuery(){const te=this.client.getQueryCache().build(this.client,this.options);if(te===this.currentQuery)return;const Re=this.currentQuery;this.currentQuery=te,this.currentQueryInitialState=te.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(Re?.removeObserver(this),te.addObserver(this))}onQueryUpdate(te){const Re={};te.type==="success"?Re.onSuccess=!te.manual:te.type==="error"&&!(0,W.wm)(te.error)&&(Re.onError=!0),this.updateResult(Re),this.hasListeners()&&this.updateTimers()}notify(te){Te.j.batch(()=>{if(te.onSuccess){var Re,Ie,$e,vt;(Re=(Ie=this.options).onSuccess)==null||Re.call(Ie,this.currentResult.data),($e=(vt=this.options).onSettled)==null||$e.call(vt,this.currentResult.data,null)}else if(te.onError){var mt,It,qe,nn;(mt=(It=this.options).onError)==null||mt.call(It,this.currentResult.error),(qe=(nn=this.options).onSettled)==null||qe.call(nn,void 0,this.currentResult.error)}te.listeners&&this.listeners.forEach(({listener:Ut})=>{Ut(this.currentResult)}),te.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function q(V,te){return te.enabled!==!1&&!V.state.dataUpdatedAt&&!(V.state.status==="error"&&te.retryOnMount===!1)}function Z(V,te){return q(V,te)||V.state.dataUpdatedAt>0&&U(V,te,te.refetchOnMount)}function U(V,te,Re){if(te.enabled!==!1){const Ie=typeof Re=="function"?Re(V):Re;return Ie==="always"||Ie!==!1&&ne(V,te)}return!1}function ge(V,te,Re,Ie){return Re.enabled!==!1&&(V!==te||Ie.enabled===!1)&&(!Re.suspense||V.state.status!=="error")&&ne(V,Re)}function ne(V,te){return V.isStaleByTime(te.staleTime)}function ve(V,te,Re){return Re.keepPreviousData?!1:Re.placeholderData!==void 0?te.isPlaceholderData:!(0,we.f8)(V.getCurrentResult(),te)}},7273:(a,l,se)=>{"use strict";se.d(l,{k:()=>Te});var we=se(7753);class Te{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,we.gn)(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(ie){this.cacheTime=Math.max(this.cacheTime||0,ie??(we.S$?1/0:3e5))}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}},5265:(a,l,se)=>{"use strict";se.d(l,{II:()=>Z,v_:()=>W,wm:()=>q});var we=se(6291),Te=se(7200),ae=se(7753);function ie(U){return Math.min(1e3*2**U,3e4)}function W(U){return(U??"online")==="online"?Te.t.isOnline():!0}class ee{constructor(ge){this.revert=ge?.revert,this.silent=ge?.silent}}function q(U){return U instanceof ee}function Z(U){let ge=!1,ne=0,ve=!1,V,te,Re;const Ie=new Promise((Ft,rn)=>{te=Ft,Re=rn}),$e=Ft=>{ve||(nn(new ee(Ft)),U.abort==null||U.abort())},vt=()=>{ge=!0},mt=()=>{ge=!1},It=()=>!we.m.isFocused()||U.networkMode!=="always"&&!Te.t.isOnline(),qe=Ft=>{ve||(ve=!0,U.onSuccess==null||U.onSuccess(Ft),V?.(),te(Ft))},nn=Ft=>{ve||(ve=!0,U.onError==null||U.onError(Ft),V?.(),Re(Ft))},Ut=()=>new Promise(Ft=>{V=rn=>{const Vt=ve||!It();return Vt&&Ft(rn),Vt},U.onPause==null||U.onPause()}).then(()=>{V=void 0,ve||U.onContinue==null||U.onContinue()}),Xe=()=>{if(ve)return;let Ft;try{Ft=U.fn()}catch(rn){Ft=Promise.reject(rn)}Promise.resolve(Ft).then(qe).catch(rn=>{var Vt,ze;if(ve)return;const je=(Vt=U.retry)!=null?Vt:3,De=(ze=U.retryDelay)!=null?ze:ie,ct=typeof De=="function"?De(ne,rn):De,qt=je===!0||typeof je=="number"&&ne<je||typeof je=="function"&&je(ne,rn);if(ge||!qt){nn(rn);return}ne++,U.onFail==null||U.onFail(ne,rn),(0,ae.yy)(ct).then(()=>{if(It())return Ut()}).then(()=>{ge?nn(rn):Xe()})})};return W(U.networkMode)?Xe():Ut().then(Xe),{promise:Ie,cancel:$e,continue:()=>V?.()?Ie:Promise.resolve(),cancelRetry:vt,continueRetry:mt}}},6249:(a,l,se)=>{"use strict";se.d(l,{Q:()=>we});class we{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(ae){const ie={listener:ae};return this.listeners.add(ie),this.onSubscribe(),()=>{this.listeners.delete(ie),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}},7753:(a,l,se)=>{"use strict";se.d(l,{Cp:()=>Ie,F$:()=>te,G6:()=>rn,GR:()=>U,MK:()=>ve,Od:()=>Re,S$:()=>we,Zw:()=>ae,b_:()=>ge,f8:()=>mt,gn:()=>ie,j3:()=>q,jY:()=>Vt,lQ:()=>Te,nJ:()=>V,pl:()=>ze,vh:()=>Z,yy:()=>Ft});const we=typeof window>"u"||"Deno"in window;function Te(){}function ae(je,De){return typeof je=="function"?je(De):je}function ie(je){return typeof je=="number"&&je>=0&&je!==1/0}function W(je,De){return je.filter(ct=>!De.includes(ct))}function ee(je,De,ct){const qt=je.slice(0);return qt[De]=ct,qt}function q(je,De){return Math.max(je+(De||0)-Date.now(),0)}function Z(je,De,ct){return Ut(je)?typeof De=="function"?{...ct,queryKey:je,queryFn:De}:{...De,queryKey:je}:je}function U(je,De,ct){return Ut(je)?typeof De=="function"?{...ct,mutationKey:je,mutationFn:De}:{...De,mutationKey:je}:typeof je=="function"?{...De,mutationFn:je}:{...je}}function ge(je,De,ct){return Ut(je)?[{...De,queryKey:je},ct]:[je||{},De]}function ne(je,De,ct){return Ut(je)?[{...De,mutationKey:je},ct]:[je||{},De]}function ve(je,De){const{type:ct="all",exact:qt,fetchStatus:z,predicate:He,queryKey:Ct,stale:kt}=je;if(Ut(Ct)){if(qt){if(De.queryHash!==te(Ct,De.options))return!1}else if(!Ie(De.queryKey,Ct))return!1}if(ct!=="all"){const Pe=De.isActive();if(ct==="active"&&!Pe||ct==="inactive"&&Pe)return!1}return!(typeof kt=="boolean"&&De.isStale()!==kt||typeof z<"u"&&z!==De.state.fetchStatus||He&&!He(De))}function V(je,De){const{exact:ct,fetching:qt,predicate:z,mutationKey:He}=je;if(Ut(He)){if(!De.options.mutationKey)return!1;if(ct){if(Re(De.options.mutationKey)!==Re(He))return!1}else if(!Ie(De.options.mutationKey,He))return!1}return!(typeof qt=="boolean"&&De.state.status==="loading"!==qt||z&&!z(De))}function te(je,De){return(De?.queryKeyHashFn||Re)(je)}function Re(je){return JSON.stringify(je,(De,ct)=>qe(ct)?Object.keys(ct).sort().reduce((qt,z)=>(qt[z]=ct[z],qt),{}):ct)}function Ie(je,De){return $e(je,De)}function $e(je,De){return je===De?!0:typeof je!=typeof De?!1:je&&De&&typeof je=="object"&&typeof De=="object"?!Object.keys(De).some(ct=>!$e(je[ct],De[ct])):!1}function vt(je,De){if(je===De)return je;const ct=It(je)&&It(De);if(ct||qe(je)&&qe(De)){const qt=ct?je.length:Object.keys(je).length,z=ct?De:Object.keys(De),He=z.length,Ct=ct?[]:{};let kt=0;for(let Pe=0;Pe<He;Pe++){const yt=ct?Pe:z[Pe];Ct[yt]=vt(je[yt],De[yt]),Ct[yt]===je[yt]&&kt++}return qt===He&&kt===qt?je:Ct}return De}function mt(je,De){if(je&&!De||De&&!je)return!1;for(const ct in je)if(je[ct]!==De[ct])return!1;return!0}function It(je){return Array.isArray(je)&&je.length===Object.keys(je).length}function qe(je){if(!nn(je))return!1;const De=je.constructor;if(typeof De>"u")return!0;const ct=De.prototype;return!(!nn(ct)||!ct.hasOwnProperty("isPrototypeOf"))}function nn(je){return Object.prototype.toString.call(je)==="[object Object]"}function Ut(je){return Array.isArray(je)}function Xe(je){return je instanceof Error}function Ft(je){return new Promise(De=>{setTimeout(De,je)})}function rn(je){Ft(0).then(je)}function Vt(){if(typeof AbortController=="function")return new AbortController}function ze(je,De,ct){return ct.isDataEqual!=null&&ct.isDataEqual(je,De)?je:typeof ct.structuralSharing=="function"?ct.structuralSharing(je,De):ct.structuralSharing!==!1?vt(je,De):De}},8138:(a,l,se)=>{"use strict";se.d(l,{Ht:()=>ee,jE:()=>W});var we=se(6194);const Te=we.createContext(void 0),ae=we.createContext(!1);function ie(q,Z){return q||(Z&&typeof window<"u"?(window.ReactQueryClientContext||(window.ReactQueryClientContext=Te),window.ReactQueryClientContext):Te)}const W=({context:q}={})=>{const Z=we.useContext(ie(q,we.useContext(ae)));if(!Z)throw new Error("No QueryClient set, use QueryClientProvider to set one");return Z},ee=({client:q,children:Z,context:U,contextSharing:ge=!1})=>{we.useEffect(()=>(q.mount(),()=>{q.unmount()}),[q]);const ne=ie(U,ge);return we.createElement(ae.Provider,{value:!U&&ge},we.createElement(ne.Provider,{value:q},Z))}},9233:(a,l,se)=>{"use strict";se.d(l,{t:()=>It});var we=se(6194),Te=se(3190),ae=se(9176);function ie(){let qe=!1;return{clearReset:()=>{qe=!1},reset:()=>{qe=!0},isReset:()=>qe}}const W=we.createContext(ie()),ee=()=>we.useContext(W),q=({children:qe})=>{const[nn]=React.useState(()=>ie());return React.createElement(W.Provider,{value:nn},typeof qe=="function"?qe(nn):qe)};var Z=se(8138);const U=we.createContext(!1),ge=()=>we.useContext(U),ne=U.Provider;var ve=se(8539);const V=(qe,nn)=>{(qe.suspense||qe.useErrorBoundary)&&(nn.isReset()||(qe.retryOnMount=!1))},te=qe=>{we.useEffect(()=>{qe.clearReset()},[qe])},Re=({result:qe,errorResetBoundary:nn,useErrorBoundary:Ut,query:Xe})=>qe.isError&&!nn.isReset()&&!qe.isFetching&&(0,ve.G)(Ut,[qe.error,Xe]),Ie=qe=>{qe.suspense&&typeof qe.staleTime!="number"&&(qe.staleTime=1e3)},$e=(qe,nn)=>qe.isLoading&&qe.isFetching&&!nn,vt=(qe,nn,Ut)=>qe?.suspense&&$e(nn,Ut),mt=(qe,nn,Ut)=>nn.fetchOptimistic(qe).then(({data:Xe})=>{qe.onSuccess==null||qe.onSuccess(Xe),qe.onSettled==null||qe.onSettled(Xe,null)}).catch(Xe=>{Ut.clearReset(),qe.onError==null||qe.onError(Xe),qe.onSettled==null||qe.onSettled(void 0,Xe)});function It(qe,nn){const Ut=(0,Z.jE)({context:qe.context}),Xe=ge(),Ft=ee(),rn=Ut.defaultQueryOptions(qe);rn._optimisticResults=Xe?"isRestoring":"optimistic",rn.onError&&(rn.onError=Te.j.batchCalls(rn.onError)),rn.onSuccess&&(rn.onSuccess=Te.j.batchCalls(rn.onSuccess)),rn.onSettled&&(rn.onSettled=Te.j.batchCalls(rn.onSettled)),Ie(rn),V(rn,Ft),te(Ft);const[Vt]=we.useState(()=>new nn(Ut,rn)),ze=Vt.getOptimisticResult(rn);if((0,ae.r)(we.useCallback(je=>{const De=Xe?()=>{}:Vt.subscribe(Te.j.batchCalls(je));return Vt.updateResult(),De},[Vt,Xe]),()=>Vt.getCurrentResult(),()=>Vt.getCurrentResult()),we.useEffect(()=>{Vt.setOptions(rn,{listeners:!1})},[rn,Vt]),vt(rn,ze,Xe))throw mt(rn,Vt,Ft);if(Re({result:ze,errorResetBoundary:Ft,useErrorBoundary:rn.useErrorBoundary,query:Vt.getCurrentQuery()}))throw ze.error;return rn.notifyOnChangeProps?ze:Vt.trackResult(ze)}},4357:(a,l,se)=>{"use strict";se.d(l,{q:()=>ee});var we=se(7753),Te=se(2532),ae=se(4876);class ie extends Te.${constructor(Z,U){super(Z,U)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(Z,U){super.setOptions({...Z,behavior:(0,ae.PL)()},U)}getOptimisticResult(Z){return Z.behavior=(0,ae.PL)(),super.getOptimisticResult(Z)}fetchNextPage({pageParam:Z,...U}={}){return this.fetch({...U,meta:{fetchMore:{direction:"forward",pageParam:Z}}})}fetchPreviousPage({pageParam:Z,...U}={}){return this.fetch({...U,meta:{fetchMore:{direction:"backward",pageParam:Z}}})}createResult(Z,U){var ge,ne,ve,V,te,Re;const{state:Ie}=Z,$e=super.createResult(Z,U),{isFetching:vt,isRefetching:mt}=$e,It=vt&&((ge=Ie.fetchMeta)==null||(ne=ge.fetchMore)==null?void 0:ne.direction)==="forward",qe=vt&&((ve=Ie.fetchMeta)==null||(V=ve.fetchMore)==null?void 0:V.direction)==="backward";return{...$e,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:(0,ae.rB)(U,(te=Ie.data)==null?void 0:te.pages),hasPreviousPage:(0,ae.RQ)(U,(Re=Ie.data)==null?void 0:Re.pages),isFetchingNextPage:It,isFetchingPreviousPage:qe,isRefetching:mt&&!It&&!qe}}}var W=se(9233);function ee(q,Z,U){const ge=(0,we.vh)(q,Z,U);return(0,W.t)(ge,ie)}},2297:(a,l,se)=>{"use strict";se.d(l,{n:()=>ge});var we=se(6194),Te=se(7753),ae=se(1955),ie=se(3190),W=se(6249);class ee extends W.Q{constructor(V,te){super(),this.client=V,this.setOptions(te),this.bindMethods(),this.updateResult()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(V){var te;const Re=this.options;this.options=this.client.defaultMutationOptions(V),(0,Te.f8)(Re,this.options)||this.client.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.currentMutation,observer:this}),(te=this.currentMutation)==null||te.setOptions(this.options)}onUnsubscribe(){if(!this.hasListeners()){var V;(V=this.currentMutation)==null||V.removeObserver(this)}}onMutationUpdate(V){this.updateResult();const te={listeners:!0};V.type==="success"?te.onSuccess=!0:V.type==="error"&&(te.onError=!0),this.notify(te)}getCurrentResult(){return this.currentResult}reset(){this.currentMutation=void 0,this.updateResult(),this.notify({listeners:!0})}mutate(V,te){return this.mutateOptions=te,this.currentMutation&&this.currentMutation.removeObserver(this),this.currentMutation=this.client.getMutationCache().build(this.client,{...this.options,variables:typeof V<"u"?V:this.options.variables}),this.currentMutation.addObserver(this),this.currentMutation.execute()}updateResult(){const V=this.currentMutation?this.currentMutation.state:(0,ae.$)(),te={...V,isLoading:V.status==="loading",isSuccess:V.status==="success",isError:V.status==="error",isIdle:V.status==="idle",mutate:this.mutate,reset:this.reset};this.currentResult=te}notify(V){ie.j.batch(()=>{if(this.mutateOptions&&this.hasListeners()){if(V.onSuccess){var te,Re,Ie,$e;(te=(Re=this.mutateOptions).onSuccess)==null||te.call(Re,this.currentResult.data,this.currentResult.variables,this.currentResult.context),(Ie=($e=this.mutateOptions).onSettled)==null||Ie.call($e,this.currentResult.data,null,this.currentResult.variables,this.currentResult.context)}else if(V.onError){var vt,mt,It,qe;(vt=(mt=this.mutateOptions).onError)==null||vt.call(mt,this.currentResult.error,this.currentResult.variables,this.currentResult.context),(It=(qe=this.mutateOptions).onSettled)==null||It.call(qe,void 0,this.currentResult.error,this.currentResult.variables,this.currentResult.context)}}V.listeners&&this.listeners.forEach(({listener:nn})=>{nn(this.currentResult)})})}}var q=se(9176),Z=se(8138),U=se(8539);function ge(ve,V,te){const Re=(0,Te.GR)(ve,V,te),Ie=(0,Z.jE)({context:Re.context}),[$e]=we.useState(()=>new ee(Ie,Re));we.useEffect(()=>{$e.setOptions(Re)},[$e,Re]);const vt=(0,q.r)(we.useCallback(It=>$e.subscribe(ie.j.batchCalls(It)),[$e]),()=>$e.getCurrentResult(),()=>$e.getCurrentResult()),mt=we.useCallback((It,qe)=>{$e.mutate(It,qe).catch(ne)},[$e]);if(vt.error&&(0,U.G)($e.options.useErrorBoundary,[vt.error]))throw vt.error;return{...vt,mutate:mt,mutateAsync:vt.mutate}}function ne(){}},2215:(a,l,se)=>{"use strict";se.d(l,{I:()=>ie});var we=se(7753),Te=se(2532),ae=se(9233);function ie(W,ee,q){const Z=(0,we.vh)(W,ee,q);return(0,ae.t)(Z,Te.$)}},9176:(a,l,se)=>{"use strict";se.d(l,{r:()=>Te});var we=se(7030);const Te=we.useSyncExternalStore},8539:(a,l,se)=>{"use strict";se.d(l,{G:()=>we});function we(Te,ae){return typeof Te=="function"?Te(...ae):!!Te}},1642:(a,l,se)=>{"use strict";se.d(l,{Ay:()=>jr,t:()=>Qe});var we=se(2284),Te=se(3029),ae=se(2901);function ie(be){if(be===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return be}function W(be,pe){return W=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(ue,K){return ue.__proto__=K,ue},W(be,pe)}function ee(be,pe){if(typeof pe!="function"&&pe!==null)throw new TypeError("Super expression must either be null or a function");be.prototype=Object.create(pe&&pe.prototype,{constructor:{value:be,writable:!0,configurable:!0}}),Object.defineProperty(be,"prototype",{writable:!1}),pe&&W(be,pe)}function q(be,pe){if(pe&&((0,we.A)(pe)==="object"||typeof pe=="function"))return pe;if(pe!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ie(be)}function Z(be){return Z=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(le){return le.__proto__||Object.getPrototypeOf(le)},Z(be)}var U=se(4467),ge=se(6369);function ne(be){if(typeof Symbol<"u"&&be[Symbol.iterator]!=null||be["@@iterator"]!=null)return Array.from(be)}var ve=se(8394),V=se(6562);function te(be){return(0,ge.A)(be)||ne(be)||(0,ve.A)(be)||(0,V.A)()}function Re(be,pe){var le=Object.keys(be);if(Object.getOwnPropertySymbols){var ue=Object.getOwnPropertySymbols(be);pe&&(ue=ue.filter(function(K){return Object.getOwnPropertyDescriptor(be,K).enumerable})),le.push.apply(le,ue)}return le}function Ie(be){for(var pe=1;pe<arguments.length;pe++){var le=arguments[pe]!=null?arguments[pe]:{};pe%2?Re(Object(le),!0).forEach(function(ue){(0,U.A)(be,ue,le[ue])}):Object.getOwnPropertyDescriptors?Object.defineProperties(be,Object.getOwnPropertyDescriptors(le)):Re(Object(le)).forEach(function(ue){Object.defineProperty(be,ue,Object.getOwnPropertyDescriptor(le,ue))})}return be}var $e={type:"logger",log:function(pe){this.output("log",pe)},warn:function(pe){this.output("warn",pe)},error:function(pe){this.output("error",pe)},output:function(pe,le){console&&console[pe]&&console[pe].apply(console,le)}},vt=function(){function be(pe){var le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(0,Te.A)(this,be),this.init(pe,le)}return(0,ae.A)(be,[{key:"init",value:function(le){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=ue.prefix||"i18next:",this.logger=le||$e,this.options=ue,this.debug=ue.debug}},{key:"setDebug",value:function(le){this.debug=le}},{key:"log",value:function(){for(var le=arguments.length,ue=new Array(le),K=0;K<le;K++)ue[K]=arguments[K];return this.forward(ue,"log","",!0)}},{key:"warn",value:function(){for(var le=arguments.length,ue=new Array(le),K=0;K<le;K++)ue[K]=arguments[K];return this.forward(ue,"warn","",!0)}},{key:"error",value:function(){for(var le=arguments.length,ue=new Array(le),K=0;K<le;K++)ue[K]=arguments[K];return this.forward(ue,"error","")}},{key:"deprecate",value:function(){for(var le=arguments.length,ue=new Array(le),K=0;K<le;K++)ue[K]=arguments[K];return this.forward(ue,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(le,ue,K,fe){return fe&&!this.debug?null:(typeof le[0]=="string"&&(le[0]="".concat(K).concat(this.prefix," ").concat(le[0])),this.logger[ue](le))}},{key:"create",value:function(le){return new be(this.logger,Ie(Ie({},{prefix:"".concat(this.prefix,":").concat(le,":")}),this.options))}},{key:"clone",value:function(le){return le=le||this.options,le.prefix=le.prefix||this.prefix,new be(this.logger,le)}}]),be}(),mt=new vt,It=function(){function be(){(0,Te.A)(this,be),this.observers={}}return(0,ae.A)(be,[{key:"on",value:function(le,ue){var K=this;return le.split(" ").forEach(function(fe){K.observers[fe]=K.observers[fe]||[],K.observers[fe].push(ue)}),this}},{key:"off",value:function(le,ue){if(this.observers[le]){if(!ue){delete this.observers[le];return}this.observers[le]=this.observers[le].filter(function(K){return K!==ue})}}},{key:"emit",value:function(le){for(var ue=arguments.length,K=new Array(ue>1?ue-1:0),fe=1;fe<ue;fe++)K[fe-1]=arguments[fe];if(this.observers[le]){var _e=[].concat(this.observers[le]);_e.forEach(function(X){X.apply(void 0,K)})}if(this.observers["*"]){var Ve=[].concat(this.observers["*"]);Ve.forEach(function(X){X.apply(X,[le].concat(K))})}}}]),be}();function qe(){var be,pe,le=new Promise(function(ue,K){be=ue,pe=K});return le.resolve=be,le.reject=pe,le}function nn(be){return be==null?"":""+be}function Ut(be,pe,le){be.forEach(function(ue){pe[ue]&&(le[ue]=pe[ue])})}function Xe(be,pe,le){function ue(Ve){return Ve&&Ve.indexOf("###")>-1?Ve.replace(/###/g,"."):Ve}function K(){return!be||typeof be=="string"}for(var fe=typeof pe!="string"?[].concat(pe):pe.split(".");fe.length>1;){if(K())return{};var _e=ue(fe.shift());!be[_e]&&le&&(be[_e]=new le),Object.prototype.hasOwnProperty.call(be,_e)?be=be[_e]:be={}}return K()?{}:{obj:be,k:ue(fe.shift())}}function Ft(be,pe,le){var ue=Xe(be,pe,Object),K=ue.obj,fe=ue.k;K[fe]=le}function rn(be,pe,le,ue){var K=Xe(be,pe,Object),fe=K.obj,_e=K.k;fe[_e]=fe[_e]||[],ue&&(fe[_e]=fe[_e].concat(le)),ue||fe[_e].push(le)}function Vt(be,pe){var le=Xe(be,pe),ue=le.obj,K=le.k;if(ue)return ue[K]}function ze(be,pe,le){var ue=Vt(be,le);return ue!==void 0?ue:Vt(pe,le)}function je(be,pe,le){for(var ue in pe)ue!=="__proto__"&&ue!=="constructor"&&(ue in be?typeof be[ue]=="string"||be[ue]instanceof String||typeof pe[ue]=="string"||pe[ue]instanceof String?le&&(be[ue]=pe[ue]):je(be[ue],pe[ue],le):be[ue]=pe[ue]);return be}function De(be){return be.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var ct={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function qt(be){return typeof be=="string"?be.replace(/[&<>"'\/]/g,function(pe){return ct[pe]}):be}var z=typeof window<"u"&&window.navigator&&typeof window.navigator.userAgentData>"u"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,He=[" ",",","?","!",";"];function Ct(be,pe,le){pe=pe||"",le=le||"";var ue=He.filter(function(Ve){return pe.indexOf(Ve)<0&&le.indexOf(Ve)<0});if(ue.length===0)return!0;var K=new RegExp("(".concat(ue.map(function(Ve){return Ve==="?"?"\\?":Ve}).join("|"),")")),fe=!K.test(be);if(!fe){var _e=be.indexOf(le);_e>0&&!K.test(be.substring(0,_e))&&(fe=!0)}return fe}function kt(be,pe){var le=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(be){if(be[pe])return be[pe];for(var ue=pe.split(le),K=be,fe=0;fe<ue.length;++fe){if(!K||typeof K[ue[fe]]=="string"&&fe+1<ue.length)return;if(K[ue[fe]]===void 0){for(var _e=2,Ve=ue.slice(fe,fe+_e).join(le),X=K[Ve];X===void 0&&ue.length>fe+_e;)_e++,Ve=ue.slice(fe,fe+_e).join(le),X=K[Ve];if(X===void 0)return;if(X===null)return null;if(pe.endsWith(Ve)){if(typeof X=="string")return X;if(Ve&&typeof X[Ve]=="string")return X[Ve]}var xe=ue.slice(fe+_e).join(le);return xe?kt(X,xe,le):void 0}K=K[ue[fe]]}return K}}function Pe(be,pe){var le=Object.keys(be);if(Object.getOwnPropertySymbols){var ue=Object.getOwnPropertySymbols(be);pe&&(ue=ue.filter(function(K){return Object.getOwnPropertyDescriptor(be,K).enumerable})),le.push.apply(le,ue)}return le}function yt(be){for(var pe=1;pe<arguments.length;pe++){var le=arguments[pe]!=null?arguments[pe]:{};pe%2?Pe(Object(le),!0).forEach(function(ue){(0,U.A)(be,ue,le[ue])}):Object.getOwnPropertyDescriptors?Object.defineProperties(be,Object.getOwnPropertyDescriptors(le)):Pe(Object(le)).forEach(function(ue){Object.defineProperty(be,ue,Object.getOwnPropertyDescriptor(le,ue))})}return be}function un(be){var pe=Rn();return function(){var ue=Z(be),K;if(pe){var fe=Z(this).constructor;K=Reflect.construct(ue,arguments,fe)}else K=ue.apply(this,arguments);return q(this,K)}}function Rn(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Yn=function(be){ee(le,be);var pe=un(le);function le(ue){var K,fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return(0,Te.A)(this,le),K=pe.call(this),z&&It.call(ie(K)),K.data=ue||{},K.options=fe,K.options.keySeparator===void 0&&(K.options.keySeparator="."),K.options.ignoreJSONStructure===void 0&&(K.options.ignoreJSONStructure=!0),K}return(0,ae.A)(le,[{key:"addNamespaces",value:function(K){this.options.ns.indexOf(K)<0&&this.options.ns.push(K)}},{key:"removeNamespaces",value:function(K){var fe=this.options.ns.indexOf(K);fe>-1&&this.options.ns.splice(fe,1)}},{key:"getResource",value:function(K,fe,_e){var Ve=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},X=Ve.keySeparator!==void 0?Ve.keySeparator:this.options.keySeparator,xe=Ve.ignoreJSONStructure!==void 0?Ve.ignoreJSONStructure:this.options.ignoreJSONStructure,Ne=[K,fe];_e&&typeof _e!="string"&&(Ne=Ne.concat(_e)),_e&&typeof _e=="string"&&(Ne=Ne.concat(X?_e.split(X):_e)),K.indexOf(".")>-1&&(Ne=K.split("."));var Ee=Vt(this.data,Ne);return Ee||!xe||typeof _e!="string"?Ee:kt(this.data&&this.data[K]&&this.data[K][fe],_e,X)}},{key:"addResource",value:function(K,fe,_e,Ve){var X=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},xe=X.keySeparator!==void 0?X.keySeparator:this.options.keySeparator,Ne=[K,fe];_e&&(Ne=Ne.concat(xe?_e.split(xe):_e)),K.indexOf(".")>-1&&(Ne=K.split("."),Ve=fe,fe=Ne[1]),this.addNamespaces(fe),Ft(this.data,Ne,Ve),X.silent||this.emit("added",K,fe,_e,Ve)}},{key:"addResources",value:function(K,fe,_e){var Ve=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var X in _e)(typeof _e[X]=="string"||Object.prototype.toString.apply(_e[X])==="[object Array]")&&this.addResource(K,fe,X,_e[X],{silent:!0});Ve.silent||this.emit("added",K,fe,_e)}},{key:"addResourceBundle",value:function(K,fe,_e,Ve,X){var xe=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},Ne=[K,fe];K.indexOf(".")>-1&&(Ne=K.split("."),Ve=_e,_e=fe,fe=Ne[1]),this.addNamespaces(fe);var Ee=Vt(this.data,Ne)||{};Ve?je(Ee,_e,X):Ee=yt(yt({},Ee),_e),Ft(this.data,Ne,Ee),xe.silent||this.emit("added",K,fe,_e)}},{key:"removeResourceBundle",value:function(K,fe){this.hasResourceBundle(K,fe)&&delete this.data[K][fe],this.removeNamespaces(fe),this.emit("removed",K,fe)}},{key:"hasResourceBundle",value:function(K,fe){return this.getResource(K,fe)!==void 0}},{key:"getResourceBundle",value:function(K,fe){return fe||(fe=this.options.defaultNS),this.options.compatibilityAPI==="v1"?yt(yt({},{}),this.getResource(K,fe)):this.getResource(K,fe)}},{key:"getDataByLanguage",value:function(K){return this.data[K]}},{key:"hasLanguageSomeTranslations",value:function(K){var fe=this.getDataByLanguage(K),_e=fe&&Object.keys(fe)||[];return!!_e.find(function(Ve){return fe[Ve]&&Object.keys(fe[Ve]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),le}(It),nr={processors:{},addPostProcessor:function(pe){this.processors[pe.name]=pe},handle:function(pe,le,ue,K,fe){var _e=this;return pe.forEach(function(Ve){_e.processors[Ve]&&(le=_e.processors[Ve].process(le,ue,K,fe))}),le}};function rr(be,pe){var le=Object.keys(be);if(Object.getOwnPropertySymbols){var ue=Object.getOwnPropertySymbols(be);pe&&(ue=ue.filter(function(K){return Object.getOwnPropertyDescriptor(be,K).enumerable})),le.push.apply(le,ue)}return le}function ar(be){for(var pe=1;pe<arguments.length;pe++){var le=arguments[pe]!=null?arguments[pe]:{};pe%2?rr(Object(le),!0).forEach(function(ue){(0,U.A)(be,ue,le[ue])}):Object.getOwnPropertyDescriptors?Object.defineProperties(be,Object.getOwnPropertyDescriptors(le)):rr(Object(le)).forEach(function(ue){Object.defineProperty(be,ue,Object.getOwnPropertyDescriptor(le,ue))})}return be}function wr(be){var pe=Ts();return function(){var ue=Z(be),K;if(pe){var fe=Z(this).constructor;K=Reflect.construct(ue,arguments,fe)}else K=ue.apply(this,arguments);return q(this,K)}}function Ts(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Zr={},Bs=function(be){ee(le,be);var pe=wr(le);function le(ue){var K,fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return(0,Te.A)(this,le),K=pe.call(this),z&&It.call(ie(K)),Ut(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],ue,ie(K)),K.options=fe,K.options.keySeparator===void 0&&(K.options.keySeparator="."),K.logger=mt.create("translator"),K}return(0,ae.A)(le,[{key:"changeLanguage",value:function(K){K&&(this.language=K)}},{key:"exists",value:function(K){var fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(K==null)return!1;var _e=this.resolve(K,fe);return _e&&_e.res!==void 0}},{key:"extractFromKey",value:function(K,fe){var _e=fe.nsSeparator!==void 0?fe.nsSeparator:this.options.nsSeparator;_e===void 0&&(_e=":");var Ve=fe.keySeparator!==void 0?fe.keySeparator:this.options.keySeparator,X=fe.ns||this.options.defaultNS||[],xe=_e&&K.indexOf(_e)>-1,Ne=!this.options.userDefinedKeySeparator&&!fe.keySeparator&&!this.options.userDefinedNsSeparator&&!fe.nsSeparator&&!Ct(K,_e,Ve);if(xe&&!Ne){var Ee=K.match(this.interpolator.nestingRegexp);if(Ee&&Ee.length>0)return{key:K,namespaces:X};var Oe=K.split(_e);(_e!==Ve||_e===Ve&&this.options.ns.indexOf(Oe[0])>-1)&&(X=Oe.shift()),K=Oe.join(Ve)}return typeof X=="string"&&(X=[X]),{key:K,namespaces:X}}},{key:"translate",value:function(K,fe,_e){var Ve=this;if((0,we.A)(fe)!=="object"&&this.options.overloadTranslationOptionHandler&&(fe=this.options.overloadTranslationOptionHandler(arguments)),(0,we.A)(fe)==="object"&&(fe=ar({},fe)),fe||(fe={}),K==null)return"";Array.isArray(K)||(K=[String(K)]);var X=fe.returnDetails!==void 0?fe.returnDetails:this.options.returnDetails,xe=fe.keySeparator!==void 0?fe.keySeparator:this.options.keySeparator,Ne=this.extractFromKey(K[K.length-1],fe),Ee=Ne.key,Oe=Ne.namespaces,Be=Oe[Oe.length-1],et=fe.lng||this.language,dt=fe.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(et&&et.toLowerCase()==="cimode"){if(dt){var bt=fe.nsSeparator||this.options.nsSeparator;return X?{res:"".concat(Be).concat(bt).concat(Ee),usedKey:Ee,exactUsedKey:Ee,usedLng:et,usedNS:Be}:"".concat(Be).concat(bt).concat(Ee)}return X?{res:Ee,usedKey:Ee,exactUsedKey:Ee,usedLng:et,usedNS:Be}:Ee}var ft=this.resolve(K,fe),pt=ft&&ft.res,_t=ft&&ft.usedKey||Ee,Kt=ft&&ft.exactUsedKey||Ee,fn=Object.prototype.toString.apply(pt),hn=["[object Number]","[object Function]","[object RegExp]"],In=fe.joinArrays!==void 0?fe.joinArrays:this.options.joinArrays,lr=!this.i18nFormat||this.i18nFormat.handleAsObject,Gn=typeof pt!="string"&&typeof pt!="boolean"&&typeof pt!="number";if(lr&&pt&&Gn&&hn.indexOf(fn)<0&&!(typeof In=="string"&&fn==="[object Array]")){if(!fe.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var Mn=this.options.returnedObjectHandler?this.options.returnedObjectHandler(_t,pt,ar(ar({},fe),{},{ns:Oe})):"key '".concat(Ee," (").concat(this.language,")' returned an object instead of string.");return X?(ft.res=Mn,ft):Mn}if(xe){var gr=fn==="[object Array]",er=gr?[]:{},_r=gr?Kt:_t;for(var vs in pt)if(Object.prototype.hasOwnProperty.call(pt,vs)){var ys="".concat(_r).concat(xe).concat(vs);er[vs]=this.translate(ys,ar(ar({},fe),{joinArrays:!1,ns:Oe})),er[vs]===ys&&(er[vs]=pt[vs])}pt=er}}else if(lr&&typeof In=="string"&&fn==="[object Array]")pt=pt.join(In),pt&&(pt=this.extendTranslation(pt,K,fe,_e));else{var ro=!1,qs=!1,hs=fe.count!==void 0&&typeof fe.count!="string",Ks=le.hasDefaultValue(fe),os=hs?this.pluralResolver.getSuffix(et,fe.count,fe):"",Gs=fe["defaultValue".concat(os)]||fe.defaultValue;!this.isValidLookup(pt)&&Ks&&(ro=!0,pt=Gs),this.isValidLookup(pt)||(qs=!0,pt=Ee);var Ar=fe.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,bo=Ar&&qs?void 0:pt,io=Ks&&Gs!==pt&&this.options.updateMissing;if(qs||ro||io){if(this.logger.log(io?"updateKey":"missingKey",et,Be,Ee,io?Gs:pt),xe){var ho=this.resolve(Ee,ar(ar({},fe),{},{keySeparator:!1}));ho&&ho.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var $o=[],Ka=this.languageUtils.getFallbackCodes(this.options.fallbackLng,fe.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Ka&&Ka[0])for(var ei=0;ei<Ka.length;ei++)$o.push(Ka[ei]);else this.options.saveMissingTo==="all"?$o=this.languageUtils.toResolveHierarchy(fe.lng||this.language):$o.push(fe.lng||this.language);var Ma=function(Qo,so,pa){var di=Ks&&pa!==pt?pa:bo;Ve.options.missingKeyHandler?Ve.options.missingKeyHandler(Qo,Be,so,di,io,fe):Ve.backendConnector&&Ve.backendConnector.saveMissing&&Ve.backendConnector.saveMissing(Qo,Be,so,di,io,fe),Ve.emit("missingKey",Qo,Be,so,pt)};this.options.saveMissing&&(this.options.saveMissingPlurals&&hs?$o.forEach(function(Fi){Ve.pluralResolver.getSuffixes(Fi,fe).forEach(function(Qo){Ma([Fi],Ee+Qo,fe["defaultValue".concat(Qo)]||Gs)})}):Ma($o,Ee,Gs))}pt=this.extendTranslation(pt,K,fe,ft,_e),qs&&pt===Ee&&this.options.appendNamespaceToMissingKey&&(pt="".concat(Be,":").concat(Ee)),(qs||ro)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?pt=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(Be,":").concat(Ee):Ee,ro?pt:void 0):pt=this.options.parseMissingKeyHandler(pt))}return X?(ft.res=pt,ft):pt}},{key:"extendTranslation",value:function(K,fe,_e,Ve,X){var xe=this;if(this.i18nFormat&&this.i18nFormat.parse)K=this.i18nFormat.parse(K,ar(ar({},this.options.interpolation.defaultVariables),_e),Ve.usedLng,Ve.usedNS,Ve.usedKey,{resolved:Ve});else if(!_e.skipInterpolation){_e.interpolation&&this.interpolator.init(ar(ar({},_e),{interpolation:ar(ar({},this.options.interpolation),_e.interpolation)}));var Ne=typeof K=="string"&&(_e&&_e.interpolation&&_e.interpolation.skipOnVariables!==void 0?_e.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables),Ee;if(Ne){var Oe=K.match(this.interpolator.nestingRegexp);Ee=Oe&&Oe.length}var Be=_e.replace&&typeof _e.replace!="string"?_e.replace:_e;if(this.options.interpolation.defaultVariables&&(Be=ar(ar({},this.options.interpolation.defaultVariables),Be)),K=this.interpolator.interpolate(K,Be,_e.lng||this.language,_e),Ne){var et=K.match(this.interpolator.nestingRegexp),dt=et&&et.length;Ee<dt&&(_e.nest=!1)}!_e.lng&&this.options.compatibilityAPI!=="v1"&&Ve&&Ve.res&&(_e.lng=Ve.usedLng),_e.nest!==!1&&(K=this.interpolator.nest(K,function(){for(var pt=arguments.length,_t=new Array(pt),Kt=0;Kt<pt;Kt++)_t[Kt]=arguments[Kt];return X&&X[0]===_t[0]&&!_e.context?(xe.logger.warn("It seems you are nesting recursively key: ".concat(_t[0]," in key: ").concat(fe[0])),null):xe.translate.apply(xe,_t.concat([fe]))},_e)),_e.interpolation&&this.interpolator.reset()}var bt=_e.postProcess||this.options.postProcess,ft=typeof bt=="string"?[bt]:bt;return K!=null&&ft&&ft.length&&_e.applyPostProcessor!==!1&&(K=nr.handle(ft,K,fe,this.options&&this.options.postProcessPassResolved?ar({i18nResolved:Ve},_e):_e,this)),K}},{key:"resolve",value:function(K){var fe=this,_e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ve,X,xe,Ne,Ee;return typeof K=="string"&&(K=[K]),K.forEach(function(Oe){if(!fe.isValidLookup(Ve)){var Be=fe.extractFromKey(Oe,_e),et=Be.key;X=et;var dt=Be.namespaces;fe.options.fallbackNS&&(dt=dt.concat(fe.options.fallbackNS));var bt=_e.count!==void 0&&typeof _e.count!="string",ft=bt&&!_e.ordinal&&_e.count===0&&fe.pluralResolver.shouldUseIntlApi(),pt=_e.context!==void 0&&(typeof _e.context=="string"||typeof _e.context=="number")&&_e.context!=="",_t=_e.lngs?_e.lngs:fe.languageUtils.toResolveHierarchy(_e.lng||fe.language,_e.fallbackLng);dt.forEach(function(Kt){fe.isValidLookup(Ve)||(Ee=Kt,!Zr["".concat(_t[0],"-").concat(Kt)]&&fe.utils&&fe.utils.hasLoadedNamespace&&!fe.utils.hasLoadedNamespace(Ee)&&(Zr["".concat(_t[0],"-").concat(Kt)]=!0,fe.logger.warn('key "'.concat(X,'" for languages "').concat(_t.join(", "),`" won't get resolved as namespace "`).concat(Ee,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),_t.forEach(function(fn){if(!fe.isValidLookup(Ve)){Ne=fn;var hn=[et];if(fe.i18nFormat&&fe.i18nFormat.addLookupKeys)fe.i18nFormat.addLookupKeys(hn,et,fn,Kt,_e);else{var In;bt&&(In=fe.pluralResolver.getSuffix(fn,_e.count,_e));var lr="".concat(fe.options.pluralSeparator,"zero");if(bt&&(hn.push(et+In),ft&&hn.push(et+lr)),pt){var Gn="".concat(et).concat(fe.options.contextSeparator).concat(_e.context);hn.push(Gn),bt&&(hn.push(Gn+In),ft&&hn.push(Gn+lr))}}for(var Mn;Mn=hn.pop();)fe.isValidLookup(Ve)||(xe=Mn,Ve=fe.getResource(fn,Kt,Mn,_e))}}))})}}),{res:Ve,usedKey:X,exactUsedKey:xe,usedLng:Ne,usedNS:Ee}}},{key:"isValidLookup",value:function(K){return K!==void 0&&!(!this.options.returnNull&&K===null)&&!(!this.options.returnEmptyString&&K==="")}},{key:"getResource",value:function(K,fe,_e){var Ve=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(K,fe,_e,Ve):this.resourceStore.getResource(K,fe,_e,Ve)}}],[{key:"hasDefaultValue",value:function(K){var fe="defaultValue";for(var _e in K)if(Object.prototype.hasOwnProperty.call(K,_e)&&fe===_e.substring(0,fe.length)&&K[_e]!==void 0)return!0;return!1}}]),le}(It);function rt(be){return be.charAt(0).toUpperCase()+be.slice(1)}var zt=function(){function be(pe){(0,Te.A)(this,be),this.options=pe,this.supportedLngs=this.options.supportedLngs||!1,this.logger=mt.create("languageUtils")}return(0,ae.A)(be,[{key:"getScriptPartFromCode",value:function(le){if(!le||le.indexOf("-")<0)return null;var ue=le.split("-");return ue.length===2||(ue.pop(),ue[ue.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(ue.join("-"))}},{key:"getLanguagePartFromCode",value:function(le){if(!le||le.indexOf("-")<0)return le;var ue=le.split("-");return this.formatLanguageCode(ue[0])}},{key:"formatLanguageCode",value:function(le){if(typeof le=="string"&&le.indexOf("-")>-1){var ue=["hans","hant","latn","cyrl","cans","mong","arab"],K=le.split("-");return this.options.lowerCaseLng?K=K.map(function(fe){return fe.toLowerCase()}):K.length===2?(K[0]=K[0].toLowerCase(),K[1]=K[1].toUpperCase(),ue.indexOf(K[1].toLowerCase())>-1&&(K[1]=rt(K[1].toLowerCase()))):K.length===3&&(K[0]=K[0].toLowerCase(),K[1].length===2&&(K[1]=K[1].toUpperCase()),K[0]!=="sgn"&&K[2].length===2&&(K[2]=K[2].toUpperCase()),ue.indexOf(K[1].toLowerCase())>-1&&(K[1]=rt(K[1].toLowerCase())),ue.indexOf(K[2].toLowerCase())>-1&&(K[2]=rt(K[2].toLowerCase()))),K.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?le.toLowerCase():le}},{key:"isSupportedCode",value:function(le){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(le=this.getLanguagePartFromCode(le)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(le)>-1}},{key:"getBestMatchFromCodes",value:function(le){var ue=this;if(!le)return null;var K;return le.forEach(function(fe){if(!K){var _e=ue.formatLanguageCode(fe);(!ue.options.supportedLngs||ue.isSupportedCode(_e))&&(K=_e)}}),!K&&this.options.supportedLngs&&le.forEach(function(fe){if(!K){var _e=ue.getLanguagePartFromCode(fe);if(ue.isSupportedCode(_e))return K=_e;K=ue.options.supportedLngs.find(function(Ve){if(Ve===_e)return Ve;if(!(Ve.indexOf("-")<0&&_e.indexOf("-")<0)&&Ve.indexOf(_e)===0)return Ve})}}),K||(K=this.getFallbackCodes(this.options.fallbackLng)[0]),K}},{key:"getFallbackCodes",value:function(le,ue){if(!le)return[];if(typeof le=="function"&&(le=le(ue)),typeof le=="string"&&(le=[le]),Object.prototype.toString.apply(le)==="[object Array]")return le;if(!ue)return le.default||[];var K=le[ue];return K||(K=le[this.getScriptPartFromCode(ue)]),K||(K=le[this.formatLanguageCode(ue)]),K||(K=le[this.getLanguagePartFromCode(ue)]),K||(K=le.default),K||[]}},{key:"toResolveHierarchy",value:function(le,ue){var K=this,fe=this.getFallbackCodes(ue||this.options.fallbackLng||[],le),_e=[],Ve=function(xe){xe&&(K.isSupportedCode(xe)?_e.push(xe):K.logger.warn("rejecting language code not found in supportedLngs: ".concat(xe)))};return typeof le=="string"&&le.indexOf("-")>-1?(this.options.load!=="languageOnly"&&Ve(this.formatLanguageCode(le)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&Ve(this.getScriptPartFromCode(le)),this.options.load!=="currentOnly"&&Ve(this.getLanguagePartFromCode(le))):typeof le=="string"&&Ve(this.formatLanguageCode(le)),fe.forEach(function(X){_e.indexOf(X)<0&&Ve(K.formatLanguageCode(X))}),_e}}]),be}(),Hn=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],Nr={1:function(pe){return Number(pe>1)},2:function(pe){return Number(pe!=1)},3:function(pe){return 0},4:function(pe){return Number(pe%10==1&&pe%100!=11?0:pe%10>=2&&pe%10<=4&&(pe%100<10||pe%100>=20)?1:2)},5:function(pe){return Number(pe==0?0:pe==1?1:pe==2?2:pe%100>=3&&pe%100<=10?3:pe%100>=11?4:5)},6:function(pe){return Number(pe==1?0:pe>=2&&pe<=4?1:2)},7:function(pe){return Number(pe==1?0:pe%10>=2&&pe%10<=4&&(pe%100<10||pe%100>=20)?1:2)},8:function(pe){return Number(pe==1?0:pe==2?1:pe!=8&&pe!=11?2:3)},9:function(pe){return Number(pe>=2)},10:function(pe){return Number(pe==1?0:pe==2?1:pe<7?2:pe<11?3:4)},11:function(pe){return Number(pe==1||pe==11?0:pe==2||pe==12?1:pe>2&&pe<20?2:3)},12:function(pe){return Number(pe%10!=1||pe%100==11)},13:function(pe){return Number(pe!==0)},14:function(pe){return Number(pe==1?0:pe==2?1:pe==3?2:3)},15:function(pe){return Number(pe%10==1&&pe%100!=11?0:pe%10>=2&&(pe%100<10||pe%100>=20)?1:2)},16:function(pe){return Number(pe%10==1&&pe%100!=11?0:pe!==0?1:2)},17:function(pe){return Number(pe==1||pe%10==1&&pe%100!=11?0:1)},18:function(pe){return Number(pe==0?0:pe==1?1:2)},19:function(pe){return Number(pe==1?0:pe==0||pe%100>1&&pe%100<11?1:pe%100>10&&pe%100<20?2:3)},20:function(pe){return Number(pe==1?0:pe==0||pe%100>0&&pe%100<20?1:2)},21:function(pe){return Number(pe%100==1?1:pe%100==2?2:pe%100==3||pe%100==4?3:0)},22:function(pe){return Number(pe==1?0:pe==2?1:(pe<0||pe>10)&&pe%10==0?2:3)}},kr=["v1","v2","v3"],Xn={zero:0,one:1,two:2,few:3,many:4,other:5};function Jt(){var be={};return Hn.forEach(function(pe){pe.lngs.forEach(function(le){be[le]={numbers:pe.nr,plurals:Nr[pe.fc]}})}),be}var Xt=function(){function be(pe){var le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(0,Te.A)(this,be),this.languageUtils=pe,this.options=le,this.logger=mt.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=Jt()}return(0,ae.A)(be,[{key:"addRule",value:function(le,ue){this.rules[le]=ue}},{key:"getRule",value:function(le){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(le,{type:ue.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[le]||this.rules[this.languageUtils.getLanguagePartFromCode(le)]}},{key:"needsPlural",value:function(le){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},K=this.getRule(le,ue);return this.shouldUseIntlApi()?K&&K.resolvedOptions().pluralCategories.length>1:K&&K.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(le,ue){var K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(le,K).map(function(fe){return"".concat(ue).concat(fe)})}},{key:"getSuffixes",value:function(le){var ue=this,K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},fe=this.getRule(le,K);return fe?this.shouldUseIntlApi()?fe.resolvedOptions().pluralCategories.sort(function(_e,Ve){return Xn[_e]-Xn[Ve]}).map(function(_e){return"".concat(ue.options.prepend).concat(_e)}):fe.numbers.map(function(_e){return ue.getSuffix(le,_e,K)}):[]}},{key:"getSuffix",value:function(le,ue){var K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},fe=this.getRule(le,K);return fe?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(fe.select(ue)):this.getSuffixRetroCompatible(fe,ue):(this.logger.warn("no plural rule found for: ".concat(le)),"")}},{key:"getSuffixRetroCompatible",value:function(le,ue){var K=this,fe=le.noAbs?le.plurals(ue):le.plurals(Math.abs(ue)),_e=le.numbers[fe];this.options.simplifyPluralSuffix&&le.numbers.length===2&&le.numbers[0]===1&&(_e===2?_e="plural":_e===1&&(_e=""));var Ve=function(){return K.options.prepend&&_e.toString()?K.options.prepend+_e.toString():_e.toString()};return this.options.compatibilityJSON==="v1"?_e===1?"":typeof _e=="number"?"_plural_".concat(_e.toString()):Ve():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&le.numbers.length===2&&le.numbers[0]===1?Ve():this.options.prepend&&fe.toString()?this.options.prepend+fe.toString():fe.toString()}},{key:"shouldUseIntlApi",value:function(){return!kr.includes(this.options.compatibilityJSON)}}]),be}();function qn(be,pe){var le=Object.keys(be);if(Object.getOwnPropertySymbols){var ue=Object.getOwnPropertySymbols(be);pe&&(ue=ue.filter(function(K){return Object.getOwnPropertyDescriptor(be,K).enumerable})),le.push.apply(le,ue)}return le}function bn(be){for(var pe=1;pe<arguments.length;pe++){var le=arguments[pe]!=null?arguments[pe]:{};pe%2?qn(Object(le),!0).forEach(function(ue){(0,U.A)(be,ue,le[ue])}):Object.getOwnPropertyDescriptors?Object.defineProperties(be,Object.getOwnPropertyDescriptors(le)):qn(Object(le)).forEach(function(ue){Object.defineProperty(be,ue,Object.getOwnPropertyDescriptor(le,ue))})}return be}function sr(be,pe,le){var ue=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",K=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,fe=ze(be,pe,le);return!fe&&K&&typeof le=="string"&&(fe=kt(be,le,ue),fe===void 0&&(fe=kt(pe,le,ue))),fe}var Jn=function(){function be(){var pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(0,Te.A)(this,be),this.logger=mt.create("interpolator"),this.options=pe,this.format=pe.interpolation&&pe.interpolation.format||function(le){return le},this.init(pe)}return(0,ae.A)(be,[{key:"init",value:function(){var le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};le.interpolation||(le.interpolation={escapeValue:!0});var ue=le.interpolation;this.escape=ue.escape!==void 0?ue.escape:qt,this.escapeValue=ue.escapeValue!==void 0?ue.escapeValue:!0,this.useRawValueToEscape=ue.useRawValueToEscape!==void 0?ue.useRawValueToEscape:!1,this.prefix=ue.prefix?De(ue.prefix):ue.prefixEscaped||"{{",this.suffix=ue.suffix?De(ue.suffix):ue.suffixEscaped||"}}",this.formatSeparator=ue.formatSeparator?ue.formatSeparator:ue.formatSeparator||",",this.unescapePrefix=ue.unescapeSuffix?"":ue.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":ue.unescapeSuffix||"",this.nestingPrefix=ue.nestingPrefix?De(ue.nestingPrefix):ue.nestingPrefixEscaped||De("$t("),this.nestingSuffix=ue.nestingSuffix?De(ue.nestingSuffix):ue.nestingSuffixEscaped||De(")"),this.nestingOptionsSeparator=ue.nestingOptionsSeparator?ue.nestingOptionsSeparator:ue.nestingOptionsSeparator||",",this.maxReplaces=ue.maxReplaces?ue.maxReplaces:1e3,this.alwaysFormat=ue.alwaysFormat!==void 0?ue.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var le="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(le,"g");var ue="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(ue,"g");var K="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(K,"g")}},{key:"interpolate",value:function(le,ue,K,fe){var _e=this,Ve,X,xe,Ne=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function Ee(bt){return bt.replace(/\$/g,"$$$$")}var Oe=function(ft){if(ft.indexOf(_e.formatSeparator)<0){var pt=sr(ue,Ne,ft,_e.options.keySeparator,_e.options.ignoreJSONStructure);return _e.alwaysFormat?_e.format(pt,void 0,K,bn(bn(bn({},fe),ue),{},{interpolationkey:ft})):pt}var _t=ft.split(_e.formatSeparator),Kt=_t.shift().trim(),fn=_t.join(_e.formatSeparator).trim();return _e.format(sr(ue,Ne,Kt,_e.options.keySeparator,_e.options.ignoreJSONStructure),fn,K,bn(bn(bn({},fe),ue),{},{interpolationkey:Kt}))};this.resetRegExp();var Be=fe&&fe.missingInterpolationHandler||this.options.missingInterpolationHandler,et=fe&&fe.interpolation&&fe.interpolation.skipOnVariables!==void 0?fe.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,dt=[{regex:this.regexpUnescape,safeValue:function(ft){return Ee(ft)}},{regex:this.regexp,safeValue:function(ft){return _e.escapeValue?Ee(_e.escape(ft)):Ee(ft)}}];return dt.forEach(function(bt){for(xe=0;Ve=bt.regex.exec(le);){var ft=Ve[1].trim();if(X=Oe(ft),X===void 0)if(typeof Be=="function"){var pt=Be(le,Ve,fe);X=typeof pt=="string"?pt:""}else if(fe&&Object.prototype.hasOwnProperty.call(fe,ft))X="";else if(et){X=Ve[0];continue}else _e.logger.warn("missed to pass in variable ".concat(ft," for interpolating ").concat(le)),X="";else typeof X!="string"&&!_e.useRawValueToEscape&&(X=nn(X));var _t=bt.safeValue(X);if(le=le.replace(Ve[0],_t),et?(bt.regex.lastIndex+=X.length,bt.regex.lastIndex-=Ve[0].length):bt.regex.lastIndex=0,xe++,xe>=_e.maxReplaces)break}}),le}},{key:"nest",value:function(le,ue){var K=this,fe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},_e,Ve,X;function xe(Be,et){var dt=this.nestingOptionsSeparator;if(Be.indexOf(dt)<0)return Be;var bt=Be.split(new RegExp("".concat(dt,"[ ]*{"))),ft="{".concat(bt[1]);Be=bt[0],ft=this.interpolate(ft,X);var pt=ft.match(/'/g),_t=ft.match(/"/g);(pt&&pt.length%2===0&&!_t||_t.length%2!==0)&&(ft=ft.replace(/'/g,'"'));try{X=JSON.parse(ft),et&&(X=bn(bn({},et),X))}catch(Kt){return this.logger.warn("failed parsing options string in nesting for key ".concat(Be),Kt),"".concat(Be).concat(dt).concat(ft)}return delete X.defaultValue,Be}for(;_e=this.nestingRegexp.exec(le);){var Ne=[];X=bn({},fe),X=X.replace&&typeof X.replace!="string"?X.replace:X,X.applyPostProcessor=!1,delete X.defaultValue;var Ee=!1;if(_e[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(_e[1])){var Oe=_e[1].split(this.formatSeparator).map(function(Be){return Be.trim()});_e[1]=Oe.shift(),Ne=Oe,Ee=!0}if(Ve=ue(xe.call(this,_e[1].trim(),X),X),Ve&&_e[0]===le&&typeof Ve!="string")return Ve;typeof Ve!="string"&&(Ve=nn(Ve)),Ve||(this.logger.warn("missed to resolve ".concat(_e[1]," for nesting ").concat(le)),Ve=""),Ee&&(Ve=Ne.reduce(function(Be,et){return K.format(Be,et,fe.lng,bn(bn({},fe),{},{interpolationkey:_e[1].trim()}))},Ve.trim())),le=le.replace(_e[0],Ve),this.regexp.lastIndex=0}return le}}]),be}();function fs(be,pe){var le=Object.keys(be);if(Object.getOwnPropertySymbols){var ue=Object.getOwnPropertySymbols(be);pe&&(ue=ue.filter(function(K){return Object.getOwnPropertyDescriptor(be,K).enumerable})),le.push.apply(le,ue)}return le}function Kn(be){for(var pe=1;pe<arguments.length;pe++){var le=arguments[pe]!=null?arguments[pe]:{};pe%2?fs(Object(le),!0).forEach(function(ue){(0,U.A)(be,ue,le[ue])}):Object.getOwnPropertyDescriptors?Object.defineProperties(be,Object.getOwnPropertyDescriptors(le)):fs(Object(le)).forEach(function(ue){Object.defineProperty(be,ue,Object.getOwnPropertyDescriptor(le,ue))})}return be}function Ir(be){var pe=be.toLowerCase().trim(),le={};if(be.indexOf("(")>-1){var ue=be.split("(");pe=ue[0].toLowerCase().trim();var K=ue[1].substring(0,ue[1].length-1);if(pe==="currency"&&K.indexOf(":")<0)le.currency||(le.currency=K.trim());else if(pe==="relativetime"&&K.indexOf(":")<0)le.range||(le.range=K.trim());else{var fe=K.split(";");fe.forEach(function(_e){if(_e){var Ve=_e.split(":"),X=te(Ve),xe=X[0],Ne=X.slice(1),Ee=Ne.join(":").trim().replace(/^'+|'+$/g,"");le[xe.trim()]||(le[xe.trim()]=Ee),Ee==="false"&&(le[xe.trim()]=!1),Ee==="true"&&(le[xe.trim()]=!0),isNaN(Ee)||(le[xe.trim()]=parseInt(Ee,10))}})}}return{formatName:pe,formatOptions:le}}function Rr(be){var pe={};return function(ue,K,fe){var _e=K+JSON.stringify(fe),Ve=pe[_e];return Ve||(Ve=be(K,fe),pe[_e]=Ve),Ve(ue)}}var pr=function(){function be(){var pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(0,Te.A)(this,be),this.logger=mt.create("formatter"),this.options=pe,this.formats={number:Rr(function(le,ue){var K=new Intl.NumberFormat(le,Kn({},ue));return function(fe){return K.format(fe)}}),currency:Rr(function(le,ue){var K=new Intl.NumberFormat(le,Kn(Kn({},ue),{},{style:"currency"}));return function(fe){return K.format(fe)}}),datetime:Rr(function(le,ue){var K=new Intl.DateTimeFormat(le,Kn({},ue));return function(fe){return K.format(fe)}}),relativetime:Rr(function(le,ue){var K=new Intl.RelativeTimeFormat(le,Kn({},ue));return function(fe){return K.format(fe,ue.range||"day")}}),list:Rr(function(le,ue){var K=new Intl.ListFormat(le,Kn({},ue));return function(fe){return K.format(fe)}})},this.init(pe)}return(0,ae.A)(be,[{key:"init",value:function(le){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},K=ue.interpolation;this.formatSeparator=K.formatSeparator?K.formatSeparator:K.formatSeparator||","}},{key:"add",value:function(le,ue){this.formats[le.toLowerCase().trim()]=ue}},{key:"addCached",value:function(le,ue){this.formats[le.toLowerCase().trim()]=Rr(ue)}},{key:"format",value:function(le,ue,K){var fe=this,_e=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},Ve=ue.split(this.formatSeparator),X=Ve.reduce(function(xe,Ne){var Ee=Ir(Ne),Oe=Ee.formatName,Be=Ee.formatOptions;if(fe.formats[Oe]){var et=xe;try{var dt=_e&&_e.formatParams&&_e.formatParams[_e.interpolationkey]||{},bt=dt.locale||dt.lng||_e.locale||_e.lng||K;et=fe.formats[Oe](xe,bt,Kn(Kn(Kn({},Be),_e),dt))}catch(ft){fe.logger.warn(ft)}return et}else fe.logger.warn("there was no format function for ".concat(Oe));return xe},le);return X}}]),be}();function Tr(be,pe){var le=Object.keys(be);if(Object.getOwnPropertySymbols){var ue=Object.getOwnPropertySymbols(be);pe&&(ue=ue.filter(function(K){return Object.getOwnPropertyDescriptor(be,K).enumerable})),le.push.apply(le,ue)}return le}function gt(be){for(var pe=1;pe<arguments.length;pe++){var le=arguments[pe]!=null?arguments[pe]:{};pe%2?Tr(Object(le),!0).forEach(function(ue){(0,U.A)(be,ue,le[ue])}):Object.getOwnPropertyDescriptors?Object.defineProperties(be,Object.getOwnPropertyDescriptors(le)):Tr(Object(le)).forEach(function(ue){Object.defineProperty(be,ue,Object.getOwnPropertyDescriptor(le,ue))})}return be}function _s(be){var pe=cs();return function(){var ue=Z(be),K;if(pe){var fe=Z(this).constructor;K=Reflect.construct(ue,arguments,fe)}else K=ue.apply(this,arguments);return q(this,K)}}function cs(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Gr(be,pe){be.pending[pe]!==void 0&&(delete be.pending[pe],be.pendingCount--)}var xr=function(be){ee(le,be);var pe=_s(le);function le(ue,K,fe){var _e,Ve=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return(0,Te.A)(this,le),_e=pe.call(this),z&&It.call(ie(_e)),_e.backend=ue,_e.store=K,_e.services=fe,_e.languageUtils=fe.languageUtils,_e.options=Ve,_e.logger=mt.create("backendConnector"),_e.waitingReads=[],_e.maxParallelReads=Ve.maxParallelReads||10,_e.readingCalls=0,_e.maxRetries=Ve.maxRetries>=0?Ve.maxRetries:5,_e.retryTimeout=Ve.retryTimeout>=1?Ve.retryTimeout:350,_e.state={},_e.queue=[],_e.backend&&_e.backend.init&&_e.backend.init(fe,Ve.backend,Ve),_e}return(0,ae.A)(le,[{key:"queueLoad",value:function(K,fe,_e,Ve){var X=this,xe={},Ne={},Ee={},Oe={};return K.forEach(function(Be){var et=!0;fe.forEach(function(dt){var bt="".concat(Be,"|").concat(dt);!_e.reload&&X.store.hasResourceBundle(Be,dt)?X.state[bt]=2:X.state[bt]<0||(X.state[bt]===1?Ne[bt]===void 0&&(Ne[bt]=!0):(X.state[bt]=1,et=!1,Ne[bt]===void 0&&(Ne[bt]=!0),xe[bt]===void 0&&(xe[bt]=!0),Oe[dt]===void 0&&(Oe[dt]=!0)))}),et||(Ee[Be]=!0)}),(Object.keys(xe).length||Object.keys(Ne).length)&&this.queue.push({pending:Ne,pendingCount:Object.keys(Ne).length,loaded:{},errors:[],callback:Ve}),{toLoad:Object.keys(xe),pending:Object.keys(Ne),toLoadLanguages:Object.keys(Ee),toLoadNamespaces:Object.keys(Oe)}}},{key:"loaded",value:function(K,fe,_e){var Ve=K.split("|"),X=Ve[0],xe=Ve[1];fe&&this.emit("failedLoading",X,xe,fe),_e&&this.store.addResourceBundle(X,xe,_e),this.state[K]=fe?-1:2;var Ne={};this.queue.forEach(function(Ee){rn(Ee.loaded,[X],xe),Gr(Ee,K),fe&&Ee.errors.push(fe),Ee.pendingCount===0&&!Ee.done&&(Object.keys(Ee.loaded).forEach(function(Oe){Ne[Oe]||(Ne[Oe]={});var Be=Ee.loaded[Oe];Be.length&&Be.forEach(function(et){Ne[Oe][et]===void 0&&(Ne[Oe][et]=!0)})}),Ee.done=!0,Ee.errors.length?Ee.callback(Ee.errors):Ee.callback())}),this.emit("loaded",Ne),this.queue=this.queue.filter(function(Ee){return!Ee.done})}},{key:"read",value:function(K,fe,_e){var Ve=this,X=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,xe=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,Ne=arguments.length>5?arguments[5]:void 0;if(!K.length)return Ne(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:K,ns:fe,fcName:_e,tried:X,wait:xe,callback:Ne});return}this.readingCalls++;var Ee=function(dt,bt){if(Ve.readingCalls--,Ve.waitingReads.length>0){var ft=Ve.waitingReads.shift();Ve.read(ft.lng,ft.ns,ft.fcName,ft.tried,ft.wait,ft.callback)}if(dt&&bt&&X<Ve.maxRetries){setTimeout(function(){Ve.read.call(Ve,K,fe,_e,X+1,xe*2,Ne)},xe);return}Ne(dt,bt)},Oe=this.backend[_e].bind(this.backend);if(Oe.length===2){try{var Be=Oe(K,fe);Be&&typeof Be.then=="function"?Be.then(function(et){return Ee(null,et)}).catch(Ee):Ee(null,Be)}catch(et){Ee(et)}return}return Oe(K,fe,Ee)}},{key:"prepareLoading",value:function(K,fe){var _e=this,Ve=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},X=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),X&&X();typeof K=="string"&&(K=this.languageUtils.toResolveHierarchy(K)),typeof fe=="string"&&(fe=[fe]);var xe=this.queueLoad(K,fe,Ve,X);if(!xe.toLoad.length)return xe.pending.length||X(),null;xe.toLoad.forEach(function(Ne){_e.loadOne(Ne)})}},{key:"load",value:function(K,fe,_e){this.prepareLoading(K,fe,{},_e)}},{key:"reload",value:function(K,fe,_e){this.prepareLoading(K,fe,{reload:!0},_e)}},{key:"loadOne",value:function(K){var fe=this,_e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",Ve=K.split("|"),X=Ve[0],xe=Ve[1];this.read(X,xe,"read",void 0,void 0,function(Ne,Ee){Ne&&fe.logger.warn("".concat(_e,"loading namespace ").concat(xe," for language ").concat(X," failed"),Ne),!Ne&&Ee&&fe.logger.log("".concat(_e,"loaded namespace ").concat(xe," for language ").concat(X),Ee),fe.loaded(K,Ne,Ee)})}},{key:"saveMissing",value:function(K,fe,_e,Ve,X){var xe=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},Ne=arguments.length>6&&arguments[6]!==void 0?arguments[6]:function(){};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(fe)){this.logger.warn('did not save key "'.concat(_e,'" as the namespace "').concat(fe,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(_e==null||_e==="")){if(this.backend&&this.backend.create){var Ee=gt(gt({},xe),{},{isUpdate:X}),Oe=this.backend.create.bind(this.backend);if(Oe.length<6)try{var Be;Oe.length===5?Be=Oe(K,fe,_e,Ve,Ee):Be=Oe(K,fe,_e,Ve),Be&&typeof Be.then=="function"?Be.then(function(et){return Ne(null,et)}).catch(Ne):Ne(null,Be)}catch(et){Ne(et)}else Oe(K,fe,_e,Ve,Ne,Ee)}!K||!K[0]||this.store.addResource(K[0],fe,_e,Ve)}}}]),le}(It);function no(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(pe){var le={};if((0,we.A)(pe[1])==="object"&&(le=pe[1]),typeof pe[1]=="string"&&(le.defaultValue=pe[1]),typeof pe[2]=="string"&&(le.tDescription=pe[2]),(0,we.A)(pe[2])==="object"||(0,we.A)(pe[3])==="object"){var ue=pe[3]||pe[2];Object.keys(ue).forEach(function(K){le[K]=ue[K]})}return le},interpolation:{escapeValue:!0,format:function(pe,le,ue,K){return pe},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function ps(be){return typeof be.ns=="string"&&(be.ns=[be.ns]),typeof be.fallbackLng=="string"&&(be.fallbackLng=[be.fallbackLng]),typeof be.fallbackNS=="string"&&(be.fallbackNS=[be.fallbackNS]),be.supportedLngs&&be.supportedLngs.indexOf("cimode")<0&&(be.supportedLngs=be.supportedLngs.concat(["cimode"])),be}function ns(be,pe){var le=Object.keys(be);if(Object.getOwnPropertySymbols){var ue=Object.getOwnPropertySymbols(be);pe&&(ue=ue.filter(function(K){return Object.getOwnPropertyDescriptor(be,K).enumerable})),le.push.apply(le,ue)}return le}function ss(be){for(var pe=1;pe<arguments.length;pe++){var le=arguments[pe]!=null?arguments[pe]:{};pe%2?ns(Object(le),!0).forEach(function(ue){(0,U.A)(be,ue,le[ue])}):Object.getOwnPropertyDescriptors?Object.defineProperties(be,Object.getOwnPropertyDescriptors(le)):ns(Object(le)).forEach(function(ue){Object.defineProperty(be,ue,Object.getOwnPropertyDescriptor(le,ue))})}return be}function Wo(be){var pe=_o();return function(){var ue=Z(be),K;if(pe){var fe=Z(this).constructor;K=Reflect.construct(ue,arguments,fe)}else K=ue.apply(this,arguments);return q(this,K)}}function _o(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ao(){}function Ls(be){var pe=Object.getOwnPropertyNames(Object.getPrototypeOf(be));pe.forEach(function(le){typeof be[le]=="function"&&(be[le]=be[le].bind(be))})}var So=function(be){ee(le,be);var pe=Wo(le);function le(){var ue,K=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},fe=arguments.length>1?arguments[1]:void 0;if((0,Te.A)(this,le),ue=pe.call(this),z&&It.call(ie(ue)),ue.options=ps(K),ue.services={},ue.logger=mt,ue.modules={external:[]},Ls(ie(ue)),fe&&!ue.isInitialized&&!K.isClone){if(!ue.options.initImmediate)return ue.init(K,fe),q(ue,ie(ue));setTimeout(function(){ue.init(K,fe)},0)}return ue}return(0,ae.A)(le,[{key:"init",value:function(){var K=this,fe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},_e=arguments.length>1?arguments[1]:void 0;typeof fe=="function"&&(_e=fe,fe={}),!fe.defaultNS&&fe.defaultNS!==!1&&fe.ns&&(typeof fe.ns=="string"?fe.defaultNS=fe.ns:fe.ns.indexOf("translation")<0&&(fe.defaultNS=fe.ns[0]));var Ve=no();this.options=ss(ss(ss({},Ve),this.options),ps(fe)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=ss(ss({},Ve.interpolation),this.options.interpolation)),fe.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=fe.keySeparator),fe.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=fe.nsSeparator);function X(ft){return ft?typeof ft=="function"?new ft:ft:null}if(!this.options.isClone){this.modules.logger?mt.init(X(this.modules.logger),this.options):mt.init(null,this.options);var xe;this.modules.formatter?xe=this.modules.formatter:typeof Intl<"u"&&(xe=pr);var Ne=new zt(this.options);this.store=new Yn(this.options.resources,this.options);var Ee=this.services;Ee.logger=mt,Ee.resourceStore=this.store,Ee.languageUtils=Ne,Ee.pluralResolver=new Xt(Ne,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),xe&&(!this.options.interpolation.format||this.options.interpolation.format===Ve.interpolation.format)&&(Ee.formatter=X(xe),Ee.formatter.init(Ee,this.options),this.options.interpolation.format=Ee.formatter.format.bind(Ee.formatter)),Ee.interpolator=new Jn(this.options),Ee.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},Ee.backendConnector=new xr(X(this.modules.backend),Ee.resourceStore,Ee,this.options),Ee.backendConnector.on("*",function(ft){for(var pt=arguments.length,_t=new Array(pt>1?pt-1:0),Kt=1;Kt<pt;Kt++)_t[Kt-1]=arguments[Kt];K.emit.apply(K,[ft].concat(_t))}),this.modules.languageDetector&&(Ee.languageDetector=X(this.modules.languageDetector),Ee.languageDetector.init&&Ee.languageDetector.init(Ee,this.options.detection,this.options)),this.modules.i18nFormat&&(Ee.i18nFormat=X(this.modules.i18nFormat),Ee.i18nFormat.init&&Ee.i18nFormat.init(this)),this.translator=new Bs(this.services,this.options),this.translator.on("*",function(ft){for(var pt=arguments.length,_t=new Array(pt>1?pt-1:0),Kt=1;Kt<pt;Kt++)_t[Kt-1]=arguments[Kt];K.emit.apply(K,[ft].concat(_t))}),this.modules.external.forEach(function(ft){ft.init&&ft.init(K)})}if(this.format=this.options.interpolation.format,_e||(_e=ao),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var Oe=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);Oe.length>0&&Oe[0]!=="dev"&&(this.options.lng=Oe[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var Be=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];Be.forEach(function(ft){K[ft]=function(){var pt;return(pt=K.store)[ft].apply(pt,arguments)}});var et=["addResource","addResources","addResourceBundle","removeResourceBundle"];et.forEach(function(ft){K[ft]=function(){var pt;return(pt=K.store)[ft].apply(pt,arguments),K}});var dt=qe(),bt=function(){var pt=function(Kt,fn){K.isInitialized&&!K.initializedStoreOnce&&K.logger.warn("init: i18next is already initialized. You should call init just once!"),K.isInitialized=!0,K.options.isClone||K.logger.log("initialized",K.options),K.emit("initialized",K.options),dt.resolve(fn),_e(Kt,fn)};if(K.languages&&K.options.compatibilityAPI!=="v1"&&!K.isInitialized)return pt(null,K.t.bind(K));K.changeLanguage(K.options.lng,pt)};return this.options.resources||!this.options.initImmediate?bt():setTimeout(bt,0),dt}},{key:"loadResources",value:function(K){var fe=this,_e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ao,Ve=_e,X=typeof K=="string"?K:this.language;if(typeof K=="function"&&(Ve=K),!this.options.resources||this.options.partialBundledLanguages){if(X&&X.toLowerCase()==="cimode")return Ve();var xe=[],Ne=function(Be){if(Be){var et=fe.services.languageUtils.toResolveHierarchy(Be);et.forEach(function(dt){xe.indexOf(dt)<0&&xe.push(dt)})}};if(X)Ne(X);else{var Ee=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);Ee.forEach(function(Oe){return Ne(Oe)})}this.options.preload&&this.options.preload.forEach(function(Oe){return Ne(Oe)}),this.services.backendConnector.load(xe,this.options.ns,function(Oe){!Oe&&!fe.resolvedLanguage&&fe.language&&fe.setResolvedLanguage(fe.language),Ve(Oe)})}else Ve(null)}},{key:"reloadResources",value:function(K,fe,_e){var Ve=qe();return K||(K=this.languages),fe||(fe=this.options.ns),_e||(_e=ao),this.services.backendConnector.reload(K,fe,function(X){Ve.resolve(),_e(X)}),Ve}},{key:"use",value:function(K){if(!K)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!K.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return K.type==="backend"&&(this.modules.backend=K),(K.type==="logger"||K.log&&K.warn&&K.error)&&(this.modules.logger=K),K.type==="languageDetector"&&(this.modules.languageDetector=K),K.type==="i18nFormat"&&(this.modules.i18nFormat=K),K.type==="postProcessor"&&nr.addPostProcessor(K),K.type==="formatter"&&(this.modules.formatter=K),K.type==="3rdParty"&&this.modules.external.push(K),this}},{key:"setResolvedLanguage",value:function(K){if(!(!K||!this.languages)&&!(["cimode","dev"].indexOf(K)>-1))for(var fe=0;fe<this.languages.length;fe++){var _e=this.languages[fe];if(!(["cimode","dev"].indexOf(_e)>-1)&&this.store.hasLanguageSomeTranslations(_e)){this.resolvedLanguage=_e;break}}}},{key:"changeLanguage",value:function(K,fe){var _e=this;this.isLanguageChangingTo=K;var Ve=qe();this.emit("languageChanging",K);var X=function(Oe){_e.language=Oe,_e.languages=_e.services.languageUtils.toResolveHierarchy(Oe),_e.resolvedLanguage=void 0,_e.setResolvedLanguage(Oe)},xe=function(Oe,Be){Be?(X(Be),_e.translator.changeLanguage(Be),_e.isLanguageChangingTo=void 0,_e.emit("languageChanged",Be),_e.logger.log("languageChanged",Be)):_e.isLanguageChangingTo=void 0,Ve.resolve(function(){return _e.t.apply(_e,arguments)}),fe&&fe(Oe,function(){return _e.t.apply(_e,arguments)})},Ne=function(Oe){!K&&!Oe&&_e.services.languageDetector&&(Oe=[]);var Be=typeof Oe=="string"?Oe:_e.services.languageUtils.getBestMatchFromCodes(Oe);Be&&(_e.language||X(Be),_e.translator.language||_e.translator.changeLanguage(Be),_e.services.languageDetector&&_e.services.languageDetector.cacheUserLanguage&&_e.services.languageDetector.cacheUserLanguage(Be)),_e.loadResources(Be,function(et){xe(et,Be)})};return!K&&this.services.languageDetector&&!this.services.languageDetector.async?Ne(this.services.languageDetector.detect()):!K&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(Ne):this.services.languageDetector.detect(Ne):Ne(K),Ve}},{key:"getFixedT",value:function(K,fe,_e){var Ve=this,X=function xe(Ne,Ee){var Oe;if((0,we.A)(Ee)!=="object"){for(var Be=arguments.length,et=new Array(Be>2?Be-2:0),dt=2;dt<Be;dt++)et[dt-2]=arguments[dt];Oe=Ve.options.overloadTranslationOptionHandler([Ne,Ee].concat(et))}else Oe=ss({},Ee);Oe.lng=Oe.lng||xe.lng,Oe.lngs=Oe.lngs||xe.lngs,Oe.ns=Oe.ns||xe.ns,Oe.keyPrefix=Oe.keyPrefix||_e||xe.keyPrefix;var bt=Ve.options.keySeparator||".",ft;return Oe.keyPrefix&&Array.isArray(Ne)?ft=Ne.map(function(pt){return"".concat(Oe.keyPrefix).concat(bt).concat(pt)}):ft=Oe.keyPrefix?"".concat(Oe.keyPrefix).concat(bt).concat(Ne):Ne,Ve.t(ft,Oe)};return typeof K=="string"?X.lng=K:X.lngs=K,X.ns=fe,X.keyPrefix=_e,X}},{key:"t",value:function(){var K;return this.translator&&(K=this.translator).translate.apply(K,arguments)}},{key:"exists",value:function(){var K;return this.translator&&(K=this.translator).exists.apply(K,arguments)}},{key:"setDefaultNamespace",value:function(K){this.options.defaultNS=K}},{key:"hasLoadedNamespace",value:function(K){var fe=this,_e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var Ve=_e.lng||this.resolvedLanguage||this.languages[0],X=this.options?this.options.fallbackLng:!1,xe=this.languages[this.languages.length-1];if(Ve.toLowerCase()==="cimode")return!0;var Ne=function(Be,et){var dt=fe.services.backendConnector.state["".concat(Be,"|").concat(et)];return dt===-1||dt===2};if(_e.precheck){var Ee=_e.precheck(this,Ne);if(Ee!==void 0)return Ee}return!!(this.hasResourceBundle(Ve,K)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||Ne(Ve,K)&&(!X||Ne(xe,K)))}},{key:"loadNamespaces",value:function(K,fe){var _e=this,Ve=qe();return this.options.ns?(typeof K=="string"&&(K=[K]),K.forEach(function(X){_e.options.ns.indexOf(X)<0&&_e.options.ns.push(X)}),this.loadResources(function(X){Ve.resolve(),fe&&fe(X)}),Ve):(fe&&fe(),Promise.resolve())}},{key:"loadLanguages",value:function(K,fe){var _e=qe();typeof K=="string"&&(K=[K]);var Ve=this.options.preload||[],X=K.filter(function(xe){return Ve.indexOf(xe)<0});return X.length?(this.options.preload=Ve.concat(X),this.loadResources(function(xe){_e.resolve(),fe&&fe(xe)}),_e):(fe&&fe(),Promise.resolve())}},{key:"dir",value:function(K){if(K||(K=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!K)return"rtl";var fe=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],_e=this.services&&this.services.languageUtils||new zt(no());return fe.indexOf(_e.getLanguagePartFromCode(K))>-1||K.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var K=this,fe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},_e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ao,Ve=ss(ss(ss({},this.options),fe),{isClone:!0}),X=new le(Ve);(fe.debug!==void 0||fe.prefix!==void 0)&&(X.logger=X.logger.clone(fe));var xe=["store","services","language"];return xe.forEach(function(Ne){X[Ne]=K[Ne]}),X.services=ss({},this.services),X.services.utils={hasLoadedNamespace:X.hasLoadedNamespace.bind(X)},X.translator=new Bs(X.services,X.options),X.translator.on("*",function(Ne){for(var Ee=arguments.length,Oe=new Array(Ee>1?Ee-1:0),Be=1;Be<Ee;Be++)Oe[Be-1]=arguments[Be];X.emit.apply(X,[Ne].concat(Oe))}),X.init(Ve,_e),X.translator.options=X.options,X.translator.backendConnector.services.utils={hasLoadedNamespace:X.hasLoadedNamespace.bind(X)},X}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),le}(It);(0,U.A)(So,"createInstance",function(){var be=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},pe=arguments.length>1?arguments[1]:void 0;return new So(be,pe)});var jr=So.createInstance();jr.createInstance=So.createInstance;var Dn=jr.createInstance,Dr=jr.dir,Vs=jr.init,Mo=jr.loadResources,qo=jr.reloadResources,ui=jr.use,Wn=jr.changeLanguage,Me=jr.getFixedT,Qe=jr.t,Ke=jr.exists,ut=jr.setDefaultNamespace,Wt=jr.hasLoadedNamespace,cn=jr.loadNamespaces,Qt=jr.loadLanguages},3254:(a,l,se)=>{"use strict";se.d(l,{xC:()=>_o,x6:()=>fs,r9:()=>Hn,Bd:()=>Gr});var we=se(4467);function Te(Me,Qe){if(Me==null)return{};var Ke={};for(var ut in Me)if(Object.prototype.hasOwnProperty.call(Me,ut)){if(Qe.indexOf(ut)>=0)continue;Ke[ut]=Me[ut]}return Ke}function ae(Me,Qe){if(Me==null)return{};var Ke=Te(Me,Qe),ut,Wt;if(Object.getOwnPropertySymbols){var cn=Object.getOwnPropertySymbols(Me);for(Wt=0;Wt<cn.length;Wt++)ut=cn[Wt],!(Qe.indexOf(ut)>=0)&&Object.prototype.propertyIsEnumerable.call(Me,ut)&&(Ke[ut]=Me[ut])}return Ke}var ie=se(6194),W=se(2284),ee=se(3761),q=se.n(ee),Z=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function U(Me){var Qe={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},Ke=Me.match(/<\/?([^\s]+?)[/\s>]/);if(Ke&&(Qe.name=Ke[1],(q()[Ke[1]]||Me.charAt(Me.length-2)==="/")&&(Qe.voidElement=!0),Qe.name.startsWith("!--"))){var ut=Me.indexOf("-->");return{type:"comment",comment:ut!==-1?Me.slice(4,ut):""}}for(var Wt=new RegExp(Z),cn=null;(cn=Wt.exec(Me))!==null;)if(cn[0].trim())if(cn[1]){var Qt=cn[1].trim(),be=[Qt,""];Qt.indexOf("=")>-1&&(be=Qt.split("=")),Qe.attrs[be[0]]=be[1],Wt.lastIndex--}else cn[2]&&(Qe.attrs[cn[2]]=cn[3].trim().substring(1,cn[3].length-1));return Qe}var ge=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,ne=/^\s*$/,ve=Object.create(null);function V(Me,Qe){switch(Qe.type){case"text":return Me+Qe.content;case"tag":return Me+="<"+Qe.name+(Qe.attrs?function(Ke){var ut=[];for(var Wt in Ke)ut.push(Wt+'="'+Ke[Wt]+'"');return ut.length?" "+ut.join(" "):""}(Qe.attrs):"")+(Qe.voidElement?"/>":">"),Qe.voidElement?Me:Me+Qe.children.reduce(V,"")+"</"+Qe.name+">";case"comment":return Me+"<!--"+Qe.comment+"-->"}}var te={parse:function(Me,Qe){Qe||(Qe={}),Qe.components||(Qe.components=ve);var Ke,ut=[],Wt=[],cn=-1,Qt=!1;if(Me.indexOf("<")!==0){var be=Me.indexOf("<");ut.push({type:"text",content:be===-1?Me:Me.substring(0,be)})}return Me.replace(ge,function(pe,le){if(Qt){if(pe!=="</"+Ke.name+">")return;Qt=!1}var ue,K=pe.charAt(1)!=="/",fe=pe.startsWith("<!--"),_e=le+pe.length,Ve=Me.charAt(_e);if(fe){var X=U(pe);return cn<0?(ut.push(X),ut):((ue=Wt[cn]).children.push(X),ut)}if(K&&(cn++,(Ke=U(pe)).type==="tag"&&Qe.components[Ke.name]&&(Ke.type="component",Qt=!0),Ke.voidElement||Qt||!Ve||Ve==="<"||Ke.children.push({type:"text",content:Me.slice(_e,Me.indexOf("<",_e))}),cn===0&&ut.push(Ke),(ue=Wt[cn-1])&&ue.children.push(Ke),Wt[cn]=Ke),(!K||Ke.voidElement)&&(cn>-1&&(Ke.voidElement||Ke.name===pe.slice(2,-1))&&(cn--,Ke=cn===-1?ut:Wt[cn]),!Qt&&Ve!=="<"&&Ve)){ue=cn===-1?ut:Wt[cn].children;var xe=Me.indexOf("<",_e),Ne=Me.slice(_e,xe===-1?void 0:xe);ne.test(Ne)&&(Ne=" "),(xe>-1&&cn+ue.length>=0||Ne!==" ")&&ue.push({type:"text",content:Ne})}}),ut},stringify:function(Me){return Me.reduce(function(Qe,Ke){return Qe+V("",Ke)},"")}};const Re=te;function Ie(){if(console&&console.warn){for(var Me,Qe=arguments.length,Ke=new Array(Qe),ut=0;ut<Qe;ut++)Ke[ut]=arguments[ut];typeof Ke[0]=="string"&&(Ke[0]="react-i18next:: ".concat(Ke[0])),(Me=console).warn.apply(Me,Ke)}}var $e={};function vt(){for(var Me=arguments.length,Qe=new Array(Me),Ke=0;Ke<Me;Ke++)Qe[Ke]=arguments[Ke];typeof Qe[0]=="string"&&$e[Qe[0]]||(typeof Qe[0]=="string"&&($e[Qe[0]]=new Date),Ie.apply(void 0,Qe))}var mt=function(Qe,Ke){return function(){if(Qe.isInitialized)Ke();else{var ut=function Wt(){setTimeout(function(){Qe.off("initialized",Wt)},0),Ke()};Qe.on("initialized",ut)}}};function It(Me,Qe,Ke){Me.loadNamespaces(Qe,mt(Me,Ke))}function qe(Me,Qe,Ke,ut){typeof Ke=="string"&&(Ke=[Ke]),Ke.forEach(function(Wt){Me.options.ns.indexOf(Wt)<0&&Me.options.ns.push(Wt)}),Me.loadLanguages(Qe,mt(Me,ut))}function nn(Me,Qe){var Ke=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},ut=Qe.languages[0],Wt=Qe.options?Qe.options.fallbackLng:!1,cn=Qe.languages[Qe.languages.length-1];if(ut.toLowerCase()==="cimode")return!0;var Qt=function(pe,le){var ue=Qe.services.backendConnector.state["".concat(pe,"|").concat(le)];return ue===-1||ue===2};return Ke.bindI18n&&Ke.bindI18n.indexOf("languageChanging")>-1&&Qe.services.backendConnector.backend&&Qe.isLanguageChangingTo&&!Qt(Qe.isLanguageChangingTo,Me)?!1:!!(Qe.hasResourceBundle(ut,Me)||!Qe.services.backendConnector.backend||Qe.options.resources&&!Qe.options.partialBundledLanguages||Qt(ut,Me)&&(!Wt||Qt(cn,Me)))}function Ut(Me,Qe){var Ke=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!Qe.languages||!Qe.languages.length)return vt("i18n.languages were undefined or empty",Qe.languages),!0;var ut=Qe.options.ignoreJSONStructure!==void 0;return ut?Qe.hasLoadedNamespace(Me,{lng:Ke.lng,precheck:function(cn,Qt){if(Ke.bindI18n&&Ke.bindI18n.indexOf("languageChanging")>-1&&cn.services.backendConnector.backend&&cn.isLanguageChangingTo&&!Qt(cn.isLanguageChangingTo,Me))return!1}}):nn(Me,Qe,Ke)}function Xe(Me){return Me.displayName||Me.name||(typeof Me=="string"&&Me.length>0?Me:"Unknown")}var Ft=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,rn={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"\xA9","&#169;":"\xA9","&reg;":"\xAE","&#174;":"\xAE","&hellip;":"\u2026","&#8230;":"\u2026","&#x2F;":"/","&#47;":"/"},Vt=function(Qe){return rn[Qe]},ze=function(Qe){return Qe.replace(Ft,Vt)};function je(Me,Qe){var Ke=Object.keys(Me);if(Object.getOwnPropertySymbols){var ut=Object.getOwnPropertySymbols(Me);Qe&&(ut=ut.filter(function(Wt){return Object.getOwnPropertyDescriptor(Me,Wt).enumerable})),Ke.push.apply(Ke,ut)}return Ke}function De(Me){for(var Qe=1;Qe<arguments.length;Qe++){var Ke=arguments[Qe]!=null?arguments[Qe]:{};Qe%2?je(Object(Ke),!0).forEach(function(ut){(0,we.A)(Me,ut,Ke[ut])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Me,Object.getOwnPropertyDescriptors(Ke)):je(Object(Ke)).forEach(function(ut){Object.defineProperty(Me,ut,Object.getOwnPropertyDescriptor(Ke,ut))})}return Me}var ct={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:ze};function qt(){var Me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ct=De(De({},ct),Me)}function z(){return ct}var He;function Ct(Me){He=Me}function kt(){return He}var Pe=["format"],yt=["children","count","parent","i18nKey","context","tOptions","values","defaults","components","ns","i18n","t","shouldUnescape"];function un(Me,Qe){var Ke=Object.keys(Me);if(Object.getOwnPropertySymbols){var ut=Object.getOwnPropertySymbols(Me);Qe&&(ut=ut.filter(function(Wt){return Object.getOwnPropertyDescriptor(Me,Wt).enumerable})),Ke.push.apply(Ke,ut)}return Ke}function Rn(Me){for(var Qe=1;Qe<arguments.length;Qe++){var Ke=arguments[Qe]!=null?arguments[Qe]:{};Qe%2?un(Object(Ke),!0).forEach(function(ut){(0,we.A)(Me,ut,Ke[ut])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Me,Object.getOwnPropertyDescriptors(Ke)):un(Object(Ke)).forEach(function(ut){Object.defineProperty(Me,ut,Object.getOwnPropertyDescriptor(Ke,ut))})}return Me}function Yn(Me,Qe){if(!Me)return!1;var Ke=Me.props?Me.props.children:Me.children;return Qe?Ke.length>0:!!Ke}function nr(Me){return Me?Me.props?Me.props.children:Me.children:[]}function rr(Me){return Object.prototype.toString.call(Me)!=="[object Array]"?!1:Me.every(function(Qe){return(0,ie.isValidElement)(Qe)})}function ar(Me){return Array.isArray(Me)?Me:[Me]}function wr(Me,Qe){var Ke=Rn({},Qe);return Ke.props=Object.assign(Me.props,Qe.props),Ke}function Ts(Me,Qe){if(!Me)return"";var Ke="",ut=ar(Me),Wt=Qe.transSupportBasicHtmlNodes&&Qe.transKeepBasicHtmlNodesFor?Qe.transKeepBasicHtmlNodesFor:[];return ut.forEach(function(cn,Qt){if(typeof cn=="string")Ke+="".concat(cn);else if((0,ie.isValidElement)(cn)){var be=Object.keys(cn.props).length,pe=Wt.indexOf(cn.type)>-1,le=cn.props.children;if(!le&&pe&&be===0)Ke+="<".concat(cn.type,"/>");else if(!le&&(!pe||be!==0))Ke+="<".concat(Qt,"></").concat(Qt,">");else if(cn.props.i18nIsDynamicList)Ke+="<".concat(Qt,"></").concat(Qt,">");else if(pe&&be===1&&typeof le=="string")Ke+="<".concat(cn.type,">").concat(le,"</").concat(cn.type,">");else{var ue=Ts(le,Qe);Ke+="<".concat(Qt,">").concat(ue,"</").concat(Qt,">")}}else if(cn===null)Ie("Trans: the passed in value is invalid - seems you passed in a null child.");else if((0,W.A)(cn)==="object"){var K=cn.format,fe=ae(cn,Pe),_e=Object.keys(fe);if(_e.length===1){var Ve=K?"".concat(_e[0],", ").concat(K):_e[0];Ke+="{{".concat(Ve,"}}")}else Ie("react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.",cn)}else Ie("Trans: the passed in value is invalid - seems you passed in a variable like {number} - please pass in variables for interpolation as full objects like {{number}}.",cn)}),Ke}function Zr(Me,Qe,Ke,ut,Wt,cn){if(Qe==="")return[];var Qt=ut.transKeepBasicHtmlNodesFor||[],be=Qe&&new RegExp(Qt.join("|")).test(Qe);if(!Me&&!be)return[Qe];var pe={};function le(xe){var Ne=ar(xe);Ne.forEach(function(Ee){typeof Ee!="string"&&(Yn(Ee)?le(nr(Ee)):(0,W.A)(Ee)==="object"&&!(0,ie.isValidElement)(Ee)&&Object.assign(pe,Ee))})}le(Me);var ue=Re.parse("<0>".concat(Qe,"</0>")),K=Rn(Rn({},pe),Wt);function fe(xe,Ne,Ee){var Oe=nr(xe),Be=Ve(Oe,Ne.children,Ee);return rr(Oe)&&Be.length===0?Oe:Be}function _e(xe,Ne,Ee,Oe,Be){xe.dummy&&(xe.children=Ne),Ee.push((0,ie.cloneElement)(xe,Rn(Rn({},xe.props),{},{key:Oe}),Be?void 0:Ne))}function Ve(xe,Ne,Ee){var Oe=ar(xe),Be=ar(Ne);return Be.reduce(function(et,dt,bt){var ft=dt.children&&dt.children[0]&&dt.children[0].content&&Ke.services.interpolator.interpolate(dt.children[0].content,K,Ke.language);if(dt.type==="tag"){var pt=Oe[parseInt(dt.name,10)];!pt&&Ee.length===1&&Ee[0][dt.name]&&(pt=Ee[0][dt.name]),pt||(pt={});var _t=Object.keys(dt.attrs).length!==0?wr({props:dt.attrs},pt):pt,Kt=(0,ie.isValidElement)(_t),fn=Kt&&Yn(dt,!0)&&!dt.voidElement,hn=be&&(0,W.A)(_t)==="object"&&_t.dummy&&!Kt,In=(0,W.A)(Me)==="object"&&Me!==null&&Object.hasOwnProperty.call(Me,dt.name);if(typeof _t=="string"){var lr=Ke.services.interpolator.interpolate(_t,K,Ke.language);et.push(lr)}else if(Yn(_t)||fn){var Gn=fe(_t,dt,Ee);_e(_t,Gn,et,bt)}else if(hn){var Mn=Ve(Oe,dt.children,Ee);et.push((0,ie.cloneElement)(_t,Rn(Rn({},_t.props),{},{key:bt}),Mn))}else if(Number.isNaN(parseFloat(dt.name)))if(In){var gr=fe(_t,dt,Ee);_e(_t,gr,et,bt,dt.voidElement)}else if(ut.transSupportBasicHtmlNodes&&Qt.indexOf(dt.name)>-1)if(dt.voidElement)et.push((0,ie.createElement)(dt.name,{key:"".concat(dt.name,"-").concat(bt)}));else{var er=Ve(Oe,dt.children,Ee);et.push((0,ie.createElement)(dt.name,{key:"".concat(dt.name,"-").concat(bt)},er))}else if(dt.voidElement)et.push("<".concat(dt.name," />"));else{var _r=Ve(Oe,dt.children,Ee);et.push("<".concat(dt.name,">").concat(_r,"</").concat(dt.name,">"))}else if((0,W.A)(_t)==="object"&&!Kt){var vs=dt.children[0]?ft:null;vs&&et.push(vs)}else dt.children.length===1&&ft?et.push((0,ie.cloneElement)(_t,Rn(Rn({},_t.props),{},{key:bt}),ft)):et.push((0,ie.cloneElement)(_t,Rn(Rn({},_t.props),{},{key:bt})))}else if(dt.type==="text"){var ys=ut.transWrapTextNodes,ro=cn?ut.unescape(Ke.services.interpolator.interpolate(dt.content,K,Ke.language)):Ke.services.interpolator.interpolate(dt.content,K,Ke.language);ys?et.push((0,ie.createElement)(ys,{key:"".concat(dt.name,"-").concat(bt)},ro)):et.push(ro)}return et},[])}var X=Ve([{dummy:!0,children:Me||[]}],ue,ar(Me||[]));return nr(X[0])}function Bs(Me){var Qe=Me.children,Ke=Me.count,ut=Me.parent,Wt=Me.i18nKey,cn=Me.context,Qt=Me.tOptions,be=Qt===void 0?{}:Qt,pe=Me.values,le=Me.defaults,ue=Me.components,K=Me.ns,fe=Me.i18n,_e=Me.t,Ve=Me.shouldUnescape,X=ae(Me,yt),xe=fe||kt();if(!xe)return vt("You will need to pass in an i18next instance by using i18nextReactModule"),Qe;var Ne=_e||xe.t.bind(xe)||function(fn){return fn};cn&&(be.context=cn);var Ee=Rn(Rn({},z()),xe.options&&xe.options.react),Oe=K||Ne.ns||xe.options&&xe.options.defaultNS;Oe=typeof Oe=="string"?[Oe]:Oe||["translation"];var Be=le||Ts(Qe,Ee)||Ee.transEmptyNodeValue||Wt,et=Ee.hashTransKey,dt=Wt||(et?et(Be):Be),bt=pe?be.interpolation:{interpolation:Rn(Rn({},be.interpolation),{},{prefix:"#$?",suffix:"?$#"})},ft=Rn(Rn(Rn(Rn({},be),{},{count:Ke},pe),bt),{},{defaultValue:Be,ns:Oe}),pt=dt?Ne(dt,ft):Be,_t=Zr(ue||Qe,pt,xe,Ee,ft,Ve),Kt=ut!==void 0?ut:Ee.defaultTransParent;return Kt?(0,ie.createElement)(Kt,X,_t):_t}var rt=se(3029),zt=se(2901),Hn={type:"3rdParty",init:function(Qe){qt(Qe.options.react),Ct(Qe)}};function Nr(Me,Qe){var Ke=Object.keys(Me);if(Object.getOwnPropertySymbols){var ut=Object.getOwnPropertySymbols(Me);Qe&&(ut=ut.filter(function(Wt){return Object.getOwnPropertyDescriptor(Me,Wt).enumerable})),Ke.push.apply(Ke,ut)}return Ke}function kr(Me){for(var Qe=1;Qe<arguments.length;Qe++){var Ke=arguments[Qe]!=null?arguments[Qe]:{};Qe%2?Nr(Object(Ke),!0).forEach(function(ut){_defineProperty(Me,ut,Ke[ut])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Me,Object.getOwnPropertyDescriptors(Ke)):Nr(Object(Ke)).forEach(function(ut){Object.defineProperty(Me,ut,Object.getOwnPropertyDescriptor(Ke,ut))})}return Me}var Xn=(0,ie.createContext)(),Jt=function(){function Me(){(0,rt.A)(this,Me),this.usedNamespaces={}}return(0,zt.A)(Me,[{key:"addUsedNamespaces",value:function(Ke){var ut=this;Ke.forEach(function(Wt){ut.usedNamespaces[Wt]||(ut.usedNamespaces[Wt]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),Me}();function Xt(Me){return function(Qe){return new Promise(function(Ke){var ut=qn();Me.getInitialProps?Me.getInitialProps(Qe).then(function(Wt){Ke(kr(kr({},Wt),ut))}):Ke(ut)})}}function qn(){var Me=getI18n(),Qe=Me.reportNamespaces?Me.reportNamespaces.getUsedNamespaces():[],Ke={},ut={};return Me.languages.forEach(function(Wt){ut[Wt]={},Qe.forEach(function(cn){ut[Wt][cn]=Me.getResourceBundle(Wt,cn)||{}})}),Ke.initialI18nStore=ut,Ke.initialLanguage=Me.language,Ke}var bn=["children","count","parent","i18nKey","context","tOptions","values","defaults","components","ns","i18n","t","shouldUnescape"];function sr(Me,Qe){var Ke=Object.keys(Me);if(Object.getOwnPropertySymbols){var ut=Object.getOwnPropertySymbols(Me);Qe&&(ut=ut.filter(function(Wt){return Object.getOwnPropertyDescriptor(Me,Wt).enumerable})),Ke.push.apply(Ke,ut)}return Ke}function Jn(Me){for(var Qe=1;Qe<arguments.length;Qe++){var Ke=arguments[Qe]!=null?arguments[Qe]:{};Qe%2?sr(Object(Ke),!0).forEach(function(ut){(0,we.A)(Me,ut,Ke[ut])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Me,Object.getOwnPropertyDescriptors(Ke)):sr(Object(Ke)).forEach(function(ut){Object.defineProperty(Me,ut,Object.getOwnPropertyDescriptor(Ke,ut))})}return Me}function fs(Me){var Qe=Me.children,Ke=Me.count,ut=Me.parent,Wt=Me.i18nKey,cn=Me.context,Qt=Me.tOptions,be=Qt===void 0?{}:Qt,pe=Me.values,le=Me.defaults,ue=Me.components,K=Me.ns,fe=Me.i18n,_e=Me.t,Ve=Me.shouldUnescape,X=ae(Me,bn),xe=(0,ie.useContext)(Xn)||{},Ne=xe.i18n,Ee=xe.defaultNS,Oe=fe||Ne||kt(),Be=_e||Oe&&Oe.t.bind(Oe);return Bs(Jn({children:Qe,count:Ke,parent:ut,i18nKey:Wt,context:cn,tOptions:be,values:pe,defaults:le,components:ue,ns:K||Be&&Be.ns||Ee||Oe&&Oe.options&&Oe.options.defaultNS,i18n:Oe,t:_e,shouldUnescape:Ve},X))}var Kn=se(6369);function Ir(Me,Qe){var Ke=Me==null?null:typeof Symbol<"u"&&Me[Symbol.iterator]||Me["@@iterator"];if(Ke!=null){var ut,Wt,cn,Qt,be=[],pe=!0,le=!1;try{if(cn=(Ke=Ke.call(Me)).next,Qe===0){if(Object(Ke)!==Ke)return;pe=!1}else for(;!(pe=(ut=cn.call(Ke)).done)&&(be.push(ut.value),be.length!==Qe);pe=!0);}catch(ue){le=!0,Wt=ue}finally{try{if(!pe&&Ke.return!=null&&(Qt=Ke.return(),Object(Qt)!==Qt))return}finally{if(le)throw Wt}}return be}}var Rr=se(8394),pr=se(6562);function Tr(Me,Qe){return(0,Kn.A)(Me)||Ir(Me,Qe)||(0,Rr.A)(Me,Qe)||(0,pr.A)()}function gt(Me,Qe){var Ke=Object.keys(Me);if(Object.getOwnPropertySymbols){var ut=Object.getOwnPropertySymbols(Me);Qe&&(ut=ut.filter(function(Wt){return Object.getOwnPropertyDescriptor(Me,Wt).enumerable})),Ke.push.apply(Ke,ut)}return Ke}function _s(Me){for(var Qe=1;Qe<arguments.length;Qe++){var Ke=arguments[Qe]!=null?arguments[Qe]:{};Qe%2?gt(Object(Ke),!0).forEach(function(ut){(0,we.A)(Me,ut,Ke[ut])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Me,Object.getOwnPropertyDescriptors(Ke)):gt(Object(Ke)).forEach(function(ut){Object.defineProperty(Me,ut,Object.getOwnPropertyDescriptor(Ke,ut))})}return Me}var cs=function(Qe,Ke){var ut=(0,ie.useRef)();return(0,ie.useEffect)(function(){ut.current=Ke?ut.current:Qe},[Qe,Ke]),ut.current};function Gr(Me){var Qe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ke=Qe.i18n,ut=(0,ie.useContext)(Xn)||{},Wt=ut.i18n,cn=ut.defaultNS,Qt=Ke||Wt||kt();if(Qt&&!Qt.reportNamespaces&&(Qt.reportNamespaces=new Jt),!Qt){vt("You will need to pass in an i18next instance by using initReactI18next");var be=function(pt,_t){return typeof _t=="string"?_t:_t&&(0,W.A)(_t)==="object"&&typeof _t.defaultValue=="string"?_t.defaultValue:Array.isArray(pt)?pt[pt.length-1]:pt},pe=[be,{},!1];return pe.t=be,pe.i18n={},pe.ready=!1,pe}Qt.options.react&&Qt.options.react.wait!==void 0&&vt("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var le=_s(_s(_s({},z()),Qt.options.react),Qe),ue=le.useSuspense,K=le.keyPrefix,fe=Me||cn||Qt.options&&Qt.options.defaultNS;fe=typeof fe=="string"?[fe]:fe||["translation"],Qt.reportNamespaces.addUsedNamespaces&&Qt.reportNamespaces.addUsedNamespaces(fe);var _e=(Qt.isInitialized||Qt.initializedStoreOnce)&&fe.every(function(ft){return Ut(ft,Qt,le)});function Ve(){return Qt.getFixedT(Qe.lng||null,le.nsMode==="fallback"?fe:fe[0],K)}var X=(0,ie.useState)(Ve),xe=Tr(X,2),Ne=xe[0],Ee=xe[1],Oe=fe.join();Qe.lng&&(Oe="".concat(Qe.lng).concat(Oe));var Be=cs(Oe),et=(0,ie.useRef)(!0);(0,ie.useEffect)(function(){var ft=le.bindI18n,pt=le.bindI18nStore;et.current=!0,!_e&&!ue&&(Qe.lng?qe(Qt,Qe.lng,fe,function(){et.current&&Ee(Ve)}):It(Qt,fe,function(){et.current&&Ee(Ve)})),_e&&Be&&Be!==Oe&&et.current&&Ee(Ve);function _t(){et.current&&Ee(Ve)}return ft&&Qt&&Qt.on(ft,_t),pt&&Qt&&Qt.store.on(pt,_t),function(){et.current=!1,ft&&Qt&&ft.split(" ").forEach(function(Kt){return Qt.off(Kt,_t)}),pt&&Qt&&pt.split(" ").forEach(function(Kt){return Qt.store.off(Kt,_t)})}},[Qt,Oe]);var dt=(0,ie.useRef)(!0);(0,ie.useEffect)(function(){et.current&&!dt.current&&Ee(Ve),dt.current=!1},[Qt,K]);var bt=[Ne,Qt,_e];if(bt.t=Ne,bt.i18n=Qt,bt.ready=_e,_e||!_e&&!ue)return bt;throw new Promise(function(ft){Qe.lng?qe(Qt,Qe.lng,fe,function(){return ft()}):It(Qt,fe,function(){return ft()})})}var xr=null;function no(Me,Qe){var Ke=Object.keys(Me);if(Object.getOwnPropertySymbols){var ut=Object.getOwnPropertySymbols(Me);Qe&&(ut=ut.filter(function(Wt){return Object.getOwnPropertyDescriptor(Me,Wt).enumerable})),Ke.push.apply(Ke,ut)}return Ke}function ps(Me){for(var Qe=1;Qe<arguments.length;Qe++){var Ke=arguments[Qe]!=null?arguments[Qe]:{};Qe%2?no(Object(Ke),!0).forEach(function(ut){_defineProperty(Me,ut,Ke[ut])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Me,Object.getOwnPropertyDescriptors(Ke)):no(Object(Ke)).forEach(function(ut){Object.defineProperty(Me,ut,Object.getOwnPropertyDescriptor(Ke,ut))})}return Me}function ns(Me){var Qe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function(ut){function Wt(Qt){var be=Qt.forwardedRef,pe=_objectWithoutProperties(Qt,xr),le=useTranslation(Me,ps(ps({},pe),{},{keyPrefix:Qe.keyPrefix})),ue=_slicedToArray(le,3),K=ue[0],fe=ue[1],_e=ue[2],Ve=ps(ps({},pe),{},{t:K,i18n:fe,tReady:_e});return Qe.withRef&&be?Ve.ref=be:!Qe.withRef&&be&&(Ve.forwardedRef=be),createElement(ut,Ve)}Wt.displayName="withI18nextTranslation(".concat(getDisplayName(ut),")"),Wt.WrappedComponent=ut;var cn=function(be,pe){return createElement(Wt,Object.assign({},be,{forwardedRef:pe}))};return Qe.withRef?forwardRefReact(cn):Wt}}var ss=null;function Wo(Me){var Qe=Me.ns,Ke=Me.children,ut=_objectWithoutProperties(Me,ss),Wt=useTranslation(Qe,ut),cn=_slicedToArray(Wt,3),Qt=cn[0],be=cn[1],pe=cn[2];return Ke(Qt,{i18n:be,lng:be.language},pe)}function _o(Me){var Qe=Me.i18n,Ke=Me.defaultNS,ut=Me.children,Wt=(0,ie.useMemo)(function(){return{i18n:Qe,defaultNS:Ke}},[Qe,Ke]);return(0,ie.createElement)(Xn.Provider,{value:Wt},ut)}function ao(Me,Qe){var Ke=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},ut=Ke.i18n,Wt=useContext(I18nContext)||{},cn=Wt.i18n,Qt=ut||cn||getI18n();Qt.options&&Qt.options.isClone||(Me&&!Qt.initializedStoreOnce&&(Qt.services.resourceStore.data=Me,Qt.options.ns=Object.values(Me).reduce(function(be,pe){return Object.keys(pe).forEach(function(le){be.indexOf(le)<0&&be.push(le)}),be},Qt.options.ns),Qt.initializedStoreOnce=!0,Qt.isInitialized=!0),Qe&&!Qt.initializedLanguageOnce&&(Qt.changeLanguage(Qe),Qt.initializedLanguageOnce=!0))}var Ls=null;function So(Me,Qe){var Ke=Object.keys(Me);if(Object.getOwnPropertySymbols){var ut=Object.getOwnPropertySymbols(Me);Qe&&(ut=ut.filter(function(Wt){return Object.getOwnPropertyDescriptor(Me,Wt).enumerable})),Ke.push.apply(Ke,ut)}return Ke}function jr(Me){for(var Qe=1;Qe<arguments.length;Qe++){var Ke=arguments[Qe]!=null?arguments[Qe]:{};Qe%2?So(Object(Ke),!0).forEach(function(ut){_defineProperty(Me,ut,Ke[ut])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Me,Object.getOwnPropertyDescriptors(Ke)):So(Object(Ke)).forEach(function(ut){Object.defineProperty(Me,ut,Object.getOwnPropertyDescriptor(Ke,ut))})}return Me}function Dn(){return function(Qe){function Ke(ut){var Wt=ut.initialI18nStore,cn=ut.initialLanguage,Qt=_objectWithoutProperties(ut,Ls);return useSSR(Wt,cn),createElement(Qe,jr({},Qt))}return Ke.getInitialProps=composeInitialProps(Qe),Ke.displayName="withI18nextSSR(".concat(getDisplayName(Qe),")"),Ke.WrappedComponent=Qe,Ke}}var Dr=function(){return""},Vs=function(){return""},Mo=function(){return""},qo=function(){return""},ui=function(){return""},Wn=function(){return""}}},rP={};function ln(a){var l=rP[a];if(l!==void 0)return l.exports;var se=rP[a]={id:a,loaded:!1,exports:{}};return nP[a].call(se.exports,se,se.exports,ln),se.loaded=!0,se.exports}ln.m=nP,ln.n=a=>{var l=a&&a.__esModule?()=>a.default:()=>a;return ln.d(l,{a:l}),l},(()=>{var a=Object.getPrototypeOf?se=>Object.getPrototypeOf(se):se=>se.__proto__,l;ln.t=function(se,we){if(we&1&&(se=this(se)),we&8||typeof se=="object"&&se&&(we&4&&se.__esModule||we&16&&typeof se.then=="function"))return se;var Te=Object.create(null);ln.r(Te);var ae={};l=l||[null,a({}),a([]),a(a)];for(var ie=we&2&&se;typeof ie=="object"&&!~l.indexOf(ie);ie=a(ie))Object.getOwnPropertyNames(ie).forEach(W=>ae[W]=()=>se[W]);return ae.default=()=>se,ln.d(Te,ae),Te}})(),ln.d=(a,l)=>{for(var se in l)ln.o(l,se)&&!ln.o(a,se)&&Object.defineProperty(a,se,{enumerable:!0,get:l[se]})},ln.f={},ln.e=a=>Promise.all(Object.keys(ln.f).reduce((l,se)=>(ln.f[se](a,l),l),[])),ln.u=a=>"static/js/"+a+"."+{95:"dc36ce92",372:"8ba9759f",458:"b8db2dbe",735:"922f1526",784:"5efe9830",942:"6ad81269"}[a]+".chunk.js",ln.miniCssF=a=>{},ln.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),ln.o=(a,l)=>Object.prototype.hasOwnProperty.call(a,l),(()=>{var a={},l="ssp:";ln.l=(se,we,Te,ae)=>{if(a[se]){a[se].push(we);return}var ie,W;if(Te!==void 0)for(var ee=document.getElementsByTagName("script"),q=0;q<ee.length;q++){var Z=ee[q];if(Z.getAttribute("src")==se||Z.getAttribute("data-webpack")==l+Te){ie=Z;break}}ie||(W=!0,ie=document.createElement("script"),ie.charset="utf-8",ie.timeout=120,ln.nc&&ie.setAttribute("nonce",ln.nc),ie.setAttribute("data-webpack",l+Te),ie.src=se),a[se]=[we];var U=(ne,ve)=>{ie.onerror=ie.onload=null,clearTimeout(ge);var V=a[se];if(delete a[se],ie.parentNode&&ie.parentNode.removeChild(ie),V&&V.forEach(te=>te(ve)),ne)return ne(ve)},ge=setTimeout(U.bind(null,void 0,{type:"timeout",target:ie}),12e4);ie.onerror=U.bind(null,ie.onerror),ie.onload=U.bind(null,ie.onload),W&&document.head.appendChild(ie)}})(),ln.r=a=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},ln.nmd=a=>(a.paths=[],a.children||(a.children=[]),a),ln.p="/",(()=>{var a={792:0};ln.f.j=(we,Te)=>{var ae=ln.o(a,we)?a[we]:void 0;if(ae!==0)if(ae)Te.push(ae[2]);else{var ie=new Promise((Z,U)=>ae=a[we]=[Z,U]);Te.push(ae[2]=ie);var W=ln.p+ln.u(we),ee=new Error,q=Z=>{if(ln.o(a,we)&&(ae=a[we],ae!==0&&(a[we]=void 0),ae)){var U=Z&&(Z.type==="load"?"missing":Z.type),ge=Z&&Z.target&&Z.target.src;ee.message="Loading chunk "+we+` failed.
(`+U+": "+ge+")",ee.name="ChunkLoadError",ee.type=U,ee.request=ge,ae[1](ee)}};ln.l(W,q,"chunk-"+we,we)}};var l=(we,Te)=>{var ae=Te[0],ie=Te[1],W=Te[2],ee,q,Z=0;if(ae.some(ge=>a[ge]!==0)){for(ee in ie)ln.o(ie,ee)&&(ln.m[ee]=ie[ee]);if(W)var U=W(ln)}for(we&&we(Te);Z<ae.length;Z++)q=ae[Z],ln.o(a,q)&&a[q]&&a[q][0](),a[q]=0},se=self.webpackChunkssp=self.webpackChunkssp||[];se.forEach(l.bind(null,0)),se.push=l.bind(null,se.push.bind(se))})(),ln.nc=void 0;var Uce={};(()=>{"use strict";var a=ln(8810),l=ln(6194),se=ln.t(l,2),we=ln(9580);const Te={};var ae=ln(9336),ie=ln(2096);const W=JSON.parse('{"version":"1.117.1"}'),{env:ee,datadog:q}=ae.A,{enabled:Z,...U}=q,{version:ge}=W,{bff:ne}=ae.A;if(Z){const e=[ne.url];ie.L.init({env:ee,version:ge,allowedTracingUrls:e,...U}),ie.L.startSessionReplayRecording()}const ve=(e,t,n)=>{Z&&ie.L.setUser({id:e,name:t,email:n})};var V=ln(8138);const te=function(){return null},Re=null;var Ie=ln(603);function $e(){return typeof document=="object"&&typeof document.cookie=="string"}function vt(){document.cookie.split(";").forEach(function(e){document.cookie=e.replace(/^ +/,"").replace(/=.*/,"=;expires="+new Date().toUTCString()+";path=/")})}function mt(e,t){return typeof e=="string"?Ie.q(e,t):typeof e=="object"&&e!==null?e:{}}function It(e,t){return typeof t>"u"&&(t=!e||e[0]!=="{"&&e[0]!=="["&&e[0]!=='"'),!t}function qe(e,t){t===void 0&&(t={});var n=nn(e);if(It(n,t.doNotParse))try{return JSON.parse(n)}catch{}return e}function nn(e){return e&&e[0]==="j"&&e[1]===":"?e.substr(2):e}var Ut=function(){return Ut=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},Ut.apply(this,arguments)},Xe=function(){function e(t,n){var r=this;this.changeListeners=[],this.HAS_DOCUMENT_COOKIE=!1,this.cookies=mt(t,n),new Promise(function(){r.HAS_DOCUMENT_COOKIE=$e()}).catch(function(){})}return e.prototype._updateBrowserValues=function(t){this.HAS_DOCUMENT_COOKIE&&(this.cookies=Ie.q(document.cookie,t))},e.prototype._emitChange=function(t){for(var n=0;n<this.changeListeners.length;++n)this.changeListeners[n](t)},e.prototype.get=function(t,n,r){return n===void 0&&(n={}),this._updateBrowserValues(r),qe(this.cookies[t],n)},e.prototype.getAll=function(t,n){t===void 0&&(t={}),this._updateBrowserValues(n);var r={};for(var s in this.cookies)r[s]=qe(this.cookies[s],t);return r},e.prototype.set=function(t,n,r){var s;typeof n=="object"&&(n=JSON.stringify(n)),this.cookies=Ut(Ut({},this.cookies),(s={},s[t]=n,s)),this.HAS_DOCUMENT_COOKIE&&(document.cookie=Ie.l(t,n,r)),this._emitChange({name:t,value:n,options:r})},e.prototype.remove=function(t,n){var r=n=Ut(Ut({},n),{expires:new Date(1970,1,1,0,0,1),maxAge:0});this.cookies=Ut({},this.cookies),delete this.cookies[t],this.HAS_DOCUMENT_COOKIE&&(document.cookie=Ie.l(t,"",r)),this._emitChange({name:t,value:void 0,options:n})},e.prototype.addChangeListener=function(t){this.changeListeners.push(t)},e.prototype.removeChangeListener=function(t){var n=this.changeListeners.indexOf(t);n>=0&&this.changeListeners.splice(n,1)},e}();const rn=Xe,Vt=rn,ze=l.createContext(new Vt),{Provider:je,Consumer:De}=ze,ct=null;class qt extends l.Component{constructor(t){super(t),t.cookies?this.cookies=t.cookies:this.cookies=new rn}render(){return l.createElement(je,{value:this.cookies},this.props.children)}}var z=ln(3254),He=ln(7030),Ct=ln(8072),kt=ln(2963),Pe=ln.t(kt,2);function yt(e){e()}let un=yt;const Rn=e=>un=e,Yn=()=>un,nr=Symbol.for("react-redux-context"),rr=typeof globalThis<"u"?globalThis:{};function ar(){var e;if(!l.createContext)return{};const t=(e=rr[nr])!=null?e:rr[nr]=new Map;let n=t.get(l.createContext);return n||(n=l.createContext(null),t.set(l.createContext,n)),n}const wr=ar(),Ts=null;function Zr(e=wr){return function(){return(0,l.useContext)(e)}}const Bs=Zr();let zt=()=>{throw new Error("uSES not initialized!")};const Hn=e=>{zt=e},Nr=(e,t)=>e===t;function kr(e=wr){const t=e===wr?Bs:Zr(e);return function(r,s={}){const{equalityFn:o=Nr,stabilityCheck:i=void 0,noopCheck:u=void 0}=typeof s=="function"?{equalityFn:s}:s,{store:p,subscription:g,getServerState:v,stabilityCheck:w,noopCheck:x}=t(),E=(0,l.useRef)(!0),R=(0,l.useCallback)({[r.name](N){return r(N)}}[r.name],[r,w,i]),k=zt(g.addNestedSub,p.getState,v||p.getState,R,o);return(0,l.useDebugValue)(k),k}}const Xn=kr();var Jt=ln(4072),Xt=ln(9249);function qn(){const e=Yn();let t=null,n=null;return{clear(){t=null,n=null},notify(){e(()=>{let r=t;for(;r;)r.callback(),r=r.next})},get(){let r=[],s=t;for(;s;)r.push(s),s=s.next;return r},subscribe(r){let s=!0,o=n={callback:r,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){!s||t===null||(s=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}const bn={notify(){},get:()=>[]};function sr(e,t){let n,r=bn,s=0,o=!1;function i(k){v();const N=r.subscribe(k);let L=!1;return()=>{L||(L=!0,N(),w())}}function u(){r.notify()}function p(){R.onStateChange&&R.onStateChange()}function g(){return o}function v(){s++,n||(n=t?t.addNestedSub(p):e.subscribe(p),r=qn())}function w(){s--,n&&s===0&&(n(),n=void 0,r.clear(),r=bn)}function x(){o||(o=!0,v())}function E(){o&&(o=!1,w())}const R={addNestedSub:i,notifyNestedSubs:u,handleChangeWrapper:p,isSubscribed:g,trySubscribe:x,tryUnsubscribe:E,getListeners:()=>r};return R}const fs=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?l.useLayoutEffect:l.useEffect,Kn=null;let Ir=null;const Rr=e=>{Ir=e},pr=null,Tr=null,gt=e=>{try{return JSON.stringify(e)}catch{return String(e)}};function _s(e,t,n){useIsomorphicLayoutEffect(()=>e(...t),n)}function cs(e,t,n,r,s,o){e.current=r,n.current=!1,s.current&&(s.current=null,o())}function Gr(e,t,n,r,s,o,i,u,p,g,v){if(!e)return()=>{};let w=!1,x=null;const E=()=>{if(w||!u.current)return;const k=t.getState();let N,L;try{N=r(k,s.current)}catch(D){L=D,x=D}L||(x=null),N===o.current?i.current||g():(o.current=N,p.current=N,i.current=!0,v())};return n.onStateChange=E,n.trySubscribe(),E(),()=>{if(w=!0,n.tryUnsubscribe(),n.onStateChange=null,x)throw x}}const xr=()=>pr;function no(e,t){return e===t}let ps=!1;function ns(e,t,n,{pure:r,areStatesEqual:s=no,areOwnPropsEqual:o=shallowEqual,areStatePropsEqual:i=shallowEqual,areMergedPropsEqual:u=shallowEqual,forwardRef:p=!1,context:g=ReactReduxContext}={}){const v=g,w=mapStateToPropsFactory(e),x=mapDispatchToPropsFactory(t),E=mergePropsFactory(n),R=Boolean(e);return N=>{const L=N.displayName||N.name||"Component",D=`Connect(${L})`,B={shouldHandleStateChanges:R,displayName:D,wrappedComponentName:L,WrappedComponent:N,initMapStateToProps:w,initMapDispatchToProps:x,initMergeProps:E,areStatesEqual:s,areStatePropsEqual:i,areOwnPropsEqual:o,areMergedPropsEqual:u};function Q(G){const[Le,We,at]=React.useMemo(()=>{const{reactReduxForwardedRef:En}=G,Ws=_objectWithoutPropertiesLoose(G,Kn);return[G.context,En,Ws]},[G]),St=React.useMemo(()=>Le&&Le.Consumer&&isContextConsumer(React.createElement(Le.Consumer,null))?Le:v,[Le,v]),xt=React.useContext(St),Mt=Boolean(G.store)&&Boolean(G.store.getState)&&Boolean(G.store.dispatch),$t=Boolean(xt)&&Boolean(xt.store),Nt=Mt?G.store:xt.store,Bn=$t?xt.getServerState:Nt.getState,wn=React.useMemo(()=>defaultSelectorFactory(Nt.dispatch,B),[Nt]),[Nn,Zt]=React.useMemo(()=>{if(!R)return Tr;const En=createSubscription(Nt,Mt?void 0:xt.subscription),Ws=En.notifyNestedSubs.bind(En);return[En,Ws]},[Nt,Mt,xt]),Pt=React.useMemo(()=>Mt?xt:_extends({},xt,{subscription:Nn}),[Mt,xt,Nn]),At=React.useRef(),Ht=React.useRef(at),Gt=React.useRef(),Sn=React.useRef(!1),Cr=React.useRef(!1),br=React.useRef(!1),Ln=React.useRef();useIsomorphicLayoutEffect(()=>(br.current=!0,()=>{br.current=!1}),[]);const Hr=React.useMemo(()=>()=>Gt.current&&at===Ht.current?Gt.current:wn(Nt.getState(),at),[Nt,at]),ws=React.useMemo(()=>Ws=>Nn?Gr(R,Nt,Nn,wn,Ht,At,Sn,br,Gt,Zt,Ws):()=>{},[Nn]);_s(cs,[Ht,At,Sn,at,Gt,Zt]);let us;try{us=Ir(ws,Hr,Bn?()=>wn(Bn(),at):Hr)}catch(En){throw Ln.current&&(En.message+=`
The error may be correlated with this previous error:
${Ln.current.stack}

`),En}useIsomorphicLayoutEffect(()=>{Ln.current=void 0,Gt.current=void 0,At.current=us});const tr=React.useMemo(()=>React.createElement(N,_extends({},us,{ref:We})),[We,N,us]);return React.useMemo(()=>R?React.createElement(St.Provider,{value:Pt},tr):tr,[St,tr,Pt])}const ye=React.memo(Q);if(ye.WrappedComponent=N,ye.displayName=Q.displayName=D,p){const Le=React.forwardRef(function(at,St){return React.createElement(ye,_extends({},at,{reactReduxForwardedRef:St}))});return Le.displayName=D,Le.WrappedComponent=N,hoistStatics(Le,N)}return hoistStatics(ye,N)}}const ss=null;function Wo({store:e,context:t,children:n,serverState:r,stabilityCheck:s="once",noopCheck:o="once"}){const i=l.useMemo(()=>{const g=sr(e);return{store:e,subscription:g,getServerState:r?()=>r:void 0,stabilityCheck:s,noopCheck:o}},[e,r,s,o]),u=l.useMemo(()=>e.getState(),[e]);fs(()=>{const{subscription:g}=i;return g.onStateChange=g.notifyNestedSubs,g.trySubscribe(),u!==e.getState()&&g.notifyNestedSubs(),()=>{g.tryUnsubscribe(),g.onStateChange=void 0}},[i,u]);const p=t||wr;return l.createElement(p.Provider,{value:i},n)}const _o=Wo;function ao(e=wr){const t=e===wr?Bs:Zr(e);return function(){const{store:r}=t();return r}}const Ls=ao();function So(e=wr){const t=e===wr?Ls:ao(e);return function(){return t().dispatch}}const jr=So();Hn(Ct.useSyncExternalStoreWithSelector),Rr(He.useSyncExternalStore),Rn(kt.unstable_batchedUpdates);/**
 * @remix-run/router v1.16.1
 *
 * Copyright (c) Remix Software Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */function Dn(){return Dn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Dn.apply(this,arguments)}var Dr;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Dr||(Dr={}));const Vs="popstate";function Mo(e){e===void 0&&(e={});let{initialEntries:t=["/"],initialIndex:n,v5Compat:r=!1}=e,s;s=t.map((E,R)=>v(E,typeof E=="string"?null:E.state,R===0?"default":void 0));let o=p(n??s.length-1),i=Dr.Pop,u=null;function p(E){return Math.min(Math.max(E,0),s.length-1)}function g(){return s[o]}function v(E,R,k){R===void 0&&(R=null);let N=ut(s?g().pathname:"/",E,R,k);return Me(N.pathname.charAt(0)==="/","relative pathnames are not supported in memory history: "+JSON.stringify(E)),N}function w(E){return typeof E=="string"?E:Wt(E)}return{get index(){return o},get action(){return i},get location(){return g()},createHref:w,createURL(E){return new URL(w(E),"http://localhost")},encodeLocation(E){let R=typeof E=="string"?cn(E):E;return{pathname:R.pathname||"",search:R.search||"",hash:R.hash||""}},push(E,R){i=Dr.Push;let k=v(E,R);o+=1,s.splice(o,s.length,k),r&&u&&u({action:i,location:k,delta:1})},replace(E,R){i=Dr.Replace;let k=v(E,R);s[o]=k,r&&u&&u({action:i,location:k,delta:0})},go(E){i=Dr.Pop;let R=p(o+E),k=s[R];o=R,u&&u({action:i,location:k,delta:E})},listen(E){return u=E,()=>{u=null}}}}function qo(e){e===void 0&&(e={});function t(r,s){let{pathname:o,search:i,hash:u}=r.location;return ut("",{pathname:o,search:i,hash:u},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:Wt(s)}return Qt(t,n,null,e)}function ui(e){e===void 0&&(e={});function t(s,o){let{pathname:i="/",search:u="",hash:p=""}=cn(s.location.hash.substr(1));return!i.startsWith("/")&&!i.startsWith(".")&&(i="/"+i),ut("",{pathname:i,search:u,hash:p},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(s,o){let i=s.document.querySelector("base"),u="";if(i&&i.getAttribute("href")){let p=s.location.href,g=p.indexOf("#");u=g===-1?p:p.slice(0,g)}return u+"#"+(typeof o=="string"?o:Wt(o))}function r(s,o){Me(s.pathname.charAt(0)==="/","relative pathnames are not supported in hash history.push("+JSON.stringify(o)+")")}return Qt(t,n,r,e)}function Wn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Me(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Qe(){return Math.random().toString(36).substr(2,8)}function Ke(e,t){return{usr:e.state,key:e.key,idx:t}}function ut(e,t,n,r){return n===void 0&&(n=null),Dn({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?cn(t):t,{state:n,key:t&&t.key||r||Qe()})}function Wt(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function cn(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function Qt(e,t,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:o=!1}=r,i=s.history,u=Dr.Pop,p=null,g=v();g==null&&(g=0,i.replaceState(Dn({},i.state,{idx:g}),""));function v(){return(i.state||{idx:null}).idx}function w(){u=Dr.Pop;let N=v(),L=N==null?null:N-g;g=N,p&&p({action:u,location:k.location,delta:L})}function x(N,L){u=Dr.Push;let D=ut(k.location,N,L);n&&n(D,N),g=v()+1;let B=Ke(D,g),Q=k.createHref(D);try{i.pushState(B,"",Q)}catch(ce){if(ce instanceof DOMException&&ce.name==="DataCloneError")throw ce;s.location.assign(Q)}o&&p&&p({action:u,location:k.location,delta:1})}function E(N,L){u=Dr.Replace;let D=ut(k.location,N,L);n&&n(D,N),g=v();let B=Ke(D,g),Q=k.createHref(D);i.replaceState(B,"",Q),o&&p&&p({action:u,location:k.location,delta:0})}function R(N){let L=s.location.origin!=="null"?s.location.origin:s.location.href,D=typeof N=="string"?N:Wt(N);return D=D.replace(/ $/,"%20"),Wn(L,"No window.location.(origin|href) available to create URL for href: "+D),new URL(D,L)}let k={get action(){return u},get location(){return e(s,i)},listen(N){if(p)throw new Error("A history only accepts one active listener");return s.addEventListener(Vs,w),p=N,()=>{s.removeEventListener(Vs,w),p=null}},createHref(N){return t(s,N)},createURL:R,encodeLocation(N){let L=R(N);return{pathname:L.pathname,search:L.search,hash:L.hash}},push:x,replace:E,go(N){return i.go(N)}};return k}var be;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(be||(be={}));const pe=new Set(["lazy","caseSensitive","path","id","index","children"]);function le(e){return e.index===!0}function ue(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((s,o)=>{let i=[...n,o],u=typeof s.id=="string"?s.id:i.join("-");if(Wn(s.index!==!0||!s.children,"Cannot specify children on an index route"),Wn(!r[u],'Found a route id collision on id "'+u+`".  Route id's must be globally unique within Data Router usages`),le(s)){let p=Dn({},s,t(s),{id:u});return r[u]=p,p}else{let p=Dn({},s,t(s),{id:u,children:void 0});return r[u]=p,s.children&&(p.children=ue(s.children,t,i,r)),p}})}function K(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?cn(t):t,s=In(r.pathname||"/",n);if(s==null)return null;let o=_e(e);X(o);let i=null;for(let u=0;i==null&&u<o.length;++u){let p=hn(s);i=pt(o[u],p)}return i}function fe(e,t){let{route:n,pathname:r,params:s}=e;return{id:n.id,pathname:r,params:s,data:t[n.id],handle:n.handle}}function _e(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let s=(o,i,u)=>{let p={relativePath:u===void 0?o.path||"":u,caseSensitive:o.caseSensitive===!0,childrenIndex:i,route:o};p.relativePath.startsWith("/")&&(Wn(p.relativePath.startsWith(r),'Absolute route path "'+p.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),p.relativePath=p.relativePath.slice(r.length));let g=ys([r,p.relativePath]),v=n.concat(p);o.children&&o.children.length>0&&(Wn(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+g+'".')),_e(o.children,t,v,g)),!(o.path==null&&!o.index)&&t.push({path:g,score:bt(g,o.index),routesMeta:v})};return e.forEach((o,i)=>{var u;if(o.path===""||!((u=o.path)!=null&&u.includes("?")))s(o,i);else for(let p of Ve(o.path))s(o,i,p)}),t}function Ve(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return s?[o,""]:[o];let i=Ve(r.join("/")),u=[];return u.push(...i.map(p=>p===""?o:[o,p].join("/"))),s&&u.push(...i),u.map(p=>e.startsWith("/")&&p===""?"/":p)}function X(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:ft(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const xe=/^:[\w-]+$/,Ne=3,Ee=2,Oe=1,Be=10,et=-2,dt=e=>e==="*";function bt(e,t){let n=e.split("/"),r=n.length;return n.some(dt)&&(r+=et),t&&(r+=Ee),n.filter(s=>!dt(s)).reduce((s,o)=>s+(xe.test(o)?Ne:o===""?Oe:Be),r)}function ft(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function pt(e,t){let{routesMeta:n}=e,r={},s="/",o=[];for(let i=0;i<n.length;++i){let u=n[i],p=i===n.length-1,g=s==="/"?t:t.slice(s.length)||"/",v=Kt({path:u.relativePath,caseSensitive:u.caseSensitive,end:p},g);if(!v)return null;Object.assign(r,v.params);let w=u.route;o.push({params:r,pathname:ys([s,v.pathname]),pathnameBase:ro(ys([s,v.pathnameBase])),route:w}),v.pathnameBase!=="/"&&(s=ys([s,v.pathnameBase]))}return o}function _t(e,t){t===void 0&&(t={});let n=e;n.endsWith("*")&&n!=="*"&&!n.endsWith("/*")&&(Me(!1,'Route path "'+n+'" will be treated as if it were '+('"'+n.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+n.replace(/\*$/,"/*")+'".')),n=n.replace(/\*$/,"/*"));const r=n.startsWith("/")?"/":"",s=i=>i==null?"":typeof i=="string"?i:String(i),o=n.split(/\/+/).map((i,u,p)=>{if(u===p.length-1&&i==="*")return s(t["*"]);const v=i.match(/^:([\w-]+)(\??)$/);if(v){const[,w,x]=v;let E=t[w];return Wn(x==="?"||E!=null,'Missing ":'+w+'" param'),s(E)}return i.replace(/\?$/g,"")}).filter(i=>!!i);return r+o.join("/")}function Kt(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=fn(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let o=s[0],i=o.replace(/(.)\/+$/,"$1"),u=s.slice(1);return{params:r.reduce((g,v,w)=>{let{paramName:x,isOptional:E}=v;if(x==="*"){let k=u[w]||"";i=o.slice(0,o.length-k.length).replace(/(.)\/+$/,"$1")}const R=u[w];return E&&!R?g[x]=void 0:g[x]=(R||"").replace(/%2F/g,"/"),g},{}),pathname:o,pathnameBase:i,pattern:e}}function fn(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Me(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,u,p)=>(r.push({paramName:u,isOptional:p!=null}),p?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function hn(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Me(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function In(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function lr(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?cn(e):e;return{pathname:n?n.startsWith("/")?n:Gn(n,t):t,search:qs(r),hash:hs(s)}}function Gn(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function Mn(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"].  Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function gr(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function er(e,t){let n=gr(e);return t?n.map((r,s)=>s===e.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function _r(e,t,n,r){r===void 0&&(r=!1);let s;typeof e=="string"?s=cn(e):(s=Dn({},e),Wn(!s.pathname||!s.pathname.includes("?"),Mn("?","pathname","search",s)),Wn(!s.pathname||!s.pathname.includes("#"),Mn("#","pathname","hash",s)),Wn(!s.search||!s.search.includes("#"),Mn("#","search","hash",s)));let o=e===""||s.pathname==="",i=o?"/":s.pathname,u;if(i==null)u=n;else{let w=t.length-1;if(!r&&i.startsWith("..")){let x=i.split("/");for(;x[0]==="..";)x.shift(),w-=1;s.pathname=x.join("/")}u=w>=0?t[w]:"/"}let p=lr(s,u),g=i&&i!=="/"&&i.endsWith("/"),v=(o||i===".")&&n.endsWith("/");return!p.pathname.endsWith("/")&&(g||v)&&(p.pathname+="/"),p}function vs(e){return e===""||e.pathname===""?"/":typeof e=="string"?cn(e).pathname:e.pathname}const ys=e=>e.join("/").replace(/\/\/+/g,"/"),ro=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),qs=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,hs=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Ks=function(t,n){n===void 0&&(n={});let r=typeof n=="number"?{status:n}:n,s=new Headers(r.headers);return s.has("Content-Type")||s.set("Content-Type","application/json; charset=utf-8"),new Response(JSON.stringify(t),Dn({},r,{headers:s}))};class os extends Error{}class Gs{constructor(t,n){this.pendingKeysSet=new Set,this.subscribers=new Set,this.deferredKeys=[],Wn(t&&typeof t=="object"&&!Array.isArray(t),"defer() only accepts plain objects");let r;this.abortPromise=new Promise((o,i)=>r=i),this.controller=new AbortController;let s=()=>r(new os("Deferred data aborted"));this.unlistenAbortSignal=()=>this.controller.signal.removeEventListener("abort",s),this.controller.signal.addEventListener("abort",s),this.data=Object.entries(t).reduce((o,i)=>{let[u,p]=i;return Object.assign(o,{[u]:this.trackPromise(u,p)})},{}),this.done&&this.unlistenAbortSignal(),this.init=n}trackPromise(t,n){if(!(n instanceof Promise))return n;this.deferredKeys.push(t),this.pendingKeysSet.add(t);let r=Promise.race([n,this.abortPromise]).then(s=>this.onSettle(r,t,void 0,s),s=>this.onSettle(r,t,s));return r.catch(()=>{}),Object.defineProperty(r,"_tracked",{get:()=>!0}),r}onSettle(t,n,r,s){if(this.controller.signal.aborted&&r instanceof os)return this.unlistenAbortSignal(),Object.defineProperty(t,"_error",{get:()=>r}),Promise.reject(r);if(this.pendingKeysSet.delete(n),this.done&&this.unlistenAbortSignal(),r===void 0&&s===void 0){let o=new Error('Deferred data for key "'+n+'" resolved/rejected with `undefined`, you must resolve/reject with a value or `null`.');return Object.defineProperty(t,"_error",{get:()=>o}),this.emit(!1,n),Promise.reject(o)}return s===void 0?(Object.defineProperty(t,"_error",{get:()=>r}),this.emit(!1,n),Promise.reject(r)):(Object.defineProperty(t,"_data",{get:()=>s}),this.emit(!1,n),s)}emit(t,n){this.subscribers.forEach(r=>r(t,n))}subscribe(t){return this.subscribers.add(t),()=>this.subscribers.delete(t)}cancel(){this.controller.abort(),this.pendingKeysSet.forEach((t,n)=>this.pendingKeysSet.delete(n)),this.emit(!0)}async resolveData(t){let n=!1;if(!this.done){let r=()=>this.cancel();t.addEventListener("abort",r),n=await new Promise(s=>{this.subscribe(o=>{t.removeEventListener("abort",r),(o||this.done)&&s(o)})})}return n}get done(){return this.pendingKeysSet.size===0}get unwrappedData(){return Wn(this.data!==null&&this.done,"Can only unwrap data on initialized and settled deferreds"),Object.entries(this.data).reduce((t,n)=>{let[r,s]=n;return Object.assign(t,{[r]:bo(s)})},{})}get pendingKeys(){return Array.from(this.pendingKeysSet)}}function Ar(e){return e instanceof Promise&&e._tracked===!0}function bo(e){if(!Ar(e))return e;if(e._error)throw e._error;return e._data}const io=function(t,n){n===void 0&&(n={});let r=typeof n=="number"?{status:n}:n;return new Gs(t,r)},ho=function(t,n){n===void 0&&(n=302);let r=n;typeof r=="number"?r={status:r}:typeof r.status>"u"&&(r.status=302);let s=new Headers(r.headers);return s.set("Location",t),new Response(null,Dn({},r,{headers:s}))},$o=(e,t)=>{let n=ho(e,t);return n.headers.set("X-Remix-Reload-Document","true"),n};class Ka{constructor(t,n,r,s){s===void 0&&(s=!1),this.status=t,this.statusText=n||"",this.internal=s,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function ei(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Ma=["post","put","patch","delete"],Fi=new Set(Ma),Qo=["get",...Ma],so=new Set(Qo),pa=new Set([301,302,303,307,308]),di=new Set([307,308]),Ce={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},I={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},$a={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Yo=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ko=e=>({hasErrorBoundary:Boolean(e.hasErrorBoundary)}),Ud="remix-router-transitions";function yu(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;Wn(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let s;if(e.mapRouteProperties)s=e.mapRouteProperties;else if(e.detectErrorBoundary){let it=e.detectErrorBoundary;s=Rt=>({hasErrorBoundary:it(Rt)})}else s=ko;let o={},i=ue(e.routes,s,void 0,o),u,p=e.basename||"/",g=e.unstable_dataStrategy||fi,v=Dn({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,unstable_skipActionErrorRevalidation:!1},e.future),w=null,x=new Set,E=null,R=null,k=null,N=e.hydrationData!=null,L=K(i,e.history.location,p),D=null;if(L==null){let it=Oo(404,{pathname:e.history.location.pathname}),{matches:Rt,route:Bt}=kc(i);L=Rt,D={[Bt.id]:it}}let B,Q=L.some(it=>it.route.lazy),ce=L.some(it=>it.route.loader);if(Q)B=!1;else if(!ce)B=!0;else if(v.v7_partialHydration){let it=e.hydrationData?e.hydrationData.loaderData:null,Rt=e.hydrationData?e.hydrationData.errors:null,Bt=xn=>xn.route.loader?typeof xn.route.loader=="function"&&xn.route.loader.hydrate===!0?!1:it&&it[xn.route.id]!==void 0||Rt&&Rt[xn.route.id]!==void 0:!0;if(Rt){let xn=L.findIndex(Qn=>Rt[Qn.route.id]!==void 0);B=L.slice(0,xn+1).every(Bt)}else B=L.every(Bt)}else B=e.hydrationData!=null;let ye,G={historyAction:e.history.action,location:e.history.location,matches:L,initialized:B,navigation:Ce,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||D,fetchers:new Map,blockers:new Map},Le=Dr.Pop,We=!1,at,St=!1,xt=new Map,Mt=null,$t=!1,Nt=!1,Bn=[],wn=[],Nn=new Map,Zt=0,Pt=-1,At=new Map,Ht=new Set,Gt=new Map,Sn=new Map,Cr=new Set,br=new Map,Ln=new Map,Hr=!1;function ws(){if(w=e.history.listen(it=>{let{action:Rt,location:Bt,delta:xn}=it;if(Hr){Hr=!1;return}Me(Ln.size===0||xn!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs.  This can also happen if you are using createHashRouter and the user manually changes the URL.");let Qn=rs({currentLocation:G.location,nextLocation:Bt,historyAction:Rt});if(Qn&&xn!=null){Hr=!0,e.history.go(xn*-1),Kf(Qn,{state:"blocked",location:Bt,proceed(){Kf(Qn,{state:"proceeding",proceed:void 0,reset:void 0,location:Bt}),e.history.go(xn)},reset(){let xs=new Map(G.blockers);xs.set(Qn,$a),mr({blockers:xs})}});return}return ja(Rt,Bt)}),n){J(t,xt);let it=()=>re(t,xt);t.addEventListener("pagehide",it),Mt=()=>t.removeEventListener("pagehide",it)}return G.initialized||ja(Dr.Pop,G.location,{initialHydration:!0}),ye}function us(){w&&w(),Mt&&Mt(),x.clear(),at&&at.abort(),G.fetchers.forEach((it,Rt)=>xc(Rt)),G.blockers.forEach((it,Rt)=>jm(Rt))}function tr(it){return x.add(it),()=>x.delete(it)}function mr(it,Rt){Rt===void 0&&(Rt={}),G=Dn({},G,it);let Bt=[],xn=[];v.v7_fetcherPersist&&G.fetchers.forEach((Qn,xs)=>{Qn.state==="idle"&&(Cr.has(xs)?xn.push(xs):Bt.push(xs))}),[...x].forEach(Qn=>Qn(G,{deletedFetchers:xn,unstable_viewTransitionOpts:Rt.viewTransitionOpts,unstable_flushSync:Rt.flushSync===!0})),v.v7_fetcherPersist&&(Bt.forEach(Qn=>G.fetchers.delete(Qn)),xn.forEach(Qn=>xc(Qn)))}function En(it,Rt,Bt){var xn,Qn;let{flushSync:xs}=Bt===void 0?{}:Bt,Xr=G.actionData!=null&&G.navigation.formMethod!=null&&ni(G.navigation.formMethod)&&G.navigation.state==="loading"&&((xn=it.state)==null?void 0:xn._isRedirect)!==!0,Er;Rt.actionData?Object.keys(Rt.actionData).length>0?Er=Rt.actionData:Er=null:Xr?Er=G.actionData:Er=null;let Us=Rt.loaderData?eh(G.loaderData,Rt.loaderData,Rt.matches||[],Rt.errors):G.loaderData,Is=G.blockers;Is.size>0&&(Is=new Map(Is),Is.forEach((Es,Da)=>Is.set(Da,$a)));let _l=We===!0||G.navigation.formMethod!=null&&ni(G.navigation.formMethod)&&((Qn=it.state)==null?void 0:Qn._isRedirect)!==!0;u&&(i=u,u=void 0),$t||Le===Dr.Pop||(Le===Dr.Push?e.history.push(it,it.state):Le===Dr.Replace&&e.history.replace(it,it.state));let Sl;if(Le===Dr.Pop){let Es=xt.get(G.location.pathname);Es&&Es.has(it.pathname)?Sl={currentLocation:G.location,nextLocation:it}:xt.has(it.pathname)&&(Sl={currentLocation:it,nextLocation:G.location})}else if(St){let Es=xt.get(G.location.pathname);Es?Es.add(it.pathname):(Es=new Set([it.pathname]),xt.set(G.location.pathname,Es)),Sl={currentLocation:G.location,nextLocation:it}}mr(Dn({},Rt,{actionData:Er,loaderData:Us,historyAction:Le,location:it,initialized:!0,navigation:Ce,revalidation:"idle",restoreScrollPosition:_c(it,Rt.matches||G.matches),preventScrollReset:_l,blockers:Is}),{viewTransitionOpts:Sl,flushSync:xs===!0}),Le=Dr.Pop,We=!1,St=!1,$t=!1,Nt=!1,Bn=[],wn=[]}async function Ws(it,Rt){if(typeof it=="number"){e.history.go(it);return}let Bt=Fn(G.location,G.matches,p,v.v7_prependBasename,it,v.v7_relativeSplatPath,Rt?.fromRouteId,Rt?.relative),{path:xn,submission:Qn,error:xs}=Ur(v.v7_normalizeFormMethod,!1,Bt,Rt),Xr=G.location,Er=ut(G.location,xn,Rt&&Rt.state);Er=Dn({},Er,e.history.encodeLocation(Er));let Us=Rt&&Rt.replace!=null?Rt.replace:void 0,Is=Dr.Push;Us===!0?Is=Dr.Replace:Us===!1||Qn!=null&&ni(Qn.formMethod)&&Qn.formAction===G.location.pathname+G.location.search&&(Is=Dr.Replace);let _l=Rt&&"preventScrollReset"in Rt?Rt.preventScrollReset===!0:void 0,Sl=(Rt&&Rt.unstable_flushSync)===!0,Es=rs({currentLocation:Xr,nextLocation:Er,historyAction:Is});if(Es){Kf(Es,{state:"blocked",location:Er,proceed(){Kf(Es,{state:"proceeding",proceed:void 0,reset:void 0,location:Er}),Ws(it,Rt)},reset(){let Da=new Map(G.blockers);Da.set(Es,$a),mr({blockers:Da})}});return}return await ja(Is,Er,{submission:Qn,pendingError:xs,preventScrollReset:_l,replace:Rt&&Rt.replace,enableViewTransition:Rt&&Rt.unstable_viewTransition,flushSync:Sl})}function xi(){if(jn(),mr({revalidation:"loading"}),G.navigation.state!=="submitting"){if(G.navigation.state==="idle"){ja(G.historyAction,G.location,{startUninterruptedRevalidation:!0});return}ja(Le||G.historyAction,G.navigation.location,{overrideNavigation:G.navigation})}}async function ja(it,Rt,Bt){at&&at.abort(),at=null,Le=it,$t=(Bt&&Bt.startUninterruptedRevalidation)===!0,Do(G.location,G.matches),We=(Bt&&Bt.preventScrollReset)===!0,St=(Bt&&Bt.enableViewTransition)===!0;let xn=u||i,Qn=Bt&&Bt.overrideNavigation,xs=K(xn,Rt,p),Xr=(Bt&&Bt.flushSync)===!0;if(!xs){let Es=Oo(404,{pathname:Rt.pathname}),{matches:Da,route:nl}=kc(xn);fo(),En(Rt,{matches:Da,loaderData:{},errors:{[nl.id]:Es}},{flushSync:Xr});return}if(G.initialized&&!Nt&&pi(G.location,Rt)&&!(Bt&&Bt.submission&&ni(Bt.submission.formMethod))){En(Rt,{matches:xs},{flushSync:Xr});return}at=new AbortController;let Er=Gl(e.history,Rt,at.signal,Bt&&Bt.submission),Us;if(Bt&&Bt.pendingError)Us=[go(xs).route.id,{type:be.error,error:Bt.pendingError}];else if(Bt&&Bt.submission&&ni(Bt.submission.formMethod)){let Es=await Li(Er,Rt,Bt.submission,xs,{replace:Bt.replace,flushSync:Xr});if(Es.shortCircuited)return;Us=Es.pendingActionResult,Qn=Hd(Rt,Bt.submission),Xr=!1,Er=Gl(e.history,Er.url,Er.signal)}let{shortCircuited:Is,loaderData:_l,errors:Sl}=await Ze(Er,Rt,xs,Qn,Bt&&Bt.submission,Bt&&Bt.fetcherSubmission,Bt&&Bt.replace,Bt&&Bt.initialHydration===!0,Xr,Us);Is||(at=null,En(Rt,Dn({matches:xs},Xu(Us),{loaderData:_l,errors:Sl})))}async function Li(it,Rt,Bt,xn,Qn){Qn===void 0&&(Qn={}),jn();let xs=Ju(Rt,Bt);mr({navigation:xs},{flushSync:Qn.flushSync===!0});let Xr,Er=xu(xn,Rt);if(!Er.route.action&&!Er.route.lazy)Xr={type:be.error,error:Oo(405,{method:it.method,pathname:Rt.pathname,routeId:Er.route.id})};else if(Xr=(await _n("action",it,[Er],xn))[0],it.signal.aborted)return{shortCircuited:!0};if(Pc(Xr)){let Us;return Qn&&Qn.replace!=null?Us=Qn.replace:Us=Kl(Xr.response.headers.get("Location"),new URL(it.url),p)===G.location.pathname+G.location.search,await On(it,Xr,{submission:Bt,replace:Us}),{shortCircuited:!0}}if(Rc(Xr))throw Oo(400,{type:"defer-action"});if(Lo(Xr)){let Us=go(xn,Er.route.id);return(Qn&&Qn.replace)!==!0&&(Le=Dr.Push),{pendingActionResult:[Us.route.id,Xr]}}return{pendingActionResult:[Er.route.id,Xr]}}async function Ze(it,Rt,Bt,xn,Qn,xs,Xr,Er,Us,Is){let _l=xn||Hd(Rt,Qn),Sl=Qn||xs||nh(_l),Es=u||i,[Da,nl]=Ro(e.history,G,Bt,Sl,Rt,v.v7_partialHydration&&Er===!0,v.unstable_skipActionErrorRevalidation,Nt,Bn,wn,Cr,Gt,Ht,Es,p,Is);if(fo(po=>!(Bt&&Bt.some(Sc=>Sc.route.id===po))||Da&&Da.some(Sc=>Sc.route.id===po)),Pt=++Zt,Da.length===0&&nl.length===0){let po=Fd();return En(Rt,Dn({matches:Bt,loaderData:{},errors:Is&&Lo(Is[1])?{[Is[0]]:Is[1].error}:null},Xu(Is),po?{fetchers:new Map(G.fetchers)}:{}),{flushSync:Us}),{shortCircuited:!0}}if(!$t&&(!v.v7_partialHydration||!Er)){nl.forEach(Sc=>{let Yu=G.fetchers.get(Sc.key),Cl=ed(void 0,Yu?Yu.data:void 0);G.fetchers.set(Sc.key,Cl)});let po;Is&&!Lo(Is[1])?po={[Is[0]]:Is[1].data}:G.actionData&&(Object.keys(G.actionData).length===0?po=null:po=G.actionData),mr(Dn({navigation:_l},po!==void 0?{actionData:po}:{},nl.length>0?{fetchers:new Map(G.fetchers)}:{}),{flushSync:Us})}nl.forEach(po=>{Nn.has(po.key)&&Ja(po.key),po.controller&&Nn.set(po.key,po.controller)});let Fw=()=>nl.forEach(po=>Ja(po.key));at&&at.signal.addEventListener("abort",Fw);let{loaderResults:Dm,fetcherResults:Ay}=await Lt(G.matches,Bt,Da,nl,it);if(it.signal.aborted)return{shortCircuited:!0};at&&at.signal.removeEventListener("abort",Fw),nl.forEach(po=>Nn.delete(po.key));let Iy=Qf([...Dm,...Ay]);if(Iy){if(Iy.idx>=Da.length){let po=nl[Iy.idx-Da.length].key;Ht.add(po)}return await On(it,Iy.result,{replace:Xr}),{shortCircuited:!0}}let{loaderData:jy,errors:Gf}=Tc(G,Bt,Da,Dm,Is,nl,Ay,br);br.forEach((po,Sc)=>{po.subscribe(Yu=>{(Yu||po.done)&&br.delete(Sc)})}),v.v7_partialHydration&&Er&&G.errors&&Object.entries(G.errors).filter(po=>{let[Sc]=po;return!Da.some(Yu=>Yu.route.id===Sc)}).forEach(po=>{let[Sc,Yu]=po;Gf=Object.assign(Gf||{},{[Sc]:Yu})});let t1=Fd(),n1=zd(Pt),r1=t1||n1||nl.length>0;return Dn({loaderData:jy,errors:Gf},r1?{fetchers:new Map(G.fetchers)}:{})}function Tt(it,Rt,Bt,xn){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");Nn.has(it)&&Ja(it);let Qn=(xn&&xn.unstable_flushSync)===!0,xs=u||i,Xr=Fn(G.location,G.matches,p,v.v7_prependBasename,Bt,v.v7_relativeSplatPath,Rt,xn?.relative),Er=K(xs,Xr,p);if(!Er){$s(it,Rt,Oo(404,{pathname:Xr}),{flushSync:Qn});return}let{path:Us,submission:Is,error:_l}=Ur(v.v7_normalizeFormMethod,!0,Xr,xn);if(_l){$s(it,Rt,_l,{flushSync:Qn});return}let Sl=xu(Er,Us);if(We=(xn&&xn.preventScrollReset)===!0,Is&&ni(Is.formMethod)){Dt(it,Rt,Us,Sl,Er,Qn,Is);return}Gt.set(it,{routeId:Rt,path:Us}),Vn(it,Rt,Us,Sl,Er,Qn,Is)}async function Dt(it,Rt,Bt,xn,Qn,xs,Xr){if(jn(),Gt.delete(it),!xn.route.action&&!xn.route.lazy){let Cl=Oo(405,{method:Xr.formMethod,pathname:Bt,routeId:Rt});$s(it,Rt,Cl,{flushSync:xs});return}let Er=G.fetchers.get(it);ds(it,Lm(Xr,Er),{flushSync:xs});let Us=new AbortController,Is=Gl(e.history,Bt,Us.signal,Xr);Nn.set(it,Us);let _l=Zt,Es=(await _n("action",Is,[xn],Qn))[0];if(Is.signal.aborted){Nn.get(it)===Us&&Nn.delete(it);return}if(v.v7_fetcherPersist&&Cr.has(it)){if(Pc(Es)||Lo(Es)){ds(it,zi(void 0));return}}else{if(Pc(Es))if(Nn.delete(it),Pt>_l){ds(it,zi(void 0));return}else return Ht.add(it),ds(it,ed(Xr)),On(Is,Es,{fetcherSubmission:Xr});if(Lo(Es)){$s(it,Rt,Es.error);return}}if(Rc(Es))throw Oo(400,{type:"defer-action"});let Da=G.navigation.location||G.location,nl=Gl(e.history,Da,Us.signal),Fw=u||i,Dm=G.navigation.state!=="idle"?K(Fw,G.navigation.location,p):G.matches;Wn(Dm,"Didn't find any matches after fetcher action");let Ay=++Zt;At.set(it,Ay);let Iy=ed(Xr,Es.data);G.fetchers.set(it,Iy);let[jy,Gf]=Ro(e.history,G,Dm,Xr,Da,!1,v.unstable_skipActionErrorRevalidation,Nt,Bn,wn,Cr,Gt,Ht,Fw,p,[xn.route.id,Es]);Gf.filter(Cl=>Cl.key!==it).forEach(Cl=>{let zw=Cl.key,CF=G.fetchers.get(zw),zce=ed(void 0,CF?CF.data:void 0);G.fetchers.set(zw,zce),Nn.has(zw)&&Ja(zw),Cl.controller&&Nn.set(zw,Cl.controller)}),mr({fetchers:new Map(G.fetchers)});let t1=()=>Gf.forEach(Cl=>Ja(Cl.key));Us.signal.addEventListener("abort",t1);let{loaderResults:n1,fetcherResults:r1}=await Lt(G.matches,Dm,jy,Gf,nl);if(Us.signal.aborted)return;Us.signal.removeEventListener("abort",t1),At.delete(it),Nn.delete(it),Gf.forEach(Cl=>Nn.delete(Cl.key));let po=Qf([...n1,...r1]);if(po){if(po.idx>=jy.length){let Cl=Gf[po.idx-jy.length].key;Ht.add(Cl)}return On(nl,po.result)}let{loaderData:Sc,errors:Yu}=Tc(G,G.matches,jy,n1,void 0,Gf,r1,br);if(G.fetchers.has(it)){let Cl=zi(Es.data);G.fetchers.set(it,Cl)}zd(Ay),G.navigation.state==="loading"&&Ay>Pt?(Wn(Le,"Expected pending action"),at&&at.abort(),En(G.navigation.location,{matches:Dm,loaderData:Sc,errors:Yu,fetchers:new Map(G.fetchers)})):(mr({errors:Yu,loaderData:eh(G.loaderData,Sc,Dm,Yu),fetchers:new Map(G.fetchers)}),Nt=!1)}async function Vn(it,Rt,Bt,xn,Qn,xs,Xr){let Er=G.fetchers.get(it);ds(it,ed(Xr,Er?Er.data:void 0),{flushSync:xs});let Us=new AbortController,Is=Gl(e.history,Bt,Us.signal);Nn.set(it,Us);let _l=Zt,Es=(await _n("loader",Is,[xn],Qn))[0];if(Rc(Es)&&(Es=await Zu(Es,Is.signal,!0)||Es),Nn.get(it)===Us&&Nn.delete(it),!Is.signal.aborted){if(Cr.has(it)){ds(it,zi(void 0));return}if(Pc(Es))if(Pt>_l){ds(it,zi(void 0));return}else{Ht.add(it),await On(Is,Es);return}if(Lo(Es)){$s(it,Rt,Es.error);return}Wn(!Rc(Es),"Unhandled fetcher deferred data"),ds(it,zi(Es.data))}}async function On(it,Rt,Bt){let{submission:xn,fetcherSubmission:Qn,replace:xs}=Bt===void 0?{}:Bt;Rt.response.headers.has("X-Remix-Revalidate")&&(Nt=!0);let Xr=Rt.response.headers.get("Location");Wn(Xr,"Expected a Location header on the redirect Response"),Xr=Kl(Xr,new URL(it.url),p);let Er=ut(G.location,Xr,{_isRedirect:!0});if(n){let Da=!1;if(Rt.response.headers.has("X-Remix-Reload-Document"))Da=!0;else if(Yo.test(Xr)){const nl=e.history.createURL(Xr);Da=nl.origin!==t.location.origin||In(nl.pathname,p)==null}if(Da){xs?t.location.replace(Xr):t.location.assign(Xr);return}}at=null;let Us=xs===!0?Dr.Replace:Dr.Push,{formMethod:Is,formAction:_l,formEncType:Sl}=G.navigation;!xn&&!Qn&&Is&&_l&&Sl&&(xn=nh(G.navigation));let Es=xn||Qn;if(di.has(Rt.response.status)&&Es&&ni(Es.formMethod))await ja(Us,Er,{submission:Dn({},Es,{formAction:Xr}),preventScrollReset:We});else{let Da=Hd(Er,xn);await ja(Us,Er,{overrideNavigation:Da,fetcherSubmission:Qn,preventScrollReset:We})}}async function _n(it,Rt,Bt,xn){try{let Qn=await Wl(g,it,Rt,Bt,xn,o,s);return await Promise.all(Qn.map((xs,Xr)=>{if(bu(xs)){let Er=xs.result;return{type:be.redirect,response:ql(Er,Rt,Bt[Xr].route.id,xn,p,v.v7_relativeSplatPath)}}return sl(xs)}))}catch(Qn){return Bt.map(()=>({type:be.error,error:Qn}))}}async function Lt(it,Rt,Bt,xn,Qn){let[xs,...Xr]=await Promise.all([Bt.length?_n("loader",Qn,Bt,Rt):[],...xn.map(Er=>{if(Er.matches&&Er.match&&Er.controller){let Us=Gl(e.history,Er.path,Er.controller.signal);return _n("loader",Us,[Er.match],Er.matches).then(Is=>Is[0])}else return Promise.resolve({type:be.error,error:Oo(404,{pathname:Er.path})})})]);return await Promise.all([Xc(it,Bt,xs,xs.map(()=>Qn.signal),!1,G.loaderData),Xc(it,xn.map(Er=>Er.match),Xr,xn.map(Er=>Er.controller?Er.controller.signal:null),!0)]),{loaderResults:xs,fetcherResults:Xr}}function jn(){Nt=!0,Bn.push(...fo()),Gt.forEach((it,Rt)=>{Nn.has(Rt)&&(wn.push(Rt),Ja(Rt))})}function ds(it,Rt,Bt){Bt===void 0&&(Bt={}),G.fetchers.set(it,Rt),mr({fetchers:new Map(G.fetchers)},{flushSync:(Bt&&Bt.flushSync)===!0})}function $s(it,Rt,Bt,xn){xn===void 0&&(xn={});let Qn=go(G.matches,Rt);xc(it),mr({errors:{[Qn.route.id]:Bt},fetchers:new Map(G.fetchers)},{flushSync:(xn&&xn.flushSync)===!0})}function Ca(it){return v.v7_fetcherPersist&&(Sn.set(it,(Sn.get(it)||0)+1),Cr.has(it)&&Cr.delete(it)),G.fetchers.get(it)||I}function xc(it){let Rt=G.fetchers.get(it);Nn.has(it)&&!(Rt&&Rt.state==="loading"&&At.has(it))&&Ja(it),Gt.delete(it),At.delete(it),Ht.delete(it),Cr.delete(it),G.fetchers.delete(it)}function Qc(it){if(v.v7_fetcherPersist){let Rt=(Sn.get(it)||0)-1;Rt<=0?(Sn.delete(it),Cr.add(it)):Sn.set(it,Rt)}else xc(it);mr({fetchers:new Map(G.fetchers)})}function Ja(it){let Rt=Nn.get(it);Wn(Rt,"Expected fetch controller: "+it),Rt.abort(),Nn.delete(it)}function Ld(it){for(let Rt of it){let Bt=Ca(Rt),xn=zi(Bt.data);G.fetchers.set(Rt,xn)}}function Fd(){let it=[],Rt=!1;for(let Bt of Ht){let xn=G.fetchers.get(Bt);Wn(xn,"Expected fetcher: "+Bt),xn.state==="loading"&&(Ht.delete(Bt),it.push(Bt),Rt=!0)}return Ld(it),Rt}function zd(it){let Rt=[];for(let[Bt,xn]of At)if(xn<it){let Qn=G.fetchers.get(Bt);Wn(Qn,"Expected fetcher: "+Bt),Qn.state==="loading"&&(Ja(Bt),At.delete(Bt),Rt.push(Bt))}return Ld(Rt),Rt.length>0}function qf(it,Rt){let Bt=G.blockers.get(it)||$a;return Ln.get(it)!==Rt&&Ln.set(it,Rt),Bt}function jm(it){G.blockers.delete(it),Ln.delete(it)}function Kf(it,Rt){let Bt=G.blockers.get(it)||$a;Wn(Bt.state==="unblocked"&&Rt.state==="blocked"||Bt.state==="blocked"&&Rt.state==="blocked"||Bt.state==="blocked"&&Rt.state==="proceeding"||Bt.state==="blocked"&&Rt.state==="unblocked"||Bt.state==="proceeding"&&Rt.state==="unblocked","Invalid blocker state transition: "+Bt.state+" -> "+Rt.state);let xn=new Map(G.blockers);xn.set(it,Rt),mr({blockers:xn})}function rs(it){let{currentLocation:Rt,nextLocation:Bt,historyAction:xn}=it;if(Ln.size===0)return;Ln.size>1&&Me(!1,"A router only supports one blocker at a time");let Qn=Array.from(Ln.entries()),[xs,Xr]=Qn[Qn.length-1],Er=G.blockers.get(xs);if(!(Er&&Er.state==="proceeding")&&Xr({currentLocation:Rt,nextLocation:Bt,historyAction:xn}))return xs}function fo(it){let Rt=[];return br.forEach((Bt,xn)=>{(!it||it(xn))&&(Bt.cancel(),Rt.push(xn),br.delete(xn))}),Rt}function sa(it,Rt,Bt){if(E=it,k=Rt,R=Bt||null,!N&&G.navigation===Ce){N=!0;let xn=_c(G.location,G.matches);xn!=null&&mr({restoreScrollPosition:xn})}return()=>{E=null,k=null,R=null}}function oa(it,Rt){return R&&R(it,Rt.map(xn=>fe(xn,G.loaderData)))||it.key}function Do(it,Rt){if(E&&k){let Bt=oa(it,Rt);E[Bt]=k()}}function _c(it,Rt){if(E){let Bt=oa(it,Rt),xn=E[Bt];if(typeof xn=="number")return xn}return null}function xl(it){o={},u=ue(it,s,void 0,o)}return ye={get basename(){return p},get future(){return v},get state(){return G},get routes(){return i},get window(){return t},initialize:ws,subscribe:tr,enableScrollRestoration:sa,navigate:Ws,fetch:Tt,revalidate:xi,createHref:it=>e.history.createHref(it),encodeLocation:it=>e.history.encodeLocation(it),getFetcher:Ca,deleteFetcher:Qc,dispose:us,getBlocker:qf,deleteBlocker:jm,_internalFetchControllers:Nn,_internalActiveDeferreds:br,_internalSetRoutes:xl},ye}const _i=Symbol("deferred");function Cc(e,t){Wn(e.length>0,"You must provide a non-empty routes array to createStaticHandler");let n={},r=(t?t.basename:null)||"/",s;if(t!=null&&t.mapRouteProperties)s=t.mapRouteProperties;else if(t!=null&&t.detectErrorBoundary){let E=t.detectErrorBoundary;s=R=>({hasErrorBoundary:E(R)})}else s=ko;let o=Dn({v7_relativeSplatPath:!1,v7_throwAbortReason:!1},t?t.future:null),i=ue(e,s,void 0,n);async function u(E,R){let{requestContext:k,skipLoaderErrorBubbling:N,unstable_dataStrategy:L}=R===void 0?{}:R,D=new URL(E.url),B=E.method,Q=ut("",Wt(D),null,"default"),ce=K(i,Q,r);if(!Vd(B)&&B!=="HEAD"){let G=Oo(405,{method:B}),{matches:Le,route:We}=kc(i);return{basename:r,location:Q,matches:Le,loaderData:{},actionData:null,errors:{[We.id]:G},statusCode:G.status,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}else if(!ce){let G=Oo(404,{pathname:Q.pathname}),{matches:Le,route:We}=kc(i);return{basename:r,location:Q,matches:Le,loaderData:{},actionData:null,errors:{[We.id]:G},statusCode:G.status,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}let ye=await g(E,Q,ce,k,L||null,N===!0,null);return Oc(ye)?ye:Dn({location:Q,basename:r},ye)}async function p(E,R){let{routeId:k,requestContext:N,unstable_dataStrategy:L}=R===void 0?{}:R,D=new URL(E.url),B=E.method,Q=ut("",Wt(D),null,"default"),ce=K(i,Q,r);if(!Vd(B)&&B!=="HEAD"&&B!=="OPTIONS")throw Oo(405,{method:B});if(!ce)throw Oo(404,{pathname:Q.pathname});let ye=k?ce.find(at=>at.route.id===k):xu(ce,Q);if(k&&!ye)throw Oo(403,{pathname:Q.pathname,routeId:k});if(!ye)throw Oo(404,{pathname:Q.pathname});let G=await g(E,Q,ce,N,L||null,!1,ye);if(Oc(G))return G;let Le=G.errors?Object.values(G.errors)[0]:void 0;if(Le!==void 0)throw Le;if(G.actionData)return Object.values(G.actionData)[0];if(G.loaderData){var We;let at=Object.values(G.loaderData)[0];return(We=G.activeDeferreds)!=null&&We[ye.route.id]&&(at[_i]=G.activeDeferreds[ye.route.id]),at}}async function g(E,R,k,N,L,D,B){Wn(E.signal,"query()/queryRoute() requests must contain an AbortController signal");try{if(ni(E.method.toLowerCase()))return await v(E,k,B||xu(k,R),N,L,D,B!=null);let Q=await w(E,k,N,L,D,B);return Oc(Q)?Q:Dn({},Q,{actionData:null,actionHeaders:{}})}catch(Q){if(Mm(Q)&&Oc(Q.result)){if(Q.type===be.error)throw Q.result;return Q.result}if(Yf(Q))return Q;throw Q}}async function v(E,R,k,N,L,D,B){let Q;if(!k.route.action&&!k.route.lazy){let G=Oo(405,{method:E.method,pathname:new URL(E.url).pathname,routeId:k.route.id});if(B)throw G;Q={type:be.error,error:G}}else Q=(await x("action",E,[k],R,B,N,L))[0],E.signal.aborted&&tt(E,B,o);if(Pc(Q))throw new Response(null,{status:Q.response.status,headers:{Location:Q.response.headers.get("Location")}});if(Rc(Q)){let G=Oo(400,{type:"defer-action"});if(B)throw G;Q={type:be.error,error:G}}if(B){if(Lo(Q))throw Q.error;return{matches:[k],loaderData:{},actionData:{[k.route.id]:Q.data},errors:null,statusCode:200,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}let ce=new Request(E.url,{headers:E.headers,redirect:E.redirect,signal:E.signal});if(Lo(Q)){let G=D?k:go(R,k.route.id),Le=await w(ce,R,N,L,D,null,[G.route.id,Q]);return Dn({},Le,{statusCode:ei(Q.error)?Q.error.status:Q.statusCode!=null?Q.statusCode:500,actionData:null,actionHeaders:Dn({},Q.headers?{[k.route.id]:Q.headers}:{})})}let ye=await w(ce,R,N,L,D,null);return Dn({},ye,{actionData:{[k.route.id]:Q.data}},Q.statusCode?{statusCode:Q.statusCode}:{},{actionHeaders:Q.headers?{[k.route.id]:Q.headers}:{}})}async function w(E,R,k,N,L,D,B){let Q=D!=null;if(Q&&!(D!=null&&D.route.loader)&&!(D!=null&&D.route.lazy))throw Oo(400,{method:E.method,pathname:new URL(E.url).pathname,routeId:D?.route.id});let ye=(D?[D]:B&&Lo(B[1])?ha(R,B[0]):R).filter(St=>St.route.loader||St.route.lazy);if(ye.length===0)return{matches:R,loaderData:R.reduce((St,xt)=>Object.assign(St,{[xt.route.id]:null}),{}),errors:B&&Lo(B[1])?{[B[0]]:B[1].error}:null,statusCode:200,loaderHeaders:{},activeDeferreds:null};let G=await x("loader",E,ye,R,Q,k,N);E.signal.aborted&&tt(E,Q,o);let Le=new Map,We=Bd(R,ye,G,B,Le,L),at=new Set(ye.map(St=>St.route.id));return R.forEach(St=>{at.has(St.route.id)||(We.loaderData[St.route.id]=null)}),Dn({},We,{matches:R,activeDeferreds:Le.size>0?Object.fromEntries(Le.entries()):null})}async function x(E,R,k,N,L,D,B){let Q=await Wl(B||fi,E,R,k,N,n,s,D);return await Promise.all(Q.map((ce,ye)=>{if(bu(ce)){let G=ce.result;throw ql(G,R,k[ye].route.id,N,r,o.v7_relativeSplatPath)}if(Oc(ce.result)&&L)throw ce;return sl(ce)}))}return{dataRoutes:i,query:u,queryRoute:p}}function cr(e,t,n){return Dn({},t,{statusCode:ei(n)?n.status:500,errors:{[t._deepestRenderedBoundaryId||e[0].id]:n}})}function tt(e,t,n){if(n.v7_throwAbortReason&&e.signal.reason!==void 0)throw e.signal.reason;let r=t?"queryRoute":"query";throw new Error(r+"() call aborted: "+e.method+" "+e.url)}function tn(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Fn(e,t,n,r,s,o,i,u){let p,g;if(i){p=[];for(let w of t)if(p.push(w),w.route.id===i){g=w;break}}else p=t,g=t[t.length-1];let v=_r(s||".",er(p,o),In(e.pathname,n)||e.pathname,u==="path");return s==null&&(v.search=e.search,v.hash=e.hash),(s==null||s===""||s===".")&&g&&g.route.index&&!wu(v.search)&&(v.search=v.search?v.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(v.pathname=v.pathname==="/"?n:ys([n,v.pathname])),Wt(v)}function Ur(e,t,n,r){if(!r||!tn(r))return{path:n};if(r.formMethod&&!Vd(r.formMethod))return{path:n,error:Oo(405,{method:r.formMethod})};let s=()=>({path:n,error:Oo(400,{type:"invalid-body"})}),o=r.formMethod||"get",i=e?o.toUpperCase():o.toLowerCase(),u=th(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!ni(i))return s();let x=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((E,R)=>{let[k,N]=R;return""+E+k+"="+N+`
`},""):String(r.body);return{path:n,submission:{formMethod:i,formAction:u,formEncType:r.formEncType,formData:void 0,json:void 0,text:x}}}else if(r.formEncType==="application/json"){if(!ni(i))return s();try{let x=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:i,formAction:u,formEncType:r.formEncType,formData:void 0,json:x,text:void 0}}}catch{return s()}}}Wn(typeof FormData=="function","FormData is not available in this environment");let p,g;if(r.formData)p=ti(r.formData),g=r.formData;else if(r.body instanceof FormData)p=ti(r.body),g=r.body;else if(r.body instanceof URLSearchParams)p=r.body,g=Yc(p);else if(r.body==null)p=new URLSearchParams,g=new FormData;else try{p=new URLSearchParams(r.body),g=Yc(p)}catch{return s()}let v={formMethod:i,formAction:u,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:g,json:void 0,text:void 0};if(ni(v.formMethod))return{path:n,submission:v};let w=cn(n);return t&&w.search&&wu(w.search)&&p.append("index",""),w.search="?"+p,{path:Wt(w),submission:v}}function ha(e,t){let n=e;if(t){let r=e.findIndex(s=>s.route.id===t);r>=0&&(n=e.slice(0,r))}return n}function Ro(e,t,n,r,s,o,i,u,p,g,v,w,x,E,R,k){let N=k?Lo(k[1])?k[1].error:k[1].data:void 0,L=e.createURL(t.location),D=e.createURL(s),B=k&&Lo(k[1])?k[0]:void 0,Q=B?ha(n,B):n,ce=k?k[1].statusCode:void 0,ye=i&&ce&&ce>=400,G=Q.filter((We,at)=>{let{route:St}=We;if(St.lazy)return!0;if(St.loader==null)return!1;if(o)return typeof St.loader!="function"||St.loader.hydrate?!0:t.loaderData[St.id]===void 0&&(!t.errors||t.errors[St.id]===void 0);if(aa(t.loaderData,t.matches[at],We)||p.some($t=>$t===We.route.id))return!0;let xt=t.matches[at],Mt=We;return rl(We,Dn({currentUrl:L,currentParams:xt.params,nextUrl:D,nextParams:Mt.params},r,{actionResult:N,unstable_actionStatus:ce,defaultShouldRevalidate:ye?!1:u||L.pathname+L.search===D.pathname+D.search||L.search!==D.search||Po(xt,Mt)}))}),Le=[];return w.forEach((We,at)=>{if(o||!n.some(Nt=>Nt.route.id===We.routeId)||v.has(at))return;let St=K(E,We.path,R);if(!St){Le.push({key:at,routeId:We.routeId,path:We.path,matches:null,match:null,controller:null});return}let xt=t.fetchers.get(at),Mt=xu(St,We.path),$t=!1;x.has(at)?$t=!1:g.includes(at)?$t=!0:xt&&xt.state!=="idle"&&xt.data===void 0?$t=u:$t=rl(Mt,Dn({currentUrl:L,currentParams:t.matches[t.matches.length-1].params,nextUrl:D,nextParams:n[n.length-1].params},r,{actionResult:N,unstable_actionStatus:ce,defaultShouldRevalidate:ye?!1:u})),$t&&Le.push({key:at,routeId:We.routeId,path:We.path,matches:St,match:Mt,controller:new AbortController})}),[G,Le]}function aa(e,t,n){let r=!t||n.route.id!==t.route.id,s=e[n.route.id]===void 0;return r||s}function Po(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function rl(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}async function mo(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let s=n[e.id];Wn(s,"No route found in manifest");let o={};for(let i in r){let p=s[i]!==void 0&&i!=="hasErrorBoundary";Me(!p,'Route "'+s.id+'" has a static property "'+i+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+i+'" will be ignored.')),!p&&!pe.has(i)&&(o[i]=r[i])}Object.assign(s,o),Object.assign(s,Dn({},t(s),{lazy:void 0}))}function fi(e){return Promise.all(e.matches.map(t=>t.resolve()))}async function Wl(e,t,n,r,s,o,i,u){let p=r.reduce((w,x)=>w.add(x.route.id),new Set),g=new Set,v=await e({matches:s.map(w=>{let x=p.has(w.route.id);return Dn({},w,{shouldLoad:x,resolve:R=>(g.add(w.route.id),x?Ec(t,n,w,o,i,R,u):Promise.resolve({type:be.data,result:void 0}))})}),request:n,params:s[0].params,context:u});return s.forEach(w=>Wn(g.has(w.route.id),'`match.resolve()` was not called for route id "'+w.route.id+'". You must call `match.resolve()` on every match passed to `dataStrategy` to ensure all routes are properly loaded.')),v.filter((w,x)=>p.has(s[x].route.id))}async function Ec(e,t,n,r,s,o,i){let u,p,g=v=>{let w,x=new Promise((k,N)=>w=N);p=()=>w(),t.signal.addEventListener("abort",p);let E=k=>typeof v!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+n.route.id+"]"))):v({request:t,params:n.params,context:i},...k!==void 0?[k]:[]),R;return o?R=o(k=>E(k)):R=(async()=>{try{return{type:"data",result:await E()}}catch(k){return{type:"error",result:k}}})(),Promise.race([R,x])};try{let v=n.route[e];if(n.route.lazy)if(v){let w,[x]=await Promise.all([g(v).catch(E=>{w=E}),mo(n.route,s,r)]);if(w!==void 0)throw w;u=x}else if(await mo(n.route,s,r),v=n.route[e],v)u=await g(v);else if(e==="action"){let w=new URL(t.url),x=w.pathname+w.search;throw Oo(405,{method:t.method,pathname:x,routeId:n.route.id})}else return{type:be.data,result:void 0};else if(v)u=await g(v);else{let w=new URL(t.url),x=w.pathname+w.search;throw Oo(404,{pathname:x})}Wn(u.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(v){return{type:be.error,result:v}}finally{p&&t.signal.removeEventListener("abort",p)}return u}async function sl(e){let{result:t,type:n,status:r}=e;if(Oc(t)){let i;try{let u=t.headers.get("Content-Type");u&&/\bapplication\/json\b/.test(u)?t.body==null?i=null:i=await t.json():i=await t.text()}catch(u){return{type:be.error,error:u}}return n===be.error?{type:be.error,error:new Ka(t.status,t.statusText,i),statusCode:t.status,headers:t.headers}:{type:be.data,data:i,statusCode:t.status,headers:t.headers}}if(n===be.error)return{type:be.error,error:t,statusCode:ei(t)?t.status:r};if($m(t)){var s,o;return{type:be.deferred,deferredData:t,statusCode:(s=t.init)==null?void 0:s.status,headers:((o=t.init)==null?void 0:o.headers)&&new Headers(t.init.headers)}}return{type:be.data,data:t,statusCode:r}}function ql(e,t,n,r,s,o){let i=e.headers.get("Location");if(Wn(i,"Redirects returned/thrown from loaders/actions must have a Location header"),!Yo.test(i)){let u=r.slice(0,r.findIndex(p=>p.route.id===n)+1);i=Fn(new URL(t.url),u,s,!0,i,o),e.headers.set("Location",i)}return e}function Kl(e,t,n){if(Yo.test(e)){let r=e,s=r.startsWith("//")?new URL(t.protocol+r):new URL(r),o=In(s.pathname,n)!=null;if(s.origin===t.origin&&o)return s.pathname+s.search+s.hash}return e}function Gl(e,t,n,r){let s=e.createURL(th(t)).toString(),o={signal:n};if(r&&ni(r.formMethod)){let{formMethod:i,formEncType:u}=r;o.method=i.toUpperCase(),u==="application/json"?(o.headers=new Headers({"Content-Type":u}),o.body=JSON.stringify(r.json)):u==="text/plain"?o.body=r.text:u==="application/x-www-form-urlencoded"&&r.formData?o.body=ti(r.formData):o.body=r.formData}return new Request(s,o)}function ti(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function Yc(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function Bd(e,t,n,r,s,o){let i={},u=null,p,g=!1,v={},w=r&&Lo(r[1])?r[1].error:void 0;return n.forEach((x,E)=>{let R=t[E].route.id;if(Wn(!Pc(x),"Cannot handle redirect results in processLoaderData"),Lo(x)){let k=x.error;if(w!==void 0&&(k=w,w=void 0),u=u||{},o)u[R]=k;else{let N=go(e,R);u[N.route.id]==null&&(u[N.route.id]=k)}i[R]=void 0,g||(g=!0,p=ei(x.error)?x.error.status:500),x.headers&&(v[R]=x.headers)}else Rc(x)?(s.set(R,x.deferredData),i[R]=x.deferredData.data,x.statusCode!=null&&x.statusCode!==200&&!g&&(p=x.statusCode),x.headers&&(v[R]=x.headers)):(i[R]=x.data,x.statusCode&&x.statusCode!==200&&!g&&(p=x.statusCode),x.headers&&(v[R]=x.headers))}),w!==void 0&&r&&(u={[r[0]]:w},i[r[0]]=void 0),{loaderData:i,errors:u,statusCode:p||200,loaderHeaders:v}}function Tc(e,t,n,r,s,o,i,u){let{loaderData:p,errors:g}=Bd(t,n,r,s,u,!1);for(let v=0;v<o.length;v++){let{key:w,match:x,controller:E}=o[v];Wn(i!==void 0&&i[v]!==void 0,"Did not find corresponding fetcher result");let R=i[v];if(!(E&&E.signal.aborted))if(Lo(R)){let k=go(e.matches,x?.route.id);g&&g[k.route.id]||(g=Dn({},g,{[k.route.id]:R.error})),e.fetchers.delete(w)}else if(Pc(R))Wn(!1,"Unhandled fetcher revalidation redirect");else if(Rc(R))Wn(!1,"Unhandled fetcher deferred data");else{let k=zi(R.data);e.fetchers.set(w,k)}}return{loaderData:p,errors:g}}function eh(e,t,n,r){let s=Dn({},t);for(let o of n){let i=o.route.id;if(t.hasOwnProperty(i)?t[i]!==void 0&&(s[i]=t[i]):e[i]!==void 0&&o.route.loader&&(s[i]=e[i]),r&&r.hasOwnProperty(i))break}return s}function Xu(e){return e?Lo(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function go(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function kc(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Oo(e,t){let{pathname:n,routeId:r,method:s,type:o}=t===void 0?{}:t,i="Unknown Server Error",u="Unknown @remix-run/router error";return e===400?(i="Bad Request",s&&n&&r?u="You made a "+s+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":o==="defer-action"?u="defer() is not supported in actions":o==="invalid-body"&&(u="Unable to encode submission body")):e===403?(i="Forbidden",u='Route "'+r+'" does not match URL "'+n+'"'):e===404?(i="Not Found",u='No route matches URL "'+n+'"'):e===405&&(i="Method Not Allowed",s&&n&&r?u="You made a "+s.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":s&&(u='Invalid request method "'+s.toUpperCase()+'"')),new Ka(e||500,i,new Error(u),!0)}function Qf(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(Pc(n))return{result:n,idx:t}}}function th(e){let t=typeof e=="string"?cn(e):e;return Wt(Dn({},t,{hash:""}))}function pi(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Mm(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type===be.data||e.type===be.error)}function bu(e){return Oc(e.result)&&pa.has(e.result.status)}function Rc(e){return e.type===be.deferred}function Lo(e){return e.type===be.error}function Pc(e){return(e&&e.type)===be.redirect}function $m(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function Oc(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function Yf(e){if(!Oc(e))return!1;let t=e.status,n=e.headers.get("Location");return t>=300&&t<=399&&n!=null}function Vd(e){return so.has(e.toLowerCase())}function ni(e){return Fi.has(e.toLowerCase())}async function Xc(e,t,n,r,s,o){for(let i=0;i<n.length;i++){let u=n[i],p=t[i];if(!p)continue;let g=e.find(w=>w.route.id===p.route.id),v=g!=null&&!Po(g,p)&&(o&&o[p.route.id])!==void 0;if(Rc(u)&&(s||v)){let w=r[i];Wn(w,"Expected an AbortSignal for revalidating fetcher deferred result"),await Zu(u,w,s).then(x=>{x&&(n[i]=x||n[i])})}}}async function Zu(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:be.data,data:e.deferredData.unwrappedData}}catch(s){return{type:be.error,error:s}}return{type:be.data,data:e.deferredData.data}}}function wu(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function xu(e,t){let n=typeof t=="string"?cn(t).search:t.search;if(e[e.length-1].route.index&&wu(n||""))return e[e.length-1];let r=gr(e);return r[r.length-1]}function nh(e){let{formMethod:t,formAction:n,formEncType:r,text:s,formData:o,json:i}=e;if(!(!t||!n||!r)){if(s!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:s};if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:o,json:void 0,text:void 0};if(i!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:i,text:void 0}}}function Hd(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Ju(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function ed(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function Lm(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function zi(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function J(e,t){try{let n=e.sessionStorage.getItem(Ud);if(n){let r=JSON.parse(n);for(let[s,o]of Object.entries(r||{}))o&&Array.isArray(o)&&t.set(s,new Set(o||[]))}}catch{}}function re(e,t){if(t.size>0){let n={};for(let[r,s]of t)n[r]=[...s];try{e.sessionStorage.setItem(Ud,JSON.stringify(n))}catch(r){Me(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/**
 * React Router v6.23.1
 *
 * Copyright (c) Remix Software Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */function Se(){return Se=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Se.apply(this,arguments)}const ke=l.createContext(null),Ue=l.createContext(null),lt=l.createContext(null),ot=l.createContext(null),en=l.createContext(null),or=l.createContext({outlet:null,matches:[],isDataRoute:!1}),Tn=l.createContext(null);function $n(e,t){let{relative:n}=t===void 0?{}:t;vr()||Wn(!1);let{basename:r,navigator:s}=l.useContext(ot),{hash:o,pathname:i,search:u}=Ql(e,{relative:n}),p=i;return r!=="/"&&(p=i==="/"?r:ys([r,i])),s.createHref({pathname:p,search:u,hash:o})}function vr(){return l.useContext(en)!=null}function ks(){return vr()||Wn(!1),l.useContext(en).location}function Ea(){return React.useContext(en).navigationType}function Mr(e){vr()||Wn(!1);let{pathname:t}=ks();return l.useMemo(()=>Kt(e,t),[t,e])}const ms=null;function Pr(e){l.useContext(ot).static||l.useLayoutEffect(e)}function Qs(){let{isDataRoute:e}=l.useContext(or);return e?Hm():Fo()}function Fo(){vr()||Wn(!1);let e=l.useContext(ke),{basename:t,future:n,navigator:r}=l.useContext(ot),{matches:s}=l.useContext(or),{pathname:o}=ks(),i=JSON.stringify(er(s,n.v7_relativeSplatPath)),u=l.useRef(!1);return Pr(()=>{u.current=!0}),l.useCallback(function(g,v){if(v===void 0&&(v={}),!u.current)return;if(typeof g=="number"){r.go(g);return}let w=_r(g,JSON.parse(i),o,v.relative==="path");e==null&&t!=="/"&&(w.pathname=w.pathname==="/"?t:ys([t,w.pathname])),(v.replace?r.replace:r.push)(w,v.state,v)},[t,r,i,o,e])}const zo=l.createContext(null);function Nc(){return React.useContext(zo)}function La(e){let t=l.useContext(or).outlet;return t&&l.createElement(zo.Provider,{value:e},t)}function ma(){let{matches:e}=l.useContext(or),t=e[e.length-1];return t?t.params:{}}function Ql(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=l.useContext(ot),{matches:s}=l.useContext(or),{pathname:o}=ks(),i=JSON.stringify(er(s,r.v7_relativeSplatPath));return l.useMemo(()=>_r(e,JSON.parse(i),o,n==="path"),[e,i,o,n])}function _u(e,t){return Su(e,t)}function Su(e,t,n,r){vr()||Wn(!1);let{navigator:s}=l.useContext(ot),{matches:o}=l.useContext(or),i=o[o.length-1],u=i?i.params:{},p=i?i.pathname:"/",g=i?i.pathnameBase:"/",v=i&&i.route,w=ks(),x;if(t){var E;let D=typeof t=="string"?cn(t):t;g==="/"||(E=D.pathname)!=null&&E.startsWith(g)||Wn(!1),x=D}else x=w;let R=x.pathname||"/",k=R;if(g!=="/"){let D=g.replace(/^\//,"").split("/");k="/"+R.replace(/^\//,"").split("/").slice(D.length).join("/")}let N=K(e,{pathname:k}),L=zm(N&&N.map(D=>Object.assign({},D,{params:Object.assign({},u,D.params),pathname:ys([g,s.encodeLocation?s.encodeLocation(D.pathname).pathname:D.pathname]),pathnameBase:D.pathnameBase==="/"?g:ys([g,s.encodeLocation?s.encodeLocation(D.pathnameBase).pathname:D.pathnameBase])})),o,n,r);return t&&L?l.createElement(en.Provider,{value:{location:Se({pathname:"/",search:"",hash:"",state:null,key:"default"},x),navigationType:Dr.Pop}},L):L}function td(){let e=qd(),t=ei(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},i=null;return l.createElement(l.Fragment,null,l.createElement("h2",null,"Unexpected Application Error!"),l.createElement("h3",{style:{fontStyle:"italic"}},t),n?l.createElement("pre",{style:s},n):null,i)}const I0=l.createElement(td,null);class j0 extends l.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?l.createElement(or.Provider,{value:this.props.routeContext},l.createElement(Tn.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Fm(e){let{routeContext:t,match:n,children:r}=e,s=l.useContext(ke);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),l.createElement(or.Provider,{value:t},r)}function zm(e,t,n,r){var s;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var o;if((o=n)!=null&&o.errors)e=n.matches;else return null}let i=e,u=(s=n)==null?void 0:s.errors;if(u!=null){let v=i.findIndex(w=>w.route.id&&u?.[w.route.id]!==void 0);v>=0||Wn(!1),i=i.slice(0,Math.min(i.length,v+1))}let p=!1,g=-1;if(n&&r&&r.v7_partialHydration)for(let v=0;v<i.length;v++){let w=i[v];if((w.route.HydrateFallback||w.route.hydrateFallbackElement)&&(g=v),w.route.id){let{loaderData:x,errors:E}=n,R=w.route.loader&&x[w.route.id]===void 0&&(!E||E[w.route.id]===void 0);if(w.route.lazy||R){p=!0,g>=0?i=i.slice(0,g+1):i=[i[0]];break}}}return i.reduceRight((v,w,x)=>{let E,R=!1,k=null,N=null;n&&(E=u&&w.route.id?u[w.route.id]:void 0,k=w.route.errorElement||I0,p&&(g<0&&x===0?(Cu("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),R=!0,N=null):g===x&&(R=!0,N=w.route.hydrateFallbackElement||null)));let L=t.concat(i.slice(0,x+1)),D=()=>{let B;return E?B=k:R?B=N:w.route.Component?B=l.createElement(w.route.Component,null):w.route.element?B=w.route.element:B=v,l.createElement(Fm,{match:w,routeContext:{outlet:v,matches:L,isDataRoute:n!=null},children:B})};return n&&(w.route.ErrorBoundary||w.route.errorElement||x===0)?l.createElement(j0,{location:n.location,revalidation:n.revalidation,component:k,error:E,children:D(),routeContext:{outlet:null,matches:L,isDataRoute:!0}}):D()},null)}var rh=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(rh||{}),Ui=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Ui||{});function Bw(e){return e+" must be used within a data router.  See https://reactrouter.com/routers/picking-a-router."}function Bi(e){let t=l.useContext(ke);return t||Wn(!1),t}function El(e){let t=l.useContext(Ue);return t||Wn(!1),t}function Um(e){let t=l.useContext(or);return t||Wn(!1),t}function Wd(e){let t=Um(e),n=t.matches[t.matches.length-1];return n.route.id||Wn(!1),n.route.id}function D0(){return Wd(Ui.UseRouteId)}function Dy(){return El(Ui.UseNavigation).navigation}function M0(){let e=Bi(rh.UseRevalidator),t=El(Ui.UseRevalidator);return React.useMemo(()=>({revalidate:e.router.revalidate,state:t.revalidation}),[e.router.revalidate,t.revalidation])}function Vw(){let{matches:e,loaderData:t}=El(Ui.UseMatches);return React.useMemo(()=>e.map(n=>UNSAFE_convertRouteMatchToUiMatch(n,t)),[e,t])}function Hw(){let e=El(Ui.UseLoaderData),t=Wd(Ui.UseLoaderData);if(e.errors&&e.errors[t]!=null){console.error("You cannot `useLoaderData` in an errorElement (routeId: "+t+")");return}return e.loaderData[t]}function Xf(e){return El(Ui.UseRouteLoaderData).loaderData[e]}function sh(){let e=El(Ui.UseActionData),t=Wd(Ui.UseLoaderData);return e.actionData?e.actionData[t]:void 0}function qd(){var e;let t=l.useContext(Tn),n=El(Ui.UseRouteError),r=Wd(Ui.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function Bm(){let e=React.useContext(lt);return e?._data}function Vm(){let e=React.useContext(lt);return e?._error}let Kd=0;function Gd(e){let{router:t,basename:n}=Bi(rh.UseBlocker),r=El(Ui.UseBlocker),[s,o]=l.useState(""),i=l.useCallback(u=>{if(typeof e!="function")return!!e;if(n==="/")return e(u);let{currentLocation:p,nextLocation:g,historyAction:v}=u;return e({currentLocation:Se({},p,{pathname:In(p.pathname,n)||p.pathname}),nextLocation:Se({},g,{pathname:In(g.pathname,n)||g.pathname}),historyAction:v})},[n,e]);return l.useEffect(()=>{let u=String(++Kd);return o(u),()=>t.deleteBlocker(u)},[t]),l.useEffect(()=>{s!==""&&t.getBlocker(s,i)},[t,s,i]),s&&r.blockers.has(s)?r.blockers.get(s):$a}function Hm(){let{router:e}=Bi(rh.UseNavigateStable),t=Wd(Ui.UseNavigateStable),n=l.useRef(!1);return Pr(()=>{n.current=!0}),l.useCallback(function(s,o){o===void 0&&(o={}),n.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,Se({fromRouteId:t},o)))},[e,t])}const ol={};function Cu(e,t,n){!t&&!ol[e]&&(ol[e]=!0)}const Zf=se["startTransition"];function Ww(e){let{fallbackElement:t,router:n,future:r}=e,[s,o]=React.useState(n.state),{v7_startTransition:i}=r||{},u=React.useCallback(w=>{i&&Zf?Zf(()=>o(w)):o(w)},[o,i]);React.useLayoutEffect(()=>n.subscribe(u),[n,u]),React.useEffect(()=>{},[]);let p=React.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:w=>n.navigate(w),push:(w,x,E)=>n.navigate(w,{state:x,preventScrollReset:E?.preventScrollReset}),replace:(w,x,E)=>n.navigate(w,{replace:!0,state:x,preventScrollReset:E?.preventScrollReset})}),[n]),g=n.basename||"/",v=React.useMemo(()=>({router:n,navigator:p,static:!1,basename:g}),[n,p,g]);return React.createElement(React.Fragment,null,React.createElement(ke.Provider,{value:v},React.createElement(Ue.Provider,{value:s},React.createElement(nd,{basename:g,location:s.location,navigationType:s.historyAction,navigator:p,future:{v7_relativeSplatPath:n.future.v7_relativeSplatPath}},s.initialized||n.future.v7_partialHydration?React.createElement($y,{routes:n.routes,future:n.future,state:s}):t))),null)}function $y(e){let{routes:t,future:n,state:r}=e;return Su(t,void 0,r,n)}function Ly(e){let{basename:t,children:n,initialEntries:r,initialIndex:s,future:o}=e,i=React.useRef();i.current==null&&(i.current=createMemoryHistory({initialEntries:r,initialIndex:s,v5Compat:!0}));let u=i.current,[p,g]=React.useState({action:u.action,location:u.location}),{v7_startTransition:v}=o||{},w=React.useCallback(x=>{v&&Zf?Zf(()=>g(x)):g(x)},[g,v]);return React.useLayoutEffect(()=>u.listen(w),[u,w]),React.createElement(nd,{basename:t,children:n,location:p.location,navigationType:p.action,navigator:u,future:o})}function hi(e){let{to:t,replace:n,state:r,relative:s}=e;vr()||Wn(!1);let{future:o,static:i}=l.useContext(ot),{matches:u}=l.useContext(or),{pathname:p}=ks(),g=Qs(),v=_r(t,er(u,o.v7_relativeSplatPath),p,s==="path"),w=JSON.stringify(v);return l.useEffect(()=>g(JSON.parse(w),{replace:n,state:r,relative:s}),[g,w,s,n,r]),null}function Ta(e){return La(e.context)}function $r(e){Wn(!1)}function nd(e){let{basename:t="/",children:n=null,location:r,navigationType:s=Dr.Pop,navigator:o,static:i=!1,future:u}=e;vr()&&Wn(!1);let p=t.replace(/^\/*/,"/"),g=l.useMemo(()=>({basename:p,navigator:o,static:i,future:Se({v7_relativeSplatPath:!1},u)}),[p,u,o,i]);typeof r=="string"&&(r=cn(r));let{pathname:v="/",search:w="",hash:x="",state:E=null,key:R="default"}=r,k=l.useMemo(()=>{let N=In(v,p);return N==null?null:{location:{pathname:N,search:w,hash:x,state:E,key:R},navigationType:s}},[p,v,w,x,E,R,s]);return k==null?null:l.createElement(ot.Provider,{value:g},l.createElement(en.Provider,{children:n,value:k}))}function qw(e){let{children:t,location:n}=e;return _u(vo(t),n)}function Kw(e){let{children:t,errorElement:n,resolve:r}=e;return React.createElement(Wm,{resolve:r,errorElement:n},React.createElement($0,null,t))}var ia=function(e){return e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error",e}(ia||{});const Fy=new Promise(()=>{});class Wm extends l.Component{constructor(t){super(t),this.state={error:null}}static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,n){console.error("<Await> caught the following error during render",t,n)}render(){let{children:t,errorElement:n,resolve:r}=this.props,s=null,o=ia.pending;if(!(r instanceof Promise))o=ia.success,s=Promise.resolve(),Object.defineProperty(s,"_tracked",{get:()=>!0}),Object.defineProperty(s,"_data",{get:()=>r});else if(this.state.error){o=ia.error;let i=this.state.error;s=Promise.reject().catch(()=>{}),Object.defineProperty(s,"_tracked",{get:()=>!0}),Object.defineProperty(s,"_error",{get:()=>i})}else r._tracked?(s=r,o="_error"in s?ia.error:"_data"in s?ia.success:ia.pending):(o=ia.pending,Object.defineProperty(r,"_tracked",{get:()=>!0}),s=r.then(i=>Object.defineProperty(r,"_data",{get:()=>i}),i=>Object.defineProperty(r,"_error",{get:()=>i})));if(o===ia.error&&s._error instanceof os)throw Fy;if(o===ia.error&&!n)throw s._error;if(o===ia.error)return l.createElement(lt.Provider,{value:s,children:n});if(o===ia.success)return l.createElement(lt.Provider,{value:s,children:t});throw s}}function $0(e){let{children:t}=e,n=Bm(),r=typeof t=="function"?t(n):t;return React.createElement(React.Fragment,null,r)}function vo(e,t){t===void 0&&(t=[]);let n=[];return l.Children.forEach(e,(r,s)=>{if(!l.isValidElement(r))return;let o=[...t,s];if(r.type===l.Fragment){n.push.apply(n,vo(r.props.children,o));return}r.type!==$r&&Wn(!1),!r.props.index||!r.props.children||Wn(!1);let i={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(i.children=vo(r.props.children,o)),n.push(i)}),n}function oh(e){return zm(e)}function Qd(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:l.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:l.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:l.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}function ah(e,t){return createRouter({basename:t?.basename,future:Se({},t?.future,{v7_prependBasename:!0}),history:createMemoryHistory({initialEntries:t?.initialEntries,initialIndex:t?.initialIndex}),hydrationData:t?.hydrationData,routes:e,mapRouteProperties:Qd,unstable_dataStrategy:t?.unstable_dataStrategy}).initialize()}/**
 * React Router DOM v6.23.1
 *
 * Copyright (c) Remix Software Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */function al(){return al=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},al.apply(this,arguments)}function Jf(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,o;for(o=0;o<r.length;o++)s=r[o],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}const rd="get",Yd="application/x-www-form-urlencoded";function Zc(e){return e!=null&&typeof e.tagName=="string"}function qm(e){return Zc(e)&&e.tagName.toLowerCase()==="button"}function L0(e){return Zc(e)&&e.tagName.toLowerCase()==="form"}function Xd(e){return Zc(e)&&e.tagName.toLowerCase()==="input"}function F0(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Zd(e,t){return e.button===0&&(!t||t==="_self")&&!F0(e)}function Eu(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function Km(e,t){let n=Eu(e);return t&&t.forEach((r,s)=>{n.has(s)||t.getAll(s).forEach(o=>{n.append(s,o)})}),n}let Yl=null;function Jd(){if(Yl===null)try{new FormData(document.createElement("form"),0),Yl=!1}catch{Yl=!0}return Yl}const ep=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Gm(e){return e!=null&&!ep.has(e)?null:e}function Qm(e,t){let n,r,s,o,i;if(L0(e)){let u=e.getAttribute("action");r=u?stripBasename(u,t):null,n=e.getAttribute("method")||rd,s=Gm(e.getAttribute("enctype"))||Yd,o=new FormData(e)}else if(qm(e)||Xd(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let p=e.getAttribute("formaction")||u.getAttribute("action");if(r=p?stripBasename(p,t):null,n=e.getAttribute("formmethod")||u.getAttribute("method")||rd,s=Gm(e.getAttribute("formenctype"))||Gm(u.getAttribute("enctype"))||Yd,o=new FormData(u,e),!Jd()){let{name:g,type:v,value:w}=e;if(v==="image"){let x=g?g+".":"";o.append(x+"x","0"),o.append(x+"y","0")}else g&&o.append(g,w)}}else{if(Zc(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=rd,r=null,s=Yd,i=e}return o&&s==="text/plain"&&(i=o,o=void 0),{action:r,method:n.toLowerCase(),encType:s,formData:o,body:i}}const ih=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],Gw=null,z0=null,Tu="6";try{window.__reactRouterVersion=Tu}catch{}function U0(e,t){return yu({basename:t?.basename,future:al({},t?.future,{v7_prependBasename:!0}),history:qo({window:t?.window}),hydrationData:t?.hydrationData||Xl(),routes:e,mapRouteProperties:Qd,unstable_dataStrategy:t?.unstable_dataStrategy,window:t?.window}).initialize()}function ef(e,t){return createRouter({basename:t?.basename,future:al({},t?.future,{v7_prependBasename:!0}),history:createHashHistory({window:t?.window}),hydrationData:t?.hydrationData||Xl(),routes:e,mapRouteProperties:UNSAFE_mapRouteProperties,unstable_dataStrategy:t?.unstable_dataStrategy,window:t?.window}).initialize()}function Xl(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=al({},t,{errors:tf(t.errors)})),t}function tf(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,s]of t)if(s&&s.__type==="RouteErrorResponse")n[r]=new Ka(s.status,s.statusText,s.data,s.internal===!0);else if(s&&s.__type==="Error"){if(s.__subType){let o=window[s.__subType];if(typeof o=="function")try{let i=new o(s.message);i.stack="",n[r]=i}catch{}}if(n[r]==null){let o=new Error(s.message);o.stack="",n[r]=o}}else n[r]=s;return n}const Ss=l.createContext({isTransitioning:!1}),tp=l.createContext(new Map),ku=se["startTransition"],rf=Pe["flushSync"],sf=se["useId"];function sd(e){ku?ku(e):e()}function Ac(e){rf?rf(e):e()}class Ru{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function lo(e){let{fallbackElement:t,router:n,future:r}=e,[s,o]=l.useState(n.state),[i,u]=l.useState(),[p,g]=l.useState({isTransitioning:!1}),[v,w]=l.useState(),[x,E]=l.useState(),[R,k]=l.useState(),N=l.useRef(new Map),{v7_startTransition:L}=r||{},D=l.useCallback(G=>{L?sd(G):G()},[L]),B=l.useCallback((G,Le)=>{let{deletedFetchers:We,unstable_flushSync:at,unstable_viewTransitionOpts:St}=Le;We.forEach(Mt=>N.current.delete(Mt)),G.fetchers.forEach((Mt,$t)=>{Mt.data!==void 0&&N.current.set($t,Mt.data)});let xt=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!St||xt){at?Ac(()=>o(G)):D(()=>o(G));return}if(at){Ac(()=>{x&&(v&&v.resolve(),x.skipTransition()),g({isTransitioning:!0,flushSync:!0,currentLocation:St.currentLocation,nextLocation:St.nextLocation})});let Mt=n.window.document.startViewTransition(()=>{Ac(()=>o(G))});Mt.finished.finally(()=>{Ac(()=>{w(void 0),E(void 0),u(void 0),g({isTransitioning:!1})})}),Ac(()=>E(Mt));return}x?(v&&v.resolve(),x.skipTransition(),k({state:G,currentLocation:St.currentLocation,nextLocation:St.nextLocation})):(u(G),g({isTransitioning:!0,flushSync:!1,currentLocation:St.currentLocation,nextLocation:St.nextLocation}))},[n.window,x,v,N,D]);l.useLayoutEffect(()=>n.subscribe(B),[n,B]),l.useEffect(()=>{p.isTransitioning&&!p.flushSync&&w(new Ru)},[p]),l.useEffect(()=>{if(v&&i&&n.window){let G=i,Le=v.promise,We=n.window.document.startViewTransition(async()=>{D(()=>o(G)),await Le});We.finished.finally(()=>{w(void 0),E(void 0),u(void 0),g({isTransitioning:!1})}),E(We)}},[D,i,v,n.window]),l.useEffect(()=>{v&&i&&s.location.key===i.location.key&&v.resolve()},[v,x,s.location,i]),l.useEffect(()=>{!p.isTransitioning&&R&&(u(R.state),g({isTransitioning:!0,flushSync:!1,currentLocation:R.currentLocation,nextLocation:R.nextLocation}),k(void 0))},[p.isTransitioning,R]),l.useEffect(()=>{},[]);let Q=l.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:G=>n.navigate(G),push:(G,Le,We)=>n.navigate(G,{state:Le,preventScrollReset:We?.preventScrollReset}),replace:(G,Le,We)=>n.navigate(G,{replace:!0,state:Le,preventScrollReset:We?.preventScrollReset})}),[n]),ce=n.basename||"/",ye=l.useMemo(()=>({router:n,navigator:Q,static:!1,basename:ce}),[n,Q,ce]);return l.createElement(l.Fragment,null,l.createElement(ke.Provider,{value:ye},l.createElement(Ue.Provider,{value:s},l.createElement(tp.Provider,{value:N.current},l.createElement(Ss.Provider,{value:p},l.createElement(nd,{basename:ce,location:s.location,navigationType:s.historyAction,navigator:Q,future:{v7_relativeSplatPath:n.future.v7_relativeSplatPath}},s.initialized||n.future.v7_partialHydration?l.createElement(Co,{routes:n.routes,future:n.future,state:s}):t))))),null)}function Co(e){let{routes:t,future:n,state:r}=e;return Su(t,void 0,r,n)}function od(e){let{basename:t,children:n,future:r,window:s}=e,o=React.useRef();o.current==null&&(o.current=createBrowserHistory({window:s,v5Compat:!0}));let i=o.current,[u,p]=React.useState({action:i.action,location:i.location}),{v7_startTransition:g}=r||{},v=React.useCallback(w=>{g&&ku?ku(()=>p(w)):p(w)},[p,g]);return React.useLayoutEffect(()=>i.listen(v),[i,v]),React.createElement(Router,{basename:t,children:n,location:u.location,navigationType:u.action,navigator:i,future:r})}function Si(e){let{basename:t,children:n,future:r,window:s}=e,o=React.useRef();o.current==null&&(o.current=createHashHistory({window:s,v5Compat:!0}));let i=o.current,[u,p]=React.useState({action:i.action,location:i.location}),{v7_startTransition:g}=r||{},v=React.useCallback(w=>{g&&ku?ku(()=>p(w)):p(w)},[p,g]);return React.useLayoutEffect(()=>i.listen(v),[i,v]),React.createElement(Router,{basename:t,children:n,location:u.location,navigationType:u.action,navigator:i,future:r})}function il(e){let{basename:t,children:n,future:r,history:s}=e,[o,i]=React.useState({action:s.action,location:s.location}),{v7_startTransition:u}=r||{},p=React.useCallback(g=>{u&&ku?ku(()=>i(g)):i(g)},[i,u]);return React.useLayoutEffect(()=>s.listen(p),[s,p]),React.createElement(Router,{basename:t,children:n,location:o.location,navigationType:o.action,navigator:s,future:r})}const ad=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",id=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ka=l.forwardRef(function(t,n){let{onClick:r,relative:s,reloadDocument:o,replace:i,state:u,target:p,to:g,preventScrollReset:v,unstable_viewTransition:w}=t,x=Jf(t,ih),{basename:E}=l.useContext(ot),R,k=!1;if(typeof g=="string"&&id.test(g)&&(R=g,ad))try{let B=new URL(window.location.href),Q=g.startsWith("//")?new URL(B.protocol+g):new URL(g),ce=In(Q.pathname,E);Q.origin===B.origin&&ce!=null?g=ce+Q.search+Q.hash:k=!0}catch{}let N=$n(g,{relative:s}),L=B0(g,{replace:i,state:u,target:p,preventScrollReset:v,relative:s,unstable_viewTransition:w});function D(B){r&&r(B),B.defaultPrevented||L(B)}return l.createElement("a",al({},x,{href:R||N,onClick:k||o?r:D,ref:n,target:p}))}),Ym=null,of=null;function ch(e){let{getKey:t,storageKey:n}=e;return Jl({getKey:t,storageKey:n}),null}var Ic;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Ic||(Ic={}));var af;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(af||(af={}));function Pu(e){return e+" must be used within a data router.  See https://reactrouter.com/routers/picking-a-router."}function ld(e){let t=React.useContext(UNSAFE_DataRouterContext);return t||UNSAFE_invariant(!1),t}function rp(e){let t=React.useContext(UNSAFE_DataRouterStateContext);return t||UNSAFE_invariant(!1),t}function B0(e,t){let{target:n,replace:r,state:s,preventScrollReset:o,relative:i,unstable_viewTransition:u}=t===void 0?{}:t,p=Qs(),g=ks(),v=Ql(e,{relative:i});return l.useCallback(w=>{if(Zd(w,n)){w.preventDefault();let x=r!==void 0?r:Wt(g)===Wt(v);p(e,{replace:x,state:s,preventScrollReset:o,relative:i,unstable_viewTransition:u})}},[g,p,v,r,s,n,e,o,i,u])}function zy(e){let t=l.useRef(Eu(e)),n=l.useRef(!1),r=ks(),s=l.useMemo(()=>Km(r.search,n.current?null:t.current),[r.search]),o=Qs(),i=l.useCallback((u,p)=>{const g=Eu(typeof u=="function"?u(s):u);n.current=!0,o("?"+g,p)},[o,s]);return[s,i]}function Zl(){if(typeof document>"u")throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}let lf=0,Tl=()=>"__"+String(++lf)+"__";function uh(){let{router:e}=ld(Ic.UseSubmit),{basename:t}=React.useContext(UNSAFE_NavigationContext),n=UNSAFE_useRouteId();return React.useCallback(function(r,s){s===void 0&&(s={}),Zl();let{action:o,method:i,encType:u,formData:p,body:g}=Qm(r,t);if(s.navigate===!1){let v=s.fetcherKey||Tl();e.fetch(v,n,s.action||o,{preventScrollReset:s.preventScrollReset,formData:p,body:g,formMethod:s.method||i,formEncType:s.encType||u,unstable_flushSync:s.unstable_flushSync})}else e.navigate(s.action||o,{preventScrollReset:s.preventScrollReset,formData:p,body:g,formMethod:s.method||i,formEncType:s.encType||u,replace:s.replace,state:s.state,fromRouteId:n,unstable_flushSync:s.unstable_flushSync,unstable_viewTransition:s.unstable_viewTransition})},[e,t,n])}function Xm(e,t){let{relative:n}=t===void 0?{}:t,{basename:r}=React.useContext(UNSAFE_NavigationContext),s=React.useContext(UNSAFE_RouteContext);s||UNSAFE_invariant(!1);let[o]=s.matches.slice(-1),i=al({},useResolvedPath(e||".",{relative:n})),u=useLocation();if(e==null){i.search=u.search;let p=new URLSearchParams(i.search);p.has("index")&&p.get("index")===""&&(p.delete("index"),i.search=p.toString()?"?"+p.toString():"")}return(!e||e===".")&&o.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(i.pathname=i.pathname==="/"?r:joinPaths([r,i.pathname])),createPath(i)}function kl(e){var t;let{key:n}=e===void 0?{}:e,{router:r}=ld(Ic.UseFetcher),s=rp(af.UseFetcher),o=React.useContext(tp),i=React.useContext(UNSAFE_RouteContext),u=(t=i.matches[i.matches.length-1])==null?void 0:t.route.id;o||UNSAFE_invariant(!1),i||UNSAFE_invariant(!1),u==null&&UNSAFE_invariant(!1);let p=sf?sf():"",[g,v]=React.useState(n||p);n&&n!==g?v(n):g||v(Tl()),React.useEffect(()=>(r.getFetcher(g),()=>{r.deleteFetcher(g)}),[r,g]);let w=React.useCallback((D,B)=>{u||UNSAFE_invariant(!1),r.fetch(g,u,D,B)},[g,u,r]),x=uh(),E=React.useCallback((D,B)=>{x(D,al({},B,{navigate:!1,fetcherKey:g}))},[g,x]),R=React.useMemo(()=>React.forwardRef((B,Q)=>React.createElement(of,al({},B,{navigate:!1,fetcherKey:g,ref:Q}))),[g]),k=s.fetchers.get(g)||IDLE_FETCHER,N=o.get(g);return React.useMemo(()=>al({Form:R,submit:E,load:w},k,{data:N}),[R,E,w,k,N])}function Xo(){let e=rp(af.UseFetchers);return Array.from(e.fetchers.entries()).map(t=>{let[n,r]=t;return al({},r,{key:n})})}const Rl="react-router-scroll-positions";let Vi={};function Jl(e){let{getKey:t,storageKey:n}=e===void 0?{}:e,{router:r}=ld(Ic.UseScrollRestoration),{restoreScrollPosition:s,preventScrollReset:o}=rp(af.UseScrollRestoration),{basename:i}=React.useContext(UNSAFE_NavigationContext),u=useLocation(),p=useMatches(),g=useNavigation();React.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),V0(React.useCallback(()=>{if(g.state==="idle"){let v=(t?t(u,p):null)||u.key;Vi[v]=window.scrollY}try{sessionStorage.setItem(n||Rl,JSON.stringify(Vi))}catch{}window.history.scrollRestoration="auto"},[n,t,g.state,u,p])),typeof document<"u"&&(React.useLayoutEffect(()=>{try{let v=sessionStorage.getItem(n||Rl);v&&(Vi=JSON.parse(v))}catch{}},[n]),React.useLayoutEffect(()=>{let v=t&&i!=="/"?(x,E)=>t(al({},x,{pathname:stripBasename(x.pathname,i)||x.pathname}),E):t,w=r?.enableScrollRestoration(Vi,()=>window.scrollY,v);return()=>w&&w()},[r,i,t]),React.useLayoutEffect(()=>{if(s!==!1){if(typeof s=="number"){window.scrollTo(0,s);return}if(u.hash){let v=document.getElementById(decodeURIComponent(u.hash.slice(1)));if(v){v.scrollIntoView();return}}o!==!0&&window.scrollTo(0,0)}},[u,s,o]))}function cf(e,t){let{capture:n}=t||{};React.useEffect(()=>{let r=n!=null?{capture:n}:void 0;return window.addEventListener("beforeunload",e,r),()=>{window.removeEventListener("beforeunload",e,r)}},[e,n])}function V0(e,t){let{capture:n}=t||{};React.useEffect(()=>{let r=n!=null?{capture:n}:void 0;return window.addEventListener("pagehide",e,r),()=>{window.removeEventListener("pagehide",e,r)}},[e,n])}function H0(e){let{when:t,message:n}=e,r=useBlocker(t);React.useEffect(()=>{r.state==="blocked"&&(window.confirm(n)?setTimeout(r.proceed,0):r.reset())},[r,n]),React.useEffect(()=>{r.state==="blocked"&&!t&&r.reset()},[r,t])}function W0(e,t){t===void 0&&(t={});let n=React.useContext(Ss);n==null&&UNSAFE_invariant(!1);let{basename:r}=ld(Ic.useViewTransitionState),s=useResolvedPath(e,{relative:t.relative});if(!n.isTransitioning)return!1;let o=stripBasename(n.currentLocation.pathname,r)||n.currentLocation.pathname,i=stripBasename(n.nextLocation.pathname,r)||n.nextLocation.pathname;return matchPath(s.pathname,i)!=null||matchPath(s.pathname,o)!=null}function mi(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?mi=function(n){return typeof n}:mi=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},mi(e)}function Ci(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Uo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ec(e,t,n){return t&&Uo(e.prototype,t),n&&Uo(e,n),e}function q0(e,t){return t&&(mi(t)==="object"||typeof t=="function")?t:uf(e)}function dh(e){return dh=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},dh(e)}function uf(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Zm(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&fh(e,t)}function fh(e,t){return fh=Object.setPrototypeOf||function(r,s){return r.__proto__=s,r},fh(e,t)}function Ou(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Jm=function(e){Zm(t,e);function t(){var n,r;Ci(this,t);for(var s=arguments.length,o=new Array(s),i=0;i<s;i++)o[i]=arguments[i];return r=q0(this,(n=dh(t)).call.apply(n,[this].concat(o))),Ou(uf(r),"state",{bootstrapped:!1}),Ou(uf(r),"_unsubscribe",void 0),Ou(uf(r),"handlePersistorState",function(){var u=r.props.persistor,p=u.getState(),g=p.bootstrapped;g&&(r.props.onBeforeLift?Promise.resolve(r.props.onBeforeLift()).finally(function(){return r.setState({bootstrapped:!0})}):r.setState({bootstrapped:!0}),r._unsubscribe&&r._unsubscribe())}),r}return ec(t,[{key:"componentDidMount",value:function(){this._unsubscribe=this.props.persistor.subscribe(this.handlePersistorState),this.handlePersistorState()}},{key:"componentWillUnmount",value:function(){this._unsubscribe&&this._unsubscribe()}},{key:"render",value:function(){return typeof this.props.children=="function"?this.props.children(this.state.bootstrapped):this.state.bootstrapped?this.props.children:this.props.loading}}]),t}(l.PureComponent);Ou(Jm,"defaultProps",{children:null,loading:null});var df=ln(1191);const{i18n:eg}=ae.A,Eo=(0,df.W)(eg);var jc=ln(9583),sp="-";function K0(e){var t=ff(e),n=e.conflictingClassGroups,r=e.conflictingClassGroupModifiers,s=r===void 0?{}:r;function o(u){var p=u.split(sp);return p[0]===""&&p.length!==1&&p.shift(),Jc(p,t)||ph(u)}function i(u,p){var g=n[u]||[];return p&&s[u]?[].concat(g,s[u]):g}return{getClassGroupId:o,getConflictingClassGroupIds:i}}function Jc(e,t){if(e.length===0)return t.classGroupId;var n=e[0],r=t.nextPart.get(n),s=r?Jc(e.slice(1),r):void 0;if(s)return s;if(t.validators.length!==0){var o=e.join(sp);return t.validators.find(function(i){var u=i.validator;return u(o)})?.classGroupId}}var tg=/^\[(.+)\]$/;function ph(e){if(tg.test(e)){var t=tg.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function ff(e){var t=e.theme,n=e.prefix,r={nextPart:new Map,validators:[]},s=hh(Object.entries(e.classGroups),n);return s.forEach(function(o){var i=o[0],u=o[1];Nu(u,r,i,t)}),r}function Nu(e,t,n,r){e.forEach(function(s){if(typeof s=="string"){var o=s===""?t:pf(t,s);o.classGroupId=n;return}if(typeof s=="function"){if(ng(s)){Nu(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(function(i){var u=i[0],p=i[1];Nu(p,pf(t,u),n,r)})})}function pf(e,t){var n=e;return t.split(sp).forEach(function(r){n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function ng(e){return e.isThemeGetter}function hh(e,t){return t?e.map(function(n){var r=n[0],s=n[1],o=s.map(function(i){return typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(function(u){var p=u[0],g=u[1];return[t+p,g]})):i});return[r,o]}):e}function rg(e){if(e<1)return{get:function(){},set:function(){}};var t=0,n=new Map,r=new Map;function s(o,i){n.set(o,i),t++,t>e&&(t=0,r=n,n=new Map)}return{get:function(i){var u=n.get(i);if(u!==void 0)return u;if((u=r.get(i))!==void 0)return s(i,u),u},set:function(i,u){n.has(i)?n.set(i,u):s(i,u)}}}var cd="!";function Pl(e){var t=e.separator||":",n=t.length===1,r=t[0],s=t.length;return function(i){for(var u=[],p=0,g=0,v,w=0;w<i.length;w++){var x=i[w];if(p===0){if(x===r&&(n||i.slice(w,w+s)===t)){u.push(i.slice(g,w)),g=w+s;continue}if(x==="/"){v=w;continue}}x==="["?p++:x==="]"&&p--}var E=u.length===0?i:i.substring(g),R=E.startsWith(cd),k=R?E.substring(1):E,N=v&&v>g?v-g:void 0;return{modifiers:u,hasImportantModifier:R,baseClassName:k,maybePostfixModifierPosition:N}}}function Au(e){if(e.length<=1)return e;var t=[],n=[];return e.forEach(function(r){var s=r[0]==="[";s?(t.push.apply(t,n.sort().concat([r])),n=[]):n.push(r)}),t.push.apply(t,n.sort()),t}function mh(e){return{cache:rg(e.cacheSize),splitModifiers:Pl(e),...K0(e)}}var sg=/\s+/;function eu(e,t){var n=t.splitModifiers,r=t.getClassGroupId,s=t.getConflictingClassGroupIds,o=new Set;return e.trim().split(sg).map(function(i){var u=n(i),p=u.modifiers,g=u.hasImportantModifier,v=u.baseClassName,w=u.maybePostfixModifierPosition,x=r(w?v.substring(0,w):v),E=Boolean(w);if(!x){if(!w)return{isTailwindClass:!1,originalClassName:i};if(x=r(v),!x)return{isTailwindClass:!1,originalClassName:i};E=!1}var R=Au(p).join(":"),k=g?R+cd:R;return{isTailwindClass:!0,modifierId:k,classGroupId:x,originalClassName:i,hasPostfixModifier:E}}).reverse().filter(function(i){if(!i.isTailwindClass)return!0;var u=i.modifierId,p=i.classGroupId,g=i.hasPostfixModifier,v=u+p;return o.has(v)?!1:(o.add(v),s(p,g).forEach(function(w){return o.add(u+w)}),!0)}).reverse().map(function(i){return i.originalClassName}).join(" ")}function ll(){for(var e=0,t,n,r="";e<arguments.length;)(t=arguments[e++])&&(n=gh(t))&&(r&&(r+=" "),r+=n);return r}function gh(e){if(typeof e=="string")return e;for(var t,n="",r=0;r<e.length;r++)e[r]&&(t=gh(e[r]))&&(n&&(n+=" "),n+=t);return n}function vh(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,s,o,i=u;function u(g){var v=t[0],w=t.slice(1),x=w.reduce(function(E,R){return R(E)},v());return r=mh(x),s=r.cache.get,o=r.cache.set,i=p,p(g)}function p(g){var v=s(g);if(v)return v;var w=eu(g,r);return o(g,w),w}return function(){return i(ll.apply(null,arguments))}}function Ys(e){var t=function(r){return r[e]||[]};return t.isThemeGetter=!0,t}var tc=/^\[(?:([a-z-]+):)?(.+)\]$/i,yh=/^\d+\/\d+$/,og=new Set(["px","full","screen"]),bh=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,G0=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,tu=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;function ga(e){return ru(e)||og.has(e)||yh.test(e)||ud(e)}function ud(e){return cl(e,"length",Jo)}function op(e){return cl(e,"size",Ra)}function dd(e){return cl(e,"position",Ra)}function wh(e){return cl(e,"url",Ga)}function nu(e){return cl(e,"number",ru)}var Q0=null;function ru(e){return!Number.isNaN(Number(e))}function Zo(e){return e.endsWith("%")&&ru(e.slice(0,-1))}function Dc(e){return hf(e)||cl(e,"number",hf)}function Rs(e){return tc.test(e)}function fd(){return!0}function Ol(e){return bh.test(e)}function ag(e){return cl(e,"",mf)}function cl(e,t,n){var r=tc.exec(e);return r?r[1]?r[1]===t:n(r[2]):!1}function Jo(e){return G0.test(e)}function Ra(){return!1}function Ga(e){return e.startsWith("url(")}function hf(e){return Number.isInteger(Number(e))}function mf(e){return tu.test(e)}function gf(){var e=Ys("colors"),t=Ys("spacing"),n=Ys("blur"),r=Ys("brightness"),s=Ys("borderColor"),o=Ys("borderRadius"),i=Ys("borderSpacing"),u=Ys("borderWidth"),p=Ys("contrast"),g=Ys("grayscale"),v=Ys("hueRotate"),w=Ys("invert"),x=Ys("gap"),E=Ys("gradientColorStops"),R=Ys("gradientColorStopPositions"),k=Ys("inset"),N=Ys("margin"),L=Ys("opacity"),D=Ys("padding"),B=Ys("saturate"),Q=Ys("scale"),ce=Ys("sepia"),ye=Ys("skew"),G=Ys("space"),Le=Ys("translate"),We=function(){return["auto","contain","none"]},at=function(){return["auto","hidden","clip","visible","scroll"]},St=function(){return["auto",Rs,t]},xt=function(){return[Rs,t]},Mt=function(){return["",ga]},$t=function(){return["auto",ru,Rs]},Nt=function(){return["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"]},Bn=function(){return["solid","dashed","dotted","double","none"]},wn=function(){return["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"]},Nn=function(){return["start","end","center","between","around","evenly","stretch"]},Zt=function(){return["","0",Rs]},Pt=function(){return["auto","avoid","all","avoid-page","page","left","right","column"]},At=function(){return[ru,nu]},Ht=function(){return[ru,Rs]};return{cacheSize:500,theme:{colors:[fd],spacing:[ga],blur:["none","",Ol,Rs],brightness:At(),borderColor:[e],borderRadius:["none","","full",Ol,Rs],borderSpacing:xt(),borderWidth:Mt(),contrast:At(),grayscale:Zt(),hueRotate:Ht(),invert:Zt(),gap:xt(),gradientColorStops:[e],gradientColorStopPositions:[Zo,ud],inset:St(),margin:St(),opacity:At(),padding:xt(),saturate:At(),scale:At(),sepia:Zt(),skew:Ht(),space:xt(),translate:xt()},classGroups:{aspect:[{aspect:["auto","square","video",Rs]}],container:["container"],columns:[{columns:[Ol]}],"break-after":[{"break-after":Pt()}],"break-before":[{"break-before":Pt()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none"]}],clear:[{clear:["left","right","both","none"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[].concat(Nt(),[Rs])}],overflow:[{overflow:at()}],"overflow-x":[{"overflow-x":at()}],"overflow-y":[{"overflow-y":at()}],overscroll:[{overscroll:We()}],"overscroll-x":[{"overscroll-x":We()}],"overscroll-y":[{"overscroll-y":We()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[k]}],"inset-x":[{"inset-x":[k]}],"inset-y":[{"inset-y":[k]}],start:[{start:[k]}],end:[{end:[k]}],top:[{top:[k]}],right:[{right:[k]}],bottom:[{bottom:[k]}],left:[{left:[k]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Dc]}],basis:[{basis:St()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Rs]}],grow:[{grow:Zt()}],shrink:[{shrink:Zt()}],order:[{order:["first","last","none",Dc]}],"grid-cols":[{"grid-cols":[fd]}],"col-start-end":[{col:["auto",{span:["full",Dc]},Rs]}],"col-start":[{"col-start":$t()}],"col-end":[{"col-end":$t()}],"grid-rows":[{"grid-rows":[fd]}],"row-start-end":[{row:["auto",{span:[Dc]},Rs]}],"row-start":[{"row-start":$t()}],"row-end":[{"row-end":$t()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Rs]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Rs]}],gap:[{gap:[x]}],"gap-x":[{"gap-x":[x]}],"gap-y":[{"gap-y":[x]}],"justify-content":[{justify:["normal"].concat(Nn())}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal"].concat(Nn(),["baseline"])}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[].concat(Nn(),["baseline"])}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[D]}],px:[{px:[D]}],py:[{py:[D]}],ps:[{ps:[D]}],pe:[{pe:[D]}],pt:[{pt:[D]}],pr:[{pr:[D]}],pb:[{pb:[D]}],pl:[{pl:[D]}],m:[{m:[N]}],mx:[{mx:[N]}],my:[{my:[N]}],ms:[{ms:[N]}],me:[{me:[N]}],mt:[{mt:[N]}],mr:[{mr:[N]}],mb:[{mb:[N]}],ml:[{ml:[N]}],"space-x":[{"space-x":[G]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[G]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit",Rs,t]}],"min-w":[{"min-w":["min","max","fit",Rs,ga]}],"max-w":[{"max-w":["0","none","full","min","max","fit","prose",{screen:[Ol]},Ol,Rs]}],h:[{h:[Rs,t,"auto","min","max","fit"]}],"min-h":[{"min-h":["min","max","fit",Rs,ga]}],"max-h":[{"max-h":[Rs,t,"min","max","fit"]}],"font-size":[{text:["base",Ol,ud]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",nu]}],"font-family":[{font:[fd]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Rs]}],"line-clamp":[{"line-clamp":["none",ru,nu]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Rs,ga]}],"list-image":[{"list-image":["none",Rs]}],"list-style-type":[{list:["none","disc","decimal",Rs]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[L]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[L]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[].concat(Bn(),["wavy"])}],"text-decoration-thickness":[{decoration:["auto","from-font",ga]}],"underline-offset":[{"underline-offset":["auto",Rs,ga]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],indent:[{indent:xt()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Rs]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Rs]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[L]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[].concat(Nt(),[dd])}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",op]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},wh]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[R]}],"gradient-via-pos":[{via:[R]}],"gradient-to-pos":[{to:[R]}],"gradient-from":[{from:[E]}],"gradient-via":[{via:[E]}],"gradient-to":[{to:[E]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[u]}],"border-w-x":[{"border-x":[u]}],"border-w-y":[{"border-y":[u]}],"border-w-s":[{"border-s":[u]}],"border-w-e":[{"border-e":[u]}],"border-w-t":[{"border-t":[u]}],"border-w-r":[{"border-r":[u]}],"border-w-b":[{"border-b":[u]}],"border-w-l":[{"border-l":[u]}],"border-opacity":[{"border-opacity":[L]}],"border-style":[{border:[].concat(Bn(),["hidden"])}],"divide-x":[{"divide-x":[u]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[u]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[L]}],"divide-style":[{divide:Bn()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:[""].concat(Bn())}],"outline-offset":[{"outline-offset":[Rs,ga]}],"outline-w":[{outline:[ga]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Mt()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[L]}],"ring-offset-w":[{"ring-offset":[ga]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ol,ag]}],"shadow-color":[{shadow:[fd]}],opacity:[{opacity:[L]}],"mix-blend":[{"mix-blend":wn()}],"bg-blend":[{"bg-blend":wn()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[p]}],"drop-shadow":[{"drop-shadow":["","none",Ol,Rs]}],grayscale:[{grayscale:[g]}],"hue-rotate":[{"hue-rotate":[v]}],invert:[{invert:[w]}],saturate:[{saturate:[B]}],sepia:[{sepia:[ce]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[p]}],"backdrop-grayscale":[{"backdrop-grayscale":[g]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[v]}],"backdrop-invert":[{"backdrop-invert":[w]}],"backdrop-opacity":[{"backdrop-opacity":[L]}],"backdrop-saturate":[{"backdrop-saturate":[B]}],"backdrop-sepia":[{"backdrop-sepia":[ce]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Rs]}],duration:[{duration:Ht()}],ease:[{ease:["linear","in","out","in-out",Rs]}],delay:[{delay:Ht()}],animate:[{animate:["none","spin","ping","pulse","bounce",Rs]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[Q]}],"scale-x":[{"scale-x":[Q]}],"scale-y":[{"scale-y":[Q]}],rotate:[{rotate:[Dc,Rs]}],"translate-x":[{"translate-x":[Le]}],"translate-y":[{"translate-y":[Le]}],"skew-x":[{"skew-x":[ye]}],"skew-y":[{"skew-y":[ye]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Rs]}],accent:[{accent:["auto",e]}],appearance:["appearance-none"],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Rs]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":xt()}],"scroll-mx":[{"scroll-mx":xt()}],"scroll-my":[{"scroll-my":xt()}],"scroll-ms":[{"scroll-ms":xt()}],"scroll-me":[{"scroll-me":xt()}],"scroll-mt":[{"scroll-mt":xt()}],"scroll-mr":[{"scroll-mr":xt()}],"scroll-mb":[{"scroll-mb":xt()}],"scroll-ml":[{"scroll-ml":xt()}],"scroll-p":[{"scroll-p":xt()}],"scroll-px":[{"scroll-px":xt()}],"scroll-py":[{"scroll-py":xt()}],"scroll-ps":[{"scroll-ps":xt()}],"scroll-pe":[{"scroll-pe":xt()}],"scroll-pt":[{"scroll-pt":xt()}],"scroll-pr":[{"scroll-pr":xt()}],"scroll-pb":[{"scroll-pb":xt()}],"scroll-pl":[{"scroll-pl":xt()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","pinch-zoom","manipulation",{pan:["x","left","right","y","up","down"]}]}],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Rs]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ga,nu]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}var Y0=vh(gf);const st=(...e)=>Y0((0,jc.$)(e));function ig(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function ap(...e){return t=>e.forEach(n=>ig(n,t))}function X0(...e){return React.useCallback(ap(...e),e)}var Qa=l.forwardRef((e,t)=>{const{children:n,...r}=e,s=l.Children.toArray(n),o=s.find(lg);if(o){const i=o.props.children,u=s.map(p=>p===o?l.Children.count(i)>1?l.Children.only(null):l.isValidElement(i)?i.props.children:null:p);return(0,a.jsx)(Hi,{...r,ref:t,children:l.isValidElement(i)?l.cloneElement(i,void 0,u):null})}return(0,a.jsx)(Hi,{...r,ref:t,children:n})});Qa.displayName="Slot";var Hi=l.forwardRef((e,t)=>{const{children:n,...r}=e;if(l.isValidElement(n)){const s=ug(n);return l.cloneElement(n,{...cg(r,n.props),ref:t?ap(t,s):s})}return l.Children.count(n)>1?l.Children.only(null):null});Hi.displayName="SlotClone";var ip=({children:e})=>(0,a.jsx)(a.Fragment,{children:e});function lg(e){return l.isValidElement(e)&&e.type===ip}function cg(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...u)=>{o(...u),s(...u)}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function ug(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var By=null;const dg=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,xh=jc.A,Nl=(e,t)=>n=>{var r;if(t?.variants==null)return xh(e,n?.class,n?.className);const{variants:s,defaultVariants:o}=t,i=Object.keys(s).map(g=>{const v=n?.[g],w=o?.[g];if(v===null)return null;const x=dg(v)||dg(w);return s[g][x]}),u=n&&Object.entries(n).reduce((g,v)=>{let[w,x]=v;return x===void 0||(g[w]=x),g},{}),p=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((g,v)=>{let{class:w,className:x,...E}=v;return Object.entries(E).every(R=>{let[k,N]=R;return Array.isArray(N)?N.includes({...o,...u}[k]):{...o,...u}[k]===N})?[...g,w,x]:g},[]);return xh(e,i,p,n?.class,n?.className)};var No=(e=>(e.Primary="primary",e.Secondary="secondary",e.Outline="outline",e.PrimaryF="primaryf",e.Success="success",e.Danger="danger",e.None="none",e))(No||{}),Z0=(e=>(e.Default="default",e.Small="sm",e.Large="lg",e))(Z0||{});const J0=Nl("font-regular flex items-center justify-center rounded-lg leading-none text-white ring-offset-background focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-0 focus-visible:outline-indigo-300 disabled:cursor-not-allowed disabled:bg-gray-300 disabled:bg-none disabled:text-gray-500 dark:disabled:text-gray-600",{variants:{variant:{primary:"ease bg-gradient-to-r from-indigo-600 from-5% to-purple-600 to-100% hover:from-indigo-600 hover:to-purple-700 dark:disabled:bg-gray-800 dark:disabled:bg-none",secondary:"border border-blue-600 bg-white/50 text-blue-700 hover:border-blue-700 hover:bg-slate-100 dark:border-slate-800 dark:bg-slate-900 dark:text-slate-200 dark:hover:border-slate-700",outline:"hover:text-accent-fore ground border border-input bg-white text-gray-900 hover:bg-accent dark:border-slate-800 dark:bg-slate-900 dark:text-slate-200 dark:hover:border-slate-700",primaryf:"border-input text-gray-900 hover:bg-accent hover:text-accent-foreground",success:"ease bg-green-600 hover:shadow-lg dark:disabled:bg-gray-800 dark:disabled:bg-none",danger:"ease bg-red-600 hover:shadow-lg dark:disabled:bg-gray-800 dark:disabled:bg-none",none:""},size:{default:"px-8 py-3 text-sm",sm:"px-8 py-1.5 text-sm",lg:"h-11 rounded-md px-8"}},defaultVariants:{variant:"primary",size:"default"}}),vf=(0,l.forwardRef)(({className:e,variant:t,size:n,asChild:r=!1,fullWidth:s=!1,...o},i)=>{const u=r?Qa:"button";return(0,a.jsx)(u,{className:st(J0({variant:t,size:n,className:e}),s&&"w-full"),ref:i,...o})});vf.displayName="Button";const mn=vf;function _h({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"}))}const su=l.forwardRef(_h);var Je=ln(8168);function gn(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e?.(s),n===!1||!s.defaultPrevented)return t?.(s)}}function ev(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function nc(...e){return t=>e.forEach(n=>ev(n,t))}function Lr(...e){return(0,l.useCallback)(nc(...e),e)}function Iu(e,t){const n=(0,l.createContext)(t);function r(o){const{children:i,...u}=o,p=(0,l.useMemo)(()=>u,Object.values(u));return(0,l.createElement)(n.Provider,{value:p},i)}function s(o){const i=(0,l.useContext)(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return r.displayName=e+"Provider",[r,s]}function va(e,t=[]){let n=[];function r(o,i){const u=(0,l.createContext)(i),p=n.length;n=[...n,i];function g(w){const{scope:x,children:E,...R}=w,k=x?.[e][p]||u,N=(0,l.useMemo)(()=>R,Object.values(R));return(0,l.createElement)(k.Provider,{value:N},E)}function v(w,x){const E=x?.[e][p]||u,R=(0,l.useContext)(E);if(R)return R;if(i!==void 0)return i;throw new Error(`\`${w}\` must be used within \`${o}\``)}return g.displayName=o+"Provider",[g,v]}const s=()=>{const o=n.map(i=>(0,l.createContext)(i));return function(u){const p=u?.[e]||o;return(0,l.useMemo)(()=>({[`__scope${e}`]:{...u,[e]:p}}),[u,p])}};return s.scopeName=e,[r,tv(s,...t)]}function tv(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const i=r.reduce((u,{useScope:p,scopeName:g})=>{const w=p(o)[`__scope${g}`];return{...u,...w}},{});return(0,l.useMemo)(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}const ya=Boolean(globalThis?.document)?l.useLayoutEffect:()=>{},Vy=se["useId".toString()]||(()=>{});let nv=0;function ri(e){const[t,n]=l.useState(Vy());return ya(()=>{e||n(r=>r??String(nv++))},[e]),e||(t?`radix-${t}`:"")}function Ao(e){const t=(0,l.useRef)(e);return(0,l.useEffect)(()=>{t.current=e}),(0,l.useMemo)(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function si({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,s]=rv({defaultProp:t,onChange:n}),o=e!==void 0,i=o?e:r,u=Ao(n),p=(0,l.useCallback)(g=>{if(o){const w=typeof g=="function"?g(e):g;w!==e&&u(w)}else s(g)},[o,e,s,u]);return[i,p]}function rv({defaultProp:e,onChange:t}){const n=(0,l.useState)(e),[r]=n,s=(0,l.useRef)(r),o=Ao(t);return(0,l.useEffect)(()=>{s.current!==r&&(o(r),s.current=r)},[r,s,o]),n}const fg=(0,l.forwardRef)((e,t)=>{const{children:n,...r}=e,s=l.Children.toArray(n),o=s.find(sv);if(o){const i=o.props.children,u=s.map(p=>p===o?l.Children.count(i)>1?l.Children.only(null):(0,l.isValidElement)(i)?i.props.children:null:p);return(0,l.createElement)(bf,(0,Je.A)({},r,{ref:t}),(0,l.isValidElement)(i)?(0,l.cloneElement)(i,void 0,u):null)}return(0,l.createElement)(bf,(0,Je.A)({},r,{ref:t}),n)});fg.displayName="Slot";const bf=(0,l.forwardRef)((e,t)=>{const{children:n,...r}=e;return(0,l.isValidElement)(n)?(0,l.cloneElement)(n,{...Wy(r,n.props),ref:t?nc(t,n.ref):n.ref}):l.Children.count(n)>1?l.Children.only(null):null});bf.displayName="SlotClone";const Hy=({children:e})=>(0,l.createElement)(l.Fragment,null,e);function sv(e){return(0,l.isValidElement)(e)&&e.type===Hy}function Wy(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...u)=>{o(...u),s(...u)}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}const Mc=null,zn=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,t)=>{const n=(0,l.forwardRef)((r,s)=>{const{asChild:o,...i}=r,u=o?fg:t;return(0,l.useEffect)(()=>{window[Symbol.for("radix-ui")]=!0},[]),(0,l.createElement)(u,(0,Je.A)({},i,{ref:s}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function lp(e,t){e&&(0,kt.flushSync)(()=>e.dispatchEvent(t))}const qy=null;function pg(e,t=globalThis?.document){const n=Ao(e);(0,l.useEffect)(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const av="DismissableLayer",ou="dismissableLayer.update",Sh="dismissableLayer.pointerDownOutside",Ch="dismissableLayer.focusOutside";let iv;const hg=(0,l.createContext)({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),wf=(0,l.forwardRef)((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:u,onDismiss:p,...g}=e,v=(0,l.useContext)(hg),[w,x]=(0,l.useState)(null),E=(n=w?.ownerDocument)!==null&&n!==void 0?n:globalThis?.document,[,R]=(0,l.useState)({}),k=Lr(t,Le=>x(Le)),N=Array.from(v.layers),[L]=[...v.layersWithOutsidePointerEventsDisabled].slice(-1),D=N.indexOf(L),B=w?N.indexOf(w):-1,Q=v.layersWithOutsidePointerEventsDisabled.size>0,ce=B>=D,ye=uv(Le=>{const We=Le.target,at=[...v.branches].some(St=>St.contains(We));!ce||at||(o?.(Le),u?.(Le),Le.defaultPrevented||p?.())},E),G=Ky(Le=>{const We=Le.target;[...v.branches].some(St=>St.contains(We))||(i?.(Le),u?.(Le),Le.defaultPrevented||p?.())},E);return pg(Le=>{B===v.layers.size-1&&(s?.(Le),!Le.defaultPrevented&&p&&(Le.preventDefault(),p()))},E),(0,l.useEffect)(()=>{if(w)return r&&(v.layersWithOutsidePointerEventsDisabled.size===0&&(iv=E.body.style.pointerEvents,E.body.style.pointerEvents="none"),v.layersWithOutsidePointerEventsDisabled.add(w)),v.layers.add(w),Ei(),()=>{r&&v.layersWithOutsidePointerEventsDisabled.size===1&&(E.body.style.pointerEvents=iv)}},[w,E,r,v]),(0,l.useEffect)(()=>()=>{w&&(v.layers.delete(w),v.layersWithOutsidePointerEventsDisabled.delete(w),Ei())},[w,v]),(0,l.useEffect)(()=>{const Le=()=>R({});return document.addEventListener(ou,Le),()=>document.removeEventListener(ou,Le)},[]),(0,l.createElement)(zn.div,(0,Je.A)({},g,{ref:k,style:{pointerEvents:Q?ce?"auto":"none":void 0,...e.style},onFocusCapture:gn(e.onFocusCapture,G.onFocusCapture),onBlurCapture:gn(e.onBlurCapture,G.onBlurCapture),onPointerDownCapture:gn(e.onPointerDownCapture,ye.onPointerDownCapture)}))}),lv="DismissableLayerBranch",cv=(0,l.forwardRef)((e,t)=>{const n=(0,l.useContext)(hg),r=(0,l.useRef)(null),s=Lr(t,r);return(0,l.useEffect)(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),(0,l.createElement)(zn.div,(0,Je.A)({},e,{ref:s}))});function uv(e,t=globalThis?.document){const n=Ao(e),r=(0,l.useRef)(!1),s=(0,l.useRef)(()=>{});return(0,l.useEffect)(()=>{const o=u=>{if(u.target&&!r.current){let g=function(){gi(Sh,n,p,{discrete:!0})};const p={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=g,t.addEventListener("click",s.current,{once:!0})):g()}else t.removeEventListener("click",s.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Ky(e,t=globalThis?.document){const n=Ao(e),r=(0,l.useRef)(!1);return(0,l.useEffect)(()=>{const s=o=>{o.target&&!r.current&&gi(Ch,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Ei(){const e=new CustomEvent(ou);document.dispatchEvent(e)}function gi(e,t,n,{discrete:r}){const s=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?lp(s,o):s.dispatchEvent(o)}const Gy=null,Qy=null,Eh="focusScope.autoFocusOnMount",Th="focusScope.autoFocusOnUnmount",mg={bubbles:!1,cancelable:!0},xf="FocusScope",_f=(0,l.forwardRef)((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...i}=e,[u,p]=(0,l.useState)(null),g=Ao(s),v=Ao(o),w=(0,l.useRef)(null),x=Lr(t,k=>p(k)),E=(0,l.useRef)({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;(0,l.useEffect)(()=>{if(r){let k=function(B){if(E.paused||!u)return;const Q=B.target;u.contains(Q)?w.current=Q:$c(w.current,{select:!0})},N=function(B){if(E.paused||!u)return;const Q=B.relatedTarget;Q!==null&&(u.contains(Q)||$c(w.current,{select:!0}))},L=function(B){if(document.activeElement===document.body)for(const ce of B)ce.removedNodes.length>0&&$c(u)};document.addEventListener("focusin",k),document.addEventListener("focusout",N);const D=new MutationObserver(L);return u&&D.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",k),document.removeEventListener("focusout",N),D.disconnect()}}},[r,u,E.paused]),(0,l.useEffect)(()=>{if(u){dp.add(E);const k=document.activeElement;if(!u.contains(k)){const L=new CustomEvent(Eh,mg);u.addEventListener(Eh,g),u.dispatchEvent(L),L.defaultPrevented||(cp(Ph(gg(u)),{select:!0}),document.activeElement===k&&$c(u))}return()=>{u.removeEventListener(Eh,g),setTimeout(()=>{const L=new CustomEvent(Th,mg);u.addEventListener(Th,v),u.dispatchEvent(L),L.defaultPrevented||$c(k??document.body,{select:!0}),u.removeEventListener(Th,v),dp.remove(E)},0)}}},[u,g,v,E]);const R=(0,l.useCallback)(k=>{if(!n&&!r||E.paused)return;const N=k.key==="Tab"&&!k.altKey&&!k.ctrlKey&&!k.metaKey,L=document.activeElement;if(N&&L){const D=k.currentTarget,[B,Q]=kh(D);B&&Q?!k.shiftKey&&L===Q?(k.preventDefault(),n&&$c(B,{select:!0})):k.shiftKey&&L===B&&(k.preventDefault(),n&&$c(Q,{select:!0})):L===D&&k.preventDefault()}},[n,r,E.paused]);return(0,l.createElement)(zn.div,(0,Je.A)({tabIndex:-1},i,{ref:x,onKeyDown:R}))});function cp(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if($c(r,{select:t}),document.activeElement!==n)return}function kh(e){const t=gg(e),n=up(t,e),r=up(t.reverse(),e);return[n,r]}function gg(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function up(e,t){for(const n of e)if(!Rh(n,{upTo:t}))return n}function Rh(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function dv(e){return e instanceof HTMLInputElement&&"select"in e}function $c(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&dv(e)&&t&&e.select()}}const dp=Yy();function Yy(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=vg(e,t),e.unshift(t)},remove(t){var n;e=vg(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function vg(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Ph(e){return e.filter(t=>t.tagName!=="A")}const yg=null,Sf="Portal",Wi=(0,l.forwardRef)((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...s}=e;return r?kt.createPortal((0,l.createElement)(zn.div,(0,Je.A)({},s,{ref:t})),r):null}),Qw=null;function fp(e,t){return(0,l.useReducer)((n,r)=>{const s=t[n][r];return s??n},e)}const la=e=>{const{present:t,children:n}=e,r=fv(t),s=typeof n=="function"?n({present:r.isPresent}):l.Children.only(n),o=Lr(r.ref,s.ref);return typeof n=="function"||r.isPresent?(0,l.cloneElement)(s,{ref:o}):null};la.displayName="Presence";function fv(e){const[t,n]=(0,l.useState)(),r=(0,l.useRef)({}),s=(0,l.useRef)(e),o=(0,l.useRef)("none"),i=e?"mounted":"unmounted",[u,p]=fp(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return(0,l.useEffect)(()=>{const g=pp(r.current);o.current=u==="mounted"?g:"none"},[u]),ya(()=>{const g=r.current,v=s.current;if(v!==e){const x=o.current,E=pp(g);e?p("MOUNT"):E==="none"||g?.display==="none"?p("UNMOUNT"):p(v&&x!==E?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,p]),ya(()=>{if(t){const g=w=>{const E=pp(r.current).includes(w.animationName);w.target===t&&E&&(0,kt.flushSync)(()=>p("ANIMATION_END"))},v=w=>{w.target===t&&(o.current=pp(r.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else p("ANIMATION_END")},[t,p]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:(0,l.useCallback)(g=>{g&&(r.current=getComputedStyle(g)),n(g)},[])}}function pp(e){return e?.animationName||"none"}let pd=0;function Ti(e){return hp(),e.children}function hp(){(0,l.useEffect)(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:pv()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:pv()),pd++,()=>{pd===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),pd--}},[])}function pv(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}const bg=null;var Ya=function(e,t){return Ya=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(n[s]=r[s])},Ya(e,t)};function Xy(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Ya(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Cn=function(){return Cn=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Cn.apply(this,arguments)};function Lc(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function wg(e,t,n,r){var s=arguments.length,o=s<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(i=e[u])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}function xg(e,t){return function(n,r){t(n,r,e)}}function Yw(e,t,n,r,s,o){function i(L){if(L!==void 0&&typeof L!="function")throw new TypeError("Function expected");return L}for(var u=r.kind,p=u==="getter"?"get":u==="setter"?"set":"value",g=!t&&e?r.static?e:e.prototype:null,v=t||(g?Object.getOwnPropertyDescriptor(g,r.name):{}),w,x=!1,E=n.length-1;E>=0;E--){var R={};for(var k in r)R[k]=k==="access"?{}:r[k];for(var k in r.access)R.access[k]=r.access[k];R.addInitializer=function(L){if(x)throw new TypeError("Cannot add initializers after decoration has completed");o.push(i(L||null))};var N=(0,n[E])(u==="accessor"?{get:v.get,set:v.set}:v[p],R);if(u==="accessor"){if(N===void 0)continue;if(N===null||typeof N!="object")throw new TypeError("Object expected");(w=i(N.get))&&(v.get=w),(w=i(N.set))&&(v.set=w),(w=i(N.init))&&s.unshift(w)}else(w=i(N))&&(u==="field"?s.unshift(w):v[p]=w)}g&&Object.defineProperty(g,r.name,v),x=!0}function Oh(e,t,n){for(var r=arguments.length>2,s=0;s<t.length;s++)n=r?t[s].call(e,n):t[s].call(e);return r?n:void 0}function _g(e){return typeof e=="symbol"?e:"".concat(e)}function hv(e,t,n){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})}function mv(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function qi(e,t,n,r){function s(o){return o instanceof n?o:new n(function(i){i(o)})}return new(n||(n=Promise))(function(o,i){function u(v){try{g(r.next(v))}catch(w){i(w)}}function p(v){try{g(r.throw(v))}catch(w){i(w)}}function g(v){v.done?o(v.value):s(v.value).then(u,p)}g((r=r.apply(e,t||[])).next())})}function ju(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,s,o,i;return i={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function u(g){return function(v){return p([g,v])}}function p(g){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,g[0]&&(n=0)),n;)try{if(r=1,s&&(o=g[0]&2?s.return:g[0]?s.throw||((o=s.return)&&o.call(s),0):s.next)&&!(o=o.call(s,g[1])).done)return o;switch(s=0,o&&(g=[g[0]&2,o.value]),g[0]){case 0:case 1:o=g;break;case 4:return n.label++,{value:g[1],done:!1};case 5:n.label++,s=g[1],g=[0];continue;case 7:g=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(g[0]===6||g[0]===2)){n=0;continue}if(g[0]===3&&(!o||g[1]>o[0]&&g[1]<o[3])){n.label=g[1];break}if(g[0]===6&&n.label<o[1]){n.label=o[1],o=g;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(g);break}o[2]&&n.ops.pop(),n.trys.pop();continue}g=t.call(e,n)}catch(v){g=[6,v],s=0}finally{r=o=0}if(g[0]&5)throw g[1];return{value:g[0]?g[1]:void 0,done:!0}}}var Nh=Object.create?function(e,t,n,r){r===void 0&&(r=n);var s=Object.getOwnPropertyDescriptor(t,n);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,s)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]};function Sg(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&Nh(t,e,n)}function Fa(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ki(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),s,o=[],i;try{for(;(t===void 0||t-- >0)&&!(s=r.next()).done;)o.push(s.value)}catch(u){i={error:u}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return o}function Du(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Ki(arguments[t]));return e}function gv(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),s=0,t=0;t<n;t++)for(var o=arguments[t],i=0,u=o.length;i<u;i++,s++)r[s]=o[i];return r}function hd(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,o;r<s;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}function ki(e){return this instanceof ki?(this.v=e,this):new ki(e)}function Cg(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(e,t||[]),s,o=[];return s={},i("next"),i("throw"),i("return"),s[Symbol.asyncIterator]=function(){return this},s;function i(x){r[x]&&(s[x]=function(E){return new Promise(function(R,k){o.push([x,E,R,k])>1||u(x,E)})})}function u(x,E){try{p(r[x](E))}catch(R){w(o[0][3],R)}}function p(x){x.value instanceof ki?Promise.resolve(x.value.v).then(g,v):w(o[0][2],x)}function g(x){u("next",x)}function v(x){u("throw",x)}function w(x,E){x(E),o.shift(),o.length&&u(o[0][0],o[0][1])}}function Fc(e){var t,n;return t={},r("next"),r("throw",function(s){throw s}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(s,o){t[s]=e[s]?function(i){return(n=!n)?{value:ki(e[s](i)),done:!1}:o?o(i):i}:o}}function Zy(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof Fa=="function"?Fa(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(o){n[o]=e[o]&&function(i){return new Promise(function(u,p){i=e[o](i),s(u,p,i.done,i.value)})}}function s(o,i,u,p){Promise.resolve(p).then(function(g){o({value:g,done:u})},i)}}function vv(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var Eg=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function yv(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&Nh(t,e,n);return Eg(t,e),t}function Tg(e){return e&&e.__esModule?e:{default:e}}function bv(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)}function mp(e,t,n,r,s){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?s.call(e,n):s?s.value=n:t.set(e,n),n}function Ah(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function ul(e,t,n){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var r;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=t[Symbol.asyncDispose]}if(r===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=t[Symbol.dispose]}if(typeof r!="function")throw new TypeError("Object not disposable.");e.stack.push({value:t,dispose:r,async:n})}else n&&e.stack.push({async:!0});return t}var Xs=typeof SuppressedError=="function"?SuppressedError:function(e,t,n){var r=new Error(n);return r.name="SuppressedError",r.error=e,r.suppressed=t,r};function Xa(e){function t(r){e.error=e.hasError?new Xs(r,e.error,"An error was suppressed during disposal."):r,e.hasError=!0}function n(){for(;e.stack.length;){var r=e.stack.pop();try{var s=r.dispose&&r.dispose.call(r.value);if(r.async)return Promise.resolve(s).then(n,function(o){return t(o),n()})}catch(o){t(o)}}if(e.hasError)throw e.error}return n()}const Pa={__extends:Xy,__assign:Cn,__rest:Lc,__decorate:wg,__param:xg,__metadata:mv,__awaiter:qi,__generator:ju,__createBinding:Nh,__exportStar:Sg,__values:Fa,__read:Ki,__spread:Du,__spreadArrays:gv,__spreadArray:hd,__await:ki,__asyncGenerator:Cg,__asyncDelegator:Fc,__asyncValues:Zy,__makeTemplateObject:vv,__importStar:yv,__importDefault:Tg,__classPrivateFieldGet:bv,__classPrivateFieldSet:mp,__classPrivateFieldIn:Ah,__addDisposableResource:ul,__disposeResources:Xa};var ca="right-scroll-bar-position",za="width-before-scroll-bar",Cf="with-scroll-bars-hidden",Oa="--removed-body-scroll-bar-size";function md(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function gd(e,t){var n=(0,l.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var Ih=typeof window<"u"?l.useLayoutEffect:l.useEffect,Ef=new WeakMap;function vd(e,t){var n=gd(t||null,function(r){return e.forEach(function(s){return md(s,r)})});return Ih(function(){var r=Ef.get(n);if(r){var s=new Set(r),o=new Set(e),i=n.current;s.forEach(function(u){o.has(u)||md(u,null)}),o.forEach(function(u){s.has(u)||md(u,i)})}Ef.set(n,e)},[e]),n}function Ri(e){return e}function jh(e,t){t===void 0&&(t=Ri);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var i=t(o,r);return n.push(i),function(){n=n.filter(function(u){return u!==i})}},assignSyncMedium:function(o){for(r=!0;n.length;){var i=n;n=[],i.forEach(o)}n={push:function(u){return o(u)},filter:function(){return n}}},assignMedium:function(o){r=!0;var i=[];if(n.length){var u=n;n=[],u.forEach(o),i=n}var p=function(){var v=i;i=[],v.forEach(o)},g=function(){return Promise.resolve().then(p)};g(),n={push:function(v){i.push(v),g()},filter:function(v){return i=i.filter(v),n}}}};return s}function gp(e,t){return t===void 0&&(t=Ri),jh(e,t)}function rc(e){e===void 0&&(e={});var t=jh(null);return t.options=Cn({async:!0,ssr:!1},e),t}var vp=rc(),yp=function(){},sc=l.forwardRef(function(e,t){var n=l.useRef(null),r=l.useState({onScrollCapture:yp,onWheelCapture:yp,onTouchMoveCapture:yp}),s=r[0],o=r[1],i=e.forwardProps,u=e.children,p=e.className,g=e.removeScrollBar,v=e.enabled,w=e.shards,x=e.sideCar,E=e.noIsolation,R=e.inert,k=e.allowPinchZoom,N=e.as,L=N===void 0?"div":N,D=Lc(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),B=x,Q=vd([n,t]),ce=Cn(Cn({},D),s);return l.createElement(l.Fragment,null,v&&l.createElement(B,{sideCar:vp,removeScrollBar:g,shards:w,noIsolation:E,inert:R,setCallbacks:o,allowPinchZoom:!!k,lockRef:n}),i?l.cloneElement(l.Children.only(u),Cn(Cn({},ce),{ref:Q})):l.createElement(L,Cn({},ce,{className:p,ref:Q}),u))});sc.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},sc.classNames={fullWidth:za,zeroRight:ca};var bp=function(e){var t=e.sideCar,n=Lc(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return l.createElement(r,Cn({},n))};bp.isSideCarExport=!0;function zc(e,t){return e.useMedium(t),bp}var Tf,Dh=function(e){Tf=e},kg=function(){return Tf||ln.nc};function Al(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=kg();return t&&e.setAttribute("nonce",t),e}function Uc(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function oi(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Mu=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Al())&&(Uc(t,n),oi(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},oc=function(){var e=Mu();return function(t,n){l.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Ko=function(){var e=oc(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},kf={left:0,top:0,right:0,gap:0},yd=function(e){return parseInt(e||"",10)||0},Mh=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[yd(n),yd(r),yd(s)]},wv=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return kf;var t=Mh(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},$u=Ko(),bd="data-scroll-locked",Rg=function(e,t,n,r){var s=e.left,o=e.top,i=e.right,u=e.gap;return n===void 0&&(n="margin"),`
  .`.concat(Cf,` {
   overflow: hidden `).concat(r,`;
   padding-right: `).concat(u,"px ").concat(r,`;
  }
  body[`).concat(bd,`] {
    overflow: hidden `).concat(r,`;
    overscroll-behavior: contain;
    `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
    padding-left: `.concat(s,`px;
    padding-top: `).concat(o,`px;
    padding-right: `).concat(i,`px;
    margin-left:0;
    margin-top:0;
    margin-right: `).concat(u,"px ").concat(r,`;
    `),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
  }
  
  .`).concat(ca,` {
    right: `).concat(u,"px ").concat(r,`;
  }
  
  .`).concat(za,` {
    margin-right: `).concat(u,"px ").concat(r,`;
  }
  
  .`).concat(ca," .").concat(ca,` {
    right: 0 `).concat(r,`;
  }
  
  .`).concat(za," .").concat(za,` {
    margin-right: 0 `).concat(r,`;
  }
  
  body[`).concat(bd,`] {
    `).concat(Oa,": ").concat(u,`px;
  }
`)},Lu=function(){var e=parseInt(document.body.getAttribute(bd)||"0",10);return isFinite(e)?e:0},Pg=function(){l.useEffect(function(){return document.body.setAttribute(bd,(Lu()+1).toString()),function(){var e=Lu()-1;e<=0?document.body.removeAttribute(bd):document.body.setAttribute(bd,e.toString())}},[])},Bc=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;Pg();var o=l.useMemo(function(){return wv(s)},[s]);return l.createElement($u,{styles:Rg(o,!t,s,n?"":"!important")})},$h=!1;if(typeof window<"u")try{var wp=Object.defineProperty({},"passive",{get:function(){return $h=!0,!0}});window.addEventListener("test",wp,wp),window.removeEventListener("test",wp,wp)}catch{$h=!1}var Fu=$h?{passive:!1}:!1,Lh=function(e){return e.tagName==="TEXTAREA"},xv=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Lh(e)&&n[t]==="visible")},Jy=function(e){return xv(e,"overflowY")},_v=function(e){return xv(e,"overflowX")},Il=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=ai(e,n);if(r){var s=Fh(e,n),o=s[1],i=s[2];if(o>i)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},dl=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},au=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},ai=function(e,t){return e==="v"?Jy(t):_v(t)},Fh=function(e,t){return e==="v"?dl(t):au(t)},yo=function(e,t){return e==="h"&&t==="rtl"?-1:1},Fs=function(e,t,n,r,s){var o=yo(e,window.getComputedStyle(t).direction),i=o*r,u=n.target,p=t.contains(u),g=!1,v=i>0,w=0,x=0;do{var E=Fh(e,u),R=E[0],k=E[1],N=E[2],L=k-N-o*R;(R||L)&&ai(e,u)&&(w+=L,x+=R),u=u.parentNode}while(!p&&u!==document.body||p&&(t.contains(u)||t===u));return(v&&(s&&w===0||!s&&i>w)||!v&&(s&&x===0||!s&&-i>x))&&(g=!0),g},wd=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Sv=function(e){return[e.deltaX,e.deltaY]},Cv=function(e){return e&&"current"in e?e.current:e},Ev=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Og=function(e){return`
  .block-interactivity-`.concat(e,` {pointer-events: none;}
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},eb=0,ii=[];function Ng(e){var t=l.useRef([]),n=l.useRef([0,0]),r=l.useRef(),s=l.useState(eb++)[0],o=l.useState(function(){return Ko()})[0],i=l.useRef(e);l.useEffect(function(){i.current=e},[e]),l.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var k=hd([e.lockRef.current],(e.shards||[]).map(Cv),!0).filter(Boolean);return k.forEach(function(N){return N.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),k.forEach(function(N){return N.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var u=l.useCallback(function(k,N){if("touches"in k&&k.touches.length===2)return!i.current.allowPinchZoom;var L=wd(k),D=n.current,B="deltaX"in k?k.deltaX:D[0]-L[0],Q="deltaY"in k?k.deltaY:D[1]-L[1],ce,ye=k.target,G=Math.abs(B)>Math.abs(Q)?"h":"v";if("touches"in k&&G==="h"&&ye.type==="range")return!1;var Le=Il(G,ye);if(!Le)return!0;if(Le?ce=G:(ce=G==="v"?"h":"v",Le=Il(G,ye)),!Le)return!1;if(!r.current&&"changedTouches"in k&&(B||Q)&&(r.current=ce),!ce)return!0;var We=r.current||ce;return Fs(We,N,k,We==="h"?B:Q,!0)},[]),p=l.useCallback(function(k){var N=k;if(!(!ii.length||ii[ii.length-1]!==o)){var L="deltaY"in N?Sv(N):wd(N),D=t.current.filter(function(ce){return ce.name===N.type&&ce.target===N.target&&Ev(ce.delta,L)})[0];if(D&&D.should){N.cancelable&&N.preventDefault();return}if(!D){var B=(i.current.shards||[]).map(Cv).filter(Boolean).filter(function(ce){return ce.contains(N.target)}),Q=B.length>0?u(N,B[0]):!i.current.noIsolation;Q&&N.cancelable&&N.preventDefault()}}},[]),g=l.useCallback(function(k,N,L,D){var B={name:k,delta:N,target:L,should:D};t.current.push(B),setTimeout(function(){t.current=t.current.filter(function(Q){return Q!==B})},1)},[]),v=l.useCallback(function(k){n.current=wd(k),r.current=void 0},[]),w=l.useCallback(function(k){g(k.type,Sv(k),k.target,u(k,e.lockRef.current))},[]),x=l.useCallback(function(k){g(k.type,wd(k),k.target,u(k,e.lockRef.current))},[]);l.useEffect(function(){return ii.push(o),e.setCallbacks({onScrollCapture:w,onWheelCapture:w,onTouchMoveCapture:x}),document.addEventListener("wheel",p,Fu),document.addEventListener("touchmove",p,Fu),document.addEventListener("touchstart",v,Fu),function(){ii=ii.filter(function(k){return k!==o}),document.removeEventListener("wheel",p,Fu),document.removeEventListener("touchmove",p,Fu),document.removeEventListener("touchstart",v,Fu)}},[]);var E=e.removeScrollBar,R=e.inert;return l.createElement(l.Fragment,null,R?l.createElement(o,{styles:Og(s)}):null,E?l.createElement(Bc,{gapMode:"margin"}):null)}const tb=zc(vp,Ng);var Pi=l.forwardRef(function(e,t){return l.createElement(sc,Cn({},e,{ref:t,sideCar:tb}))});Pi.classNames=sc.classNames;const xd=Pi;var zu=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},iu=new WeakMap,Rf=new WeakMap,Gi={},zh=0,xp=function(e){return e&&(e.host||xp(e.parentNode))},Uh=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=xp(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return Boolean(n)})},Bh=function(e,t,n,r){var s=Uh(t,Array.isArray(e)?e:[e]);Gi[n]||(Gi[n]=new WeakMap);var o=Gi[n],i=[],u=new Set,p=new Set(s),g=function(w){!w||u.has(w)||(u.add(w),g(w.parentNode))};s.forEach(g);var v=function(w){!w||p.has(w)||Array.prototype.forEach.call(w.children,function(x){if(u.has(x))v(x);else try{var E=x.getAttribute(r),R=E!==null&&E!=="false",k=(iu.get(x)||0)+1,N=(o.get(x)||0)+1;iu.set(x,k),o.set(x,N),i.push(x),k===1&&R&&Rf.set(x,!0),N===1&&x.setAttribute(n,"true"),R||x.setAttribute(r,"true")}catch(L){console.error("aria-hidden: cannot operate on ",x,L)}})};return v(t),u.clear(),zh++,function(){i.forEach(function(w){var x=iu.get(w)-1,E=o.get(w)-1;iu.set(w,x),o.set(w,E),x||(Rf.has(w)||w.removeAttribute(r),Rf.delete(w)),E||w.removeAttribute(n)}),zh--,zh||(iu=new WeakMap,iu=new WeakMap,Rf=new WeakMap,Gi={})}},Uu=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=t||zu(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live]"))),Bh(r,s,n,"aria-hidden")):function(){return null}},_p=function(e,t,n){n===void 0&&(n="data-inert-ed");var r=t||zu(e);return r?Bh(e,r,n,"inert"):function(){return null}},Vh=function(){return typeof HTMLElement<"u"&&HTMLElement.prototype.hasOwnProperty("inert")},Ag=function(e,t,n){return n===void 0&&(n="data-suppressed"),(Vh()?_p:Uu)(e,t,n)};const fl=(0,l.forwardRef)((e,t)=>{const{children:n,...r}=e,s=l.Children.toArray(n),o=s.find(jg);if(o){const i=o.props.children,u=s.map(p=>p===o?l.Children.count(i)>1?l.Children.only(null):(0,l.isValidElement)(i)?i.props.children:null:p);return(0,l.createElement)(Ig,(0,Je.A)({},r,{ref:t}),(0,l.isValidElement)(i)?(0,l.cloneElement)(i,void 0,u):null)}return(0,l.createElement)(Ig,(0,Je.A)({},r,{ref:t}),n)});fl.displayName="Slot";const Ig=(0,l.forwardRef)((e,t)=>{const{children:n,...r}=e;return(0,l.isValidElement)(n)?(0,l.cloneElement)(n,{...Pf(r,n.props),ref:t?nc(t,n.ref):n.ref}):l.Children.count(n)>1?l.Children.only(null):null});Ig.displayName="SlotClone";const Oi=({children:e})=>(0,l.createElement)(l.Fragment,null,e);function jg(e){return(0,l.isValidElement)(e)&&e.type===Oi}function Pf(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...u)=>{o(...u),s(...u)}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}const Tv=null,Of="Dialog",[Dg,Xw]=va(Of),[Hh,ac]=Dg(Of),_d=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:o,modal:i=!0}=e,u=(0,l.useRef)(null),p=(0,l.useRef)(null),[g=!1,v]=si({prop:r,defaultProp:s,onChange:o});return(0,l.createElement)(Hh,{scope:t,triggerRef:u,contentRef:p,contentId:ri(),titleId:ri(),descriptionId:ri(),open:g,onOpenChange:v,onOpenToggle:(0,l.useCallback)(()=>v(w=>!w),[v]),modal:i},n)},Mg="DialogTrigger",Nf=(0,l.forwardRef)((e,t)=>{const{__scopeDialog:n,...r}=e,s=ac(Mg,n),o=Lr(t,s.triggerRef);return(0,l.createElement)(zn.button,(0,Je.A)({type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":nt(s.open)},r,{ref:o,onClick:gn(e.onClick,s.onOpenToggle)}))}),c="DialogPortal",[f,y]=Dg(c,{forceMount:void 0}),C=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,o=ac(c,t);return(0,l.createElement)(f,{scope:t,forceMount:n},l.Children.map(r,i=>(0,l.createElement)(la,{present:n||o.open},(0,l.createElement)(Wi,{asChild:!0,container:s},i))))},O="DialogOverlay",F=(0,l.forwardRef)((e,t)=>{const n=y(O,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=ac(O,e.__scopeDialog);return o.modal?(0,l.createElement)(la,{present:r||o.open},(0,l.createElement)(de,(0,Je.A)({},s,{ref:t}))):null}),de=(0,l.forwardRef)((e,t)=>{const{__scopeDialog:n,...r}=e,s=ac(O,n);return(0,l.createElement)(xd,{as:fl,allowPinchZoom:!0,shards:[s.contentRef]},(0,l.createElement)(zn.div,(0,Je.A)({"data-state":nt(s.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),Fe="DialogContent",Ye=(0,l.forwardRef)((e,t)=>{const n=y(Fe,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=ac(Fe,e.__scopeDialog);return(0,l.createElement)(la,{present:r||o.open},o.modal?(0,l.createElement)(Ot,(0,Je.A)({},s,{ref:t})):(0,l.createElement)(dn,(0,Je.A)({},s,{ref:t})))}),Ot=(0,l.forwardRef)((e,t)=>{const n=ac(Fe,e.__scopeDialog),r=(0,l.useRef)(null),s=Lr(t,n.contentRef,r);return(0,l.useEffect)(()=>{const o=r.current;if(o)return Uu(o)},[]),(0,l.createElement)(pn,(0,Je.A)({},e,{ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:gn(e.onCloseAutoFocus,o=>{var i;o.preventDefault(),(i=n.triggerRef.current)===null||i===void 0||i.focus()}),onPointerDownOutside:gn(e.onPointerDownOutside,o=>{const i=o.detail.originalEvent,u=i.button===0&&i.ctrlKey===!0;(i.button===2||u)&&o.preventDefault()}),onFocusOutside:gn(e.onFocusOutside,o=>o.preventDefault())}))}),dn=(0,l.forwardRef)((e,t)=>{const n=ac(Fe,e.__scopeDialog),r=(0,l.useRef)(!1),s=(0,l.useRef)(!1);return(0,l.createElement)(pn,(0,Je.A)({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var i;if((i=e.onCloseAutoFocus)===null||i===void 0||i.call(e,o),!o.defaultPrevented){var u;r.current||(u=n.triggerRef.current)===null||u===void 0||u.focus(),o.preventDefault()}r.current=!1,s.current=!1},onInteractOutside:o=>{var i,u;(i=e.onInteractOutside)===null||i===void 0||i.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const p=o.target;((u=n.triggerRef.current)===null||u===void 0?void 0:u.contains(p))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}}))}),pn=(0,l.forwardRef)((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,...i}=e,u=ac(Fe,n),p=(0,l.useRef)(null),g=Lr(t,p);return hp(),(0,l.createElement)(l.Fragment,null,(0,l.createElement)(_f,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o},(0,l.createElement)(wf,(0,Je.A)({role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":nt(u.open)},i,{ref:g,onDismiss:()=>u.onOpenChange(!1)}))),!1)}),on="DialogTitle",Zn=(0,l.forwardRef)((e,t)=>{const{__scopeDialog:n,...r}=e,s=ac(on,n);return(0,l.createElement)(zn.h2,(0,Je.A)({id:s.titleId},r,{ref:t}))}),dr="DialogDescription",hr=(0,l.forwardRef)((e,t)=>{const{__scopeDialog:n,...r}=e,s=ac(dr,n);return(0,l.createElement)(zn.p,(0,Je.A)({id:s.descriptionId},r,{ref:t}))}),ua="DialogClose",wt=(0,l.forwardRef)((e,t)=>{const{__scopeDialog:n,...r}=e,s=ac(ua,n);return(0,l.createElement)(zn.button,(0,Je.A)({type:"button"},r,{ref:t,onClick:gn(e.onClick,()=>s.onOpenChange(!1))}))});function nt(e){return e?"open":"closed"}const Et="DialogTitleWarning",[vn,yr]=Iu(Et,{contentName:Fe,titleName:on,docsSlug:"dialog"}),Qr=({titleId:e})=>{const t=yr(Et),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.

If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.

For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return $67UHm$useEffect(()=>{if(e&&!document.getElementById(e))throw new Error(n)},[n,e]),null},Wr="DialogDescriptionWarning",as=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${yr(Wr).contentName}}.`;return $67UHm$useEffect(()=>{var s;const o=(s=e.current)===null||s===void 0?void 0:s.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Ua=_d,eo=Nf,ic=C,Wh=F,kv=Ye,jl=Zn,$g=hr,Zw=wt,Rv=Ua,Jw=({className:e,children:t,...n})=>(0,a.jsx)(ic,{...n,children:(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:t})});Jw.displayName=ic.displayName;const nb=(0,l.forwardRef)(({className:e,...t},n)=>(0,a.jsx)(Wh,{ref:n,className:st("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm transition-all duration-100 data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=open]:fade-in",e),...t}));nb.displayName=Wh.displayName;const Pv=(0,l.forwardRef)(({className:e,children:t,...n},r)=>(0,a.jsxs)(Jw,{children:[(0,a.jsx)(nb,{}),(0,a.jsxs)(kv,{ref:r,className:st("fixed z-50 grid w-11/12 sm:w-full gap-8 rounded-b-lg border dark:border-slate-800 bg-background p-6 shadow-lg animate-in data-[state=open]:fade-in-90 data-[state=open]:slide-in-from-bottom-10 sm:max-w-lg sm:rounded-lg sm:zoom-in-90 data-[state=open]:sm:slide-in-from-bottom-0",e),...n,children:[t,(0,a.jsxs)(Zw,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground dark:text-gray-100",children:[(0,a.jsx)(su,{className:"h-4 w-4"}),(0,a.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));Pv.displayName=kv.displayName;const rb=({className:e,...t})=>(0,a.jsx)("div",{className:st("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});rb.displayName="DialogHeader";const Ov=({className:e,...t})=>(0,a.jsx)("div",{className:st("flex flex-col justify-between space-y-4 sm:space-y-0 sm:flex-col-reverse sm:flex-row sm:justify-end sm:space-x-4",e),...t});Ov.displayName="DialogFooter";const Nv=(0,l.forwardRef)(({className:e,...t},n)=>(0,a.jsx)(jl,{ref:n,className:st("text-lg font-semibold leading-none tracking-tight dark:text-slate-200",e),...t}));Nv.displayName=jl.displayName;const Av=(0,l.forwardRef)(({className:e,...t},n)=>(0,a.jsx)($g,{ref:n,className:st("text-sm text-muted-foreground dark:text-slate-200",e),...t}));Av.displayName=$g.displayName;const Vc=({open:e=!1,onClose:t,onConfirm:n,onCancel:r,title:s,cancelButtonText:o,confirmButtonText:i,children:u,destructive:p,className:g})=>{const v=()=>{t?.()},w=async()=>{await n?.(),t?.()},x=()=>{t?.(),r?.()};return(0,a.jsx)(Rv,{open:e,onOpenChange:v,children:(0,a.jsxs)(Pv,{className:g??"",children:[s&&(0,a.jsx)(rb,{children:(0,a.jsx)(Nv,{children:s})}),u&&(0,a.jsx)(Av,{asChild:!0,"data-testid":"dialogDescriptionContent",children:(0,a.jsx)("div",{className:"text-slate-900",children:u})}),(0,a.jsxs)(Ov,{children:[o?(0,a.jsx)(mn,{"data-testid":"dialogBtnCancel",onClick:x,size:"sm",variant:No.Outline,children:o}):null,i?(0,a.jsx)(mn,{onClick:async()=>{await w()},size:"sm","data-testid":"dialogBtnConfirm",variant:No.Primary,className:st(p&&"bg-none bg-red-600 hover:bg-red-500"),children:i}):null]})]})})},ex=(0,l.createContext)(null),tx=({children:e})=>{const{t}=(0,z.Bd)(),[n,r]=(0,l.useState)(null),[s,o]=(0,l.useState)(!1),i=(0,l.useCallback)(v=>{r(v),o(!0)},[o]),u=(0,l.useCallback)(()=>{n?.onConfirm?.(),o(!1)},[n]),p=(0,l.useCallback)(()=>{n?.onCancel?.(),o(!1)},[n]),g=(0,l.useMemo)(()=>({show:i}),[i]);return(0,a.jsxs)(ex.Provider,{value:g,children:[(0,a.jsx)(Vc,{open:s,onClose:p,onConfirm:u,title:n?.title??t("core:actions.discardChanges"),confirmButtonText:n?.confirmButtonText??t("core:actions.confirm"),cancelButtonText:n?.cancelButtonText??t("core:actions.cancel"),children:n?.children}),e]})},s1=()=>{const e=(0,l.useContext)(ex);if(!e)throw new Error("usePrompt must be used within a PromptProvider");return e},Af=({isDirty:e=!1,title:t,confirmButtonText:n,cancelButtonText:r,onConfirm:s,onCancel:o,children:i})=>{const{t:u}=(0,z.Bd)(),p=Gd(e),g=i??u("core:prompt.unSavedChangesMessage"),{show:v}=s1(),w=(0,l.useCallback)(async()=>e?await new Promise(x=>{v({title:t,confirmButtonText:n,cancelButtonText:r,children:g,onConfirm:()=>{x(!0),s?.()},onCancel:()=>{x(!1),o?.()}})}):await Promise.resolve(!0),[e,v]);return(0,l.useEffect)(()=>{p.state==="blocked"&&e&&w().then(x=>{if(x){p.proceed();return}p.reset()})},[p,w,e]),(0,l.useEffect)(()=>(e&&(window.onbeforeunload=()=>t??g),()=>{window.onbeforeunload=null}),[e,t,g]),{confirm:w}},o1=(e,t)=>{try{if(!ie.L)return;ie.L.addError(e,t)}catch(n){console.error(n)}},oP=()=>actions.sendDatadogError;class a1 extends l.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t,n){o1(t,n),console.error(t,n)}render(){return this.state.hasError?(0,a.jsx)(a.Fragment,{children:this.props.fallback}):this.props.children}}const sb=a1;class lc{static write(t){return`${t}${lc.RecordSeparator}`}static parse(t){if(t[t.length-1]!==lc.RecordSeparator)throw new Error("Message is incomplete.");const n=t.split(lc.RecordSeparator);return n.pop(),n}}lc.RecordSeparatorCode=30,lc.RecordSeparator=String.fromCharCode(lc.RecordSeparatorCode);var Yt;(function(e){e[e.Trace=0]="Trace",e[e.Debug=1]="Debug",e[e.Information=2]="Information",e[e.Warning=3]="Warning",e[e.Error=4]="Error",e[e.Critical=5]="Critical",e[e.None=6]="None"})(Yt||(Yt={}));class Lg{constructor(){}log(t,n){}}Lg.instance=new Lg;const i1="8.0.7";class Za{static isRequired(t,n){if(t==null)throw new Error(`The '${n}' argument is required.`)}static isNotEmpty(t,n){if(!t||t.match(/^\s*$/))throw new Error(`The '${n}' argument should not be empty.`)}static isIn(t,n,r){if(!(t in n))throw new Error(`Unknown ${r} value: ${t}.`)}}class ba{static get isBrowser(){return!ba.isNode&&typeof window=="object"&&typeof window.document=="object"}static get isWebWorker(){return!ba.isNode&&typeof self=="object"&&"importScripts"in self}static get isReactNative(){return!ba.isNode&&typeof window=="object"&&typeof window.document>"u"}static get isNode(){return typeof process<"u"&&process.release&&process.release.name==="node"}}function Fg(e,t){let n="";return Na(e)?(n=`Binary data of length ${e.byteLength}`,t&&(n+=`. Content: '${l1(e)}'`)):typeof e=="string"&&(n=`String data of length ${e.length}`,t&&(n+=`. Content: '${e}'`)),n}function l1(e){const t=new Uint8Array(e);let n="";return t.forEach(r=>{const s=r<16?"0":"";n+=`0x${s}${r.toString(16)} `}),n.substr(0,n.length-1)}function Na(e){return e&&typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||e.constructor&&e.constructor.name==="ArrayBuffer")}async function nx(e,t,n,r,s,o){const i={},[u,p]=qh();i[u]=p,e.log(Yt.Trace,`(${t} transport) sending data. ${Fg(s,o.logMessageContent)}.`);const g=Na(s)?"arraybuffer":"text",v=await n.post(r,{content:s,headers:{...i,...o.headers},responseType:g,timeout:o.timeout,withCredentials:o.withCredentials});e.log(Yt.Trace,`(${t} transport) request complete. Response status: ${v.statusCode}.`)}function c1(e){return e===void 0?new Iv(Yt.Information):e===null?Lg.instance:e.log!==void 0?e:new Iv(e)}class u1{constructor(t,n){this._subject=t,this._observer=n}dispose(){const t=this._subject.observers.indexOf(this._observer);t>-1&&this._subject.observers.splice(t,1),this._subject.observers.length===0&&this._subject.cancelCallback&&this._subject.cancelCallback().catch(n=>{})}}class Iv{constructor(t){this._minLevel=t,this.out=console}log(t,n){if(t>=this._minLevel){const r=`[${new Date().toISOString()}] ${Yt[t]}: ${n}`;switch(t){case Yt.Critical:case Yt.Error:this.out.error(r);break;case Yt.Warning:this.out.warn(r);break;case Yt.Information:this.out.info(r);break;default:this.out.log(r);break}}}}function qh(){let e="X-SignalR-User-Agent";return ba.isNode&&(e="User-Agent"),[e,aP(i1,jv(),f1(),d1())]}function aP(e,t,n,r){let s="Microsoft SignalR/";const o=e.split(".");return s+=`${o[0]}.${o[1]}`,s+=` (${e}; `,t&&t!==""?s+=`${t}; `:s+="Unknown OS; ",s+=`${n}`,r?s+=`; ${r}`:s+="; Unknown Runtime Version",s+=")",s}function jv(){if(ba.isNode)switch(process.platform){case"win32":return"Windows NT";case"darwin":return"macOS";case"linux":return"Linux";default:return process.platform}else return""}function d1(){if(ba.isNode)return process.versions.node}function f1(){return ba.isNode?"NodeJS":"Browser"}function ob(e){return e.stack?e.stack:e.message?e.message:`${e}`}function ab(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof ln.g<"u")return ln.g;throw new Error("could not find global")}class p1{writeHandshakeRequest(t){return lc.write(JSON.stringify(t))}parseHandshakeResponse(t){let n,r;if(Na(t)){const u=new Uint8Array(t),p=u.indexOf(lc.RecordSeparatorCode);if(p===-1)throw new Error("Message is incomplete.");const g=p+1;n=String.fromCharCode.apply(null,Array.prototype.slice.call(u.slice(0,g))),r=u.byteLength>g?u.slice(g).buffer:null}else{const u=t,p=u.indexOf(lc.RecordSeparator);if(p===-1)throw new Error("Message is incomplete.");const g=p+1;n=u.substring(0,g),r=u.length>g?u.substring(g):null}const s=lc.parse(n),o=JSON.parse(s[0]);if(o.type)throw new Error("Expected a handshake response from the server.");return[r,o]}}class Sp extends Error{constructor(t,n){const r=new.target.prototype;super(`${t}: Status code '${n}'`),this.statusCode=n,this.__proto__=r}}class ib extends Error{constructor(t="A timeout occurred."){const n=new.target.prototype;super(t),this.__proto__=n}}class Bu extends Error{constructor(t="An abort occurred."){const n=new.target.prototype;super(t),this.__proto__=n}}class h1 extends Error{constructor(t,n){const r=new.target.prototype;super(t),this.transport=n,this.errorType="UnsupportedTransportError",this.__proto__=r}}class rx extends Error{constructor(t,n){const r=new.target.prototype;super(t),this.transport=n,this.errorType="DisabledTransportError",this.__proto__=r}}class m1 extends Error{constructor(t,n){const r=new.target.prototype;super(t),this.transport=n,this.errorType="FailedToStartTransportError",this.__proto__=r}}class sx extends Error{constructor(t){const n=new.target.prototype;super(t),this.errorType="FailedToNegotiateWithServerError",this.__proto__=n}}class g1 extends Error{constructor(t,n){const r=new.target.prototype;super(t),this.innerErrors=n,this.__proto__=r}}var Ps;(function(e){e[e.Invocation=1]="Invocation",e[e.StreamItem=2]="StreamItem",e[e.Completion=3]="Completion",e[e.StreamInvocation=4]="StreamInvocation",e[e.CancelInvocation=5]="CancelInvocation",e[e.Ping=6]="Ping",e[e.Close=7]="Close",e[e.Ack=8]="Ack",e[e.Sequence=9]="Sequence"})(Ps||(Ps={}));class ox{constructor(){this.observers=[]}next(t){for(const n of this.observers)n.next(t)}error(t){for(const n of this.observers)n.error&&n.error(t)}complete(){for(const t of this.observers)t.complete&&t.complete()}subscribe(t){return this.observers.push(t),new u1(this,t)}}class ea{constructor(t,n,r){this._bufferSize=1e5,this._messages=[],this._totalMessageCount=0,this._waitForSequenceMessage=!1,this._nextReceivingSequenceId=1,this._latestReceivedSequenceId=0,this._bufferedByteCount=0,this._reconnectInProgress=!1,this._protocol=t,this._connection=n,this._bufferSize=r}async _send(t){const n=this._protocol.writeMessage(t);let r=Promise.resolve();if(this._isInvocationMessage(t)){this._totalMessageCount++;let s=()=>{},o=()=>{};Na(n)?this._bufferedByteCount+=n.byteLength:this._bufferedByteCount+=n.length,this._bufferedByteCount>=this._bufferSize&&(r=new Promise((i,u)=>{s=i,o=u})),this._messages.push(new v1(n,this._totalMessageCount,s,o))}try{this._reconnectInProgress||await this._connection.send(n)}catch{this._disconnected()}await r}_ack(t){let n=-1;for(let r=0;r<this._messages.length;r++){const s=this._messages[r];if(s._id<=t.sequenceId)n=r,Na(s._message)?this._bufferedByteCount-=s._message.byteLength:this._bufferedByteCount-=s._message.length,s._resolver();else if(this._bufferedByteCount<this._bufferSize)s._resolver();else break}n!==-1&&(this._messages=this._messages.slice(n+1))}_shouldProcessMessage(t){if(this._waitForSequenceMessage)return t.type!==Ps.Sequence?!1:(this._waitForSequenceMessage=!1,!0);if(!this._isInvocationMessage(t))return!0;const n=this._nextReceivingSequenceId;return this._nextReceivingSequenceId++,n<=this._latestReceivedSequenceId?(n===this._latestReceivedSequenceId&&this._ackTimer(),!1):(this._latestReceivedSequenceId=n,this._ackTimer(),!0)}_resetSequence(t){if(t.sequenceId>this._nextReceivingSequenceId){this._connection.stop(new Error("Sequence ID greater than amount of messages we've received."));return}this._nextReceivingSequenceId=t.sequenceId}_disconnected(){this._reconnectInProgress=!0,this._waitForSequenceMessage=!0}async _resend(){const t=this._messages.length!==0?this._messages[0]._id:this._totalMessageCount+1;await this._connection.send(this._protocol.writeMessage({type:Ps.Sequence,sequenceId:t}));const n=this._messages;for(const r of n)await this._connection.send(r._message);this._reconnectInProgress=!1}_dispose(t){t??(t=new Error("Unable to reconnect to server."));for(const n of this._messages)n._rejector(t)}_isInvocationMessage(t){switch(t.type){case Ps.Invocation:case Ps.StreamItem:case Ps.Completion:case Ps.StreamInvocation:case Ps.CancelInvocation:return!0;case Ps.Close:case Ps.Sequence:case Ps.Ping:case Ps.Ack:return!1}}_ackTimer(){this._ackTimerHandle===void 0&&(this._ackTimerHandle=setTimeout(async()=>{try{this._reconnectInProgress||await this._connection.send(this._protocol.writeMessage({type:Ps.Ack,sequenceId:this._latestReceivedSequenceId}))}catch{}clearTimeout(this._ackTimerHandle),this._ackTimerHandle=void 0},1e3))}}class v1{constructor(t,n,r,s){this._message=t,this._id=n,this._resolver=r,this._rejector=s}}const iP=30*1e3,ax=15*1e3,y1=1e5;var ta;(function(e){e.Disconnected="Disconnected",e.Connecting="Connecting",e.Connected="Connected",e.Disconnecting="Disconnecting",e.Reconnecting="Reconnecting"})(ta||(ta={}));class lb{static create(t,n,r,s,o,i,u){return new lb(t,n,r,s,o,i,u)}constructor(t,n,r,s,o,i,u){this._nextKeepAlive=0,this._freezeEventListener=()=>{this._logger.log(Yt.Warning,"The page is being frozen, this will likely lead to the connection being closed and messages being lost. For more information see the docs at https://learn.microsoft.com/aspnet/core/signalr/javascript-client#bsleep")},Za.isRequired(t,"connection"),Za.isRequired(n,"logger"),Za.isRequired(r,"protocol"),this.serverTimeoutInMilliseconds=o??iP,this.keepAliveIntervalInMilliseconds=i??ax,this._statefulReconnectBufferSize=u??y1,this._logger=n,this._protocol=r,this.connection=t,this._reconnectPolicy=s,this._handshakeProtocol=new p1,this.connection.onreceive=p=>this._processIncomingData(p),this.connection.onclose=p=>this._connectionClosed(p),this._callbacks={},this._methods={},this._closedCallbacks=[],this._reconnectingCallbacks=[],this._reconnectedCallbacks=[],this._invocationId=0,this._receivedHandshakeResponse=!1,this._connectionState=ta.Disconnected,this._connectionStarted=!1,this._cachedPingMessage=this._protocol.writeMessage({type:Ps.Ping})}get state(){return this._connectionState}get connectionId(){return this.connection&&this.connection.connectionId||null}get baseUrl(){return this.connection.baseUrl||""}set baseUrl(t){if(this._connectionState!==ta.Disconnected&&this._connectionState!==ta.Reconnecting)throw new Error("The HubConnection must be in the Disconnected or Reconnecting state to change the url.");if(!t)throw new Error("The HubConnection url must be a valid url.");this.connection.baseUrl=t}start(){return this._startPromise=this._startWithStateTransitions(),this._startPromise}async _startWithStateTransitions(){if(this._connectionState!==ta.Disconnected)return Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."));this._connectionState=ta.Connecting,this._logger.log(Yt.Debug,"Starting HubConnection.");try{await this._startInternal(),ba.isBrowser&&window.document.addEventListener("freeze",this._freezeEventListener),this._connectionState=ta.Connected,this._connectionStarted=!0,this._logger.log(Yt.Debug,"HubConnection connected successfully.")}catch(t){return this._connectionState=ta.Disconnected,this._logger.log(Yt.Debug,`HubConnection failed to start successfully because of error '${t}'.`),Promise.reject(t)}}async _startInternal(){this._stopDuringStartError=void 0,this._receivedHandshakeResponse=!1;const t=new Promise((n,r)=>{this._handshakeResolver=n,this._handshakeRejecter=r});await this.connection.start(this._protocol.transferFormat);try{let n=this._protocol.version;this.connection.features.reconnect||(n=1);const r={protocol:this._protocol.name,version:n};if(this._logger.log(Yt.Debug,"Sending handshake request."),await this._sendMessage(this._handshakeProtocol.writeHandshakeRequest(r)),this._logger.log(Yt.Information,`Using HubProtocol '${this._protocol.name}'.`),this._cleanupTimeout(),this._resetTimeoutPeriod(),this._resetKeepAliveInterval(),await t,this._stopDuringStartError)throw this._stopDuringStartError;(this.connection.features.reconnect||!1)&&(this._messageBuffer=new ea(this._protocol,this.connection,this._statefulReconnectBufferSize),this.connection.features.disconnected=this._messageBuffer._disconnected.bind(this._messageBuffer),this.connection.features.resend=()=>{if(this._messageBuffer)return this._messageBuffer._resend()}),this.connection.features.inherentKeepAlive||await this._sendMessage(this._cachedPingMessage)}catch(n){throw this._logger.log(Yt.Debug,`Hub handshake failed with error '${n}' during start(). Stopping HubConnection.`),this._cleanupTimeout(),this._cleanupPingTimer(),await this.connection.stop(n),n}}async stop(){const t=this._startPromise;this.connection.features.reconnect=!1,this._stopPromise=this._stopInternal(),await this._stopPromise;try{await t}catch{}}_stopInternal(t){if(this._connectionState===ta.Disconnected)return this._logger.log(Yt.Debug,`Call to HubConnection.stop(${t}) ignored because it is already in the disconnected state.`),Promise.resolve();if(this._connectionState===ta.Disconnecting)return this._logger.log(Yt.Debug,`Call to HttpConnection.stop(${t}) ignored because the connection is already in the disconnecting state.`),this._stopPromise;const n=this._connectionState;return this._connectionState=ta.Disconnecting,this._logger.log(Yt.Debug,"Stopping HubConnection."),this._reconnectDelayHandle?(this._logger.log(Yt.Debug,"Connection stopped during reconnect delay. Done reconnecting."),clearTimeout(this._reconnectDelayHandle),this._reconnectDelayHandle=void 0,this._completeClose(),Promise.resolve()):(n===ta.Connected&&this._sendCloseMessage(),this._cleanupTimeout(),this._cleanupPingTimer(),this._stopDuringStartError=t||new Bu("The connection was stopped before the hub handshake could complete."),this.connection.stop(t))}async _sendCloseMessage(){try{await this._sendWithProtocol(this._createCloseMessage())}catch{}}stream(t,...n){const[r,s]=this._replaceStreamingParams(n),o=this._createStreamInvocation(t,n,s);let i;const u=new ox;return u.cancelCallback=()=>{const p=this._createCancelInvocation(o.invocationId);return delete this._callbacks[o.invocationId],i.then(()=>this._sendWithProtocol(p))},this._callbacks[o.invocationId]=(p,g)=>{if(g){u.error(g);return}else p&&(p.type===Ps.Completion?p.error?u.error(new Error(p.error)):u.complete():u.next(p.item))},i=this._sendWithProtocol(o).catch(p=>{u.error(p),delete this._callbacks[o.invocationId]}),this._launchStreams(r,i),u}_sendMessage(t){return this._resetKeepAliveInterval(),this.connection.send(t)}_sendWithProtocol(t){return this._messageBuffer?this._messageBuffer._send(t):this._sendMessage(this._protocol.writeMessage(t))}send(t,...n){const[r,s]=this._replaceStreamingParams(n),o=this._sendWithProtocol(this._createInvocation(t,n,!0,s));return this._launchStreams(r,o),o}invoke(t,...n){const[r,s]=this._replaceStreamingParams(n),o=this._createInvocation(t,n,!1,s);return new Promise((u,p)=>{this._callbacks[o.invocationId]=(v,w)=>{if(w){p(w);return}else v&&(v.type===Ps.Completion?v.error?p(new Error(v.error)):u(v.result):p(new Error(`Unexpected message type: ${v.type}`)))};const g=this._sendWithProtocol(o).catch(v=>{p(v),delete this._callbacks[o.invocationId]});this._launchStreams(r,g)})}on(t,n){!t||!n||(t=t.toLowerCase(),this._methods[t]||(this._methods[t]=[]),this._methods[t].indexOf(n)===-1&&this._methods[t].push(n))}off(t,n){if(!t)return;t=t.toLowerCase();const r=this._methods[t];if(r)if(n){const s=r.indexOf(n);s!==-1&&(r.splice(s,1),r.length===0&&delete this._methods[t])}else delete this._methods[t]}onclose(t){t&&this._closedCallbacks.push(t)}onreconnecting(t){t&&this._reconnectingCallbacks.push(t)}onreconnected(t){t&&this._reconnectedCallbacks.push(t)}_processIncomingData(t){if(this._cleanupTimeout(),this._receivedHandshakeResponse||(t=this._processHandshakeResponse(t),this._receivedHandshakeResponse=!0),t){const n=this._protocol.parseMessages(t,this._logger);for(const r of n)if(!(this._messageBuffer&&!this._messageBuffer._shouldProcessMessage(r)))switch(r.type){case Ps.Invocation:this._invokeClientMethod(r).catch(s=>{this._logger.log(Yt.Error,`Invoke client method threw error: ${ob(s)}`)});break;case Ps.StreamItem:case Ps.Completion:{const s=this._callbacks[r.invocationId];if(s){r.type===Ps.Completion&&delete this._callbacks[r.invocationId];try{s(r)}catch(o){this._logger.log(Yt.Error,`Stream callback threw error: ${ob(o)}`)}}break}case Ps.Ping:break;case Ps.Close:{this._logger.log(Yt.Information,"Close message received from server.");const s=r.error?new Error("Server returned an error on close: "+r.error):void 0;r.allowReconnect===!0?this.connection.stop(s):this._stopPromise=this._stopInternal(s);break}case Ps.Ack:this._messageBuffer&&this._messageBuffer._ack(r);break;case Ps.Sequence:this._messageBuffer&&this._messageBuffer._resetSequence(r);break;default:this._logger.log(Yt.Warning,`Invalid message type: ${r.type}.`);break}}this._resetTimeoutPeriod()}_processHandshakeResponse(t){let n,r;try{[r,n]=this._handshakeProtocol.parseHandshakeResponse(t)}catch(s){const o="Error parsing handshake response: "+s;this._logger.log(Yt.Error,o);const i=new Error(o);throw this._handshakeRejecter(i),i}if(n.error){const s="Server returned handshake error: "+n.error;this._logger.log(Yt.Error,s);const o=new Error(s);throw this._handshakeRejecter(o),o}else this._logger.log(Yt.Debug,"Server handshake complete.");return this._handshakeResolver(),r}_resetKeepAliveInterval(){this.connection.features.inherentKeepAlive||(this._nextKeepAlive=new Date().getTime()+this.keepAliveIntervalInMilliseconds,this._cleanupPingTimer())}_resetTimeoutPeriod(){if((!this.connection.features||!this.connection.features.inherentKeepAlive)&&(this._timeoutHandle=setTimeout(()=>this.serverTimeout(),this.serverTimeoutInMilliseconds),this._pingServerHandle===void 0)){let t=this._nextKeepAlive-new Date().getTime();t<0&&(t=0),this._pingServerHandle=setTimeout(async()=>{if(this._connectionState===ta.Connected)try{await this._sendMessage(this._cachedPingMessage)}catch{this._cleanupPingTimer()}},t)}}serverTimeout(){this.connection.stop(new Error("Server timeout elapsed without receiving a message from the server."))}async _invokeClientMethod(t){const n=t.target.toLowerCase(),r=this._methods[n];if(!r){this._logger.log(Yt.Warning,`No client method with the name '${n}' found.`),t.invocationId&&(this._logger.log(Yt.Warning,`No result given for '${n}' method and invocation ID '${t.invocationId}'.`),await this._sendWithProtocol(this._createCompletionMessage(t.invocationId,"Client didn't provide a result.",null)));return}const s=r.slice(),o=!!t.invocationId;let i,u,p;for(const g of s)try{const v=i;i=await g.apply(this,t.arguments),o&&i&&v&&(this._logger.log(Yt.Error,`Multiple results provided for '${n}'. Sending error to server.`),p=this._createCompletionMessage(t.invocationId,"Client provided multiple results.",null)),u=void 0}catch(v){u=v,this._logger.log(Yt.Error,`A callback for the method '${n}' threw error '${v}'.`)}p?await this._sendWithProtocol(p):o?(u?p=this._createCompletionMessage(t.invocationId,`${u}`,null):i!==void 0?p=this._createCompletionMessage(t.invocationId,null,i):(this._logger.log(Yt.Warning,`No result given for '${n}' method and invocation ID '${t.invocationId}'.`),p=this._createCompletionMessage(t.invocationId,"Client didn't provide a result.",null)),await this._sendWithProtocol(p)):i&&this._logger.log(Yt.Error,`Result given for '${n}' method but server is not expecting a result.`)}_connectionClosed(t){this._logger.log(Yt.Debug,`HubConnection.connectionClosed(${t}) called while in state ${this._connectionState}.`),this._stopDuringStartError=this._stopDuringStartError||t||new Bu("The underlying connection was closed before the hub handshake could complete."),this._handshakeResolver&&this._handshakeResolver(),this._cancelCallbacksWithError(t||new Error("Invocation canceled due to the underlying connection being closed.")),this._cleanupTimeout(),this._cleanupPingTimer(),this._connectionState===ta.Disconnecting?this._completeClose(t):this._connectionState===ta.Connected&&this._reconnectPolicy?this._reconnect(t):this._connectionState===ta.Connected&&this._completeClose(t)}_completeClose(t){if(this._connectionStarted){this._connectionState=ta.Disconnected,this._connectionStarted=!1,this._messageBuffer&&(this._messageBuffer._dispose(t??new Error("Connection closed.")),this._messageBuffer=void 0),ba.isBrowser&&window.document.removeEventListener("freeze",this._freezeEventListener);try{this._closedCallbacks.forEach(n=>n.apply(this,[t]))}catch(n){this._logger.log(Yt.Error,`An onclose callback called with error '${t}' threw error '${n}'.`)}}}async _reconnect(t){const n=Date.now();let r=0,s=t!==void 0?t:new Error("Attempting to reconnect due to a unknown error."),o=this._getNextRetryDelay(r++,0,s);if(o===null){this._logger.log(Yt.Debug,"Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt."),this._completeClose(t);return}if(this._connectionState=ta.Reconnecting,t?this._logger.log(Yt.Information,`Connection reconnecting because of error '${t}'.`):this._logger.log(Yt.Information,"Connection reconnecting."),this._reconnectingCallbacks.length!==0){try{this._reconnectingCallbacks.forEach(i=>i.apply(this,[t]))}catch(i){this._logger.log(Yt.Error,`An onreconnecting callback called with error '${t}' threw error '${i}'.`)}if(this._connectionState!==ta.Reconnecting){this._logger.log(Yt.Debug,"Connection left the reconnecting state in onreconnecting callback. Done reconnecting.");return}}for(;o!==null;){if(this._logger.log(Yt.Information,`Reconnect attempt number ${r} will start in ${o} ms.`),await new Promise(i=>{this._reconnectDelayHandle=setTimeout(i,o)}),this._reconnectDelayHandle=void 0,this._connectionState!==ta.Reconnecting){this._logger.log(Yt.Debug,"Connection left the reconnecting state during reconnect delay. Done reconnecting.");return}try{if(await this._startInternal(),this._connectionState=ta.Connected,this._logger.log(Yt.Information,"HubConnection reconnected successfully."),this._reconnectedCallbacks.length!==0)try{this._reconnectedCallbacks.forEach(i=>i.apply(this,[this.connection.connectionId]))}catch(i){this._logger.log(Yt.Error,`An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${i}'.`)}return}catch(i){if(this._logger.log(Yt.Information,`Reconnect attempt failed because of error '${i}'.`),this._connectionState!==ta.Reconnecting){this._logger.log(Yt.Debug,`Connection moved to the '${this._connectionState}' from the reconnecting state during reconnect attempt. Done reconnecting.`),this._connectionState===ta.Disconnecting&&this._completeClose();return}s=i instanceof Error?i:new Error(i.toString()),o=this._getNextRetryDelay(r++,Date.now()-n,s)}}this._logger.log(Yt.Information,`Reconnect retries have been exhausted after ${Date.now()-n} ms and ${r} failed attempts. Connection disconnecting.`),this._completeClose()}_getNextRetryDelay(t,n,r){try{return this._reconnectPolicy.nextRetryDelayInMilliseconds({elapsedMilliseconds:n,previousRetryCount:t,retryReason:r})}catch(s){return this._logger.log(Yt.Error,`IRetryPolicy.nextRetryDelayInMilliseconds(${t}, ${n}) threw error '${s}'.`),null}}_cancelCallbacksWithError(t){const n=this._callbacks;this._callbacks={},Object.keys(n).forEach(r=>{const s=n[r];try{s(null,t)}catch(o){this._logger.log(Yt.Error,`Stream 'error' callback called with '${t}' threw error: ${ob(o)}`)}})}_cleanupPingTimer(){this._pingServerHandle&&(clearTimeout(this._pingServerHandle),this._pingServerHandle=void 0)}_cleanupTimeout(){this._timeoutHandle&&clearTimeout(this._timeoutHandle)}_createInvocation(t,n,r,s){if(r)return s.length!==0?{arguments:n,streamIds:s,target:t,type:Ps.Invocation}:{arguments:n,target:t,type:Ps.Invocation};{const o=this._invocationId;return this._invocationId++,s.length!==0?{arguments:n,invocationId:o.toString(),streamIds:s,target:t,type:Ps.Invocation}:{arguments:n,invocationId:o.toString(),target:t,type:Ps.Invocation}}}_launchStreams(t,n){if(t.length!==0){n||(n=Promise.resolve());for(const r in t)t[r].subscribe({complete:()=>{n=n.then(()=>this._sendWithProtocol(this._createCompletionMessage(r)))},error:s=>{let o;s instanceof Error?o=s.message:s&&s.toString?o=s.toString():o="Unknown error",n=n.then(()=>this._sendWithProtocol(this._createCompletionMessage(r,o)))},next:s=>{n=n.then(()=>this._sendWithProtocol(this._createStreamItemMessage(r,s)))}})}}_replaceStreamingParams(t){const n=[],r=[];for(let s=0;s<t.length;s++){const o=t[s];if(this._isObservable(o)){const i=this._invocationId;this._invocationId++,n[i]=o,r.push(i.toString()),t.splice(s,1)}}return[n,r]}_isObservable(t){return t&&t.subscribe&&typeof t.subscribe=="function"}_createStreamInvocation(t,n,r){const s=this._invocationId;return this._invocationId++,r.length!==0?{arguments:n,invocationId:s.toString(),streamIds:r,target:t,type:Ps.StreamInvocation}:{arguments:n,invocationId:s.toString(),target:t,type:Ps.StreamInvocation}}_createCancelInvocation(t){return{invocationId:t,type:Ps.CancelInvocation}}_createStreamItemMessage(t,n){return{invocationId:t,item:n,type:Ps.StreamItem}}_createCompletionMessage(t,n,r){return n?{error:n,invocationId:t,type:Ps.Completion}:{invocationId:t,result:r,type:Ps.Completion}}_createCloseMessage(){return{type:Ps.Close}}}const cb=[0,2e3,1e4,3e4,null];class ix{constructor(t){this._retryDelays=t!==void 0?[...t,null]:cb}nextRetryDelayInMilliseconds(t){return this._retryDelays[t.previousRetryCount]}}class Cp{}Cp.Authorization="Authorization",Cp.Cookie="Cookie";class lx{constructor(t,n,r){this.statusCode=t,this.statusText=n,this.content=r}}class zg{get(t,n){return this.send({...n,method:"GET",url:t})}post(t,n){return this.send({...n,method:"POST",url:t})}delete(t,n){return this.send({...n,method:"DELETE",url:t})}getCookieString(t){return""}}class h extends zg{constructor(t,n){super(),this._innerClient=t,this._accessTokenFactory=n}async send(t){let n=!0;this._accessTokenFactory&&(!this._accessToken||t.url&&t.url.indexOf("/negotiate?")>0)&&(n=!1,this._accessToken=await this._accessTokenFactory()),this._setAuthorizationHeader(t);const r=await this._innerClient.send(t);return n&&r.statusCode===401&&this._accessTokenFactory?(this._accessToken=await this._accessTokenFactory(),this._setAuthorizationHeader(t),await this._innerClient.send(t)):r}_setAuthorizationHeader(t){t.headers||(t.headers={}),this._accessToken?t.headers[Cp.Authorization]=`Bearer ${this._accessToken}`:this._accessTokenFactory&&t.headers[Cp.Authorization]&&delete t.headers[Cp.Authorization]}getCookieString(t){return this._innerClient.getCookieString(t)}}class b extends zg{constructor(t){if(super(),this._logger=t,typeof fetch>"u"||ba.isNode){const n=require;this._jar=new(n("tough-cookie")).CookieJar,typeof fetch>"u"?this._fetchType=n("node-fetch"):this._fetchType=fetch,this._fetchType=n("fetch-cookie")(this._fetchType,this._jar)}else this._fetchType=fetch.bind(ab());if(typeof AbortController>"u"){const n=require;this._abortControllerType=n("abort-controller")}else this._abortControllerType=AbortController}async send(t){if(t.abortSignal&&t.abortSignal.aborted)throw new Bu;if(!t.method)throw new Error("No method defined.");if(!t.url)throw new Error("No url defined.");const n=new this._abortControllerType;let r;t.abortSignal&&(t.abortSignal.onabort=()=>{n.abort(),r=new Bu});let s=null;if(t.timeout){const p=t.timeout;s=setTimeout(()=>{n.abort(),this._logger.log(Yt.Warning,"Timeout from HTTP request."),r=new ib},p)}t.content===""&&(t.content=void 0),t.content&&(t.headers=t.headers||{},Na(t.content)?t.headers["Content-Type"]="application/octet-stream":t.headers["Content-Type"]="text/plain;charset=UTF-8");let o;try{o=await this._fetchType(t.url,{body:t.content,cache:"no-cache",credentials:t.withCredentials===!0?"include":"same-origin",headers:{"X-Requested-With":"XMLHttpRequest",...t.headers},method:t.method,mode:"cors",redirect:"follow",signal:n.signal})}catch(p){throw r||(this._logger.log(Yt.Warning,`Error from HTTP request. ${p}.`),p)}finally{s&&clearTimeout(s),t.abortSignal&&(t.abortSignal.onabort=null)}if(!o.ok){const p=await _(o,"text");throw new Sp(p||o.statusText,o.status)}const u=await _(o,t.responseType);return new lx(o.status,o.statusText,u)}getCookieString(t){let n="";return ba.isNode&&this._jar&&this._jar.getCookies(t,(r,s)=>n=s.join("; ")),n}}function _(e,t){let n;switch(t){case"arraybuffer":n=e.arrayBuffer();break;case"text":n=e.text();break;case"blob":case"document":case"json":throw new Error(`${t} is not supported.`);default:n=e.text();break}return n}class P extends zg{constructor(t){super(),this._logger=t}send(t){return t.abortSignal&&t.abortSignal.aborted?Promise.reject(new Bu):t.method?t.url?new Promise((n,r)=>{const s=new XMLHttpRequest;s.open(t.method,t.url,!0),s.withCredentials=t.withCredentials===void 0?!0:t.withCredentials,s.setRequestHeader("X-Requested-With","XMLHttpRequest"),t.content===""&&(t.content=void 0),t.content&&(Na(t.content)?s.setRequestHeader("Content-Type","application/octet-stream"):s.setRequestHeader("Content-Type","text/plain;charset=UTF-8"));const o=t.headers;o&&Object.keys(o).forEach(i=>{s.setRequestHeader(i,o[i])}),t.responseType&&(s.responseType=t.responseType),t.abortSignal&&(t.abortSignal.onabort=()=>{s.abort(),r(new Bu)}),t.timeout&&(s.timeout=t.timeout),s.onload=()=>{t.abortSignal&&(t.abortSignal.onabort=null),s.status>=200&&s.status<300?n(new lx(s.status,s.statusText,s.response||s.responseText)):r(new Sp(s.response||s.responseText||s.statusText,s.status))},s.onerror=()=>{this._logger.log(Yt.Warning,`Error from HTTP request. ${s.status}: ${s.statusText}.`),r(new Sp(s.statusText,s.status))},s.ontimeout=()=>{this._logger.log(Yt.Warning,"Timeout from HTTP request."),r(new ib)},s.send(t.content)}):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}}class A extends zg{constructor(t){if(super(),typeof fetch<"u"||ba.isNode)this._httpClient=new b(t);else if(typeof XMLHttpRequest<"u")this._httpClient=new P(t);else throw new Error("No usable HttpClient found.")}send(t){return t.abortSignal&&t.abortSignal.aborted?Promise.reject(new Bu):t.method?t.url?this._httpClient.send(t):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}getCookieString(t){return this._httpClient.getCookieString(t)}}var $;(function(e){e[e.None=0]="None",e[e.WebSockets=1]="WebSockets",e[e.ServerSentEvents=2]="ServerSentEvents",e[e.LongPolling=4]="LongPolling"})($||($={}));var Y;(function(e){e[e.Text=1]="Text",e[e.Binary=2]="Binary"})(Y||(Y={}));class he{constructor(){this._isAborted=!1,this.onabort=null}abort(){this._isAborted||(this._isAborted=!0,this.onabort&&this.onabort())}get signal(){return this}get aborted(){return this._isAborted}}class me{get pollAborted(){return this._pollAbort.aborted}constructor(t,n,r){this._httpClient=t,this._logger=n,this._pollAbort=new he,this._options=r,this._running=!1,this.onreceive=null,this.onclose=null}async connect(t,n){if(Za.isRequired(t,"url"),Za.isRequired(n,"transferFormat"),Za.isIn(n,Y,"transferFormat"),this._url=t,this._logger.log(Yt.Trace,"(LongPolling transport) Connecting."),n===Y.Binary&&typeof XMLHttpRequest<"u"&&typeof new XMLHttpRequest().responseType!="string")throw new Error("Binary protocols over XmlHttpRequest not implementing advanced features are not supported.");const[r,s]=qh(),o={[r]:s,...this._options.headers},i={abortSignal:this._pollAbort.signal,headers:o,timeout:1e5,withCredentials:this._options.withCredentials};n===Y.Binary&&(i.responseType="arraybuffer");const u=`${t}&_=${Date.now()}`;this._logger.log(Yt.Trace,`(LongPolling transport) polling: ${u}.`);const p=await this._httpClient.get(u,i);p.statusCode!==200?(this._logger.log(Yt.Error,`(LongPolling transport) Unexpected response code: ${p.statusCode}.`),this._closeError=new Sp(p.statusText||"",p.statusCode),this._running=!1):this._running=!0,this._receiving=this._poll(this._url,i)}async _poll(t,n){try{for(;this._running;)try{const r=`${t}&_=${Date.now()}`;this._logger.log(Yt.Trace,`(LongPolling transport) polling: ${r}.`);const s=await this._httpClient.get(r,n);s.statusCode===204?(this._logger.log(Yt.Information,"(LongPolling transport) Poll terminated by server."),this._running=!1):s.statusCode!==200?(this._logger.log(Yt.Error,`(LongPolling transport) Unexpected response code: ${s.statusCode}.`),this._closeError=new Sp(s.statusText||"",s.statusCode),this._running=!1):s.content?(this._logger.log(Yt.Trace,`(LongPolling transport) data received. ${Fg(s.content,this._options.logMessageContent)}.`),this.onreceive&&this.onreceive(s.content)):this._logger.log(Yt.Trace,"(LongPolling transport) Poll timed out, reissuing.")}catch(r){this._running?r instanceof ib?this._logger.log(Yt.Trace,"(LongPolling transport) Poll timed out, reissuing."):(this._closeError=r,this._running=!1):this._logger.log(Yt.Trace,`(LongPolling transport) Poll errored after shutdown: ${r.message}`)}}finally{this._logger.log(Yt.Trace,"(LongPolling transport) Polling complete."),this.pollAborted||this._raiseOnClose()}}async send(t){return this._running?nx(this._logger,"LongPolling",this._httpClient,this._url,t,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))}async stop(){this._logger.log(Yt.Trace,"(LongPolling transport) Stopping polling."),this._running=!1,this._pollAbort.abort();try{await this._receiving,this._logger.log(Yt.Trace,`(LongPolling transport) sending DELETE request to ${this._url}.`);const t={},[n,r]=qh();t[n]=r;const s={headers:{...t,...this._options.headers},timeout:this._options.timeout,withCredentials:this._options.withCredentials};let o;try{await this._httpClient.delete(this._url,s)}catch(i){o=i}o?o instanceof Sp&&(o.statusCode===404?this._logger.log(Yt.Trace,"(LongPolling transport) A 404 response was returned from sending a DELETE request."):this._logger.log(Yt.Trace,`(LongPolling transport) Error sending a DELETE request: ${o}`)):this._logger.log(Yt.Trace,"(LongPolling transport) DELETE request accepted.")}finally{this._logger.log(Yt.Trace,"(LongPolling transport) Stop finished."),this._raiseOnClose()}}_raiseOnClose(){if(this.onclose){let t="(LongPolling transport) Firing onclose event.";this._closeError&&(t+=" Error: "+this._closeError),this._logger.log(Yt.Trace,t),this.onclose(this._closeError)}}}class Ae{constructor(t,n,r,s){this._httpClient=t,this._accessToken=n,this._logger=r,this._options=s,this.onreceive=null,this.onclose=null}async connect(t,n){return Za.isRequired(t,"url"),Za.isRequired(n,"transferFormat"),Za.isIn(n,Y,"transferFormat"),this._logger.log(Yt.Trace,"(SSE transport) Connecting."),this._url=t,this._accessToken&&(t+=(t.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(this._accessToken)}`),new Promise((r,s)=>{let o=!1;if(n!==Y.Text){s(new Error("The Server-Sent Events transport only supports the 'Text' transfer format"));return}let i;if(ba.isBrowser||ba.isWebWorker)i=new this._options.EventSource(t,{withCredentials:this._options.withCredentials});else{const u=this._httpClient.getCookieString(t),p={};p.Cookie=u;const[g,v]=qh();p[g]=v,i=new this._options.EventSource(t,{withCredentials:this._options.withCredentials,headers:{...p,...this._options.headers}})}try{i.onmessage=u=>{if(this.onreceive)try{this._logger.log(Yt.Trace,`(SSE transport) data received. ${Fg(u.data,this._options.logMessageContent)}.`),this.onreceive(u.data)}catch(p){this._close(p);return}},i.onerror=u=>{o?this._close():s(new Error("EventSource failed to connect. The connection could not be found on the server, either the connection ID is not present on the server, or a proxy is refusing/buffering the connection. If you have multiple servers check that sticky sessions are enabled."))},i.onopen=()=>{this._logger.log(Yt.Information,`SSE connected to ${this._url}`),this._eventSource=i,o=!0,r()}}catch(u){s(u);return}})}async send(t){return this._eventSource?nx(this._logger,"SSE",this._httpClient,this._url,t,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))}stop(){return this._close(),Promise.resolve()}_close(t){this._eventSource&&(this._eventSource.close(),this._eventSource=void 0,this.onclose&&this.onclose(t))}}class Ge{constructor(t,n,r,s,o,i){this._logger=r,this._accessTokenFactory=n,this._logMessageContent=s,this._webSocketConstructor=o,this._httpClient=t,this.onreceive=null,this.onclose=null,this._headers=i}async connect(t,n){Za.isRequired(t,"url"),Za.isRequired(n,"transferFormat"),Za.isIn(n,Y,"transferFormat"),this._logger.log(Yt.Trace,"(WebSockets transport) Connecting.");let r;return this._accessTokenFactory&&(r=await this._accessTokenFactory()),new Promise((s,o)=>{t=t.replace(/^http/,"ws");let i;const u=this._httpClient.getCookieString(t);let p=!1;if(ba.isNode||ba.isReactNative){const g={},[v,w]=qh();g[v]=w,r&&(g[Cp.Authorization]=`Bearer ${r}`),u&&(g[Cp.Cookie]=u),i=new this._webSocketConstructor(t,void 0,{headers:{...g,...this._headers}})}else r&&(t+=(t.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(r)}`);i||(i=new this._webSocketConstructor(t)),n===Y.Binary&&(i.binaryType="arraybuffer"),i.onopen=g=>{this._logger.log(Yt.Information,`WebSocket connected to ${t}.`),this._webSocket=i,p=!0,s()},i.onerror=g=>{let v=null;typeof ErrorEvent<"u"&&g instanceof ErrorEvent?v=g.error:v="There was an error with the transport",this._logger.log(Yt.Information,`(WebSockets transport) ${v}.`)},i.onmessage=g=>{if(this._logger.log(Yt.Trace,`(WebSockets transport) data received. ${Fg(g.data,this._logMessageContent)}.`),this.onreceive)try{this.onreceive(g.data)}catch(v){this._close(v);return}},i.onclose=g=>{if(p)this._close(g);else{let v=null;typeof ErrorEvent<"u"&&g instanceof ErrorEvent?v=g.error:v="WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled.",o(new Error(v))}}})}send(t){return this._webSocket&&this._webSocket.readyState===this._webSocketConstructor.OPEN?(this._logger.log(Yt.Trace,`(WebSockets transport) sending data. ${Fg(t,this._logMessageContent)}.`),this._webSocket.send(t),Promise.resolve()):Promise.reject("WebSocket is not in the OPEN state")}stop(){return this._webSocket&&this._close(void 0),Promise.resolve()}_close(t){this._webSocket&&(this._webSocket.onclose=()=>{},this._webSocket.onmessage=()=>{},this._webSocket.onerror=()=>{},this._webSocket.close(),this._webSocket=void 0),this._logger.log(Yt.Trace,"(WebSockets transport) socket closed."),this.onclose&&(this._isCloseEvent(t)&&(t.wasClean===!1||t.code!==1e3)?this.onclose(new Error(`WebSocket closed with status code: ${t.code} (${t.reason||"no reason given"}).`)):t instanceof Error?this.onclose(t):this.onclose())}_isCloseEvent(t){return t&&typeof t.wasClean=="boolean"&&typeof t.code=="number"}}const ht=100;class jt{constructor(t,n={}){if(this._stopPromiseResolver=()=>{},this.features={},this._negotiateVersion=1,Za.isRequired(t,"url"),this._logger=c1(n.logger),this.baseUrl=this._resolveUrl(t),n=n||{},n.logMessageContent=n.logMessageContent===void 0?!1:n.logMessageContent,typeof n.withCredentials=="boolean"||n.withCredentials===void 0)n.withCredentials=n.withCredentials===void 0?!0:n.withCredentials;else throw new Error("withCredentials option was not a 'boolean' or 'undefined' value");n.timeout=n.timeout===void 0?100*1e3:n.timeout;let r=null,s=null;if(ba.isNode){const o=require;r=o("ws"),s=o("eventsource")}!ba.isNode&&typeof WebSocket<"u"&&!n.WebSocket?n.WebSocket=WebSocket:ba.isNode&&!n.WebSocket&&r&&(n.WebSocket=r),!ba.isNode&&typeof EventSource<"u"&&!n.EventSource?n.EventSource=EventSource:ba.isNode&&!n.EventSource&&typeof s<"u"&&(n.EventSource=s),this._httpClient=new h(n.httpClient||new A(this._logger),n.accessTokenFactory),this._connectionState="Disconnected",this._connectionStarted=!1,this._options=n,this.onreceive=null,this.onclose=null}async start(t){if(t=t||Y.Binary,Za.isIn(t,Y,"transferFormat"),this._logger.log(Yt.Debug,`Starting connection with transfer format '${Y[t]}'.`),this._connectionState!=="Disconnected")return Promise.reject(new Error("Cannot start an HttpConnection that is not in the 'Disconnected' state."));if(this._connectionState="Connecting",this._startInternalPromise=this._startInternal(t),await this._startInternalPromise,this._connectionState==="Disconnecting"){const n="Failed to start the HttpConnection before stop() was called.";return this._logger.log(Yt.Error,n),await this._stopPromise,Promise.reject(new Bu(n))}else if(this._connectionState!=="Connected"){const n="HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!";return this._logger.log(Yt.Error,n),Promise.reject(new Bu(n))}this._connectionStarted=!0}send(t){return this._connectionState!=="Connected"?Promise.reject(new Error("Cannot send data if the connection is not in the 'Connected' State.")):(this._sendQueue||(this._sendQueue=new sn(this.transport)),this._sendQueue.send(t))}async stop(t){if(this._connectionState==="Disconnected")return this._logger.log(Yt.Debug,`Call to HttpConnection.stop(${t}) ignored because the connection is already in the disconnected state.`),Promise.resolve();if(this._connectionState==="Disconnecting")return this._logger.log(Yt.Debug,`Call to HttpConnection.stop(${t}) ignored because the connection is already in the disconnecting state.`),this._stopPromise;this._connectionState="Disconnecting",this._stopPromise=new Promise(n=>{this._stopPromiseResolver=n}),await this._stopInternal(t),await this._stopPromise}async _stopInternal(t){this._stopError=t;try{await this._startInternalPromise}catch{}if(this.transport){try{await this.transport.stop()}catch(n){this._logger.log(Yt.Error,`HttpConnection.transport.stop() threw error '${n}'.`),this._stopConnection()}this.transport=void 0}else this._logger.log(Yt.Debug,"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.")}async _startInternal(t){let n=this.baseUrl;this._accessTokenFactory=this._options.accessTokenFactory,this._httpClient._accessTokenFactory=this._accessTokenFactory;try{if(this._options.skipNegotiation)if(this._options.transport===$.WebSockets)this.transport=this._constructTransport($.WebSockets),await this._startTransport(n,t);else throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");else{let r=null,s=0;do{if(r=await this._getNegotiationResponse(n),this._connectionState==="Disconnecting"||this._connectionState==="Disconnected")throw new Bu("The connection was stopped during negotiation.");if(r.error)throw new Error(r.error);if(r.ProtocolVersion)throw new Error("Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details.");if(r.url&&(n=r.url),r.accessToken){const o=r.accessToken;this._accessTokenFactory=()=>o,this._httpClient._accessToken=o,this._httpClient._accessTokenFactory=void 0}s++}while(r.url&&s<ht);if(s===ht&&r.url)throw new Error("Negotiate redirection limit exceeded.");await this._createTransport(n,this._options.transport,r,t)}this.transport instanceof me&&(this.features.inherentKeepAlive=!0),this._connectionState==="Connecting"&&(this._logger.log(Yt.Debug,"The HttpConnection connected successfully."),this._connectionState="Connected")}catch(r){return this._logger.log(Yt.Error,"Failed to start the connection: "+r),this._connectionState="Disconnected",this.transport=void 0,this._stopPromiseResolver(),Promise.reject(r)}}async _getNegotiationResponse(t){const n={},[r,s]=qh();n[r]=s;const o=this._resolveNegotiateUrl(t);this._logger.log(Yt.Debug,`Sending negotiation request: ${o}.`);try{const i=await this._httpClient.post(o,{content:"",headers:{...n,...this._options.headers},timeout:this._options.timeout,withCredentials:this._options.withCredentials});if(i.statusCode!==200)return Promise.reject(new Error(`Unexpected status code returned from negotiate '${i.statusCode}'`));const u=JSON.parse(i.content);return(!u.negotiateVersion||u.negotiateVersion<1)&&(u.connectionToken=u.connectionId),u.useStatefulReconnect&&this._options._useStatefulReconnect!==!0?Promise.reject(new sx("Client didn't negotiate Stateful Reconnect but the server did.")):u}catch(i){let u="Failed to complete negotiation with the server: "+i;return i instanceof Sp&&i.statusCode===404&&(u=u+" Either this is not a SignalR endpoint or there is a proxy blocking the connection."),this._logger.log(Yt.Error,u),Promise.reject(new sx(u))}}_createConnectUrl(t,n){return n?t+(t.indexOf("?")===-1?"?":"&")+`id=${n}`:t}async _createTransport(t,n,r,s){let o=this._createConnectUrl(t,r.connectionToken);if(this._isITransport(n)){this._logger.log(Yt.Debug,"Connection was provided an instance of ITransport, using that directly."),this.transport=n,await this._startTransport(o,s),this.connectionId=r.connectionId;return}const i=[],u=r.availableTransports||[];let p=r;for(const g of u){const v=this._resolveTransportOrError(g,n,s,p?.useStatefulReconnect===!0);if(v instanceof Error)i.push(`${g.transport} failed:`),i.push(v);else if(this._isITransport(v)){if(this.transport=v,!p){try{p=await this._getNegotiationResponse(t)}catch(w){return Promise.reject(w)}o=this._createConnectUrl(t,p.connectionToken)}try{await this._startTransport(o,s),this.connectionId=p.connectionId;return}catch(w){if(this._logger.log(Yt.Error,`Failed to start the transport '${g.transport}': ${w}`),p=void 0,i.push(new m1(`${g.transport} failed: ${w}`,$[g.transport])),this._connectionState!=="Connecting"){const x="Failed to select transport before stop() was called.";return this._logger.log(Yt.Debug,x),Promise.reject(new Bu(x))}}}}return i.length>0?Promise.reject(new g1(`Unable to connect to the server with any of the available transports. ${i.join(" ")}`,i)):Promise.reject(new Error("None of the transports supported by the client are supported by the server."))}_constructTransport(t){switch(t){case $.WebSockets:if(!this._options.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new Ge(this._httpClient,this._accessTokenFactory,this._logger,this._options.logMessageContent,this._options.WebSocket,this._options.headers||{});case $.ServerSentEvents:if(!this._options.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new Ae(this._httpClient,this._httpClient._accessToken,this._logger,this._options);case $.LongPolling:return new me(this._httpClient,this._logger,this._options);default:throw new Error(`Unknown transport: ${t}.`)}}_startTransport(t,n){return this.transport.onreceive=this.onreceive,this.features.reconnect?this.transport.onclose=async r=>{let s=!1;if(this.features.reconnect)try{this.features.disconnected(),await this.transport.connect(t,n),await this.features.resend()}catch{s=!0}else{this._stopConnection(r);return}s&&this._stopConnection(r)}:this.transport.onclose=r=>this._stopConnection(r),this.transport.connect(t,n)}_resolveTransportOrError(t,n,r,s){const o=$[t.transport];if(o==null)return this._logger.log(Yt.Debug,`Skipping transport '${t.transport}' because it is not supported by this client.`),new Error(`Skipping transport '${t.transport}' because it is not supported by this client.`);if(an(n,o))if(t.transferFormats.map(u=>Y[u]).indexOf(r)>=0){if(o===$.WebSockets&&!this._options.WebSocket||o===$.ServerSentEvents&&!this._options.EventSource)return this._logger.log(Yt.Debug,`Skipping transport '${$[o]}' because it is not supported in your environment.'`),new h1(`'${$[o]}' is not supported in your environment.`,o);this._logger.log(Yt.Debug,`Selecting transport '${$[o]}'.`);try{return this.features.reconnect=o===$.WebSockets?s:void 0,this._constructTransport(o)}catch(u){return u}}else return this._logger.log(Yt.Debug,`Skipping transport '${$[o]}' because it does not support the requested transfer format '${Y[r]}'.`),new Error(`'${$[o]}' does not support ${Y[r]}.`);else return this._logger.log(Yt.Debug,`Skipping transport '${$[o]}' because it was disabled by the client.`),new rx(`'${$[o]}' is disabled by the client.`,o)}_isITransport(t){return t&&typeof t=="object"&&"connect"in t}_stopConnection(t){if(this._logger.log(Yt.Debug,`HttpConnection.stopConnection(${t}) called while in state ${this._connectionState}.`),this.transport=void 0,t=this._stopError||t,this._stopError=void 0,this._connectionState==="Disconnected"){this._logger.log(Yt.Debug,`Call to HttpConnection.stopConnection(${t}) was ignored because the connection is already in the disconnected state.`);return}if(this._connectionState==="Connecting")throw this._logger.log(Yt.Warning,`Call to HttpConnection.stopConnection(${t}) was ignored because the connection is still in the connecting state.`),new Error(`HttpConnection.stopConnection(${t}) was called while the connection is still in the connecting state.`);if(this._connectionState==="Disconnecting"&&this._stopPromiseResolver(),t?this._logger.log(Yt.Error,`Connection disconnected with error '${t}'.`):this._logger.log(Yt.Information,"Connection disconnected."),this._sendQueue&&(this._sendQueue.stop().catch(n=>{this._logger.log(Yt.Error,`TransportSendQueue.stop() threw error '${n}'.`)}),this._sendQueue=void 0),this.connectionId=void 0,this._connectionState="Disconnected",this._connectionStarted){this._connectionStarted=!1;try{this.onclose&&this.onclose(t)}catch(n){this._logger.log(Yt.Error,`HttpConnection.onclose(${t}) threw error '${n}'.`)}}}_resolveUrl(t){if(t.lastIndexOf("https://",0)===0||t.lastIndexOf("http://",0)===0)return t;if(!ba.isBrowser)throw new Error(`Cannot resolve '${t}'.`);const n=window.document.createElement("a");return n.href=t,this._logger.log(Yt.Information,`Normalizing '${t}' to '${n.href}'.`),n.href}_resolveNegotiateUrl(t){const n=new URL(t);n.pathname.endsWith("/")?n.pathname+="negotiate":n.pathname+="/negotiate";const r=new URLSearchParams(n.searchParams);return r.has("negotiateVersion")||r.append("negotiateVersion",this._negotiateVersion.toString()),r.has("useStatefulReconnect")?r.get("useStatefulReconnect")==="true"&&(this._options._useStatefulReconnect=!0):this._options._useStatefulReconnect===!0&&r.append("useStatefulReconnect","true"),n.search=r.toString(),n.toString()}}function an(e,t){return!e||(t&e)!==0}class sn{constructor(t){this._transport=t,this._buffer=[],this._executing=!0,this._sendBufferedData=new kn,this._transportResult=new kn,this._sendLoopPromise=this._sendLoop()}send(t){return this._bufferData(t),this._transportResult||(this._transportResult=new kn),this._transportResult.promise}stop(){return this._executing=!1,this._sendBufferedData.resolve(),this._sendLoopPromise}_bufferData(t){if(this._buffer.length&&typeof this._buffer[0]!=typeof t)throw new Error(`Expected data to be of type ${typeof this._buffer} but was of type ${typeof t}`);this._buffer.push(t),this._sendBufferedData.resolve()}async _sendLoop(){for(;;){if(await this._sendBufferedData.promise,!this._executing){this._transportResult&&this._transportResult.reject("Connection stopped.");break}this._sendBufferedData=new kn;const t=this._transportResult;this._transportResult=void 0;const n=typeof this._buffer[0]=="string"?this._buffer.join(""):sn._concatBuffers(this._buffer);this._buffer.length=0;try{await this._transport.send(n),t.resolve()}catch(r){t.reject(r)}}}static _concatBuffers(t){const n=t.map(o=>o.byteLength).reduce((o,i)=>o+i),r=new Uint8Array(n);let s=0;for(const o of t)r.set(new Uint8Array(o),s),s+=o.byteLength;return r.buffer}}class kn{constructor(){this.promise=new Promise((t,n)=>[this._resolver,this._rejecter]=[t,n])}resolve(){this._resolver()}reject(t){this._rejecter(t)}}const is="json";class Ns{constructor(){this.name=is,this.version=2,this.transferFormat=Y.Text}parseMessages(t,n){if(typeof t!="string")throw new Error("Invalid input for JSON hub protocol. Expected a string.");if(!t)return[];n===null&&(n=Lg.instance);const r=lc.parse(t),s=[];for(const o of r){const i=JSON.parse(o);if(typeof i.type!="number")throw new Error("Invalid payload.");switch(i.type){case Ps.Invocation:this._isInvocationMessage(i);break;case Ps.StreamItem:this._isStreamItemMessage(i);break;case Ps.Completion:this._isCompletionMessage(i);break;case Ps.Ping:break;case Ps.Close:break;case Ps.Ack:this._isAckMessage(i);break;case Ps.Sequence:this._isSequenceMessage(i);break;default:n.log(Yt.Information,"Unknown message type '"+i.type+"' ignored.");continue}s.push(i)}return s}writeMessage(t){return lc.write(JSON.stringify(t))}_isInvocationMessage(t){this._assertNotEmptyString(t.target,"Invalid payload for Invocation message."),t.invocationId!==void 0&&this._assertNotEmptyString(t.invocationId,"Invalid payload for Invocation message.")}_isStreamItemMessage(t){if(this._assertNotEmptyString(t.invocationId,"Invalid payload for StreamItem message."),t.item===void 0)throw new Error("Invalid payload for StreamItem message.")}_isCompletionMessage(t){if(t.result&&t.error)throw new Error("Invalid payload for Completion message.");!t.result&&t.error&&this._assertNotEmptyString(t.error,"Invalid payload for Completion message."),this._assertNotEmptyString(t.invocationId,"Invalid payload for Completion message.")}_isAckMessage(t){if(typeof t.sequenceId!="number")throw new Error("Invalid SequenceId for Ack message.")}_isSequenceMessage(t){if(typeof t.sequenceId!="number")throw new Error("Invalid SequenceId for Sequence message.")}_assertNotEmptyString(t,n){if(typeof t!="string"||t==="")throw new Error(n)}}const co={trace:Yt.Trace,debug:Yt.Debug,info:Yt.Information,information:Yt.Information,warn:Yt.Warning,warning:Yt.Warning,error:Yt.Error,critical:Yt.Critical,none:Yt.None};function da(e){const t=co[e.toLowerCase()];if(typeof t<"u")return t;throw new Error(`Unknown log level: ${e}`)}class Go{configureLogging(t){if(Za.isRequired(t,"logging"),Fr(t))this.logger=t;else if(typeof t=="string"){const n=da(t);this.logger=new Iv(n)}else this.logger=new Iv(t);return this}withUrl(t,n){return Za.isRequired(t,"url"),Za.isNotEmpty(t,"url"),this.url=t,typeof n=="object"?this.httpConnectionOptions={...this.httpConnectionOptions,...n}:this.httpConnectionOptions={...this.httpConnectionOptions,transport:n},this}withHubProtocol(t){return Za.isRequired(t,"protocol"),this.protocol=t,this}withAutomaticReconnect(t){if(this.reconnectPolicy)throw new Error("A reconnectPolicy has already been set.");return t?Array.isArray(t)?this.reconnectPolicy=new ix(t):this.reconnectPolicy=t:this.reconnectPolicy=new ix,this}withServerTimeout(t){return Za.isRequired(t,"milliseconds"),this._serverTimeoutInMilliseconds=t,this}withKeepAliveInterval(t){return Za.isRequired(t,"milliseconds"),this._keepAliveIntervalInMilliseconds=t,this}withStatefulReconnect(t){return this.httpConnectionOptions===void 0&&(this.httpConnectionOptions={}),this.httpConnectionOptions._useStatefulReconnect=!0,this._statefulReconnectBufferSize=t?.bufferSize,this}build(){const t=this.httpConnectionOptions||{};if(t.logger===void 0&&(t.logger=this.logger),!this.url)throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection.");const n=new jt(this.url,t);return lb.create(n,this.logger||Lg.instance,this.protocol||new Ns,this.reconnectPolicy,this._serverTimeoutInMilliseconds,this._keepAliveIntervalInMilliseconds,this._statefulReconnectBufferSize)}}function Fr(e){return e.log!==void 0}var zr=ln(9387);const vi=e=>{const[t,n]=(0,l.useState)(null),{isLoggedIn:r}=(0,zr.m)();(0,l.useEffect)(()=>(r&&s(),()=>{t&&t.state===ta.Connected&&t.stop().catch(i=>{console.error(i)})}),[e.bffUrl,r]);const s=async()=>{const i=new Go().withUrl(`${e.bffUrl}/ssp-hub`).withAutomaticReconnect().build();await i.start().catch(u=>console.error(u)),n(i)},o=e.hubService;return(0,a.jsx)(o,{connection:t,children:e.children})};var Yr=ln(1993),ur=(e=>(e.SET_THEME="SET_THEME",e.SET_DARK_MODE="THEME_SET_DARK_MODE",e))(ur||{});const Br=e=>({type:"SET_THEME",theme:e}),yi=e=>({type:"THEME_SET_DARK_MODE",darkMode:e});var lu=Symbol.for("immer-nothing"),cu=Symbol.for("immer-draftable"),Or=Symbol.for("immer-state"),Ep=[];function na(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var uu=Object.getPrototypeOf;function cc(e){return!!e&&!!e[Or]}function Hc(e){return e?lP(e)||Array.isArray(e)||!!e[cu]||!!e.constructor?.[cu]||db(e)||fb(e):!1}var EF=Object.prototype.constructor.toString();function lP(e){if(!e||typeof e!="object")return!1;const t=uu(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===EF}function Bce(e){return cc(e)||na(15,e),e[Or].base_}function Dv(e,t){Ug(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function Ug(e){const t=e[Or];return t?t.type_:Array.isArray(e)?1:db(e)?2:fb(e)?3:0}function ub(e,t){return Ug(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function b1(e,t){return Ug(e)===2?e.get(t):e[t]}function cP(e,t,n){const r=Ug(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function TF(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function db(e){return e instanceof Map}function fb(e){return e instanceof Set}function Qi(e){return e.copy_||e.base_}function w1(e,t){if(db(e))return new Map(e);if(fb(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=lP(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[Or];let s=Reflect.ownKeys(r);for(let o=0;o<s.length;o++){const i=s[o],u=r[i];u.writable===!1&&(u.writable=!0,u.configurable=!0),(u.get||u.set)&&(r[i]={configurable:!0,writable:!0,enumerable:u.enumerable,value:e[i]})}return Object.create(uu(e),r)}else{const r=uu(e);if(r!==null&&n)return{...e};const s=Object.create(r);return Object.assign(s,e)}}function x1(e,t=!1){return cx(e)||cc(e)||!Hc(e)||(Ug(e)>1&&(e.set=e.add=e.clear=e.delete=kF),Object.freeze(e),t&&Object.entries(e).forEach(([n,r])=>x1(r,!0))),e}function kF(){na(2)}function cx(e){return Object.isFrozen(e)}var _1={};function Bg(e){const t=_1[e];return t||na(0,e),t}function uP(e,t){_1[e]||(_1[e]=t)}var pb;function ux(){return pb}function RF(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function dP(e,t){t&&(Bg("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function S1(e){C1(e),e.drafts_.forEach(PF),e.drafts_=null}function C1(e){e===pb&&(pb=e.parent_)}function fP(e){return pb=RF(pb,e)}function PF(e){const t=e[Or];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function pP(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Or].modified_&&(S1(t),na(4)),Hc(e)&&(e=dx(t,e),t.parent_||fx(t,e)),t.patches_&&Bg("Patches").generateReplacementPatches_(n[Or].base_,e,t.patches_,t.inversePatches_)):e=dx(t,n,[]),S1(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==lu?e:void 0}function dx(e,t,n){if(cx(t))return t;const r=t[Or];if(!r)return Dv(t,(s,o)=>hP(e,r,t,s,o,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return fx(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const s=r.copy_;let o=s,i=!1;r.type_===3&&(o=new Set(s),s.clear(),i=!0),Dv(o,(u,p)=>hP(e,r,s,u,p,n,i)),fx(e,s,!1),n&&e.patches_&&Bg("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function hP(e,t,n,r,s,o,i){if(cc(s)){const u=o&&t&&t.type_!==3&&!ub(t.assigned_,r)?o.concat(r):void 0,p=dx(e,s,u);if(cP(n,r,p),cc(p))e.canAutoFreeze_=!1;else return}else i&&n.add(s);if(Hc(s)&&!cx(s)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;dx(e,s),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,r)&&fx(e,s)}}function fx(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&x1(t,n)}function OF(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:ux(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let s=r,o=E1;n&&(s=[r],o=hb);const{revoke:i,proxy:u}=Proxy.revocable(s,o);return r.draft_=u,r.revoke_=i,u}var E1={get(e,t){if(t===Or)return e;const n=Qi(e);if(!ub(n,t))return NF(e,n,t);const r=n[t];return e.finalized_||!Hc(r)?r:r===T1(e.base_,t)?(k1(e),e.copy_[t]=mb(r,e)):r},has(e,t){return t in Qi(e)},ownKeys(e){return Reflect.ownKeys(Qi(e))},set(e,t,n){const r=mP(Qi(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const s=T1(Qi(e),t),o=s?.[Or];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(TF(n,s)&&(n!==void 0||ub(e.base_,t)))return!0;k1(e),Tp(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return T1(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,k1(e),Tp(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Qi(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){na(11)},getPrototypeOf(e){return uu(e.base_)},setPrototypeOf(){na(12)}},hb={};Dv(E1,(e,t)=>{hb[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),hb.deleteProperty=function(e,t){return hb.set.call(this,e,t,void 0)},hb.set=function(e,t,n){return E1.set.call(this,e[0],t,n,e[0])};function T1(e,t){const n=e[Or];return(n?Qi(n):e)[t]}function NF(e,t,n){const r=mP(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}function mP(e,t){if(!(t in e))return;let n=uu(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=uu(n)}}function Tp(e){e.modified_||(e.modified_=!0,e.parent_&&Tp(e.parent_))}function k1(e){e.copy_||(e.copy_=w1(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var AF=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const o=n;n=t;const i=this;return function(p=o,...g){return i.produce(p,v=>n.call(this,v,...g))}}typeof n!="function"&&na(6),r!==void 0&&typeof r!="function"&&na(7);let s;if(Hc(t)){const o=fP(this),i=mb(t,void 0);let u=!0;try{s=n(i),u=!1}finally{u?S1(o):C1(o)}return dP(o,r),pP(s,o)}else if(!t||typeof t!="object"){if(s=n(t),s===void 0&&(s=t),s===lu&&(s=void 0),this.autoFreeze_&&x1(s,!0),r){const o=[],i=[];Bg("Patches").generateReplacementPatches_(t,s,o,i),r(o,i)}return s}else na(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(i,...u)=>this.produceWithPatches(i,p=>t(p,...u));let r,s;return[this.produce(t,n,(i,u)=>{r=i,s=u}),r,s]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Hc(e)||na(8),cc(e)&&(e=gP(e));const t=fP(this),n=mb(e,void 0);return n[Or].isManual_=!0,C1(t),n}finishDraft(e,t){const n=e&&e[Or];(!n||!n.isManual_)&&na(9);const{scope_:r}=n;return dP(r,t),pP(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const s=t[n];if(s.path.length===0&&s.op==="replace"){e=s.value;break}}n>-1&&(t=t.slice(n+1));const r=Bg("Patches").applyPatches_;return cc(e)?r(e,t):this.produce(e,s=>r(s,t))}};function mb(e,t){const n=db(e)?Bg("MapSet").proxyMap_(e,t):fb(e)?Bg("MapSet").proxySet_(e,t):OF(e,t);return(t?t.scope_:ux()).drafts_.push(n),n}function gP(e){return cc(e)||na(10,e),vP(e)}function vP(e){if(!Hc(e)||cx(e))return e;const t=e[Or];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=w1(e,t.scope_.immer_.useStrictShallowCopy_)}else n=w1(e,!0);return Dv(n,(r,s)=>{cP(n,r,vP(s))}),t&&(t.finalized_=!1),n}function Vce(){const t="replace",n="add",r="remove";function s(x,E,R,k){switch(x.type_){case 0:case 2:return i(x,E,R,k);case 1:return o(x,E,R,k);case 3:return u(x,E,R,k)}}function o(x,E,R,k){let{base_:N,assigned_:L}=x,D=x.copy_;D.length<N.length&&([N,D]=[D,N],[R,k]=[k,R]);for(let B=0;B<N.length;B++)if(L[B]&&D[B]!==N[B]){const Q=E.concat([B]);R.push({op:t,path:Q,value:w(D[B])}),k.push({op:t,path:Q,value:w(N[B])})}for(let B=N.length;B<D.length;B++){const Q=E.concat([B]);R.push({op:n,path:Q,value:w(D[B])})}for(let B=D.length-1;N.length<=B;--B){const Q=E.concat([B]);k.push({op:r,path:Q})}}function i(x,E,R,k){const{base_:N,copy_:L}=x;Dv(x.assigned_,(D,B)=>{const Q=b1(N,D),ce=b1(L,D),ye=B?ub(N,D)?t:n:r;if(Q===ce&&ye===t)return;const G=E.concat(D);R.push(ye===r?{op:ye,path:G}:{op:ye,path:G,value:ce}),k.push(ye===n?{op:r,path:G}:ye===r?{op:n,path:G,value:w(Q)}:{op:t,path:G,value:w(Q)})})}function u(x,E,R,k){let{base_:N,copy_:L}=x,D=0;N.forEach(B=>{if(!L.has(B)){const Q=E.concat([D]);R.push({op:r,path:Q,value:B}),k.unshift({op:n,path:Q,value:B})}D++}),D=0,L.forEach(B=>{if(!N.has(B)){const Q=E.concat([D]);R.push({op:n,path:Q,value:B}),k.unshift({op:r,path:Q,value:B})}D++})}function p(x,E,R,k){R.push({op:t,path:[],value:E===lu?void 0:E}),k.push({op:t,path:[],value:x})}function g(x,E){return E.forEach(R=>{const{path:k,op:N}=R;let L=x;for(let ce=0;ce<k.length-1;ce++){const ye=Ug(L);let G=k[ce];typeof G!="string"&&typeof G!="number"&&(G=""+G),(ye===0||ye===1)&&(G==="__proto__"||G==="constructor")&&na(16+3),typeof L=="function"&&G==="prototype"&&na(16+3),L=b1(L,G),typeof L!="object"&&na(16+2,k.join("/"))}const D=Ug(L),B=v(R.value),Q=k[k.length-1];switch(N){case t:switch(D){case 2:return L.set(Q,B);case 3:na(16);default:return L[Q]=B}case n:switch(D){case 1:return Q==="-"?L.push(B):L.splice(Q,0,B);case 2:return L.set(Q,B);case 3:return L.add(B);default:return L[Q]=B}case r:switch(D){case 1:return L.splice(Q,1);case 2:return L.delete(Q);case 3:return L.delete(R.value);default:return delete L[Q]}default:na(16+1,N)}}),x}function v(x){if(!Hc(x))return x;if(Array.isArray(x))return x.map(v);if(db(x))return new Map(Array.from(x.entries()).map(([R,k])=>[R,v(k)]));if(fb(x))return new Set(Array.from(x).map(v));const E=Object.create(uu(x));for(const R in x)E[R]=v(x[R]);return ub(x,cu)&&(E[cu]=x[cu]),E}function w(x){return cc(x)?v(x):x}uP("Patches",{applyPatches_:g,generatePatches_:s,generateReplacementPatches_:p})}function Hce(){class e extends Map{constructor(p,g){super(),this[Or]={type_:2,parent_:g,scope_:g?g.scope_:ux(),modified_:!1,finalized_:!1,copy_:void 0,assigned_:void 0,base_:p,draft_:this,isManual_:!1,revoked_:!1}}get size(){return Qi(this[Or]).size}has(p){return Qi(this[Or]).has(p)}set(p,g){const v=this[Or];return i(v),(!Qi(v).has(p)||Qi(v).get(p)!==g)&&(n(v),Tp(v),v.assigned_.set(p,!0),v.copy_.set(p,g),v.assigned_.set(p,!0)),this}delete(p){if(!this.has(p))return!1;const g=this[Or];return i(g),n(g),Tp(g),g.base_.has(p)?g.assigned_.set(p,!1):g.assigned_.delete(p),g.copy_.delete(p),!0}clear(){const p=this[Or];i(p),Qi(p).size&&(n(p),Tp(p),p.assigned_=new Map,Dv(p.base_,g=>{p.assigned_.set(g,!1)}),p.copy_.clear())}forEach(p,g){const v=this[Or];Qi(v).forEach((w,x,E)=>{p.call(g,this.get(x),x,this)})}get(p){const g=this[Or];i(g);const v=Qi(g).get(p);if(g.finalized_||!Hc(v)||v!==g.base_.get(p))return v;const w=mb(v,g);return n(g),g.copy_.set(p,w),w}keys(){return Qi(this[Or]).keys()}values(){const p=this.keys();return{[Symbol.iterator]:()=>this.values(),next:()=>{const g=p.next();return g.done?g:{done:!1,value:this.get(g.value)}}}}entries(){const p=this.keys();return{[Symbol.iterator]:()=>this.entries(),next:()=>{const g=p.next();if(g.done)return g;const v=this.get(g.value);return{done:!1,value:[g.value,v]}}}}[Symbol.iterator](){return this.entries()}}function t(u,p){return new e(u,p)}function n(u){u.copy_||(u.assigned_=new Map,u.copy_=new Map(u.base_))}class r extends Set{constructor(p,g){super(),this[Or]={type_:3,parent_:g,scope_:g?g.scope_:ux(),modified_:!1,finalized_:!1,copy_:void 0,base_:p,draft_:this,drafts_:new Map,revoked_:!1,isManual_:!1}}get size(){return Qi(this[Or]).size}has(p){const g=this[Or];return i(g),g.copy_?!!(g.copy_.has(p)||g.drafts_.has(p)&&g.copy_.has(g.drafts_.get(p))):g.base_.has(p)}add(p){const g=this[Or];return i(g),this.has(p)||(o(g),Tp(g),g.copy_.add(p)),this}delete(p){if(!this.has(p))return!1;const g=this[Or];return i(g),o(g),Tp(g),g.copy_.delete(p)||(g.drafts_.has(p)?g.copy_.delete(g.drafts_.get(p)):!1)}clear(){const p=this[Or];i(p),Qi(p).size&&(o(p),Tp(p),p.copy_.clear())}values(){const p=this[Or];return i(p),o(p),p.copy_.values()}entries(){const p=this[Or];return i(p),o(p),p.copy_.entries()}keys(){return this.values()}[Symbol.iterator](){return this.values()}forEach(p,g){const v=this.values();let w=v.next();for(;!w.done;)p.call(g,w.value,w.value,this),w=v.next()}}function s(u,p){return new r(u,p)}function o(u){u.copy_||(u.copy_=new Set,u.base_.forEach(p=>{if(Hc(p)){const g=mb(p,u);u.drafts_.set(p,g),u.copy_.add(g)}else u.copy_.add(p)}))}function i(u){u.revoked_&&na(3,JSON.stringify(Qi(u)))}uP("MapSet",{proxyMap_:t,proxySet_:s})}var du=new AF,Wce=du.produce,qce=du.produceWithPatches.bind(du),Kce=du.setAutoFreeze.bind(du),Gce=du.setUseStrictShallowCopy.bind(du),Qce=du.applyPatches.bind(du),Yce=du.createDraft.bind(du),Xce=du.finishDraft.bind(du);function Zce(e){return e}function Jce(e){return e}var IF=(e,t,n)=>{if(t.length===1&&t[0]===n){let r=!1;try{const s={};e(s)===s&&(r=!0)}catch{}if(r){let s;try{throw new Error}catch(o){({stack:s}=o)}console.warn(`The result function returned its own inputs without modification. e.g
\`createSelector([state => state.todos], todos => todos)\`
This could lead to inefficient memoization and unnecessary re-renders.
Ensure transformation logic is in the result function, and extraction logic is in the input selectors.`,{stack:s})}}},jF=(e,t,n)=>{const{memoize:r,memoizeOptions:s}=t,{inputSelectorResults:o,inputSelectorResultsCopy:i}=e,u=r(()=>({}),...s);if(!(u.apply(null,o)===u.apply(null,i))){let g;try{throw new Error}catch(v){({stack:g}=v)}console.warn(`An input selector returned a different result when passed same arguments.
This means your output selector will likely run more frequently than intended.
Avoid returning a new reference inside your input selector, e.g.
\`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)\``,{arguments:n,firstInputs:o,secondInputs:i,stack:g})}},yP={inputStabilityCheck:"once",identityFunctionCheck:"once"},eue=e=>{Object.assign(yP,e)},px="NOT_FOUND";function bP(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function DF(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function MF(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var wP=e=>Array.isArray(e)?e:[e];function $F(e){const t=Array.isArray(e[0])?e[0]:e;return MF(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function LF(e,t){const n=[],{length:r}=e;for(let s=0;s<r;s++)n.push(e[s].apply(null,t));return n}var tue=(e,t)=>{const{identityFunctionCheck:n,inputStabilityCheck:r}={...yP,...t};return{identityFunctionCheck:{shouldRun:n==="always"||n==="once"&&e,run:IF},inputStabilityCheck:{shouldRun:r==="always"||r==="once"&&e,run:jF}}},xP=0,gb=null,R1=class{revision=xP;_value;_lastValue;_isEqual=P1;constructor(e,t=P1){this._value=this._lastValue=e,this._isEqual=t}get value(){return gb?.add(this),this._value}set value(e){this.value!==e&&(this._value=e,this.revision=++xP)}};function P1(e,t){return e===t}var FF=class{_cachedValue;_cachedRevision=-1;_deps=[];hits=0;fn;constructor(e){this.fn=e}clear(){this._cachedValue=void 0,this._cachedRevision=-1,this._deps=[],this.hits=0}get value(){if(this.revision>this._cachedRevision){const{fn:e}=this,t=new Set,n=gb;gb=t,this._cachedValue=e(),gb=n,this.hits++,this._deps=Array.from(t),this._cachedRevision=this.revision}return gb?.add(this),this._cachedValue}get revision(){return Math.max(...this._deps.map(e=>e.revision),0)}};function O1(e){return e instanceof R1||console.warn("Not a valid cell! ",e),e.value}function zF(e,t){if(!(e instanceof R1))throw new TypeError("setValue must be passed a tracked store created with `createStorage`.");e.value=e._lastValue=t}function UF(e,t=P1){return new R1(e,t)}function BF(e){return bP(e,"the first parameter to `createCache` must be a function"),new FF(e)}var VF=(e,t)=>!1;function hx(){return UF(null,VF)}function mx(e,t){zF(e,t)}var _P=e=>{let t=e.collectionTag;t===null&&(t=e.collectionTag=hx()),O1(t)},gx=e=>{const t=e.collectionTag;t!==null&&mx(t,null)},nue=Symbol(),SP=0,HF=Object.getPrototypeOf({}),WF=class{constructor(e){this.value=e,this.value=e,this.tag.value=e}proxy=new Proxy(this,vb);tag=hx();tags={};children={};collectionTag=null;id=SP++},vb={get(e,t){function n(){const{value:s}=e,o=Reflect.get(s,t);if(typeof t=="symbol"||t in HF)return o;if(typeof o=="object"&&o!==null){let i=e.children[t];return i===void 0&&(i=e.children[t]=CP(o)),i.tag&&O1(i.tag),i.proxy}else{let i=e.tags[t];return i===void 0&&(i=e.tags[t]=hx(),i.value=o),O1(i),o}}return n()},ownKeys(e){return _P(e),Reflect.ownKeys(e.value)},getOwnPropertyDescriptor(e,t){return Reflect.getOwnPropertyDescriptor(e.value,t)},has(e,t){return Reflect.has(e.value,t)}},qF=class{constructor(e){this.value=e,this.value=e,this.tag.value=e}proxy=new Proxy([this],KF);tag=hx();tags={};children={};collectionTag=null;id=SP++},KF={get([e],t){return t==="length"&&_P(e),vb.get(e,t)},ownKeys([e]){return vb.ownKeys(e)},getOwnPropertyDescriptor([e],t){return vb.getOwnPropertyDescriptor(e,t)},has([e],t){return vb.has(e,t)}};function CP(e){return Array.isArray(e)?new qF(e):new WF(e)}function EP(e,t){const{value:n,tags:r,children:s}=e;if(e.value=t,Array.isArray(n)&&Array.isArray(t)&&n.length!==t.length)gx(e);else if(n!==t){let o=0,i=0,u=!1;for(const g in n)o++;for(const g in t)if(i++,!(g in n)){u=!0;break}(u||o!==i)&&gx(e)}for(const o in r){const i=n[o],u=t[o];i!==u&&(gx(e),mx(r[o],u)),typeof u=="object"&&u!==null&&delete r[o]}for(const o in s){const i=s[o],u=t[o];i.value!==u&&(typeof u=="object"&&u!==null?EP(i,u):(TP(i),delete s[o]))}}function TP(e){e.tag&&mx(e.tag,null),gx(e);for(const t in e.tags)mx(e.tags[t],null);for(const t in e.children)TP(e.children[t])}function GF(e){let t;return{get(n){return t&&e(t.key,n)?t.value:px},put(n,r){t={key:n,value:r}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function QF(e,t){let n=[];function r(u){const p=n.findIndex(g=>t(u,g.key));if(p>-1){const g=n[p];return p>0&&(n.splice(p,1),n.unshift(g)),g.value}return px}function s(u,p){r(u)===px&&(n.unshift({key:u,value:p}),n.length>e&&n.pop())}function o(){return n}function i(){n=[]}return{get:r,put:s,getEntries:o,clear:i}}var kP=(e,t)=>e===t;function RP(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;const{length:s}=n;for(let o=0;o<s;o++)if(!e(n[o],r[o]))return!1;return!0}}function rue(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:r=kP,maxSize:s=1,resultEqualityCheck:o}=n,i=RP(r);let u=0;const p=s===1?GF(i):QF(s,i);function g(){let v=p.get(arguments);if(v===px){if(v=e.apply(null,arguments),u++,o){const x=p.getEntries().find(E=>o(E.value,v));x&&(v=x.value,u!==0&&u--)}p.put(arguments,v)}return v}return g.clearCache=()=>{p.clear(),g.resetResultsCount()},g.resultsCount=()=>u,g.resetResultsCount=()=>{u=0},g}function sue(e){const t=CP([]);let n=null;const r=RP(kP),s=BF(()=>e.apply(null,t.proxy));function o(){return r(n,arguments)||(EP(t,arguments),n=arguments),s.value}return o.clearCache=()=>s.clear(),o}var YF=class{constructor(e){this.value=e}deref(){return this.value}},XF=typeof WeakRef<"u"?WeakRef:YF,ZF=0,PP=1;function vx(){return{s:ZF,v:void 0,o:null,p:null}}function N1(e,t={}){let n=vx();const{resultEqualityCheck:r}=t;let s,o=0;function i(){let u=n;const{length:p}=arguments;for(let w=0,x=p;w<x;w++){const E=arguments[w];if(typeof E=="function"||typeof E=="object"&&E!==null){let R=u.o;R===null&&(u.o=R=new WeakMap);const k=R.get(E);k===void 0?(u=vx(),R.set(E,u)):u=k}else{let R=u.p;R===null&&(u.p=R=new Map);const k=R.get(E);k===void 0?(u=vx(),R.set(E,u)):u=k}}const g=u;let v;if(u.s===PP?v=u.v:(v=e.apply(null,arguments),o++),g.s=PP,r){const w=s?.deref?.()??s;w!=null&&r(w,v)&&(v=w,o!==0&&o--),s=typeof v=="object"&&v!==null||typeof v=="function"?new XF(v):v}return g.v=v,v}return i.clearCache=()=>{n=vx(),i.resetResultsCount()},i.resultsCount=()=>o,i.resetResultsCount=()=>{o=0},i}function OP(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...s)=>{let o=0,i=0,u,p={},g=s.pop();typeof g=="object"&&(p=g,g=s.pop()),bP(g,`createSelector expects an output function after the inputs, but received: [${typeof g}]`);const v={...n,...p},{memoize:w,memoizeOptions:x=[],argsMemoize:E=N1,argsMemoizeOptions:R=[],devModeChecks:k={}}=v,N=wP(x),L=wP(R),D=$F(s),B=w(function(){return o++,g.apply(null,arguments)},...N);let Q=!0;const ce=E(function(){i++;const G=LF(D,arguments);return u=B.apply(null,G),u},...L);return Object.assign(ce,{resultFunc:g,memoizedResultFunc:B,dependencies:D,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>u,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:w,argsMemoize:E})};return Object.assign(r,{withTypes:()=>r}),r}var JF=OP(N1),e6=Object.assign((e,t=JF)=>{DF(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(o=>e[o]);return t(r,(...o)=>o.reduce((i,u,p)=>(i[n[p]]=u,i),{}))},{withTypes:()=>e6});function Yi(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var t6=(()=>typeof Symbol=="function"&&Symbol.observable||"@@observable")(),NP=t6,A1=()=>Math.random().toString(36).substring(7).split("").join("."),n6={INIT:`@@redux/INIT${A1()}`,REPLACE:`@@redux/REPLACE${A1()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${A1()}`},Mv=n6;function yx(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function oue(e){if(e===void 0)return"undefined";if(e===null)return"null";const t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(o6(e))return"date";if(s6(e))return"error";const n=r6(e);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return Object.prototype.toString.call(e).slice(8,-1).toLowerCase().replace(/\s/g,"")}function r6(e){return typeof e.constructor=="function"?e.constructor.name:null}function s6(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function o6(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function a6(e){return typeof e}function I1(e,t,n){if(typeof e!="function")throw new Error(Yi(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Yi(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Yi(1));return n(I1)(e,t)}let r=e,s=t,o=new Map,i=o,u=0,p=!1;function g(){i===o&&(i=new Map,o.forEach((N,L)=>{i.set(L,N)}))}function v(){if(p)throw new Error(Yi(3));return s}function w(N){if(typeof N!="function")throw new Error(Yi(4));if(p)throw new Error(Yi(5));let L=!0;g();const D=u++;return i.set(D,N),function(){if(L){if(p)throw new Error(Yi(6));L=!1,g(),i.delete(D),o=null}}}function x(N){if(!yx(N))throw new Error(Yi(7));if(typeof N.type>"u")throw new Error(Yi(8));if(typeof N.type!="string")throw new Error(Yi(17));if(p)throw new Error(Yi(9));try{p=!0,s=r(s,N)}finally{p=!1}return(o=i).forEach(D=>{D()}),N}function E(N){if(typeof N!="function")throw new Error(Yi(10));r=N,x({type:Mv.REPLACE})}function R(){const N=w;return{subscribe(L){if(typeof L!="object"||L===null)throw new Error(Yi(11));function D(){const Q=L;Q.next&&Q.next(v())}return D(),{unsubscribe:N(D)}},[NP](){return this}}}return x({type:Mv.INIT}),{dispatch:x,subscribe:w,getState:v,replaceReducer:E,[NP]:R}}function aue(e,t,n){return I1(e,t,n)}function iue(e){typeof console<"u"&&typeof console.error=="function"&&console.error(e);try{throw new Error(e)}catch{}}function lue(e,t,n,r){const s=Object.keys(t),o=n&&n.type===Mv.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(s.length===0)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!yx(e))return`The ${o} has unexpected type of "${a6(e)}". Expected argument to be an object with the following keys: "${s.join('", "')}"`;const i=Object.keys(e).filter(u=>!t.hasOwnProperty(u)&&!r[u]);if(i.forEach(u=>{r[u]=!0}),!(n&&n.type===Mv.REPLACE)&&i.length>0)return`Unexpected ${i.length>1?"keys":"key"} "${i.join('", "')}" found in ${o}. Expected to find one of the known reducer keys instead: "${s.join('", "')}". Unexpected keys will be ignored.`}function i6(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:Mv.INIT})>"u")throw new Error(Yi(12));if(typeof n(void 0,{type:Mv.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Yi(13))})}function l6(e){const t=Object.keys(e),n={};for(let i=0;i<t.length;i++){const u=t[i];typeof e[u]=="function"&&(n[u]=e[u])}const r=Object.keys(n);let s,o;try{i6(n)}catch(i){o=i}return function(u={},p){if(o)throw o;let g=!1;const v={};for(let w=0;w<r.length;w++){const x=r[w],E=n[x],R=u[x],k=E(R,p);if(typeof k>"u"){const N=p&&p.type;throw new Error(Yi(14))}v[x]=k,g=g||k!==R}return g=g||r.length!==Object.keys(u).length,g?v:u}}function AP(e,t){return function(...n){return t(e.apply(this,n))}}function cue(e,t){if(typeof e=="function")return AP(e,t);if(typeof e!="object"||e===null)throw new Error(Yi(16));const n={};for(const r in e){const s=e[r];typeof s=="function"&&(n[r]=AP(s,t))}return n}function bx(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function c6(...e){return t=>(n,r)=>{const s=t(n,r);let o=()=>{throw new Error(Yi(15))};const i={getState:s.getState,dispatch:(p,...g)=>o(p,...g)},u=e.map(p=>p(i));return o=bx(...u)(s.dispatch),{...s,dispatch:o}}}function u6(e){return yx(e)&&"type"in e&&typeof e.type=="string"}function IP(e){return({dispatch:n,getState:r})=>s=>o=>typeof o=="function"?o(n,r,e):s(o)}var d6=IP(),f6=IP,p6=(...e)=>{const t=OP(...e),n=Object.assign((...r)=>{const s=t(...r),o=(i,...u)=>s(cc(i)?gP(i):i,...u);return Object.assign(o,s),o},{withTypes:()=>n});return n},h6=p6(N1),m6=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?bx:bx.apply(null,arguments)},uue=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},jP=e=>e&&typeof e.match=="function";function If(e,t){function n(...r){if(t){let s=t(...r);if(!s)throw new Error(Ba(0));return{type:e,payload:s.payload,..."meta"in s&&{meta:s.meta},..."error"in s&&{error:s.error}}}return{type:e,payload:r[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=r=>u6(r)&&r.type===e,n}function g6(e){return typeof e=="function"&&"type"in e&&jP(e)}function v6(e){return isAction(e)&&Object.keys(e).every(y6)}function y6(e){return["type","payload","error","meta"].indexOf(e)>-1}function b6(e){const t=e?`${e}`.split("/"):[],n=t[t.length-1]||"actionCreator";return`Detected an action creator with type "${e||"unknown"}" being dispatched. 
Make sure you're calling the action creator before dispatching, i.e. \`dispatch(${n}())\` instead of \`dispatch(${n})\`. This is necessary even if the action has no payload.`}function due(e={}){return()=>n=>r=>n(r)}function fue(e,t){let n=0;return{measureTime(r){const s=Date.now();try{return r()}finally{const o=Date.now();n+=o-s}},warnIfExceeded(){n>e&&console.warn(`${t} took ${n}ms, which is more than the warning threshold of ${e}ms. 
If your state or actions are very large, you may want to disable the middleware as it might cause too much of a slowdown in development mode. See https://redux-toolkit.js.org/api/getDefaultMiddleware for instructions.
It is disabled in production builds, so you don't need to worry about that.`)}}}function j1(e,t){for(const n of e)if(t(n))return n}var DP=class Uw extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Uw.prototype)}static get[Symbol.species](){return Uw}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Uw(...t[0].concat(this)):new Uw(...t.concat(this))}};function MP(e){return isDraftable(e)?createNextState(e,()=>{}):e}function wx(e,t,n){if(e.has(t)){let s=e.get(t);return n.update&&(s=n.update(s,t,e),e.set(t,s)),s}if(!n.insert)throw new Error(Ba(10));const r=n.insert(t,e);return e.set(t,r),r}function pue(e){return typeof e!="object"||e==null||Object.isFrozen(e)}function hue(e,t,n){const r=$P(e,t,n);return{detectMutations(){return LP(e,t,r,n)}}}function $P(e,t=[],n,r="",s=new Set){const o={value:n};if(!e(n)&&!s.has(n)){s.add(n),o.children={};for(const i in n){const u=r?r+"."+i:i;t.length&&t.indexOf(u)!==-1||(o.children[i]=$P(e,t,n[i],u))}}return o}function LP(e,t=[],n,r,s=!1,o=""){const i=n?n.value:void 0,u=i===r;if(s&&!u&&!Number.isNaN(r))return{wasMutated:!0,path:o};if(e(i)||e(r))return{wasMutated:!1};const p={};for(let v in n.children)p[v]=!0;for(let v in r)p[v]=!0;const g=t.length>0;for(let v in p){const w=o?o+"."+v:v;if(g&&t.some(R=>R instanceof RegExp?R.test(w):w===R))continue;const x=LP(e,t,n.children[v],r[v],u,w);if(x.wasMutated)return x}return{wasMutated:!1}}function mue(e={}){if(!0)return()=>r=>s=>r(s);var t,n}function w6(e){const t=typeof e;return e==null||t==="string"||t==="boolean"||t==="number"||Array.isArray(e)||isPlainObject(e)}function x6(e,t="",n=w6,r,s=[],o){let i;if(!n(e))return{keyPath:t||"<root>",value:e};if(typeof e!="object"||e===null||o?.has(e))return!1;const u=r!=null?r(e):Object.entries(e),p=s.length>0;for(const[g,v]of u){const w=t?t+"."+g:g;if(!(p&&s.some(E=>E instanceof RegExp?E.test(w):w===E))){if(!n(v))return{keyPath:w,value:v};if(typeof v=="object"&&(i=x6(v,w,n,r,s,o),i))return i}}return o&&FP(e)&&o.add(e),!1}function FP(e){if(!Object.isFrozen(e))return!1;for(const t of Object.values(e))if(!(typeof t!="object"||t===null)&&!FP(t))return!1;return!0}function gue(e={}){return()=>t=>n=>t(n)}function _6(e){return typeof e=="boolean"}var S6=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:s=!0,actionCreatorCheck:o=!0}=t??{};let i=new DP;return n&&(_6(n)?i.push(d6):i.push(f6(n.extraArgument))),i},zP="RTK_autoBatch",vue=()=>e=>({payload:e,meta:{[zP]:!0}}),UP=e=>t=>{setTimeout(t,e)},C6=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:UP(10),E6=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let s=!0,o=!1,i=!1;const u=new Set,p=e.type==="tick"?queueMicrotask:e.type==="raf"?C6:e.type==="callback"?e.queueNotification:UP(e.timeout),g=()=>{i=!1,o&&(o=!1,u.forEach(v=>v()))};return Object.assign({},r,{subscribe(v){const w=()=>s&&v(),x=r.subscribe(w);return u.add(v),()=>{x(),u.delete(v)}},dispatch(v){try{return s=!v?.meta?.[zP],o=!s,o&&(i||(i=!0,p(g))),r.dispatch(v)}finally{s=!0}}})},T6=e=>function(n){const{autoBatch:r=!0}=n??{};let s=new DP(e);return r&&s.push(E6(typeof r=="object"?r:void 0)),s},Kh=!0;function k6(e){const t=S6(),{reducer:n=void 0,middleware:r,devTools:s=!0,preloadedState:o=void 0,enhancers:i=void 0}=e||{};let u;if(typeof n=="function")u=n;else if(yx(n))u=l6(n);else throw new Error(Ba(1));if(!Kh&&r&&typeof r!="function")throw new Error(Ba(2));let p;if(typeof r=="function"){if(p=r(t),!Kh&&!Array.isArray(p))throw new Error(Ba(3))}else p=t();if(!Kh&&p.some(R=>typeof R!="function"))throw new Error(Ba(4));let g=bx;s&&(g=m6({trace:!Kh,...typeof s=="object"&&s}));const v=c6(...p),w=T6(v);if(!Kh&&i&&typeof i!="function")throw new Error(Ba(5));let x=typeof i=="function"?i(w):w();if(!Kh&&!Array.isArray(x))throw new Error(Ba(6));if(!Kh&&x.some(R=>typeof R!="function"))throw new Error(Ba(7));!Kh&&p.length&&!x.includes(v)&&console.error("middlewares were provided, but middleware enhancer was not included in final enhancers - make sure to call `getDefaultEnhancers`");const E=g(...x);return I1(u,o,E)}function BP(e){const t={},n=[];let r;const s={addCase(o,i){const u=typeof o=="string"?o:o.type;if(!u)throw new Error(Ba(28));if(u in t)throw new Error(Ba(29));return t[u]=i,s},addMatcher(o,i){return n.push({matcher:o,reducer:i}),s},addDefaultCase(o){return r=o,s}};return e(s),[t,n,r]}function R6(e){return typeof e=="function"}function P6(e,t){let[n,r,s]=BP(t),o;if(R6(e))o=()=>MP(e());else{const u=MP(e);o=()=>u}function i(u=o(),p){let g=[n[p.type],...r.filter(({matcher:v})=>v(p)).map(({reducer:v})=>v)];return g.filter(v=>!!v).length===0&&(g=[s]),g.reduce((v,w)=>{if(w)if(isDraft2(v)){const E=w(v,p);return E===void 0?v:E}else{if(isDraftable2(v))return createNextState2(v,x=>w(x,p));{const x=w(v,p);if(x===void 0){if(v===null)return v;throw new Error(Ba(9))}return x}}return v},u)}return i.getInitialState=o,i}var O6="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",yb=(e=21)=>{let t="",n=e;for(;n--;)t+=O6[Math.random()*64|0];return t},VP=(e,t)=>jP(e)?e.match(t):e(t);function bb(...e){return t=>e.some(n=>VP(n,t))}function D1(...e){return t=>e.every(n=>VP(n,t))}function xx(e,t){if(!e||!e.meta)return!1;const n=typeof e.meta.requestId=="string",r=t.indexOf(e.meta.requestStatus)>-1;return n&&r}function wb(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function N6(...e){return e.length===0?t=>xx(t,["pending"]):wb(e)?bb(...e.map(t=>t.pending)):N6()(e[0])}function M1(...e){return e.length===0?t=>xx(t,["rejected"]):wb(e)?bb(...e.map(t=>t.rejected)):M1()(e[0])}function A6(...e){const t=n=>n&&n.meta&&n.meta.rejectedWithValue;return e.length===0?D1(M1(...e),t):wb(e)?D1(M1(...e),t):A6()(e[0])}function I6(...e){return e.length===0?t=>xx(t,["fulfilled"]):wb(e)?bb(...e.map(t=>t.fulfilled)):I6()(e[0])}function j6(...e){return e.length===0?t=>xx(t,["pending","fulfilled","rejected"]):wb(e)?bb(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):j6()(e[0])}var D6=["name","message","stack","code"],$1=class{constructor(e,t){this.payload=e,this.meta=t}_type},HP=class{constructor(e,t){this.payload=e,this.meta=t}_type},M6=e=>{if(typeof e=="object"&&e!==null){const t={};for(const n of D6)typeof e[n]=="string"&&(t[n]=e[n]);return t}return{message:String(e)}},$6=(()=>{function e(t,n,r){const s=If(t+"/fulfilled",(p,g,v,w)=>({payload:p,meta:{...w||{},arg:v,requestId:g,requestStatus:"fulfilled"}})),o=If(t+"/pending",(p,g,v)=>({payload:void 0,meta:{...v||{},arg:g,requestId:p,requestStatus:"pending"}})),i=If(t+"/rejected",(p,g,v,w,x)=>({payload:w,error:(r&&r.serializeError||M6)(p||"Rejected"),meta:{...x||{},arg:v,requestId:g,rejectedWithValue:!!w,requestStatus:"rejected",aborted:p?.name==="AbortError",condition:p?.name==="ConditionError"}}));function u(p){return(g,v,w)=>{const x=r?.idGenerator?r.idGenerator(p):yb(),E=new AbortController;let R,k;function N(D){k=D,E.abort()}const L=async function(){let D;try{let Q=r?.condition?.(p,{getState:v,extra:w});if(F6(Q)&&(Q=await Q),Q===!1||E.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const ce=new Promise((ye,G)=>{R=()=>{G({name:"AbortError",message:k||"Aborted"})},E.signal.addEventListener("abort",R)});g(o(x,p,r?.getPendingMeta?.({requestId:x,arg:p},{getState:v,extra:w}))),D=await Promise.race([ce,Promise.resolve(n(p,{dispatch:g,getState:v,extra:w,requestId:x,signal:E.signal,abort:N,rejectWithValue:(ye,G)=>new $1(ye,G),fulfillWithValue:(ye,G)=>new HP(ye,G)})).then(ye=>{if(ye instanceof $1)throw ye;return ye instanceof HP?s(ye.payload,x,p,ye.meta):s(ye,x,p)})])}catch(Q){D=Q instanceof $1?i(null,x,p,Q.payload,Q.meta):i(Q,x,p)}finally{R&&E.signal.removeEventListener("abort",R)}return r&&!r.dispatchConditionRejection&&i.match(D)&&D.meta.condition||g(D),D}();return Object.assign(L,{abort:N,requestId:x,arg:p,unwrap(){return L.then(L6)}})}}return Object.assign(u,{pending:o,rejected:i,fulfilled:s,settled:bb(i,s),typePrefix:t})}return e.withTypes=()=>e,e})();function L6(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function F6(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var WP=Symbol.for("rtk-slice-createasyncthunk"),yue={[WP]:$6},z6=(e=>(e.reducer="reducer",e.reducerWithPrepare="reducerWithPrepare",e.asyncThunk="asyncThunk",e))(z6||{});function U6(e,t){return`${e}/${t}`}function bue({creators:e}={}){const t=e?.asyncThunk?.[WP];return function(r){const{name:s,reducerPath:o=s}=r;if(!s)throw new Error(Ba(11));typeof process<"u";const i=(typeof r.reducers=="function"?r.reducers(V6()):r.reducers)||{},u=Object.keys(i),p={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},g={addCase(D,B){const Q=typeof D=="string"?D:D.type;if(!Q)throw new Error(Ba(12));if(Q in p.sliceCaseReducersByType)throw new Error(Ba(13));return p.sliceCaseReducersByType[Q]=B,g},addMatcher(D,B){return p.sliceMatchers.push({matcher:D,reducer:B}),g},exposeAction(D,B){return p.actionCreators[D]=B,g},exposeCaseReducer(D,B){return p.sliceCaseReducersByName[D]=B,g}};u.forEach(D=>{const B=i[D],Q={reducerName:D,type:U6(s,D),createNotation:typeof r.reducers=="function"};W6(B)?K6(Q,B,g,t):H6(Q,B,g)});function v(){const[D={},B=[],Q=void 0]=typeof r.extraReducers=="function"?BP(r.extraReducers):[r.extraReducers],ce={...D,...p.sliceCaseReducersByType};return P6(r.initialState,ye=>{for(let G in ce)ye.addCase(G,ce[G]);for(let G of p.sliceMatchers)ye.addMatcher(G.matcher,G.reducer);for(let G of B)ye.addMatcher(G.matcher,G.reducer);Q&&ye.addDefaultCase(Q)})}const w=D=>D,x=new Map;let E;function R(D,B){return E||(E=v()),E(D,B)}function k(){return E||(E=v()),E.getInitialState()}function N(D,B=!1){function Q(ye){let G=ye[D];return typeof G>"u"&&B&&(G=k()),G}function ce(ye=w){const G=wx(x,B,{insert:()=>new WeakMap});return wx(G,ye,{insert:()=>{const Le={};for(const[We,at]of Object.entries(r.selectors??{}))Le[We]=B6(at,ye,k,B);return Le}})}return{reducerPath:D,getSelectors:ce,get selectors(){return ce(Q)},selectSlice:Q}}const L={name:s,reducer:R,actions:p.actionCreators,caseReducers:p.sliceCaseReducersByName,getInitialState:k,...N(o),injectInto(D,{reducerPath:B,...Q}={}){const ce=B??o;return D.inject({reducerPath:ce,reducer:R},Q),{...L,...N(ce,!0)}}};return L}}function B6(e,t,n,r){function s(o,...i){let u=t(o);return typeof u>"u"&&r&&(u=n()),e(u,...i)}return s.unwrapped=e,s}var wue=null;function V6(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function H6({type:e,reducerName:t,createNotation:n},r,s){let o,i;if("reducer"in r){if(n&&!q6(r))throw new Error(Ba(17));o=r.reducer,i=r.prepare}else o=r;s.addCase(e,o).exposeCaseReducer(t,o).exposeAction(t,i?If(e,i):If(e))}function W6(e){return e._reducerDefinitionType==="asyncThunk"}function q6(e){return e._reducerDefinitionType==="reducerWithPrepare"}function K6({type:e,reducerName:t},n,r,s){if(!s)throw new Error(Ba(18));const{payloadCreator:o,fulfilled:i,pending:u,rejected:p,settled:g,options:v}=n,w=s(e,o,v);r.exposeAction(t,w),i&&r.addCase(w.fulfilled,i),u&&r.addCase(w.pending,u),p&&r.addCase(w.rejected,p),g&&r.addMatcher(w.settled,g),r.exposeCaseReducer(t,{fulfilled:i||_x,pending:u||_x,rejected:p||_x,settled:g||_x})}function _x(){}function G6(){return{ids:[],entities:{}}}function Q6(e){function t(n={},r){const s=Object.assign(G6(),n);return r?e.setAll(s,r):s}return{getInitialState:t}}function Y6(){function e(t,n={}){const{createSelector:r=h6}=n,s=w=>w.ids,o=w=>w.entities,i=r(s,o,(w,x)=>w.map(E=>x[E])),u=(w,x)=>x,p=(w,x)=>w[x],g=r(s,w=>w.length);if(!t)return{selectIds:s,selectEntities:o,selectAll:i,selectTotal:g,selectById:r(o,u,p)};const v=r(t,o);return{selectIds:r(t,s),selectEntities:v,selectAll:r(t,i),selectTotal:r(t,g),selectById:r(v,u,p)}}return{getSelectors:e}}var X6=null;function Z6(e){const t=li((n,r)=>e(r));return function(r){return t(r,void 0)}}function li(e){return function(n,r){function s(i){return v6(i)}const o=i=>{s(r)?e(r.payload,i):e(r,i)};return X6(n)?(o(n),n):createNextState3(n,o)}}function $v(e,t){return t(e)}function Vg(e){return Array.isArray(e)||(e=Object.values(e)),e}function qP(e){return isDraft4(e)?current2(e):e}function KP(e,t,n){e=Vg(e);const r=current2(n.ids),s=new Set(r),o=[],i=[];for(const u of e){const p=$v(u,t);s.has(p)?i.push({id:p,changes:u}):o.push(u)}return[o,i,r]}function GP(e){function t(R,k){const N=$v(R,e);N in k.entities||(k.ids.push(N),k.entities[N]=R)}function n(R,k){R=Vg(R);for(const N of R)t(N,k)}function r(R,k){const N=$v(R,e);N in k.entities||k.ids.push(N),k.entities[N]=R}function s(R,k){R=Vg(R);for(const N of R)r(N,k)}function o(R,k){R=Vg(R),k.ids=[],k.entities={},n(R,k)}function i(R,k){return u([R],k)}function u(R,k){let N=!1;R.forEach(L=>{L in k.entities&&(delete k.entities[L],N=!0)}),N&&(k.ids=k.ids.filter(L=>L in k.entities))}function p(R){Object.assign(R,{ids:[],entities:{}})}function g(R,k,N){const L=N.entities[k.id];if(L===void 0)return!1;const D=Object.assign({},L,k.changes),B=$v(D,e),Q=B!==k.id;return Q&&(R[k.id]=B,delete N.entities[k.id]),N.entities[B]=D,Q}function v(R,k){return w([R],k)}function w(R,k){const N={},L={};R.forEach(B=>{B.id in k.entities&&(L[B.id]={id:B.id,changes:{...L[B.id]?L[B.id].changes:null,...B.changes}})}),R=Object.values(L),R.length>0&&R.filter(Q=>g(N,Q,k)).length>0&&(k.ids=Object.values(k.entities).map(Q=>$v(Q,e)))}function x(R,k){return E([R],k)}function E(R,k){const[N,L]=KP(R,e,k);w(L,k),n(N,k)}return{removeAll:Z6(p),addOne:li(t),addMany:li(n),setOne:li(r),setMany:li(s),setAll:li(o),updateOne:li(v),updateMany:li(w),upsertOne:li(x),upsertMany:li(E),removeOne:li(i),removeMany:li(u)}}function J6(e,t,n){let r=0,s=e.length;for(;r<s;){let o=r+s>>>1;const i=e[o];n(t,i)>=0?r=o+1:s=o}return r}function e4(e,t,n){const r=J6(e,t,n);return e.splice(r,0,t),e}function t4(e,t){const{removeOne:n,removeMany:r,removeAll:s}=GP(e);function o(L,D){return i([L],D)}function i(L,D,B){L=Vg(L);const Q=new Set(B??current3(D.ids)),ce=L.filter(ye=>!Q.has($v(ye,e)));ce.length!==0&&N(D,ce)}function u(L,D){return p([L],D)}function p(L,D){if(L=Vg(L),L.length!==0){for(const B of L)delete D.entities[e(B)];N(D,L)}}function g(L,D){L=Vg(L),D.entities={},D.ids=[],i(L,D,[])}function v(L,D){return w([L],D)}function w(L,D){let B=!1,Q=!1;for(let ce of L){const ye=D.entities[ce.id];if(!ye)continue;B=!0,Object.assign(ye,ce.changes);const G=e(ye);if(ce.id!==G){Q=!0,delete D.entities[ce.id];const Le=D.ids.indexOf(ce.id);D.ids[Le]=G,D.entities[G]=ye}}B&&N(D,[],B,Q)}function x(L,D){return E([L],D)}function E(L,D){const[B,Q,ce]=KP(L,e,D);Q.length&&w(Q,D),B.length&&i(B,D,ce)}function R(L,D){if(L.length!==D.length)return!1;for(let B=0;B<L.length&&B<D.length;B++)if(L[B]!==D[B])return!1;return!0}const N=(L,D,B,Q)=>{const ce=qP(L.entities),ye=qP(L.ids),G=L.entities;let Le=ye;Q&&(Le=Array.from(new Set(ye)));let We=[];for(const xt of Le){const Mt=ce[xt];Mt&&We.push(Mt)}const at=We.length===0;for(const xt of D)G[e(xt)]=xt,at||e4(We,xt,t);at?We=D.slice().sort(t):B&&We.sort(t);const St=We.map(e);R(ye,St)||(L.ids=St)};return{removeOne:n,removeMany:r,removeAll:s,addOne:li(o),updateOne:li(v),upsertOne:li(x),setOne:li(u),setMany:li(p),setAll:li(g),addMany:li(i),updateMany:li(w),upsertMany:li(E)}}function xue(e={}){const{selectId:t,sortComparer:n}={sortComparer:!1,selectId:i=>i.id,...e},r=n?t4(t,n):GP(t),s=Q6(r),o=Y6();return{selectId:t,sortComparer:n,...s,...o,...r}}var n4="task",_ue="listener",Sue="completed",r4="cancelled",s4=null,o4=null,L1=null,a4=null,Sx=class{constructor(e){this.code=e,this.message=`${n4} ${r4} (reason: ${e})`}name="TaskAbortError";message},F1=(e,t)=>{if(typeof e!="function")throw new Error(Ba(32))},Cx=()=>{},QP=(e,t=Cx)=>(e.catch(t),e),YP=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Hg=(e,t)=>{const n=e.signal;n.aborted||("reason"in n||Object.defineProperty(n,"reason",{enumerable:!0,value:t,configurable:!0,writable:!0}),e.abort(t))},Wg=e=>{if(e.aborted){const{reason:t}=e;throw new Sx(t)}};function XP(e,t){let n=Cx;return new Promise((r,s)=>{const o=()=>s(new Sx(e.reason));if(e.aborted){o();return}n=YP(e,o),t.finally(()=>n()).then(r,s)}).finally(()=>{n=Cx})}var i4=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof Sx?"cancelled":"rejected",error:n}}finally{t?.()}},Ex=e=>t=>QP(XP(e,t).then(n=>(Wg(e),n))),ZP=e=>{const t=Ex(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:l4}=Object,JP={},Tx="listenerMiddleware",c4=(e,t)=>{const n=r=>YP(e,()=>Hg(r,e.reason));return(r,s)=>{F1(r,"taskExecutor");const o=new AbortController;n(o);const i=i4(async()=>{Wg(e),Wg(o.signal);const u=await r({pause:Ex(o.signal),delay:ZP(o.signal),signal:o.signal});return Wg(o.signal),u},()=>Hg(o,o4));return s?.autoJoin&&t.push(i.catch(Cx)),{result:Ex(e)(i),cancel(){Hg(o,s4)}}}},u4=(e,t)=>{const n=async(r,s)=>{Wg(t);let o=()=>{};const u=[new Promise((p,g)=>{let v=e({predicate:r,effect:(w,x)=>{x.unsubscribe(),p([w,x.getState(),x.getOriginalState()])}});o=()=>{v(),g()}})];s!=null&&u.push(new Promise(p=>setTimeout(p,s,null)));try{const p=await XP(t,Promise.race(u));return Wg(t),p}finally{o()}};return(r,s)=>QP(n(r,s))},e2=e=>{let{type:t,actionCreator:n,matcher:r,predicate:s,effect:o}=e;if(t)s=If(t).match;else if(n)t=n.type,s=n.match;else if(r)s=r;else if(!s)throw new Error(Ba(21));return F1(o,"options.listener"),{predicate:s,type:t,effect:o}},t2=Object.assign(e=>{const{type:t,predicate:n,effect:r}=e2(e);return{id:yb(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(Ba(22))}}},{withTypes:()=>t2}),z1=e=>{e.pending.forEach(t=>{Hg(t,L1)})},d4=e=>()=>{e.forEach(z1),e.clear()},n2=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},r2=Object.assign(If(`${Tx}/add`),{withTypes:()=>r2}),f4=If(`${Tx}/removeAll`),s2=Object.assign(If(`${Tx}/remove`),{withTypes:()=>s2}),p4=(...e)=>{console.error(`${Tx}/error`,...e)},Cue=(e={})=>{const t=new Map,{extra:n,onError:r=p4}=e;F1(r,"onError");const s=v=>(v.unsubscribe=()=>t.delete(v.id),t.set(v.id,v),w=>{v.unsubscribe(),w?.cancelActive&&z1(v)}),o=v=>{let w=j1(Array.from(t.values()),x=>x.effect===v.effect);return w||(w=t2(v)),s(w)};Object.assign(o,{withTypes:()=>o});const i=v=>{const{type:w,effect:x,predicate:E}=e2(v),R=j1(Array.from(t.values()),k=>(typeof w=="string"?k.type===w:k.predicate===E)&&k.effect===x);return R&&(R.unsubscribe(),v.cancelActive&&z1(R)),!!R};Object.assign(i,{withTypes:()=>i});const u=async(v,w,x,E)=>{const R=new AbortController,k=u4(o,R.signal),N=[];try{v.pending.add(R),await Promise.resolve(v.effect(w,l4({},x,{getOriginalState:E,condition:(L,D)=>k(L,D).then(Boolean),take:k,delay:ZP(R.signal),pause:Ex(R.signal),extra:n,signal:R.signal,fork:c4(R.signal,N),unsubscribe:v.unsubscribe,subscribe:()=>{t.set(v.id,v)},cancelActiveListeners:()=>{v.pending.forEach((L,D,B)=>{L!==R&&(Hg(L,L1),B.delete(L))})},cancel:()=>{Hg(R,L1),v.pending.delete(R)},throwIfCancelled:()=>{Wg(R.signal)}})))}catch(L){L instanceof Sx||n2(r,L,{raisedBy:"effect"})}finally{await Promise.all(N),Hg(R,a4),v.pending.delete(R)}},p=d4(t);return{middleware:v=>w=>x=>{if(!isAction3(x))return w(x);if(r2.match(x))return o(x.payload);if(f4.match(x)){p();return}if(s2.match(x))return i(x.payload);let E=v.getState();const R=()=>{if(E===JP)throw new Error(Ba(23));return E};let k;try{if(k=w(x),t.size>0){const N=v.getState(),L=Array.from(t.values());for(const D of L){let B=!1;try{B=D.predicate(x,N,E)}catch(Q){B=!1,n2(r,Q,{raisedBy:"predicate"})}B&&u(D,x,v,R)}}}finally{E=JP}return k},startListening:o,stopListening:i,clearListeners:p}},h4=e=>({id:yb(),middleware:e,applied:new Map}),m4=e=>t=>t?.meta?.instanceId===e,Eue=()=>{const e=yb(),t=new Map,n=Object.assign(If("dynamicMiddleware/add",(...u)=>({payload:u,meta:{instanceId:e}})),{withTypes:()=>n}),r=Object.assign(function(...p){p.forEach(g=>{let v=j1(Array.from(t.values()),w=>w.middleware===g);v||(v=h4(g)),t.set(v.id,v)})},{withTypes:()=>r}),s=u=>{const p=Array.from(t.values()).map(g=>wx(g.applied,u,{insert:()=>g.middleware(u)}));return compose3(...p)},o=D1(n,m4(e));return{middleware:u=>p=>g=>o(g)?(r(...g.payload),u.dispatch):s(u)(p)(g),addMiddleware:r,withMiddleware:n,instanceId:e}},g4=e=>"reducerPath"in e&&typeof e.reducerPath=="string",v4=e=>e.flatMap(t=>g4(t)?[[t.reducerPath,t.reducer]]:Object.entries(t)),U1=Symbol.for("rtk-state-proxy-original"),y4=e=>!!e&&!!e[U1],b4=new WeakMap,w4=(e,t)=>wx(b4,e,{insert:()=>new Proxy(e,{get:(n,r,s)=>{if(r===U1)return n;const o=Reflect.get(n,r,s);if(typeof o>"u"){const i=t[r.toString()];if(i){const u=i(void 0,{type:yb()});if(typeof u>"u")throw new Error(Ba(24));return u}}return o}})}),x4=e=>{if(!y4(e))throw new Error(Ba(25));return e[U1]},_4=(e={})=>e;function Tue(...e){const t=Object.fromEntries(v4(e)),n=()=>Object.keys(t).length?combineReducers2(t):_4;let r=n();function s(u,p){return r(u,p)}s.withLazyLoadedSlices=()=>s;const o=(u,p={})=>{const{reducerPath:g,reducer:v}=u,w=t[g];return!p.overrideExisting&&w&&w!==v?(typeof process<"u",s):(t[g]=v,r=n(),s)},i=Object.assign(function(p,g){return function(w,...x){return p(w4(g?g(w,...x):w,t),...x)}},{original:x4});return Object.assign(s,{inject:o,selector:i})}function Ba(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var B1="persist:",V1="persist/FLUSH",kx="persist/REHYDRATE",H1="persist/PAUSE",W1="persist/PERSIST",q1="persist/PURGE",K1="persist/REGISTER",S4=-1;function Rx(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Rx=function(n){return typeof n}:Rx=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Rx(e)}function o2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function C4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?o2(n,!0).forEach(function(r){E4(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o2(n).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function E4(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function T4(e,t,n,r){var s=r.debug,o=C4({},n);return e&&Rx(e)==="object"&&Object.keys(e).forEach(function(i){i!=="_persist"&&t[i]===n[i]&&(o[i]=e[i])}),o}function k4(e){var t=e.blacklist||null,n=e.whitelist||null,r=e.transforms||[],s=e.throttle||0,o="".concat(e.keyPrefix!==void 0?e.keyPrefix:B1).concat(e.key),i=e.storage,u;e.serialize===!1?u=function(ce){return ce}:typeof e.serialize=="function"?u=e.serialize:u=R4;var p=e.writeFailHandler||null,g={},v={},w=[],x=null,E=null,R=function(ce){Object.keys(ce).forEach(function(ye){L(ye)&&g[ye]!==ce[ye]&&w.indexOf(ye)===-1&&w.push(ye)}),Object.keys(g).forEach(function(ye){ce[ye]===void 0&&L(ye)&&w.indexOf(ye)===-1&&g[ye]!==void 0&&w.push(ye)}),x===null&&(x=setInterval(k,s)),g=ce};function k(){if(w.length===0){x&&clearInterval(x),x=null;return}var Q=w.shift(),ce=r.reduce(function(ye,G){return G.in(ye,Q,g)},g[Q]);if(ce!==void 0)try{v[Q]=u(ce)}catch(ye){console.error("redux-persist/createPersistoid: error serializing state",ye)}else delete v[Q];w.length===0&&N()}function N(){Object.keys(v).forEach(function(Q){g[Q]===void 0&&delete v[Q]}),E=i.setItem(o,u(v)).catch(D)}function L(Q){return!(n&&n.indexOf(Q)===-1&&Q!=="_persist"||t&&t.indexOf(Q)!==-1)}function D(Q){p&&p(Q)}var B=function(){for(;w.length!==0;)k();return E||Promise.resolve()};return{update:R,flush:B}}function R4(e){return JSON.stringify(e)}function P4(e){var t=e.transforms||[],n="".concat(e.keyPrefix!==void 0?e.keyPrefix:B1).concat(e.key),r=e.storage,s=e.debug,o;return e.deserialize===!1?o=function(u){return u}:typeof e.deserialize=="function"?o=e.deserialize:o=O4,r.getItem(n).then(function(i){if(i)try{var u={},p=o(i);return Object.keys(p).forEach(function(g){u[g]=t.reduceRight(function(v,w){return w.out(v,g,p)},o(p[g]))}),u}catch(g){throw g}else return})}function O4(e){return JSON.parse(e)}function N4(e){var t=e.storage,n="".concat(e.keyPrefix!==void 0?e.keyPrefix:B1).concat(e.key);return t.removeItem(n,A4)}function A4(e){}function a2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function kp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?a2(n,!0).forEach(function(r){I4(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a2(n).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function I4(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function j4(e,t){if(e==null)return{};var n=D4(e,t),r,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)r=o[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function D4(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,o;for(o=0;o<r.length;o++)s=r[o],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}var M4=5e3;function $4(e,t){var n=e.version!==void 0?e.version:S4,r=e.debug||!1,s=e.stateReconciler===void 0?T4:e.stateReconciler,o=e.getStoredState||P4,i=e.timeout!==void 0?e.timeout:M4,u=null,p=!1,g=!0,v=function(x){return x._persist.rehydrated&&u&&!g&&u.update(x),x};return function(w,x){var E=w||{},R=E._persist,k=j4(E,["_persist"]),N=k;if(x.type===W1){var L=!1,D=function(We,at){L||(x.rehydrate(e.key,We,at),L=!0)};if(i&&setTimeout(function(){!L&&D(void 0,new Error('redux-persist: persist timed out for persist key "'.concat(e.key,'"')))},i),g=!1,u||(u=k4(e)),R)return kp({},t(N,x),{_persist:R});if(typeof x.rehydrate!="function"||typeof x.register!="function")throw new Error("redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.");return x.register(e.key),o(e).then(function(Le){var We=e.migrate||function(at,St){return Promise.resolve(at)};We(Le,n).then(function(at){D(at)},function(at){D(void 0,at)})},function(Le){D(void 0,Le)}),kp({},t(N,x),{_persist:{version:n,rehydrated:!1}})}else{if(x.type===q1)return p=!0,x.result(N4(e)),kp({},t(N,x),{_persist:R});if(x.type===V1)return x.result(u&&u.flush()),kp({},t(N,x),{_persist:R});if(x.type===H1)g=!0;else if(x.type===kx){if(p)return kp({},N,{_persist:kp({},R,{rehydrated:!0})});if(x.key===e.key){var B=t(N,x),Q=x.payload,ce=s!==!1&&Q!==void 0?s(Q,w,B,e):B,ye=kp({},ce,{_persist:kp({},R,{rehydrated:!0})});return v(ye)}}}if(!R)return t(w,x);var G=t(N,x);return G===N?w:v(kp({},G,{_persist:R}))}}function pl(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var i2=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),G1=function(){return Math.random().toString(36).substring(7).split("").join(".")},Lv={INIT:"@@redux/INIT"+G1(),REPLACE:"@@redux/REPLACE"+G1(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+G1()}};function l2(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function kue(e){if(e===void 0)return"undefined";if(e===null)return"null";var t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(z4(e))return"date";if(F4(e))return"error";var n=L4(e);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return t.slice(8,-1).toLowerCase().replace(/\s/g,"")}function L4(e){return typeof e.constructor=="function"?e.constructor.name:null}function F4(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function z4(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function U4(e){var t=typeof e;return t}function c2(e,t,n){var r;if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(pl(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(pl(1));return n(c2)(e,t)}if(typeof e!="function")throw new Error(pl(2));var s=e,o=t,i=[],u=i,p=!1;function g(){u===i&&(u=i.slice())}function v(){if(p)throw new Error(pl(3));return o}function w(k){if(typeof k!="function")throw new Error(pl(4));if(p)throw new Error(pl(5));var N=!0;return g(),u.push(k),function(){if(N){if(p)throw new Error(pl(6));N=!1,g();var D=u.indexOf(k);u.splice(D,1),i=null}}}function x(k){if(!l2(k))throw new Error(pl(7));if(typeof k.type>"u")throw new Error(pl(8));if(p)throw new Error(pl(9));try{p=!0,o=s(o,k)}finally{p=!1}for(var N=i=u,L=0;L<N.length;L++){var D=N[L];D()}return k}function E(k){if(typeof k!="function")throw new Error(pl(10));s=k,x({type:Lv.REPLACE})}function R(){var k,N=w;return k={subscribe:function(D){if(typeof D!="object"||D===null)throw new Error(pl(11));function B(){D.next&&D.next(v())}B();var Q=N(B);return{unsubscribe:Q}}},k[i2]=function(){return this},k}return x({type:Lv.INIT}),r={dispatch:x,subscribe:w,getState:v,replaceReducer:E},r[i2]=R,r}var Rue=null;function Pue(e){typeof console<"u"&&typeof console.error=="function"&&console.error(e);try{throw new Error(e)}catch{}}function Oue(e,t,n,r){var s=Object.keys(t),o=n&&n.type===Lv.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(s.length===0)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!l2(e))return"The "+o+' has unexpected type of "'+U4(e)+'". Expected argument to be an object with the following '+('keys: "'+s.join('", "')+'"');var i=Object.keys(e).filter(function(u){return!t.hasOwnProperty(u)&&!r[u]});if(i.forEach(function(u){r[u]=!0}),!(n&&n.type===Lv.REPLACE)&&i.length>0)return"Unexpected "+(i.length>1?"keys":"key")+" "+('"'+i.join('", "')+'" found in '+o+". ")+"Expected to find one of the known reducer keys instead: "+('"'+s.join('", "')+'". Unexpected keys will be ignored.')}function B4(e){Object.keys(e).forEach(function(t){var n=e[t],r=n(void 0,{type:Lv.INIT});if(typeof r>"u")throw new Error(pl(12));if(typeof n(void 0,{type:Lv.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(pl(13))})}function V4(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var s=t[r];typeof e[s]=="function"&&(n[s]=e[s])}var o=Object.keys(n),i,u;try{B4(n)}catch(p){u=p}return function(g,v){if(g===void 0&&(g={}),u)throw u;if(!1)var w;for(var x=!1,E={},R=0;R<o.length;R++){var k=o[R],N=n[k],L=g[k],D=N(L,v);if(typeof D>"u"){var B=v&&v.type;throw new Error(pl(14))}E[k]=D,x=x||D!==L}return x=x||o.length!==Object.keys(g).length,x?E:g}}function u2(e,t){return function(){return t(e.apply(this,arguments))}}function Nue(e,t){if(typeof e=="function")return u2(e,t);if(typeof e!="object"||e===null)throw new Error(pl(16));var n={};for(var r in e){var s=e[r];typeof s=="function"&&(n[r]=u2(s,t))}return n}function H4(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.length===0?function(r){return r}:t.length===1?t[0]:t.reduce(function(r,s){return function(){return r(s.apply(void 0,arguments))}})}function Aue(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){return function(){var s=r.apply(void 0,arguments),o=function(){throw new Error(pl(15))},i={getState:s.getState,dispatch:function(){return o.apply(void 0,arguments)}},u=t.map(function(p){return p(i)});return o=H4.apply(void 0,u)(s.dispatch),_objectSpread(_objectSpread({},s),{},{dispatch:o})}}}function d2(e){return K4(e)||q4(e)||W4()}function W4(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function q4(e){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)==="[object Arguments]")return Array.from(e)}function K4(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}function f2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Q1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?f2(n,!0).forEach(function(r){G4(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f2(n).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function G4(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var p2={registry:[],bootstrapped:!1},Q4=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p2,n=arguments.length>1?arguments[1]:void 0;switch(n.type){case K1:return Q1({},t,{registry:[].concat(d2(t.registry),[n.key])});case kx:var r=t.registry.indexOf(n.key),s=d2(t.registry);return s.splice(r,1),Q1({},t,{registry:s,bootstrapped:s.length===0});default:return t}};function Y4(e,t,n){if(!1)var r,s;var o=n||!1,i=c2(Q4,p2,t&&t.enhancer?t.enhancer:void 0),u=function(w){i.dispatch({type:K1,key:w})},p=function(w,x,E){var R={type:kx,payload:x,err:E,key:w};e.dispatch(R),i.dispatch(R),o&&g.getState().bootstrapped&&(o(),o=!1)},g=Q1({},i,{purge:function(){var w=[];return e.dispatch({type:q1,result:function(E){w.push(E)}}),Promise.all(w)},flush:function(){var w=[];return e.dispatch({type:V1,result:function(E){w.push(E)}}),Promise.all(w)},pause:function(){e.dispatch({type:H1})},persist:function(){e.dispatch({type:W1,register:u,rehydrate:p})}});return t&&t.manualPersist||g.persist(),g}const X4=({mainReducer:e,devTools:t=!1,defaultState:n})=>{const r=k6({reducer:e,preloadedState:n,devTools:t,middleware:s=>s({serializableCheck:{ignoredActions:[V1,kx,H1,W1,q1,K1]}})});return{store:r,persistor:Y4(r)}};var Z4=ln(7484);const J4=e=>async(t,n)=>{const r=t?._persist.version;return n===r?t:e(t,r)},e7=e=>(t,{key:n,shared:r,version:s,persistFields:o,migrate:i})=>$4({storage:Z4.A,key:n,keyPrefix:r?void 0:`persist:${e}_`,version:s,whitelist:o,migrate:i?J4(i):void 0},t),{appName:t7}=ae.A,Px=e7(t7);var oe=ln(1520);const n7=oe.Sx.Default,Y1="theme",r7=1,s7=["darkMode"],o7={theme:n7,darkMode:void 0},a7=Px((e=o7,t)=>{switch(t.type){case ur.SET_THEME:return{...e,theme:t.theme};case ur.SET_DARK_MODE:return{...e,darkMode:t.darkMode};default:return e}},{key:Y1,shared:!0,version:r7,persistFields:s7}),h2=e=>e[Y1],Due=e=>h2(e).theme,i7=e=>h2(e).darkMode,Mue=()=>useSelector(selectors.theme),l7=()=>Xn(i7),Fv=()=>{const e=l7();if(e!==void 0)return e;try{return window.matchMedia?.("(prefers-color-scheme: dark)")?.matches}catch{return!1}},Ox=()=>{const e=jr();return{setTheme:(...t)=>e(Br.apply(null,t)),setDarkMode:(...t)=>e(yi.apply(null,t))}};var js=ln(2215),Os=ln(8782);const c7=e=>({shortName:e?.shortName??"",themeColor:e?.themeColor??"",theme:e?.theme??oe.Sx.Default,resellerName:e?.resellerName??"",icon:e?.images?.find(t=>t.type===oe.yj.Icon)?.url??"",logo:e?.images?.find(t=>t.type===oe.yj.Logo)?.url??""});class u7{static getPortalMetadata(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/PortalMetadata";const i=(0,oe.Y_)("get","application/json",o,n);i.params={portalType:t.portalType},(0,oe.pY)(i,r,s)})}}var Nx=(e=>(e.RSP="RSP",e.SSP="SSP",e))(Nx||{});const d7=(e,t,n)=>{n&&X1("manifest-placeholder","href",`${n}/${e==="SSP"?"ssp":"rsp"}-manifest.webmanifest`),t.icon&&X1("icon-placeholder","href",t.icon),t.themeColor&&X1("theme-color-placeholder","content",t.themeColor),t.shortName&&(document.title=t.shortName)},X1=(e,t,n)=>{const r=document.getElementById(e);r&&r.setAttribute(t,n)},Ax={queryKey:()=>["portalMetadata"],queryFn:async e=>await u7.getPortalMetadata({portalType:e===Nx.SSP?oe.Lo.SSP:oe.Lo.RSP}),staleTime:60*60*1e3},xb=({portalMode:e=Nx.SSP,...t}={})=>{const n=Ax.queryKey(),{data:r,isLoading:s,...o}=(0,js.I)({queryKey:n,queryFn:async()=>await Ax.queryFn(e),staleTime:Ax.staleTime,enabled:(0,Os.canLocationMakeCallForData)()});return{data:c7(r),isLoading:s,...o}};var $ue=ln(716);const f7={input:"var(--input)",ring:"var(--ring)",background:"var(--background)",foreground:"var(--foreground)",primary:{foreground:"var(--primary-foreground)"},secondary:{foreground:"var(--secondary-foreground)"},destructive:{DEFAULT:"var(--destructive)",foreground:"var(--destructive-foreground)"},muted:{DEFAULT:"var(--muted)",foreground:"var(--muted-foreground)"},accent:{DEFAULT:"var(--accent)",foreground:"var(--accent-foreground)"},popover:{DEFAULT:"var(--popover)",foreground:"var(--popover-foreground)"},card:{DEFAULT:"var(--card)",foreground:"var(--card-foreground)"}},Lue={borderRadius:{lg:"var(--radius)",md:"calc(var(--radius) - 2px)",sm:"calc(var(--radius) - 4px)"},keyframes:{"accordion-down":{from:{height:0},to:{height:"var(--radix-accordion-content-height)"}},"accordion-up":{from:{height:"var(--radix-accordion-content-height)"},to:{height:0}}},animation:{"accordion-down":"accordion-down 0.2s ease-out","accordion-up":"accordion-up 0.2s ease-out"}};var m2=(e=>(e.Primary="primary",e.Secondary="secondary",e.BgGradient="bgGradient",e))(m2||{});const g2=Object.values(m2),v2=[50,100,200,300,400,500,600,700,800,900,950],_b=500,Z1="color",y2="dark",p7="DEFAULT";var h7=ln(9462),m7=ln.n(h7);const b2=e=>`rgb(var(--${e}) / <alpha-value>)`,J1=(...e)=>e.filter(t=>!!t).join("-"),g7=e=>e.rgb().array().map(Math.round).join(" "),v7=(e,t)=>t<_b?e.lighten(1-t/_b):t>_b?e.darken(t/_b-1):e,w2=(e,t)=>({[t??p7]:b2(J1(Z1,e,t,_b)),...Object.fromEntries(v2.map(r=>{const s=J1(t,r),o=J1(Z1,e,t,r);return[s,b2(o)]}))}),x2=(e,t)=>t?v2.map(n=>`--${Z1}-${e}-${n}: ${g7(v7(m7()(t),n))};`):[],y7=(e,t)=>{const n=t.map(s=>s[e]);let r={};for(const s of n){if(typeof s=="string")return s;r={...r,...s}}return r},b7=(...e)=>{const t=Array.from(new Set(e.map(n=>Object.keys(n)).flat()));return Object.fromEntries(t.map(n=>[n,y7(n,e)]))},w7=Object.fromEntries(g2.map(e=>[e,{...w2(e),...w2(e,y2)}])),Fue=b7(w7,f7),zue=g2.map(e=>({pattern:new RegExp(`^(bg|text|border)-${e}`)})),Uue=null,eC=e=>Object.entries(e).map(([n,r])=>[...x2(n,r.light),...x2(`${n}-${y2}`,r.dark)]).flat().join(" "),x7=eC({primary:{light:"rgb(15, 23, 42)",dark:"rgb(15, 23, 42)"},secondary:{light:"rgb(55, 65, 81)",dark:"rgb(137, 154, 181)"},bgGradient:{light:"rgb(195, 237, 245)",dark:"rgb(24, 52, 98)"}}),_7=eC({primary:{light:"rgb(4, 60, 25)",dark:"rgb(7, 67, 30)"},secondary:{light:"rgb(9, 87, 39)",dark:"rgb(203, 240, 216)"},bgGradient:{light:"rgb(168, 243, 197)",dark:"rgb(7, 67, 30)"}}),S7=eC({primary:{light:"rgb(32, 43, 79)",dark:"rgb(18, 52, 106)"},secondary:{light:"rgb(50, 62, 101)",dark:"rgb(194, 210, 231)"},bgGradient:{light:"rgb(145, 166, 237)",dark:"rgb(18, 52, 106)"}}),C7={[oe.Sx.Green]:_7,[oe.Sx.Blue]:S7,[oe.Sx.Default]:x7},E7=({theme:e=oe.Sx.Default})=>{const t=String(C7[e]);return(0,a.jsxs)("style",{"data-testid":`theme-${e.toLowerCase()}`,children:[" ",`:root{ ${t} }`," "]})},T7=({children:e})=>{const n=xb()?.data?.theme,r=Fv(),{setTheme:s}=Ox();return(0,l.useEffect)(()=>{document.body&&(s(n??oe.Sx.Default),document.body.className=r?"dark":"",document.body.dataset.theme=n?.toLowerCase())},[r,n]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(E7,{theme:n}),e]})},k7=()=>(0,a.jsx)(Yr.N9,{darkMode:Fv()}),Gh=()=>{if(!(typeof window>"u"))return window.location.hostname},_2=()=>window.location.origin,Qh=()=>ks(),jf=()=>ma(),Wue=e=>{const{search:t}=Qh(),n=useMemo(()=>new URLSearchParams(t),[t]);if(e)return S2(n.getAll(e));const s=Array.from(n.keys()).map(o=>[o,S2(n.getAll(o))]);return Object.fromEntries(s)},Dl=()=>{const e=jf();return(t,n)=>_t(t,{...e,...n})},Ni=()=>{const e=Qs(),t=Dl();return{navigateWithRedirectToReferrer:n=>e({pathname:t(n),search:Eu({redirectTo:encodeURIComponent(window.location.href)}).toString()}),navigate:(n,r)=>e(t(n,r)),push:(n,r)=>e(t(n,r)),replace:(n,r)=>e(t(n,r),{replace:!0})}},S2=e=>e.length>1?e:e[0],C2=e=>{const t=Qh(),n=Mr(e);return n?_t(e,n.params)===t.pathname:!1},que=()=>{const{pathname:e}=useLocation();return useEffect(()=>{window?.scrollTo?.(0,0)},[e]),null},Kue=null;var E2=(e=>(e.Root="/",e.Login="/login",e.Onboarding="/admin/onboarding",e.OrganizationDispatcher="/:organizationUniqueName",e.Dashboard="/:organizationUniqueName/",e.Admin="/:organizationUniqueName/admin",e.Billing="/:organizationUniqueName/billing",e.Register="/:organizationUniqueName/register",e.Subscriptions="/:organizationUniqueName/subscriptions",e.Subscription="/:organizationUniqueName/subscriptions/:subscriptionId",e.Licenses="/:organizationUniqueName/licenses",e.Support="/:organizationUniqueName/support",e.Users="/:organizationUniqueName/users",e.UserEdit="/:organizationUniqueName/users/:userId/edit",e.UsersInvite="/:organizationUniqueName/users/invite",e.OrganizationsNotActivated="/no-activated-organizations",e.OrganizationSuspended="/:organizationUniqueName/organization-suspended",e.HelpDesk="/:organizationUniqueName/helpdesk",e.HelpDeskCreate="/:organizationUniqueName/helpdesk/create",e.HelpDeskTicketDetail="/:organizationUniqueName/helpdesk/:helpDeskTicketId/detail",e.Shop="/:organizationUniqueName/shop",e.ShopProductDetail="/:organizationUniqueName/shop/:shopProductId/detail",e.Orders="/:organizationUniqueName/orders",e.Order="/:organizationUniqueName/orders/:orderId/detail",e))(E2||{});const Un=E2;var T2=(e=>(e.SET_SELECTED_RESELLER="SET_SELECTED_RESELLER",e))(T2||{});const R7=e=>({type:"SET_SELECTED_RESELLER",id:e}),k2=e=>({logo:((n,r)=>n&&r?`${n}?${r}`:n)(P7(e?.images,oe.yj.Logo)?.url??"",e?.logoHash??0),logoHash:e?.logoHash??0,theme:O7(e?.theme),hostName:e?.hostName}),P7=(e,t)=>e?.find(n=>n.type===t),O7=e=>{switch(e){case oe.Sx.Green:return oe.Sx.Green;case oe.Sx.Default:default:return oe.Sx.Default}},N7=e=>({id:e?.id??"",name:e?.name??"",isOnboarded:e?.isOnboarded??!1,portalSettings:k2(e?.portalSettings),supportInformation:A7(e?.supportInformation)}),A7=e=>({address:e?.address??"",email:e?.email??"",phoneNumber:e?.phoneNumber??""});class tC{static getPortalSettingsByHostname(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/PortalSettings/{hostname}";o=o.replace("{hostname}",t.hostname+"");const i=(0,oe.Y_)("get","application/json",o,n);(0,oe.pY)(i,r,s)})}static setPortalSettings(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/PortalSettings";const i=(0,oe.Y_)("post","application/json",o,n);let u=t.command;i.data=u,(0,oe.pY)(i,r,s)})}static updateImage(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/PortalSettings/update-image";const i=(0,oe.Y_)("post","multipart/form-data",o,n);let u=null;if(u=new FormData,t.resellerId)if(Object.prototype.toString.call(t.resellerId)==="[object Array]")for(const p of t.resellerId)u.append("ResellerId",p);else u.append("ResellerId",t.resellerId);if(t.file)if(Object.prototype.toString.call(t.file)==="[object Array]")for(const p of t.file)u.append("File",p);else u.append("File",t.file);if(t.type)if(Object.prototype.toString.call(t.type)==="[object Array]")for(const p of t.type)u.append("Type",p);else u.append("Type",t.type);if(t.size)if(Object.prototype.toString.call(t.size)==="[object Array]")for(const p of t.size)u.append("Size",p);else u.append("Size",t.size);i.data=u,(0,oe.pY)(i,r,s)})}}class qg{static getReseller(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/Resellers/{hostname}";o=o.replace("{hostname}",t.hostname+"");const i=(0,oe.Y_)("get","application/json",o,n);(0,oe.pY)(i,r,s)})}static setSupportInformation(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/Resellers/{resellerId}/set-support-information";o=o.replace("{resellerId}",t.resellerId+"");const i=(0,oe.Y_)("post","application/json",o,n);let u=t.command;i.data=u,(0,oe.pY)(i,r,s)})}static setResellerSettings(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/Resellers/{resellerId}/set-reseller-settings";o=o.replace("{resellerId}",t.resellerId+"");const i=(0,oe.Y_)("post","application/json",o,n);let u=t.command;i.data=u,(0,oe.pY)(i,r,s)})}static onboardedReseller(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/Resellers/{resellerId}/onboarded";o=o.replace("{resellerId}",t.resellerId+"");const i=(0,oe.Y_)("post","application/json",o,n);let u=null;i.data=u,(0,oe.pY)(i,r,s)})}static setOrderSettings(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/Resellers/{resellerId}/set-order-settings";o=o.replace("{resellerId}",t.resellerId+"");const i=(0,oe.Y_)("post","application/json",o,n);let u=t.command;i.data=u,(0,oe.pY)(i,r,s)})}}const nC={queryKey:e=>["portalSettingsByHostname",e],queryFn:async e=>await tC.getPortalSettingsByHostname({hostname:e}),staleTime:10*6e4},rC={queryKey:e=>["reseller",e],queryFn:async e=>await qg.getReseller({hostname:e}),staleTime:60*60*1e3},sC="reseller",I7=1,j7=["selectedReseller"],D7={selectedReseller:void 0},M7=Px((e=D7,t)=>t.type===T2.SET_SELECTED_RESELLER?{...e,selectedReseller:t.id}:e,{key:sC,shared:!0,version:I7,persistFields:j7}),$7=e=>e[sC],L7=e=>$7(e).selectedReseller,R2=({...e}={})=>{const t=Gh()??"localhost",n=nC.queryKey(t),{data:r,isLoading:s,isFetching:o,...i}=(0,js.I)({queryKey:n,queryFn:async()=>await nC.queryFn(t),staleTime:nC.staleTime,enabled:(0,Os.canLocationMakeCallForData)()});return{data:k2(r),isLoading:s&&o,...i}},Kg=({reload:e=!1,...t}={})=>{const{isLoggedIn:n}=(0,zr.m)(),r=Gh()??"localhost",s=rC.queryKey(r),o=(0,V.jE)();(0,Os.useInvalidateQuery)(s,e,o);const{data:i,isLoading:u,isFetching:p,...g}=(0,js.I)({queryKey:s,queryFn:async()=>await rC.queryFn(r),enabled:n,staleTime:rC.staleTime});return{data:N7(i),isLoading:u&&p,...g}},zv=()=>Xn(L7),F7=()=>{const e=jr();return{setSelectedReseller:(...t)=>e(R7.apply(null,t))}};var Que=ln(9153),P2=(e=>(e.SET_SELECTED_ORGANIZATION="SET_SELECTED_ORGANIZATION",e))(P2||{});const z7=e=>({type:"SET_SELECTED_ORGANIZATION",id:e}),U7=e=>({id:e.id,name:e.name??"",uniqueName:e.uniqueName??"",subreseller:e.subreseller??"",isSuspended:e.isSuspended});class O2{static resellerOrganizationsGetAvailableOrganizations(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/resellers/{resellerId}/organizations";o=o.replace("{resellerId}",t.resellerId+"");const i=(0,oe.Y_)("get","application/json",o,n);(0,oe.pY)(i,r,s)})}static queryDetailedOrganizations(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/resellers/{resellerId}/organizations/query";o=o.replace("{resellerId}",t.resellerId+"");const i=(0,oe.Y_)("post","application/json",o,n);let u=t.detailedOrganizationsQuery;i.data=u,(0,oe.pY)(i,r,s)})}}const Ix={queryKey:e=>["availableOrganizations",e],queryFn:async e=>await O2.resellerOrganizationsGetAvailableOrganizations({resellerId:e}),staleTime:1*6e4},B7=()=>{const{data:e}=Yh();return{findById:V7(e),findByUniqueName:N2(e)}},V7=e=>t=>e.find(({id:n})=>n===t),N2=e=>t=>e.find(({uniqueName:n})=>n===t),oC="organization",H7=1,W7=["selectedOrganization"],q7={selectedOrganization:void 0},K7=Px((e=q7,t)=>t.type===P2.SET_SELECTED_ORGANIZATION?{...e,selectedOrganization:t.id}:e,{key:oC,shared:!0,version:H7,persistFields:W7}),G7=e=>e[oC],Q7=e=>G7(e).selectedOrganization;function A2(e,t){function n(r){let s,o=1;return typeof r=="string"&&r.startsWith("-")?(o=-1,s=r.substring(1)):s=r,function(i,u){const p=i[s],g=u[s],v=t?.ignoreCase&&typeof p=="string"?p.toLowerCase():p,w=t?.ignoreCase&&typeof g=="string"?g.toLowerCase():g,x=v>w?1:0;return(v<w?-1:x)*o}}return function(r,s){let o=0,i=0;const u=e?.length;for(;i===0&&o<u;)i=n(e[o])(r,s),o++;return i}}function aC(e,t,n={ignoreCase:!1}){return Array.isArray(t)?e.sort(A2(t,n)):e.sort(A2([t],n))}const I2=(e,t,n="name")=>e[n].toLocaleLowerCase()<t[n].toLocaleLowerCase()?-1:e[n].toLocaleLowerCase()>t[n].toLocaleLowerCase()?1:0,Y7=e=>{let t=[],n=[];[...e].sort((s,o)=>I2(s,o)).forEach(s=>{s.subreseller?t=[...t,s]:n=[...n,s]});const r=[...t].sort((s,o)=>I2(s,o,"subreseller"));return[...n,...r]},j2=e=>{if(!e)return null;const t=[...e];return aC(t,["isSuspended","name"]),t[0]},Yh=({...e}={})=>{const{isLoggedIn:t}=(0,zr.m)(),n=zv()??"",{data:r,isLoading:s,isFetching:o,...i}=(0,js.I)({queryKey:Ix.queryKey(n),queryFn:async()=>await Ix.queryFn(n),enabled:t&&n!=="",staleTime:Ix.staleTime});return{data:Y7((r??[]).map(U7)),isLoading:s&&o,...i}},Ai=()=>{const{data:e,isLoading:t}=Yh(),n=Xn(Q7),{setSelectedOrganization:r}=M2(),s=e?.every(o=>o.id!==n);return(0,l.useEffect)(()=>{s&&!t&&e.length!==0&&r(j2(e)?.id)},[t,s,e.length]),s?j2(e)?.id:n},iC=()=>{const{data:e,isLoading:t,isFetched:n}=Yh();return{isLoading:t,hasNoActivatedOrganizations:!t&&n&&e?.length===0}},D2=()=>{const{data:e,isLoading:t,isFetched:n}=Yh(),{organizationUniqueName:r}=jf(),s=N2(e),o=r?s(r):void 0;return{isLoading:t,isActive:!t&&n&&o&&!o?.isSuspended,isSuspended:!t&&n&&o?.isSuspended,selectedOrganizationUniqueName:o?.uniqueName}},Io=()=>{const{data:e}=Yh(),t=Ai();return t?e.find(({id:n})=>n===t):e[0]},X7=()=>{const{pathname:e}=Qh(),{organizationUniqueName:t}=jf(),n=Dl(),r=[Un.OrganizationSuspended];return s=>{if(!t)return e;const o=e.replace(t,":organizationUniqueName");return Object.values(Un).includes(o)?r.some(u=>u===o)?n(Un.Dashboard,{organizationUniqueName:s}):e.replace(t,s):Un.Root}},M2=()=>{const e=jr();return{setSelectedOrganization:(...t)=>e(z7.apply(null,t))}};function Z7({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 21h16.5M4.5 3h15M5.25 3v18m13.5-18v18M9 6.75h1.5m-1.5 3h1.5m-1.5 3h1.5m3-6H15m-1.5 3H15m-1.5 3H15M9 21v-3.375c0-.621.504-1.125 1.125-1.125h3.75c.621 0 1.125.504 1.125 1.125V21"}))}const $2=l.forwardRef(Z7);var wo=(e=>(e.Default="default",e.Info="info",e.Warning="warning",e.Danger="danger",e.Success="success",e))(wo||{});const J7=Nl("font-regular inline-flex items-center whitespace-nowrap rounded-md border px-2 py-1 text-xs font-normal text-slate-900 transition-colors dark:bg-slate-950",{variants:{variant:{default:"border-gray-600/10 bg-gray-100 dark:border-gray-800 dark:text-gray-600",info:"border-indigo-600/10 bg-indigo-100 dark:border-indigo-800 dark:text-indigo-600",warning:"border-orange-600/10 bg-orange-100 dark:border-yellow-800 dark:text-yellow-600",danger:"border-red-600/10 bg-red-100 dark:border-red-800 dark:text-red-600",success:"border-green-600/10 bg-green-100 dark:border-green-800 dark:text-green-600"}},defaultVariants:{variant:"default"}}),to=({className:e,variant:t="default",...n})=>(0,a.jsx)("div",{className:st(J7({variant:t}),e),"data-testid":`badge-${String(t)}`,...n});function e8({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"}))}const Gg=l.forwardRef(e8),Sd=e=>e?(e=e.charAt(0).toUpperCase()+e.slice(1),e.replace(/(_\w)/g,t=>t.toUpperCase().substring(1))):"";function t8({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"}))}const Xh=l.forwardRef(t8);var L2=1,n8=.9,r8=.8,s8=.17,lC=.1,cC=.999,o8=.9999,a8=.99,i8=/[\\\/_+.#"@\[\(\{&]/,l8=/[\\\/_+.#"@\[\(\{&]/g,c8=/[\s-]/,F2=/[\s-]/g;function uC(e,t,n,r,s,o,i){if(o===t.length)return s===e.length?L2:a8;var u=`${s},${o}`;if(i[u]!==void 0)return i[u];for(var p=r.charAt(o),g=n.indexOf(p,s),v=0,w,x,E,R;g>=0;)w=uC(e,t,n,r,g+1,o+1,i),w>v&&(g===s?w*=L2:i8.test(e.charAt(g-1))?(w*=r8,E=e.slice(s,g-1).match(l8),E&&s>0&&(w*=Math.pow(cC,E.length))):c8.test(e.charAt(g-1))?(w*=n8,R=e.slice(s,g-1).match(F2),R&&s>0&&(w*=Math.pow(cC,R.length))):(w*=s8,s>0&&(w*=Math.pow(cC,g-s))),e.charAt(g)!==t.charAt(o)&&(w*=o8)),(w<lC&&n.charAt(g-1)===r.charAt(o+1)||r.charAt(o+1)===r.charAt(o)&&n.charAt(g-1)!==r.charAt(o))&&(x=uC(e,t,n,r,g+1,o+2,i),x*lC>w&&(w=x*lC)),w>v&&(v=w),g=n.indexOf(p,g+1);return i[u]=v,v}function z2(e){return e.toLowerCase().replace(F2," ")}function u8(e,t){return uC(e,t,z2(e),z2(t),0,0,{})}function Zh(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e?.(s),n===!1||!s.defaultPrevented)return t?.(s)}}function d8(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function U2(...e){return t=>e.forEach(n=>d8(n,t))}function Qg(...e){return(0,l.useCallback)(U2(...e),e)}function f8(e,t){const n=(0,l.createContext)(t);function r(o){const{children:i,...u}=o,p=(0,l.useMemo)(()=>u,Object.values(u));return(0,l.createElement)(n.Provider,{value:p},i)}function s(o){const i=(0,l.useContext)(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return r.displayName=e+"Provider",[r,s]}function p8(e,t=[]){let n=[];function r(o,i){const u=(0,l.createContext)(i),p=n.length;n=[...n,i];function g(w){const{scope:x,children:E,...R}=w,k=x?.[e][p]||u,N=(0,l.useMemo)(()=>R,Object.values(R));return(0,l.createElement)(k.Provider,{value:N},E)}function v(w,x){const E=x?.[e][p]||u,R=(0,l.useContext)(E);if(R)return R;if(i!==void 0)return i;throw new Error(`\`${w}\` must be used within \`${o}\``)}return g.displayName=o+"Provider",[g,v]}const s=()=>{const o=n.map(i=>(0,l.createContext)(i));return function(u){const p=u?.[e]||o;return(0,l.useMemo)(()=>({[`__scope${e}`]:{...u,[e]:p}}),[u,p])}};return s.scopeName=e,[r,h8(s,...t)]}function h8(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const i=r.reduce((u,{useScope:p,scopeName:g})=>{const w=p(o)[`__scope${g}`];return{...u,...w}},{});return(0,l.useMemo)(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}const dC=Boolean(globalThis?.document)?l.useLayoutEffect:()=>{},m8=se["useId".toString()]||(()=>{});let g8=0;function fC(e){const[t,n]=l.useState(m8());return dC(()=>{e||n(r=>r??String(g8++))},[e]),e||(t?`radix-${t}`:"")}function Yg(e){const t=(0,l.useRef)(e);return(0,l.useEffect)(()=>{t.current=e}),(0,l.useMemo)(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function v8({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,s]=y8({defaultProp:t,onChange:n}),o=e!==void 0,i=o?e:r,u=Yg(n),p=(0,l.useCallback)(g=>{if(o){const w=typeof g=="function"?g(e):g;w!==e&&u(w)}else s(g)},[o,e,s,u]);return[i,p]}function y8({defaultProp:e,onChange:t}){const n=(0,l.useState)(e),[r]=n,s=(0,l.useRef)(r),o=Yg(t);return(0,l.useEffect)(()=>{s.current!==r&&(o(r),s.current=r)},[r,s,o]),n}const pC=(0,l.forwardRef)((e,t)=>{const{children:n,...r}=e,s=l.Children.toArray(n),o=s.find(w8);if(o){const i=o.props.children,u=s.map(p=>p===o?l.Children.count(i)>1?l.Children.only(null):(0,l.isValidElement)(i)?i.props.children:null:p);return(0,l.createElement)(hC,(0,Je.A)({},r,{ref:t}),(0,l.isValidElement)(i)?(0,l.cloneElement)(i,void 0,u):null)}return(0,l.createElement)(hC,(0,Je.A)({},r,{ref:t}),n)});pC.displayName="Slot";const hC=(0,l.forwardRef)((e,t)=>{const{children:n,...r}=e;return(0,l.isValidElement)(n)?(0,l.cloneElement)(n,{...x8(r,n.props),ref:U2(t,n.ref)}):l.Children.count(n)>1?l.Children.only(null):null});hC.displayName="SlotClone";const b8=({children:e})=>(0,l.createElement)(l.Fragment,null,e);function w8(e){return(0,l.isValidElement)(e)&&e.type===b8}function x8(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?n[r]=(...u)=>{o?.(...u),s?.(...u)}:r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}const tde=null,Rp=["a","button","div","h2","h3","img","li","nav","ol","p","span","svg","ul"].reduce((e,t)=>{const n=(0,l.forwardRef)((r,s)=>{const{asChild:o,...i}=r,u=o?pC:t;return(0,l.useEffect)(()=>{window[Symbol.for("radix-ui")]=!0},[]),(0,l.createElement)(u,(0,Je.A)({},i,{ref:s}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function _8(e,t){e&&(0,kt.flushSync)(()=>e.dispatchEvent(t))}const rde=null;function S8(e){const t=Yg(e);(0,l.useEffect)(()=>{const n=r=>{r.key==="Escape"&&t(r)};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[t])}const C8="DismissableLayer",mC="dismissableLayer.update",E8="dismissableLayer.pointerDownOutside",T8="dismissableLayer.focusOutside";let B2;const V2=(0,l.createContext)({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),H2=(0,l.forwardRef)((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:i,onDismiss:u,...p}=e,g=(0,l.useContext)(V2),[v,w]=(0,l.useState)(null),[,x]=(0,l.useState)({}),E=Qg(t,ye=>w(ye)),R=Array.from(g.layers),[k]=[...g.layersWithOutsidePointerEventsDisabled].slice(-1),N=R.indexOf(k),L=v?R.indexOf(v):-1,D=g.layersWithOutsidePointerEventsDisabled.size>0,B=L>=N,Q=P8(ye=>{const G=ye.target,Le=[...g.branches].some(We=>We.contains(G));!B||Le||(s?.(ye),i?.(ye),ye.defaultPrevented||u?.())}),ce=O8(ye=>{const G=ye.target;[...g.branches].some(We=>We.contains(G))||(o?.(ye),i?.(ye),ye.defaultPrevented||u?.())});return S8(ye=>{L===g.layers.size-1&&(r?.(ye),!ye.defaultPrevented&&u&&(ye.preventDefault(),u()))}),(0,l.useEffect)(()=>{if(v)return n&&(g.layersWithOutsidePointerEventsDisabled.size===0&&(B2=document.body.style.pointerEvents,document.body.style.pointerEvents="none"),g.layersWithOutsidePointerEventsDisabled.add(v)),g.layers.add(v),W2(),()=>{n&&g.layersWithOutsidePointerEventsDisabled.size===1&&(document.body.style.pointerEvents=B2)}},[v,n,g]),(0,l.useEffect)(()=>()=>{v&&(g.layers.delete(v),g.layersWithOutsidePointerEventsDisabled.delete(v),W2())},[v,g]),(0,l.useEffect)(()=>{const ye=()=>x({});return document.addEventListener(mC,ye),()=>document.removeEventListener(mC,ye)},[]),(0,l.createElement)(Rp.div,(0,Je.A)({},p,{ref:E,style:{pointerEvents:D?B?"auto":"none":void 0,...e.style},onFocusCapture:Zh(e.onFocusCapture,ce.onFocusCapture),onBlurCapture:Zh(e.onBlurCapture,ce.onBlurCapture),onPointerDownCapture:Zh(e.onPointerDownCapture,Q.onPointerDownCapture)}))}),k8="DismissableLayerBranch",R8=(0,l.forwardRef)((e,t)=>{const n=(0,l.useContext)(V2),r=(0,l.useRef)(null),s=Qg(t,r);return(0,l.useEffect)(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),(0,l.createElement)(Rp.div,(0,Je.A)({},e,{ref:s}))});function P8(e){const t=Yg(e),n=(0,l.useRef)(!1),r=(0,l.useRef)(()=>{});return(0,l.useEffect)(()=>{const s=i=>{if(i.target&&!n.current){let p=function(){q2(E8,t,u,{discrete:!0})};const u={originalEvent:i};i.pointerType==="touch"?(document.removeEventListener("click",r.current),r.current=p,document.addEventListener("click",r.current,{once:!0})):p()}n.current=!1},o=window.setTimeout(()=>{document.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),document.removeEventListener("pointerdown",s),document.removeEventListener("click",r.current)}},[t]),{onPointerDownCapture:()=>n.current=!0}}function O8(e){const t=Yg(e),n=(0,l.useRef)(!1);return(0,l.useEffect)(()=>{const r=s=>{s.target&&!n.current&&q2(T8,t,{originalEvent:s},{discrete:!1})};return document.addEventListener("focusin",r),()=>document.removeEventListener("focusin",r)},[t]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function W2(){const e=new CustomEvent(mC);document.dispatchEvent(e)}function q2(e,t,n,{discrete:r}){const s=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?_8(s,o):s.dispatchEvent(o)}const sde=null,ode=null,gC="focusScope.autoFocusOnMount",vC="focusScope.autoFocusOnUnmount",K2={bubbles:!1,cancelable:!0},N8="FocusScope",G2=(0,l.forwardRef)((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...i}=e,[u,p]=(0,l.useState)(null),g=Yg(s),v=Yg(o),w=(0,l.useRef)(null),x=Qg(t,k=>p(k)),E=(0,l.useRef)({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;(0,l.useEffect)(()=>{if(r){let k=function(L){if(E.paused||!u)return;const D=L.target;u.contains(D)?w.current=D:Xg(w.current,{select:!0})},N=function(L){E.paused||!u||u.contains(L.relatedTarget)||Xg(w.current,{select:!0})};return document.addEventListener("focusin",k),document.addEventListener("focusout",N),()=>{document.removeEventListener("focusin",k),document.removeEventListener("focusout",N)}}},[r,u,E.paused]),(0,l.useEffect)(()=>{if(u){X2.add(E);const k=document.activeElement;if(!u.contains(k)){const L=new CustomEvent(gC,K2);u.addEventListener(gC,g),u.dispatchEvent(L),L.defaultPrevented||(A8($8(Q2(u)),{select:!0}),document.activeElement===k&&Xg(u))}return()=>{u.removeEventListener(gC,g),setTimeout(()=>{const L=new CustomEvent(vC,K2);u.addEventListener(vC,v),u.dispatchEvent(L),L.defaultPrevented||Xg(k??document.body,{select:!0}),u.removeEventListener(vC,v),X2.remove(E)},0)}}},[u,g,v,E]);const R=(0,l.useCallback)(k=>{if(!n&&!r||E.paused)return;const N=k.key==="Tab"&&!k.altKey&&!k.ctrlKey&&!k.metaKey,L=document.activeElement;if(N&&L){const D=k.currentTarget,[B,Q]=I8(D);B&&Q?!k.shiftKey&&L===Q?(k.preventDefault(),n&&Xg(B,{select:!0})):k.shiftKey&&L===B&&(k.preventDefault(),n&&Xg(Q,{select:!0})):L===D&&k.preventDefault()}},[n,r,E.paused]);return(0,l.createElement)(Rp.div,(0,Je.A)({tabIndex:-1},i,{ref:x,onKeyDown:R}))});function A8(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Xg(r,{select:t}),document.activeElement!==n)return}function I8(e){const t=Q2(e),n=Y2(t,e),r=Y2(t.reverse(),e);return[n,r]}function Q2(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Y2(e,t){for(const n of e)if(!j8(n,{upTo:t}))return n}function j8(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function D8(e){return e instanceof HTMLInputElement&&"select"in e}function Xg(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&D8(e)&&t&&e.select()}}const X2=M8();function M8(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Z2(e,t),e.unshift(t)},remove(t){var n;e=Z2(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function Z2(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function $8(e){return e.filter(t=>t.tagName!=="A")}const ade=null,L8="Portal",J2=(0,l.forwardRef)((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...s}=e;return r?kt.createPortal((0,l.createElement)(Rp.div,(0,Je.A)({},s,{ref:t})),r):null}),ide=null;function F8(e,t){return(0,l.useReducer)((n,r)=>{const s=t[n][r];return s??n},e)}const jx=e=>{const{present:t,children:n}=e,r=z8(t),s=typeof n=="function"?n({present:r.isPresent}):l.Children.only(n),o=Qg(r.ref,s.ref);return typeof n=="function"||r.isPresent?(0,l.cloneElement)(s,{ref:o}):null};jx.displayName="Presence";function z8(e){const[t,n]=(0,l.useState)(),r=(0,l.useRef)({}),s=(0,l.useRef)(e),o=(0,l.useRef)("none"),i=e?"mounted":"unmounted",[u,p]=F8(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return(0,l.useEffect)(()=>{const g=Dx(r.current);o.current=u==="mounted"?g:"none"},[u]),dC(()=>{const g=r.current,v=s.current;if(v!==e){const x=o.current,E=Dx(g);e?p("MOUNT"):E==="none"||g?.display==="none"?p("UNMOUNT"):p(v&&x!==E?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,p]),dC(()=>{if(t){const g=w=>{const E=Dx(r.current).includes(w.animationName);w.target===t&&E&&(0,kt.flushSync)(()=>p("ANIMATION_END"))},v=w=>{w.target===t&&(o.current=Dx(r.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else p("ANIMATION_END")},[t,p]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:(0,l.useCallback)(g=>{g&&(r.current=getComputedStyle(g)),n(g)},[])}}function Dx(e){return e?.animationName||"none"}let yC=0;function lde(e){return eO(),e.children}function eO(){(0,l.useEffect)(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:tO()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:tO()),yC++,()=>{yC===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),yC--}},[])}function tO(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}const cde=null;var nO=rc(),bC=function(){},Mx=l.forwardRef(function(e,t){var n=l.useRef(null),r=l.useState({onScrollCapture:bC,onWheelCapture:bC,onTouchMoveCapture:bC}),s=r[0],o=r[1],i=e.forwardProps,u=e.children,p=e.className,g=e.removeScrollBar,v=e.enabled,w=e.shards,x=e.sideCar,E=e.noIsolation,R=e.inert,k=e.allowPinchZoom,N=e.as,L=N===void 0?"div":N,D=Lc(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),B=x,Q=vd([n,t]),ce=Cn(Cn({},D),s);return l.createElement(l.Fragment,null,v&&l.createElement(B,{sideCar:nO,removeScrollBar:g,shards:w,noIsolation:E,inert:R,setCallbacks:o,allowPinchZoom:!!k,lockRef:n}),i?l.cloneElement(l.Children.only(u),Cn(Cn({},ce),{ref:Q})):l.createElement(L,Cn({},ce,{className:p,ref:Q}),u))});Mx.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Mx.classNames={fullWidth:za,zeroRight:ca};var wC=!1;if(typeof window<"u")try{var $x=Object.defineProperty({},"passive",{get:function(){return wC=!0,!0}});window.addEventListener("test",$x,$x),window.removeEventListener("test",$x,$x)}catch{wC=!1}var Uv=wC?{passive:!1}:!1,U8=function(e){var t=window.getComputedStyle(e);return t.overflowY!=="hidden"&&!(t.overflowY===t.overflowX&&t.overflowY==="visible")},B8=function(e){var t=window.getComputedStyle(e);return t.overflowX!=="hidden"&&!(t.overflowY===t.overflowX&&t.overflowX==="visible")},rO=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=sO(e,n);if(r){var s=oO(e,n),o=s[1],i=s[2];if(o>i)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},V8=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},H8=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},sO=function(e,t){return e==="v"?U8(t):B8(t)},oO=function(e,t){return e==="v"?V8(t):H8(t)},W8=function(e,t){return e==="h"&&t==="rtl"?-1:1},q8=function(e,t,n,r,s){var o=W8(e,window.getComputedStyle(t).direction),i=o*r,u=n.target,p=t.contains(u),g=!1,v=i>0,w=0,x=0;do{var E=oO(e,u),R=E[0],k=E[1],N=E[2],L=k-N-o*R;(R||L)&&sO(e,u)&&(w+=L,x+=R),u=u.parentNode}while(!p&&u!==document.body||p&&(t.contains(u)||t===u));return(v&&(s&&w===0||!s&&i>w)||!v&&(s&&x===0||!s&&-i>x))&&(g=!0),g},Lx=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},aO=function(e){return[e.deltaX,e.deltaY]},iO=function(e){return e&&"current"in e?e.current:e},K8=function(e,t){return e[0]===t[0]&&e[1]===t[1]},G8=function(e){return`
  .block-interactivity-`.concat(e,` {pointer-events: none;}
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},Q8=0,Bv=[];function Y8(e){var t=l.useRef([]),n=l.useRef([0,0]),r=l.useRef(),s=l.useState(Q8++)[0],o=l.useState(function(){return Ko()})[0],i=l.useRef(e);l.useEffect(function(){i.current=e},[e]),l.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var k=hd([e.lockRef.current],(e.shards||[]).map(iO),!0).filter(Boolean);return k.forEach(function(N){return N.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),k.forEach(function(N){return N.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var u=l.useCallback(function(k,N){if("touches"in k&&k.touches.length===2)return!i.current.allowPinchZoom;var L=Lx(k),D=n.current,B="deltaX"in k?k.deltaX:D[0]-L[0],Q="deltaY"in k?k.deltaY:D[1]-L[1],ce,ye=k.target,G=Math.abs(B)>Math.abs(Q)?"h":"v";if("touches"in k&&G==="h"&&ye.type==="range")return!1;var Le=rO(G,ye);if(!Le)return!0;if(Le?ce=G:(ce=G==="v"?"h":"v",Le=rO(G,ye)),!Le)return!1;if(!r.current&&"changedTouches"in k&&(B||Q)&&(r.current=ce),!ce)return!0;var We=r.current||ce;return q8(We,N,k,We==="h"?B:Q,!0)},[]),p=l.useCallback(function(k){var N=k;if(!(!Bv.length||Bv[Bv.length-1]!==o)){var L="deltaY"in N?aO(N):Lx(N),D=t.current.filter(function(ce){return ce.name===N.type&&ce.target===N.target&&K8(ce.delta,L)})[0];if(D&&D.should){N.preventDefault();return}if(!D){var B=(i.current.shards||[]).map(iO).filter(Boolean).filter(function(ce){return ce.contains(N.target)}),Q=B.length>0?u(N,B[0]):!i.current.noIsolation;Q&&N.preventDefault()}}},[]),g=l.useCallback(function(k,N,L,D){var B={name:k,delta:N,target:L,should:D};t.current.push(B),setTimeout(function(){t.current=t.current.filter(function(Q){return Q!==B})},1)},[]),v=l.useCallback(function(k){n.current=Lx(k),r.current=void 0},[]),w=l.useCallback(function(k){g(k.type,aO(k),k.target,u(k,e.lockRef.current))},[]),x=l.useCallback(function(k){g(k.type,Lx(k),k.target,u(k,e.lockRef.current))},[]);l.useEffect(function(){return Bv.push(o),e.setCallbacks({onScrollCapture:w,onWheelCapture:w,onTouchMoveCapture:x}),document.addEventListener("wheel",p,Uv),document.addEventListener("touchmove",p,Uv),document.addEventListener("touchstart",v,Uv),function(){Bv=Bv.filter(function(k){return k!==o}),document.removeEventListener("wheel",p,Uv),document.removeEventListener("touchmove",p,Uv),document.removeEventListener("touchstart",v,Uv)}},[]);var E=e.removeScrollBar,R=e.inert;return l.createElement(l.Fragment,null,R?l.createElement(o,{styles:G8(s)}):null,E?l.createElement(Bc,{gapMode:"margin"}):null)}const X8=zc(nO,Y8);var lO=l.forwardRef(function(e,t){return l.createElement(Mx,Cn({},e,{ref:t,sideCar:X8}))});lO.classNames=Mx.classNames;const Z8=lO,xC="Dialog",[cO,ude]=p8(xC),[J8,Cd]=cO(xC),uO=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:o,modal:i=!0}=e,u=(0,l.useRef)(null),p=(0,l.useRef)(null),[g=!1,v]=v8({prop:r,defaultProp:s,onChange:o});return(0,l.createElement)(J8,{scope:t,triggerRef:u,contentRef:p,contentId:fC(),titleId:fC(),descriptionId:fC(),open:g,onOpenChange:v,onOpenToggle:(0,l.useCallback)(()=>v(w=>!w),[v]),modal:i},n)},dO="DialogTrigger",e9=(0,l.forwardRef)((e,t)=>{const{__scopeDialog:n,...r}=e,s=Cd(dO,n),o=Qg(t,s.triggerRef);return(0,l.createElement)(Rp.button,(0,Je.A)({type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":CC(s.open)},r,{ref:o,onClick:Zh(e.onClick,s.onOpenToggle)}))}),_C="DialogPortal",[t9,fO]=cO(_C,{forceMount:void 0}),pO=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,o=Cd(_C,t);return(0,l.createElement)(t9,{scope:t,forceMount:n},l.Children.map(r,i=>(0,l.createElement)(jx,{present:n||o.open},(0,l.createElement)(J2,{asChild:!0,container:s},i))))},Fx="DialogOverlay",hO=(0,l.forwardRef)((e,t)=>{const n=fO(Fx,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=Cd(Fx,e.__scopeDialog);return o.modal?(0,l.createElement)(jx,{present:r||o.open},(0,l.createElement)(n9,(0,Je.A)({},s,{ref:t}))):null}),n9=(0,l.forwardRef)((e,t)=>{const{__scopeDialog:n,...r}=e,s=Cd(Fx,n);return(0,l.createElement)(Z8,{as:pC,allowPinchZoom:!0,shards:[s.contentRef]},(0,l.createElement)(Rp.div,(0,Je.A)({"data-state":CC(s.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),Zg="DialogContent",mO=(0,l.forwardRef)((e,t)=>{const n=fO(Zg,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=Cd(Zg,e.__scopeDialog);return(0,l.createElement)(jx,{present:r||o.open},o.modal?(0,l.createElement)(r9,(0,Je.A)({},s,{ref:t})):(0,l.createElement)(s9,(0,Je.A)({},s,{ref:t})))}),r9=(0,l.forwardRef)((e,t)=>{const n=Cd(Zg,e.__scopeDialog),r=(0,l.useRef)(null),s=Qg(t,n.contentRef,r);return(0,l.useEffect)(()=>{const o=r.current;if(o)return Uu(o)},[]),(0,l.createElement)(gO,(0,Je.A)({},e,{ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Zh(e.onCloseAutoFocus,o=>{var i;o.preventDefault(),(i=n.triggerRef.current)===null||i===void 0||i.focus()}),onPointerDownOutside:Zh(e.onPointerDownOutside,o=>{const i=o.detail.originalEvent,u=i.button===0&&i.ctrlKey===!0;(i.button===2||u)&&o.preventDefault()}),onFocusOutside:Zh(e.onFocusOutside,o=>o.preventDefault())}))}),s9=(0,l.forwardRef)((e,t)=>{const n=Cd(Zg,e.__scopeDialog),r=(0,l.useRef)(!1);return(0,l.createElement)(gO,(0,Je.A)({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o;if((o=e.onCloseAutoFocus)===null||o===void 0||o.call(e,s),!s.defaultPrevented){var i;r.current||(i=n.triggerRef.current)===null||i===void 0||i.focus(),s.preventDefault()}r.current=!1},onInteractOutside:s=>{var o,i;(o=e.onInteractOutside)===null||o===void 0||o.call(e,s),s.defaultPrevented||(r.current=!0);const u=s.target;((i=n.triggerRef.current)===null||i===void 0?void 0:i.contains(u))&&s.preventDefault()}}))}),gO=(0,l.forwardRef)((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,...i}=e,u=Cd(Zg,n),p=(0,l.useRef)(null),g=Qg(t,p);return eO(),(0,l.createElement)(l.Fragment,null,(0,l.createElement)(G2,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o},(0,l.createElement)(H2,(0,Je.A)({role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":CC(u.open)},i,{ref:g,onDismiss:()=>u.onOpenChange(!1)}))),!1)}),SC="DialogTitle",o9=(0,l.forwardRef)((e,t)=>{const{__scopeDialog:n,...r}=e,s=Cd(SC,n);return(0,l.createElement)(Rp.h2,(0,Je.A)({id:s.titleId},r,{ref:t}))}),vO="DialogDescription",a9=(0,l.forwardRef)((e,t)=>{const{__scopeDialog:n,...r}=e,s=Cd(vO,n);return(0,l.createElement)(Rp.p,(0,Je.A)({id:s.descriptionId},r,{ref:t}))}),yO="DialogClose",i9=(0,l.forwardRef)((e,t)=>{const{__scopeDialog:n,...r}=e,s=Cd(yO,n);return(0,l.createElement)(Rp.button,(0,Je.A)({type:"button"},r,{ref:t,onClick:Zh(e.onClick,()=>s.onOpenChange(!1))}))});function CC(e){return e?"open":"closed"}const bO="DialogTitleWarning",[dde,wO]=f8(bO,{contentName:Zg,titleName:SC,docsSlug:"dialog"}),fde=({titleId:e})=>{const t=wO(bO),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.

If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.

For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return $67UHm$useEffect(()=>{if(e&&!document.getElementById(e))throw new Error(n)},[n,e]),null},l9="DialogDescriptionWarning",pde=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${wO(l9).contentName}}.`;return $67UHm$useEffect(()=>{var s;const o=(s=e.current)===null||s===void 0?void 0:s.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},c9=uO,hde=null,u9=pO,d9=hO,f9=mO,mde=null,gde=null,vde=null;var p9='[cmdk-list-sizer=""]',Sb='[cmdk-group=""]',EC='[cmdk-group-items=""]',h9='[cmdk-group-heading=""]',TC='[cmdk-item=""]',xO=`${TC}:not([aria-disabled="true"])`,kC="cmdk-item-select",Pp="data-value",m9=(e,t)=>u8(e,t),_O=l.createContext(void 0),Cb=()=>l.useContext(_O),SO=l.createContext(void 0),RC=()=>l.useContext(SO),CO=l.createContext(void 0),EO=l.forwardRef((e,t)=>{let n=l.useRef(null),r=Hv(()=>{var Pt,At,Ht;return{search:"",value:(Ht=(At=e.value)!=null?At:(Pt=e.defaultValue)==null?void 0:Pt.toLowerCase())!=null?Ht:"",filtered:{count:0,items:new Map,groups:new Set}}}),s=Hv(()=>new Set),o=Hv(()=>new Map),i=Hv(()=>new Map),u=Hv(()=>new Set),p=kO(e),{label:g,children:v,value:w,onValueChange:x,filter:E,shouldFilter:R,vimBindings:k=!0,...N}=e,L=l.useId(),D=l.useId(),B=l.useId(),Q=E9();Vv(()=>{if(w!==void 0){let Pt=w.trim().toLowerCase();r.current.value=Pt,Q(6,St),ce.emit()}},[w]);let ce=l.useMemo(()=>({subscribe:Pt=>(u.current.add(Pt),()=>u.current.delete(Pt)),snapshot:()=>r.current,setState:(Pt,At,Ht)=>{var Gt,Sn,Cr;if(!Object.is(r.current[Pt],At)){if(r.current[Pt]=At,Pt==="search")at(),Le(),Q(1,We);else if(Pt==="value")if(((Gt=p.current)==null?void 0:Gt.value)!==void 0){let br=At??"";(Cr=(Sn=p.current).onValueChange)==null||Cr.call(Sn,br);return}else Ht||Q(5,St);ce.emit()}},emit:()=>{u.current.forEach(Pt=>Pt())}}),[]),ye=l.useMemo(()=>({value:(Pt,At)=>{At!==i.current.get(Pt)&&(i.current.set(Pt,At),r.current.filtered.items.set(Pt,G(At)),Q(2,()=>{Le(),ce.emit()}))},item:(Pt,At)=>(s.current.add(Pt),At&&(o.current.has(At)?o.current.get(At).add(Pt):o.current.set(At,new Set([Pt]))),Q(3,()=>{at(),Le(),r.current.value||We(),ce.emit()}),()=>{i.current.delete(Pt),s.current.delete(Pt),r.current.filtered.items.delete(Pt);let Ht=xt();Q(4,()=>{at(),Ht?.getAttribute("id")===Pt&&We(),ce.emit()})}),group:Pt=>(o.current.has(Pt)||o.current.set(Pt,new Set),()=>{i.current.delete(Pt),o.current.delete(Pt)}),filter:()=>p.current.shouldFilter,label:g||e["aria-label"],commandRef:n,listId:L,inputId:B,labelId:D}),[]);function G(Pt){var At,Ht;let Gt=(Ht=(At=p.current)==null?void 0:At.filter)!=null?Ht:m9;return Pt?Gt(Pt,r.current.search):0}function Le(){if(!n.current||!r.current.search||p.current.shouldFilter===!1)return;let Pt=r.current.filtered.items,At=[];r.current.filtered.groups.forEach(Gt=>{let Sn=o.current.get(Gt),Cr=0;Sn.forEach(br=>{let Ln=Pt.get(br);Cr=Math.max(Ln,Cr)}),At.push([Gt,Cr])});let Ht=n.current.querySelector(p9);Mt().sort((Gt,Sn)=>{var Cr,br;let Ln=Gt.getAttribute(Pp),Hr=Sn.getAttribute(Pp);return((Cr=Pt.get(Hr))!=null?Cr:0)-((br=Pt.get(Ln))!=null?br:0)}).forEach(Gt=>{let Sn=Gt.closest(EC);Sn?Sn.appendChild(Gt.parentElement===Sn?Gt:Gt.closest(`${EC} > *`)):Ht.appendChild(Gt.parentElement===Ht?Gt:Gt.closest(`${EC} > *`))}),At.sort((Gt,Sn)=>Sn[1]-Gt[1]).forEach(Gt=>{let Sn=n.current.querySelector(`${Sb}[${Pp}="${Gt[0]}"]`);Sn?.parentElement.appendChild(Sn)})}function We(){let Pt=Mt().find(Ht=>!Ht.ariaDisabled),At=Pt?.getAttribute(Pp);ce.setState("value",At||void 0)}function at(){if(!r.current.search||p.current.shouldFilter===!1){r.current.filtered.count=s.current.size;return}r.current.filtered.groups=new Set;let Pt=0;for(let At of s.current){let Ht=i.current.get(At),Gt=G(Ht);r.current.filtered.items.set(At,Gt),Gt>0&&Pt++}for(let[At,Ht]of o.current)for(let Gt of Ht)if(r.current.filtered.items.get(Gt)>0){r.current.filtered.groups.add(At);break}r.current.filtered.count=Pt}function St(){var Pt,At,Ht;let Gt=xt();Gt&&(((Pt=Gt.parentElement)==null?void 0:Pt.firstChild)===Gt&&((Ht=(At=Gt.closest(Sb))==null?void 0:At.querySelector(h9))==null||Ht.scrollIntoView({block:"nearest"})),Gt.scrollIntoView({block:"nearest"}))}function xt(){var Pt;return(Pt=n.current)==null?void 0:Pt.querySelector(`${TC}[aria-selected="true"]`)}function Mt(){return Array.from(n.current.querySelectorAll(xO))}function $t(Pt){let At=Mt()[Pt];At&&ce.setState("value",At.getAttribute(Pp))}function Nt(Pt){var At;let Ht=xt(),Gt=Mt(),Sn=Gt.findIndex(br=>br===Ht),Cr=Gt[Sn+Pt];(At=p.current)!=null&&At.loop&&(Cr=Sn+Pt<0?Gt[Gt.length-1]:Sn+Pt===Gt.length?Gt[0]:Gt[Sn+Pt]),Cr&&ce.setState("value",Cr.getAttribute(Pp))}function Bn(Pt){let At=xt(),Ht=At?.closest(Sb),Gt;for(;Ht&&!Gt;)Ht=Pt>0?S9(Ht,Sb):C9(Ht,Sb),Gt=Ht?.querySelector(xO);Gt?ce.setState("value",Gt.getAttribute(Pp)):Nt(Pt)}let wn=()=>$t(Mt().length-1),Nn=Pt=>{Pt.preventDefault(),Pt.metaKey?wn():Pt.altKey?Bn(1):Nt(1)},Zt=Pt=>{Pt.preventDefault(),Pt.metaKey?$t(0):Pt.altKey?Bn(-1):Nt(-1)};return l.createElement("div",{ref:Eb([n,t]),...N,"cmdk-root":"",onKeyDown:Pt=>{var At;if((At=N.onKeyDown)==null||At.call(N,Pt),!Pt.defaultPrevented)switch(Pt.key){case"n":case"j":{k&&Pt.ctrlKey&&Nn(Pt);break}case"ArrowDown":{Nn(Pt);break}case"p":case"k":{k&&Pt.ctrlKey&&Zt(Pt);break}case"ArrowUp":{Zt(Pt);break}case"Home":{Pt.preventDefault(),$t(0);break}case"End":{Pt.preventDefault(),wn();break}case"Enter":if(!Pt.nativeEvent.isComposing){Pt.preventDefault();let Ht=xt();if(Ht){let Gt=new Event(kC);Ht.dispatchEvent(Gt)}}}}},l.createElement("label",{"cmdk-label":"",htmlFor:ye.inputId,id:ye.labelId,style:T9},g),l.createElement(SO.Provider,{value:ce},l.createElement(_O.Provider,{value:ye},v)))}),g9=l.forwardRef((e,t)=>{var n,r;let s=l.useId(),o=l.useRef(null),i=l.useContext(CO),u=Cb(),p=kO(e),g=(r=(n=p.current)==null?void 0:n.forceMount)!=null?r:i?.forceMount;Vv(()=>u.item(s,i?.id),[]);let v=RO(s,o,[e.value,e.children,o]),w=RC(),x=Jg(ce=>ce.value&&ce.value===v.current),E=Jg(ce=>g||u.filter()===!1?!0:ce.search?ce.filtered.items.get(s)>0:!0);l.useEffect(()=>{let ce=o.current;if(!(!ce||e.disabled))return ce.addEventListener(kC,R),()=>ce.removeEventListener(kC,R)},[E,e.onSelect,e.disabled]);function R(){var ce,ye;k(),(ye=(ce=p.current).onSelect)==null||ye.call(ce,v.current)}function k(){w.setState("value",v.current,!0)}if(!E)return null;let{disabled:N,value:L,onSelect:D,forceMount:B,...Q}=e;return l.createElement("div",{ref:Eb([o,t]),...Q,id:s,"cmdk-item":"",role:"option","aria-disabled":N||void 0,"aria-selected":x||void 0,"data-disabled":N||void 0,"data-selected":x||void 0,onPointerMove:N?void 0:k,onClick:N?void 0:R},e.children)}),TO=l.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:s,...o}=e,i=l.useId(),u=l.useRef(null),p=l.useRef(null),g=l.useId(),v=Cb(),w=Jg(R=>s||v.filter()===!1?!0:R.search?R.filtered.groups.has(i):!0);Vv(()=>v.group(i),[]),RO(i,u,[e.value,e.heading,p]);let x=l.useMemo(()=>({id:i,forceMount:s}),[s]),E=l.createElement(CO.Provider,{value:x},r);return l.createElement("div",{ref:Eb([u,t]),...o,"cmdk-group":"",role:"presentation",hidden:w?void 0:!0},n&&l.createElement("div",{ref:p,"cmdk-group-heading":"","aria-hidden":!0,id:g},n),l.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?g:void 0},E))}),v9=l.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,s=l.useRef(null),o=Jg(i=>!i.search);return!n&&!o?null:l.createElement("div",{ref:Eb([s,t]),...r,"cmdk-separator":"",role:"separator"})}),y9=l.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,s=e.value!=null,o=RC(),i=Jg(v=>v.search),u=Jg(v=>v.value),p=Cb(),g=l.useMemo(()=>{var v;let w=(v=p.commandRef.current)==null?void 0:v.querySelector(`${TC}[${Pp}="${u}"]`);return w?.getAttribute("id")},[u,p.commandRef]);return l.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),l.createElement("input",{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":p.listId,"aria-labelledby":p.labelId,"aria-activedescendant":g,id:p.inputId,type:"text",value:s?e.value:i,onChange:v=>{s||o.setState("search",v.target.value),n?.(v.target.value)}})}),b9=l.forwardRef((e,t)=>{let{children:n,...r}=e,s=l.useRef(null),o=l.useRef(null),i=Cb();return l.useEffect(()=>{if(o.current&&s.current){let u=o.current,p=s.current,g,v=new ResizeObserver(()=>{g=requestAnimationFrame(()=>{let w=u.offsetHeight;p.style.setProperty("--cmdk-list-height",w.toFixed(1)+"px")})});return v.observe(u),()=>{cancelAnimationFrame(g),v.unobserve(u)}}},[]),l.createElement("div",{ref:Eb([s,t]),...r,"cmdk-list":"",role:"listbox","aria-label":"Suggestions",id:i.listId,"aria-labelledby":i.inputId},l.createElement("div",{ref:o,"cmdk-list-sizer":""},n))}),w9=l.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:o,container:i,...u}=e;return l.createElement(c9,{open:n,onOpenChange:r},l.createElement(u9,{container:i},l.createElement(d9,{"cmdk-overlay":"",className:s}),l.createElement(f9,{"aria-label":e.label,"cmdk-dialog":"",className:o},l.createElement(EO,{ref:t,...u}))))}),x9=l.forwardRef((e,t)=>{let n=l.useRef(!0),r=Jg(s=>s.filtered.count===0);return l.useEffect(()=>{n.current=!1},[]),n.current||!r?null:l.createElement("div",{ref:t,...e,"cmdk-empty":"",role:"presentation"})}),_9=l.forwardRef((e,t)=>{let{progress:n,children:r,...s}=e;return l.createElement("div",{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Loading..."},l.createElement("div",{"aria-hidden":!0},r))}),uc=Object.assign(EO,{List:b9,Item:g9,Input:y9,Group:TO,Separator:v9,Dialog:w9,Empty:x9,Loading:_9});function S9(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function C9(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function kO(e){let t=l.useRef(e);return Vv(()=>{t.current=e}),t}var Vv=typeof window>"u"?l.useEffect:l.useLayoutEffect;function Hv(e){let t=l.useRef();return t.current===void 0&&(t.current=e()),t}function Eb(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function Jg(e){let t=RC(),n=()=>e(t.snapshot());return l.useSyncExternalStore(t.subscribe,n,n)}function RO(e,t,n){let r=l.useRef(),s=Cb();return Vv(()=>{var o;let i=(()=>{var u;for(let p of n){if(typeof p=="string")return p.trim().toLowerCase();if(typeof p=="object"&&"current"in p)return p.current?(u=p.current.textContent)==null?void 0:u.trim().toLowerCase():r.current}})();s.value(e,i),(o=t.current)==null||o.setAttribute(Pp,i),r.current=i}),r}var E9=()=>{let[e,t]=l.useState(),n=Hv(()=>new Map);return Vv(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,s)=>{n.current.set(r,s),t({})}},T9={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const zx=(0,l.forwardRef)(({className:e,...t},n)=>(0,a.jsx)(uc,{ref:n,className:st("flex h-full w-full flex-col overflow-hidden rounded-md text-popover-foreground",e),...t}));zx.displayName=uc.displayName;const yde=({children:e,...t})=>jsx(Dialog,{...t,children:jsx(DialogContent,{className:"overflow-hidden p-0 shadow-2xl",children:jsx(zx,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:e})})}),PO=(0,l.forwardRef)(({className:e,...t},n)=>(0,a.jsxs)("div",{className:"flex items-center border-b px-3 dark:border-slate-800","cmdk-input-wrapper":"",children:[(0,a.jsx)(Xh,{className:"h-4 w-4 shrink-0 opacity-50"}),(0,a.jsx)(uc.Input,{ref:n,className:st("flex h-11 w-full bg-transparent py-3 text-sm outline-none border-none focus:ring-0 placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));PO.displayName=uc.Input.displayName;const PC=(0,l.forwardRef)((e,t)=>(0,a.jsx)(uc.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));PC.displayName=uc.Empty.displayName;const OO=(0,l.forwardRef)(({className:e="",...t},n)=>(0,a.jsx)(uc.Group,{ref:n,className:e,...t}));OO.displayName=uc.Group.displayName;const k9=(0,l.forwardRef)(({className:e,...t},n)=>(0,a.jsx)(uc.Separator,{ref:n,className:st("-mx-1 h-px bg-border",e),...t}));k9.displayName=uc.Separator.displayName;const OC=(0,l.forwardRef)(({className:e,...t},n)=>(0,a.jsx)(uc.Item,{ref:n,className:st("relative flex cursor-default select-none items-center px-2 py-1.5 text-sm outline-none aria-selected:bg-slate-200 aria-selected:dark:text-slate-900 aria-selected:text-gray-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t}));OC.displayName=uc.Item.displayName;const R9=({className:e,...t})=>(0,a.jsx)("span",{className:st("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});R9.displayName="CommandShortcut";const NO=(0,l.forwardRef)(({className:e,...t},n)=>(0,a.jsx)(uc.List,{ref:n,className:st("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));NO.displayName=uc.List.displayName;var hl=ln(3554);const AO=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?(0,hl.UE)({element:r.current,padding:s}).fn(n):{}:r?(0,hl.UE)({element:r,padding:s}).fn(n):{}}}};var Ux=typeof document<"u"?l.useLayoutEffect:l.useEffect;function Bx(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Bx(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const o=s[r];if(!(o==="_owner"&&e.$$typeof)&&!Bx(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function IO(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function jO(e,t){const n=IO(e);return Math.round(t*n)/n}function DO(e){const t=l.useRef(e);return Ux(()=>{t.current=e}),t}function MO(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:o,floating:i}={},transform:u=!0,whileElementsMounted:p,open:g}=e,[v,w]=l.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[x,E]=l.useState(r);Bx(x,r)||E(r);const[R,k]=l.useState(null),[N,L]=l.useState(null),D=l.useCallback(wn=>{wn!==ye.current&&(ye.current=wn,k(wn))},[]),B=l.useCallback(wn=>{wn!==G.current&&(G.current=wn,L(wn))},[]),Q=o||R,ce=i||N,ye=l.useRef(null),G=l.useRef(null),Le=l.useRef(v),We=p!=null,at=DO(p),St=DO(s),xt=l.useCallback(()=>{if(!ye.current||!G.current)return;const wn={placement:t,strategy:n,middleware:x};St.current&&(wn.platform=St.current),(0,hl.rD)(ye.current,G.current,wn).then(Nn=>{const Zt={...Nn,isPositioned:!0};Mt.current&&!Bx(Le.current,Zt)&&(Le.current=Zt,kt.flushSync(()=>{w(Zt)}))})},[x,t,n,St]);Ux(()=>{g===!1&&Le.current.isPositioned&&(Le.current.isPositioned=!1,w(wn=>({...wn,isPositioned:!1})))},[g]);const Mt=l.useRef(!1);Ux(()=>(Mt.current=!0,()=>{Mt.current=!1}),[]),Ux(()=>{if(Q&&(ye.current=Q),ce&&(G.current=ce),Q&&ce){if(at.current)return at.current(Q,ce,xt);xt()}},[Q,ce,xt,at,We]);const $t=l.useMemo(()=>({reference:ye,floating:G,setReference:D,setFloating:B}),[D,B]),Nt=l.useMemo(()=>({reference:Q,floating:ce}),[Q,ce]),Bn=l.useMemo(()=>{const wn={position:n,left:0,top:0};if(!Nt.floating)return wn;const Nn=jO(Nt.floating,v.x),Zt=jO(Nt.floating,v.y);return u?{...wn,transform:"translate("+Nn+"px, "+Zt+"px)",...IO(Nt.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Nn,top:Zt}},[n,u,Nt.floating,v.x,v.y]);return l.useMemo(()=>({...v,update:xt,refs:$t,elements:Nt,floatingStyles:Bn}),[v,xt,$t,Nt,Bn])}const P9="Arrow",$O=(0,l.forwardRef)((e,t)=>{const{children:n,width:r=10,height:s=5,...o}=e;return(0,l.createElement)(zn.svg,(0,Je.A)({},o,{ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none"}),e.asChild?n:(0,l.createElement)("polygon",{points:"0,0 30,0 15,10"}))}),LO=$O;function Wv(e){const[t,n]=(0,l.useState)(void 0);return ya(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const o=s[0];let i,u;if("borderBoxSize"in o){const p=o.borderBoxSize,g=Array.isArray(p)?p[0]:p;i=g.inlineSize,u=g.blockSize}else i=e.offsetWidth,u=e.offsetHeight;n({width:i,height:u})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const bde=null,wde=null,NC="Popper",[FO,qv]=va(NC),[O9,zO]=FO(NC),UO=e=>{const{__scopePopper:t,children:n}=e,[r,s]=(0,l.useState)(null);return(0,l.createElement)(O9,{scope:t,anchor:r,onAnchorChange:s},n)},BO="PopperAnchor",VO=(0,l.forwardRef)((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,o=zO(BO,n),i=(0,l.useRef)(null),u=Lr(t,i);return(0,l.useEffect)(()=>{o.onAnchorChange(r?.current||i.current)}),r?null:(0,l.createElement)(zn.div,(0,Je.A)({},s,{ref:u}))}),AC="PopperContent",[N9,A9]=FO(AC),HO=(0,l.forwardRef)((e,t)=>{var n,r,s,o,i,u,p,g;const{__scopePopper:v,side:w="bottom",sideOffset:x=0,align:E="center",alignOffset:R=0,arrowPadding:k=0,avoidCollisions:N=!0,collisionBoundary:L=[],collisionPadding:D=0,sticky:B="partial",hideWhenDetached:Q=!1,updatePositionStrategy:ce="optimized",onPlaced:ye,...G}=e,Le=zO(AC,v),[We,at]=(0,l.useState)(null),St=Lr(t,xi=>at(xi)),[xt,Mt]=(0,l.useState)(null),$t=Wv(xt),Nt=(n=$t?.width)!==null&&n!==void 0?n:0,Bn=(r=$t?.height)!==null&&r!==void 0?r:0,wn=w+(E!=="center"?"-"+E:""),Nn=typeof D=="number"?D:{top:0,right:0,bottom:0,left:0,...D},Zt=Array.isArray(L)?L:[L],Pt=Zt.length>0,At={padding:Nn,boundary:Zt.filter(j9),altBoundary:Pt},{refs:Ht,floatingStyles:Gt,placement:Sn,isPositioned:Cr,middlewareData:br}=MO({strategy:"fixed",placement:wn,whileElementsMounted:(...xi)=>(0,hl.ll)(...xi,{animationFrame:ce==="always"}),elements:{reference:Le.anchor},middleware:[(0,hl.cY)({mainAxis:x+Bn,alignmentAxis:R}),N&&(0,hl.BN)({mainAxis:!0,crossAxis:!1,limiter:B==="partial"?(0,hl.ER)():void 0,...At}),N&&(0,hl.UU)({...At}),(0,hl.Ej)({...At,apply:({elements:xi,rects:ja,availableWidth:Li,availableHeight:Ze})=>{const{width:Tt,height:Dt}=ja.reference,Vn=xi.floating.style;Vn.setProperty("--radix-popper-available-width",`${Li}px`),Vn.setProperty("--radix-popper-available-height",`${Ze}px`),Vn.setProperty("--radix-popper-anchor-width",`${Tt}px`),Vn.setProperty("--radix-popper-anchor-height",`${Dt}px`)}}),xt&&AO({element:xt,padding:k}),D9({arrowWidth:Nt,arrowHeight:Bn}),Q&&(0,hl.jD)({strategy:"referenceHidden",...At})]}),[Ln,Hr]=KO(Sn),ws=Ao(ye);ya(()=>{Cr&&ws?.()},[Cr,ws]);const us=(s=br.arrow)===null||s===void 0?void 0:s.x,tr=(o=br.arrow)===null||o===void 0?void 0:o.y,mr=((i=br.arrow)===null||i===void 0?void 0:i.centerOffset)!==0,[En,Ws]=(0,l.useState)();return ya(()=>{We&&Ws(window.getComputedStyle(We).zIndex)},[We]),(0,l.createElement)("div",{ref:Ht.setFloating,"data-radix-popper-content-wrapper":"",style:{...Gt,transform:Cr?Gt.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:En,["--radix-popper-transform-origin"]:[(u=br.transformOrigin)===null||u===void 0?void 0:u.x,(p=br.transformOrigin)===null||p===void 0?void 0:p.y].join(" ")},dir:e.dir},(0,l.createElement)(N9,{scope:v,placedSide:Ln,onArrowChange:Mt,arrowX:us,arrowY:tr,shouldHideArrow:mr},(0,l.createElement)(zn.div,(0,Je.A)({"data-side":Ln,"data-align":Hr},G,{ref:St,style:{...G.style,animation:Cr?void 0:"none",opacity:(g=br.hide)!==null&&g!==void 0&&g.referenceHidden?0:void 0}}))))}),WO="PopperArrow",I9={top:"bottom",right:"left",bottom:"top",left:"right"},qO=(0,l.forwardRef)(function(t,n){const{__scopePopper:r,...s}=t,o=A9(WO,r),i=I9[o.placedSide];return(0,l.createElement)("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0}},(0,l.createElement)(LO,(0,Je.A)({},s,{ref:n,style:{...s.style,display:"block"}})))});function j9(e){return e!==null}const D9=e=>({name:"transformOrigin",options:e,fn(t){var n,r,s,o,i;const{placement:u,rects:p,middlewareData:g}=t,w=((n=g.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,x=w?0:e.arrowWidth,E=w?0:e.arrowHeight,[R,k]=KO(u),N={start:"0%",center:"50%",end:"100%"}[k],L=((r=(s=g.arrow)===null||s===void 0?void 0:s.x)!==null&&r!==void 0?r:0)+x/2,D=((o=(i=g.arrow)===null||i===void 0?void 0:i.y)!==null&&o!==void 0?o:0)+E/2;let B="",Q="";return R==="bottom"?(B=w?N:`${L}px`,Q=`${-E}px`):R==="top"?(B=w?N:`${L}px`,Q=`${p.floating.height+E}px`):R==="right"?(B=`${-E}px`,Q=w?N:`${D}px`):R==="left"&&(B=`${p.floating.width+E}px`,Q=w?N:`${D}px`),{data:{x:B,y:Q}}}});function KO(e){const[t,n="center"]=e.split("-");return[t,n]}const Vx=UO,Hx=VO,IC=HO,jC=qO,GO=(0,l.forwardRef)((e,t)=>{const{children:n,...r}=e,s=l.Children.toArray(n),o=s.find($9);if(o){const i=o.props.children,u=s.map(p=>p===o?l.Children.count(i)>1?l.Children.only(null):(0,l.isValidElement)(i)?i.props.children:null:p);return(0,l.createElement)(DC,(0,Je.A)({},r,{ref:t}),(0,l.isValidElement)(i)?(0,l.cloneElement)(i,void 0,u):null)}return(0,l.createElement)(DC,(0,Je.A)({},r,{ref:t}),n)});GO.displayName="Slot";const DC=(0,l.forwardRef)((e,t)=>{const{children:n,...r}=e;return(0,l.isValidElement)(n)?(0,l.cloneElement)(n,{...L9(r,n.props),ref:t?nc(t,n.ref):n.ref}):l.Children.count(n)>1?l.Children.only(null):null});DC.displayName="SlotClone";const M9=({children:e})=>(0,l.createElement)(l.Fragment,null,e);function $9(e){return(0,l.isValidElement)(e)&&e.type===M9}function L9(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...u)=>{o(...u),s(...u)}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}const xde=null,MC="Popover",[QO,_de]=va(MC,[qv]),Tb=qv(),[F9,Jh]=QO(MC),YO=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:o,modal:i=!1}=e,u=Tb(t),p=(0,l.useRef)(null),[g,v]=(0,l.useState)(!1),[w=!1,x]=si({prop:r,defaultProp:s,onChange:o});return(0,l.createElement)(Vx,u,(0,l.createElement)(F9,{scope:t,contentId:ri(),triggerRef:p,open:w,onOpenChange:x,onOpenToggle:(0,l.useCallback)(()=>x(E=>!E),[x]),hasCustomAnchor:g,onCustomAnchorAdd:(0,l.useCallback)(()=>v(!0),[]),onCustomAnchorRemove:(0,l.useCallback)(()=>v(!1),[]),modal:i},n))},XO="PopoverAnchor",z9=(0,l.forwardRef)((e,t)=>{const{__scopePopover:n,...r}=e,s=Jh(XO,n),o=Tb(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:u}=s;return(0,l.useEffect)(()=>(i(),()=>u()),[i,u]),(0,l.createElement)(Hx,(0,Je.A)({},o,r,{ref:t}))}),ZO="PopoverTrigger",JO=(0,l.forwardRef)((e,t)=>{const{__scopePopover:n,...r}=e,s=Jh(ZO,n),o=Tb(n),i=Lr(t,s.triggerRef),u=(0,l.createElement)(zn.button,(0,Je.A)({type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":sN(s.open)},r,{ref:i,onClick:gn(e.onClick,s.onOpenToggle)}));return s.hasCustomAnchor?u:(0,l.createElement)(Hx,(0,Je.A)({asChild:!0},o),u)}),$C="PopoverPortal",[U9,B9]=QO($C,{forceMount:void 0}),eN=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,o=Jh($C,t);return(0,l.createElement)(U9,{scope:t,forceMount:n},(0,l.createElement)(la,{present:n||o.open},(0,l.createElement)(Wi,{asChild:!0,container:s},r)))},Kv="PopoverContent",tN=(0,l.forwardRef)((e,t)=>{const n=B9(Kv,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,o=Jh(Kv,e.__scopePopover);return(0,l.createElement)(la,{present:r||o.open},o.modal?(0,l.createElement)(V9,(0,Je.A)({},s,{ref:t})):(0,l.createElement)(H9,(0,Je.A)({},s,{ref:t})))}),V9=(0,l.forwardRef)((e,t)=>{const n=Jh(Kv,e.__scopePopover),r=(0,l.useRef)(null),s=Lr(t,r),o=(0,l.useRef)(!1);return(0,l.useEffect)(()=>{const i=r.current;if(i)return Uu(i)},[]),(0,l.createElement)(xd,{as:GO,allowPinchZoom:!0},(0,l.createElement)(nN,(0,Je.A)({},e,{ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:gn(e.onCloseAutoFocus,i=>{var u;i.preventDefault(),o.current||(u=n.triggerRef.current)===null||u===void 0||u.focus()}),onPointerDownOutside:gn(e.onPointerDownOutside,i=>{const u=i.detail.originalEvent,p=u.button===0&&u.ctrlKey===!0,g=u.button===2||p;o.current=g},{checkForDefaultPrevented:!1}),onFocusOutside:gn(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})))}),H9=(0,l.forwardRef)((e,t)=>{const n=Jh(Kv,e.__scopePopover),r=(0,l.useRef)(!1),s=(0,l.useRef)(!1);return(0,l.createElement)(nN,(0,Je.A)({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var i;if((i=e.onCloseAutoFocus)===null||i===void 0||i.call(e,o),!o.defaultPrevented){var u;r.current||(u=n.triggerRef.current)===null||u===void 0||u.focus(),o.preventDefault()}r.current=!1,s.current=!1},onInteractOutside:o=>{var i,u;(i=e.onInteractOutside)===null||i===void 0||i.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const p=o.target;((u=n.triggerRef.current)===null||u===void 0?void 0:u.contains(p))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}}))}),nN=(0,l.forwardRef)((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:i,onEscapeKeyDown:u,onPointerDownOutside:p,onFocusOutside:g,onInteractOutside:v,...w}=e,x=Jh(Kv,n),E=Tb(n);return hp(),(0,l.createElement)(_f,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o},(0,l.createElement)(wf,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:v,onEscapeKeyDown:u,onPointerDownOutside:p,onFocusOutside:g,onDismiss:()=>x.onOpenChange(!1)},(0,l.createElement)(IC,(0,Je.A)({"data-state":sN(x.open),role:"dialog",id:x.contentId},E,w,{ref:t,style:{...w.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}}))))}),rN="PopoverClose",W9=(0,l.forwardRef)((e,t)=>{const{__scopePopover:n,...r}=e,s=Jh(rN,n);return(0,l.createElement)(zn.button,(0,Je.A)({type:"button"},r,{ref:t,onClick:gn(e.onClick,()=>s.onOpenChange(!1))}))}),q9="PopoverArrow",K9=(0,l.forwardRef)((e,t)=>{const{__scopePopover:n,...r}=e,s=Tb(n);return(0,l.createElement)(jC,(0,Je.A)({},s,r,{ref:t}))});function sN(e){return e?"open":"closed"}const G9=YO,Sde=null,Q9=JO,Y9=eN,oN=tN,Cde=null,Ede=null,X9=G9,Z9=Q9,aN=(0,l.forwardRef)(({className:e,align:t="start",sideOffset:n=4,...r},s)=>(0,a.jsx)(Y9,{children:(0,a.jsx)(oN,{ref:s,align:t,sideOffset:n,className:st("z-50 animate-in data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 rounded-xl bg-transparent shadow-[0px_4px_24px_#00000012,inset_0px_-1px_1px_#ffffff20,inset_0px_1px_1px_#ffffff40] backdrop-blur-[32px] backdrop-brightness-[100%]  border-[rgba(255,255,255,0.18)] bg-white/50 dark:bg-slate-900 dark:shadow-none dark:border dark:border-slate-800",e),...r})}));aN.displayName=oN.displayName;function J9({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"}))}const Gv=l.forwardRef(J9),iN=({optionValue:e,searchableValue:t,label:n,value:r,dataTestId:s,onSelectItem:o})=>(0,a.jsxs)(OC,{onSelect:()=>o(e),"data-testid":s,className:st("cursor-pointer py-2 pl-10 pr-4 text-gray-900 dark:text-white",e===r?"font-medium":""),value:t,children:[(0,a.jsx)("span",{className:"absolute inset-y-0 left-0 flex items-center pl-3 text-purple-600",children:(0,a.jsx)(Gv,{className:st("h-4 w-4",e===r?"opacity-100":"opacity-0")})}),n]},e),ez=({options:e={},dataTestId:t,value:n,onSelectItem:r})=>(0,a.jsx)(TO,{children:Object.entries(e)?.map(([s,o])=>(0,a.jsx)(iN,{optionValue:s,dataTestId:t,searchableValue:o?.toString(),label:o,value:n,onSelectItem:r},s))}),tz=({groupOptions:e,dataTestId:t,...n})=>(0,a.jsx)(a.Fragment,{children:Object.entries(e).map(([r,s])=>(0,a.jsx)(OO,{heading:r,"data-testid":`comboboxGroupContentSubHeading${Sd(t)}`,children:s.map(o=>(0,a.jsx)(iN,{dataTestId:`comboboxGroupContent${Sd(t)}`,...n,optionValue:o.id,searchableValue:o?.name,label:o?.label??o.name},o.id))},r))}),nz=({options:e,value:t,onChange:n,searcheable:r=!1,disabled:s=!1,buttonClassName:o,buttonValueClassName:i,buttonTitle:u,listClassName:p,texts:g={},icon:v,groupOptions:w,dataTestId:x})=>{const{t:E}=(0,z.Bd)(),[R,k]=(0,l.useState)(!1),[N,L]=(0,l.useState)(t);(0,l.useEffect)(()=>{L(t)},[t]);const D=ce=>{ce!==N&&(L(ce),n?.(ce)),k(!1)};g={emptyValue:g.emptyValue??E("core:combobox.emptyValue"),searchPlaceholder:g.searchPlaceholder??E("core:combobox.searchPlaceholder"),noResults:g.noResults??E("core:combobox.noResults")};const B=(0,l.useMemo)(()=>w?Object.values(w).flatMap(ce=>ce.map(ye=>ye)):[],[w]),Q=ce=>{if(w){const ye=B.find(G=>G.id===N);return ye?.label??ye?.name}return e?.[ce]};return(0,a.jsxs)(X9,{open:R,onOpenChange:k,children:[(0,a.jsx)(Z9,{asChild:!0,children:(0,a.jsxs)(mn,{variant:"outline",role:"combobox",disabled:s,"aria-expanded":R,className:st("justify-between gap-2 font-normal text-sm font-regular text-gray-900",o),title:u,"data-testid":`comboboxTrigger${Sd(x)}`,children:[v,(0,a.jsx)("span",{className:i,children:N?Q(N):g.emptyValue}),(0,a.jsx)(Gg,{className:"ml-2 h-4 w-4 shrink-0 text-white opacity-50 md:text-gray-900 dark:md:text-white"})]})}),(0,a.jsx)(aN,{className:"mt-[10px] p-0 md:mt-0",children:(0,a.jsxs)(zx,{className:"m-[10px] ml-0 h-[calc(100vh-90px)] w-[calc(100vw-20px)] md:m-0 md:h-auto md:w-auto",children:[r&&(0,a.jsx)(PO,{placeholder:String(g.searchPlaceholder),className:"my-1","data-testid":`comboboxInputFilter${Sd(x)}`}),(0,a.jsx)(PC,{children:g.noResults}),(0,a.jsx)("div",{className:p,children:w?(0,a.jsx)(tz,{dataTestId:x,value:N,onSelectItem:D,groupOptions:w}):(0,a.jsx)(ez,{dataTestId:`comboboxContent${Sd(x)}`,value:N,onSelectItem:D,options:e})})]})})]})};var LC=ln(1642);const rz=({organization:e})=>(0,a.jsxs)("div",{className:"dark:bg-slate-950s flex items-center bg-transparent p-2 text-sm capitalize text-gray-900 dark:text-white","data-testid":"textOrganizationName",children:[(0,a.jsx)($2,{className:"mr-2 h-4 w-4 text-white md:text-gray-900 dark:md:text-white"}),e?.name,e?.isSuspended?(0,a.jsx)(to,{variant:wo.Warning,className:"ml-4",children:(0,LC.t)("ssp:organization.suspended")}):null]}),sz=()=>{const{data:e}=Yh(),t=Io(),{t:n}=(0,z.Bd)(),r=X7(),{navigate:s}=Ni(),o=g=>g.isSuspended?(0,a.jsxs)(a.Fragment,{children:[g.name,(0,a.jsx)(to,{variant:wo.Warning,className:"ml-4",children:n("ssp:organization.suspended")})]}):g.name,i=e.reduce((g,v)=>{const w={...v,label:o(v)};return Object.hasOwn(g,v.subreseller)?g[v.subreseller]=[...g[v.subreseller],w]:g[v.subreseller]=[w],g},{}),u=(0,l.useMemo)(()=>Object.fromEntries(e.map(g=>[g.id,g.name])),[e]),p=g=>{const v=e.find(({id:w})=>w===g);s(r(v.uniqueName))};return Object.keys(u).length===1?(0,a.jsx)(rz,{organization:e[0]}):(0,a.jsx)(nz,{groupOptions:i,searcheable:!0,value:t?.id,onChange:p,buttonClassName:"border p-2 border-slate-800 lg:border-slate-200 dark:border dark:border-slate-800 shadow-none hover:bg-transparent hover:shadow-none focus-visible:outline-offset-0 focus-visible:outline-indigo-300 capitalize bg-transparent hover:bg-slate-800  lg:hover:bg-slate-50 dark:hover:bg-slate-900/50 dark:bg-slate-950s",buttonValueClassName:"text-white lg:text-gray-900 text-sm max-w-[calc(100vw-240px)] lg:max-w-[calc(100vw-450px)] truncate  dark:text-white",buttonTitle:"Organization switch combobox button",listClassName:"max-h-[calc(100vh-112px)] lg:max-h-[600px] overflow-auto text-gray-900 font-regular",icon:(0,a.jsx)($2,{className:"h-4 w-4 text-white lg:text-gray-900 dark:lg:text-white"}),dataTestId:"organization"})},lN=Nl("m-0 p-0",{variants:{variant:{heading1:"text-5xl sm:text-6xl leading-none tracking-tight",heading2:"text-[2.5rem] sm:text-5xl leading-12 sm:leading-none tracking-tight",heading3:"text-[2rem] sm:text-[2.5rem] leading-10 sm:leading-12 tracking-tight sm:tracking-tight",heading4:"text-2xl sm:text-[2rem] leading-8 sm:leading-10 tracking-tight",heading5:"text-xl sm:text-2xl leading-6 sm:leading-8",heading6:"text-base sm:text-xl leading-6 tracking-normal sm:tracking-tight",body1:"text-base leading-6 tracking-wide",body2:"text-sm leading-5 tracking-wide",label:"text-xs leading-4 tracking-normal"},weight:{default:"font-normal",medium:"font-medium",semiBold:"font-semibold",bold:"font-bold",extraBold:"font-extrabold"},colors:{default:"text-slate-900 dark:text-slate-200",light:"text-slate-500 dark:text-slate-200",white:"text-white"}},defaultVariants:{variant:"body1",colors:"default",weight:"default"}}),Pn=({className:e,children:t,variant:n,as:r,asChild:s,colors:o,weight:i,...u})=>{const p=s?Qa:r??"p";return(0,a.jsx)(p,{className:st(lN({variant:n,weight:i,colors:o}),e),...u,children:t})};Pn.displayName="Typography";const cN=({className:e=""})=>(0,a.jsx)("div",{className:st("fixed h-screen w-screen dark:bg-slate-950 dark:bg-none",e),"data-testid":"main-gradient"});function Wx(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function Ed(){let e=[],t={addEventListener(n,r,s,o){return n.addEventListener(r,s,o),t.add(()=>n.removeEventListener(r,s,o))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return t.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return t.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return Wx(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,s){let o=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:s}),this.add(()=>{Object.assign(n.style,{[r]:o})})},group(n){let r=Ed();return n(r),this.add(()=>r.dispose())},add(n){return e.push(n),()=>{let r=e.indexOf(n);if(r>=0)for(let s of e.splice(r,1))s()}},dispose(){for(let n of e.splice(0))n()}};return t}function kb(){let[e]=(0,l.useState)(Ed);return(0,l.useEffect)(()=>()=>e.dispose(),[e]),e}var oz=Object.defineProperty,az=(e,t,n)=>t in e?oz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,FC=(e,t,n)=>(az(e,typeof t!="symbol"?t+"":t,n),n);class iz{constructor(){FC(this,"current",this.detect()),FC(this,"handoffState","pending"),FC(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}}let Op=new iz,Xi=(e,t)=>{Op.isServer?(0,l.useEffect)(e,t):(0,l.useLayoutEffect)(e,t)};function Np(e){let t=(0,l.useRef)(e);return Xi(()=>{t.current=e},[e]),t}let Zs=function(e){let t=Np(e);return l.useCallback((...n)=>t.current(...n),[t])};function Rb(){let e=(0,l.useRef)(!1);return Xi(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function lz(e=0){let[t,n]=(0,l.useState)(e),r=Rb(),s=(0,l.useCallback)(p=>{r.current&&n(g=>g|p)},[t,r]),o=(0,l.useCallback)(p=>Boolean(t&p),[t]),i=(0,l.useCallback)(p=>{r.current&&n(g=>g&~p)},[n,r]),u=(0,l.useCallback)(p=>{r.current&&n(g=>g^p)},[n]);return{flags:t,addFlag:s,hasFlag:o,removeFlag:i,toggleFlag:u}}function cz(){let e=typeof document>"u";return(t=>t.useSyncExternalStore)(se)(()=>()=>{},()=>!1,()=>!e)}function Qv(){let e=cz(),[t,n]=l.useState(Op.isHandoffComplete);return t&&Op.isHandoffComplete===!1&&n(!1),l.useEffect(()=>{t!==!0&&n(!0)},[t]),l.useEffect(()=>Op.handoff(),[]),e?!1:t}let uN=Symbol();function uz(e,t=!0){return Object.assign(e,{[uN]:t})}function dc(...e){let t=(0,l.useRef)(e);(0,l.useEffect)(()=>{t.current=e},[e]);let n=Zs(r=>{for(let s of t.current)s!=null&&(typeof s=="function"?s(r):s.current=r)});return e.every(r=>r==null||r?.[uN])?void 0:n}function Zi(e,t,...n){if(e in t){let s=t[e];return typeof s=="function"?s(...n):s}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(s=>`"${s}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Zi),r}function dz(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function zC(e,...t){e&&t.length>0&&e.classList.add(...t)}function UC(e,...t){e&&t.length>0&&e.classList.remove(...t)}function fz(e,t){let n=Ed();if(!e)return n.dispose;let{transitionDuration:r,transitionDelay:s}=getComputedStyle(e),[o,i]=[r,s].map(p=>{let[g=0]=p.split(",").filter(Boolean).map(v=>v.includes("ms")?parseFloat(v):parseFloat(v)*1e3).sort((v,w)=>w-v);return g}),u=o+i;if(u!==0){n.group(g=>{g.setTimeout(()=>{t(),g.dispose()},u),g.addEventListener(e,"transitionrun",v=>{v.target===v.currentTarget&&g.dispose()})});let p=n.addEventListener(e,"transitionend",g=>{g.target===g.currentTarget&&(t(),p())})}else t();return n.add(()=>t()),n.dispose}function pz(e,t,n,r){let s=n?"enter":"leave",o=Ed(),i=r!==void 0?dz(r):()=>{};s==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let u=Zi(s,{enter:()=>t.enter,leave:()=>t.leave}),p=Zi(s,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),g=Zi(s,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return UC(e,...t.base,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),zC(e,...t.base,...u,...g),o.nextFrame(()=>{UC(e,...t.base,...u,...g),zC(e,...t.base,...u,...p),fz(e,()=>(UC(e,...t.base,...u),zC(e,...t.base,...t.entered),i()))}),o.dispose}function hz({immediate:e,container:t,direction:n,classes:r,onStart:s,onStop:o}){let i=Rb(),u=kb(),p=Np(n);Xi(()=>{e&&(p.current="enter")},[e]),Xi(()=>{let g=Ed();u.add(g.dispose);let v=t.current;if(v&&p.current!=="idle"&&i.current)return g.dispose(),s.current(p.current),g.add(pz(v,r.current,p.current==="enter",()=>{g.dispose(),o.current(p.current)})),g.dispose},[n])}let BC=(0,l.createContext)(null);BC.displayName="OpenClosedContext";var ml=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(ml||{});function qx(){return(0,l.useContext)(BC)}function dN({value:e,children:t}){return l.createElement(BC.Provider,{value:e},t)}function Kx(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}var Yv=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Yv||{}),em=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(em||{});function Ml({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:s,visible:o=!0,name:i,mergeRefs:u}){u=u??mz;let p=fN(t,e);if(o)return Gx(p,n,r,i,u);let g=s??0;if(g&2){let{static:v=!1,...w}=p;if(v)return Gx(w,n,r,i,u)}if(g&1){let{unmount:v=!0,...w}=p;return Zi(v?0:1,{[0](){return null},[1](){return Gx({...w,hidden:!0,style:{display:"none"}},n,r,i,u)}})}return Gx(p,n,r,i,u)}function Gx(e,t={},n,r,s){let{as:o=n,children:i,refName:u="ref",...p}=VC(e,["unmount","static"]),g=e.ref!==void 0?{[u]:e.ref}:{},v=typeof i=="function"?i(t):i;"className"in p&&p.className&&typeof p.className=="function"&&(p.className=p.className(t));let w={};if(t){let x=!1,E=[];for(let[R,k]of Object.entries(t))typeof k=="boolean"&&(x=!0),k===!0&&E.push(R);x&&(w["data-headlessui-state"]=E.join(" "))}if(o===l.Fragment&&Object.keys(pN(p)).length>0){if(!(0,l.isValidElement)(v)||Array.isArray(v)&&v.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(p).map(k=>`  - ${k}`).join(`
`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(k=>`  - ${k}`).join(`
`)].join(`
`));let x=v.props,E=typeof x?.className=="function"?(...k)=>Kx(x?.className(...k),p.className):Kx(x?.className,p.className),R=E?{className:E}:{};return(0,l.cloneElement)(v,Object.assign({},fN(v.props,pN(VC(p,["ref"]))),w,g,{ref:s(v.ref,g.ref)},R))}return(0,l.createElement)(o,Object.assign({},VC(p,["ref"]),o!==l.Fragment&&g,o!==l.Fragment&&w),v)}function Ode(){let e=S([]),t=j(n=>{for(let r of e.current)r!=null&&(typeof r=="function"?r(n):r.current=n)},[]);return(...n)=>{if(!n.every(r=>r==null))return e.current=n,t}}function mz(...e){return e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}function fN(...e){var t;if(e.length===0)return{};if(e.length===1)return e[0];let n={},r={};for(let s of e)for(let o in s)o.startsWith("on")&&typeof s[o]=="function"?((t=r[o])!=null||(r[o]=[]),r[o].push(s[o])):n[o]=s[o];if(n.disabled||n["aria-disabled"])return Object.assign(n,Object.fromEntries(Object.keys(r).map(s=>[s,void 0])));for(let s in r)Object.assign(n,{[s](o,...i){let u=r[s];for(let p of u){if((o instanceof Event||o?.nativeEvent instanceof Event)&&o.defaultPrevented)return;p(o,...i)}}});return n}function gl(e){var t;return Object.assign((0,l.forwardRef)(e),{displayName:(t=e.displayName)!=null?t:e.name})}function pN(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function VC(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function tm(e=""){return e.split(/\s+/).filter(t=>t.length>1)}let Qx=(0,l.createContext)(null);Qx.displayName="TransitionContext";var gz=(e=>(e.Visible="visible",e.Hidden="hidden",e))(gz||{});function vz(){let e=(0,l.useContext)(Qx);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function yz(){let e=(0,l.useContext)(Yx);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let Yx=(0,l.createContext)(null);Yx.displayName="NestingContext";function Xx(e){return"children"in e?Xx(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function hN(e,t){let n=Np(e),r=(0,l.useRef)([]),s=Rb(),o=kb(),i=Zs((E,R=em.Hidden)=>{let k=r.current.findIndex(({el:N})=>N===E);k!==-1&&(Zi(R,{[em.Unmount](){r.current.splice(k,1)},[em.Hidden](){r.current[k].state="hidden"}}),o.microTask(()=>{var N;!Xx(r)&&s.current&&((N=n.current)==null||N.call(n))}))}),u=Zs(E=>{let R=r.current.find(({el:k})=>k===E);return R?R.state!=="visible"&&(R.state="visible"):r.current.push({el:E,state:"visible"}),()=>i(E,em.Unmount)}),p=(0,l.useRef)([]),g=(0,l.useRef)(Promise.resolve()),v=(0,l.useRef)({enter:[],leave:[],idle:[]}),w=Zs((E,R,k)=>{p.current.splice(0),t&&(t.chains.current[R]=t.chains.current[R].filter(([N])=>N!==E)),t?.chains.current[R].push([E,new Promise(N=>{p.current.push(N)})]),t?.chains.current[R].push([E,new Promise(N=>{Promise.all(v.current[R].map(([L,D])=>D)).then(()=>N())})]),R==="enter"?g.current=g.current.then(()=>t?.wait.current).then(()=>k(R)):k(R)}),x=Zs((E,R,k)=>{Promise.all(v.current[R].splice(0).map(([N,L])=>L)).then(()=>{var N;(N=p.current.shift())==null||N()}).then(()=>k(R))});return(0,l.useMemo)(()=>({children:r,register:u,unregister:i,onStart:w,onStop:x,wait:g,chains:v}),[u,i,r,w,x,v,g])}function bz(){}let wz=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function mN(e){var t;let n={};for(let r of wz)n[r]=(t=e[r])!=null?t:bz;return n}function xz(e){let t=(0,l.useRef)(mN(e));return(0,l.useEffect)(()=>{t.current=mN(e)},[e]),t}let _z="div",gN=Yv.RenderStrategy;function Sz(e,t){var n,r;let{beforeEnter:s,afterEnter:o,beforeLeave:i,afterLeave:u,enter:p,enterFrom:g,enterTo:v,entered:w,leave:x,leaveFrom:E,leaveTo:R,...k}=e,N=(0,l.useRef)(null),L=dc(N,t),D=(n=k.unmount)==null||n?em.Unmount:em.Hidden,{show:B,appear:Q,initial:ce}=vz(),[ye,G]=(0,l.useState)(B?"visible":"hidden"),Le=yz(),{register:We,unregister:at}=Le;(0,l.useEffect)(()=>We(N),[We,N]),(0,l.useEffect)(()=>{if(D===em.Hidden&&N.current){if(B&&ye!=="visible"){G("visible");return}return Zi(ye,{hidden:()=>at(N),visible:()=>We(N)})}},[ye,N,We,at,B,D]);let St=Np({base:tm(k.className),enter:tm(p),enterFrom:tm(g),enterTo:tm(v),entered:tm(w),leave:tm(x),leaveFrom:tm(E),leaveTo:tm(R)}),xt=xz({beforeEnter:s,afterEnter:o,beforeLeave:i,afterLeave:u}),Mt=Qv();(0,l.useEffect)(()=>{if(Mt&&ye==="visible"&&N.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[N,ye,Mt]);let $t=ce&&!Q,Nt=Q&&B&&ce,Bn=(()=>!Mt||$t?"idle":B?"enter":"leave")(),wn=lz(0),Nn=Zs(Sn=>Zi(Sn,{enter:()=>{wn.addFlag(ml.Opening),xt.current.beforeEnter()},leave:()=>{wn.addFlag(ml.Closing),xt.current.beforeLeave()},idle:()=>{}})),Zt=Zs(Sn=>Zi(Sn,{enter:()=>{wn.removeFlag(ml.Opening),xt.current.afterEnter()},leave:()=>{wn.removeFlag(ml.Closing),xt.current.afterLeave()},idle:()=>{}})),Pt=hN(()=>{G("hidden"),at(N)},Le),At=(0,l.useRef)(!1);hz({immediate:Nt,container:N,classes:St,direction:Bn,onStart:Np(Sn=>{At.current=!0,Pt.onStart(N,Sn,Nn)}),onStop:Np(Sn=>{At.current=!1,Pt.onStop(N,Sn,Zt),Sn==="leave"&&!Xx(Pt)&&(G("hidden"),at(N))})});let Ht=k,Gt={ref:L};return Nt?Ht={...Ht,className:Kx(k.className,...St.current.enter,...St.current.enterFrom)}:At.current&&(Ht.className=Kx(k.className,(r=N.current)==null?void 0:r.className),Ht.className===""&&delete Ht.className),l.createElement(Yx.Provider,{value:Pt},l.createElement(dN,{value:Zi(ye,{visible:ml.Open,hidden:ml.Closed})|wn.flags},Ml({ourProps:Gt,theirProps:Ht,defaultTag:_z,features:gN,visible:ye==="visible",name:"Transition.Child"})))}function Cz(e,t){let{show:n,appear:r=!1,unmount:s=!0,...o}=e,i=(0,l.useRef)(null),u=dc(i,t);Qv();let p=qx();if(n===void 0&&p!==null&&(n=(p&ml.Open)===ml.Open),![!0,!1].includes(n))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[g,v]=(0,l.useState)(n?"visible":"hidden"),w=hN(()=>{v("hidden")}),[x,E]=(0,l.useState)(!0),R=(0,l.useRef)([n]);Xi(()=>{x!==!1&&R.current[R.current.length-1]!==n&&(R.current.push(n),E(!1))},[R,n]);let k=(0,l.useMemo)(()=>({show:n,appear:r,initial:x}),[n,r,x]);(0,l.useEffect)(()=>{if(n)v("visible");else if(!Xx(w))v("hidden");else{let B=i.current;if(!B)return;let Q=B.getBoundingClientRect();Q.x===0&&Q.y===0&&Q.width===0&&Q.height===0&&v("hidden")}},[n,w]);let N={unmount:s},L=Zs(()=>{var B;x&&E(!1),(B=e.beforeEnter)==null||B.call(e)}),D=Zs(()=>{var B;x&&E(!1),(B=e.beforeLeave)==null||B.call(e)});return l.createElement(Yx.Provider,{value:w},l.createElement(Qx.Provider,{value:k},Ml({ourProps:{...N,as:l.Fragment,children:l.createElement(vN,{ref:u,...N,...o,beforeEnter:L,beforeLeave:D})},theirProps:{},defaultTag:l.Fragment,features:gN,visible:g==="visible",name:"Transition"})))}function Ez(e,t){let n=(0,l.useContext)(Qx)!==null,r=qx()!==null;return l.createElement(l.Fragment,null,!n&&r?l.createElement(HC,{ref:t,...e}):l.createElement(vN,{ref:t,...e}))}let HC=gl(Cz),vN=gl(Sz),Tz=gl(Ez),Pb=Object.assign(HC,{Child:Tz,Root:HC});function yN(e,t,n,r){let s=Np(n);(0,l.useEffect)(()=>{e=e??window;function o(i){s.current(i)}return e.addEventListener(t,o,r),()=>e.removeEventListener(t,o,r)},[e,t,r])}function bN(e){let t=Zs(e),n=(0,l.useRef)(!1);(0,l.useEffect)(()=>(n.current=!1,()=>{n.current=!0,Wx(()=>{n.current&&t()})}),[t])}function Zx(e){return Op.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}function Xv(...e){return(0,l.useMemo)(()=>Zx(...e),[...e])}function wN(e,t,n){let r=Np(t);(0,l.useEffect)(()=>{function s(o){r.current(o)}return window.addEventListener(e,s,n),()=>window.removeEventListener(e,s,n)},[e,n])}var Ob=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(Ob||{});function kz(){let e=(0,l.useRef)(0);return wN("keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}function WC(e,t){let n=(0,l.useRef)([]),r=Zs(e);(0,l.useEffect)(()=>{let s=[...n.current];for(let[o,i]of t.entries())if(n.current[o]!==i){let u=r(t,s);return n.current=t,u}},[r,...t])}let Rz="div";var Jx=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(Jx||{});function Pz(e,t){var n;let{features:r=1,...s}=e,o={ref:t,"aria-hidden":(r&2)===2?!0:(n=s["aria-hidden"])!=null?n:void 0,hidden:(r&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return Ml({ourProps:o,theirProps:s,slot:{},defaultTag:Rz,name:"Hidden"})}let qC=gl(Pz);function Oz(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let nm=[];Oz(()=>{function e(t){t.target instanceof HTMLElement&&t.target!==document.body&&nm[0]!==t.target&&(nm.unshift(t.target),nm=nm.filter(n=>n!=null&&n.isConnected),nm.splice(10))}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});let KC=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var Ap=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e))(Ap||{}),xN=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(xN||{}),Nz=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(Nz||{});function _N(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(KC)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var GC=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(GC||{});function QC(e,t=0){var n;return e===((n=Zx(e))==null?void 0:n.body)?!1:Zi(t,{[0](){return e.matches(KC)},[1](){let r=e;for(;r!==null;){if(r.matches(KC))return!0;r=r.parentElement}return!1}})}function SN(e){let t=Zx(e);Ed().nextFrame(()=>{t&&!QC(t.activeElement,0)&&rm(e)})}var Az=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(Az||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function rm(e){e?.focus({preventScroll:!0})}let Iz=["textarea","input"].join(",");function jz(e){var t,n;return(n=(t=e?.matches)==null?void 0:t.call(e,Iz))!=null?n:!1}function CN(e,t=n=>n){return e.slice().sort((n,r)=>{let s=t(n),o=t(r);if(s===null||o===null)return 0;let i=s.compareDocumentPosition(o);return i&Node.DOCUMENT_POSITION_FOLLOWING?-1:i&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Dz(e,t){return Nb(_N(),t,{relativeTo:e})}function Nb(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:s=[]}={}){let o=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,i=Array.isArray(e)?n?CN(e):e:_N(e);s.length>0&&i.length>1&&(i=i.filter(E=>!s.includes(E))),r=r??o.activeElement;let u=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),p=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,i.indexOf(r))-1;if(t&4)return Math.max(0,i.indexOf(r))+1;if(t&8)return i.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),g=t&32?{preventScroll:!0}:{},v=0,w=i.length,x;do{if(v>=w||v+w<=0)return 0;let E=p+v;if(t&16)E=(E+w)%w;else{if(E<0)return 3;if(E>=w)return 1}x=i[E],x?.focus(g),v+=u}while(x!==o.activeElement);return t&6&&jz(x)&&x.select(),2}function EN(e){if(!e)return new Set;if(typeof e=="function")return new Set(e());let t=new Set;for(let n of e.current)n.current instanceof HTMLElement&&t.add(n.current);return t}let Mz="div";var TN=(e=>(e[e.None=1]="None",e[e.InitialFocus=2]="InitialFocus",e[e.TabLock=4]="TabLock",e[e.FocusLock=8]="FocusLock",e[e.RestoreFocus=16]="RestoreFocus",e[e.All=30]="All",e))(TN||{});function $z(e,t){let n=(0,l.useRef)(null),r=dc(n,t),{initialFocus:s,containers:o,features:i=30,...u}=e;Qv()||(i=1);let p=Xv(n);zz({ownerDocument:p},Boolean(i&16));let g=Uz({ownerDocument:p,container:n,initialFocus:s},Boolean(i&2));Bz({ownerDocument:p,container:n,containers:o,previousActiveElement:g},Boolean(i&8));let v=kz(),w=Zs(k=>{let N=n.current;N&&(L=>L())(()=>{Zi(v.current,{[Ob.Forwards]:()=>{Nb(N,Ap.First,{skipElements:[k.relatedTarget]})},[Ob.Backwards]:()=>{Nb(N,Ap.Last,{skipElements:[k.relatedTarget]})}})})}),x=kb(),E=(0,l.useRef)(!1),R={ref:r,onKeyDown(k){k.key=="Tab"&&(E.current=!0,x.requestAnimationFrame(()=>{E.current=!1}))},onBlur(k){let N=EN(o);n.current instanceof HTMLElement&&N.add(n.current);let L=k.relatedTarget;L instanceof HTMLElement&&L.dataset.headlessuiFocusGuard!=="true"&&(kN(N,L)||(E.current?Nb(n.current,Zi(v.current,{[Ob.Forwards]:()=>Ap.Next,[Ob.Backwards]:()=>Ap.Previous})|Ap.WrapAround,{relativeTo:k.target}):k.target instanceof HTMLElement&&rm(k.target)))}};return l.createElement(l.Fragment,null,Boolean(i&4)&&l.createElement(qC,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:w,features:Jx.Focusable}),Ml({ourProps:R,theirProps:u,defaultTag:Mz,name:"FocusTrap"}),Boolean(i&4)&&l.createElement(qC,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:w,features:Jx.Focusable}))}let Lz=gl($z),Ab=Object.assign(Lz,{features:TN});function Fz(e=!0){let t=(0,l.useRef)(nm.slice());return WC(([n],[r])=>{r===!0&&n===!1&&Wx(()=>{t.current.splice(0)}),r===!1&&n===!0&&(t.current=nm.slice())},[e,nm,t]),Zs(()=>{var n;return(n=t.current.find(r=>r!=null&&r.isConnected))!=null?n:null})}function zz({ownerDocument:e},t){let n=Fz(t);WC(()=>{t||e?.activeElement===e?.body&&rm(n())},[t]),bN(()=>{t&&rm(n())})}function Uz({ownerDocument:e,container:t,initialFocus:n},r){let s=(0,l.useRef)(null),o=Rb();return WC(()=>{if(!r)return;let i=t.current;i&&Wx(()=>{if(!o.current)return;let u=e?.activeElement;if(n!=null&&n.current){if(n?.current===u){s.current=u;return}}else if(i.contains(u)){s.current=u;return}n!=null&&n.current?rm(n.current):Nb(i,Ap.First)===xN.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),s.current=e?.activeElement})},[r]),s}function Bz({ownerDocument:e,container:t,containers:n,previousActiveElement:r},s){let o=Rb();yN(e?.defaultView,"focus",i=>{if(!s||!o.current)return;let u=EN(n);t.current instanceof HTMLElement&&u.add(t.current);let p=r.current;if(!p)return;let g=i.target;g&&g instanceof HTMLElement?kN(u,g)?(r.current=g,rm(g)):(i.preventDefault(),i.stopPropagation(),rm(p)):rm(r.current)},!0)}function kN(e,t){for(let n of e)if(n.contains(t))return!0;return!1}let RN=(0,l.createContext)(!1);function Vz(){return(0,l.useContext)(RN)}function YC(e){return l.createElement(RN.Provider,{value:e.force},e.children)}function Hz(e){let t=Vz(),n=(0,l.useContext)(PN),r=Xv(e),[s,o]=(0,l.useState)(()=>{if(!t&&n!==null||Op.isServer)return null;let i=r?.getElementById("headlessui-portal-root");if(i)return i;if(r===null)return null;let u=r.createElement("div");return u.setAttribute("id","headlessui-portal-root"),r.body.appendChild(u)});return(0,l.useEffect)(()=>{s!==null&&(r!=null&&r.body.contains(s)||r==null||r.body.appendChild(s))},[s,r]),(0,l.useEffect)(()=>{t||n!==null&&o(n.current)},[n,o,t]),s}let Wz=l.Fragment;function qz(e,t){let n=e,r=(0,l.useRef)(null),s=dc(uz(v=>{r.current=v}),t),o=Xv(r),i=Hz(r),[u]=(0,l.useState)(()=>{var v;return Op.isServer?null:(v=o?.createElement("div"))!=null?v:null}),p=(0,l.useContext)(XC),g=Qv();return Xi(()=>{!i||!u||i.contains(u)||(u.setAttribute("data-headlessui-portal",""),i.appendChild(u))},[i,u]),Xi(()=>{if(u&&p)return p.register(u)},[p,u]),bN(()=>{var v;!i||!u||(u instanceof Node&&i.contains(u)&&i.removeChild(u),i.childNodes.length<=0&&((v=i.parentElement)==null||v.removeChild(i)))}),g?!i||!u?null:(0,kt.createPortal)(Ml({ourProps:{ref:s},theirProps:n,defaultTag:Wz,name:"Portal"}),u):null}let Kz=l.Fragment,PN=(0,l.createContext)(null);function Gz(e,t){let{target:n,...r}=e,s={ref:dc(t)};return l.createElement(PN.Provider,{value:n},Ml({ourProps:s,theirProps:r,defaultTag:Kz,name:"Popover.Group"}))}let XC=(0,l.createContext)(null);function Qz(){let e=(0,l.useContext)(XC),t=(0,l.useRef)([]),n=Zs(o=>(t.current.push(o),e&&e.register(o),()=>r(o))),r=Zs(o=>{let i=t.current.indexOf(o);i!==-1&&t.current.splice(i,1),e&&e.unregister(o)}),s=(0,l.useMemo)(()=>({register:n,unregister:r,portals:t}),[n,r,t]);return[t,(0,l.useMemo)(()=>function({children:o}){return l.createElement(XC.Provider,{value:s},o)},[s])]}let Yz=gl(qz),Xz=gl(Gz),ZC=Object.assign(Yz,{Group:Xz});function Zz(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}const Jz=typeof Object.is=="function"?Object.is:Zz,{useState:eU,useEffect:tU,useLayoutEffect:nU,useDebugValue:rU}=se;let Nde=null,Ade=null;function sU(e,t,n){const r=t(),[{inst:s},o]=eU({inst:{value:r,getSnapshot:t}});return nU(()=>{s.value=r,s.getSnapshot=t,JC(s)&&o({inst:s})},[e,r,t]),tU(()=>(JC(s)&&o({inst:s}),e(()=>{JC(s)&&o({inst:s})})),[e]),rU(r),r}function JC(e){const t=e.getSnapshot,n=e.value;try{const r=t();return!Jz(n,r)}catch{return!0}}function oU(e,t,n){return t()}const aU=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",iU=!aU,Ide=iU?oU:sU,lU=(e=>e.useSyncExternalStore)(se);function cU(e){return lU(e.subscribe,e.getSnapshot,e.getSnapshot)}function uU(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(s){return r.add(s),()=>r.delete(s)},dispatch(s,...o){let i=t[s].call(n,...o);i&&(n=i,r.forEach(u=>u()))}}}function dU(){let e;return{before({doc:t}){var n;let r=t.documentElement;e=((n=t.defaultView)!=null?n:window).innerWidth-r.clientWidth},after({doc:t,d:n}){let r=t.documentElement,s=r.clientWidth-r.offsetWidth,o=e-s;n.style(r,"paddingRight",`${o}px`)}}}function ON(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function fU(){return/Android/gi.test(window.navigator.userAgent)}function pU(){return ON()||fU()}function hU(){return ON()?{before({doc:e,d:t,meta:n}){function r(s){return n.containers.flatMap(o=>o()).some(o=>o.contains(s))}t.microTask(()=>{var s;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let u=Ed();u.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>u.dispose()))}let o=(s=window.scrollY)!=null?s:window.pageYOffset,i=null;t.addEventListener(e,"click",u=>{if(u.target instanceof HTMLElement)try{let p=u.target.closest("a");if(!p)return;let{hash:g}=new URL(p.href),v=e.querySelector(g);v&&!r(v)&&(i=v)}catch{}},!0),t.addEventListener(e,"touchstart",u=>{if(u.target instanceof HTMLElement)if(r(u.target)){let p=u.target;for(;p.parentElement&&r(p.parentElement);)p=p.parentElement;t.style(p,"overscrollBehavior","contain")}else t.style(u.target,"touchAction","none")}),t.addEventListener(e,"touchmove",u=>{if(u.target instanceof HTMLElement)if(r(u.target)){let p=u.target;for(;p.parentElement&&p.dataset.headlessuiPortal!==""&&!(p.scrollHeight>p.clientHeight||p.scrollWidth>p.clientWidth);)p=p.parentElement;p.dataset.headlessuiPortal===""&&u.preventDefault()}else u.preventDefault()},{passive:!1}),t.add(()=>{var u;let p=(u=window.scrollY)!=null?u:window.pageYOffset;o!==p&&window.scrollTo(0,o),i&&i.isConnected&&(i.scrollIntoView({block:"nearest"}),i=null)})})}}:{}}function mU(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function gU(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let e0=uU(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:Ed(),meta:new Set};return r.count++,r.meta.add(t),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:n}){let r={doc:e,d:t,meta:gU(n)},s=[hU(),dU(),mU()];s.forEach(({before:o})=>o?.(r)),s.forEach(({after:o})=>o?.(r))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});e0.subscribe(()=>{let e=e0.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let r=t.get(n.doc)==="hidden",s=n.count!==0;(s&&!r||!s&&r)&&e0.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&e0.dispatch("TEARDOWN",n)}});function vU(e,t,n){let r=cU(e0),s=e?r.get(e):void 0,o=s?s.count>0:!1;return Xi(()=>{if(!(!e||!t))return e0.dispatch("PUSH",e,n),()=>e0.dispatch("POP",e,n)},[t,e]),o}var NN;let Ip=(NN=l.useId)!=null?NN:function(){let e=Qv(),[t,n]=l.useState(e?()=>Op.nextId():null);return Xi(()=>{t===null&&n(Op.nextId())},[t]),t!=null?""+t:void 0},eE=new Map,Ib=new Map;function AN(e,t=!0){Xi(()=>{var n;if(!t)return;let r=typeof e=="function"?e():e.current;if(!r)return;function s(){var i;if(!r)return;let u=(i=Ib.get(r))!=null?i:1;if(u===1?Ib.delete(r):Ib.set(r,u-1),u!==1)return;let p=eE.get(r);p&&(p["aria-hidden"]===null?r.removeAttribute("aria-hidden"):r.setAttribute("aria-hidden",p["aria-hidden"]),r.inert=p.inert,eE.delete(r))}let o=(n=Ib.get(r))!=null?n:0;return Ib.set(r,o+1),o!==0||(eE.set(r,{"aria-hidden":r.getAttribute("aria-hidden"),inert:r.inert}),r.setAttribute("aria-hidden","true"),r.inert=!0),s},[e,t])}function e_(e,t,n){let r=Np(t);(0,l.useEffect)(()=>{function s(o){r.current(o)}return document.addEventListener(e,s,n),()=>document.removeEventListener(e,s,n)},[e,n])}function IN(e,t,n=!0){let r=(0,l.useRef)(!1);(0,l.useEffect)(()=>{requestAnimationFrame(()=>{r.current=n})},[n]);function s(i,u){if(!r.current||i.defaultPrevented)return;let p=u(i);if(p===null||!p.getRootNode().contains(p)||!p.isConnected)return;let g=function v(w){return typeof w=="function"?v(w()):Array.isArray(w)||w instanceof Set?w:[w]}(e);for(let v of g){if(v===null)continue;let w=v instanceof HTMLElement?v:v.current;if(w!=null&&w.contains(p)||i.composed&&i.composedPath().includes(w))return}return!QC(p,GC.Loose)&&p.tabIndex!==-1&&i.preventDefault(),t(i,p)}let o=(0,l.useRef)(null);e_("pointerdown",i=>{var u,p;r.current&&(o.current=((p=(u=i.composedPath)==null?void 0:u.call(i))==null?void 0:p[0])||i.target)},!0),e_("mousedown",i=>{var u,p;r.current&&(o.current=((p=(u=i.composedPath)==null?void 0:u.call(i))==null?void 0:p[0])||i.target)},!0),e_("click",i=>{pU()||o.current&&(s(i,()=>o.current),o.current=null)},!0),e_("touchend",i=>s(i,()=>i.target instanceof HTMLElement?i.target:null),!0),wN("blur",i=>s(i,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function yU({defaultContainers:e=[],portals:t,mainTreeNodeRef:n}={}){var r;let s=(0,l.useRef)((r=n?.current)!=null?r:null),o=Xv(s),i=Zs(()=>{var u,p,g;let v=[];for(let w of e)w!==null&&(w instanceof HTMLElement?v.push(w):"current"in w&&w.current instanceof HTMLElement&&v.push(w.current));if(t!=null&&t.current)for(let w of t.current)v.push(w);for(let w of(u=o?.querySelectorAll("html > *, body > *"))!=null?u:[])w!==document.body&&w!==document.head&&w instanceof HTMLElement&&w.id!=="headlessui-portal-root"&&(w.contains(s.current)||w.contains((g=(p=s.current)==null?void 0:p.getRootNode())==null?void 0:g.host)||v.some(x=>w.contains(x))||v.push(w));return v});return{resolveContainers:i,contains:Zs(u=>i().some(p=>p.contains(u))),mainTreeNodeRef:s,MainTreeNode:(0,l.useMemo)(()=>function(){return n!=null?null:l.createElement(qC,{features:Jx.Hidden,ref:s})},[s,n])}}function jde(){let e=M(null);return{mainTreeNodeRef:e,MainTreeNode:d(()=>function(){return m.createElement(T,{features:H.Hidden,ref:e})},[e])}}let tE=(0,l.createContext)(()=>{});tE.displayName="StackContext";var nE=(e=>(e[e.Add=0]="Add",e[e.Remove=1]="Remove",e))(nE||{});function bU(){return(0,l.useContext)(tE)}function wU({children:e,onUpdate:t,type:n,element:r,enabled:s}){let o=bU(),i=Zs((...u)=>{t?.(...u),o(...u)});return Xi(()=>{let u=s===void 0||s===!0;return u&&i(0,n,r),()=>{u&&i(1,n,r)}},[i,n,r,s]),l.createElement(tE.Provider,{value:i},e)}function jN(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=t?.getAttribute("disabled")==="";return r&&xU(n)?!1:r}function xU(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}let DN=(0,l.createContext)(null);function MN(){let e=(0,l.useContext)(DN);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,MN),t}return e}function _U(){let[e,t]=(0,l.useState)([]);return[e.length>0?e.join(" "):void 0,(0,l.useMemo)(()=>function(n){let r=Zs(o=>(t(i=>[...i,o]),()=>t(i=>{let u=i.slice(),p=u.indexOf(o);return p!==-1&&u.splice(p,1),u}))),s=(0,l.useMemo)(()=>({register:r,slot:n.slot,name:n.name,props:n.props}),[r,n.slot,n.name,n.props]);return l.createElement(DN.Provider,{value:s},n.children)},[t])]}let SU="p";function CU(e,t){let n=Ip(),{id:r=`headlessui-description-${n}`,...s}=e,o=MN(),i=dc(t);Xi(()=>o.register(r),[r,o.register]);let u={ref:i,...o.props,id:r};return Ml({ourProps:u,theirProps:s,slot:o.slot||{},defaultTag:SU,name:o.name||"Description"})}let EU=gl(CU),TU=Object.assign(EU,{});var Ji=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(Ji||{}),kU=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(kU||{}),RU=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(RU||{});let PU={[0](e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},t_=(0,l.createContext)(null);t_.displayName="DialogContext";function jb(e){let t=(0,l.useContext)(t_);if(t===null){let n=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,jb),n}return t}function OU(e,t,n=()=>[document.body]){vU(e,t,r=>{var s;return{containers:[...(s=r.containers)!=null?s:[],n]}})}function NU(e,t){return Zi(t.type,PU,e,t)}let AU="div",IU=Yv.RenderStrategy|Yv.Static;function jU(e,t){let n=Ip(),{id:r=`headlessui-dialog-${n}`,open:s,onClose:o,initialFocus:i,role:u="dialog",__demoMode:p=!1,...g}=e,[v,w]=(0,l.useState)(0),x=(0,l.useRef)(!1);u=function(){return u==="dialog"||u==="alertdialog"?u:(x.current||(x.current=!0,console.warn(`Invalid role [${u}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")}();let E=qx();s===void 0&&E!==null&&(s=(E&ml.Open)===ml.Open);let R=(0,l.useRef)(null),k=dc(R,t),N=Xv(R),L=e.hasOwnProperty("open")||E!==null,D=e.hasOwnProperty("onClose");if(!L&&!D)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!L)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!D)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(typeof s!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${s}`);if(typeof o!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${o}`);let B=s?0:1,[Q,ce]=(0,l.useReducer)(NU,{titleId:null,descriptionId:null,panelRef:(0,l.createRef)()}),ye=Zs(()=>o(!1)),G=Zs(tr=>ce({type:0,id:tr})),Le=Qv()?p?!1:B===0:!1,We=v>1,at=(0,l.useContext)(t_)!==null,[St,xt]=Qz(),Mt={get current(){var tr;return(tr=Q.panelRef.current)!=null?tr:R.current}},{resolveContainers:$t,mainTreeNodeRef:Nt,MainTreeNode:Bn}=yU({portals:St,defaultContainers:[Mt]}),wn=We?"parent":"leaf",Nn=E!==null?(E&ml.Closing)===ml.Closing:!1,Zt=(()=>at||Nn?!1:Le)(),Pt=(0,l.useCallback)(()=>{var tr,mr;return(mr=Array.from((tr=N?.querySelectorAll("body > *"))!=null?tr:[]).find(En=>En.id==="headlessui-portal-root"?!1:En.contains(Nt.current)&&En instanceof HTMLElement))!=null?mr:null},[Nt]);AN(Pt,Zt);let At=(()=>We?!0:Le)(),Ht=(0,l.useCallback)(()=>{var tr,mr;return(mr=Array.from((tr=N?.querySelectorAll("[data-headlessui-portal]"))!=null?tr:[]).find(En=>En.contains(Nt.current)&&En instanceof HTMLElement))!=null?mr:null},[Nt]);AN(Ht,At);let Gt=(()=>!(!Le||We))();IN($t,tr=>{tr.preventDefault(),ye()},Gt);let Sn=(()=>!(We||B!==0))();yN(N?.defaultView,"keydown",tr=>{Sn&&(tr.defaultPrevented||tr.key===Ji.Escape&&(tr.preventDefault(),tr.stopPropagation(),ye()))});let Cr=(()=>!(Nn||B!==0||at))();OU(N,Cr,$t),(0,l.useEffect)(()=>{if(B!==0||!R.current)return;let tr=new ResizeObserver(mr=>{for(let En of mr){let Ws=En.target.getBoundingClientRect();Ws.x===0&&Ws.y===0&&Ws.width===0&&Ws.height===0&&ye()}});return tr.observe(R.current),()=>tr.disconnect()},[B,R,ye]);let[br,Ln]=_U(),Hr=(0,l.useMemo)(()=>[{dialogState:B,close:ye,setTitleId:G},Q],[B,Q,ye,G]),ws=(0,l.useMemo)(()=>({open:B===0}),[B]),us={ref:k,id:r,role:u,"aria-modal":B===0?!0:void 0,"aria-labelledby":Q.titleId,"aria-describedby":br};return l.createElement(wU,{type:"Dialog",enabled:B===0,element:R,onUpdate:Zs((tr,mr)=>{mr==="Dialog"&&Zi(tr,{[nE.Add]:()=>w(En=>En+1),[nE.Remove]:()=>w(En=>En-1)})})},l.createElement(YC,{force:!0},l.createElement(ZC,null,l.createElement(t_.Provider,{value:Hr},l.createElement(ZC.Group,{target:R},l.createElement(YC,{force:!1},l.createElement(Ln,{slot:ws,name:"Dialog.Description"},l.createElement(Ab,{initialFocus:i,containers:$t,features:Le?Zi(wn,{parent:Ab.features.RestoreFocus,leaf:Ab.features.All&~Ab.features.FocusLock}):Ab.features.None},l.createElement(xt,null,Ml({ourProps:us,theirProps:g,slot:ws,defaultTag:AU,features:IU,visible:B===0,name:"Dialog"}))))))))),l.createElement(Bn,null))}let DU="div";function MU(e,t){let n=Ip(),{id:r=`headlessui-dialog-overlay-${n}`,...s}=e,[{dialogState:o,close:i}]=jb("Dialog.Overlay"),u=dc(t),p=Zs(v=>{if(v.target===v.currentTarget){if(jN(v.currentTarget))return v.preventDefault();v.preventDefault(),v.stopPropagation(),i()}}),g=(0,l.useMemo)(()=>({open:o===0}),[o]);return Ml({ourProps:{ref:u,id:r,"aria-hidden":!0,onClick:p},theirProps:s,slot:g,defaultTag:DU,name:"Dialog.Overlay"})}let $U="div";function LU(e,t){let n=Ip(),{id:r=`headlessui-dialog-backdrop-${n}`,...s}=e,[{dialogState:o},i]=jb("Dialog.Backdrop"),u=dc(t);(0,l.useEffect)(()=>{if(i.panelRef.current===null)throw new Error("A <Dialog.Backdrop /> component is being used, but a <Dialog.Panel /> component is missing.")},[i.panelRef]);let p=(0,l.useMemo)(()=>({open:o===0}),[o]);return l.createElement(YC,{force:!0},l.createElement(ZC,null,Ml({ourProps:{ref:u,id:r,"aria-hidden":!0},theirProps:s,slot:p,defaultTag:$U,name:"Dialog.Backdrop"})))}let FU="div";function zU(e,t){let n=Ip(),{id:r=`headlessui-dialog-panel-${n}`,...s}=e,[{dialogState:o},i]=jb("Dialog.Panel"),u=dc(t,i.panelRef),p=(0,l.useMemo)(()=>({open:o===0}),[o]),g=Zs(v=>{v.stopPropagation()});return Ml({ourProps:{ref:u,id:r,onClick:g},theirProps:s,slot:p,defaultTag:FU,name:"Dialog.Panel"})}let UU="h2";function BU(e,t){let n=Ip(),{id:r=`headlessui-dialog-title-${n}`,...s}=e,[{dialogState:o,setTitleId:i}]=jb("Dialog.Title"),u=dc(t);(0,l.useEffect)(()=>(i(r),()=>i(null)),[r,i]);let p=(0,l.useMemo)(()=>({open:o===0}),[o]);return Ml({ourProps:{ref:u,id:r},theirProps:s,slot:p,defaultTag:UU,name:"Dialog.Title"})}let VU=gl(jU),HU=gl(LU),WU=gl(zU),qU=gl(MU),KU=gl(BU),$N=Object.assign(VU,{Backdrop:HU,Panel:WU,Overlay:qU,Title:KU,Description:TU});const LN=({children:e,open:t,onClose:n,className:r})=>{const{t:s}=(0,z.Bd)();return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(Pb.Root,{show:t,as:l.Fragment,children:(0,a.jsxs)($N,{as:"div",className:st("fixed inset-0 z-50 lg:hidden",r),onClose:n,children:[(0,a.jsx)(Pb.Child,{as:l.Fragment,enter:"transition-opacity ease-linear duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"transition-opacity ease-linear duration-300",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,a.jsx)("div",{className:"fixed inset-0 bg-gray-600/75"})}),(0,a.jsx)(Pb.Child,{as:l.Fragment,enter:"transition ease-in-out duration-300 transform",enterFrom:"-translate-x-full",enterTo:"translate-x-0",leave:"transition ease-in-out duration-300 transform",leaveFrom:"translate-x-0",leaveTo:"-translate-x-full",children:(0,a.jsxs)($N.Panel,{className:"relative inline-flex",children:[e,(0,a.jsx)(Pb.Child,{as:l.Fragment,enter:"ease-in-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in-out duration-300",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,a.jsx)("div",{className:"pl-2 pt-3",onClick:n,children:(0,a.jsxs)("button",{type:"button",className:"ml-1 flex h-10 w-10 items-center justify-center rounded-full outline-none ring-2 ring-inset ring-white",children:[(0,a.jsx)("span",{className:"sr-only",children:s("core:sidebar.closeSidebar")}),(0,a.jsx)(su,{className:"h-6 w-6 text-white","aria-hidden":"true"})]})})})]})})]})}),(0,a.jsx)("div",{className:"hidden lg:flex",children:e})]})},rE=({children:e,Icon:t,current:n,dataTestId:r})=>(0,a.jsxs)("div",{className:st("hover:bg-slate-800 group flex items-center rounded-md px-4 py-2 antialiased md:subpixel-antialiased text-sm font-normal text-slate-300 hover:text-slate-200 dark:hover:bg-slate-800",n&&"bg-secondary hover:bg-secondary-600 text-white dark:bg-slate-900 dark:bg-secondary dark:hover:bg-secondary-600 dark:text-white"),"data-testid":`${r??""} ${n?"menuItemCurrent":""}`,children:[t&&(0,a.jsx)(t,{className:st("mr-3 h-6 w-6 shrink-0 stroke-1")}),(0,a.jsx)("span",{children:e})]}),FN=({logo:e,onLogoClick:t,logoContainerClassName:n,companyName:r,children:s})=>(0,a.jsxs)("aside",{className:"z-50 flex h-screen w-64 flex-none flex-col gap-16 overflow-auto bg-slate-900 dark:border-r dark:border-slate-800 dark:bg-slate-950 lg:fixed lg:h-full lg:w-64","aria-label":"Sidebar","data-testid":"sidebar",children:[(0,a.jsx)("div",{className:st("flex shrink h-24 lg:h-40 items-center p-2 lg:shrink-0 justify-center mt-4 mx-6 rounded-lg",t&&"cursor-pointer",n),onClick:t,children:(0,a.jsx)("img",{src:e,className:"block max-h-full max-w-full object-contain align-middle italic",alt:r,"data-testid":"logo"})}),(0,a.jsx)("div",{className:"mt-1 flex-1 px-2",children:(0,a.jsx)("nav",{className:"flex-1 space-y-1",children:s})})]}),Zv=({children:e,className:t=""})=>(0,a.jsx)("main",{className:t,children:e});function GU({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"}))}const QU=l.forwardRef(GU),zN=({children:e,onHamburgerButtonClick:t,rightSection:n,className:r})=>{const{t:s}=(0,z.Bd)();return(0,a.jsxs)("div",{className:st("bg-primary sticky top-0 z-40 flex h-16 w-full shrink-0 border-b-gray-100 shadow dark:border-b dark:border-slate-800 dark:bg-slate-950 lg:bg-white lg:shadow-sm",r),"data-testid":"header",children:[t&&(0,a.jsxs)("button",{type:"button",className:"border-r border-transparent px-4 text-gray-500 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-indigo-500 dark:border-transparent dark:text-gray-100 lg:hidden",onClick:t,children:[(0,a.jsx)("span",{className:"sr-only",children:s("core:header.openMenu")}),(0,a.jsx)(QU,{className:"h-6 w-6 text-white"})]}),(0,a.jsxs)("div",{className:"flex flex-1 justify-between lg:px-8 lg:py-4",children:[(0,a.jsx)("div",{className:"flex grow items-center",children:e}),(0,a.jsx)("div",{className:"flex grow items-center justify-end gap-6 px-4 lg:gap-7 lg:pr-0",children:n})]})]})},Ude=({Icon:e,description:t,unreadItemsCount:n,...r})=>jsxs("button",{type:"button",className:"relative rounded-full border border-slate-50 p-2 text-gray-400 hover:bg-slate-200 hover:text-gray-500 focus:bg-slate-200 focus:outline-none dark:border-slate-800 dark:bg-transparent dark:text-gray-100 md:h-9 md:w-9",...r,children:[t&&jsx("span",{className:"sr-only",children:t}),jsx(e,{className:"h-5 w-5"}),n&&jsxs("div",{className:"absolute right-0 top-0 -mr-1 -mt-1 flex h-4 w-4",children:[jsx("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-purple-400 opacity-75"}),jsx("div",{className:"relative inline-flex h-4 w-4 items-center justify-center rounded-full bg-blue-500 text-[10px] font-light text-white",children:n})]})]}),Bde=null,zs=({dataTestId:e,floating:t=!1,className:n})=>{const{t:r}=(0,z.Bd)();return(0,a.jsxs)("div",{className:st(t&&"fixed left-0 top-0 z-30 flex h-screen w-screen items-center justify-center bg-white/50 dark:bg-black/50"),"data-testid":e??"spinner",role:"status",children:[(0,a.jsxs)("svg",{"aria-hidden":"true",className:st("mr-2 h-16 w-16 animate-spin fill-blue-600 text-gray-200 dark:text-gray-600",n),viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,a.jsx)("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),(0,a.jsx)("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),(0,a.jsx)("span",{className:"sr-only",children:r("core:spinner.loading")})]})};function YU({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"}))}const Td=l.forwardRef(YU),XU=()=>{const{t:e}=(0,z.Bd)();return(0,a.jsx)("div",{"data-testid":"server-error",className:"h-screen dark:bg-slate-900",children:(0,a.jsxs)("div",{className:"mx-auto flex h-full max-w-2xl flex-col items-center text-center",children:[(0,a.jsx)(Td,{className:"mx-auto mt-20 w-12 text-red-600 sm:mt-24"}),(0,a.jsx)("h1",{className:"mt-4 text-3xl font-bold tracking-tight text-gray-900 dark:text-white  sm:text-5xl",children:e("core:errors.server.title")}),(0,a.jsx)("p",{className:"mt-4 text-base leading-7 text-gray-600 dark:text-white sm:mt-6 sm:text-lg  sm:leading-8",children:e("core:errors.server.description")})]})})},n_=(e,{showLoader:t=!0,fallback:n}={})=>(0,a.jsx)(sb,{fallback:(0,a.jsx)(XU,{}),children:(0,a.jsx)(l.Suspense,{fallback:t?n??(0,a.jsx)(zs,{floating:!0}):null,children:e})});var r_=ln(6225);const UN=l.lazy(async()=>await Promise.all([ln.e(735),ln.e(95)]).then(ln.bind(ln,6095))),sE="Avatar",[ZU,qde]=va(sE),[JU,BN]=ZU(sE),VN=(0,l.forwardRef)((e,t)=>{const{__scopeAvatar:n,...r}=e,[s,o]=(0,l.useState)("idle");return(0,l.createElement)(JU,{scope:n,imageLoadingStatus:s,onImageLoadingStatusChange:o},(0,l.createElement)(zn.span,(0,Je.A)({},r,{ref:t})))}),HN="AvatarImage",WN=(0,l.forwardRef)((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:s=()=>{},...o}=e,i=BN(HN,n),u=eB(r),p=Ao(g=>{s(g),i.onImageLoadingStatusChange(g)});return ya(()=>{u!=="idle"&&p(u)},[u,p]),u==="loaded"?(0,l.createElement)(zn.img,(0,Je.A)({},o,{ref:t,src:r})):null}),qN="AvatarFallback",KN=(0,l.forwardRef)((e,t)=>{const{__scopeAvatar:n,delayMs:r,...s}=e,o=BN(qN,n),[i,u]=(0,l.useState)(r===void 0);return(0,l.useEffect)(()=>{if(r!==void 0){const p=window.setTimeout(()=>u(!0),r);return()=>window.clearTimeout(p)}},[r]),i&&o.imageLoadingStatus!=="loaded"?(0,l.createElement)(zn.span,(0,Je.A)({},s,{ref:t})):null});function eB(e){const[t,n]=(0,l.useState)("idle");return ya(()=>{if(!e){n("error");return}let r=!0;const s=new window.Image,o=i=>()=>{r&&n(i)};return n("loading"),s.onload=o("loaded"),s.onerror=o("error"),s.src=e,()=>{r=!1}},[e]),t}const GN=VN,QN=WN,YN=KN,jp=l.forwardRef(({className:e,...t},n)=>(0,a.jsx)(GN,{ref:n,className:st("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));jp.displayName=GN.displayName;const XN=l.forwardRef(({className:e,...t},n)=>(0,a.jsx)(QN,{ref:n,className:st("aspect-square h-full w-full",e),...t}));XN.displayName=QN.displayName;const Dp=l.forwardRef(({className:e,...t},n)=>(0,a.jsx)(YN,{ref:n,className:st("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Dp.displayName=YN.displayName;function tB({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.752 15.002A9.72 9.72 0 0 1 18 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 0 0 3 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 0 0 9.002-5.998Z"}))}const nB=l.forwardRef(tB);function rB({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3v2.25m6.364.386-1.591 1.591M21 12h-2.25m-.386 6.364-1.591-1.591M12 18.75V21m-4.773-4.227-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0Z"}))}const sB=l.forwardRef(rB);function Db(e){const t=(0,l.useRef)({value:e,previous:e});return(0,l.useMemo)(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}const oE="Switch",[oB,Qde]=va(oE),[aB,iB]=oB(oE),ZN=(0,l.forwardRef)((e,t)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:o,required:i,disabled:u,value:p="on",onCheckedChange:g,...v}=e,[w,x]=(0,l.useState)(null),E=Lr(t,D=>x(D)),R=(0,l.useRef)(!1),k=w?Boolean(w.closest("form")):!0,[N=!1,L]=si({prop:s,defaultProp:o,onChange:g});return(0,l.createElement)(aB,{scope:n,checked:N,disabled:u},(0,l.createElement)(zn.button,(0,Je.A)({type:"button",role:"switch","aria-checked":N,"aria-required":i,"data-state":tA(N),"data-disabled":u?"":void 0,disabled:u,value:p},v,{ref:E,onClick:gn(e.onClick,D=>{L(B=>!B),k&&(R.current=D.isPropagationStopped(),R.current||D.stopPropagation())})})),k&&(0,l.createElement)(lB,{control:w,bubbles:!R.current,name:r,value:p,checked:N,required:i,disabled:u,style:{transform:"translateX(-100%)"}}))}),JN="SwitchThumb",eA=(0,l.forwardRef)((e,t)=>{const{__scopeSwitch:n,...r}=e,s=iB(JN,n);return(0,l.createElement)(zn.span,(0,Je.A)({"data-state":tA(s.checked),"data-disabled":s.disabled?"":void 0},r,{ref:t}))}),lB=e=>{const{control:t,checked:n,bubbles:r=!0,...s}=e,o=(0,l.useRef)(null),i=Db(n),u=Wv(t);return(0,l.useEffect)(()=>{const p=o.current,g=window.HTMLInputElement.prototype,w=Object.getOwnPropertyDescriptor(g,"checked").set;if(i!==n&&w){const x=new Event("click",{bubbles:r});w.call(p,n),p.dispatchEvent(x)}},[i,n,r]),(0,l.createElement)("input",(0,Je.A)({type:"checkbox","aria-hidden":!0,defaultChecked:n},s,{tabIndex:-1,ref:o,style:{...e.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function tA(e){return e?"checked":"unchecked"}const nA=ZN,cB=eA,rA=(0,l.forwardRef)(({children:e,className:t,...n},r)=>(0,a.jsxs)(nA,{ref:r,className:st("flex items-center dark:bg-slate-950 dark:border-slate-950 relative bg-slate-200 border-2 border-transparent shrink-0 shadow-inner focus:outline-none relative h-6 w-12 cursor-pointer rounded-full outline-none data-[state=checked]:bg-gradient-to-tr data-[state=checked]:from-indigo-600 data-[state=checked]:to-purple-700",t),...n,children:[e,(0,a.jsx)(cB,{className:"shadow-blackA7 flex h-5 w-5 translate-x-0.5 items-center justify-center rounded-full bg-white transition-transform duration-100 will-change-transform data-[state=checked]:translate-x-6"})]}));rA.displayName=nA.displayName;const ci=rA,uB=(0,l.forwardRef)((e,t)=>{const{children:n,...r}=e,s=l.Children.toArray(n),o=s.find(dB);if(o){const i=o.props.children,u=s.map(p=>p===o?l.Children.count(i)>1?l.Children.only(null):(0,l.isValidElement)(i)?i.props.children:null:p);return(0,l.createElement)(aE,(0,Je.A)({},r,{ref:t}),(0,l.isValidElement)(i)?(0,l.cloneElement)(i,void 0,u):null)}return(0,l.createElement)(aE,(0,Je.A)({},r,{ref:t}),n)});uB.displayName="Slot";const aE=(0,l.forwardRef)((e,t)=>{const{children:n,...r}=e;return(0,l.isValidElement)(n)?(0,l.cloneElement)(n,{...fB(r,n.props),ref:t?nc(t,n.ref):n.ref}):l.Children.count(n)>1?l.Children.only(null):null});aE.displayName="SlotClone";const sA=({children:e})=>(0,l.createElement)(l.Fragment,null,e);function dB(e){return(0,l.isValidElement)(e)&&e.type===sA}function fB(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...u)=>{o(...u),s(...u)}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}const Yde=null,pB="VisuallyHidden",iE=(0,l.forwardRef)((e,t)=>(0,l.createElement)(zn.span,(0,Je.A)({},e,{ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}))),hB=iE,[s_,Xde]=va("Tooltip",[qv]),o_=qv(),oA="TooltipProvider",mB=700,lE="tooltip.open",[gB,cE]=s_(oA),aA=e=>{const{__scopeTooltip:t,delayDuration:n=mB,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:o}=e,[i,u]=(0,l.useState)(!0),p=(0,l.useRef)(!1),g=(0,l.useRef)(0);return(0,l.useEffect)(()=>{const v=g.current;return()=>window.clearTimeout(v)},[]),(0,l.createElement)(gB,{scope:t,isOpenDelayed:i,delayDuration:n,onOpen:(0,l.useCallback)(()=>{window.clearTimeout(g.current),u(!1)},[]),onClose:(0,l.useCallback)(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>u(!0),r)},[r]),isPointerInTransitRef:p,onPointerInTransitChange:(0,l.useCallback)(v=>{p.current=v},[]),disableHoverableContent:s},o)},a_="Tooltip",[vB,Mb]=s_(a_),iA=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s=!1,onOpenChange:o,disableHoverableContent:i,delayDuration:u}=e,p=cE(a_,e.__scopeTooltip),g=o_(t),[v,w]=(0,l.useState)(null),x=ri(),E=(0,l.useRef)(0),R=i??p.disableHoverableContent,k=u??p.delayDuration,N=(0,l.useRef)(!1),[L=!1,D]=si({prop:r,defaultProp:s,onChange:G=>{G?(p.onOpen(),document.dispatchEvent(new CustomEvent(lE))):p.onClose(),o?.(G)}}),B=(0,l.useMemo)(()=>L?N.current?"delayed-open":"instant-open":"closed",[L]),Q=(0,l.useCallback)(()=>{window.clearTimeout(E.current),N.current=!1,D(!0)},[D]),ce=(0,l.useCallback)(()=>{window.clearTimeout(E.current),D(!1)},[D]),ye=(0,l.useCallback)(()=>{window.clearTimeout(E.current),E.current=window.setTimeout(()=>{N.current=!0,D(!0)},k)},[k,D]);return(0,l.useEffect)(()=>()=>window.clearTimeout(E.current),[]),(0,l.createElement)(Vx,g,(0,l.createElement)(vB,{scope:t,contentId:x,open:L,stateAttribute:B,trigger:v,onTriggerChange:w,onTriggerEnter:(0,l.useCallback)(()=>{p.isOpenDelayed?ye():Q()},[p.isOpenDelayed,ye,Q]),onTriggerLeave:(0,l.useCallback)(()=>{R?ce():window.clearTimeout(E.current)},[ce,R]),onOpen:Q,onClose:ce,disableHoverableContent:R},n))},uE="TooltipTrigger",lA=(0,l.forwardRef)((e,t)=>{const{__scopeTooltip:n,...r}=e,s=Mb(uE,n),o=cE(uE,n),i=o_(n),u=(0,l.useRef)(null),p=Lr(t,u,s.onTriggerChange),g=(0,l.useRef)(!1),v=(0,l.useRef)(!1),w=(0,l.useCallback)(()=>g.current=!1,[]);return(0,l.useEffect)(()=>()=>document.removeEventListener("pointerup",w),[w]),(0,l.createElement)(Hx,(0,Je.A)({asChild:!0},i),(0,l.createElement)(zn.button,(0,Je.A)({"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute},r,{ref:p,onPointerMove:gn(e.onPointerMove,x=>{x.pointerType!=="touch"&&!v.current&&!o.isPointerInTransitRef.current&&(s.onTriggerEnter(),v.current=!0)}),onPointerLeave:gn(e.onPointerLeave,()=>{s.onTriggerLeave(),v.current=!1}),onPointerDown:gn(e.onPointerDown,()=>{g.current=!0,document.addEventListener("pointerup",w,{once:!0})}),onFocus:gn(e.onFocus,()=>{g.current||s.onOpen()}),onBlur:gn(e.onBlur,s.onClose),onClick:gn(e.onClick,s.onClose)})))}),dE="TooltipPortal",[yB,bB]=s_(dE,{forceMount:void 0}),wB=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:s}=e,o=Mb(dE,t);return(0,l.createElement)(yB,{scope:t,forceMount:n},(0,l.createElement)(la,{present:n||o.open},(0,l.createElement)(Wi,{asChild:!0,container:s},r)))},Jv="TooltipContent",cA=(0,l.forwardRef)((e,t)=>{const n=bB(Jv,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...o}=e,i=Mb(Jv,e.__scopeTooltip);return(0,l.createElement)(la,{present:r||i.open},i.disableHoverableContent?(0,l.createElement)(uA,(0,Je.A)({side:s},o,{ref:t})):(0,l.createElement)(xB,(0,Je.A)({side:s},o,{ref:t})))}),xB=(0,l.forwardRef)((e,t)=>{const n=Mb(Jv,e.__scopeTooltip),r=cE(Jv,e.__scopeTooltip),s=(0,l.useRef)(null),o=Lr(t,s),[i,u]=(0,l.useState)(null),{trigger:p,onClose:g}=n,v=s.current,{onPointerInTransitChange:w}=r,x=(0,l.useCallback)(()=>{u(null),w(!1)},[w]),E=(0,l.useCallback)((R,k)=>{const N=R.currentTarget,L={x:R.clientX,y:R.clientY},D=EB(L,N.getBoundingClientRect()),B=TB(L,D),Q=kB(k.getBoundingClientRect()),ce=PB([...B,...Q]);u(ce),w(!0)},[w]);return(0,l.useEffect)(()=>()=>x(),[x]),(0,l.useEffect)(()=>{if(p&&v){const R=N=>E(N,v),k=N=>E(N,p);return p.addEventListener("pointerleave",R),v.addEventListener("pointerleave",k),()=>{p.removeEventListener("pointerleave",R),v.removeEventListener("pointerleave",k)}}},[p,v,E,x]),(0,l.useEffect)(()=>{if(i){const R=k=>{const N=k.target,L={x:k.clientX,y:k.clientY},D=p?.contains(N)||v?.contains(N),B=!RB(L,i);D?x():B&&(x(),g())};return document.addEventListener("pointermove",R),()=>document.removeEventListener("pointermove",R)}},[p,v,i,g,x]),(0,l.createElement)(uA,(0,Je.A)({},e,{ref:o}))}),[_B,SB]=s_(a_,{isInside:!1}),uA=(0,l.forwardRef)((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:o,onPointerDownOutside:i,...u}=e,p=Mb(Jv,n),g=o_(n),{onClose:v}=p;return(0,l.useEffect)(()=>(document.addEventListener(lE,v),()=>document.removeEventListener(lE,v)),[v]),(0,l.useEffect)(()=>{if(p.trigger){const w=x=>{const E=x.target;E!=null&&E.contains(p.trigger)&&v()};return window.addEventListener("scroll",w,{capture:!0}),()=>window.removeEventListener("scroll",w,{capture:!0})}},[p.trigger,v]),(0,l.createElement)(wf,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:w=>w.preventDefault(),onDismiss:v},(0,l.createElement)(IC,(0,Je.A)({"data-state":p.stateAttribute},g,u,{ref:t,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"}}),(0,l.createElement)(sA,null,r),(0,l.createElement)(_B,{scope:n,isInside:!0},(0,l.createElement)(hB,{id:p.contentId,role:"tooltip"},s||r))))}),dA="TooltipArrow",CB=(0,l.forwardRef)((e,t)=>{const{__scopeTooltip:n,...r}=e,s=o_(n);return SB(dA,n).isInside?null:(0,l.createElement)(jC,(0,Je.A)({},s,r,{ref:t}))});function EB(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,s,o)){case o:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function TB(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function kB(e){const{top:t,right:n,bottom:r,left:s}=e;return[{x:s,y:t},{x:n,y:t},{x:n,y:r},{x:s,y:r}]}function RB(e,t){const{x:n,y:r}=e;let s=!1;for(let o=0,i=t.length-1;o<t.length;i=o++){const u=t[o].x,p=t[o].y,g=t[i].x,v=t[i].y;p>r!=v>r&&n<(g-u)*(r-p)/(v-p)+u&&(s=!s)}return s}function PB(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),OB(t)}function OB(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const s=e[r];for(;t.length>=2;){const o=t[t.length-1],i=t[t.length-2];if((o.x-i.x)*(s.y-i.y)>=(o.y-i.y)*(s.x-i.x))t.pop();else break}t.push(s)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const s=e[r];for(;n.length>=2;){const o=n[n.length-1],i=n[n.length-2];if((o.x-i.x)*(s.y-i.y)>=(o.y-i.y)*(s.x-i.x))n.pop();else break}n.push(s)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}const NB=aA,AB=iA,IB=lA,Zde=null,fA=cA,Jde=null,pA=(0,l.forwardRef)(({className:e,sideOffset:t=4,...n},r)=>(0,a.jsx)(fA,{ref:r,sideOffset:t,className:st("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-50 data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-i-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1 dark:bg-slate-950 dark:border-slate-800",e),...n}));pA.displayName=fA.displayName;const t0=({children:e,tooltip:t,className:n,wrapperClassName:r,...s})=>(0,a.jsx)(NB,{children:(0,a.jsxs)(AB,{...s,children:[(0,a.jsx)(IB,{className:r,asChild:!0,children:(0,a.jsx)("div",{className:"inline-flex",children:e})}),(0,a.jsx)(pA,{className:n,"data-testid":"tooltip",children:t})]})}),$l=t0,hA=({darkMode:e,setDarkMode:t})=>{const{t:n}=(0,z.Bd)(),r=n(e?"core:theme.darkModeToggle.disableDarkModeTooltip":"core:theme.darkModeToggle.enableDarkModeTooltip");return(0,a.jsx)("div",{children:(0,a.jsx)($l,{tooltip:r,children:(0,a.jsxs)(ci,{"data-testid":"btnDarkModeSwitch",defaultChecked:e,onCheckedChange:()=>t(!e),children:[(0,a.jsx)(nB,{"data-testid":"btnDarkModeIcon",className:"absolute left-1.5 h-4 w-4 text-slate-200"}),(0,a.jsx)(sB,{"data-testid":"btnLightModeIcon",className:"absolute right-1.5 h-4 w-4 text-slate-400"})]})})})};function mA(e){var t;if(e.type)return e.type;let n=(t=e.as)!=null?t:"button";if(typeof n=="string"&&n.toLowerCase()==="button")return"button"}function jB(e,t){let[n,r]=(0,l.useState)(()=>mA(e));return Xi(()=>{r(mA(e))},[e.type,e.as]),Xi(()=>{n||t.current&&t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&r("button")},[n,t]),n}let gA=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function vA(e){var t,n;let r=(t=e.innerText)!=null?t:"",s=e.cloneNode(!0);if(!(s instanceof HTMLElement))return r;let o=!1;for(let u of s.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))u.remove(),o=!0;let i=o?(n=s.innerText)!=null?n:"":r;return gA.test(i)&&(i=i.replace(gA,"")),i}function DB(e){let t=e.getAttribute("aria-label");if(typeof t=="string")return t.trim();let n=e.getAttribute("aria-labelledby");if(n){let r=n.split(" ").map(s=>{let o=document.getElementById(s);if(o){let i=o.getAttribute("aria-label");return typeof i=="string"?i.trim():vA(o).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return vA(e).trim()}function MB(e){let t=(0,l.useRef)(""),n=(0,l.useRef)("");return Zs(()=>{let r=e.current;if(!r)return"";let s=r.innerText;if(t.current===s)return n.current;let o=DB(r).trim().toLowerCase();return t.current=s,n.current=o,o})}function yA(e){return[e.screenX,e.screenY]}function $B(){let e=(0,l.useRef)([-1,-1]);return{wasMoved(t){let n=yA(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=yA(t)}}}function LB({container:e,accept:t,walk:n,enabled:r=!0}){let s=(0,l.useRef)(t),o=(0,l.useRef)(n);(0,l.useEffect)(()=>{s.current=t,o.current=n},[t,n]),Xi(()=>{if(!e||!r)return;let i=Zx(e);if(!i)return;let u=s.current,p=o.current,g=Object.assign(w=>u(w),{acceptNode:u}),v=i.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,g,!1);for(;v.nextNode();)p(v.currentNode)},[e,r,s,o])}function FB(e){throw new Error("Unexpected object: "+e)}var kd=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(kd||{});function zB(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),s=r??-1;switch(e.focus){case 0:{for(let o=0;o<n.length;++o)if(!t.resolveDisabled(n[o],o,n))return o;return r}case 1:{for(let o=s-1;o>=0;--o)if(!t.resolveDisabled(n[o],o,n))return o;return r}case 2:{for(let o=s+1;o<n.length;++o)if(!t.resolveDisabled(n[o],o,n))return o;return r}case 3:{for(let o=n.length-1;o>=0;--o)if(!t.resolveDisabled(n[o],o,n))return o;return r}case 4:{for(let o=0;o<n.length;++o)if(t.resolveId(n[o],o,n)===e.id)return o;return r}case 5:return null;default:FB(e)}}var UB=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(UB||{}),BB=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(BB||{}),VB=(e=>(e[e.OpenMenu=0]="OpenMenu",e[e.CloseMenu=1]="CloseMenu",e[e.GoToItem=2]="GoToItem",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterItem=5]="RegisterItem",e[e.UnregisterItem=6]="UnregisterItem",e))(VB||{});function fE(e,t=n=>n){let n=e.activeItemIndex!==null?e.items[e.activeItemIndex]:null,r=CN(t(e.items.slice()),o=>o.dataRef.current.domRef.current),s=n?r.indexOf(n):null;return s===-1&&(s=null),{items:r,activeItemIndex:s}}let HB={[1](e){return e.menuState===1?e:{...e,activeItemIndex:null,menuState:1}},[0](e){return e.menuState===0?e:{...e,__demoMode:!1,menuState:0}},[2]:(e,t)=>{var n;let r=fE(e),s=zB(t,{resolveItems:()=>r.items,resolveActiveIndex:()=>r.activeItemIndex,resolveId:o=>o.id,resolveDisabled:o=>o.dataRef.current.disabled});return{...e,...r,searchQuery:"",activeItemIndex:s,activationTrigger:(n=t.trigger)!=null?n:1}},[3]:(e,t)=>{let n=e.searchQuery!==""?0:1,r=e.searchQuery+t.value.toLowerCase(),s=(e.activeItemIndex!==null?e.items.slice(e.activeItemIndex+n).concat(e.items.slice(0,e.activeItemIndex+n)):e.items).find(i=>{var u;return((u=i.dataRef.current.textValue)==null?void 0:u.startsWith(r))&&!i.dataRef.current.disabled}),o=s?e.items.indexOf(s):-1;return o===-1||o===e.activeItemIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeItemIndex:o,activationTrigger:1}},[4](e){return e.searchQuery===""?e:{...e,searchQuery:"",searchActiveItemIndex:null}},[5]:(e,t)=>{let n=fE(e,r=>[...r,{id:t.id,dataRef:t.dataRef}]);return{...e,...n}},[6]:(e,t)=>{let n=fE(e,r=>{let s=r.findIndex(o=>o.id===t.id);return s!==-1&&r.splice(s,1),r});return{...e,...n,activationTrigger:1}}},pE=(0,l.createContext)(null);pE.displayName="MenuContext";function i_(e){let t=(0,l.useContext)(pE);if(t===null){let n=new Error(`<${e} /> is missing a parent <Menu /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,i_),n}return t}function WB(e,t){return Zi(t.type,HB,e,t)}let qB=l.Fragment;function KB(e,t){let{__demoMode:n=!1,...r}=e,s=(0,l.useReducer)(WB,{__demoMode:n,menuState:n?0:1,buttonRef:(0,l.createRef)(),itemsRef:(0,l.createRef)(),items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1}),[{menuState:o,itemsRef:i,buttonRef:u},p]=s,g=dc(t);IN([u,i],(E,R)=>{var k;p({type:1}),QC(R,GC.Loose)||(E.preventDefault(),(k=u.current)==null||k.focus())},o===0);let v=Zs(()=>{p({type:1})}),w=(0,l.useMemo)(()=>({open:o===0,close:v}),[o,v]),x={ref:g};return l.createElement(pE.Provider,{value:s},l.createElement(dN,{value:Zi(o,{[0]:ml.Open,[1]:ml.Closed})},Ml({ourProps:x,theirProps:r,slot:w,defaultTag:qB,name:"Menu"})))}let GB="button";function QB(e,t){var n;let r=Ip(),{id:s=`headlessui-menu-button-${r}`,...o}=e,[i,u]=i_("Menu.Button"),p=dc(i.buttonRef,t),g=kb(),v=Zs(k=>{switch(k.key){case Ji.Space:case Ji.Enter:case Ji.ArrowDown:k.preventDefault(),k.stopPropagation(),u({type:0}),g.nextFrame(()=>u({type:2,focus:kd.First}));break;case Ji.ArrowUp:k.preventDefault(),k.stopPropagation(),u({type:0}),g.nextFrame(()=>u({type:2,focus:kd.Last}));break}}),w=Zs(k=>{switch(k.key){case Ji.Space:k.preventDefault();break}}),x=Zs(k=>{if(jN(k.currentTarget))return k.preventDefault();e.disabled||(i.menuState===0?(u({type:1}),g.nextFrame(()=>{var N;return(N=i.buttonRef.current)==null?void 0:N.focus({preventScroll:!0})})):(k.preventDefault(),u({type:0})))}),E=(0,l.useMemo)(()=>({open:i.menuState===0}),[i]),R={ref:p,id:s,type:jB(e,i.buttonRef),"aria-haspopup":"menu","aria-controls":(n=i.itemsRef.current)==null?void 0:n.id,"aria-expanded":i.menuState===0,onKeyDown:v,onKeyUp:w,onClick:x};return Ml({ourProps:R,theirProps:o,slot:E,defaultTag:GB,name:"Menu.Button"})}let YB="div",XB=Yv.RenderStrategy|Yv.Static;function ZB(e,t){var n,r;let s=Ip(),{id:o=`headlessui-menu-items-${s}`,...i}=e,[u,p]=i_("Menu.Items"),g=dc(u.itemsRef,t),v=Xv(u.itemsRef),w=kb(),x=qx(),E=(()=>x!==null?(x&ml.Open)===ml.Open:u.menuState===0)();(0,l.useEffect)(()=>{let D=u.itemsRef.current;D&&u.menuState===0&&D!==v?.activeElement&&D.focus({preventScroll:!0})},[u.menuState,u.itemsRef,v]),LB({container:u.itemsRef.current,enabled:u.menuState===0,accept(D){return D.getAttribute("role")==="menuitem"?NodeFilter.FILTER_REJECT:D.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(D){D.setAttribute("role","none")}});let R=Zs(D=>{var B,Q;switch(w.dispose(),D.key){case Ji.Space:if(u.searchQuery!=="")return D.preventDefault(),D.stopPropagation(),p({type:3,value:D.key});case Ji.Enter:if(D.preventDefault(),D.stopPropagation(),p({type:1}),u.activeItemIndex!==null){let{dataRef:ce}=u.items[u.activeItemIndex];(Q=(B=ce.current)==null?void 0:B.domRef.current)==null||Q.click()}SN(u.buttonRef.current);break;case Ji.ArrowDown:return D.preventDefault(),D.stopPropagation(),p({type:2,focus:kd.Next});case Ji.ArrowUp:return D.preventDefault(),D.stopPropagation(),p({type:2,focus:kd.Previous});case Ji.Home:case Ji.PageUp:return D.preventDefault(),D.stopPropagation(),p({type:2,focus:kd.First});case Ji.End:case Ji.PageDown:return D.preventDefault(),D.stopPropagation(),p({type:2,focus:kd.Last});case Ji.Escape:D.preventDefault(),D.stopPropagation(),p({type:1}),Ed().nextFrame(()=>{var ce;return(ce=u.buttonRef.current)==null?void 0:ce.focus({preventScroll:!0})});break;case Ji.Tab:D.preventDefault(),D.stopPropagation(),p({type:1}),Ed().nextFrame(()=>{Dz(u.buttonRef.current,D.shiftKey?Ap.Previous:Ap.Next)});break;default:D.key.length===1&&(p({type:3,value:D.key}),w.setTimeout(()=>p({type:4}),350));break}}),k=Zs(D=>{switch(D.key){case Ji.Space:D.preventDefault();break}}),N=(0,l.useMemo)(()=>({open:u.menuState===0}),[u]),L={"aria-activedescendant":u.activeItemIndex===null||(n=u.items[u.activeItemIndex])==null?void 0:n.id,"aria-labelledby":(r=u.buttonRef.current)==null?void 0:r.id,id:o,onKeyDown:R,onKeyUp:k,role:"menu",tabIndex:0,ref:g};return Ml({ourProps:L,theirProps:i,slot:N,defaultTag:YB,features:XB,visible:E,name:"Menu.Items"})}let JB=l.Fragment;function eV(e,t){let n=Ip(),{id:r=`headlessui-menu-item-${n}`,disabled:s=!1,...o}=e,[i,u]=i_("Menu.Item"),p=i.activeItemIndex!==null?i.items[i.activeItemIndex].id===r:!1,g=(0,l.useRef)(null),v=dc(t,g);Xi(()=>{if(i.__demoMode||i.menuState!==0||!p||i.activationTrigger===0)return;let ce=Ed();return ce.requestAnimationFrame(()=>{var ye,G;(G=(ye=g.current)==null?void 0:ye.scrollIntoView)==null||G.call(ye,{block:"nearest"})}),ce.dispose},[i.__demoMode,g,p,i.menuState,i.activationTrigger,i.activeItemIndex]);let w=MB(g),x=(0,l.useRef)({disabled:s,domRef:g,get textValue(){return w()}});Xi(()=>{x.current.disabled=s},[x,s]),Xi(()=>(u({type:5,id:r,dataRef:x}),()=>u({type:6,id:r})),[x,r]);let E=Zs(()=>{u({type:1})}),R=Zs(ce=>{if(s)return ce.preventDefault();u({type:1}),SN(i.buttonRef.current)}),k=Zs(()=>{if(s)return u({type:2,focus:kd.Nothing});u({type:2,focus:kd.Specific,id:r})}),N=$B(),L=Zs(ce=>N.update(ce)),D=Zs(ce=>{N.wasMoved(ce)&&(s||p||u({type:2,focus:kd.Specific,id:r,trigger:0}))}),B=Zs(ce=>{N.wasMoved(ce)&&(s||p&&u({type:2,focus:kd.Nothing}))}),Q=(0,l.useMemo)(()=>({active:p,disabled:s,close:E}),[p,s,E]);return Ml({ourProps:{id:r,ref:v,role:"menuitem",tabIndex:s===!0?void 0:-1,"aria-disabled":s===!0?!0:void 0,disabled:void 0,onClick:R,onFocus:k,onPointerEnter:L,onMouseEnter:L,onPointerMove:D,onMouseMove:D,onPointerLeave:B,onMouseLeave:B},theirProps:o,slot:Q,defaultTag:JB,name:"Menu.Item"})}let tV=gl(KB),nV=gl(QB),rV=gl(ZB),sV=gl(eV),l_=Object.assign(tV,{Button:nV,Items:rV,Item:sV});const bA=({children:e,buttonContent:t,className:n,...r})=>(0,a.jsxs)(l_,{as:"div",className:"relative",children:[(0,a.jsx)(l_.Button,{className:st("flex max-w-xs items-center rounded-full text-sm focus:bg-slate-200 focus:outline-none ",n),...r,title:"User menu button",children:t}),(0,a.jsx)(Pb,{as:l.Fragment,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:(0,a.jsx)(l_.Items,{className:"absolute right-0 z-50 mt-2 origin-top-right divide-y divide-gray-200 rounded-xl border-[rgba(255,255,255,0.18)] bg-white/50 py-2 shadow-[0px_4px_24px_#00000012,inset_0px_-1px_1px_#ffffff20,inset_0px_1px_1px_#ffffff40] ring-1 ring-black/5 backdrop-blur-[32px] backdrop-brightness-[100%] focus:outline-none dark:divide-slate-800 dark:border dark:border-slate-800 dark:bg-slate-900 dark:text-white dark:shadow-none dark:backdrop-blur-none",children:e})})]}),sm=({children:e,className:t,autoClose:n=!0,onClick:r,...s})=>{const o=i=>{n||i.preventDefault(),r&&r(i)};return(0,a.jsx)(l_.Item,{...s,onClick:i=>o(i),children:({active:i})=>(0,a.jsx)("div",{className:Y0(i&&"bg-gray-100","block cursor-pointer px-4 py-2 text-sm text-gray-900 whitespace-nowrap hover:bg-slate-200 dark:text-white dark:hover:text-slate-900 focus-visible:outline-indigo-300 dark:focus-visible:text-primary",t),children:e})})},nfe=({Icon:e,className:t,...n})=>jsx("div",{className:mergeClassName("flex justify-center items-center h-9 w-9 md:h-10 md:w-10 p-2 text-gray-400 dark:bg-stone-900 dark:text-gray-100 md:text-gray-400",t),...n,children:jsx(e,{className:"h-7 w-7"})}),rfe=null;var ey=ln(1048);const Mp=e=>{if(!e||e.trim().length===0)return"";const t=e.trim().split(/\s+/),n=[];return t.length>0&&n.push(t[0][0].toUpperCase()),t.length===1&&n.push(t[0][1].toUpperCase()),t.length>1&&n.length<2&&n.push(t[1][0].toUpperCase()),n.join("").slice(0,2)};function oV({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 21a9.004 9.004 0 0 0 8.716-6.747M12 21a9.004 9.004 0 0 1-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 0 1 7.843 4.582M12 3a8.997 8.997 0 0 0-7.843 4.582m15.686 0A11.953 11.953 0 0 1 12 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0 1 21 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0 1 12 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 0 1 3 12c0-1.605.42-3.113 1.157-4.418"}))}const wA=l.forwardRef(oV);var n0=ln(5873);const jo=(0,l.forwardRef)(({to:e,children:t,isAbsolute:n=!1,dataTestId:r,currentClassName:s,params:o={},...i},u)=>{const p=Qh(),g=jf(),v=Dl();!g.organizationUniqueName&&!o.organizationUniqueName&&(o.organizationUniqueName="");const w=v(e,o),x=p.pathname===w;return n?(0,a.jsx)("a",{href:e,...i,ref:u,children:t}):(0,a.jsx)(ka,{ref:u,to:w,"data-testid":r,className:(0,jc.A)(i.className,x&&s),...i,children:t})}),xA=({onClick:e,...t})=>{const{t:n}=(0,z.Bd)(),r=(0,n0.ok)(),s=(0,n0.Jt)(),o=(0,n0.Mb)(),i=(g,v)=>n(g==="en"?"ssp:layout.userMenu.languageToggle.switchToFrenchTooltip":"ssp:layout.userMenu.languageToggle.switchToEnglishTooltip"),u=g=>n(g==="en"?"ssp:layout.userMenu.languageToggle.languages.english":"ssp:layout.userMenu.languageToggle.languages.french"),p=(g,v)=>{g.preventDefault(),o(v),e?.(g)};return r?(0,a.jsx)(a.Fragment,{children:s.filter(g=>g!==r).map(g=>(0,l.createElement)(jo,{...t,to:"#",key:g,onClick:v=>{p(v,g)},className:"group flex items-center text-inherit dark:text-inherit","data-testid":"linkLanguageSwitch"},(0,a.jsx)(t0,{tooltip:i(r,g),children:(0,a.jsxs)("div",{"data-testid":"btnLanguageSwitch",className:"flex items-center justify-center gap-1 text-sm font-normal antialiased md:subpixel-antialiased ",children:[(0,a.jsx)(wA,{"data-testid":"btnLanguageSwitchIcon",className:"w-5 stroke-1 text-inherit dark:text-inherit"}),u(r)]})})))}):null},aV=()=>{const{t:e}=(0,z.Bd)(),{data:t}=(0,ey.useCurrentUser)(),n=(0,ae.L)(),r=Fv(),{setDarkMode:s}=Ox(),i=`${_2()}/admin`;if(!t)return null;const p=(()=>{if(!(!t.firstName||!t.lastName))return`${t.firstName} ${t.lastName}`})();return(0,a.jsxs)(bA,{buttonContent:(0,a.jsx)("div",{className:"flex flex-row items-center gap-3 rounded-full md:pr-0",children:(0,a.jsx)(jp,{children:(0,a.jsx)(Dp,{className:"dark:text-slate-200",children:Mp(p)})})}),className:"border border-slate-800 bg-slate-950 focus-visible:outline-offset-0 focus-visible:outline-indigo-300 dark:border dark:border-slate-800 dark:bg-slate-900 sm:border-slate-200 sm:bg-slate-200","data-testid":"user-menu",children:[(0,a.jsx)("div",{children:(0,a.jsx)(sm,{className:"cursor-default text-gray-900 hover:bg-transparent dark:text-white dark:hover:text-white dark:focus-visible:text-primary",disabled:!0,children:(0,a.jsxs)("div",{className:"flex min-w-[225px] flex-col items-center gap-y-2 px-1 pb-2 pt-1",children:[(0,a.jsx)("div",{className:"flex h-11 w-11 items-center justify-center rounded-full border border-slate-200 bg-slate-300 dark:border-slate-800 dark:bg-slate-900",children:(0,a.jsx)(jp,{children:(0,a.jsx)(Dp,{className:"dark:bg-slate-950 dark:text-slate-200",children:Mp(p)})})}),(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center gap-1 pl-4 pr-2",children:[p&&(0,a.jsx)("div",{className:"text-sm font-semibold leading-none","data-testid":"menuUserFullName",children:p}),t.jobTitle&&(0,a.jsx)("div",{className:"text-sm text-gray-500",children:t.jobTitle}),t?.isResellerAdminOrInternalAdmin?(0,a.jsx)(jo,{isAbsolute:!0,to:i,target:"_blank","data-testid":"linkAdminUrl",rel:"noopener noreferrer",className:"inline-block text-sm text-blue-600 focus-visible:outline-indigo-300",children:e("ssp:layout.userMenu.goToAdmin")}):null]})]})})}),(0,a.jsx)("div",{children:(0,a.jsxs)(sm,{autoClose:!1,className:"flex items-center justify-between whitespace-nowrap",children:[e("ssp:layout.userMenu.darkModeToggle.label"),(0,a.jsx)(hA,{darkMode:r,setDarkMode:s})]})}),(0,a.jsx)("div",{children:(0,a.jsxs)(sm,{autoClose:!1,className:"flex items-center justify-between whitespace-nowrap",children:[e("ssp:layout.userMenu.languageToggle.label"),(0,a.jsx)(xA,{})]})}),(0,a.jsx)("div",{children:(0,a.jsx)("a",{href:n,className:"mt-10 w-3/4","data-testid":"linkSignOutUrl",children:(0,a.jsx)(sm,{children:e("ssp:layout.userMenu.signOut")})})})]})},iV=({onHamburgerButtonClick:e})=>{const t=Fv(),{hasNoActivatedOrganizations:n}=iC();return(0,a.jsx)(zN,{onHamburgerButtonClick:n?void 0:e,rightSection:(0,a.jsxs)("div",{className:"flex flex-row gap-4",children:[n_((0,a.jsx)(UN,{className:"self-center",mode:t?r_.uy.Dark:r_.uy.Light}),{showLoader:!1}),(0,a.jsx)(aV,{})]}),children:n?null:(0,a.jsx)(sz,{})})};function lV({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.712 4.33a9.027 9.027 0 0 1 1.652 1.306c.51.51.944 1.064 1.306 1.652M16.712 4.33l-3.448 4.138m3.448-4.138a9.014 9.014 0 0 0-9.424 0M19.67 7.288l-4.138 3.448m4.138-3.448a9.014 9.014 0 0 1 0 9.424m-4.138-5.976a3.736 3.736 0 0 0-.88-1.388 3.737 3.737 0 0 0-1.388-.88m2.268 2.268a3.765 3.765 0 0 1 0 2.528m-2.268-4.796a3.765 3.765 0 0 0-2.528 0m4.796 4.796c-.181.506-.475.982-.88 1.388a3.736 3.736 0 0 1-1.388.88m2.268-2.268 4.138 3.448m0 0a9.027 9.027 0 0 1-1.306 1.652c-.51.51-1.064.944-1.652 1.306m0 0-3.448-4.138m3.448 4.138a9.014 9.014 0 0 1-9.424 0m5.976-4.138a3.765 3.765 0 0 1-2.528 0m0 0a3.736 3.736 0 0 1-1.388-.88 3.737 3.737 0 0 1-.88-1.388m2.268 2.268L7.288 19.67m0 0a9.024 9.024 0 0 1-1.652-1.306 9.027 9.027 0 0 1-1.306-1.652m0 0 4.138-3.448M4.33 16.712a9.014 9.014 0 0 1 0-9.424m4.138 5.976a3.765 3.765 0 0 1 0-2.528m0 0c.181-.506.475-.982.88-1.388a3.736 3.736 0 0 1 1.388-.88m-2.268 2.268L4.33 7.288m6.406 1.18L7.288 4.33m0 0a9.024 9.024 0 0 0-1.652 1.306A9.025 9.025 0 0 0 4.33 7.288"}))}const cV=l.forwardRef(lV);function uV({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.5 14.25v2.25m3-4.5v4.5m3-6.75v6.75m3-9v9M6 20.25h12A2.25 2.25 0 0 0 20.25 18V6A2.25 2.25 0 0 0 18 3.75H6A2.25 2.25 0 0 0 3.75 6v12A2.25 2.25 0 0 0 6 20.25Z"}))}const dV=l.forwardRef(uV);function fV({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.35 3.836c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75 2.25 2.25 0 0 0-.1-.664m-5.8 0A2.251 2.251 0 0 1 13.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m8.9-4.414c.376.023.75.05 1.124.08 1.131.094 1.976 1.057 1.976 2.192V16.5A2.25 2.25 0 0 1 18 18.75h-2.25m-7.5-10.5H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V18.75m-7.5-10.5h6.375c.621 0 1.125.504 1.125 1.125v9.375m-8.25-3 1.5 1.5 3-3.75"}))}const pV=l.forwardRef(fV);function hV({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.5 8.25V6a2.25 2.25 0 0 0-2.25-2.25H6A2.25 2.25 0 0 0 3.75 6v8.25A2.25 2.25 0 0 0 6 16.5h2.25m8.25-8.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-7.5A2.25 2.25 0 0 1 8.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 0 0-2.25 2.25v6"}))}const mV=l.forwardRef(hV);function gV({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 21v-7.5a.75.75 0 0 1 .75-.75h3a.75.75 0 0 1 .75.75V21m-4.5 0H2.36m11.14 0H18m0 0h3.64m-1.39 0V9.349M3.75 21V9.349m0 0a3.001 3.001 0 0 0 3.75-.615A2.993 2.993 0 0 0 9.75 9.75c.896 0 1.7-.393 2.25-1.016a2.993 2.993 0 0 0 2.25 1.016c.896 0 1.7-.393 2.25-1.015a3.001 3.001 0 0 0 3.75.614m-16.5 0a3.004 3.004 0 0 1-.621-4.72l1.189-1.19A1.5 1.5 0 0 1 5.378 3h13.243a1.5 1.5 0 0 1 1.06.44l1.19 1.189a3 3 0 0 1-.621 4.72M6.75 18h3.75a.75.75 0 0 0 .75-.75V13.5a.75.75 0 0 0-.75-.75H6.75a.75.75 0 0 0-.75.75v3.75c0 .414.336.75.75.75Z"}))}const _A=l.forwardRef(gV);function vV({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19.128a9.38 9.38 0 0 0 2.625.372 9.337 9.337 0 0 0 4.121-.952 4.125 4.125 0 0 0-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 0 1 8.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0 1 11.964-3.07M12 6.375a3.375 3.375 0 1 1-6.75 0 3.375 3.375 0 0 1 6.75 0Zm8.25 2.25a2.625 2.625 0 1 1-5.25 0 2.625 2.625 0 0 1 5.25 0Z"}))}const yV=l.forwardRef(vV);function bV({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 6.75h12M8.25 12h12m-12 5.25h12M3.75 6.75h.007v.008H3.75V6.75Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0ZM3.75 12h.007v.008H3.75V12Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm-.375 5.25h.007v.008H3.75v-.008Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z"}))}const hE=l.forwardRef(bV),wV="Separator",mE="horizontal",xV=["horizontal","vertical"],c_=(0,l.forwardRef)((e,t)=>{const{decorative:n,orientation:r=mE,...s}=e,o=SA(r)?r:mE,u=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return(0,l.createElement)(zn.div,(0,Je.A)({"data-orientation":o},u,s,{ref:t}))});c_.propTypes={orientation(e,t,n){const r=e[t],s=String(r);return r&&!SA(r)?new Error(_V(s,n)):null}};function _V(e,t){return`Invalid prop \`orientation\` of value \`${e}\` supplied to \`${t}\`, expected one of:
  - horizontal
  - vertical

Defaulting to \`${mE}\`.`}function SA(e){return xV.includes(e)}const CA=c_,Vu=l.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},s)=>(0,a.jsx)(CA,{ref:s,"data-testid":"separator",decorative:n,orientation:t,className:st(t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));Vu.displayName=CA.displayName;class EA{static getOrganizationPermissions(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/Permissions/organization/{organizationId}";o=o.replace("{organizationId}",t.organizationId+"");const i=(0,oe.Y_)("get","application/json",o,n);(0,oe.pY)(i,r,s)})}static getResellerPermissions(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/Permissions/reseller/{hostname}";o=o.replace("{hostname}",t.hostname+"");const i=(0,oe.Y_)("get","application/json",o,n);(0,oe.pY)(i,r,s)})}}const TA=10*60*1e3,u_={queryKey:e=>["permissions",e],queryFn:async e=>await EA.getOrganizationPermissions({organizationId:e}),staleTime:TA},gE={queryKey:e=>["resellerPermissions",e],queryFn:async e=>await EA.getResellerPermissions({hostname:e}),staleTime:TA},SV=e=>{const t=u_.queryKey(e),{isLoggedIn:n}=(0,zr.m)(),{data:r,isLoading:s,...o}=(0,js.I)({queryKey:t,queryFn:async()=>await u_.queryFn(e),staleTime:u_.staleTime,enabled:!!e&&n&&(0,Os.canLocationMakeCallForData)()});return{data:r??[],isLoading:!!e&&n&&s,...o}},CV=()=>{const{isLoggedIn:e}=(0,zr.m)(),t=Gh()??"localhost",n=gE.queryKey(t),{data:r,isLoading:s,...o}=(0,js.I)({queryKey:n,queryFn:async()=>await gE.queryFn(t),staleTime:gE.staleTime,enabled:e&&(0,Os.canLocationMakeCallForData)()});return{data:r??[],isLoading:s&&e,...o}};var gfe=ln(6664);const fu=()=>{const e=Ai(),t=SV(e??"");return{permissionsLoading:t.isLoading,permissionsFetched:t.data.length>0,hasAccess:n=>!!(t.data.length>0&&t.data.some(r=>r===n))}},Bo=e=>{const{hasAccess:t,permissionsFetched:n}=fu();return n&&t(e.permission)?(0,a.jsx)(a.Fragment,{children:e.children}):null};var Vo=ln(2297);class ty{static getTickets(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/organizations/{organizationId}/helpDesk/tickets";o=o.replace("{organizationId}",t.organizationId+"");const i=(0,oe.Y_)("get","application/json",o,n);(0,oe.pY)(i,r,s)})}static createTicket(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/organizations/{organizationId}/helpDesk/tickets";o=o.replace("{organizationId}",t.organizationId+"");const i=(0,oe.Y_)("post","application/json",o,n);let u=t.command;i.data=u,(0,oe.pY)(i,r,s)})}static getOrganizationHelpDeskTicketTypes(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/organizations/{organizationId}/helpDesk/tickets/types";o=o.replace("{organizationId}",t.organizationId+"");const i=(0,oe.Y_)("get","application/json",o,n);(0,oe.pY)(i,r,s)})}static getOrganizationHelpDeskTicketStatuses(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/organizations/{organizationId}/helpDesk/tickets/statuses";o=o.replace("{organizationId}",t.organizationId+"");const i=(0,oe.Y_)("get","application/json",o,n);(0,oe.pY)(i,r,s)})}static getTicketDetails(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/organizations/{organizationId}/helpDesk/tickets/{ticketId}";o=o.replace("{organizationId}",t.organizationId+""),o=o.replace("{ticketId}",t.ticketId+"");const i=(0,oe.Y_)("get","application/json",o,n);(0,oe.pY)(i,r,s)})}static getTicketAttachment(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/organizations/{organizationId}/helpDesk/tickets/{ticketId}/attachments/{attachmentId}";o=o.replace("{organizationId}",t.organizationId+""),o=o.replace("{ticketId}",t.ticketId+""),o=o.replace("{attachmentId}",t.attachmentId+"");const i=(0,oe.Y_)("get","application/json",o,n);(0,oe.pY)(i,r,s)})}static createTicketNote(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/organizations/{organizationId}/helpDesk/tickets/{ticketId}/notes";o=o.replace("{organizationId}",t.organizationId+""),o=o.replace("{ticketId}",t.ticketId+"");const i=(0,oe.Y_)("post","application/json",o,n);let u=t.command;i.data=u,(0,oe.pY)(i,r,s)})}}const EV=(e,t,n)=>e[n]&&t[n]&&e[n]<t[n]?-1:1,TV=(e,t)=>vE(e,t,!0),vE=(e,t,n=!1)=>[...e].sort((r,s)=>EV(r,s,t)*(n?-1:1)),kA=(e,t)=>e.slice(0,e.length>t?t:e.length),yE=(e,t)=>!e||e?.length===0||!t?{}:Object.fromEntries(e.map(n=>[n[t],n])),kV=(e,t)=>[...new Map(e.map(n=>[n[t],n])).values()],RA=e=>Array.isArray(e)?e.filter(t=>t!=null):[];class RV{static getIntegrations(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/organizations/{organizationId}/integrations";o=o.replace("{organizationId}",t.organizationId+"");const i=(0,oe.Y_)("get","application/json",o,n);(0,oe.pY)(i,r,s)})}}const PA="00000000-0000-0000-0000-000000000000",Aa=10*60*1e3,$b=20,OA=[10,20,50,100],bE=250,NA=500;var oo=ln(5734);const wE={queryKey:e=>["OrganizationIntegrationsService/getIntegrations",e],queryFn:async e=>e?await RV.getIntegrations({organizationId:e}):await(0,oo.Ui)(),staleTime:Aa},PV=e=>{const t=Io();return(0,js.I)({queryKey:wE.queryKey(t?.id),queryFn:async()=>await wE.queryFn(t?.id),enabled:!!t,staleTime:wE.staleTime,...e})},AA=e=>{const n=Io()?.uniqueName;if(e&&n)return{organizationUniqueName:n,...e};if(n)return{organizationUniqueName:n}},IA=()=>{const e=Dl(),{navigate:t}=Ni(),n=AA();return(0,l.useCallback)(()=>{n?.organizationUniqueName&&t(e(Un.HelpDesk,{organizationUniqueName:n?.organizationUniqueName}))},[e,n?.organizationUniqueName,t])},OV=()=>{const e=(0,V.jE)();return{setNote:(n,r)=>{const s=e.getQueryData(n);return e.setQueryData(n,{...s,notes:[...s?.notes??[],r]}),s}}},NV=()=>{const e=(0,V.jE)();return{updateTickets:(n,r)=>{const s=e.getQueryData(n)??[];return e.setQueryData(n,[r,...s]),s}}};class AV{static getAccess(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/organizations/{organizationId}/helpDesk/access";o=o.replace("{organizationId}",t.organizationId+"");const i=(0,oe.Y_)("get","application/json",o,n);(0,oe.pY)(i,r,s)})}}const xE={queryKey:e=>["OrganizationHelpDeskService/getAccess",e],queryFn:async e=>e?await AV.getAccess({organizationId:e}):await(0,oo.Ui)(),staleTime:Aa},d_={queryKey:e=>["OrganizationTicketsService/getTickets",e],queryFn:async e=>e?await ty.getTickets({organizationId:e}):await(0,oo.Ui)(),staleTime:Aa},_E={queryKey:e=>["OrganizationTicketsService/getOrganizationHelpDeskTicketTypes",e],queryFn:async e=>e?await ty.getOrganizationHelpDeskTicketTypes({organizationId:e}):await(0,oo.Ui)(),staleTime:Aa},SE={queryKey:e=>(0,Os.getLocalizedQueryKey)(["OrganizationTicketsService/getOrganizationHelpDeskTicketStatuses",e]),queryFn:async e=>e?await ty.getOrganizationHelpDeskTicketStatuses({organizationId:e}):await Promise.reject(new Error("Missing parameters")),staleTime:Aa},f_={queryKey:(e,t)=>["OrganizationTicketsService/getTicketDetails",e,t],queryFn:async(e,t)=>!e||!t?await Promise.reject(new Error("Missing parameters")):await ty.getTicketDetails({organizationId:e,ticketId:t}),staleTime:Aa},jA=()=>{const e=Io();return(0,js.I)({queryKey:xE.queryKey(e?.id),queryFn:async()=>await xE.queryFn(e?.id),enabled:!!e,staleTime:xE.staleTime})},p_=(e={})=>PV({...e,select:t=>t?.helpDesk?.isEnabled??!1}),CE=()=>{const e=jA(),t=Io(),n=!e?.isLoading&&e.data!==void 0&&e.data.isPsaAvailable;return(0,js.I)({queryKey:d_.queryKey(t?.id),queryFn:async()=>await d_.queryFn(t?.id),enabled:!!t&&n,staleTime:d_.staleTime})},EE=e=>{const t=Io();return(0,js.I)({queryKey:_E.queryKey(t?.id),queryFn:async()=>await _E.queryFn(t?.id),enabled:!!t,select:e,staleTime:_E.staleTime})},h_=()=>EE(e=>yE(e,"id")),m_=()=>{const e=Io();return(0,js.I)({queryKey:SE.queryKey(e?.id),queryFn:async()=>await SE.queryFn(e?.id),enabled:!!e,select:t=>yE(t,"id"),staleTime:SE.staleTime})},IV=()=>{const{t:e}=(0,z.Bd)(),t=Io(),{updateTickets:n}=NV();return(0,Vo.n)({mutationFn:async r=>{if(!r?.ticketTypeId||!t?.id)throw new Error("Missing parameters");return await ty.createTicket({organizationId:t?.id,command:{...r,ticketTypeId:r.ticketTypeId}})},onSuccess:async r=>((0,Yr.v0)(e("ssp:pages.helpdesk.create.successMessage")),n(d_.queryKey(t?.id),r)),onError:()=>{(0,Yr.A2)(e("ssp:pages.helpdesk.create.failureMessage"))}})},DA=(e,t)=>{const n=Io();return(0,js.I)({queryKey:f_.queryKey(n?.id,t),queryFn:async()=>await f_.queryFn(n?.id,t),enabled:!!n&&!!t,staleTime:f_.staleTime,...e})},jV=()=>{const{t:e}=(0,z.Bd)(),t=Io(),{setNote:n}=OV();return(0,Vo.n)({mutationFn:async r=>{if(!r?.ticketId||!t?.id)throw new Error("Missing parameters");return await ty.createTicketNote({organizationId:t?.id,ticketId:r.ticketId,command:{text:r.text}})},onSuccess:async(r,s)=>n(f_.queryKey(t?.id,s?.ticketId),r),onError:()=>{(0,Yr.A2)(e("ssp:pages.helpdesk.detail.failureMessage"))}})},DV=()=>{const{data:e}=R2(),{data:t}=Kg(),{hasAccess:n}=fu(),{pathname:r}=Qh(),{navigate:s}=Ni(),o=Dl(),i=p_(),{t:u}=(0,z.Bd)(),p=Io()?.uniqueName??"",g=()=>{s(Un.Root)},v=k=>o(k,{organizationUniqueName:p}),w=i?.data?[{permission:oe.aX.HelpDeskList,label:u("ssp:layout.menu.support"),to:v(Un.HelpDesk),Icon:cV,hasChildPages:!0,dataTestId:"menuItemSupport"}]:[],x=[...p?[{permission:oe.aX.DashboardAccess,label:u("ssp:layout.menu.dashboard"),to:v(Un.Dashboard),Icon:dV,dataTestId:"menuItemDashboard"},{permission:oe.aX.SubscriptionList,label:u("ssp:layout.menu.subscriptions"),to:v(Un.Subscriptions),Icon:pV,hasChildPages:!0,dataTestId:"menuItemSubscriptions"},{permission:oe.aX.LicenseList,label:u("ssp:layout.menu.licenses"),to:v(Un.Licenses),Icon:mV,dataTestId:"menuItemLicenses"},{label:u("ssp:layout.menu.marketplace"),permission:oe.aX.MarketplaceProductList,to:v(Un.Shop),Icon:_A,dataTestId:"menuItemShop"}]:[],...w].filter(({permission:k})=>!k||n(k))??[],E=[{permission:oe.aX.UsersList,label:u("ssp:layout.menu.users"),to:v(Un.Users),Icon:yV,hasChildPages:!0,dataTestId:"menuItemUsers"},{permission:oe.aX.OrderList,label:u("ssp:layout.menu.orders"),to:v(Un.Orders),Icon:hE,hasChildPages:!0,dataTestId:"menuItemOrders"}].filter(({permission:k})=>!k||n(k)),R=(k,N)=>N?k===r:r.startsWith(k);return(0,a.jsxs)(FN,{logoContainerClassName:"bg-white",logo:e?.logo,companyName:t?.name,onLogoClick:g,children:[x.map(({label:k,to:N,Icon:L,hasChildPages:D=!1,dataTestId:B})=>(0,a.jsx)(jo,{to:N,className:"block",children:(0,a.jsx)(rE,{dataTestId:B,Icon:L,current:R(N,!D),children:k})},N)),(0,a.jsx)(Vu,{className:"!my-4 h-px bg-slate-300"}),E.map(({label:k,to:N,Icon:L,hasChildPages:D=!1,dataTestId:B})=>(0,a.jsx)(jo,{to:N,className:"block",children:(0,a.jsx)(rE,{dataTestId:B,Icon:L,current:R(N,!D),children:k})},N))]})},Wc=({children:e,padded:t=!0,centered:n=!0,showSidebar:r=!0,showCaseChildren:s,className:o=""})=>{const[i,u]=(0,l.useState)(!1),p=()=>{u(!0)},g=()=>{u(!1)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(cN,{className:"bgGradCircles"}),(0,a.jsx)(Zv,{className:o,children:(0,a.jsxs)("div",{className:st("flex min-h-screen",{"lg:grid lg:grid-cols-[16rem_auto]":r}),children:[r?(0,a.jsx)(LN,{open:i,onClose:g,children:(0,a.jsx)(DV,{})}):null,(0,a.jsxs)("div",{className:"z-20 flex w-full flex-col",children:[(0,a.jsx)(iV,{onHamburgerButtonClick:p}),(0,a.jsxs)("div",{className:"relative lg:w-full",children:[s?(0,a.jsx)("div",{className:"pointer-events-none absolute z-30 h-full w-full bg-gradient-to-b from-slate-900/50 to-slate-900",children:s}):null,(0,a.jsx)("div",{className:(0,jc.A)("text-gray-900 dark:text-slate-200",t&&"px-4 py-8 sm:px-6 sm:py-10 lg:px-10 lg:py-8",n&&"mx-auto w-full max-w-screen-2xl",s&&"pointer-events-none select-none grayscale"),children:e})]})]})]})})]})},TE=({showSidebar:e=!1,title:t,content:n,children:r,icon:s})=>(0,a.jsx)(Wc,{showSidebar:e,children:(0,a.jsxs)("div",{className:"mx-auto mt-40 flex max-w-2xl flex-col items-center text-center sm:mt-24",children:[s??(0,a.jsx)(Xh,{className:"mx-auto w-12"}),(0,a.jsx)(Pn,{as:"h1",weight:"bold",variant:"heading3",className:"mt-6",children:t}),(0,a.jsx)(Pn,{as:"h2",variant:"body2",className:"mt-6",children:n}),r]})}),MV=V4({[Y1]:a7,[oC]:K7,[sC]:M7}),{isProduction:$V}=ae.A,LV=e=>X4({mainReducer:MV,devTools:!$V,defaultState:e}),{store:FV,persistor:zV}=LV(),wfe=null;class MA{static getAvailableOrdersByResellerId(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/resellers/{resellerId}/orders";o=o.replace("{resellerId}",t.resellerId+"");const i=(0,oe.Y_)("get","application/json",o,n);(0,oe.pY)(i,r,s)})}static getResellerOrderDetailsById(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/resellers/{resellerId}/orders/{orderId}/details";o=o.replace("{resellerId}",t.resellerId+""),o=o.replace("{orderId}",t.orderId+"");const i=(0,oe.Y_)("get","application/json",o,n);(0,oe.pY)(i,r,s)})}}const Lb={queryKey:e=>["ResellerOrdersService/getAvailableOrdersByResellerId",e],queryFn:async e=>e?await MA.getAvailableOrdersByResellerId({resellerId:e}):await(0,oo.Ui)(),staleTime:Aa},kE={queryKey:(e,t)=>["ResellerOrdersService/getResellerOrderDetailsById",e,t],queryFn:async(e,t)=>!e||!t?await(0,oo.Ui)():await MA.getResellerOrderDetailsById({resellerId:e,orderId:t}),staleTime:Aa};class om{static getLicensesByOrganizationId(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/organizations/{organizationId}/licenses";o=o.replace("{organizationId}",t.organizationId+"");const i=(0,oe.Y_)("get","application/json",o,n);(0,oe.pY)(i,r,s)})}static updateLicenseSubscribers(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/organizations/{organizationId}/licenses";o=o.replace("{organizationId}",t.organizationId+"");const i=(0,oe.Y_)("post","application/json",o,n);let u=t.command;i.data=u,(0,oe.pY)(i,r,s)})}static getSubscribersByOrganizationId(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/organizations/{organizationId}/licenses/Subscribers";o=o.replace("{organizationId}",t.organizationId+"");const i=(0,oe.Y_)("get","application/json",o,n);(0,oe.pY)(i,r,s)})}static getUsedLicenseStatsByOrganizationIdAsync(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/organizations/{organizationId}/licenses/used-stats";o=o.replace("{organizationId}",t.organizationId+"");const i=(0,oe.Y_)("get","application/json",o,n);(0,oe.pY)(i,r,s)})}static getUnusedLicenseStatsByOrganizationIdAsync(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/organizations/{organizationId}/licenses/unused-stats";o=o.replace("{organizationId}",t.organizationId+"");const i=(0,oe.Y_)("get","application/json",o,n);(0,oe.pY)(i,r,s)})}static refresh(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/organizations/{organizationId}/licenses/refresh";o=o.replace("{organizationId}",t.organizationId+"");const i=(0,oe.Y_)("post","application/json",o,n);let u=null;i.data=u,(0,oe.pY)(i,r,s)})}static getErroneousUpdatesByOrganizationId(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/organizations/{organizationId}/licenses/erroneous-updates";o=o.replace("{organizationId}",t.organizationId+"");const i=(0,oe.Y_)("get","application/json",o,n);(0,oe.pY)(i,r,s)})}static dismissErroneousUpdate(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/organizations/{organizationId}/licenses/erroneous-updates/{licenseUpdateId}/dismiss";o=o.replace("{organizationId}",t.organizationId+""),o=o.replace("{licenseUpdateId}",t.licenseUpdateId+"");const i=(0,oe.Y_)("post","application/json",o,n);let u=null;i.data=u,(0,oe.pY)(i,r,s)})}}const ny={queryKey:e=>(0,Os.getLocalizedQueryKey)(["licensesByOrganizationId",e]),queryFn:async e=>e?await om.getLicensesByOrganizationId({organizationId:e}):[],staleTime:5*1e3},g_={queryKey:e=>(0,Os.getLocalizedQueryKey)(["subscribersByOrganizationId",e]),queryFn:async e=>e?await om.getSubscribersByOrganizationId({organizationId:e}):[],staleTime:5*1e3},Fb={queryKey:e=>(0,Os.getLocalizedQueryKey)(["erroneousLicenseUpdatesByOrganizationId",e]),queryFn:async e=>e?await om.getErroneousUpdatesByOrganizationId({organizationId:e}):[]},v_={queryKey:e=>(0,Os.getLocalizedQueryKey)(["usedLicenseStatsByOrganizationId",e]),queryFn:async e=>e?await om.getUsedLicenseStatsByOrganizationIdAsync({organizationId:e}):await Promise.resolve({isRecalculating:!0,currentUserLicensesCount:0,currentUserLicenses:[]}),staleTime:60*1e3},y_={queryKey:e=>(0,Os.getLocalizedQueryKey)(["unusedLicenseStatsByOrganizationId",e]),queryFn:async e=>e?await om.getUnusedLicenseStatsByOrganizationIdAsync({organizationId:e}):await Promise.resolve({isRecalculating:!0,unusedLicensesCount:0,unusedLicenses:[]}),staleTime:60*1e3};class $A{static getOrganizationOrdersById(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/organizations/{organizationId}/orders";o=o.replace("{organizationId}",t.organizationId+"");const i=(0,oe.Y_)("get","application/json",o,n);(0,oe.pY)(i,r,s)})}static getOrganizationOrderDetailsById(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/organizations/{organizationId}/orders/{orderId}/details";o=o.replace("{organizationId}",t.organizationId+""),o=o.replace("{orderId}",t.orderId+"");const i=(0,oe.Y_)("get","application/json",o,n);(0,oe.pY)(i,r,s)})}}const RE={queryKey:e=>["OrganizationOrdersService/getOrganizationOrdersById",e],queryFn:async e=>e?await $A.getOrganizationOrdersById({organizationId:e}):await(0,oo.Ui)()},PE={queryKey:(e,t)=>["OrganizationOrdersService/getOrganizationOrderDetailsById",e,t],queryFn:async(e,t)=>!e||!t?await(0,oo.Ui)():await $A.getOrganizationOrderDetailsById({orderId:t,organizationId:e}),staleTime:Aa};class LA{static getSubscriptionsByOrganizationId(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/organizations/{organizationId}/subscriptions";o=o.replace("{organizationId}",t.organizationId+"");const i=(0,oe.Y_)("get","application/json",o,n);(0,oe.pY)(i,r,s)})}static getSubscriptionCountByOrganizationAsync(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/organizations/{organizationId}/subscriptions/count";o=o.replace("{organizationId}",t.organizationId+"");const i=(0,oe.Y_)("get","application/json",o,n);(0,oe.pY)(i,r,s)})}}const am={queryKey:e=>(0,Os.getLocalizedQueryKey)(["subscriptionsByOrganizationId",e]),queryFn:async e=>e?await LA.getSubscriptionsByOrganizationId({organizationId:e}):[],staleTime:5*1e3},OE={queryKey:e=>(0,Os.getLocalizedQueryKey)(["subscriptionCountByOrganizationId",e]),queryFn:async e=>e?await LA.getSubscriptionCountByOrganizationAsync({organizationId:e}):{count:0,isRecalculating:!0},staleTime:6*10*1e3};class b_{static getUsersAsync(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/organizations/{organizationId}/users";o=o.replace("{organizationId}",t.organizationId+"");const i=(0,oe.Y_)("get","application/json",o,n);(0,oe.pY)(i,r,s)})}static getCountUsersAsync(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/organizations/{organizationId}/users/count";o=o.replace("{organizationId}",t.organizationId+"");const i=(0,oe.Y_)("get","application/json",o,n);(0,oe.pY)(i,r,s)})}static getUser(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/organizations/{organizationId}/users/{userId}";o=o.replace("{organizationId}",t.organizationId+""),o=o.replace("{userId}",t.userId+"");const i=(0,oe.Y_)("get","application/json",o,n);(0,oe.pY)(i,r,s)})}static updateOrganizationUser(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/{userId}/update";o=o.replace("{userId}",t.userId+"");const i=(0,oe.Y_)("post","application/json",o,n);i.params={organizationId:t.organizationId};let u=t.command;i.data=u,(0,oe.pY)(i,r,s)})}}const im={queryKey:e=>["usersByOrganizationId",e],queryFn:async e=>e?await b_.getUsersAsync({organizationId:e}):[],staleTime:10*60*1e3},NE={queryKey:(e,t)=>["OrganizationUsersService/getUser",e,t],queryFn:async(e,t)=>await b_.getUser({organizationId:e,userId:t})},ry={queryKey:e=>["userCountByOrganizationId",e],queryFn:async e=>e?await b_.getCountUsersAsync({organizationId:e}):{count:0,isRecalculating:!0},staleTime:10*60*1e3},UV=()=>{const e=(0,V.jE)();return{key:oe.Sq.RefreshOrganizationSubscriptions,invokeMethod:async t=>{await e.invalidateQueries(am.queryKey(t.organizationId))}}},BV=()=>{const e=(0,V.jE)(),t=zv();return{key:oe.Sq.RefreshOrganizations,invokeMethod:async n=>{const r=n?.resellerId??t;await e.invalidateQueries(Ix.queryKey(r))}}},VV=()=>{const e=(0,V.jE)();return{key:oe.Sq.RefreshLicenses,invokeMethod:async t=>{await e.invalidateQueries(ny.queryKey(t.organizationId)),await e.invalidateQueries(im.queryKey(t.organizationId)),await e.invalidateQueries(v_.queryKey(t.organizationId)),await e.invalidateQueries(y_.queryKey(t.organizationId))}}},HV=()=>({key:oe.Sq.LogOutUser,invokeMethod:async()=>{const e=(0,ae.L)();window.location.href=e}}),WV=()=>{const e=(0,V.jE)(),t=Ai();return{key:oe.Sq.RefreshPermissions,invokeMethod:async n=>{const r=n?.organizationId??t;await e.invalidateQueries(u_.queryKey(r))}}},qV=()=>{const e=(0,V.jE)(),t=zv();return{key:oe.Sq.RefreshAdminOrders,invokeMethod:async n=>{const r=n?.resellerId??t;await e.invalidateQueries(Lb.queryKey(r))}}},KV=()=>{const e=(0,V.jE)(),t=Ai();return{key:oe.Sq.RefreshOrders,invokeMethod:async n=>{const r=n?.organizationId??t;await e.invalidateQueries(RE.queryKey(r))}}},GV=()=>[UV(),BV(),VV(),HV(),WV(),qV(),KV()],QV=e=>{const t=Ai(),n=Kg();(0,l.useEffect)(()=>{e&&t&&e.send(oe.Sq.AssignToOrganizationGroup,t)},[e?.connectionId,t]),(0,l.useEffect)(()=>{e&&n?.data?.id&&e.send(oe.Sq.AssignToResellerGroup,n?.data?.id)},[e?.connectionId,n?.data?.id])},YV=({connection:e,children:t})=>{const n=GV();return(0,l.useEffect)(()=>{e?.connectionId&&n.forEach(r=>{e.on(r.key,r.invokeMethod)})},[e?.connectionId]),QV(e),(0,a.jsx)(a.Fragment,{children:t})},FA=({className:e})=>{const{t}=(0,z.Bd)();return(0,a.jsx)(Zv,{className:"dark:bg-slate-900",children:(0,a.jsx)("div",{"data-testid":"error-500",className:st("h-full",e),children:(0,a.jsxs)("div",{className:"mx-auto flex max-w-2xl flex-col items-center text-center",children:[(0,a.jsx)(Td,{className:"mx-auto mt-20 w-12 text-red-600 sm:mt-24"}),(0,a.jsx)("p",{className:"text-base font-semibold leading-8 dark:text-white",children:"500"}),(0,a.jsx)("h1",{className:"mt-4 text-3xl font-bold tracking-tight text-gray-900 dark:text-white sm:text-5xl",children:t("ssp:pages.500.title")}),(0,a.jsx)("p",{className:"mt-4 text-base leading-7 text-gray-600 dark:text-white sm:mt-6 sm:text-lg sm:leading-8",children:t("ssp:pages.500.description")}),(0,a.jsx)(mn,{asChild:!0,className:"mt-8",children:(0,a.jsx)("a",{href:"/",children:t("ssp:pages.500.reloadApplication")})})]})})})},{bff:XV,whiteListed401Paths:ZV}=ae.A,zA=(0,Os.createClient)({api:XV,whiteListed401Paths:ZV});zA.setDefaultOptions({queries:{staleTime:10*1e3,cacheTime:60*1e3}});const JV=zA;var sy=ln(9052);const Hu=e=>{const t=(0,l.useRef)();return(0,l.useEffect)(()=>{t.current=e},[e]),t.current},eH=()=>{const[e,t]=(0,l.useState)(null);return(0,l.useEffect)(()=>{ln.e(784).then(ln.bind(ln,2784)).then(n=>{t(n.default)}).catch(n=>{console.error("failed to load google analytics",n)})},[]),e},UA=()=>{const e=ks(),t=Hu(e.pathname),n=(0,ey.useCurrentUser)(),r=eH(),s=!!r&&n?.data?.id&&!!ae.A.googleAnalyticsTrackingId,o=(0,l.useCallback)(u=>{r?.send({hitType:"pageview",page:u,title:u})},[r]);return(0,l.useEffect)(()=>{s&&(r.initialize(ae.A.googleAnalyticsTrackingId,{gaOptions:{userId:n?.data?.id}}),o(e.pathname))},[o,s]),{sendPageViewEvent:(0,l.useCallback)(()=>{s&&t!==e.pathname&&o(e.pathname)},[s,e.pathname,t,o])}},bi=()=>{const[e,t]=zy(),n=(0,l.useCallback)(v=>e.get(v)??"",[e]),r=(0,l.useCallback)(v=>{t(v,{replace:!0})},[t]),s=(0,l.useCallback)((v,w)=>{r(x=>((x.get(v)?[x.get(v),w].join(","):[w].join(",")).length!==0?x.set(v,x.get(v)?[x.get(v),w].join(","):[w].join(",")):e.delete(v),x))},[r,e]),o=(0,l.useCallback)((v,w)=>{r(x=>(w!==""&&w!==void 0?x.set(v,w??""):e.delete(v),x))},[r,e]),i=(0,l.useCallback)(v=>{const w=n(v);return w?w.split(","):[]},[n]),u=(0,l.useCallback)(v=>{e.has(v)&&(e.delete(v),r(e))},[e,r]),p=(0,l.useCallback)((v,w="")=>{if(e.has(v)){const x=n(v).split(",").filter(E=>E!==w);x.length===0?(e.delete(v),r(e)):r(E=>(E.set(v,x.join(",")),E))}},[n,e,r]),g=(0,l.useCallback)(()=>{r({})},[r]);return{searchParams:e,getParams:n,setSearchParams:o,removeAllQueryParams:g,removeSearchParam:u,setArrayParams:s,getArrayParam:i,removeArrayParam:p}};var BA=(e=>(e.Dashboard="/admin/dashboard",e.Organizations="/admin/organizations",e.Organization="/admin/organizations/:organizationId/detail",e.Settings="/admin/settings",e.Orders="/admin/orders",e.Order="/admin/orders/:orderId/detail",e.OrderDecision="/admin/orders/:orderId/:decision",e.Integrations="/admin/integrations",e.IntegrationsConnectWise="/admin/integrations/connectwise",e.SherwebIntegrationsServiceProvider="/admin/integrations/service-provider/sherweb",e.IntegrationsConnectWiseApiInformation="/admin/integrations/connectwise/api-information",e.IntegrationsConnectWiseBoardConfiguration="/admin/integrations/connectwise/board-configuration",e.IntegrationsConnectWiseOrganizationMapping="/admin/integrations/connectwise/organization-mapping",e.Marketplace="/admin/marketplace",e.MarketplaceCatalogProducts="/admin/marketplace/:catalogId",e.MarketplaceCatalogAddProducts="/admin/marketplace/:catalogId/add-products",e.MarketplaceCatalogAssignedOrganizations="/admin/marketplace/:catalogId/assigned-organizations",e.Login="/admin/login",e.Onboarding="/admin/onboarding",e.Subscription="/:organizationUniqueName/subscriptions/:subscriptionId",e.InternalError="/admin/500",e.UnauthorizedAccess="/admin/401",e.ForbiddenAccess="/admin/403",e.NotFound="/admin/404",e))(BA||{});const Sr=BA;var VA=(e=>(e.SET_SELECTED_RESELLER="SET_SELECTED_RESELLER",e))(VA||{});const tH=e=>({type:"SET_SELECTED_RESELLER",id:e}),nH=e=>e?{priceVisible:e?.priceVisible,isSubresellerShown:e?.isSubresellerShown,showUsers:e?.showUsers,showBilling:e?.showBilling,showLicenses:e?.showLicenses,showSubscriptions:e?.showSubscriptions,orgAdminCanCreateUsers:e?.orgAdminCanCreateUsers,allowSubscriptionCancellation:e?.allowSubscriptionCancellation}:{priceVisible:!1,isSubresellerShown:!1,showUsers:!1,showBilling:!1,showLicenses:!1,showSubscriptions:!1,orgAdminCanCreateUsers:!1,allowSubscriptionCancellation:!1},rH=e=>e?{isOrderApprovalRequired:e?.isOrderApprovalRequired,teamNotifications:{enabled:e?.teamsNotificationsEnabled,webHookUrl:e?.teamsIncomingWebhook},emailNotifications:{enabled:e?.emailNotificationsEnabled,allUsersEnabled:e?.emailRecipientsList?.length===0,emails:e?.emailRecipientsList}}:{isOrderApprovalRequired:!1,teamNotifications:{enabled:!1,webHookUrl:""},emailNotifications:{enabled:!1,allUsersEnabled:!1,emails:[]}},sH=e=>{const t=(n,r)=>n&&r?`${n}?${r}`:n;return{id:e?.id??"",name:e?.name??"",isOnboarded:e?.isOnboarded??!1,portalSettings:{logo:t(HA(e?.portalSettings?.images,oe.yj.Logo)?.url,e?.portalSettings?.logoHash),favicon:t(HA(e?.portalSettings?.images,oe.yj.Icon)?.url,e?.portalSettings?.logoHash),logoHash:e?.portalSettings?.logoHash,theme:e?.portalSettings?.theme},supportInformation:{address:e?.supportInformation?.address,email:e?.supportInformation?.email,phoneNumber:e?.supportInformation?.phoneNumber},resellerSettings:nH(e?.resellerSettings),orderSettings:rH(e?.orderSettings)}},HA=(e,t)=>e?.find(n=>n.type===t),WA={mutationFn:async e=>await tC.updateImage({resellerId:e.resellerId,file:e.file,type:e.type,size:e.size})},qA={mutationFn:async e=>await qg.onboardedReseller({resellerId:e.resellerId})},oH={mutationFn:async e=>{const t={email:e.email,phoneNumber:e.phoneNumber,address:e.address};return await qg.setSupportInformation({resellerId:e.resellerId,command:t})}},_fe={mutationFn:async e=>{const t={priceVisible:e.priceVisible,isSubresellerShown:e.isSubresellerShown,showSubscriptions:e.showSubscriptions,showUsers:e.showUsers,showLicenses:e.showLicenses,showBilling:e.showBilling,orgAdminCanCreateUsers:e.orgAdminCanCreateUsers,allowSubscriptionCancellation:e.allowSubscriptionCancellation};return await qg.setResellerSettings({resellerId:e.resellerId,command:t})}},aH={mutationFn:async e=>await tC.setPortalSettings({command:{resellerId:e.resellerId,theme:e.theme}})};class iH{static getResellerAdminsEmails(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/resellers/{resellerId}/users/reseller-emails";o=o.replace("{resellerId}",t.resellerId+"");const i=(0,oe.Y_)("get","application/json",o,n);(0,oe.pY)(i,r,s)})}}const r0={queryKey:e=>["ResellersService/getReseller",e],queryFn:async e=>await qg.getReseller({hostname:e}),staleTime:60*60*1e3},AE={queryKey:e=>["ResellerUsersService/getAdminEmails",e],queryFn:async e=>await iH.getResellerAdminsEmails({resellerId:e??""}),staleTime:1/0},KA="reseller",lH=1,cH=["selectedReseller"],uH={selectedReseller:void 0},Cfe=Px((e=uH,t)=>t.type===VA.SET_SELECTED_RESELLER?{...e,selectedReseller:t.id}:e,{key:KA,shared:!0,version:lH,persistFields:cH}),dH=e=>e[KA],fH=e=>dH(e).selectedReseller,GA=()=>{const e=Gh()??"localhost",t=wa()??"",n=r0.queryKey(e),r=(0,V.jE)();return{resellerId:t,queryKey:n,queryClient:r}},s0=()=>{const{isLoggedIn:e}=(0,zr.m)(),t=Gh()??"localhost",n=r0.queryKey(t);return(0,js.I)({queryKey:n,queryFn:async()=>await r0.queryFn(t),select:r=>sH(r),enabled:e,staleTime:r0.staleTime})},pH=()=>{const e=s0();return(0,js.I)({queryKey:AE.queryKey(e?.data?.id),queryFn:async()=>await AE.queryFn(e?.data?.id),enabled:!!e?.data?.id,staleTime:AE.staleTime})},wa=()=>Xn(fH),QA=()=>{const e=Gh()??"localhost",t=wa()??"",n=r0.queryKey(e),r=(0,V.jE)(),s=(0,Vo.n)({mutationFn:WA.mutationFn}),o=async()=>{await r.invalidateQueries(n)};return{updateLogo:async i=>{await YA(t,i,oe.yj.Other,144,144),await s.mutateAsync({resellerId:t,file:i,type:oe.yj.Logo,size:"any"}),await o()},updateIcon:async i=>{await YA(t,i,oe.yj.Icon,64,64),await o()},...s,data:s.data}},YA=async(e,t,n,r,s)=>{const o=await t.arrayBuffer();o&&await ln.e(372).then(ln.bind(ln,3372)).then(async i=>{const g=await(await i.default.load(o)).resize({height:s,width:r}).toBlob(),v=new File([g],t.name,{type:t.type});return await WA.mutationFn({resellerId:e,size:`${s}x${r}`,type:n,file:v})})},hH=()=>{const{resellerId:e,queryClient:t,queryKey:n}=GA(),r=(0,Vo.n)({mutationFn:aH.mutationFn,onSuccess:async()=>{await t.invalidateQueries(n)}});return{updatePortalSettings:async s=>await r.mutateAsync({resellerId:e,theme:s}),...r,data:r.data}},mH=()=>{const e=wa()??"",t=(0,V.jE)(),n=r0.queryKey(e),r=(0,Vo.n)({mutationFn:qA.mutationFn});return{updateOnboarding:async()=>{await qA.mutationFn({resellerId:e});const s=await r.mutateAsync({resellerId:e});return await t.invalidateQueries(n),await t.refetchQueries(n),s},...r,data:r.data}},XA=()=>{const e=jr();return{setSelectedReseller:(...t)=>e(tH.apply(null,t))}},gH=()=>{const e=wa()??"",t=(0,Vo.n)({mutationFn:oH.mutationFn});return{setSupportInformation:async(n,r,s)=>await t.mutateAsync({resellerId:e,email:n,phoneNumber:r,address:s}),...t,data:t.data}},vH=()=>{const{t:e}=(0,z.Bd)(),t=wa(),n=(0,V.jE)(),r=Gh()??"localhost",s=r0.queryKey(r);return(0,Vo.n)({mutationFn:async o=>{if(!t)throw(0,oo.XY)();return await qg.setResellerSettings({resellerId:t,command:{...o}})},onSuccess:async()=>{(0,Yr.v0)(e("rsp:pages.settings.labels.changesApplied")),await n.invalidateQueries(s)}})},yH=()=>{const{t:e}=(0,z.Bd)(),{resellerId:t,queryClient:n,queryKey:r}=GA();return(0,Vo.n)({mutationFn:async s=>await qg.setOrderSettings({resellerId:t,command:{emailNotificationsEnabled:s.emailNotifications.enabled,emailRecipientsList:s.emailNotifications.allUsersEnabled?[]:s.emailNotifications.emails,isOrderApprovalRequired:s.isOrderApprovalRequired,teamsNotificationsEnabled:s.teamNotifications.enabled,teamsIncomingWebhook:s.teamNotifications.webHookUrl}}),onSuccess:async()=>((0,Yr.v0)(e("rsp:pages.settings.labels.changesApplied")),await n.invalidateQueries(r))})},bH=({children:e})=>{const t=(0,ey.useCurrentUser)(),{navigate:n}=Ni(),{isLoading:r,data:s}=s0(),{setSelectedReseller:o}=XA(),{sendPageViewEvent:i}=UA();return(0,l.useEffect)(()=>{i()},[i]),(0,l.useEffect)(()=>{s&&o(s.id)},[s,o]),(0,l.useEffect)(()=>{t?.data&&ve(t.data?.id??"",`${t?.data.firstName??""} ${t.data?.lastName??""}`,t.data.email??"")},[t?.data]),(0,l.useEffect)(()=>{s?.id&&!s?.isOnboarded&&!r&&n(Sr.Onboarding)},[s?.isOnboarded,r]),t.isLoading&&r?(0,a.jsx)(zs,{floating:!0}):e?(0,a.jsx)(a.Fragment,{children:e}):(0,a.jsx)(Ta,{})},zb=({children:e,className:t=""})=>(0,a.jsx)("main",{className:t,children:e}),vl=(0,l.forwardRef)(({to:e,children:t,currentClassName:n,isAbsolute:r=!1,params:s,...o},i)=>{const u=Qh(),p=Dl(),g=u.pathname===e;return r?(0,a.jsx)("a",{href:e,...o,ref:i,children:t}):(0,a.jsx)(ka,{ref:i,to:p(e,s),className:(0,jc.A)(o.className,g&&n),...o,children:t})}),wH=({className:e})=>{const{t}=(0,z.Bd)();return(0,a.jsx)(zb,{className:"dark:bg-slate-900",children:(0,a.jsx)("div",{"data-testid":"error-401",className:st("h-full",e),children:(0,a.jsxs)("div",{className:"mx-auto flex max-w-2xl flex-col items-center text-center",children:[(0,a.jsx)(Td,{className:"mx-auto  mt-20 w-12 text-red-600 sm:mt-24"}),(0,a.jsx)("p",{className:"text-base font-semibold leading-8 dark:text-white",children:"401"}),(0,a.jsx)("h1",{className:"mt-4 text-3xl font-bold tracking-tight text-gray-900 dark:text-white sm:text-5xl",children:t("rsp:pages.401.title")}),(0,a.jsx)("p",{className:"mt-4 text-base leading-7 text-gray-600 dark:text-white sm:mt-6 sm:text-lg sm:leading-8",children:t("rsp:pages.401.description")}),(0,a.jsx)(mn,{asChild:!0,className:"mt-8",children:(0,a.jsx)(vl,{to:Un.Login,children:t("rsp:pages.401.backToLogin")})})]})})})},ZA=({onClick:e,...t})=>{const{t:n}=(0,z.Bd)(),r=(0,n0.ok)(),s=(0,n0.Jt)(),o=(0,n0.Mb)(),i=(g,v)=>n(g==="en"?"rsp:layout.userMenu.languageToggle.switchToFrenchTooltip":"rsp:layout.userMenu.languageToggle.switchToEnglishTooltip"),u=g=>n(g==="en"?"rsp:layout.userMenu.languageToggle.languages.english":"rsp:layout.userMenu.languageToggle.languages.french"),p=(g,v)=>{g.preventDefault(),o(v),e?.(g)};return r?(0,a.jsx)(a.Fragment,{children:s.filter(g=>g!==r).map(g=>(0,l.createElement)(vl,{...t,to:"#",key:g,onClick:v=>{p(v,g)},className:"group flex items-center text-inherit dark:text-inherit"},(0,a.jsx)(t0,{tooltip:i(r,g),children:(0,a.jsxs)("div",{"data-testid":"btnLanguageSwitch",className:"flex items-center justify-center gap-1 text-sm font-normal antialiased md:subpixel-antialiased ",children:[(0,a.jsx)(wA,{"data-testid":"btnLanguageSwitchIcon",className:"w-5 stroke-1 text-inherit dark:text-inherit"}),u(r)]})})))}):null},xH=()=>{const{t:e}=(0,z.Bd)(),{data:t}=(0,ey.useCurrentUser)(),n=Fv(),{setDarkMode:r}=Ox(),{bff:s}=ae.A,o=`${s.url}${s.signOutPath}`,i=_2();if(!t)return null;const p=(()=>{if(!(!t.firstName||!t.lastName))return`${t.firstName} ${t.lastName}`})();return(0,a.jsxs)(bA,{buttonContent:(0,a.jsx)("div",{className:"flex flex-row items-center gap-3 rounded-full md:pr-0",children:(0,a.jsx)(jp,{children:(0,a.jsx)(Dp,{className:"dark:text-slate-200",children:Mp(p)})})}),className:"border border-slate-800 bg-slate-950 focus-visible:outline-offset-0 focus-visible:outline-indigo-300 dark:border dark:border-slate-800 dark:bg-slate-900 sm:border-slate-200 sm:bg-slate-200","data-testid":"user-menu",children:[(0,a.jsx)("div",{children:(0,a.jsx)(sm,{className:"cursor-default text-gray-900 hover:bg-transparent dark:text-white dark:hover:text-white dark:focus-visible:text-primary",disabled:!0,children:(0,a.jsxs)("div",{className:"flex min-w-[225px] flex-col items-center gap-y-2 px-1 pb-2 pt-1",children:[(0,a.jsx)("div",{className:"flex h-11 w-11 items-center justify-center rounded-full border border-slate-200 bg-slate-300 dark:border-slate-800 dark:bg-slate-900",children:(0,a.jsx)(jp,{children:(0,a.jsx)(Dp,{className:"dark:bg-slate-950 dark:text-slate-200",children:Mp(p)})})}),(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center gap-1 pl-4 pr-2",children:[p&&(0,a.jsx)("div",{className:"text-sm font-semibold leading-none",children:p}),t.jobTitle&&(0,a.jsx)("div",{className:"text-sm text-gray-500",children:t.jobTitle}),(0,a.jsx)(vl,{isAbsolute:!0,to:i,target:"_blank",rel:"noopener noreferrer",className:"inline-block text-sm text-blue-600 focus-visible:outline-indigo-300",children:e("rsp:layout.userMenu.goToPortal")})]})]})})}),(0,a.jsx)("div",{children:(0,a.jsxs)(sm,{autoClose:!1,className:"flex items-center justify-between whitespace-nowrap",children:[e("rsp:layout.userMenu.darkModeToggle.label"),(0,a.jsx)(hA,{darkMode:n,setDarkMode:r})]})}),(0,a.jsx)("div",{children:(0,a.jsxs)(sm,{autoClose:!1,className:"flex items-center justify-between whitespace-nowrap",children:[e("rsp:layout.userMenu.languageToggle.label"),(0,a.jsx)(ZA,{})]})}),(0,a.jsx)("a",{href:o,className:"mt-10 w-3/4",children:(0,a.jsx)(sm,{children:e("rsp:layout.userMenu.signOut")})})]})},_H=({onHamburgerButtonClick:e})=>{const t=Fv();return(0,a.jsx)(zN,{className:"lg:bg-transparent lg:shadow-transparent",onHamburgerButtonClick:e,rightSection:(0,a.jsxs)("div",{className:"flex flex-row gap-4",children:[n_((0,a.jsx)(UN,{className:"self-center",mode:t?r_.uy.Dark:r_.uy.Light}),{showLoader:!1}),(0,a.jsx)(xH,{})]})})};function SH({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 0 1-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 0 1 1.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 0 0-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 0 1-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H9.75"}))}const CH=l.forwardRef(SH);function EH({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.25 6.087c0-.355.186-.676.401-.959.221-.29.349-.634.349-1.003 0-1.036-1.007-1.875-2.25-1.875s-2.25.84-2.25 1.875c0 .369.128.713.349 1.003.215.283.401.604.401.959v0a.64.64 0 0 1-.657.643 48.39 48.39 0 0 1-4.163-.3c.186 1.613.293 3.25.315 4.907a.656.656 0 0 1-.658.663v0c-.355 0-.676-.186-.959-.401a1.647 1.647 0 0 0-1.003-.349c-1.036 0-1.875 1.007-1.875 2.25s.84 2.25 1.875 2.25c.369 0 .713-.128 1.003-.349.283-.215.604-.401.959-.401v0c.31 0 .555.26.532.57a48.039 48.039 0 0 1-.642 5.056c1.518.19 3.058.309 4.616.354a.64.64 0 0 0 .657-.643v0c0-.355-.186-.676-.401-.959a1.647 1.647 0 0 1-.349-1.003c0-1.035 1.008-1.875 2.25-1.875 1.243 0 2.25.84 2.25 1.875 0 .369-.128.713-.349 1.003-.215.283-.4.604-.4.959v0c0 .333.277.599.61.58a48.1 48.1 0 0 0 5.427-.63 48.05 48.05 0 0 0 .582-4.717.532.532 0 0 0-.533-.57v0c-.355 0-.676.186-.959.401-.29.221-.634.349-1.003.349-1.035 0-1.875-1.007-1.875-2.25s.84-2.25 1.875-2.25c.37 0 .713.128 1.003.349.283.215.604.401.96.401v0a.656.656 0 0 0 .658-.663 48.422 48.422 0 0 0-.37-5.36c-1.886.342-3.81.574-5.766.689a.578.578 0 0 1-.61-.58v0Z"}))}const TH=l.forwardRef(EH);function kH({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 0 1 0 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 0 1-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 0 1 0-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28Z"}),l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))}const IE=l.forwardRef(kH),oy=()=>{const e=CV();return{permissionsLoading:e.isLoading,permissionsFetched:e.data.length>0,hasAccess:t=>!!(e.data.length>0&&(Array.isArray(t)&&t.every(n=>e.data.includes(n))||e.data.some(n=>n===t)))}},w_=e=>{const{hasAccess:t}=oy();return t(e.permission)?(0,a.jsx)(a.Fragment,{children:e.children}):null},RH=()=>{const{t:e}=(0,z.Bd)(),{pathname:t}=Qh(),{navigate:n}=Ni(),{hasAccess:r}=oy(),s=()=>{n(Sr.Settings)},o=[{label:e("rsp:layout.menu.orders"),to:Sr.Orders,Icon:CH,dataTestId:"menuItemOrders",hasChildPages:!0},{label:e("rsp:layout.menu.integrations"),to:Sr.Integrations,Icon:TH,dataTestId:"menuItemIntegrations"},{label:e("rsp:layout.menu.organizations"),to:Sr.Organizations,Icon:hE,dataTestId:"menuItemOrganizations"},{label:e("rsp:layout.menu.marketplace"),to:Sr.Marketplace,Icon:_A,dataTestId:"menuItemMarketplace",hasChildPages:!0,permission:oe.aX.CatalogManagementList},{label:e("rsp:layout.menu.settings"),to:Sr.Settings,Icon:IE,dataTestId:"menuItemSettings"}].filter(u=>!u.permission||r(u.permission)),i=(u,p)=>u==="/admin"&&p?u===t:t.startsWith(u);return(0,a.jsx)(FN,{logo:"/logo512-blue.svg",onLogoClick:s,logoContainerClassName:"mt-10 mb-6 px-6",children:o.map(({label:u,to:p,Icon:g,dataTestId:v,hasChildPages:w=!1})=>(0,a.jsx)(vl,{to:p,className:"block",children:(0,a.jsx)(rE,{dataTestId:v,Icon:g,current:i(p,!w),children:u})},p))})},Wu=({children:e,padded:t=!0,centered:n=!0,className:r,showSidebar:s=!0})=>{const[o,i]=(0,l.useState)(!1),u=()=>{i(!0)},p=()=>{i(!1)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(cN,{className:"bg-[#E5EFF7]"}),(0,a.jsx)(zb,{className:r,children:(0,a.jsxs)("div",{className:st("flex min-h-screen",{"lg:grid lg:grid-cols-[16rem_auto]":s}),children:[s?(0,a.jsx)(LN,{open:o,onClose:p,children:(0,a.jsx)(RH,{})}):null,(0,a.jsxs)("div",{className:"z-20 flex w-full flex-col",children:[(0,a.jsx)(_H,{onHamburgerButtonClick:u}),(0,a.jsx)("div",{className:"lg:w-full",children:(0,a.jsx)("div",{className:(0,jc.A)("text-gray-900 dark:text-slate-200",t&&"px-4 py-8 sm:px-6 sm:py-10 lg:px-10 lg:py-8",n&&"mx-auto w-full max-w-screen-2xl"),children:e})})]})]})})]})},PH=({className:e})=>{const{t}=(0,z.Bd)(),{isAuthenticated:n}=(0,zr.Z)(),{hasAccess:r}=oy(),s=n?Wu:zb;return(0,a.jsx)(s,{className:"dark:bg-slate-900",showSidebar:!1,children:(0,a.jsx)("div",{"data-testid":"error-403",className:st("h-full",e),children:(0,a.jsxs)("div",{className:"mx-auto flex max-w-2xl flex-col items-center text-center ",children:[(0,a.jsx)(Td,{className:"mx-auto mt-20 w-12 text-red-600 sm:mt-24"}),(0,a.jsx)("p",{className:"text-base font-semibold leading-8 dark:text-white",children:"403"}),(0,a.jsx)("h1",{className:"mt-4 text-3xl font-bold tracking-tight text-gray-900 dark:text-white sm:text-5xl",children:t("rsp:pages.403.title")}),(0,a.jsx)("p",{className:"mt-4 text-base leading-7 text-gray-600 dark:text-white sm:mt-6 sm:text-lg sm:leading-8",children:t("rsp:pages.403.description")}),(0,a.jsx)(mn,{asChild:!0,className:"mt-8",children:(0,a.jsx)(vl,{"data-testid":"linkBackToHomePage",to:r(oe.aX.ResellerAdmin)?Sr.Orders:Un.Root,children:t("rsp:pages.403.backToHomepage")})})]})})})},JA=({className:e=""})=>{const{t}=(0,z.Bd)(),{isAuthenticated:n}=(0,zr.Z)(),r=n?Wu:zb;return(0,a.jsx)(r,{className:"dark:bg-slate-900",showSidebar:!1,children:(0,a.jsx)("div",{"data-testid":"error-404",className:st("h-full",e),children:(0,a.jsxs)("div",{className:"mx-auto flex h-full max-w-2xl flex-col items-center text-center ",children:[(0,a.jsx)(Td,{className:"mx-auto mt-20 w-12 text-red-600 sm:mt-24"}),(0,a.jsx)("p",{className:"text-base font-semibold leading-8 dark:text-white",children:"404"}),(0,a.jsx)("h1",{className:"mt-4 text-3xl font-bold tracking-tight text-gray-900 dark:text-white sm:text-5xl",children:t("rsp:pages.404.title")}),(0,a.jsx)("p",{className:"mt-4 text-base leading-7 text-gray-600 dark:text-white sm:mt-6 sm:text-lg sm:leading-8",children:t("rsp:pages.404.description")}),(0,a.jsx)(mn,{asChild:!0,className:"mt-8",children:(0,a.jsx)(vl,{to:Sr.Settings,children:t("rsp:pages.404.backToHomepage")})})]})})})},OH=({className:e})=>{const{t}=(0,z.Bd)();return(0,a.jsx)(zb,{className:"dark:bg-slate-900",children:(0,a.jsx)("div",{"data-testid":"error-500",className:st("h-full",e),children:(0,a.jsxs)("div",{className:"mx-auto flex h-full max-w-2xl flex-col items-center text-center",children:[(0,a.jsx)(Td,{className:"mx-auto mt-20 w-12 text-red-600 sm:mt-24"}),(0,a.jsx)("p",{className:"text-base font-semibold leading-8 dark:text-white",children:"500"}),(0,a.jsx)("h1",{className:"mt-4 text-3xl font-bold tracking-tight text-gray-900 dark:text-white  sm:text-5xl",children:t("rsp:pages.500.title")}),(0,a.jsx)("p",{className:"mt-4 text-base leading-7 text-gray-600 dark:text-white sm:mt-6 sm:text-lg  sm:leading-8",children:t("rsp:pages.500.description")}),(0,a.jsx)(mn,{asChild:!0,className:"mt-8",children:(0,a.jsx)(vl,{to:Sr.Settings,children:t("rsp:pages.500.reloadApplication")})})]})})})},el=({children:e,...t})=>(0,a.jsx)("h1",{className:"text-4xl font-extrabold text-gray-900 dark:text-slate-200 md:text-5xl md:leading-tight",...t,children:e}),qu=({children:e,...t})=>(0,a.jsx)("p",{className:"md:text-normal text-sm leading-none text-slate-500 dark:text-slate-200",...t,children:e}),yl=({title:e,subTitle:t,className:n})=>(0,a.jsxs)("div",{className:st("flex flex-col gap-2",n),children:[e,t]}),eI=(0,l.createContext)(void 0),Bfe=e=>{const{dir:t,children:n}=e;return $7Gjcd$createElement(eI.Provider,{value:t},n)};function lm(e){const t=(0,l.useContext)(eI);return e||t||"ltr"}const Vfe=null;function Ub(e,[t,n]){return Math.min(n,Math.max(t,e))}function NH(e,t){return(0,l.useReducer)((n,r)=>{const s=t[n][r];return s??n},e)}const jE="ScrollArea",[tI,Hfe]=va(jE),[AH,Ku]=tI(jE),nI=(0,l.forwardRef)((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:s,scrollHideDelay:o=600,...i}=e,[u,p]=(0,l.useState)(null),[g,v]=(0,l.useState)(null),[w,x]=(0,l.useState)(null),[E,R]=(0,l.useState)(null),[k,N]=(0,l.useState)(null),[L,D]=(0,l.useState)(0),[B,Q]=(0,l.useState)(0),[ce,ye]=(0,l.useState)(!1),[G,Le]=(0,l.useState)(!1),We=Lr(t,St=>p(St)),at=lm(s);return(0,l.createElement)(AH,{scope:n,type:r,dir:at,scrollHideDelay:o,scrollArea:u,viewport:g,onViewportChange:v,content:w,onContentChange:x,scrollbarX:E,onScrollbarXChange:R,scrollbarXEnabled:ce,onScrollbarXEnabledChange:ye,scrollbarY:k,onScrollbarYChange:N,scrollbarYEnabled:G,onScrollbarYEnabledChange:Le,onCornerWidthChange:D,onCornerHeightChange:Q},(0,l.createElement)(zn.div,(0,Je.A)({dir:at},i,{ref:We,style:{position:"relative",["--radix-scroll-area-corner-width"]:L+"px",["--radix-scroll-area-corner-height"]:B+"px",...e.style}})))}),rI="ScrollAreaViewport",sI=(0,l.forwardRef)((e,t)=>{const{__scopeScrollArea:n,children:r,...s}=e,o=Ku(rI,n),i=(0,l.useRef)(null),u=Lr(t,i,o.onViewportChange);return(0,l.createElement)(l.Fragment,null,(0,l.createElement)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"}}),(0,l.createElement)(zn.div,(0,Je.A)({"data-radix-scroll-area-viewport":""},s,{ref:u,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...e.style}}),(0,l.createElement)("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"}},r)))}),Df="ScrollAreaScrollbar",DE=(0,l.forwardRef)((e,t)=>{const{forceMount:n,...r}=e,s=Ku(Df,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:i}=s,u=e.orientation==="horizontal";return(0,l.useEffect)(()=>(u?o(!0):i(!0),()=>{u?o(!1):i(!1)}),[u,o,i]),s.type==="hover"?(0,l.createElement)(IH,(0,Je.A)({},r,{ref:t,forceMount:n})):s.type==="scroll"?(0,l.createElement)(jH,(0,Je.A)({},r,{ref:t,forceMount:n})):s.type==="auto"?(0,l.createElement)(oI,(0,Je.A)({},r,{ref:t,forceMount:n})):s.type==="always"?(0,l.createElement)(ME,(0,Je.A)({},r,{ref:t})):null}),IH=(0,l.forwardRef)((e,t)=>{const{forceMount:n,...r}=e,s=Ku(Df,e.__scopeScrollArea),[o,i]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{const u=s.scrollArea;let p=0;if(u){const g=()=>{window.clearTimeout(p),i(!0)},v=()=>{p=window.setTimeout(()=>i(!1),s.scrollHideDelay)};return u.addEventListener("pointerenter",g),u.addEventListener("pointerleave",v),()=>{window.clearTimeout(p),u.removeEventListener("pointerenter",g),u.removeEventListener("pointerleave",v)}}},[s.scrollArea,s.scrollHideDelay]),(0,l.createElement)(la,{present:n||o},(0,l.createElement)(oI,(0,Je.A)({"data-state":o?"visible":"hidden"},r,{ref:t})))}),jH=(0,l.forwardRef)((e,t)=>{const{forceMount:n,...r}=e,s=Ku(Df,e.__scopeScrollArea),o=e.orientation==="horizontal",i=C_(()=>p("SCROLL_END"),100),[u,p]=NH("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return(0,l.useEffect)(()=>{if(u==="idle"){const g=window.setTimeout(()=>p("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(g)}},[u,s.scrollHideDelay,p]),(0,l.useEffect)(()=>{const g=s.viewport,v=o?"scrollLeft":"scrollTop";if(g){let w=g[v];const x=()=>{const E=g[v];w!==E&&(p("SCROLL"),i()),w=E};return g.addEventListener("scroll",x),()=>g.removeEventListener("scroll",x)}},[s.viewport,o,p,i]),(0,l.createElement)(la,{present:n||u!=="hidden"},(0,l.createElement)(ME,(0,Je.A)({"data-state":u==="hidden"?"hidden":"visible"},r,{ref:t,onPointerEnter:gn(e.onPointerEnter,()=>p("POINTER_ENTER")),onPointerLeave:gn(e.onPointerLeave,()=>p("POINTER_LEAVE"))})))}),oI=(0,l.forwardRef)((e,t)=>{const n=Ku(Df,e.__scopeScrollArea),{forceMount:r,...s}=e,[o,i]=(0,l.useState)(!1),u=e.orientation==="horizontal",p=C_(()=>{if(n.viewport){const g=n.viewport.offsetWidth<n.viewport.scrollWidth,v=n.viewport.offsetHeight<n.viewport.scrollHeight;i(u?g:v)}},10);return ay(n.viewport,p),ay(n.content,p),(0,l.createElement)(la,{present:r||o},(0,l.createElement)(ME,(0,Je.A)({"data-state":o?"visible":"hidden"},s,{ref:t})))}),ME=(0,l.forwardRef)((e,t)=>{const{orientation:n="vertical",...r}=e,s=Ku(Df,e.__scopeScrollArea),o=(0,l.useRef)(null),i=(0,l.useRef)(0),[u,p]=(0,l.useState)({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),g=uI(u.viewport,u.content),v={...r,sizes:u,onSizesChange:p,hasThumb:Boolean(g>0&&g<1),onThumbChange:x=>o.current=x,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:x=>i.current=x};function w(x,E){return zH(x,i.current,u,E)}return n==="horizontal"?(0,l.createElement)(DH,(0,Je.A)({},v,{ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const x=s.viewport.scrollLeft,E=dI(x,u,s.dir);o.current.style.transform=`translate3d(${E}px, 0, 0)`}},onWheelScroll:x=>{s.viewport&&(s.viewport.scrollLeft=x)},onDragScroll:x=>{s.viewport&&(s.viewport.scrollLeft=w(x,s.dir))}})):n==="vertical"?(0,l.createElement)(MH,(0,Je.A)({},v,{ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const x=s.viewport.scrollTop,E=dI(x,u);o.current.style.transform=`translate3d(0, ${E}px, 0)`}},onWheelScroll:x=>{s.viewport&&(s.viewport.scrollTop=x)},onDragScroll:x=>{s.viewport&&(s.viewport.scrollTop=w(x))}})):null}),DH=(0,l.forwardRef)((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,o=Ku(Df,e.__scopeScrollArea),[i,u]=(0,l.useState)(),p=(0,l.useRef)(null),g=Lr(t,p,o.onScrollbarXChange);return(0,l.useEffect)(()=>{p.current&&u(getComputedStyle(p.current))},[p]),(0,l.createElement)(iI,(0,Je.A)({"data-orientation":"horizontal"},s,{ref:g,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,["--radix-scroll-area-thumb-width"]:S_(n)+"px",...e.style},onThumbPointerDown:v=>e.onThumbPointerDown(v.x),onDragScroll:v=>e.onDragScroll(v.x),onWheelScroll:(v,w)=>{if(o.viewport){const x=o.viewport.scrollLeft+v.deltaX;e.onWheelScroll(x),pI(x,w)&&v.preventDefault()}},onResize:()=>{p.current&&o.viewport&&i&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:p.current.clientWidth,paddingStart:__(i.paddingLeft),paddingEnd:__(i.paddingRight)}})}}))}),MH=(0,l.forwardRef)((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,o=Ku(Df,e.__scopeScrollArea),[i,u]=(0,l.useState)(),p=(0,l.useRef)(null),g=Lr(t,p,o.onScrollbarYChange);return(0,l.useEffect)(()=>{p.current&&u(getComputedStyle(p.current))},[p]),(0,l.createElement)(iI,(0,Je.A)({"data-orientation":"vertical"},s,{ref:g,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)",["--radix-scroll-area-thumb-height"]:S_(n)+"px",...e.style},onThumbPointerDown:v=>e.onThumbPointerDown(v.y),onDragScroll:v=>e.onDragScroll(v.y),onWheelScroll:(v,w)=>{if(o.viewport){const x=o.viewport.scrollTop+v.deltaY;e.onWheelScroll(x),pI(x,w)&&v.preventDefault()}},onResize:()=>{p.current&&o.viewport&&i&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:p.current.clientHeight,paddingStart:__(i.paddingTop),paddingEnd:__(i.paddingBottom)}})}}))}),[$H,aI]=tI(Df),iI=(0,l.forwardRef)((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:s,onThumbChange:o,onThumbPointerUp:i,onThumbPointerDown:u,onThumbPositionChange:p,onDragScroll:g,onWheelScroll:v,onResize:w,...x}=e,E=Ku(Df,n),[R,k]=(0,l.useState)(null),N=Lr(t,We=>k(We)),L=(0,l.useRef)(null),D=(0,l.useRef)(""),B=E.viewport,Q=r.content-r.viewport,ce=Ao(v),ye=Ao(p),G=C_(w,10);function Le(We){if(L.current){const at=We.clientX-L.current.left,St=We.clientY-L.current.top;g({x:at,y:St})}}return(0,l.useEffect)(()=>{const We=at=>{const St=at.target;R?.contains(St)&&ce(at,Q)};return document.addEventListener("wheel",We,{passive:!1}),()=>document.removeEventListener("wheel",We,{passive:!1})},[B,R,Q,ce]),(0,l.useEffect)(ye,[r,ye]),ay(R,G),ay(E.content,G),(0,l.createElement)($H,{scope:n,scrollbar:R,hasThumb:s,onThumbChange:Ao(o),onThumbPointerUp:Ao(i),onThumbPositionChange:ye,onThumbPointerDown:Ao(u)},(0,l.createElement)(zn.div,(0,Je.A)({},x,{ref:N,style:{position:"absolute",...x.style},onPointerDown:gn(e.onPointerDown,We=>{We.button===0&&(We.target.setPointerCapture(We.pointerId),L.current=R.getBoundingClientRect(),D.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",E.viewport&&(E.viewport.style.scrollBehavior="auto"),Le(We))}),onPointerMove:gn(e.onPointerMove,Le),onPointerUp:gn(e.onPointerUp,We=>{const at=We.target;at.hasPointerCapture(We.pointerId)&&at.releasePointerCapture(We.pointerId),document.body.style.webkitUserSelect=D.current,E.viewport&&(E.viewport.style.scrollBehavior=""),L.current=null})})))}),x_="ScrollAreaThumb",lI=(0,l.forwardRef)((e,t)=>{const{forceMount:n,...r}=e,s=aI(x_,e.__scopeScrollArea);return(0,l.createElement)(la,{present:n||s.hasThumb},(0,l.createElement)(LH,(0,Je.A)({ref:t},r)))}),LH=(0,l.forwardRef)((e,t)=>{const{__scopeScrollArea:n,style:r,...s}=e,o=Ku(x_,n),i=aI(x_,n),{onThumbPositionChange:u}=i,p=Lr(t,w=>i.onThumbChange(w)),g=(0,l.useRef)(),v=C_(()=>{g.current&&(g.current(),g.current=void 0)},100);return(0,l.useEffect)(()=>{const w=o.viewport;if(w){const x=()=>{if(v(),!g.current){const E=UH(w,u);g.current=E,u()}};return u(),w.addEventListener("scroll",x),()=>w.removeEventListener("scroll",x)}},[o.viewport,v,u]),(0,l.createElement)(zn.div,(0,Je.A)({"data-state":i.hasThumb?"visible":"hidden"},s,{ref:p,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:gn(e.onPointerDownCapture,w=>{const E=w.target.getBoundingClientRect(),R=w.clientX-E.left,k=w.clientY-E.top;i.onThumbPointerDown({x:R,y:k})}),onPointerUp:gn(e.onPointerUp,i.onThumbPointerUp)}))}),$E="ScrollAreaCorner",cI=(0,l.forwardRef)((e,t)=>{const n=Ku($E,e.__scopeScrollArea),r=Boolean(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?(0,l.createElement)(FH,(0,Je.A)({},e,{ref:t})):null}),FH=(0,l.forwardRef)((e,t)=>{const{__scopeScrollArea:n,...r}=e,s=Ku($E,n),[o,i]=(0,l.useState)(0),[u,p]=(0,l.useState)(0),g=Boolean(o&&u);return ay(s.scrollbarX,()=>{var v;const w=((v=s.scrollbarX)===null||v===void 0?void 0:v.offsetHeight)||0;s.onCornerHeightChange(w),p(w)}),ay(s.scrollbarY,()=>{var v;const w=((v=s.scrollbarY)===null||v===void 0?void 0:v.offsetWidth)||0;s.onCornerWidthChange(w),i(w)}),g?(0,l.createElement)(zn.div,(0,Je.A)({},r,{ref:t,style:{width:o,height:u,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}})):null});function __(e){return e?parseInt(e,10):0}function uI(e,t){const n=e/t;return isNaN(n)?0:n}function S_(e){const t=uI(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function zH(e,t,n,r="ltr"){const s=S_(n),o=s/2,i=t||o,u=s-i,p=n.scrollbar.paddingStart+i,g=n.scrollbar.size-n.scrollbar.paddingEnd-u,v=n.content-n.viewport,w=r==="ltr"?[0,v]:[v*-1,0];return fI([p,g],w)(e)}function dI(e,t,n="ltr"){const r=S_(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-s,i=t.content-t.viewport,u=o-r,p=n==="ltr"?[0,i]:[i*-1,0],g=Ub(e,p);return fI([0,i],[0,u])(g)}function fI(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function pI(e,t){return e>0&&e<t}const UH=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function s(){const o={left:e.scrollLeft,top:e.scrollTop},i=n.left!==o.left,u=n.top!==o.top;(i||u)&&t(),n=o,r=window.requestAnimationFrame(s)}(),()=>window.cancelAnimationFrame(r)};function C_(e,t){const n=Ao(e),r=(0,l.useRef)(0);return(0,l.useEffect)(()=>()=>window.clearTimeout(r.current),[]),(0,l.useCallback)(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function ay(e,t){const n=Ao(t);ya(()=>{let r=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return s.observe(e),()=>{window.cancelAnimationFrame(r),s.unobserve(e)}}},[e,n])}const hI=nI,BH=sI,Wfe=null,qfe=null,VH=cI,o0=(0,l.forwardRef)(({className:e,children:t,...n},r)=>(0,a.jsxs)(hI,{ref:r,className:st("relative overflow-hidden",e),...n,children:[(0,a.jsx)(BH,{className:"h-full w-full rounded-[inherit]",children:t}),(0,a.jsx)(Bb,{}),(0,a.jsx)(VH,{})]}));o0.displayName=hI.displayName;const Bb=(0,l.forwardRef)(({className:e,orientation:t="vertical",...n},r)=>(0,a.jsx)(DE,{ref:r,orientation:t,className:st("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]"),...n,children:(0,a.jsx)(lI,{className:st("bg-border relative flex-1 rounded-full bg-slate-300",e)})}));Bb.displayName=DE.displayName;const LE=(0,l.forwardRef)((e,t)=>{const{children:n,...r}=e,s=l.Children.toArray(n),o=s.find(WH);if(o){const i=o.props.children,u=s.map(p=>p===o?l.Children.count(i)>1?l.Children.only(null):(0,l.isValidElement)(i)?i.props.children:null:p);return(0,l.createElement)(FE,(0,Je.A)({},r,{ref:t}),(0,l.isValidElement)(i)?(0,l.cloneElement)(i,void 0,u):null)}return(0,l.createElement)(FE,(0,Je.A)({},r,{ref:t}),n)});LE.displayName="Slot";const FE=(0,l.forwardRef)((e,t)=>{const{children:n,...r}=e;return(0,l.isValidElement)(n)?(0,l.cloneElement)(n,{...qH(r,n.props),ref:t?nc(t,n.ref):n.ref}):l.Children.count(n)>1?l.Children.only(null):null});FE.displayName="SlotClone";const HH=({children:e})=>(0,l.createElement)(l.Fragment,null,e);function WH(e){return(0,l.isValidElement)(e)&&e.type===HH}function qH(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...u)=>{o(...u),s(...u)}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}const Kfe=null;function Vb(e){const t=e+"CollectionProvider",[n,r]=va(t),[s,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=E=>{const{scope:R,children:k}=E,N=l.useRef(null),L=l.useRef(new Map).current;return l.createElement(s,{scope:R,itemMap:L,collectionRef:N},k)},u=e+"CollectionSlot",p=l.forwardRef((E,R)=>{const{scope:k,children:N}=E,L=o(u,k),D=Lr(R,L.collectionRef);return l.createElement(LE,{ref:D},N)}),g=e+"CollectionItemSlot",v="data-radix-collection-item",w=l.forwardRef((E,R)=>{const{scope:k,children:N,...L}=E,D=l.useRef(null),B=Lr(R,D),Q=o(g,k);return l.useEffect(()=>(Q.itemMap.set(D,{ref:D,...L}),()=>void Q.itemMap.delete(D))),l.createElement(LE,{[v]:"",ref:B},N)});function x(E){const R=o(e+"CollectionConsumer",E);return l.useCallback(()=>{const N=R.collectionRef.current;if(!N)return[];const L=Array.from(N.querySelectorAll(`[${v}]`));return Array.from(R.itemMap.values()).sort((Q,ce)=>L.indexOf(Q.ref.current)-L.indexOf(ce.ref.current))},[R.collectionRef,R.itemMap])}return[{Provider:i,Slot:p,ItemSlot:w},x,r]}const zE="rovingFocusGroup.onEntryFocus",KH={bubbles:!1,cancelable:!0},E_="RovingFocusGroup",[UE,mI,GH]=Vb(E_),[QH,iy]=va(E_,[GH]),[YH,XH]=QH(E_),gI=(0,l.forwardRef)((e,t)=>(0,l.createElement)(UE.Provider,{scope:e.__scopeRovingFocusGroup},(0,l.createElement)(UE.Slot,{scope:e.__scopeRovingFocusGroup},(0,l.createElement)(ZH,(0,Je.A)({},e,{ref:t}))))),ZH=(0,l.forwardRef)((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:o,currentTabStopId:i,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:p,onEntryFocus:g,...v}=e,w=(0,l.useRef)(null),x=Lr(t,w),E=lm(o),[R=null,k]=si({prop:i,defaultProp:u,onChange:p}),[N,L]=(0,l.useState)(!1),D=Ao(g),B=mI(n),Q=(0,l.useRef)(!1),[ce,ye]=(0,l.useState)(0);return(0,l.useEffect)(()=>{const G=w.current;if(G)return G.addEventListener(zE,D),()=>G.removeEventListener(zE,D)},[D]),(0,l.createElement)(YH,{scope:n,orientation:r,dir:E,loop:s,currentTabStopId:R,onItemFocus:(0,l.useCallback)(G=>k(G),[k]),onItemShiftTab:(0,l.useCallback)(()=>L(!0),[]),onFocusableItemAdd:(0,l.useCallback)(()=>ye(G=>G+1),[]),onFocusableItemRemove:(0,l.useCallback)(()=>ye(G=>G-1),[])},(0,l.createElement)(zn.div,(0,Je.A)({tabIndex:N||ce===0?-1:0,"data-orientation":r},v,{ref:x,style:{outline:"none",...e.style},onMouseDown:gn(e.onMouseDown,()=>{Q.current=!0}),onFocus:gn(e.onFocus,G=>{const Le=!Q.current;if(G.target===G.currentTarget&&Le&&!N){const We=new CustomEvent(zE,KH);if(G.currentTarget.dispatchEvent(We),!We.defaultPrevented){const at=B().filter(Nt=>Nt.focusable),St=at.find(Nt=>Nt.active),xt=at.find(Nt=>Nt.id===R),$t=[St,xt,...at].filter(Boolean).map(Nt=>Nt.ref.current);bI($t)}}Q.current=!1}),onBlur:gn(e.onBlur,()=>L(!1))})))}),vI="RovingFocusGroupItem",yI=(0,l.forwardRef)((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:o,...i}=e,u=ri(),p=o||u,g=XH(vI,n),v=g.currentTabStopId===p,w=mI(n),{onFocusableItemAdd:x,onFocusableItemRemove:E}=g;return(0,l.useEffect)(()=>{if(r)return x(),()=>E()},[r,x,E]),(0,l.createElement)(UE.ItemSlot,{scope:n,id:p,focusable:r,active:s},(0,l.createElement)(zn.span,(0,Je.A)({tabIndex:v?0:-1,"data-orientation":g.orientation},i,{ref:t,onMouseDown:gn(e.onMouseDown,R=>{r?g.onItemFocus(p):R.preventDefault()}),onFocus:gn(e.onFocus,()=>g.onItemFocus(p)),onKeyDown:gn(e.onKeyDown,R=>{if(R.key==="Tab"&&R.shiftKey){g.onItemShiftTab();return}if(R.target!==R.currentTarget)return;const k=tW(R,g.orientation,g.dir);if(k!==void 0){R.preventDefault();let L=w().filter(D=>D.focusable).map(D=>D.ref.current);if(k==="last")L.reverse();else if(k==="prev"||k==="next"){k==="prev"&&L.reverse();const D=L.indexOf(R.currentTarget);L=g.loop?nW(L,D+1):L.slice(D+1)}setTimeout(()=>bI(L))}})})))}),JH={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function eW(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function tW(e,t,n){const r=eW(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return JH[r]}function bI(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function nW(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const BE=gI,VE=yI,HE="Tabs",[rW,Gfe]=va(HE,[iy]),wI=iy(),[sW,WE]=rW(HE),xI=(0,l.forwardRef)((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:o,orientation:i="horizontal",dir:u,activationMode:p="automatic",...g}=e,v=lm(u),[w,x]=si({prop:r,onChange:s,defaultProp:o});return(0,l.createElement)(sW,{scope:n,baseId:ri(),value:w,onValueChange:x,orientation:i,dir:v,activationMode:p},(0,l.createElement)(zn.div,(0,Je.A)({dir:v,"data-orientation":i},g,{ref:t})))}),_I="TabsList",SI=(0,l.forwardRef)((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,o=WE(_I,n),i=wI(n);return(0,l.createElement)(BE,(0,Je.A)({asChild:!0},i,{orientation:o.orientation,dir:o.dir,loop:r}),(0,l.createElement)(zn.div,(0,Je.A)({role:"tablist","aria-orientation":o.orientation},s,{ref:t})))}),CI="TabsTrigger",EI=(0,l.forwardRef)((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...o}=e,i=WE(CI,n),u=wI(n),p=RI(i.baseId,r),g=PI(i.baseId,r),v=r===i.value;return(0,l.createElement)(VE,(0,Je.A)({asChild:!0},u,{focusable:!s,active:v}),(0,l.createElement)(zn.button,(0,Je.A)({type:"button",role:"tab","aria-selected":v,"aria-controls":g,"data-state":v?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:p},o,{ref:t,onMouseDown:gn(e.onMouseDown,w=>{!s&&w.button===0&&w.ctrlKey===!1?i.onValueChange(r):w.preventDefault()}),onKeyDown:gn(e.onKeyDown,w=>{[" ","Enter"].includes(w.key)&&i.onValueChange(r)}),onFocus:gn(e.onFocus,()=>{const w=i.activationMode!=="manual";!v&&!s&&w&&i.onValueChange(r)})})))}),TI="TabsContent",kI=(0,l.forwardRef)((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:o,...i}=e,u=WE(TI,n),p=RI(u.baseId,r),g=PI(u.baseId,r),v=r===u.value,w=(0,l.useRef)(v);return(0,l.useEffect)(()=>{const x=requestAnimationFrame(()=>w.current=!1);return()=>cancelAnimationFrame(x)},[]),(0,l.createElement)(la,{present:s||v},({present:x})=>(0,l.createElement)(zn.div,(0,Je.A)({"data-state":v?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":p,hidden:!x,id:g,tabIndex:0},i,{ref:t,style:{...e.style,animationDuration:w.current?"0s":void 0}}),x&&o))});function RI(e,t){return`${e}-trigger-${t}`}function PI(e,t){return`${e}-content-${t}`}const oW=xI,OI=SI,NI=EI,AI=kI,Hb=oW,ly=l.forwardRef(({className:e,...t},n)=>(0,a.jsx)(OI,{ref:n,className:st("w-full md:w-auto h-auto inline-flex sm:h-9 items-center justify-start rounded-lg bg-transparent p-1 text-muted-foreground",e),...t}));ly.displayName=OI.displayName;const Rd=l.forwardRef(({className:e,...t},n)=>(0,a.jsx)(NI,{ref:n,className:st("w-full md:w-auto inline-flex items-center justify-center whitespace-nowrap px-4 py-1 md:px-8 text-sm leading-8 font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:border-b-2 data-[state=active]:border-indigo-600 data-[state=active]:text-indigo-600 data-[state=active]:font-semibold data-[state=active]:dark:text-slate-200 data-[state=active]:dark:border-slate-200",e),...t}));Rd.displayName=NI.displayName;const cm=l.forwardRef(({className:e,...t},n)=>(0,a.jsx)(AI,{ref:n,className:st("ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));cm.displayName=AI.displayName;const aW=({Page:e,RequiredPermission:t=[]})=>{const{isAuthenticated:n}=(0,zr.Z)(),{isLoggedIn:r,isLoading:s,isFetching:o}=(0,zr.m)(),i=Qs(),u=ks(),{hasAccess:p,permissionsLoading:g,permissionsFetched:v}=oy();return(0,l.useEffect)(()=>{const w=sy._.AdminForbiddenAccess,x=Array.isArray(t)?t:[t];!n&&!r&&!(s||o)&&u.pathname!==Sr.Login&&i(Sr.Login,{state:{from:u.pathname}}),v&&!window.location.href.includes(w)&&r&&!g&&!p([oe.aX.ResellerAdmin,...x])&&i(w)},[n,r,v,g,s]),n?(0,a.jsx)(e,{}):(0,a.jsx)(zs,{floating:!0})},Ll=(e,t)=>()=>(0,a.jsx)(aW,{Page:e,RequiredPermission:t});class iW{static getResellerIntegrations(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/resellers/{resellerId}/integrations";o=o.replace("{resellerId}",t.resellerId+"");const i=(0,oe.Y_)("get","application/json",o,n);(0,oe.pY)(i,r,s)})}}const T_={queryKey:e=>["ResellerIntegrationsService/getResellerIntegrations",e],queryFn:async e=>e?await iW.getResellerIntegrations({resellerId:e}):await Promise.reject(new Error("Missing parameters")),staleTime:Aa},k_=e=>{const t=wa();return(0,js.I)({queryKey:T_.queryKey(t),queryFn:async()=>await T_.queryFn(t),enabled:!!t,staleTime:T_.staleTime,...e})},lW=e=>{const{t}=(0,z.Bd)();switch(e){case oe.pq.ConnectWise:return t("rsp:pages.integrations.cards.connectWise.title");case oe.pq.Sherweb:return t("rsp:pages.integrations.cards.sherweb.title");default:return"Undefined"}},cW=e=>{const{t}=(0,z.Bd)();switch(e){case oe.pq.ConnectWise:return t("rsp:pages.integrations.cards.connectWise.description");case oe.pq.Sherweb:return t("rsp:pages.integrations.cards.sherweb.description");default:return"Undefined"}},uW=e=>{switch(e){case oe.pq.ConnectWise:return Sr.IntegrationsConnectWise;case oe.pq.Sherweb:return Sr.SherwebIntegrationsServiceProvider;default:return"/"}};function dW({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.348 14.652a3.75 3.75 0 0 1 0-5.304m5.304 0a3.75 3.75 0 0 1 0 5.304m-7.425 2.121a6.75 6.75 0 0 1 0-9.546m9.546 0a6.75 6.75 0 0 1 0 9.546M5.106 18.894c-3.808-3.807-3.808-9.98 0-13.788m13.788 0c3.808 3.807 3.808 9.98 0 13.788M12 12h.008v.008H12V12Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z"}))}const fW=l.forwardRef(dW),xo=({children:e,padded:t=!0,className:n="",...r})=>(0,a.jsx)("div",{...r,className:st("rounded-xl bg-gradient-to-b from-white/60 to-white/50  shadow-[0px_4px_24px_#00000012,inset_0px_-1px_1px_#ffffff20,inset_0px_1px_1px_#ffffff40] backdrop-blur-[32px] backdrop-brightness-[100%]  border-[rgba(255,255,255,0.18)]","dark:bg-none dark:bg-slate-900 dark:text-white dark:backdrop-blur-none dark:border dark:border-slate-800 dark:shadow-none",t&&"p-4 md:p-8 border-1 border-solid border-white",n),children:e}),Xfe=({chart:e,children:t,...n})=>jsxs(Card,{...n,className:mergeClassName("relative overflow-hidden",n?.className),children:[t,jsx("div",{className:"absolute bottom-0 left-0 h-2/5 w-full opacity-40 hover:opacity-80",children:e})]}),Zfe=null,fc=({children:e,...t})=>(0,a.jsx)("h3",{...t,className:st("truncate text-sm font-medium text-slate-500 dark:text-slate-200",t?.className),children:e}),R_=({children:e,large:t=!1,...n})=>(0,a.jsx)("div",{...n,className:st("mr-2 text-3xl font-bold leading-9 text-gray-900 dark:text-slate-200",t&&"flex h-full items-center justify-center text-6xl font-bold",n?.className),children:e}),tpe=({children:e,...t})=>jsx(Card,{padded:!1,...t,className:mergeClassName("withTable relative",t?.className),children:e}),npe=null,pW=({integration:e})=>{const{t}=(0,z.Bd)(),n=lW(e.integrationType),r=cW(e.integrationType),s=uW(e.integrationType);return(0,a.jsxs)(xo,{className:"flex flex-col justify-between md:p-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(fc,{children:(0,a.jsx)(Pn,{variant:"body1",weight:"semiBold",children:n})}),(0,a.jsx)(Pn,{variant:"label",children:r})]}),(0,a.jsx)("div",{className:"mt-4",children:(0,a.jsxs)("div",{className:`flex ${e.configured?"justify-between":"justify-end"}`,children:[e.configured?(0,a.jsxs)(to,{variant:wo.Success,children:[(0,a.jsx)(fW,{className:"mr-1 h-4 w-4"}),t("rsp:pages.integrations.buttons.connected")]}):null,(0,a.jsx)(w_,{permission:oe.aX.IntegrationConfigure,children:(0,a.jsx)(jo,{to:s,children:(0,a.jsxs)(to,{className:"border-gray-600/10 bg-gray-100 hover:bg-gray-600/10 dark:border-gray-400 dark:bg-transparent dark:text-gray-300","data-testid":"btnIntegrationSetup",children:[(0,a.jsx)(IE,{className:"mr-1 h-4 w-4"}),t("rsp:pages.integrations.buttons.setup")]})})})]})})]})},qE=({integrations:e=[],dataTestId:t,value:n})=>(0,a.jsx)(cm,{value:n,"data-testid":t,className:"focus-visible:ring-indigo-300 md:py-4",children:(0,a.jsx)("div",{className:"mt-4 grid grid-cols-1 gap-4 lg:gap-6 xl:grid-cols-1",children:(0,a.jsx)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2  lg:grid-cols-3 lg:gap-6 xl:grid-cols-4",children:e?.map(r=>(0,a.jsx)(hW,{integration:r},r.id))})})}),hW=pW,mW=Ll(()=>{const{t:e}=(0,z.Bd)(),t=k_({staleTime:0,refetchOnMount:!0}),{hasAccess:n}=oy(),r=n([oe.aX.IntegrationList,oe.aX.IntegrationDetails,oe.aX.IntegrationConfigure]),s=[...r?t.data?.helpDesk??[]:[],...t.data?.serviceProvider??[]];return(0,a.jsxs)(Wu,{children:[(0,a.jsx)("div",{className:"mb-8 sm:mb-16",children:(0,a.jsx)(yl,{title:(0,a.jsx)(el,{"data-testid":"pageIntegrationsTitle",children:e("rsp:pages.integrations.title")})})}),(t?.isLoading||t?.data===void 0)&&(0,a.jsx)(zs,{floating:!0}),(0,a.jsxs)(Hb,{defaultValue:"all",className:"w-full",children:[(0,a.jsxs)(o0,{children:[(0,a.jsxs)(ly,{className:"h-16 sm:h-auto",children:[(0,a.jsx)(Rd,{value:"all","data-testid":"tabsTriggerAll",className:"focus-visible:ring-indigo-300",children:e("rsp:pages.integrations.tabs.all")}),(0,a.jsx)(Rd,{value:"serviceProvider",disabled:t.data?.serviceProvider==null||t.data.serviceProvider?.length===0,"data-testid":"tabsTriggerServiceProvider",className:"focus-visible:ring-indigo-300",children:e("rsp:pages.integrations.tabs.serviceProvider")}),r?(0,a.jsx)(Rd,{value:"support",disabled:t.data?.helpDesk==null||t.data.helpDesk?.length===0,"data-testid":"tabsTriggerSupport",className:"focus-visible:ring-indigo-300",children:e("rsp:pages.integrations.tabs.support")}):null]}),(0,a.jsx)(Bb,{orientation:"horizontal"})]}),(0,a.jsx)(qE,{value:"all",dataTestId:"tabsContentAll",integrations:s},"allIntegrations"),(0,a.jsx)(qE,{value:"serviceProvider",dataTestId:"tabsContentServiceProvider",integrations:t?.data?.serviceProvider},"serviceProviderIntegrations"),(0,a.jsx)(qE,{value:"support",dataTestId:"tabsContentSupport",integrations:t?.data?.helpDesk},"supportIntegrations")]})]})});function gW({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18"}))}const vW=l.forwardRef(gW),a0=({children:e})=>(0,a.jsxs)("div",{className:"mb-4 inline-flex flex-nowrap text-sm font-medium text-gray-500 dark:text-zinc-500 md:mb-2",children:[(0,a.jsx)(vW,{className:"mr-0.5 w-4 text-gray-500 hover:bg-slate-50","data-testid":"backlink-icon"}),e]}),yW=l.forwardRef(({children:e},t)=>{const n=Qh();return(0,a.jsx)(Hb,{value:n.pathname,ref:t,children:e})}),KE=l.forwardRef(({to:e,children:t,disabled:n,...r},s)=>(0,a.jsx)(Rd,{asChild:!0,value:e,disabled:n,...r,ref:s,children:(0,a.jsx)(ka,{className:st({"pointer-events-none":n}),to:e,children:t})})),bW=()=>(0,a.jsx)(Ta,{});class II{static getHelpDeskApiInformation(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/resellers/{resellerId}/helpdesk/{integrationId}/api-information";o=o.replace("{resellerId}",t.resellerId+""),o=o.replace("{integrationId}",t.integrationId+"");const i=(0,oe.Y_)("get","application/json",o,n);(0,oe.pY)(i,r,s)})}static setHelpDeskApiInformation(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/resellers/{resellerId}/helpdesk/{integrationId}/api-information";o=o.replace("{resellerId}",t.resellerId+""),o=o.replace("{integrationId}",t.integrationId+"");const i=(0,oe.Y_)("post","application/json",o,n);let u=t.command;i.data=u,(0,oe.pY)(i,r,s)})}}class P_{static getHelpDeskTicketStatusMappings(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/resellers/{resellerId}/helpdesk/{integrationId}/ticket-status-mappings";o=o.replace("{resellerId}",t.resellerId+""),o=o.replace("{integrationId}",t.integrationId+"");const i=(0,oe.Y_)("get","application/json",o,n);i.params={serviceBoardId:t.serviceBoardId},(0,oe.pY)(i,r,s)})}static getHelpDeskServiceBoards(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/resellers/{resellerId}/helpdesk/{integrationId}/service-boards";o=o.replace("{resellerId}",t.resellerId+""),o=o.replace("{integrationId}",t.integrationId+"");const i=(0,oe.Y_)("get","application/json",o,n);(0,oe.pY)(i,r,s)})}static getHelpDeskTicketTypes(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/resellers/{resellerId}/helpdesk/{integrationId}/ticket/types";o=o.replace("{resellerId}",t.resellerId+""),o=o.replace("{integrationId}",t.integrationId+"");const i=(0,oe.Y_)("get","application/json",o,n);i.params={serviceBoardId:t.serviceBoardId},(0,oe.pY)(i,r,s)})}static setHelpDeskBoardConfiguration(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/resellers/{resellerId}/helpdesk/{integrationId}/configuration";o=o.replace("{resellerId}",t.resellerId+""),o=o.replace("{integrationId}",t.integrationId+"");const i=(0,oe.Y_)("post","application/json",o,n);let u=t.configurationCommand;i.data=u,(0,oe.pY)(i,r,s)})}}class jI{static getUnmappedOrganizations(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/resellers/{resellerId}/helpdesk/{integrationId}/organizations/unmapped";o=o.replace("{resellerId}",t.resellerId+""),o=o.replace("{integrationId}",t.integrationId+"");const i=(0,oe.Y_)("get","application/json",o,n);(0,oe.pY)(i,r,s)})}static mapOrganizations(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/resellers/{resellerId}/helpdesk/{integrationId}/organizations/map";o=o.replace("{resellerId}",t.resellerId+""),o=o.replace("{integrationId}",t.integrationId+"");const i=(0,oe.Y_)("post","application/json",o,n);let u=t.command;i.data=u,(0,oe.pY)(i,r,s)})}}const wW=e=>{if(!e)return{requiredStatuses:[],optionalStatuses:[]};const t=[],n=[];return e.forEach(r=>{r.isRequired?t.push(r):n.push(r)}),{requiredStatuses:t,optionalStatuses:n}},xW=(e,t)=>!e||!t?{ticketStatusMappingList:{}}:{...e,ticketStatusMappingList:{[t]:e?.ticketStatusMappingList?.reduce((n,r)=>{const s=r.ticketStatusId;return n[s]=n[s]||[],n[s].push(r?.integrationTicketStatusId??""),n},{})??{}}},_W=(e,t)=>!e||!t?{ticketTypes:[]}:{ticketTypes:e,configured:{[t]:e.filter(n=>n.configured).map(n=>n.integrationId??"")??[]}};class SW{static getHelpDeskTicketStatuses(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/resellers/{resellerId}/helpdesk/{integrationId}/tickets/statuses";o=o.replace("{resellerId}",t.resellerId+""),o=o.replace("{integrationId}",t.integrationId+"");const i=(0,oe.Y_)("get","application/json",o,n);(0,oe.pY)(i,r,s)})}}const O_={queryKey:(e,t)=>["HelpDeskApiInformationService/getHelpDeskApiInformation",e,t],queryFn:async(e,t)=>!e||!t?await(0,oo.Ui)():await II.getHelpDeskApiInformation({resellerId:e,integrationId:t}),staleTime:Aa},Wb={queryKey:(e,t)=>["HelpDeskBoardConfigurationService/getHelpDeskServiceBoards",e,t],queryFn:async(e,t)=>!e||!t?await(0,oo.Ui)():await P_.getHelpDeskServiceBoards({resellerId:e,integrationId:t}),staleTime:Aa},GE={queryKey:(e,t)=>(0,Os.getLocalizedQueryKey)(["HelpDeskTicketsService/getHelpDeskTicketStatuses",e,t]),queryFn:async(e,t)=>!e||!t?await(0,oo.Ui)():await SW.getHelpDeskTicketStatuses({resellerId:e,integrationId:t}),staleTime:Aa},qb={queryKey:(e,t,n)=>(0,Os.getLocalizedQueryKey)(["HelpDeskBoardConfigurationService/getHelpDeskTicketStatusMappings",e,t,n]),queryFn:async(e,t,n)=>!e||!t||!n?await(0,oo.Ui)():await P_.getHelpDeskTicketStatusMappings({resellerId:e,integrationId:t,serviceBoardId:n}),staleTime:Aa},Kb={queryKey:(e,t,n)=>(0,Os.getLocalizedQueryKey)(["HelpDeskBoardConfigurationService/getHelpDeskTicketTypes",e,t,n]),queryFn:async(e,t,n)=>!e||!t||!n?await(0,oo.Ui)():await P_.getHelpDeskTicketTypes({resellerId:e,integrationId:t,serviceBoardId:n}),staleTime:Aa},N_={queryKey:(e,t)=>["HelpDeskOrganizationsService/getUnmappedOrganizations",e,t],queryFn:async(e,t)=>!e||!t?await Promise.reject(new Error("Missing parameters")):await jI.getUnmappedOrganizations({resellerId:e,integrationId:t}),staleTime:Aa},$p=()=>k_({select:e=>e?.helpDesk?.find(t=>t.integrationType===oe.pq.ConnectWise)?.id??""}),Pd=()=>{const e=k_({select:t=>t?.helpDesk?.find(n=>n.integrationType===oe.pq.ConnectWise)?.configured??!1});return{isLoading:e?.isLoading||e?.data===void 0,isEnabled:e?.data}},CW=()=>{const e=$p()?.data,t=Pd()?.isEnabled,n=wa();return(0,js.I)({queryKey:O_.queryKey(n,e),queryFn:async()=>await O_.queryFn(n,e),enabled:!!n&&!!e&&t,staleTime:O_.staleTime})},EW=()=>{const{t:e}=(0,z.Bd)(),t=(0,V.jE)(),n=$p()?.data,r=QE()?.data,s=wa();return(0,Vo.n)({mutationFn:async o=>{if(!s||!n)throw(0,oo.XY)();return await II.setHelpDeskApiInformation({resellerId:s,integrationId:n,command:o})},onSuccess:async()=>{(0,Yr.v0)(e("rsp:pages.integrations.helpdesk.connectWise.apiInformation.configuration.updateSuccess")),await t.invalidateQueries({queryKey:T_.queryKey(s)}),await t.invalidateQueries({queryKey:O_.queryKey(s,n)}),r&&await Promise.all([t.invalidateQueries({queryKey:Wb.queryKey(s,n)}),t.invalidateQueries({queryKey:qb.queryKey(s,n,r)}),t.invalidateQueries({queryKey:Kb.queryKey(s,n,r)})])}})},A_=e=>{const t=$p()?.data,n=wa(),r=Pd()?.isEnabled;return(0,js.I)({queryKey:Wb.queryKey(n,t),queryFn:async()=>await Wb.queryFn(n,t),enabled:!!n&&!!t&&r,staleTime:Wb.staleTime,...e})},QE=()=>A_({select:e=>e?.find(t=>t?.active)?.id}),DI=()=>{const e=wa(),t=$p()?.data,n=Pd()?.isEnabled;return(0,js.I)({queryKey:GE.queryKey(e,t),queryFn:async()=>await GE.queryFn(e,t),enabled:!!e&&!!t&&n,select:r=>wW(r),staleTime:GE.staleTime})},YE=e=>{const t=wa(),n=$p()?.data,r=Pd()?.isEnabled;return(0,js.I)({queryKey:qb.queryKey(t,n,e),queryFn:async()=>await qb.queryFn(t,n,e),select:s=>xW(s,e),enabled:!!t&&!!n&&!!e&&r,staleTime:qb.staleTime})},MI=e=>{const t=wa(),n=$p()?.data,r=Pd()?.isEnabled;return(0,js.I)({queryKey:Kb.queryKey(t,n,e),queryFn:async()=>await Kb.queryFn(t,n,e),select:s=>_W(s,e),enabled:!!t&&!!n&&!!e&&r,staleTime:Kb.staleTime})},TW=()=>{const{t:e}=(0,z.Bd)(),t=(0,V.jE)(),n=$p()?.data,r=wa();return(0,Vo.n)({mutationFn:async s=>{if(!r||!n)throw(0,oo.XY)();return await P_.setHelpDeskBoardConfiguration({resellerId:r,integrationId:n,configurationCommand:{serviceBoardId:s.serviceBoard,ticketStatusMappings:Object.entries(s.ticketStatusMappingList[s?.serviceBoard??""])?.flatMap(([o,i])=>i?i?.map(u=>({ticketStatusId:o,integrationTicketStatusId:u})):[]),ticketTypeMappings:s.ticketTypes[s?.serviceBoard??""]}})},onSuccess:async(s,o)=>{(0,Yr.v0)(e("rsp:pages.integrations.helpdesk.connectWise.boardConfiguration.updateSuccess")),await Promise.all([t.invalidateQueries({queryKey:Wb.queryKey(r,n)}),t.invalidateQueries({queryKey:qb.queryKey(r,n,o?.serviceBoard)}),t.invalidateQueries({queryKey:Kb.queryKey(r,n,o?.serviceBoard)})])}})},XE=e=>{const t=wa(),n=$p()?.data,r=Pd()?.isEnabled;return(0,js.I)({queryKey:N_.queryKey(t,n),queryFn:async()=>await N_.queryFn(t,n),enabled:!!t&&!!n&&!!r,staleTime:N_.staleTime,...e})},kW=()=>{const e=(0,V.jE)(),t=wa(),n=$p()?.data,r=Pd()?.isEnabled;return(0,Vo.n)({mutationFn:async s=>{if(!t||!n)throw(0,oo.XY)();if(!r)throw(0,oo.er)("HelpDesk not configured");return await jI.mapOrganizations({resellerId:t,integrationId:n,command:{setOrganizationMappings:Object.keys(s?.organizations).reduce((o,i)=>(o.push({organizationId:i,companyId:s?.organizations[i]}),o),[])}})},onSuccess:async()=>{await e.invalidateQueries({queryKey:N_.queryKey(t,n)})}})},RW=Ll(()=>{const{t:e}=(0,z.Bd)(),t=Pd(),n=XE();return t?.isLoading?(0,a.jsx)(zs,{floating:!0}):(0,a.jsxs)(Wu,{children:[(0,a.jsxs)("div",{className:"mb-8 sm:mb-16",children:[(0,a.jsx)(vl,{to:Sr.Integrations,"data-testid":"linkBackToIntegrations",children:(0,a.jsx)(a0,{children:e("rsp:pages.integrations.backLink")})}),(0,a.jsx)(yl,{title:(0,a.jsx)(el,{"data-testid":"pageConnectWiseTitle",children:e("rsp:pages.integrations.helpdesk.connectWise.title")})})]}),(0,a.jsx)(yW,{className:"w-full",children:(0,a.jsxs)(o0,{children:[(0,a.jsxs)(ly,{className:"h-16 sm:h-auto",children:[(0,a.jsx)(KE,{to:Sr.IntegrationsConnectWiseApiInformation,"data-testid":"tabsTriggerApiInformation",className:"focus-visible:ring-indigo-300",children:e("rsp:pages.integrations.helpdesk.connectWise.tabs.apiInformation")}),(0,a.jsx)(KE,{to:Sr.IntegrationsConnectWiseBoardConfiguration,disabled:!t?.isEnabled,"data-testid":"tabsTriggerBoardConfiguration",className:"focus-visible:ring-indigo-300",children:e("rsp:pages.integrations.helpdesk.connectWise.tabs.boardConfiguration")}),(0,a.jsxs)(KE,{to:Sr.IntegrationsConnectWiseOrganizationMapping,disabled:!t?.isEnabled,"data-testid":"tabsTriggerOrganizationMapping",className:"focus-visible:ring-indigo-300",children:[e("rsp:pages.integrations.helpdesk.connectWise.tabs.organizationMapping"),n?.data&&n?.data?.length!==0?(0,a.jsx)(Pn,{variant:"body2",weight:"medium","data-testid":"textUnMappedOrganizationCount",className:"ml-2.5 flex h-4 items-center rounded-xl bg-indigo-100 px-2.5 text-indigo-600 dark:text-indigo-600",children:n?.data?.length}):null]})]}),(0,a.jsx)(Bb,{orientation:"horizontal"})]})}),(0,a.jsx)(bW,{})]})},[oe.aX.IntegrationConfigure,oe.aX.IntegrationList]);var Gb=e=>e.type==="checkbox",cy=e=>e instanceof Date,pc=e=>e==null;const $I=e=>typeof e=="object";var Ii=e=>!pc(e)&&!Array.isArray(e)&&$I(e)&&!cy(e),LI=e=>Ii(e)&&e.target?Gb(e.target)?e.target.checked:e.target.value:e,PW=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,FI=(e,t)=>e.has(PW(t)),OW=e=>{const t=e.constructor&&e.constructor.prototype;return Ii(t)&&t.hasOwnProperty("isPrototypeOf")},ZE=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function ji(e){let t;const n=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(ZE&&(e instanceof Blob||e instanceof FileList))&&(n||Ii(e)))if(t=n?[]:{},!n&&!OW(e))t=e;else for(const r in e)e.hasOwnProperty(r)&&(t[r]=ji(e[r]));else return e;return t}var uy=e=>Array.isArray(e)?e.filter(Boolean):[],fa=e=>e===void 0,An=(e,t,n)=>{if(!t||!Ii(e))return n;const r=uy(t.split(/[,[\].]+?/)).reduce((s,o)=>pc(s)?s:s[o],e);return fa(r)||r===e?fa(e[t])?n:e[t]:r},Od=e=>typeof e=="boolean";const I_={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Gu={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Lp={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},zI=l.createContext(null),xa=()=>l.useContext(zI),NW=e=>{const{children:t,...n}=e;return l.createElement(zI.Provider,{value:n},t)};var UI=(e,t,n,r=!0)=>{const s={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(s,o,{get:()=>{const i=o;return t._proxyFormState[i]!==Gu.all&&(t._proxyFormState[i]=!r||Gu.all),n&&(n[i]=!0),e[i]}});return s},qc=e=>Ii(e)&&!Object.keys(e).length,BI=(e,t,n,r)=>{n(e);const{name:s,...o}=e;return qc(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(i=>t[i]===(!r||Gu.all))},pu=e=>Array.isArray(e)?e:[e],VI=(e,t,n)=>!e||!t||e===t||pu(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r)));function j_(e){const t=l.useRef(e);t.current=e,l.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}function AW(e){const t=xa(),{control:n=t.control,disabled:r,name:s,exact:o}=e||{},[i,u]=l.useState(n._formState),p=l.useRef(!0),g=l.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),v=l.useRef(s);return v.current=s,j_({disabled:r,next:w=>p.current&&VI(v.current,w.name,o)&&BI(w,g.current,n._updateFormState)&&u({...n._formState,...w}),subject:n._subjects.state}),l.useEffect(()=>(p.current=!0,g.current.isValid&&n._updateValid(!0),()=>{p.current=!1}),[n]),UI(i,n,g.current,!1)}var Mf=e=>typeof e=="string",HI=(e,t,n,r,s)=>Mf(e)?(r&&t.watch.add(e),An(n,e,s)):Array.isArray(e)?e.map(o=>(r&&t.watch.add(o),An(n,o))):(r&&(t.watchAll=!0),n);function IW(e){const t=xa(),{control:n=t.control,name:r,defaultValue:s,disabled:o,exact:i}=e||{},u=l.useRef(r);u.current=r,j_({disabled:o,subject:n._subjects.values,next:v=>{VI(u.current,v.name,i)&&g(ji(HI(u.current,n._names,v.values||n._formValues,!1,s)))}});const[p,g]=l.useState(n._getWatch(r,s));return l.useEffect(()=>n._removeUnmounted()),p}var JE=e=>/^\w*$/.test(e),WI=e=>uy(e.replace(/["|']|\]/g,"").split(/\.|\[/)),To=(e,t,n)=>{let r=-1;const s=JE(t)?[t]:WI(t),o=s.length,i=o-1;for(;++r<o;){const u=s[r];let p=n;if(r!==i){const g=e[u];p=Ii(g)||Array.isArray(g)?g:isNaN(+s[r+1])?{}:[]}e[u]=p,e=e[u]}return e};function jW(e){const t=xa(),{name:n,disabled:r,control:s=t.control,shouldUnregister:o}=e,i=FI(s._names.array,n),u=IW({control:s,name:n,defaultValue:An(s._formValues,n,An(s._defaultValues,n,e.defaultValue)),exact:!0}),p=AW({control:s,name:n}),g=l.useRef(s.register(n,{...e.rules,value:u,...Od(e.disabled)?{disabled:e.disabled}:{}}));return l.useEffect(()=>{const v=s._options.shouldUnregister||o,w=(x,E)=>{const R=An(s._fields,x);R&&(R._f.mount=E)};if(w(n,!0),v){const x=ji(An(s._options.defaultValues,n));To(s._defaultValues,n,x),fa(An(s._formValues,n))&&To(s._formValues,n,x)}return()=>{(i?v&&!s._state.action:v)?s.unregister(n):w(n,!1)}},[n,s,i,o]),l.useEffect(()=>{An(s._fields,n)&&s._updateDisabledField({disabled:r,fields:s._fields,name:n,value:An(s._fields,n)._f.value})},[r,n,s]),{field:{name:n,value:u,...Od(r)||p.disabled?{disabled:p.disabled||r}:{},onChange:l.useCallback(v=>g.current.onChange({target:{value:LI(v),name:n},type:I_.CHANGE}),[n]),onBlur:l.useCallback(()=>g.current.onBlur({target:{value:An(s._formValues,n),name:n},type:I_.BLUR}),[n,s]),ref:v=>{const w=An(s._fields,n);w&&v&&(w._f.ref={focus:()=>v.focus(),select:()=>v.select(),setCustomValidity:x=>v.setCustomValidity(x),reportValidity:()=>v.reportValidity()})}},formState:p,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!An(p.errors,n)},isDirty:{enumerable:!0,get:()=>!!An(p.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!An(p.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!An(p.validatingFields,n)},error:{enumerable:!0,get:()=>An(p.errors,n)}})}}const DW=e=>e.render(jW(e)),MW="post";function upe(e){const t=xa(),[n,r]=React.useState(!1),{control:s=t.control,onSubmit:o,children:i,action:u,method:p=MW,headers:g,encType:v,onError:w,render:x,onSuccess:E,validateStatus:R,...k}=e,N=async L=>{let D=!1,B="";await s.handleSubmit(async Q=>{const ce=new FormData;let ye="";try{ye=JSON.stringify(Q)}catch{}for(const G of s._names.mount)ce.append(G,An(Q,G));if(o&&await o({data:Q,event:L,method:p,formData:ce,formDataJson:ye}),u)try{const G=[g&&g["Content-Type"],v].some(We=>We&&We.includes("json")),Le=await fetch(u,{method:p,headers:{...g,...v?{"Content-Type":v}:{}},body:G?ye:ce});Le&&(R?!R(Le.status):Le.status<200||Le.status>=300)?(D=!0,w&&w({response:Le}),B=String(Le.status)):E&&E({response:Le})}catch(G){D=!0,w&&w({error:G})}})(L),D&&e.control&&(e.control._subjects.state.next({isSubmitSuccessful:!1}),e.control.setError("root.server",{type:B}))};return React.useEffect(()=>{r(!0)},[]),x?React.createElement(React.Fragment,null,x({submit:N})):React.createElement("form",{noValidate:n,action:u,method:p,encType:v,onSubmit:N,...k},i)}var qI=(e,t,n,r,s)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:s||!0}}:{},um=()=>{const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const n=(Math.random()*16+e)%16|0;return(t=="x"?n:n&3|8).toString(16)})},eT=(e,t,n={})=>n.shouldFocus||fa(n.shouldFocus)?n.focusName||`${e}.${fa(n.focusIndex)?t:n.focusIndex}.`:"",Qb=e=>({isOnSubmit:!e||e===Gu.onSubmit,isOnBlur:e===Gu.onBlur,isOnChange:e===Gu.onChange,isOnAll:e===Gu.all,isOnTouch:e===Gu.onTouched}),tT=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const dy=(e,t,n,r)=>{for(const s of n||Object.keys(e)){const o=An(e,s);if(o){const{_f:i,...u}=o;if(i){if(i.refs&&i.refs[0]&&t(i.refs[0],s)&&!r)break;if(i.ref&&t(i.ref,i.name)&&!r)break;dy(u,t)}else Ii(u)&&dy(u,t)}}};var KI=(e,t,n)=>{const r=uy(An(e,n));return To(r,"root",t[n]),To(e,n,r),e},nT=e=>e.type==="file",dm=e=>typeof e=="function",D_=e=>{if(!ZE)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},M_=e=>Mf(e),rT=e=>e.type==="radio",$_=e=>e instanceof RegExp;const GI={value:!1,isValid:!1},QI={value:!0,isValid:!0};var YI=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!fa(e[0].attributes.value)?fa(e[0].value)||e[0].value===""?QI:{value:e[0].value,isValid:!0}:QI:GI}return GI};const XI={isValid:!1,value:null};var ZI=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,XI):XI;function JI(e,t,n="validate"){if(M_(e)||Array.isArray(e)&&e.every(M_)||Od(e)&&!e)return{type:n,message:M_(e)?e:"",ref:t}}var fy=e=>Ii(e)&&!$_(e)?e:{value:e,message:""},sT=async(e,t,n,r,s)=>{const{ref:o,refs:i,required:u,maxLength:p,minLength:g,min:v,max:w,pattern:x,validate:E,name:R,valueAsNumber:k,mount:N,disabled:L}=e._f,D=An(t,R);if(!N||L)return{};const B=i?i[0]:o,Q=xt=>{r&&B.reportValidity&&(B.setCustomValidity(Od(xt)?"":xt||""),B.reportValidity())},ce={},ye=rT(o),G=Gb(o),Le=ye||G,We=(k||nT(o))&&fa(o.value)&&fa(D)||D_(o)&&o.value===""||D===""||Array.isArray(D)&&!D.length,at=qI.bind(null,R,n,ce),St=(xt,Mt,$t,Nt=Lp.maxLength,Bn=Lp.minLength)=>{const wn=xt?Mt:$t;ce[R]={type:xt?Nt:Bn,message:wn,ref:o,...at(xt?Nt:Bn,wn)}};if(s?!Array.isArray(D)||!D.length:u&&(!Le&&(We||pc(D))||Od(D)&&!D||G&&!YI(i).isValid||ye&&!ZI(i).isValid)){const{value:xt,message:Mt}=M_(u)?{value:!!u,message:u}:fy(u);if(xt&&(ce[R]={type:Lp.required,message:Mt,ref:B,...at(Lp.required,Mt)},!n))return Q(Mt),ce}if(!We&&(!pc(v)||!pc(w))){let xt,Mt;const $t=fy(w),Nt=fy(v);if(!pc(D)&&!isNaN(D)){const Bn=o.valueAsNumber||D&&+D;pc($t.value)||(xt=Bn>$t.value),pc(Nt.value)||(Mt=Bn<Nt.value)}else{const Bn=o.valueAsDate||new Date(D),wn=Pt=>new Date(new Date().toDateString()+" "+Pt),Nn=o.type=="time",Zt=o.type=="week";Mf($t.value)&&D&&(xt=Nn?wn(D)>wn($t.value):Zt?D>$t.value:Bn>new Date($t.value)),Mf(Nt.value)&&D&&(Mt=Nn?wn(D)<wn(Nt.value):Zt?D<Nt.value:Bn<new Date(Nt.value))}if((xt||Mt)&&(St(!!xt,$t.message,Nt.message,Lp.max,Lp.min),!n))return Q(ce[R].message),ce}if((p||g)&&!We&&(Mf(D)||s&&Array.isArray(D))){const xt=fy(p),Mt=fy(g),$t=!pc(xt.value)&&D.length>+xt.value,Nt=!pc(Mt.value)&&D.length<+Mt.value;if(($t||Nt)&&(St($t,xt.message,Mt.message),!n))return Q(ce[R].message),ce}if(x&&!We&&Mf(D)){const{value:xt,message:Mt}=fy(x);if($_(xt)&&!D.match(xt)&&(ce[R]={type:Lp.pattern,message:Mt,ref:o,...at(Lp.pattern,Mt)},!n))return Q(Mt),ce}if(E){if(dm(E)){const xt=await E(D,t),Mt=JI(xt,B);if(Mt&&(ce[R]={...Mt,...at(Lp.validate,Mt.message)},!n))return Q(Mt.message),ce}else if(Ii(E)){let xt={};for(const Mt in E){if(!qc(xt)&&!n)break;const $t=JI(await E[Mt](D,t),B,Mt);$t&&(xt={...$t,...at(Mt,$t.message)},Q($t.message),n&&(ce[R]=xt))}if(!qc(xt)&&(ce[R]={ref:B,...xt},!n))return ce}}return Q(!0),ce},oT=(e,t)=>[...e,...pu(t)],aT=e=>Array.isArray(e)?e.map(()=>{}):void 0;function iT(e,t,n){return[...e.slice(0,t),...pu(n),...e.slice(t)]}var lT=(e,t,n)=>Array.isArray(e)?(fa(e[n])&&(e[n]=void 0),e.splice(n,0,e.splice(t,1)[0]),e):[],cT=(e,t)=>[...pu(t),...pu(e)];function $W(e,t){let n=0;const r=[...e];for(const s of t)r.splice(s-n,1),n++;return uy(r).length?r:[]}var uT=(e,t)=>fa(t)?[]:$W(e,pu(t).sort((n,r)=>n-r)),dT=(e,t,n)=>{[e[t],e[n]]=[e[n],e[t]]};function LW(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=fa(e)?r++:e[t[r++]];return e}function FW(e){for(const t in e)if(e.hasOwnProperty(t)&&!fa(e[t]))return!1;return!0}function wi(e,t){const n=Array.isArray(t)?t:JE(t)?[t]:WI(t),r=n.length===1?e:LW(e,n),s=n.length-1,o=n[s];return r&&delete r[o],s!==0&&(Ii(r)&&qc(r)||Array.isArray(r)&&FW(r))&&wi(e,n.slice(0,-1)),e}var ej=(e,t,n)=>(e[t]=n,e);function dpe(e){const t=xa(),{control:n=t.control,name:r,keyName:s="id",shouldUnregister:o}=e,[i,u]=React.useState(n._getFieldArray(r)),p=React.useRef(n._getFieldArray(r).map(um)),g=React.useRef(i),v=React.useRef(r),w=React.useRef(!1);v.current=r,g.current=i,n._names.array.add(r),e.rules&&n.register(r,e.rules),j_({next:({values:ce,name:ye})=>{if(ye===v.current||!ye){const G=An(ce,v.current);Array.isArray(G)&&(u(G),p.current=G.map(um))}},subject:n._subjects.array});const x=React.useCallback(ce=>{w.current=!0,n._updateFieldArray(r,ce)},[n,r]),E=(ce,ye)=>{const G=pu(ji(ce)),Le=oT(n._getFieldArray(r),G);n._names.focus=eT(r,Le.length-1,ye),p.current=oT(p.current,G.map(um)),x(Le),u(Le),n._updateFieldArray(r,Le,oT,{argA:aT(ce)})},R=(ce,ye)=>{const G=pu(ji(ce)),Le=cT(n._getFieldArray(r),G);n._names.focus=eT(r,0,ye),p.current=cT(p.current,G.map(um)),x(Le),u(Le),n._updateFieldArray(r,Le,cT,{argA:aT(ce)})},k=ce=>{const ye=uT(n._getFieldArray(r),ce);p.current=uT(p.current,ce),x(ye),u(ye),n._updateFieldArray(r,ye,uT,{argA:ce})},N=(ce,ye,G)=>{const Le=pu(ji(ye)),We=iT(n._getFieldArray(r),ce,Le);n._names.focus=eT(r,ce,G),p.current=iT(p.current,ce,Le.map(um)),x(We),u(We),n._updateFieldArray(r,We,iT,{argA:ce,argB:aT(ye)})},L=(ce,ye)=>{const G=n._getFieldArray(r);dT(G,ce,ye),dT(p.current,ce,ye),x(G),u(G),n._updateFieldArray(r,G,dT,{argA:ce,argB:ye},!1)},D=(ce,ye)=>{const G=n._getFieldArray(r);lT(G,ce,ye),lT(p.current,ce,ye),x(G),u(G),n._updateFieldArray(r,G,lT,{argA:ce,argB:ye},!1)},B=(ce,ye)=>{const G=ji(ye),Le=ej(n._getFieldArray(r),ce,G);p.current=[...Le].map((We,at)=>!We||at===ce?um():p.current[at]),x(Le),u([...Le]),n._updateFieldArray(r,Le,ej,{argA:ce,argB:G},!0,!1)},Q=ce=>{const ye=pu(ji(ce));p.current=ye.map(um),x([...ye]),u([...ye]),n._updateFieldArray(r,[...ye],G=>G,{},!0,!1)};return React.useEffect(()=>{if(n._state.action=!1,tT(r,n._names)&&n._subjects.state.next({...n._formState}),w.current&&(!Qb(n._options.mode).isOnSubmit||n._formState.isSubmitted))if(n._options.resolver)n._executeSchema([r]).then(ce=>{const ye=An(ce.errors,r),G=An(n._formState.errors,r);(G?!ye&&G.type||ye&&(G.type!==ye.type||G.message!==ye.message):ye&&ye.type)&&(ye?To(n._formState.errors,r,ye):wi(n._formState.errors,r),n._subjects.state.next({errors:n._formState.errors}))});else{const ce=An(n._fields,r);ce&&ce._f&&!(Qb(n._options.reValidateMode).isOnSubmit&&Qb(n._options.mode).isOnSubmit)&&sT(ce,n._formValues,n._options.criteriaMode===Gu.all,n._options.shouldUseNativeValidation,!0).then(ye=>!qc(ye)&&n._subjects.state.next({errors:KI(n._formState.errors,ye,r)}))}n._subjects.values.next({name:r,values:{...n._formValues}}),n._names.focus&&dy(n._fields,(ce,ye)=>{if(n._names.focus&&ye.startsWith(n._names.focus)&&ce.focus)return ce.focus(),1}),n._names.focus="",n._updateValid(),w.current=!1},[i,r,n]),React.useEffect(()=>(!An(n._formValues,r)&&n._updateFieldArray(r),()=>{(n._options.shouldUnregister||o)&&n.unregister(r)}),[r,n,s,o]),{swap:React.useCallback(L,[x,r,n]),move:React.useCallback(D,[x,r,n]),prepend:React.useCallback(R,[x,r,n]),append:React.useCallback(E,[x,r,n]),remove:React.useCallback(k,[x,r,n]),insert:React.useCallback(N,[x,r,n]),update:React.useCallback(B,[x,r,n]),replace:React.useCallback(Q,[x,r,n]),fields:React.useMemo(()=>i.map((ce,ye)=>({...ce,[s]:p.current[ye]||um()})),[i,s])}}var fT=()=>{let e=[];return{get observers(){return e},next:s=>{for(const o of e)o.next&&o.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(o=>o!==s)}}),unsubscribe:()=>{e=[]}}},L_=e=>pc(e)||!$I(e);function i0(e,t){if(L_(e)||L_(t))return e===t;if(cy(e)&&cy(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const s of n){const o=e[s];if(!r.includes(s))return!1;if(s!=="ref"){const i=t[s];if(cy(o)&&cy(i)||Ii(o)&&Ii(i)||Array.isArray(o)&&Array.isArray(i)?!i0(o,i):o!==i)return!1}}return!0}var tj=e=>e.type==="select-multiple",zW=e=>rT(e)||Gb(e),pT=e=>D_(e)&&e.isConnected,nj=e=>{for(const t in e)if(dm(e[t]))return!0;return!1};function F_(e,t={}){const n=Array.isArray(e);if(Ii(e)||n)for(const r in e)Array.isArray(e[r])||Ii(e[r])&&!nj(e[r])?(t[r]=Array.isArray(e[r])?[]:{},F_(e[r],t[r])):pc(e[r])||(t[r]=!0);return t}function rj(e,t,n){const r=Array.isArray(e);if(Ii(e)||r)for(const s in e)Array.isArray(e[s])||Ii(e[s])&&!nj(e[s])?fa(t)||L_(n[s])?n[s]=Array.isArray(e[s])?F_(e[s],[]):{...F_(e[s])}:rj(e[s],pc(t)?{}:t[s],n[s]):n[s]=!i0(e[s],t[s]);return n}var z_=(e,t)=>rj(e,t,F_(t)),sj=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>fa(e)?e:t?e===""?NaN:e&&+e:n&&Mf(e)?new Date(e):r?r(e):e;function hT(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return nT(t)?t.files:rT(t)?ZI(e.refs).value:tj(t)?[...t.selectedOptions].map(({value:n})=>n):Gb(t)?YI(e.refs).value:sj(fa(t.value)?e.ref.value:t.value,e)}var UW=(e,t,n,r)=>{const s={};for(const o of e){const i=An(t,o);i&&To(s,o,i._f)}return{criteriaMode:n,names:[...e],fields:s,shouldUseNativeValidation:r}},Yb=e=>fa(e)?e:$_(e)?e.source:Ii(e)?$_(e.value)?e.value.source:e.value:e,BW=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function oj(e,t,n){const r=An(e,n);if(r||JE(n))return{error:r,name:n};const s=n.split(".");for(;s.length;){const o=s.join("."),i=An(t,o),u=An(e,o);if(i&&!Array.isArray(i)&&n!==o)return{name:n};if(u&&u.type)return{name:o,error:u};s.pop()}return{name:n}}var VW=(e,t,n,r,s)=>s.isOnAll?!1:!n&&s.isOnTouch?!(t||e):(n?r.isOnBlur:s.isOnBlur)?!e:(n?r.isOnChange:s.isOnChange)?e:!0,HW=(e,t)=>!uy(An(e,t)).length&&wi(e,t);const WW={mode:Gu.onSubmit,reValidateMode:Gu.onChange,shouldFocusError:!0};function qW(e={}){let t={...WW,...e},n={submitCount:0,isDirty:!1,isLoading:dm(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},s=Ii(t.defaultValues)||Ii(t.values)?ji(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:ji(s),i={action:!1,mount:!1,watch:!1},u={mount:new Set,unMount:new Set,array:new Set,watch:new Set},p,g=0;const v={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},w={values:fT(),array:fT(),state:fT()},x=Qb(t.mode),E=Qb(t.reValidateMode),R=t.criteriaMode===Gu.all,k=Ze=>Tt=>{clearTimeout(g),g=setTimeout(Ze,Tt)},N=async Ze=>{if(v.isValid||Ze){const Tt=t.resolver?qc((await Le()).errors):await at(r,!0);Tt!==n.isValid&&w.state.next({isValid:Tt})}},L=(Ze,Tt)=>{(v.isValidating||v.validatingFields)&&((Ze||Array.from(u.mount)).forEach(Dt=>{Dt&&(Tt?To(n.validatingFields,Dt,Tt):wi(n.validatingFields,Dt))}),w.state.next({validatingFields:n.validatingFields,isValidating:!qc(n.validatingFields)}))},D=(Ze,Tt=[],Dt,Vn,On=!0,_n=!0)=>{if(Vn&&Dt){if(i.action=!0,_n&&Array.isArray(An(r,Ze))){const Lt=Dt(An(r,Ze),Vn.argA,Vn.argB);On&&To(r,Ze,Lt)}if(_n&&Array.isArray(An(n.errors,Ze))){const Lt=Dt(An(n.errors,Ze),Vn.argA,Vn.argB);On&&To(n.errors,Ze,Lt),HW(n.errors,Ze)}if(v.touchedFields&&_n&&Array.isArray(An(n.touchedFields,Ze))){const Lt=Dt(An(n.touchedFields,Ze),Vn.argA,Vn.argB);On&&To(n.touchedFields,Ze,Lt)}v.dirtyFields&&(n.dirtyFields=z_(s,o)),w.state.next({name:Ze,isDirty:xt(Ze,Tt),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else To(o,Ze,Tt)},B=(Ze,Tt)=>{To(n.errors,Ze,Tt),w.state.next({errors:n.errors})},Q=Ze=>{n.errors=Ze,w.state.next({errors:n.errors,isValid:!1})},ce=(Ze,Tt,Dt,Vn)=>{const On=An(r,Ze);if(On){const _n=An(o,Ze,fa(Dt)?An(s,Ze):Dt);fa(_n)||Vn&&Vn.defaultChecked||Tt?To(o,Ze,Tt?_n:hT(On._f)):Nt(Ze,_n),i.mount&&N()}},ye=(Ze,Tt,Dt,Vn,On)=>{let _n=!1,Lt=!1;const jn={name:Ze},ds=!!(An(r,Ze)&&An(r,Ze)._f.disabled);if(!Dt||Vn){v.isDirty&&(Lt=n.isDirty,n.isDirty=jn.isDirty=xt(),_n=Lt!==jn.isDirty);const $s=ds||i0(An(s,Ze),Tt);Lt=!!(!ds&&An(n.dirtyFields,Ze)),$s||ds?wi(n.dirtyFields,Ze):To(n.dirtyFields,Ze,!0),jn.dirtyFields=n.dirtyFields,_n=_n||v.dirtyFields&&Lt!==!$s}if(Dt){const $s=An(n.touchedFields,Ze);$s||(To(n.touchedFields,Ze,Dt),jn.touchedFields=n.touchedFields,_n=_n||v.touchedFields&&$s!==Dt)}return _n&&On&&w.state.next(jn),_n?jn:{}},G=(Ze,Tt,Dt,Vn)=>{const On=An(n.errors,Ze),_n=v.isValid&&Od(Tt)&&n.isValid!==Tt;if(e.delayError&&Dt?(p=k(()=>B(Ze,Dt)),p(e.delayError)):(clearTimeout(g),p=null,Dt?To(n.errors,Ze,Dt):wi(n.errors,Ze)),(Dt?!i0(On,Dt):On)||!qc(Vn)||_n){const Lt={...Vn,..._n&&Od(Tt)?{isValid:Tt}:{},errors:n.errors,name:Ze};n={...n,...Lt},w.state.next(Lt)}},Le=async Ze=>{L(Ze,!0);const Tt=await t.resolver(o,t.context,UW(Ze||u.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return L(Ze),Tt},We=async Ze=>{const{errors:Tt}=await Le(Ze);if(Ze)for(const Dt of Ze){const Vn=An(Tt,Dt);Vn?To(n.errors,Dt,Vn):wi(n.errors,Dt)}else n.errors=Tt;return Tt},at=async(Ze,Tt,Dt={valid:!0})=>{for(const Vn in Ze){const On=Ze[Vn];if(On){const{_f:_n,...Lt}=On;if(_n){const jn=u.array.has(_n.name);L([Vn],!0);const ds=await sT(On,o,R,t.shouldUseNativeValidation&&!Tt,jn);if(L([Vn]),ds[_n.name]&&(Dt.valid=!1,Tt))break;!Tt&&(An(ds,_n.name)?jn?KI(n.errors,ds,_n.name):To(n.errors,_n.name,ds[_n.name]):wi(n.errors,_n.name))}Lt&&await at(Lt,Tt,Dt)}}return Dt.valid},St=()=>{for(const Ze of u.unMount){const Tt=An(r,Ze);Tt&&(Tt._f.refs?Tt._f.refs.every(Dt=>!pT(Dt)):!pT(Tt._f.ref))&&br(Ze)}u.unMount=new Set},xt=(Ze,Tt)=>(Ze&&Tt&&To(o,Ze,Tt),!i0(At(),s)),Mt=(Ze,Tt,Dt)=>HI(Ze,u,{...i.mount?o:fa(Tt)?s:Mf(Ze)?{[Ze]:Tt}:Tt},Dt,Tt),$t=Ze=>uy(An(i.mount?o:s,Ze,e.shouldUnregister?An(s,Ze,[]):[])),Nt=(Ze,Tt,Dt={})=>{const Vn=An(r,Ze);let On=Tt;if(Vn){const _n=Vn._f;_n&&(!_n.disabled&&To(o,Ze,sj(Tt,_n)),On=D_(_n.ref)&&pc(Tt)?"":Tt,tj(_n.ref)?[..._n.ref.options].forEach(Lt=>Lt.selected=On.includes(Lt.value)):_n.refs?Gb(_n.ref)?_n.refs.length>1?_n.refs.forEach(Lt=>(!Lt.defaultChecked||!Lt.disabled)&&(Lt.checked=Array.isArray(On)?!!On.find(jn=>jn===Lt.value):On===Lt.value)):_n.refs[0]&&(_n.refs[0].checked=!!On):_n.refs.forEach(Lt=>Lt.checked=Lt.value===On):nT(_n.ref)?_n.ref.value="":(_n.ref.value=On,_n.ref.type||w.values.next({name:Ze,values:{...o}})))}(Dt.shouldDirty||Dt.shouldTouch)&&ye(Ze,On,Dt.shouldTouch,Dt.shouldDirty,!0),Dt.shouldValidate&&Pt(Ze)},Bn=(Ze,Tt,Dt)=>{for(const Vn in Tt){const On=Tt[Vn],_n=`${Ze}.${Vn}`,Lt=An(r,_n);(u.array.has(Ze)||!L_(On)||Lt&&!Lt._f)&&!cy(On)?Bn(_n,On,Dt):Nt(_n,On,Dt)}},wn=(Ze,Tt,Dt={})=>{const Vn=An(r,Ze),On=u.array.has(Ze),_n=ji(Tt);To(o,Ze,_n),On?(w.array.next({name:Ze,values:{...o}}),(v.isDirty||v.dirtyFields)&&Dt.shouldDirty&&w.state.next({name:Ze,dirtyFields:z_(s,o),isDirty:xt(Ze,_n)})):Vn&&!Vn._f&&!pc(_n)?Bn(Ze,_n,Dt):Nt(Ze,_n,Dt),tT(Ze,u)&&w.state.next({...n}),w.values.next({name:i.mount?Ze:void 0,values:{...o}})},Nn=async Ze=>{i.mount=!0;const Tt=Ze.target;let Dt=Tt.name,Vn=!0;const On=An(r,Dt),_n=()=>Tt.type?hT(On._f):LI(Ze),Lt=jn=>{Vn=Number.isNaN(jn)||jn===An(o,Dt,jn)};if(On){let jn,ds;const $s=_n(),Ca=Ze.type===I_.BLUR||Ze.type===I_.FOCUS_OUT,xc=!BW(On._f)&&!t.resolver&&!An(n.errors,Dt)&&!On._f.deps||VW(Ca,An(n.touchedFields,Dt),n.isSubmitted,E,x),Qc=tT(Dt,u,Ca);To(o,Dt,$s),Ca?(On._f.onBlur&&On._f.onBlur(Ze),p&&p(0)):On._f.onChange&&On._f.onChange(Ze);const Ja=ye(Dt,$s,Ca,!1),Ld=!qc(Ja)||Qc;if(!Ca&&w.values.next({name:Dt,type:Ze.type,values:{...o}}),xc)return v.isValid&&N(),Ld&&w.state.next({name:Dt,...Qc?{}:Ja});if(!Ca&&Qc&&w.state.next({...n}),t.resolver){const{errors:Fd}=await Le([Dt]);if(Lt($s),Vn){const zd=oj(n.errors,r,Dt),qf=oj(Fd,r,zd.name||Dt);jn=qf.error,Dt=qf.name,ds=qc(Fd)}}else L([Dt],!0),jn=(await sT(On,o,R,t.shouldUseNativeValidation))[Dt],L([Dt]),Lt($s),Vn&&(jn?ds=!1:v.isValid&&(ds=await at(r,!0)));Vn&&(On._f.deps&&Pt(On._f.deps),G(Dt,ds,jn,Ja))}},Zt=(Ze,Tt)=>{if(An(n.errors,Tt)&&Ze.focus)return Ze.focus(),1},Pt=async(Ze,Tt={})=>{let Dt,Vn;const On=pu(Ze);if(t.resolver){const _n=await We(fa(Ze)?Ze:On);Dt=qc(_n),Vn=Ze?!On.some(Lt=>An(_n,Lt)):Dt}else Ze?(Vn=(await Promise.all(On.map(async _n=>{const Lt=An(r,_n);return await at(Lt&&Lt._f?{[_n]:Lt}:Lt)}))).every(Boolean),!(!Vn&&!n.isValid)&&N()):Vn=Dt=await at(r);return w.state.next({...!Mf(Ze)||v.isValid&&Dt!==n.isValid?{}:{name:Ze},...t.resolver||!Ze?{isValid:Dt}:{},errors:n.errors}),Tt.shouldFocus&&!Vn&&dy(r,Zt,Ze?On:u.mount),Vn},At=Ze=>{const Tt={...i.mount?o:s};return fa(Ze)?Tt:Mf(Ze)?An(Tt,Ze):Ze.map(Dt=>An(Tt,Dt))},Ht=(Ze,Tt)=>({invalid:!!An((Tt||n).errors,Ze),isDirty:!!An((Tt||n).dirtyFields,Ze),isTouched:!!An((Tt||n).touchedFields,Ze),isValidating:!!An((Tt||n).validatingFields,Ze),error:An((Tt||n).errors,Ze)}),Gt=Ze=>{Ze&&pu(Ze).forEach(Tt=>wi(n.errors,Tt)),w.state.next({errors:Ze?n.errors:{}})},Sn=(Ze,Tt,Dt)=>{const Vn=(An(r,Ze,{_f:{}})._f||{}).ref;To(n.errors,Ze,{...Tt,ref:Vn}),w.state.next({name:Ze,errors:n.errors,isValid:!1}),Dt&&Dt.shouldFocus&&Vn&&Vn.focus&&Vn.focus()},Cr=(Ze,Tt)=>dm(Ze)?w.values.subscribe({next:Dt=>Ze(Mt(void 0,Tt),Dt)}):Mt(Ze,Tt,!0),br=(Ze,Tt={})=>{for(const Dt of Ze?pu(Ze):u.mount)u.mount.delete(Dt),u.array.delete(Dt),Tt.keepValue||(wi(r,Dt),wi(o,Dt)),!Tt.keepError&&wi(n.errors,Dt),!Tt.keepDirty&&wi(n.dirtyFields,Dt),!Tt.keepTouched&&wi(n.touchedFields,Dt),!Tt.keepIsValidating&&wi(n.validatingFields,Dt),!t.shouldUnregister&&!Tt.keepDefaultValue&&wi(s,Dt);w.values.next({values:{...o}}),w.state.next({...n,...Tt.keepDirty?{isDirty:xt()}:{}}),!Tt.keepIsValid&&N()},Ln=({disabled:Ze,name:Tt,field:Dt,fields:Vn,value:On})=>{if(Od(Ze)){const _n=Ze?void 0:fa(On)?hT(Dt?Dt._f:An(Vn,Tt)._f):On;To(o,Tt,_n),ye(Tt,_n,!1,!1,!0)}},Hr=(Ze,Tt={})=>{let Dt=An(r,Ze);const Vn=Od(Tt.disabled);return To(r,Ze,{...Dt||{},_f:{...Dt&&Dt._f?Dt._f:{ref:{name:Ze}},name:Ze,mount:!0,...Tt}}),u.mount.add(Ze),Dt?Ln({field:Dt,disabled:Tt.disabled,name:Ze,value:Tt.value}):ce(Ze,!0,Tt.value),{...Vn?{disabled:Tt.disabled}:{},...t.progressive?{required:!!Tt.required,min:Yb(Tt.min),max:Yb(Tt.max),minLength:Yb(Tt.minLength),maxLength:Yb(Tt.maxLength),pattern:Yb(Tt.pattern)}:{},name:Ze,onChange:Nn,onBlur:Nn,ref:On=>{if(On){Hr(Ze,Tt),Dt=An(r,Ze);const _n=fa(On.value)&&On.querySelectorAll&&On.querySelectorAll("input,select,textarea")[0]||On,Lt=zW(_n),jn=Dt._f.refs||[];if(Lt?jn.find(ds=>ds===_n):_n===Dt._f.ref)return;To(r,Ze,{_f:{...Dt._f,...Lt?{refs:[...jn.filter(pT),_n,...Array.isArray(An(s,Ze))?[{}]:[]],ref:{type:_n.type,name:Ze}}:{ref:_n}}}),ce(Ze,!1,void 0,_n)}else Dt=An(r,Ze,{}),Dt._f&&(Dt._f.mount=!1),(t.shouldUnregister||Tt.shouldUnregister)&&!(FI(u.array,Ze)&&i.action)&&u.unMount.add(Ze)}}},ws=()=>t.shouldFocusError&&dy(r,Zt,u.mount),us=Ze=>{Od(Ze)&&(w.state.next({disabled:Ze}),dy(r,(Tt,Dt)=>{let Vn=Ze;const On=An(r,Dt);On&&Od(On._f.disabled)&&(Vn||(Vn=On._f.disabled)),Tt.disabled=Vn},0,!1))},tr=(Ze,Tt)=>async Dt=>{let Vn;Dt&&(Dt.preventDefault&&Dt.preventDefault(),Dt.persist&&Dt.persist());let On=ji(o);if(w.state.next({isSubmitting:!0}),t.resolver){const{errors:_n,values:Lt}=await Le();n.errors=_n,On=Lt}else await at(r);if(wi(n.errors,"root"),qc(n.errors)){w.state.next({errors:{}});try{await Ze(On,Dt)}catch(_n){Vn=_n}}else Tt&&await Tt({...n.errors},Dt),ws(),setTimeout(ws);if(w.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:qc(n.errors)&&!Vn,submitCount:n.submitCount+1,errors:n.errors}),Vn)throw Vn},mr=(Ze,Tt={})=>{An(r,Ze)&&(fa(Tt.defaultValue)?wn(Ze,ji(An(s,Ze))):(wn(Ze,Tt.defaultValue),To(s,Ze,ji(Tt.defaultValue))),Tt.keepTouched||wi(n.touchedFields,Ze),Tt.keepDirty||(wi(n.dirtyFields,Ze),n.isDirty=Tt.defaultValue?xt(Ze,ji(An(s,Ze))):xt()),Tt.keepError||(wi(n.errors,Ze),v.isValid&&N()),w.state.next({...n}))},En=(Ze,Tt={})=>{const Dt=Ze?ji(Ze):s,Vn=ji(Dt),On=qc(Ze),_n=On?s:Vn;if(Tt.keepDefaultValues||(s=Dt),!Tt.keepValues){if(Tt.keepDirtyValues)for(const Lt of u.mount)An(n.dirtyFields,Lt)?To(_n,Lt,An(o,Lt)):wn(Lt,An(_n,Lt));else{if(ZE&&fa(Ze))for(const Lt of u.mount){const jn=An(r,Lt);if(jn&&jn._f){const ds=Array.isArray(jn._f.refs)?jn._f.refs[0]:jn._f.ref;if(D_(ds)){const $s=ds.closest("form");if($s){$s.reset();break}}}}r={}}o=e.shouldUnregister?Tt.keepDefaultValues?ji(s):{}:ji(_n),w.array.next({values:{..._n}}),w.values.next({values:{..._n}})}u={mount:Tt.keepDirtyValues?u.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!v.isValid||!!Tt.keepIsValid||!!Tt.keepDirtyValues,i.watch=!!e.shouldUnregister,w.state.next({submitCount:Tt.keepSubmitCount?n.submitCount:0,isDirty:On?!1:Tt.keepDirty?n.isDirty:!!(Tt.keepDefaultValues&&!i0(Ze,s)),isSubmitted:Tt.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:On?[]:Tt.keepDirtyValues?Tt.keepDefaultValues&&o?z_(s,o):n.dirtyFields:Tt.keepDefaultValues&&Ze?z_(s,Ze):{},touchedFields:Tt.keepTouched?n.touchedFields:{},errors:Tt.keepErrors?n.errors:{},isSubmitSuccessful:Tt.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},Ws=(Ze,Tt)=>En(dm(Ze)?Ze(o):Ze,Tt);return{control:{register:Hr,unregister:br,getFieldState:Ht,handleSubmit:tr,setError:Sn,_executeSchema:Le,_getWatch:Mt,_getDirty:xt,_updateValid:N,_removeUnmounted:St,_updateFieldArray:D,_updateDisabledField:Ln,_getFieldArray:$t,_reset:En,_resetDefaultValues:()=>dm(t.defaultValues)&&t.defaultValues().then(Ze=>{Ws(Ze,t.resetOptions),w.state.next({isLoading:!1})}),_updateFormState:Ze=>{n={...n,...Ze}},_disableForm:us,_subjects:w,_proxyFormState:v,_setErrors:Q,get _fields(){return r},get _formValues(){return o},get _state(){return i},set _state(Ze){i=Ze},get _defaultValues(){return s},get _names(){return u},set _names(Ze){u=Ze},get _formState(){return n},set _formState(Ze){n=Ze},get _options(){return t},set _options(Ze){t={...t,...Ze}}},trigger:Pt,register:Hr,handleSubmit:tr,watch:Cr,setValue:wn,getValues:At,reset:Ws,resetField:mr,clearErrors:Gt,unregister:br,setError:Sn,setFocus:(Ze,Tt={})=>{const Dt=An(r,Ze),Vn=Dt&&Dt._f;if(Vn){const On=Vn.refs?Vn.refs[0]:Vn.ref;On.focus&&(On.focus(),Tt.shouldSelect&&On.select())}},getFieldState:Ht}}function hc(e={}){const t=l.useRef(),n=l.useRef(),[r,s]=l.useState({isDirty:!1,isValidating:!1,isLoading:dm(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:dm(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...qW(e),formState:r});const o=t.current.control;return o._options=e,j_({subject:o._subjects.state,next:i=>{BI(i,o._proxyFormState,o._updateFormState,!0)&&s({...o._formState})}}),l.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),l.useEffect(()=>{if(o._proxyFormState.isDirty){const i=o._getDirty();i!==r.isDirty&&o._subjects.state.next({isDirty:i})}},[o,r.isDirty]),l.useEffect(()=>{e.values&&!i0(e.values,n.current)?(o._reset(e.values,o._options.resetOptions),n.current=e.values,s(i=>({...i}))):o._resetDefaultValues()},[e.values,o]),l.useEffect(()=>{e.errors&&o._setErrors(e.errors)},[e.errors,o]),l.useEffect(()=>{o._state.mount||(o._updateValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),l.useEffect(()=>{e.shouldUnregister&&o._subjects.values.next({values:o._getWatch()})},[e.shouldUnregister,o]),t.current.formState=UI(r,o),t.current}var aj=function(e,t,n){if(e&&"reportValidity"in e){var r=An(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},ij=function(e,t){var n=function(s){var o=t.fields[s];o&&o.ref&&"reportValidity"in o.ref?aj(o.ref,s,e):o.refs&&o.refs.forEach(function(i){return aj(i,s,e)})};for(var r in t.fields)n(r)},KW=function(e,t){t.shouldUseNativeValidation&&ij(e,t);var n={};for(var r in e){var s=An(t.fields,r),o=Object.assign(e[r]||{},{ref:s&&s.ref});if(GW(t.names||Object.keys(e),r)){var i=Object.assign({},An(n,r));To(i,"root",o),To(n,r,i)}else To(n,r,o)}return n},GW=function(e,t){return e.some(function(n){return n.startsWith(t+".")})},QW=function(e,t){for(var n={};e.length;){var r=e[0],s=r.code,o=r.message,i=r.path.join(".");if(!n[i])if("unionErrors"in r){var u=r.unionErrors[0].errors[0];n[i]={message:u.message,type:u.code}}else n[i]={message:o,type:s};if("unionErrors"in r&&r.unionErrors.forEach(function(v){return v.errors.forEach(function(w){return e.push(w)})}),t){var p=n[i].types,g=p&&p[r.code];n[i]=qI(i,t,n,s,g?[].concat(g,r.message):r.message)}e.shift()}return n},mc=function(e,t,n){return n===void 0&&(n={}),function(r,s,o){try{return Promise.resolve(function(i,u){try{var p=Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(g){return o.shouldUseNativeValidation&&ij({},o),{errors:{},values:n.raw?r:g}})}catch(g){return u(g)}return p&&p.then?p.then(void 0,u):p}(0,function(i){if(function(u){return u.errors!=null}(i))return{values:{},errors:KW(QW(i.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw i}))}catch(i){return Promise.reject(i)}}};const YW="Label",lj=(0,l.forwardRef)((e,t)=>(0,l.createElement)(zn.label,(0,Je.A)({},e,{ref:t,onMouseDown:n=>{var r;(r=e.onMouseDown)===null||r===void 0||r.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault()}}))),cj=lj,XW=Nl("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Fp=l.forwardRef(({className:e,...t},n)=>(0,a.jsx)(cj,{ref:n,className:st(XW(),e),...t}));Fp.displayName=cj.displayName;const U_=Nl("text-sm text-red-700 dark:text-red-500"),gc=NW,uj=l.createContext({}),Jr=({...e})=>{const t=l.useMemo(()=>({name:e.name}),[e.name]);return(0,a.jsx)(uj.Provider,{value:t,children:(0,a.jsx)(DW,{...e})})},B_=()=>{const e=l.useContext(uj),t=l.useContext(dj),{getFieldState:n,formState:r}=xa(),s=n(e.name,r);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:o}=t;return{id:o,name:e.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...s}},dj=l.createContext({}),qr=l.forwardRef(({className:e,...t},n)=>{const r=l.useId(),s=l.useMemo(()=>({id:r}),[r]);return(0,a.jsx)(dj.Provider,{value:s,children:(0,a.jsx)("div",{ref:n,className:st("space-y-2",e),...t})})});qr.displayName="FormItem";const As=l.forwardRef(({className:e,...t},n)=>{const{error:r,formItemId:s}=B_();return(0,a.jsx)(Fp,{ref:n,className:st("text-sm font-semibold text-gray-900 dark:text-slate-200",r&&"text-red-600 dark:text-red-600",e),htmlFor:s,...t})});As.displayName="FormLabel";const Kr=l.forwardRef(({...e},t)=>{const{error:n,formItemId:r,formDescriptionId:s,formMessageId:o}=B_();return(0,a.jsx)(Qa,{ref:t,id:r,"aria-describedby":n?`${s} ${o}`:`${s}`,"aria-invalid":!!n,...e})});Kr.displayName="FormControl";const mT=l.forwardRef(({className:e,...t},n)=>{const{formDescriptionId:r}=B_();return(0,a.jsx)("p",{ref:n,id:r,className:st("text-sm text-muted-foreground",e),...t})});mT.displayName="FormDescription";const Cs=l.forwardRef(({className:e,children:t,...n},r)=>{const{t:s}=(0,z.Bd)(),{error:o,formMessageId:i}=B_(),u=o?.message?s(`${o?.message?.toString()}`)||String(o?.message):"",p=o?u:t;return p?(0,a.jsx)("p",{ref:r,id:i,className:st(U_(),e),...n,children:p}):null});Cs.displayName="FormMessage";const _a=l.forwardRef(({className:e,type:t="text",placeholder:n,value:r,...s},o)=>(0,a.jsx)("input",{type:t,className:st("w-full text-sm rounded-md border border-slate-300 px-3 py-1.5 placeholder:text-gray-400 text-slate-900","dark:border-gray-700 dark:bg-slate-950 dark:text-slate-200 dark:placeholder:text-gray-600","disabled:bg-slate-100 disabled:select-none",e),ref:o,placeholder:n??"",value:r??"",...s}));_a.displayName="Input";const gT="Radio",[ZW,fj]=va(gT),[JW,eq]=ZW(gT),pj=(0,l.forwardRef)((e,t)=>{const{__scopeRadio:n,name:r,checked:s=!1,required:o,disabled:i,value:u="on",onCheck:p,...g}=e,[v,w]=(0,l.useState)(null),x=Lr(t,k=>w(k)),E=(0,l.useRef)(!1),R=v?Boolean(v.closest("form")):!0;return(0,l.createElement)(JW,{scope:n,checked:s,disabled:i},(0,l.createElement)(zn.button,(0,Je.A)({type:"button",role:"radio","aria-checked":s,"data-state":gj(s),"data-disabled":i?"":void 0,disabled:i,value:u},g,{ref:x,onClick:gn(e.onClick,k=>{s||p?.(),R&&(E.current=k.isPropagationStopped(),E.current||k.stopPropagation())})})),R&&(0,l.createElement)(tq,{control:v,bubbles:!E.current,name:r,value:u,checked:s,required:o,disabled:i,style:{transform:"translateX(-100%)"}}))}),hj="RadioIndicator",mj=(0,l.forwardRef)((e,t)=>{const{__scopeRadio:n,forceMount:r,...s}=e,o=eq(hj,n);return(0,l.createElement)(la,{present:r||o.checked},(0,l.createElement)(zn.span,(0,Je.A)({"data-state":gj(o.checked),"data-disabled":o.disabled?"":void 0},s,{ref:t})))}),tq=e=>{const{control:t,checked:n,bubbles:r=!0,...s}=e,o=(0,l.useRef)(null),i=Db(n),u=Wv(t);return(0,l.useEffect)(()=>{const p=o.current,g=window.HTMLInputElement.prototype,w=Object.getOwnPropertyDescriptor(g,"checked").set;if(i!==n&&w){const x=new Event("click",{bubbles:r});w.call(p,n),p.dispatchEvent(x)}},[i,n,r]),(0,l.createElement)("input",(0,Je.A)({type:"radio","aria-hidden":!0,defaultChecked:n},s,{tabIndex:-1,ref:o,style:{...e.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function gj(e){return e?"checked":"unchecked"}const nq=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],vT="RadioGroup",[rq,fpe]=va(vT,[iy,fj]),vj=iy(),yj=fj(),[sq,oq]=rq(vT),bj=(0,l.forwardRef)((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:s,value:o,required:i=!1,disabled:u=!1,orientation:p,dir:g,loop:v=!0,onValueChange:w,...x}=e,E=vj(n),R=lm(g),[k,N]=si({prop:o,defaultProp:s,onChange:w});return(0,l.createElement)(sq,{scope:n,name:r,required:i,disabled:u,value:k,onValueChange:N},(0,l.createElement)(BE,(0,Je.A)({asChild:!0},E,{orientation:p,dir:R,loop:v}),(0,l.createElement)(zn.div,(0,Je.A)({role:"radiogroup","aria-required":i,"aria-orientation":p,"data-disabled":u?"":void 0,dir:R},x,{ref:t}))))}),wj="RadioGroupItem",xj=(0,l.forwardRef)((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...s}=e,o=oq(wj,n),i=o.disabled||r,u=vj(n),p=yj(n),g=(0,l.useRef)(null),v=Lr(t,g),w=o.value===s.value,x=(0,l.useRef)(!1);return(0,l.useEffect)(()=>{const E=k=>{nq.includes(k.key)&&(x.current=!0)},R=()=>x.current=!1;return document.addEventListener("keydown",E),document.addEventListener("keyup",R),()=>{document.removeEventListener("keydown",E),document.removeEventListener("keyup",R)}},[]),(0,l.createElement)(VE,(0,Je.A)({asChild:!0},u,{focusable:!i,active:w}),(0,l.createElement)(pj,(0,Je.A)({disabled:i,required:o.required,checked:w},p,s,{name:o.name,ref:v,onCheck:()=>o.onValueChange(s.value),onKeyDown:gn(E=>{E.key==="Enter"&&E.preventDefault()}),onFocus:gn(s.onFocus,()=>{var E;x.current&&((E=g.current)===null||E===void 0||E.click())})})))}),aq="RadioGroupIndicator",_j=(0,l.forwardRef)((e,t)=>{const{__scopeRadioGroup:n,...r}=e,s=yj(n);return(0,l.createElement)(mj,(0,Je.A)({},s,r,{ref:t}))}),Sj=bj,Cj=xj,iq=_j,Ej=l.forwardRef(({className:e,...t},n)=>(0,a.jsx)(Sj,{className:st("grid",e),...t,ref:n}));Ej.displayName=Sj.displayName;/**
 * @license lucide-react v0.330.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */var lq={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
 * @license lucide-react v0.330.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const cq=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),l0=(e,t)=>{const n=(0,l.forwardRef)(({color:r="currentColor",size:s=24,strokeWidth:o=2,absoluteStrokeWidth:i,className:u="",children:p,...g},v)=>(0,l.createElement)("svg",{ref:v,...lq,width:s,height:s,stroke:r,strokeWidth:i?Number(o)*24/Number(s):o,className:["lucide",`lucide-${cq(e)}`,u].join(" "),...g},[...t.map(([w,x])=>(0,l.createElement)(w,x)),...Array.isArray(p)?p:[p]]));return n.displayName=`${e}`,n};/**
 * @license lucide-react v0.330.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Tj=l0("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),kj=l.forwardRef(({className:e,...t},n)=>(0,a.jsx)(Cj,{ref:n,className:st("aspect-square h-4 w-4 rounded-full border border-slate-300 ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:(0,a.jsx)(iq,{className:"flex items-center justify-center",children:(0,a.jsx)(Tj,{className:"h-2 rounded-full fill-white text-white"})})}));kj.displayName=Cj.displayName;const uq=({label:e,field:t,options:n,color:r="indigo"})=>{const s=xa();return(0,a.jsx)(Jr,{control:s.control,name:t,render:({field:o})=>(0,a.jsxs)(qr,{children:[(0,a.jsx)(As,{children:e}),(0,a.jsx)(Kr,{children:(0,a.jsx)(Ej,{onValueChange:o.onChange,defaultValue:o.value,className:"flex flex-col",children:n.map(i=>(0,a.jsx)(qr,{className:"border-x border-t border-slate-300 first:rounded-t last:rounded-b last:border","data-testid":i.dataTestId,children:(0,a.jsxs)(As,{className:st("flex space-x-3 rounded-[inherit] border-inherit p-4 hover:cursor-pointer",{[`bg-${r}-100`]:i.value===o.value}),children:[(0,a.jsx)(Kr,{children:(0,a.jsx)(kj,{className:i.value===o.value?`bg-${r}-500`:"",value:i.value})}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("div",{className:st("font-medium leading-4 text-gray-800 dark:text-slate-200",{"dark:text-gray-900":i.value===o.value}),children:i.title}),(0,a.jsx)("div",{className:"text-xs font-normal text-slate-500",children:i.description})]})]})},i.value))})}),(0,a.jsx)(Cs,{})]})})},Rj=l.forwardRef(({containerClassName:e="",children:t,...n},r)=>(0,a.jsxs)("div",{className:st("flex flex-row",e),children:[(0,a.jsx)(_a,{ref:r,...n}),t]}));Rj.displayName="FormInputWithChildren";/**
 * @license lucide-react v0.330.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Pj=l0("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),dq=(0,l.forwardRef)(({placeholder:e,tags:t,setTags:n,className:r="",...s},o)=>{const[i,u]=(0,l.useState)(""),p=w=>u(w.target.value),g=w=>{if(w.key==="Enter"||w.key===","){w.preventDefault();const x=i.trim();x&&!t.includes(x)&&n([...t,x]),u("")}},v=w=>n(t.filter(x=>x!==w));return(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:`flex w-full flex-wrap gap-2 rounded-md ${t.length!==0?"mb-2":""}`,children:t.map(w=>(0,a.jsxs)("span",{className:"inline-flex h-8 items-center rounded-md border bg-indigo-600 pl-2 text-sm text-white hover:bg-indigo-700",children:[w,(0,a.jsx)(mn,{type:"button",variant:"None",onClick:()=>v(w),"data-testid":"remove-tag",className:st("p-2 text-white h-full"),children:(0,a.jsx)(Pj,{size:16})})]},w))}),(0,a.jsx)(_a,{...s,ref:o,type:"text",placeholder:e,value:i,onChange:p,onKeyDown:g,className:r})]})});dq.displayName="TagInput";const ppe=({dataTestId:e,disabled:t=!1,fieldName:n,label:r,placeholder:s="",tags:o=[]})=>{const i=useFormContext(),[u,p]=useState(o),g=async v=>{p(v),i.setValue(n,v),await i.trigger(n,{shouldFocus:!0})};return jsx(FormField,{control:i.control,name:n,render:({field:v})=>jsxs(FormItem,{className:"w-full",children:[jsx(FormLabel,{children:r}),jsx(FormControl,{children:jsx(TagInput,{...v,"data-testid":e,placeholder:s,tags:u,disabled:t,setTags:async w=>{await g(w)}})}),jsx(FormMessage,{})]})})};/**
 * @license lucide-react v0.330.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const fq=l0("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),Di=({Icon:e,mobileView:t,variant:n="primary",size:r="sm",className:s="h-full",isLoading:o,loaderDataTestId:i="loader",loaderClassName:u="mr-2 h-4 w-4",dataTestId:p="btnLoader",loadingChildren:g,onClick:v,children:w,...x})=>{const{t:E}=(0,z.Bd)(),R=()=>{const k=(0,a.jsx)(fq,{className:`${u} animate-spin`,"data-testid":i});return o?t?k:(0,a.jsxs)(a.Fragment,{children:[k,g??w??E("core:loader.loading")]}):t&&e?(0,a.jsx)(e,{className:"h-4 w-4","data-testid":"loaderMobileIcon"}):(0,a.jsx)(a.Fragment,{children:w??E("core:loader.title")})};return(0,a.jsx)(mn,{variant:n,size:r,className:s,"data-testid":p,onClick:v,disabled:o,...x,children:R()})},V_=({disabled:e=!1,showLoader:t=!1,children:n})=>{const{t:r}=(0,z.Bd)(),s=n??r("rsp:pages.settings.labels.save");return(0,a.jsxs)("div",{className:"grid-col-1 grid gap-y-4 md:grid-cols-2 md:gap-y-0",children:[(0,a.jsx)("div",{className:"w-full sm:w-9/12"}),(0,a.jsx)("div",{className:"w-full",children:(0,a.jsx)(Di,{type:"submit",disabled:e,className:"col-start-2 w-full sm:w-1/2",dataTestId:"saveSettings",isLoading:t,loadingChildren:s,children:s})})]})},Xb=({children:e,className:t,onSubmit:n})=>(0,a.jsx)("form",{onSubmit:n,className:st("my-4 flex flex-col gap-y-16 rounded-xl p-4 dark:bg-slate-900 md:px-8 md:py-16",t),children:e}),pq=({children:e,className:t=""})=>(0,a.jsx)("div",{className:st("grid-col-1 grid gap-y-4 md:grid-cols-2 md:gap-y-0",t),children:e}),hq=({leftContent:e,children:t,contentContainerClassName:n=""})=>(0,a.jsxs)(a.Fragment,{children:[e,(0,a.jsx)("div",{className:"w-full",children:(0,a.jsx)("div",{className:"flex flex-col gap-8",children:(0,a.jsx)("div",{className:st("grid grid-cols-1 gap-y-4",n),children:t})})})]}),mq=({leftContent:e,children:t,contentContainerClassName:n=""})=>(0,a.jsxs)(a.Fragment,{children:[e,(0,a.jsx)("div",{className:"w-full",children:(0,a.jsx)("div",{className:"flex flex-col gap-8",children:(0,a.jsx)(xo,{padded:!1,className:st("grid grid-cols-1 gap-y-4 p-6",n),children:t})})})]}),gq=({label:e,subLabel:t})=>(0,a.jsxs)("div",{className:"flex w-full flex-col gap-y-1 sm:w-9/12",children:[(0,a.jsx)("label",{className:"font-semibold","data-testid":"textFormLabel",children:e}),(0,a.jsx)("div",{className:"text-xs text-gray-500 dark:text-slate-300","data-testid":"textFormSubLabel",children:t})]});Xb.Row=hq,Xb.RowCard=mq,Xb.LeftContent=gq,Xb.Wrapper=pq;const Sa=Xb,Oj={enabled:!1,companyName:"",clientId:"",privateApiKey:"",publicApiKey:"",url:""},vq="https://docs.connectwise.com/ConnectWise_Documentation/090/040/010/010/060",Nj=({className:e="",children:t})=>{const{t:n}=(0,z.Bd)();return(0,a.jsx)(Sa.Wrapper,{children:(0,a.jsx)(Sa.RowCard,{contentContainerClassName:st("md:max-w-md max-w-full bg-white/50 gap-y-2 dark:bg-slate-950",e),leftContent:(0,a.jsx)(Sa.LeftContent,{label:n("rsp:pages.integrations.helpdesk.connectWise.apiInformation.configuration.title"),subLabel:(0,a.jsx)(z.x6,{i18nKey:"rsp:pages.integrations.helpdesk.connectWise.apiInformation.configuration.description",children:(0,a.jsx)(ka,{to:vq,target:"_blank","data-testid":"linkApiInformationHelp",className:"font-semibold text-indigo-600 hover:underline"})})}),children:t})})},yq=({apiInformation:e,onEditMode:t})=>{const{t:n}=(0,z.Bd)(),r=xa(),[s]=r.watch(["enabled"]);return s?(0,a.jsxs)(Nj,{children:[(0,a.jsx)(fc,{children:(0,a.jsx)(Pn,{variant:"body1",weight:"semiBold","data-testid":"textConnectWiseCompanyName",children:e?.companyName})}),(0,a.jsx)(fc,{children:(0,a.jsxs)(Pn,{colors:"light",variant:"body2","data-testid":"textConnectWisePublicKey",children:[n("rsp:pages.integrations.helpdesk.connectWise.apiInformation.configuration.publicKey")," ",e?.publicApiKey]})}),(0,a.jsx)("div",{className:"flex justify-end pt-6",children:(0,a.jsx)(mn,{variant:"None",className:"bg-indigo-600 px-4 py-2 hover:bg-indigo-700",onClick:()=>{t(e)},"data-testid":"btnApiInformationReset",children:n("rsp:actions.reset")})})]}):null},bq=()=>{const{t:e}=(0,z.Bd)(),t=xa();return(0,a.jsx)(Sa.Wrapper,{children:(0,a.jsx)(Sa.Row,{leftContent:(0,a.jsx)(Sa.LeftContent,{label:e("rsp:pages.integrations.helpdesk.connectWise.apiInformation.enabled.title"),subLabel:e("rsp:pages.integrations.helpdesk.connectWise.apiInformation.enabled.description")}),children:(0,a.jsx)(Jr,{control:t.control,name:"enabled",render:({field:n})=>(0,a.jsxs)(qr,{className:"settings-form-item",children:[(0,a.jsx)(As,{children:e("rsp:pages.integrations.helpdesk.connectWise.apiInformation.enabled.label")}),(0,a.jsx)(Kr,{className:"settings-form-control",children:(0,a.jsx)(ci,{checked:n.value,onCheckedChange:n.onChange,"data-testid":"switchApiInformationEnabled"})}),(0,a.jsx)(Cs,{})]})})})})};function wq({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"}))}const c0=l.forwardRef(wq);function xq({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}const Zb=l.forwardRef(xq);var $f=(e=>(e.Default="default",e.Info="info",e.Warning="warning",e.Danger="danger",e.Success="success",e))($f||{});const _q=Nl("relative w-full rounded-lg px-4 py-3 pl-10 text-sm [&>svg]:absolute [&>svg]:left-4",{variants:{variant:{default:"bg-gray-100  text-gray-600 dark:bg-gray-500 dark:text-gray-100",info:"bg-indigo-100 text-indigo-600 dark:bg-indigo-500 dark:text-indigo-100",warning:"bg-yellow-100 text-orange-600 dark:bg-yellow-500 dark:text-orange-100",danger:"bg-red-100 text-red-600 dark:bg-red-500 dark:text-red-100",success:"bg-green-100 text-green-600 dark:bg-green-500 dark:text-green-100"}},defaultVariants:{variant:"default"}}),Aj=(0,l.forwardRef)(({className:e,variant:t,...n},r)=>(0,a.jsx)("div",{ref:r,role:"alert",className:st(_q({variant:t}),e),...n}));Aj.displayName="Alert";const Ij=(0,l.forwardRef)(({children:e,className:t,...n},r)=>(0,a.jsx)("h5",{ref:r,className:st("mb-1 font-medium leading-none tracking-tight",t),...n,children:e}));Ij.displayName="AlertTitle";const jj=(0,l.forwardRef)(({className:e,...t},n)=>(0,a.jsx)("div",{ref:n,className:st("text-sm [&_p]:leading-relaxed",e),...t}));jj.displayName="AlertDescription";const Sq=e=>{switch(e){case"info":return c0;case"warning":case"danger":return Td;case"success":return Zb;default:return null}},zp=({title:e,children:t,variant:n,className:r,onClose:s,...o})=>{const i=Sq(n);return(0,a.jsxs)(Aj,{...o,variant:n,className:st("flex items-center",r),children:[i&&(0,a.jsx)(i,{className:"h-4 w-4"}),e&&(0,a.jsx)(Ij,{children:e}),(0,a.jsx)(jj,{className:"grow",children:t}),s&&(0,a.jsxs)(mn,{variant:"none","data-testid":"alert-close-button",size:"small",className:"h-5 w-4 items-center text-inherit",onClick:()=>s(),children:[(0,a.jsx)(su,{className:"h-4 w-4"}),(0,a.jsx)("span",{className:"sr-only",children:"Close"})]})]})},Cq={CONNECTWISE_IN_SUFFICIENT_PERMISSION:"insufficient.api.key.permissions"},Eq=({apiInformationError:e})=>{const{t}=(0,z.Bd)();return!e||e!==Cq.CONNECTWISE_IN_SUFFICIENT_PERMISSION?null:(0,a.jsxs)(zp,{variant:$f.Danger,className:"items-start [&>svg]:top-4","data-testid":"alertConnectWiseApiInformationPermissionError",children:[(0,a.jsx)("div",{className:"mb-2",children:t("rsp:pages.integrations.helpdesk.connectWise.apiInformation.permssionError.title")}),(0,a.jsxs)("ul",{className:"flex list-outside list-disc flex-col gap-2 pl-5 [&_ul]:list-[revert]",children:[(0,a.jsxs)("li",{children:[t("rsp:pages.integrations.helpdesk.connectWise.apiInformation.permssionError.companyPermssion.missing"),(0,a.jsx)("ul",{className:"ml-2",children:(0,a.jsx)("li",{children:t("rsp:pages.integrations.helpdesk.connectWise.apiInformation.permssionError.companyPermssion.label")})})]}),(0,a.jsxs)("li",{children:[t("rsp:pages.integrations.helpdesk.connectWise.apiInformation.permssionError.servicePermission.missing"),(0,a.jsx)("ul",{className:"ml-2",children:(0,a.jsx)("li",{children:t("rsp:pages.integrations.helpdesk.connectWise.apiInformation.permssionError.servicePermission.label")})})]})]})]})},Tq=({isEditMode:e=!1,apiInformation:t,apiInformationMutation:n,onEditMode:r})=>{const{t:s}=(0,z.Bd)(),o=xa(),i=(0,oo.Co)(n?.error),[u]=o.watch(["enabled"]);return u?(0,a.jsxs)(Nj,{className:st("md:max-w-md max-w-full dark:bg-slate-950 py-8",{"pb-12":!e}),children:[(0,a.jsx)(Eq,{apiInformationError:i}),(0,a.jsx)(Jr,{control:o.control,name:"companyName",render:({field:p})=>(0,a.jsxs)(qr,{children:[(0,a.jsx)(As,{children:s("rsp:pages.integrations.helpdesk.connectWise.apiInformation.configuration.fields.companyNameLabel")}),(0,a.jsx)(Kr,{children:(0,a.jsx)(_a,{...p,"data-testid":"inputApiInformationCompanyName",disabled:n?.isLoading,placeholder:s("rsp:pages.integrations.helpdesk.connectWise.apiInformation.configuration.fields.companyNamePlaceholder")})}),(0,a.jsx)(Cs,{})]})}),(0,a.jsx)(Jr,{control:o.control,name:"publicApiKey",render:({field:p})=>(0,a.jsxs)(qr,{children:[(0,a.jsx)(As,{children:s("rsp:pages.integrations.helpdesk.connectWise.apiInformation.configuration.fields.publicApiKeyLabel")}),(0,a.jsx)(Kr,{children:(0,a.jsx)(_a,{...p,"data-testid":"inputApiInformationPublicApiKey",disabled:n?.isLoading,placeholder:s("rsp:pages.integrations.helpdesk.connectWise.apiInformation.configuration.fields.publicApiKeyPlaceholder")})}),(0,a.jsx)(Cs,{})]})}),(0,a.jsx)(Jr,{control:o.control,name:"privateApiKey",render:({field:p})=>(0,a.jsxs)(qr,{children:[(0,a.jsx)(As,{children:s("rsp:pages.integrations.helpdesk.connectWise.apiInformation.configuration.fields.privateApiKeyLabel")}),(0,a.jsx)(Kr,{children:(0,a.jsx)(_a,{...p,"data-testid":"inputApiInformationPrivateApiKey",disabled:n?.isLoading,placeholder:s("rsp:pages.integrations.helpdesk.connectWise.apiInformation.configuration.fields.privateApiKeyPlaceholder")})}),(0,a.jsx)(Cs,{})]})}),(0,a.jsx)(Jr,{control:o.control,name:"clientId",render:({field:p})=>(0,a.jsxs)(qr,{children:[(0,a.jsx)(As,{children:s("rsp:pages.integrations.helpdesk.connectWise.apiInformation.configuration.fields.clientIdLabel")}),(0,a.jsx)(Kr,{children:(0,a.jsx)(_a,{...p,"data-testid":"inputApiInformationClientId",disabled:n?.isLoading,placeholder:s("rsp:pages.integrations.helpdesk.connectWise.apiInformation.configuration.fields.clientIdPlaceholder")})}),(0,a.jsx)(Cs,{})]})}),(0,a.jsx)(Jr,{control:o.control,name:"url",render:({field:p})=>(0,a.jsxs)(qr,{children:[(0,a.jsx)(As,{children:s("rsp:pages.integrations.helpdesk.connectWise.apiInformation.configuration.fields.urlLabel")}),(0,a.jsx)(Kr,{children:(0,a.jsx)(_a,{...p,"data-testid":"inputApiInformationUrl",disabled:n?.isLoading,placeholder:s("rsp:pages.integrations.helpdesk.connectWise.apiInformation.configuration.fields.urlPlaceholder")})}),(0,a.jsx)(Cs,{})]})}),e?(0,a.jsx)("div",{className:"flex justify-end pt-6",children:(0,a.jsx)(mn,{className:"px-4 py-2",variant:No.Outline,onClick:()=>{r(t)},"data-testid":"btnApiInformationCancel",children:s("rsp:actions.cancel")})}):null]}):null},kq=({form:e})=>{const[t,n]=(0,l.useState)(!1),r=(0,l.useCallback)(o=>{o&&e.reset({...o,clientId:o.clientId===PA?"":o.clientId})},[e]),s=(0,l.useCallback)(o=>{e.reset({...Oj,enabled:o?.enabled}),e.clearErrors(),n(i=>!i)},[e]);return{isEditMode:t,onEditMode:s,setFormValues:r,setIsEditMode:n}};var uo;(function(e){e.assertEqual=s=>s;function t(s){}e.assertIs=t;function n(s){throw new Error}e.assertNever=n,e.arrayToEnum=s=>{const o={};for(const i of s)o[i]=i;return o},e.getValidEnumValues=s=>{const o=e.objectKeys(s).filter(u=>typeof s[s[u]]!="number"),i={};for(const u of o)i[u]=s[u];return e.objectValues(i)},e.objectValues=s=>e.objectKeys(s).map(function(o){return s[o]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const o=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&o.push(i);return o},e.find=(s,o)=>{for(const i of s)if(o(i))return i},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function r(s,o=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(uo||(uo={}));var yT;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(yT||(yT={}));const fr=uo.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),fm=e=>{switch(typeof e){case"undefined":return fr.undefined;case"string":return fr.string;case"number":return isNaN(e)?fr.nan:fr.number;case"boolean":return fr.boolean;case"function":return fr.function;case"bigint":return fr.bigint;case"symbol":return fr.symbol;case"object":return Array.isArray(e)?fr.array:e===null?fr.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?fr.promise:typeof Map<"u"&&e instanceof Map?fr.map:typeof Set<"u"&&e instanceof Set?fr.set:typeof Date<"u"&&e instanceof Date?fr.date:fr.object;default:return fr.unknown}},yn=uo.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Rq=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class hu extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(o){return o.message},r={_errors:[]},s=o=>{for(const i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)r._errors.push(n(i));else{let u=r,p=0;for(;p<i.path.length;){const g=i.path[p];p===i.path.length-1?(u[g]=u[g]||{_errors:[]},u[g]._errors.push(n(i))):u[g]=u[g]||{_errors:[]},u=u[g],p++}}};return s(this),r}static assert(t){if(!(t instanceof hu))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,uo.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const s of this.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):r.push(t(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}hu.create=e=>new hu(e);const py=(e,t)=>{let n;switch(e.code){case yn.invalid_type:e.received===fr.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case yn.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,uo.jsonStringifyReplacer)}`;break;case yn.unrecognized_keys:n=`Unrecognized key(s) in object: ${uo.joinValues(e.keys,", ")}`;break;case yn.invalid_union:n="Invalid input";break;case yn.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${uo.joinValues(e.options)}`;break;case yn.invalid_enum_value:n=`Invalid enum value. Expected ${uo.joinValues(e.options)}, received '${e.received}'`;break;case yn.invalid_arguments:n="Invalid function arguments";break;case yn.invalid_return_type:n="Invalid function return type";break;case yn.invalid_date:n="Invalid date";break;case yn.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:uo.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case yn.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case yn.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case yn.custom:n="Invalid input";break;case yn.invalid_intersection_types:n="Intersection results could not be merged";break;case yn.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case yn.not_finite:n="Number must be finite";break;default:n=t.defaultError,uo.assertNever(e)}return{message:n}};let Dj=py;function Pq(e){Dj=e}function H_(){return Dj}const W_=e=>{const{data:t,path:n,errorMaps:r,issueData:s}=e,o=[...n,...s.path||[]],i={...s,path:o};if(s.message!==void 0)return{...s,path:o,message:s.message};let u="";const p=r.filter(g=>!!g).slice().reverse();for(const g of p)u=g(i,{data:t,defaultError:u}).message;return{...s,path:o,message:u}},Oq=[];function ir(e,t){const n=H_(),r=W_({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===py?void 0:py].filter(s=>!!s)});e.common.issues.push(r)}class Fl{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const s of n){if(s.status==="aborted")return bs;s.status==="dirty"&&t.dirty(),r.push(s.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const s of n){const o=await s.key,i=await s.value;r.push({key:o,value:i})}return Fl.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const s of n){const{key:o,value:i}=s;if(o.status==="aborted"||i.status==="aborted")return bs;o.status==="dirty"&&t.dirty(),i.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof i.value<"u"||s.alwaysSet)&&(r[o.value]=i.value)}return{status:t.value,value:r}}}const bs=Object.freeze({status:"aborted"}),hy=e=>({status:"dirty",value:e}),vc=e=>({status:"valid",value:e}),bT=e=>e.status==="aborted",wT=e=>e.status==="dirty",Jb=e=>e.status==="valid",ew=e=>typeof Promise<"u"&&e instanceof Promise;function q_(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)}function Mj(e,t,n,r,s){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?s.call(e,n):s?s.value=n:t.set(e,n),n}typeof SuppressedError=="function"&&SuppressedError;var Vr;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(Vr||(Vr={}));var tw,nw;class Lf{constructor(t,n,r,s){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const $j=(e,t)=>{if(Jb(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new hu(e.common.issues);return this._error=n,this._error}}};function Ms(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:s}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(i,u)=>{var p,g;const{message:v}=e;return i.code==="invalid_enum_value"?{message:v??u.defaultError}:typeof u.data>"u"?{message:(p=v??r)!==null&&p!==void 0?p:u.defaultError}:i.code!=="invalid_type"?{message:u.defaultError}:{message:(g=v??n)!==null&&g!==void 0?g:u.defaultError}},description:s}}class Hs{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return fm(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:fm(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Fl,ctx:{common:t.parent.common,data:t.data,parsedType:fm(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(ew(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const s={common:{issues:[],async:(r=n?.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:fm(t)},o=this._parseSync({data:t,path:s.path,parent:s});return $j(s,o)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:fm(t)},s=this._parse({data:t,path:r.path,parent:r}),o=await(ew(s)?s:Promise.resolve(s));return $j(r,o)}refine(t,n){const r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,o)=>{const i=t(s),u=()=>o.addIssue({code:yn.custom,...r(s)});return typeof Promise<"u"&&i instanceof Promise?i.then(p=>p?!0:(u(),!1)):i?!0:(u(),!1)})}refinement(t,n){return this._refinement((r,s)=>t(r)?!0:(s.addIssue(typeof n=="function"?n(r,s):n),!1))}_refinement(t){return new Id({schema:this,typeName:gs.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return zf.create(this,this._def)}nullable(){return gm.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ad.create(this,this._def)}promise(){return yy.create(this,this._def)}or(t){return aw.create([this,t],this._def)}and(t){return iw.create(this,t,this._def)}transform(t){return new Id({...Ms(this._def),schema:this,typeName:gs.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new fw({...Ms(this._def),innerType:this,defaultValue:n,typeName:gs.ZodDefault})}brand(){return new ST({typeName:gs.ZodBranded,type:this,...Ms(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new pw({...Ms(this._def),innerType:this,catchValue:n,typeName:gs.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return hw.create(this,t)}readonly(){return mw.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Nq=/^c[^\s-]{8,}$/i,Aq=/^[0-9a-z]+$/,Iq=/^[0-9A-HJKMNP-TV-Z]{26}$/,jq=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Dq=/^[a-z0-9_-]{21}$/i,Mq=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,$q=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Lq="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let xT;const Fq=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,zq=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Uq=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Lj="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Bq=new RegExp(`^${Lj}$`);function Fj(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function Vq(e){return new RegExp(`^${Fj(e)}$`)}function zj(e){let t=`${Lj}T${Fj(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function Hq(e,t){return!!((t==="v4"||!t)&&Fq.test(e)||(t==="v6"||!t)&&zq.test(e))}class Nd extends Hs{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==fr.string){const o=this._getOrReturnCtx(t);return ir(o,{code:yn.invalid_type,expected:fr.string,received:o.parsedType}),bs}const r=new Fl;let s;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(s=this._getOrReturnCtx(t,s),ir(s,{code:yn.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")t.data.length>o.value&&(s=this._getOrReturnCtx(t,s),ir(s,{code:yn.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const i=t.data.length>o.value,u=t.data.length<o.value;(i||u)&&(s=this._getOrReturnCtx(t,s),i?ir(s,{code:yn.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):u&&ir(s,{code:yn.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")$q.test(t.data)||(s=this._getOrReturnCtx(t,s),ir(s,{validation:"email",code:yn.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")xT||(xT=new RegExp(Lq,"u")),xT.test(t.data)||(s=this._getOrReturnCtx(t,s),ir(s,{validation:"emoji",code:yn.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")jq.test(t.data)||(s=this._getOrReturnCtx(t,s),ir(s,{validation:"uuid",code:yn.invalid_string,message:o.message}),r.dirty());else if(o.kind==="nanoid")Dq.test(t.data)||(s=this._getOrReturnCtx(t,s),ir(s,{validation:"nanoid",code:yn.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")Nq.test(t.data)||(s=this._getOrReturnCtx(t,s),ir(s,{validation:"cuid",code:yn.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")Aq.test(t.data)||(s=this._getOrReturnCtx(t,s),ir(s,{validation:"cuid2",code:yn.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")Iq.test(t.data)||(s=this._getOrReturnCtx(t,s),ir(s,{validation:"ulid",code:yn.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),ir(s,{validation:"url",code:yn.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),ir(s,{validation:"regex",code:yn.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(s=this._getOrReturnCtx(t,s),ir(s,{code:yn.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(s=this._getOrReturnCtx(t,s),ir(s,{code:yn.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(s=this._getOrReturnCtx(t,s),ir(s,{code:yn.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?zj(o).test(t.data)||(s=this._getOrReturnCtx(t,s),ir(s,{code:yn.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="date"?Bq.test(t.data)||(s=this._getOrReturnCtx(t,s),ir(s,{code:yn.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?Vq(o).test(t.data)||(s=this._getOrReturnCtx(t,s),ir(s,{code:yn.invalid_string,validation:"time",message:o.message}),r.dirty()):o.kind==="duration"?Mq.test(t.data)||(s=this._getOrReturnCtx(t,s),ir(s,{validation:"duration",code:yn.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?Hq(t.data,o.version)||(s=this._getOrReturnCtx(t,s),ir(s,{validation:"ip",code:yn.invalid_string,message:o.message}),r.dirty()):o.kind==="base64"?Uq.test(t.data)||(s=this._getOrReturnCtx(t,s),ir(s,{validation:"base64",code:yn.invalid_string,message:o.message}),r.dirty()):uo.assertNever(o);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(s=>t.test(s),{validation:n,code:yn.invalid_string,...Vr.errToObj(r)})}_addCheck(t){return new Nd({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Vr.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Vr.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Vr.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Vr.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Vr.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Vr.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Vr.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Vr.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Vr.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Vr.errToObj(t)})}datetime(t){var n,r;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:(n=t?.offset)!==null&&n!==void 0?n:!1,local:(r=t?.local)!==null&&r!==void 0?r:!1,...Vr.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...Vr.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...Vr.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Vr.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...Vr.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Vr.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Vr.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Vr.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Vr.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Vr.errToObj(n)})}nonempty(t){return this.min(1,Vr.errToObj(t))}trim(){return new Nd({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Nd({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Nd({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Nd.create=e=>{var t;return new Nd({checks:[],typeName:gs.ZodString,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...Ms(e)})};function Wq(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,s=n>r?n:r,o=parseInt(e.toFixed(s).replace(".","")),i=parseInt(t.toFixed(s).replace(".",""));return o%i/Math.pow(10,s)}class pm extends Hs{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==fr.number){const o=this._getOrReturnCtx(t);return ir(o,{code:yn.invalid_type,expected:fr.number,received:o.parsedType}),bs}let r;const s=new Fl;for(const o of this._def.checks)o.kind==="int"?uo.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),ir(r,{code:yn.invalid_type,expected:"integer",received:"float",message:o.message}),s.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),ir(r,{code:yn.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),ir(r,{code:yn.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="multipleOf"?Wq(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),ir(r,{code:yn.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),ir(r,{code:yn.not_finite,message:o.message}),s.dirty()):uo.assertNever(o);return{status:s.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Vr.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Vr.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Vr.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Vr.toString(n))}setLimit(t,n,r,s){return new pm({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Vr.toString(s)}]})}_addCheck(t){return new pm({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Vr.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Vr.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Vr.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Vr.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Vr.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Vr.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Vr.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Vr.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Vr.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&uo.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}pm.create=e=>new pm({checks:[],typeName:gs.ZodNumber,coerce:e?.coerce||!1,...Ms(e)});class hm extends Hs{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==fr.bigint){const o=this._getOrReturnCtx(t);return ir(o,{code:yn.invalid_type,expected:fr.bigint,received:o.parsedType}),bs}let r;const s=new Fl;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),ir(r,{code:yn.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),ir(r,{code:yn.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),ir(r,{code:yn.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):uo.assertNever(o);return{status:s.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Vr.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Vr.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Vr.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Vr.toString(n))}setLimit(t,n,r,s){return new hm({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Vr.toString(s)}]})}_addCheck(t){return new hm({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Vr.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Vr.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Vr.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Vr.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Vr.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}hm.create=e=>{var t;return new hm({checks:[],typeName:gs.ZodBigInt,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...Ms(e)})};class rw extends Hs{_parse(t){if(this._def.coerce&&(t.data=Boolean(t.data)),this._getType(t)!==fr.boolean){const r=this._getOrReturnCtx(t);return ir(r,{code:yn.invalid_type,expected:fr.boolean,received:r.parsedType}),bs}return vc(t.data)}}rw.create=e=>new rw({typeName:gs.ZodBoolean,coerce:e?.coerce||!1,...Ms(e)});class u0 extends Hs{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==fr.date){const o=this._getOrReturnCtx(t);return ir(o,{code:yn.invalid_type,expected:fr.date,received:o.parsedType}),bs}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return ir(o,{code:yn.invalid_date}),bs}const r=new Fl;let s;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(s=this._getOrReturnCtx(t,s),ir(s,{code:yn.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(s=this._getOrReturnCtx(t,s),ir(s,{code:yn.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):uo.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new u0({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Vr.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Vr.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}u0.create=e=>new u0({checks:[],coerce:e?.coerce||!1,typeName:gs.ZodDate,...Ms(e)});class K_ extends Hs{_parse(t){if(this._getType(t)!==fr.symbol){const r=this._getOrReturnCtx(t);return ir(r,{code:yn.invalid_type,expected:fr.symbol,received:r.parsedType}),bs}return vc(t.data)}}K_.create=e=>new K_({typeName:gs.ZodSymbol,...Ms(e)});class sw extends Hs{_parse(t){if(this._getType(t)!==fr.undefined){const r=this._getOrReturnCtx(t);return ir(r,{code:yn.invalid_type,expected:fr.undefined,received:r.parsedType}),bs}return vc(t.data)}}sw.create=e=>new sw({typeName:gs.ZodUndefined,...Ms(e)});class ow extends Hs{_parse(t){if(this._getType(t)!==fr.null){const r=this._getOrReturnCtx(t);return ir(r,{code:yn.invalid_type,expected:fr.null,received:r.parsedType}),bs}return vc(t.data)}}ow.create=e=>new ow({typeName:gs.ZodNull,...Ms(e)});class my extends Hs{constructor(){super(...arguments),this._any=!0}_parse(t){return vc(t.data)}}my.create=e=>new my({typeName:gs.ZodAny,...Ms(e)});class d0 extends Hs{constructor(){super(...arguments),this._unknown=!0}_parse(t){return vc(t.data)}}d0.create=e=>new d0({typeName:gs.ZodUnknown,...Ms(e)});class Up extends Hs{_parse(t){const n=this._getOrReturnCtx(t);return ir(n,{code:yn.invalid_type,expected:fr.never,received:n.parsedType}),bs}}Up.create=e=>new Up({typeName:gs.ZodNever,...Ms(e)});class G_ extends Hs{_parse(t){if(this._getType(t)!==fr.undefined){const r=this._getOrReturnCtx(t);return ir(r,{code:yn.invalid_type,expected:fr.void,received:r.parsedType}),bs}return vc(t.data)}}G_.create=e=>new G_({typeName:gs.ZodVoid,...Ms(e)});class Ad extends Hs{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),s=this._def;if(n.parsedType!==fr.array)return ir(n,{code:yn.invalid_type,expected:fr.array,received:n.parsedType}),bs;if(s.exactLength!==null){const i=n.data.length>s.exactLength.value,u=n.data.length<s.exactLength.value;(i||u)&&(ir(n,{code:i?yn.too_big:yn.too_small,minimum:u?s.exactLength.value:void 0,maximum:i?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(ir(n,{code:yn.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(ir(n,{code:yn.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((i,u)=>s.type._parseAsync(new Lf(n,i,n.path,u)))).then(i=>Fl.mergeArray(r,i));const o=[...n.data].map((i,u)=>s.type._parseSync(new Lf(n,i,n.path,u)));return Fl.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new Ad({...this._def,minLength:{value:t,message:Vr.toString(n)}})}max(t,n){return new Ad({...this._def,maxLength:{value:t,message:Vr.toString(n)}})}length(t,n){return new Ad({...this._def,exactLength:{value:t,message:Vr.toString(n)}})}nonempty(t){return this.min(1,t)}}Ad.create=(e,t)=>new Ad({type:e,minLength:null,maxLength:null,exactLength:null,typeName:gs.ZodArray,...Ms(t)});function gy(e){if(e instanceof Va){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=zf.create(gy(r))}return new Va({...e._def,shape:()=>t})}else return e instanceof Ad?new Ad({...e._def,type:gy(e.element)}):e instanceof zf?zf.create(gy(e.unwrap())):e instanceof gm?gm.create(gy(e.unwrap())):e instanceof Ff?Ff.create(e.items.map(t=>gy(t))):e}class Va extends Hs{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=uo.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==fr.object){const g=this._getOrReturnCtx(t);return ir(g,{code:yn.invalid_type,expected:fr.object,received:g.parsedType}),bs}const{status:r,ctx:s}=this._processInputParams(t),{shape:o,keys:i}=this._getCached(),u=[];if(!(this._def.catchall instanceof Up&&this._def.unknownKeys==="strip"))for(const g in s.data)i.includes(g)||u.push(g);const p=[];for(const g of i){const v=o[g],w=s.data[g];p.push({key:{status:"valid",value:g},value:v._parse(new Lf(s,w,s.path,g)),alwaysSet:g in s.data})}if(this._def.catchall instanceof Up){const g=this._def.unknownKeys;if(g==="passthrough")for(const v of u)p.push({key:{status:"valid",value:v},value:{status:"valid",value:s.data[v]}});else if(g==="strict")u.length>0&&(ir(s,{code:yn.unrecognized_keys,keys:u}),r.dirty());else if(g!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const g=this._def.catchall;for(const v of u){const w=s.data[v];p.push({key:{status:"valid",value:v},value:g._parse(new Lf(s,w,s.path,v)),alwaysSet:v in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const g=[];for(const v of p){const w=await v.key,x=await v.value;g.push({key:w,value:x,alwaysSet:v.alwaysSet})}return g}).then(g=>Fl.mergeObjectSync(r,g)):Fl.mergeObjectSync(r,p)}get shape(){return this._def.shape()}strict(t){return Vr.errToObj,new Va({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var s,o,i,u;const p=(i=(o=(s=this._def).errorMap)===null||o===void 0?void 0:o.call(s,n,r).message)!==null&&i!==void 0?i:r.defaultError;return n.code==="unrecognized_keys"?{message:(u=Vr.errToObj(t).message)!==null&&u!==void 0?u:p}:{message:p}}}:{}})}strip(){return new Va({...this._def,unknownKeys:"strip"})}passthrough(){return new Va({...this._def,unknownKeys:"passthrough"})}extend(t){return new Va({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Va({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:gs.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Va({...this._def,catchall:t})}pick(t){const n={};return uo.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new Va({...this._def,shape:()=>n})}omit(t){const n={};return uo.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new Va({...this._def,shape:()=>n})}deepPartial(){return gy(this)}partial(t){const n={};return uo.objectKeys(this.shape).forEach(r=>{const s=this.shape[r];t&&!t[r]?n[r]=s:n[r]=s.optional()}),new Va({...this._def,shape:()=>n})}required(t){const n={};return uo.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof zf;)o=o._def.innerType;n[r]=o}}),new Va({...this._def,shape:()=>n})}keyof(){return Uj(uo.objectKeys(this.shape))}}Va.create=(e,t)=>new Va({shape:()=>e,unknownKeys:"strip",catchall:Up.create(),typeName:gs.ZodObject,...Ms(t)}),Va.strictCreate=(e,t)=>new Va({shape:()=>e,unknownKeys:"strict",catchall:Up.create(),typeName:gs.ZodObject,...Ms(t)}),Va.lazycreate=(e,t)=>new Va({shape:e,unknownKeys:"strip",catchall:Up.create(),typeName:gs.ZodObject,...Ms(t)});class aw extends Hs{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function s(o){for(const u of o)if(u.result.status==="valid")return u.result;for(const u of o)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;const i=o.map(u=>new hu(u.ctx.common.issues));return ir(n,{code:yn.invalid_union,unionErrors:i}),bs}if(n.common.async)return Promise.all(r.map(async o=>{const i={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:i}),ctx:i}})).then(s);{let o;const i=[];for(const p of r){const g={...n,common:{...n.common,issues:[]},parent:null},v=p._parseSync({data:n.data,path:n.path,parent:g});if(v.status==="valid")return v;v.status==="dirty"&&!o&&(o={result:v,ctx:g}),g.common.issues.length&&i.push(g.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const u=i.map(p=>new hu(p));return ir(n,{code:yn.invalid_union,unionErrors:u}),bs}}get options(){return this._def.options}}aw.create=(e,t)=>new aw({options:e,typeName:gs.ZodUnion,...Ms(t)});const Bp=e=>e instanceof cw?Bp(e.schema):e instanceof Id?Bp(e.innerType()):e instanceof uw?[e.value]:e instanceof mm?e.options:e instanceof dw?uo.objectValues(e.enum):e instanceof fw?Bp(e._def.innerType):e instanceof sw?[void 0]:e instanceof ow?[null]:e instanceof zf?[void 0,...Bp(e.unwrap())]:e instanceof gm?[null,...Bp(e.unwrap())]:e instanceof ST||e instanceof mw?Bp(e.unwrap()):e instanceof pw?Bp(e._def.innerType):[];class Q_ extends Hs{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==fr.object)return ir(n,{code:yn.invalid_type,expected:fr.object,received:n.parsedType}),bs;const r=this.discriminator,s=n.data[r],o=this.optionsMap.get(s);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(ir(n,{code:yn.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),bs)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const s=new Map;for(const o of n){const i=Bp(o.shape[t]);if(!i.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const u of i){if(s.has(u))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(u)}`);s.set(u,o)}}return new Q_({typeName:gs.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:s,...Ms(r)})}}function _T(e,t){const n=fm(e),r=fm(t);if(e===t)return{valid:!0,data:e};if(n===fr.object&&r===fr.object){const s=uo.objectKeys(t),o=uo.objectKeys(e).filter(u=>s.indexOf(u)!==-1),i={...e,...t};for(const u of o){const p=_T(e[u],t[u]);if(!p.valid)return{valid:!1};i[u]=p.data}return{valid:!0,data:i}}else if(n===fr.array&&r===fr.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let o=0;o<e.length;o++){const i=e[o],u=t[o],p=_T(i,u);if(!p.valid)return{valid:!1};s.push(p.data)}return{valid:!0,data:s}}else return n===fr.date&&r===fr.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class iw extends Hs{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=(o,i)=>{if(bT(o)||bT(i))return bs;const u=_T(o.value,i.value);return u.valid?((wT(o)||wT(i))&&n.dirty(),{status:n.value,value:u.data}):(ir(r,{code:yn.invalid_intersection_types}),bs)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,i])=>s(o,i)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}iw.create=(e,t,n)=>new iw({left:e,right:t,typeName:gs.ZodIntersection,...Ms(n)});class Ff extends Hs{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==fr.array)return ir(r,{code:yn.invalid_type,expected:fr.array,received:r.parsedType}),bs;if(r.data.length<this._def.items.length)return ir(r,{code:yn.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),bs;!this._def.rest&&r.data.length>this._def.items.length&&(ir(r,{code:yn.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((i,u)=>{const p=this._def.items[u]||this._def.rest;return p?p._parse(new Lf(r,i,r.path,u)):null}).filter(i=>!!i);return r.common.async?Promise.all(o).then(i=>Fl.mergeArray(n,i)):Fl.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new Ff({...this._def,rest:t})}}Ff.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ff({items:e,typeName:gs.ZodTuple,rest:null,...Ms(t)})};class lw extends Hs{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==fr.object)return ir(r,{code:yn.invalid_type,expected:fr.object,received:r.parsedType}),bs;const s=[],o=this._def.keyType,i=this._def.valueType;for(const u in r.data)s.push({key:o._parse(new Lf(r,u,r.path,u)),value:i._parse(new Lf(r,r.data[u],r.path,u)),alwaysSet:u in r.data});return r.common.async?Fl.mergeObjectAsync(n,s):Fl.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Hs?new lw({keyType:t,valueType:n,typeName:gs.ZodRecord,...Ms(r)}):new lw({keyType:Nd.create(),valueType:t,typeName:gs.ZodRecord,...Ms(n)})}}class Y_ extends Hs{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==fr.map)return ir(r,{code:yn.invalid_type,expected:fr.map,received:r.parsedType}),bs;const s=this._def.keyType,o=this._def.valueType,i=[...r.data.entries()].map(([u,p],g)=>({key:s._parse(new Lf(r,u,r.path,[g,"key"])),value:o._parse(new Lf(r,p,r.path,[g,"value"]))}));if(r.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const p of i){const g=await p.key,v=await p.value;if(g.status==="aborted"||v.status==="aborted")return bs;(g.status==="dirty"||v.status==="dirty")&&n.dirty(),u.set(g.value,v.value)}return{status:n.value,value:u}})}else{const u=new Map;for(const p of i){const g=p.key,v=p.value;if(g.status==="aborted"||v.status==="aborted")return bs;(g.status==="dirty"||v.status==="dirty")&&n.dirty(),u.set(g.value,v.value)}return{status:n.value,value:u}}}}Y_.create=(e,t,n)=>new Y_({valueType:t,keyType:e,typeName:gs.ZodMap,...Ms(n)});class f0 extends Hs{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==fr.set)return ir(r,{code:yn.invalid_type,expected:fr.set,received:r.parsedType}),bs;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(ir(r,{code:yn.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&(ir(r,{code:yn.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const o=this._def.valueType;function i(p){const g=new Set;for(const v of p){if(v.status==="aborted")return bs;v.status==="dirty"&&n.dirty(),g.add(v.value)}return{status:n.value,value:g}}const u=[...r.data.values()].map((p,g)=>o._parse(new Lf(r,p,r.path,g)));return r.common.async?Promise.all(u).then(p=>i(p)):i(u)}min(t,n){return new f0({...this._def,minSize:{value:t,message:Vr.toString(n)}})}max(t,n){return new f0({...this._def,maxSize:{value:t,message:Vr.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}f0.create=(e,t)=>new f0({valueType:e,minSize:null,maxSize:null,typeName:gs.ZodSet,...Ms(t)});class vy extends Hs{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==fr.function)return ir(n,{code:yn.invalid_type,expected:fr.function,received:n.parsedType}),bs;function r(u,p){return W_({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,H_(),py].filter(g=>!!g),issueData:{code:yn.invalid_arguments,argumentsError:p}})}function s(u,p){return W_({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,H_(),py].filter(g=>!!g),issueData:{code:yn.invalid_return_type,returnTypeError:p}})}const o={errorMap:n.common.contextualErrorMap},i=n.data;if(this._def.returns instanceof yy){const u=this;return vc(async function(...p){const g=new hu([]),v=await u._def.args.parseAsync(p,o).catch(E=>{throw g.addIssue(r(p,E)),g}),w=await Reflect.apply(i,this,v);return await u._def.returns._def.type.parseAsync(w,o).catch(E=>{throw g.addIssue(s(w,E)),g})})}else{const u=this;return vc(function(...p){const g=u._def.args.safeParse(p,o);if(!g.success)throw new hu([r(p,g.error)]);const v=Reflect.apply(i,this,g.data),w=u._def.returns.safeParse(v,o);if(!w.success)throw new hu([s(v,w.error)]);return w.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new vy({...this._def,args:Ff.create(t).rest(d0.create())})}returns(t){return new vy({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new vy({args:t||Ff.create([]).rest(d0.create()),returns:n||d0.create(),typeName:gs.ZodFunction,...Ms(r)})}}class cw extends Hs{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}cw.create=(e,t)=>new cw({getter:e,typeName:gs.ZodLazy,...Ms(t)});class uw extends Hs{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return ir(n,{received:n.data,code:yn.invalid_literal,expected:this._def.value}),bs}return{status:"valid",value:t.data}}get value(){return this._def.value}}uw.create=(e,t)=>new uw({value:e,typeName:gs.ZodLiteral,...Ms(t)});function Uj(e,t){return new mm({values:e,typeName:gs.ZodEnum,...Ms(t)})}class mm extends Hs{constructor(){super(...arguments),tw.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return ir(n,{expected:uo.joinValues(r),received:n.parsedType,code:yn.invalid_type}),bs}if(q_(this,tw,"f")||Mj(this,tw,new Set(this._def.values),"f"),!q_(this,tw,"f").has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return ir(n,{received:n.data,code:yn.invalid_enum_value,options:r}),bs}return vc(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return mm.create(t,{...this._def,...n})}exclude(t,n=this._def){return mm.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}tw=new WeakMap,mm.create=Uj;class dw extends Hs{constructor(){super(...arguments),nw.set(this,void 0)}_parse(t){const n=uo.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==fr.string&&r.parsedType!==fr.number){const s=uo.objectValues(n);return ir(r,{expected:uo.joinValues(s),received:r.parsedType,code:yn.invalid_type}),bs}if(q_(this,nw,"f")||Mj(this,nw,new Set(uo.getValidEnumValues(this._def.values)),"f"),!q_(this,nw,"f").has(t.data)){const s=uo.objectValues(n);return ir(r,{received:r.data,code:yn.invalid_enum_value,options:s}),bs}return vc(t.data)}get enum(){return this._def.values}}nw=new WeakMap,dw.create=(e,t)=>new dw({values:e,typeName:gs.ZodNativeEnum,...Ms(t)});class yy extends Hs{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==fr.promise&&n.common.async===!1)return ir(n,{code:yn.invalid_type,expected:fr.promise,received:n.parsedType}),bs;const r=n.parsedType===fr.promise?n.data:Promise.resolve(n.data);return vc(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}yy.create=(e,t)=>new yy({type:e,typeName:gs.ZodPromise,...Ms(t)});class Id extends Hs{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===gs.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=this._def.effect||null,o={addIssue:i=>{ir(r,i),i.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),s.type==="preprocess"){const i=s.transform(r.data,o);if(r.common.async)return Promise.resolve(i).then(async u=>{if(n.value==="aborted")return bs;const p=await this._def.schema._parseAsync({data:u,path:r.path,parent:r});return p.status==="aborted"?bs:p.status==="dirty"||n.value==="dirty"?hy(p.value):p});{if(n.value==="aborted")return bs;const u=this._def.schema._parseSync({data:i,path:r.path,parent:r});return u.status==="aborted"?bs:u.status==="dirty"||n.value==="dirty"?hy(u.value):u}}if(s.type==="refinement"){const i=u=>{const p=s.refinement(u,o);if(r.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(r.common.async===!1){const u=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return u.status==="aborted"?bs:(u.status==="dirty"&&n.dirty(),i(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(u=>u.status==="aborted"?bs:(u.status==="dirty"&&n.dirty(),i(u.value).then(()=>({status:n.value,value:u.value}))))}if(s.type==="transform")if(r.common.async===!1){const i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Jb(i))return i;const u=s.transform(i.value,o);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>Jb(i)?Promise.resolve(s.transform(i.value,o)).then(u=>({status:n.value,value:u})):i);uo.assertNever(s)}}Id.create=(e,t,n)=>new Id({schema:e,typeName:gs.ZodEffects,effect:t,...Ms(n)}),Id.createWithPreprocess=(e,t,n)=>new Id({schema:t,effect:{type:"preprocess",transform:e},typeName:gs.ZodEffects,...Ms(n)});class zf extends Hs{_parse(t){return this._getType(t)===fr.undefined?vc(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}zf.create=(e,t)=>new zf({innerType:e,typeName:gs.ZodOptional,...Ms(t)});class gm extends Hs{_parse(t){return this._getType(t)===fr.null?vc(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}gm.create=(e,t)=>new gm({innerType:e,typeName:gs.ZodNullable,...Ms(t)});class fw extends Hs{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===fr.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}fw.create=(e,t)=>new fw({innerType:e,typeName:gs.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ms(t)});class pw extends Hs{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return ew(s)?s.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new hu(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new hu(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}pw.create=(e,t)=>new pw({innerType:e,typeName:gs.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ms(t)});class X_ extends Hs{_parse(t){if(this._getType(t)!==fr.nan){const r=this._getOrReturnCtx(t);return ir(r,{code:yn.invalid_type,expected:fr.nan,received:r.parsedType}),bs}return{status:"valid",value:t.data}}}X_.create=e=>new X_({typeName:gs.ZodNaN,...Ms(e)});const qq=Symbol("zod_brand");class ST extends Hs{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class hw extends Hs{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?bs:o.status==="dirty"?(n.dirty(),hy(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?bs:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(t,n){return new hw({in:t,out:n,typeName:gs.ZodPipeline})}}class mw extends Hs{_parse(t){const n=this._def.innerType._parse(t),r=s=>(Jb(s)&&(s.value=Object.freeze(s.value)),s);return ew(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}mw.create=(e,t)=>new mw({innerType:e,typeName:gs.ZodReadonly,...Ms(t)});function Z_(e,t={},n){return e?my.create().superRefine((r,s)=>{var o,i;if(!e(r)){const u=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,p=(i=(o=u.fatal)!==null&&o!==void 0?o:n)!==null&&i!==void 0?i:!0,g=typeof u=="string"?{message:u}:u;s.addIssue({code:"custom",...g,fatal:p})}}):my.create()}const Kq={object:Va.lazycreate};var gs;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(gs||(gs={}));const Gq=(e,t={message:`Input not instance of ${e.name}`})=>Z_(n=>n instanceof e,t),Ds=Nd.create,Bj=pm.create,Qq=X_.create,Yq=hm.create,Ia=rw.create,Xq=u0.create,Zq=K_.create,Jq=sw.create,eK=ow.create,tK=my.create,nK=d0.create,rK=Up.create,sK=G_.create,CT=Ad.create,tl=Va.create,oK=Va.strictCreate,aK=aw.create,iK=Q_.create,lK=iw.create,cK=Ff.create,gw=lw.create,uK=Y_.create,dK=f0.create,fK=vy.create,pK=cw.create,ET=uw.create,hK=mm.create,Vj=dw.create,mK=yy.create,Hj=Id.create,gK=zf.create,vK=gm.create,Wj=Id.createWithPreprocess,yK=hw.create;var Spe=Object.freeze({__proto__:null,defaultErrorMap:py,setErrorMap:Pq,getErrorMap:H_,makeIssue:W_,EMPTY_PATH:Oq,addIssueToContext:ir,ParseStatus:Fl,INVALID:bs,DIRTY:hy,OK:vc,isAborted:bT,isDirty:wT,isValid:Jb,isAsync:ew,get util(){return uo},get objectUtil(){return yT},ZodParsedType:fr,getParsedType:fm,ZodType:Hs,datetimeRegex:zj,ZodString:Nd,ZodNumber:pm,ZodBigInt:hm,ZodBoolean:rw,ZodDate:u0,ZodSymbol:K_,ZodUndefined:sw,ZodNull:ow,ZodAny:my,ZodUnknown:d0,ZodNever:Up,ZodVoid:G_,ZodArray:Ad,ZodObject:Va,ZodUnion:aw,ZodDiscriminatedUnion:Q_,ZodIntersection:iw,ZodTuple:Ff,ZodRecord:lw,ZodMap:Y_,ZodSet:f0,ZodFunction:vy,ZodLazy:cw,ZodLiteral:uw,ZodEnum:mm,ZodNativeEnum:dw,ZodPromise:yy,ZodEffects:Id,ZodTransformer:Id,ZodOptional:zf,ZodNullable:gm,ZodDefault:fw,ZodCatch:pw,ZodNaN:X_,BRAND:qq,ZodBranded:ST,ZodPipeline:hw,ZodReadonly:mw,custom:Z_,Schema:Hs,ZodSchema:Hs,late:Kq,get ZodFirstPartyTypeKind(){return gs},coerce:{string:e=>Nd.create({...e,coerce:!0}),number:e=>pm.create({...e,coerce:!0}),boolean:e=>rw.create({...e,coerce:!0}),bigint:e=>hm.create({...e,coerce:!0}),date:e=>u0.create({...e,coerce:!0})},any:tK,array:CT,bigint:Yq,boolean:Ia,date:Xq,discriminatedUnion:iK,effect:Hj,enum:hK,function:fK,instanceof:Gq,intersection:lK,lazy:pK,literal:ET,map:uK,nan:Qq,nativeEnum:Vj,never:rK,null:eK,nullable:vK,number:Bj,object:tl,oboolean:()=>Ia().optional(),onumber:()=>Bj().optional(),optional:gK,ostring:()=>Ds().optional(),pipeline:yK,preprocess:Wj,promise:mK,record:gw,set:dK,strictObject:oK,string:Ds,symbol:Zq,transformer:Hj,tuple:cK,undefined:Jq,union:aK,unknown:nK,void:sK,NEVER:bs,ZodIssueCode:yn,quotelessJson:Rq,ZodError:hu});const yc=e=>Wj(t=>t===null||typeof t=="string"&&t===""?void 0:t,e.optional()),bK=e=>[{id:"companyName",value:e.companyName},{id:"clientId",value:e.clientId},{id:"privateApiKey",value:e.privateApiKey},{id:"publicApiKey",value:e.publicApiKey},{id:"url",value:e.url}],wK=()=>tl({enabled:Ia(),companyName:yc(Ds()),clientId:yc(Ds().uuid("rsp:pages.integrations.helpdesk.connectWise.apiInformation.configuration.fields.errorClientIdFormat")),privateApiKey:yc(Ds()),publicApiKey:yc(Ds()),url:yc(Ds())}).superRefine((e,t)=>{e.enabled&&(bK(e).filter(r=>!r.value)?.map(r=>r.id)).forEach(r=>{t.addIssue({code:yn.custom,message:"rsp:validations.mixed.required",path:[r]})})}),xK=Ll(()=>{const e=Pd(),t=CW(),n=EW(),r=wK(),s=hc({resolver:mc(r),defaultValues:Oj}),o=!!t?.data?.enabled,{isEditMode:i,setIsEditMode:u,setFormValues:p,onEditMode:g}=kq({form:s});(0,l.useEffect)(()=>{t?.data&&p(t?.data)},[t?.data]),(0,l.useEffect)(()=>{n?.isSuccess&&u(!1)},[n?.isSuccess]);const v=w=>{const x=w.enabled?w:{enabled:!1};n.mutate(x)};return e?.isLoading?(0,a.jsx)(zs,{floating:!0}):e?.isEnabled&&(t?.isLoading||!t?.data)?(0,a.jsx)(zs,{floating:!0}):(0,a.jsx)(gc,{...s,children:(0,a.jsxs)(Sa,{onSubmit:s.handleSubmit(v),children:[(0,a.jsx)(bq,{}),o&&!i?(0,a.jsx)(yq,{apiInformation:t?.data,onEditMode:g}):(0,a.jsx)(Tq,{isEditMode:i,onEditMode:g,apiInformation:t?.data,apiInformationMutation:n}),(0,a.jsx)(V_,{showLoader:n?.isLoading,disabled:n?.isLoading})]})})},[oe.aX.IntegrationConfigure,oe.aX.IntegrationList]),_K={serviceBoard:void 0,ticketStatusMappingList:{},ticketTypes:{}},qj=(e,t)=>e?t?.includes?.(e)??!1:!1,SK=(e,t)=>t?Array.from(new Set(Object.values(e?.[t]))).flat()?.filter(n=>n!==void 0):[],CK="DismissableLayer",TT="dismissableLayer.update",EK="dismissableLayer.pointerDownOutside",TK="dismissableLayer.focusOutside";let Kj;const Gj=(0,l.createContext)({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Qj=(0,l.forwardRef)((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:u,onDismiss:p,...g}=e,v=(0,l.useContext)(Gj),[w,x]=(0,l.useState)(null),E=(n=w?.ownerDocument)!==null&&n!==void 0?n:globalThis?.document,[,R]=(0,l.useState)({}),k=Lr(t,Le=>x(Le)),N=Array.from(v.layers),[L]=[...v.layersWithOutsidePointerEventsDisabled].slice(-1),D=N.indexOf(L),B=w?N.indexOf(w):-1,Q=v.layersWithOutsidePointerEventsDisabled.size>0,ce=B>=D,ye=PK(Le=>{const We=Le.target,at=[...v.branches].some(St=>St.contains(We));!ce||at||(o?.(Le),u?.(Le),Le.defaultPrevented||p?.())},E),G=OK(Le=>{const We=Le.target;[...v.branches].some(St=>St.contains(We))||(i?.(Le),u?.(Le),Le.defaultPrevented||p?.())},E);return pg(Le=>{B===v.layers.size-1&&(s?.(Le),!Le.defaultPrevented&&p&&(Le.preventDefault(),p()))},E),(0,l.useEffect)(()=>{if(w)return r&&(v.layersWithOutsidePointerEventsDisabled.size===0&&(Kj=E.body.style.pointerEvents,E.body.style.pointerEvents="none"),v.layersWithOutsidePointerEventsDisabled.add(w)),v.layers.add(w),Yj(),()=>{r&&v.layersWithOutsidePointerEventsDisabled.size===1&&(E.body.style.pointerEvents=Kj)}},[w,E,r,v]),(0,l.useEffect)(()=>()=>{w&&(v.layers.delete(w),v.layersWithOutsidePointerEventsDisabled.delete(w),Yj())},[w,v]),(0,l.useEffect)(()=>{const Le=()=>R({});return document.addEventListener(TT,Le),()=>document.removeEventListener(TT,Le)},[]),(0,l.createElement)(zn.div,(0,Je.A)({},g,{ref:k,style:{pointerEvents:Q?ce?"auto":"none":void 0,...e.style},onFocusCapture:gn(e.onFocusCapture,G.onFocusCapture),onBlurCapture:gn(e.onBlurCapture,G.onBlurCapture),onPointerDownCapture:gn(e.onPointerDownCapture,ye.onPointerDownCapture)}))}),kK="DismissableLayerBranch",RK=(0,l.forwardRef)((e,t)=>{const n=(0,l.useContext)(Gj),r=(0,l.useRef)(null),s=Lr(t,r);return(0,l.useEffect)(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),(0,l.createElement)(zn.div,(0,Je.A)({},e,{ref:s}))});function PK(e,t=globalThis?.document){const n=Ao(e),r=(0,l.useRef)(!1),s=(0,l.useRef)(()=>{});return(0,l.useEffect)(()=>{const o=u=>{if(u.target&&!r.current){let g=function(){Xj(EK,n,p,{discrete:!0})};const p={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=g,t.addEventListener("click",s.current,{once:!0})):g()}r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function OK(e,t=globalThis?.document){const n=Ao(e),r=(0,l.useRef)(!1);return(0,l.useEffect)(()=>{const s=o=>{o.target&&!r.current&&Xj(TK,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Yj(){const e=new CustomEvent(TT);document.dispatchEvent(e)}function Xj(e,t,n,{discrete:r}){const s=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?lp(s,o):s.dispatchEvent(o)}const Tpe=null,kpe=null,kT="focusScope.autoFocusOnMount",RT="focusScope.autoFocusOnUnmount",Zj={bubbles:!1,cancelable:!0},NK="FocusScope",Jj=(0,l.forwardRef)((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...i}=e,[u,p]=(0,l.useState)(null),g=Ao(s),v=Ao(o),w=(0,l.useRef)(null),x=Lr(t,k=>p(k)),E=(0,l.useRef)({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;(0,l.useEffect)(()=>{if(r){let k=function(B){if(E.paused||!u)return;const Q=B.target;u.contains(Q)?w.current=Q:vm(w.current,{select:!0})},N=function(B){if(E.paused||!u)return;const Q=B.relatedTarget;Q!==null&&(u.contains(Q)||vm(w.current,{select:!0}))},L=function(B){const Q=document.activeElement;for(const ce of B)ce.removedNodes.length>0&&(u!=null&&u.contains(Q)||vm(u))};document.addEventListener("focusin",k),document.addEventListener("focusout",N);const D=new MutationObserver(L);return u&&D.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",k),document.removeEventListener("focusout",N),D.disconnect()}}},[r,u,E.paused]),(0,l.useEffect)(()=>{if(u){n5.add(E);const k=document.activeElement;if(!u.contains(k)){const L=new CustomEvent(kT,Zj);u.addEventListener(kT,g),u.dispatchEvent(L),L.defaultPrevented||(AK($K(e5(u)),{select:!0}),document.activeElement===k&&vm(u))}return()=>{u.removeEventListener(kT,g),setTimeout(()=>{const L=new CustomEvent(RT,Zj);u.addEventListener(RT,v),u.dispatchEvent(L),L.defaultPrevented||vm(k??document.body,{select:!0}),u.removeEventListener(RT,v),n5.remove(E)},0)}}},[u,g,v,E]);const R=(0,l.useCallback)(k=>{if(!n&&!r||E.paused)return;const N=k.key==="Tab"&&!k.altKey&&!k.ctrlKey&&!k.metaKey,L=document.activeElement;if(N&&L){const D=k.currentTarget,[B,Q]=IK(D);B&&Q?!k.shiftKey&&L===Q?(k.preventDefault(),n&&vm(B,{select:!0})):k.shiftKey&&L===B&&(k.preventDefault(),n&&vm(Q,{select:!0})):L===D&&k.preventDefault()}},[n,r,E.paused]);return(0,l.createElement)(zn.div,(0,Je.A)({tabIndex:-1},i,{ref:x,onKeyDown:R}))});function AK(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(vm(r,{select:t}),document.activeElement!==n)return}function IK(e){const t=e5(e),n=t5(t,e),r=t5(t.reverse(),e);return[n,r]}function e5(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function t5(e,t){for(const n of e)if(!jK(n,{upTo:t}))return n}function jK(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function DK(e){return e instanceof HTMLInputElement&&"select"in e}function vm(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&DK(e)&&t&&e.select()}}const n5=MK();function MK(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=r5(e,t),e.unshift(t)},remove(t){var n;e=r5(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function r5(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function $K(e){return e.filter(t=>t.tagName!=="A")}const Rpe=null,Ppe=null,Ope=null,PT="Popper",[s5,o5]=va(PT),[LK,a5]=s5(PT),i5=e=>{const{__scopePopper:t,children:n}=e,[r,s]=(0,l.useState)(null);return(0,l.createElement)(LK,{scope:t,anchor:r,onAnchorChange:s},n)},l5="PopperAnchor",c5=(0,l.forwardRef)((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,o=a5(l5,n),i=(0,l.useRef)(null),u=Lr(t,i);return(0,l.useEffect)(()=>{o.onAnchorChange(r?.current||i.current)}),r?null:(0,l.createElement)(zn.div,(0,Je.A)({},s,{ref:u}))}),OT="PopperContent",[FK,zK]=s5(OT),u5=(0,l.forwardRef)((e,t)=>{var n,r,s,o,i,u,p,g;const{__scopePopper:v,side:w="bottom",sideOffset:x=0,align:E="center",alignOffset:R=0,arrowPadding:k=0,collisionBoundary:N=[],collisionPadding:L=0,sticky:D="partial",hideWhenDetached:B=!1,avoidCollisions:Q=!0,onPlaced:ce,...ye}=e,G=a5(OT,v),[Le,We]=(0,l.useState)(null),at=Lr(t,Ws=>We(Ws)),[St,xt]=(0,l.useState)(null),Mt=Wv(St),$t=(n=Mt?.width)!==null&&n!==void 0?n:0,Nt=(r=Mt?.height)!==null&&r!==void 0?r:0,Bn=w+(E!=="center"?"-"+E:""),wn=typeof L=="number"?L:{top:0,right:0,bottom:0,left:0,...L},Nn=Array.isArray(N)?N:[N],Zt=Nn.length>0,Pt={padding:wn,boundary:Nn.filter(BK),altBoundary:Zt},{refs:At,floatingStyles:Ht,placement:Gt,isPositioned:Sn,middlewareData:Cr}=MO({strategy:"fixed",placement:Bn,whileElementsMounted:hl.ll,elements:{reference:G.anchor},middleware:[(0,hl.cY)({mainAxis:x+Nt,alignmentAxis:R}),Q&&(0,hl.BN)({mainAxis:!0,crossAxis:!1,limiter:D==="partial"?(0,hl.ER)():void 0,...Pt}),Q&&(0,hl.UU)({...Pt}),(0,hl.Ej)({...Pt,apply:({elements:Ws,rects:xi,availableWidth:ja,availableHeight:Li})=>{const{width:Ze,height:Tt}=xi.reference,Dt=Ws.floating.style;Dt.setProperty("--radix-popper-available-width",`${ja}px`),Dt.setProperty("--radix-popper-available-height",`${Li}px`),Dt.setProperty("--radix-popper-anchor-width",`${Ze}px`),Dt.setProperty("--radix-popper-anchor-height",`${Tt}px`)}}),St&&AO({element:St,padding:k}),VK({arrowWidth:$t,arrowHeight:Nt}),B&&(0,hl.jD)({strategy:"referenceHidden"})]}),[br,Ln]=p5(Gt),Hr=Ao(ce);ya(()=>{Sn&&Hr?.()},[Sn,Hr]);const ws=(s=Cr.arrow)===null||s===void 0?void 0:s.x,us=(o=Cr.arrow)===null||o===void 0?void 0:o.y,tr=((i=Cr.arrow)===null||i===void 0?void 0:i.centerOffset)!==0,[mr,En]=(0,l.useState)();return ya(()=>{Le&&En(window.getComputedStyle(Le).zIndex)},[Le]),(0,l.createElement)("div",{ref:At.setFloating,"data-radix-popper-content-wrapper":"",style:{...Ht,transform:Sn?Ht.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:mr,["--radix-popper-transform-origin"]:[(u=Cr.transformOrigin)===null||u===void 0?void 0:u.x,(p=Cr.transformOrigin)===null||p===void 0?void 0:p.y].join(" ")},dir:e.dir},(0,l.createElement)(FK,{scope:v,placedSide:br,onArrowChange:xt,arrowX:ws,arrowY:us,shouldHideArrow:tr},(0,l.createElement)(zn.div,(0,Je.A)({"data-side":br,"data-align":Ln},ye,{ref:at,style:{...ye.style,animation:Sn?void 0:"none",opacity:(g=Cr.hide)!==null&&g!==void 0&&g.referenceHidden?0:void 0}}))))}),d5="PopperArrow",UK={top:"bottom",right:"left",bottom:"top",left:"right"},f5=(0,l.forwardRef)(function(t,n){const{__scopePopper:r,...s}=t,o=zK(d5,r),i=UK[o.placedSide];return(0,l.createElement)("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0}},(0,l.createElement)(LO,(0,Je.A)({},s,{ref:n,style:{...s.style,display:"block"}})))});function BK(e){return e!==null}const VK=e=>({name:"transformOrigin",options:e,fn(t){var n,r,s,o,i;const{placement:u,rects:p,middlewareData:g}=t,w=((n=g.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,x=w?0:e.arrowWidth,E=w?0:e.arrowHeight,[R,k]=p5(u),N={start:"0%",center:"50%",end:"100%"}[k],L=((r=(s=g.arrow)===null||s===void 0?void 0:s.x)!==null&&r!==void 0?r:0)+x/2,D=((o=(i=g.arrow)===null||i===void 0?void 0:i.y)!==null&&o!==void 0?o:0)+E/2;let B="",Q="";return R==="bottom"?(B=w?N:`${L}px`,Q=`${-E}px`):R==="top"?(B=w?N:`${L}px`,Q=`${p.floating.height+E}px`):R==="right"?(B=`${-E}px`,Q=w?N:`${D}px`):R==="left"&&(B=`${p.floating.width+E}px`,Q=w?N:`${D}px`),{data:{x:B,y:Q}}}});function p5(e){const[t,n="center"]=e.split("-");return[t,n]}const HK=i5,WK=c5,qK=u5,KK=f5,GK="Portal",h5=(0,l.forwardRef)((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...s}=e;return r?kt.createPortal((0,l.createElement)(zn.div,(0,Je.A)({},s,{ref:t})),r):null}),Npe=null,m5=(0,l.forwardRef)((e,t)=>{const{children:n,...r}=e,s=l.Children.toArray(n),o=s.find(YK);if(o){const i=o.props.children,u=s.map(p=>p===o?l.Children.count(i)>1?l.Children.only(null):(0,l.isValidElement)(i)?i.props.children:null:p);return(0,l.createElement)(NT,(0,Je.A)({},r,{ref:t}),(0,l.isValidElement)(i)?(0,l.cloneElement)(i,void 0,u):null)}return(0,l.createElement)(NT,(0,Je.A)({},r,{ref:t}),n)});m5.displayName="Slot";const NT=(0,l.forwardRef)((e,t)=>{const{children:n,...r}=e;return(0,l.isValidElement)(n)?(0,l.cloneElement)(n,{...XK(r,n.props),ref:t?nc(t,n.ref):n.ref}):l.Children.count(n)>1?l.Children.only(null):null});NT.displayName="SlotClone";const QK=({children:e})=>(0,l.createElement)(l.Fragment,null,e);function YK(e){return(0,l.isValidElement)(e)&&e.type===QK}function XK(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...u)=>{o(...u),s(...u)}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}const Ape=null,ZK=[" ","Enter","ArrowUp","ArrowDown"],JK=[" ","Enter"],vw="Select",[J_,eS,eG]=Vb(vw),[by,Ipe]=va(vw,[eG,o5]),tS=o5(),[tG,ym]=by(vw),[nG,rG]=by(vw),g5=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:o,value:i,defaultValue:u,onValueChange:p,dir:g,name:v,autoComplete:w,disabled:x,required:E}=e,R=tS(t),[k,N]=(0,l.useState)(null),[L,D]=(0,l.useState)(null),[B,Q]=(0,l.useState)(!1),ce=lm(g),[ye=!1,G]=si({prop:r,defaultProp:s,onChange:o}),[Le,We]=si({prop:i,defaultProp:u,onChange:p}),at=(0,l.useRef)(null),St=k?Boolean(k.closest("form")):!0,[xt,Mt]=(0,l.useState)(new Set),$t=Array.from(xt).map(Nt=>Nt.props.value).join(";");return(0,l.createElement)(HK,R,(0,l.createElement)(tG,{required:E,scope:t,trigger:k,onTriggerChange:N,valueNode:L,onValueNodeChange:D,valueNodeHasChildren:B,onValueNodeHasChildrenChange:Q,contentId:ri(),value:Le,onValueChange:We,open:ye,onOpenChange:G,dir:ce,triggerPointerDownPosRef:at,disabled:x},(0,l.createElement)(J_.Provider,{scope:t},(0,l.createElement)(nG,{scope:e.__scopeSelect,onNativeOptionAdd:(0,l.useCallback)(Nt=>{Mt(Bn=>new Set(Bn).add(Nt))},[]),onNativeOptionRemove:(0,l.useCallback)(Nt=>{Mt(Bn=>{const wn=new Set(Bn);return wn.delete(Nt),wn})},[])},n)),St?(0,l.createElement)(F5,{key:$t,"aria-hidden":!0,required:E,tabIndex:-1,name:v,autoComplete:w,value:Le,onChange:Nt=>We(Nt.target.value),disabled:x},Le===void 0?(0,l.createElement)("option",{value:""}):null,Array.from(xt)):null))},v5="SelectTrigger",y5=(0,l.forwardRef)((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,o=tS(n),i=ym(v5,n),u=i.disabled||r,p=Lr(t,i.onTriggerChange),g=eS(n),[v,w,x]=z5(R=>{const k=g().filter(D=>!D.disabled),N=k.find(D=>D.value===i.value),L=U5(k,R,N);L!==void 0&&i.onValueChange(L.value)}),E=()=>{u||(i.onOpenChange(!0),x())};return(0,l.createElement)(WK,(0,Je.A)({asChild:!0},o),(0,l.createElement)(zn.button,(0,Je.A)({type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":i.value===void 0?"":void 0},s,{ref:p,onClick:gn(s.onClick,R=>{R.currentTarget.focus()}),onPointerDown:gn(s.onPointerDown,R=>{const k=R.target;k.hasPointerCapture(R.pointerId)&&k.releasePointerCapture(R.pointerId),R.button===0&&R.ctrlKey===!1&&(E(),i.triggerPointerDownPosRef.current={x:Math.round(R.pageX),y:Math.round(R.pageY)},R.preventDefault())}),onKeyDown:gn(s.onKeyDown,R=>{const k=v.current!=="";!(R.ctrlKey||R.altKey||R.metaKey)&&R.key.length===1&&w(R.key),!(k&&R.key===" ")&&ZK.includes(R.key)&&(E(),R.preventDefault())})})))}),b5="SelectValue",w5=(0,l.forwardRef)((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:o,placeholder:i,...u}=e,p=ym(b5,n),{onValueNodeHasChildrenChange:g}=p,v=o!==void 0,w=Lr(t,p.onValueNodeChange);return ya(()=>{g(v)},[g,v]),(0,l.createElement)(zn.span,(0,Je.A)({},u,{ref:w,style:{pointerEvents:"none"}}),p.value===void 0&&i!==void 0?i:o)}),sG="SelectIcon",x5=(0,l.forwardRef)((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return(0,l.createElement)(zn.span,(0,Je.A)({"aria-hidden":!0},s,{ref:t}),r||"\u25BC")}),oG="SelectPortal",_5=e=>(0,l.createElement)(h5,(0,Je.A)({asChild:!0},e)),p0="SelectContent",S5=(0,l.forwardRef)((e,t)=>{const n=ym(p0,e.__scopeSelect),[r,s]=(0,l.useState)();if(ya(()=>{s(new DocumentFragment)},[]),!n.open){const o=r;return o?(0,kt.createPortal)((0,l.createElement)(C5,{scope:e.__scopeSelect},(0,l.createElement)(J_.Slot,{scope:e.__scopeSelect},(0,l.createElement)("div",null,e.children))),o):null}return(0,l.createElement)(E5,(0,Je.A)({},e,{ref:t}))}),Vp=10,[C5,bm]=by(p0),aG="SelectContentImpl",E5=(0,l.forwardRef)((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:o,onPointerDownOutside:i,side:u,sideOffset:p,align:g,alignOffset:v,arrowPadding:w,collisionBoundary:x,collisionPadding:E,sticky:R,hideWhenDetached:k,avoidCollisions:N,...L}=e,D=ym(p0,n),[B,Q]=(0,l.useState)(null),[ce,ye]=(0,l.useState)(null),G=Lr(t,Ln=>Q(Ln)),[Le,We]=(0,l.useState)(null),[at,St]=(0,l.useState)(null),xt=eS(n),[Mt,$t]=(0,l.useState)(!1),Nt=(0,l.useRef)(!1);(0,l.useEffect)(()=>{if(B)return Uu(B)},[B]),hp();const Bn=(0,l.useCallback)(Ln=>{const[Hr,...ws]=xt().map(mr=>mr.ref.current),[us]=ws.slice(-1),tr=document.activeElement;for(const mr of Ln)if(mr===tr||(mr?.scrollIntoView({block:"nearest"}),mr===Hr&&ce&&(ce.scrollTop=0),mr===us&&ce&&(ce.scrollTop=ce.scrollHeight),mr?.focus(),document.activeElement!==tr))return},[xt,ce]),wn=(0,l.useCallback)(()=>Bn([Le,B]),[Bn,Le,B]);(0,l.useEffect)(()=>{Mt&&wn()},[Mt,wn]);const{onOpenChange:Nn,triggerPointerDownPosRef:Zt}=D;(0,l.useEffect)(()=>{if(B){let Ln={x:0,y:0};const Hr=us=>{var tr,mr,En,Ws;Ln={x:Math.abs(Math.round(us.pageX)-((tr=(mr=Zt.current)===null||mr===void 0?void 0:mr.x)!==null&&tr!==void 0?tr:0)),y:Math.abs(Math.round(us.pageY)-((En=(Ws=Zt.current)===null||Ws===void 0?void 0:Ws.y)!==null&&En!==void 0?En:0))}},ws=us=>{Ln.x<=10&&Ln.y<=10?us.preventDefault():B.contains(us.target)||Nn(!1),document.removeEventListener("pointermove",Hr),Zt.current=null};return Zt.current!==null&&(document.addEventListener("pointermove",Hr),document.addEventListener("pointerup",ws,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Hr),document.removeEventListener("pointerup",ws,{capture:!0})}}},[B,Nn,Zt]),(0,l.useEffect)(()=>{const Ln=()=>Nn(!1);return window.addEventListener("blur",Ln),window.addEventListener("resize",Ln),()=>{window.removeEventListener("blur",Ln),window.removeEventListener("resize",Ln)}},[Nn]);const[Pt,At]=z5(Ln=>{const Hr=xt().filter(tr=>!tr.disabled),ws=Hr.find(tr=>tr.ref.current===document.activeElement),us=U5(Hr,Ln,ws);us&&setTimeout(()=>us.ref.current.focus())}),Ht=(0,l.useCallback)((Ln,Hr,ws)=>{const us=!Nt.current&&!ws;(D.value!==void 0&&D.value===Hr||us)&&(We(Ln),us&&(Nt.current=!0))},[D.value]),Gt=(0,l.useCallback)(()=>B?.focus(),[B]),Sn=(0,l.useCallback)((Ln,Hr,ws)=>{const us=!Nt.current&&!ws;(D.value!==void 0&&D.value===Hr||us)&&St(Ln)},[D.value]),Cr=r==="popper"?AT:T5,br=Cr===AT?{side:u,sideOffset:p,align:g,alignOffset:v,arrowPadding:w,collisionBoundary:x,collisionPadding:E,sticky:R,hideWhenDetached:k,avoidCollisions:N}:{};return(0,l.createElement)(C5,{scope:n,content:B,viewport:ce,onViewportChange:ye,itemRefCallback:Ht,selectedItem:Le,onItemLeave:Gt,itemTextRefCallback:Sn,focusSelectedItem:wn,selectedItemText:at,position:r,isPositioned:Mt,searchRef:Pt},(0,l.createElement)(xd,{as:m5,allowPinchZoom:!0},(0,l.createElement)(Jj,{asChild:!0,trapped:D.open,onMountAutoFocus:Ln=>{Ln.preventDefault()},onUnmountAutoFocus:gn(s,Ln=>{var Hr;(Hr=D.trigger)===null||Hr===void 0||Hr.focus({preventScroll:!0}),Ln.preventDefault()})},(0,l.createElement)(Qj,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:Ln=>Ln.preventDefault(),onDismiss:()=>D.onOpenChange(!1)},(0,l.createElement)(Cr,(0,Je.A)({role:"listbox",id:D.contentId,"data-state":D.open?"open":"closed",dir:D.dir,onContextMenu:Ln=>Ln.preventDefault()},L,br,{onPlaced:()=>$t(!0),ref:G,style:{display:"flex",flexDirection:"column",outline:"none",...L.style},onKeyDown:gn(L.onKeyDown,Ln=>{const Hr=Ln.ctrlKey||Ln.altKey||Ln.metaKey;if(Ln.key==="Tab"&&Ln.preventDefault(),!Hr&&Ln.key.length===1&&At(Ln.key),["ArrowUp","ArrowDown","Home","End"].includes(Ln.key)){let us=xt().filter(tr=>!tr.disabled).map(tr=>tr.ref.current);if(["ArrowUp","End"].includes(Ln.key)&&(us=us.slice().reverse()),["ArrowUp","ArrowDown"].includes(Ln.key)){const tr=Ln.target,mr=us.indexOf(tr);us=us.slice(mr+1)}setTimeout(()=>Bn(us)),Ln.preventDefault()}})}))))))}),iG="SelectItemAlignedPosition",T5=(0,l.forwardRef)((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,o=ym(p0,n),i=bm(p0,n),[u,p]=(0,l.useState)(null),[g,v]=(0,l.useState)(null),w=Lr(t,G=>v(G)),x=eS(n),E=(0,l.useRef)(!1),R=(0,l.useRef)(!0),{viewport:k,selectedItem:N,selectedItemText:L,focusSelectedItem:D}=i,B=(0,l.useCallback)(()=>{if(o.trigger&&o.valueNode&&u&&g&&k&&N&&L){const G=o.trigger.getBoundingClientRect(),Le=g.getBoundingClientRect(),We=o.valueNode.getBoundingClientRect(),at=L.getBoundingClientRect();if(o.dir!=="rtl"){const tr=at.left-Le.left,mr=We.left-tr,En=G.left-mr,Ws=G.width+En,xi=Math.max(Ws,Le.width),ja=window.innerWidth-Vp,Li=Ub(mr,[Vp,ja-xi]);u.style.minWidth=Ws+"px",u.style.left=Li+"px"}else{const tr=Le.right-at.right,mr=window.innerWidth-We.right-tr,En=window.innerWidth-G.right-mr,Ws=G.width+En,xi=Math.max(Ws,Le.width),ja=window.innerWidth-Vp,Li=Ub(mr,[Vp,ja-xi]);u.style.minWidth=Ws+"px",u.style.right=Li+"px"}const St=x(),xt=window.innerHeight-Vp*2,Mt=k.scrollHeight,$t=window.getComputedStyle(g),Nt=parseInt($t.borderTopWidth,10),Bn=parseInt($t.paddingTop,10),wn=parseInt($t.borderBottomWidth,10),Nn=parseInt($t.paddingBottom,10),Zt=Nt+Bn+Mt+Nn+wn,Pt=Math.min(N.offsetHeight*5,Zt),At=window.getComputedStyle(k),Ht=parseInt(At.paddingTop,10),Gt=parseInt(At.paddingBottom,10),Sn=G.top+G.height/2-Vp,Cr=xt-Sn,br=N.offsetHeight/2,Ln=N.offsetTop+br,Hr=Nt+Bn+Ln,ws=Zt-Hr;if(Hr<=Sn){const tr=N===St[St.length-1].ref.current;u.style.bottom="0px";const mr=g.clientHeight-k.offsetTop-k.offsetHeight,En=Math.max(Cr,br+(tr?Gt:0)+mr+wn),Ws=Hr+En;u.style.height=Ws+"px"}else{const tr=N===St[0].ref.current;u.style.top="0px";const En=Math.max(Sn,Nt+k.offsetTop+(tr?Ht:0)+br)+ws;u.style.height=En+"px",k.scrollTop=Hr-Sn+k.offsetTop}u.style.margin=`${Vp}px 0`,u.style.minHeight=Pt+"px",u.style.maxHeight=xt+"px",r?.(),requestAnimationFrame(()=>E.current=!0)}},[x,o.trigger,o.valueNode,u,g,k,N,L,o.dir,r]);ya(()=>B(),[B]);const[Q,ce]=(0,l.useState)();ya(()=>{g&&ce(window.getComputedStyle(g).zIndex)},[g]);const ye=(0,l.useCallback)(G=>{G&&R.current===!0&&(B(),D?.(),R.current=!1)},[B,D]);return(0,l.createElement)(cG,{scope:n,contentWrapper:u,shouldExpandOnScrollRef:E,onScrollButtonChange:ye},(0,l.createElement)("div",{ref:p,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:Q}},(0,l.createElement)(zn.div,(0,Je.A)({},s,{ref:w,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}}))))}),lG="SelectPopperPosition",AT=(0,l.forwardRef)((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=Vp,...o}=e,i=tS(n);return(0,l.createElement)(qK,(0,Je.A)({},i,o,{ref:t,align:r,collisionPadding:s,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}))}),[cG,IT]=by(p0,{}),jT="SelectViewport",k5=(0,l.forwardRef)((e,t)=>{const{__scopeSelect:n,...r}=e,s=bm(jT,n),o=IT(jT,n),i=Lr(t,s.onViewportChange),u=(0,l.useRef)(0);return(0,l.createElement)(l.Fragment,null,(0,l.createElement)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),(0,l.createElement)(J_.Slot,{scope:n},(0,l.createElement)(zn.div,(0,Je.A)({"data-radix-select-viewport":"",role:"presentation"},r,{ref:i,style:{position:"relative",flex:1,overflow:"auto",...r.style},onScroll:gn(r.onScroll,p=>{const g=p.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:w}=o;if(w!=null&&w.current&&v){const x=Math.abs(u.current-g.scrollTop);if(x>0){const E=window.innerHeight-Vp*2,R=parseFloat(v.style.minHeight),k=parseFloat(v.style.height),N=Math.max(R,k);if(N<E){const L=N+x,D=Math.min(E,L),B=L-D;v.style.height=D+"px",v.style.bottom==="0px"&&(g.scrollTop=B>0?B:0,v.style.justifyContent="flex-end")}}}u.current=g.scrollTop})}))))}),R5="SelectGroup",[uG,dG]=by(R5),P5=(0,l.forwardRef)((e,t)=>{const{__scopeSelect:n,...r}=e,s=ri();return(0,l.createElement)(uG,{scope:n,id:s},(0,l.createElement)(zn.div,(0,Je.A)({role:"group","aria-labelledby":s},r,{ref:t})))}),O5="SelectLabel",N5=(0,l.forwardRef)((e,t)=>{const{__scopeSelect:n,...r}=e,s=dG(O5,n);return(0,l.createElement)(zn.div,(0,Je.A)({id:s.id},r,{ref:t}))}),nS="SelectItem",[fG,A5]=by(nS),I5=(0,l.forwardRef)((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:o,...i}=e,u=ym(nS,n),p=bm(nS,n),g=u.value===r,[v,w]=(0,l.useState)(o??""),[x,E]=(0,l.useState)(!1),R=Lr(t,L=>{var D;return(D=p.itemRefCallback)===null||D===void 0?void 0:D.call(p,L,r,s)}),k=ri(),N=()=>{s||(u.onValueChange(r),u.onOpenChange(!1))};return(0,l.createElement)(fG,{scope:n,value:r,disabled:s,textId:k,isSelected:g,onItemTextChange:(0,l.useCallback)(L=>{w(D=>{var B;return D||((B=L?.textContent)!==null&&B!==void 0?B:"").trim()})},[])},(0,l.createElement)(J_.ItemSlot,{scope:n,value:r,disabled:s,textValue:v},(0,l.createElement)(zn.div,(0,Je.A)({role:"option","aria-labelledby":k,"data-highlighted":x?"":void 0,"aria-selected":g&&x,"data-state":g?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1},i,{ref:R,onFocus:gn(i.onFocus,()=>E(!0)),onBlur:gn(i.onBlur,()=>E(!1)),onPointerUp:gn(i.onPointerUp,N),onPointerMove:gn(i.onPointerMove,L=>{if(s){var D;(D=p.onItemLeave)===null||D===void 0||D.call(p)}else L.currentTarget.focus({preventScroll:!0})}),onPointerLeave:gn(i.onPointerLeave,L=>{if(L.currentTarget===document.activeElement){var D;(D=p.onItemLeave)===null||D===void 0||D.call(p)}}),onKeyDown:gn(i.onKeyDown,L=>{var D;((D=p.searchRef)===null||D===void 0?void 0:D.current)!==""&&L.key===" "||(JK.includes(L.key)&&N(),L.key===" "&&L.preventDefault())})}))))}),yw="SelectItemText",j5=(0,l.forwardRef)((e,t)=>{const{__scopeSelect:n,className:r,style:s,...o}=e,i=ym(yw,n),u=bm(yw,n),p=A5(yw,n),g=rG(yw,n),[v,w]=(0,l.useState)(null),x=Lr(t,L=>w(L),p.onItemTextChange,L=>{var D;return(D=u.itemTextRefCallback)===null||D===void 0?void 0:D.call(u,L,p.value,p.disabled)}),E=v?.textContent,R=(0,l.useMemo)(()=>(0,l.createElement)("option",{key:p.value,value:p.value,disabled:p.disabled},E),[p.disabled,p.value,E]),{onNativeOptionAdd:k,onNativeOptionRemove:N}=g;return ya(()=>(k(R),()=>N(R)),[k,N,R]),(0,l.createElement)(l.Fragment,null,(0,l.createElement)(zn.span,(0,Je.A)({id:p.textId},o,{ref:x})),p.isSelected&&i.valueNode&&!i.valueNodeHasChildren?(0,kt.createPortal)(o.children,i.valueNode):null)}),D5="SelectItemIndicator",M5=(0,l.forwardRef)((e,t)=>{const{__scopeSelect:n,...r}=e;return A5(D5,n).isSelected?(0,l.createElement)(zn.span,(0,Je.A)({"aria-hidden":!0},r,{ref:t})):null}),DT="SelectScrollUpButton",pG=(0,l.forwardRef)((e,t)=>{const n=bm(DT,e.__scopeSelect),r=IT(DT,e.__scopeSelect),[s,o]=(0,l.useState)(!1),i=Lr(t,r.onScrollButtonChange);return ya(()=>{if(n.viewport&&n.isPositioned){let p=function(){const g=u.scrollTop>0;o(g)};const u=n.viewport;return p(),u.addEventListener("scroll",p),()=>u.removeEventListener("scroll",p)}},[n.viewport,n.isPositioned]),s?(0,l.createElement)($5,(0,Je.A)({},e,{ref:i,onAutoScroll:()=>{const{viewport:u,selectedItem:p}=n;u&&p&&(u.scrollTop=u.scrollTop-p.offsetHeight)}})):null}),MT="SelectScrollDownButton",hG=(0,l.forwardRef)((e,t)=>{const n=bm(MT,e.__scopeSelect),r=IT(MT,e.__scopeSelect),[s,o]=(0,l.useState)(!1),i=Lr(t,r.onScrollButtonChange);return ya(()=>{if(n.viewport&&n.isPositioned){let p=function(){const g=u.scrollHeight-u.clientHeight,v=Math.ceil(u.scrollTop)<g;o(v)};const u=n.viewport;return p(),u.addEventListener("scroll",p),()=>u.removeEventListener("scroll",p)}},[n.viewport,n.isPositioned]),s?(0,l.createElement)($5,(0,Je.A)({},e,{ref:i,onAutoScroll:()=>{const{viewport:u,selectedItem:p}=n;u&&p&&(u.scrollTop=u.scrollTop+p.offsetHeight)}})):null}),$5=(0,l.forwardRef)((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,o=bm("SelectScrollButton",n),i=(0,l.useRef)(null),u=eS(n),p=(0,l.useCallback)(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return(0,l.useEffect)(()=>()=>p(),[p]),ya(()=>{var g;const v=u().find(w=>w.ref.current===document.activeElement);v==null||(g=v.ref.current)===null||g===void 0||g.scrollIntoView({block:"nearest"})},[u]),(0,l.createElement)(zn.div,(0,Je.A)({"aria-hidden":!0},s,{ref:t,style:{flexShrink:0,...s.style},onPointerDown:gn(s.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:gn(s.onPointerMove,()=>{var g;(g=o.onItemLeave)===null||g===void 0||g.call(o),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:gn(s.onPointerLeave,()=>{p()})}))}),mG="SelectSeparator",L5=(0,l.forwardRef)((e,t)=>{const{__scopeSelect:n,...r}=e;return(0,l.createElement)(zn.div,(0,Je.A)({"aria-hidden":!0},r,{ref:t}))}),$T="SelectArrow",gG=(0,l.forwardRef)((e,t)=>{const{__scopeSelect:n,...r}=e,s=tS(n),o=ym($T,n),i=bm($T,n);return o.open&&i.position==="popper"?(0,l.createElement)(KK,(0,Je.A)({},s,r,{ref:t})):null}),F5=(0,l.forwardRef)((e,t)=>{const{value:n,...r}=e,s=(0,l.useRef)(null),o=Lr(t,s),i=Db(n);return(0,l.useEffect)(()=>{const u=s.current,p=window.HTMLSelectElement.prototype,v=Object.getOwnPropertyDescriptor(p,"value").set;if(i!==n&&v){const w=new Event("change",{bubbles:!0});v.call(u,n),u.dispatchEvent(w)}},[i,n]),(0,l.createElement)(iE,{asChild:!0},(0,l.createElement)("select",(0,Je.A)({},r,{ref:o,defaultValue:n})))});F5.displayName="BubbleSelect";function z5(e){const t=Ao(e),n=(0,l.useRef)(""),r=(0,l.useRef)(0),s=(0,l.useCallback)(i=>{const u=n.current+i;t(u),function p(g){n.current=g,window.clearTimeout(r.current),g!==""&&(r.current=window.setTimeout(()=>p(""),1e3))}(u)},[t]),o=(0,l.useCallback)(()=>{n.current="",window.clearTimeout(r.current)},[]);return(0,l.useEffect)(()=>()=>window.clearTimeout(r.current),[]),[n,s,o]}function U5(e,t,n){const s=t.length>1&&Array.from(t).every(g=>g===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let i=vG(e,Math.max(o,0));s.length===1&&(i=i.filter(g=>g!==n));const p=i.find(g=>g.textValue.toLowerCase().startsWith(s.toLowerCase()));return p!==n?p:void 0}function vG(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const yG=g5,B5=y5,bG=w5,wG=x5,xG=_5,V5=S5,_G=k5,SG=P5,H5=N5,W5=I5,CG=j5,EG=M5,jpe=null,Dpe=null,q5=L5,Mpe=null,h0=yG,$pe=SG,m0=bG,wm=(0,l.forwardRef)(({className:e,children:t,...n},r)=>(0,a.jsxs)(B5,{ref:r,className:st("flex w-full items-center bg-white text-sm justify-between border-slate-300 rounded-md border border-slate-300 px-3 py-1.5 focus:outline-blue-500 data-[placeholder]:text-gray-400 dark:focus-visible:none dark:focus:border-blue-500 dark:border-gray-700 dark:bg-slate-950 dark:text-slate-200 dark:placeholder:text-gray-600",e),...n,children:[t,(0,a.jsx)(wG,{asChild:!0,children:(0,a.jsx)(Gg,{className:"h-4 w-4 opacity-50"})})]}));wm.displayName=B5.displayName;const xm=(0,l.forwardRef)(({className:e,children:t,position:n="popper",...r},s)=>(0,a.jsx)(xG,{children:(0,a.jsx)(V5,{ref:s,className:st("relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:(0,a.jsx)(_G,{className:st("py-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t})})}));xm.displayName=V5.displayName;const TG=(0,l.forwardRef)(({className:e,...t},n)=>(0,a.jsx)(H5,{ref:n,className:st("px-2 py-1.5 text-sm font-semibold",e),...t}));TG.displayName=H5.displayName;const _m=(0,l.forwardRef)(({className:e,children:t,...n},r)=>(0,a.jsxs)(W5,{ref:r,className:st("relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 disabled:bg-slate-100",e),...n,children:[(0,a.jsx)("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,a.jsx)(EG,{children:(0,a.jsx)(Gv,{className:"h-4 w-4"})})}),(0,a.jsx)(CG,{children:t})]}));_m.displayName=W5.displayName;const kG=(0,l.forwardRef)(({className:e,...t},n)=>(0,a.jsx)(q5,{ref:n,className:st("-mx-1 my-1 h-px bg-muted",e),...t}));kG.displayName=q5.displayName;const RG=()=>{const{t:e}=(0,z.Bd)(),t=xa(),n=A_();return(0,a.jsx)(Sa.Row,{contentContainerClassName:"md:max-w-md max-w-full",leftContent:(0,a.jsx)(Sa.LeftContent,{label:e("rsp:pages.integrations.helpdesk.connectWise.boardConfiguration.serviceBoard.title"),subLabel:e("rsp:pages.integrations.helpdesk.connectWise.boardConfiguration.serviceBoard.description")}),children:(0,a.jsx)(Jr,{control:t.control,name:"serviceBoard",render:({field:r})=>(0,a.jsxs)(qr,{children:[(0,a.jsx)(As,{children:e("rsp:pages.integrations.helpdesk.connectWise.boardConfiguration.serviceBoard.label")}),(0,a.jsxs)(h0,{value:r.value,onValueChange:s=>{r.onChange(s),t.reset({serviceBoard:s,ticketStatusMappingList:{...t.getValues("ticketStatusMappingList"),[s]:{...t.getValues("ticketStatusMappingList")?.[s]}},ticketTypes:{...t.getValues("ticketTypes"),[s]:Array.from(new Set([...t.getValues("ticketTypes")?.[s]??[]]))}})},children:[(0,a.jsx)(Kr,{children:(0,a.jsx)(wm,{"data-testid":"selectTriggerServiceBoard",children:(0,a.jsx)(m0,{placeholder:e("rsp:pages.integrations.helpdesk.connectWise.boardConfiguration.serviceBoard.placeholder")})})}),(0,a.jsx)(xm,{side:"bottom",children:n?.data?.map(s=>(0,a.jsx)(_m,{value:s.id??"","data-testid":"selectItemServiceBoard",children:s.name},s.name))})]}),(0,a.jsx)(Cs,{})]})})})},K5=(0,l.createContext)(null),rS=()=>{const e=(0,l.useContext)(K5);if(!e)throw new Error("useMultiSelect must be used within MultiSelectProvider");return e},LT=({values:e=[],onValuesChange:t,options:n=[],className:r,children:s,...o})=>{const[i,u]=(0,l.useState)(""),[p,g]=(0,l.useState)(!1),[v,w]=(0,l.useState)(-1),x=Hu(n),[E,R]=(0,l.useState)({}),k=(0,l.useCallback)(ye=>{if(e?.includes(ye)){t(e?.filter(G=>G!==ye));return}t([...e??[],ye])},[t,e]);(0,l.useEffect)(()=>{const ye=n?.map(G=>G.value);!x&&x!==n&&Object.keys(E)?.map(G=>!ye.includes(G))&&R(yE(n,"value"))},[E,n,x]);const N=(0,l.useCallback)(()=>{const ye=v+1;e?.length!==0&&w(ye>e?.length-1?-1:ye)},[v,e?.length]),L=(0,l.useCallback)(()=>{const ye=v-1;w(ye<0?e?.length-1:ye)},[v,e?.length]),D=(0,l.useCallback)(()=>{if(v!==-1&&v<e?.length){t(e?.filter(G=>G!==e[v]));const ye=v-1<0?0:v-1;w(ye);return}t(e?.filter(ye=>ye!==e[e?.length-1]))},[v,t,e]),B=(0,l.useCallback)(ye=>{if((ye.key==="Backspace"||ye.key==="Delete")&&e?.length>0&&i.length===0&&D(),ye.key==="Enter"&&g(!0),ye.key==="Escape"){if(v!==-1){w(-1);return}g(!1)}ye.key==="ArrowLeft"&&L(),ye.key==="ArrowRight"&&v!==-1&&N()},[v,D,i.length,N,L,e?.length]),Q=(0,l.useMemo)(()=>n,[n]),ce=(0,l.useMemo)(()=>({value:e,onValueChange:k,open:p,setOpen:g,mappedOptions:E,options:Q,setMappedOptions:R,inputValue:i,setInputValue:u,activeIndex:v,setActiveIndex:w}),[v,i,E,Q,k,p,e]);return(0,a.jsx)(K5.Provider,{value:ce,children:(0,a.jsxs)(zx,{onKeyDown:B,className:st("overflow-visible bg-transparent flex flex-col space-y-2 !max-w-[100%]",r),...o,children:[s,(0,a.jsx)(G5,{})]})})},sS=(0,l.forwardRef)(({className:e,children:t,...n},r)=>{const{value:s,onValueChange:o,activeIndex:i,open:u,mappedOptions:p}=rS(),g=(0,l.useCallback)(v=>{v.preventDefault(),v.stopPropagation()},[]);return(0,a.jsxs)("div",{ref:r,tabIndex:0,className:st("flex flex-wrap gap-2 p-2 py-2 items-center border border-muted rounded-lg bg-background","dark:bg-slate-950 dark:text-slate-200",u&&"border-blue-600 dark:ring-blue-600 dark:border-blue-600",e),...n,children:[s?.map((v,w)=>(0,a.jsxs)(to,{"data-testid":"multiSelectSelectedItem",className:st("pl-2 pr-1 flex items-center gap-1 h-[28px]",i===w&&"ring-2 ring-muted-foreground "),variant:"secondary",children:[(0,a.jsx)(Pn,{variant:"body2",children:p?.[v]?.label}),(0,a.jsxs)("button",{"aria-roledescription":"button to remove option",type:"button","data-testid":"multiSelectRemoveOption",onMouseDown:g,onClick:()=>o(v),children:[(0,a.jsxs)("span",{className:"sr-only",children:["Remove ",p?.[v]?.label," option"]}),(0,a.jsx)(Pj,{className:"h-3 w-3 dark:text-white"})]})]},v)),t]})});sS.displayName="MultiSelectTrigger";const oS=(0,l.forwardRef)(({className:e,dataTestId:t,...n},r)=>{const{setOpen:s,inputValue:o,setInputValue:i,activeIndex:u,setActiveIndex:p}=rS();return(0,a.jsx)(uc.Input,{...n,ref:r,value:o,onValueChange:u===-1?i:void 0,"data-testid":t??"multiSelectInput",onBlur:()=>s(!1),onFocus:()=>s(!0),onClick:()=>p(-1),className:st("text-sm rounded-md border border-slate-300 px-3 py-1.5 flex-2 placeholder:text-gray-400 text-slate-900 flex-1","dark:border-gray-700 dark:bg-slate-950 dark:text-slate-200 dark:placeholder:text-gray-600 pl-0","dark:text-white","border-none focus:[box-shadow:none] focus:outline-none","disabled:bg-slate-100 disabled:select-none",e,u!==-1&&"caret-transparent")})});oS.displayName="MultiSelectInput";const G5=(0,l.forwardRef)(({children:e},t)=>{const{open:n,options:r}=rS();return(0,a.jsx)("div",{ref:t,className:"dark:border-1 relative dark:border-white",children:n?(0,a.jsx)(Q5,{children:r?.map(s=>(0,a.jsx)(Y5,{value:s?.value??"",disabled:s?.disabled,"data-testid":"multiSelectItem",children:s.label},s?.value))}):null})});G5.displayName="MultiSelectContent";const Q5=(0,l.forwardRef)(({className:e,children:t},n)=>{const{t:r}=(0,z.Bd)();return(0,a.jsxs)(NO,{ref:n,className:st("p-1 flex flex-col gap-2 rounded-md scrollbar-thin scrollbar-track-transparent transition-colors","scrollbar-thumb-muted-foreground dark:scrollbar-thumb-muted scrollbar-thumb-rounded-lg w-full","absolute bg-background shadow-md z-10 border dark:border-white top-0",e),children:[t,(0,a.jsx)(PC,{"data-testid":"multiSelectNoResult",children:(0,a.jsx)("span",{className:"text-muted-foreground",children:r("core:dataTable.noResults")})})]})});Q5.displayName="MultiSelectList";const Y5=(0,l.forwardRef)(({className:e,value:t,children:n,...r},s)=>{const{value:o,onValueChange:i,setInputValue:u}=rS(),p=(0,l.useCallback)(v=>{v.preventDefault(),v.stopPropagation()},[]),g=t?.length!==0?o?.includes(t):!1;return(0,a.jsxs)(OC,{ref:s,...r,onSelect:()=>{i(t),u("")},className:st("relative items-center flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none hover:bg-accent hover:text-accent-foreground aria-selected:bg-accent aria-selected:dark:text-white aria-selected:text-accent-foreground  data-[disabled]:pointer-events-none data-[disabled]:opacity-50 disabled:bg-slate-100",e,r.disabled&&"opacity-50 cursor-not-allowed"),onMouseDown:p,children:[g&&(0,a.jsx)("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,a.jsx)(Gv,{className:"h-4 w-4"})}),n]})});Y5.displayName="MultiSelectItem";const PG=()=>{const e=xa(),[t,n]=e.watch(["serviceBoard","ticketStatusMappingList"]),r=YE(t);return(0,l.useCallback)(s=>r?.data?.integrationStatuses?.filter(o=>{if(!SK(n,t).includes(o?.integrationTicketStatusId)||s?.length!==0&&s?.includes(o?.integrationTicketStatusId??""))return o}),[r?.data?.integrationStatuses,t,n])},OG=()=>{const{t:e}=(0,z.Bd)(),[t,n]=(0,l.useState)({}),r=xa(),s=DI(),[o]=r.watch(["serviceBoard"]),i=A_(),u=YE(o),p=PG(),g=s?.isLoading||!s?.data,v=u?.isLoading||!u?.data,w=i?.isLoading||!i?.data;(0,l.useEffect)(()=>{const E=s?.data?.optionalStatuses?.map(k=>k?.id),R=r.getValues("ticketStatusMappingList")?.[r.getValues("serviceBoard")??""];R&&Object.keys(R).some(k=>E?.includes(k))&&n(k=>({...k,[r.getValues("serviceBoard")??""]:!0}))},[s?.data?.optionalStatuses,r]);const x=()=>{o!==void 0&&n(E=>({...E,[o]:!E[o]}))};return o?v||g||w?(0,a.jsx)(zs,{floating:!0}):(0,a.jsxs)(Sa.Row,{contentContainerClassName:"md:max-w-md max-w-full",leftContent:(0,a.jsx)(Sa.LeftContent,{label:e("rsp:pages.integrations.helpdesk.connectWise.boardConfiguration.statusMapping.title"),subLabel:e("rsp:pages.integrations.helpdesk.connectWise.boardConfiguration.statusMapping.description")}),children:[u.isFetching?(0,a.jsx)(zs,{floating:!0}):null,s?.data?.requiredStatuses?.map(E=>(0,a.jsx)(Jr,{control:r.control,name:`ticketStatusMappingList.${o}.${E.id}`,render:({field:R})=>(0,a.jsxs)(qr,{children:[(0,a.jsx)(As,{children:`${E.name??""}*`}),(0,a.jsxs)(LT,{onValuesChange:R.onChange,options:p(R.value)?.map(k=>({label:k.integrationTicketStatusName,value:k?.integrationTicketStatusId})),values:R.value,children:[(0,a.jsx)(Kr,{children:(0,a.jsx)(sS,{children:(0,a.jsx)(oS,{placeholder:E?.placeholder,dataTestId:`multiSelectInput${E.type}`})})}),(0,a.jsx)(Cs,{})]})]})},`ticketStatusMappingList.${o}.${E.id}`)),t?.[o]?s?.data?.optionalStatuses?.map(E=>(0,a.jsx)(Jr,{control:r.control,name:`ticketStatusMappingList.${o}.${E.id}`,render:({field:R})=>(0,a.jsxs)(qr,{children:[(0,a.jsx)(As,{children:E.name}),(0,a.jsxs)(LT,{onValuesChange:R.onChange,options:p(R.value)?.map(k=>({label:k.integrationTicketStatusName,value:k?.integrationTicketStatusId})),values:R.value,children:[(0,a.jsx)(Kr,{children:(0,a.jsx)(sS,{children:(0,a.jsx)(oS,{dataTestId:`multiSelectInput${E.type}`,placeholder:E?.placeholder})})}),(0,a.jsx)(Cs,{})]})]})},`ticketStatusMappingList.${o}.${E.id}`)):null,(0,a.jsx)("div",{children:(0,a.jsx)(mn,{variant:"None",type:"button",className:"inline-block pl-0 pt-0 text-sm text-blue-600 underline focus-visible:outline-indigo-300",onClick:x,"data-testid":"btnShowHideOptionalStatuses",children:t?.[o]?`- ${e("rsp:pages.integrations.helpdesk.connectWise.boardConfiguration.statusMapping.showLessStatuses")}`:`+ ${e("rsp:pages.integrations.helpdesk.connectWise.boardConfiguration.statusMapping.showMoreStatuses")}`})})]}):null},FT="Checkbox",[NG,Lpe]=va(FT),[AG,IG]=NG(FT),X5=(0,l.forwardRef)((e,t)=>{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:o,required:i,disabled:u,value:p="on",onCheckedChange:g,...v}=e,[w,x]=(0,l.useState)(null),E=Lr(t,B=>x(B)),R=(0,l.useRef)(!1),k=w?Boolean(w.closest("form")):!0,[N=!1,L]=si({prop:s,defaultProp:o,onChange:g}),D=(0,l.useRef)(N);return(0,l.useEffect)(()=>{const B=w?.form;if(B){const Q=()=>L(D.current);return B.addEventListener("reset",Q),()=>B.removeEventListener("reset",Q)}},[w,L]),(0,l.createElement)(AG,{scope:n,state:N,disabled:u},(0,l.createElement)(zn.button,(0,Je.A)({type:"button",role:"checkbox","aria-checked":g0(N)?"mixed":N,"aria-required":i,"data-state":eD(N),"data-disabled":u?"":void 0,disabled:u,value:p},v,{ref:E,onKeyDown:gn(e.onKeyDown,B=>{B.key==="Enter"&&B.preventDefault()}),onClick:gn(e.onClick,B=>{L(Q=>g0(Q)?!0:!Q),k&&(R.current=B.isPropagationStopped(),R.current||B.stopPropagation())})})),k&&(0,l.createElement)(jG,{control:w,bubbles:!R.current,name:r,value:p,checked:N,required:i,disabled:u,style:{transform:"translateX(-100%)"}}))}),Z5="CheckboxIndicator",J5=(0,l.forwardRef)((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...s}=e,o=IG(Z5,n);return(0,l.createElement)(la,{present:r||g0(o.state)||o.state===!0},(0,l.createElement)(zn.span,(0,Je.A)({"data-state":eD(o.state),"data-disabled":o.disabled?"":void 0},s,{ref:t,style:{pointerEvents:"none",...e.style}})))}),jG=e=>{const{control:t,checked:n,bubbles:r=!0,...s}=e,o=(0,l.useRef)(null),i=Db(n),u=Wv(t);return(0,l.useEffect)(()=>{const p=o.current,g=window.HTMLInputElement.prototype,w=Object.getOwnPropertyDescriptor(g,"checked").set;if(i!==n&&w){const x=new Event("click",{bubbles:r});p.indeterminate=g0(n),w.call(p,g0(n)?!1:n),p.dispatchEvent(x)}},[i,n,r]),(0,l.createElement)("input",(0,Je.A)({type:"checkbox","aria-hidden":!0,defaultChecked:g0(n)?!1:n},s,{tabIndex:-1,ref:o,style:{...e.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function g0(e){return e==="indeterminate"}function eD(e){return g0(e)?"indeterminate":e?"checked":"unchecked"}const tD=X5,DG=J5;/**
 * @license lucide-react v0.330.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const MG=l0("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
 * @license lucide-react v0.330.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const nD=l0("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),$G=Nl("group peer h-4 w-4 shrink-0 rounded-sm border ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=unchecked]:border-slate-400 data-[state=checked]:text-primary-foreground data-[state=indeterminate]:text-white dark:text-white",{variants:{variant:{primary:"border-primary data-[state=checked]:bg-primary data-[state=indeterminate]:bg-primary",secondary:"border-indigo data-[state=checked]:bg-indigo-600 data-[state=indeterminate]:bg-indigo-600"}},defaultVariants:{variant:"primary"}}),wy=l.forwardRef(({className:e,variant:t,...n},r)=>(0,a.jsx)(tD,{ref:r,className:st($G({variant:t}),e),...n,children:(0,a.jsxs)(DG,{className:st("flex items-center justify-center text-current"),children:[(0,a.jsx)(MG,{className:"hidden h-4 w-4 group-data-[state=indeterminate]:block"}),(0,a.jsx)(nD,{className:"hidden h-4 w-4 group-data-[state=checked]:block"})]})}));wy.displayName=tD.displayName;const zT=Nl("font-regular flex w-full space-x-3 border-t border-slate-300 p-4 text-sm text-gray-900 first:rounded-t-[0.2rem] first:border-none last:rounded-b-[0.2rem] hover:cursor-pointer peer-disabled:cursor-not-allowed peer-disabled:opacity-70 dark:bg-slate-900 dark:text-white"),LG=({children:e})=>(0,a.jsx)("div",{className:"mr-4 flex items-center",children:e}),UT=({children:e,className:t="",onClick:n,dataTestId:r})=>(0,a.jsx)("ul",{"data-testid":r,className:st("border border-t border-slate-300 rounded",t),onClick:n,children:e}),FG=({asChild:e,as:t,children:n,className:r="",...s})=>{const o=e?Qa:t??"li";return(0,a.jsx)(o,{...s,className:st(zT(),r),children:n})};UT.Item=FG,UT.Actions=LG;const zl=UT,zG=()=>{const{t:e}=(0,z.Bd)(),t=xa(),[n,r]=t.watch(["serviceBoard","ticketTypes"]),s=MI(n),o=n?r?.[n]:[],i=s?.isLoading||!s?.data,u=t.formState.errors.ticketTypes?.[n??""];return n?i?(0,a.jsx)(zs,{floating:!0}):s?.data?.ticketTypes?.length===0?null:(0,a.jsx)(Sa.Row,{contentContainerClassName:"md:max-w-md max-w-full",leftContent:(0,a.jsx)(Sa.LeftContent,{label:e("rsp:pages.integrations.helpdesk.connectWise.boardConfiguration.ticketTypes.title"),subLabel:e("rsp:pages.integrations.helpdesk.connectWise.boardConfiguration.ticketTypes.description")}),children:(0,a.jsxs)(xo,{padded:!1,className:"px-6 py-8","data-testid":"containerHelpdeskTicketTypes",children:[(0,a.jsx)(zl,{children:s?.data?.ticketTypes?.map(p=>(0,a.jsx)(zl.Item,{className:st("p-0",{"bg-indigo-100 dark:text-slate-200":qj(p.integrationId,o)}),children:(0,a.jsx)(Jr,{control:t.control,name:`ticketTypes.${n}`,render:({field:g})=>(0,a.jsx)(qr,{className:"w-full",children:(0,a.jsxs)(As,{className:zT({className:"space-x-0"}),children:[(0,a.jsx)(zl.Actions,{children:(0,a.jsx)(Kr,{children:(0,a.jsx)(wy,{"data-testid":"checkboxTicketType",variant:"secondary",checked:qj(p.integrationId,o),onCheckedChange:v=>{v?g.onChange([...g.value??[],p.integrationId]):g.onChange(g.value?.filter(w=>w!==p.integrationId))}})})}),(0,a.jsx)(Pn,{variant:"body2",weight:"default",className:"flex",children:p.name})]})})},`ticketTypes.${n}`)},p.integrationId))}),u?(0,a.jsx)("div",{className:st(U_(),"mt-4"),children:e("rsp:pages.integrations.helpdesk.connectWise.boardConfiguration.oneTicketTypeAtleast")}):null]})}):null},UG=({form:e})=>{const[t]=e.watch(["serviceBoard"]),n=YE(t),r=MI(t),s=A_(),o=QE(),i=(0,l.useCallback)(p=>{p!==void 0&&e.setValue("serviceBoard",p)},[e]),u=(0,l.useCallback)(p=>{p!==void 0&&e.reset({serviceBoard:o?.data,ticketStatusMappingList:{...e.getValues("ticketStatusMappingList"),[p]:{...n?.data?.ticketStatusMappingList?.[p]}},ticketTypes:{...e.getValues("ticketTypes"),[p]:Array.from(new Set([...r?.data?.configured?.[p]??[]]))}})},[o?.data,n?.data?.ticketStatusMappingList,r?.data?.configured,e]);return{setFormServiceBoard:i,setFormValues:u,isServiceBoardLoading:s?.isLoading||!s?.data}},BG=()=>gw(gw(Ds(),yc(CT(Ds())))),VG=()=>{const t=DI()?.data?.requiredStatuses?.map(n=>n.id);return tl({serviceBoard:yc(Ds()).refine(n=>n!==void 0,"rsp:validations.mixed.required"),ticketStatusMappingList:BG(),ticketTypes:gw(Ds(),yc(CT(Ds())))}).superRefine((n,r)=>{const{serviceBoard:s,ticketStatusMappingList:o,ticketTypes:i}=n;s!==void 0&&(t?.forEach(u=>{(!o?.[s]?.[u]||o?.[s]?.[u]?.length===0)&&r.addIssue({code:yn.custom,message:"rsp:validations.mixed.required",path:[`ticketStatusMappingList[${s}][${u}]`]})}),i[s]?.length===0&&r.addIssue({code:yn.custom,message:"rsp:pages.integrations.helpdesk.connectWise.boardConfiguration.oneTicketTypeAtleast",path:[`ticketTypes[${s}].ticketTypesMapping`]}))})},HG=Ll(()=>{const{t:e}=(0,z.Bd)(),[t,n]=(0,l.useState)(!1),r=VG(),s=hc({resolver:mc(r),defaultValues:_K}),o=Pd(),i=QE(),u=TW(),{isServiceBoardLoading:p,setFormServiceBoard:g,setFormValues:v}=UG({form:s});(0,l.useEffect)(()=>{!i.isLoading&&i?.data&&g(i?.data)},[i?.data,i.isLoading,g]),(0,l.useEffect)(()=>{i?.data!==void 0&&s.getValues("serviceBoard")===i?.data&&v(i?.data)},[i?.data,s,v]);const w=()=>{u.mutate(s.getValues())},x=E=>{!i?.isLoading&&i?.data!==void 0&&i?.data!==s.getValues("serviceBoard")?n(!0):u.mutate(E)};return o?.isEnabled?p||o?.isLoading?(0,a.jsx)(zs,{floating:!0}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(gc,{...s,children:(0,a.jsxs)(Sa,{onSubmit:s.handleSubmit(x),children:[(0,a.jsx)(Sa.Wrapper,{children:(0,a.jsx)(RG,{})}),(0,a.jsx)(Sa.Wrapper,{children:(0,a.jsx)(OG,{})}),(0,a.jsx)(Sa.Wrapper,{children:(0,a.jsx)(zG,{})}),(0,a.jsx)(V_,{showLoader:u?.isLoading,disabled:u?.isLoading})]})}),(0,a.jsx)(Vc,{open:t,title:e("rsp:pages.integrations.helpdesk.connectWise.boardConfiguration.modal.title"),onClose:()=>n(!1),onConfirm:w,cancelButtonText:e("rsp:actions.cancel"),confirmButtonText:e("rsp:actions.save"),children:e("rsp:pages.integrations.helpdesk.connectWise.boardConfiguration.modal.description")})]}):(0,a.jsx)(hi,{replace:!0,to:Sr.IntegrationsConnectWiseApiInformation})},[oe.aX.IntegrationConfigure,oe.aX.IntegrationList]);function WG({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m5.231 13.481L15 17.25m-4.5-15H5.625c-.621 0-1.125.504-1.125 1.125v16.5c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Zm3.75 11.625a2.625 2.625 0 1 1-5.25 0 2.625 2.625 0 0 1 5.25 0Z"}))}const qG=l.forwardRef(WG),xy=({emptyMessage:e,hasBorder:t=!0,dataTestId:n,className:r})=>{const{t:s}=(0,z.Bd)();return(0,a.jsxs)("div",{className:st("flex w-full flex-col items-center justify-center gap-4 rounded-xl p-8 font-normal text-gray-300 md:h-60",{"border-2 border-dashed border-gray-300":t},r),"data-testid":`noResults${Sd(n)}`,children:[(0,a.jsx)(qG,{className:"h-16 w-16 stroke-1"}),(0,a.jsx)("p",{children:e??s("core:dataTable.noResults")})]})},KG=({form:e,submittedOrganizations:t})=>{const{t:n}=(0,z.Bd)(),r=kW();(0,l.useEffect)(()=>{r?.isSuccess&&r?.data?.organizationMappingResults?.forEach(i=>{i.isMapped&&e.setValue(`organizations.${i.id}`,void 0)})},[r?.data?.organizationMappingResults,r?.isSuccess,e]),(0,l.useEffect)(()=>{t?.length!==0&&t?.forEach(i=>{i?.isMapped!==void 0&&!i?.isMapped&&(e.setValue("organizations",{[i?.id]:i?.value}),e.setError(`organizations.${i?.id}`,{message:n("rsp:pages.integrations.helpdesk.connectWise.organizationMapping.failedMappingError")}))})},[t]);const s=(0,l.useCallback)((i,u)=>{u?.forEach(p=>{i.organizations?.[p?.id]||e.setError(`organizations.${p?.id}`,{message:n("rsp:validations.mixed.required")})})},[]),o=(0,l.useCallback)(i=>r?.data&&r?.data?.organizationMappingResults?.length!==0?i?.map(u=>{const g={...r?.data?.organizationMappingResults?.find(v=>v.id===u.id&&!v?.isMapped),value:r?.variables?.organizations?.[u.id]??""};return{...u,...g}})??[]:[],[r?.data,r?.variables?.organizations]);return{setRequiredError:s,getFailedOrganizationsMapping:o,connetWiseMapOrganizationMutation:r}},GG=()=>tl({organizations:gw(Ds(),yc(Ds()))}),QG={organizations:{}},YG=({disabled:e})=>{const{t}=(0,z.Bd)(),n=xa(),r=XE();return(0,a.jsx)(Sa.RowCard,{contentContainerClassName:"md:max-w-md max-w-full",leftContent:(0,a.jsx)(Sa.LeftContent,{label:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[t("rsp:pages.integrations.helpdesk.connectWise.organizationMapping.title"),(0,a.jsx)(Pn,{as:"div",children:(0,a.jsx)($l,{className:"max-w-lg",tooltip:t("rsp:pages.integrations.helpdesk.connectWise.organizationMapping.titleTooltip"),children:(0,a.jsx)(c0,{className:"h-4 w-4"})})})]}),subLabel:t("rsp:pages.integrations.helpdesk.connectWise.organizationMapping.description")}),children:r?.data?.map(({name:s,id:o})=>(0,a.jsx)(Jr,{control:n.control,name:`organizations.${o}`,render:({field:i})=>(0,a.jsxs)(qr,{children:[(0,a.jsx)(As,{children:s}),(0,a.jsx)(Kr,{children:(0,a.jsx)(_a,{...i,disabled:e,"data-testid":"inputOrganizationMapping",placeholder:t("rsp:pages.integrations.helpdesk.connectWise.organizationMapping.organizationIdPlaceholder"),onChange:u=>{n.clearErrors(`organizations.${o}`),i.onChange(u?.target.value)}})}),(0,a.jsx)(Cs,{})]})},`organizations.${o}`))})},XG=Ll(()=>{const{t:e}=(0,z.Bd)(),t=GG(),[n,r]=(0,l.useState)([]),s=hc({resolver:mc(t),defaultValues:QG}),o=Pd(),i=XE(),u=!i?.isLoading&&!!i?.data&&i?.data?.length===0,{setRequiredError:p,getFailedOrganizationsMapping:g,connetWiseMapOrganizationMutation:v}=KG({form:s,submittedOrganizations:n}),w=x=>{if(Object.keys(x.organizations)?.every(R=>!x.organizations[R])){p(x,i?.data);return}r([]),v.mutate(x)};return Af({isDirty:Object.values(s.getValues("organizations")).some(Boolean)}),(0,l.useEffect)(()=>{r(g(i?.data))},[g,i?.data]),o?.isEnabled?o.isLoading||i?.isLoading||!i?.data?(0,a.jsx)(zs,{floating:!0}):u?(0,a.jsx)(xy,{dataTestId:"organizationMapping",className:"mt-8 md:mt-16",emptyMessage:e("rsp:pages.integrations.helpdesk.connectWise.organizationMapping.allOrganizationsMappedTitle")}):(0,a.jsx)(gc,{...s,children:(0,a.jsxs)(Sa,{className:"md:py-4",onSubmit:s.handleSubmit(w),children:[(0,a.jsx)(Pn,{className:"mt-1 md:mt-8",variant:"body2",children:e("rsp:pages.integrations.helpdesk.connectWise.organizationMapping.pageHeading")}),(0,a.jsx)(Sa.Wrapper,{children:(0,a.jsx)(YG,{disabled:v?.isLoading})}),(0,a.jsx)(V_,{showLoader:v?.isLoading,disabled:v?.isLoading})]})}):(0,a.jsx)(hi,{replace:!0,to:Sr.IntegrationsConnectWiseApiInformation})},[oe.aX.IntegrationConfigure,oe.aX.IntegrationList]);class rD{static getServiceProvidersConfiguration(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/resellers/{resellerId}/service-provider-configurations";o=o.replace("{resellerId}",t.resellerId+"");const i=(0,oe.Y_)("get","application/json",o,n);(0,oe.pY)(i,r,s)})}static setServiceProvidersConfiguration(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/resellers/{resellerId}/service-provider-configurations";o=o.replace("{resellerId}",t.resellerId+"");const i=(0,oe.Y_)("post","application/json",o,n);let u=t.command;i.data=u,(0,oe.pY)(i,r,s)})}}class ZG{static getServiceProviders(t={}){return new Promise((n,r)=>{let s=oe.Jp+"/ServiceProviders";const o=(0,oe.Y_)("get","application/json",s,t);(0,oe.pY)(o,n,r)})}}const BT={queryKey:()=>["ServiceProvidersService/getServiceProviders"],queryFn:async()=>await ZG.getServiceProviders(),staleTime:60*60*1e3},aS={queryKey:e=>["ServiceProvidersConfigurationService/getServiceProvidersConfiguration",e],queryFn:async e=>e?await rD.getServiceProvidersConfiguration({resellerId:e}):await(0,oo.Ui)(),staleTime:60*60*1e3},JG=()=>(0,js.I)({queryKey:BT.queryKey(),queryFn:async()=>await BT.queryFn(),staleTime:BT.staleTime}),sD=e=>{const t=wa();return(0,js.I)({queryKey:aS.queryKey(t),queryFn:async()=>await aS.queryFn(t),staleTime:aS.staleTime,...e})},eQ=()=>sD({select:e=>e?.[0]}),oD=()=>{const{t:e}=(0,z.Bd)(),t=(0,V.jE)(),n=wa();return(0,Vo.n)({mutationFn:async r=>{if(!n||!r?.serviceProviderId)throw(0,oo.XY)();return await rD.setServiceProvidersConfiguration({resellerId:n,command:{serviceProviderId:r.serviceProviderId,privateApiKey:r?.clientSecret,publicApiKey:r?.clientId,subscriptionKey:r?.subscriptionKey}})},onError:()=>{(0,Yr.A2)(e("rsp:pages.integrations.serviceProvider.sherweb.updateFailureMessage"))},onSuccess:async()=>{(0,Yr.v0)(e("rsp:pages.integrations.serviceProvider.sherweb.updateSuccessMessage")),await t.invalidateQueries({queryKey:aS.queryKey(n)})}})},aD={clientId:"",clientSecret:"",subscriptionKey:"",serviceProviderId:""},tQ=({form:e})=>{const[t,n]=(0,l.useState)(!1),r=(0,l.useCallback)(o=>{e.reset(o)},[e]),s=(0,l.useCallback)(()=>{e.reset({...aD,serviceProviderId:e.getValues("serviceProviderId")}),e.clearErrors(),n(o=>!o)},[e]);return{isEditMode:t,onResetEditMode:s,setFormValues:r,setIsEditMode:n}},nQ=e=>[{id:"clientId",value:e.clientId},{id:"clientSecret",value:e.clientSecret},{id:"subscriptionKey",value:e.subscriptionKey}],rQ=()=>tl({clientSecret:yc(Ds()),subscriptionKey:yc(Ds()),serviceProviderId:yc(Ds()),clientId:yc(Ds().uuid("rsp:pages.integrations.serviceProvider.sherweb.form.errorClientIdFormat"))}).superRefine((e,t)=>{(nQ(e).filter(r=>!r.value)?.map(r=>r.id)).forEach(r=>{t.addIssue({code:yn.custom,message:"rsp:validations.mixed.required",path:[r]})})}),iD=({className:e,children:t})=>{const{t:n}=(0,z.Bd)();return(0,a.jsx)(Sa.Wrapper,{children:(0,a.jsx)(Sa.RowCard,{contentContainerClassName:st("md:max-w-md max-w-full bg-white/50 gap-y-2 dark:bg-slate-950",e),leftContent:(0,a.jsx)(Sa.LeftContent,{label:n("rsp:pages.integrations.serviceProvider.sherweb.keysTitle"),subLabel:(0,a.jsx)(z.x6,{i18nKey:"rsp:pages.integrations.serviceProvider.sherweb.keysDescription",children:(0,a.jsx)(ka,{to:"https://github.com/sherweb/Public-Apis/blob/master/README.md#prerequisite-for-using-the-apis",target:"_blank",className:"font-semibold text-indigo-600 hover:underline"})})}),children:t})})},sQ=({serviceProvider:e,onResetEditMode:t})=>{const{t:n}=(0,z.Bd)();return(0,a.jsxs)(iD,{children:[(0,a.jsx)(fc,{children:(0,a.jsx)(Pn,{variant:"body1",weight:"semiBold",children:n("rsp:pages.integrations.serviceProvider.sherweb.form.title")})}),(0,a.jsx)(fc,{children:(0,a.jsxs)(Pn,{colors:"light",variant:"body2","data-testid":"textSherwebServiceProviderPublicKey",children:[n("rsp:pages.integrations.serviceProvider.sherweb.form.clientIdKey"),":"," ",e?.clientId]})}),(0,a.jsx)("div",{className:"flex justify-end pt-6",children:(0,a.jsx)(mn,{variant:"None",className:"bg-indigo-600 px-4 py-2 hover:bg-indigo-700",onClick:()=>{t()},"data-testid":"btnSherwebServiceProviderReset",children:n("rsp:actions.reset")})})]})},oQ=({isEditMode:e=!1,isLoading:t=!1,onResetEditMode:n})=>{const{t:r}=(0,z.Bd)(),s=xa();return(0,a.jsxs)(iD,{className:st("md:max-w-md max-w-full dark:bg-slate-950 py-8",{"pb-12":!e}),children:[(0,a.jsx)(Jr,{control:s.control,name:"clientId",render:({field:o})=>(0,a.jsxs)(qr,{children:[(0,a.jsx)(As,{children:r("rsp:pages.integrations.serviceProvider.sherweb.form.clientIdKey")}),(0,a.jsx)(Kr,{children:(0,a.jsx)(_a,{...o,"data-testid":"inputSherwebServiceProviderClientId",disabled:t,placeholder:r("rsp:pages.integrations.serviceProvider.sherweb.form.clientIdKeyPlaceholder")})}),(0,a.jsx)(Cs,{})]})}),(0,a.jsx)(Jr,{control:s.control,name:"clientSecret",render:({field:o})=>(0,a.jsxs)(qr,{children:[(0,a.jsx)(As,{children:r("rsp:pages.integrations.serviceProvider.sherweb.form.clientSecretKey")}),(0,a.jsx)(Kr,{children:(0,a.jsx)(_a,{...o,"data-testid":"inputSherwebServiceProviderClientSecret",disabled:t,placeholder:r("rsp:pages.integrations.serviceProvider.sherweb.form.clientSecretKeyPlaceholder")})}),(0,a.jsx)(Cs,{})]})}),(0,a.jsx)(Jr,{control:s.control,name:"subscriptionKey",render:({field:o})=>(0,a.jsxs)(qr,{children:[(0,a.jsx)(As,{children:r("rsp:pages.integrations.serviceProvider.sherweb.form.subscriptionKey")}),(0,a.jsx)(Kr,{children:(0,a.jsx)(_a,{...o,"data-testid":"inputSherwebServiceProviderSubscriptionKey",disabled:t,placeholder:r("rsp:pages.integrations.serviceProvider.sherweb.form.subscriptionKeyPlaceholder")})}),(0,a.jsx)(Cs,{})]})}),e?(0,a.jsx)("div",{className:"flex justify-end pt-6",children:(0,a.jsx)(mn,{className:"px-4 py-2",variant:No.Outline,onClick:()=>{n()},"data-testid":"btnSherwebServiceProviderCancel",children:r("rsp:actions.cancel")})}):null]})},aQ=Ll(()=>{const e=eQ(),t=oD(),n=rQ(),r=hc({resolver:mc(n),defaultValues:aD}),s=!!e?.data,{isEditMode:o,setIsEditMode:i,setFormValues:u,onResetEditMode:p}=tQ({form:r});Af({isDirty:r.formState.isDirty&&o}),(0,l.useEffect)(()=>{e?.data&&u(e?.data)},[e?.data]),(0,l.useEffect)(()=>{t?.isSuccess&&i(!1)},[t?.isSuccess]);const g=v=>{t.mutate(v)};return e?.isLoading||!e?.data?(0,a.jsx)(zs,{floating:!0}):(0,a.jsx)(gc,{...r,children:(0,a.jsxs)(Sa,{className:"!py-3",onSubmit:r.handleSubmit(g),children:[s&&!o?(0,a.jsx)(sQ,{serviceProvider:e?.data,onResetEditMode:p}):(0,a.jsx)(oQ,{isEditMode:o,onResetEditMode:p,isLoading:t?.isLoading}),(0,a.jsx)(V_,{showLoader:t?.isLoading,disabled:t?.isLoading})]})})},oe.aX.ResellerAdmin),iQ=Ll(()=>{const{t:e}=(0,z.Bd)();return(0,a.jsxs)(Wu,{children:[(0,a.jsxs)("div",{className:"mb-8 sm:mb-16",children:[(0,a.jsx)(vl,{to:Sr.Integrations,"data-testid":"linkBackToIntegrations",children:(0,a.jsx)(a0,{children:e("rsp:pages.integrations.backLink")})}),(0,a.jsx)(yl,{title:(0,a.jsx)(el,{"data-testid":"pageSherwebServiceProviderTitle",children:e("rsp:pages.integrations.serviceProvider.sherweb.title")}),subTitle:(0,a.jsx)(qu,{children:e("rsp:pages.integrations.serviceProvider.sherweb.subTitle")})})]}),(0,a.jsx)(aQ,{})]})},[]),lQ=()=>{const e=ks();return(0,a.jsx)(hi,{replace:!0,to:Un.Login,state:e.state})};var VT=ln(4357);class bw{static getAvailableCatalogsByResellerId(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/resellers/{resellerId}/catalogs";o=o.replace("{resellerId}",t.resellerId+"");const i=(0,oe.Y_)("get","application/json",o,n);(0,oe.pY)(i,r,s)})}static getAvailableProducts(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/resellers/{resellerId}/catalogs/{catalogId}/available-products";o=o.replace("{resellerId}",t.resellerId+""),o=o.replace("{catalogId}",t.catalogId+"");const i=(0,oe.Y_)("get","application/json",o,n);(0,oe.pY)(i,r,s)})}static getProducts(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/resellers/{resellerId}/catalogs/{catalogId}/products";o=o.replace("{resellerId}",t.resellerId+""),o=o.replace("{catalogId}",t.catalogId+"");const i=(0,oe.Y_)("get","application/json",o,n);(0,oe.pY)(i,r,s)})}static setProducts(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/resellers/{resellerId}/catalogs/{catalogId}/products";o=o.replace("{resellerId}",t.resellerId+""),o=o.replace("{catalogId}",t.catalogId+"");const i=(0,oe.Y_)("post","application/json",o,n);let u=t.command;i.data=u,(0,oe.pY)(i,r,s)})}static queryCatalogOrganizations(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/resellers/{resellerId}/catalogs/organizations/search";o=o.replace("{resellerId}",t.resellerId+"");const i=(0,oe.Y_)("post","application/json",o,n);i.params={catalogId:t.catalogId};let u=t.command;i.data=u,(0,oe.pY)(i,r,s)})}}const cQ=e=>{if(!e)return{totalOffersCount:0,selectedOffers:[],products:[],allOfferSkus:[],allOffers:[]};let t=[],n=[],r=[];const s=e?.map(o=>({...o,offers:o?.offers?.map(i=>{n=[...n,i?.sku??""];const u={...i,id:i.sku};return r=[...r,u],i.isSelected&&(t=[...t,{...i,id:i.sku}]),u})??[]}));return{selectedOffers:t,totalOffersCount:r.length,products:s??[],allOfferSkus:n,allOffers:r}},HT=e=>({page:1,pageSize:20,query:"",sortBy:oe.fC.NameAscending,filter:oe.F2.All,...e}),lD=1e7,uQ=()=>{const e=(0,V.jE)();return{updateProducts:(n,r)=>{const s=e.getQueryData(n)??void 0;return e.setQueryData(n,{...s,availableCatalogProducts:s?.availableCatalogProducts?.map(o=>({...o,offers:o.offers?.map(i=>r.skusToAdd?.includes(i.sku??"")?{...i,isSelected:!0}:r.skusToRemove?.includes(i.sku??"")?{...i,isSelected:!1}:i)}))}),s}}},WT={queryKey:e=>(0,Os.getLocalizedQueryKey)(["ResellerCatalogsService/getAvailableCatalogsByResellerId",e]),queryFn:async e=>e?await bw.getAvailableCatalogsByResellerId({resellerId:e}):await Promise.reject((0,oo.XY)()),staleTime:Aa},qT={queryKey:(e,t)=>(0,Os.getLocalizedQueryKey)(["ResellerCatalogsService/getProducts",e,t]),queryFn:async(e,t)=>!e||!t?await Promise.reject((0,oo.XY)()):await bw.getProducts({resellerId:e,catalogId:t}),staleTime:Aa},iS={queryKey:(e,t)=>(0,Os.getLocalizedQueryKey)(["ResellerCatalogsService/getAvailableProducts",e,t]),queryFn:async(e,t)=>!e||!t?await Promise.reject((0,oo.XY)()):await bw.getAvailableProducts({resellerId:e,catalogId:t}),staleTime:Aa},KT={queryKey:(e,t,n=HT())=>(0,Os.getLocalizedQueryKey)(["ResellerCatalogsService/queryCatalogOrganizations",e,t,n]),queryFn:async(e,t,n=HT())=>!e||!t?await Promise.reject((0,oo.XY)()):await bw.queryCatalogOrganizations({resellerId:e,catalogId:t,command:n}),staleTime:Aa},cD=e=>{const t=wa();return(0,js.I)({queryKey:WT.queryKey(t),queryFn:async()=>await WT.queryFn(t),enabled:!!t,staleTime:WT.staleTime,...e})},GT=e=>cD({select:t=>t?.find(n=>n.id===e)}),dQ=e=>{const t=wa();return(0,js.I)({queryKey:qT.queryKey(t,e),queryFn:async()=>await qT.queryFn(t,e),enabled:!!t&&!!e,staleTime:qT.staleTime})},uD=e=>{const t=wa();return(0,js.I)({queryKey:iS.queryKey(t,e),queryFn:async()=>await iS.queryFn(t,e),select:n=>cQ(n.availableCatalogProducts),enabled:!!t&&!!e,staleTime:iS.staleTime})},QT=(e,t)=>{const n=wa(),r={...HT(),...t},{isLoggedIn:s}=(0,zr.m)();return(0,VT.q)({queryKey:KT.queryKey(n,e,r),queryFn:async({pageParam:o=1})=>await KT.queryFn(n,e,{...r,page:o}),enabled:s&&!!n&&!!e,keepPreviousData:!0,staleTime:KT.staleTime,getNextPageParam:o=>o?.hasNextPage?o?.pageIndex+1:null})},fQ=e=>{const{t}=(0,z.Bd)(),n=wa(),{updateProducts:r}=uQ();return(0,Vo.n)({mutationFn:async s=>{if(!n||!e)throw(0,oo.XY)();return await bw.setProducts({resellerId:n,catalogId:e,command:s})},onSuccess:async(s,o)=>{const i=iS.queryKey(n,e);r(i,o),(0,Yr.v0)(t("rsp:pages.marketplace.addProducts.confirmation.updateCatalogSuccessMessage"))},onError:()=>{(0,Yr.A2)(t("rsp:pages.marketplace.addProducts.confirmation.updateCatalogFailureMessage"))}})},Ha=({className:e,...t})=>(0,a.jsx)("div",{className:st("animate-pulse rounded-md bg-slate-200 dark:bg-slate-950 rounded-md",e),...t}),Hp=({count:e=4})=>(0,a.jsx)("div",{className:"flex flex-col justify-center gap-y-6","data-testid":"skeletonTable",children:Array.from({length:e},(t,n)=>(0,a.jsx)(Ha,{className:"h-[40px] w-full"},n))}),dD=({count:e=2,className:t,children:n})=>(0,a.jsx)(a.Fragment,{children:Array.from({length:e},(r,s)=>(0,a.jsxs)(xo,{className:st("flex h-56 flex-col justify-between md:p-4",t),"data-testid":"skeletonMarketplaceCard",children:[(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)(fc,{children:(0,a.jsx)(Ha,{className:"mb-2 h-[16px] w-20"})}),(0,a.jsx)(Ha,{className:"h-[16px] w-20"})]}),n,(0,a.jsx)("div",{className:"mt-4",children:(0,a.jsxs)("div",{className:"flex justify-start",children:[(0,a.jsx)("div",{className:"flex items-center gap-1",children:(0,a.jsx)(Ha,{className:"h-[16px] w-20"})}),(0,a.jsx)("div",{className:"ml-4 flex items-center gap-1",children:(0,a.jsx)(Ha,{className:"h-[16px] w-20"})})]})})]},s))});function pQ({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 21h19.5m-18-18v18m10.5-18v18m6-13.5V21M6.75 6.75h.75m-.75 3h.75m-.75 3h.75m3-6h.75m-.75 3h.75m-.75 3h.75M6.75 21v-3.375c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21M3 3h12m-.75 4.5H21m-3.75 3.75h.008v.008h-.008v-.008Zm0 3h.008v.008h-.008v-.008Zm0 3h.008v.008h-.008v-.008Z"}))}const fD=l.forwardRef(pQ),hQ=({catalog:e})=>{const{t}=(0,z.Bd)(),{navigate:n}=Ni(),r=()=>{n(Sr.MarketplaceCatalogProducts,{catalogId:e.id})};return(0,a.jsxs)(xo,{className:"flex h-40 flex-col justify-between hover:cursor-pointer md:p-4","data-testid":"cardCatalog",onClick:r,children:[(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)(fc,{children:(0,a.jsx)(Pn,{variant:"heading6",weight:"bold",children:e.name})}),(0,a.jsx)(Pn,{variant:"label",colors:"light",children:e.description})]}),(0,a.jsx)("div",{className:"mt-4",children:(0,a.jsxs)("div",{className:"flex flex-wrap justify-start gap-x-4 gap-y-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(fD,{className:"h-4 w-4 shrink-0 opacity-50 dark:text-white"}),(0,a.jsxs)(Pn,{variant:"label",colors:"light",children:[t("rsp:pages.marketplace.labels.organizations")," - ",e.numberOrganizations]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(hE,{className:"h-4 w-4 shrink-0 opacity-50 dark:text-white"}),(0,a.jsxs)(Pn,{variant:"label",colors:"light",children:[t("rsp:pages.marketplace.labels.skus")," - ",e.numberSkus]})]})]})})]},e.id)},mQ=Ll(()=>{const{t:e}=(0,z.Bd)(),t=cD();return(0,a.jsx)(Wu,{children:(0,a.jsxs)("div",{className:"flex flex-col gap-12 md:gap-16",children:[(0,a.jsx)(yl,{title:(0,a.jsx)(el,{"data-testid":"pageMarketplaceTitle",children:e("rsp:pages.marketplace.title")}),subTitle:(0,a.jsx)(qu,{"data-testid":"pageMarketplaceSubTitle",children:e("rsp:pages.marketplace.subtitle")})}),(0,a.jsx)("div",{className:"mt-4 grid grid-cols-1 gap-4 lg:gap-6 xl:grid-cols-1",children:(0,a.jsx)("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-2 lg:grid-cols-3 lg:gap-6 xl:grid-cols-4",children:(0,Os.isRequestLoading)(t)?(0,a.jsx)(dD,{className:"h-40"}):t?.data?.map(n=>(0,a.jsx)(hQ,{catalog:n},n.id))})})]})})},oe.aX.CatalogManagementList);var gQ=ln(4841),v0=ln.n(gQ);function Sm(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e?.(s),n===!1||!s.defaultPrevented)return t?.(s)}}function vQ(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function yQ(...e){return t=>e.forEach(n=>vQ(n,t))}function y0(...e){return l.useCallback(yQ(...e),e)}function bQ(e,t){const n=l.createContext(t),r=o=>{const{children:i,...u}=o,p=l.useMemo(()=>u,Object.values(u));return(0,a.jsx)(n.Provider,{value:p,children:i})};r.displayName=e+"Provider";function s(o){const i=l.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,s]}function wQ(e,t=[]){let n=[];function r(o,i){const u=l.createContext(i),p=n.length;n=[...n,i];const g=w=>{const{scope:x,children:E,...R}=w,k=x?.[e]?.[p]||u,N=l.useMemo(()=>R,Object.values(R));return(0,a.jsx)(k.Provider,{value:N,children:E})};g.displayName=o+"Provider";function v(w,x){const E=x?.[e]?.[p]||u,R=l.useContext(E);if(R)return R;if(i!==void 0)return i;throw new Error(`\`${w}\` must be used within \`${o}\``)}return[g,v]}const s=()=>{const o=n.map(i=>l.createContext(i));return function(u){const p=u?.[e]||o;return l.useMemo(()=>({[`__scope${e}`]:{...u,[e]:p}}),[u,p])}};return s.scopeName=e,[r,xQ(s,...t)]}function xQ(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const i=r.reduce((u,{useScope:p,scopeName:g})=>{const w=p(o)[`__scope${g}`];return{...u,...w}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var lS=Boolean(globalThis?.document)?l.useLayoutEffect:()=>{},_Q=se["useId".toString()]||(()=>{}),SQ=0;function YT(e){const[t,n]=l.useState(_Q());return lS(()=>{e||n(r=>r??String(SQ++))},[e]),e||(t?`radix-${t}`:"")}function b0(e){const t=l.useRef(e);return l.useEffect(()=>{t.current=e}),l.useMemo(()=>(...n)=>t.current?.(...n),[])}function CQ({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,s]=EQ({defaultProp:t,onChange:n}),o=e!==void 0,i=o?e:r,u=b0(n),p=l.useCallback(g=>{if(o){const w=typeof g=="function"?g(e):g;w!==e&&u(w)}else s(g)},[o,e,s,u]);return[i,p]}function EQ({defaultProp:e,onChange:t}){const n=l.useState(e),[r]=n,s=l.useRef(r),o=b0(t);return l.useEffect(()=>{s.current!==r&&(o(r),s.current=r)},[r,s,o]),n}var TQ=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Wp=TQ.reduce((e,t)=>{const n=l.forwardRef((r,s)=>{const{asChild:o,...i}=r,u=o?Qa:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),(0,a.jsx)(u,{...i,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function kQ(e,t){e&&kt.flushSync(()=>e.dispatchEvent(t))}var Zpe=null;function RQ(e,t=globalThis?.document){const n=b0(e);l.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var PQ="DismissableLayer",XT="dismissableLayer.update",OQ="dismissableLayer.pointerDownOutside",NQ="dismissableLayer.focusOutside",pD,hD=l.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),mD=l.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:i,onDismiss:u,...p}=e,g=l.useContext(hD),[v,w]=l.useState(null),x=v?.ownerDocument??globalThis?.document,[,E]=l.useState({}),R=y0(t,G=>w(G)),k=Array.from(g.layers),[N]=[...g.layersWithOutsidePointerEventsDisabled].slice(-1),L=k.indexOf(N),D=v?k.indexOf(v):-1,B=g.layersWithOutsidePointerEventsDisabled.size>0,Q=D>=L,ce=jQ(G=>{const Le=G.target,We=[...g.branches].some(at=>at.contains(Le));!Q||We||(s?.(G),i?.(G),G.defaultPrevented||u?.())},x),ye=DQ(G=>{const Le=G.target;[...g.branches].some(at=>at.contains(Le))||(o?.(G),i?.(G),G.defaultPrevented||u?.())},x);return RQ(G=>{D===g.layers.size-1&&(r?.(G),!G.defaultPrevented&&u&&(G.preventDefault(),u()))},x),l.useEffect(()=>{if(v)return n&&(g.layersWithOutsidePointerEventsDisabled.size===0&&(pD=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),g.layersWithOutsidePointerEventsDisabled.add(v)),g.layers.add(v),gD(),()=>{n&&g.layersWithOutsidePointerEventsDisabled.size===1&&(x.body.style.pointerEvents=pD)}},[v,x,n,g]),l.useEffect(()=>()=>{v&&(g.layers.delete(v),g.layersWithOutsidePointerEventsDisabled.delete(v),gD())},[v,g]),l.useEffect(()=>{const G=()=>E({});return document.addEventListener(XT,G),()=>document.removeEventListener(XT,G)},[]),(0,a.jsx)(Wp.div,{...p,ref:R,style:{pointerEvents:B?Q?"auto":"none":void 0,...e.style},onFocusCapture:Sm(e.onFocusCapture,ye.onFocusCapture),onBlurCapture:Sm(e.onBlurCapture,ye.onBlurCapture),onPointerDownCapture:Sm(e.onPointerDownCapture,ce.onPointerDownCapture)})});mD.displayName=PQ;var AQ="DismissableLayerBranch",IQ=l.forwardRef((e,t)=>{const n=l.useContext(hD),r=l.useRef(null),s=y0(t,r);return l.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),(0,a.jsx)(Wp.div,{...e,ref:s})});IQ.displayName=AQ;function jQ(e,t=globalThis?.document){const n=b0(e),r=l.useRef(!1),s=l.useRef(()=>{});return l.useEffect(()=>{const o=u=>{if(u.target&&!r.current){let g=function(){vD(OQ,n,v,{discrete:!0})};var p=g;const v={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=g,t.addEventListener("click",s.current,{once:!0})):g()}else t.removeEventListener("click",s.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function DQ(e,t=globalThis?.document){const n=b0(e),r=l.useRef(!1);return l.useEffect(()=>{const s=o=>{o.target&&!r.current&&vD(NQ,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function gD(){const e=new CustomEvent(XT);document.dispatchEvent(e)}function vD(e,t,n,{discrete:r}){const s=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?kQ(s,o):s.dispatchEvent(o)}var Jpe=null,ehe=null,ZT="focusScope.autoFocusOnMount",JT="focusScope.autoFocusOnUnmount",yD={bubbles:!1,cancelable:!0},MQ="FocusScope",bD=l.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...i}=e,[u,p]=l.useState(null),g=b0(s),v=b0(o),w=l.useRef(null),x=y0(t,k=>p(k)),E=l.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;l.useEffect(()=>{if(r){let D=function(ye){if(E.paused||!u)return;const G=ye.target;u.contains(G)?w.current=G:Cm(w.current,{select:!0})},B=function(ye){if(E.paused||!u)return;const G=ye.relatedTarget;G!==null&&(u.contains(G)||Cm(w.current,{select:!0}))},Q=function(ye){if(document.activeElement===document.body)for(const Le of ye)Le.removedNodes.length>0&&Cm(u)};var k=D,N=B,L=Q;document.addEventListener("focusin",D),document.addEventListener("focusout",B);const ce=new MutationObserver(Q);return u&&ce.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",D),document.removeEventListener("focusout",B),ce.disconnect()}}},[r,u,E.paused]),l.useEffect(()=>{if(u){_D.add(E);const k=document.activeElement;if(!u.contains(k)){const L=new CustomEvent(ZT,yD);u.addEventListener(ZT,g),u.dispatchEvent(L),L.defaultPrevented||($Q(BQ(wD(u)),{select:!0}),document.activeElement===k&&Cm(u))}return()=>{u.removeEventListener(ZT,g),setTimeout(()=>{const L=new CustomEvent(JT,yD);u.addEventListener(JT,v),u.dispatchEvent(L),L.defaultPrevented||Cm(k??document.body,{select:!0}),u.removeEventListener(JT,v),_D.remove(E)},0)}}},[u,g,v,E]);const R=l.useCallback(k=>{if(!n&&!r||E.paused)return;const N=k.key==="Tab"&&!k.altKey&&!k.ctrlKey&&!k.metaKey,L=document.activeElement;if(N&&L){const D=k.currentTarget,[B,Q]=LQ(D);B&&Q?!k.shiftKey&&L===Q?(k.preventDefault(),n&&Cm(B,{select:!0})):k.shiftKey&&L===B&&(k.preventDefault(),n&&Cm(Q,{select:!0})):L===D&&k.preventDefault()}},[n,r,E.paused]);return(0,a.jsx)(Wp.div,{tabIndex:-1,...i,ref:x,onKeyDown:R})});bD.displayName=MQ;function $Q(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Cm(r,{select:t}),document.activeElement!==n)return}function LQ(e){const t=wD(e),n=xD(t,e),r=xD(t.reverse(),e);return[n,r]}function wD(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function xD(e,t){for(const n of e)if(!FQ(n,{upTo:t}))return n}function FQ(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function zQ(e){return e instanceof HTMLInputElement&&"select"in e}function Cm(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&zQ(e)&&t&&e.select()}}var _D=UQ();function UQ(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=SD(e,t),e.unshift(t)},remove(t){e=SD(e,t),e[0]?.resume()}}}function SD(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function BQ(e){return e.filter(t=>t.tagName!=="A")}var the=null,VQ="Portal",CD=l.forwardRef((e,t)=>{const{container:n,...r}=e,[s,o]=l.useState(!1);lS(()=>o(!0),[]);const i=n||s&&globalThis?.document?.body;return i?kt.createPortal((0,a.jsx)(Wp.div,{...r,ref:t}),i):null});CD.displayName=VQ;var nhe=null;function HQ(e,t){return l.useReducer((n,r)=>t[n][r]??n,e)}var cS=e=>{const{present:t,children:n}=e,r=WQ(t),s=typeof n=="function"?n({present:r.isPresent}):l.Children.only(n),o=y0(r.ref,qQ(s));return typeof n=="function"||r.isPresent?l.cloneElement(s,{ref:o}):null};cS.displayName="Presence";function WQ(e){const[t,n]=l.useState(),r=l.useRef({}),s=l.useRef(e),o=l.useRef("none"),i=e?"mounted":"unmounted",[u,p]=HQ(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return l.useEffect(()=>{const g=uS(r.current);o.current=u==="mounted"?g:"none"},[u]),lS(()=>{const g=r.current,v=s.current;if(v!==e){const x=o.current,E=uS(g);e?p("MOUNT"):E==="none"||g?.display==="none"?p("UNMOUNT"):p(v&&x!==E?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,p]),lS(()=>{if(t){let g;const v=t.ownerDocument.defaultView??window,w=E=>{const k=uS(r.current).includes(E.animationName);if(E.target===t&&k&&(p("ANIMATION_END"),!s.current)){const N=t.style.animationFillMode;t.style.animationFillMode="forwards",g=v.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=N)})}},x=E=>{E.target===t&&(o.current=uS(r.current))};return t.addEventListener("animationstart",x),t.addEventListener("animationcancel",w),t.addEventListener("animationend",w),()=>{v.clearTimeout(g),t.removeEventListener("animationstart",x),t.removeEventListener("animationcancel",w),t.removeEventListener("animationend",w)}}else p("ANIMATION_END")},[t,p]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:l.useCallback(g=>{g&&(r.current=getComputedStyle(g)),n(g)},[])}}function uS(e){return e?.animationName||"none"}function qQ(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ek=0;function rhe(e){return ED(),e.children}function ED(){l.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??TD()),document.body.insertAdjacentElement("beforeend",e[1]??TD()),ek++,()=>{ek===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ek--}},[])}function TD(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var she=null,kD=rc(),tk=function(){},dS=l.forwardRef(function(e,t){var n=l.useRef(null),r=l.useState({onScrollCapture:tk,onWheelCapture:tk,onTouchMoveCapture:tk}),s=r[0],o=r[1],i=e.forwardProps,u=e.children,p=e.className,g=e.removeScrollBar,v=e.enabled,w=e.shards,x=e.sideCar,E=e.noIsolation,R=e.inert,k=e.allowPinchZoom,N=e.as,L=N===void 0?"div":N,D=e.gapMode,B=Lc(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),Q=x,ce=vd([n,t]),ye=Cn(Cn({},B),s);return l.createElement(l.Fragment,null,v&&l.createElement(Q,{sideCar:kD,removeScrollBar:g,shards:w,noIsolation:E,inert:R,setCallbacks:o,allowPinchZoom:!!k,lockRef:n,gapMode:D}),i?l.cloneElement(l.Children.only(u),Cn(Cn({},ye),{ref:ce})):l.createElement(L,Cn({},ye,{className:p,ref:ce}),u))});dS.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},dS.classNames={fullWidth:za,zeroRight:ca};var nk=!1;if(typeof window<"u")try{var fS=Object.defineProperty({},"passive",{get:function(){return nk=!0,!0}});window.addEventListener("test",fS,fS),window.removeEventListener("test",fS,fS)}catch{nk=!1}var _y=nk?{passive:!1}:!1,KQ=function(e){return e.tagName==="TEXTAREA"},RD=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!KQ(e)&&n[t]==="visible")},GQ=function(e){return RD(e,"overflowY")},QQ=function(e){return RD(e,"overflowX")},PD=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=OD(e,r);if(s){var o=ND(e,r),i=o[1],u=o[2];if(i>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},YQ=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},XQ=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},OD=function(e,t){return e==="v"?GQ(t):QQ(t)},ND=function(e,t){return e==="v"?YQ(t):XQ(t)},ZQ=function(e,t){return e==="h"&&t==="rtl"?-1:1},JQ=function(e,t,n,r,s){var o=ZQ(e,window.getComputedStyle(t).direction),i=o*r,u=n.target,p=t.contains(u),g=!1,v=i>0,w=0,x=0;do{var E=ND(e,u),R=E[0],k=E[1],N=E[2],L=k-N-o*R;(R||L)&&OD(e,u)&&(w+=L,x+=R),u instanceof ShadowRoot?u=u.host:u=u.parentNode}while(!p&&u!==document.body||p&&(t.contains(u)||t===u));return(v&&(s&&Math.abs(w)<1||!s&&i>w)||!v&&(s&&Math.abs(x)<1||!s&&-i>x))&&(g=!0),g},pS=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},AD=function(e){return[e.deltaX,e.deltaY]},ID=function(e){return e&&"current"in e?e.current:e},eY=function(e,t){return e[0]===t[0]&&e[1]===t[1]},tY=function(e){return`
  .block-interactivity-`.concat(e,` {pointer-events: none;}
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},nY=0,Sy=[];function rY(e){var t=l.useRef([]),n=l.useRef([0,0]),r=l.useRef(),s=l.useState(nY++)[0],o=l.useState(Ko)[0],i=l.useRef(e);l.useEffect(function(){i.current=e},[e]),l.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var k=hd([e.lockRef.current],(e.shards||[]).map(ID),!0).filter(Boolean);return k.forEach(function(N){return N.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),k.forEach(function(N){return N.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var u=l.useCallback(function(k,N){if("touches"in k&&k.touches.length===2||k.type==="wheel"&&k.ctrlKey)return!i.current.allowPinchZoom;var L=pS(k),D=n.current,B="deltaX"in k?k.deltaX:D[0]-L[0],Q="deltaY"in k?k.deltaY:D[1]-L[1],ce,ye=k.target,G=Math.abs(B)>Math.abs(Q)?"h":"v";if("touches"in k&&G==="h"&&ye.type==="range")return!1;var Le=PD(G,ye);if(!Le)return!0;if(Le?ce=G:(ce=G==="v"?"h":"v",Le=PD(G,ye)),!Le)return!1;if(!r.current&&"changedTouches"in k&&(B||Q)&&(r.current=ce),!ce)return!0;var We=r.current||ce;return JQ(We,N,k,We==="h"?B:Q,!0)},[]),p=l.useCallback(function(k){var N=k;if(!(!Sy.length||Sy[Sy.length-1]!==o)){var L="deltaY"in N?AD(N):pS(N),D=t.current.filter(function(ce){return ce.name===N.type&&(ce.target===N.target||N.target===ce.shadowParent)&&eY(ce.delta,L)})[0];if(D&&D.should){N.cancelable&&N.preventDefault();return}if(!D){var B=(i.current.shards||[]).map(ID).filter(Boolean).filter(function(ce){return ce.contains(N.target)}),Q=B.length>0?u(N,B[0]):!i.current.noIsolation;Q&&N.cancelable&&N.preventDefault()}}},[]),g=l.useCallback(function(k,N,L,D){var B={name:k,delta:N,target:L,should:D,shadowParent:sY(L)};t.current.push(B),setTimeout(function(){t.current=t.current.filter(function(Q){return Q!==B})},1)},[]),v=l.useCallback(function(k){n.current=pS(k),r.current=void 0},[]),w=l.useCallback(function(k){g(k.type,AD(k),k.target,u(k,e.lockRef.current))},[]),x=l.useCallback(function(k){g(k.type,pS(k),k.target,u(k,e.lockRef.current))},[]);l.useEffect(function(){return Sy.push(o),e.setCallbacks({onScrollCapture:w,onWheelCapture:w,onTouchMoveCapture:x}),document.addEventListener("wheel",p,_y),document.addEventListener("touchmove",p,_y),document.addEventListener("touchstart",v,_y),function(){Sy=Sy.filter(function(k){return k!==o}),document.removeEventListener("wheel",p,_y),document.removeEventListener("touchmove",p,_y),document.removeEventListener("touchstart",v,_y)}},[]);var E=e.removeScrollBar,R=e.inert;return l.createElement(l.Fragment,null,R?l.createElement(o,{styles:tY(s)}):null,E?l.createElement(Bc,{gapMode:e.gapMode}):null)}function sY(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const oY=zc(kD,rY);var jD=l.forwardRef(function(e,t){return l.createElement(dS,Cn({},e,{ref:t,sideCar:oY}))});jD.classNames=dS.classNames;const aY=jD;var rk="Dialog",[DD,ohe]=wQ(rk),[iY,jd]=DD(rk),MD=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:o,modal:i=!0}=e,u=l.useRef(null),p=l.useRef(null),[g=!1,v]=CQ({prop:r,defaultProp:s,onChange:o});return(0,a.jsx)(iY,{scope:t,triggerRef:u,contentRef:p,contentId:YT(),titleId:YT(),descriptionId:YT(),open:g,onOpenChange:v,onOpenToggle:l.useCallback(()=>v(w=>!w),[v]),modal:i,children:n})};MD.displayName=rk;var $D="DialogTrigger",LD=l.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=jd($D,n),o=y0(t,s.triggerRef);return(0,a.jsx)(Wp.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":ak(s.open),...r,ref:o,onClick:Sm(e.onClick,s.onOpenToggle)})});LD.displayName=$D;var sk="DialogPortal",[lY,FD]=DD(sk,{forceMount:void 0}),zD=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,o=jd(sk,t);return(0,a.jsx)(lY,{scope:t,forceMount:n,children:l.Children.map(r,i=>(0,a.jsx)(cS,{present:n||o.open,children:(0,a.jsx)(CD,{asChild:!0,container:s,children:i})}))})};zD.displayName=sk;var hS="DialogOverlay",UD=l.forwardRef((e,t)=>{const n=FD(hS,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=jd(hS,e.__scopeDialog);return o.modal?(0,a.jsx)(cS,{present:r||o.open,children:(0,a.jsx)(cY,{...s,ref:t})}):null});UD.displayName=hS;var cY=l.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=jd(hS,n);return(0,a.jsx)(aY,{as:Qa,allowPinchZoom:!0,shards:[s.contentRef],children:(0,a.jsx)(Wp.div,{"data-state":ak(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),w0="DialogContent",BD=l.forwardRef((e,t)=>{const n=FD(w0,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=jd(w0,e.__scopeDialog);return(0,a.jsx)(cS,{present:r||o.open,children:o.modal?(0,a.jsx)(uY,{...s,ref:t}):(0,a.jsx)(dY,{...s,ref:t})})});BD.displayName=w0;var uY=l.forwardRef((e,t)=>{const n=jd(w0,e.__scopeDialog),r=l.useRef(null),s=y0(t,n.contentRef,r);return l.useEffect(()=>{const o=r.current;if(o)return Uu(o)},[]),(0,a.jsx)(VD,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Sm(e.onCloseAutoFocus,o=>{o.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Sm(e.onPointerDownOutside,o=>{const i=o.detail.originalEvent,u=i.button===0&&i.ctrlKey===!0;(i.button===2||u)&&o.preventDefault()}),onFocusOutside:Sm(e.onFocusOutside,o=>o.preventDefault())})}),dY=l.forwardRef((e,t)=>{const n=jd(w0,e.__scopeDialog),r=l.useRef(!1),s=l.useRef(!1);return(0,a.jsx)(VD,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(r.current||n.triggerRef.current?.focus(),o.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const i=o.target;n.triggerRef.current?.contains(i)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),VD=l.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,...i}=e,u=jd(w0,n),p=l.useRef(null),g=y0(t,p);return ED(),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(bD,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:(0,a.jsx)(mD,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":ak(u.open),...i,ref:g,onDismiss:()=>u.onOpenChange(!1)})}),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(fY,{titleId:u.titleId}),(0,a.jsx)(hY,{contentRef:p,descriptionId:u.descriptionId})]})]})}),ok="DialogTitle",HD=l.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=jd(ok,n);return(0,a.jsx)(Wp.h2,{id:s.titleId,...r,ref:t})});HD.displayName=ok;var WD="DialogDescription",qD=l.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=jd(WD,n);return(0,a.jsx)(Wp.p,{id:s.descriptionId,...r,ref:t})});qD.displayName=WD;var KD="DialogClose",GD=l.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=jd(KD,n);return(0,a.jsx)(Wp.button,{type:"button",...r,ref:t,onClick:Sm(e.onClick,()=>s.onOpenChange(!1))})});GD.displayName=KD;function ak(e){return e?"open":"closed"}var QD="DialogTitleWarning",[ahe,YD]=bQ(QD,{contentName:w0,titleName:ok,docsSlug:"dialog"}),fY=({titleId:e})=>{const t=YD(QD),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.

If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.

For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return l.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},pY="DialogDescriptionWarning",hY=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${YD(pY).contentName}}.`;return l.useEffect(()=>{const s=e.current?.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},mY=MD,gY=LD,vY=zD,yY=UD,bY=BD,wY=HD,xY=qD,_Y=GD;function SY(e){if(!e||typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const XD=l.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),Cy=()=>{const e=l.useContext(XD);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};SY(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,100%,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,-100%,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(-100%,0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(100%,0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(
[data-state=closed]
){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,100%,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,100%,0)}}@keyframes slideFromTop{from{transform:translate3d(0,-100%,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,-100%,0)}}@keyframes slideFromLeft{from{transform:translate3d(-100%,0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(-100%,0,0)}}@keyframes slideFromRight{from{transform:translate3d(100%,0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(100%,0,0)}}`);const CY=24,EY=typeof window<"u"?l.useLayoutEffect:l.useEffect;function ZD(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}function TY(){return ik(/^Mac/)}function kY(){return ik(/^iPhone/)}function JD(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function RY(){return ik(/^iPad/)||TY()&&navigator.maxTouchPoints>1}function eM(){return kY()||RY()}function ik(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.platform):void 0}const lk=typeof document<"u"&&window.visualViewport;function tM(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function nM(e){for(tM(e)&&(e=e.parentElement);e&&!tM(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const PY=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let mS=0,ck;function OY(e={}){let{isDisabled:t}=e;EY(()=>{if(!t)return mS++,mS===1&&eM()&&(ck=NY()),()=>{mS--,mS===0&&ck?.()}},[t])}function NY(){let e,t=0,n=w=>{e=nM(w.target),!(e===document.documentElement&&e===document.body)&&(t=w.changedTouches[0].pageY)},r=w=>{if(!e||e===document.documentElement||e===document.body){w.preventDefault();return}let x=w.changedTouches[0].pageY,E=e.scrollTop,R=e.scrollHeight-e.clientHeight;R!==0&&((E<=0&&x>t||E>=R&&x<t)&&w.preventDefault(),t=x)},s=w=>{let x=w.target;uk(x)&&x!==document.activeElement&&(w.preventDefault(),x.style.transform="translateY(-2000px)",x.focus(),requestAnimationFrame(()=>{x.style.transform=""}))},o=w=>{let x=w.target;uk(x)&&(x.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{x.style.transform="",lk&&(lk.height<window.innerHeight?requestAnimationFrame(()=>{rM(x)}):lk.addEventListener("resize",()=>rM(x),{once:!0}))}))},i=()=>{window.scrollTo(0,0)},u=window.pageXOffset,p=window.pageYOffset,g=ZD(AY(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let v=ZD(ww(document,"touchstart",n,{passive:!1,capture:!0}),ww(document,"touchmove",r,{passive:!1,capture:!0}),ww(document,"touchend",s,{passive:!1,capture:!0}),ww(document,"focus",o,!0),ww(window,"scroll",i));return()=>{g(),v(),window.scrollTo(u,p)}}function AY(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function ww(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function rM(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let n=nM(e);if(n!==document.documentElement&&n!==document.body&&n!==e){let r=n.getBoundingClientRect().top,s=e.getBoundingClientRect().top,o=e.getBoundingClientRect().bottom;const i=n.getBoundingClientRect().bottom+CY;o>i&&(n.scrollTop+=s-r)}e=n.parentElement}}function uk(e){return e instanceof HTMLInputElement&&!PY.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function IY(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function jY(...e){return t=>e.forEach(n=>IY(n,t))}function sM(...e){return l.useCallback(jY(...e),e)}const oM=new WeakMap;function Mi(e,t,n=!1){if(!e||!(e instanceof HTMLElement))return;let r={};Object.entries(t).forEach(([s,o])=>{if(s.startsWith("--")){e.style.setProperty(s,o);return}r[s]=e.style[s],e.style[s]=o}),!n&&oM.set(e,r)}function DY(e,t){if(!e||!(e instanceof HTMLElement))return;let n=oM.get(e);n&&(e.style[t]=n[t])}const $i=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function gS(e,t){if(!e)return null;const n=window.getComputedStyle(e),r=n.transform||n.webkitTransform||n.mozTransform;let s=r.match(/^matrix3d\((.+)\)$/);return s?parseFloat(s[1].split(", ")[$i(t)?13:12]):(s=r.match(/^matrix\((.+)\)$/),s?parseFloat(s[1].split(", ")[$i(t)?5:4]):null)}function MY(e){return 8*(Math.log(e+1)-2)}function dk(e,t){if(!e)return()=>{};const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}function $Y(...e){return(...t)=>{for(const n of e)typeof n=="function"&&n(...t)}}const Wa={DURATION:.5,EASE:[.32,.72,0,1]},aM=.4,LY=.25,FY=100,iM=8,x0=16,fk=26,pk="vaul-dragging";function lM(e){const t=l.useRef(e);return l.useEffect(()=>{t.current=e}),l.useMemo(()=>(...n)=>t.current==null?void 0:t.current.call(t,...n),[])}function zY({defaultProp:e,onChange:t}){const n=l.useState(e),[r]=n,s=l.useRef(r),o=lM(t);return l.useEffect(()=>{s.current!==r&&(o(r),s.current=r)},[r,s,o]),n}function cM({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,s]=zY({defaultProp:t,onChange:n}),o=e!==void 0,i=o?e:r,u=lM(n),p=l.useCallback(g=>{if(o){const w=typeof g=="function"?g(e):g;w!==e&&u(w)}else s(g)},[o,e,s,u]);return[i,p]}function UY({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:n,drawerRef:r,overlayRef:s,fadeFromIndex:o,onSnapPointChange:i,direction:u="bottom",container:p,snapToSequentialPoint:g}){const[v,w]=cM({prop:e,defaultProp:n?.[0],onChange:t}),[x,E]=l.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);l.useEffect(()=>{function G(){E({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",G),()=>window.removeEventListener("resize",G)},[]);const R=l.useMemo(()=>v===n?.[n.length-1]||null,[n,v]),k=l.useMemo(()=>n?.findIndex(G=>G===v),[n,v]),N=n&&n.length>0&&(o||o===0)&&!Number.isNaN(o)&&n[o]===v||!n,L=l.useMemo(()=>{const G=p?{width:p.getBoundingClientRect().width,height:p.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var Le;return(Le=n?.map(We=>{const at=typeof We=="string";let St=0;if(at&&(St=parseInt(We,10)),$i(u)){const Mt=at?St:x?We*G.height:0;return x?u==="bottom"?G.height-Mt:-G.height+Mt:Mt}const xt=at?St:x?We*G.width:0;return x?u==="right"?G.width-xt:-G.width+xt:xt}))!=null?Le:[]},[n,x,p]),D=l.useMemo(()=>k!==null?L?.[k]:null,[L,k]),B=l.useCallback(G=>{var Le;const We=(Le=L?.findIndex(at=>at===G))!=null?Le:null;i(We),Mi(r.current,{transition:`transform ${Wa.DURATION}s cubic-bezier(${Wa.EASE.join(",")})`,transform:$i(u)?`translate3d(0, ${G}px, 0)`:`translate3d(${G}px, 0, 0)`}),L&&We!==L.length-1&&We!==o&&We<o?Mi(s.current,{transition:`opacity ${Wa.DURATION}s cubic-bezier(${Wa.EASE.join(",")})`,opacity:"0"}):Mi(s.current,{transition:`opacity ${Wa.DURATION}s cubic-bezier(${Wa.EASE.join(",")})`,opacity:"1"}),w(n?.[Math.max(We,0)])},[r.current,n,L,o,s,w]);l.useEffect(()=>{if(v||e){var G;const Le=(G=n?.findIndex(We=>We===e||We===v))!=null?G:-1;L&&Le!==-1&&typeof L[Le]=="number"&&B(L[Le])}},[v,e,n,L,B]);function Q({draggedDistance:G,closeDrawer:Le,velocity:We,dismissible:at}){if(o===void 0)return;const St=u==="bottom"||u==="right"?(D??0)-G:(D??0)+G,xt=k===o-1,Mt=k===0,$t=G>0;if(xt&&Mi(s.current,{transition:`opacity ${Wa.DURATION}s cubic-bezier(${Wa.EASE.join(",")})`}),!g&&We>2&&!$t){at?Le():B(L[0]);return}if(!g&&We>2&&$t&&L&&n){B(L[n.length-1]);return}const Nt=L?.reduce((wn,Nn)=>typeof wn!="number"||typeof Nn!="number"?wn:Math.abs(Nn-St)<Math.abs(wn-St)?Nn:wn),Bn=$i(u)?window.innerHeight:window.innerWidth;if(We>aM&&Math.abs(G)<Bn*.4){const wn=$t?1:-1;if(wn>0&&R){B(L[n.length-1]);return}if(Mt&&wn<0&&at&&Le(),k===null)return;B(L[k+wn]);return}B(Nt)}function ce({draggedDistance:G}){if(D===null)return;const Le=u==="bottom"||u==="right"?D-G:D+G;(u==="bottom"||u==="right")&&Le<L[L.length-1]||(u==="top"||u==="left")&&Le>L[L.length-1]||Mi(r.current,{transform:$i(u)?`translate3d(0, ${Le}px, 0)`:`translate3d(${Le}px, 0, 0)`})}function ye(G,Le){if(!n||typeof k!="number"||!L||o===void 0)return null;const We=k===o-1;if(k>=o&&Le)return 0;if(We&&!Le)return 1;if(!N&&!We)return null;const St=We?k+1:k-1,xt=We?L[St]-L[St-1]:L[St+1]-L[St],Mt=G/Math.abs(xt);return We?1-Mt:Mt}return{isLastSnapPoint:R,activeSnapPoint:v,shouldFade:N,getPercentageDragged:ye,setActiveSnapPoint:w,activeSnapPointIndex:k,onRelease:Q,onDrag:ce,snapPointsOffset:L}}const BY=()=>()=>{};function VY(){const{direction:e,isOpen:t,shouldScaleBackground:n,setBackgroundColorOnScale:r,noBodyStyles:s}=Cy(),o=l.useRef(null),i=(0,l.useMemo)(()=>document.body.style.backgroundColor,[]);function u(){return(window.innerWidth-fk)/window.innerWidth}l.useEffect(()=>{if(t&&n){o.current&&clearTimeout(o.current);const p=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!p)return;$Y(r&&!s?dk(document.body,{background:"black"}):BY,dk(p,{transformOrigin:$i(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${Wa.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Wa.EASE.join(",")})`}));const g=dk(p,{borderRadius:`${iM}px`,overflow:"hidden",...$i(e)?{transform:`scale(${u()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${u()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{g(),o.current=window.setTimeout(()=>{i?document.body.style.background=i:document.body.style.removeProperty("background")},Wa.DURATION*1e3)}}},[t,n,i])}let xw=null;function HY({isOpen:e,modal:t,nested:n,hasBeenOpened:r,preventScrollRestoration:s,noBodyStyles:o}){const[i,u]=l.useState(()=>typeof window<"u"?window.location.href:""),p=l.useRef(0),g=l.useCallback(()=>{if(JD()&&xw===null&&e&&!o){xw={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:w,innerHeight:x}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-p.current}px`,left:`${-w}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const E=x-window.innerHeight;E&&p.current>=x&&(document.body.style.top=`${-(p.current+E)}px`)}),300)}},[e]),v=l.useCallback(()=>{if(JD()&&xw!==null&&!o){const w=-parseInt(document.body.style.top,10),x=-parseInt(document.body.style.left,10);Object.assign(document.body.style,xw),window.requestAnimationFrame(()=>{if(s&&i!==window.location.href){u(window.location.href);return}window.scrollTo(x,w)}),xw=null}},[i]);return l.useEffect(()=>{function w(){p.current=window.scrollY}return w(),window.addEventListener("scroll",w),()=>{window.removeEventListener("scroll",w)}},[]),l.useEffect(()=>{n||!r||(e?(!window.matchMedia("(display-mode: standalone)").matches&&g(),t||window.setTimeout(()=>{v()},500)):v())},[e,r,i,t,n,g,v]),{restorePositionSetting:v}}function uM({open:e,onOpenChange:t,children:n,onDrag:r,onRelease:s,snapPoints:o,shouldScaleBackground:i=!1,setBackgroundColorOnScale:u=!0,closeThreshold:p=LY,scrollLockTimeout:g=FY,dismissible:v=!0,handleOnly:w=!1,fadeFromIndex:x=o&&o.length-1,activeSnapPoint:E,setActiveSnapPoint:R,fixed:k,modal:N=!0,onClose:L,nested:D,noBodyStyles:B,direction:Q="bottom",defaultOpen:ce=!1,disablePreventScroll:ye=!0,snapToSequentialPoint:G=!1,preventScrollRestoration:Le=!1,repositionInputs:We=!0,onAnimationEnd:at,container:St,autoFocus:xt=!1}){var Mt,$t;const[Nt=!1,Bn]=cM({defaultProp:ce,prop:e,onChange:rs=>{t?.(rs),!rs&&!D&&ds(),setTimeout(()=>{at?.(rs)},Wa.DURATION*1e3),rs&&!N&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),rs||(document.body.style.pointerEvents="auto")}}),[wn,Nn]=l.useState(!1),[Zt,Pt]=l.useState(!1),[At,Ht]=l.useState(!1),Gt=l.useRef(null),Sn=l.useRef(null),Cr=l.useRef(null),br=l.useRef(null),Ln=l.useRef(null),Hr=l.useRef(!1),ws=l.useRef(null),us=l.useRef(0),tr=l.useRef(!1),mr=l.useRef(0),En=l.useRef(null),Ws=l.useRef(((Mt=En.current)==null?void 0:Mt.getBoundingClientRect().height)||0),xi=l.useRef((($t=En.current)==null?void 0:$t.getBoundingClientRect().width)||0),ja=l.useRef(0),Li=l.useCallback(rs=>{o&&rs===On.length-1&&(Sn.current=new Date)},[]),{activeSnapPoint:Ze,activeSnapPointIndex:Tt,setActiveSnapPoint:Dt,onRelease:Vn,snapPointsOffset:On,onDrag:_n,shouldFade:Lt,getPercentageDragged:jn}=UY({snapPoints:o,activeSnapPointProp:E,setActiveSnapPointProp:R,drawerRef:En,fadeFromIndex:x,overlayRef:Gt,onSnapPointChange:Li,direction:Q,container:St,snapToSequentialPoint:G});OY({isDisabled:!Nt||Zt||!N||At||!wn||!We||!ye});const{restorePositionSetting:ds}=HY({isOpen:Nt,modal:N,nested:D,hasBeenOpened:wn,preventScrollRestoration:Le,noBodyStyles:B});function $s(){return(window.innerWidth-fk)/window.innerWidth}function Ca(rs){var fo,sa;!v&&!o||En.current&&!En.current.contains(rs.target)||(Ws.current=((fo=En.current)==null?void 0:fo.getBoundingClientRect().height)||0,xi.current=((sa=En.current)==null?void 0:sa.getBoundingClientRect().width)||0,Pt(!0),Cr.current=new Date,eM()&&window.addEventListener("touchend",()=>Hr.current=!1,{once:!0}),rs.target.setPointerCapture(rs.pointerId),us.current=$i(Q)?rs.pageY:rs.pageX)}function xc(rs,fo){var sa,oa;let Do=rs;const _c=(sa=window.getSelection())==null?void 0:sa.toString(),xl=En.current?gS(En.current,Q):null,it=new Date;if(Do.hasAttribute("data-vaul-no-drag")||Do.closest("[data-vaul-no-drag]"))return!1;if(Q==="right"||Q==="left")return!0;if(Sn.current&&it.getTime()-Sn.current.getTime()<500)return!1;if(xl!==null&&(Q==="bottom"?xl>0:xl<0))return!0;if(_c&&_c.length>0)return!1;if(it.getTime()-((oa=Ln.current)==null?void 0:oa.getTime())<g&&xl===0||fo)return Ln.current=it,!1;for(;Do;){if(Do.scrollHeight>Do.clientHeight){if(Do.scrollTop!==0)return Ln.current=new Date,!1;if(Do.getAttribute("role")==="dialog")return!0}Do=Do.parentNode}return!0}function Qc(rs){if(En.current&&Zt){const fo=Q==="bottom"||Q==="right"?1:-1,sa=(us.current-($i(Q)?rs.pageY:rs.pageX))*fo,oa=sa>0,Do=o&&!v&&!oa;if(Do&&Tt===0)return;const _c=Math.abs(sa),xl=document.querySelector("[data-vaul-drawer-wrapper]"),it=Q==="bottom"||Q==="top"?Ws.current:xi.current;let Rt=_c/it;const Bt=jn(_c,oa);if(Bt!==null&&(Rt=Bt),Do&&Rt>=1||!Hr.current&&!xc(rs.target,oa))return;if(En.current.classList.add(pk),Hr.current=!0,Mi(En.current,{transition:"none"}),Mi(Gt.current,{transition:"none"}),o&&_n({draggedDistance:sa}),oa&&!o){const Qn=MY(sa),xs=Math.min(Qn*-1,0)*fo;Mi(En.current,{transform:$i(Q)?`translate3d(0, ${xs}px, 0)`:`translate3d(${xs}px, 0, 0)`});return}const xn=1-Rt;if((Lt||x&&Tt===x-1)&&(r?.(rs,Rt),Mi(Gt.current,{opacity:`${xn}`,transition:"none"},!0)),xl&&Gt.current&&i){const Qn=Math.min($s()+Rt*(1-$s()),1),xs=8-Rt*8,Xr=Math.max(0,14-Rt*14);Mi(xl,{borderRadius:`${xs}px`,transform:$i(Q)?`scale(${Qn}) translate3d(0, ${Xr}px, 0)`:`scale(${Qn}) translate3d(${Xr}px, 0, 0)`,transition:"none"},!0)}if(!o){const Qn=_c*fo;Mi(En.current,{transform:$i(Q)?`translate3d(0, ${Qn}px, 0)`:`translate3d(${Qn}px, 0, 0)`})}}}l.useEffect(()=>{var rs;function fo(){if(!En.current||!We)return;const sa=document.activeElement;if(uk(sa)||tr.current){var oa;const Do=((oa=window.visualViewport)==null?void 0:oa.height)||0,_c=window.innerHeight;let xl=_c-Do;const it=En.current.getBoundingClientRect().height||0,Rt=it>_c*.8;ja.current||(ja.current=it);const Bt=En.current.getBoundingClientRect().top;if(Math.abs(mr.current-xl)>60&&(tr.current=!tr.current),o&&o.length>0&&On&&Tt){const xn=On[Tt]||0;xl+=xn}if(mr.current=xl,it>Do||tr.current){const xn=En.current.getBoundingClientRect().height;let Qn=xn;xn>Do&&(Qn=Do-(Rt?Bt:fk)),k?En.current.style.height=`${xn-Math.max(xl,0)}px`:En.current.style.height=`${Math.max(Qn,Do-Bt)}px`}else En.current.style.height=`${ja.current}px`;o&&o.length>0&&!tr.current?En.current.style.bottom="0px":En.current.style.bottom=`${Math.max(xl,0)}px`}}return(rs=window.visualViewport)==null||rs.addEventListener("resize",fo),()=>{var sa;return(sa=window.visualViewport)==null?void 0:sa.removeEventListener("resize",fo)}},[Tt,o,On]);function Ja(rs){Fd(),L?.(),rs||Bn(!1),setTimeout(()=>{o&&Dt(o[0])},Wa.DURATION*1e3)}function Ld(){if(!En.current)return;const rs=document.querySelector("[data-vaul-drawer-wrapper]"),fo=gS(En.current,Q);Mi(En.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${Wa.DURATION}s cubic-bezier(${Wa.EASE.join(",")})`}),Mi(Gt.current,{transition:`opacity ${Wa.DURATION}s cubic-bezier(${Wa.EASE.join(",")})`,opacity:"1"}),i&&fo&&fo>0&&Nt&&Mi(rs,{borderRadius:`${iM}px`,overflow:"hidden",...$i(Q)?{transform:`scale(${$s()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${$s()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${Wa.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Wa.EASE.join(",")})`},!0)}function Fd(){!Zt||!En.current||(En.current.classList.remove(pk),Hr.current=!1,Pt(!1),br.current=new Date)}function zd(rs){if(!Zt||!En.current)return;En.current.classList.remove(pk),Hr.current=!1,Pt(!1),br.current=new Date;const fo=gS(En.current,Q);if(!xc(rs.target,!1)||!fo||Number.isNaN(fo)||Cr.current===null)return;const sa=br.current.getTime()-Cr.current.getTime(),oa=us.current-($i(Q)?rs.pageY:rs.pageX),Do=Math.abs(oa)/sa;if(Do>.05&&(Ht(!0),setTimeout(()=>{Ht(!1)},200)),o){Vn({draggedDistance:oa*(Q==="bottom"||Q==="right"?1:-1),closeDrawer:Ja,velocity:Do,dismissible:v}),s?.(rs,!0);return}if(Q==="bottom"||Q==="right"?oa>0:oa<0){Ld(),s?.(rs,!0);return}if(Do>aM){Ja(),s?.(rs,!1);return}var _c;const xl=Math.min((_c=En.current.getBoundingClientRect().height)!=null?_c:0,window.innerHeight);var it;const Rt=Math.min((it=En.current.getBoundingClientRect().width)!=null?it:0,window.innerWidth),Bt=Q==="left"||Q==="right";if(Math.abs(fo)>=(Bt?Rt:xl)*p){Ja(),s?.(rs,!1);return}s?.(rs,!0),Ld()}l.useEffect(()=>(Nt&&(Mi(document.documentElement,{scrollBehavior:"auto"}),Sn.current=new Date),()=>{DY(document.documentElement,"scrollBehavior")}),[Nt]);function qf(rs){const fo=rs?(window.innerWidth-x0)/window.innerWidth:1,sa=rs?-x0:0;ws.current&&window.clearTimeout(ws.current),Mi(En.current,{transition:`transform ${Wa.DURATION}s cubic-bezier(${Wa.EASE.join(",")})`,transform:`scale(${fo}) translate3d(0, ${sa}px, 0)`}),!rs&&En.current&&(ws.current=setTimeout(()=>{const oa=gS(En.current,Q);Mi(En.current,{transition:"none",transform:$i(Q)?`translate3d(0, ${oa}px, 0)`:`translate3d(${oa}px, 0, 0)`})},500))}function jm(rs,fo){if(fo<0)return;const sa=(window.innerWidth-x0)/window.innerWidth,oa=sa+fo*(1-sa),Do=-x0+fo*x0;Mi(En.current,{transform:$i(Q)?`scale(${oa}) translate3d(0, ${Do}px, 0)`:`scale(${oa}) translate3d(${Do}px, 0, 0)`,transition:"none"})}function Kf(rs,fo){const sa=$i(Q)?window.innerHeight:window.innerWidth,oa=fo?(sa-x0)/sa:1,Do=fo?-x0:0;fo&&Mi(En.current,{transition:`transform ${Wa.DURATION}s cubic-bezier(${Wa.EASE.join(",")})`,transform:$i(Q)?`scale(${oa}) translate3d(0, ${Do}px, 0)`:`scale(${oa}) translate3d(${Do}px, 0, 0)`})}return l.createElement(mY,{defaultOpen:ce,onOpenChange:rs=>{!v&&!rs||(rs?Nn(!0):Ja(!0),Bn(rs))},open:Nt},l.createElement(XD.Provider,{value:{activeSnapPoint:Ze,snapPoints:o,setActiveSnapPoint:Dt,drawerRef:En,overlayRef:Gt,onOpenChange:t,onPress:Ca,onRelease:zd,onDrag:Qc,dismissible:v,handleOnly:w,isOpen:Nt,isDragging:Zt,shouldFade:Lt,closeDrawer:Ja,onNestedDrag:jm,onNestedOpenChange:qf,onNestedRelease:Kf,keyboardIsOpen:tr,modal:N,snapPointsOffset:On,direction:Q,shouldScaleBackground:i,setBackgroundColorOnScale:u,noBodyStyles:B,container:St,autoFocus:xt}},n))}const dM=l.forwardRef(function({...e},t){const{overlayRef:n,snapPoints:r,onRelease:s,shouldFade:o,isOpen:i,modal:u}=Cy(),p=sM(t,n),g=r&&r.length>0;return u?l.createElement(yY,{onMouseUp:s,ref:p,"data-vaul-overlay":"","data-vaul-snap-points":i&&g?"true":"false","data-vaul-snap-points-overlay":i&&o?"true":"false",...e}):(typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),null)});dM.displayName="Drawer.Overlay";const fM=l.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:n,...r},s){const{drawerRef:o,onPress:i,onRelease:u,onDrag:p,keyboardIsOpen:g,snapPointsOffset:v,modal:w,isOpen:x,direction:E,snapPoints:R,container:k,handleOnly:N,autoFocus:L}=Cy(),[D,B]=l.useState(!1),Q=sM(s,o),ce=l.useRef(null),ye=l.useRef(null),G=l.useRef(!1),Le=R&&R.length>0;VY();const We=(St,xt,Mt=0)=>{if(G.current)return!0;const $t=Math.abs(St.y),Nt=Math.abs(St.x),Bn=Nt>$t,wn=["bottom","right"].includes(xt)?1:-1;if(xt==="left"||xt==="right"){if(!(St.x*wn<0)&&Nt>=0&&Nt<=Mt)return Bn}else if(!(St.y*wn<0)&&$t>=0&&$t<=Mt)return!Bn;return G.current=!0,!0};l.useEffect(()=>{Le&&window.requestAnimationFrame(()=>{B(!0)})},[]);function at(St){ce.current=null,G.current=!1,u(St)}return l.createElement(bY,{"data-vaul-drawer-direction":E,"data-vaul-drawer":"","data-vaul-delayed-snap-points":D?"true":"false","data-vaul-snap-points":x&&Le?"true":"false","data-vaul-custom-container":k?"true":"false",...r,ref:Q,style:v&&v.length>0?{"--snap-point-height":`${v[0]}px`,...t}:t,onPointerDown:St=>{N||(r.onPointerDown==null||r.onPointerDown.call(r,St),ce.current={x:St.pageX,y:St.pageY},i(St))},onOpenAutoFocus:St=>{n?.(St),L||St.preventDefault()},onPointerDownOutside:St=>{if(e?.(St),!w||St.defaultPrevented){St.preventDefault();return}g.current&&(g.current=!1)},onFocusOutside:St=>{if(!w){St.preventDefault();return}},onPointerMove:St=>{if(ye.current=St,N||(r.onPointerMove==null||r.onPointerMove.call(r,St),!ce.current))return;const xt=St.pageY-ce.current.y,Mt=St.pageX-ce.current.x,$t=St.pointerType==="touch"?10:2;We({x:Mt,y:xt},E,$t)?p(St):(Math.abs(Mt)>$t||Math.abs(xt)>$t)&&(ce.current=null)},onPointerUp:St=>{r.onPointerUp==null||r.onPointerUp.call(r,St),ce.current=null,G.current=!1,u(St)},onPointerOut:St=>{r.onPointerOut==null||r.onPointerOut.call(r,St),at(ye.current)},onContextMenu:St=>{r.onContextMenu==null||r.onContextMenu.call(r,St),at(ye.current)}})});fM.displayName="Drawer.Content";const WY=250,qY=120,pM=l.forwardRef(function({preventCycle:e=!1,children:t,...n},r){const{closeDrawer:s,isDragging:o,snapPoints:i,activeSnapPoint:u,setActiveSnapPoint:p,dismissible:g,handleOnly:v,isOpen:w,onPress:x,onDrag:E}=Cy(),R=l.useRef(null),k=l.useRef(!1);function N(){if(k.current){B();return}window.setTimeout(()=>{L()},qY)}function L(){if(o||e||k.current){B();return}if(B(),(!i||i.length===0)&&g){s();return}if(u===i[i.length-1]&&g){s();return}const ce=i.findIndex(G=>G===u);if(ce===-1)return;const ye=i[ce+1];p(ye)}function D(){R.current=window.setTimeout(()=>{k.current=!0},WY)}function B(){window.clearTimeout(R.current),k.current=!1}return l.createElement("div",{onClick:N,onPointerCancel:B,onPointerDown:Q=>{v&&x(Q),D()},onPointerMove:Q=>{v&&E(Q)},ref:r,"data-vaul-drawer-visible":w?"true":"false","data-vaul-handle":"","aria-hidden":"true",...n},l.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))});pM.displayName="Drawer.Handle";function KY({onDrag:e,onOpenChange:t,...n}){const{onNestedDrag:r,onNestedOpenChange:s,onNestedRelease:o}=Cy();if(!r)throw new Error("Drawer.NestedRoot must be placed in another drawer");return l.createElement(uM,{nested:!0,onClose:()=>{s(!1)},onDrag:(i,u)=>{r(i,u),e?.(i,u)},onOpenChange:i=>{i&&s(i)},onRelease:o,...n})}function GY(e){const t=Cy(),{container:n=t.container,...r}=e;return l.createElement(vY,{container:n,...r})}const Dd={Root:uM,NestedRoot:KY,Content:fM,Overlay:dM,Trigger:gY,Portal:GY,Handle:pM,Close:_Y,Title:wY,Description:xY},hM=({shouldScaleBackground:e=!0,...t})=>(0,a.jsx)(Dd.Root,{handleOnly:!0,shouldScaleBackground:e,...t});hM.displayName="Drawer";const ihe=Dd.Trigger,QY=Dd.Portal,lhe=Dd.Close,mM=l.forwardRef(({className:e,...t},n)=>(0,a.jsx)(Dd.Overlay,{ref:n,className:st("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm !opacity-1",e),...t}));mM.displayName=Dd.Overlay.displayName;const gM=l.forwardRef(({className:e,children:t,...n},r)=>(0,a.jsxs)(QY,{children:[(0,a.jsx)(mM,{}),(0,a.jsxs)(Dd.Content,{ref:r,className:st("fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",e),...n,children:[(0,a.jsx)("div",{className:"mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted"}),t]})]}));gM.displayName="DrawerContent";const vM=({className:e,onClose:t,...n})=>(0,a.jsxs)("div",{className:"relative",children:[t?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(mn,{"data-testid":"drawer-x-icon",variant:"none",onClick:()=>{t?.()},className:"absolute right-0",children:(0,a.jsx)(su,{className:"h-6 w-6 cursor-pointer stroke-1 text-slate-600 dark:text-white"})}),(0,a.jsx)("span",{className:"sr-only",children:"Close"})]}):null,(0,a.jsx)("div",{className:st("grid gap-1.5 p-4 text-center sm:text-left",e),...n})]});vM.displayName="DrawerHeader";const yM=({className:e,...t})=>(0,a.jsx)("div",{className:st("mt-auto flex flex-col gap-2 p-4",e),...t});yM.displayName="DrawerFooter";const bM=l.forwardRef(({className:e,...t},n)=>(0,a.jsx)(Dd.Title,{ref:n,className:st("text-lg font-semibold leading-none tracking-tight",e),...t}));bM.displayName=Dd.Title.displayName;const wM=l.forwardRef(({className:e,...t},n)=>(0,a.jsx)(Dd.Description,{ref:n,className:st("text-sm text-muted-foreground",e),...t}));wM.displayName=Dd.Description.displayName;const vS=e=>e?/^[0-9.-_]{8}\b-[0-9.-_]{4}\b-[0-9.-_]{4}\b-[0-9.-_]{4}\b-[0-9.-_]{12}$/gi.test(e):!1,Em=()=>{const e=jf();return{catalogId:vS(e.catalogId)?String(e.catalogId):void 0}},YY=({alreadyAddedOffers:e,selectedOffers:t})=>!(e.length===t.length&&e.every(n=>t.some(r=>r.sku===n.sku))),XY=()=>{const{catalogId:e}=Em(),t=fQ(e);return{setCatalogProductsMutation:t,onUpdateCatalogProducts:(r,s)=>{const o=r.filter(i=>!s.some(u=>u.sku===i.sku));t.mutate({skusToAdd:RA(s?.map(i=>i.sku)),skusToRemove:RA(o?.map(i=>i.sku))})}}},ZY=({open:e,changedProductsCount:t,onClose:n,onSubmit:r})=>{const{t:s}=(0,z.Bd)(),{catalogId:o}=Em(),i=GT(o);return(0,a.jsx)(Vc,{open:e,onClose:n,onConfirm:r,title:s("rsp:pages.marketplace.addProducts.confirmation.title"),confirmButtonText:s("rsp:pages.marketplace.addProducts.confirmation.updateCatalog"),cancelButtonText:s("rsp:actions.cancel"),children:(0,a.jsx)(z.x6,{i18nKey:"rsp:pages.marketplace.addProducts.confirmation.body",values:{catalogName:i?.data?.name,count:t}})})};function JY({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5"}))}const xM=l.forwardRef(JY),hk=e=>typeof e?.onSort=="function",eX=({isAllSelected:e,currentSelectedAll:t,isHeaderFixed:n,columns:r,setData:s,data:o,initialSort:i,handleSelectAll:u})=>{const[p,g]=(0,l.useState)(i?.id?{[i?.id]:i?.ascending}:{}),v=(0,l.useCallback)(w=>{hk(w)&&g(x=>{const E=w?.accessorKey??w?.id,R=!x?.[E];return w?.onSort?.({data:o,setData:s,ascending:R}),{...x,[E]:R}})},[o,s]);return(0,a.jsx)("div",{className:"relative",children:(0,a.jsx)(zl,{className:st("overflow  grid grid-cols-12 rounded-l-lg border-none w-full",{"fixed border-b border-t-0 border-r-0 border-l-0 border-solid rounded-none":n}),dataTestId:"collapsibe-header",children:r.map(w=>{const x=w?.accessorKey??w?.id;return w.id==="select"&&typeof w.header=="function"?(0,a.jsx)(zl.Item,{className:"col-span-2 flex items-center justify-center hover:cursor-default",children:w.header({checked:e,handleSelectAll:u,data:o,currentSelectedAll:t})},w.id):(0,a.jsx)(zl.Item,{"data-testid":`collapsible-header collapsible-header-${x}`,className:st("col-span-2 border-none px-4 py-4 md:px-8 group hover:cursor-default",{"hover:cursor-pointer":hk(w)},w.className),onClick:()=>v(w),children:(0,a.jsxs)(Pn,{variant:"body2",weight:"semiBold",className:"relative",as:"div",children:[w.header,hk(w)?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(xM,{"data-testid":`chevron-up-${w.accessorKey}`,className:st("absolute opacity-0 w-4 h-4 top-[2px] -right-[20px]",{"group-hover:opacity-100":p[x]})},`chevron-up-${w.accessorKey}`),(0,a.jsx)(Gg,{"data-testid":`chevron-down-${w.accessorKey}`,className:st("absolute opacity-0 w-4 h-4 top-[2px] -right-[20px]",{"group-hover:opacity-100":!p[x]})},`chevron-down-${w.accessorKey}`)]}):null]})},x)})})})},_M=({columns:e=[],isHeaderFixed:t,data:n=[],renderCollapsibleRow:r,emptyMessage:s,nestedChildrenType:o,initialSort:i,nestedChildrenTotalCount:u=0,onSelectAll:p,selectedRows:g=[]})=>{const{t:v}=(0,z.Bd)(),[w,x]=(0,l.useState)(!1),[E,R]=(0,l.useState)({}),[k,N]=(0,l.useState)(n),L=(0,l.useMemo)(()=>[...g].length!==0?"indeterminate":!1,[g]),D=(0,l.useMemo)(()=>u===[...g].length?!0:L,[L,u,g]),B=Hu(D);(0,l.useEffect)(()=>{B!==D&&p?.(D===!0)},[D,p,B]);const Q=(0,l.useCallback)(()=>{x(G=>!G),N(G=>G?.map(Le=>({...Le,[o]:Le?.[o]?.map(We=>({...We,isSelected:!w}))})))},[o,w]),ce=(0,l.useMemo)(()=>G=>G.some(Le=>[...g].some(We=>v0()(We,Le)))?"indeterminate":!1,[g]),ye=(0,l.useMemo)(()=>k?.map(G=>({...G,isSelected:(G?.[o]).every(Le=>[...g].some(We=>v0()(We,Le)))?!0:ce(G?.[o])})),[ce,o,g,k]);return n.length===0?(0,a.jsx)(xy,{emptyMessage:s??v("core:dataTable.noResults")}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(eX,{columns:e,data:ye,setData:N,isHeaderFixed:t,initialSort:i,currentSelectedAll:w,isAllSelected:D,handleSelectAll:Q}),r({data:ye,setData:N,columns:e,nestedChildrenType:o,setOpenedRow:R,openedRow:E})]})};_M.DisplayName="CollapsibleDataTable";const uhe=null;function tX(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e?.(s),n===!1||!s.defaultPrevented)return t?.(s)}}function dhe(e,t){const n=React.createContext(t),r=o=>{const{children:i,...u}=o,p=React.useMemo(()=>u,Object.values(u));return jsx(n.Provider,{value:p,children:i})};r.displayName=e+"Provider";function s(o){const i=React.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,s]}function nX(e,t=[]){let n=[];function r(o,i){const u=l.createContext(i),p=n.length;n=[...n,i];const g=w=>{const{scope:x,children:E,...R}=w,k=x?.[e]?.[p]||u,N=l.useMemo(()=>R,Object.values(R));return(0,a.jsx)(k.Provider,{value:N,children:E})};g.displayName=o+"Provider";function v(w,x){const E=x?.[e]?.[p]||u,R=l.useContext(E);if(R)return R;if(i!==void 0)return i;throw new Error(`\`${w}\` must be used within \`${o}\``)}return[g,v]}const s=()=>{const o=n.map(i=>l.createContext(i));return function(u){const p=u?.[e]||o;return l.useMemo(()=>({[`__scope${e}`]:{...u,[e]:p}}),[u,p])}};return s.scopeName=e,[r,rX(s,...t)]}function rX(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const i=r.reduce((u,{useScope:p,scopeName:g})=>{const w=p(o)[`__scope${g}`];return{...u,...w}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function SM(e){const t=l.useRef(e);return l.useEffect(()=>{t.current=e}),l.useMemo(()=>(...n)=>t.current?.(...n),[])}function sX({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,s]=oX({defaultProp:t,onChange:n}),o=e!==void 0,i=o?e:r,u=SM(n),p=l.useCallback(g=>{if(o){const w=typeof g=="function"?g(e):g;w!==e&&u(w)}else s(g)},[o,e,s,u]);return[i,p]}function oX({defaultProp:e,onChange:t}){const n=l.useState(e),[r]=n,s=l.useRef(r),o=SM(t);return l.useEffect(()=>{s.current!==r&&(o(r),s.current=r)},[r,s,o]),n}var yS=Boolean(globalThis?.document)?l.useLayoutEffect:()=>{};function aX(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function iX(...e){return t=>e.forEach(n=>aX(n,t))}function CM(...e){return l.useCallback(iX(...e),e)}var lX=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],mk=lX.reduce((e,t)=>{const n=l.forwardRef((r,s)=>{const{asChild:o,...i}=r,u=o?Qa:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),(0,a.jsx)(u,{...i,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function fhe(e,t){e&&ReactDOM.flushSync(()=>e.dispatchEvent(t))}var phe=null;function cX(e,t){return l.useReducer((n,r)=>t[n][r]??n,e)}var EM=e=>{const{present:t,children:n}=e,r=uX(t),s=typeof n=="function"?n({present:r.isPresent}):l.Children.only(n),o=CM(r.ref,dX(s));return typeof n=="function"||r.isPresent?l.cloneElement(s,{ref:o}):null};EM.displayName="Presence";function uX(e){const[t,n]=l.useState(),r=l.useRef({}),s=l.useRef(e),o=l.useRef("none"),i=e?"mounted":"unmounted",[u,p]=cX(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return l.useEffect(()=>{const g=bS(r.current);o.current=u==="mounted"?g:"none"},[u]),yS(()=>{const g=r.current,v=s.current;if(v!==e){const x=o.current,E=bS(g);e?p("MOUNT"):E==="none"||g?.display==="none"?p("UNMOUNT"):p(v&&x!==E?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,p]),yS(()=>{if(t){let g;const v=t.ownerDocument.defaultView??window,w=E=>{const k=bS(r.current).includes(E.animationName);if(E.target===t&&k&&(p("ANIMATION_END"),!s.current)){const N=t.style.animationFillMode;t.style.animationFillMode="forwards",g=v.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=N)})}},x=E=>{E.target===t&&(o.current=bS(r.current))};return t.addEventListener("animationstart",x),t.addEventListener("animationcancel",w),t.addEventListener("animationend",w),()=>{v.clearTimeout(g),t.removeEventListener("animationstart",x),t.removeEventListener("animationcancel",w),t.removeEventListener("animationend",w)}}else p("ANIMATION_END")},[t,p]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:l.useCallback(g=>{g&&(r.current=getComputedStyle(g)),n(g)},[])}}function bS(e){return e?.animationName||"none"}function dX(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var fX=se["useId".toString()]||(()=>{}),pX=0;function hX(e){const[t,n]=l.useState(fX());return yS(()=>{e||n(r=>r??String(pX++))},[e]),e||(t?`radix-${t}`:"")}var gk="Collapsible",[mX,hhe]=nX(gk),[gX,vk]=mX(gk),TM=l.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:o,onOpenChange:i,...u}=e,[p=!1,g]=sX({prop:r,defaultProp:s,onChange:i});return(0,a.jsx)(gX,{scope:n,disabled:o,contentId:hX(),open:p,onOpenToggle:l.useCallback(()=>g(v=>!v),[g]),children:(0,a.jsx)(mk.div,{"data-state":bk(p),"data-disabled":o?"":void 0,...u,ref:t})})});TM.displayName=gk;var kM="CollapsibleTrigger",RM=l.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,s=vk(kM,n);return(0,a.jsx)(mk.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":bk(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:t,onClick:tX(e.onClick,s.onOpenToggle)})});RM.displayName=kM;var yk="CollapsibleContent",PM=l.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=vk(yk,e.__scopeCollapsible);return(0,a.jsx)(EM,{present:n||s.open,children:({present:o})=>(0,a.jsx)(vX,{...r,ref:t,present:o})})});PM.displayName=yk;var vX=l.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:s,...o}=e,i=vk(yk,n),[u,p]=l.useState(r),g=l.useRef(null),v=CM(t,g),w=l.useRef(0),x=w.current,E=l.useRef(0),R=E.current,k=i.open||u,N=l.useRef(k),L=l.useRef();return l.useEffect(()=>{const D=requestAnimationFrame(()=>N.current=!1);return()=>cancelAnimationFrame(D)},[]),yS(()=>{const D=g.current;if(D){L.current=L.current||{transitionDuration:D.style.transitionDuration,animationName:D.style.animationName},D.style.transitionDuration="0s",D.style.animationName="none";const B=D.getBoundingClientRect();w.current=B.height,E.current=B.width,N.current||(D.style.transitionDuration=L.current.transitionDuration,D.style.animationName=L.current.animationName),p(r)}},[i.open,r]),(0,a.jsx)(mk.div,{"data-state":bk(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!k,...o,ref:v,style:{["--radix-collapsible-content-height"]:x?`${x}px`:void 0,["--radix-collapsible-content-width"]:R?`${R}px`:void 0,...e.style},children:k&&s})});function bk(e){return e?"open":"closed"}var yX=TM,mhe=null,ghe=null;const bX=yX,wX=RM,xX=PM,OM=({parentData:e,childrens:t,columns:n,setData:r,className:s})=>(0,a.jsx)(a.Fragment,{children:t?.map(o=>(0,a.jsx)(Qa,{children:(0,a.jsx)(a.Fragment,{children:n.map(i=>i.id==="select"&&typeof i.header=="function"?(0,a.jsx)(zl.Item,{className:st("first:border-1 col-span-2 flex justify-end first:rounded-none first:border-solid hover:cursor-default",s),children:i?.cell?.({data:o,setData:r,isCollapsible:!1})},`collapse-select-${String(i.accessorKey??i.id)}`):(0,a.jsx)(zl.Item,{className:st("first:border-1 first:rounded-none first:border-solid col-span-2 px-4 py-4 md:px-8 hover:cursor-default",i.className),children:(0,a.jsxs)(Pn,{variant:"body2",as:"div",children:[i?.render?i?.render({data:o,accessorKey:i?.accessorKey,parentData:e}):null,!i?.render&&i?.accessorKey?o?.[i?.accessorKey]:""]})},`collapse-${String(i.accessorKey??i.id)}`))})},o.id))});function _X({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"}))}const wS=l.forwardRef(_X),SX=({columns:e,data:t,setData:n})=>{const r=e.find(s=>s.id==="select");return(0,a.jsx)(a.Fragment,{children:e.map(s=>s.id==="select"&&typeof s.header=="function"?(0,a.jsxs)(zl.Item,{className:"first:border-1 relative col-span-2 flex justify-center px-2 first:rounded-none first:border-solid hover:cursor-pointer",children:[s?.cell?.({data:t,setData:n,isCollapsible:!0}),(0,a.jsx)(wS,{className:"absolute left-[12px] h-4 w-4 group-data-[state=open]:hidden lg:left-8"}),(0,a.jsx)(Gg,{className:"absolute left-[12px] h-4 w-4 group-data-[state=closed]:hidden lg:left-8"})]},`collapse-trigger-select-${String(s.accessorKey??s.id)}`):(0,a.jsxs)(zl.Item,{className:st("first:border-1 first:rounded-none first:border-solid col-span-2 px-2 py-4 md:px-8 hover:cursor-pointer",s.className),children:[(0,a.jsxs)(Pn,{variant:"body2",as:"div",className:"relative",children:[s?.render?s?.render({accessorKey:s?.accessorKey,parentData:t}):null,!s?.render&&s?.accessorKey?t?.[s?.accessorKey]:""]}),r?null:(0,a.jsxs)("div",{className:"items-center",children:[(0,a.jsx)(wS,{className:"absolute left-[12px] h-4 w-4 group-data-[state=open]:hidden"}),(0,a.jsx)(Gg,{className:"absolute left-[12px] h-4 w-4 group-data-[state=closed]:hidden"})]})]},`collapse-trigger-row-${String(s.accessorKey??s.id)}`))})},CX=({columns:e,data:t,nestedChildrenType:n,setData:r,openedRow:s,setOpenedRow:o})=>{const i=(0,l.useCallback)(u=>{o(p=>({...p,[u?.id]:!p[u?.id]}))},[o]);return(0,a.jsx)(a.Fragment,{children:t.map((u,p)=>{const g=u[n];return Array.isArray(u?.[n])&&g?.length===1?(0,a.jsx)(zl,{className:"overflow grid grid-cols-12 rounded-l-lg border-none",dataTestId:"collapsible-row",children:(0,a.jsx)(OM,{columns:e,parentData:u,childrens:g,setData:r,className:"justify-center"})},`collapsible-single-row-${u.id}`):(0,a.jsx)(bX,{asChild:!0,open:s[p],children:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(wX,{className:"group w-full",asChild:!0,children:(0,a.jsx)("div",{children:(0,a.jsx)(zl,{dataTestId:"collapsible-row",className:"overflow grid grid-cols-12 rounded-l-lg border-none","data-testid":"collapsible-trigger",onClick:()=>{i(u)},children:(0,a.jsx)(SX,{columns:e,data:u,setData:r})})})},`collapsible-trigger-${u?.id}`),(0,a.jsx)(xX,{children:(0,a.jsx)(zl,{className:"overflow grid grid-cols-12 border-none",dataTestId:"collapsible-row",children:(0,a.jsx)(OM,{columns:e,childrens:g,setData:r,className:"justify-center pl-20"})})})]})},`collapsible-${u?.id}`)})})};var Uf=(e=>(e.CAD="CAD",e.USD="USD",e))(Uf||{});const Md=e=>t=>Intl.NumberFormat(e,{style:"currency",currency:t.currency}).format(t.amount),EX=()=>e=>{switch(e){case Uf.USD:return oe.Sj.Usd;case Uf.CAD:default:return oe.Sj.Cad}},TX=({setSelectedRows:e})=>{const t=(0,l.useCallback)(({currentSelectedAll:o,data:i,handleSelectAll:u})=>{if(o)e([]);else{let p=[];i.forEach(g=>{g.offers?.forEach(v=>{p=[...p,{...v,isSelected:!0}]})}),e(p)}u()},[e]),n=(0,l.useCallback)(({setData:o,data:i,checked:u})=>{o(p=>p?.map(g=>g.name===i?.name?{...g,offers:g.offers?.map(v=>{const w={...v,isSelected:u};return e(x=>u?kV([...x,w],"sku"):[...x].find(E=>E.sku===w.sku)?[...x].filter(E=>E.sku!==w.sku):x),w})}:g))},[e]),r=(0,l.useCallback)(({data:o,checked:i,setData:u})=>{e(p=>{if(o){if(i&&![...p].map(g=>g.sku).includes(o.sku))return[...p,{...o,isSelected:i}];if([...p].map(g=>g.sku).includes(o.sku))return p.filter(g=>g.sku!==o?.sku)}return p}),u(p=>p?.map(g=>({...g,offers:g.offers?.map(v=>v.sku===o?.sku?{...v,isSelected:i}:v)})))},[e]),s=(0,l.useCallback)(o=>{const{isCollapsible:i,...u}=o;i?n(u):r(u)},[n,r]);return{selectAll:t,selectRow:s}},kX={id:"vendorName",ascending:!0},RX=(e,t)=>{const{checked:n,...r}=e;return(0,a.jsx)(wy,{variant:"secondary","data-testid":"checkbox-header",checked:n,onClick:()=>{t(r)}})},PX=(e,t)=>(0,a.jsx)(wy,{"data-testid":`checkbox-${e?.data?.id}`,variant:"secondary",checked:e?.data?.isSelected,onClick:n=>{n.stopPropagation()},onCheckedChange:n=>{t({...e,checked:n})}}),OX=({offers:e,onSelectOffers:t})=>{const{t:n,i18n:{language:r}}=(0,z.Bd)(),{catalogId:s}=Em(),o=uD(s),i=Md(r),{selectAll:u,selectRow:p}=TX({setSelectedRows:t}),g=[{id:"select",header:v=>RX(v,u),cell:v=>PX(v,p)},{id:"vendorName",header:n("rsp:pages.marketplace.addProducts.table.vendor"),onSort:({ascending:v,setData:w,data:x})=>{w?.(vE(x,"vendorName",!v))},render({parentData:v,data:w}){return v?.vendorName??w?.vendor}},{accessorKey:"sku",header:n("rsp:pages.marketplace.addProducts.table.sku")},{accessorKey:"name",className:"col-span-4",header:n("rsp:pages.marketplace.addProducts.table.productName"),onSort:({ascending:v,setData:w,data:x})=>{w?.(vE(x,"name",!v))}},{accessorKey:"price",header:n("rsp:pages.marketplace.addProducts.table.price"),render({data:v}){return v?.price&&i(v?.price)}}];return o?.data?(0,a.jsx)(_M,{columns:g,data:o?.data?.products,isHeaderFixed:!0,nestedChildrenTotalCount:o?.data?.totalOffersCount,nestedChildrenType:"offers",initialSort:kX,selectedRows:e,renderCollapsibleRow:v=>(0,a.jsx)(o0,{className:"mt-9 flex grow overflow-y-auto py-4",children:(0,a.jsx)(CX,{...v})})}):null},NX=Ll(()=>{const{t:e}=(0,z.Bd)(),[t,n]=(0,l.useState)(!1),{catalogId:r}=Em(),s=uD(r),o=GT(r),{setCatalogProductsMutation:i,onUpdateCatalogProducts:u}=XY(),{navigate:p}=Ni(),g=(0,l.useMemo)(()=>s?.data?.selectedOffers??[],[s?.data?.selectedOffers]),[v,w]=(0,l.useState)(g),x=Hu(g);(0,l.useEffect)(()=>{!v0()(g,x)&&g.length!==0&&w(g)},[g,x]);const E=YY({alreadyAddedOffers:s?.data?.selectedOffers??[],selectedOffers:v}),R=()=>{p(Sr.MarketplaceCatalogProducts,{catalogId:r??""})},k=(0,l.useCallback)(()=>{n(!0)},[]),N=()=>{u(s?.data?.allOffers??[],v)},L=()=>{n(!1)};return Af({isDirty:E}),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(hM,{open:!0,children:(0,a.jsx)(gM,{className:"ml-0 mr-[6px] flex h-3/4 flex-col outline-none lg:ml-[260px]",children:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(vM,{className:"p-4 pb-10 text-start md:pl-12",onClose:()=>{R()},children:[(0,a.jsx)(bM,{className:"dark:text-white",children:(0,Os.isRequestLoading)(o)?(0,a.jsx)(Ha,{className:"h-[18px] w-[264px]"}):e("rsp:pages.marketplace.addProducts.title",{name:o?.data?.name})}),(0,a.jsx)(wM,{className:"dark:text-white",children:e("rsp:pages.marketplace.addProducts.description")})]}),(0,Os.isRequestLoading)(s)?(0,a.jsx)("div",{className:"p-4 md:pl-12",children:(0,a.jsx)(Hp,{count:4})}):(0,a.jsx)(OX,{offers:v,onSelectOffers:w}),(0,a.jsx)(yM,{className:"sticky bottom-2 p-4 pt-6",children:(0,a.jsxs)("div",{className:"flex justify-end gap-4",children:[(0,a.jsx)(mn,{variant:No.Outline,"data-testid":"btnCancelManageCatalog",onClick:()=>{R()},children:e("core:actions.cancel")}),(0,a.jsx)(Di,{disabled:(0,Os.isRequestLoading)(s)||!E||i.isLoading,dataTestId:"btnUpdateCatalog",isLoading:i.isLoading,onClick:k,children:e("rsp:pages.marketplace.addProducts.updateCatalog")})]})})]})})}),(0,a.jsx)(ZY,{open:t,onClose:L,changedProductsCount:v.length,onSubmit:N})]})},oe.aX.CatalogProductsEdit),AX=()=>(0,a.jsx)("div",{className:"flex justify-center",children:(0,a.jsx)(zs,{className:"h-8 w-8",dataTestId:"spinnerInfiniteScroll"})}),wk=({isLoading:e=!1,hasMore:t,next:n,threshold:r=.8,root:s=null,rootMargin:o="0px"})=>{const i=(0,l.useRef)(null),u=(0,l.useCallback)(p=>{e||!t||!p||(i.current&&i.current.disconnect(),i.current=new IntersectionObserver(g=>{g[0].isIntersecting&&n()},{threshold:r,root:s,rootMargin:o}),i.current.observe(p))},[t,e,n,s,o,r]);return(0,a.jsx)("div",{ref:u,children:e?(0,a.jsx)(AX,{}):null})},NM=Ua,whe=eo,xhe=Zw,IX=ic,AM=l.forwardRef(({className:e,...t},n)=>(0,a.jsx)(Wh,{className:st("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));AM.displayName=Wh.displayName;const jX=Nl("fixed z-50 gap-4 bg-background p-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out sm:p-6",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4  border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right dark:border-l-slate-800"}},defaultVariants:{side:"right"}}),xk=l.forwardRef(({side:e="right",className:t,closeIconContainerClassName:n,children:r,...s},o)=>(0,a.jsxs)(IX,{children:[(0,a.jsx)(AM,{}),(0,a.jsxs)(kv,{ref:o,className:st(jX({side:e}),t),...s,children:[r,(0,a.jsxs)("div",{className:st("absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary sm:top-8",n),children:[(0,a.jsx)(mn,{"data-testid":"sheet-x-icon",variant:"none",onClick:()=>s.onClose(),className:"p-1",children:(0,a.jsx)(su,{className:"h-6 w-6 cursor-pointer stroke-1 text-slate-600 dark:text-white"})}),(0,a.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));xk.displayName=kv.displayName;const _k=({className:e,...t})=>(0,a.jsx)("div",{className:st("flex flex-col space-y-8 sm:text-left",e),...t});_k.displayName="SheetHeader";const IM=({className:e,...t})=>(0,a.jsx)("div",{className:st("mt-4 flex flex-col-reverse sm:flex-row sm:justify-between sm:space-x-2",e),...t});IM.displayName="SheetFooter";const Sk=l.forwardRef(({className:e,...t},n)=>(0,a.jsx)(jl,{ref:n,className:st("text-2xl font-base text-foreground",e),...t}));Sk.displayName=jl.displayName;const jM=l.forwardRef(({className:e,...t},n)=>(0,a.jsx)($g,{ref:n,className:st("text-sm text-muted-foreground",e),...t}));jM.displayName=$g.displayName;const DX=({children:e})=>(0,a.jsx)("div",{className:"flex flex-col",children:(0,a.jsx)("div",{className:"flex flex-col justify-between gap-4",children:e})}),MX=({children:e,className:t})=>(0,a.jsx)("div",{className:st("flex flex-1 flex-col gap-y-1",t),children:e}),$X=({children:e})=>(0,a.jsx)(Pn,{variant:"body2",colors:"light",as:"div",children:e}),LX=({children:e})=>(0,a.jsx)(Pn,{variant:"body2",as:"div",className:"mb-2",children:e}),FX=({children:e,className:t})=>(0,a.jsx)("div",{className:st("p-6",t),children:e}),zX=({children:e,className:t})=>(0,a.jsx)("div",{className:st("flex justify-between pb-0",t),children:e}),ls=({isLoading:e,title:t,children:n,onClose:r,dataTestId:s,...o})=>(0,a.jsx)(NM,{...o,open:!0,children:(0,a.jsx)(xk,{"data-testid":s??"sheetPage",className:"flex w-full flex-col gap-0 overflow-auto p-0 sm:w-[550px] sm:p-0",closeIconContainerClassName:"!top-6 [&>button]:p-0",onPointerDownOutside:r,onEscapeKeyDown:r,onClose:r,children:e?(0,a.jsx)(zs,{className:"absolute left-[calc(50%-3rem)] top-[calc(50%-3rem)]"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(_k,{className:"p-6 pr-14",children:(0,a.jsx)(Sk,{children:t})}),n]})})});ls.Row=zX,ls.Layout=FX,ls.Column=DX,ls.Content=MX,ls.ContentLabel=$X,ls.ContentValue=LX;const UX=({assignedOrganizations:e,unAssignedOrganizations:t})=>{const[n,r]=(0,l.useState)([]),[s,o]=(0,l.useState)([]);return(0,l.useEffect)(()=>{const i=e?.filter(u=>n.includes(u.organizationId));n.length!==0&&i?.length!==0&&i?.forEach(({organizationId:u})=>r(p=>p?.filter(g=>g!==u)))},[e,n]),(0,l.useEffect)(()=>{const i=t?.filter(u=>s.includes(u.organizationId));s.length!==0&&i?.length!==0&&i?.forEach(({organizationId:u})=>o(p=>p?.filter(g=>g!==u)))},[t,s]),{selectedAssignedOrganizationIds:n,setSelectedAssignedOrganizationIds:r,selectedRemovedOrganizationIds:s,setSelectedRemovedOrganizationIds:o}},BX=(e,t,n)=>t.includes(e?.organizationId??"")||e.isAssigned?!n.includes(e?.organizationId):e.isAssigned,VX=({infiniteScrollComponent:e,catalogOrganizations:t,selectedAssignedOrganizationIds:n,selectedRemovedOrganizationIds:r,onAssignOrganizations:s,onUnAssignOrganizations:o})=>{const{t:i}=(0,z.Bd)(),u=g=>{s(v=>[...v,g]),o(v=>v?.filter(w=>w!==g))},p=g=>{s(v=>v?.filter(w=>w!==g)),o(v=>[...v,g])};return(0,a.jsx)(ls.Layout,{className:"flex grow flex-col overflow-y-auto py-4 pt-9",children:t?.length===0?(0,a.jsx)(xy,{emptyMessage:i("rsp:pages.marketplace.manageOrganizations.notFound"),className:"my-4"}):(0,a.jsxs)(o0,{children:[(0,a.jsx)(zl,{className:"border-none",children:t?.map(g=>(0,a.jsx)(zl.Item,{"data-testid":"listOrganization",className:"border-b-1 flex h-16 w-full items-center p-0",children:(0,a.jsxs)(Fp,{htmlFor:g?.organizationId,className:"flex h-full w-full hover:cursor-pointer",children:[(0,a.jsx)(zl.Actions,{className:zT({className:"space-x-0"}),children:(0,a.jsx)(wy,{id:g?.organizationId,"data-testid":"checkboxAssignedOrganization",variant:"secondary",checked:BX(g,n,r),onCheckedChange:v=>{if(g?.organizationId){if(v){u(g.organizationId);return}p(g?.organizationId)}}})}),(0,a.jsx)(Pn,{variant:"body2",weight:"default",className:"flex items-center",children:g?.name})]})},g?.organizationId))}),e]})})},_w=({value:e,onChange:t,debounce:n=bE,...r})=>{const[s,o]=(0,l.useState)(e);return(0,l.useEffect)(()=>{o(e)},[e]),(0,l.useEffect)(()=>{const i=setTimeout(()=>{t(s)},n);return()=>clearTimeout(i)},[s]),(0,a.jsx)("input",{...r,value:s,onChange:i=>o(i.target.value)})},HX=({search:e,setSearch:t})=>{const{t:n}=(0,z.Bd)(),r=s=>{t(s)};return(0,a.jsx)(ls.Layout,{className:"sticky top-0 px-6 py-0",children:(0,a.jsxs)("div",{className:"relative top-0 flex w-full items-center",children:[(0,a.jsx)(Xh,{className:"absolute left-3 h-5 w-5 text-gray-500 focus-within:text-gray-600","aria-hidden":"true"}),(0,a.jsx)(_w,{type:"text",className:"w-full rounded-lg border border-gray-300 py-2 pl-10 text-left text-sm font-normal leading-none text-gray-600 outline-none focus:border-blue-500 focus:ring-blue-500 focus-visible:outline-offset-0 focus-visible:outline-indigo-300 dark:border-none dark:border-slate-800 dark:bg-slate-950 dark:text-slate-200 dark:ring-1 dark:ring-zinc-700",placeholder:n("rsp:pages.marketplace.manageOrganizations.searchPlaceholder"),value:e,onChange:r,"data-testid":"inputFilterTable"})]})})},WX=Ll(()=>{const{t:e}=(0,z.Bd)(),[t,n]=(0,l.useState)(""),{catalogId:r}=Em(),{navigate:s}=Ni(),o=Dl(),i=QT(r,{query:t}),u=(0,Os.getAllPagesResults)(i),p=QT(r,{query:"",pageSize:lD,filter:oe.F2.Assigned}),g=QT(r,{query:"",pageSize:lD,filter:oe.F2.Unassigned}),v=(0,Os.getAllPagesResults)(p),w=(0,Os.getAllPagesResults)(g),{selectedAssignedOrganizationIds:x,setSelectedAssignedOrganizationIds:E,selectedRemovedOrganizationIds:R,setSelectedRemovedOrganizationIds:k}=UX({assignedOrganizations:v,unAssignedOrganizations:w}),N=x.length!==0||R.length!==0,L=()=>{s(o(Sr.MarketplaceCatalogProducts,{catalogId:r}))},D=async()=>{await i.fetchNextPage()},B=()=>{console.log("selectedAssignedOrganizationIds",x),console.log("selectedRemovedOrganizationIds",R)};return Af({isDirty:N}),(0,a.jsxs)(ls,{title:(0,a.jsx)(Pn,{variant:"heading6",weight:"bold",className:"text-wrap",as:"div",children:e("rsp:pages.marketplace.manageOrganizations.title")}),onClose:L,children:[(0,a.jsx)(HX,{search:t,setSearch:n}),(0,Os.isRequestLoading)(i)?(0,a.jsx)(zs,{dataTestId:"layoverSpinnner",className:"absolute left-[calc(50%-3rem)] top-[calc(50%-3rem)] z-10"}):(0,a.jsx)(VX,{catalogOrganizations:u,selectedRemovedOrganizationIds:R,selectedAssignedOrganizationIds:x,onAssignOrganizations:E,onUnAssignOrganizations:k,infiniteScrollComponent:i?.hasNextPage?(0,a.jsx)(wk,{isLoading:i.isFetchingNextPage,hasMore:i?.hasNextPage,next:D}):null}),(0,a.jsx)("div",{className:"sticky bottom-2 mt-auto flex flex-col gap-2 p-6",children:(0,a.jsxs)("div",{className:"flex justify-end gap-4",children:[(0,a.jsx)(mn,{variant:No.Outline,"data-testid":"btnCancelManageCatalog",onClick:L,children:e("core:actions.cancel")}),(0,a.jsx)(Di,{disabled:!N||(0,Os.isRequestLoading)(i),isLoading:!1,"data-testid":"btnUpdateCatalog",onClick:B,children:e("rsp:pages.marketplace.manageOrganizations.updateCatalog")})]})})]})},oe.aX.CatalogOrganizationsList),qX=({catalogProducts:e,searchText:t})=>e?{filteredProducts:e.filter(r=>t===""||(r.name??"")?.toLowerCase().includes(t.toLowerCase())||(r.vendorName??"")?.toLowerCase().includes(t.toLowerCase())||r.offers?.some(s=>(s.sku??"").toLowerCase().includes(t.toLowerCase())))}:{filteredProducts:[]},DM=(0,l.forwardRef)((e,t)=>{const{children:n,...r}=e,s=l.Children.toArray(n),o=s.find(GX);if(o){const i=o.props.children,u=s.map(p=>p===o?l.Children.count(i)>1?l.Children.only(null):(0,l.isValidElement)(i)?i.props.children:null:p);return(0,l.createElement)(Ck,(0,Je.A)({},r,{ref:t}),(0,l.isValidElement)(i)?(0,l.cloneElement)(i,void 0,u):null)}return(0,l.createElement)(Ck,(0,Je.A)({},r,{ref:t}),n)});DM.displayName="Slot";const Ck=(0,l.forwardRef)((e,t)=>{const{children:n,...r}=e;return(0,l.isValidElement)(n)?(0,l.cloneElement)(n,{...QX(r,n.props),ref:t?nc(t,n.ref):n.ref}):l.Children.count(n)>1?l.Children.only(null):null});Ck.displayName="SlotClone";const KX=({children:e})=>(0,l.createElement)(l.Fragment,null,e);function GX(e){return(0,l.isValidElement)(e)&&e.type===KX}function QX(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...u)=>{o(...u),s(...u)}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}const Che=null,Ek=["Enter"," "],YX=["ArrowDown","PageUp","Home"],MM=["ArrowUp","PageDown","End"],XX=[...YX,...MM],ZX={ltr:[...Ek,"ArrowRight"],rtl:[...Ek,"ArrowLeft"]},JX={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Sw="Menu",[Cw,eZ,tZ]=Vb(Sw),[_0,$M]=va(Sw,[tZ,qv,iy]),Ew=qv(),LM=iy(),[FM,Tm]=_0(Sw),[nZ,Tw]=_0(Sw),zM=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:o,modal:i=!0}=e,u=Ew(t),[p,g]=(0,l.useState)(null),v=(0,l.useRef)(!1),w=Ao(o),x=lm(s);return(0,l.useEffect)(()=>{const E=()=>{v.current=!0,document.addEventListener("pointerdown",R,{capture:!0,once:!0}),document.addEventListener("pointermove",R,{capture:!0,once:!0})},R=()=>v.current=!1;return document.addEventListener("keydown",E,{capture:!0}),()=>{document.removeEventListener("keydown",E,{capture:!0}),document.removeEventListener("pointerdown",R,{capture:!0}),document.removeEventListener("pointermove",R,{capture:!0})}},[]),(0,l.createElement)(Vx,u,(0,l.createElement)(FM,{scope:t,open:n,onOpenChange:w,content:p,onContentChange:g},(0,l.createElement)(nZ,{scope:t,onClose:(0,l.useCallback)(()=>w(!1),[w]),isUsingKeyboardRef:v,dir:x,modal:i},r)))},rZ="MenuAnchor",Tk=(0,l.forwardRef)((e,t)=>{const{__scopeMenu:n,...r}=e,s=Ew(n);return(0,l.createElement)(Hx,(0,Je.A)({},s,r,{ref:t}))}),kk="MenuPortal",[sZ,UM]=_0(kk,{forceMount:void 0}),BM=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,o=Tm(kk,t);return(0,l.createElement)(sZ,{scope:t,forceMount:n},(0,l.createElement)(la,{present:n||o.open},(0,l.createElement)(Wi,{asChild:!0,container:s},r)))},Qu="MenuContent",[oZ,Rk]=_0(Qu),VM=(0,l.forwardRef)((e,t)=>{const n=UM(Qu,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,o=Tm(Qu,e.__scopeMenu),i=Tw(Qu,e.__scopeMenu);return(0,l.createElement)(Cw.Provider,{scope:e.__scopeMenu},(0,l.createElement)(la,{present:r||o.open},(0,l.createElement)(Cw.Slot,{scope:e.__scopeMenu},i.modal?(0,l.createElement)(aZ,(0,Je.A)({},s,{ref:t})):(0,l.createElement)(iZ,(0,Je.A)({},s,{ref:t})))))}),aZ=(0,l.forwardRef)((e,t)=>{const n=Tm(Qu,e.__scopeMenu),r=(0,l.useRef)(null),s=Lr(t,r);return(0,l.useEffect)(()=>{const o=r.current;if(o)return Uu(o)},[]),(0,l.createElement)(Pk,(0,Je.A)({},e,{ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:gn(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),iZ=(0,l.forwardRef)((e,t)=>{const n=Tm(Qu,e.__scopeMenu);return(0,l.createElement)(Pk,(0,Je.A)({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),Pk=(0,l.forwardRef)((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:u,onEntryFocus:p,onEscapeKeyDown:g,onPointerDownOutside:v,onFocusOutside:w,onInteractOutside:x,onDismiss:E,disableOutsideScroll:R,...k}=e,N=Tm(Qu,n),L=Tw(Qu,n),D=Ew(n),B=LM(n),Q=eZ(n),[ce,ye]=(0,l.useState)(null),G=(0,l.useRef)(null),Le=Lr(t,G,N.onContentChange),We=(0,l.useRef)(0),at=(0,l.useRef)(""),St=(0,l.useRef)(0),xt=(0,l.useRef)(null),Mt=(0,l.useRef)("right"),$t=(0,l.useRef)(0),Nt=R?xd:l.Fragment,Bn=R?{as:DM,allowPinchZoom:!0}:void 0,wn=Zt=>{var Pt,At;const Ht=at.current+Zt,Gt=Q().filter(ws=>!ws.disabled),Sn=document.activeElement,Cr=(Pt=Gt.find(ws=>ws.ref.current===Sn))===null||Pt===void 0?void 0:Pt.textValue,br=Gt.map(ws=>ws.textValue),Ln=bZ(br,Ht,Cr),Hr=(At=Gt.find(ws=>ws.textValue===Ln))===null||At===void 0?void 0:At.ref.current;(function ws(us){at.current=us,window.clearTimeout(We.current),us!==""&&(We.current=window.setTimeout(()=>ws(""),1e3))})(Ht),Hr&&setTimeout(()=>Hr.focus())};(0,l.useEffect)(()=>()=>window.clearTimeout(We.current),[]),hp();const Nn=(0,l.useCallback)(Zt=>{var Pt,At;return Mt.current===((Pt=xt.current)===null||Pt===void 0?void 0:Pt.side)&&xZ(Zt,(At=xt.current)===null||At===void 0?void 0:At.area)},[]);return(0,l.createElement)(oZ,{scope:n,searchRef:at,onItemEnter:(0,l.useCallback)(Zt=>{Nn(Zt)&&Zt.preventDefault()},[Nn]),onItemLeave:(0,l.useCallback)(Zt=>{var Pt;Nn(Zt)||((Pt=G.current)===null||Pt===void 0||Pt.focus(),ye(null))},[Nn]),onTriggerLeave:(0,l.useCallback)(Zt=>{Nn(Zt)&&Zt.preventDefault()},[Nn]),pointerGraceTimerRef:St,onPointerGraceIntentChange:(0,l.useCallback)(Zt=>{xt.current=Zt},[])},(0,l.createElement)(Nt,Bn,(0,l.createElement)(_f,{asChild:!0,trapped:s,onMountAutoFocus:gn(o,Zt=>{var Pt;Zt.preventDefault(),(Pt=G.current)===null||Pt===void 0||Pt.focus()}),onUnmountAutoFocus:i},(0,l.createElement)(wf,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:g,onPointerDownOutside:v,onFocusOutside:w,onInteractOutside:x,onDismiss:E},(0,l.createElement)(BE,(0,Je.A)({asChild:!0},B,{dir:L.dir,orientation:"vertical",loop:r,currentTabStopId:ce,onCurrentTabStopIdChange:ye,onEntryFocus:gn(p,Zt=>{L.isUsingKeyboardRef.current||Zt.preventDefault()})}),(0,l.createElement)(IC,(0,Je.A)({role:"menu","aria-orientation":"vertical","data-state":i$(N.open),"data-radix-menu-content":"",dir:L.dir},D,k,{ref:Le,style:{outline:"none",...k.style},onKeyDown:gn(k.onKeyDown,Zt=>{const At=Zt.target.closest("[data-radix-menu-content]")===Zt.currentTarget,Ht=Zt.ctrlKey||Zt.altKey||Zt.metaKey,Gt=Zt.key.length===1;At&&(Zt.key==="Tab"&&Zt.preventDefault(),!Ht&&Gt&&wn(Zt.key));const Sn=G.current;if(Zt.target!==Sn||!XX.includes(Zt.key))return;Zt.preventDefault();const br=Q().filter(Ln=>!Ln.disabled).map(Ln=>Ln.ref.current);MM.includes(Zt.key)&&br.reverse(),vZ(br)}),onBlur:gn(e.onBlur,Zt=>{Zt.currentTarget.contains(Zt.target)||(window.clearTimeout(We.current),at.current="")}),onPointerMove:gn(e.onPointerMove,Rw(Zt=>{const Pt=Zt.target,At=$t.current!==Zt.clientX;if(Zt.currentTarget.contains(Pt)&&At){const Ht=Zt.clientX>$t.current?"right":"left";Mt.current=Ht,$t.current=Zt.clientX}}))})))))))}),lZ="MenuGroup",Ok=(0,l.forwardRef)((e,t)=>{const{__scopeMenu:n,...r}=e;return(0,l.createElement)(zn.div,(0,Je.A)({role:"group"},r,{ref:t}))}),cZ="MenuLabel",HM=(0,l.forwardRef)((e,t)=>{const{__scopeMenu:n,...r}=e;return(0,l.createElement)(zn.div,(0,Je.A)({},r,{ref:t}))}),xS="MenuItem",WM="menu.itemSelect",_S=(0,l.forwardRef)((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,o=(0,l.useRef)(null),i=Tw(xS,e.__scopeMenu),u=Rk(xS,e.__scopeMenu),p=Lr(t,o),g=(0,l.useRef)(!1),v=()=>{const w=o.current;if(!n&&w){const x=new CustomEvent(WM,{bubbles:!0,cancelable:!0});w.addEventListener(WM,E=>r?.(E),{once:!0}),lp(w,x),x.defaultPrevented?g.current=!1:i.onClose()}};return(0,l.createElement)(qM,(0,Je.A)({},s,{ref:p,disabled:n,onClick:gn(e.onClick,v),onPointerDown:w=>{var x;(x=e.onPointerDown)===null||x===void 0||x.call(e,w),g.current=!0},onPointerUp:gn(e.onPointerUp,w=>{var x;g.current||(x=w.currentTarget)===null||x===void 0||x.click()}),onKeyDown:gn(e.onKeyDown,w=>{const x=u.searchRef.current!=="";n||x&&w.key===" "||Ek.includes(w.key)&&(w.currentTarget.click(),w.preventDefault())})}))}),qM=(0,l.forwardRef)((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...o}=e,i=Rk(xS,n),u=LM(n),p=(0,l.useRef)(null),g=Lr(t,p),[v,w]=(0,l.useState)(!1),[x,E]=(0,l.useState)("");return(0,l.useEffect)(()=>{const R=p.current;if(R){var k;E(((k=R.textContent)!==null&&k!==void 0?k:"").trim())}},[o.children]),(0,l.createElement)(Cw.ItemSlot,{scope:n,disabled:r,textValue:s??x},(0,l.createElement)(VE,(0,Je.A)({asChild:!0},u,{focusable:!r}),(0,l.createElement)(zn.div,(0,Je.A)({role:"menuitem","data-highlighted":v?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},o,{ref:g,onPointerMove:gn(e.onPointerMove,Rw(R=>{r?i.onItemLeave(R):(i.onItemEnter(R),R.defaultPrevented||R.currentTarget.focus())})),onPointerLeave:gn(e.onPointerLeave,Rw(R=>i.onItemLeave(R))),onFocus:gn(e.onFocus,()=>w(!0)),onBlur:gn(e.onBlur,()=>w(!1))}))))}),uZ="MenuCheckboxItem",KM=(0,l.forwardRef)((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return(0,l.createElement)(ZM,{scope:e.__scopeMenu,checked:n},(0,l.createElement)(_S,(0,Je.A)({role:"menuitemcheckbox","aria-checked":SS(n)?"mixed":n},s,{ref:t,"data-state":Ik(n),onSelect:gn(s.onSelect,()=>r?.(SS(n)?!0:!n),{checkForDefaultPrevented:!1})})))}),GM="MenuRadioGroup",[dZ,fZ]=_0(GM,{value:void 0,onValueChange:()=>{}}),QM=(0,l.forwardRef)((e,t)=>{const{value:n,onValueChange:r,...s}=e,o=Ao(r);return(0,l.createElement)(dZ,{scope:e.__scopeMenu,value:n,onValueChange:o},(0,l.createElement)(Ok,(0,Je.A)({},s,{ref:t})))}),YM="MenuRadioItem",XM=(0,l.forwardRef)((e,t)=>{const{value:n,...r}=e,s=fZ(YM,e.__scopeMenu),o=n===s.value;return(0,l.createElement)(ZM,{scope:e.__scopeMenu,checked:o},(0,l.createElement)(_S,(0,Je.A)({role:"menuitemradio","aria-checked":o},r,{ref:t,"data-state":Ik(o),onSelect:gn(r.onSelect,()=>{var i;return(i=s.onValueChange)===null||i===void 0?void 0:i.call(s,n)},{checkForDefaultPrevented:!1})})))}),Nk="MenuItemIndicator",[ZM,pZ]=_0(Nk,{checked:!1}),JM=(0,l.forwardRef)((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,o=pZ(Nk,n);return(0,l.createElement)(la,{present:r||SS(o.checked)||o.checked===!0},(0,l.createElement)(zn.span,(0,Je.A)({},s,{ref:t,"data-state":Ik(o.checked)})))}),hZ="MenuSeparator",e$=(0,l.forwardRef)((e,t)=>{const{__scopeMenu:n,...r}=e;return(0,l.createElement)(zn.div,(0,Je.A)({role:"separator","aria-orientation":"horizontal"},r,{ref:t}))}),mZ="MenuArrow",t$=(0,l.forwardRef)((e,t)=>{const{__scopeMenu:n,...r}=e,s=Ew(n);return(0,l.createElement)(jC,(0,Je.A)({},s,r,{ref:t}))}),Ak="MenuSub",[gZ,n$]=_0(Ak),r$=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:s}=e,o=Tm(Ak,t),i=Ew(t),[u,p]=(0,l.useState)(null),[g,v]=(0,l.useState)(null),w=Ao(s);return(0,l.useEffect)(()=>(o.open===!1&&w(!1),()=>w(!1)),[o.open,w]),(0,l.createElement)(Vx,i,(0,l.createElement)(FM,{scope:t,open:r,onOpenChange:w,content:g,onContentChange:v},(0,l.createElement)(gZ,{scope:t,contentId:ri(),triggerId:ri(),trigger:u,onTriggerChange:p},n)))},kw="MenuSubTrigger",s$=(0,l.forwardRef)((e,t)=>{const n=Tm(kw,e.__scopeMenu),r=Tw(kw,e.__scopeMenu),s=n$(kw,e.__scopeMenu),o=Rk(kw,e.__scopeMenu),i=(0,l.useRef)(null),{pointerGraceTimerRef:u,onPointerGraceIntentChange:p}=o,g={__scopeMenu:e.__scopeMenu},v=(0,l.useCallback)(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return(0,l.useEffect)(()=>v,[v]),(0,l.useEffect)(()=>{const w=u.current;return()=>{window.clearTimeout(w),p(null)}},[u,p]),(0,l.createElement)(Tk,(0,Je.A)({asChild:!0},g),(0,l.createElement)(qM,(0,Je.A)({id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":i$(n.open)},e,{ref:nc(t,s.onTriggerChange),onClick:w=>{var x;(x=e.onClick)===null||x===void 0||x.call(e,w),!(e.disabled||w.defaultPrevented)&&(w.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:gn(e.onPointerMove,Rw(w=>{o.onItemEnter(w),!w.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(o.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),v()},100))})),onPointerLeave:gn(e.onPointerLeave,Rw(w=>{var x;v();const E=(x=n.content)===null||x===void 0?void 0:x.getBoundingClientRect();if(E){var R;const k=(R=n.content)===null||R===void 0?void 0:R.dataset.side,N=k==="right",L=N?-5:5,D=E[N?"left":"right"],B=E[N?"right":"left"];o.onPointerGraceIntentChange({area:[{x:w.clientX+L,y:w.clientY},{x:D,y:E.top},{x:B,y:E.top},{x:B,y:E.bottom},{x:D,y:E.bottom}],side:k}),window.clearTimeout(u.current),u.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(w),w.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:gn(e.onKeyDown,w=>{const x=o.searchRef.current!=="";if(!(e.disabled||x&&w.key===" ")&&ZX[r.dir].includes(w.key)){var E;n.onOpenChange(!0),(E=n.content)===null||E===void 0||E.focus(),w.preventDefault()}})})))}),o$="MenuSubContent",a$=(0,l.forwardRef)((e,t)=>{const n=UM(Qu,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,o=Tm(Qu,e.__scopeMenu),i=Tw(Qu,e.__scopeMenu),u=n$(o$,e.__scopeMenu),p=(0,l.useRef)(null),g=Lr(t,p);return(0,l.createElement)(Cw.Provider,{scope:e.__scopeMenu},(0,l.createElement)(la,{present:r||o.open},(0,l.createElement)(Cw.Slot,{scope:e.__scopeMenu},(0,l.createElement)(Pk,(0,Je.A)({id:u.contentId,"aria-labelledby":u.triggerId},s,{ref:g,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:v=>{var w;i.isUsingKeyboardRef.current&&((w=p.current)===null||w===void 0||w.focus()),v.preventDefault()},onCloseAutoFocus:v=>v.preventDefault(),onFocusOutside:gn(e.onFocusOutside,v=>{v.target!==u.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:gn(e.onEscapeKeyDown,v=>{i.onClose(),v.preventDefault()}),onKeyDown:gn(e.onKeyDown,v=>{const w=v.currentTarget.contains(v.target),x=JX[i.dir].includes(v.key);if(w&&x){var E;o.onOpenChange(!1),(E=u.trigger)===null||E===void 0||E.focus(),v.preventDefault()}})})))))});function i$(e){return e?"open":"closed"}function SS(e){return e==="indeterminate"}function Ik(e){return SS(e)?"indeterminate":e?"checked":"unchecked"}function vZ(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function yZ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function bZ(e,t,n){const s=t.length>1&&Array.from(t).every(g=>g===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let i=yZ(e,Math.max(o,0));s.length===1&&(i=i.filter(g=>g!==n));const p=i.find(g=>g.toLowerCase().startsWith(s.toLowerCase()));return p!==n?p:void 0}function wZ(e,t){const{x:n,y:r}=e;let s=!1;for(let o=0,i=t.length-1;o<t.length;i=o++){const u=t[o].x,p=t[o].y,g=t[i].x,v=t[i].y;p>r!=v>r&&n<(g-u)*(r-p)/(v-p)+u&&(s=!s)}return s}function xZ(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return wZ(n,t)}function Rw(e){return t=>t.pointerType==="mouse"?e(t):void 0}const _Z=zM,SZ=Tk,CZ=BM,EZ=VM,TZ=Ok,kZ=HM,RZ=_S,PZ=KM,OZ=QM,NZ=XM,AZ=JM,IZ=e$,jZ=t$,DZ=r$,MZ=s$,$Z=a$,jk="DropdownMenu",[LZ,Ehe]=va(jk,[$M]),Ul=$M(),[FZ,l$]=LZ(jk),c$=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:s,defaultOpen:o,onOpenChange:i,modal:u=!0}=e,p=Ul(t),g=(0,l.useRef)(null),[v=!1,w]=si({prop:s,defaultProp:o,onChange:i});return(0,l.createElement)(FZ,{scope:t,triggerId:ri(),triggerRef:g,contentId:ri(),open:v,onOpenChange:w,onOpenToggle:(0,l.useCallback)(()=>w(x=>!x),[w]),modal:u},(0,l.createElement)(_Z,(0,Je.A)({},p,{open:v,onOpenChange:w,dir:r,modal:u}),n))},u$="DropdownMenuTrigger",d$=(0,l.forwardRef)((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=e,o=l$(u$,n),i=Ul(n);return(0,l.createElement)(SZ,(0,Je.A)({asChild:!0},i),(0,l.createElement)(zn.button,(0,Je.A)({type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r},s,{ref:nc(t,o.triggerRef),onPointerDown:gn(e.onPointerDown,u=>{!r&&u.button===0&&u.ctrlKey===!1&&(o.onOpenToggle(),o.open||u.preventDefault())}),onKeyDown:gn(e.onKeyDown,u=>{r||(["Enter"," "].includes(u.key)&&o.onOpenToggle(),u.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})))}),zZ="DropdownMenuPortal",f$=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Ul(t);return(0,l.createElement)(CZ,(0,Je.A)({},r,n))},p$="DropdownMenuContent",h$=(0,l.forwardRef)((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=l$(p$,n),o=Ul(n),i=(0,l.useRef)(!1);return(0,l.createElement)(EZ,(0,Je.A)({id:s.contentId,"aria-labelledby":s.triggerId},o,r,{ref:t,onCloseAutoFocus:gn(e.onCloseAutoFocus,u=>{var p;i.current||(p=s.triggerRef.current)===null||p===void 0||p.focus(),i.current=!1,u.preventDefault()}),onInteractOutside:gn(e.onInteractOutside,u=>{const p=u.detail.originalEvent,g=p.button===0&&p.ctrlKey===!0,v=p.button===2||g;(!s.modal||v)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),UZ="DropdownMenuGroup",m$=(0,l.forwardRef)((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Ul(n);return(0,l.createElement)(TZ,(0,Je.A)({},s,r,{ref:t}))}),BZ="DropdownMenuLabel",g$=(0,l.forwardRef)((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Ul(n);return(0,l.createElement)(kZ,(0,Je.A)({},s,r,{ref:t}))}),VZ="DropdownMenuItem",v$=(0,l.forwardRef)((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Ul(n);return(0,l.createElement)(RZ,(0,Je.A)({},s,r,{ref:t}))}),HZ="DropdownMenuCheckboxItem",y$=(0,l.forwardRef)((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Ul(n);return(0,l.createElement)(PZ,(0,Je.A)({},s,r,{ref:t}))}),WZ="DropdownMenuRadioGroup",b$=(0,l.forwardRef)((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Ul(n);return(0,l.createElement)(OZ,(0,Je.A)({},s,r,{ref:t}))}),qZ="DropdownMenuRadioItem",w$=(0,l.forwardRef)((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Ul(n);return(0,l.createElement)(NZ,(0,Je.A)({},s,r,{ref:t}))}),KZ="DropdownMenuItemIndicator",x$=(0,l.forwardRef)((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Ul(n);return(0,l.createElement)(AZ,(0,Je.A)({},s,r,{ref:t}))}),GZ="DropdownMenuSeparator",_$=(0,l.forwardRef)((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Ul(n);return(0,l.createElement)(IZ,(0,Je.A)({},s,r,{ref:t}))}),QZ="DropdownMenuArrow",YZ=(0,l.forwardRef)((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Ul(n);return(0,l.createElement)(jZ,(0,Je.A)({},s,r,{ref:t}))}),XZ=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:s,defaultOpen:o}=e,i=Ul(t),[u=!1,p]=si({prop:r,defaultProp:o,onChange:s});return(0,l.createElement)(DZ,(0,Je.A)({},i,{open:u,onOpenChange:p}),n)},ZZ="DropdownMenuSubTrigger",S$=(0,l.forwardRef)((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Ul(n);return(0,l.createElement)(MZ,(0,Je.A)({},s,r,{ref:t}))}),JZ="DropdownMenuSubContent",C$=(0,l.forwardRef)((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Ul(n);return(0,l.createElement)($Z,(0,Je.A)({},s,r,{ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),eJ=c$,tJ=d$,E$=f$,T$=h$,nJ=m$,k$=g$,R$=v$,P$=y$,rJ=b$,O$=w$,N$=x$,A$=_$,The=null,sJ=XZ,I$=S$,j$=C$;/**
 * @license lucide-react v0.330.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const oJ=l0("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),S0=eJ,C0=tJ,khe=nJ,Rhe=E$,Phe=sJ,Ohe=rJ,aJ=l.forwardRef(({className:e,inset:t,children:n,...r},s)=>(0,a.jsxs)(I$,{ref:s,className:st("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[n,(0,a.jsx)(oJ,{className:"ml-auto h-4 w-4"})]}));aJ.displayName=I$.displayName;const iJ=l.forwardRef(({className:e,...t},n)=>(0,a.jsx)(j$,{ref:n,className:st("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));iJ.displayName=j$.displayName;const km=l.forwardRef(({className:e,sideOffset:t=4,...n},r)=>(0,a.jsx)(E$,{children:(0,a.jsx)(T$,{ref:r,sideOffset:t,className:st("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));km.displayName=T$.displayName;const Bl=l.forwardRef(({className:e,inset:t,...n},r)=>(0,a.jsx)(R$,{ref:r,className:st("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 hover:cursor-pointer disabled:cursor-not-allowed ",t&&"pl-8",e),...n}));Bl.displayName=R$.displayName;const lJ=l.forwardRef(({className:e,children:t,checked:n,...r},s)=>(0,a.jsxs)(P$,{ref:s,className:st("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[(0,a.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,a.jsx)(N$,{children:(0,a.jsx)(nD,{className:"h-4 w-4"})})}),t]}));lJ.displayName=P$.displayName;const cJ=l.forwardRef(({className:e,children:t,...n},r)=>(0,a.jsxs)(O$,{ref:r,className:st("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[(0,a.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,a.jsx)(N$,{children:(0,a.jsx)(Tj,{className:"h-2 w-2 fill-current"})})}),t]}));cJ.displayName=O$.displayName;const uJ=l.forwardRef(({className:e,inset:t,...n},r)=>(0,a.jsx)(k$,{ref:r,className:st("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));uJ.displayName=k$.displayName;const dJ=l.forwardRef(({className:e,...t},n)=>(0,a.jsx)(A$,{ref:n,className:st("-mx-1 my-1 h-px bg-muted",e),...t}));dJ.displayName=A$.displayName;const fJ=({className:e,...t})=>(0,a.jsx)("span",{className:st("ml-auto text-xs tracking-widest opacity-60",e),...t});fJ.displayName="DropdownMenuShortcut";const pJ=({children:e})=>{const{t}=(0,z.Bd)(),[n,r]=(0,l.useState)(!1),{catalogId:s}=Em();return(0,a.jsxs)("div",{className:"flex w-full justify-between",children:[e,(0,a.jsxs)(S0,{open:n,onOpenChange:r,children:[(0,a.jsx)(C0,{asChild:!0,"data-testid":"dropdownManageCatalog",children:(0,a.jsx)(mn,{variant:"None",className:"bg-indigo-600 px-4 py-2 hover:bg-indigo-700",children:t("rsp:pages.marketplace.catalogs.manageCatalog")})}),(0,a.jsxs)(km,{align:"end",className:"min-w-[230px]",children:[(0,a.jsx)(Bl,{"data-testid":"dropdownItemManageProducts",asChild:!0,children:(0,a.jsx)(vl,{to:Sr.MarketplaceCatalogAddProducts,params:{catalogId:s},children:t("rsp:pages.marketplace.catalogs.manageProducts")})}),(0,a.jsx)(Bl,{"data-testid":"dropdownItemAssignedOrganizations",asChild:!0,children:(0,a.jsx)(vl,{to:Sr.MarketplaceCatalogAssignedOrganizations,params:{catalogId:s},children:t("rsp:pages.marketplace.catalogs.manageAssignedOrganizations")})})]})]})]})};function hJ({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"}))}const Dk=l.forwardRef(hJ),mJ=()=>{const{t:e}=(0,z.Bd)(),{catalogId:t}=Em(),{navigate:n}=Ni(),r=()=>{n(Sr.MarketplaceCatalogAddProducts,{catalogId:t})},s=o=>{o.key==="Enter"&&r()};return(0,a.jsx)(xo,{className:"flex h-56 flex-col justify-between border-2 border-dashed border-slate-400 hover:cursor-pointer focus-visible:outline-indigo-300 md:p-4","data-testid":"cardAddProductsToCatalog",tabIndex:0,onKeyDown:s,onClick:r,children:(0,a.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-2",children:[(0,a.jsx)(Dk,{className:"h-8 w-8 stroke-2 text-slate-500"}),(0,a.jsx)(Pn,{className:"text-slate-500 dark:text-slate-200",children:e("rsp:pages.marketplace.catalogs.addProducts")})]})})},D$=({vendorType:e,className:t})=>{if(!e)return null;const n=()=>{switch(e){case"Microsoft":return(0,a.jsx)("img",{src:"/microsoft-vendor.png",alt:"Microsoft vendor","data-testid":"vendorMicrosoft",className:"h-full"});case"Google":return(0,a.jsx)("img",{src:"/google-vendor.png",alt:"Google vendor","data-testid":"vendorGoogle",className:"h-full"});default:return(0,a.jsx)(Pn,{variant:"body2",colors:"light","data-testid":`vendor${Sd(e)}`,children:e})}};return(0,a.jsx)("div",{className:t,children:n()})},gJ=({product:e})=>{const{t,i18n:{language:n}}=(0,z.Bd)(),r=Md(n);return(0,a.jsx)(xo,{className:"flex min-h-56 flex-col justify-between md:p-4","data-testid":"cardCatalogProduct",children:(0,a.jsxs)("div",{className:"flex h-full flex-col justify-between gap-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(D$,{vendorType:e.vendorName,className:"mb-2 h-[16px]"}),(0,a.jsx)(fc,{className:"min-h-12 text-slate-900 dark:text-slate-200",children:(0,a.jsx)(Pn,{variant:"body1",weight:"semiBold",className:"line-clamp-3 text-wrap sm:line-clamp-2","data-testid":"productName",children:e.name})}),(0,a.jsx)("div",{className:"flex flex-wrap items-center gap-x-2",children:(0,a.jsxs)("div",{className:"mt-3 flex flex-col items-start gap-2",children:[(0,a.jsxs)(Pn,{variant:"body2",children:[t("rsp:pages.marketplace.catalogs.billingCycle"),"/",t("rsp:pages.marketplace.catalogs.commitmentTerm")]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1",children:e.offers?.map(s=>(0,a.jsxs)(to,{"data-testid":"productOffer",className:"dark:bg-slate-950 dark:text-slate-200",children:[t(`rsp:pages.marketplace.catalogs.billingCycleValues.${s.billingCycle}`),"/",t(`rsp:pages.marketplace.catalogs.commitmentValues.${s.commitmentTermType}`)]},s.sku))})]})})]}),(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)(Pn,{variant:"body1",weight:"semiBold","data-testid":"productPrice",children:e.startingPrice&&r(e.startingPrice)}),(0,a.jsx)(Pn,{variant:"body2",colors:"light",children:t("rsp:pages.marketplace.catalogs.startingPrice")})]})]})},e.id)},vJ=()=>{const{t:e}=(0,z.Bd)();return(0,a.jsxs)("div",{className:"flex flex-col gap-12 md:gap-16",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(vl,{to:Sr.Marketplace,"data-testid":"linkBackToCatalogs",children:(0,a.jsx)(a0,{children:e("rsp:pages.marketplace.catalogs.backToCatalogs")})}),(0,a.jsxs)("div",{children:[(0,a.jsx)(Ha,{className:"h-[60px] w-80"}),(0,a.jsx)(Ha,{className:"mt-2 h-[14px] w-96"})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)(Ha,{className:"h-[36px] w-[300px]"}),(0,a.jsx)(Ha,{className:"h-[36px] w-[130px]"})]}),(0,a.jsx)(Ha,{className:"h-[34px] w-[390px]"})]}),(0,a.jsx)("div",{className:"mt-4 grid grid-cols-1 gap-4 lg:gap-6 xl:grid-cols-1",children:(0,a.jsx)("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-2 lg:grid-cols-3 lg:gap-6 xl:grid-cols-4",children:(0,a.jsx)(dD,{className:"h-56",children:(0,a.jsxs)("div",{className:"mt-3 flex flex-col gap-2",children:[(0,a.jsx)(Ha,{className:"h-[20px] w-[90px]"}),(0,a.jsx)(Ha,{className:"h-[20px] w-[180px]"})]})})})})]})},yJ=({searchText:e,setSearchText:t})=>{const{t:n}=(0,z.Bd)();return(0,a.jsxs)("div",{className:"relative flex w-full items-center md:mb-0 md:w-1/3 md:min-w-[350px]",children:[(0,a.jsx)(Xh,{className:"absolute left-3 h-5 w-5 text-gray-500 focus-within:text-gray-600","aria-hidden":"true"}),(0,a.jsx)(_w,{type:"text",className:"w-full rounded-lg border border-gray-300 py-2 pl-10 text-left text-sm font-normal leading-none text-gray-600 outline-none focus:border-blue-500 focus:ring-blue-500 focus-visible:outline-offset-0 focus-visible:outline-indigo-300 dark:border-none dark:border-slate-800 dark:bg-slate-950 dark:text-slate-200 dark:ring-1 dark:ring-zinc-700",placeholder:n("rsp:pages.marketplace.catalogs.searchInputPlaceholder"),value:e,onChange:t,"data-testid":"inputMarketplaceCatalogProductsSearch"}),(0,a.jsx)("div",{className:"justify-content absolute right-3 flex items-center",children:(0,a.jsx)($l,{tooltip:n("rsp:pages.marketplace.catalogs.searchInputHelper"),className:"ml-8",children:(0,a.jsx)(c0,{className:"h-4 w-4 text-gray-500 focus-within:text-gray-600","aria-hidden":"true"})})})]})},bJ=Ll(()=>{const{t:e}=(0,z.Bd)(),[t,n]=(0,l.useState)(""),{catalogId:r}=Em(),s=dQ(r),o=GT(r),i=(0,Os.isRequestHavingNoResults)(s),{filteredProducts:u}=qX({catalogProducts:s?.data,searchText:t}),p=()=>i?(0,a.jsx)(mJ,{}):u?.length===0?(0,a.jsx)(xy,{dataTestId:"CatalogProducts"}):u?.map(g=>(0,a.jsx)(gJ,{product:g},g.id));return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(Wu,{children:(0,Os.isRequestLoading)(s)||(0,Os.isRequestLoading)(o)?(0,a.jsx)(vJ,{}):(0,a.jsxs)("div",{className:"flex flex-col gap-12 md:gap-16",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(vl,{to:Sr.Marketplace,"data-testid":"linkBackToCatalogs",children:(0,a.jsx)(a0,{children:e("rsp:pages.marketplace.catalogs.backToCatalogs")})}),(0,a.jsx)(yl,{title:(0,a.jsx)(el,{"data-testid":"pageCatalogProductsTitle",children:o?.data?.name}),subTitle:(0,a.jsx)(qu,{"data-testid":"pageCatalogProductsSubitle",children:o?.data?.description})})]}),i?null:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(pJ,{children:(0,a.jsx)(Pn,{variant:"heading5",weight:"bold",children:e("rsp:pages.marketplace.catalogs.allProducts")})}),(0,a.jsx)(yJ,{searchText:t,setSearchText:n})]}),(0,a.jsx)("div",{className:"mt-4 grid grid-cols-1 gap-4 lg:gap-6 xl:grid-cols-1",children:(0,a.jsx)("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-2 lg:grid-cols-3 lg:gap-6 xl:grid-cols-4",children:p()})})]})}),(0,a.jsx)(Ta,{})]})},oe.aX.CatalogProductsList);var wJ=ln(4044),xJ=ln.n(wJ);const _J=({...e})=>{const{t}=(0,z.Bd)(),n=()=>{window.location.href=Un.Root};return(0,a.jsxs)("div",{className:"mt-6 flex flex-col gap-8 md:mt-12","data-testid":"bootstraping-step",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-4 md:gap-9",children:[(0,a.jsx)("div",{className:"flex justify-center",children:(0,a.jsx)("div",{className:"flex h-14 w-14 items-center justify-center rounded-full bg-slate-200 dark:border dark:border-slate-800 dark:bg-slate-950 md:h-28 md:w-28",children:(0,a.jsx)(Gv,{className:"h-12 w-12 stroke-2 text-white md:h-24 md:w-24"})})}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("h1",{className:"text-center text-3xl font-medium text-slate-900 dark:text-slate-200",children:t("rsp:pages.onboarding.onboardingComplete.title")}),(0,a.jsx)("p",{className:"text-center text-sm text-slate-500 dark:text-slate-200",children:t("rsp:pages.onboarding.onboardingComplete.description")})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4 px-0 text-sm dark:text-slate-100 md:px-16",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(Zb,{className:"ml-2 h-8 w-8 shrink-0 text-gray-900 dark:text-white"}),t("rsp:pages.onboarding.onboardingComplete.labels.seeOrganizations")]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(Zb,{className:"ml-2 h-8 w-8 shrink-0 text-gray-900 dark:text-white"}),t("rsp:pages.onboarding.onboardingComplete.labels.inviteCustomers")]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(Zb,{className:"ml-2 h-8 w-8 shrink-0 text-gray-900 dark:text-white"}),t("rsp:pages.onboarding.onboardingComplete.labels.moreFeature")]}),(0,a.jsx)("div",{className:"mt-8 flex flex-row justify-center",children:(0,a.jsx)(mn,{type:"button",onClick:n,"data-testid":"btnAccessSelfServicePortal",children:t("rsp:pages.onboarding.complete")})})]})]})};var SJ=ln(8379),CJ=ln.n(SJ),EJ=ln(6882),ra=ln.n(EJ),TJ=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function Pw(e,t){var n=kJ(e);if(typeof n.path!="string"){var r=e.webkitRelativePath;Object.defineProperty(n,"path",{value:typeof t=="string"?t:typeof r=="string"&&r.length>0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}function kJ(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),s=TJ.get(r);s&&Object.defineProperty(e,"type",{value:s,writable:!1,configurable:!1,enumerable:!0})}return e}var RJ=[".DS_Store","Thumbs.db"];function PJ(e){return qi(this,void 0,void 0,function(){return ju(this,function(t){return CS(e)&&OJ(e.dataTransfer)?[2,jJ(e.dataTransfer,e.type)]:NJ(e)?[2,AJ(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,IJ(e)]:[2,[]]})})}function OJ(e){return CS(e)}function NJ(e){return CS(e)&&CS(e.target)}function CS(e){return typeof e=="object"&&e!==null}function AJ(e){return Mk(e.target.files).map(function(t){return Pw(t)})}function IJ(e){return qi(this,void 0,void 0,function(){var t;return ju(this,function(n){switch(n.label){case 0:return[4,Promise.all(e.map(function(r){return r.getFile()}))];case 1:return t=n.sent(),[2,t.map(function(r){return Pw(r)})]}})})}function jJ(e,t){return qi(this,void 0,void 0,function(){var n,r;return ju(this,function(s){switch(s.label){case 0:return e.items?(n=Mk(e.items).filter(function(o){return o.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(DJ))]):[3,2];case 1:return r=s.sent(),[2,M$($$(r))];case 2:return[2,M$(Mk(e.files).map(function(o){return Pw(o)}))]}})})}function M$(e){return e.filter(function(t){return RJ.indexOf(t.name)===-1})}function Mk(e){if(e===null)return[];for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r)}return t}function DJ(e){if(typeof e.webkitGetAsEntry!="function")return L$(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?F$(t):L$(e)}function $$(e){return e.reduce(function(t,n){return hd(hd([],Ki(t),!1),Ki(Array.isArray(n)?$$(n):[n]),!1)},[])}function L$(e){var t=e.getAsFile();if(!t)return Promise.reject("".concat(e," is not a File"));var n=Pw(t);return Promise.resolve(n)}function MJ(e){return qi(this,void 0,void 0,function(){return ju(this,function(t){return[2,e.isDirectory?F$(e):$J(e)]})})}function F$(e){var t=e.createReader();return new Promise(function(n,r){var s=[];function o(){var i=this;t.readEntries(function(u){return qi(i,void 0,void 0,function(){var p,g,v;return ju(this,function(w){switch(w.label){case 0:if(u.length)return[3,5];w.label=1;case 1:return w.trys.push([1,3,,4]),[4,Promise.all(s)];case 2:return p=w.sent(),n(p),[3,4];case 3:return g=w.sent(),r(g),[3,4];case 4:return[3,6];case 5:v=Promise.all(u.map(MJ)),s.push(v),o(),w.label=6;case 6:return[2]}})})},function(u){r(u)})}o()})}function $J(e){return qi(this,void 0,void 0,function(){return ju(this,function(t){return[2,new Promise(function(n,r){e.file(function(s){var o=Pw(s,e.fullPath);n(o)},function(s){r(s)})})]})})}var LJ=ln(6721);function z$(e){return UJ(e)||zJ(e)||H$(e)||FJ()}function FJ(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zJ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function UJ(e){if(Array.isArray(e))return Lk(e)}function U$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function B$(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?U$(Object(n),!0).forEach(function(r){V$(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):U$(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function V$(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $k(e){return $k=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$k(e)}function Ow(e,t){return HJ(e)||VJ(e,t)||H$(e,t)||BJ()}function BJ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function H$(e,t){if(e){if(typeof e=="string")return Lk(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Lk(e,t)}}function Lk(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function VJ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],s=!0,o=!1,i,u;try{for(n=n.call(e);!(s=(i=n.next()).done)&&(r.push(i.value),!(t&&r.length===t));s=!0);}catch(p){o=!0,u=p}finally{try{!s&&n.return!=null&&n.return()}finally{if(o)throw u}}return r}}function HJ(e){if(Array.isArray(e))return e}var W$="file-invalid-type",q$="file-too-large",K$="file-too-small",G$="too-many-files",jhe={FileInvalidType:W$,FileTooLarge:q$,FileTooSmall:K$,TooManyFiles:G$},WJ=function(t){t=Array.isArray(t)&&t.length===1?t[0]:t;var n=Array.isArray(t)?"one of ".concat(t.join(", ")):t;return{code:W$,message:"File type must be ".concat(n)}},Q$=function(t){return{code:q$,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},Y$=function(t){return{code:K$,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},qJ={code:G$,message:"Too many files"};function X$(e,t){var n=e.type==="application/x-moz-file"||(0,LJ.A)(e,t);return[n,n?null:WJ(t)]}function Z$(e,t,n){if(E0(e.size))if(E0(t)&&E0(n)){if(e.size>n)return[!1,Q$(n)];if(e.size<t)return[!1,Y$(t)]}else{if(E0(t)&&e.size<t)return[!1,Y$(t)];if(E0(n)&&e.size>n)return[!1,Q$(n)]}return[!0,null]}function E0(e){return e!=null}function KJ(e){var t=e.files,n=e.accept,r=e.minSize,s=e.maxSize,o=e.multiple,i=e.maxFiles,u=e.validator;return!o&&t.length>1||o&&i>=1&&t.length>i?!1:t.every(function(p){var g=X$(p,n),v=Ow(g,1),w=v[0],x=Z$(p,r,s),E=Ow(x,1),R=E[0],k=u?u(p):null;return w&&R&&!k})}function ES(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function TS(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function Dhe(e){return $k(e)==="object"&&e!==null&&e.kind==="file"}function J$(e){e.preventDefault()}function GJ(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function QJ(e){return e.indexOf("Edge/")!==-1}function YJ(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return GJ(e)||QJ(e)}function Bf(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var s=arguments.length,o=new Array(s>1?s-1:0),i=1;i<s;i++)o[i-1]=arguments[i];return t.some(function(u){return!ES(r)&&u&&u.apply(void 0,[r].concat(o)),ES(r)})}}function XJ(){return"showOpenFilePicker"in window}function ZJ(e){if(E0(e)){var t=Object.entries(e).filter(function(n){var r=Ow(n,2),s=r[0],o=r[1],i=!0;return eL(s)||(console.warn('Skipped "'.concat(s,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),i=!1),(!Array.isArray(o)||!o.every(tL))&&(console.warn('Skipped "'.concat(s,'" because an invalid file extension was provided.')),i=!1),i}).reduce(function(n,r){var s=Ow(r,2),o=s[0],i=s[1];return B$(B$({},n),{},V$({},o,i))},{});return[{description:"Files",accept:t}]}return e}function JJ(e){if(E0(e))return Object.entries(e).reduce(function(t,n){var r=Ow(n,2),s=r[0],o=r[1];return[].concat(z$(t),[s],z$(o))},[]).filter(function(t){return eL(t)||tL(t)}).join(",")}function eee(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function tee(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function eL(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function tL(e){return/^.*\.[\w]+$/.test(e)}var nee=["children"],ree=["open"],see=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],oee=["refKey","onChange","onClick"];function aee(e){return cee(e)||lee(e)||nL(e)||iee()}function iee(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lee(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function cee(e){if(Array.isArray(e))return zk(e)}function Fk(e,t){return fee(e)||dee(e,t)||nL(e,t)||uee()}function uee(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nL(e,t){if(e){if(typeof e=="string")return zk(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return zk(e,t)}}function zk(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function dee(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],s=!0,o=!1,i,u;try{for(n=n.call(e);!(s=(i=n.next()).done)&&(r.push(i.value),!(t&&r.length===t));s=!0);}catch(p){o=!0,u=p}finally{try{!s&&n.return!=null&&n.return()}finally{if(o)throw u}}return r}}function fee(e){if(Array.isArray(e))return e}function rL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function qa(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?rL(Object(n),!0).forEach(function(r){Uk(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Uk(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kS(e,t){if(e==null)return{};var n=pee(e,t),r,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)r=o[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function pee(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,o;for(o=0;o<r.length;o++)s=r[o],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Bk=(0,l.forwardRef)(function(e,t){var n=e.children,r=kS(e,nee),s=oL(r),o=s.open,i=kS(s,ree);return(0,l.useImperativeHandle)(t,function(){return{open:o}},[o]),l.createElement(l.Fragment,null,n(qa(qa({},i),{},{open:o})))});Bk.displayName="Dropzone";var sL={disabled:!1,getFilesFromEvent:PJ,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};Bk.defaultProps=sL,Bk.propTypes={children:ra().func,accept:ra().objectOf(ra().arrayOf(ra().string)),multiple:ra().bool,preventDropOnDocument:ra().bool,noClick:ra().bool,noKeyboard:ra().bool,noDrag:ra().bool,noDragEventsBubbling:ra().bool,minSize:ra().number,maxSize:ra().number,maxFiles:ra().number,disabled:ra().bool,getFilesFromEvent:ra().func,onFileDialogCancel:ra().func,onFileDialogOpen:ra().func,useFsAccessApi:ra().bool,autoFocus:ra().bool,onDragEnter:ra().func,onDragLeave:ra().func,onDragOver:ra().func,onDrop:ra().func,onDropAccepted:ra().func,onDropRejected:ra().func,onError:ra().func,validator:ra().func};const Mhe=null;var Vk={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function oL(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=qa(qa({},sL),e),n=t.accept,r=t.disabled,s=t.getFilesFromEvent,o=t.maxSize,i=t.minSize,u=t.multiple,p=t.maxFiles,g=t.onDragEnter,v=t.onDragLeave,w=t.onDragOver,x=t.onDrop,E=t.onDropAccepted,R=t.onDropRejected,k=t.onFileDialogCancel,N=t.onFileDialogOpen,L=t.useFsAccessApi,D=t.autoFocus,B=t.preventDropOnDocument,Q=t.noClick,ce=t.noKeyboard,ye=t.noDrag,G=t.noDragEventsBubbling,Le=t.onError,We=t.validator,at=(0,l.useMemo)(function(){return JJ(n)},[n]),St=(0,l.useMemo)(function(){return ZJ(n)},[n]),xt=(0,l.useMemo)(function(){return typeof N=="function"?N:aL},[N]),Mt=(0,l.useMemo)(function(){return typeof k=="function"?k:aL},[k]),$t=(0,l.useRef)(null),Nt=(0,l.useRef)(null),Bn=(0,l.useReducer)(hee,Vk),wn=Fk(Bn,2),Nn=wn[0],Zt=wn[1],Pt=Nn.isFocused,At=Nn.isFileDialogActive,Ht=(0,l.useRef)(typeof window<"u"&&window.isSecureContext&&L&&XJ()),Gt=function(){!Ht.current&&At&&setTimeout(function(){if(Nt.current){var jn=Nt.current.files;jn.length||(Zt({type:"closeDialog"}),Mt())}},300)};(0,l.useEffect)(function(){return window.addEventListener("focus",Gt,!1),function(){window.removeEventListener("focus",Gt,!1)}},[Nt,At,Mt,Ht]);var Sn=(0,l.useRef)([]),Cr=function(jn){$t.current&&$t.current.contains(jn.target)||(jn.preventDefault(),Sn.current=[])};(0,l.useEffect)(function(){return B&&(document.addEventListener("dragover",J$,!1),document.addEventListener("drop",Cr,!1)),function(){B&&(document.removeEventListener("dragover",J$),document.removeEventListener("drop",Cr))}},[$t,B]),(0,l.useEffect)(function(){return!r&&D&&$t.current&&$t.current.focus(),function(){}},[$t,D,r]);var br=(0,l.useCallback)(function(Lt){Le?Le(Lt):console.error(Lt)},[Le]),Ln=(0,l.useCallback)(function(Lt){Lt.preventDefault(),Lt.persist(),Dt(Lt),Sn.current=[].concat(aee(Sn.current),[Lt.target]),TS(Lt)&&Promise.resolve(s(Lt)).then(function(jn){if(!(ES(Lt)&&!G)){var ds=jn.length,$s=ds>0&&KJ({files:jn,accept:at,minSize:i,maxSize:o,multiple:u,maxFiles:p,validator:We}),Ca=ds>0&&!$s;Zt({isDragAccept:$s,isDragReject:Ca,isDragActive:!0,type:"setDraggedFiles"}),g&&g(Lt)}}).catch(function(jn){return br(jn)})},[s,g,br,G,at,i,o,u,p,We]),Hr=(0,l.useCallback)(function(Lt){Lt.preventDefault(),Lt.persist(),Dt(Lt);var jn=TS(Lt);if(jn&&Lt.dataTransfer)try{Lt.dataTransfer.dropEffect="copy"}catch{}return jn&&w&&w(Lt),!1},[w,G]),ws=(0,l.useCallback)(function(Lt){Lt.preventDefault(),Lt.persist(),Dt(Lt);var jn=Sn.current.filter(function($s){return $t.current&&$t.current.contains($s)}),ds=jn.indexOf(Lt.target);ds!==-1&&jn.splice(ds,1),Sn.current=jn,!(jn.length>0)&&(Zt({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),TS(Lt)&&v&&v(Lt))},[$t,v,G]),us=(0,l.useCallback)(function(Lt,jn){var ds=[],$s=[];Lt.forEach(function(Ca){var xc=X$(Ca,at),Qc=Fk(xc,2),Ja=Qc[0],Ld=Qc[1],Fd=Z$(Ca,i,o),zd=Fk(Fd,2),qf=zd[0],jm=zd[1],Kf=We?We(Ca):null;if(Ja&&qf&&!Kf)ds.push(Ca);else{var rs=[Ld,jm];Kf&&(rs=rs.concat(Kf)),$s.push({file:Ca,errors:rs.filter(function(fo){return fo})})}}),(!u&&ds.length>1||u&&p>=1&&ds.length>p)&&(ds.forEach(function(Ca){$s.push({file:Ca,errors:[qJ]})}),ds.splice(0)),Zt({acceptedFiles:ds,fileRejections:$s,type:"setFiles"}),x&&x(ds,$s,jn),$s.length>0&&R&&R($s,jn),ds.length>0&&E&&E(ds,jn)},[Zt,u,at,i,o,p,x,E,R,We]),tr=(0,l.useCallback)(function(Lt){Lt.preventDefault(),Lt.persist(),Dt(Lt),Sn.current=[],TS(Lt)&&Promise.resolve(s(Lt)).then(function(jn){ES(Lt)&&!G||us(jn,Lt)}).catch(function(jn){return br(jn)}),Zt({type:"reset"})},[s,us,br,G]),mr=(0,l.useCallback)(function(){if(Ht.current){Zt({type:"openDialog"}),xt();var Lt={multiple:u,types:St};window.showOpenFilePicker(Lt).then(function(jn){return s(jn)}).then(function(jn){us(jn,null),Zt({type:"closeDialog"})}).catch(function(jn){eee(jn)?(Mt(jn),Zt({type:"closeDialog"})):tee(jn)?(Ht.current=!1,Nt.current?(Nt.current.value=null,Nt.current.click()):br(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):br(jn)});return}Nt.current&&(Zt({type:"openDialog"}),xt(),Nt.current.value=null,Nt.current.click())},[Zt,xt,Mt,L,us,br,St,u]),En=(0,l.useCallback)(function(Lt){!$t.current||!$t.current.isEqualNode(Lt.target)||(Lt.key===" "||Lt.key==="Enter"||Lt.keyCode===32||Lt.keyCode===13)&&(Lt.preventDefault(),mr())},[$t,mr]),Ws=(0,l.useCallback)(function(){Zt({type:"focus"})},[]),xi=(0,l.useCallback)(function(){Zt({type:"blur"})},[]),ja=(0,l.useCallback)(function(){Q||(YJ()?setTimeout(mr,0):mr())},[Q,mr]),Li=function(jn){return r?null:jn},Ze=function(jn){return ce?null:Li(jn)},Tt=function(jn){return ye?null:Li(jn)},Dt=function(jn){G&&jn.stopPropagation()},Vn=(0,l.useMemo)(function(){return function(){var Lt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},jn=Lt.refKey,ds=jn===void 0?"ref":jn,$s=Lt.role,Ca=Lt.onKeyDown,xc=Lt.onFocus,Qc=Lt.onBlur,Ja=Lt.onClick,Ld=Lt.onDragEnter,Fd=Lt.onDragOver,zd=Lt.onDragLeave,qf=Lt.onDrop,jm=kS(Lt,see);return qa(qa(Uk({onKeyDown:Ze(Bf(Ca,En)),onFocus:Ze(Bf(xc,Ws)),onBlur:Ze(Bf(Qc,xi)),onClick:Li(Bf(Ja,ja)),onDragEnter:Tt(Bf(Ld,Ln)),onDragOver:Tt(Bf(Fd,Hr)),onDragLeave:Tt(Bf(zd,ws)),onDrop:Tt(Bf(qf,tr)),role:typeof $s=="string"&&$s!==""?$s:"presentation"},ds,$t),!r&&!ce?{tabIndex:0}:{}),jm)}},[$t,En,Ws,xi,ja,Ln,Hr,ws,tr,ce,ye,r]),On=(0,l.useCallback)(function(Lt){Lt.stopPropagation()},[]),_n=(0,l.useMemo)(function(){return function(){var Lt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},jn=Lt.refKey,ds=jn===void 0?"ref":jn,$s=Lt.onChange,Ca=Lt.onClick,xc=kS(Lt,oee),Qc=Uk({accept:at,multiple:u,type:"file",style:{display:"none"},onChange:Li(Bf($s,tr)),onClick:Li(Bf(Ca,On)),tabIndex:-1},ds,Nt);return qa(qa({},Qc),xc)}},[Nt,n,u,tr,r]);return qa(qa({},Nn),{},{isFocused:Pt&&!r,getRootProps:Vn,getInputProps:_n,rootRef:$t,inputRef:Nt,open:Li(mr)})}function hee(e,t){switch(t.type){case"focus":return qa(qa({},e),{},{isFocused:!0});case"blur":return qa(qa({},e),{},{isFocused:!1});case"openDialog":return qa(qa({},Vk),{},{isFileDialogActive:!0});case"closeDialog":return qa(qa({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return qa(qa({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return qa(qa({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return qa({},Vk);default:return e}}function aL(){}const iL=["PageUp","PageDown"],lL=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],cL={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Ey="Slider",[Hk,mee,gee]=Vb(Ey),[uL,$he]=va(Ey,[gee]),[vee,RS]=uL(Ey),dL=(0,l.forwardRef)((e,t)=>{const{name:n,min:r=0,max:s=100,step:o=1,orientation:i="horizontal",disabled:u=!1,minStepsBetweenThumbs:p=0,defaultValue:g=[r],value:v,onValueChange:w=()=>{},onValueCommit:x=()=>{},inverted:E=!1,...R}=e,[k,N]=(0,l.useState)(null),L=Lr(t,$t=>N($t)),D=(0,l.useRef)(new Set),B=(0,l.useRef)(0),Q=i==="horizontal",ce=k?Boolean(k.closest("form")):!0,ye=Q?yee:bee,[G=[],Le]=si({prop:v,defaultProp:g,onChange:$t=>{var Nt;(Nt=[...D.current][B.current])===null||Nt===void 0||Nt.focus(),w($t)}}),We=(0,l.useRef)(G);function at($t){const Nt=Cee(G,$t);Mt($t,Nt)}function St($t){Mt($t,B.current)}function xt(){const $t=We.current[B.current];G[B.current]!==$t&&x(G)}function Mt($t,Nt,{commit:Bn}={commit:!1}){const wn=Ree(o),Nn=Pee(Math.round(($t-r)/o)*o+r,wn),Zt=Ub(Nn,[r,s]);Le((Pt=[])=>{const At=_ee(Pt,Zt,Nt);if(kee(At,p*o)){B.current=At.indexOf(Zt);const Ht=String(At)!==String(Pt);return Ht&&Bn&&x(At),Ht?At:Pt}else return Pt})}return(0,l.createElement)(vee,{scope:e.__scopeSlider,disabled:u,min:r,max:s,valueIndexToChangeRef:B,thumbs:D.current,values:G,orientation:i},(0,l.createElement)(Hk.Provider,{scope:e.__scopeSlider},(0,l.createElement)(Hk.Slot,{scope:e.__scopeSlider},(0,l.createElement)(ye,(0,Je.A)({"aria-disabled":u,"data-disabled":u?"":void 0},R,{ref:L,onPointerDown:gn(R.onPointerDown,()=>{u||(We.current=G)}),min:r,max:s,inverted:E,onSlideStart:u?void 0:at,onSlideMove:u?void 0:St,onSlideEnd:u?void 0:xt,onHomeKeyDown:()=>!u&&Mt(r,0,{commit:!0}),onEndKeyDown:()=>!u&&Mt(s,G.length-1,{commit:!0}),onStepKeyDown:({event:$t,direction:Nt})=>{if(!u){const Nn=iL.includes($t.key)||$t.shiftKey&&lL.includes($t.key)?10:1,Zt=B.current,Pt=G[Zt],At=o*Nn*Nt;Mt(Pt+At,Zt,{commit:!0})}}})))),ce&&G.map(($t,Nt)=>(0,l.createElement)(xee,{key:Nt,name:n?n+(G.length>1?"[]":""):void 0,value:$t})))}),[fL,pL]=uL(Ey,{startEdge:"left",endEdge:"right",size:"width",direction:1}),yee=(0,l.forwardRef)((e,t)=>{const{min:n,max:r,dir:s,inverted:o,onSlideStart:i,onSlideMove:u,onSlideEnd:p,onStepKeyDown:g,...v}=e,[w,x]=(0,l.useState)(null),E=Lr(t,B=>x(B)),R=(0,l.useRef)(),k=lm(s),N=k==="ltr",L=N&&!o||!N&&o;function D(B){const Q=R.current||w.getBoundingClientRect(),ce=[0,Q.width],G=Kk(ce,L?[n,r]:[r,n]);return R.current=Q,G(B-Q.left)}return(0,l.createElement)(fL,{scope:e.__scopeSlider,startEdge:L?"left":"right",endEdge:L?"right":"left",direction:L?1:-1,size:"width"},(0,l.createElement)(hL,(0,Je.A)({dir:k,"data-orientation":"horizontal"},v,{ref:E,style:{...v.style,["--radix-slider-thumb-transform"]:"translateX(-50%)"},onSlideStart:B=>{const Q=D(B.clientX);i?.(Q)},onSlideMove:B=>{const Q=D(B.clientX);u?.(Q)},onSlideEnd:()=>{R.current=void 0,p?.()},onStepKeyDown:B=>{const ce=cL[L?"from-left":"from-right"].includes(B.key);g?.({event:B,direction:ce?-1:1})}})))}),bee=(0,l.forwardRef)((e,t)=>{const{min:n,max:r,inverted:s,onSlideStart:o,onSlideMove:i,onSlideEnd:u,onStepKeyDown:p,...g}=e,v=(0,l.useRef)(null),w=Lr(t,v),x=(0,l.useRef)(),E=!s;function R(k){const N=x.current||v.current.getBoundingClientRect(),L=[0,N.height],B=Kk(L,E?[r,n]:[n,r]);return x.current=N,B(k-N.top)}return(0,l.createElement)(fL,{scope:e.__scopeSlider,startEdge:E?"bottom":"top",endEdge:E?"top":"bottom",size:"height",direction:E?1:-1},(0,l.createElement)(hL,(0,Je.A)({"data-orientation":"vertical"},g,{ref:w,style:{...g.style,["--radix-slider-thumb-transform"]:"translateY(50%)"},onSlideStart:k=>{const N=R(k.clientY);o?.(N)},onSlideMove:k=>{const N=R(k.clientY);i?.(N)},onSlideEnd:()=>{x.current=void 0,u?.()},onStepKeyDown:k=>{const L=cL[E?"from-bottom":"from-top"].includes(k.key);p?.({event:k,direction:L?-1:1})}})))}),hL=(0,l.forwardRef)((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:s,onSlideEnd:o,onHomeKeyDown:i,onEndKeyDown:u,onStepKeyDown:p,...g}=e,v=RS(Ey,n);return(0,l.createElement)(zn.span,(0,Je.A)({},g,{ref:t,onKeyDown:gn(e.onKeyDown,w=>{w.key==="Home"?(i(w),w.preventDefault()):w.key==="End"?(u(w),w.preventDefault()):iL.concat(lL).includes(w.key)&&(p(w),w.preventDefault())}),onPointerDown:gn(e.onPointerDown,w=>{const x=w.target;x.setPointerCapture(w.pointerId),w.preventDefault(),v.thumbs.has(x)?x.focus():r(w)}),onPointerMove:gn(e.onPointerMove,w=>{w.target.hasPointerCapture(w.pointerId)&&s(w)}),onPointerUp:gn(e.onPointerUp,w=>{const x=w.target;x.hasPointerCapture(w.pointerId)&&(x.releasePointerCapture(w.pointerId),o(w))})}))}),mL="SliderTrack",gL=(0,l.forwardRef)((e,t)=>{const{__scopeSlider:n,...r}=e,s=RS(mL,n);return(0,l.createElement)(zn.span,(0,Je.A)({"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation},r,{ref:t}))}),Wk="SliderRange",vL=(0,l.forwardRef)((e,t)=>{const{__scopeSlider:n,...r}=e,s=RS(Wk,n),o=pL(Wk,n),i=(0,l.useRef)(null),u=Lr(t,i),p=s.values.length,g=s.values.map(x=>bL(x,s.min,s.max)),v=p>1?Math.min(...g):0,w=100-Math.max(...g);return(0,l.createElement)(zn.span,(0,Je.A)({"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0},r,{ref:u,style:{...e.style,[o.startEdge]:v+"%",[o.endEdge]:w+"%"}}))}),qk="SliderThumb",yL=(0,l.forwardRef)((e,t)=>{const n=mee(e.__scopeSlider),[r,s]=(0,l.useState)(null),o=Lr(t,u=>s(u)),i=(0,l.useMemo)(()=>r?n().findIndex(u=>u.ref.current===r):-1,[n,r]);return(0,l.createElement)(wee,(0,Je.A)({},e,{ref:o,index:i}))}),wee=(0,l.forwardRef)((e,t)=>{const{__scopeSlider:n,index:r,...s}=e,o=RS(qk,n),i=pL(qk,n),[u,p]=(0,l.useState)(null),g=Lr(t,N=>p(N)),v=Wv(u),w=o.values[r],x=w===void 0?0:bL(w,o.min,o.max),E=See(r,o.values.length),R=v?.[i.size],k=R?Eee(R,x,i.direction):0;return(0,l.useEffect)(()=>{if(u)return o.thumbs.add(u),()=>{o.thumbs.delete(u)}},[u,o.thumbs]),(0,l.createElement)("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[i.startEdge]:`calc(${x}% + ${k}px)`}},(0,l.createElement)(Hk.ItemSlot,{scope:e.__scopeSlider},(0,l.createElement)(zn.span,(0,Je.A)({role:"slider","aria-label":e["aria-label"]||E,"aria-valuemin":o.min,"aria-valuenow":w,"aria-valuemax":o.max,"aria-orientation":o.orientation,"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,tabIndex:o.disabled?void 0:0},s,{ref:g,style:w===void 0?{display:"none"}:e.style,onFocus:gn(e.onFocus,()=>{o.valueIndexToChangeRef.current=r})}))))}),xee=e=>{const{value:t,...n}=e,r=(0,l.useRef)(null),s=Db(t);return(0,l.useEffect)(()=>{const o=r.current,i=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(i,"value").set;if(s!==t&&p){const g=new Event("input",{bubbles:!0});p.call(o,t),o.dispatchEvent(g)}},[s,t]),(0,l.createElement)("input",(0,Je.A)({style:{display:"none"}},n,{ref:r,defaultValue:t}))};function _ee(e=[],t,n){const r=[...e];return r[n]=t,r.sort((s,o)=>s-o)}function bL(e,t,n){const o=100/(n-t)*(e-t);return Ub(o,[0,100])}function See(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function Cee(e,t){if(e.length===1)return 0;const n=e.map(s=>Math.abs(s-t)),r=Math.min(...n);return n.indexOf(r)}function Eee(e,t,n){const r=e/2,o=Kk([0,50],[0,r]);return(r-o(t)*n)*n}function Tee(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function kee(e,t){if(t>0){const n=Tee(e);return Math.min(...n)>=t}return!0}function Kk(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Ree(e){return(String(e).split(".")[1]||"").length}function Pee(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}const wL=dL,Oee=gL,Nee=vL,Aee=yL,xL=(0,l.forwardRef)(({className:e,...t},n)=>(0,a.jsxs)(wL,{ref:n,className:st("relative flex w-full touch-none select-none items-center",e),...t,children:[(0,a.jsx)(Oee,{className:"relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20",children:(0,a.jsx)(Nee,{className:"absolute h-full bg-indigo-500"})}),(0,a.jsx)(Aee,{className:"block h-4 w-4 cursor-grab rounded-full border bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50"})]}));xL.displayName=wL.displayName;const Iee=xL,jee={"image/jpeg":[],"image/png":[],"image/bmp":[],"image/gif":[],"image/webp":[],"image/svg+xml":[]},Nw=50,Dee="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAIAAAC0Ujn1AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAOwwAADsMBx2+oZAAAADlJREFUSEvtzaENAEAMw8DfMUP8/huUFBm1sJKPhDkvG3/DNJgG02AajqZ7Z/phxjSYBtNgGi6mkwI2N9UKFp3MkAAAAABJRU5ErkJggg==",Mee=e=>{const t=e.getContext("2d"),n=document.createElement("canvas").getContext("2d");if(!t||!n)throw new Error;const r=t.getImageData(0,0,e.width,e.height),s=r.data.length,o={top:null,bottom:null};let i,u;for(i=0;i<s;i+=4)r.data[i+3]!==0&&(u=~~(i/4/e.width),o.top===null&&(o.top=u),(o.bottom===null||o.bottom<u)&&(o.bottom=u));const p=o.bottom-o.top,g=t.getImageData(0,o.top,e.width,p+1);return n.canvas.height=p,n.putImageData(g,0,0),n.canvas},$ee=300,Lee=300,_L="image/png",Fee="file.png",zee=({open:e=!1,onClose:t,onSave:n,title:r,imageWidth:s=$ee,imageHeight:o=Lee,imageType:i=_L,imageName:u=Fee,trimVertically:p=!1})=>{const{t:g}=(0,z.Bd)(),[v,w]=(0,l.useState)(),[x,E]=(0,l.useState)(1),[R,k]=(0,l.useState)(!1),[N,L]=(0,l.useState)(!1),D=(0,l.useRef)(null),{getRootProps:B,getInputProps:Q,open:ce}=oL({noClick:!0,noKeyboard:!0,onDrop:at=>w(at[0]),accept:jee}),ye=()=>{w(void 0),E(1),k(!1),L(!1),t?.()},G=async()=>await new Promise((at,St)=>{if(!D.current)return St(new Error);(p?Mee(D.current.getImageScaledToCanvas()):D.current.getImageScaledToCanvas()).toBlob(Mt=>Mt?at(Mt):St(new Error),i)}),Le=async()=>{if(D.current)try{k(!0);const at=new File([await G()],u,{type:_L});await n?.(at),ye()}catch(at){L(!0),console.error(at)}finally{k(!1)}},We=at=>E(at[0]);return(0,a.jsx)(Rv,{open:e,onOpenChange:ye,children:(0,a.jsxs)(Pv,{style:{width:s+Nw*2},children:[r&&(0,a.jsx)(Nv,{children:r}),(0,a.jsx)(Av,{asChild:!0,children:(0,a.jsx)("div",{children:R||N?(0,a.jsxs)("div",{className:"flex items-center justify-center",style:{width:s+Nw,height:s+Nw},children:[R&&(0,a.jsx)(zs,{}),N&&!R&&(0,a.jsx)(zp,{variant:$f.Danger,children:g("core:errors.generic")})]}):(0,a.jsxs)("div",{...B(),children:[(0,a.jsx)("input",{...Q(),"data-testid":"upload-input"}),v?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(CJ(),{ref:D,width:s,height:o,image:v,scale:x,style:{backgroundImage:"url("+Dee+")"}}),(0,a.jsxs)("div",{className:"mt-3",children:[(0,a.jsx)("strong",{children:g("core:imageUploaderDialog.zoom")}),(0,a.jsx)(Iee,{min:.1,max:2,step:.01,defaultValue:[1],onValueChange:We,className:"mt-2"})]})]}):(0,a.jsxs)("div",{className:"flex cursor-pointer flex-col items-center justify-center border-2 border-dashed",style:{width:s+Nw,height:o+Nw},"data-testid":"dropzone",onClick:ce,children:[g("core:imageUploaderDialog.dropYourFile"),(0,a.jsx)("br",{}),(0,a.jsx)("em",{children:g("core:imageUploaderDialog.clickToSelectAFile")})]})]})})}),(0,a.jsxs)(Ov,{children:[(0,a.jsx)(mn,{onClick:ye,variant:No.Outline,children:g("core:actions.cancel")}),(0,a.jsx)(mn,{onClick:Le,variant:No.Primary,disabled:!v,children:g("core:actions.save")})]})]})})},Gk=({imageUrl:e,onSave:t,title:n})=>{const{t:r}=(0,z.Bd)(),[s,o]=(0,l.useState)(!1);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(zee,{open:s,onClose:()=>o(!1),title:n,onSave:t,imageWidth:300,imageHeight:300,trimVertically:!0}),(0,a.jsxs)("div",{className:"relative flex min-h-[96px] items-center justify-center rounded-lg border border-dotted p-4 dark:border-slate-800 dark:bg-slate-900/75 md:min-h-[128px]","data-testid":"update-image-container",children:[e&&(0,a.jsx)("img",{src:e,alt:"",className:"w-56 items-center dark:bg-slate-100"}),(0,a.jsx)("div",{className:`absolute left-0 top-0 flex h-full w-full items-center justify-center${e?" bg-white/60 opacity-0 backdrop-blur-sm transition-all duration-300 hover:opacity-100":""}`,children:(0,a.jsxs)(mn,{variant:"outline",type:"button",size:"sm",onClick:()=>o(!0),"data-testid":"btnUploadImage",children:[e&&r("rsp:actions.edit"),!e&&r("rsp:actions.upload")]})})]})]})},Uee=tl({resellerName:Ds().min(2),resellerSSPUrl:Ds().min(2)}),Bee=({reseller:e,...t})=>{const{t:n}=(0,z.Bd)(),{updateLogo:r,updateIcon:s}=QA(),o=Gh()??"localhost",i=e?.portalSettings?.logo?`${e.portalSettings.logo}?${e?.portalSettings?.logoHash??""}`:"",u=hc({resolver:mc(Uee),defaultValues:{resellerName:e?.name??"",resellerSSPUrl:o}});function p(v){t?.nextStep!==void 0&&t?.nextStep()}const g=async v=>{await r(v),await s(v),(0,Yr.v0)(n("rsp:pages.settings.customizationsSettings.logo.updateSuccess"))};return(0,a.jsxs)("div",{className:"mt-6 flex flex-col gap-4 md:mt-12","data-testid":"portal-configuration-step",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-4 md:gap-12",children:[(0,a.jsx)("h1",{className:"text-3xl font-medium text-slate-900 dark:text-slate-200",children:n("rsp:pages.onboarding.portalConfiguration.title")}),(0,a.jsx)("p",{className:"text-sm text-slate-500 dark:text-slate-200",children:n("rsp:pages.onboarding.portalConfiguration.description")})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(Fp,{className:"mt-2 text-sm font-semibold text-gray-900 dark:text-slate-200",children:n("rsp:pages.onboarding.portalConfiguration.labels.uploadLogo")}),(0,a.jsx)(Gk,{imageUrl:i,onSave:g,title:n("rsp:pages.settings.customizationsSettings.logo.updateModal.title")})]}),(0,a.jsx)(gc,{...u,children:(0,a.jsxs)("form",{onSubmit:u.handleSubmit(p),className:"flex flex-col gap-4",children:[(0,a.jsx)(Jr,{control:u.control,name:"resellerName",render:({field:v})=>(0,a.jsxs)(qr,{children:[(0,a.jsx)(As,{children:n("rsp:pages.onboarding.portalConfiguration.labels.resellerName")}),(0,a.jsx)(Kr,{children:(0,a.jsx)(_a,{...v,disabled:!0,"data-testid":"inputCompanyName"})}),(0,a.jsx)(Cs,{})]})}),(0,a.jsx)(Jr,{control:u.control,name:"resellerSSPUrl",render:({field:v})=>(0,a.jsxs)(qr,{children:[(0,a.jsx)(As,{children:n("rsp:pages.onboarding.portalConfiguration.labels.portalUrl")}),(0,a.jsx)(Kr,{children:(0,a.jsx)(_a,{...v,"data-testid":"inputSelfServicePortalUrl",disabled:!0})}),(0,a.jsx)(Cs,{})]})}),(0,a.jsx)("div",{className:"mt-4 grid w-full grid-flow-col",children:(0,a.jsx)("div",{className:"flex justify-end",children:(0,a.jsx)(mn,{type:"submit",className:"w-1/3","data-testid":"btnPortalConfigurationNextStep",children:n("rsp:pages.onboarding.nextStep")})})})]})})]})]})},PS=Eo.t("rsp:validations.mixed.required"),Vee=tl({serviceProvider:Ds().min(1,{message:PS}),publicApiKey:Ds().min(1,{message:PS}),privateApiKey:Ds().min(1,{message:PS}),subscriptionKey:Ds().min(1,{message:PS})}),Hee=({...e})=>{const{t}=(0,z.Bd)(),{data:n}=JG(),r=sD(),s=oD(),o=hc({resolver:mc(Vee),defaultValues:{publicApiKey:"",privateApiKey:"",subscriptionKey:""}}),i=o.watch("serviceProvider");(0,l.useEffect)(()=>{!i&&n&&n?.length>0&&!r?.isLoading&&o.setValue("serviceProvider",r?.data&&r?.data?.length!==0?r?.data?.[0]?.serviceProviderId:n?.[0]?.id)},[i,n,r?.data]),(0,l.useEffect)(()=>{if(i){const g=r?.data?.find(v=>v.serviceProviderId===i);o.setValue("publicApiKey",g?.clientId??"")}},[i,r?.data]),(0,l.useEffect)(()=>{s?.isSuccess&&(e.setValid(!0),e?.nextStep?.())},[s?.isSuccess]);async function u(g){e?.nextStep!==void 0&&s.mutate({serviceProviderId:g?.serviceProvider,clientId:g?.publicApiKey,clientSecret:g?.privateApiKey,subscriptionKey:g?.subscriptionKey})}const p=t("rsp:pages.onboarding.nextStep");return(0,a.jsxs)("div",{className:"mt-6 flex flex-col gap-4 md:mt-12","data-testid":"service-provider-step",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-4 md:gap-12",children:[(0,a.jsx)("h1",{className:"text-3xl font-medium text-slate-900 dark:text-slate-200",children:t("rsp:pages.onboarding.serviceProviderConfiguration.title")}),(0,a.jsx)("p",{className:"text-sm text-slate-500 dark:text-slate-200","data-testid":"description",children:(0,a.jsx)(z.x6,{i18nKey:"rsp:pages.onboarding.serviceProviderConfiguration.description",children:(0,a.jsx)(ka,{to:"https://github.com/sherweb/Public-Apis/blob/master/README.md#prerequisite-for-using-the-apis",target:"_blank",className:"font-semibold text-indigo-600 hover:underline"})})})]}),(0,a.jsx)("div",{className:"flex flex-col gap-4",children:(0,a.jsx)(gc,{...o,children:(0,a.jsxs)("form",{onSubmit:o.handleSubmit(u),className:"mt-2 flex flex-col gap-4",children:[(0,a.jsx)(Jr,{control:o.control,name:"serviceProvider",render:({field:g})=>(0,a.jsxs)(qr,{children:[(0,a.jsx)(As,{children:t("rsp:pages.onboarding.serviceProviderConfiguration.labels.serviceProvider")}),(0,a.jsxs)(h0,{value:g.value,onValueChange:g.onChange,children:[(0,a.jsx)(Kr,{children:(0,a.jsx)(wm,{children:(0,a.jsx)(m0,{placeholder:t("rsp:pages.onboarding.serviceProviderConfiguration.placeholders.serviceProvider")})})}),(0,a.jsx)(xm,{side:"bottom",children:n?.map(v=>(0,a.jsx)(_m,{value:v.id,children:v.name??""},v.name??""))})]}),(0,a.jsx)(Cs,{})]})}),(0,a.jsx)(Jr,{control:o.control,name:"publicApiKey",render:({field:g})=>(0,a.jsxs)(qr,{children:[(0,a.jsx)(As,{children:t("rsp:pages.onboarding.serviceProviderConfiguration.labels.clientIdKey")}),(0,a.jsx)(Kr,{children:(0,a.jsx)(_a,{...g,"data-testid":"inputClientId",placeholder:t("rsp:pages.onboarding.serviceProviderConfiguration.labels.clientIdKeyPlaceholder")})}),(0,a.jsx)(Cs,{})]})}),(0,a.jsx)(Jr,{control:o.control,name:"privateApiKey",render:({field:g})=>(0,a.jsxs)(qr,{children:[(0,a.jsx)(As,{children:t("rsp:pages.onboarding.serviceProviderConfiguration.labels.clientSecretKey")}),(0,a.jsx)(Kr,{children:(0,a.jsx)(_a,{...g,"data-testid":"inputClientSecret",placeholder:t("rsp:pages.onboarding.serviceProviderConfiguration.labels.clientSecretKeyPlaceholder")})}),(0,a.jsx)(Cs,{})]})}),(0,a.jsx)(Jr,{control:o.control,name:"subscriptionKey",render:({field:g})=>(0,a.jsxs)(qr,{children:[(0,a.jsx)(As,{children:t("rsp:pages.onboarding.serviceProviderConfiguration.labels.subscriptionKey")}),(0,a.jsx)(Kr,{children:(0,a.jsx)(_a,{...g,"data-testid":"inputSubscriptionKey",placeholder:t("rsp:pages.onboarding.serviceProviderConfiguration.labels.subscriptionKeyPlaceholder")})}),(0,a.jsx)(Cs,{})]})}),(0,a.jsxs)("div",{className:"mt-4 flex flex-row justify-between",children:[(0,a.jsx)(mn,{variant:"outline",type:"button",onClick:e.previousStep,"data-testid":"btnServiceProviderConfigurationPreviousStep",children:t("rsp:pages.onboarding.previousStep")}),(0,a.jsx)(Di,{type:"submit",dataTestId:"btnServiceProviderConfigurationNextStep",disabled:s?.isLoading,className:"w-1/3",isLoading:s?.isLoading,loaderDataTestId:"loaderFormSubmit",loadingChildren:p,children:p})]})]})})})]})},Qk="text-indigo-600",Wee=({...e})=>{const{t}=(0,z.Bd)(),n=3,r=e.activeStep/(n-1)*100,s=(o,i)=>{e?.goToStep&&i&&e.goToStep(o)};return(0,a.jsx)("div",{"data-testid":"steps",children:(0,a.jsxs)("div",{className:"my-6","aria-hidden":"true",children:[(0,a.jsx)("div",{className:"overflow-hidden rounded-full bg-gray-200 dark:bg-slate-950",children:(0,a.jsx)("div",{className:"h-2 rounded-full bg-indigo-600",style:{width:`${r}%`}})}),(0,a.jsxs)("div",{className:"mt-6 hidden grid-cols-3 text-sm font-medium text-gray-600 sm:grid",children:[(0,a.jsx)("div",{className:`${e.activeStep>=0?Qk:""}`,children:(0,a.jsx)("span",{className:"cursor-pointer",onClick:()=>s(1,!0),"data-testid":"stepPortalConfiguration",children:t("rsp:pages.onboarding.portalConfiguration.stepTitle")})}),(0,a.jsx)("div",{className:`text-center ${e.activeStep>=1?Qk:""}`,children:(0,a.jsx)("span",{className:"cursor-pointer",onClick:()=>s(2,!0),"data-testid":"stepServiceProvider",children:t("rsp:pages.onboarding.serviceProviderConfiguration.stepTitle")})}),(0,a.jsx)("div",{className:`text-right ${e.activeStep===2?Qk:""}`,children:(0,a.jsx)("span",{"data-testid":"stepSupportInformation",className:`${e.serviceProviderStepValid?"cursor-pointer":""}`,onClick:()=>s(3,e.serviceProviderStepValid),children:t("rsp:pages.onboarding.supportInformation.stepTitle")})})]})]})})},qee=/^\+?(\d{0,2})\(?(\d{3})\)?[- ]?(\d{3})[- ]?(\d{4})$/,Kee=["sherweb.com"],Gee=tl({supportEmail:Ds().email({message:`${Eo.t("rsp:validations.email.format")}`}).refine(e=>!Kee.some(t=>e?.endsWith(t)),{message:Eo.t("rsp:pages.onboarding.supportInformation.error.supportEmail")}).optional().or(ET("")),supportPhoneNumber:Ds().regex(qee,`${Eo.t("rsp:validations.phoneNumber.invalid")}`).optional().or(ET(""))}),Qee=({...e})=>{const{t}=(0,z.Bd)(),{setSupportInformation:n}=gH(),{updateOnboarding:r}=mH(),s=hc({resolver:mc(Gee),defaultValues:{supportEmail:e.reseller.supportInformation.email,supportPhoneNumber:e.reseller.supportInformation.phoneNumber}});async function o(i){e?.nextStep!==void 0&&(await n(i.supportEmail??"",i.supportPhoneNumber??"",e?.reseller?.supportInformation?.address??""),await r(),e?.nextStep())}return(0,a.jsxs)("div",{className:"mt-6 flex flex-col gap-4 md:mt-12","data-testid":"support-information-step",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-4 md:gap-12",children:[(0,a.jsx)("h1",{className:"text-3xl font-medium text-slate-900 dark:text-slate-200",children:t("rsp:pages.onboarding.supportInformation.title")}),(0,a.jsx)("p",{className:"text-sm text-slate-500 dark:text-slate-200",children:t("rsp:pages.onboarding.supportInformation.description")})]}),(0,a.jsx)("div",{className:"flex flex-col gap-4",children:(0,a.jsx)(gc,{...s,children:(0,a.jsxs)("form",{onSubmit:s.handleSubmit(o),className:"mt-2 flex flex-col gap-4",children:[(0,a.jsx)(Jr,{control:s.control,name:"supportEmail",render:({field:i})=>(0,a.jsxs)(qr,{children:[(0,a.jsx)(As,{children:t("rsp:pages.onboarding.supportInformation.labels.supportEmail")}),(0,a.jsx)(Kr,{children:(0,a.jsx)(_a,{...i,"data-testid":"inputSupportEmail",placeholder:t("rsp:pages.onboarding.supportInformation.placeholders.supportEmail")})}),(0,a.jsx)(Cs,{})]})}),(0,a.jsx)(Jr,{control:s.control,name:"supportPhoneNumber",render:({field:i})=>(0,a.jsxs)(qr,{children:[(0,a.jsx)(As,{children:t("rsp:pages.onboarding.supportInformation.labels.supportPhoneNumber")}),(0,a.jsx)(Kr,{children:(0,a.jsx)(_a,{...i,"data-testid":"inputSupportPhoneNumber",placeholder:t("rsp:pages.onboarding.supportInformation.placeholders.supportPhoneNumber")})}),(0,a.jsx)(Cs,{})]})}),(0,a.jsxs)("div",{className:"mt-4 flex flex-row justify-between",children:[(0,a.jsx)(mn,{variant:"outline",type:"button",onClick:e.previousStep,"data-testid":"btnSupportInformationPreviousStep",children:t("rsp:pages.onboarding.previousStep")}),(0,a.jsx)(Di,{type:"submit",className:"w-1/3",isLoading:!e.isFormValid,dataTestId:"btnSupportInformationNextStep",children:t("rsp:pages.onboarding.nextStep")})]})]})})})]})},Yee=Ll(()=>{const[e,t]=(0,l.useState)(0),[n,r]=(0,l.useState)(!1),[s,o]=(0,l.useState)(!1),{isLoading:i,data:u}=s0(),p=g=>{t(g.activeStep-1)};return(0,l.useEffect)(()=>{o(n)},[n]),u?.isOnboarded?(0,a.jsx)(hi,{replace:!0,to:Un.Root}):i||!u?(0,a.jsx)(zs,{floating:!0}):(0,a.jsx)("div",{className:"flex h-screen w-full justify-center dark:bg-slate-950",children:(0,a.jsx)("div",{className:"m-2 flex h-fit max-w-xl flex-col gap-12 rounded-md dark:border dark:border-slate-800 dark:bg-slate-900 sm:m-4 md:mx-auto md:my-8",children:(0,a.jsxs)("div",{className:"p-4 sm:p-8",children:[(0,a.jsx)("div",{className:"fixed left-0 top-0 flex w-full justify-end px-8 py-4 shadow-sm md:px-4",children:(0,a.jsx)(ZA,{})}),(0,a.jsx)("div",{className:"flex flex-col gap-8",children:(0,a.jsxs)(xJ(),{onStepChange:p,isHashEnabled:!0,nav:(0,a.jsx)(Wee,{activeStep:e,serviceProviderStepValid:n}),children:[(0,a.jsx)(Bee,{reseller:u,hashKey:"portalConfiguration"}),(0,a.jsx)(Hee,{setValid:r,hashKey:"serviceProvider"}),(0,a.jsx)(Qee,{reseller:u,isFormValid:s,hashKey:"supportInformation"}),(0,a.jsx)(_J,{hashKey:"bootstraping"})]})})]})})})});class OS{static amendmentOrdersCreateOrder(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/AmendmentOrders";const i=(0,oe.Y_)("post","application/json",o,n);let u=t.command;i.data=u,(0,oe.pY)(i,r,s)})}static amendmentOrdersDismissOrderError(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/AmendmentOrders/dismiss-error";const i=(0,oe.Y_)("post","application/json",o,n);let u=t.command;i.data=u,(0,oe.pY)(i,r,s)})}static amendmentOrdersProcessOrder(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/AmendmentOrders/process";const i=(0,oe.Y_)("post","application/json",o,n);let u=t.command;i.data=u,(0,oe.pY)(i,r,s)})}}const Xee=e=>e?TV(e.map(Yk),"createdOn"):[],Yk=e=>{const t=e?.value?{currency:Zee(e.value.currency),amount:e.value.amount}:void 0;return{...e,id:e?.orderId??"",organizationId:e?.organizationId??"",humanReadableId:e?.humanReadableId??"",createdOn:e?.createdAt??void 0,firstSubscriptionId:e?.items?.[0]?.subscriptionId,firstSubscriptionStatus:e?.items?.[0]?.subscriptionStatus,firstProductName:e?.items?.[0]?.productName,firstQuantity:e?.items?.[0]?.quantity??0,orderValue:t,error:e?.errorResult?{message:e?.errorResult.message,title:e?.errorResult.title,detail:e?.errorResult.detail}:void 0}},Zee=e=>{switch(e){case oe.Sj.Cad:return Uf.CAD;case oe.Sj.Usd:default:return Uf.USD}},Jee=(e,t)=>e?t?[...e.map(n=>t.orderIds?.includes(n.orderId)?{...n,orderStatus:t.decision===oe.cX.Approve?oe.Re.Pending:oe.Re.Rejected,decisionNote:t.decisionNote??void 0}:n)]:e:[],SL=()=>{const e=wa();return(0,js.I)({queryKey:Lb.queryKey(e),queryFn:async()=>await Lb.queryFn(e),enabled:!!e,select:t=>Xee(t),staleTime:Lb.staleTime})},CL=e=>{const t=wa();return(0,js.I)({queryKey:kE.queryKey(t,e),queryFn:async()=>await kE.queryFn(t,e),select:n=>Yk(n),enabled:!!t&&!!e,staleTime:kE.staleTime})},Xk=()=>{const e=(0,V.jE)(),t=wa();return(0,Vo.n)({mutationFn:async n=>{if(!n.decision)throw new Error("Missing decision");if(n?.orderIds?.length===0)throw new Error("Missing order id");if(!n.organizationId)throw new Error("Missing organization id");return await OS.amendmentOrdersProcessOrder({command:{...n,decision:n.decision===oe.cX.Approve?oe.cX.Approve:oe.cX.Reject}})},onSuccess:async(n,r)=>{e.setQueryData(Lb.queryKey(t),s=>Jee(s,r))}})},Aw=l.forwardRef(({label:e,className:t,...n},r)=>(0,a.jsxs)(a.Fragment,{children:[e&&(0,a.jsx)("label",{id:"textarea-label",className:"text-sm font-semibold text-gray-900 dark:text-slate-200",children:e}),(0,a.jsx)("textarea",{"aria-labelledby":"textarea-label","data-testid":"inputTextarea",className:st("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground","disabled:cursor-not-allowed disabled:opacity-50","dark:border-gray-700 dark:bg-slate-950 dark:text-slate-200 dark:placeholder:text-gray-600",t),ref:r,...n})]}));Aw.displayName="Textarea";const ete=({textAreaRef:e,triggerAutoSize:t,maxHeight:n=Number.MAX_SAFE_INTEGER,minHeight:r=0})=>{const[s,o]=(0,l.useState)(!0);(0,l.useEffect)(()=>{if(e){s&&(e.style.minHeight=`${r+2}px`,n>r&&(e.style.maxHeight=`${n}px`),o(!1)),e.style.height=`${r+2}px`;const u=e.scrollHeight;u>n?e.style.height=`${n}px`:e.style.height=`${u+2}px`}},[e,t])},EL=(0,l.forwardRef)(({maxHeight:e=Number.MAX_SAFE_INTEGER,minHeight:t=52,className:n,onChange:r,value:s,...o},i)=>{const u=(0,l.useRef)(null),[p,g]=(0,l.useState)("");return ete({textAreaRef:u.current,triggerAutoSize:p,maxHeight:e,minHeight:t}),(0,l.useImperativeHandle)(i,()=>({textArea:u.current,focus:()=>u.current?.focus(),maxHeight:e,minHeight:t})),(0,l.useEffect)(()=>{g(s)},[o?.defaultValue,s]),(0,a.jsx)(Aw,{...o,value:s,ref:u,className:n,onChange:v=>{g(v.target.value),r?.(v)}})});EL.displayName="AutosizeTextarea";const Zk=({onSubmit:e,cancelConfirmation:t,confirmationDialogOpened:n,decision:r,order:s})=>{const{t:o}=(0,z.Bd)(),[i,u]=(0,l.useState)(void 0),p=r===oe.cX.Approve?"rsp:pages.orders.list.actions.confirmationModal.approveBody":"rsp:pages.orders.list.actions.confirmationModal.rejectBody",g=r===oe.cX.Approve?o("rsp:pages.orders.list.actions.approve"):o("rsp:pages.orders.list.actions.reject"),v=r===oe.cX.Approve?o("rsp:pages.orders.list.actions.confirmationModal.approveTitle"):o("rsp:pages.orders.list.actions.confirmationModal.rejectTitle");return(0,a.jsx)(Vc,{open:n,onClose:()=>{u(void 0),t()},onConfirm:async()=>e(r,i),title:v,confirmButtonText:g,cancelButtonText:o("rsp:actions.cancel"),children:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(z.x6,{i18nKey:p,values:{orderId:s.humanReadableId,organizationName:s.organizationName},components:{1:(0,a.jsx)("br",{})}}),r===oe.cX.Reject&&(0,a.jsx)(Aw,{"data-testid":"textareaDecisionNote",value:i??"",onChange:w=>u(w.target.value),placeholder:o("rsp:pages.orders.list.actions.confirmationModal.decisionNotePlaceholder")??"",className:"mt-4"})]})})},tte=({open:e=!1})=>{const{t}=(0,z.Bd)(),{navigate:n}=Ni(),r=(0,l.useCallback)(()=>{n(Sr.Orders)},[n]);return(0,a.jsx)(Vc,{open:e,title:t("rsp:pages.orders.orderAlreadyReviewed.title"),cancelButtonText:t("rsp:actions.cancel"),onCancel:r,onClose:r,children:t("rsp:pages.orders.orderAlreadyReviewed.content")})},nte=()=>{const e=jf(),t=vS(e.orderId)?String(e.orderId):void 0,n=String(e.decision)?.toLowerCase(),r=n===oe.cX.Approve.toLowerCase()?oe.cX.Approve:oe.cX.Reject;return{havingRequiredProps:!!t&&!!n,orderId:t,decision:r}},rte=()=>{const e=C2(Sr.Order),t=nte(),{data:n,error:r,isFetched:s}=CL(t.orderId),o=Xk(),{t:i}=(0,z.Bd)(),{hasAccess:u,permissionsFetched:p}=oy(),{navigate:g}=Ni(),[v,w]=(0,l.useState)(!1),[x,E]=(0,l.useState)(t.havingRequiredProps),R=p&&!u(oe.aX.OrderApproval)&&!v,k=s&&!!n?.orderStatus&&n.orderStatus!==oe.Re.WaitingForApproval&&!v,N=s&&(!n||r)&&!v;if((0,l.useEffect)(()=>{t.havingRequiredProps&&N&&!e&&(0,Yr.A2)(i("rsp:pages.orders.orderApprovalDecisionErrors.notFound"))},[t.havingRequiredProps,N]),(0,l.useEffect)(()=>{R&&!e&&(0,Yr.A2)(i("rsp:errors.forbidden"))},[R]),!t.havingRequiredProps||R||e)return null;if(k)return(0,a.jsx)(tte,{open:k});if(!n||r)return null;const L=()=>{E(!1),D()},D=()=>{w(!0),g(Sr.Orders)},B=(Q,ce)=>{o.mutate({orderIds:[n.id],organizationId:n.organizationId??"",decision:Q??void 0,decisionNote:ce}),D()};return(0,a.jsx)(Zk,{decision:t.decision,order:n,cancelConfirmation:L,onSubmit:B,confirmationDialogOpened:x})},T0=({orderStatus:e})=>{const{t}=(0,z.Bd)(),n={[oe.Re.Failed]:(0,a.jsx)(to,{variant:wo.Danger,children:t("core:orders.status.failed")}),[oe.Re.Pending]:(0,a.jsx)(to,{variant:wo.Warning,children:t("core:orders.status.pending")}),[oe.Re.Completed]:(0,a.jsx)(to,{variant:wo.Success,children:t("core:orders.status.completed")}),[oe.Re.WaitingForApproval]:(0,a.jsx)(to,{variant:wo.Warning,children:t("core:orders.status.waitingForApproval")}),[oe.Re.Rejected]:(0,a.jsx)(to,{variant:wo.Danger,children:t("core:orders.status.rejected")})};return e?n[e]:null},Jk=({orderType:e})=>{const{t}=(0,z.Bd)();return e===oe.ZN.Amendment?(0,a.jsx)("div",{children:t("core:orders.types.update")}):(0,a.jsx)("div",{children:t("core:orders.types.purchase")})};var TL=ln(2284);function bc(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function ste(e){return bc(1,arguments),e instanceof Date||(0,TL.A)(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Vf(e){bc(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||(0,TL.A)(e)==="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):((typeof e=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function ote(e){if(bc(1,arguments),!ste(e)&&typeof e!="number")return!1;var t=Vf(e);return!isNaN(Number(t))}function k0(e){if(e===null||e===!0||e===!1)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function ate(e,t){bc(2,arguments);var n=Vf(e).getTime(),r=k0(t);return new Date(n+r)}function ite(e,t){bc(2,arguments);var n=k0(t);return ate(e,-n)}var lte=864e5;function cte(e){bc(1,arguments);var t=Vf(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=t.getTime(),s=n-r;return Math.floor(s/lte)+1}function NS(e){bc(1,arguments);var t=1,n=Vf(e),r=n.getUTCDay(),s=(r<t?7:0)+r-t;return n.setUTCDate(n.getUTCDate()-s),n.setUTCHours(0,0,0,0),n}function kL(e){bc(1,arguments);var t=Vf(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var s=NS(r),o=new Date(0);o.setUTCFullYear(n,0,4),o.setUTCHours(0,0,0,0);var i=NS(o);return t.getTime()>=s.getTime()?n+1:t.getTime()>=i.getTime()?n:n-1}function ute(e){bc(1,arguments);var t=kL(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var r=NS(n);return r}var dte=6048e5;function fte(e){bc(1,arguments);var t=Vf(e),n=NS(t).getTime()-ute(t).getTime();return Math.round(n/dte)+1}var RL={};function AS(){return RL}function Ghe(e){RL=e}function IS(e,t){var n,r,s,o,i,u,p,g;bc(1,arguments);var v=AS(),w=k0((n=(r=(s=(o=t?.weekStartsOn)!==null&&o!==void 0?o:t==null||(i=t.locale)===null||i===void 0||(u=i.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&s!==void 0?s:v.weekStartsOn)!==null&&r!==void 0?r:(p=v.locale)===null||p===void 0||(g=p.options)===null||g===void 0?void 0:g.weekStartsOn)!==null&&n!==void 0?n:0);if(!(w>=0&&w<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var x=Vf(e),E=x.getUTCDay(),R=(E<w?7:0)+E-w;return x.setUTCDate(x.getUTCDate()-R),x.setUTCHours(0,0,0,0),x}function PL(e,t){var n,r,s,o,i,u,p,g;bc(1,arguments);var v=Vf(e),w=v.getUTCFullYear(),x=AS(),E=k0((n=(r=(s=(o=t?.firstWeekContainsDate)!==null&&o!==void 0?o:t==null||(i=t.locale)===null||i===void 0||(u=i.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&s!==void 0?s:x.firstWeekContainsDate)!==null&&r!==void 0?r:(p=x.locale)===null||p===void 0||(g=p.options)===null||g===void 0?void 0:g.firstWeekContainsDate)!==null&&n!==void 0?n:1);if(!(E>=1&&E<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var R=new Date(0);R.setUTCFullYear(w+1,0,E),R.setUTCHours(0,0,0,0);var k=IS(R,t),N=new Date(0);N.setUTCFullYear(w,0,E),N.setUTCHours(0,0,0,0);var L=IS(N,t);return v.getTime()>=k.getTime()?w+1:v.getTime()>=L.getTime()?w:w-1}function pte(e,t){var n,r,s,o,i,u,p,g;bc(1,arguments);var v=AS(),w=k0((n=(r=(s=(o=t?.firstWeekContainsDate)!==null&&o!==void 0?o:t==null||(i=t.locale)===null||i===void 0||(u=i.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&s!==void 0?s:v.firstWeekContainsDate)!==null&&r!==void 0?r:(p=v.locale)===null||p===void 0||(g=p.options)===null||g===void 0?void 0:g.firstWeekContainsDate)!==null&&n!==void 0?n:1),x=PL(e,t),E=new Date(0);E.setUTCFullYear(x,0,w),E.setUTCHours(0,0,0,0);var R=IS(E,t);return R}var hte=6048e5;function mte(e,t){bc(1,arguments);var n=Vf(e),r=IS(n,t).getTime()-pte(n,t).getTime();return Math.round(r/hte)+1}function Ho(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}var gte={y:function(t,n){var r=t.getUTCFullYear(),s=r>0?r:1-r;return Ho(n==="yy"?s%100:s,n.length)},M:function(t,n){var r=t.getUTCMonth();return n==="M"?String(r+1):Ho(r+1,2)},d:function(t,n){return Ho(t.getUTCDate(),n.length)},a:function(t,n){var r=t.getUTCHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h:function(t,n){return Ho(t.getUTCHours()%12||12,n.length)},H:function(t,n){return Ho(t.getUTCHours(),n.length)},m:function(t,n){return Ho(t.getUTCMinutes(),n.length)},s:function(t,n){return Ho(t.getUTCSeconds(),n.length)},S:function(t,n){var r=n.length,s=t.getUTCMilliseconds(),o=Math.floor(s*Math.pow(10,r-3));return Ho(o,n.length)}};const Rm=gte;var Ty={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},vte={G:function(t,n,r){var s=t.getUTCFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return r.era(s,{width:"abbreviated"});case"GGGGG":return r.era(s,{width:"narrow"});case"GGGG":default:return r.era(s,{width:"wide"})}},y:function(t,n,r){if(n==="yo"){var s=t.getUTCFullYear(),o=s>0?s:1-s;return r.ordinalNumber(o,{unit:"year"})}return Rm.y(t,n)},Y:function(t,n,r,s){var o=PL(t,s),i=o>0?o:1-o;if(n==="YY"){var u=i%100;return Ho(u,2)}return n==="Yo"?r.ordinalNumber(i,{unit:"year"}):Ho(i,n.length)},R:function(t,n){var r=kL(t);return Ho(r,n.length)},u:function(t,n){var r=t.getUTCFullYear();return Ho(r,n.length)},Q:function(t,n,r){var s=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"Q":return String(s);case"QQ":return Ho(s,2);case"Qo":return r.ordinalNumber(s,{unit:"quarter"});case"QQQ":return r.quarter(s,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(s,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(s,{width:"wide",context:"formatting"})}},q:function(t,n,r){var s=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"q":return String(s);case"qq":return Ho(s,2);case"qo":return r.ordinalNumber(s,{unit:"quarter"});case"qqq":return r.quarter(s,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(s,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(s,{width:"wide",context:"standalone"})}},M:function(t,n,r){var s=t.getUTCMonth();switch(n){case"M":case"MM":return Rm.M(t,n);case"Mo":return r.ordinalNumber(s+1,{unit:"month"});case"MMM":return r.month(s,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(s,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(s,{width:"wide",context:"formatting"})}},L:function(t,n,r){var s=t.getUTCMonth();switch(n){case"L":return String(s+1);case"LL":return Ho(s+1,2);case"Lo":return r.ordinalNumber(s+1,{unit:"month"});case"LLL":return r.month(s,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(s,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(s,{width:"wide",context:"standalone"})}},w:function(t,n,r,s){var o=mte(t,s);return n==="wo"?r.ordinalNumber(o,{unit:"week"}):Ho(o,n.length)},I:function(t,n,r){var s=fte(t);return n==="Io"?r.ordinalNumber(s,{unit:"week"}):Ho(s,n.length)},d:function(t,n,r){return n==="do"?r.ordinalNumber(t.getUTCDate(),{unit:"date"}):Rm.d(t,n)},D:function(t,n,r){var s=cte(t);return n==="Do"?r.ordinalNumber(s,{unit:"dayOfYear"}):Ho(s,n.length)},E:function(t,n,r){var s=t.getUTCDay();switch(n){case"E":case"EE":case"EEE":return r.day(s,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(s,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(s,{width:"short",context:"formatting"});case"EEEE":default:return r.day(s,{width:"wide",context:"formatting"})}},e:function(t,n,r,s){var o=t.getUTCDay(),i=(o-s.weekStartsOn+8)%7||7;switch(n){case"e":return String(i);case"ee":return Ho(i,2);case"eo":return r.ordinalNumber(i,{unit:"day"});case"eee":return r.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(o,{width:"short",context:"formatting"});case"eeee":default:return r.day(o,{width:"wide",context:"formatting"})}},c:function(t,n,r,s){var o=t.getUTCDay(),i=(o-s.weekStartsOn+8)%7||7;switch(n){case"c":return String(i);case"cc":return Ho(i,n.length);case"co":return r.ordinalNumber(i,{unit:"day"});case"ccc":return r.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(o,{width:"narrow",context:"standalone"});case"cccccc":return r.day(o,{width:"short",context:"standalone"});case"cccc":default:return r.day(o,{width:"wide",context:"standalone"})}},i:function(t,n,r){var s=t.getUTCDay(),o=s===0?7:s;switch(n){case"i":return String(o);case"ii":return Ho(o,n.length);case"io":return r.ordinalNumber(o,{unit:"day"});case"iii":return r.day(s,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(s,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(s,{width:"short",context:"formatting"});case"iiii":default:return r.day(s,{width:"wide",context:"formatting"})}},a:function(t,n,r){var s=t.getUTCHours(),o=s/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(t,n,r){var s=t.getUTCHours(),o;switch(s===12?o=Ty.noon:s===0?o=Ty.midnight:o=s/12>=1?"pm":"am",n){case"b":case"bb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(t,n,r){var s=t.getUTCHours(),o;switch(s>=17?o=Ty.evening:s>=12?o=Ty.afternoon:s>=4?o=Ty.morning:o=Ty.night,n){case"B":case"BB":case"BBB":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(t,n,r){if(n==="ho"){var s=t.getUTCHours()%12;return s===0&&(s=12),r.ordinalNumber(s,{unit:"hour"})}return Rm.h(t,n)},H:function(t,n,r){return n==="Ho"?r.ordinalNumber(t.getUTCHours(),{unit:"hour"}):Rm.H(t,n)},K:function(t,n,r){var s=t.getUTCHours()%12;return n==="Ko"?r.ordinalNumber(s,{unit:"hour"}):Ho(s,n.length)},k:function(t,n,r){var s=t.getUTCHours();return s===0&&(s=24),n==="ko"?r.ordinalNumber(s,{unit:"hour"}):Ho(s,n.length)},m:function(t,n,r){return n==="mo"?r.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):Rm.m(t,n)},s:function(t,n,r){return n==="so"?r.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):Rm.s(t,n)},S:function(t,n){return Rm.S(t,n)},X:function(t,n,r,s){var o=s._originalDate||t,i=o.getTimezoneOffset();if(i===0)return"Z";switch(n){case"X":return NL(i);case"XXXX":case"XX":return R0(i);case"XXXXX":case"XXX":default:return R0(i,":")}},x:function(t,n,r,s){var o=s._originalDate||t,i=o.getTimezoneOffset();switch(n){case"x":return NL(i);case"xxxx":case"xx":return R0(i);case"xxxxx":case"xxx":default:return R0(i,":")}},O:function(t,n,r,s){var o=s._originalDate||t,i=o.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+OL(i,":");case"OOOO":default:return"GMT"+R0(i,":")}},z:function(t,n,r,s){var o=s._originalDate||t,i=o.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+OL(i,":");case"zzzz":default:return"GMT"+R0(i,":")}},t:function(t,n,r,s){var o=s._originalDate||t,i=Math.floor(o.getTime()/1e3);return Ho(i,n.length)},T:function(t,n,r,s){var o=s._originalDate||t,i=o.getTime();return Ho(i,n.length)}};function OL(e,t){var n=e>0?"-":"+",r=Math.abs(e),s=Math.floor(r/60),o=r%60;if(o===0)return n+String(s);var i=t||"";return n+String(s)+i+Ho(o,2)}function NL(e,t){if(e%60===0){var n=e>0?"-":"+";return n+Ho(Math.abs(e)/60,2)}return R0(e,t)}function R0(e,t){var n=t||"",r=e>0?"-":"+",s=Math.abs(e),o=Ho(Math.floor(s/60),2),i=Ho(s%60,2);return r+o+n+i}const yte=vte;var AL=function(t,n){switch(t){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},IL=function(t,n){switch(t){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},bte=function(t,n){var r=t.match(/(P+)(p+)?/)||[],s=r[1],o=r[2];if(!o)return AL(t,n);var i;switch(s){case"P":i=n.dateTime({width:"short"});break;case"PP":i=n.dateTime({width:"medium"});break;case"PPP":i=n.dateTime({width:"long"});break;case"PPPP":default:i=n.dateTime({width:"full"});break}return i.replace("{{date}}",AL(s,n)).replace("{{time}}",IL(o,n))},wte={p:IL,P:bte};const xte=wte;function _te(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}var Ste=["D","DD"],Cte=["YY","YYYY"];function Ete(e){return Ste.indexOf(e)!==-1}function Tte(e){return Cte.indexOf(e)!==-1}function jL(e,t,n){if(e==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var kte={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Rte=function(t,n,r){var s,o=kte[t];return typeof o=="string"?s=o:n===1?s=o.one:s=o.other.replace("{{count}}",n.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+s:s+" ago":s};const Pte=Rte;function qp(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth,r=e.formats[n]||e.formats[e.defaultWidth];return r}}var Ote={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Nte={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Ate={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Ite={date:qp({formats:Ote,defaultWidth:"full"}),time:qp({formats:Nte,defaultWidth:"full"}),dateTime:qp({formats:Ate,defaultWidth:"full"})};const jte=Ite;var Dte={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Mte=function(t,n,r,s){return Dte[t]};const DL=Mte;function Hf(e){return function(t,n){var r=n!=null&&n.context?String(n.context):"standalone",s;if(r==="formatting"&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,i=n!=null&&n.width?String(n.width):o;s=e.formattingValues[i]||e.formattingValues[o]}else{var u=e.defaultWidth,p=n!=null&&n.width?String(n.width):e.defaultWidth;s=e.values[p]||e.values[u]}var g=e.argumentCallback?e.argumentCallback(t):t;return s[g]}}var $te={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Lte={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Fte={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},zte={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Ute={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Bte={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Vte=function(t,n){var r=Number(t),s=r%100;if(s>20||s<10)switch(s%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},Hte={ordinalNumber:Vte,era:Hf({values:$te,defaultWidth:"wide"}),quarter:Hf({values:Lte,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:Hf({values:Fte,defaultWidth:"wide"}),day:Hf({values:zte,defaultWidth:"wide"}),dayPeriod:Hf({values:Ute,defaultWidth:"wide",formattingValues:Bte,defaultFormattingWidth:"wide"})};const ML=Hte;function Wf(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.width,s=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(s);if(!o)return null;var i=o[0],u=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],p=Array.isArray(u)?qte(u,function(w){return w.test(i)}):Wte(u,function(w){return w.test(i)}),g;g=e.valueCallback?e.valueCallback(p):p,g=n.valueCallback?n.valueCallback(g):g;var v=t.slice(i.length);return{value:g,rest:v}}}function Wte(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function qte(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}function $L(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.match(e.matchPattern);if(!r)return null;var s=r[0],o=t.match(e.parsePattern);if(!o)return null;var i=e.valueCallback?e.valueCallback(o[0]):o[0];i=n.valueCallback?n.valueCallback(i):i;var u=t.slice(s.length);return{value:i,rest:u}}}var Kte=/^(\d+)(th|st|nd|rd)?/i,Gte=/\d+/i,Qte={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Yte={any:[/^b/i,/^(a|c)/i]},Xte={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Zte={any:[/1/i,/2/i,/3/i,/4/i]},Jte={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},ene={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},tne={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},nne={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},rne={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},sne={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},one={ordinalNumber:$L({matchPattern:Kte,parsePattern:Gte,valueCallback:function(t){return parseInt(t,10)}}),era:Wf({matchPatterns:Qte,defaultMatchWidth:"wide",parsePatterns:Yte,defaultParseWidth:"any"}),quarter:Wf({matchPatterns:Xte,defaultMatchWidth:"wide",parsePatterns:Zte,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:Wf({matchPatterns:Jte,defaultMatchWidth:"wide",parsePatterns:ene,defaultParseWidth:"any"}),day:Wf({matchPatterns:tne,defaultMatchWidth:"wide",parsePatterns:nne,defaultParseWidth:"any"}),dayPeriod:Wf({matchPatterns:rne,defaultMatchWidth:"any",parsePatterns:sne,defaultParseWidth:"any"})};const LL=one;var ane={code:"en-US",formatDistance:Pte,formatLong:jte,formatRelative:DL,localize:ML,match:LL,options:{weekStartsOn:0,firstWeekContainsDate:1}};const ine=ane;var lne=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,cne=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,une=/^'([^]*?)'?$/,dne=/''/g,fne=/[a-zA-Z]/;function pne(e,t,n){var r,s,o,i,u,p,g,v,w,x,E,R,k,N,L,D,B,Q;bc(2,arguments);var ce=String(t),ye=AS(),G=(r=(s=n?.locale)!==null&&s!==void 0?s:ye.locale)!==null&&r!==void 0?r:ine,Le=k0((o=(i=(u=(p=n?.firstWeekContainsDate)!==null&&p!==void 0?p:n==null||(g=n.locale)===null||g===void 0||(v=g.options)===null||v===void 0?void 0:v.firstWeekContainsDate)!==null&&u!==void 0?u:ye.firstWeekContainsDate)!==null&&i!==void 0?i:(w=ye.locale)===null||w===void 0||(x=w.options)===null||x===void 0?void 0:x.firstWeekContainsDate)!==null&&o!==void 0?o:1);if(!(Le>=1&&Le<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var We=k0((E=(R=(k=(N=n?.weekStartsOn)!==null&&N!==void 0?N:n==null||(L=n.locale)===null||L===void 0||(D=L.options)===null||D===void 0?void 0:D.weekStartsOn)!==null&&k!==void 0?k:ye.weekStartsOn)!==null&&R!==void 0?R:(B=ye.locale)===null||B===void 0||(Q=B.options)===null||Q===void 0?void 0:Q.weekStartsOn)!==null&&E!==void 0?E:0);if(!(We>=0&&We<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!G.localize)throw new RangeError("locale must contain localize property");if(!G.formatLong)throw new RangeError("locale must contain formatLong property");var at=Vf(e);if(!ote(at))throw new RangeError("Invalid time value");var St=_te(at),xt=ite(at,St),Mt={firstWeekContainsDate:Le,weekStartsOn:We,locale:G,_originalDate:at},$t=ce.match(cne).map(function(Nt){var Bn=Nt[0];if(Bn==="p"||Bn==="P"){var wn=xte[Bn];return wn(Nt,G.formatLong)}return Nt}).join("").match(lne).map(function(Nt){if(Nt==="''")return"'";var Bn=Nt[0];if(Bn==="'")return hne(Nt);var wn=yte[Bn];if(wn)return!(n!=null&&n.useAdditionalWeekYearTokens)&&Tte(Nt)&&jL(Nt,t,String(e)),!(n!=null&&n.useAdditionalDayOfYearTokens)&&Ete(Nt)&&jL(Nt,t,String(e)),wn(xt,Nt,G.localize,Mt);if(Bn.match(fne))throw new RangeError("Format string contains an unescaped latin alphabet character `"+Bn+"`");return Nt}).join("");return $t}function hne(e){var t=e.match(une);return t?t[1].replace(dne,"'"):e}var mne={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"a second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"a minute",other:"{{count}} minutes"},aboutXHours:{one:"about an hour",other:"about {{count}} hours"},xHours:{one:"an hour",other:"{{count}} hours"},xDays:{one:"a day",other:"{{count}} days"},aboutXWeeks:{one:"about a week",other:"about {{count}} weeks"},xWeeks:{one:"a week",other:"{{count}} weeks"},aboutXMonths:{one:"about a month",other:"about {{count}} months"},xMonths:{one:"a month",other:"{{count}} months"},aboutXYears:{one:"about a year",other:"about {{count}} years"},xYears:{one:"a year",other:"{{count}} years"},overXYears:{one:"over a year",other:"over {{count}} years"},almostXYears:{one:"almost a year",other:"almost {{count}} years"}},gne=function(t,n,r){var s,o=mne[t];return typeof o=="string"?s=o:n===1?s=o.one:s=o.other.replace("{{count}}",n.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+s:s+" ago":s};const vne=gne;var yne={full:"EEEE, MMMM do, yyyy",long:"MMMM do, yyyy",medium:"MMM d, yyyy",short:"yyyy-MM-dd"},bne={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},wne={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},xne={date:qp({formats:yne,defaultWidth:"full"}),time:qp({formats:bne,defaultWidth:"full"}),dateTime:qp({formats:wne,defaultWidth:"full"})},_ne={code:"en-CA",formatDistance:vne,formatLong:xne,formatRelative:DL,localize:ML,match:LL,options:{weekStartsOn:0,firstWeekContainsDate:1}};const Sne=_ne;var Cne={lessThanXSeconds:{one:"moins d\u2019une seconde",other:"moins de {{count}} secondes"},xSeconds:{one:"1 seconde",other:"{{count}} secondes"},halfAMinute:"30 secondes",lessThanXMinutes:{one:"moins d\u2019une minute",other:"moins de {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"environ 1 heure",other:"environ {{count}} heures"},xHours:{one:"1 heure",other:"{{count}} heures"},xDays:{one:"1 jour",other:"{{count}} jours"},aboutXWeeks:{one:"environ 1 semaine",other:"environ {{count}} semaines"},xWeeks:{one:"1 semaine",other:"{{count}} semaines"},aboutXMonths:{one:"environ 1 mois",other:"environ {{count}} mois"},xMonths:{one:"1 mois",other:"{{count}} mois"},aboutXYears:{one:"environ 1 an",other:"environ {{count}} ans"},xYears:{one:"1 an",other:"{{count}} ans"},overXYears:{one:"plus d\u2019un an",other:"plus de {{count}} ans"},almostXYears:{one:"presqu\u2019un an",other:"presque {{count}} ans"}},Ene=function(t,n,r){var s,o=Cne[t];return typeof o=="string"?s=o:n===1?s=o.one:s=o.other.replace("{{count}}",String(n)),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"dans "+s:"il y a "+s:s};const Tne=Ene;var kne={full:"EEEE d MMMM y",long:"d MMMM y",medium:"d MMM y",short:"dd/MM/y"},Rne={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},Pne={full:"{{date}} '\xE0' {{time}}",long:"{{date}} '\xE0' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},One={date:qp({formats:kne,defaultWidth:"full"}),time:qp({formats:Rne,defaultWidth:"full"}),dateTime:qp({formats:Pne,defaultWidth:"full"})};const Nne=One;var Ane={lastWeek:"eeee 'dernier \xE0' p",yesterday:"'hier \xE0' p",today:"'aujourd\u2019hui \xE0' p",tomorrow:"'demain \xE0' p'",nextWeek:"eeee 'prochain \xE0' p",other:"P"},Ine=function(t,n,r,s){return Ane[t]};const jne=Ine;var Dne={narrow:["av. J.-C","ap. J.-C"],abbreviated:["av. J.-C","ap. J.-C"],wide:["avant J\xE9sus-Christ","apr\xE8s J\xE9sus-Christ"]},Mne={narrow:["T1","T2","T3","T4"],abbreviated:["1er trim.","2\xE8me trim.","3\xE8me trim.","4\xE8me trim."],wide:["1er trimestre","2\xE8me trimestre","3\xE8me trimestre","4\xE8me trimestre"]},$ne={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["janv.","f\xE9vr.","mars","avr.","mai","juin","juil.","ao\xFBt","sept.","oct.","nov.","d\xE9c."],wide:["janvier","f\xE9vrier","mars","avril","mai","juin","juillet","ao\xFBt","septembre","octobre","novembre","d\xE9cembre"]},Lne={narrow:["D","L","M","M","J","V","S"],short:["di","lu","ma","me","je","ve","sa"],abbreviated:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],wide:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"]},Fne={narrow:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"mat.",afternoon:"ap.m.",evening:"soir",night:"mat."},abbreviated:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"matin",afternoon:"apr\xE8s-midi",evening:"soir",night:"matin"},wide:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"du matin",afternoon:"de l\u2019apr\xE8s-midi",evening:"du soir",night:"du matin"}},zne=function(t,n){var r=Number(t),s=n?.unit;if(r===0)return"0";var o=["year","week","hour","minute","second"],i;return r===1?i=s&&o.includes(s)?"\xE8re":"er":i="\xE8me",r+i},Une={ordinalNumber:zne,era:Hf({values:Dne,defaultWidth:"wide"}),quarter:Hf({values:Mne,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:Hf({values:$ne,defaultWidth:"wide"}),day:Hf({values:Lne,defaultWidth:"wide"}),dayPeriod:Hf({values:Fne,defaultWidth:"wide"})};const Bne=Une;var Vne=/^(\d+)(ième|ère|ème|er|e)?/i,Hne=/\d+/i,Wne={narrow:/^(av\.J\.C|ap\.J\.C|ap\.J\.-C)/i,abbreviated:/^(av\.J\.-C|av\.J-C|apr\.J\.-C|apr\.J-C|ap\.J-C)/i,wide:/^(avant Jésus-Christ|après Jésus-Christ)/i},qne={any:[/^av/i,/^ap/i]},Kne={narrow:/^T?[1234]/i,abbreviated:/^[1234](er|ème|e)? trim\.?/i,wide:/^[1234](er|ème|e)? trimestre/i},Gne={any:[/1/i,/2/i,/3/i,/4/i]},Qne={narrow:/^[jfmasond]/i,abbreviated:/^(janv|févr|mars|avr|mai|juin|juill|juil|août|sept|oct|nov|déc)\.?/i,wide:/^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i},Yne={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^av/i,/^ma/i,/^juin/i,/^juil/i,/^ao/i,/^s/i,/^o/i,/^n/i,/^d/i]},Xne={narrow:/^[lmjvsd]/i,short:/^(di|lu|ma|me|je|ve|sa)/i,abbreviated:/^(dim|lun|mar|mer|jeu|ven|sam)\.?/i,wide:/^(dimanche|lundi|mardi|mercredi|jeudi|vendredi|samedi)/i},Zne={narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^di/i,/^lu/i,/^ma/i,/^me/i,/^je/i,/^ve/i,/^sa/i]},Jne={narrow:/^(a|p|minuit|midi|mat\.?|ap\.?m\.?|soir|nuit)/i,any:/^([ap]\.?\s?m\.?|du matin|de l'après[-\s]midi|du soir|de la nuit)/i},ere={any:{am:/^a/i,pm:/^p/i,midnight:/^min/i,noon:/^mid/i,morning:/mat/i,afternoon:/ap/i,evening:/soir/i,night:/nuit/i}},tre={ordinalNumber:$L({matchPattern:Vne,parsePattern:Hne,valueCallback:function(t){return parseInt(t)}}),era:Wf({matchPatterns:Wne,defaultMatchWidth:"wide",parsePatterns:qne,defaultParseWidth:"any"}),quarter:Wf({matchPatterns:Kne,defaultMatchWidth:"wide",parsePatterns:Gne,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:Wf({matchPatterns:Qne,defaultMatchWidth:"wide",parsePatterns:Yne,defaultParseWidth:"any"}),day:Wf({matchPatterns:Xne,defaultMatchWidth:"wide",parsePatterns:Zne,defaultParseWidth:"any"}),dayPeriod:Wf({matchPatterns:Jne,defaultMatchWidth:"any",parsePatterns:ere,defaultParseWidth:"any"})},nre={code:"fr",formatDistance:Tne,formatLong:Nne,formatRelative:jne,localize:Bne,match:tre,options:{weekStartsOn:1,firstWeekContainsDate:4}};const rre=nre;var mu=ln(6419),Kp=(e=>(e.fullDate="fullDate",e.numeric="numeric",e.datetime="datetime",e))(Kp||{});const sre=e=>{switch(e){case mu.T.FR:return rre;case mu.T.EN:default:return Sne}},bl=(e,t)=>{const n=e??mu.T.EN,r=sre(n),s=n.slice(0,2);let o;const i={},u={},p={};switch(i[mu.T.EN]="MM-dd-yyyy",i[mu.T.FR]="dd-MM-yyyy",u[mu.T.EN]="MMMM do, y hh:mm aaaaa'm'",u[mu.T.FR]="d MMMM y hh:mm aaaaa'",p[mu.T.EN]="MMMM do, y",p[mu.T.FR]="d MMMM y",t){case"numeric":o=i[s];break;case"datetime":o=u[s];break;default:o=p[s]}return g=>{if(g&&(typeof g=="string"&&(g=new Date(g)),g instanceof Date&&!Number.isNaN(g.getTime()))){g=are(g,t);const v=pne(g,o,{locale:r});return n===mu.T.FR&&v.startsWith("1 ")?(0,a.jsxs)(a.Fragment,{children:["1",(0,a.jsx)("sup",{children:"er"}),v.substring(1)]}):v}}},ore=["datetime"],are=(e,t)=>t&&ore.includes(t)?e:new Date(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds()),ire=({firstName:e,lastName:t,email:n})=>(0,a.jsx)("div",{className:"flex flex-row items-center gap-4",children:(0,a.jsx)("div",{className:"mb-1 flex flex-col justify-between",children:n?(0,a.jsx)(a.Fragment,{children:n}):(0,a.jsxs)(a.Fragment,{children:[e," ",t]})})}),FL=({order:e})=>{const{t,i18n:{language:n}}=(0,z.Bd)(),r=bl(n),s=Md(n),o=Boolean(e?.error?.message??e?.decisionNote),i=Boolean(e?.error?.title);return e?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(Vu,{className:"bg-slate-300 dark:bg-slate-700"}),(0,a.jsx)(ls.Layout,{children:(0,a.jsxs)(ls.Row,{className:"gap-x-4",children:[(0,a.jsxs)(ls.Column,{children:[(0,a.jsxs)(ls.Content,{children:[(0,a.jsx)(ls.ContentLabel,{children:t("core:orders.detail.organizationName")}),(0,a.jsx)(ls.ContentValue,{children:e?.organizationUniqueName})]}),(0,a.jsxs)(ls.Content,{className:"mt-2",children:[(0,a.jsx)(ls.ContentLabel,{children:t("core:orders.detail.createdOn")}),(0,a.jsx)(ls.ContentValue,{children:r(e?.createdOn)})]}),(0,a.jsxs)(ls.Content,{children:[(0,a.jsx)(ls.ContentLabel,{children:t("core:orders.detail.orderValue")}),(0,a.jsx)(ls.ContentValue,{children:e.orderValue?s(e.orderValue):null})]}),(0,a.jsxs)(ls.Content,{children:[(0,a.jsx)(ls.ContentLabel,{children:t("core:orders.detail.productName")}),(0,a.jsx)(ls.ContentValue,{children:e?.firstProductName})]})]}),(0,a.jsxs)(ls.Column,{children:[(0,a.jsxs)(ls.Content,{children:[(0,a.jsx)(ls.ContentLabel,{children:t("core:orders.detail.createdBy")}),(0,a.jsx)(ls.ContentValue,{children:(0,a.jsx)(ire,{firstName:e?.userFirstName,lastName:e?.userLastName,email:e?.userEmail})})]}),(0,a.jsxs)(ls.Content,{children:[(0,a.jsx)(ls.ContentLabel,{children:t("core:orders.detail.status")}),(0,a.jsx)(ls.ContentValue,{children:(0,a.jsx)(T0,{orderStatus:e?.orderStatus})})]}),(0,a.jsxs)(ls.Content,{children:[(0,a.jsx)(ls.ContentLabel,{children:t("core:orders.detail.type")}),(0,a.jsx)(ls.ContentValue,{children:(0,a.jsx)(Jk,{orderType:e?.orderType})})]}),(0,a.jsxs)(ls.Content,{children:[(0,a.jsx)(ls.ContentLabel,{children:t("core:orders.detail.quantity")}),(0,a.jsx)(ls.ContentValue,{children:e?.firstQuantity})]})]})]})}),(0,a.jsx)(Vu,{className:"bg-slate-300 dark:bg-slate-700"}),(0,a.jsx)(ls.Layout,{className:"flex flex-col gap-y-2",children:(0,a.jsxs)("div",{className:"flex flex-col gap-y-6",children:[o?(0,a.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,a.jsx)(Pn,{variant:"body2",weight:"medium",children:t("core:orders.detail.comment")}),(0,a.jsx)(Pn,{variant:"body2",children:e?.error?.message??e?.decisionNote})]}):null,i?(0,a.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,a.jsx)(Pn,{variant:"body2",weight:"medium",as:"div",children:t("core:orders.detail.serverError")}),(0,a.jsxs)(Pn,{variant:"body2",as:"div",children:[e?.error?.title&&!e?.error?.detail?.includes(e?.error.title)&&(0,a.jsx)("p",{children:decodeURIComponent(encodeURIComponent(e?.error?.title??""))}),(0,a.jsx)("p",{children:decodeURIComponent(encodeURIComponent(e?.error?.detail??""))})]})]}):null]})})]}):null},lre=Ll(()=>{const{t:e}=(0,z.Bd)(),{orderId:t}=ma(),n=CL(t),r=Qs(),s=n.isLoading||!n?.data,o=()=>{r(Sr.Orders)};return(0,a.jsxs)(ls,{dataTestId:"sheetOrderDetailsPage",title:s?null:(0,a.jsx)(Pn,{variant:"heading6",weight:"bold",className:"text-wrap",children:e("core:orders.detail.title",{orderId:n?.data?.humanReadableId})}),onClose:o,children:[s?(0,a.jsx)(zs,{dataTestId:"layoverSpinnner",className:"absolute left-[calc(50%-3rem)] top-[calc(50%-3rem)] z-10"}):null,(0,a.jsx)(FL,{order:n?.data})]})},oe.aX.AdminOrderDetails);/**
   * table-core
   *
   * Copyright (c) TanStack
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE.md file in the root directory of this source tree.
   *
   * @license MIT
   */function Jhe(){return{accessor:(e,t)=>typeof e=="function"?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e}}function Pm(e,t){return typeof e=="function"?e(t):e}function eme(){}function gu(e,t){return n=>{t.setState(r=>({...r,[e]:Pm(n,r[e])}))}}function jS(e){return e instanceof Function}function cre(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function zL(e,t){const n=[],r=s=>{s.forEach(o=>{n.push(o);const i=t(o);i!=null&&i.length&&r(i)})};return r(e),n}function es(e,t,n){let r=[],s;return o=>{let i;n.key&&n.debug&&(i=Date.now());const u=e(o);if(!(u.length!==r.length||u.some((v,w)=>r[w]!==v)))return s;r=u;let g;if(n.key&&n.debug&&(g=Date.now()),s=t(...u),n==null||n.onChange==null||n.onChange(s),n.key&&n.debug&&n!=null&&n.debug()){const v=Math.round((Date.now()-i)*100)/100,w=Math.round((Date.now()-g)*100)/100,x=w/16,E=(R,k)=>{for(R=String(R);R.length<k;)R=" "+R;return R};console.info(`%c\u23F1 ${E(w,5)} /${E(v,5)} ms`,`
            font-size: .6rem;
            font-weight: bold;
            color: hsl(${Math.max(0,Math.min(120-120*x,120))}deg 100% 31%);`,n?.key)}return s}}function ts(e,t,n,r){return{debug:()=>{var s;return(s=e?.debugAll)!=null?s:e[t]},key:!1,onChange:r}}function ure(e,t,n,r){const s=()=>{var i;return(i=o.getValue())!=null?i:e.options.renderFallbackValue},o={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:s,getContext:es(()=>[e,n,t,o],(i,u,p,g)=>({table:i,column:u,row:p,cell:g,getValue:g.getValue,renderValue:g.renderValue}),ts(e.options,"debugCells","cell.getContext"))};return e._features.forEach(i=>{i.createCell==null||i.createCell(o,n,t,e)},{}),o}function dre(e,t,n,r){var s,o;const u={...e._getDefaultColumnDef(),...t},p=u.accessorKey;let g=(s=(o=u.id)!=null?o:p?p.replace(".","_"):void 0)!=null?s:typeof u.header=="string"?u.header:void 0,v;if(u.accessorFn?v=u.accessorFn:p&&(p.includes(".")?v=x=>{let E=x;for(const k of p.split(".")){var R;E=(R=E)==null?void 0:R[k]}return E}:v=x=>x[u.accessorKey]),!g)throw new Error;let w={id:`${String(g)}`,accessorFn:v,parent:r,depth:n,columnDef:u,columns:[],getFlatColumns:es(()=>[!0],()=>{var x;return[w,...(x=w.columns)==null?void 0:x.flatMap(E=>E.getFlatColumns())]},ts(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:es(()=>[e._getOrderColumnsFn()],x=>{var E;if((E=w.columns)!=null&&E.length){let R=w.columns.flatMap(k=>k.getLeafColumns());return x(R)}return[w]},ts(e.options,"debugColumns","column.getLeafColumns"))};for(const x of e._features)x.createColumn==null||x.createColumn(w,e);return w}const Vl="debugHeaders";function UL(e,t,n){var r;let o={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const i=[],u=p=>{p.subHeaders&&p.subHeaders.length&&p.subHeaders.map(u),i.push(p)};return u(o),i},getContext:()=>({table:e,header:o,column:t})};return e._features.forEach(i=>{i.createHeader==null||i.createHeader(o,e)}),o}const fre={createTable:e=>{e.getHeaderGroups=es(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,s)=>{var o,i;const u=(o=r?.map(w=>n.find(x=>x.id===w)).filter(Boolean))!=null?o:[],p=(i=s?.map(w=>n.find(x=>x.id===w)).filter(Boolean))!=null?i:[],g=n.filter(w=>!(r!=null&&r.includes(w.id))&&!(s!=null&&s.includes(w.id)));return DS(t,[...u,...g,...p],e)},ts(e.options,Vl,"getHeaderGroups")),e.getCenterHeaderGroups=es(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,s)=>(n=n.filter(o=>!(r!=null&&r.includes(o.id))&&!(s!=null&&s.includes(o.id))),DS(t,n,e,"center")),ts(e.options,Vl,"getCenterHeaderGroups")),e.getLeftHeaderGroups=es(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var s;const o=(s=r?.map(i=>n.find(u=>u.id===i)).filter(Boolean))!=null?s:[];return DS(t,o,e,"left")},ts(e.options,Vl,"getLeftHeaderGroups")),e.getRightHeaderGroups=es(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var s;const o=(s=r?.map(i=>n.find(u=>u.id===i)).filter(Boolean))!=null?s:[];return DS(t,o,e,"right")},ts(e.options,Vl,"getRightHeaderGroups")),e.getFooterGroups=es(()=>[e.getHeaderGroups()],t=>[...t].reverse(),ts(e.options,Vl,"getFooterGroups")),e.getLeftFooterGroups=es(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),ts(e.options,Vl,"getLeftFooterGroups")),e.getCenterFooterGroups=es(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),ts(e.options,Vl,"getCenterFooterGroups")),e.getRightFooterGroups=es(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),ts(e.options,Vl,"getRightFooterGroups")),e.getFlatHeaders=es(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),ts(e.options,Vl,"getFlatHeaders")),e.getLeftFlatHeaders=es(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),ts(e.options,Vl,"getLeftFlatHeaders")),e.getCenterFlatHeaders=es(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),ts(e.options,Vl,"getCenterFlatHeaders")),e.getRightFlatHeaders=es(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),ts(e.options,Vl,"getRightFlatHeaders")),e.getCenterLeafHeaders=es(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ts(e.options,Vl,"getCenterLeafHeaders")),e.getLeftLeafHeaders=es(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ts(e.options,Vl,"getLeftLeafHeaders")),e.getRightLeafHeaders=es(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ts(e.options,Vl,"getRightLeafHeaders")),e.getLeafHeaders=es(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var s,o,i,u,p,g;return[...(s=(o=t[0])==null?void 0:o.headers)!=null?s:[],...(i=(u=n[0])==null?void 0:u.headers)!=null?i:[],...(p=(g=r[0])==null?void 0:g.headers)!=null?p:[]].map(v=>v.getLeafHeaders()).flat()},ts(e.options,Vl,"getLeafHeaders"))}};function DS(e,t,n,r){var s,o;let i=0;const u=function(x,E){E===void 0&&(E=1),i=Math.max(i,E),x.filter(R=>R.getIsVisible()).forEach(R=>{var k;(k=R.columns)!=null&&k.length&&u(R.columns,E+1)},0)};u(e);let p=[];const g=(x,E)=>{const R={depth:E,id:[r,`${E}`].filter(Boolean).join("_"),headers:[]},k=[];x.forEach(N=>{const L=[...k].reverse()[0],D=N.column.depth===R.depth;let B,Q=!1;if(D&&N.column.parent?B=N.column.parent:(B=N.column,Q=!0),L&&L?.column===B)L.subHeaders.push(N);else{const ce=UL(n,B,{id:[r,E,B.id,N?.id].filter(Boolean).join("_"),isPlaceholder:Q,placeholderId:Q?`${k.filter(ye=>ye.column===B).length}`:void 0,depth:E,index:k.length});ce.subHeaders.push(N),k.push(ce)}R.headers.push(N),N.headerGroup=R}),p.push(R),E>0&&g(k,E-1)},v=t.map((x,E)=>UL(n,x,{depth:i,index:E}));g(v,i-1),p.reverse();const w=x=>x.filter(R=>R.column.getIsVisible()).map(R=>{let k=0,N=0,L=[0];R.subHeaders&&R.subHeaders.length?(L=[],w(R.subHeaders).forEach(B=>{let{colSpan:Q,rowSpan:ce}=B;k+=Q,L.push(ce)})):k=1;const D=Math.min(...L);return N=N+D,R.colSpan=k,R.rowSpan=N,{colSpan:k,rowSpan:N}});return w((s=(o=p[0])==null?void 0:o.headers)!=null?s:[]),p}const MS=(e,t,n,r,s,o,i)=>{let u={id:t,index:r,original:n,depth:s,parentId:i,_valuesCache:{},_uniqueValuesCache:{},getValue:p=>{if(u._valuesCache.hasOwnProperty(p))return u._valuesCache[p];const g=e.getColumn(p);if(g!=null&&g.accessorFn)return u._valuesCache[p]=g.accessorFn(u.original,r),u._valuesCache[p]},getUniqueValues:p=>{if(u._uniqueValuesCache.hasOwnProperty(p))return u._uniqueValuesCache[p];const g=e.getColumn(p);if(g!=null&&g.accessorFn)return g.columnDef.getUniqueValues?(u._uniqueValuesCache[p]=g.columnDef.getUniqueValues(u.original,r),u._uniqueValuesCache[p]):(u._uniqueValuesCache[p]=[u.getValue(p)],u._uniqueValuesCache[p])},renderValue:p=>{var g;return(g=u.getValue(p))!=null?g:e.options.renderFallbackValue},subRows:o??[],getLeafRows:()=>zL(u.subRows,p=>p.subRows),getParentRow:()=>u.parentId?e.getRow(u.parentId,!0):void 0,getParentRows:()=>{let p=[],g=u;for(;;){const v=g.getParentRow();if(!v)break;p.push(v),g=v}return p.reverse()},getAllCells:es(()=>[e.getAllLeafColumns()],p=>p.map(g=>ure(e,u,g,g.id)),ts(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:es(()=>[u.getAllCells()],p=>p.reduce((g,v)=>(g[v.column.id]=v,g),{}),ts(e.options,"debugRows","getAllCellsByColumnId"))};for(let p=0;p<e._features.length;p++){const g=e._features[p];g==null||g.createRow==null||g.createRow(u,e)}return u},pre={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},BL=(e,t,n)=>{var r;const s=n.toLowerCase();return Boolean((r=e.getValue(t))==null||(r=r.toString())==null||(r=r.toLowerCase())==null?void 0:r.includes(s))};BL.autoRemove=e=>$d(e);const VL=(e,t,n)=>{var r;return Boolean((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.includes(n))};VL.autoRemove=e=>$d(e);const HL=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===n?.toLowerCase()};HL.autoRemove=e=>$d(e);const WL=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};WL.autoRemove=e=>$d(e)||!(e!=null&&e.length);const qL=(e,t,n)=>!n.some(r=>{var s;return!((s=e.getValue(t))!=null&&s.includes(r))});qL.autoRemove=e=>$d(e)||!(e!=null&&e.length);const KL=(e,t,n)=>n.some(r=>{var s;return(s=e.getValue(t))==null?void 0:s.includes(r)});KL.autoRemove=e=>$d(e)||!(e!=null&&e.length);const GL=(e,t,n)=>e.getValue(t)===n;GL.autoRemove=e=>$d(e);const QL=(e,t,n)=>e.getValue(t)==n;QL.autoRemove=e=>$d(e);const eR=(e,t,n)=>{let[r,s]=n;const o=e.getValue(t);return o>=r&&o<=s};eR.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,s=typeof n!="number"?parseFloat(n):n,o=t===null||Number.isNaN(r)?-1/0:r,i=n===null||Number.isNaN(s)?1/0:s;if(o>i){const u=o;o=i,i=u}return[o,i]},eR.autoRemove=e=>$d(e)||$d(e[0])&&$d(e[1]);const Gp={includesString:BL,includesStringSensitive:VL,equalsString:HL,arrIncludes:WL,arrIncludesAll:qL,arrIncludesSome:KL,equals:GL,weakEquals:QL,inNumberRange:eR};function $d(e){return e==null||e===""}const hre={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:gu("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n?.getValue(e.id);return typeof r=="string"?Gp.includesString:typeof r=="number"?Gp.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Gp.equals:Array.isArray(r)?Gp.arrIncludes:Gp.weakEquals},e.getFilterFn=()=>{var n,r;return jS(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:Gp[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,s;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((s=t.options.enableFilters)!=null?s:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(s=>s.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const s=e.getFilterFn(),o=r?.find(v=>v.id===e.id),i=Pm(n,o?o.value:void 0);if(YL(s,i,e)){var u;return(u=r?.filter(v=>v.id!==e.id))!=null?u:[]}const p={id:e.id,value:i};if(o){var g;return(g=r?.map(v=>v.id===e.id?p:v))!=null?g:[]}return r!=null&&r.length?[...r,p]:[p]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=s=>{var o;return(o=Pm(t,s))==null?void 0:o.filter(i=>{const u=n.find(p=>p.id===i.id);if(u){const p=u.getFilterFn();if(YL(p,i.value,u))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function YL(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const tR={sum:(e,t,n)=>n.reduce((r,s)=>{const o=s.getValue(e);return r+(typeof o=="number"?o:0)},0),min:(e,t,n)=>{let r;return n.forEach(s=>{const o=s.getValue(e);o!=null&&(r>o||r===void 0&&o>=o)&&(r=o)}),r},max:(e,t,n)=>{let r;return n.forEach(s=>{const o=s.getValue(e);o!=null&&(r<o||r===void 0&&o>=o)&&(r=o)}),r},extent:(e,t,n)=>{let r,s;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r===void 0?i>=i&&(r=s=i):(r>i&&(r=i),s<i&&(s=i)))}),[r,s]},mean:(e,t)=>{let n=0,r=0;if(t.forEach(s=>{let o=s.getValue(e);o!=null&&(o=+o)>=o&&(++n,r+=o)}),n)return r/n},median:(e,t)=>{if(!t.length)return;const n=t.map(o=>o.getValue(e));if(!cre(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),s=n.sort((o,i)=>o-i);return n.length%2!==0?s[r]:(s[r-1]+s[r])/2},unique:(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),uniqueCount:(e,t)=>new Set(t.map(n=>n.getValue(e))).size,count:(e,t)=>t.length},mre={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:gu("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n?.getValue(e.id);if(typeof r=="number")return tR.sum;if(Object.prototype.toString.call(r)==="[object Date]")return tR.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return jS(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:tR[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var s;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((s=n.subRows)!=null&&s.length)}}};function gre(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(o=>!t.includes(o.id));return n==="remove"?r:[...t.map(o=>e.find(i=>i.id===o)).filter(Boolean),...r]}const vre={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:gu("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=es(n=>[Iw(t,n)],n=>n.findIndex(r=>r.id===e.id),ts(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var r;return((r=Iw(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const s=Iw(t,n);return((r=s[s.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=es(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>s=>{let o=[];if(!(t!=null&&t.length))o=s;else{const i=[...t],u=[...s];for(;u.length&&i.length;){const p=i.shift(),g=u.findIndex(v=>v.id===p);g>-1&&o.push(u.splice(g,1)[0])}o=[...o,...u]}return gre(o,n,r)},ts(e.options,"debugTable","_getOrderColumnsFn"))}},nR=()=>({left:[],right:[]}),yre={getInitialState:e=>({columnPinning:nR(),...e}),getDefaultOptions:e=>({onColumnPinningChange:gu("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(s=>s.id).filter(Boolean);t.setColumnPinning(s=>{var o,i;if(n==="right"){var u,p;return{left:((u=s?.left)!=null?u:[]).filter(w=>!(r!=null&&r.includes(w))),right:[...((p=s?.right)!=null?p:[]).filter(w=>!(r!=null&&r.includes(w))),...r]}}if(n==="left"){var g,v;return{left:[...((g=s?.left)!=null?g:[]).filter(w=>!(r!=null&&r.includes(w))),...r],right:((v=s?.right)!=null?v:[]).filter(w=>!(r!=null&&r.includes(w)))}}return{left:((o=s?.left)!=null?o:[]).filter(w=>!(r!=null&&r.includes(w))),right:((i=s?.right)!=null?i:[]).filter(w=>!(r!=null&&r.includes(w)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var s,o,i;return((s=r.columnDef.enablePinning)!=null?s:!0)&&((o=(i=t.options.enableColumnPinning)!=null?i:t.options.enablePinning)!=null?o:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(u=>u.id),{left:r,right:s}=t.getState().columnPinning,o=n.some(u=>r?.includes(u)),i=n.some(u=>s?.includes(u));return o?"left":i?"right":!1},e.getPinnedIndex=()=>{var n,r;const s=e.getIsPinned();return s?(n=(r=t.getState().columnPinning)==null||(r=r[s])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=es(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,s)=>{const o=[...r??[],...s??[]];return n.filter(i=>!o.includes(i.column.id))},ts(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=es(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(o=>n.find(i=>i.column.id===o)).filter(Boolean).map(o=>({...o,position:"left"})),ts(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=es(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(o=>n.find(i=>i.column.id===o)).filter(Boolean).map(o=>({...o,position:"right"})),ts(t.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?nR():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:nR())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var s,o;return Boolean(((s=r.left)==null?void 0:s.length)||((o=r.right)==null?void 0:o.length))}return Boolean((n=r[t])==null?void 0:n.length)},e.getLeftLeafColumns=es(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(s=>s.id===r)).filter(Boolean),ts(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=es(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(s=>s.id===r)).filter(Boolean),ts(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=es(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const s=[...n??[],...r??[]];return t.filter(o=>!s.includes(o.id))},ts(e.options,"debugColumns","getCenterLeafColumns"))}},$S={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},rR=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),bre={getDefaultColumnDef:()=>$S,getInitialState:e=>({columnSizing:{},columnSizingInfo:rR(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:gu("columnSizing",e),onColumnSizingInfoChange:gu("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,s;const o=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:$S.minSize,(r=o??e.columnDef.size)!=null?r:$S.size),(s=e.columnDef.maxSize)!=null?s:$S.maxSize)},e.getStart=es(n=>[n,Iw(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((s,o)=>s+o.getSize(),0),ts(t.options,"debugColumns","getStart")),e.getAfter=es(n=>[n,Iw(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((s,o)=>s+o.getSize(),0),ts(t.options,"debugColumns","getAfter")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...s}=n;return s})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=s=>{if(s.subHeaders.length)s.subHeaders.forEach(r);else{var o;n+=(o=s.column.getSize())!=null?o:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),s=r?.getCanResize();return o=>{if(!r||!s||(o.persist==null||o.persist(),sR(o)&&o.touches&&o.touches.length>1))return;const i=e.getSize(),u=e?e.getLeafHeaders().map(L=>[L.column.id,L.column.getSize()]):[[r.id,r.getSize()]],p=sR(o)?Math.round(o.touches[0].clientX):o.clientX,g={},v=(L,D)=>{typeof D=="number"&&(t.setColumnSizingInfo(B=>{var Q,ce;const ye=t.options.columnResizeDirection==="rtl"?-1:1,G=(D-((Q=B?.startOffset)!=null?Q:0))*ye,Le=Math.max(G/((ce=B?.startSize)!=null?ce:0),-.999999);return B.columnSizingStart.forEach(We=>{let[at,St]=We;g[at]=Math.round(Math.max(St+St*Le,0)*100)/100}),{...B,deltaOffset:G,deltaPercentage:Le}}),(t.options.columnResizeMode==="onChange"||L==="end")&&t.setColumnSizing(B=>({...B,...g})))},w=L=>v("move",L),x=L=>{v("end",L),t.setColumnSizingInfo(D=>({...D,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},E=n||typeof document<"u"?document:null,R={moveHandler:L=>w(L.clientX),upHandler:L=>{E?.removeEventListener("mousemove",R.moveHandler),E?.removeEventListener("mouseup",R.upHandler),x(L.clientX)}},k={moveHandler:L=>(L.cancelable&&(L.preventDefault(),L.stopPropagation()),w(L.touches[0].clientX),!1),upHandler:L=>{var D;E?.removeEventListener("touchmove",k.moveHandler),E?.removeEventListener("touchend",k.upHandler),L.cancelable&&(L.preventDefault(),L.stopPropagation()),x((D=L.touches[0])==null?void 0:D.clientX)}},N=wre()?{passive:!1}:!1;sR(o)?(E?.addEventListener("touchmove",k.moveHandler,N),E?.addEventListener("touchend",k.upHandler,N)):(E?.addEventListener("mousemove",R.moveHandler,N),E?.addEventListener("mouseup",R.upHandler,N)),t.setColumnSizingInfo(L=>({...L,startOffset:p,startSize:i,deltaOffset:0,deltaPercentage:0,columnSizingStart:u,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?rR():(n=e.initialState.columnSizingInfo)!=null?n:rR())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0}}};let LS=null;function wre(){if(typeof LS=="boolean")return LS;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return LS=e,LS}function sR(e){return e.type==="touchstart"}const xre={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:gu("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const s=e.columns;return(n=s.length?s.some(o=>o.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=es(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),ts(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=es(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,s)=>[...n,...r,...s],ts(t.options,"debugRows","getVisibleCells"))},createTable:e=>{const t=(n,r)=>es(()=>[r(),r().filter(s=>s.getIsVisible()).map(s=>s.id).join("_")],s=>s.filter(o=>o.getIsVisible==null?void 0:o.getIsVisible()),ts(e.options,"debugColumns",n));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((s,o)=>({...s,[o.id]:n||!(o.getCanHide!=null&&o.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function Iw(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const _re={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},Sre={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:gu("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,s,o;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((s=t.options.enableFilters)!=null?s:!0)&&((o=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?o:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Gp.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return jS(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:Gp[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},Cre={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:gu("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,s;if(!t){e._queue(()=>{t=!0});return}if((r=(s=e.options.autoResetAll)!=null?s:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var s,o;e.setExpanded(r?{}:(s=(o=e.initialState)==null?void 0:o.expanded)!=null?s:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(s=>!s.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(o=>{const i=o.split(".");r=Math.max(r,i.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var s;const o=r===!0?!0:!!(r!=null&&r[e.id]);let i={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(u=>{i[u]=!0}):i=r,n=(s=n)!=null?s:!o,!o&&n)return{...i,[e.id]:!0};if(o&&!n){const{[e.id]:u,...p}=i;return p}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r?.[e.id])},e.getCanExpand=()=>{var n,r,s;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((s=e.subRows)!=null&&s.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},oR=0,aR=10,iR=()=>({pageIndex:oR,pageSize:aR}),Ere={getInitialState:e=>({...e,pagination:{...iR(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:gu("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,s;if(!t){e._queue(()=>{t=!0});return}if((r=(s=e.options.autoResetAll)!=null?s:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const s=o=>Pm(r,o);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(s)},e.resetPagination=r=>{var s;e.setPagination(r?iR():(s=e.initialState.pagination)!=null?s:iR())},e.setPageIndex=r=>{e.setPagination(s=>{let o=Pm(r,s.pageIndex);const i=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return o=Math.max(0,Math.min(o,i)),{...s,pageIndex:o}})},e.resetPageIndex=r=>{var s,o;e.setPageIndex(r?oR:(s=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageIndex)!=null?s:oR)},e.resetPageSize=r=>{var s,o;e.setPageSize(r?aR:(s=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageSize)!=null?s:aR)},e.setPageSize=r=>{e.setPagination(s=>{const o=Math.max(1,Pm(r,s.pageSize)),i=s.pageSize*s.pageIndex,u=Math.floor(i/o);return{...s,pageIndex:u,pageSize:o}})},e.setPageCount=r=>e.setPagination(s=>{var o;let i=Pm(r,(o=e.options.pageCount)!=null?o:-1);return typeof i=="number"&&(i=Math.max(-1,i)),{...s,pageCount:i}}),e.getPageOptions=es(()=>[e.getPageCount()],r=>{let s=[];return r&&r>0&&(s=[...new Array(r)].fill(null).map((o,i)=>i)),s},ts(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,s=e.getPageCount();return s===-1?!0:s===0?!1:r<s-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},lR=()=>({top:[],bottom:[]}),Tre={getInitialState:e=>({rowPinning:lR(),...e}),getDefaultOptions:e=>({onRowPinningChange:gu("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,s)=>{const o=r?e.getLeafRows().map(p=>{let{id:g}=p;return g}):[],i=s?e.getParentRows().map(p=>{let{id:g}=p;return g}):[],u=new Set([...i,e.id,...o]);t.setRowPinning(p=>{var g,v;if(n==="bottom"){var w,x;return{top:((w=p?.top)!=null?w:[]).filter(k=>!(u!=null&&u.has(k))),bottom:[...((x=p?.bottom)!=null?x:[]).filter(k=>!(u!=null&&u.has(k))),...Array.from(u)]}}if(n==="top"){var E,R;return{top:[...((E=p?.top)!=null?E:[]).filter(k=>!(u!=null&&u.has(k))),...Array.from(u)],bottom:((R=p?.bottom)!=null?R:[]).filter(k=>!(u!=null&&u.has(k)))}}return{top:((g=p?.top)!=null?g:[]).filter(k=>!(u!=null&&u.has(k))),bottom:((v=p?.bottom)!=null?v:[]).filter(k=>!(u!=null&&u.has(k)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:s}=t.options;return typeof r=="function"?r(e):(n=r??s)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:s}=t.getState().rowPinning,o=n.some(u=>r?.includes(u)),i=n.some(u=>s?.includes(u));return o?"top":i?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const s=e.getIsPinned();if(!s)return-1;const o=(n=t._getPinnedRows(s))==null?void 0:n.map(i=>{let{id:u}=i;return u});return(r=o?.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?lR():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:lR())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var s,o;return Boolean(((s=r.top)==null?void 0:s.length)||((o=r.bottom)==null?void 0:o.length))}return Boolean((n=r[t])==null?void 0:n.length)},e._getPinnedRows=es(t=>[e.getRowModel().rows,e.getState().rowPinning[t],t],(t,n,r)=>{var s;return((s=e.options.keepPinnedRows)==null||s?(n??[]).map(i=>{const u=e.getRow(i,!0);return u.getIsAllParentsExpanded()?u:null}):(n??[]).map(i=>t.find(u=>u.id===i))).filter(Boolean).map(i=>({...i,position:r}))},ts(e.options,"debugRows","_getPinnedRows")),e.getTopRows=()=>e._getPinnedRows("top"),e.getBottomRows=()=>e._getPinnedRows("bottom"),e.getCenterRows=es(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const s=new Set([...n??[],...r??[]]);return t.filter(o=>!s.has(o.id))},ts(e.options,"debugRows","getCenterRows"))}},kre={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:gu("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},s=e.getPreGroupedRowModel().flatRows;return t?s.forEach(o=>{o.getCanSelect()&&(r[o.id]=!0)}):s.forEach(o=>{delete r[o.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),s={...n};return e.getRowModel().rows.forEach(o=>{cR(s,o.id,r,!0,e)}),s}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=es(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?uR(e,n):{rows:[],flatRows:[],rowsById:{}},ts(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=es(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?uR(e,n):{rows:[],flatRows:[],rowsById:{}},ts(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=es(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?uR(e,n):{rows:[],flatRows:[],rowsById:{}},ts(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=Boolean(t.length&&Object.keys(n).length);return r&&t.some(s=>s.getCanSelect()&&!n[s.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(s=>s.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(s=>!n[s.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const s=e.getIsSelected();t.setRowSelection(o=>{var i;if(n=typeof n<"u"?n:!s,e.getCanSelect()&&s===n)return o;const u={...o};return cR(u,e.id,n,(i=r?.selectChildren)!=null?i:!0,t),u})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return dR(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return fR(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return fR(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var s;n&&e.toggleSelected((s=r.target)==null?void 0:s.checked)}}}},cR=(e,t,n,r,s)=>{var o;const i=s.getRow(t,!0);n?(i.getCanMultiSelect()||Object.keys(e).forEach(u=>delete e[u]),i.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(o=i.subRows)!=null&&o.length&&i.getCanSelectSubRows()&&i.subRows.forEach(u=>cR(e,u.id,n,r,s))};function uR(e,t){const n=e.getState().rowSelection,r=[],s={},o=function(i,u){return i.map(p=>{var g;const v=dR(p,n);if(v&&(r.push(p),s[p.id]=p),(g=p.subRows)!=null&&g.length&&(p={...p,subRows:o(p.subRows)}),v)return p}).filter(Boolean)};return{rows:o(t.rows),flatRows:r,rowsById:s}}function dR(e,t){var n;return(n=t[e.id])!=null?n:!1}function fR(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let s=!0,o=!1;return e.subRows.forEach(i=>{if(!(o&&!s)&&(i.getCanSelect()&&(dR(i,t)?o=!0:s=!1),i.subRows&&i.subRows.length)){const u=fR(i,t);u==="all"?o=!0:(u==="some"&&(o=!0),s=!1)}}),s?"all":o?"some":!1}const pR=/([0-9]+)/gm,Rre=(e,t,n)=>XL(Om(e.getValue(n)).toLowerCase(),Om(t.getValue(n)).toLowerCase()),Pre=(e,t,n)=>XL(Om(e.getValue(n)),Om(t.getValue(n))),Ore=(e,t,n)=>hR(Om(e.getValue(n)).toLowerCase(),Om(t.getValue(n)).toLowerCase()),Nre=(e,t,n)=>hR(Om(e.getValue(n)),Om(t.getValue(n))),Are=(e,t,n)=>{const r=e.getValue(n),s=t.getValue(n);return r>s?1:r<s?-1:0},Ire=(e,t,n)=>hR(e.getValue(n),t.getValue(n));function hR(e,t){return e===t?0:e>t?1:-1}function Om(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function XL(e,t){const n=e.split(pR).filter(Boolean),r=t.split(pR).filter(Boolean);for(;n.length&&r.length;){const s=n.shift(),o=r.shift(),i=parseInt(s,10),u=parseInt(o,10),p=[i,u].sort();if(isNaN(p[0])){if(s>o)return 1;if(o>s)return-1;continue}if(isNaN(p[1]))return isNaN(i)?-1:1;if(i>u)return 1;if(u>i)return-1}return n.length-r.length}const jw={alphanumeric:Rre,alphanumericCaseSensitive:Pre,text:Ore,textCaseSensitive:Nre,datetime:Are,basic:Ire},jre=[fre,xre,vre,yre,pre,hre,_re,Sre,{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:gu("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const s of n){const o=s?.getValue(e.id);if(Object.prototype.toString.call(o)==="[object Date]")return jw.datetime;if(typeof o=="string"&&(r=!0,o.split(pR).length>1))return jw.alphanumeric}return r?jw.text:jw.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof n?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return jS(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:jw[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const s=e.getNextSortingOrder(),o=typeof n<"u"&&n!==null;t.setSorting(i=>{const u=i?.find(E=>E.id===e.id),p=i?.findIndex(E=>E.id===e.id);let g=[],v,w=o?n:s==="desc";if(i!=null&&i.length&&e.getCanMultiSort()&&r?u?v="toggle":v="add":i!=null&&i.length&&p!==i.length-1?v="replace":u?v="toggle":v="replace",v==="toggle"&&(o||s||(v="remove")),v==="add"){var x;g=[...i,{id:e.id,desc:w}],g.splice(0,g.length-((x=t.options.maxMultiSortColCount)!=null?x:Number.MAX_SAFE_INTEGER))}else v==="toggle"?g=i.map(E=>E.id===e.id?{...E,desc:w}:E):v==="remove"?g=i.filter(E=>E.id!==e.id):g=[{id:e.id,desc:w}];return g})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,s;const o=e.getFirstSortDir(),i=e.getIsSorted();return i?i!==o&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(s=t.options.enableMultiRemove)!=null)||s)?!1:i==="desc"?"asc":"desc":o},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(s=>s.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(s=>s.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},mre,Cre,Ere,Tre,kre,bre];function Dre(e){var t,n;const r=[...jre,...(t=e._features)!=null?t:[]];let s={_features:r};const o=s._features.reduce((x,E)=>Object.assign(x,E.getDefaultOptions==null?void 0:E.getDefaultOptions(s)),{}),i=x=>s.options.mergeOptions?s.options.mergeOptions(o,x):{...o,...x};let p={...{},...(n=e.initialState)!=null?n:{}};s._features.forEach(x=>{var E;p=(E=x.getInitialState==null?void 0:x.getInitialState(p))!=null?E:p});const g=[];let v=!1;const w={_features:r,options:{...o,...e},initialState:p,_queue:x=>{g.push(x),v||(v=!0,Promise.resolve().then(()=>{for(;g.length;)g.shift()();v=!1}).catch(E=>setTimeout(()=>{throw E})))},reset:()=>{s.setState(s.initialState)},setOptions:x=>{const E=Pm(x,s.options);s.options=i(E)},getState:()=>s.options.state,setState:x=>{s.options.onStateChange==null||s.options.onStateChange(x)},_getRowId:(x,E,R)=>{var k;return(k=s.options.getRowId==null?void 0:s.options.getRowId(x,E,R))!=null?k:`${R?[R.id,E].join("."):E}`},getCoreRowModel:()=>(s._getCoreRowModel||(s._getCoreRowModel=s.options.getCoreRowModel(s)),s._getCoreRowModel()),getRowModel:()=>s.getPaginationRowModel(),getRow:(x,E)=>{let R=(E?s.getPrePaginationRowModel():s.getRowModel()).rowsById[x];if(!R&&(R=s.getCoreRowModel().rowsById[x],!R))throw new Error;return R},_getDefaultColumnDef:es(()=>[s.options.defaultColumn],x=>{var E;return x=(E=x)!=null?E:{},{header:R=>{const k=R.header.column.columnDef;return k.accessorKey?k.accessorKey:k.accessorFn?k.id:null},cell:R=>{var k,N;return(k=(N=R.renderValue())==null||N.toString==null?void 0:N.toString())!=null?k:null},...s._features.reduce((R,k)=>Object.assign(R,k.getDefaultColumnDef==null?void 0:k.getDefaultColumnDef()),{}),...x}},ts(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>s.options.columns,getAllColumns:es(()=>[s._getColumnDefs()],x=>{const E=function(R,k,N){return N===void 0&&(N=0),R.map(L=>{const D=dre(s,L,N,k),B=L;return D.columns=B.columns?E(B.columns,D,N+1):[],D})};return E(x)},ts(e,"debugColumns","getAllColumns")),getAllFlatColumns:es(()=>[s.getAllColumns()],x=>x.flatMap(E=>E.getFlatColumns()),ts(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:es(()=>[s.getAllFlatColumns()],x=>x.reduce((E,R)=>(E[R.id]=R,E),{}),ts(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:es(()=>[s.getAllColumns(),s._getOrderColumnsFn()],(x,E)=>{let R=x.flatMap(k=>k.getLeafColumns());return E(R)},ts(e,"debugColumns","getAllLeafColumns")),getColumn:x=>s._getAllFlatColumnsById()[x]};Object.assign(s,w);for(let x=0;x<s._features.length;x++){const E=s._features[x];E==null||E.createTable==null||E.createTable(s)}return s}function Mre(){return e=>es(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(s,o,i){o===void 0&&(o=0);const u=[];for(let g=0;g<s.length;g++){const v=MS(e,e._getRowId(s[g],g,i),s[g],g,o,void 0,i?.id);if(n.flatRows.push(v),n.rowsById[v.id]=v,u.push(v),e.options.getSubRows){var p;v.originalSubRows=e.options.getSubRows(s[g],g),(p=v.originalSubRows)!=null&&p.length&&(v.subRows=r(v.originalSubRows,o+1,v))}}return u};return n.rows=r(t),n},ts(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function dme(){return e=>es(()=>[e.getState().expanded,e.getPreExpandedRowModel(),e.options.paginateExpandedRows],(t,n,r)=>!n.rows.length||t!==!0&&!Object.keys(t??{}).length||!r?n:ZL(n),ts(e.options,"debugTable","getExpandedRowModel"))}function ZL(e){const t=[],n=r=>{var s;t.push(r),(s=r.subRows)!=null&&s.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function fme(){return(e,t)=>es(()=>{var n;return[(n=e.getColumn(t))==null?void 0:n.getFacetedRowModel()]},n=>{var r;if(!n)return;const s=(r=n.flatRows[0])==null?void 0:r.getUniqueValues(t);if(typeof s>"u")return;let o=[s,s];for(let i=0;i<n.flatRows.length;i++){const u=n.flatRows[i].getUniqueValues(t);for(let p=0;p<u.length;p++){const g=u[p];g<o[0]?o[0]=g:g>o[1]&&(o[1]=g)}}return o},ts(e.options,"debugTable","getFacetedMinMaxValues"))}function JL(e,t,n){return n.options.filterFromLeafRows?$re(e,t,n):Lre(e,t,n)}function $re(e,t,n){var r;const s=[],o={},i=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,u=function(p,g){g===void 0&&(g=0);const v=[];for(let x=0;x<p.length;x++){var w;let E=p[x];const R=MS(n,E.id,E.original,E.index,E.depth,void 0,E.parentId);if(R.columnFilters=E.columnFilters,(w=E.subRows)!=null&&w.length&&g<i){if(R.subRows=u(E.subRows,g+1),E=R,t(E)&&!R.subRows.length){v.push(E),o[E.id]=E,s.push(E);continue}if(t(E)||R.subRows.length){v.push(E),o[E.id]=E,s.push(E);continue}}else E=R,t(E)&&(v.push(E),o[E.id]=E,s.push(E))}return v};return{rows:u(e),flatRows:s,rowsById:o}}function Lre(e,t,n){var r;const s=[],o={},i=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,u=function(p,g){g===void 0&&(g=0);const v=[];for(let x=0;x<p.length;x++){let E=p[x];if(t(E)){var w;if((w=E.subRows)!=null&&w.length&&g<i){const k=MS(n,E.id,E.original,E.index,E.depth,void 0,E.parentId);k.subRows=u(E.subRows,g+1),E=k}v.push(E),s.push(E),o[E.id]=E}}return v};return{rows:u(e),flatRows:s,rowsById:o}}function pme(){return(e,t)=>es(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter,e.getFilteredRowModel()],(n,r,s)=>{if(!n.rows.length||!(r!=null&&r.length)&&!s)return n;const o=[...r.map(u=>u.id).filter(u=>u!==t),s?"__global__":void 0].filter(Boolean),i=u=>{for(let p=0;p<o.length;p++)if(u.columnFilters[o[p]]===!1)return!1;return!0};return JL(n.rows,i,e)},ts(e.options,"debugTable","getFacetedRowModel"))}function hme(){return(e,t)=>es(()=>{var n;return[(n=e.getColumn(t))==null?void 0:n.getFacetedRowModel()]},n=>{if(!n)return new Map;let r=new Map;for(let o=0;o<n.flatRows.length;o++){const i=n.flatRows[o].getUniqueValues(t);for(let u=0;u<i.length;u++){const p=i[u];if(r.has(p)){var s;r.set(p,((s=r.get(p))!=null?s:0)+1)}else r.set(p,1)}}return r},ts(e.options,"debugTable",`getFacetedUniqueValues_${t}`))}function Fre(){return e=>es(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let x=0;x<t.flatRows.length;x++)t.flatRows[x].columnFilters={},t.flatRows[x].columnFiltersMeta={};return t}const s=[],o=[];(n??[]).forEach(x=>{var E;const R=e.getColumn(x.id);if(!R)return;const k=R.getFilterFn();k&&s.push({id:x.id,filterFn:k,resolvedValue:(E=k.resolveFilterValue==null?void 0:k.resolveFilterValue(x.value))!=null?E:x.value})});const i=(n??[]).map(x=>x.id),u=e.getGlobalFilterFn(),p=e.getAllLeafColumns().filter(x=>x.getCanGlobalFilter());r&&u&&p.length&&(i.push("__global__"),p.forEach(x=>{var E;o.push({id:x.id,filterFn:u,resolvedValue:(E=u.resolveFilterValue==null?void 0:u.resolveFilterValue(r))!=null?E:r})}));let g,v;for(let x=0;x<t.flatRows.length;x++){const E=t.flatRows[x];if(E.columnFilters={},s.length)for(let R=0;R<s.length;R++){g=s[R];const k=g.id;E.columnFilters[k]=g.filterFn(E,k,g.resolvedValue,N=>{E.columnFiltersMeta[k]=N})}if(o.length){for(let R=0;R<o.length;R++){v=o[R];const k=v.id;if(v.filterFn(E,k,v.resolvedValue,N=>{E.columnFiltersMeta[k]=N})){E.columnFilters.__global__=!0;break}}E.columnFilters.__global__!==!0&&(E.columnFilters.__global__=!1)}}const w=x=>{for(let E=0;E<i.length;E++)if(x.columnFilters[i[E]]===!1)return!1;return!0};return JL(t.rows,w,e)},ts(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function mme(){return e=>es(()=>[e.getState().grouping,e.getPreGroupedRowModel()],(t,n)=>{if(!n.rows.length||!t.length)return n;const r=t.filter(p=>e.getColumn(p)),s=[],o={},i=function(p,g,v){if(g===void 0&&(g=0),g>=r.length)return p.map(R=>(R.depth=g,s.push(R),o[R.id]=R,R.subRows&&(R.subRows=i(R.subRows,g+1,R.id)),R));const w=r[g],x=zre(p,w);return Array.from(x.entries()).map((R,k)=>{let[N,L]=R,D=`${w}:${N}`;D=v?`${v}>${D}`:D;const B=i(L,g+1,D),Q=g?zL(L,ye=>ye.subRows):L,ce=MS(e,D,Q[0].original,k,g,void 0,v);return Object.assign(ce,{groupingColumnId:w,groupingValue:N,subRows:B,leafRows:Q,getValue:ye=>{if(r.includes(ye)){if(ce._valuesCache.hasOwnProperty(ye))return ce._valuesCache[ye];if(L[0]){var G;ce._valuesCache[ye]=(G=L[0].getValue(ye))!=null?G:void 0}return ce._valuesCache[ye]}if(ce._groupingValuesCache.hasOwnProperty(ye))return ce._groupingValuesCache[ye];const Le=e.getColumn(ye),We=Le?.getAggregationFn();if(We)return ce._groupingValuesCache[ye]=We(ye,Q,L),ce._groupingValuesCache[ye]}}),B.forEach(ye=>{s.push(ye),o[ye.id]=ye}),ce})},u=i(n.rows,0);return u.forEach(p=>{s.push(p),o[p.id]=p}),{rows:u,flatRows:s,rowsById:o}},ts(e.options,"debugTable","getGroupedRowModel",()=>{e._queue(()=>{e._autoResetExpanded(),e._autoResetPageIndex()})}))}function zre(e,t){const n=new Map;return e.reduce((r,s)=>{const o=`${s.getGroupingValue(t)}`,i=r.get(o);return i?i.push(s):r.set(o,[s]),r},n)}function Ure(e){return t=>es(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:s,pageIndex:o}=n;let{rows:i,flatRows:u,rowsById:p}=r;const g=s*o,v=g+s;i=i.slice(g,v);let w;t.options.paginateExpandedRows?w={rows:i,flatRows:u,rowsById:p}:w=ZL({rows:i,flatRows:u,rowsById:p}),w.flatRows=[];const x=E=>{w.flatRows.push(E),E.subRows.length&&E.subRows.forEach(x)};return w.rows.forEach(x),w},ts(t.options,"debugTable","getPaginationRowModel"))}function Bre(){return e=>es(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,s=[],o=r.filter(p=>{var g;return(g=e.getColumn(p.id))==null?void 0:g.getCanSort()}),i={};o.forEach(p=>{const g=e.getColumn(p.id);g&&(i[p.id]={sortUndefined:g.columnDef.sortUndefined,invertSorting:g.columnDef.invertSorting,sortingFn:g.getSortingFn()})});const u=p=>{const g=p.map(v=>({...v}));return g.sort((v,w)=>{for(let E=0;E<o.length;E+=1){var x;const R=o[E],k=i[R.id],N=k.sortUndefined,L=(x=R?.desc)!=null?x:!1;let D=0;if(N){const B=v.getValue(R.id),Q=w.getValue(R.id),ce=B===void 0,ye=Q===void 0;if(ce||ye){if(N==="first")return ce?-1:1;if(N==="last")return ce?1:-1;D=ce&&ye?0:ce?N:-N}}if(D===0&&(D=k.sortingFn(v,w,R.id)),D!==0)return L&&(D*=-1),k.invertSorting&&(D*=-1),D}return v.index-w.index}),g.forEach(v=>{var w;s.push(v),(w=v.subRows)!=null&&w.length&&(v.subRows=u(v.subRows))}),g};return{rows:u(n.rows),flatRows:s,rowsById:n.rowsById}},ts(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}const mR=(0,l.forwardRef)(({className:e,...t},n)=>(0,a.jsx)("div",{className:"w-full overflow-auto",children:(0,a.jsx)("table",{ref:n,className:st("w-full caption-bottom text-sm",e),...t})}));mR.displayName="Table";const e3=(0,l.forwardRef)(({className:e,...t},n)=>(0,a.jsx)("thead",{ref:n,className:st("[&_tr]:border-b",e),...t}));e3.displayName="TableHeader";const t3=(0,l.forwardRef)(({className:e,...t},n)=>(0,a.jsx)("tbody",{ref:n,className:st("[&_tr]:border-t [&_tr]:border-slate-200 dark:[&_tr]:border-slate-800",e),...t}));t3.displayName="TableBody";const Vre=(0,l.forwardRef)(({className:e,...t},n)=>(0,a.jsx)("tfoot",{ref:n,className:st("bg-primary font-medium text-primary-foreground",e),...t}));Vre.displayName="TableFooter";const FS=(0,l.forwardRef)(({className:e,...t},n)=>(0,a.jsx)("tr",{ref:n,className:st("first:border-none border-b border-slate-500 transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));FS.displayName="TableRow";const n3=(0,l.forwardRef)(({className:e,...t},n)=>(0,a.jsx)("th",{ref:n,className:st("first:rounded-l-lg last:rounded-r-lg h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));n3.displayName="TableHead";const gR=(0,l.forwardRef)(({className:e,...t},n)=>(0,a.jsx)("td",{ref:n,className:st("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));gR.displayName="TableCell";const Hre=(0,l.forwardRef)(({className:e,...t},n)=>(0,a.jsx)("caption",{ref:n,className:st("mt-4 text-sm text-muted-foreground",e),...t}));Hre.displayName="TableCaption";/**
   * react-table
   *
   * Copyright (c) TanStack
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE.md file in the root directory of this source tree.
   *
   * @license MIT
   */function r3(e,t){return e?Wre(e)?l.createElement(e,t):e:null}function Wre(e){return qre(e)||typeof e=="function"||Kre(e)}function qre(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function Kre(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Gre(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=l.useState(()=>({current:Dre(t)})),[r,s]=l.useState(()=>n.current.initialState);return n.current.setOptions(o=>({...o,...e,state:{...r,...e.state},onStateChange:i=>{s(i),e.onStateChange==null||e.onStateChange(i)}})),n.current}const Qre=(e,t="dataCell")=>t?{"data-testid":`${t}${Sd(e)}`}:{},P0=({children:e})=>(0,a.jsx)(t3,{children:e}),Yre=({table:e,dataTestId:t})=>(0,a.jsx)(a.Fragment,{children:e.getRowModel().rows.map(n=>(0,a.jsx)(FS,{className:"align-top dark:border-transparent dark:bg-transparent",children:n.getVisibleCells().map(r=>(0,a.jsx)(gR,{...Qre(r.column.id,t),className:st("px-8 py-5",r.column.columnDef.meta?.className,r.column.columnDef.meta?.cellClassName),children:r3(r.column.columnDef.cell,r.getContext())},r.id))},n.id))}),s3=({colSpanLength:e,emptyMessage:t,dataTestId:n})=>(0,a.jsx)(FS,{children:(0,a.jsx)(gR,{colSpan:e,className:"bg-transparent p-4 dark:bg-transparent dark:text-white",children:(0,a.jsx)(xy,{dataTestId:n,emptyMessage:t})})});P0.Content=Yre,P0.EmptyContent=s3;const o3=({children:e,className:t})=>(0,a.jsx)("div",{className:st("overflow-hidden dark:border-zinc-700 md:max-w-[calc(100vw-340px)]",t),children:e}),Qp=()=>{const{getParams:e,setSearchParams:t}=bi(),n=e("search"),r=Hu(n),s=(0,l.useCallback)(o=>{t("search",o)},[t]);return{search:n,hasValueChanged:r!==n,onSetSearchParams:s}},a3=({debounce:e=bE,onChange:t,filterableFields:n,filterPlaceholder:r,fieldDescription:s,children:o})=>{const{search:i,onSetSearchParams:u}=Qp(),p=g=>{u(g),t?.(g)};return(0,a.jsxs)("div",{className:"mb-8 flex items-center justify-between",children:[n?.length!==0?(0,a.jsxs)("div",{className:"relative flex w-full items-center md:mb-0 md:w-1/4 md:min-w-[275px]",children:[(0,a.jsx)(Xh,{className:"absolute left-3 h-5 w-5 text-gray-500 focus-within:text-gray-600","aria-hidden":"true"}),(0,a.jsx)(_w,{type:"text",className:"w-full rounded-lg border border-gray-300 py-2 pl-10 text-left text-sm font-normal leading-none text-gray-600 outline-none focus:border-blue-500 focus:ring-blue-500 focus-visible:outline-offset-0 focus-visible:outline-indigo-300 dark:border-none dark:border-slate-800 dark:bg-slate-950 dark:text-slate-200 dark:ring-1 dark:ring-zinc-700",placeholder:r,value:i,onChange:p,debounce:e,"data-testid":"inputFilterTable"}),(0,a.jsx)("div",{className:"justify-content absolute right-3 flex items-center",children:(0,a.jsx)($l,{tooltip:s,className:"ml-8",children:(0,a.jsx)(c0,{className:"h-4 w-4 text-gray-500 focus-within:text-gray-600","aria-hidden":"true"})})})]}):null,o]})};function Xre({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 15 12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9"}))}const Zre=l.forwardRef(Xre),Jre=e=>{const t=i=>{switch(i){case"asc":return(0,a.jsx)(xM,{className:"mx-2 inline-flex w-[17px]","data-testid":"sort-icon-up"});case"desc":return(0,a.jsx)(Gg,{className:"mx-2 inline-flex w-[17px]","data-testid":"sort-icon-down"});default:return(0,a.jsx)(Zre,{className:"mx-2 hidden w-[17px]","data-testid":"sort-icon-neutral"})}},n=e.column.getCanSort(),r=e.column.getIsSorted(),s=n?t(r):null,o=r3(e.column.columnDef.header,e.getContext());return(0,a.jsx)(n3,{className:st("px-8 py-4 text-sm font-semibold font-regular bg-slate-200 text-slate-900 dark:border-slate-800 dark:hover:bg-slate-950/50 dark:bg-slate-950 dark:text-slate-200 whitespace-nowrap",n&&"hover:bg-slate-200/50 hover:dark:text-slate-200 dark:hover:bg-slate-950/50 cursor-pointer",!!r&&"bg-slate-200/80",e.column.columnDef.meta?.className,e.column.columnDef.meta?.headerClassName),onClick:n?()=>e.column.toggleSorting(r==="asc"):void 0,style:{width:e.getSize()!==150?e.getSize():void 0},children:(0,a.jsxs)("div",{className:"relative",children:[o,(0,a.jsx)("span",{className:"absolute",children:n&&s})]})},e.id)},i3=({table:e})=>(0,a.jsx)(e3,{children:e.getHeaderGroups().map(t=>(0,a.jsx)(FS,{children:t.headers.map(n=>(0,a.jsx)(Jre,{...n},n.id))},t.id))});/**
   * match-sorter-utils
   *
   * Copyright (c) TanStack
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE.md file in the root directory of this source tree.
   *
   * @license MIT
   */const l3={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u1EA4:"A",\u1EAE:"A",\u1EB2:"A",\u1EB4:"A",\u1EB6:"A",\u00C6:"AE",\u1EA6:"A",\u1EB0:"A",\u0202:"A",\u00C7:"C",\u1E08:"C",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u1EBE:"E",\u1E16:"E",\u1EC0:"E",\u1E14:"E",\u1E1C:"E",\u0206:"E",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u1E2E:"I",\u020A:"I",\u00D0:"D",\u00D1:"N",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u1ED0:"O",\u1E4C:"O",\u1E52:"O",\u020E:"O",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00DD:"Y",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u1EA5:"a",\u1EAF:"a",\u1EB3:"a",\u1EB5:"a",\u1EB7:"a",\u00E6:"ae",\u1EA7:"a",\u1EB1:"a",\u0203:"a",\u00E7:"c",\u1E09:"c",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u1EBF:"e",\u1E17:"e",\u1EC1:"e",\u1E15:"e",\u1E1D:"e",\u0207:"e",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u1E2F:"i",\u020B:"i",\u00F0:"d",\u00F1:"n",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u1ED1:"o",\u1E4D:"o",\u1E53:"o",\u020F:"o",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00FD:"y",\u00FF:"y",\u0100:"A",\u0101:"a",\u0102:"A",\u0103:"a",\u0104:"A",\u0105:"a",\u0106:"C",\u0107:"c",\u0108:"C",\u0109:"c",\u010A:"C",\u010B:"c",\u010C:"C",\u010D:"c",C\u0306:"C",c\u0306:"c",\u010E:"D",\u010F:"d",\u0110:"D",\u0111:"d",\u0112:"E",\u0113:"e",\u0114:"E",\u0115:"e",\u0116:"E",\u0117:"e",\u0118:"E",\u0119:"e",\u011A:"E",\u011B:"e",\u011C:"G",\u01F4:"G",\u011D:"g",\u01F5:"g",\u011E:"G",\u011F:"g",\u0120:"G",\u0121:"g",\u0122:"G",\u0123:"g",\u0124:"H",\u0125:"h",\u0126:"H",\u0127:"h",\u1E2A:"H",\u1E2B:"h",\u0128:"I",\u0129:"i",\u012A:"I",\u012B:"i",\u012C:"I",\u012D:"i",\u012E:"I",\u012F:"i",\u0130:"I",\u0131:"i",\u0132:"IJ",\u0133:"ij",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u1E30:"K",\u1E31:"k",K\u0306:"K",k\u0306:"k",\u0139:"L",\u013A:"l",\u013B:"L",\u013C:"l",\u013D:"L",\u013E:"l",\u013F:"L",\u0140:"l",\u0141:"l",\u0142:"l",\u1E3E:"M",\u1E3F:"m",M\u0306:"M",m\u0306:"m",\u0143:"N",\u0144:"n",\u0145:"N",\u0146:"n",\u0147:"N",\u0148:"n",\u0149:"n",N\u0306:"N",n\u0306:"n",\u014C:"O",\u014D:"o",\u014E:"O",\u014F:"o",\u0150:"O",\u0151:"o",\u0152:"OE",\u0153:"oe",P\u0306:"P",p\u0306:"p",\u0154:"R",\u0155:"r",\u0156:"R",\u0157:"r",\u0158:"R",\u0159:"r",R\u0306:"R",r\u0306:"r",\u0212:"R",\u0213:"r",\u015A:"S",\u015B:"s",\u015C:"S",\u015D:"s",\u015E:"S",\u0218:"S",\u0219:"s",\u015F:"s",\u0160:"S",\u0161:"s",\u0162:"T",\u0163:"t",\u021B:"t",\u021A:"T",\u0164:"T",\u0165:"t",\u0166:"T",\u0167:"t",T\u0306:"T",t\u0306:"t",\u0168:"U",\u0169:"u",\u016A:"U",\u016B:"u",\u016C:"U",\u016D:"u",\u016E:"U",\u016F:"u",\u0170:"U",\u0171:"u",\u0172:"U",\u0173:"u",\u0216:"U",\u0217:"u",V\u0306:"V",v\u0306:"v",\u0174:"W",\u0175:"w",\u1E82:"W",\u1E83:"w",X\u0306:"X",x\u0306:"x",\u0176:"Y",\u0177:"y",\u0178:"Y",Y\u0306:"Y",y\u0306:"y",\u0179:"Z",\u017A:"z",\u017B:"Z",\u017C:"z",\u017D:"Z",\u017E:"z",\u017F:"s",\u0192:"f",\u01A0:"O",\u01A1:"o",\u01AF:"U",\u01B0:"u",\u01CD:"A",\u01CE:"a",\u01CF:"I",\u01D0:"i",\u01D1:"O",\u01D2:"o",\u01D3:"U",\u01D4:"u",\u01D5:"U",\u01D6:"u",\u01D7:"U",\u01D8:"u",\u01D9:"U",\u01DA:"u",\u01DB:"U",\u01DC:"u",\u1EE8:"U",\u1EE9:"u",\u1E78:"U",\u1E79:"u",\u01FA:"A",\u01FB:"a",\u01FC:"AE",\u01FD:"ae",\u01FE:"O",\u01FF:"o",\u00DE:"TH",\u00FE:"th",\u1E54:"P",\u1E55:"p",\u1E64:"S",\u1E65:"s",X\u0301:"X",x\u0301:"x",\u0403:"\u0413",\u0453:"\u0433",\u040C:"\u041A",\u045C:"\u043A",A\u030B:"A",a\u030B:"a",E\u030B:"E",e\u030B:"e",I\u030B:"I",i\u030B:"i",\u01F8:"N",\u01F9:"n",\u1ED2:"O",\u1ED3:"o",\u1E50:"O",\u1E51:"o",\u1EEA:"U",\u1EEB:"u",\u1E80:"W",\u1E81:"w",\u1EF2:"Y",\u1EF3:"y",\u0200:"A",\u0201:"a",\u0204:"E",\u0205:"e",\u0208:"I",\u0209:"i",\u020C:"O",\u020D:"o",\u0210:"R",\u0211:"r",\u0214:"U",\u0215:"u",B\u030C:"B",b\u030C:"b",\u010C\u0323:"C",\u010D\u0323:"c",\u00CA\u030C:"E",\u00EA\u030C:"e",F\u030C:"F",f\u030C:"f",\u01E6:"G",\u01E7:"g",\u021E:"H",\u021F:"h",J\u030C:"J",\u01F0:"j",\u01E8:"K",\u01E9:"k",M\u030C:"M",m\u030C:"m",P\u030C:"P",p\u030C:"p",Q\u030C:"Q",q\u030C:"q",\u0158\u0329:"R",\u0159\u0329:"r",\u1E66:"S",\u1E67:"s",V\u030C:"V",v\u030C:"v",W\u030C:"W",w\u030C:"w",X\u030C:"X",x\u030C:"x",Y\u030C:"Y",y\u030C:"y",A\u0327:"A",a\u0327:"a",B\u0327:"B",b\u0327:"b",\u1E10:"D",\u1E11:"d",\u0228:"E",\u0229:"e",\u0190\u0327:"E",\u025B\u0327:"e",\u1E28:"H",\u1E29:"h",I\u0327:"I",i\u0327:"i",\u0197\u0327:"I",\u0268\u0327:"i",M\u0327:"M",m\u0327:"m",O\u0327:"O",o\u0327:"o",Q\u0327:"Q",q\u0327:"q",U\u0327:"U",u\u0327:"u",X\u0327:"X",x\u0327:"x",Z\u0327:"Z",z\u0327:"z"},ese=Object.keys(l3).join("|"),tse=new RegExp(ese,"g");function nse(e){return e.replace(tse,t=>l3[t])}/**
 * @name match-sorter
 * @license MIT license.
 * @copyright (c) 2099 Kent C. Dodds
 * @author Kent C. Dodds <me@kentcdodds.com> (https://kentcdodds.com)
 */const wc={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0};function rse(e,t,n){var r;if(n=n||{},n.threshold=(r=n.threshold)!=null?r:wc.MATCHES,!n.accessors){const i=c3(e,t,n);return{rankedValue:e,rank:i,accessorIndex:-1,accessorThreshold:n.threshold,passed:i>=n.threshold}}const s=ise(e,n.accessors),o={rankedValue:e,rank:wc.NO_MATCH,accessorIndex:-1,accessorThreshold:n.threshold,passed:!1};for(let i=0;i<s.length;i++){const u=s[i];let p=c3(u.itemValue,t,n);const{minRanking:g,maxRanking:v,threshold:w=n.threshold}=u.attributes;p<g&&p>=wc.MATCHES?p=g:p>v&&(p=v),p=Math.min(p,v),p>=w&&p>o.rank&&(o.rank=p,o.passed=!0,o.accessorIndex=i,o.accessorThreshold=w,o.rankedValue=u.itemValue)}return o}function c3(e,t,n){return e=u3(e,n),t=u3(t,n),t.length>e.length?wc.NO_MATCH:e===t?wc.CASE_SENSITIVE_EQUAL:(e=e.toLowerCase(),t=t.toLowerCase(),e===t?wc.EQUAL:e.startsWith(t)?wc.STARTS_WITH:e.includes(` ${t}`)?wc.WORD_STARTS_WITH:e.includes(t)?wc.CONTAINS:t.length===1?wc.NO_MATCH:sse(e).includes(t)?wc.ACRONYM:ose(e,t))}function sse(e){let t="";return e.split(" ").forEach(r=>{r.split("-").forEach(o=>{t+=o.substr(0,1)})}),t}function ose(e,t){let n=0,r=0;function s(p,g,v){for(let w=v,x=g.length;w<x;w++)if(g[w]===p)return n+=1,w+1;return-1}function o(p){const g=1/p,v=n/t.length;return wc.MATCHES+v*g}const i=s(t[0],e,0);if(i<0)return wc.NO_MATCH;r=i;for(let p=1,g=t.length;p<g;p++){const v=t[p];if(r=s(v,e,r),!(r>-1))return wc.NO_MATCH}const u=r-i;return o(u)}function yme(e,t){return e.rank===t.rank?0:e.rank>t.rank?-1:1}function u3(e,t){let{keepDiacritics:n}=t;return e=`${e}`,n||(e=nse(e)),e}function ase(e,t){let n=t;typeof t=="object"&&(n=t.accessor);const r=n(e);return r==null?[]:Array.isArray(r)?r:[String(r)]}function ise(e,t){const n=[];for(let r=0,s=t.length;r<s;r++){const o=t[r],i=lse(o),u=ase(e,o);for(let p=0,g=u.length;p<g;p++)n.push({itemValue:u[p],attributes:i})}return n}const d3={maxRanking:1/0,minRanking:-1/0};function lse(e){return typeof e=="function"?d3:{...d3,...e}}const cse=({sorting:e,onSortBy:t})=>{const n=Hu(e),r=(0,l.useCallback)(s=>{const[o]=s;t?.({sortField:o?.id,sortAscending:!o?.desc})},[t]);return{previousSorting:n,onSortByServer:r}},f3=({data:e=[],columns:t,rowsPerPage:n=$b,filterableFields:r,onSortBy:s,...o})=>{const[i,u]=(0,l.useState)([]),p=Hu(i),[g,v]=(0,l.useState)(""),{onSortByServer:w}=cse({sorting:i,onSortBy:s}),x=(R,k,N,L)=>{if(!r?.includes(k))return!1;const D=rse(R.getValue(k),N,{threshold:wc.CONTAINS});return L({itemRank:D}),D.passed};return{table:Gre({data:e,columns:t,getCoreRowModel:Mre(),onSortingChange:u,onGlobalFilterChange:v,filterFns:{fuzzy:x},globalFilterFn:x,state:{sorting:i,globalFilter:g},initialState:{pagination:{pageSize:n}},defaultColumn:{minSize:64},...o}),setGlobalFilter:v,sorting:i,hasSortingChanged:!v0()(p,i),onSortByServer:w}};function use({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m18.75 4.5-7.5 7.5 7.5 7.5m-6-15L5.25 12l7.5 7.5"}))}const p3=l.forwardRef(use);function dse({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 19.5 8.25 12l7.5-7.5"}))}const h3=l.forwardRef(dse);function fse({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m5.25 4.5 7.5 7.5-7.5 7.5m6-15 7.5 7.5-7.5 7.5"}))}const m3=l.forwardRef(fse),pse=({table:e,rowsPerPageOptions:t})=>{const{t:n}=(0,z.Bd)();return(0,a.jsx)("div",{className:"flex items-center justify-end border-t border-slate-200 p-4 dark:border-slate-700 dark:bg-slate-900",children:(0,a.jsxs)("div",{className:"lg:space-x-8' flex grow items-center justify-end space-x-6",children:[t.length>1&&(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:n("core:dataTable.resultsPerPage")}),(0,a.jsxs)(h0,{value:`${e.getState().pagination.pageSize}`,onValueChange:r=>{e.setPageSize(Number(r))},children:[(0,a.jsx)(wm,{className:"h-8 w-[70px]",children:(0,a.jsx)(m0,{placeholder:e.getState().pagination.pageSize})}),(0,a.jsx)(xm,{side:"top",children:t.map(r=>(0,a.jsx)(_m,{value:`${r}`,children:r},r))})]})]}),(0,a.jsx)("div",{className:"flex w-[100px] items-center justify-start text-sm font-medium",children:n("core:dataTable.pagination",{currentPage:e.getState().pagination.pageIndex+1,totalPage:e.getPageCount()})}),(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsxs)(mn,{variant:"outline",className:"hidden h-8 w-8 p-0 text-gray-900 dark:bg-slate-950 lg:flex",onClick:()=>e.setPageIndex(0),disabled:!e.getCanPreviousPage(),children:[(0,a.jsx)("span",{className:"sr-only",children:n("core:dataTable.goToFirstPage")}),(0,a.jsx)(p3,{className:"h-4 w-4"})]}),(0,a.jsxs)(mn,{variant:"outline",className:"h-8 w-8 p-0 text-gray-900 dark:bg-slate-950",onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),children:[(0,a.jsx)("span",{className:"sr-only",children:n("core:dataTable.goToPreviousPage")}),(0,a.jsx)(h3,{className:"h-4 w-4"})]}),(0,a.jsxs)(mn,{variant:"outline",className:"h-8 w-8 p-0 text-gray-900 dark:bg-slate-950",onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),children:[(0,a.jsx)("span",{className:"sr-only",children:n("core:dataTable.goToNextPage")}),(0,a.jsx)(wS,{className:"h-4 w-4"})]}),(0,a.jsxs)(mn,{variant:"outline",className:"hidden h-8 w-8 p-0 text-gray-900 dark:bg-slate-950 lg:flex",onClick:()=>e.setPageIndex(e.getPageCount()-1),disabled:!e.getCanNextPage(),children:[(0,a.jsx)("span",{className:"sr-only",children:n("core:dataTable.goToLastPage")}),(0,a.jsx)(m3,{className:"h-4 w-4"})]})]})]})})},ky=({columns:e,data:t=[],filterableFields:n=[],rowsPerPage:r=$b,rowsPerPageOptions:s=OA,emptyMessage:o,filterPlaceholder:i,fieldDescription:u,className:p,optionalActions:g,dataTestId:v})=>{const w=Math.min(...s),{table:x,setGlobalFilter:E}=f3({data:t,columns:e,rowsPerPage:r,filterableFields:n,getPaginationRowModel:Ure(),getFilteredRowModel:Fre(),getSortedRowModel:Bre()});return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(a3,{filterableFields:n,onChange:E,filterPlaceholder:i,fieldDescription:u,children:g}),(0,a.jsxs)(o3,{className:p,children:[(0,a.jsxs)(mR,{children:[(0,a.jsx)(i3,{table:x}),(0,a.jsx)(P0,{children:x.getRowModel().rows?.length?(0,a.jsx)(P0.Content,{table:x,dataTestId:v}):(0,a.jsx)(P0.EmptyContent,{colSpanLength:e.length,emptyMessage:o,dataTestId:v})})]}),t.length>w&&(0,a.jsx)(pse,{table:x,rowsPerPageOptions:s})]})]})},Cme=({content:e,className:t=""})=>jsx("div",{className:t,children:e});function hse({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6.75a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5ZM12 12.75a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5ZM12 18.75a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5Z"}))}const zS=l.forwardRef(hse);var Kc=(e=>(e.Daily="Daily",e.Weekly="Weekly",e.Monthly="Monthly",e.Yearly="Yearly",e))(Kc||{}),Ry=(e=>(e.Annual="Annual",e.Biennial="Biennial",e.Triennial="Triennial",e.Monthly="Monthly",e))(Ry||{}),wl=(e=>(e.New="New",e.Processing="Processing",e.Active="Active",e.Suspended="Suspended",e.Inactive="Inactive",e.Failed="Failed",e.Pending="Pending",e.WaitingForApproval="WaitingForApproval",e))(wl||{}),Hl=(e=>(e.Completed="Completed",e.Pending="Pending",e.Failed="Failed",e.WaitingForApproval="WaitingForApproval",e.Rejected="Rejected",e))(Hl||{}),O0=(e=>(e.Approve="Approve",e.Reject="Reject",e))(O0||{});const g3=(e,t)=>e?.currency?{amount:e.amount*(t??0),currency:e.currency}:null,mse=e=>{const t=e.price?{currency:gse(e.price.currency),amount:e.price.amount}:null,n=Sse(e.lastPendingOrFailedOrder),r=_se(e?.status),s=vR(r,n);return{...e,commitmentType:wse(e?.commitmentType),billingCycle:xse(e?.billingCycle),orderApprovalSettings:e.orderApprovalSettings?{isOrderApprovalRequired:e.orderApprovalSettings?.isOrderApprovalRequired}:null,status:r,statusWithOrders:s,lastPendingOrFailedOrder:n,price:t,commitmentEndDate:e.commitmentEndDate?e.commitmentEndDate:null,renewalDate:e.renewalDate?e.renewalDate:null,total:g3(t,e.quantity)}},vR=(e,t)=>{if(e===wl.Active&&t){if(t.status===Hl.Failed&&t.error&&!t.error?.dismissed)return wl.Failed;if(t.status===Hl.Pending)return wl.Pending;if(t.status===Hl.WaitingForApproval)return wl.WaitingForApproval}return e??null},v3=e=>e?e.map(mse):[],gse=e=>{switch(e){case oe.Sj.Cad:return Uf.CAD;case oe.Sj.Usd:default:return Uf.USD}},vse=(e,t,n)=>e?t?[...e.map(r=>{if(r.id===t.subscriptionId){const s=v3(n??[]);return{...r,lastPendingOrFailedOrder:s?.[0]?.lastPendingOrFailedOrder}}return r})]:e:[],yse=(e,t)=>e?t?[...e.map(n=>{if(t.orderLines.some(r=>r.subscriptionId===n.id)){const r={...n.lastPendingOrFailedOrder,orderId:n.lastPendingOrFailedOrder?.orderId??"",quantity:n.lastPendingOrFailedOrder?.quantity??null,initialQuantity:n.quantity??0,createdAt:n.lastPendingOrFailedOrder?.createdAt??null,error:{dismissed:!0,content:n.lastPendingOrFailedOrder?.error?.content}},s=vR(n.status,r);return{...n,statusWithOrders:s,lastPendingOrFailedOrder:r}}return n})]:e:[],bse=(e,t)=>e?t?[...e.map(n=>{if(t.orderIds.some(r=>r===n.lastPendingOrFailedOrder?.orderId)){const r={...n.lastPendingOrFailedOrder,orderId:n.lastPendingOrFailedOrder?.orderId??"",quantity:n.lastPendingOrFailedOrder?.quantity??null,initialQuantity:n.quantity??0,createdAt:n.lastPendingOrFailedOrder?.createdAt??null,status:t.decision===oe.cX.Approve?Hl.Pending:Hl.Rejected,decisionNote:t.decisionNote??void 0,error:null},s=vR(n.status,r);return{...n,statusWithOrders:s,lastPendingOrFailedOrder:r}}return n})]:e:[],wse=e=>e?Ry[e]:null,xse=e=>e?Kc[e]:null,_se=e=>e?wl[e]:null,Sse=e=>e?{orderId:e.orderId??"",error:e.error?{content:e.error.content,dismissed:e.error.dismissed}:null,quantity:e.quantity,initialQuantity:e.initialQuantity,status:Hl[e.status]??e.status,createdAt:e.createdAt,decisionNote:e.decisionNote,humanReadableId:e.humanReadableId}:null,US=e=>({count:e?.count??0,isRecalculating:e?.isRecalculating??!0}),Cse={mutationFn:async e=>await OS.amendmentOrdersCreateOrder({command:{organizationId:e.organizationId,orderLines:[{subscriptionId:e.subscriptionId,quantity:e.quantity}]}})},Ese={mutationFn:async e=>await OS.amendmentOrdersDismissOrderError({command:{...e}})},Tse={mutationFn:async e=>await OS.amendmentOrdersProcessOrder({command:{...e}})},kse=()=>{const e=Io();return(0,js.I)({queryKey:OE.queryKey(e?.id),queryFn:async()=>await OE.queryFn(e?.id),enabled:!!e,initialData:()=>US(),select:t=>US(t),refetchInterval:(t,n)=>!t||t.isRecalculating?1e3:OE.staleTime})},BS=({reload:e=!1,...t}={})=>{const n=Io(),r=(0,V.jE)();return(0,Os.useInvalidateQuery)(am.queryKey(n?.id),e,r),(0,js.I)({queryKey:am.queryKey(n?.id),queryFn:async()=>await am.queryFn(n?.id),enabled:!!n,staleTime:am.staleTime,select:s=>v3(s)})},VS=(e,t={})=>{const n=BS(t),r=n?.data?.find(o=>o.id===e),s=n.isFetched&&!n.isLoading&&!r;return{...n,data:r,error:n.error??(s?new Error("not found"):void 0)}},Rse=e=>{const t=(0,V.jE)(),n=Ai(),r=(0,Vo.n)({mutationFn:async s=>await Cse.mutationFn(s),onSuccess:async(s,o)=>{t.setQueryData(am.queryKey(n),i=>vse(i,o,s))}});return{updateQuantity:async s=>{if(!e)throw new Error("Missing subscription id");const o=await r.mutateAsync({organizationId:n??"",quantity:s,subscriptionId:e});if(r.isError)throw r.error;return o},...r}},Pse=()=>{const e=(0,V.jE)(),t=Ai(),n=(0,Vo.n)({mutationFn:async r=>await Ese.mutationFn(r),onSuccess:async(r,s)=>{e.setQueryData(am.queryKey(t),o=>yse(o,s))}});return{dismissOrderError:async(r,s)=>{if(!s)throw new Error("Missing subscription id");if(!r)throw new Error("Missing order id");if(await n.mutateAsync({organizationId:t??"",orderLines:[{subscriptionId:s,orderId:r}]}),n.isError)throw n.error},...n}},Ose=()=>{const e=(0,V.jE)(),t=Ai(),n=(0,Vo.n)({mutationFn:async r=>await Tse.mutationFn(r),onSuccess:async(r,s)=>{e.setQueryData(am.queryKey(t),o=>bse(o,s))}});return{processOrder:async(r,s,o)=>{if(!s)throw new Error("Missing decision");if(!r)throw new Error("Missing order id");const i={decision:s===O0.Approve?oe.cX.Approve:oe.cX.Reject,orderIds:[r],organizationId:t??"",decisionNote:o};if(await n.mutateAsync(i),n.isError)throw n.error},...n}},Nse=()=>{const{t:e}=(0,z.Bd)();return t=>{switch(t){case Kc.Daily:return e("ssp:subscription.cycle.daily");case Kc.Weekly:return e("ssp:subscription.cycle.weekly");case Kc.Monthly:return e("ssp:subscription.cycle.monthly");case Kc.Yearly:return e("ssp:subscription.cycle.yearly")}}},Ase=()=>{const{t:e}=(0,z.Bd)();return t=>{switch(t){case Kc.Daily:return e("ssp:subscription.cycleBilling.daily");case Kc.Weekly:return e("ssp:subscription.cycleBilling.weekly");case Kc.Monthly:return e("ssp:subscription.cycleBilling.monthly");case Kc.Yearly:return e("ssp:subscription.cycleBilling.yearly")}}},Ise=()=>{const{t:e}=(0,z.Bd)();return t=>{switch(t){case Kc.Daily:return e("ssp:subscription.cycleBillingFull.daily");case Kc.Weekly:return e("ssp:subscription.cycleBillingFull.weekly");case Kc.Monthly:return e("ssp:subscription.cycleBillingFull.monthly");case Kc.Yearly:return e("ssp:subscription.cycleBillingFull.yearly")}}},y3=()=>{const{t:e}=(0,z.Bd)();return t=>{switch(t){case Ry.Annual:return e("ssp:subscription.commitmentRenewal.annual");case Ry.Biennial:return e("ssp:subscription.commitmentRenewal.biennial");case Ry.Triennial:return e("ssp:subscription.commitmentRenewal.triennial");case Ry.Monthly:return e("ssp:subscription.commitmentRenewal.monthly")}}},b3=()=>{const{t:e}=(0,z.Bd)();return(t,n)=>{switch(t){case wl.New:return(0,a.jsx)(to,{variant:wo.Success,children:e("ssp:subscription.status.new")});case wl.Active:return(0,a.jsx)(to,{variant:wo.Success,children:e("ssp:subscription.status.active")});case wl.Processing:return(0,a.jsx)(to,{variant:wo.Success,children:e("ssp:subscription.status.processing")});case wl.Pending:{const r=(0,a.jsx)(to,{variant:wo.Warning,children:e("ssp:subscription.status.pending")});return n?(0,a.jsx)($l,{"data-testid":"tooltip",tooltip:e("ssp:pages.subscriptions.list.pendingQuantity",{pendingQuantity:n?.quantity}),children:r}):r}case wl.WaitingForApproval:return(0,a.jsx)(to,{variant:wo.Warning,children:e("ssp:subscription.status.waitingForApproval")});case wl.Failed:{const r=(0,a.jsx)(to,{variant:wo.Danger,children:e("ssp:subscription.status.failed")});return n?(0,a.jsx)($l,{"data-testid":"tooltip",tooltip:e("ssp:pages.subscriptions.list.pendingQuantityError",{pendingQuantity:n?.quantity,error:n?.error?.content}),children:r}):r}case wl.Inactive:return(0,a.jsx)(to,{variant:wo.Default,children:e("ssp:subscription.status.inactive")});case wl.Suspended:return(0,a.jsx)(to,{variant:wo.Warning,children:e("ssp:subscription.status.suspended")});default:return null}}},jse=()=>{const{t:e}=(0,z.Bd)();return t=>{switch(t){case Hl.Failed:return(0,a.jsx)(to,{variant:wo.Danger,children:e("ssp:subscription.order.status.failed")});case Hl.Rejected:return(0,a.jsx)(to,{variant:wo.Danger,children:e("ssp:subscription.order.status.rejected")});case Hl.Pending:return(0,a.jsx)(to,{variant:wo.Warning,children:e("ssp:subscription.order.status.pending")});case Hl.WaitingForApproval:return(0,a.jsx)(to,{variant:wo.Warning,children:e("ssp:subscription.order.status.waitingForApproval")});default:return null}}},Dse=({order:e})=>{const{t}=(0,z.Bd)(),[n,r]=(0,l.useState)(!1),[s,o]=(0,l.useState)(!1),[i,u]=(0,l.useState)(null),{navigate:p}=Ni(),g=Dl(),v=e?.orderStatus===oe.Re.WaitingForApproval,w=e.orderType===oe.ZN.Amendment&&e.firstSubscriptionStatus!==wl.Inactive,x=Xk(),E=()=>{p(Sr.Order,{orderId:e.id})},R=L=>{u(L),r(!0),o(!1)},k=()=>{u(null),r(!1),o(!1)},N=(L,D)=>{x.mutate({orderIds:[e.id],organizationId:e.organizationId??"",decision:L,decisionNote:D})};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"flex gap-x-4",children:(0,a.jsxs)(S0,{open:s,onOpenChange:o,children:[(0,a.jsx)(C0,{asChild:!0,"data-testid":"dropdownViewOrderOptions",children:(0,a.jsx)(mn,{variant:"ghost",className:"h-8 w-8 p-0",children:(0,a.jsx)(zS,{className:"mr-0.5 w-6 text-gray-500 hover:bg-slate-50"})})}),(0,a.jsxs)(km,{align:"end",children:[(0,a.jsx)(Bl,{"data-testid":"dropdownItemViewDetail",onClick:E,children:t("rsp:pages.orders.list.actions.viewDetails")}),w&&(0,a.jsx)(Bl,{asChild:!0,children:(0,a.jsx)(vl,{isAbsolute:!0,"data-testid":"dropdownItemViewSubscription",to:g(Sr.Subscription,{subscriptionId:e?.firstSubscriptionId??"",SubscriptionStatus:e?.firstSubscriptionStatus??"",organizationUniqueName:e?.organizationUniqueName??""}),target:"_blank",children:t("rsp:pages.orders.list.actions.viewSubscription")})}),v&&(0,a.jsxs)(w_,{permission:oe.aX.OrderApproval,children:[(0,a.jsx)(Bl,{"data-testid":"dropdownItemApprove",onClick:()=>R(oe.cX.Approve),children:t("rsp:pages.orders.list.actions.approve")}),(0,a.jsx)(Bl,{"data-testid":"dropdownItemReject",onClick:()=>R(oe.cX.Reject),children:t("rsp:pages.orders.list.actions.reject")})]})]})]})}),v&&i&&(0,a.jsx)(Zk,{decision:i,order:e,cancelConfirmation:k,onSubmit:N,confirmationDialogOpened:n})]})},Mse=({order:e})=>{const{i18n:{language:t}}=(0,z.Bd)(),n=Md(t);return e.orderValue?(0,a.jsx)("div",{className:"whitespace-nowrap",children:n(e.orderValue)}):null},$se=e=>(0,a.jsx)(Mse,{order:e}),Lse=e=>(0,a.jsx)(Dse,{order:e}),Fse=e=>(0,a.jsx)("div",{className:"font-medium",children:e?.humanReadableId}),zse=e=>(0,a.jsx)(T0,{orderStatus:e.orderStatus}),Py={className:"align-top"},Use=()=>{const{t:e,i18n:{language:t}}=(0,z.Bd)(),n=bl(t,Kp.datetime),r=SL(),s=[{accessorKey:"humanReadableId",meta:{...Py},header:e("rsp:pages.orders.list.orderId"),cell:({row:o})=>Fse(o.original),minSize:100},{accessorKey:"organizationName",header:e("rsp:pages.orders.list.organizationName"),meta:{...Py},cell:({row:o})=>o.original.organizationName,minSize:280},{accessorKey:"createdOn",header:e("rsp:pages.orders.list.createdOn"),meta:{...Py},cell:({row:o})=>n(o.original.createdOn),minSize:150},{accessorKey:"orderValue",meta:{...Py},header:e("rsp:pages.orders.list.orderValue"),cell:({row:o})=>$se(o.original)},{accessorKey:"orderStatus",meta:{className:`${Py.className} text-center`},header:e("rsp:pages.orders.list.status"),cell:({row:o})=>zse(o.original),minSize:20},{id:"actions",meta:{...Py},cell:({row:o})=>Lse(o.original),minSize:20}];return(0,a.jsx)(xo,{padded:!0,children:(0,Os.isRequestLoading)(r)?(0,a.jsx)(Hp,{}):(0,a.jsx)(ky,{dataTestId:"tableOrders",columns:s,data:r?.data,filterableFields:["humanReadableId","organizationName"],filterPlaceholder:e("rsp:pages.orders.list.filterPlaceholder"),fieldDescription:e("rsp:pages.orders.list.searchFieldDescription")})})},yR="Collapsible",[Bse,w3]=va(yR),[Vse,bR]=Bse(yR),x3=(0,l.forwardRef)((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:o,onOpenChange:i,...u}=e,[p=!1,g]=si({prop:r,defaultProp:s,onChange:i});return(0,l.createElement)(Vse,{scope:n,disabled:o,contentId:ri(),open:p,onOpenToggle:(0,l.useCallback)(()=>g(v=>!v),[g])},(0,l.createElement)(zn.div,(0,Je.A)({"data-state":xR(p),"data-disabled":o?"":void 0},u,{ref:t})))}),_3="CollapsibleTrigger",S3=(0,l.forwardRef)((e,t)=>{const{__scopeCollapsible:n,...r}=e,s=bR(_3,n);return(0,l.createElement)(zn.button,(0,Je.A)({type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":xR(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled},r,{ref:t,onClick:gn(e.onClick,s.onOpenToggle)}))}),wR="CollapsibleContent",C3=(0,l.forwardRef)((e,t)=>{const{forceMount:n,...r}=e,s=bR(wR,e.__scopeCollapsible);return(0,l.createElement)(la,{present:n||s.open},({present:o})=>(0,l.createElement)(Hse,(0,Je.A)({},r,{ref:t,present:o})))}),Hse=(0,l.forwardRef)((e,t)=>{const{__scopeCollapsible:n,present:r,children:s,...o}=e,i=bR(wR,n),[u,p]=(0,l.useState)(r),g=(0,l.useRef)(null),v=Lr(t,g),w=(0,l.useRef)(0),x=w.current,E=(0,l.useRef)(0),R=E.current,k=i.open||u,N=(0,l.useRef)(k),L=(0,l.useRef)();return(0,l.useEffect)(()=>{const D=requestAnimationFrame(()=>N.current=!1);return()=>cancelAnimationFrame(D)},[]),ya(()=>{const D=g.current;if(D){L.current=L.current||{transitionDuration:D.style.transitionDuration,animationName:D.style.animationName},D.style.transitionDuration="0s",D.style.animationName="none";const B=D.getBoundingClientRect();w.current=B.height,E.current=B.width,N.current||(D.style.transitionDuration=L.current.transitionDuration,D.style.animationName=L.current.animationName),p(r)}},[i.open,r]),(0,l.createElement)(zn.div,(0,Je.A)({"data-state":xR(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!k},o,{ref:v,style:{["--radix-collapsible-content-height"]:x?`${x}px`:void 0,["--radix-collapsible-content-width"]:R?`${R}px`:void 0,...e.style}}),k&&s)});function xR(e){return e?"open":"closed"}const Wse=x3,qse=S3,Kse=C3,Yp="Accordion",Gse=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[_R,Qse,Yse]=Vb(Yp),[HS,kme]=va(Yp,[Yse,w3]),SR=w3(),CR=l.forwardRef((e,t)=>{const{type:n,...r}=e,s=r,o=r;return l.createElement(_R.Provider,{scope:e.__scopeAccordion},n==="multiple"?l.createElement(eoe,(0,Je.A)({},o,{ref:t})):l.createElement(Jse,(0,Je.A)({},s,{ref:t})))});CR.propTypes={type(e){const t=e.value||e.defaultValue;return e.type&&!["single","multiple"].includes(e.type)?new Error("Invalid prop `type` supplied to `Accordion`. Expected one of `single | multiple`."):e.type==="multiple"&&typeof t=="string"?new Error("Invalid prop `type` supplied to `Accordion`. Expected `single` when `defaultValue` or `value` is type `string`."):e.type==="single"&&Array.isArray(t)?new Error("Invalid prop `type` supplied to `Accordion`. Expected `multiple` when `defaultValue` or `value` is type `string[]`."):null}};const[E3,Xse]=HS(Yp),[T3,Zse]=HS(Yp,{collapsible:!1}),Jse=l.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},collapsible:o=!1,...i}=e,[u,p]=si({prop:n,defaultProp:r,onChange:s});return l.createElement(E3,{scope:e.__scopeAccordion,value:u?[u]:[],onItemOpen:p,onItemClose:l.useCallback(()=>o&&p(""),[o,p])},l.createElement(T3,{scope:e.__scopeAccordion,collapsible:o},l.createElement(k3,(0,Je.A)({},i,{ref:t}))))}),eoe=l.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...o}=e,[i=[],u]=si({prop:n,defaultProp:r,onChange:s}),p=l.useCallback(v=>u((w=[])=>[...w,v]),[u]),g=l.useCallback(v=>u((w=[])=>w.filter(x=>x!==v)),[u]);return l.createElement(E3,{scope:e.__scopeAccordion,value:i,onItemOpen:p,onItemClose:g},l.createElement(T3,{scope:e.__scopeAccordion,collapsible:!0},l.createElement(k3,(0,Je.A)({},o,{ref:t}))))}),[toe,WS]=HS(Yp),k3=l.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:s,orientation:o="vertical",...i}=e,u=l.useRef(null),p=Lr(u,t),g=Qse(n),w=lm(s)==="ltr",x=gn(e.onKeyDown,E=>{var R;if(!Gse.includes(E.key))return;const k=E.target,N=g().filter(We=>{var at;return!((at=We.ref.current)!==null&&at!==void 0&&at.disabled)}),L=N.findIndex(We=>We.ref.current===k),D=N.length;if(L===-1)return;E.preventDefault();let B=L;const Q=0,ce=D-1,ye=()=>{B=L+1,B>ce&&(B=Q)},G=()=>{B=L-1,B<Q&&(B=ce)};switch(E.key){case"Home":B=Q;break;case"End":B=ce;break;case"ArrowRight":o==="horizontal"&&(w?ye():G());break;case"ArrowDown":o==="vertical"&&ye();break;case"ArrowLeft":o==="horizontal"&&(w?G():ye());break;case"ArrowUp":o==="vertical"&&G();break}const Le=B%D;(R=N[Le].ref.current)===null||R===void 0||R.focus()});return l.createElement(toe,{scope:n,disabled:r,direction:s,orientation:o},l.createElement(_R.Slot,{scope:n},l.createElement(zn.div,(0,Je.A)({},i,{"data-orientation":o,ref:p,onKeyDown:r?void 0:x}))))}),qS="AccordionItem",[noe,ER]=HS(qS),R3=l.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...s}=e,o=WS(qS,n),i=Xse(qS,n),u=SR(n),p=ri(),g=r&&i.value.includes(r)||!1,v=o.disabled||e.disabled;return l.createElement(noe,{scope:n,open:g,disabled:v,triggerId:p},l.createElement(Wse,(0,Je.A)({"data-orientation":o.orientation,"data-state":j3(g)},u,s,{ref:t,disabled:v,open:g,onOpenChange:w=>{w?i.onItemOpen(r):i.onItemClose(r)}})))}),P3="AccordionHeader",O3=l.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=WS(Yp,n),o=ER(P3,n);return l.createElement(zn.h3,(0,Je.A)({"data-orientation":s.orientation,"data-state":j3(o.open),"data-disabled":o.disabled?"":void 0},r,{ref:t}))}),TR="AccordionTrigger",N3=l.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=WS(Yp,n),o=ER(TR,n),i=Zse(TR,n),u=SR(n);return l.createElement(_R.ItemSlot,{scope:n},l.createElement(qse,(0,Je.A)({"aria-disabled":o.open&&!i.collapsible||void 0,"data-orientation":s.orientation,id:o.triggerId},u,r,{ref:t})))}),A3="AccordionContent",I3=l.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=WS(Yp,n),o=ER(A3,n),i=SR(n);return l.createElement(Kse,(0,Je.A)({role:"region","aria-labelledby":o.triggerId,"data-orientation":s.orientation},i,r,{ref:t,style:{["--radix-accordion-content-height"]:"var(--radix-collapsible-content-height)",["--radix-accordion-content-width"]:"var(--radix-collapsible-content-width)",...e.style}}))});function j3(e){return e?"open":"closed"}const roe=CR,soe=R3,ooe=O3,D3=N3,M3=I3,N0=({children:e})=>(0,a.jsx)("div",{className:"flex flex-col divide-y rounded-b-xl bg-white pb-2 dark:divide-slate-800 dark:bg-slate-950",children:e}),Js=({label:e,value:t,dataTestId:n,className:r,labelClassName:s})=>(0,a.jsxs)("div",{className:st("flex min-h-12 items-center justify-between px-4 py-2.5 text-sm dark:bg-slate-950",r),children:[(0,a.jsx)("div",{className:s,children:e}),(0,a.jsx)("div",{"data-testid":n,children:t})]}),Nm=roe,Xp=l.forwardRef(({className:e,...t},n)=>(0,a.jsx)(soe,{ref:n,className:st("",e),...t}));Xp.displayName="AccordionItem";const Zp=l.forwardRef(({className:e,children:t,...n},r)=>(0,a.jsx)(ooe,{className:"flex",children:(0,a.jsx)(D3,{ref:r,className:st("flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all [&[data-state=open]>div>svg]:rotate-180 dark:bg-slate-950",e),...n,children:(0,a.jsxs)("div",{className:"flex flex-row items-center gap-2 text-left",children:[(0,a.jsx)(Gg,{"data-testid":"accordionArrowIcon",className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200"}),t]})})}));Zp.displayName=D3.displayName;const Jp=l.forwardRef(({className:e,children:t,...n},r)=>(0,a.jsx)(M3,{ref:r,className:st("overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",e),...n,children:(0,a.jsx)("div",{className:"pb-4 pt-0",children:t})}));Jp.displayName=M3.displayName;const Oy=({className:e,children:t,...n})=>(0,a.jsx)("div",{className:st("block mr-0 sm:absolute right-0 sm:mr-4 text-sm text-gray-500 dark:text-slate-300",e),...n,children:t}),aoe=({filteredText:e,debounce:t=bE,setFilteredText:n,placeholder:r,dataTestId:s})=>(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(Xh,{className:"absolute left-3 h-5 w-5 text-gray-500 focus-within:text-gray-600","aria-hidden":"true"}),(0,a.jsx)(_w,{className:"w-full rounded-lg border border-gray-300 py-2 pl-10 text-left text-sm font-normal leading-none text-gray-600 outline-none focus:border-blue-500 focus:ring-blue-500 dark:border-none dark:border-slate-800 dark:bg-slate-950 dark:text-slate-200 dark:ring-1 dark:ring-zinc-700",type:"text",debounce:t,value:e,"data-testid":s??"inputFilterTableMobile",placeholder:r,onChange:o=>{n(o)}})]}),vu=({children:e})=>(0,a.jsx)("div",{className:"relative mb-4 flex w-full items-center gap-x-4",children:e});vu.Input=aoe;function ioe({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5m6 4.125 2.25 2.25m0 0 2.25 2.25M12 13.875l2.25-2.25M12 13.875l-2.25 2.25M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125Z"}))}const Ny=l.forwardRef(ioe),kR=({children:e,dataTestId:t})=>(0,a.jsxs)("div",{className:"flex w-full flex-col items-center justify-center gap-4 rounded-lg border-2 border-dashed border-gray-300 p-8 font-normal text-gray-400 md:h-60","data-testid":t??"containerNoResultsMobile",children:[(0,a.jsx)(Ny,{className:"h-16 w-16 stroke-1 text-gray-400","data-testid":"archiveIcon"}),(0,a.jsx)("p",{children:e})]});function loe({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"}),l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))}const KS=l.forwardRef(loe);function coe({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 9V5.25A2.25 2.25 0 0 0 13.5 3h-6a2.25 2.25 0 0 0-2.25 2.25v13.5A2.25 2.25 0 0 0 7.5 21h6a2.25 2.25 0 0 0 2.25-2.25V15m3 0 3-3m0 0-3-3m3 3H9"}))}const uoe=l.forwardRef(coe),doe=({order:e,className:t})=>{const[n,r]=(0,l.useState)(!1),[s,o]=(0,l.useState)(null),i=Xk(),u=Dl(),p=e?.orderStatus===oe.Re.WaitingForApproval,g=e?.firstSubscriptionId!==PA&&e?.firstSubscriptionStatus!==wl.Inactive&&e?.organizationUniqueName,v=e.orderType===oe.ZN.Amendment&&e.firstSubscriptionStatus!==wl.Inactive,{t:w}=(0,z.Bd)(),x=N=>{o(N),r(!0)},E=()=>{o(null),r(!1)},R=()=>{if(g){const N=u(Sr.Subscription,{subscriptionId:e?.firstSubscriptionId??"",subscriptionStatus:e?.firstSubscriptionStatus??"",organizationUniqueName:e?.organizationUniqueName??""});window.open(N,"_blank")}},k=(N,L)=>{i.mutate({orderIds:[e?.id],organizationId:e?.organizationId??"",decision:N??void 0,decisionNote:L})};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:st("flex flex-row gap-4",t),"data-testid":"divOrderActions",children:[(0,a.jsx)(mn,{asChild:!0,variant:No.Outline,size:"sm","data-testid":"btnOrderViewDetail",children:(0,a.jsxs)(vl,{to:Sr.Order,params:{orderId:e.id},children:[(0,a.jsx)(KS,{className:"mr-1 h-5 w-5  hover:bg-slate-50"}),w("rsp:pages.orders.list.actions.viewDetailsMobile")]})}),v&&(0,a.jsxs)(mn,{variant:No.Primary,size:"sm",onClick:R,"data-testid":"btnViewSubscription",children:[(0,a.jsx)(uoe,{className:"mr-1 h-5 w-5 stroke-2"}),w("rsp:pages.orders.list.actions.viewSubscriptionMobile")]}),p&&(0,a.jsxs)(w_,{permission:oe.aX.OrderApproval,children:[(0,a.jsxs)(mn,{variant:No.Success,size:"sm",onClick:()=>x(oe.cX.Approve),"data-testid":"btnApprove",children:[(0,a.jsx)(Gv,{className:"mr-1 h-5 w-5  stroke-2"})," ",w("rsp:pages.orders.list.actions.approve")]}),(0,a.jsxs)(mn,{variant:No.Danger,size:"sm",onClick:()=>x(oe.cX.Reject),"data-testid":"btnReject",children:[(0,a.jsx)(su,{className:"mr-1 h-5 w-5 stroke-2"}),w("rsp:pages.orders.list.actions.reject")]})]})]}),p&&s&&(0,a.jsx)(w_,{permission:oe.aX.OrderApproval,children:(0,a.jsx)(Zk,{decision:s,cancelConfirmation:E,onSubmit:k,order:e,confirmationDialogOpened:n})})]})},foe=()=>{const{t:e,i18n:{language:t}}=(0,z.Bd)(),n=bl(t,Kp.datetime),r=SL(),s=Md(t),{search:o,onSetSearchParams:i}=Qp(),u=r?.data?.filter(g=>(g.humanReadableId??"")?.toLowerCase().includes(o.toLowerCase())||g.organizationName?.toLowerCase().includes(o.toLowerCase())),p=()=>u?.length===0?(0,a.jsx)(kR,{children:e("rsp:pages.orders.noOrders")}):u?.map(g=>(0,a.jsx)(Nm,{type:"single",collapsible:!0,children:(0,a.jsxs)(Xp,{value:g.id,children:[(0,a.jsxs)(Zp,{className:"relative justify-between rounded-xl bg-white p-4 [&[data-state=open]>div>div]:hidden [&[data-state=open]]:rounded-b-none",children:[g.organizationName," - ",g.humanReadableId,(0,a.jsx)(Oy,{children:(0,a.jsx)(T0,{orderStatus:g?.orderStatus})})]}),(0,a.jsx)(Jp,{children:(0,a.jsxs)(N0,{children:[(0,a.jsx)(Js,{label:e("rsp:pages.orders.list.organizationName"),value:g?.organizationName}),(0,a.jsx)(Js,{label:e("rsp:pages.orders.list.createdOn"),value:n(g?.createdOn)}),(0,a.jsx)(Js,{label:e("rsp:pages.orders.list.orderValue"),value:g.orderValue?s(g.orderValue):null}),(0,a.jsx)(Js,{label:e("rsp:pages.orders.list.status"),value:(0,a.jsx)(T0,{orderStatus:g.orderStatus})}),(0,a.jsx)(Js,{className:"justify-end",labelClassName:"flex flex-wrap",label:(0,a.jsx)(doe,{order:g,className:"flex flex-wrap"})})]})})]})},g.id));return(0,a.jsx)(xo,{padded:!0,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(vu,{children:(0,a.jsx)(vu.Input,{placeholder:e("rsp:pages.orders.list.filterPlaceholder"),filteredText:o,setFilteredText:i})}),(0,Os.isRequestLoading)(r)?(0,a.jsx)(Hp,{}):p()]})})},poe=Ll(()=>{const{t:e}=(0,z.Bd)();return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(Wu,{children:(0,a.jsxs)("div",{className:"flex flex-col gap-12 md:gap-16",children:[(0,a.jsx)(yl,{title:(0,a.jsx)(el,{"data-testid":"pageOrdersTitle",children:e("rsp:pages.orders.title")})}),(0,a.jsx)("div",{className:"hidden lg:block",children:(0,a.jsx)(Use,{})}),(0,a.jsx)("div",{className:"mt-4 lg:hidden",children:(0,a.jsx)(foe,{})})]})}),(0,a.jsx)(Ta,{})]})});function hoe({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 6H5.25A2.25 2.25 0 0 0 3 8.25v10.5A2.25 2.25 0 0 0 5.25 21h10.5A2.25 2.25 0 0 0 18 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"}))}const $3=l.forwardRef(hoe);class L3{static setOrganizationSettings(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/organizations/{organizationId}/settings";o=o.replace("{organizationId}",t.organizationId+"");const i=(0,oe.Y_)("post","application/json",o,n);let u=t.command;i.data=u,(0,oe.pY)(i,r,s)})}static resetOrganizationSettings(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/organizations/{organizationId}/settings/reset";o=o.replace("{organizationId}",t.organizationId+"");const i=(0,oe.Y_)("post","application/json",o,n);let u=null;i.data=u,(0,oe.pY)(i,r,s)})}}class moe{static refreshResellerCache(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/resellers/{resellerId}/cache/refresh";o=o.replace("{resellerId}",t.resellerId+"");const i=(0,oe.Y_)("post","application/json",o,n);let u=null;i.data=u,(0,oe.pY)(i,r,s)})}}const goe=e=>e?{...e,isPriceVisible:e?.settings?.isPriceVisible,isOrderApprovalRequired:e?.settings?.isOrderApprovalRequired,showUsers:e?.settings?.showUsers,showHelpDesk:e?.settings?.showHelpDesk,showLicenses:e?.settings?.showLicenses,showSubscriptions:e?.settings?.showSubscriptions,allowSubscriptionCancellation:e?.settings?.allowSubscriptionCancellation,orgAdminCanCreateUsers:e?.settings?.orgAdminCanCreateUsers,showBilling:e?.settings?.showBilling}:{organizationId:"",organizationName:"",userCount:0,isSuspended:!1,isPriceVisible:!1,isOrderApprovalRequired:!1,showUsers:!1,showHelpDesk:!1,showLicenses:!1,showSubscriptions:!1,allowSubscriptionCancellation:!1,orgAdminCanCreateUsers:!1,showBilling:!1},F3=e=>({page:1,pageSize:$b,searchTerm:"",...e}),RR=e=>F3({sort:{field:oe.CD.None,ascending:!0},...e}),voe=()=>({allowSubscriptionCancellation:!1,isOrderApprovalRequired:!1,isPriceVisible:!1,orgAdminCanCreateUsers:!1,showBilling:!1,showHelpDesk:!1,showLicenses:!1,showSubscriptions:!1,showUsers:!1});class yoe{static getOrganizationDetail(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/organizations/{organizationId}/detail";o=o.replace("{organizationId}",t.organizationId+"");const i=(0,oe.Y_)("get","application/json",o,n);(0,oe.pY)(i,r,s)})}}const Dw="ResellerOrganizationsService/queryDetailedOrganizations",z3=async(e,t)=>!e||!t?.sort?.field||t?.sort?.ascending===void 0?await(0,oo.Ui)():await O2.queryDetailedOrganizations({resellerId:e,detailedOrganizationsQuery:t}),PR={queryKey:(e,t)=>[Dw,e,t],queryFn:z3,staleTime:Aa},OR={queryKey:(e,t)=>[Dw,"infiniteScroll",e,t],queryFn:z3,staleTime:Aa},Mw={queryKey:e=>["OrganizationsService/getOrganizationDetail",e],queryFn:async e=>e?await yoe.getOrganizationDetail({organizationId:e}):await(0,oo.Ui)(),staleTime:Aa},boe=(e=RR())=>{const{isLoggedIn:t}=(0,zr.m)(),n=zv();return(0,js.I)({queryKey:PR.queryKey(n,e),keepPreviousData:!0,queryFn:async()=>await PR.queryFn(n,e),enabled:t&&!!n,staleTime:PR.staleTime})},woe=e=>{const{isLoggedIn:t}=(0,zr.m)(),n=zv();return(0,VT.q)({queryKey:OR.queryKey(n,e),queryFn:async({pageParam:r=1})=>await OR.queryFn(n,{...e,page:r}),enabled:t&&!!n,staleTime:OR.staleTime,getNextPageParam:r=>r?.hasNextPage?r?.pageIndex+1:null})},xoe=e=>{const{isLoggedIn:t}=(0,zr.m)();return(0,js.I)({queryKey:Mw.queryKey(e),queryFn:async()=>await Mw.queryFn(e),enabled:t&&!!e,select:n=>goe(n),staleTime:Mw.staleTime})},U3=()=>{const{t:e}=(0,z.Bd)(),t=zv(),n=(0,V.jE)();return(0,Vo.n)({mutationFn:async()=>{if(!t)throw(0,oo.XY)();return await moe.refreshResellerCache({resellerId:t})},onSuccess:async()=>{await n.invalidateQueries({queryKey:[Dw]}),(0,Yr.v0)(e("rsp:pages.organizations.refresh.successMessage"))},onError:()=>{(0,Yr.A2)(e("rsp:pages.organizations.refresh.failureMessage"))}})},_oe=e=>{const{t}=(0,z.Bd)(),n=(0,V.jE)();return(0,Vo.n)({mutationFn:async r=>{if(!e||!r.command)throw(0,oo.XY)();return await L3.setOrganizationSettings({organizationId:e,...r})},onSuccess:async()=>{(0,Yr.v0)(t("rsp:pages.settings.labels.changesApplied")),await n.invalidateQueries({queryKey:Mw.queryKey(e)}),await n.invalidateQueries({queryKey:[Dw]})}})},B3=e=>{const{t}=(0,z.Bd)(),n=(0,V.jE)();return(0,Vo.n)({mutationFn:async()=>{if(!e)throw(0,oo.XY)();return await L3.resetOrganizationSettings({organizationId:e})},onSuccess:async()=>{(0,Yr.v0)(t("rsp:pages.settings.labels.changesApplied")),await n.invalidateQueries({queryKey:Mw.queryKey(e)}),await n.invalidateQueries({queryKey:[Dw]})}})},NR=l.forwardRef(({organizationUniqueName:e="",children:t,className:n,dataTestId:r},s)=>{const o=Dl();return(0,a.jsx)(vl,{isAbsolute:!0,to:o(Un.Dashboard,{organizationUniqueName:e}),target:"_blank",className:n,"data-testid":r,children:t})}),AR=()=>{const{t:e}=(0,z.Bd)();return t=>t?(0,a.jsx)(to,{variant:wo.Warning,className:"ml-4",children:e("rsp:pages.organizations.list.statuses.suspended")}):(0,a.jsx)(to,{variant:wo.Success,className:"ml-4",children:e("rsp:pages.organizations.list.statuses.active")})},V3=()=>{const{t:e}=(0,z.Bd)();return t=>t?(0,a.jsx)("div",{children:e("rsp:pages.organizations.list.settingsTypes.default")}):(0,a.jsx)("div",{children:e("rsp:pages.organizations.list.settingsTypes.custom")})},Soe=()=>{const{t:e}=(0,z.Bd)(),t=xa(),r=k_({staleTime:0,refetchOnMount:!0}).data?.helpDesk?.find(s=>s.integrationType===oe.pq.ConnectWise)?.configured??!1;return(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-y-2",children:[(0,a.jsx)(Pn,{variant:"heading6",weight:"bold",children:e("rsp:pages.organizations.detail.portalFeatures.title")}),(0,a.jsx)(Vu,{className:"bg-slate-300 dark:bg-slate-700"}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)(Pn,{variant:"body2",weight:"default",children:e("rsp:pages.organizations.detail.portalFeatures.toggles.userManagement")}),(0,a.jsx)(Jr,{control:t.control,name:"showUsers",render:({field:s})=>(0,a.jsx)(qr,{children:(0,a.jsx)(Kr,{children:(0,a.jsx)(ci,{checked:s.value,onCheckedChange:s.onChange,"data-testid":"switchShowUsers"})})})})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)(Pn,{variant:"body2",weight:"default",children:e("rsp:pages.organizations.detail.portalFeatures.toggles.subscriptionManagement")}),(0,a.jsx)(Jr,{control:t.control,name:"showSubscriptions",render:({field:s})=>(0,a.jsx)(qr,{children:(0,a.jsx)(Kr,{children:(0,a.jsx)(ci,{checked:s.value,onCheckedChange:s.onChange,"data-testid":"switchShowSubscriptions"})})})})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)(Pn,{variant:"body2",weight:"default",children:e("rsp:pages.organizations.detail.portalFeatures.toggles.licenseManagement")}),(0,a.jsx)(Jr,{control:t.control,name:"showLicenses",render:({field:s})=>(0,a.jsx)(qr,{children:(0,a.jsx)(Kr,{children:(0,a.jsx)(ci,{checked:s.value,onCheckedChange:s.onChange,"data-testid":"switchShowLicenses"})})})})]}),r?(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)(Pn,{variant:"body2",weight:"default",children:e("rsp:pages.organizations.detail.portalFeatures.toggles.helpDeskManagement")}),(0,a.jsx)(Jr,{control:t.control,name:"showHelpDesk",render:({field:s})=>(0,a.jsx)(qr,{children:(0,a.jsx)(Kr,{children:(0,a.jsx)(ci,{checked:s.value,onCheckedChange:s.onChange})})})})]}):null]})},Coe=()=>{const{t:e}=(0,z.Bd)(),t=xa();return(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-y-2",children:[(0,a.jsx)(Pn,{variant:"heading6",weight:"bold",children:e("rsp:pages.organizations.detail.subscriptionFeatures.title")}),(0,a.jsx)(Vu,{className:"bg-slate-300 dark:bg-slate-700"}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)(Pn,{variant:"body2",weight:"default",children:e("rsp:pages.organizations.detail.subscriptionFeatures.toggles.orderApproval")}),(0,a.jsx)(Jr,{control:t.control,name:"isOrderApprovalRequired",render:({field:n})=>(0,a.jsx)(qr,{children:(0,a.jsx)(Kr,{children:(0,a.jsx)(ci,{checked:n.value,onCheckedChange:n.onChange,"data-testid":"switchIsOrderApprovalRequired"})})})})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)(Pn,{variant:"body2",weight:"default",children:e("rsp:pages.organizations.detail.subscriptionFeatures.toggles.displayPrices")}),(0,a.jsx)(Jr,{control:t.control,name:"isPriceVisible",render:({field:n})=>(0,a.jsx)(qr,{children:(0,a.jsx)(Kr,{children:(0,a.jsx)(ci,{checked:n.value,onCheckedChange:n.onChange,"data-testid":"switchIsPriceVisible"})})})})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)(Pn,{variant:"body2",weight:"default",children:e("rsp:pages.organizations.detail.subscriptionFeatures.toggles.allowSubscriptionCancellation")}),(0,a.jsx)(Jr,{control:t.control,name:"allowSubscriptionCancellation",render:({field:n})=>(0,a.jsx)(qr,{children:(0,a.jsx)(Kr,{children:(0,a.jsx)(ci,{checked:n.value,onCheckedChange:n.onChange,"data-testid":"switchAllowSubscriptionCancellation"})})})})]})]})},Eoe=()=>{const{t:e}=(0,z.Bd)(),t=xa();return(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-y-2",children:[(0,a.jsx)(Pn,{variant:"heading6",weight:"bold",children:e("rsp:pages.organizations.detail.userSettings.title")}),(0,a.jsx)(Vu,{className:"bg-slate-300 dark:bg-slate-700"}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)(Pn,{variant:"body2",weight:"default",children:e("rsp:pages.organizations.detail.userSettings.toggles.orgAdminCanCreateUsers")}),(0,a.jsx)(Jr,{control:t.control,name:"orgAdminCanCreateUsers",render:({field:n})=>(0,a.jsx)(qr,{children:(0,a.jsx)(Kr,{children:(0,a.jsx)(ci,{checked:n.value,onCheckedChange:n.onChange,"data-testid":"switchOrgAdminCanCreateUsers"})})})})]})]})},Toe=()=>tl({allowSubscriptionCancellation:Ia(),isOrderApprovalRequired:Ia(),isPriceVisible:Ia(),orgAdminCanCreateUsers:Ia(),showSubscriptions:Ia(),showUsers:Ia(),showLicenses:Ia(),showHelpDesk:Ia(),showBilling:Ia()}),koe=voe(),Roe=({organization:e,onClose:t})=>{const{t:n}=(0,z.Bd)(),r=Toe(),s=_oe(e?.organizationId),o=Hu(e?.organizationId),i=hc({resolver:mc(r)}),u=Object.keys(i.formState.dirtyFields).length>0;Af({isDirty:u}),(0,l.useEffect)(()=>{s.isSuccess&&(t(),i.reset(koe))},[i,t,s.isSuccess]),(0,l.useEffect)(()=>{!o&&e?.organizationId&&i.reset({...e})},[i,o,e]);const p=g=>{s.mutate({command:{...g}})};return e?(0,a.jsx)(gc,{...i,children:(0,a.jsxs)("form",{onSubmit:i.handleSubmit(p),className:"flex h-full flex-col",children:[(0,a.jsx)(Vu,{className:"bg-slate-300 dark:bg-slate-700"}),(0,a.jsx)(ls.Layout,{children:(0,a.jsx)(ls.Row,{children:(0,a.jsx)(ls.Column,{children:(0,a.jsxs)(ls.Content,{children:[(0,a.jsx)(ls.ContentLabel,{children:n("rsp:pages.organizations.list.users")}),(0,a.jsx)(ls.ContentValue,{children:e?.userCount})]})})})}),(0,a.jsx)(Vu,{className:"bg-slate-300 dark:bg-slate-700"}),(0,a.jsxs)(ls.Layout,{className:"flex h-full flex-col",children:[(0,a.jsx)(Soe,{}),(0,a.jsx)(Coe,{}),(0,a.jsx)(Eoe,{}),(0,a.jsxs)("div",{className:"flex h-full items-end justify-end space-x-2",children:[(0,a.jsx)(mn,{variant:"secondary",type:"button",size:"sm",onClick:()=>t(),children:n("rsp:pages.organizations.detail.actions.cancel")}),(0,a.jsx)(Di,{type:"submit",className:"",isLoading:s.isLoading,loadingChildren:n("rsp:pages.organizations.detail.actions.saving"),children:n("rsp:pages.organizations.detail.actions.save")})]})]})]})}):null},Poe=()=>{const{t:e}=(0,z.Bd)(),t=AR(),{organizationId:n}=ma(),r=xoe(n),s=Qs(),o=r.isLoading||!r?.data,i=()=>{s(Sr.Organizations)};return(0,a.jsxs)(ls,{title:o?null:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(Pn,{variant:"heading6",weight:"bold",className:"text-wrap",children:r?.data?.organizationName}),(0,a.jsx)(NR,{className:"ml-2",organizationUniqueName:r?.data?.uniqueName,dataTestId:"linkGoToOrganization",children:(0,a.jsx)($3,{className:"h-4 w-4"})}),t(r.data.isSuspended)]}),(0,a.jsx)(Pn,{variant:"body2",weight:"default",className:"text-sm text-muted-foreground",children:e("rsp:pages.organizations.detail.subTitle")})]}),onClose:i,children:[o?(0,a.jsx)(zs,{dataTestId:"layoverSpinnner",className:"absolute left-[calc(50%-3rem)] top-[calc(50%-3rem)] z-10"}):null,(0,a.jsx)(Roe,{organization:r.data,onClose:i})]})},Ooe={totalPages:0,pageIndex:1,hasPreviousPage:!1,hasNextPage:!1,results:[],totalItemsCount:0},Noe=({rowsPerPageOptions:e,result:t=Ooe,isFetching:n,currentPage:r,setPageParams:s})=>{const{t:o}=(0,z.Bd)(),[i,u]=(0,l.useState)($b),p=E=>{u(Number(E)),s({pageSize:Number(E),page:r})},g=()=>{s({pageSize:i,page:1})},v=()=>{s({pageSize:i,page:r-1})},w=()=>{s({pageSize:i,page:r+1})},x=()=>{s({pageSize:i,page:t?.totalPages})};return(0,a.jsx)("div",{className:"flex items-center justify-end border-t border-slate-200 p-4 dark:border-slate-700 dark:bg-slate-900",children:(0,a.jsxs)("div",{className:"lg:space-x-8' flex grow items-center justify-end space-x-6",children:[e.length>1&&(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:o("core:dataTable.resultsPerPage")}),(0,a.jsxs)(h0,{value:`${i}`,onValueChange:p,children:[(0,a.jsx)(wm,{className:"h-8 w-[70px]",children:(0,a.jsx)(m0,{placeholder:i})}),(0,a.jsx)(xm,{side:"top",children:e.map(E=>(0,a.jsx)(_m,{value:`${E}`,children:E},E))})]})]}),(0,a.jsx)("div",{className:"flex w-[100px] items-center justify-start text-sm font-medium",children:o("core:dataTable.pagination",{currentPage:r,totalPage:t.totalPages})}),(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsxs)(mn,{variant:"outline",className:"hidden h-8 w-8 p-0 text-gray-900 dark:bg-slate-950 lg:flex",onClick:g,disabled:n||!t.hasPreviousPage,children:[(0,a.jsx)("span",{className:"sr-only",children:o("core:dataTable.goToFirstPage")}),(0,a.jsx)(p3,{className:"h-4 w-4"})]}),(0,a.jsxs)(mn,{variant:"outline",className:"h-8 w-8 p-0 text-gray-900 dark:bg-slate-950",onClick:v,disabled:n||!t.hasPreviousPage,children:[(0,a.jsx)("span",{className:"sr-only",children:o("core:dataTable.goToPreviousPage")}),(0,a.jsx)(h3,{className:"h-4 w-4"})]}),(0,a.jsxs)(mn,{variant:"outline",className:"h-8 w-8 p-0 text-gray-900 dark:bg-slate-950",onClick:w,disabled:n||!t?.hasNextPage,children:[(0,a.jsx)("span",{className:"sr-only",children:o("core:dataTable.goToNextPage")}),(0,a.jsx)(wS,{className:"h-4 w-4"})]}),(0,a.jsxs)(mn,{variant:"outline",className:"hidden h-8 w-8 p-0 text-gray-900 dark:bg-slate-950 lg:flex",onClick:x,disabled:n||!t?.hasNextPage,children:[(0,a.jsx)("span",{className:"sr-only",children:o("core:dataTable.goToLastPage")}),(0,a.jsx)(m3,{className:"h-4 w-4"})]})]})]})})},Aoe=({filterPlaceholder:e,fieldDescription:t,columns:n,data:r,setPageParams:s,isFetching:o=!1,rowsPerPageOptions:i=OA,emptyMessage:u,className:p,onSortBy:g,dataTestId:v,optionalActions:w})=>{const{search:x,hasValueChanged:E}=Qp(),[R,k]=(0,l.useState)(1),[N,L]=(0,l.useState)($b),D=r?.results,{table:B,sorting:Q,hasSortingChanged:ce,onSortByServer:ye}=f3({data:D,rowsPerPage:N,columns:n,manualFiltering:!0,manualSorting:!0,onSortBy:g}),G=(0,l.useCallback)(({pageSize:We,page:at,searchTerm:St}={})=>{const xt=at??R;k(xt),s({searchTerm:St??x,pageSize:We??N,page:xt})},[R,N,x,s]);(0,l.useEffect)(()=>{if(E){if(R!==1){G({page:R!==1?1:R});return}G()}},[R,N,G,E,x]),(0,l.useEffect)(()=>{ce&&Q.length>0&&ye(Q)},[ce,ye,Q]);const Le=(0,l.useCallback)(({pageSize:We,page:at})=>{const St=We!==N?1:at;L(We),G({page:St,pageSize:We})},[N,G]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(a3,{debounce:NA,filterPlaceholder:e,fieldDescription:t,children:w}),(0,a.jsxs)(o3,{className:p,children:[(0,a.jsxs)(mR,{children:[(0,a.jsx)(i3,{table:B}),(0,a.jsx)(P0,{children:B.getRowModel().rows?.length?(0,a.jsx)(P0.Content,{table:B,dataTestId:v}):(0,a.jsx)(s3,{colSpanLength:n.length,emptyMessage:u,dataTestId:v})})]}),(0,a.jsx)(Noe,{result:r,isFetching:o,currentPage:R,rowsPerPageOptions:i,setPageParams:Le})]})]})},Ioe=e=>e.charAt(0).toUpperCase()+e.slice(1),joe=({sort:e})=>{const{search:t}=Qp(),[n,r]=(0,l.useState)(()=>F3({sort:e,searchTerm:t})),s=(0,l.useCallback)(({sortField:i,sortAscending:u})=>{r(p=>({...p,sort:{field:Ioe(i),ascending:u}}))},[]),o=(0,l.useCallback)(({pageSize:i,page:u,searchTerm:p})=>{r(g=>({...g,pageSize:i,searchTerm:p,page:u}))},[]);return{options:n,setOptions:o,onSortBy:s}},Doe=()=>{const{t:e}=(0,z.Bd)();return(0,a.jsxs)(a.Fragment,{children:[e("rsp:pages.organizations.list.settings"),(0,a.jsx)($l,{wrapperClassName:"align-middle pl-3",tooltip:(0,a.jsx)(Pn,{variant:"body2",children:e("rsp:pages.organizations.list.settingsTooltip")}),children:(0,a.jsx)(c0,{"data-testid":"settingsTooltip",className:"h-4 w-4"})})]})},H3=({onSubmit:e,cancelConfirmation:t,confirmationDialogOpened:n})=>{const{t:r}=(0,z.Bd)();return(0,a.jsx)(Vc,{open:n,onClose:t,onConfirm:e,title:r("rsp:pages.organizations.list.actions.resetSettingsconfirmationModal.title"),confirmButtonText:r("rsp:pages.organizations.list.actions.resetSettingsconfirmationModal.confirmationButtonText"),cancelButtonText:r("rsp:actions.cancel"),children:r("rsp:pages.organizations.list.actions.resetSettingsconfirmationModal.description")})},Moe=({organization:e})=>{const{t}=(0,z.Bd)(),[n,r]=(0,l.useState)(!1),[s,o]=(0,l.useState)(!1),{navigate:i}=Ni(),u=B3(e?.organizationId),p=()=>{i(Sr.Organization,{organizationId:e.organizationId})},g=()=>{r(!0)},v=()=>{r(!1),o(!1)},w=()=>{u.mutate()};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"flex gap-x-4",children:(0,a.jsxs)(S0,{open:s,onOpenChange:o,children:[(0,a.jsx)(C0,{asChild:!0,"data-testid":"dropdownViewOrganizationOptions",children:(0,a.jsx)(mn,{variant:"ghost",className:"h-8 w-8 p-0",children:(0,a.jsx)(zS,{className:"mr-0.5 w-6 text-gray-500 hover:bg-slate-50"})})}),(0,a.jsxs)(km,{align:"end",children:[(0,a.jsx)(Bl,{"data-testid":"dropdownItemViewSettings",onClick:p,children:t("rsp:pages.organizations.list.actions.viewSettings")}),(0,a.jsx)(Bl,{asChild:!0,children:(0,a.jsx)(NR,{className:"hover:bg-accent hover:text-accent-foreground",dataTestId:"dropdownItemViewOrganization",organizationUniqueName:e?.uniqueName,children:t("rsp:pages.organizations.list.actions.openOrganization")})}),!e?.usesDefaultSettings&&(0,a.jsx)(Bl,{"data-testid":"dropdownItemResetSettings",onClick:g,children:t("rsp:pages.organizations.list.actions.resetSettings")})]})]})}),(0,a.jsx)(H3,{cancelConfirmation:v,onSubmit:w,confirmationDialogOpened:n})]})},GS={className:"align-top text-center"},$oe=()=>{const{t:e}=(0,z.Bd)(),{options:t,setOptions:n,onSortBy:r}=joe(RR()),s=boe(t),o=V3(),i=AR(),u=x=>(0,a.jsx)(Moe,{organization:x}),p=U3(),g=()=>{p.mutate()},v=()=>(0,a.jsx)(Doe,{}),w=[{accessorKey:"organizationName",meta:{className:"align-top"},header:e("rsp:pages.organizations.list.name"),enableSorting:!0,cell:({row:x})=>x.original.organizationName,minSize:400},{accessorKey:"usersCount",header:e("rsp:pages.organizations.list.users"),enableSorting:!0,meta:{...GS},cell:({row:x})=>x.original.userCount},{accessorKey:"settingsType",meta:{...GS},enableSorting:!0,header:v,cell:({row:x})=>o(x.original.usesDefaultSettings)},{accessorKey:"status",meta:{...GS},enableSorting:!0,header:e("rsp:pages.organizations.list.status"),cell:({row:x})=>i(x.original.isSuspended)},{accessorKey:"actions",meta:{...GS},header:String(),enableSorting:!1,cell:({row:x})=>u(x.original),minSize:20}];return(0,a.jsx)(xo,{padded:!0,children:(0,Os.isRequestLoading)(s)?(0,a.jsx)(Hp,{}):(0,a.jsx)(Aoe,{columns:w,data:s?.data,dataTestId:"tableOrganizations",isFetching:s.isFetching,emptyMessage:e("rsp:pages.organizations.noOrganization"),filterPlaceholder:e("rsp:pages.organizations.list.filterPlaceholder"),fieldDescription:e("rsp:pages.organizations.list.searchFieldDescription"),onSortBy:r,setPageParams:n,optionalActions:(0,a.jsx)("div",{className:"flex w-full justify-end",children:(0,a.jsx)(Di,{isLoading:p?.isLoading,onClick:g})})})})};function Loe({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{fillRule:"evenodd",d:"M4.755 10.059a7.5 7.5 0 0 1 12.548-3.364l1.903 1.903h-3.183a.75.75 0 1 0 0 1.5h4.992a.75.75 0 0 0 .75-.75V4.356a.75.75 0 0 0-1.5 0v3.18l-1.9-1.9A9 9 0 0 0 3.306 9.67a.75.75 0 1 0 1.45.388Zm15.408 3.352a.75.75 0 0 0-.919.53 7.5 7.5 0 0 1-12.548 3.364l-1.902-1.903h3.183a.75.75 0 0 0 0-1.5H2.984a.75.75 0 0 0-.75.75v4.992a.75.75 0 0 0 1.5 0v-3.18l1.9 1.9a9 9 0 0 0 15.059-4.035.75.75 0 0 0-.53-.918Z",clipRule:"evenodd"}))}const W3=l.forwardRef(Loe),Foe=({organization:e,className:t})=>{const{t:n}=(0,z.Bd)(),[r,s]=(0,l.useState)(!1),o=B3(e?.organizationId),i=()=>{s(!0)},u=()=>{s(!1)},p=()=>{o.mutate()};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:st("flex flex-row gap-4",t),"data-testid":"actionsOrganizationsMobile",children:[!e?.usesDefaultSettings&&(0,a.jsx)(mn,{variant:No.Outline,size:"sm","data-testid":"btnResetSettings",onClick:i,children:n("rsp:pages.organizations.list.actions.resetSettings")}),(0,a.jsx)(mn,{asChild:!0,variant:No.Outline,size:"sm","data-testid":"btnViewSettings",children:(0,a.jsxs)(vl,{to:Sr.Organization,params:{organizationId:e.organizationId??""},children:[(0,a.jsx)(IE,{className:"mr-1 h-5 w-5  hover:bg-slate-50"}),n("rsp:pages.organizations.list.actions.viewSettingsMobile")]})}),(0,a.jsx)(mn,{asChild:!0,variant:No.Outline,size:"sm",children:(0,a.jsx)(NR,{dataTestId:"btnOpenOrganization",organizationUniqueName:e?.uniqueName,children:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)($3,{className:"mr-1 h-5 w-5  hover:bg-slate-50"}),n("rsp:pages.organizations.list.actions.openOrganizationMobile")]})})})]}),(0,a.jsx)(H3,{cancelConfirmation:u,onSubmit:p,confirmationDialogOpened:r})]})},zoe=()=>{const{t:e}=(0,z.Bd)(),{search:t,onSetSearchParams:n}=Qp(),r=woe(RR({searchTerm:t})),s=(0,Os.isInfiniteScrollRequestHavingNoResults)(r),o=(0,Os.getAllPagesResults)(r),i=async()=>{await r.fetchNextPage()},u=V3(),p=AR(),g=U3(),v=()=>{g.mutate()},w=()=>s?(0,a.jsx)(kR,{children:e("rsp:pages.organizations.noOrganization")}):(0,a.jsxs)(a.Fragment,{children:[o?.map(x=>x?(0,a.jsx)(Nm,{type:"single",collapsible:!0,children:(0,a.jsxs)(Xp,{value:x.organizationId,children:[(0,a.jsxs)(Zp,{className:"relative justify-between rounded-xl bg-white p-4 [&[data-state=open]>div>div]:hidden [&[data-state=open]]:rounded-b-none",children:[x.organizationName,(0,a.jsx)(Oy,{children:p(x.isSuspended)})]}),(0,a.jsx)(Jp,{children:(0,a.jsxs)(N0,{children:[(0,a.jsx)(Js,{label:e("rsp:pages.organizations.list.users"),value:x.userCount}),(0,a.jsx)(Js,{label:e("rsp:pages.organizations.list.settings"),value:u(x.usesDefaultSettings)}),(0,a.jsx)(Js,{label:e("rsp:pages.organizations.list.status"),value:p(x.isSuspended)}),(0,a.jsx)(Js,{className:"justify-end",labelClassName:"flex flex-wrap",label:(0,a.jsx)(Foe,{organization:x,className:"flex flex-wrap"})})]})})]})},x.organizationId):null),r?.hasNextPage?(0,a.jsx)(wk,{isLoading:r.isFetchingNextPage,hasMore:r?.hasNextPage,next:i}):null]});return(0,a.jsx)(xo,{padded:!0,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)(vu,{children:[(0,a.jsx)(vu.Input,{debounce:NA,placeholder:e("rsp:pages.organizations.list.filterPlaceholder"),filteredText:t,setFilteredText:n}),(0,a.jsx)(Di,{mobileView:!0,isLoading:g?.isLoading,onClick:v,Icon:W3})]}),(0,Os.isRequestLoading)(r)?(0,a.jsx)(Hp,{}):w()]})})},Uoe=Ll(()=>{const{t:e}=(0,z.Bd)();return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(Wu,{children:(0,a.jsxs)("div",{className:"flex flex-col gap-12 md:gap-16",children:[(0,a.jsx)(yl,{title:(0,a.jsx)(el,{"data-testid":"pageOrganizationsTitle",children:e("rsp:pages.organizations.title")}),subTitle:(0,a.jsx)(qu,{children:e("rsp:pages.organizations.subtitle")})}),(0,a.jsx)("div",{className:"hidden lg:block",children:(0,a.jsx)($oe,{})}),(0,a.jsx)("div",{className:"mt-4 lg:hidden",children:(0,a.jsx)(zoe,{})})]})}),(0,a.jsx)(Ta,{})]})}),Boe=({error:e})=>e?(0,a.jsxs)("div",{"data-testid":"server-error",children:["An error occured",(0,a.jsx)("br",{}),(0,a.jsx)("pre",{children:JSON.stringify(e,void 0,2)})]}):null,IR=({disabled:e=!1,showLoader:t=!1,children:n})=>{const{t:r}=(0,z.Bd)();return(0,a.jsxs)("div",{className:"grid-col-1 grid gap-y-4 md:grid-cols-2 md:gap-y-0",children:[(0,a.jsx)("div",{className:"w-full sm:w-9/12"}),(0,a.jsx)("div",{className:"w-full",children:(0,a.jsx)(Di,{type:"submit",disabled:e,className:"col-start-2 w-full sm:w-1/2",dataTestId:"saveSettings",isLoading:t,loadingChildren:n??r("rsp:pages.settings.labels.saving"),children:n??r("rsp:pages.settings.labels.save")})})]})},Voe=tl({logo:Z_().nullable(),logoUrl:Ds(),favicon:Z_().nullable(),faviconUrl:Ds()}),Hoe=()=>{const{t:e}=(0,z.Bd)(),{data:t}=s0(),{updateLogo:n,updateIcon:r}=QA(),{isSuccess:s,isError:o,isLoading:i}=hH(),u=hc({resolver:mc(Voe),defaultValues:{}}),[p,g]=u.watch(["logoUrl","faviconUrl"]),v=(0,V.jE)();(0,Os.useInvalidateQuery)(Ax.queryKey(),s,v),(0,l.useEffect)(()=>{const k=t?.portalSettings;t?.id&&k&&(u.setValue("faviconUrl",k.favicon??""),u.setValue("logoUrl",k.logo??""))},[t?.id]),(0,l.useEffect)(()=>{s&&(0,Yr.v0)(e("rsp:pages.settings.customizationsSettings.theme.settingSuccessToastMessage"))},[s]),(0,l.useEffect)(()=>{o&&(0,Yr.A2)(e("rsp:pages.settings.customizationsSettings.theme.settingsFailureToastMessage"))},[o]);async function w(k){k.logo&&await n(k.logo).then(()=>{u.setValue("logo",null),(0,Yr.v0)(e("rsp:pages.settings.customizationsSettings.logo.updateSuccess"))}),k.favicon&&await r(k.favicon).then(()=>{u.setValue("favicon",null),(0,Yr.v0)(e("rsp:pages.settings.customizationsSettings.favicon.updateSuccess"))})}const x=async k=>{u.setValue("logo",k);const N=await R(k);u.setValue("logoUrl",N)},E=async k=>{u.setValue("favicon",k);const N=await R(k);u.setValue("faviconUrl",N)},R=async k=>{const N=await k.arrayBuffer().then(L=>new Blob([L],{type:k.type}));return await new Promise((L,D)=>{const B=new FileReader;B.onload=()=>{L(B.result?.toString()??"")},B.onerror=D,B.readAsDataURL(N)})};return(0,a.jsx)(gc,{...u,children:(0,a.jsxs)("form",{onSubmit:u.handleSubmit(w),className:"my-4 flex flex-col gap-y-16 rounded-xl p-4 dark:bg-slate-900 md:px-8 md:py-16",children:[(0,a.jsxs)("div",{className:"grid-col-1 grid gap-y-4 md:grid-cols-2 md:gap-y-0",children:[(0,a.jsxs)("div",{className:"w-full sm:w-9/12",children:[(0,a.jsx)("label",{className:"font-semibold",children:e("rsp:pages.settings.customizationsSettings.logo.title")}),(0,a.jsx)("div",{className:"text-xs text-gray-500 dark:text-slate-300",children:e("rsp:pages.settings.customizationsSettings.logo.description")})]}),(0,a.jsx)("div",{className:"w-full",children:(0,a.jsx)("div",{className:"flex flex-col gap-8",children:(0,a.jsx)("div",{className:"grid grid-cols-1 gap-y-4",children:(0,a.jsx)(Gk,{imageUrl:p,title:e("rsp:pages.settings.customizationsSettings.logo.updateModal.title"),onSave:x})})})})]}),(0,a.jsxs)("div",{className:"grid-col-1 grid gap-y-4 md:grid-cols-2 md:gap-y-0",children:[(0,a.jsx)("div",{className:"w-full sm:w-9/12",children:(0,a.jsx)("label",{className:"font-semibold",children:e("rsp:pages.settings.customizationsSettings.favicon.title")})}),(0,a.jsx)("div",{className:"w-full",children:(0,a.jsx)("div",{className:"flex flex-col gap-8",children:(0,a.jsx)("div",{className:"grid grid-cols-1 gap-y-4",children:(0,a.jsx)(Gk,{imageUrl:g,title:e("rsp:pages.settings.customizationsSettings.favicon.updateModal.title"),onSave:E})})})})]}),(0,a.jsx)(IR,{disabled:i})]})})},Woe=()=>{const{t:e}=(0,z.Bd)();return tl({isOrderApprovalRequired:Ia(),teamNotifications:tl({enabled:Ia().default(!1),webHookUrl:Ds().optional()}).refine(({enabled:t,webHookUrl:n})=>!t||n!=="",{path:["webHookUrl"],message:e("rsp:validations.mixed.required")}),emailNotifications:tl({enabled:Ia().default(!1),allUsersEnabled:Ia().default(!0),emails:Ds().array().optional()}).refine(({enabled:t,allUsersEnabled:n,emails:r})=>n||!t?!0:r?.length!==0,{path:["emails"],message:"rsp:validations.mixed.required"})})};var qoe=ln(1169);const Koe=()=>(0,Vo.n)({mutationFn:async({webhookUrl:e})=>await qoe.I.validateWebhook({command:{webhookUrl:e}})}),Goe=({webHookUrl:e})=>{const t=Koe(),n=yH(),r=!!t?.data&&!t?.data?.isValid,s=n.isLoading||t?.isLoading,o=async(g,v)=>{await g()&&t.mutate({webhookUrl:v??""})},i=()=>t.reset(),u=async g=>{try{const{isValid:v}=await t.mutateAsync({webhookUrl:g.teamNotifications.webHookUrl??""});v&&n.mutate(g)}catch(v){(0,Yr.JA)(v)}},p=async g=>{const v={...g,emailNotifications:{...g.emailNotifications,emails:g.emailNotifications?.enabled?g.emailNotifications.emails:[]}};if(!g.teamNotifications.enabled){i(),n.mutate({...v,teamNotifications:{...v.teamNotifications,webHookUrl:""}});return}if(t?.data?.isValid??e===v.teamNotifications.webHookUrl){n.mutate(v);return}await u(v)};return{hasConnectionFailed:r,isTestConnectionValid:t?.data?.isValid,isTestConnectionLoading:t.isLoading,isOrderSettingsLoading:n.isLoading,isSaveDisabled:s,onSubmit:p,onTestWebHookConnection:o,onResetMutationResult:i}},Qoe=()=>{const{t:e}=(0,z.Bd)(),t=xa();return(0,a.jsxs)("div",{className:"grid-col-1 grid gap-y-4 md:grid-cols-2 md:gap-y-0",children:[(0,a.jsxs)("div",{className:"w-full sm:w-9/12",children:[(0,a.jsx)("label",{className:"font-semibold",children:e("rsp:pages.settings.orderSettings.orders.title")}),(0,a.jsx)("div",{className:"text-xs text-gray-500 dark:text-slate-300",children:e("rsp:pages.settings.orderSettings.orders.description")})]}),(0,a.jsx)("div",{className:"w-full",children:(0,a.jsx)("div",{className:"flex flex-col gap-8",children:(0,a.jsx)("div",{className:"grid grid-cols-1 gap-y-4",children:(0,a.jsx)(Jr,{control:t.control,name:"isOrderApprovalRequired",render:({field:n})=>(0,a.jsxs)(qr,{className:"settings-form-item",children:[(0,a.jsx)(As,{children:e("rsp:pages.settings.orderSettings.orders.labels.orderApprovalToggle")}),(0,a.jsx)(Kr,{className:"settings-form-control",children:(0,a.jsx)(ci,{checked:n.value,onCheckedChange:n.onChange,"data-testid":"orderApprovalRequired"})}),(0,a.jsx)(Cs,{})]})})})})})]})},Yoe=()=>{const{t:e}=(0,z.Bd)(),t=xa(),[n,r]=t.watch(["emailNotifications.enabled","emailNotifications.allUsersEnabled"]),s=pH(),o=n&&!r&&(!s?.isLoading||!!s?.data);return(0,a.jsx)("div",{className:"flex flex-col gap-8",children:(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-y-4",children:[(0,a.jsx)(Jr,{control:t.control,name:"emailNotifications.enabled",render:({field:i})=>(0,a.jsxs)(qr,{className:"settings-form-item",children:[(0,a.jsxs)(As,{children:[" ",e("rsp:pages.settings.orderSettings.orders.notifications.emails.labels.orderSend")]}),(0,a.jsx)(Kr,{className:"settings-form-control",children:(0,a.jsx)(ci,{checked:i.value,disabled:t.formState.isSubmitting,onCheckedChange:u=>{i.onChange(u),t.clearErrors("emailNotifications.emails")},"data-testid":"emailNotificationsEnabled"})}),(0,a.jsx)(Cs,{})]})}),n?(0,a.jsx)(Jr,{control:t.control,name:"emailNotifications.allUsersEnabled",render:({field:i})=>(0,a.jsxs)(qr,{className:"settings-form-item",children:[(0,a.jsx)(As,{children:e("rsp:pages.settings.orderSettings.orders.notifications.emails.sendAll")}),(0,a.jsx)(Kr,{className:"settings-form-control",children:(0,a.jsx)(ci,{checked:i.value,disabled:t.formState.isSubmitting,"data-testid":"emailNotificationsAllAdmin",onCheckedChange:u=>i.onChange(u)})}),(0,a.jsx)(Cs,{})]})}):null,o?(0,a.jsx)(Jr,{control:t.control,name:"emailNotifications.emails",render:({field:i})=>(0,a.jsxs)(qr,{children:[(0,a.jsx)(As,{children:e("rsp:pages.settings.orderSettings.orders.notifications.emails.listOfUsers")}),(0,a.jsxs)(LT,{onValuesChange:i.onChange,values:i.value,options:s.data?.map(u=>({label:u?.email,value:u?.email})),children:[(0,a.jsx)(Kr,{children:(0,a.jsx)(sS,{children:(0,a.jsx)(oS,{placeholder:e("rsp:pages.settings.orderSettings.orders.notifications.emails.placeholderInput")})})}),(0,a.jsx)(Cs,{})]})]})}):null]})})},q3="teamNotifications.webHookUrl",Xoe=({hasConnectionFailed:e=!1,children:t,reset:n})=>{const{t:r}=(0,z.Bd)(),s=xa(),[o]=s.watch(["teamNotifications.enabled"]);return(0,l.useEffect)(()=>{e&&s.setError(q3,{message:r("rsp:pages.settings.orderSettings.orders.notifications.teams.webhook.connectionFailed")})},[e]),(0,a.jsx)("div",{className:"flex flex-col gap-8",children:(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-y-4",children:[(0,a.jsx)(Jr,{control:s.control,name:"teamNotifications.enabled",render:({field:i})=>(0,a.jsxs)(qr,{className:"settings-form-item",children:[(0,a.jsxs)(As,{children:[" ",r("rsp:pages.settings.orderSettings.orders.notifications.teams.labels.orderSend")]}),(0,a.jsx)(Kr,{className:"settings-form-control",children:(0,a.jsx)(ci,{checked:i.value,onCheckedChange:u=>{i.onChange(u),s.clearErrors(q3)},"data-testid":"teamNotificationsEnabled"})}),(0,a.jsx)(Cs,{})]})}),o?(0,a.jsx)(Jr,{control:s.control,name:"teamNotifications.webHookUrl",render:({field:i})=>(0,a.jsxs)(qr,{className:"w-full",children:[(0,a.jsx)("div",{className:"flex gap-x-4",children:(0,a.jsx)(As,{children:r("rsp:pages.settings.orderSettings.orders.notifications.teams.webhook.label")})}),(0,a.jsx)(Kr,{children:(0,a.jsx)(Rj,{"data-testid":"inputWebhookUrl",...i,containerClassName:"h-[33px]",placeholder:r("rsp:pages.settings.orderSettings.orders.notifications.teams.webhook.placeholder"),onChange:u=>{i.onChange(u),s.clearErrors("teamNotifications.webHookUrl"),n()},children:(0,a.jsx)("div",{className:"ml-2 flex items-center md:ml-3",children:t})})}),(0,a.jsx)(Cs,{})]})}):null]})})},Zoe=({hasConnectionFailed:e=!1,renderTeamsActionsComponent:t,reset:n})=>{const{t:r}=(0,z.Bd)(),s=xa(),[o]=s.watch(["teamNotifications.webHookUrl"]),i=async()=>await s.trigger("teamNotifications.webHookUrl");return(0,a.jsxs)("div",{className:"grid-col-1 grid gap-y-4 md:grid-cols-2 md:gap-y-0",children:[(0,a.jsxs)("div",{className:"w-full sm:w-9/12",children:[(0,a.jsx)("label",{className:"font-semibold",children:r("rsp:pages.settings.orderSettings.orders.notifications.title")}),(0,a.jsx)("div",{className:"text-xs text-gray-500 dark:text-slate-300",children:r("rsp:pages.settings.orderSettings.orders.notifications.description")})]}),(0,a.jsx)("div",{className:"w-full",children:(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsx)(Yoe,{}),(0,a.jsx)(Xoe,{hasConnectionFailed:e,reset:n,children:t({teamNotificationsWebHookUrl:o,isWebHookValid:i})})]})})]})},Joe=({reseller:e})=>{const{t}=(0,z.Bd)(),n=Woe(),r=hc({resolver:mc(n),defaultValues:e.orderSettings}),s=e?.orderSettings?.teamNotifications?.webHookUrl,o=Hu(e.orderSettings),i=Goe({webHookUrl:s});(0,l.useEffect)(()=>{e.orderSettings!==o&&r.reset(e.orderSettings)},[o,e.orderSettings]);const u=async p=>{await i.onSubmit(p)};return(0,a.jsx)(gc,{...r,children:(0,a.jsxs)("form",{onSubmit:r.handleSubmit(u),className:"my-4 flex flex-col gap-y-16 rounded-xl p-4 dark:bg-slate-900 md:px-8 md:py-16",children:[(0,a.jsx)(Qoe,{}),(0,a.jsx)(Zoe,{reset:i.onResetMutationResult,hasConnectionFailed:i.hasConnectionFailed,renderTeamsActionsComponent:({teamNotificationsWebHookUrl:p,isWebHookValid:g})=>s===p&&s!==""||i.isTestConnectionValid?(0,a.jsx)(to,{className:"whitespace-nowrap",variant:wo.Success,children:t("rsp:pages.settings.orderSettings.orders.notifications.teams.webhook.connectionSuccess")}):(0,a.jsx)(Di,{type:"button",variant:"None",className:"h-full gap-x-2 whitespace-nowrap bg-indigo-600 hover:bg-indigo-700",onClick:async()=>{await i.onTestWebHookConnection(g,p)},isLoading:i.isTestConnectionLoading,loadingChildren:t("rsp:pages.settings.orderSettings.orders.notifications.teams.webhook.testConnection"),children:t("rsp:pages.settings.orderSettings.orders.notifications.teams.webhook.testConnection")})}),(0,a.jsx)(IR,{disabled:i.isSaveDisabled,showLoader:i.isOrderSettingsLoading})]})})},eae=()=>{const{isLoading:e,isFetching:t,data:n}=s0();return e||!n?(0,a.jsx)(zs,{floating:!0}):(0,a.jsx)(Joe,{isFetching:t,reseller:n})},tae=tl({subresellerVisible:Ia(),priceVisible:Ia(),showSubscriptions:Ia(),showUsers:Ia(),showLicenses:Ia(),showBilling:Ia(),orgAdminCanCreateUsers:Ia(),allowSubscriptionCancellation:Ia()}),nae=()=>{const{t:e}=(0,z.Bd)(),t=xa();return(0,a.jsxs)("div",{className:"grid-col-1 grid gap-y-4 md:grid-cols-2 md:gap-y-0",children:[(0,a.jsxs)("div",{className:"w-full sm:w-9/12",children:[(0,a.jsx)("label",{className:"font-semibold",children:e("rsp:pages.settings.resellerSettings.userManagement.title")}),(0,a.jsx)("div",{className:"text-xs text-gray-500 dark:text-slate-300",children:e("rsp:pages.settings.resellerSettings.userManagement.description")})]}),(0,a.jsx)("div",{className:"w-full",children:(0,a.jsx)("div",{className:"flex flex-col gap-8",children:(0,a.jsx)("div",{className:"grid grid-cols-1 gap-y-4",children:(0,a.jsx)(Jr,{control:t.control,name:"orgAdminCanCreateUsers",render:({field:n})=>(0,a.jsxs)(qr,{className:"settings-form-item",children:[(0,a.jsx)(As,{children:e("rsp:pages.settings.resellerSettings.userManagement.labels.createNewUsers")}),(0,a.jsx)(Kr,{className:"settings-form-control",children:(0,a.jsx)(ci,{checked:n.value,onCheckedChange:n.onChange,"data-testid":"orgAdminCanCreateUsers"})}),(0,a.jsx)(Cs,{})]})})})})})]})},rae=()=>{const{t:e}=(0,z.Bd)(),{data:t}=s0(),n=vH(),r=hc({resolver:mc(tae)});(0,l.useEffect)(()=>{t?.id&&(r.setValue("priceVisible",t?.resellerSettings?.priceVisible??!1),r.setValue("subresellerVisible",t?.resellerSettings?.isSubresellerShown??!1),r.setValue("showUsers",t?.resellerSettings?.showUsers??!1),r.setValue("showBilling",t?.resellerSettings?.showBilling??!1),r.setValue("showLicenses",t?.resellerSettings?.showLicenses??!1),r.setValue("showSubscriptions",t?.resellerSettings?.showSubscriptions??!1),r.setValue("orgAdminCanCreateUsers",t?.resellerSettings?.orgAdminCanCreateUsers??!1),r.setValue("allowSubscriptionCancellation",t?.resellerSettings?.allowSubscriptionCancellation??!1))},[r,t]);function s(o){n.mutate({priceVisible:o.priceVisible,isSubresellerShown:o.subresellerVisible,showSubscriptions:o.showSubscriptions,showUsers:o.showUsers,showLicenses:o.showLicenses,showBilling:o.showBilling,orgAdminCanCreateUsers:o.orgAdminCanCreateUsers,allowSubscriptionCancellation:o.allowSubscriptionCancellation})}return(0,a.jsx)(gc,{...r,children:(0,a.jsxs)("form",{onSubmit:r.handleSubmit(s),className:"my-4 flex flex-col gap-y-16 rounded-xl p-4 dark:bg-slate-900 md:px-8 md:py-16",children:[(0,a.jsxs)("div",{className:"grid-col-1 grid gap-y-4 md:grid-cols-2 md:gap-y-0",children:[(0,a.jsxs)("div",{className:"w-full sm:w-9/12",children:[(0,a.jsx)("label",{className:"font-semibold",children:e("rsp:pages.settings.resellerSettings.subscriptions.title")}),(0,a.jsx)("div",{className:"text-xs text-gray-500 dark:text-slate-300",children:e("rsp:pages.settings.resellerSettings.subscriptions.description")})]}),(0,a.jsx)("div",{className:"w-full",children:(0,a.jsx)("div",{className:"flex flex-col gap-8",children:(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-y-4",children:[(0,a.jsx)(Jr,{control:r.control,name:"priceVisible",render:({field:o})=>(0,a.jsxs)(qr,{className:"settings-form-item",children:[(0,a.jsx)(As,{children:e("rsp:pages.settings.resellerSettings.subscriptions.labels.priceToggle")}),(0,a.jsx)(Kr,{className:"settings-form-control",children:(0,a.jsx)(ci,{checked:o.value,onCheckedChange:o.onChange,"data-testid":"priceVisible"})}),(0,a.jsx)(Cs,{})]})}),(0,a.jsx)(Jr,{control:r.control,name:"allowSubscriptionCancellation",render:({field:o})=>(0,a.jsxs)(qr,{className:"settings-form-item",children:[(0,a.jsx)(As,{children:e("rsp:pages.settings.resellerSettings.subscriptions.labels.allowSubscriptionCancellation")}),(0,a.jsx)(Kr,{className:"settings-form-control",children:(0,a.jsx)(ci,{checked:o.value,onCheckedChange:o.onChange,"data-testid":"allowSubscriptionCancellation"})}),(0,a.jsx)(Cs,{})]})})]})})})]}),(0,a.jsxs)("div",{className:"grid-col-1 grid gap-y-4 md:grid-cols-2 md:gap-y-0",children:[(0,a.jsxs)("div",{className:"w-full sm:w-9/12",children:[(0,a.jsx)("label",{className:"font-semibold",children:e("rsp:pages.settings.resellerSettings.subresellers.title")}),(0,a.jsx)("div",{className:"text-xs text-gray-500 dark:text-slate-300",children:e("rsp:pages.settings.resellerSettings.subresellers.description")})]}),(0,a.jsx)("div",{className:"w-full",children:(0,a.jsx)("div",{className:"flex flex-col gap-8",children:(0,a.jsx)("div",{className:"grid grid-cols-1 gap-y-4",children:(0,a.jsx)(Jr,{control:r.control,name:"subresellerVisible",render:({field:o})=>(0,a.jsxs)(qr,{className:"settings-form-item",children:[(0,a.jsx)(As,{children:e("rsp:pages.settings.resellerSettings.subresellers.labels.displaySubresellers")}),(0,a.jsx)(Kr,{className:"settings-form-control",children:(0,a.jsx)(ci,{checked:o.value,onCheckedChange:o.onChange,"data-testid":"subresellerVisible"})}),(0,a.jsx)(Cs,{})]})})})})})]}),(0,a.jsxs)("div",{className:"grid-col-1 grid gap-y-4 md:grid-cols-2 md:gap-y-0",children:[(0,a.jsxs)("div",{className:"w-full sm:w-9/12",children:[(0,a.jsx)("label",{className:"font-semibold",children:e("rsp:pages.settings.resellerSettings.applicationFeatures.title")}),(0,a.jsx)("div",{className:"text-xs text-gray-500 dark:text-slate-300",children:e("rsp:pages.settings.resellerSettings.applicationFeatures.description")})]}),(0,a.jsx)("div",{className:"w-full",children:(0,a.jsx)("div",{className:"flex flex-col gap-8",children:(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-y-4",children:[(0,a.jsx)(Jr,{control:r.control,name:"showSubscriptions",render:({field:o})=>(0,a.jsxs)(qr,{className:"settings-form-item",children:[(0,a.jsx)(As,{children:e("rsp:pages.settings.resellerSettings.applicationFeatures.labels.showSubscriptionsManagement")}),(0,a.jsx)(Kr,{className:"settings-form-control",children:(0,a.jsx)(ci,{checked:o.value,onCheckedChange:o.onChange,"data-testid":"showSubscriptions"})}),(0,a.jsx)(Cs,{})]})}),(0,a.jsx)(Jr,{control:r.control,name:"showUsers",render:({field:o})=>(0,a.jsxs)(qr,{className:"settings-form-item",children:[(0,a.jsx)(As,{children:e("rsp:pages.settings.resellerSettings.applicationFeatures.labels.showUsersManagement")}),(0,a.jsx)(Kr,{className:"settings-form-control",children:(0,a.jsx)(ci,{checked:o.value,onCheckedChange:o.onChange,"data-testid":"showUsers"})}),(0,a.jsx)(Cs,{})]})}),(0,a.jsx)(Jr,{control:r.control,name:"showLicenses",render:({field:o})=>(0,a.jsxs)(qr,{className:"settings-form-item",children:[(0,a.jsx)(As,{children:e("rsp:pages.settings.resellerSettings.applicationFeatures.labels.showLicensesManagement")}),(0,a.jsx)(Kr,{className:"settings-form-control",children:(0,a.jsx)(ci,{checked:o.value,onCheckedChange:o.onChange,"data-testid":"showLicenses"})}),(0,a.jsx)(Cs,{})]})})]})})})]}),(0,a.jsx)(nae,{}),(0,a.jsx)(IR,{disabled:n?.isLoading,showLoader:n?.isLoading})]})})},sae=Ll(()=>{const{isLoading:e,data:t,error:n}=s0(),{setSelectedReseller:r}=XA(),{t:s}=(0,z.Bd)();return(0,l.useEffect)(()=>{t&&r(t.id)},[t,r]),e?(0,a.jsx)(Wu,{children:(0,a.jsx)(zs,{floating:!0})}):n?(0,a.jsx)(Wu,{children:(0,a.jsx)(Boe,{error:n})}):(0,a.jsxs)(Wu,{children:[(0,a.jsx)("div",{className:"mb-8 sm:mb-16",children:(0,a.jsx)(yl,{title:(0,a.jsx)(el,{"data-testid":"pageSettingsTitle",children:s("rsp:pages.settings.title")}),subTitle:(0,a.jsx)(qu,{children:s("rsp:pages.settings.subtitle")})})}),(0,a.jsxs)(Hb,{defaultValue:"resellerSettings",className:"w-full",children:[(0,a.jsxs)(o0,{children:[(0,a.jsxs)(ly,{className:"h-16 sm:h-auto",children:[(0,a.jsx)(Rd,{value:"resellerSettings","data-testid":"tabsTriggerResellerSettings",className:"focus-visible:ring-indigo-300",children:s("rsp:pages.settings.resellerSettings.title")}),(0,a.jsx)(Rd,{value:"customizationsSettings","data-testid":"tabsTriggerCustomizationsSettings",className:"focus-visible:ring-indigo-300",children:s("rsp:pages.settings.customizationsSettings.title")}),(0,a.jsx)(Rd,{value:"orderSettings","data-testid":"tabsTriggerOrderSettings",className:"focus-visible:ring-indigo-300",children:s("rsp:pages.settings.orderSettings.title")})]}),(0,a.jsx)(Bb,{orientation:"horizontal"})]}),(0,a.jsx)(cm,{value:"resellerSettings","data-testid":"tabsContentResellerSettings",className:"focus-visible:ring-indigo-300",children:(0,a.jsx)(rae,{})}),(0,a.jsx)(cm,{value:"customizationsSettings","data-testid":"tabsContentCustomizationsSettings",className:"focus-visible:ring-indigo-300",children:(0,a.jsx)(Hoe,{})}),(0,a.jsx)(cm,{value:"orderSettings","data-testid":"tabsContentOrderSettings",className:"focus-visible:ring-indigo-300",children:(0,a.jsx)(eae,{})})]})]})}),Am=({className:e,fullScreen:t=!1,showSidebar:n=!1})=>{const{t:r}=(0,z.Bd)(),{isAuthenticated:s}=(0,zr.Z)(),o=t||!s?Zv:Wc;return(0,a.jsx)(o,{className:"dark:bg-slate-900",showSidebar:n,children:(0,a.jsx)("div",{"data-testid":"error-404",className:st("h-full",e),children:(0,a.jsxs)("div",{className:"mx-auto flex max-w-2xl flex-col items-center text-center",children:[(0,a.jsx)(Td,{className:"mx-auto mt-20 w-12 text-red-600 sm:mt-24"}),(0,a.jsx)("p",{className:"text-base font-semibold leading-8 dark:text-white",children:"404"}),(0,a.jsx)("h1",{className:"mt-4 text-3xl font-bold tracking-tight text-gray-900 dark:text-white sm:text-5xl",children:r("ssp:pages.404.title")}),(0,a.jsx)("p",{className:"mt-4 text-base leading-7 text-gray-600 dark:text-white sm:mt-6 sm:text-lg sm:leading-8",children:r("ssp:pages.404.description")}),(0,a.jsx)(mn,{asChild:!0,className:"mt-8",children:(0,a.jsx)(jo,{to:Un.Root,children:r("ssp:pages.404.backToHomepage")})})]})})})},oae=({children:e})=>{const t=R2(),n=xb(),{permissionsLoading:r}=fu(),{isLoading:s,data:o}=Kg(),{setSelectedReseller:i}=F7(),u=(0,ey.useCurrentUser)(),p=Yh(),{setTheme:g}=Ox(),{sendPageViewEvent:v}=UA();(0,l.useEffect)(()=>{v()},[v]),(0,l.useEffect)(()=>{u?.data&&ve(u.data?.id??"",`${u?.data.firstName??""} ${u.data?.lastName??""}`,u.data.email??"")},[u?.data]),(0,l.useEffect)(()=>{t?.data?.theme&&g(t.data.theme)},[t?.data?.theme]),(0,l.useEffect)(()=>{d7(Nx.SSP,n?.data,ae.A.bff.url)},[n?.data?.icon,n?.data?.shortName]),(0,l.useEffect)(()=>{o&&i(o.id)},[o,i]),(0,l.useEffect)(()=>{o.id&&!o.isOnboarded&&!s&&(window.location.href=Un.Onboarding)},[o.isOnboarded,s]);const w=t.isLoading||u.isLoading||p.isLoading||s||r;return t.error?(0,a.jsx)(Am,{fullScreen:!0}):w?(0,a.jsx)(zs,{floating:!0}):e?(0,a.jsx)(a.Fragment,{children:e}):(0,a.jsx)(Ta,{})},aae=e=>{const{isAuthenticated:t}=(0,zr.Z)(),{isLoggedIn:n,isLoading:r,isFetching:s}=(0,zr.m)(),o=Qs(),i=Dl(),{hasAccess:u,permissionsLoading:p,permissionsFetched:g}=fu(),v=ks(),w=Ai(),{isLoading:x,hasNoActivatedOrganizations:E}=iC(),R=E&&t&&!p,{isLoading:k,isSuspended:N,selectedOrganizationUniqueName:L}=D2(),D=N&&t&&!p;return(0,l.useEffect)(()=>{const B=sy._.ForbiddenAccess;!t&&!n&&!(r||s)&&v.pathname!==Un.Login&&o(Un.Login,{state:{from:v.pathname}}),!window.location.href.includes(B)&&n&&!p&&g&&e.RequiredPermission!==void 0&&!u(e.RequiredPermission)&&e.RequiredPermission!==oe.aX.AccessToSuspendedOrganization&&o(B)},[t,n,r,g,o,p,u,e.RequiredPermission,s,v.pathname]),(0,l.useEffect)(()=>{R&&!w&&o(Un.OrganizationsNotActivated)},[R]),(0,l.useEffect)(()=>{D&&L&&e.RequiredPermission!==void 0&&!u(e.RequiredPermission)&&o(i(Un.OrganizationSuspended,{organizationUniqueName:L}))},[D]),t&&!p&&!x&&!k&&w?(0,a.jsx)(e.Page,{}):(0,a.jsx)(zs,{floating:!0})},Gc=(e,t)=>()=>(0,a.jsx)(aae,{Page:e,RequiredPermission:t}),A0=({error:e})=>e?(0,a.jsxs)("div",{"data-testid":"server-error",children:["An error occured",(0,a.jsx)("br",{}),(0,a.jsx)("pre",{children:JSON.stringify(e,void 0,2)})]}):null;var QS=(e=>(e.Inactive="Inactive",e.Active="Active",e.InvitationSent="InvitationSent",e))(QS||{}),Im=(e=>(e.BasicUser="BasicUser",e.OrganizationAdmin="OrganizationAdmin",e.ResellerAdmin="ResellerAdmin",e.InternalAdmin="InternalAdmin",e.ResellerGuest="ResellerGuest",e))(Im||{}),YS=ln(9269);const iae=(e,t)=>{const n=t.roles?.filter(r=>r.organizationId===e).map(r=>r.userRole);return{...t,roles:n}},lae=(e,t)=>t?t.map(n=>iae(e,n)):[],cae={mutationFn:async(e,t)=>await YS.g.delete({command:{organizationId:e,userId:t}})},Zme={mutationFn:async(e,t,n,r,s,o,i)=>await YS.g.invite({command:{firstName:e,lastName:t,jobTitle:n,role:s,invitedUserEmailAddress:r,organizationsIds:[o],preferredCulture:i}})},jR=()=>{const e=Io();return(0,js.I)({queryKey:im.queryKey(e?.id),queryFn:async()=>await im.queryFn(e?.id),select:t=>lae(e?.id,t),enabled:!!e,staleTime:im.staleTime})},uae=()=>{const e=Io();return(0,js.I)({queryKey:ry.queryKey(e?.id),queryFn:async()=>await ry.queryFn(e?.id),select:t=>US(t),initialData:()=>US(),enabled:!!e,refetchInterval:(t,n)=>!t||t.isRecalculating?1e3:ry.staleTime})},K3=()=>{const e=Ai(),{t}=(0,z.Bd)(),n=(0,V.jE)(),r=(0,Vo.n)({mutationFn:async s=>await cae.mutationFn(s.organizationId,s.userId),onSuccess:async()=>{(0,Yr.v0)(t("ssp:pages.users.userDeletionDialog.success")),await n.invalidateQueries({queryKey:im.queryKey(e)}),await n.invalidateQueries({queryKey:ry.queryKey(e)})}});return{deleteUser:s=>{if(!s)throw new Error("Missing user id");return r.mutate({organizationId:e??"",userId:s})},...r}},dae=()=>{const e=Ai(),{t}=(0,z.Bd)(),n=(0,V.jE)();return(0,Vo.n)({mutationFn:async r=>{if(!r.firstName||!r.lastName||!r.jobTitle||!r.email||!r.role||!r.preferredCulture)throw new Error("Missing parameters");return await YS.g.invite({command:{...r,invitedUserEmailAddress:r.email,organizationsIds:[e??""]}})},onSuccess:async()=>((0,Yr.v0)(t("ssp:pages.user.edit.success")),await n.invalidateQueries({queryKey:ry.queryKey(e)}),await n.invalidateQueries({queryKey:im.queryKey(e)}))})},fae=e=>{const t=Ai(),{t:n}=(0,z.Bd)(),r=(0,V.jE)();return(0,Vo.n)({mutationFn:async s=>{if(!e)throw new Error("Missing user id");return await b_.updateOrganizationUser({organizationId:t,userId:e??"",command:s})},onSuccess:async()=>(await r.invalidateQueries({queryKey:NE.queryKey(t,e)}),(0,Yr.v0)(n("ssp:pages.user.edit.success")),await r.invalidateQueries({queryKey:ry.queryKey(t)}),await r.invalidateQueries({queryKey:im.queryKey(t)}))})},pae=e=>{const t=Ai();return(0,js.I)({queryKey:NE.queryKey(t,e),queryFn:async()=>{if(!e||!t)throw new Error("Missing user id or organization id");return await NE.queryFn(t,e)},select:n=>({...n,role:n?.roles?.find(r=>r.organizationId===t)?.userRole}),enabled:!!t&&!!e})},G3=()=>{const e=Ai(),{t}=(0,z.Bd)(),n=(0,V.jE)();return(0,Vo.n)({mutationFn:async r=>{if(!r||!e||!r?.email)throw new Error("Missing parameters");return await YS.g.reInvite({emailAddress:r?.email,command:{organizationId:e}})},onSuccess:async()=>{(0,Yr.v0)(t("ssp:pages.users.list.resendInvitationSuccessMessage")),await n.invalidateQueries({queryKey:im.queryKey(e)})},onError:()=>{(0,Yr.A2)(t("ssp:pages.users.list.resendInvitationFailureMessage"))}})},Q3=()=>{const{t:e}=(0,z.Bd)();return t=>t?.map(n=>{switch(n){case Im.BasicUser:return e("ssp:user.userRole.basicUser");case Im.OrganizationAdmin:return e("ssp:user.userRole.organizationAdmin");case Im.ResellerAdmin:return e("ssp:user.userRole.resellerAdmin");case Im.InternalAdmin:return e("ssp:user.userRole.internalAdmin");case Im.ResellerGuest:return e("ssp:user.userRole.resellerGuest");default:return""}}).join(", ")},Y3=()=>{const{t:e}=(0,z.Bd)(),t={[QS.Active]:(0,a.jsx)(to,{variant:wo.Success,children:e("ssp:pages.users.status.Active")}),[QS.InvitationSent]:(0,a.jsx)(to,{variant:wo.Warning,children:e("ssp:pages.users.status.InvitationSent")}),[QS.Inactive]:(0,a.jsx)(to,{variant:wo.Danger,children:e("ssp:pages.users.status.Inactive")})};return n=>n?t[n]:null},hae=()=>{const{t:e}=(0,z.Bd)(),{isLoading:t,error:n,data:r}=uae(),s=t||r.isRecalculating;return(0,a.jsxs)(a.Fragment,{children:[n&&(0,a.jsx)(A0,{error:n}),r&&(0,a.jsxs)(xo,{padded:!1,className:"flex min-h-[160px] flex-col justify-between p-6",children:[(0,a.jsx)(fc,{children:e("ssp:pages.dashboard.widgets.UserCountWidget.title")}),(0,a.jsxs)(R_,{"data-testid":"cardNumberUsers",className:"mt-4 flex flex-auto",children:[!s&&(0,a.jsx)("span",{children:r.count}),s&&(0,a.jsx)(zs,{className:"h-4 w-4"})]}),r.count===0&&!s?(0,a.jsx)(Bo,{permission:oe.aX.UsersCreate,children:(0,a.jsx)(mn,{"data-testid":"btnInviteUser",variant:"primary",size:"sm",asChild:!0,children:(0,a.jsx)(jo,{to:Un.UsersInvite,className:"inline-block",children:e("ssp:pages.dashboard.widgets.UserCountWidget.addUser")})})}):(0,a.jsx)(jo,{className:"inline-block text-sm text-blue-600 underline focus-visible:outline-indigo-300",to:Un.Users,"data-testid":"linkViewUsers",children:e("ssp:pages.dashboard.widgets.UserCountWidget.viewAll")})]})]})},mae=()=>{const{t:e}=(0,z.Bd)(),{isLoading:t,error:n,data:r}=kse();return(0,a.jsxs)(a.Fragment,{children:[n&&(0,a.jsx)(A0,{error:n}),r&&(0,a.jsxs)(xo,{padded:!1,className:"flex min-h-[160px] flex-col justify-between p-6",children:[(0,a.jsx)(fc,{children:e("ssp:pages.dashboard.widgets.SubscriptionCountWidget.title")}),(0,a.jsxs)(R_,{"data-testid":"cardNumberSubscriptions",className:"mt-4 flex flex-auto",children:[!(t||r.isRecalculating)&&(0,a.jsx)("span",{children:r.count}),(t||r.isRecalculating)&&(0,a.jsx)(zs,{className:"h-4 w-4"})]}),(0,a.jsx)(jo,{className:"inline w-fit text-sm text-indigo-600 underline focus-visible:outline-indigo-300",to:Un.Subscriptions,"data-testid":"linkViewSubscriptions",children:e("ssp:pages.dashboard.widgets.SubscriptionCountWidget.viewAll")})]})]})};/**
 * @license lucide-react v0.330.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const gae=l0("CheckCircle",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);var DR=(e=>(e.Subscriber="Subscriber",e.User="User",e.LicenseUpdate="LicenseUpdate",e))(DR||{}),X3=(e=>(e.NotApplicable="NotApplicable",e.Pending="Pending",e.Failure="Failure",e))(X3||{});function Z3(e,t){return!t.assignedLicenses?.some(n=>n===e.id)&&t.licenseUpdates?.some(n=>n.licenseId===e.id&&n.updateStatus==="Pending")}const vae=(e,t,n)=>({...e,vendorName:n,lastSyncedOn:t}),yae=e=>e?.licenses?e.licenses.map(t=>vae(t,e.lastSyncedOn,e.vendorName)):[],bae=e=>e?e.flatMap(yae):[],wae=e=>({...e,type:Sae(e.type)}),xae=e=>e?.subscribers?e.subscribers.map(t=>wae(t)):[],_ae=e=>e?e.flatMap(xae):[],Sae=e=>DR[e],Cae=(e,t)=>e?.find(n=>n.vendorName===t)?.domains?.map(n=>({...n,vendorName:t}))??[],J3=e=>({isRecalculating:e?.isRecalculating??!0,currentUserLicensesCount:e?.currentUserLicensesCount??0,currentUserLicenses:e?.currentUserLicenses??[]}),eF=e=>({isRecalculating:e?.isRecalculating??!0,unusedLicensesCount:e?.unusedLicensesCount??0,unusedLicenses:e?.unusedLicenses?.map(t=>({name:t?.name??"",unusedLicenseCount:t?.unusedLicenseCount??0}))??[]}),Eae={mutationFn:async e=>await om.refresh({organizationId:e})},Tae={mutationFn:async(e,t)=>await om.updateLicenseSubscribers({organizationId:e,command:{...t}})},kae={mutationFn:async(e,t)=>await om.dismissErroneousUpdate({organizationId:e,licenseUpdateId:t})},Rae=()=>{const e=Io();return(0,js.I)({queryKey:v_.queryKey(e?.id),queryFn:async()=>await v_.queryFn(e?.id),enabled:!!e,initialData:()=>J3(),select:t=>J3(t),refetchInterval:(t,n)=>!t||t.isRecalculating?1e3:v_.staleTime})},Pae=()=>{const e=Io();return(0,js.I)({queryKey:y_.queryKey(e?.id),queryFn:async()=>await y_.queryFn(e?.id),enabled:!!e,initialData:()=>eF(),select:t=>eF(t),refetchInterval:(t,n)=>!t||t.isRecalculating?1e3:y_.staleTime})},MR=()=>{const e=Io();return(0,js.I)({queryKey:ny.queryKey(e?.id),queryFn:async()=>await ny.queryFn(e?.id),enabled:!!e,select:t=>bae(t),staleTime:ny.staleTime})},Oae=({reload:e=!1,...t}={})=>{const n=Io(),{data:r,isLoading:s,isFetched:o,...i}=(0,js.I)({queryKey:Fb.queryKey(n?.id),queryFn:async()=>await Fb.queryFn(n?.id),enabled:!!n});return{data:r,isFetched:o,isLoading:s,...i}},tF=e=>{const t=Io();return(0,js.I)({queryKey:g_.queryKey(t?.id),queryFn:async()=>await g_.queryFn(t?.id),enabled:!!t,refetchOnMount:!1,staleTime:g_.staleTime,...e})},Nae=e=>tF({select:t=>Cae(t,e)}),Aae=()=>tF({select:e=>_ae(e)}),nF=()=>{const e=Ai(),t=(0,V.jE)(),n=(0,Vo.n)({mutationFn:async r=>await Tae.mutationFn(e??"",r),onSuccess:async(r,s)=>{await t.invalidateQueries(ny.queryKey(e)),await t.invalidateQueries(g_.queryKey(e)),await t.invalidateQueries(Fb.queryKey(e))}});return{updateLicenses:async r=>{if(await n.mutateAsync(r),n.isError)throw n.error},...n}},rF=()=>{const{t:e}=(0,z.Bd)(),t=Ai(),n=(0,V.jE)();return(0,Vo.n)({mutationFn:async()=>{if(!t)throw(0,oo.XY)();return await Eae.mutationFn(t)},onSuccess:async()=>{await n.invalidateQueries({queryKey:[ny.queryKey(t)]}),(0,Yr.v0)(e("ssp:pages.licenses.refresh.successMessage"))},onError:()=>{(0,Yr.A2)(e("ssp:pages.licenses.refresh.failureMessage"))}})},Iae=()=>{const e=Ai(),t=(0,V.jE)(),n=(0,Vo.n)({mutationFn:async r=>await kae.mutationFn(e??"",r),onSuccess:async(r,s)=>{t.setQueryData(Fb.queryKey(e),o=>o?o.filter(i=>i.licenseUpdateId!==s):[]),await t.invalidateQueries(Fb.queryKey(e))}});return{dismissLicenseUpdate:async r=>{if(await n.mutateAsync(r??""),n.isError)throw n.error},...n}},jae=()=>{const{t:e}=(0,z.Bd)(),{isLoading:t,error:n,data:r}=Rae(),s=3;return(0,a.jsxs)(a.Fragment,{children:[n&&(0,a.jsx)(A0,{error:n}),r&&(0,a.jsxs)(xo,{padded:!1,className:"flex min-h-[160px] flex-col justify-between p-6",children:[(0,a.jsx)(fc,{children:e("ssp:pages.dashboard.widgets.CurrentUserLicenseCountWidget.title")}),(0,a.jsxs)(R_,{"data-testid":"cardContentLicenses",className:"mt-4 flex flex-auto",children:[!(t||r.isRecalculating)&&(0,a.jsxs)("div",{className:"grid grid-cols-[auto_auto] gap-x-8",children:[(0,a.jsx)("span",{children:r.currentUserLicensesCount}),(0,a.jsx)("div",{className:"text-sm font-normal not-italic text-slate-700",children:(0,a.jsxs)("div",{className:"grid auto-rows-min grid-cols-[auto_auto] gap-x-1 gap-y-0.5",children:[kA(r.currentUserLicenses,s).map(o=>(0,a.jsxs)(l.Fragment,{children:[(0,a.jsx)(gae,{className:"h-4"}),(0,a.jsx)("span",{className:"truncate",children:o})]},o?.trim())),(0,a.jsx)("span",{}),r.currentUserLicenses?.length>s&&e("ssp:pages.dashboard.widgets.CurrentUserLicenseCountWidget.more",{count:r.currentUserLicenses.length-s})]})})]}),(t||r.isRecalculating)&&(0,a.jsx)(zs,{className:"h-4 w-4"})]}),(0,a.jsx)(jo,{className:"inline w-fit text-sm text-indigo-600 underline focus-visible:outline-indigo-300",to:Un.Licenses,"data-testid":"linkViewLicenses",children:e("ssp:pages.dashboard.widgets.CurrentUserLicenseCountWidget.viewAll")})]})]})},Dae=()=>{const{t:e}=(0,z.Bd)(),{isLoading:t,error:n,data:r}=Pae(),s=3;return(0,a.jsxs)(a.Fragment,{children:[n&&(0,a.jsx)(A0,{error:n}),r&&(0,a.jsxs)(xo,{padded:!1,className:"flex min-h-[160px] flex-col justify-between p-6",children:[(0,a.jsx)(fc,{children:e("ssp:pages.dashboard.widgets.UnusedLicenseCountWidget.title")}),(0,a.jsxs)(R_,{"data-testid":"cardContentUnusedLicenses",className:"mt-4 flex flex-auto",children:[!(t||r.isRecalculating)&&(0,a.jsxs)("div",{className:"grid grid-cols-[auto_auto] gap-x-8",children:[(0,a.jsx)("span",{children:r.unusedLicensesCount}),(0,a.jsx)("div",{className:"text-sm font-normal not-italic text-slate-700 dark:text-white",children:(0,a.jsxs)("div",{className:"grid auto-rows-min grid-cols-1 gap-x-1 gap-y-0.5",children:[kA(r.unusedLicenses,s).map(o=>(0,a.jsxs)("div",{className:"flex",children:[(0,a.jsx)("span",{className:"truncate",children:o.name}),(0,a.jsxs)("span",{className:"ml-1 font-semibold",children:["(",o.unusedLicenseCount,")"]})]},`${o.name.trim()}`)),r.unusedLicenses?.length>s&&e("ssp:pages.dashboard.widgets.UnusedLicenseCountWidget.more",{count:r.unusedLicenses.length-s})]})})]}),(t||r.isRecalculating)&&(0,a.jsx)(zs,{className:"h-4 w-4"})]}),(0,a.jsx)(jo,{className:"inline w-fit text-sm text-indigo-600 underline focus-visible:outline-indigo-300",to:Un.Licenses,"data-testid":"linkViewUnusedLicenses",children:e("ssp:pages.dashboard.widgets.UnusedLicenseCountWidget.viewAll")})]})]})},Mae=Gc(()=>{const{t:e}=(0,z.Bd)(),{data:t}=(0,ey.useCurrentUser)(),{data:n}=xb(),r=n.resellerName,s=t?.firstName;return(0,a.jsx)(Wc,{children:(0,a.jsxs)("div",{className:"flex flex-col gap-12 md:gap-16",children:[(0,a.jsx)(yl,{title:(0,a.jsx)(el,{"data-testid":"pageDashboardTitle",children:e("ssp:pages.dashboard.title",{userFirstName:s})}),subTitle:(0,a.jsx)(qu,{children:e("ssp:pages.dashboard.pageDescription",{resellerName:r})})}),(0,a.jsx)("div",{className:"grid grid-cols-1 gap-4 lg:gap-6 xl:grid-cols-1","data-testid":"containerDashboard",children:(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2  lg:grid-cols-3 lg:gap-6 xl:grid-cols-4",children:[(0,a.jsx)(Bo,{permission:oe.aX.UsersList,children:(0,a.jsx)(hae,{})}),(0,a.jsx)(Bo,{permission:oe.aX.SubscriptionList,children:(0,a.jsx)(mae,{})}),(0,a.jsxs)(Bo,{permission:oe.aX.LicenseList,children:[(0,a.jsx)(jae,{}),(0,a.jsx)(Dae,{})]})]})})]})})}),$ae=({className:e})=>{const{t}=(0,z.Bd)();return(0,a.jsx)(Zv,{className:"dark:bg-slate-900",children:(0,a.jsx)("div",{"data-testid":"error-401",className:st("h-full",e),children:(0,a.jsxs)("div",{className:"mx-auto flex max-w-2xl flex-col items-center text-center",children:[(0,a.jsx)(Td,{className:"mx-auto mt-20 w-12 text-red-600 sm:mt-24"}),(0,a.jsx)("p",{className:"text-base font-semibold leading-8 dark:text-white",children:"401"}),(0,a.jsx)("h1",{className:"mt-4 text-3xl font-bold tracking-tight text-gray-900 dark:text-white sm:text-5xl",children:t("ssp:pages.401.title")}),(0,a.jsx)("p",{className:"mt-4 text-base leading-7 text-gray-600 dark:text-white sm:mt-6 sm:text-lg sm:leading-8",children:t("ssp:pages.401.description")}),(0,a.jsx)(mn,{asChild:!0,className:"mt-8",children:(0,a.jsx)(jo,{to:Un.Login,children:t("ssp:pages.401.backToLogin")})})]})})})},Lae=({className:e})=>{const{t}=(0,z.Bd)(),{isAuthenticated:n}=(0,zr.Z)(),r=n?Wc:Zv;return(0,a.jsx)(r,{className:"dark:bg-slate-900",children:(0,a.jsx)("div",{"data-testid":"error-403",className:st("h-full",e),children:(0,a.jsxs)("div",{className:"mx-auto flex max-w-2xl flex-col items-center text-center",children:[(0,a.jsx)(Td,{className:"mx-auto mt-20 w-12 text-red-600 sm:mt-24"}),(0,a.jsx)("p",{className:"text-base font-semibold leading-8 dark:text-white",children:"403"}),(0,a.jsx)("h1",{className:"mt-4 text-3xl font-bold tracking-tight text-gray-900 dark:text-white sm:text-5xl",children:t("ssp:pages.403.title")}),(0,a.jsx)("p",{className:"mt-4 text-base leading-7 text-gray-600 dark:text-white sm:mt-6 sm:text-lg sm:leading-8",children:t("ssp:pages.403.description")}),(0,a.jsx)(mn,{asChild:!0,className:"mt-8",children:(0,a.jsx)(jo,{to:Un.Dashboard,children:t("ssp:pages.403.backToHomepage")})})]})})})},sF={ticketTypeId:void 0,title:"",description:""},Fae=10,oF=100,aF=700,zae="too_big",iF=e=>e?.type===zae,lF=()=>{document.body.setAttribute("data-scroll-locked","true")},Uae=({isLoading:e,onRedirectToHelpDesk:t})=>{const{t:n}=(0,z.Bd)(),r=xa();lF();const s=EE();return(0,a.jsxs)("div",{className:"flex w-full flex-col gap-6",children:[(0,a.jsx)(Jr,{control:r.control,name:"ticketTypeId",render:({field:o})=>(0,a.jsxs)(qr,{children:[(0,a.jsxs)(As,{"data-testid":"labelHelpDeskCreateTicketRequestType",children:[n("ssp:pages.helpdesk.create.requestType"),"*"]}),(0,a.jsxs)(h0,{disabled:e,onOpenChange:lF,value:o.value,onValueChange:o.onChange,children:[(0,a.jsx)(Kr,{children:(0,a.jsx)(wm,{autoFocus:!0,"data-testid":"selectTriggerRequestType",children:(0,a.jsx)(m0,{placeholder:n("ssp:pages.helpdesk.create.requestTypePlaceholder")})})}),(0,a.jsx)(xm,{side:"bottom",children:s?.data?.map(i=>(0,a.jsx)(_m,{value:i.id??"","data-testid":"selectItemTicketType",children:i.name},i.name))})]}),(0,a.jsx)(Cs,{})]})}),(0,a.jsx)(Jr,{control:r.control,name:"title",render:({field:o})=>(0,a.jsxs)(qr,{children:[(0,a.jsxs)("div",{className:"flex w-full justify-between",children:[(0,a.jsxs)(As,{"data-testid":"labelHelpDeskCreateTicketTitle",children:[n("ssp:pages.helpdesk.create.title"),"*"]}),(0,a.jsxs)(mT,{"data-testid":"descriptionHelpDeskCreateTicketTitle",className:st("text-slate-500",{[U_()]:iF(r.formState.errors?.title)}),children:[o.value.length,"/",oF]})]}),(0,a.jsx)(Kr,{children:(0,a.jsx)(_a,{...o,disabled:e,"data-testid":"inputHelpDeskCreateTicketTitle",placeholder:n("ssp:pages.helpdesk.create.titlePlaceholder")})}),(0,a.jsx)(Cs,{})]})}),(0,a.jsx)(Jr,{control:r.control,name:"description",render:({field:o})=>(0,a.jsxs)(qr,{children:[(0,a.jsxs)("div",{className:"flex w-full justify-between",children:[(0,a.jsx)(As,{children:n("ssp:pages.helpdesk.create.description")}),(0,a.jsxs)(mT,{"data-testid":"descriptionHelpDeskCreateTicketDescription",className:st("text-slate-500",{[U_()]:iF(r.formState.errors?.description)}),children:[o?.value?.length,"/",aF]})]}),(0,a.jsx)(Kr,{children:(0,a.jsx)(Aw,{...o,disabled:e,"data-testid":"inputHelpDeskCreateTicketDescription",placeholder:n("ssp:pages.helpdesk.create.descriptionPlaceholder")})}),(0,a.jsx)(Cs,{})]})}),(0,a.jsxs)("div",{className:"flex w-full justify-end gap-x-2",children:[(0,a.jsx)(mn,{className:"px-4 py-2",type:"button",variant:No.Outline,disabled:e,onClick:t,"data-testid":"btnCreateRequestCancel",children:n("ssp:actions.cancel")}),(0,a.jsx)(mn,{type:"submit",className:"px-4 py-2",variant:No.Primary,disabled:e,"data-testid":"btnCreateRequestSend",children:n("ssp:pages.helpdesk.create.send")})]})]})},Bae=()=>tl({ticketTypeId:yc(Ds()).refine(e=>e!==void 0,"core:formValidation.required"),title:Ds().trim().min(1,{message:"core:formValidation.required"}).max(oF,{message:"ssp:pages.helpdesk.create.titleMaxCharactersError"}),description:yc(Ds().trim().max(aF,{message:"ssp:pages.helpdesk.create.descriptionMaxCharactersError"}))}),Vae=({onRedirectToHelpDesk:e})=>{const{t}=(0,z.Bd)(),n=Bae(),r=hc({mode:"onSubmit",resolver:mc(n),defaultValues:sF}),s=EE(),o=s.isLoading||!s?.data,i=IV(),u=g=>i.mutate(g),p=(0,l.useCallback)(()=>{r.reset(sF),e()},[r,e]);return(0,l.useEffect)(()=>{i?.isSuccess&&p()},[p,i?.isSuccess]),Af({isDirty:r.formState.isDirty,title:t("ssp:pages.helpdesk.create.prompt.title"),children:t("ssp:pages.helpdesk.create.prompt.body"),onConfirm:p}),o?(0,a.jsx)(zs,{className:"absolute left-[calc(50%-3rem)] top-[calc(50%-3rem)]"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(Vu,{className:"bg-slate-300 dark:bg-slate-700"}),(0,a.jsxs)("div",{className:st("px-6 pb-4 py-6",{"bg-background/80 opacity-50 backdrop-blur-sm":i?.isLoading}),children:[i?.isLoading?(0,a.jsx)(zs,{className:"absolute left-[calc(50%-3rem)] top-[calc(50%-3rem)]"}):null,(0,a.jsx)("div",{className:"flex w-full flex-row justify-between",children:(0,a.jsx)(gc,{...r,children:(0,a.jsx)("form",{className:"w-full",onSubmit:r.handleSubmit(u),children:(0,a.jsx)(Uae,{isLoading:i?.isLoading,onRedirectToHelpDesk:e})})})})]})]})},Hae=Gc(()=>{const{t:e}=(0,z.Bd)(),t=IA(),n=p_(),r=(0,l.useCallback)(()=>{t()},[t]);return n?.data!==void 0&&!n?.data&&!n.isLoading?(0,a.jsx)(Am,{}):(0,a.jsx)(ls,{title:(0,a.jsx)(Pn,{variant:"heading6",weight:"bold",className:"text-wrap",children:e("ssp:pages.helpdesk.create.newRequest")}),onClose:r,children:(0,a.jsx)(Vae,{onRedirectToHelpDesk:r})})},oe.aX.HelpDeskEdit),$R=({status:e})=>{const t={[oe.B_.New]:(0,a.jsx)(to,{variant:wo.Success,children:e?.name}),[oe.B_.Closed]:(0,a.jsx)(to,{variant:wo.Default,children:e?.name}),[oe.B_.WaitingForCustomer]:(0,a.jsx)(to,{variant:wo.Warning,children:e?.name}),[oe.B_.Resolved]:(0,a.jsx)(to,{variant:wo.Default,className:"border-blue-600/10 bg-blue-100 dark:border-blue-800 dark:text-blue-600",children:e?.name}),[oe.B_.Processing]:(0,a.jsx)(to,{variant:wo.Info,children:e?.name})};return e?t[e.type]:null};var Wae=ln(3764),qae=ln.n(Wae);const LR=({className:e,content:t,...n})=>{const r=qae().sanitize(t,{ADD_ATTR:["target"]});return(0,a.jsx)("div",{"data-testid":"markdown-viewer",className:st("markdown-content",lN(n),e),dangerouslySetInnerHTML:{__html:r}})},Kae={type:"output",filter:e=>e.replace(/>\s*\n\s*</g,"><")},cF=()=>{const[e,t]=(0,l.useState)(null),[n,r]=(0,l.useState)(!0);return(0,l.useEffect)(()=>{let o=!0;return o&&ln.e(942).then(ln.t.bind(ln,9942,23)).then(i=>{t(new i.default.Converter({openLinksInNewWindow:!0,extensions:[Kae]})),r(!1)}).catch(i=>{console.error("failed to load showdown",i),r(!1)}),()=>{o=!1}},[]),{converter:e,isLoading:n,convertMarkdown:o=>e&&o?e.makeHtml(o):""}};function Gae({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 12 3.269 3.125A59.769 59.769 0 0 1 21.485 12 59.768 59.768 0 0 1 3.27 20.875L5.999 12Zm0 0h7.5"}))}const Qae=l.forwardRef(Gae),Yae=({onScrollToLastMessage:e})=>{const{t}=(0,z.Bd)(),{helpDeskTicketId:n}=jf(),[r,s]=(0,l.useState)(""),o=jV();Af({isDirty:r!==""}),(0,l.useEffect)(()=>{o.isSuccess&&(s(""),e())},[o.isSuccess,e]);const i=()=>{r!==""&&o.mutate({text:r,ticketId:n??""})};return(0,a.jsxs)("div",{className:"flex w-full items-end justify-between gap-2 px-6 py-4",children:[(0,a.jsx)("div",{className:"relative w-full",children:(0,a.jsx)(EL,{autoComplete:"off",autoFocus:!0,minHeight:80,value:r,name:"message","data-testid":"inputHelpDeskTicketNote",disabled:o.isLoading,onChange:u=>s(u?.target.value),placeholder:t("ssp:pages.helpdesk.detail.replyPlaceholder"),className:"flex h-9 w-full items-center border bg-background"})}),(0,a.jsx)(Di,{variant:No.None,onClick:i,dataTestId:"btnHelpDeskTicketSendNote",className:"rounded-full p-4 text-indigo-600 enabled:hover:bg-slate-100 enabled:hover:dark:bg-slate-950",loaderClassName:"h-5 w-5",isLoading:o.isLoading,loaderDataTestId:"loaderHelpDeskSendNote",loadingChildren:(0,a.jsx)(a.Fragment,{}),children:o.isLoading?null:(0,a.jsx)(Qae,{className:"h-5 w-5"})})]})},Xae=({notes:e})=>{const t=(0,l.useRef)(null),{i18n:{language:n}}=(0,z.Bd)(),r=bl(n,Kp.datetime),{isLoading:s,convertMarkdown:o}=cF(),i=(0,l.useCallback)(()=>{t?.current?.scrollIntoView(!1)},[]);return(0,l.useLayoutEffect)(()=>{s||i()},[s,i,t]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(Vu,{decorative:!1,className:"bg-slate-300 dark:bg-slate-700"}),(0,a.jsxs)("div",{className:"flex h-full w-full flex-col justify-between overflow-y-auto overflow-x-hidden",children:[s?(0,a.jsx)(zs,{className:"absolute left-[calc(50%-3rem)] top-[calc(50%-3rem)] z-10"}):(0,a.jsx)(o0,{children:(0,a.jsx)("div",{ref:t,className:"flex flex-col gap-4",children:e?.map(u=>(0,a.jsx)("div",{className:st("flex flex-col gap-2 px-6 whitespace-pre-wrap first:mt-8 last:mb-8",u.isCurrentUserNote?"items-end text-right":"items-start"),children:(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[u.isCurrentUserNote?null:(0,a.jsx)($l,{tooltip:u.createdByName??u.createdByEmail,children:(0,a.jsx)(jp,{className:"flex items-center justify-center",children:(0,a.jsx)(Dp,{className:"dark:bg-slate-950 dark:text-slate-200",children:Mp(u.createdByName??u.createdByEmail)})})}),(0,a.jsxs)("div",{className:"flex flex-col gap-y-1 break-words",children:[(0,a.jsx)(LR,{content:o(u.text),variant:"body2",className:st("max-w-xs rounded-md p-3 min-w-[100px]",{"bg-blue-500 text-white":u.isCurrentUserNote,"bg-slate-100 text-black dark:bg-slate-950 dark:text-white":!u.isCurrentUserNote})}),(0,a.jsx)("div",{className:"flex w-full justify-end gap-2",children:(0,a.jsx)(Pn,{variant:"label",colors:"light",children:r(u?.createdDate)})})]})]})},u.id))})}),(0,a.jsx)(Bo,{permission:oe.aX.HelpDeskEdit,children:(0,a.jsx)(Yae,{onScrollToLastMessage:i})})]})]})},Zae=()=>{const{helpDeskTicketId:e}=jf(),{t,i18n:{language:n}}=(0,z.Bd)(),r=bl(n,Kp.datetime),s=DA({},e),o=m_(),i=h_(),u=s?.data?.notes,p=s?.data?.statusId,g=[{label:t("ssp:pages.helpdesk.detail.id"),value:s?.data?.id},{label:t("ssp:pages.helpdesk.detail.createdBy"),value:s?.data?.openedByName??s?.data?.openedByEmail},{label:t("ssp:pages.helpdesk.detail.type"),value:i?.data?.[s?.data?.ticketTypeId??""]?.name}],v=[{label:t("ssp:pages.helpdesk.detail.status"),value:(0,a.jsx)($R,{status:o?.data?.[p??""]})},{label:t("ssp:pages.helpdesk.detail.createdAt"),value:r(s?.data?.createdAt)},{label:t("ssp:pages.helpdesk.detail.lastUpdate"),value:r(s?.data?.lastUpdated)}];return s?.data?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(Vu,{className:"bg-slate-300 dark:bg-slate-700"}),(0,a.jsx)("div",{className:"flex flex-col",children:(0,a.jsx)(Nm,{type:"single",collapsible:!0,defaultValue:u&&u?.length>1?"":"ticket-detail",children:(0,a.jsxs)(Xp,{value:"ticket-detail",className:"flex flex-col-reverse",children:[(0,a.jsx)(Zp,{className:"flex justify-center py-2 dark:bg-transparent dark:hover:bg-slate-950/50"}),(0,a.jsx)(Jp,{className:"[&>div]:pb-0",children:(0,a.jsxs)("div",{className:"flex justify-between p-6 pb-0",children:[(0,a.jsx)("div",{className:"flex flex-col",children:(0,a.jsx)("div",{className:"flex flex-col justify-between gap-4",children:g.map(({label:w,value:x})=>(0,a.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,a.jsx)(Pn,{variant:"body2",colors:"light",as:"div",children:w}),(0,a.jsx)(Pn,{variant:"body2",as:"div",children:x})]},w))})}),(0,a.jsx)("div",{className:"flex flex-col",children:(0,a.jsx)("div",{className:"flex flex-col justify-between gap-4",children:v.map(({label:w,value:x})=>(0,a.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,a.jsx)(Pn,{variant:"body2",colors:"light",as:"div",children:w}),(0,a.jsx)(Pn,{variant:"body2",as:"div",children:x})]},w))})})]})})]})})}),(0,a.jsx)(Xae,{notes:u})]}):null},Jae=Gc(()=>{const{helpDeskTicketId:e}=ma(),t=p_(),n=DA({refetchOnMount:!0,staleTime:0},e),r=m_(),s=r?.isLoading||!r?.data,o=h_(),i=o.isLoading||!o?.data,u=IA(),p=(0,l.useCallback)(()=>{u()},[u]),g=s||i||n.isLoading;return t?.data!==void 0&&!t?.data&&!t.isLoading?(0,a.jsx)(Am,{}):(0,a.jsxs)(ls,{isLoading:g,title:(0,a.jsx)(Pn,{variant:"heading6",weight:"bold",className:"text-wrap",children:n?.data?.subject}),onClose:p,children:[n.isFetching?(0,a.jsx)(zs,{dataTestId:"layoverSpinnner",className:"absolute left-[calc(50%-3rem)] top-[calc(50%-3rem)] z-10"}):null,(0,a.jsx)(Zae,{})]})},oe.aX.HelpDeskDetails),eie=()=>{const{t:e}=(0,z.Bd)();return(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(Bo,{permission:oe.aX.HelpDeskEdit,children:(0,a.jsx)("div",{className:"flex w-full justify-end",children:(0,a.jsx)(mn,{variant:"primary","data-testid":"btnHelpDeskCreateTicket",size:"sm",asChild:!0,children:(0,a.jsx)(jo,{to:Un.HelpDeskCreate,className:"rounded-lg focus-visible:outline-indigo-300",children:e("ssp:pages.helpdesk.create.newRequest")})})})}),(0,a.jsxs)("div",{className:"flex w-full flex-col items-center justify-center gap-4 rounded-lg border-2 border-dashed border-gray-300 p-8 font-normal text-gray-400 md:h-60","data-testid":"containerNoTickets",children:[(0,a.jsx)(Ny,{className:"h-16 w-16 stroke-1 text-gray-400"}),(0,a.jsx)("p",{children:e("ssp:pages.helpdesk.emptyMessage")})]})]})},tie=()=>{const{t:e}=(0,z.Bd)(),n=Kg()?.data?.supportInformation?.email??"";return(0,a.jsx)(TE,{showSidebar:!0,title:e("ssp:pages.helpdesk.notReady.title"),content:e("ssp:pages.helpdesk.notReady.description"),children:n!==""?(0,a.jsx)(mn,{variant:"None",className:"mt-4 bg-indigo-600 px-4 py-2 hover:bg-indigo-700","data-testid":"btnContactReseller",asChild:!0,children:(0,a.jsx)("a",{href:"mailto:"+n,children:e("ssp:pages.helpdesk.notReady.contact")})}):null})},nie=({ticketId:e})=>{const{t}=(0,z.Bd)(),n=AA({helpDeskTicketId:e??""});return(0,a.jsx)("div",{className:"flex justify-center",children:(0,a.jsx)(Bo,{permission:oe.aX.HelpDeskDetails,children:(0,a.jsx)($l,{tooltip:t("ssp:pages.helpdesk.detail.show"),children:(0,a.jsx)(mn,{asChild:!0,className:"p-0",variant:"none","data-testid":"btnHelpDeskTicketShowDetail",children:(0,a.jsx)(jo,{to:Un.HelpDeskTicketDetail,params:n,children:(0,a.jsx)(KS,{className:"h-5 w-5 stroke-1 text-indigo-500 dark:stroke-2"})})})})})})},rie=({subject:e,openedByName:t})=>{const{t:n}=(0,z.Bd)();return(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)(Pn,{className:"line-clamp-2",variant:"body2",weight:"semiBold",children:e}),(0,a.jsx)("div",{className:"flex whitespace-nowrap",children:(0,a.jsx)(Pn,{variant:"label",colors:"light",children:t?(0,a.jsxs)(a.Fragment,{children:[n("ssp:pages.helpdesk.list.columns.createdBy"),"\xA0",t]}):null})})]})},sie=e=>(0,a.jsx)($R,{status:e}),oie=(e,t)=>(0,a.jsx)(rie,{subject:e,openedByName:t}),aie=e=>(0,a.jsx)(nie,{ticketId:e}),iie=()=>{const{t:e,i18n:{language:t}}=(0,z.Bd)(),n=bl(t),r=CE(),s=r?.isLoading||!r?.data,o=m_(),i=o?.isLoading||!o?.data,u=h_(),p=u.isLoading||!u?.data,g=[{accessorKey:"id",header:e("ssp:pages.helpdesk.list.columns.ticketId"),maxSize:20,meta:{className:"text-center align-top"}},{id:"subject",header:e("ssp:pages.helpdesk.list.columns.subject"),minSize:800,meta:{className:"max-w-xl"},cell:({row:v})=>oie(v?.original?.subject,v?.original?.openedByName)},{accessorKey:"lastUpdated",header:e("ssp:pages.helpdesk.list.columns.lastUpdated"),enableSorting:!0,cell:({getValue:v})=>n(v()),minSize:180,meta:{className:"whitespace-nowrap"}},{accessorKey:"ticketTypeId",header:e("ssp:pages.helpdesk.list.columns.ticketType"),enableSorting:!0,cell:({getValue:v})=>u?.data?.[v()]?.name,minSize:145,meta:{className:"whitespace-nowrap"}},{accessorKey:"statusId",header:e("ssp:pages.helpdesk.list.columns.status"),enableSorting:!0,cell:({row:v})=>sie(o?.data?.[v.original?.statusId]),minSize:145},{id:"actions",cell:({row:v})=>aie(v.original?.id),maxSize:145}];return(0,a.jsx)(xo,{padded:!0,children:i||p||s?(0,a.jsx)(Hp,{}):(0,a.jsx)(ky,{columns:g,data:r?.data,rowsPerPage:Fae,optionalActions:(0,a.jsx)(Bo,{permission:oe.aX.HelpDeskEdit,children:(0,a.jsx)("div",{className:"flex w-full justify-end",children:(0,a.jsx)(mn,{variant:"primary","data-testid":"btnHelpDeskCreateTicket",size:"sm",asChild:!0,children:(0,a.jsx)(jo,{to:Un.HelpDeskCreate,className:"rounded-lg focus-visible:outline-indigo-300",children:e("ssp:pages.helpdesk.create.newRequest")})})})}),dataTestId:"tableHelpdeskTickets"})})};function lie({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.5 6v.75m0 3v.75m0 3v.75m0 3V18m-9-5.25h5.25M7.5 15h3M3.375 5.25c-.621 0-1.125.504-1.125 1.125v3.026a2.999 2.999 0 0 1 0 5.198v3.026c0 .621.504 1.125 1.125 1.125h17.25c.621 0 1.125-.504 1.125-1.125v-3.026a2.999 2.999 0 0 1 0-5.198V6.375c0-.621-.504-1.125-1.125-1.125H3.375Z"}))}const cie=l.forwardRef(lie),uie=()=>{const{t:e,i18n:{language:t}}=(0,z.Bd)(),n=bl(t),r=Io(),s=CE(),o=s?.isLoading||!s?.data,i=m_(),u=i.isLoading||!i?.data,p=h_(),g=p.isLoading||!p?.data;return(0,a.jsx)(xo,{padded:!0,children:g||u||o?(0,a.jsx)(Hp,{count:2}):(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(Bo,{permission:oe.aX.HelpDeskEdit,children:(0,a.jsx)("div",{className:"mb-4 flex justify-end gap-4",children:(0,a.jsx)(mn,{variant:"primary",size:"sm","data-testid":"btnHelpDeskCreateTicketMobile",asChild:!0,children:(0,a.jsx)(jo,{to:Un.HelpDeskCreate,className:"rounded-lg focus-visible:outline-indigo-300",children:(0,a.jsx)(cie,{className:"h-4 w-4"})})})})}),s?.data?.map(v=>(0,a.jsx)(Nm,{type:"single",collapsible:!0,children:(0,a.jsxs)(Xp,{value:"item-1",children:[(0,a.jsx)(Zp,{className:`relative justify-between
                    truncate rounded-xl bg-white p-4 [&>div]:overflow-hidden
                    [&[data-state=open]>div>div]:hidden [&[data-state=open]]:rounded-b-none`,children:(0,a.jsx)(Pn,{variant:"body1",className:"truncate",children:v.subject})}),(0,a.jsx)(Jp,{children:(0,a.jsxs)(N0,{children:[(0,a.jsx)(Js,{label:e("ssp:pages.helpdesk.list.columns.createdBy"),value:v?.openedByName??v.openedByEmail,dataTestId:"accCreatedByHelpDeskTicket"}),(0,a.jsx)(Js,{label:e("ssp:pages.helpdesk.list.columns.lastUpdated"),value:n(v.lastUpdated),dataTestId:"accLastUpdatedHelpDeskTicket"}),(0,a.jsx)(Js,{label:e("ssp:pages.helpdesk.list.columns.ticketType"),value:p?.data?.[v.ticketTypeId]?.name,dataTestId:"accTicketTypeHelpDeskTicket"}),(0,a.jsx)(Js,{label:e("ssp:pages.helpdesk.list.columns.status"),value:(0,a.jsx)($R,{status:i?.data?.[v.statusId]}),dataTestId:"accStatusHelpDeskTicket"}),(0,a.jsx)(Js,{label:" ",value:(0,a.jsx)(Bo,{permission:oe.aX.HelpDeskDetails,children:(0,a.jsx)($l,{tooltip:"View detail",children:(0,a.jsx)(mn,{asChild:!0,className:"gap-1 p-0",variant:"none","data-testid":"btnHelpDeskTicketMobileShowDetail",children:(0,a.jsxs)(jo,{to:Un.HelpDeskTicketDetail,params:{organizationUniqueName:r?.uniqueName??"",helpDeskTicketId:v?.id??""},children:[(0,a.jsx)(KS,{className:"h-5 w-5 stroke-1 text-indigo-500 dark:stroke-2"}),(0,a.jsx)("span",{className:"text-indigo-500",children:e("ssp:pages.helpdesk.detail.show")})]})})})})})]})})]})},v.id))]})})},die=Gc(()=>{const{t:e}=(0,z.Bd)(),t=Kg(),n=t?.isLoading||!t?.data,r=jA(),s=CE(),o=p_(),i=r?.isLoading||r?.data===void 0,u=s?.isLoading||!s?.data,p=!s?.isLoading&&!!s?.data&&s?.data?.length===0;return o?.data!==void 0&&!o?.data&&!o.isLoading?(0,a.jsx)(Am,{showSidebar:!0}):!r?.data?.isPsaAvailable&&!i&&!o.isLoading?(0,a.jsx)(tie,{}):(0,a.jsxs)(Wc,{children:[i||n||u?(0,a.jsx)(zs,{floating:!0}):(0,a.jsxs)("div",{className:"flex flex-col gap-12 md:gap-16",children:[(0,a.jsx)(yl,{title:(0,a.jsx)(el,{"data-testid":"pageHelpDeskTitle",children:e("ssp:pages.helpdesk.title")}),subTitle:(0,a.jsx)(qu,{children:e("ssp:pages.helpdesk.subTitle")})}),p?(0,a.jsx)(eie,{}):null,s?.data?.length>0?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"hidden lg:block","data-testid":"containerHelpDeskTable",children:(0,a.jsx)(iie,{})}),(0,a.jsx)("div",{className:"mt-4 lg:hidden","data-testid":"containerHelpDeskTableMobile",children:(0,a.jsx)(uie,{})})]}):null]}),(0,a.jsx)(Ta,{})]})},oe.aX.HelpDeskList),fie=({fullName:e,avatar:t})=>(0,a.jsxs)(jp,{children:[t&&(0,a.jsx)(XN,{src:t}),(0,a.jsx)(Dp,{className:"bg-slate-200 dark:border dark:border-slate-800 dark:bg-slate-950",children:Mp(e)})]}),pie=({fullName:e,avatar:t})=>(0,a.jsx)(jp,{className:"rounded-sm",children:(0,a.jsx)(Dp,{className:"rounded-sm bg-slate-200 dark:border dark:border-slate-800 dark:bg-slate-950",children:t?(0,a.jsx)("img",{src:t,className:"h-6 max-h-32 w-fit object-contain align-middle italic",alt:"Hey"}):Mp(e)})}),FR=({fullName:e,children:t})=>(0,a.jsxs)("div",{className:"flex flex-row items-center gap-4",children:[e?(0,a.jsx)(pie,{fullName:e}):null,(0,a.jsxs)("div",{className:"mb-1 flex flex-col justify-between text-sm font-medium sm:text-sm md:mb-0",children:[(0,a.jsx)("div",{className:"font-semibold",children:e}),t]})]}),hie={firstName:"",lastName:"",username:"",currentDomain:""},mie=({isDisabled:e,isUpdating:t=!1,onCancel:n})=>{const{t:r}=(0,z.Bd)(),s=()=>{const o=(0,a.jsx)("div",{children:r(t?"ssp:pages.licenses.subscribersDialog.creatingSubscriberButton":"ssp:pages.licenses.subscribersDialog.createSubscriberButton")});return e?t?o:(0,a.jsxs)($l,{"data-testid":"tooltip",tooltip:r("ssp:pages.licenses.subscribersDialog.confirmationButtonDisableMessage"),children:[(0,a.jsx)("span",{children:r("ssp:pages.licenses.subscribersDialog.createSubscriberButton")}),(0,a.jsx)(c0,{"data-testid":"information-circle-icon",className:"ml-1 h-5 w-5 stroke-1 dark:stroke-2"})]}):o};return(0,a.jsx)("div",{className:"mt-4 grid w-full grid-flow-col",children:(0,a.jsxs)("div",{className:"flex gap-4 sm:flex-row sm:justify-between",children:[(0,a.jsx)(mn,{variant:"outline",className:"w-full",size:"sm",type:"button","data-testid":"btnCancelCreateSubscriber",onClick:()=>{n()},children:r("ssp:actions.cancel")}),(0,a.jsx)(Di,{type:"submit",className:"w-full",disabled:e,dataTestId:"btnCreateSubscriber",isLoading:t,children:s()})]})})},gie=({displayEmail:e})=>{const{t}=(0,z.Bd)();return e?.username&&e?.domain?(0,a.jsxs)("div",{className:"mt-2","data-testid":"email-display-parent",children:[(0,a.jsx)(Pn,{variant:"body2",colors:"light","data-testid":"create-subscriber-email-title",children:t("ssp:pages.licenses.createSubcriberForm.email")}),(0,a.jsx)(Pn,{variant:"body2",className:"truncate","data-testid":"create-subscriber-email-display",children:`${e.username}@${e.domain}`})]}):null},vie=({license:e,onSuccess:t,existingSubscribers:n})=>{const{t:r}=(0,z.Bd)(),[s,o]=(0,l.useState)(!0),{updateLicenses:i,isLoading:u}=nF();return(0,l.useEffect)(()=>{const g=n.filter(x=>Z3(e,x));let v=e.availableQuantity-e.numberUsers;v=v<0?0:v;const w=v<=0||g.length+1>v;o(u||w)},[u,e.availableQuantity,n,e]),{isCreateButtonDisabled:s,updating:u,onSubmit:async g=>{const v=`${g.username}@${g?.currentDomain??""}`;if(n.filter(w=>w.email?.toLowerCase()===v.toLowerCase()).length===0){const w=[{id:void 0,firstName:g.firstName??"",lastName:g.lastName??"",email:v}],x={licenseId:e.id,subscriberIdsOrUsersToBeAdded:w,subscriberIdsToBeRemoved:[]};try{await i(x),(0,Yr.v0)(r("ssp:pages.licenses.subscribersDialog.created")),t()}catch{(0,Yr.A2)(r("ssp:errors.generic"))}}else(0,Yr.A2)(r("ssp:pages.licenses.createSubcriberForm.errors.subscriberAlreadyExists"))}}},zR="ssp:validations.string.min",UR="ssp:validations.string.max",yie=()=>{const{t:e}=(0,z.Bd)();return tl({firstName:Ds().min(2,{message:`${e(zR,{path:e("ssp:pages.licenses.createSubcriberForm.placeholders.firstName"),min:2})}`}).max(30,{message:`${e(UR,{path:e("ssp:pages.licenses.createSubcriberForm.placeholders.firstName"),max:30})}`}),lastName:Ds().min(2,{message:`${e(zR,{path:e("ssp:pages.licenses.createSubcriberForm.placeholders.lastName"),min:2})}`}).max(30,{message:`${e(UR,{path:e("ssp:pages.licenses.createSubcriberForm.placeholders.lastName"),max:30})}`}),username:Ds().min(2,{message:`${e(zR,{path:e("ssp:pages.licenses.createSubcriberForm.placeholders.username"),min:2})}`}).max(30,{message:`${e(UR,{path:e("ssp:pages.licenses.createSubcriberForm.placeholders.username"),max:30})}`}),currentDomain:Ds()})},bie=({existingSubscribers:e,license:t,onCancel:n,onSuccess:r})=>{const{t:s}=(0,z.Bd)(),o=yie(),[i,u]=(0,l.useState)({username:"",domain:""}),p=hc({resolver:mc(o),defaultValues:hie}),{data:g=[]}=Nae(t?.vendorName),v=Hu(g);(0,l.useEffect)(()=>{if(g?.length!==0&&!v&&v!==g){const k=g?.find(N=>N?.isDefault)?.domain??"";p.setValue("currentDomain",k),u({...i,domain:k})}},[g,p,v,i]);const{isCreateButtonDisabled:w,updating:x,onSubmit:E}=vie({license:t,onSuccess:r,existingSubscribers:e}),R=async k=>{await E(k)};return(0,a.jsxs)(xo,{className:"flex flex-col gap-4 p-4 transition ease-in-out dark:bg-slate-900 md:p-4","data-testid":"create-subscriber-form",children:[(0,a.jsx)(fc,{children:s("ssp:pages.licenses.createSubcriberForm.title")}),(0,a.jsx)(gc,{...p,children:(0,a.jsxs)("form",{onSubmit:p.handleSubmit(R),className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex space-x-4",children:[(0,a.jsx)(Jr,{control:p.control,name:"firstName",render:({field:k})=>(0,a.jsxs)(qr,{className:"w-1/2",children:[(0,a.jsx)(Kr,{children:(0,a.jsx)(_a,{"data-testid":"create-subscriber-first-name-field",...k,placeholder:s("ssp:pages.licenses.createSubcriberForm.placeholders.firstName")})}),(0,a.jsx)(Cs,{})]})}),(0,a.jsx)(Jr,{control:p.control,name:"lastName",render:({field:k})=>(0,a.jsxs)(qr,{className:"w-1/2",children:[(0,a.jsx)(Kr,{children:(0,a.jsx)(_a,{"data-testid":"create-subscriber-last-name-field",...k,placeholder:s("ssp:pages.licenses.createSubcriberForm.placeholders.lastName")})}),(0,a.jsx)(Cs,{})]})})]}),(0,a.jsx)(Jr,{control:p.control,name:"username",render:({field:k})=>(0,a.jsxs)(qr,{children:[(0,a.jsx)(Kr,{children:(0,a.jsx)(_a,{"data-testid":"create-subscriber-username-field",...k,placeholder:s("ssp:pages.licenses.createSubcriberForm.placeholders.username"),onChange:N=>{k.onChange(N),u({...i,username:N.target.value})}})}),(0,a.jsx)(Cs,{})]})}),(0,a.jsx)(Jr,{control:p.control,name:"currentDomain",render:({field:k})=>(0,a.jsxs)(qr,{children:[(0,a.jsxs)(h0,{value:k.value,onValueChange:N=>{k.onChange(N),u({...i,domain:N})},children:[(0,a.jsx)(Kr,{children:(0,a.jsx)(wm,{"data-testid":"selectTriggerDomain",children:(0,a.jsx)(m0,{})})}),(0,a.jsx)(xm,{side:"bottom",children:g?.map(N=>(0,a.jsxs)(_m,{value:N.domain??"","data-testid":"selectItemDomain",children:[N.domain," ",N?.isDefault?`(${s("ssp:pages.licenses.createSubcriberForm.default")})`:""]},`${N?.domain??""} - ${N?.vendorName??""}`))})]}),(0,a.jsx)(Cs,{})]})}),(0,a.jsx)(gie,{displayEmail:i}),(0,a.jsx)(mie,{isDisabled:w,isUpdating:x,onCancel:n})]})})]})};function wie({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"}))}const uF=l.forwardRef(wie);function xie({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}const dF=l.forwardRef(xie);function _ie({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"}))}const Sie=l.forwardRef(_ie);function Cie({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18 7.5v3m0 0v3m0-3h3m-3 0h-3m-2.25-4.125a3.375 3.375 0 1 1-6.75 0 3.375 3.375 0 0 1 6.75 0ZM3 19.235v-.11a6.375 6.375 0 0 1 12.75 0v.109A12.318 12.318 0 0 1 9.374 21c-2.331 0-4.512-.645-6.374-1.766Z"}))}const fF=l.forwardRef(Cie),Eie=({items:e,value:t,onHandle:n,childFlagged:r,childNotFlagged:s,disabled:o})=>{const[i,u]=(0,l.useState)(t?e.includes(t):!1);return(0,l.useEffect)(()=>{u(t?e.includes(t):!1)},[e,t]),(0,a.jsxs)(mn,{disabled:o,variant:"none",onClick:()=>n(t),className:"p-1",children:[!i&&s,i&&r]})},Tie=({subscriber:e,license:t,subscriberEmailsToAdd:n,subscriberIdsToRemove:r,onAddLicense:s,onRemoveLicense:o})=>{const{t:i}=(0,z.Bd)(),u=e.licenseUpdates?.filter(w=>w.licenseId===t.id&&w.updateStatus===X3.Pending),p=u&&u.length>0?u[0]:null,g=e.assignedLicenses?.includes(t.id),{hasAccess:v}=fu();return(0,a.jsxs)("div",{className:"flex",children:[p&&(0,a.jsx)(t0,{tooltip:i("ssp:pages.licenses.subscribersDialog.actions.updateInProgress"),children:(0,a.jsx)(uF,{className:"h-5 w-5 stroke-1 text-green-400 dark:stroke-2","data-testid":"subscriber-arrow-icon-"+(e.id??"")})}),!p&&(0,a.jsx)(Eie,{disabled:!v(oe.aX.LicenseAssign),items:g?r:n,onHandle:g?o:s,value:g?e.id:e.email??"",childFlagged:(0,a.jsx)(t0,{tooltip:i(g?"ssp:pages.licenses.subscribersDialog.actions.subscriberToBeDeleted":"ssp:pages.licenses.subscribersDialog.actions.subscriberToBeAdded"),children:g?(0,a.jsx)(dF,{className:"h-5 w-5 cursor-pointer stroke-1 text-red-500 dark:stroke-2","data-testid":"subscriber-x-icon-"+(e.id??"")}):(0,a.jsx)(Zb,{className:"h-5 w-5 cursor-pointer stroke-1 text-green-500 dark:stroke-2","data-testid":"subscriber-cercle-icon-"+(e.id??"")})}),childNotFlagged:(0,a.jsx)(t0,{tooltip:i(g?"ssp:pages.licenses.subscribersDialog.actions.removeSubscriber":"ssp:pages.licenses.subscribersDialog.actions.addSubscriber"),children:g?(0,a.jsx)(Sie,{className:"h-5 w-5 cursor-pointer stroke-1 text-red-500 dark:stroke-2","data-testid":"subscriber-trash-icon-"+(e.id??"")}):(0,a.jsx)(fF,{className:"h-5 w-5 cursor-pointer stroke-1 text-indigo-500 dark:stroke-2","data-testid":"subscriber-plus-icon-"+(e.id??"")})})})]})},kie=({open:e=!1,onOpenChange:t,license:n})=>{const{t:r}=(0,z.Bd)(),{isLoading:s,data:o}=Aae(),i=Hu(o),{updateLicenses:u,isLoading:p}=nF(),{hasAccess:g}=fu(),[v,w]=(0,l.useState)([]),[x,E]=(0,l.useState)([]),[R,k]=(0,l.useState)([]),[N,L]=(0,l.useState)(!1),[D,B]=(0,l.useState)(!1),[Q,ce]=(0,l.useState)(!1),[ye,G]=(0,l.useState)(!0),[Le,We]=(0,l.useState)(""),[at,St]=(0,l.useState)(!1),xt=()=>{const At=(0,a.jsx)("div",{children:r(p?"ssp:pages.licenses.subscribersDialog.confirmationButtonLoading":"ssp:pages.licenses.subscribersDialog.confirmationButton")});return ye?p?At:(0,a.jsxs)($l,{"data-testid":"tooltip",tooltip:r("ssp:pages.licenses.subscribersDialog.confirmationButtonDisableMessage"),children:[(0,a.jsx)("span",{children:r("ssp:pages.licenses.subscribersDialog.confirmationButton")}),(0,a.jsx)(c0,{"data-testid":"information-circle-icon",className:"ml-1 h-5 w-5 stroke-1 dark:stroke-2"})]}):At},Mt=()=>{k([]),w([])};(0,l.useEffect)(()=>{const At=o?.filter(br=>Z3(n,br));let Ht=n.availableQuantity-n.numberUsers;Ht=Ht<0?0:Ht;const Gt=R.length+(At?.length??0)-v.length,Sn=Gt>Ht,Cr=N?Gt>=Ht:Ht<=0;St(Cr),G(p||!N||Sn)},[p,N,R,v,o,n]),(0,l.useEffect)(()=>{Mt()},[n]),(0,l.useEffect)(()=>{if(!v0()(i,o)&&o?.length!==0&&n?.id){const At=o?.filter(Sn=>{const Cr=Sn.licenseUpdates?.map(({licenseId:br})=>br);return Sn.assignedLicenses?.includes(n.id)??Cr?.includes(n.id)}),Ht=o?.filter(Sn=>!Sn.assignedLicenses?.includes(n.id));At&&aC(At,"firstName",{ignoreCase:!0}),Ht&&aC(Ht,"firstName",{ignoreCase:!0});const Gt=Ht?At?.concat(Ht):[];Gt&&E(Gt)}},[i,o]),(0,l.useEffect)(()=>{R.length>0||v.length>0?L(!0):L(!1)},[R,v]);const $t=At=>{const Ht=At.target.value;We(Ht)},Nt=()=>{N?B(!0):t(!1)},Bn=At=>{if(At){const Ht=v.slice();if(Ht.includes(At)){const Gt=Ht.indexOf(At,0);Gt>-1&&Ht.splice(Gt,1)}else Ht.push(At);w(Ht)}},wn=At=>{if(At){const Ht=R.slice();if(Ht.includes(At)){const Gt=Ht.indexOf(At,0);Gt>-1&&Ht.splice(Gt,1)}else Ht.push(At);k(Ht)}},Nn=async()=>{const Ht=R.map(Sn=>x.filter(Cr=>Cr.email===Sn)[0]).map(Sn=>Sn.type===DR.Subscriber&&Sn.id?{id:Sn.id,firstName:void 0,lastName:void 0,email:void 0}:{id:void 0,firstName:Sn.firstName??"",lastName:Sn.lastName??"",email:Sn.email??""}),Gt={licenseId:n.id,subscriberIdsOrUsersToBeAdded:Ht,subscriberIdsToBeRemoved:v};try{await u(Gt),(0,Yr.v0)(r("ssp:pages.licenses.subscribersDialog.requestSentWithSuccess")),t(!1)}catch{(0,Yr.A2)(r("ssp:errors.generic"))}},Zt=()=>{Mt(),t(!1)},Pt=x?.filter(At=>{const Ht=Le.toLowerCase(),Gt=(At.firstName??"").toLowerCase(),Sn=(At.lastName??"").toLowerCase(),Cr=Gt.concat(" ",Sn),br=At.email?.toLowerCase();return Cr?.includes(Ht)||br?.includes(Ht)});return(0,a.jsxs)(NM,{open:e,onOpenChange:t,children:[(0,a.jsx)(xk,{className:"flex w-full flex-col overflow-auto sm:w-[550px]",onPointerDownOutside:At=>{At.preventDefault(),Nt()},onEscapeKeyDown:At=>{At.preventDefault(),Nt()},onClose:()=>{Nt()},children:s?(0,a.jsx)(zs,{className:"absolute left-[calc(50%-3rem)] top-[calc(50%-3rem)]"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(_k,{children:[(0,a.jsx)(Sk,{children:n.productName??""}),at&&(0,a.jsx)(zp,{"data-testid":"alertSubscribersDialog",variant:$f.Warning,className:"text-black dark:text-black",children:r("ssp:warnings.noLicensesAvailable")}),(0,a.jsx)("div",{className:"flex flex-row justify-between",children:(0,a.jsx)(jM,{children:r("ssp:pages.licenses.subscribersDialog.title")})})]}),(0,a.jsxs)("div",{className:"mt-2",children:[Q&&(0,a.jsx)(bie,{existingSubscribers:x,license:n,onCancel:()=>ce(!1),onSuccess:()=>{ce(!1),t(!1)}}),!Q&&(0,a.jsxs)("div",{className:"mb-4 flex flex-row justify-between gap-4",children:[(0,a.jsxs)("div",{className:"relative flex w-full items-center",children:[(0,a.jsx)(Xh,{className:"absolute left-3 h-5 w-5 text-gray-500 focus-within:text-gray-600","aria-hidden":"true"}),(0,a.jsx)("input",{type:"text",placeholder:r("ssp:pages.licenses.subscribersDialog.filterPlaceholder"),value:Le,onChange:$t,"data-testid":"inputFilterUsers",className:"w-full rounded-lg border border-gray-300 py-2 pl-10 text-left text-sm font-normal leading-none text-gray-600 outline-none focus:border-blue-500 focus:ring-blue-500 focus-visible:outline-offset-0 focus-visible:outline-indigo-300 dark:border-none dark:border-slate-800 dark:bg-slate-950 dark:text-slate-200 dark:ring-1 dark:ring-zinc-700"})]}),(0,a.jsxs)(mn,{variant:"primary",disabled:!g(oe.aX.LicenseAssign),className:"h-9 w-1/5 lg:w-3/5",onClick:()=>{ce(!0)},"data-testid":"dialogBtnCreateSubscriberEnabler",children:[(0,a.jsx)("span",{className:"hidden lg:block",children:r("ssp:pages.licenses.subscribersDialog.createSubscriberButton")}),(0,a.jsx)("span",{className:"lg:hidden",children:"+"})]})]})]}),(0,a.jsx)("div",{className:"h-full overflow-y-auto pb-16 sm:pb-8","data-testid":"dialogSubscribersContent",children:Pt&&Pt.length>0?Pt.map(At=>(0,a.jsx)("div",{className:"flex flex-row pr-2","data-testid":"subscribers-dialog-single-subscriber",children:(0,a.jsxs)("div",{className:"flex w-full flex-row justify-between border-b border-b-slate-200 py-4 dark:border-b-slate-800",children:[(0,a.jsxs)("div",{className:"flex flex-row gap-x-4",children:[(0,a.jsx)(jp,{children:(0,a.jsx)(Dp,{className:"dark:bg-slate-950 dark:text-slate-200",children:Mp(`${At.firstName} ${At.lastName}`)})}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("div",{className:"text-sm font-semibold text-foreground",children:`${At.firstName} ${At.lastName}`}),(0,a.jsx)("div",{className:"text-xs font-normal text-slate-500",children:At?.email})]})]}),(0,a.jsx)(Tie,{license:n,subscriber:At,subscriberEmailsToAdd:R,subscriberIdsToRemove:v,onAddLicense:wn,onRemoveLicense:Bn})]})},At?.id??At?.firstName)):(0,a.jsx)("div",{className:"text-foreground dark:text-slate-200",children:r("ssp:pages.licenses.subscribersDialog.noSubscriber")})}),!Q&&(0,a.jsxs)(IM,{className:`fixed bottom-0 left-0 flex w-full flex-row gap-4 bg-gradient-to-b from-white/60 to-white/50 px-8 py-4 shadow-[0px_4px_24px_#00000012,inset_0px_-1px_1px_#ffffff20,inset_0px_1px_1px_#ffffff40] backdrop-blur-[32px] backdrop-brightness-[100%] dark:bg-slate-900 dark:bg-none dark:text-white
          dark:shadow-none dark:backdrop-blur-none  sm:relative sm:px-0 sm:shadow-none`,children:[(0,a.jsx)(mn,{variant:"outline",type:"button",className:"w-full","data-testid":"btnCancelUpdateSubscribers",onClick:()=>{Nt()},children:r("ssp:actions.cancel")}),(0,a.jsx)(Di,{className:"w-full",disabled:ye,dataTestId:"btnUpdateSubscribers",onClick:async()=>await Nn(),type:"button",isLoading:p,children:xt()})]})]})}),(0,a.jsx)(Vc,{open:D,onClose:()=>B(!1),onConfirm:()=>Zt(),title:r("ssp:pages.licenses.subscribersDialog.confirmationModal.title"),confirmButtonText:r("ssp:pages.licenses.subscribersDialog.confirmationModal.confirmationButtonText"),cancelButtonText:r("ssp:actions.cancel"),children:(0,a.jsx)("p",{children:r("ssp:pages.licenses.subscribersDialog.confirmationModal.description")})})]})},pF=(0,l.memo)(kie),Rie=({license:e,setSelectedLicense:t,setOpenDialog:n})=>(0,a.jsx)(Bo,{permission:oe.aX.LicenseDetails,children:(0,a.jsx)(mn,{variant:"outline",size:"sm",type:"button","data-testid":"btnManageSubscribers",onClick:()=>{t(e),n(!0)},children:(0,LC.t)("ssp:pages.licenses.manage")})}),BR="text-center",Pie=({fullName:e})=>(0,a.jsx)(FR,{fullName:e}),Oie=({license:e,setSelectedLicense:t,setOpenDialog:n})=>(0,a.jsx)(Rie,{license:e,setSelectedLicense:t,setOpenDialog:n}),Nie=()=>{const{t:e}=(0,z.Bd)(),{isLoading:t,error:n,data:r}=MR(),[s,o]=(0,l.useState)(!1),[i,u]=(0,l.useState)(),p=rF(),g=()=>{p.mutate()},v=[{accessorKey:"productName",header:e("ssp:pages.licenses.list.columns.productName"),cell:({cell:w})=>Pie({fullName:w.getValue()}),minSize:417},{accessorKey:"vendorName",header:e("ssp:pages.licenses.list.columns.vendorName"),meta:{className:BR},minSize:278},{accessorKey:"availableQuantity",header:e("ssp:pages.licenses.list.columns.licenses"),enableSorting:!0,meta:{className:BR},minSize:139},{accessorKey:"numberUsers",header:e("ssp:pages.licenses.list.columns.users"),enableSorting:!0,meta:{className:BR},minSize:139},{id:"actions",cell:({row:w})=>Oie({license:w.original,setSelectedLicense:u,setOpenDialog:o}),minSize:139}];return t||n?null:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(ky,{columns:v,data:r,dataTestId:"tableLicenses",filterableFields:["productName"],filterPlaceholder:e("ssp:pages.licenses.list.filterPlaceholder"),fieldDescription:e("ssp:pages.licenses.list.searchFieldDescription"),optionalActions:(0,a.jsx)(Di,{isLoading:p?.isLoading,onClick:g})}),i&&s&&(0,a.jsx)(pF,{open:s,onOpenChange:o,license:i})]})},Aie=()=>{const{t:e}=(0,z.Bd)(),{isLoading:t,error:n,data:r=[]}=MR(),[s,o]=(0,l.useState)(!1),[i,u]=(0,l.useState)(),{search:p,onSetSearchParams:g}=Qp(),v=rF(),w=()=>{v.mutate()},x=(R,k)=>{if(R<=0)throw new Error("error");const N=R-k;return(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"font-base",children:e("ssp:pages.licenses.list.availableLicenses")})," ",N]})},E=r.filter(R=>(R?.productName??"").toLowerCase().includes(p.toLowerCase()));return t||n?null:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("div",{className:"mb-4 flex justify-between gap-4",children:(0,a.jsxs)(vu,{children:[(0,a.jsx)(vu.Input,{placeholder:e("ssp:pages.licenses.list.filterPlaceholder"),filteredText:p,setFilteredText:g}),(0,a.jsx)(Di,{mobileView:!0,isLoading:v?.isLoading,onClick:w,Icon:W3})]})}),E.map(R=>(0,a.jsx)(Nm,{type:"single",collapsible:!0,"data-testid":"licenseAccordion",children:(0,a.jsxs)(Xp,{value:"item-1",children:[(0,a.jsxs)(Zp,{className:"relative justify-between rounded-xl bg-white p-4 [&[data-state=open]>div>div]:hidden [&[data-state=open]]:rounded-b-none",children:[R.productName,(0,a.jsx)(Oy,{children:x(R.availableQuantity,R.numberUsers)})]}),(0,a.jsx)(Jp,{children:(0,a.jsxs)(N0,{children:[(0,a.jsx)(Js,{label:e("ssp:pages.licenses.list.columns.vendorName"),value:R.vendorName,dataTestId:"accVendorNameLicenses"}),(0,a.jsx)(Js,{label:e("ssp:pages.licenses.list.columns.licenses"),value:R.availableQuantity,dataTestId:"accAvailibilityLicenses"}),(0,a.jsx)(Js,{label:e("ssp:pages.licenses.list.columns.users"),value:R.numberUsers,dataTestId:"accNumberUserLicenses"}),(0,a.jsx)(Js,{label:"",value:(0,a.jsx)(Bo,{permission:oe.aX.LicenseDetails,children:(0,a.jsx)(mn,{variant:"outline",size:"sm",type:"button","data-testid":"btnManageSubscribersMobile",onClick:()=>{u(R),o(!0)},children:e("ssp:pages.licenses.manage")})})})]})})]})},R.id))]}),i&&(0,a.jsx)(pF,{open:s,onOpenChange:o,license:i})]})},Iie=Gc(()=>{const{t:e}=(0,z.Bd)(),{isLoading:t,error:n,data:r=[],isFetched:s}=MR(),{data:o}=Oae(),{dismissLicenseUpdate:i}=Iae(),{hasAccess:u}=fu(),p=s&&!t&&!n&&!r?.length,g=async v=>{try{await i(v)}catch{(0,Yr.A2)(e("ssp:errors.generic"))}};return(0,a.jsx)(Wc,{children:(0,a.jsxs)("div",{className:"flex flex-col gap-12 md:gap-16",children:[(0,a.jsx)(yl,{title:(0,a.jsx)(el,{"data-testid":"pageLicensesTitle",children:e("ssp:pages.licenses.title")}),subTitle:(0,a.jsx)(qu,{children:e("ssp:pages.licenses.pageDescription")})}),t&&(0,a.jsx)(zs,{floating:!0}),n&&(0,a.jsx)(A0,{error:n}),p&&(0,a.jsxs)("div",{className:"flex w-full flex-col items-center justify-center gap-4 rounded-lg border-2 border-dashed border-gray-300 p-8 font-normal text-gray-400 md:h-60","data-testid":"containerNoLicenses",children:[(0,a.jsx)(Ny,{className:"h-16 w-16 stroke-1 text-gray-400"}),(0,a.jsx)("p",{children:e("ssp:pages.licenses.noLicenses")})]}),r?.length>0&&(0,a.jsxs)(a.Fragment,{children:[o&&o.length>0&&(0,a.jsx)("div",{children:o?.map(v=>(0,a.jsx)(zp,{"data-testid":`alert-${v.licenseUpdateId}`,variant:$f.Danger,onClose:u(oe.aX.LicenseAssign)?async()=>await g(v.licenseUpdateId):void 0,children:e("ssp:pages.licenses.errors.licenseUpdateFailed",{licenseName:v.productName,subscriberName:v.subscriberName})},v.licenseUpdateId))}),(0,a.jsx)("div",{className:"hidden lg:block","data-testid":"containerLicensesTable",children:(0,a.jsx)(xo,{padded:!0,children:(0,a.jsx)(Nie,{})})}),(0,a.jsx)("div",{className:"mt-4 lg:hidden","data-testid":"containerLicensesTableMobile",children:(0,a.jsx)(xo,{padded:!0,children:(0,a.jsx)(Aie,{})})})]})]})})},oe.aX.LicenseList),jie=({resellerName:e,resellerLogoURL:t})=>{const{t:n}=(0,z.Bd)(),{data:r}=xb();return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"flex items-center justify-center",children:r&&t?(0,a.jsx)("img",{src:t,className:"max-h-32 w-fit object-contain align-middle italic",alt:n("ssp:pages.login.resellerLogoAlternative",{resellerName:e}),"data-testid":"logo"}):(0,a.jsx)("p",{className:"flex h-28 w-28 items-center rounded-md p-2 align-middle font-medium italic text-slate-900"})}),(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsx)("h1",{className:"text-3xl font-semibold text-slate-900 dark:text-slate-200","data-testid":"resellerName",children:n("ssp:pages.login.signInTo",{resellerName:e})}),(0,a.jsx)("p",{className:"text-sm text-slate-500 dark:text-slate-400","data-testid":"resellerNameParagraph",children:n("ssp:pages.login.welcomeBack",{resellerName:e})})]})]})},Die=tl({username:Ds().min(1,{message:`${Eo.t("ssp:validations.mixed.required",{path:Eo.t("ssp:pages.login.loginform.username.label")})}`})}),Mie=!0,$ie=()=>{const{t:e}=(0,z.Bd)(),t=ks(),[n,r]=(0,l.useState)(!1),{data:s}=xb(),{isLoggedIn:o,isLoading:i}=(0,zr.m)(Mie),{bff:u}=ae.A,p=`${u.url}${u.signInPath}`,g=hc({resolver:mc(Die),defaultValues:{username:""}});function v(w){r(!0);const x=t.state?.from.toString();window.location.href=`${p}${encodeURIComponent(w.username)}&redirectTo=${x}`,setTimeout(()=>{r(!1)},1e3)}return i?(0,a.jsx)(zs,{floating:!0}):o?(0,a.jsx)(hi,{replace:!0,to:Un.Root}):(0,a.jsx)(Zv,{children:(0,a.jsxs)("div",{className:"flex min-h-screen bg-slate-900 dark:bg-gradient-to-l dark:from-slate-900 dark:to-slate-950",children:[(0,a.jsx)("div",{className:"hidden w-auto p-4 md:flex md:w-1/3 lg:w-1/2"}),(0,a.jsxs)("div",{className:"flex h-screen w-full flex-col items-center justify-center bg-white dark:bg-slate-900  md:w-2/3 lg:w-1/2",children:[(0,a.jsxs)("div",{className:"top-0 flex h-14 w-full justify-between bg-white px-4 shadow-sm dark:bg-slate-900 md:px-8 md:py-4",children:[(0,a.jsx)("div",{}),(0,a.jsx)("div",{className:"flex flex-row justify-center gap-4",children:(0,a.jsx)("div",{className:"flex flex-row items-center gap-1",children:(0,a.jsx)("div",{className:"dark:text-slate-200",children:(0,a.jsx)(xA,{})})})})]}),(0,a.jsx)("div",{className:"flex h-screen w-full max-w-2xl flex-col items-center p-4 pt-8 md:mt-16 md:justify-start md:px-16 md:pb-32 md:pt-8",children:(0,a.jsxs)("div",{className:"flex w-full max-w-md flex-col gap-12",children:[(0,a.jsx)(jie,{resellerLogoURL:s.logo,resellerName:s.resellerName}),(0,a.jsx)(gc,{...g,children:(0,a.jsx)("form",{onSubmit:g.handleSubmit(v),children:(0,a.jsxs)("div",{className:"flex w-full flex-col gap-8",children:[(0,a.jsx)("div",{className:"w-full",children:(0,a.jsx)(Jr,{control:g.control,name:"username",render:({field:w})=>(0,a.jsxs)(qr,{children:[(0,a.jsx)(As,{children:e("ssp:pages.login.loginform.username.label")}),(0,a.jsx)(Kr,{children:(0,a.jsx)(_a,{"data-testid":"usernameField",placeholder:e("ssp:pages.login.loginform.username.placeholder"),...w})}),(0,a.jsx)(Cs,{})]})})}),(0,a.jsx)(Di,{isLoading:n,dataTestId:"signin",type:"submit",className:"w-full",loadingChildren:e("ssp:pages.login.loginform.signingIn"),children:e("ssp:pages.login.loginform.signIn")})]})})})]})})]})]})})},hF=()=>{const{isLoggedIn:e}=(0,zr.m)(),n=Io()?.id;return(0,js.I)({queryKey:RE.queryKey(n),queryFn:async()=>await RE.queryFn(n),enabled:e&&!!n})},Lie=e=>{const n=Io()?.id;return(0,js.I)({queryKey:PE.queryKey(n,e),queryFn:async()=>await PE.queryFn(n,e),enabled:!!n&&!!e,staleTime:PE.staleTime,select:r=>Yk(r)})},Fie=()=>{const{t:e}=(0,z.Bd)(),{orderId:t}=ma(),n=Io(),r=Lie(t),{navigate:s}=Ni(),o=r.isLoading||!r?.data,i=()=>{n?.uniqueName&&s(Un.Orders,{organizationUniqueName:n?.uniqueName??""})};return(0,a.jsxs)(ls,{title:o?null:(0,a.jsx)(Pn,{variant:"heading6",weight:"bold",className:"text-wrap",children:e("core:orders.detail.title",{orderId:r?.data?.humanReadableId})}),onClose:i,children:[o?(0,a.jsx)(zs,{dataTestId:"layoverSpinnner",className:"absolute left-[calc(50%-3rem)] top-[calc(50%-3rem)] z-10"}):null,(0,a.jsx)(FL,{order:r?.data})]})},zie=({order:e})=>{const{t}=(0,z.Bd)(),[n,r]=(0,l.useState)(!1),{navigate:s}=Ni(),o=Io(),i=()=>{o?.uniqueName&&s(Un.Order,{orderId:e.orderId,organizationUniqueName:o.uniqueName})};return(0,a.jsx)("div",{className:"flex gap-x-4",children:(0,a.jsxs)(S0,{open:n,onOpenChange:r,children:[(0,a.jsx)(C0,{asChild:!0,"data-testid":"dropdownViewOrderOptions",children:(0,a.jsx)(mn,{variant:"ghost",className:"h-8 w-8 p-0",children:(0,a.jsx)(zS,{className:"mr-0.5 w-6 text-gray-500 hover:bg-slate-50"})})}),(0,a.jsx)(km,{align:"end",children:(0,a.jsx)(Bl,{"data-testid":"dropdownItemViewDetail",onClick:i,children:t("rsp:pages.orders.list.actions.viewDetails")})})]})})},$w={className:"align-top text-center"},Uie=e=>(0,a.jsx)("div",{className:"font-medium",children:e}),Bie=e=>(0,a.jsx)(Jk,{orderType:e?.type}),Vie=e=>(0,a.jsx)(T0,{orderStatus:e?.orderStatus}),Hie=e=>(0,a.jsx)(zie,{order:e}),Wie=()=>{const{t:e,i18n:{language:t}}=(0,z.Bd)(),n=hF(),r=bl(t,Kp.datetime),s=[{accessorKey:"humanReadableId",meta:{...$w},header:e("ssp:pages.orders.list.id"),cell:({row:o})=>Uie(o.original.humanReadableId??"")},{accessorKey:"productName",header:e("ssp:pages.orders.list.productName"),meta:{className:"align-top"},cell:({row:o})=>o.original.productName},{accessorKey:"createdOn",header:e("ssp:pages.orders.list.createdOn"),meta:{className:"align-top"},cell:({row:o})=>r(o.original.createdOn)},{accessorKey:"type",meta:{...$w},header:e("ssp:pages.orders.list.type"),cell:({row:o})=>Bie(o.original)},{accessorKey:"requestedQuantity",meta:{...$w},header:e("ssp:pages.orders.list.quantity"),cell:({row:o})=>o.original.requestedQuantity},{accessorKey:"orderStatus",meta:{...$w},header:e("ssp:pages.orders.list.status"),cell:({row:o})=>Vie(o.original)},{id:"actions",meta:{...$w},cell:({row:o})=>Hie(o.original),minSize:20}];return(0,a.jsx)(xo,{padded:!0,children:(0,Os.isRequestLoading)(n)?(0,a.jsx)(Hp,{}):(0,a.jsx)(ky,{dataTestId:"tableOrders",columns:s,data:n?.data,emptyMessage:e("ssp:pages.orders.noOrder"),filterableFields:["humanReadableId","productName"],filterPlaceholder:e("ssp:pages.orders.filterPlaceholder"),fieldDescription:e("ssp:pages.orders.fieldDescription")})})},qie=({order:e,className:t})=>{const{t:n}=(0,z.Bd)();return(0,a.jsx)("div",{className:st("flex flex-row gap-4",t),"data-testid":"divOrderActions",children:(0,a.jsx)(mn,{asChild:!0,variant:No.Outline,size:"sm","data-testid":"btnOrderViewDetail",children:(0,a.jsxs)(jo,{to:Un.Order,params:{orderId:e.orderId},children:[(0,a.jsx)(KS,{className:"mr-1 h-5 w-5  hover:bg-slate-50"}),n("rsp:pages.orders.list.actions.viewDetailsMobile")]})})})},Kie=()=>{const{t:e,i18n:{language:t}}=(0,z.Bd)(),n=hF(),{search:r,onSetSearchParams:s}=Qp(),o=bl(t,Kp.datetime),i=n?.data?.filter(p=>(p.humanReadableId??"").toLowerCase().includes(r.toLowerCase())||p.productName?.toLowerCase().includes(r.toLowerCase())),u=()=>i?.length===0?(0,a.jsx)(kR,{children:e("ssp:pages.orders.noOrder")}):i?.map(p=>(0,a.jsx)(Nm,{type:"single",collapsible:!0,children:(0,a.jsxs)(Xp,{value:p.orderId,children:[(0,a.jsxs)(Zp,{className:"relative justify-between rounded-xl bg-white p-4 [&[data-state=open]>div>div]:hidden [&[data-state=open]]:rounded-b-none",children:[p.humanReadableId," - ",p.productName,(0,a.jsx)(Oy,{children:(0,a.jsx)(T0,{orderStatus:p.orderStatus})})]}),(0,a.jsx)(Jp,{children:(0,a.jsxs)(N0,{children:[(0,a.jsx)(Js,{label:e("ssp:pages.orders.list.id"),value:p.humanReadableId}),(0,a.jsx)(Js,{label:e("ssp:pages.orders.list.productName"),value:p.productName}),(0,a.jsx)(Js,{label:e("ssp:pages.orders.list.createdOn"),value:o(p.createdOn)}),(0,a.jsx)(Js,{label:e("ssp:pages.orders.list.type"),value:(0,a.jsx)(Jk,{orderType:p?.type})}),(0,a.jsx)(Js,{label:e("ssp:pages.orders.list.quantity"),value:p.requestedQuantity}),(0,a.jsx)(Js,{label:e("ssp:pages.orders.list.status"),value:(0,a.jsx)(T0,{orderStatus:p.orderStatus})}),(0,a.jsx)(Js,{className:"justify-end",labelClassName:"flex flex-wrap",label:(0,a.jsx)(qie,{order:p,className:"flex flex-wrap"})})]})})]})},p.orderId));return(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(vu,{children:(0,a.jsx)(vu.Input,{placeholder:e("ssp:pages.orders.filterPlaceholder"),filteredText:r,setFilteredText:s})}),(0,Os.isRequestLoading)(n)?(0,a.jsx)(Hp,{}):u()]})},Gie=Gc(()=>{const{t:e}=(0,z.Bd)();return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(Wc,{children:(0,a.jsxs)("div",{className:"flex flex-col gap-12 md:gap-16",children:[(0,a.jsx)(yl,{title:(0,a.jsx)(el,{"data-testid":"pageOrdersTitle",children:e("ssp:pages.orders.title")}),subTitle:(0,a.jsx)(qu,{children:e("ssp:pages.orders.subtitle")})}),(0,a.jsx)("div",{className:"hidden lg:block",children:(0,a.jsx)(Wie,{})}),(0,a.jsx)("div",{className:"mt-4 lg:hidden",children:(0,a.jsx)(Kie,{})})]})}),(0,a.jsx)(Ta,{})]})},oe.aX.OrderList),mF=Gc(()=>{const[e,t]=(0,l.useState)(!1),{navigate:n}=Ni(),{organizationUniqueName:r}=jf(),s=Ai(),{data:o}=Yh(),{findById:i,findByUniqueName:u}=B7(),{setSelectedOrganization:p}=M2(),g=r?u(r):void 0;return(0,l.useEffect)(()=>{t(!1)},[r]),(0,l.useEffect)(()=>{if(!(r||o.length===0)){if(s){const v=i(s);if(v){n(`/${v.uniqueName}`);return}}n(`/${o[0].uniqueName}`)}},[r]),(0,l.useEffect)(()=>{if(!r||o.length===0)return;const v=u(r)??null;v?p(v.id):t(!0)},[r,g]),e||o.length===0?(0,a.jsx)(Am,{}):g?(0,a.jsx)(Ta,{}):(0,a.jsx)(Wc,{})},oe.aX.AccessToSuspendedOrganization),Qie=()=>{const{t:e}=(0,z.Bd)(),{isLoading:t,hasNoActivatedOrganizations:n}=iC();return!t&&!n?(0,a.jsx)(hi,{replace:!0,to:Un.Root}):(0,a.jsx)(TE,{title:e("ssp:pages.organizationsNotActivated.title"),content:e("ssp:pages.organizationsNotActivated.content")})},Yie=()=>{const{t:e}=(0,z.Bd)(),{navigate:t}=Ni(),n=Dl(),{isLoading:r,isActive:s,selectedOrganizationUniqueName:o}=D2(),{hasAccess:i}=fu(),u=!r&&(i(oe.aX.AccessToSuspendedOrganization)||s);return(0,l.useEffect)(()=>{u&&o&&t(n(Un.OrganizationDispatcher,{organizationUniqueName:o}))},[u]),(0,a.jsx)(TE,{icon:(0,a.jsx)(Td,{className:"mx-auto w-12"}),title:e("ssp:pages.organizationSuspended.title"),content:e("ssp:pages.organizationSuspended.content")})};class Xie{static placeShoppingOrder(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/organizations/{organizationId}/shopping/orders";o=o.replace("{organizationId}",t.organizationId+"");const i=(0,oe.Y_)("post","application/json",o,n);let u=t.command;i.data=u,(0,oe.pY)(i,r,s)})}}const Zie=e=>{switch(e){case oe.Sj.Cad:return Uf.CAD;case oe.Sj.Usd:default:return Uf.USD}},Jie=e=>{if(!e)return null;const t={[oe.mV.Unknown]:[],[oe.mV.Monthly]:[],[oe.mV.Annual]:[],[oe.mV.Biennial]:[],[oe.mV.Triennial]:[],[oe.mV.Open]:[]};return e?.offers?.forEach(n=>{const{commitmentTermType:r}=n;r&&t[r].push(ele(n,e.currency))}),{...e,offersByCommitmentTerm:t}},ele=(e,t)=>{const n={currency:Zie(t),amount:e.price};return{...e,price:n}},gF=20,VR={sortBy:oe.Eh.ProductNameAscending,filters:void 0,query:""},vF=e=>{const n=Io()?.uniqueName;if(e&&n)return{organizationUniqueName:n,...e};if(n)return{organizationUniqueName:n}},tle=()=>{const e=Dl(),t=Qs(),n=vF();return(0,l.useCallback)(r=>{n?.organizationUniqueName&&t({pathname:e(Un.Shop,{organizationUniqueName:n?.organizationUniqueName}),search:r})},[e,n?.organizationUniqueName,t])},nle=()=>{const{t:e}=(0,z.Bd)();return t=>t?e(`ssp:pages.shop.detail.billingCycleValues.${t}`):""},rle=()=>{const{t:e}=(0,z.Bd)();return t=>t?e(`ssp:pages.shop.detail.commitmentTermValues.${t}`):""},sle=()=>{const{t:e}=(0,z.Bd)();return t=>t?e(`ssp:pages.shop.detail.contractDurationCommitmentTermValues.${t}`):""},yF=()=>{const{t:e}=(0,z.Bd)();return t=>t?e(`ssp:pages.shop.detail.commitmentSummary.billingCycleValues.${t}`):""},ole=()=>{const{t:e}=(0,z.Bd)();return t=>t?e(`ssp:pages.shop.detail.commitmentSummary.billingCyclePeriodValues.${t}`):""},ale=()=>{const{t:e}=(0,z.Bd)();return t=>t?e(`ssp:pages.shop.detail.commitmentSummary.commitmentTermValues.${t}`):""},ile=(e,t)=>{if(!t)return;if(v0()(e,t))return t;const n=new Map,r=(s,o)=>{const i=new Map(s?.map(u=>[u.value,u]));return o?.map(u=>{const p=i.get(u.value);return p||{...u,count:0}})};return e?.forEach(s=>{s?.fieldName&&s.countsByValue&&n.set(s.fieldName,[...s.countsByValue])}),t?.forEach(s=>{if(s?.fieldName&&s.countsByValue){const o=n.get(s.fieldName),i=r(s.countsByValue,o);i&&n.set(s.fieldName,i)}}),Array.from(n,([s,o])=>({fieldName:s,countsByValue:o}))},lle=(e,t)=>Math.ceil(e.foundProducts/t)>e.page?e.page+1:null;class bF{static getProductById(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/Products/{id}";o=o.replace("{id}",t.id+"");const i=(0,oe.Y_)("get","application/json",o,n);(0,oe.pY)(i,r,s)})}static searchProducts(t={},n={}){return new Promise((r,s)=>{let o=oe.Jp+"/Products/search";const i=(0,oe.Y_)("post","application/json",o,n);let u=t.command;i.data=u,(0,oe.pY)(i,r,s)})}}const HR={queryKey:(e,t="")=>(0,Os.getLocalizedQueryKey)(["ProductsService/searchProducts",t,e]),queryFn:async({filters:e,sortBy:t,query:n},r,s="")=>!s||s===""?await(0,oo.Ui)():await bF.searchProducts({command:{sortBy:t,query:n,filters:e,organizationId:s,pageSize:gF,page:r}}),staleTime:Aa},WR={queryKey:e=>(0,Os.getLocalizedQueryKey)(["ProductsService/getProductById",e]),queryFn:async e=>e?await bF.getProductById({id:e}):await(0,oo.Ui)(),staleTime:5*1e3},qR=({searchOptions:e,enabled:t=!0})=>{const n=Io(),{isLoggedIn:r}=(0,zr.m)();return(0,VT.q)({queryKey:HR.queryKey(e,n?.id),queryFn:async({pageParam:s=1})=>await HR.queryFn(e,s,n?.id),enabled:r&&!!n?.id&&t,keepPreviousData:!0,staleTime:HR.staleTime,getNextPageParam:s=>lle(s,gF)})},cle=({searchOptions:e,enabled:t=!0})=>{const n={...VR,...e},r=qR({searchOptions:VR,enabled:!v0()(VR,n)&&t}),s=qR({searchOptions:n,enabled:t});return{isLoading:r?.isLoading||s?.isLoading,data:ile(r?.data?.pages?.[0]?.facets,s?.data?.pages?.[0]?.facets)}},KR=e=>(0,js.I)({queryKey:WR.queryKey(e),queryFn:async()=>await WR.queryFn(e),enabled:!!e,staleTime:WR.staleTime,select:t=>Jie(t)}),ule=()=>{const e=Ai();return(0,Vo.n)({mutationFn:async t=>{if(!t.serviceProviderId||!e)throw(0,oo.XY)();if(t.orderItems.length===0)throw new Error("Must provide at least one order item");await Xie.placeShoppingOrder({organizationId:e,command:{serviceProviderId:t.serviceProviderId,orderItems:t.orderItems}})},onError:()=>{}})},GR={query:"",sortBy:oe.Eh.ProductNameAscending},dle=()=>{const{getParams:e,getArrayParam:t}=bi(),n=e("productsQuery"),r=t("productsBillingCycle"),s=t("productsCommitment"),o=t("productsVendor"),i=t("productsCategories"),u=(0,l.useMemo)(()=>({...r.length!==0?{billingCycleFilter:r}:{},...s.length!==0?{commitmentTermFilter:s}:{},...o.length!==0?{vendorFilter:o}:{},...i.length!==0?{categoryFilter:i}:{}}),[r,s,o,i]),p=(0,l.useMemo)(()=>Object.keys(u).length!==0?{filters:u}:{},[u]);return(0,l.useMemo)(()=>({query:n??"",sortBy:e("productsSortBy")===""?GR.sortBy:e("productsSortBy"),...p}),[p,e,n])};function fle({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v12m-3-2.818.879.659c1.171.879 3.07.879 4.242 0 1.172-.879 1.172-2.303 0-3.182C13.536 12.219 12.768 12 12 12c-.725 0-1.45-.22-2.003-.659-1.106-.879-1.106-2.303 0-3.182s2.9-.879 4.006 0l.415.33M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}const wF=l.forwardRef(fle),XS=({dataTestId:e,className:t,trigger:n,options:r,queryParamType:s})=>{const{getParams:o,setArrayParams:i,removeArrayParam:u}=bi(),[p,g]=(0,l.useState)(!1);return(0,a.jsxs)(S0,{open:p,onOpenChange:g,children:[(0,a.jsx)(C0,{asChild:!0,"data-testid":`dropdown${Sd(e)}`,children:n}),(0,a.jsx)(km,{align:"start",className:st("min-w-[225px]",t),children:r?.map(v=>(0,a.jsxs)(Bl,{"data-testid":`dropdownItem${Sd(e)}`,onSelect:w=>{w.preventDefault(),v.value&&(o(s).includes(v.value)?u(s,v.value):i(s,v.value))},children:[(0,a.jsx)(wy,{"data-testid":`checkbox${Sd(e)}`,variant:"secondary",checked:v?.value?o(s).includes(v?.value):!1}),(0,a.jsx)(Pn,{as:"div",variant:"body2",className:"ml-2",children:v.label}),(0,a.jsx)("div",{className:"absolute right-4",children:(0,a.jsx)(Pn,{as:"div",variant:"label",className:"rounded-lg bg-slate-200 px-1.5 py-0.5 dark:text-black",children:v.count})})]},v.value))})]})},ZS=({value:e,icon:t,text:n})=>{const r=e?.length!==0;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(Pn,{as:"div",variant:"body2",className:st("flex items-center",{"text-indigo-600":r}),children:r?(0,a.jsxs)(a.Fragment,{children:[t," ",n,": ",e?.join(", ")]}):(0,a.jsxs)(a.Fragment,{children:[t,(0,a.jsx)(Pn,{variant:"body2",as:"div",children:n})]})}),(0,a.jsx)("div",{className:st("ml-2 mt-1 border-4 border-solid border-transparent border-t-black",{"border-t-indigo-600":r})})]})},ple=({facets:e})=>{const{t}=(0,z.Bd)(),n=e?.find(({fieldName:i})=>i==="offers.billing_cycle")?.countsByValue?.map(i=>({...i,label:t(`ssp:pages.shop.filters.billingCycleValues.${i.value}`)}))??[],{getArrayParam:r}=bi(),o=r("productsBillingCycle")?.map(i=>t(`ssp:pages.shop.filters.billingCycleValues.${i}`));return(0,a.jsx)(XS,{dataTestId:"billingCycle",className:"min-w-[250px]",options:n,queryParamType:"productsBillingCycle",trigger:(0,a.jsx)(mn,{size:"small",variant:"None",className:st("flex items-center px-4 py-2 text-slate-900 hover:bg-white/50 dark:text-slate-100",{"bg-white/50":o.length!==0}),children:(0,a.jsx)(ZS,{text:t("ssp:pages.shop.filters.billingCycle"),icon:(0,a.jsx)(wF,{className:"mr-1 h-4 w-4"}),value:o})})})};function hle({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.429 9.75 2.25 12l4.179 2.25m0-4.5 5.571 3 5.571-3m-11.142 0L2.25 7.5 12 2.25l9.75 5.25-4.179 2.25m0 0L21.75 12l-4.179 2.25m0 0 4.179 2.25L12 21.75 2.25 16.5l4.179-2.25m11.142 0-5.571 3-5.571-3"}))}const mle=l.forwardRef(hle),gle=({facets:e})=>{const{t}=(0,z.Bd)(),n=(0,n0.ok)(),r=e?.find(({fieldName:i})=>i===`categories_${n}.name`)?.countsByValue?.map(i=>({...i,label:i.value}))??[],{getArrayParam:s}=bi(),o=s("productsCategories");return(0,a.jsx)(XS,{dataTestId:"categories",options:r,queryParamType:"productsCategories",trigger:(0,a.jsx)(mn,{size:"small",variant:"None",className:st("flex items-center px-4 py-2 text-slate-900 hover:bg-white/50 dark:text-slate-100",{"bg-white/50":o.length!==0}),children:(0,a.jsx)(ZS,{text:t("ssp:pages.shop.filters.category"),icon:(0,a.jsx)(mle,{className:"mr-1 h-4 w-4"}),value:o})})})},vle=({facets:e})=>{const{t}=(0,z.Bd)(),n=e?.find(({fieldName:i})=>i==="offers.commitment_term")?.countsByValue?.map(i=>({...i,label:t(`ssp:pages.shop.filters.commitmentValues.${i.value}`)}))??[],{getArrayParam:r}=bi(),s=r("productsCommitment"),o=s?.map(i=>t(`ssp:pages.shop.filters.commitmentValues.${i}`));return(0,a.jsx)(XS,{dataTestId:"commitmentTerm",options:n,queryParamType:"productsCommitment",trigger:(0,a.jsx)(mn,{size:"small",variant:"None",className:st("flex items-center px-4 py-2 text-slate-900 hover:bg-white/50 dark:text-slate-100",{"bg-white/50":s.length!==0}),children:(0,a.jsx)(ZS,{text:t("ssp:pages.shop.filters.commitment"),icon:(0,a.jsx)(wF,{className:"mr-1 h-4 w-4"}),value:o})})})},yle=()=>{const{t:e}=(0,z.Bd)(),{getParams:t,setSearchParams:n}=bi(),r=t("productsVendor")||t("productsBillingCycle")||t("productsCommitment")||t("productsCategories"),s=()=>{n("productsVendor",""),n("productsBillingCycle",""),n("productsCommitment",""),n("productsCategories","")};return r===""?null:(0,a.jsxs)(mn,{variant:"None",size:"small",className:" flex items-center px-4 py-2 hover:bg-white/50 dark:text-slate-100",onClick:s,children:[(0,a.jsx)(su,{className:"mr-1 h-4 w-4 text-indigo-600"}),(0,a.jsx)(Pn,{className:"text-indigo-600",variant:"body2",children:e("ssp:pages.shop.filters.reset")})]})};function ble({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6A2.25 2.25 0 0 1 6 3.75h2.25A2.25 2.25 0 0 1 10.5 6v2.25a2.25 2.25 0 0 1-2.25 2.25H6a2.25 2.25 0 0 1-2.25-2.25V6ZM3.75 15.75A2.25 2.25 0 0 1 6 13.5h2.25a2.25 2.25 0 0 1 2.25 2.25V18a2.25 2.25 0 0 1-2.25 2.25H6A2.25 2.25 0 0 1 3.75 18v-2.25ZM13.5 6a2.25 2.25 0 0 1 2.25-2.25H18A2.25 2.25 0 0 1 20.25 6v2.25A2.25 2.25 0 0 1 18 10.5h-2.25a2.25 2.25 0 0 1-2.25-2.25V6ZM13.5 15.75a2.25 2.25 0 0 1 2.25-2.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-2.25A2.25 2.25 0 0 1 13.5 18v-2.25Z"}))}const wle=l.forwardRef(ble),xle=({facets:e})=>{const{t}=(0,z.Bd)(),n=e?.find(({fieldName:o})=>o==="vendor")?.countsByValue?.map(o=>({...o,label:o.value}))??[],{getArrayParam:r}=bi(),s=r("productsVendor");return(0,a.jsx)(XS,{dataTestId:"vendor",options:n,queryParamType:"productsVendor",trigger:(0,a.jsx)(mn,{size:"small",variant:"None",className:st("flex items-center px-4 py-2 text-slate-900 hover:bg-white/50 dark:text-slate-100",{"bg-white/50":s.length!==0}),children:(0,a.jsx)(ZS,{text:t("ssp:pages.shop.filters.vendor"),icon:(0,a.jsx)(wle,{className:"mr-1 h-4 w-4"}),value:s})})})},_le=({facets:e,isLoading:t})=>t?(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,a.jsx)(Ha,{className:"h-[35px] w-[112px]"}),(0,a.jsx)(Ha,{className:"h-[35px] w-[112px]"}),(0,a.jsx)(Ha,{className:"h-[35px] w-[112px]"}),(0,a.jsx)(Ha,{className:"h-[35px] w-[112px]"})]}):(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,a.jsx)(gle,{facets:e}),(0,a.jsx)(xle,{facets:e}),(0,a.jsx)(ple,{facets:e}),(0,a.jsx)(vle,{facets:e}),(0,a.jsx)(yle,{})]}),Sle=({product:e})=>{const{t,i18n:{language:n}}=(0,z.Bd)(),{searchParams:r}=bi(),{removeAllQueryParams:s}=bi(),o=Dl(),i=Md(n),u=Qs(),p=vF({shopProductId:e.id}),g=()=>{s(),u(o(Un.ShopProductDetail,p),{state:{previousFilterParams:r.toString()}})},v=w=>{w.key==="Enter"&&g()};return(0,a.jsx)(xo,{className:"flex min-h-48 flex-col justify-between hover:cursor-pointer focus-visible:outline-indigo-300 md:p-4","data-testid":"product",tabIndex:0,onKeyDown:v,onClick:g,children:(0,a.jsxs)("div",{className:"flex h-full flex-col justify-between gap-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(D$,{vendorType:e.vendor,className:"mb-2 h-[16px]"}),(0,a.jsx)(fc,{className:"min-h-12 text-slate-900 dark:text-slate-200",children:(0,a.jsx)(Pn,{variant:"body1",weight:"semiBold",className:"line-clamp-3 text-wrap sm:line-clamp-2","data-testid":"productName",children:e.name})}),(0,a.jsx)("div",{className:"flex flex-wrap items-center gap-x-2",children:(0,a.jsx)("div",{className:"mt-1 flex items-center gap-x-2",children:e.categories?.map(w=>(0,a.jsx)(to,{"data-testid":"productCategories",className:"dark:bg-slate-950 dark:text-slate-200",children:w.name},w.name))})})]}),(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)(Pn,{variant:"body1",weight:"semiBold","data-testid":"productPrice",children:e.startingPrice&&i(e.startingPrice)}),(0,a.jsx)(Pn,{variant:"body2",colors:"light",children:t("ssp:pages.shop.card.startingPrice")})]})]})},e.id)},Cle=({count:e=8})=>(0,a.jsx)(a.Fragment,{children:Array.from({length:e},(t,n)=>(0,a.jsx)(xo,{className:"flex min-h-52 flex-col justify-between md:p-4","data-testid":"loaderProduct",children:(0,a.jsxs)("div",{className:"flex h-full flex-col justify-between gap-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(Ha,{className:"mb-3 h-[16px] w-20"}),(0,a.jsx)(fc,{className:"min-h-12 text-slate-900 dark:text-slate-200",children:(0,a.jsx)(Ha,{className:"h-[40px] w-full"})}),(0,a.jsx)("div",{className:"mt-3 flex items-center gap-x-2",children:(0,a.jsx)(Ha,{className:"h-[20px] w-full"})})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,a.jsx)(Ha,{className:"h-[16px] w-20"}),(0,a.jsx)(Ha,{className:"h-[16px] w-20"})]})]})},n))}),Ele=()=>{const{t:e}=(0,z.Bd)(),{getParams:t,setSearchParams:n}=bi(),r=t("productsQuery"),s=o=>{n("productsQuery",o)};return(0,a.jsx)("div",{className:"mt-6 flex justify-center",children:(0,a.jsxs)("div",{className:"relative flex h-14",children:[(0,a.jsx)(Xh,{className:"absolute left-4 top-[18px] h-5 w-5 text-gray-500 focus-within:text-gray-600","aria-hidden":"true"}),(0,a.jsx)(_w,{type:"text",className:"text-md h-full w-full min-w-80 rounded-full border border-gray-300 py-2 pl-12 text-left text-gray-600 outline-none focus:border-blue-500 focus:ring-blue-500 focus-visible:outline-offset-0 focus-visible:outline-indigo-300 dark:border-none dark:border-slate-800 dark:bg-slate-950 dark:text-slate-200 dark:ring-1 dark:ring-zinc-700 sm:min-w-[480px]",placeholder:e("ssp:pages.shop.searchPlaceholder"),"data-testid":"inputFilterProducts",value:r,onChange:s})]})})};function Tle({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{fillRule:"evenodd",d:"M6.97 2.47a.75.75 0 0 1 1.06 0l4.5 4.5a.75.75 0 0 1-1.06 1.06L8.25 4.81V16.5a.75.75 0 0 1-1.5 0V4.81L3.53 8.03a.75.75 0 0 1-1.06-1.06l4.5-4.5Zm9.53 4.28a.75.75 0 0 1 .75.75v11.69l3.22-3.22a.75.75 0 1 1 1.06 1.06l-4.5 4.5a.75.75 0 0 1-1.06 0l-4.5-4.5a.75.75 0 1 1 1.06-1.06l3.22 3.22V7.5a.75.75 0 0 1 .75-.75Z",clipRule:"evenodd"}))}const kle=l.forwardRef(Tle);function Rle({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{fillRule:"evenodd",d:"M19.916 4.626a.75.75 0 0 1 .208 1.04l-9 13.5a.75.75 0 0 1-1.154.114l-6-6a.75.75 0 0 1 1.06-1.06l5.353 5.353 8.493-12.74a.75.75 0 0 1 1.04-.207Z",clipRule:"evenodd"}))}const Ple=l.forwardRef(Rle),Ole=({isLoading:e})=>{const{t}=(0,z.Bd)(),n=[{label:t("ssp:pages.shop.sort.productNameAscending"),value:oe.Eh.ProductNameAscending},{label:t("ssp:pages.shop.sort.productNameDescending"),value:oe.Eh.ProductNameDescending},{label:t("ssp:pages.shop.sort.priceAscending"),value:oe.Eh.PriceAscending},{label:t("ssp:pages.shop.sort.priceDescending"),value:oe.Eh.PriceDescending}],{getParams:r,setSearchParams:s}=bi(),o=r("productsSortBy"),[i,u]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{!o&&o!==GR.sortBy&&s("productsSortBy",GR.sortBy)},[o,s]),e?(0,a.jsx)(Ha,{className:"h-[36px] w-[112px]"}):(0,a.jsxs)(S0,{open:i,onOpenChange:u,children:[(0,a.jsx)(C0,{asChild:!0,"data-testid":"dropdownSort",children:(0,a.jsxs)(mn,{size:"small",variant:"None",className:st("flex items-center px-4 py-2 text-slate-900 hover:bg-white/50 dark:text-slate-100",{"bg-white/50":o}),children:[(0,a.jsxs)(Pn,{as:"div",variant:"body2",className:st("flex items-center",{"text-indigo-600":o}),children:[(0,a.jsx)(kle,{className:"mr-1 h-4 w-4"}),n.find(p=>p.value===r("productsSortBy"))?.label]}),(0,a.jsx)("div",{className:st("ml-2 mt-1 border-4 border-solid border-transparent border-t-black",{"border-t-indigo-600":o})})]})}),(0,a.jsx)(km,{align:"end",className:"min-w-[225px]",children:n?.map(p=>(0,a.jsxs)(Bl,{"data-testid":"dropdownItemSort",onSelect:()=>{s("productsSortBy",p.value)},children:[r("productsSortBy")===p.value?(0,a.jsx)(Ple,{className:"h-4 w-4 text-indigo-600"}):null,(0,a.jsx)(Pn,{as:"div",variant:"body2",className:st("ml-2",{"text-indigo-600":r("productsSortBy")===p.value}),children:p.label})]},p.value))})]})},Nle=Gc(()=>{const{t:e}=(0,z.Bd)(),t=dle(),n=C2(Un.ShopProductDetail),r=qR({searchOptions:t,enabled:!n}),s=r?.isLoading||!r?.data,o=cle({searchOptions:t,enabled:!n}),i=o?.isLoading||!o?.data,u=!s&&r?.data?.pages?.[0]?.foundProducts===0,p=async()=>{await r.fetchNextPage()},g=()=>u?(0,a.jsx)(xy,{dataTestId:"Products"}):(0,a.jsx)(a.Fragment,{children:r?.data?.pages?.map(({products:v})=>v?.map(w=>(0,a.jsx)(Sle,{product:w},w.id)))});return(0,a.jsxs)(Wc,{children:[(0,a.jsxs)("div",{className:"py-4 sm:py-10",children:[(0,a.jsx)(yl,{className:"flex items-center",title:(0,a.jsx)(el,{"data-testid":"pageShopTitle",children:e("ssp:pages.shop.title")}),subTitle:e("ssp:pages.shop.subTitle")}),(0,a.jsx)(Ele,{})]}),(0,a.jsxs)("div",{className:"my-4 flex w-full items-center justify-between",children:[(0,a.jsx)(Pn,{variant:"heading5",weight:"bold",children:e("ssp:pages.shop.subHeading")}),(0,a.jsx)(Ole,{isLoading:s})]}),(0,a.jsx)("div",{className:"flex w-full",children:(0,a.jsx)(_le,{facets:o?.data,isLoading:i})}),(0,a.jsxs)("div",{className:"mb-4 mt-8 grid grid-cols-1 gap-4 lg:gap-6 xl:grid-cols-1",children:[(0,a.jsx)("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-2 lg:grid-cols-3 lg:gap-6 xl:grid-cols-4",children:s?(0,a.jsx)(Cle,{}):g()}),r?.hasNextPage?(0,a.jsx)(wk,{isLoading:r.isFetchingNextPage,hasMore:r?.hasNextPage,next:p}):null]}),(0,a.jsx)(Ta,{})]})},oe.aX.MarketplaceProductList),Lw=()=>{const{getParams:e}=bi(),t=e("productCommitment"),n=e("productSku"),{shopProductId:r}=ma(),o=KR(r??"").data?.offersByCommitmentTerm,i=o?.[t]?.find(g=>g.sku===n),u=(0,l.useMemo)(()=>o?Object.keys(o):[],[o]),p=(0,l.useMemo)(()=>{const g=o;for(const v of u)if(v!==oe.mV.Unknown&&g?.[v]?.length!==0)return!1;return!0},[o,u]);return{offersByCommitmentTerm:o,offersByCommitmentTermKeys:u,selectedOffer:i,hasOnlyNoCommitmentTerm:p}},Ale=()=>{const{t:e,i18n:{language:t}}=(0,z.Bd)(),n=Md(t),{getParams:r,setSearchParams:s}=bi(),o=r("productCommitment"),i=r("productSku"),[u,p]=(0,l.useState)([]),g=Hu(u),v=nle(),{offersByCommitmentTerm:w,selectedOffer:x}=Lw(),E=g!==u;return(0,l.useEffect)(()=>{o&&w&&p(w[o])},[o,w]),(0,l.useEffect)(()=>{(E||!i)&&u?.length>0&&s("productSku",u?.[0]?.sku)},[u,E,s,i]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(Pn,{variant:"body1",weight:"medium",className:"text-wrap",children:e("ssp:pages.shop.detail.billingCycle")}),(0,a.jsx)("div",{className:"mb-6 mt-2 flex flex-wrap gap-4",children:u.map(R=>{const k=n(R.price);return(0,a.jsx)(mn,{className:st({"border-2 border-indigo-600 dark:border-indigo-200":x?.sku===R.sku}),variant:"outline",size:"sm",type:"button",onClick:()=>{s("productSku",R?.sku??"")},children:(0,a.jsxs)("div",{className:"flex flex-col gap-y-0.5",children:[(0,a.jsx)(Pn,{variant:"body2",weight:"bold",as:"div",children:v(R.billingCycle)}),(0,a.jsx)("div",{children:k})]})},(R.sku??"")+"-billing-cycle")})})]})},Ile=()=>{const{t:e}=(0,z.Bd)(),{getParams:t,setSearchParams:n}=bi(),r=t("productCommitment"),s=rle(),{offersByCommitmentTerm:o,offersByCommitmentTermKeys:i,hasOnlyNoCommitmentTerm:u}=Lw();return(0,l.useEffect)(()=>{if(!r&&o){const p=i.find(g=>o[g].length>0);p&&n("productCommitment",p)}},[o,i,r,n]),u?null:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(Pn,{variant:"body1",weight:"medium",className:"text-wrap",children:e("ssp:pages.shop.detail.commitmentTerm")}),(0,a.jsx)("div",{className:"mb-6 mt-2 flex flex-wrap gap-4",children:i?.map(p=>o?.[p]?.length===0?null:(0,a.jsx)(mn,{className:st({"border-2 border-indigo-600 dark:border-indigo-200":r===p}),variant:"outline",size:"sm",type:"button",onClick:()=>{r!==p&&(n("productCommitment",p),n("productSku",""))},children:s(p)},p))})]})},jle=({isLoading:e=!1,disabled:t,setConfirmationDialogOpened:n})=>{const{t:r}=(0,z.Bd)(),{getParams:s}=bi(),o=Number(s("productQuantity"));return(0,a.jsx)(Bo,{permission:oe.aX.MarketplaceProductEdit,children:(0,a.jsxs)("div",{className:"mt-6 flex w-full flex-col gap-y-2",children:[(0,a.jsx)(Di,{className:"w-full",variant:"primary",dataTestId:"btnCreateNewSubscription",onClick:()=>n(!0),disabled:t||o===0||e,isLoading:e,loadingChildren:r("ssp:pages.shop.detail.creating"),children:r("ssp:pages.shop.detail.create")}),t?(0,a.jsx)(zp,{variant:$f.Warning,"data-testid":"alertAlreadyActiveSubscription",children:r("ssp:pages.shop.detail.alreadyActiveSubscription")}):null]})})},QR=()=>{const{selectedOffer:e}=Lw(),{i18n:{language:t}}=(0,z.Bd)(),n=Md(t),{getParams:r}=bi(),s=r("productQuantity"),o=EX(),i=(e?.price.amount??0)*Number(s),u=e?.price.currency??Uf.CAD;return{formattedTotalAmount:n({amount:i,currency:u}),totalAmount:i,currency:o(e?.price.currency)}},Dle=({isLoading:e=!1,onConfirm:t,onCancel:n})=>{const{t:r}=(0,z.Bd)(),{shopProductId:s}=ma(),o=KR(s),{selectedOffer:i}=Lw(),{formattedTotalAmount:u}=QR(),p=yF(),g=ole(),v=sle(),{getParams:w}=bi(),x=w("productQuantity");return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(rb,{children:(0,a.jsx)(Nv,{children:r("ssp:pages.shop.detail.confirmationModal.title")})}),(0,a.jsx)(Av,{asChild:!0,"data-testid":"dialogDescriptionContent",children:(0,a.jsx)("div",{className:"text-slate-900",children:i?.commitmentTermType===oe.mV.Unknown?(0,a.jsx)(z.x6,{i18nKey:"ssp:pages.shop.detail.confirmationModal.bodyWithoutCommitmentTerm",values:{productName:o?.data?.name,billingCycle:p(i?.billingCycle),totalAmount:u,billingCyclePeriod:g(i?.billingCycle),count:Number(x)},components:{1:(0,a.jsx)("br",{}),2:(0,a.jsx)("b",{})}}):(0,a.jsx)(z.x6,{i18nKey:"ssp:pages.shop.detail.confirmationModal.bodyWithCommitmentTerm",values:{productName:o?.data?.name,billingCycle:p(i?.billingCycle),commitmentTerm:v(i?.commitmentTermType),totalAmount:u,billingCyclePeriod:g(i?.billingCycle),count:Number(x)},components:{1:(0,a.jsx)("br",{}),2:(0,a.jsx)("b",{})}})})}),(0,a.jsxs)(Ov,{children:[(0,a.jsx)(mn,{"data-testid":"dialogBtnCancel",onClick:n,disabled:e,size:"sm",variant:No.Outline,children:r("ssp:actions.cancel")}),(0,a.jsx)(Di,{onClick:()=>{e||t()},size:"sm",dataTestId:"dialogBtnConfirm",isLoading:e,loadingChildren:r("ssp:pages.shop.detail.confirmationModal.creatingOrder"),children:r("ssp:pages.shop.detail.confirmationModal.createOrder")})]})]})};function Mle({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{fillRule:"evenodd",d:"M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z",clipRule:"evenodd"}))}const $le=l.forwardRef(Mle);function Lle({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{fillRule:"evenodd",d:"M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm-1.72 6.97a.75.75 0 1 0-1.06 1.06L10.94 12l-1.72 1.72a.75.75 0 1 0 1.06 1.06L12 13.06l1.72 1.72a.75.75 0 1 0 1.06-1.06L13.06 12l1.72-1.72a.75.75 0 1 0-1.06-1.06L12 10.94l-1.72-1.72Z",clipRule:"evenodd"}))}const Fle=l.forwardRef(Lle),zle=({isSuccess:e,onContinueShopping:t})=>{const n=Io(),r=Dl(),{t:s}=(0,z.Bd)(),{navigate:o}=Ni(),i=()=>{o(r(Un.Orders,{organizationUniqueName:n?.uniqueName??""}))},u=()=>{t()};return e?(0,a.jsxs)("div",{className:"mt-2 flex flex-col items-center justify-center gap-2",children:[(0,a.jsx)($le,{className:"h-[140px] w-[140px] text-green-500"}),(0,a.jsx)(Pn,{variant:"heading6",weight:"semiBold",className:"mt-4",children:s("ssp:pages.shop.detail.order.success")}),(0,a.jsx)(Pn,{variant:"body2",className:"text-center",children:s("ssp:pages.shop.detail.order.successContent")}),(0,a.jsxs)("div",{className:st("my-2 flex w-full flex-col items-center justify-between gap-2 sm:flex-row sm:items-start"),children:[(0,a.jsx)(mn,{size:"sm",variant:No.Outline,onClick:i,children:s("ssp:pages.shop.detail.order.status")}),(0,a.jsx)(mn,{size:"sm",variant:"None",className:"bg-indigo-600 hover:bg-indigo-700",onClick:u,children:s("ssp:pages.shop.detail.order.continueShopping")})]})]}):(0,a.jsxs)("div",{className:"mt-2 flex flex-col items-center justify-center gap-2",children:[(0,a.jsx)(Fle,{className:"h-[140px] w-[140px] text-red-500"}),(0,a.jsx)(Pn,{variant:"heading6",weight:"semiBold",className:"mt-4",children:s("ssp:pages.shop.detail.order.failed")}),(0,a.jsx)(Pn,{variant:"body2",className:"text-center",children:s("ssp:pages.shop.detail.order.failedContent")}),(0,a.jsx)("div",{className:st("my-2 flex w-full flex-row items-start justify-center"),children:(0,a.jsx)(mn,{size:"sm",variant:No.Outline,onClick:u,children:s("ssp:pages.shop.detail.order.ok")})})]})};function Ule({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 12h14"}))}const xF=l.forwardRef(Ule),Ble=999,Vle=()=>{const{t:e}=(0,z.Bd)(),{getParams:t,setSearchParams:n}=bi(),r=t("productQuantity");(0,l.useEffect)(()=>{r||n("productQuantity","1")},[r,n]);const s=p=>{const g=Math.max(Math.min(p,Ble),0);n("productQuantity",String(g))},o=p=>{const g=parseInt(p.currentTarget.value.replace(/\D/g,""))||0;s(g)},i=()=>s(Number(r)+1),u=()=>s(Number(r)-1);return(0,a.jsxs)("div",{className:"mb-6 flex w-full flex-col gap-2",children:[(0,a.jsx)(Pn,{variant:"body1",weight:"medium",className:"text-wrap",children:e("ssp:pages.shop.detail.quantity")}),(0,a.jsxs)("div",{className:"inline-flex w-full justify-between rounded-lg  border border-gray-300 bg-white dark:border-slate-800 dark:bg-slate-950 dark:text-slate-200 dark:ring-1 dark:ring-zinc-700",children:[(0,a.jsxs)(mn,{onClick:u,variant:"outline",className:"w-11 rounded-l-lg rounded-r-none border-0 px-1 py-3 text-xl font-semibold disabled:bg-gray-100 dark:bg-slate-950  dark:ring-zinc-700 dark:hover:bg-slate-900/50","data-testid":"btnSubstractQuantity",disabled:Number(r)<=1,children:[(0,a.jsx)("span",{className:"hidden",children:"-"}),(0,a.jsx)(xF,{className:"h-6 w-6"})]}),(0,a.jsx)("input",{value:String(r),onChange:o,className:"mx-1 block w-full border-none text-center text-sm font-medium text-gray-900 outline-none disabled:bg-gray-100 dark:border-none dark:bg-slate-950 dark:text-gray-300 dark:ring-zinc-700 dark:focus:bg-slate-900/50  sm:text-sm",id:"quantity","data-testid":"inputProductQuantity"}),(0,a.jsxs)(mn,{onClick:i,variant:"outline",className:"w-11 rounded-l-none rounded-r-lg border-0 px-1 py-3 text-xl font-semibold disabled:bg-gray-100 dark:bg-slate-950  dark:ring-zinc-700 dark:hover:bg-slate-900/50","data-testid":"btnAddQuantity",children:[(0,a.jsx)("span",{className:"hidden",children:"+"}),(0,a.jsx)(Dk,{className:"h-6 w-6"})]})]})]})},Hle=()=>{const{t:e}=(0,z.Bd)(),t=yF(),n=ale(),{selectedOffer:r}=Lw(),{formattedTotalAmount:s}=QR(),o=r?.billingCycle===oe.ut.Unknown||r?.billingCycle===oe.ut.Once||r?.billingCycle===oe.ut.None,i=r?.billingCycle?![oe.ut.Unknown,oe.ut.Once,oe.ut.None].includes(r?.billingCycle):!1,u=r?.commitmentTermType!==oe.mV.Unknown&&r?.commitmentTermType!==oe.mV.Open,p=r?.commitmentTermType===oe.mV.Unknown||r?.commitmentTermType===oe.mV.Open,g={[e("ssp:pages.shop.detail.commitmentSummary.summary",{billingCycle:t(r?.billingCycle),commitmentTerm:n(r?.commitmentTermType)})]:i&&u,[e("ssp:pages.shop.detail.commitmentSummary.summaryWithoutBillingCycle",{commitmentTerm:n(r?.commitmentTermType)})]:o&&u,[e("ssp:pages.shop.detail.commitmentSummary.summaryWithoutCommitment",{billingCycle:t(r?.billingCycle)})]:i&&p,[e("ssp:pages.shop.detail.commitmentSummary.summaryWithoutBillingCycleAndCommitment")]:o&&p},v=Object.keys(g);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(Pn,{variant:"body1",weight:"medium",className:"mb-2 text-wrap",children:e("ssp:pages.shop.detail.total")}),(0,a.jsx)(Pn,{variant:"heading5",weight:"bold",as:"div",className:"duration-1500 transition ease-out",children:s}),(0,a.jsx)(Pn,{variant:"body2",colors:"light",weight:"default",as:"div",className:"min-h-[20px]",children:v.length!==0?v.find(w=>g?.[w]):""})]})},Wle=Gc(()=>{const e=ks(),[t,n]=(0,l.useState)(!1),[r,s]=(0,l.useState)(void 0),{getParams:o}=bi(),{shopProductId:i}=ma(),u=o("productQuantity"),p=Number(u===""?"0":u),g=o("productSku"),v=tle(),w=KR(i),x=w.isLoading||!w?.data,{totalAmount:E,currency:R}=QR(),k=ule(),N=k?.isSuccess||k?.isError;(0,l.useEffect)(()=>{e?.state?.previousFilterParams&&s(e.state.previousFilterParams)},[e?.state?.previousFilterParams]);const L=(0,l.useCallback)(()=>{v(r)},[v,r]),D=()=>{if(N){n(!1),L();return}n(!1)},B=()=>{w?.data?.isProductAvailable&&k.mutate({serviceProviderId:w.data?.serviceProviderId,orderItems:[{productName:w.data?.name,quantity:p,sku:g,vendorName:w.data?.vendor,vendorId:w.data?.vendorId??"",totalPrice:{amount:E,currency:R}}]})};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(ls,{"aria-hidden":N,isLoading:x,title:(0,a.jsx)(Pn,{variant:"heading4",weight:"bold",className:"text-wrap",children:w.data?.name}),onClose:L,children:[(0,a.jsx)(c_,{className:"my-2 mt-0 h-px bg-slate-300 dark:bg-slate-700 md:my-2"}),(0,a.jsxs)("div",{className:"flex flex-col p-6 pt-0",children:[(0,a.jsx)("div",{className:"mt-2 flex md:mt-4",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2",children:[(0,a.jsx)(fD,{className:"mt-1 h-4 w-4 dark:lg:text-white"}),(0,a.jsx)(Pn,{variant:"body2",colors:"light",className:"mt-1","data-testid":"productVendor",children:w.data?.vendor}),(0,a.jsx)("div",{className:"mt-1 flex items-center gap-x-2",children:w.data?.categories?.map(Q=>(0,a.jsx)(to,{"data-testid":"productCategories",className:"dark:bg-slate-200",children:Q.name},Q.name))})]})}),(0,a.jsx)("div",{className:"my-4 mb-8 flex",children:(0,a.jsx)(LR,{variant:"body2",colors:"light",as:"div",content:w.data?.description??""})}),(0,a.jsx)(Ile,{}),(0,a.jsx)(Ale,{}),(0,a.jsx)(Vle,{}),(0,a.jsx)(Hle,{}),(0,a.jsx)(jle,{disabled:!w?.data?.isProductAvailable,isLoading:k.isLoading,setConfirmationDialogOpened:n})]})]}),(0,a.jsx)(Rv,{open:t,onOpenChange:D,children:(0,a.jsx)(Pv,{className:st("sm:max-w-2xl",{"min-h-[400px] !max-w-[418px] p-10 pb-0":N}),children:N?(0,a.jsx)(zle,{isSuccess:k?.isSuccess,onContinueShopping:D}):(0,a.jsx)(Dle,{isLoading:k?.isLoading,onConfirm:B,onCancel:D})})})]})},oe.aX.MarketplaceProductDetail),qle=()=>{const e=jf();return{subscriptionId:vS(e.subscriptionId)?String(e.subscriptionId):void 0}},JS=()=>{const{t:e,i18n:{language:t}}=(0,z.Bd)(),n=bl(t),{subscriptionId:r}=qle(),{isLoading:s,error:o,data:i}=VS(r);let u=0,p="";const g=i?.lastPendingOrFailedOrder?.initialQuantity??i?.quantity,v=i?.lastPendingOrFailedOrder?.quantity;g&&v&&(u=Math.abs(g-v),p=g<v?e("ssp:pages.subscription.quantityForm.orderOperation.add"):e("ssp:pages.subscription.quantityForm.orderOperation.remove"));const w=n(i?.lastPendingOrFailedOrder?.createdAt),x=!!i?.lastPendingOrFailedOrder&&i?.lastPendingOrFailedOrder?.status===Hl.Failed&&!!i?.lastPendingOrFailedOrder.error&&!i?.lastPendingOrFailedOrder.error?.dismissed,E=!!i?.lastPendingOrFailedOrder&&[Hl.Pending,Hl.WaitingForApproval].some(N=>N.toString()===i?.lastPendingOrFailedOrder?.status),R=i?.renewalDate??i?.billingCycle??i?.commitmentType;let k=i?.quantity??0;return E&&(k=i?.lastPendingOrFailedOrder?.quantity??k),{...i,subscriptionId:r,isLoading:s||!i,notFoundError:o?.message==="not found",hasError:!!o||!r,error:o,hasSummary:R,hasLastOrderFailed:x,hasLastOrderPendingQuantity:E,showLicenseUpdateFailedAlert:x&&i?.lastPendingOrFailedOrder?.quantity!==void 0,showLastOrder:i?.lastPendingOrFailedOrder?.status&&typeof w=="string",lastOrderFailedQuantityDelta:u,subscriptionUpdateOperation:p,lastFailedOrPendingOrderDate:w,lastOrderQuantity:v,quantity:k,isOrderApprovalRequired:i?.orderApprovalSettings?.isOrderApprovalRequired}};function Kle({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.625 12a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0H8.25m4.125 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0H12m4.125 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0h-.375M21 12c0 4.556-4.03 8.25-9 8.25a9.764 9.764 0 0 1-2.555-.337A5.972 5.972 0 0 1 5.41 20.97a5.969 5.969 0 0 1-.474-.065 4.48 4.48 0 0 0 .978-2.025c.09-.457-.133-.901-.467-1.226C3.93 16.178 3 14.189 3 12c0-4.556 4.03-8.25 9-8.25s9 3.694 9 8.25Z"}))}const Gle=l.forwardRef(Kle);let YR="";const Qle=({humanReadableid:e,createdAt:t,deltaQuantity:n,operationType:r,orderStatus:s,decisionNote:o})=>{switch(r){case"remove":YR="-";break;case"add":YR="+"}const{t:i,i18n:{language:u}}=(0,z.Bd)(),p=bl(u,Kp.datetime),g=bl(u,Kp.numeric),v=jse(),w=s===Hl.Rejected&&!!o;return(0,a.jsxs)("div",{className:"flex flex-col gap-2 md:gap-4","data-testid":"containerLastOrder",children:[(0,a.jsx)(Fp,{className:"text-slate-500 dark:text-slate-200",children:i("ssp:subscription.order.label")}),(0,a.jsxs)("table",{className:"w-10/12  text-left text-sm",children:[(0,a.jsx)("thead",{className:"border-b border-slate-300  text-slate-500 dark:text-slate-200",children:(0,a.jsxs)("tr",{className:"[&>th]:pb-2 [&>th]:font-normal",children:[(0,a.jsx)("th",{children:i("ssp:subscription.order.tableHeader.id")}),(0,a.jsx)("th",{children:i("ssp:subscription.order.tableHeader.date")}),(0,a.jsx)("th",{children:i("ssp:subscription.order.tableHeader.operations")}),(0,a.jsx)("th",{children:i("ssp:subscription.order.tableHeader.status")})]})}),(0,a.jsx)("tbody",{className:"text-slate-800 dark:text-white",children:(0,a.jsxs)("tr",{className:"font-medium [&>td]:pt-2",children:[(0,a.jsx)("td",{className:"font-semibold",children:e}),(0,a.jsx)("td",{children:(0,a.jsx)($l,{tooltip:p(t),children:g(t)})}),(0,a.jsxs)("td",{className:"pl-8",children:[YR,n]}),(0,a.jsxs)("td",{className:"flex",children:[v(s),w&&(0,a.jsx)($l,{wrapperClassName:"align-middle pl-3",tooltip:o,children:(0,a.jsx)(Gle,{"data-testid":"decisionTooltip",className:"h-6 w-6"})})]})]})})]})]})},Yle=({subscriptionId:e})=>{const{t}=(0,z.Bd)(),{data:n}=VS(e),r=Ase(),s=y3(),o=(p,g)=>p?g?g(p):p:(0,a.jsx)(t0,{tooltip:t("ssp:pages.subscription.fieldNotAvailable"),children:t("ssp:pages.subscription.fieldNA")}),i=r(n?.billingCycle),u=s(n?.commitmentType);return(0,a.jsxs)("div",{className:"grid grid-cols-3 gap-2 md:gap-8",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(Fp,{className:"leading-5 text-slate-500 dark:text-slate-200",children:t("ssp:pages.subscription.bilingCycle")}),(0,a.jsx)("div",{className:"text-sm text-gray-900 dark:text-white",children:o(i)})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(Fp,{className:"leading-5 text-slate-500 dark:text-slate-200",children:t("ssp:pages.subscription.commitmentTerm")}),(0,a.jsx)("div",{className:"text-sm text-gray-900 dark:text-white",children:o(u)})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(Fp,{className:"leading-5 text-slate-500 dark:text-slate-200",children:t("ssp:pages.subscription.currentQuantity")}),(0,a.jsx)("div",{className:"text-sm text-gray-900 dark:text-white",children:n?.quantity})]})]})},Xle=({orderId:e,orderStatus:t})=>{const[n,r]=(0,l.useState)(!1),[s,o]=(0,l.useState)(null),{processOrder:i}=Ose(),[u,p]=(0,l.useState)(void 0),{t:g}=(0,z.Bd)();if(t!==Hl.WaitingForApproval)return null;const v=R=>{o(R),r(!0)},w=()=>{p(void 0),o(null),r(!1)},x=async R=>{await i(e,R,u)},E=s===O0.Approve?"ssp:subscription.order.decision.confirmationModal.approveBody":"ssp:subscription.order.decision.confirmationModal.rejectBody";return(0,a.jsxs)(Bo,{permission:oe.aX.OrderApproval,children:[(0,a.jsxs)("div",{className:"flex flex-row gap-4",children:[(0,a.jsxs)(mn,{variant:No.Success,size:"sm",className:"grow",onClick:()=>v(O0.Approve),children:[(0,a.jsx)(Gv,{className:"h-5 w-5 stroke-2"})," ",g("ssp:subscription.order.decision.approve")]}),(0,a.jsxs)(mn,{variant:No.Danger,size:"sm",className:"grow",onClick:()=>v(O0.Reject),children:[(0,a.jsx)(su,{className:"h-5 w-5 stroke-2"}),g("ssp:subscription.order.decision.reject")]})]}),(0,a.jsx)(Vc,{open:n,onClose:()=>w(),onConfirm:async()=>await x(s),title:g("ssp:subscription.order.decision.confirmationModal.title"),confirmButtonText:g(s===O0.Approve?"ssp:subscription.order.decision.approve":"ssp:subscription.order.decision.reject"),cancelButtonText:g("ssp:actions.cancel"),children:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(z.x6,{i18nKey:E}),s===O0.Reject&&(0,a.jsx)(Aw,{value:u??"",onChange:R=>p(R.target.value),placeholder:g("ssp:subscription.order.decision.confirmationModal.decisionNotePlaceholder"),className:"mt-4"})]})})]})},Zle=({subscriptionId:e,quantity:t})=>{const{t:n,i18n:{language:r}}=(0,z.Bd)(),s=Md(r),{data:o}=VS(e),i=g3(o?.price,t??o?.quantity);return!o?.price||!i?null:(0,a.jsx)(Bo,{permission:oe.aX.SubscriptionPrices,children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm font-medium leading-5 text-slate-500 peer-disabled:cursor-not-allowed peer-disabled:opacity-70 dark:text-slate-200",children:n("ssp:pages.subscription.total")}),(0,a.jsx)("span",{className:"text-slate-800 dark:text-white",children:(0,a.jsx)("div",{className:"inline-flex text-2xl font-bold leading-6 ","data-state":"closed",children:s(i)})})]})})},Jle=({minimumQuantityReached:e,isQuantityZero:t,isCancelSubscriptionAllowed:n})=>{const{t:r}=(0,z.Bd)();return e?(0,a.jsx)(zp,{variant:$f.Danger,children:r("ssp:pages.subscription.quantityForm.cannotDecreaseSubscription")}):t&&!n?(0,a.jsx)(zp,{variant:$f.Danger,children:r("ssp:pages.subscription.quantityForm.cannotCancelSubscription")}):null},ece=999,tce=({onQuantityChange:e,onShowCancelConfirmation:t,onSubmit:n,isSubscriptionCancellationAllowed:r})=>{const{t:s}=(0,z.Bd)(),o=JS(),[i,u]=(0,l.useState)(0),[p,g]=(0,l.useState)(!1),v=o?.committedMinimalQuantity!=null&&i<=o.committedMinimalQuantity,w=o?.committedMinimalQuantity!=null&&i<o.committedMinimalQuantity,x=i===0;(0,l.useEffect)(()=>{e?.(i)},[i,e]),(0,l.useEffect)(()=>{o?.hasLastOrderPendingQuantity?u(o?.lastOrderQuantity??0):u(o?.quantity??0)},[o?.quantity,o?.lastOrderQuantity,o?.hasLastOrderPendingQuantity]);const E=B=>{u(Math.max(Math.min(B,ece),0))},R=B=>{const Q=parseInt(B.currentTarget.value.replace(/\D/g,""))||0;E(Q)},k=()=>E(i+1),N=()=>E(i-1);if(!o)return null;const L=i-(o.quantity??0),D=()=>o.hasLastOrderPendingQuantity?s("ssp:pages.subscription.quantityForm.actionBtnTooltip.pendingChanges"):i===o?.quantity?s("ssp:pages.subscription.quantityForm.actionBtnTooltip.noChangesToSubmit"):s("ssp:pages.subscription.quantityForm.actionBtnTooltip.updateQuantity");return(0,a.jsxs)("div",{className:"flex flex-col gap-8","data-testid":"containerUpdateSubscriptionQuantity",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(Fp,{className:"text-slate-500 dark:text-slate-200",htmlFor:"quantity",children:s("ssp:pages.subscription.quantityForm.quantity")}),(0,a.jsxs)("div",{className:"inline-flex w-full justify-between rounded-lg  border border-gray-300 bg-white dark:border-slate-800 dark:bg-slate-950 dark:text-slate-200 dark:ring-1 dark:ring-zinc-700",children:[(0,a.jsxs)(mn,{onClick:N,variant:"outline",className:"w-11 rounded-l-lg rounded-r-none border-0 px-1 py-3 text-xl font-semibold disabled:bg-gray-100 dark:bg-slate-950  dark:ring-zinc-700 dark:hover:bg-slate-900/50",disabled:o.hasLastOrderPendingQuantity||v,"data-testid":"btnSubstractSubscriptionQuantity",children:[(0,a.jsx)("span",{className:"hidden",children:"-"}),(0,a.jsx)(xF,{className:"h-6 w-6"})]}),(0,a.jsx)("input",{value:String(i),onChange:R,className:"mx-1 block w-full border-none text-center text-sm font-medium text-gray-900 outline-none disabled:bg-gray-100 dark:border-none dark:bg-slate-950 dark:text-gray-300 dark:ring-zinc-700 dark:focus:bg-slate-900/50  sm:text-sm",id:"quantity",disabled:o.hasLastOrderPendingQuantity}),(0,a.jsxs)(mn,{onClick:k,variant:"outline",className:"w-11 rounded-l-none rounded-r-lg border-0 px-1 py-3 text-xl font-semibold disabled:bg-gray-100 dark:bg-slate-950  dark:ring-zinc-700 dark:hover:bg-slate-900/50",disabled:o.hasLastOrderPendingQuantity,"data-testid":"btnAddSubscriptionQuantity",children:[(0,a.jsx)("span",{className:"hidden",children:"+"}),(0,a.jsx)(Dk,{className:"h-6 w-6"})]})]}),(0,a.jsx)(Jle,{minimumQuantityReached:v,isQuantityZero:x,isCancelSubscriptionAllowed:r})]}),(0,a.jsx)($l,{tooltip:D(),children:o.hasLastOrderPendingQuantity?(0,a.jsxs)(mn,{variant:"primary",fullWidth:!0,disabled:!0,children:[(0,a.jsxs)("svg",{"aria-hidden":"true",role:"status",className:"mr-3 inline h-4 w-4 animate-spin text-white",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,a.jsx)("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"#E5E7EB"}),(0,a.jsx)("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentColor"})]}),(0,a.jsx)("span",{children:s("ssp:pages.subscription.quantityForm.actions.updateProcessing")})]}):(0,a.jsx)(mn,{variant:"primary",fullWidth:!0,disabled:i===o?.quantity||w||o.hasLastOrderPendingQuantity||x&&!r,onClick:()=>x?t?.():g(!0),children:s("ssp:pages.subscription.quantityForm.actions.updateSubscription")})}),(0,a.jsx)(Vc,{className:"sm:max-w-2xl",open:p,onClose:()=>g(!1),onConfirm:async()=>await n(i),title:s("ssp:pages.subscription.quantityForm.confirmationModal.title"),confirmButtonText:o?.isOrderApprovalRequired?s("ssp:pages.subscription.quantityForm.confirmationModal.proceedButtonText"):s("ssp:pages.subscription.quantityForm.confirmationModal.confirmationButtonText"),cancelButtonText:s("ssp:actions.cancel"),children:(0,a.jsx)(z.x6,{i18nKey:"ssp:pages.subscription.quantityForm.confirmationModal.body",values:{count:L,operation:L>0?s("ssp:pages.subscription.quantityForm.confirmationModal.addOperation"):s("ssp:pages.subscription.quantityForm.confirmationModal.removeOperation"),quantityDelta:Math.abs(L),newQuantity:i,orderApprovalSection:o?.isOrderApprovalRequired?s("ssp:pages.subscription.quantityForm.confirmationModal.orderApprovalSection"):null},components:{1:(0,a.jsx)("br",{})}})})]})},nce=e=>{const{hasAccess:t}=fu();return(e==null||e===0)&&t(oe.aX.SubscriptionCancel)},rce=({onShowCancelConfirmation:e})=>{const{t}=(0,z.Bd)(),n=()=>{e()};return(0,a.jsxs)("div",{className:"flex flex-row gap-4 px-4 pt-10 hover:cursor-pointer",onClick:n,children:[(0,a.jsx)("div",{className:"inline-flex h-11 w-11 items-center justify-center rounded-lg bg-red-100",children:(0,a.jsx)(Ny,{className:"h-7 w-7 text-red-500"})}),(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)(Pn,{variant:"body2",weight:"medium",children:t("ssp:pages.subscription.details.tabs.manageSubscription.cancel.title")}),(0,a.jsx)(Pn,{variant:"body2",colors:"light",children:t("ssp:pages.subscription.details.tabs.manageSubscription.cancel.description")})]})]})},sce=({visible:e,onClose:t,onSubmit:n})=>{const{t:r}=(0,z.Bd)(),s=JS(),o=()=>{n(0)};return e?(0,a.jsxs)(Vc,{className:"sm:max-w-2xl",open:e,onClose:t,onConfirm:o,title:r("ssp:pages.subscription.details.tabs.manageSubscription.cancel.confirmationDialog.title",{productName:s.productName}),confirmButtonText:r("ssp:pages.subscription.details.tabs.manageSubscription.cancel.confirmationDialog.confirmButtonText"),cancelButtonText:r("ssp:pages.subscription.details.tabs.manageSubscription.cancel.confirmationDialog.dismissButtonText"),children:[r("ssp:pages.subscription.details.tabs.manageSubscription.cancel.confirmationDialog.content",{productName:s.productName}),(0,a.jsx)("br",{}),r("ssp:pages.subscription.details.tabs.manageSubscription.cancel.confirmationDialog.contentHelper")]}):null},oce=({supportEmail:e,updatingError:t,onDismissError:n})=>{const{i18n:{language:r}}=(0,z.Bd)(),s=bl(r),o=JS(),{hasAccess:i}=fu();return o?.showLicenseUpdateFailedAlert&&!t?(0,a.jsx)("div",{children:(0,a.jsx)(zp,{variant:$f.Danger,onClose:i(oe.aX.SubscriptionEdit)?n:void 0,children:(0,a.jsx)(z.x6,{i18nKey:"ssp:pages.subscription.quantityForm.lastOrderPendingQuantityError",values:{subscriptionName:o?.productName,subscriptionUpdateDelta:o?.lastOrderFailedQuantityDelta,subscriptionUpdateOperation:o?.subscriptionUpdateOperation,subscriptionUpdateDate:s(o?.lastPendingOrFailedOrder?.createdAt)},children:e&&(0,a.jsx)(jo,{to:`mailto: ${e}`,className:"font-semibold hover:underline"})})})}):null};function ace({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 5.25h.008v.008H12v-.008Z"}))}const ice=l.forwardRef(ace),lce=()=>{const{t:e}=(0,z.Bd)(),{data:t}=Kg(),n=t?.supportInformation?.email;return n?(0,a.jsxs)("a",{href:"mailto:"+(n??""),className:"flex flex-row gap-4 px-4 pb-4",children:[(0,a.jsx)("div",{className:"inline-flex h-11 w-11 items-center justify-center rounded-lg bg-indigo-100",children:(0,a.jsx)(ice,{className:"h-7 w-7 text-indigo-500"})}),(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-slate-900 dark:text-slate-200",children:e("ssp:pages.subscription.details.tabs.manageSubscription.getHelp.title")}),(0,a.jsx)("p",{className:"text-sm text-gray-500 dark:text-slate-500",children:e("ssp:pages.subscription.details.tabs.manageSubscription.getHelp.description")})]})]}):null};function cce({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5m-9-6h.008v.008H12v-.008ZM12 15h.008v.008H12V15Zm0 2.25h.008v.008H12v-.008ZM9.75 15h.008v.008H9.75V15Zm0 2.25h.008v.008H9.75v-.008ZM7.5 15h.008v.008H7.5V15Zm0 2.25h.008v.008H7.5v-.008Zm6.75-4.5h.008v.008h-.008v-.008Zm0 2.25h.008v.008h-.008V15Zm0 2.25h.008v.008h-.008v-.008Zm2.25-4.5h.008v.008H16.5v-.008Zm0 2.25h.008v.008H16.5V15Z"}))}const uce=l.forwardRef(cce);function dce({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}const fce=l.forwardRef(dce),XR=({description:e,Icon:t})=>(0,a.jsxs)("div",{className:"flex flex-row items-center gap-4 py-1 text-slate-600",children:[t&&(0,a.jsx)("div",{className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-full bg-slate-200 text-slate-900 dark:border dark:border-slate-800 dark:bg-slate-950 dark:text-slate-200",children:(0,a.jsx)(t,{className:"w-6"})}),(0,a.jsx)("span",{className:"text-sm text-gray-900 dark:text-slate-200",children:e})]}),pce=({subscriptionId:e})=>{const{t,i18n:{language:n}}=(0,z.Bd)(),r=bl(n),{data:s}=VS(e),o=Ise(),i=y3(),u=o(s?.billingCycle),p=i(s?.commitmentType),g=r(s?.renewalDate),v=`${t("ssp:pages.subscription.summary.autoRenewalOn")} ${g}`;return p??s?.renewalDate??u?(0,a.jsxs)("div",{className:"grid w-fit grid-cols-1 gap-2 md:grid-cols-2 md:gap-4",children:[p&&(0,a.jsx)(XR,{description:p,Icon:uF}),s?.renewalDate&&(0,a.jsx)(XR,{description:g&&v,Icon:uce}),u&&(0,a.jsx)(XR,{description:u,Icon:fce})]}):null},hce=Gc(()=>{const{t:e}=(0,z.Bd)(),t=Io()?.uniqueName??"",[n,r]=(0,l.useState)(!1),{isLoading:s,data:o}=Kg(),i=o?.supportInformation?.email,{convertMarkdown:u}=cF(),p=JS(),[g,v]=(0,l.useState)(p?.quantity),w=nce(p?.committedMinimalQuantity),x=w||i;(0,l.useEffect)(()=>{g||v(p?.quantity)},[p?.quantity]);const{updateQuantity:E,isLoading:R}=Rse(p?.subscriptionId),{dismissOrderError:k,isLoading:N}=Pse(),L=p?.isLoading||R||s,D=async ye=>{try{await E(ye),(0,Yr.v0)(e("ssp:pages.subscription.updateSuccess"))}catch{(0,Yr.A2)(e("ssp:errors.generic"))}},B=async()=>{try{await k(p?.lastPendingOrFailedOrder?.orderId,p?.id)}catch{(0,Yr.A2)(e("ssp:errors.generic"))}},Q=()=>{r(!1)},ce=()=>{r(!0)};return p?.notFoundError?(0,a.jsx)(hi,{replace:!0,to:_t(Un.Subscriptions,{organizationUniqueName:t})}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(Wc,{children:[L?(0,a.jsx)(zs,{floating:!0}):null,p&&!p.isLoading?(0,a.jsxs)("div",{className:"flex flex-col gap-8 md:gap-16",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(jo,{to:Un.Subscriptions,"data-testid":"linkBackToSubscriptions",children:(0,a.jsx)(a0,{children:e("ssp:pages.subscription.backlink")})}),(0,a.jsx)(el,{"data-testid":"pageSubscriptionTitle",children:p?.productName})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[p?.hasLastOrderPendingQuantity?(0,a.jsx)("div",{children:(0,a.jsx)(zp,{variant:$f.Warning,children:e("ssp:pages.subscription.quantityForm.pendingQuantityWarning")})}):null,(0,a.jsx)(oce,{supportEmail:i,updatingError:N,onDismissError:B}),(0,a.jsxs)(xo,{padded:!0,className:"grid w-full grid-cols-6   gap-12 xl:w-full xl:gap-32",children:[(0,a.jsxs)("div",{className:"col-span-6 flex flex-col gap-8 md:gap-12 lg:col-span-3",children:[(0,a.jsx)(Yle,{subscriptionId:p?.subscriptionId}),(0,a.jsx)(Bo,{permission:oe.aX.SubscriptionEdit,children:(0,a.jsx)(tce,{onQuantityChange:v,onShowCancelConfirmation:w?ce:void 0,onSubmit:D,isSubscriptionCancellationAllowed:w})})]}),(0,a.jsx)("div",{className:"col-span-6 lg:col-span-3",children:(0,a.jsxs)("div",{className:"flex flex-col gap-6 md:gap-10",children:[(0,a.jsx)(Zle,{subscriptionId:p?.subscriptionId,quantity:g}),p?.showLastOrder&&(0,a.jsx)(Qle,{humanReadableid:p?.lastPendingOrFailedOrder?.humanReadableId,createdAt:p?.lastPendingOrFailedOrder?.createdAt,deltaQuantity:p?.lastOrderFailedQuantityDelta,operationType:p?.subscriptionUpdateOperation,orderStatus:p?.lastPendingOrFailedOrder?.status,decisionNote:p?.lastPendingOrFailedOrder?.decisionNote}),(0,a.jsx)(Xle,{orderId:p?.lastPendingOrFailedOrder?.orderId,orderStatus:p?.lastPendingOrFailedOrder?.status})]})})]})]}),(0,a.jsx)(xo,{padded:!0,children:(0,a.jsxs)(Hb,{defaultValue:"details",className:"w-full",children:[(0,a.jsxs)(ly,{children:[(0,a.jsx)(Rd,{"data-testid":"tabsTriggerSubscriptionDetails",value:"details",className:"focus-visible:ring-indigo-300",children:e("ssp:pages.subscription.details.tabs.subscriptionDetails.title")}),x?(0,a.jsx)(Rd,{value:"manage","data-testid":"tabsTriggerManageSubscription",className:"focus-visible:ring-indigo-300",children:e("ssp:pages.subscription.details.tabs.manageSubscription.title")}):null]}),(0,a.jsx)(cm,{"data-testid":"tabsContentSubscriptionDetails",value:"details",className:"focus-visible:ring-indigo-300",children:(0,a.jsxs)("div",{className:"flex flex-col gap-8 px-4 pb-4 pt-10",children:[p?.hasSummary?(0,a.jsx)("div",{className:"w-full lg:w-6/12",children:(0,a.jsx)(pce,{subscriptionId:p?.subscriptionId,quantity:g})}):null,(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("p",{className:"text-base font-semibold leading-none text-slate-800 dark:text-slate-200",children:e("ssp:pages.subscription.details.descriptionTitle")}),(0,a.jsx)(LR,{content:u(p?.description),className:"product_description"})]})]})}),(0,a.jsx)(cm,{value:"manage",className:"focus-visible:ring-indigo-300","data-testid":"tabsContentManageSubscription",children:(0,a.jsxs)("div",{className:"flex flex-col gap-y-6",children:[(0,a.jsx)(Bo,{permission:oe.aX.SubscriptionCancel,children:(0,a.jsx)(rce,{onShowCancelConfirmation:ce})}),(0,a.jsx)(lce,{})]})})]})})]}):null]}),(0,a.jsx)(sce,{visible:n,onSubmit:D,onClose:Q})]})},oe.aX.SubscriptionDetails);function mce({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10"}))}const ZR=l.forwardRef(mce),gce=({subscriptionId:e})=>(0,a.jsx)(Bo,{permission:oe.aX.SubscriptionDetails,children:(0,a.jsx)(jo,{to:Un.Subscription,"data-testid":"linkEditSubscription",params:{subscriptionId:e},className:"flex p-1 focus-visible:outline-offset-0 focus-visible:outline-indigo-300",children:(0,a.jsx)($l,{tooltip:(0,LC.t)("ssp:actions.edit"),children:(0,a.jsx)(ZR,{className:"h-5 w-5 stroke-1 text-indigo-500 dark:stroke-2"})})})}),vce=({renewalDate:e,fullName:t})=>{const{t:n,i18n:{language:r}}=(0,z.Bd)(),s=bl(r);return(0,a.jsx)(FR,{fullName:t,children:e?(0,a.jsxs)("div",{className:"font-light",children:[n("ssp:pages.subscriptions.list.renewsOn")," ",s(e)]}):null})},JR="text-center",yce=({renewalDate:e,fullName:t})=>(0,a.jsx)(vce,{renewalDate:e,fullName:t}),bce=({subscriptionId:e})=>(0,a.jsx)(gce,{subscriptionId:e}),wce=()=>{const{t:e,i18n:{language:t}}=(0,z.Bd)(),n=Md(t),{isLoading:r,error:s,data:o}=BS(),i=Nse(),u=b3(),{hasAccess:p}=fu(),g=p(oe.aX.SubscriptionPrices),v=[{accessorKey:"productName",header:e("ssp:pages.subscriptions.list.columns.productName"),cell:({cell:w,row:x})=>yce({renewalDate:x.original.renewalDate,fullName:w.getValue()}),minSize:417},{accessorKey:"billingCycle",header:e("ssp:pages.subscriptions.list.columns.billingCycle"),enableSorting:!0,meta:{className:JR},cell:({getValue:w})=>i(w()),minSize:278},{accessorKey:"quantity",header:e("ssp:pages.subscriptions.list.columns.quantity"),enableSorting:!0,meta:{className:JR},minSize:278},{accessorKey:"price.amount",header:e("ssp:pages.subscriptions.list.columns.price"),enableSorting:!0,meta:{className:`text-right ${g?"":"hidden"}`},cell:({row:w})=>{const x=w.original.price;return x?n(x):null},minSize:120},{accessorKey:"total.amount",header:e("ssp:pages.subscriptions.list.columns.total"),enableSorting:!0,meta:{className:`text-right ${g?"":"hidden"}`},cell:({row:w})=>{const x=w.original.total;return x?n(x):null},minSize:120},{accessorKey:"statusWithOrders",enableSorting:!0,meta:{className:JR},header:e("ssp:pages.subscriptions.list.columns.status"),cell:({getValue:w,row:x})=>u(w(),x.original.lastPendingOrFailedOrder),minSize:278},{id:"actions",cell:({row:w})=>bce({subscriptionId:w.original.id}),minSize:139}];return r||s?null:(0,a.jsx)(ky,{columns:v,data:o,dataTestId:"tableSubscriptions",filterableFields:["productName"],filterPlaceholder:String(e("ssp:pages.subscriptions.list.filterPlaceholder")),fieldDescription:String(e("ssp:pages.subscriptions.list.searchFieldDescription"))})},xce=()=>{const{t:e,i18n:{language:t}}=(0,z.Bd)(),{isLoading:n,error:r,data:s=[]}=BS(),o=Md(t),i=b3(),{search:u,onSetSearchParams:p}=Qp(),g=s?.filter(v=>v.productName?.toLowerCase().includes(u.toLowerCase()));return n||r?null:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(vu,{children:(0,a.jsx)(vu.Input,{placeholder:e("ssp:pages.subscriptions.list.filterPlaceholder"),filteredText:u,setFilteredText:p})}),g.map((v,w)=>(0,a.jsx)(Nm,{type:"single",collapsible:!0,children:(0,a.jsxs)(Xp,{value:"item-1","data-testid":`listSubscription${w}`,children:[(0,a.jsxs)(Zp,{className:"relative justify-between rounded-xl bg-white p-4 [&[data-state=open]>div>div]:hidden [&[data-state=open]]:rounded-b-none",children:[v.productName,(0,a.jsx)(Oy,{children:i(v.statusWithOrders)})]}),(0,a.jsx)(Jp,{children:(0,a.jsxs)(N0,{children:[(0,a.jsx)(Js,{label:e("ssp:pages.subscriptions.list.columns.quantity"),value:v?.quantity,dataTestId:"accQuantitySubscriptions"}),(0,a.jsxs)(Bo,{permission:oe.aX.SubscriptionPrices,children:[(0,a.jsx)(Js,{label:e("ssp:pages.subscriptions.list.columns.price"),value:v.price?o(v.price):null,dataTestId:"accPriceamountSubscriptions"}),(0,a.jsx)(Js,{label:e("ssp:pages.subscriptions.list.columns.total"),value:v.total?o(v.total):null,dataTestId:"accTotalamountSubscriptions"})]}),(0,a.jsx)(Js,{label:e("ssp:pages.subscriptions.list.columns.status"),value:i(v?.statusWithOrders),dataTestId:"accStatusWithOrdersSubscriptions"}),(0,a.jsx)(Js,{label:e("ssp:pages.subscriptions.list.columns.billingCycle"),value:v.billingCycle,dataTestId:"accBillingCycleSubscriptions"}),(0,a.jsx)(Bo,{permission:oe.aX.SubscriptionDetails,children:(0,a.jsx)(Js,{label:"",value:(0,a.jsx)(jo,{to:Un.Subscription,"data-testid":"linkEditSubscription",params:{subscriptionId:v.id},children:(0,a.jsxs)("div",{className:"flex flex-row gap-2 text-indigo-500",children:[(0,a.jsx)(ZR,{className:"inline h-5 w-5 stroke-1 text-indigo-500 dark:stroke-2"}),(0,a.jsx)("span",{children:e("ssp:pages.subscriptions.list.edit")})]})}),dataTestId:"accActionsSubscriptions"})})]})})]})},v.id))]})},_ce=Gc(()=>{const{t:e}=(0,z.Bd)(),{isLoading:t,error:n,data:r=[],isFetched:s}=BS(),o=s&&!t&&!n&&!r?.length;return(0,a.jsx)(Wc,{children:(0,a.jsxs)("div",{className:"flex flex-col gap-12 md:gap-16",children:[(0,a.jsx)(yl,{title:(0,a.jsx)(el,{"data-testid":"pageSubscriptionsTitle",children:e("ssp:pages.subscriptions.title")}),subTitle:(0,a.jsx)(qu,{children:e("ssp:pages.subscriptions.pageDescription")})}),t&&(0,a.jsx)(zs,{floating:!0}),n&&(0,a.jsx)(A0,{error:n}),o&&(0,a.jsxs)("div",{className:"flex w-full flex-col items-center justify-center gap-4 rounded-lg border-2 border-dashed border-gray-300 p-8 font-normal text-gray-400 md:h-60","data-testid":"containerNoSubscriptions",children:[(0,a.jsx)(Ny,{className:"h-16 w-16 stroke-1 text-gray-400"}),(0,a.jsx)("p",{children:e("ssp:pages.subscriptions.noSubscriptions")})]}),r?.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"hidden lg:block","data-testid":"containerSubscriptionsTable",children:(0,a.jsx)(xo,{padded:!0,children:(0,a.jsx)(wce,{})})}),(0,a.jsx)("div",{className:"mt-4 lg:hidden","data-testid":"containerSubscriptionsTableMobile",children:(0,a.jsx)(xo,{padded:!0,children:(0,a.jsx)(xce,{})})})]})]})})},oe.aX.SubscriptionList),_F={firstName:"",lastName:"",jobTitle:"",email:"",role:oe.gG.OrganizationAdmin,preferredCulture:mu.T.EN},Sce=[{className:"col-span-2 sm:col-span-1",type:"firstName",placeholder:"John",dataTestId:"inputFirstName"},{className:"col-span-2 sm:col-span-1",type:"lastName",placeholder:"Doe",dataTestId:"inputLastName"},{className:"col-span-2",type:"email",placeholder:"johndoe@example.com",dataTestId:"inputEmail"},{className:"col-span-2",type:"jobTitle",placeholder:"ie: CEO",dataTestId:"inputTitle"}],eP="ssp:validations.string.min",tP="ssp:validations.string.max",Cce=tl({firstName:Ds().min(2,{message:`${Eo.t(eP,{path:Eo.t("ssp:pages.user.form.fields.firstName.label"),min:2})}`}).max(30,{message:`${Eo.t(tP,{path:Eo.t("ssp:pages.user.form.fields.firstName.label"),max:30})}`}),lastName:Ds().min(2,{message:`${Eo.t(eP,{path:Eo.t("ssp:pages.user.form.fields.lastName.label"),min:2})}`}).max(30,{message:`${Eo.t(tP,{path:Eo.t("ssp:pages.user.form.fields.lastName.label"),max:30})}`}),jobTitle:Ds().min(2,{message:`${Eo.t(eP,{path:Eo.t("ssp:pages.user.form.fields.jobTitle.label"),min:2})}`}).max(30,{message:`${Eo.t(tP,{path:Eo.t("ssp:pages.user.form.fields.jobTitle.label"),max:30})}`}),role:Vj(oe.gG),email:Ds().email({message:`${Eo.t("ssp:validations.string.email",{path:Eo.t("ssp:pages.user.form.fields.email.label")})}`}),preferredCulture:Ds().min(1,{message:`${Eo.t("ssp:validations.mixed.required",{path:Eo.t("ssp:pages.user.form.fields.preferredCulture.label")})}`})}),SF=({user:e})=>{const{t}=(0,z.Bd)(),n=Io(),r=Dl(),{navigate:s}=Ni(),o=dae(),i=fae(e?.id),u=!!e,p=o.isLoading||i.isLoading,g=hc({resolver:mc(Cce),defaultValues:e??_F});(0,l.useEffect)(()=>{o.isSuccess&&(g.reset(_F),s(r(Un.Users,{organizationUniqueName:n?.uniqueName??""})))},[g,r,o.isSuccess,s,n?.uniqueName]),(0,l.useEffect)(()=>{i.isSuccess&&(g.reset(e),s(r(Un.Users,{organizationUniqueName:n?.uniqueName??""})))},[i.isSuccess,g,r,s,n?.uniqueName,e]);const v=g?.formState?.isDirty;Af({isDirty:v});const w=[{value:mu.T.EN,label:t("ssp:layout.userMenu.languageToggle.languages.english"),dataTestId:"selectItemEnglish"},{value:mu.T.FR,label:t("ssp:layout.userMenu.languageToggle.languages.french"),dataTestId:"selectItemFrench"}],x=E=>{u?i.mutate(E):o.mutate(E)};return(0,a.jsx)(gc,{...g,children:(0,a.jsx)("form",{onSubmit:g.handleSubmit(x),children:(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsxs)("div",{className:"grid grid-cols-4 gap-x-8 gap-y-6",children:[(0,a.jsx)("div",{className:"col-span-4 lg:col-span-2",children:(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-x-8 gap-y-6",children:[Sce.map(E=>(0,a.jsx)("div",{className:E.className,children:(0,a.jsx)(Jr,{control:g.control,name:E.type,render:({field:R})=>(0,a.jsxs)(qr,{children:[(0,a.jsx)(As,{children:t(`ssp:pages.user.form.fields.${E.type}.label`)}),(0,a.jsx)(Kr,{children:(0,a.jsx)(_a,{disabled:E.type==="email"&&u,placeholder:E.placeholder,"data-testid":E.dataTestId,...R})}),(0,a.jsx)(Cs,{})]})})},E.type)),(0,a.jsx)("div",{className:"col-span-2",children:(0,a.jsx)(Jr,{control:g.control,name:"preferredCulture",render:({field:E})=>(0,a.jsxs)(qr,{children:[(0,a.jsx)(As,{children:t("ssp:pages.user.form.fields.preferredCulture.label")}),(0,a.jsxs)(h0,{onValueChange:E.onChange,defaultValue:E.value,children:[(0,a.jsx)(Kr,{children:(0,a.jsx)(wm,{"data-testid":"selectTriggerLanguage",children:(0,a.jsx)(m0,{placeholder:t("ssp:pages.user.form.fields.preferredCulture.placeholder")})})}),(0,a.jsx)(xm,{side:"bottom",children:w.map(R=>(0,a.jsx)(_m,{value:R.value,"data-testid":R.dataTestId,children:R.label},R.value))})]}),(0,a.jsx)(Cs,{})]})})})]})}),(0,a.jsx)("div",{className:"col-span-4 lg:col-span-2",children:(0,a.jsx)(uq,{label:t("ssp:pages.user.form.fields.role.label"),field:"role",options:[{value:Im.OrganizationAdmin,title:t("ssp:user.userRole.organizationAdmin"),description:t("ssp:pages.user.form.fields.role.organizationAdmin.description",{organizationName:n?.name}),dataTestId:"radioListOrganizationAdmin"},{value:Im.BasicUser,title:t("ssp:user.userRole.basicUser"),description:t("ssp:pages.user.form.fields.role.basicUser.description",{organizationName:n?.name}),dataTestId:"radioListBasicUser"}]})})]}),(0,a.jsx)("div",{className:"col-span-2",children:(0,a.jsx)(Di,{type:"submit",disabled:p,dataTestId:"btnCreateOrUpdateUser",isLoading:p,loadingChildren:t(u?"ssp:pages.user.edit.submitting":"ssp:pages.user.new.submit"),children:t(u?"ssp:pages.user.edit.submit":"ssp:pages.user.new.submit")})})]})})})},Ece=({user:e})=>{const{t}=(0,z.Bd)();return(0,a.jsxs)(Hb,{defaultValue:"licenses",className:"w-full",children:[(0,a.jsx)(ly,{children:(0,a.jsx)(Rd,{value:"licenses",className:"focus-visible:ring-indigo-300",children:t("ssp:pages.user.edit.tab.licenses")})}),(0,a.jsx)(cm,{value:"licenses",className:"focus-visible:ring-indigo-300",children:(0,a.jsx)("div",{className:"flex pt-10",children:(0,a.jsx)("div",{className:"grid grid-cols-4 gap-8",children:e?.licenses?.map(n=>(0,a.jsx)("div",{className:"col-span-4 md:col-span-2 lg:col-span-1",children:(0,a.jsx)(FR,{fullName:n?.productName})},n.id))})})})]})},Tce=Gc(()=>{const{t:e}=(0,z.Bd)(),t=ma(),n=vS(t.userId)?String(t.userId):void 0,r=pae(n),s=r?.data?.licenses&&r?.data?.licenses.length>0;return(0,a.jsx)(Wc,{children:r?.isLoading||!r?.data||!n?(0,a.jsx)(zs,{floating:!0}):(0,a.jsxs)("div",{className:"flex flex-col gap-12 md:gap-16",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(jo,{to:Un.Users,"data-testid":"linkBackToUsers",children:(0,a.jsx)(a0,{children:e("ssp:pages.user.backlink")})}),(0,a.jsx)(yl,{title:(0,a.jsxs)(el,{"data-testid":"pageEditUserTitle",children:[r?.data?.firstName," ",r?.data?.lastName]})})]}),(0,a.jsx)(xo,{padded:!0,children:(0,a.jsx)(SF,{user:r?.data})}),s?(0,a.jsx)(xo,{padded:!0,children:(0,a.jsx)(Ece,{user:r?.data})}):null]})})},oe.aX.UsersEdit),kce=Gc(()=>{const{t:e}=(0,z.Bd)();return(0,a.jsx)(Wc,{children:(0,a.jsxs)("div",{className:"flex flex-col gap-12 md:gap-16",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(jo,{to:Un.Users,"data-testid":"linkBackToUsers",children:(0,a.jsx)(a0,{children:e("ssp:pages.user.backlink")})}),(0,a.jsx)(yl,{title:(0,a.jsx)(el,{"data-testid":"pageInviteUserTitle",children:e("ssp:pages.user.new.title")}),subTitle:(0,a.jsx)(qu,{children:e("ssp:pages.user.new.pageDescription")})})]}),(0,a.jsx)(xo,{padded:!0,children:(0,a.jsx)(SF,{})})]})})},oe.aX.UsersCreate),Rce=({user:e,setDeleting:t,setSelectedUser:n})=>{const{t:r}=(0,z.Bd)(),[s,o]=(0,l.useState)(!1),{hasAccess:i}=fu(),u=i(oe.aX.UsersDelete)||i(oe.aX.UsersCreate)||i(oe.aX.UsersEdit),p=G3(),g=()=>{p.mutate(e)};return u?(0,a.jsxs)(S0,{open:s,onOpenChange:o,children:[(0,a.jsx)(C0,{asChild:!0,"data-testid":"dropdownViewUserOptions",children:(0,a.jsx)(mn,{variant:"ghost",className:"h-8 w-8 p-0",children:(0,a.jsx)(zS,{className:"mr-0.5 w-6 text-gray-500 hover:bg-slate-50"})})}),(0,a.jsxs)(km,{align:"end",children:[e.status===oe._O.InvitationSent?(0,a.jsx)(Bo,{permission:oe.aX.UsersCreate,children:(0,a.jsx)(Bl,{disabled:p?.isLoading,"data-testid":"dropdownItemResendInvitation",onClick:g,children:r("ssp:pages.users.list.resendInvitation")})}):null,(0,a.jsx)(Bo,{permission:oe.aX.UsersEdit,children:(0,a.jsx)(jo,{to:Un.UserEdit,params:{userId:e.id},children:(0,a.jsx)(Bl,{"data-testid":"dropdownItemEditUser",children:r("ssp:pages.users.list.edit")})})}),(0,a.jsx)(Bo,{permission:oe.aX.UsersDelete,children:(0,a.jsx)(Bl,{"data-testid":"dropdownItemDeleteUser",onClick:()=>{n(e),t(!0)},children:r("ssp:pages.users.list.delete")})})]})]}):null},Pce=({firstName:e,lastName:t,email:n})=>{const r=()=>e&&t?`${e} ${t}`:n;return(0,a.jsxs)("div",{className:"flex flex-row items-center gap-4",children:[(0,a.jsx)(fie,{fullName:Mp(r())}),(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("div",{className:"font-semibold",children:r()}),e?(0,a.jsx)("div",{className:"text-xs text-gray-500 dark:text-slate-300",children:n}):null]})]})},e1="text-center",Oce=({firstName:e,lastName:t,email:n})=>(0,a.jsx)(Pce,{firstName:e,lastName:t,email:n}),Nce=({user:e,setDeleting:t,setSelectedUser:n})=>(0,a.jsx)(Rce,{user:e,setDeleting:t,setSelectedUser:n}),Ace=()=>{const{t:e,i18n:{language:t}}=(0,z.Bd)(),{isLoading:n,error:r,data:s}=jR(),o=Q3(),[i,u]=(0,l.useState)(!1),[p,g]=(0,l.useState)(),{deleteUser:v}=K3(),w=bl(t),x=Y3(),E=[{id:"email",accessorFn:R=>`${R.firstName??""} ${R.lastName??""}  ${R.email??""}`,header:e("ssp:pages.users.list.columns.user"),enableSorting:!0,cell:({cell:R,row:k})=>Oce({firstName:k.original.firstName,lastName:k.original.lastName,email:k.original.email??""}),minSize:417},{accessorKey:"jobTitle",header:e("ssp:pages.users.list.columns.jobTitle"),enableSorting:!0,meta:{className:e1},minSize:278},{accessorKey:"roles",header:e("ssp:pages.users.list.columns.roles"),enableSorting:!0,meta:{className:e1},cell:({getValue:R})=>o(R()),minSize:278},{accessorKey:"createdAt",header:e("ssp:pages.users.list.columns.createdOn"),enableSorting:!0,meta:{className:e1},cell:({getValue:R})=>w(R()),minSize:278},{accessorKey:"status",header:"Status",enableSorting:!0,meta:{className:e1},cell:({getValue:R})=>x(R()),minSize:278},{id:"actions",cell:({row:R})=>Nce({user:R.original,setDeleting:u,setSelectedUser:g}),size:139}];return n||r?null:(0,a.jsxs)(xo,{padded:!0,children:[(0,a.jsx)(ky,{rowsPerPage:5,rowsPerPageOptions:[5],columns:E,data:s,dataTestId:"tableUsers",filterableFields:["email","jobTitle"],filterPlaceholder:e("ssp:pages.users.list.filterPlaceholder"),fieldDescription:e("ssp:pages.users.list.searchFieldDescription"),optionalActions:(0,a.jsx)(Bo,{permission:oe.aX.UsersCreate,children:(0,a.jsx)(mn,{variant:"primary","data-testid":"btnAddUser",size:"sm",onClick:()=>{},asChild:!0,children:(0,a.jsx)(jo,{to:Un.UsersInvite,className:"rounded-lg focus-visible:outline-indigo-300",children:e("ssp:pages.users.inviteUser")})})})}),p&&(0,a.jsx)(Vc,{open:i,title:e("ssp:pages.users.userDeletionDialog.title"),onClose:()=>u(!1),onConfirm:()=>{v(p.id)},confirmButtonText:e("ssp:actions.delete"),cancelButtonText:e("ssp:actions.cancel"),destructive:!0,children:(0,a.jsx)(z.x6,{i18nKey:"ssp:pages.users.userDeletionDialog.description",values:{user:p.email??`${p?.firstName??""} ${p.lastName??""}`}})})]})};function Ice({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5m-13.5-9L12 3m0 0 4.5 4.5M12 3v13.5"}))}const jce=l.forwardRef(Ice),Dce=()=>{const{t:e,i18n:{language:t}}=(0,z.Bd)(),{isFetching:n,error:r,data:s=[]}=jR(),[o,i]=(0,l.useState)(!1),[u,p]=(0,l.useState)(),{deleteUser:g}=K3(),v=bl(t),w=Q3(),x=Y3(),{search:E,onSetSearchParams:R}=Qp(),{hasAccess:k}=fu(),N=k(oe.aX.UsersDelete)||k(oe.aX.UsersCreate)||k(oe.aX.UsersEdit),L=s?.filter(Q=>`${Q.firstName??""} ${Q.lastName??""}`.toLowerCase()?.includes(E.toLowerCase())||(Q.email?.toLowerCase()??"").includes(E.toLowerCase())||Q.jobTitle?.toLowerCase().includes(E.toLowerCase())),D=G3(),B=Q=>{D.mutate(Q)};return n||r?null:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(xo,{padded:!0,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("div",{className:"mb-4 flex justify-between gap-4",children:(0,a.jsxs)(vu,{children:[(0,a.jsx)(vu.Input,{placeholder:e("ssp:pages.users.list.filterPlaceholder"),filteredText:E,setFilteredText:R}),(0,a.jsx)(Bo,{permission:oe.aX.UsersCreate,children:(0,a.jsx)(mn,{variant:"primary",size:"sm",className:"h-full",onClick:()=>{},"data-testid":"btnAddUserMobile",asChild:!0,children:(0,a.jsx)(jo,{to:Un.UsersInvite,className:"rounded-lg focus-visible:outline-indigo-300",children:(0,a.jsx)(fF,{className:"h-4 w-4"})})})})]})}),L.map(Q=>{const ce=`${Q.firstName} ${Q.lastName}`;return(0,a.jsx)(Nm,{type:"single",collapsible:!0,children:(0,a.jsxs)(Xp,{value:"item-1",children:[(0,a.jsxs)(Zp,{className:"relative justify-between rounded-xl bg-white p-4 [&[data-state=open]>div>div]:hidden [&[data-state=open]]:rounded-b-none",children:[(0,a.jsx)("span",{children:ce}),(0,a.jsx)(Oy,{children:Q.email})]}),(0,a.jsx)(Jp,{children:(0,a.jsxs)(N0,{children:[(0,a.jsx)(Js,{label:e("ssp:pages.users.list.columns.email"),value:Q.email,dataTestId:"accEmailUser"}),(0,a.jsx)(Js,{label:e("ssp:pages.users.list.columns.jobTitle"),value:Q.jobTitle,dataTestId:"accJobUser"}),(0,a.jsx)(Js,{label:e("ssp:pages.users.list.columns.roles"),value:w(Q.roles),dataTestId:"accRolesUser"}),(0,a.jsx)(Js,{label:e("ssp:pages.users.list.columns.createdOn"),value:v(Q.createdAt),dataTestId:"accCreationUser"}),(0,a.jsx)(Js,{label:e("ssp:pages.users.list.columns.status"),value:x(Q.status),dataTestId:"accCreationUser"}),N?(0,a.jsx)(Js,{label:" ",value:(0,a.jsxs)("div",{className:"flex items-center gap-x-2",children:[(0,a.jsx)(Bo,{permission:oe.aX.UsersCreate,children:(0,a.jsx)(mn,{className:"gap-1 p-0",variant:"none",disabled:D?.isLoading,"data-testid":"btnResendInvitationUserMobile",onClick:()=>B(Q),children:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(jce,{className:"h-5 w-5 stroke-1 text-indigo-500 dark:stroke-2"}),(0,a.jsx)("span",{className:"text-indigo-500",children:e("ssp:pages.users.list.resendInvitation")})]})})}),(0,a.jsx)(Bo,{permission:oe.aX.UsersEdit,children:(0,a.jsx)(mn,{asChild:!0,className:"ml-2 p-0",variant:"none","data-testid":"btnEditUserMobile",children:(0,a.jsxs)(jo,{to:Un.UserEdit,params:{userId:Q.id},className:"flex gap-1",children:[(0,a.jsx)(ZR,{className:"h-5 w-5 stroke-1 text-indigo-500 dark:stroke-2"}),(0,a.jsx)("span",{className:"text-indigo-500",children:e("ssp:pages.users.list.edit")})]})})}),(0,a.jsx)(Bo,{permission:oe.aX.UsersDelete,children:(0,a.jsxs)("button",{className:"ml-2 flex flex-row gap-1 text-indigo-500","data-testid":"btnDeleteUserMobile",onClick:()=>{p(Q),i(!0)},children:[(0,a.jsx)(dF,{className:"inline h-5 w-5 stroke-1 text-indigo-500 dark:stroke-2"}),(0,a.jsx)("span",{children:e("ssp:pages.users.list.delete")})]})})]})}):null]})})]})},Q.id)})]})}),u&&(0,a.jsx)(Vc,{open:o,title:e("ssp:pages.users.userDeletionDialog.title"),onClose:()=>i(!1),onConfirm:()=>{g(u.id)},confirmButtonText:e("ssp:actions.delete"),cancelButtonText:e("ssp:actions.cancel"),destructive:!0,children:(0,a.jsx)(z.x6,{i18nKey:"ssp:pages.users.userDeletionDialog.description",values:{user:u.email??`${u?.firstName??""} ${u.lastName??""}`}})})]})},Mce=Gc(()=>{const{t:e}=(0,z.Bd)(),{isFetching:t,error:n,isSuccess:r,data:s=[]}=jR(),o=r&&!n&&!s?.length;return(0,a.jsx)(Wc,{children:(0,a.jsxs)("div",{className:"flex flex-col gap-12 md:gap-16",children:[(0,a.jsx)(yl,{title:(0,a.jsx)(el,{"data-testid":"pageUsersTitle",children:e("ssp:pages.users.title")}),subTitle:(0,a.jsx)(qu,{children:e("ssp:pages.users.pageDescription")})}),t&&(0,a.jsx)(zs,{floating:!0}),n&&(0,a.jsx)(A0,{error:n}),o&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("div",{className:"flex w-full justify-end",children:(0,a.jsx)(Bo,{permission:oe.aX.UsersCreate,children:(0,a.jsx)(mn,{variant:"primary",onClick:()=>{},asChild:!0,"data-testid":"btnAddUser",children:(0,a.jsx)(jo,{to:Un.UsersInvite,children:e("ssp:pages.users.inviteUser")})})})}),(0,a.jsxs)("div",{className:"flex w-full flex-col items-center justify-center gap-4 rounded-lg border-2 border-dashed border-gray-300 p-8 font-normal text-gray-400 md:h-60","data-testid":"containerNoUsers",children:[(0,a.jsx)(Ny,{className:"h-16 w-16 stroke-1 text-gray-400"}),(0,a.jsx)("p",{children:e("ssp:pages.users.noUsers")})]})]}),s?.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"hidden lg:block","data-testid":"containerUsersTable",children:(0,a.jsx)(Ace,{})}),(0,a.jsx)("div",{className:"mt-4 lg:hidden","data-testid":"containerUsersTableMobile",children:(0,a.jsx)(Dce,{})})]})]})})},oe.aX.UsersList),$ce=U0(vo((0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)($r,{path:"/admin",element:n_((0,a.jsx)(bH,{})),children:[(0,a.jsx)($r,{index:!0,element:(0,a.jsx)(hi,{replace:!0,to:Sr.Orders})}),(0,a.jsxs)($r,{path:Sr.Orders,element:(0,a.jsx)(poe,{}),children:[(0,a.jsx)($r,{path:Sr.Order,element:(0,a.jsx)(lre,{})}),(0,a.jsx)($r,{path:Sr.OrderDecision,element:(0,a.jsx)(rte,{})})]}),(0,a.jsx)($r,{path:Sr.Marketplace,element:(0,a.jsx)(mQ,{})}),(0,a.jsxs)($r,{path:Sr.MarketplaceCatalogProducts,element:(0,a.jsx)(bJ,{}),children:[(0,a.jsx)($r,{path:Sr.MarketplaceCatalogAddProducts,element:(0,a.jsx)(NX,{})}),(0,a.jsx)($r,{path:Sr.MarketplaceCatalogAssignedOrganizations,element:(0,a.jsx)(WX,{})})]}),(0,a.jsx)($r,{path:Sr.Settings,element:(0,a.jsx)(sae,{})}),(0,a.jsx)($r,{path:Sr.Onboarding,element:(0,a.jsx)(Yee,{})}),(0,a.jsx)($r,{path:Sr.Integrations,element:(0,a.jsx)(mW,{})}),(0,a.jsx)($r,{path:Sr.Organizations,element:(0,a.jsx)(Uoe,{}),children:(0,a.jsx)($r,{path:Sr.Organization,element:(0,a.jsx)(Poe,{})})}),(0,a.jsx)($r,{path:Sr.SherwebIntegrationsServiceProvider,element:(0,a.jsx)(iQ,{})}),(0,a.jsxs)($r,{path:Sr.IntegrationsConnectWise,element:(0,a.jsx)(RW,{}),children:[(0,a.jsx)($r,{index:!0,element:(0,a.jsx)(hi,{replace:!0,to:Sr.IntegrationsConnectWiseApiInformation})}),(0,a.jsx)($r,{path:Sr.IntegrationsConnectWiseApiInformation,element:(0,a.jsx)(xK,{})}),(0,a.jsx)($r,{path:Sr.IntegrationsConnectWiseBoardConfiguration,element:(0,a.jsx)(HG,{})}),(0,a.jsx)($r,{path:Sr.IntegrationsConnectWiseOrganizationMapping,element:(0,a.jsx)(XG,{})})]}),(0,a.jsx)($r,{path:Sr.Login,element:(0,a.jsx)(lQ,{})}),(0,a.jsx)($r,{path:Sr.InternalError,element:(0,a.jsx)(OH,{className:"h-screen"})}),(0,a.jsx)($r,{path:Sr.UnauthorizedAccess,element:(0,a.jsx)(wH,{className:"h-screen"})}),(0,a.jsx)($r,{path:Sr.ForbiddenAccess,element:(0,a.jsx)(PH,{className:"h-screen"})}),(0,a.jsx)($r,{path:Sr.NotFound,element:(0,a.jsx)(JA,{className:"h-screen"})}),(0,a.jsx)($r,{path:"*",element:(0,a.jsx)(JA,{})})]}),(0,a.jsxs)($r,{path:"/",element:n_((0,a.jsx)(oae,{})),children:[(0,a.jsx)($r,{path:Un.Login,element:(0,a.jsx)($ie,{})}),(0,a.jsx)($r,{path:Un.Root,element:(0,a.jsx)(mF,{})}),(0,a.jsx)($r,{path:sy._.InternalError,element:(0,a.jsx)(FA,{className:"h-screen"})}),(0,a.jsx)($r,{path:sy._.UnauthorizedAccess,element:(0,a.jsx)($ae,{className:"h-screen"})}),(0,a.jsx)($r,{path:sy._.ForbiddenAccess,element:(0,a.jsx)(Lae,{className:"h-screen"})}),(0,a.jsx)($r,{path:sy._.NotFound,element:(0,a.jsx)(Am,{className:"h-screen"})}),(0,a.jsx)($r,{path:Un.OrganizationsNotActivated,element:(0,a.jsx)(Qie,{})}),(0,a.jsxs)($r,{path:Un.OrganizationDispatcher,element:(0,a.jsx)(mF,{}),children:[(0,a.jsx)($r,{path:Un.OrganizationSuspended,element:(0,a.jsx)(Yie,{})}),(0,a.jsx)($r,{path:Un.Dashboard,element:(0,a.jsx)(Mae,{})}),(0,a.jsx)($r,{path:Un.Subscriptions,element:(0,a.jsx)(_ce,{})}),(0,a.jsx)($r,{path:Un.Subscription,element:(0,a.jsx)(hce,{})}),(0,a.jsx)($r,{path:Un.Licenses,element:(0,a.jsx)(Iie,{})}),(0,a.jsx)($r,{path:Un.Users,element:(0,a.jsx)(Mce,{})}),(0,a.jsx)($r,{path:Un.Shop,element:(0,a.jsx)(Nle,{}),children:(0,a.jsx)($r,{path:Un.ShopProductDetail,element:(0,a.jsx)(Wle,{})})}),(0,a.jsx)($r,{path:Un.Orders,element:(0,a.jsx)(Gie,{}),children:(0,a.jsx)($r,{path:Un.Order,element:(0,a.jsx)(Fie,{})})}),(0,a.jsx)($r,{path:Un.UsersInvite,element:(0,a.jsx)(kce,{})}),(0,a.jsx)($r,{path:Un.UserEdit,element:(0,a.jsx)(Tce,{})}),(0,a.jsxs)($r,{path:Un.HelpDesk,element:(0,a.jsx)(die,{}),children:[(0,a.jsx)($r,{path:Un.HelpDeskCreate,element:(0,a.jsx)(Hae,{})}),(0,a.jsx)($r,{path:Un.HelpDeskTicketDetail,element:(0,a.jsx)(Jae,{})})]}),(0,a.jsx)($r,{path:"*",element:(0,a.jsx)(Am,{})})]})]}),(0,a.jsx)($r,{path:"*",element:(0,a.jsx)(Am,{})})]})),{basename:""}),Lce=()=>(0,a.jsx)(_o,{store:FV,children:(0,a.jsx)(Jm,{loading:null,persistor:zV,children:(0,a.jsx)(qt,{children:(0,a.jsx)(V.Ht,{client:JV,children:(0,a.jsxs)(T7,{children:[(0,a.jsx)(z.xC,{i18n:Eo,children:(0,a.jsx)(sb,{fallback:(0,a.jsx)(FA,{}),children:(0,a.jsxs)(tx,{children:[(0,a.jsx)(vi,{bffUrl:ae.A.bff.url,hubService:YV,children:(0,a.jsx)(lo,{router:$ce})}),(0,a.jsx)(k7,{})]})})}),ae.A.isDevelopment&&(0,a.jsx)(te,{})]})})})})}),Fce=e=>{e&&e instanceof Function&&ln.e(458).then(ln.bind(ln,8458)).then(({getCLS:t,getFID:n,getFCP:r,getLCP:s,getTTFB:o})=>{t(e),n(e),r(e),s(e),o(e)}).catch(console.error)};we.createRoot(document.getElementById("root")).render((0,a.jsx)(l.StrictMode,{children:(0,a.jsx)(Lce,{})})),Fce()})()})();

//# sourceMappingURL=main.b6ebe18a.js.map