@apolitical/component-library 8.3.11 → 8.3.12-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +3 -3
- package/index.mjs +2 -8
- package/package.json +1 -1
- package/style.css +1 -1
- package/styles/uclasses/uclasses.scss +4 -0
package/index.js
CHANGED
|
@@ -32,7 +32,7 @@ Check the top-level render call using <`+Se+">.")}return be}}function p5(W,be){{
|
|
|
32
32
|
|
|
33
33
|
Please explain why you're reporting this post. Reasons could include: inappropriate language, harassment, spam, hate speech, false information, among others. Include as much detail as you feel comfortable.
|
|
34
34
|
|
|
35
|
-
Thank you for helping to protect the Apolitical community from abusive content.`,discussionFormCard_placeholder:"Create post",discussionFormCard_placeholder_long:"Write a post or ask a question...",discussionFormCard_overlay_title:"Discard post",discussionFormCard_overlay_text:"Are you sure you want to leave without posting? Changes you have made will not be saved.",discussionFormCard_overlay_cta_discard:"Discard",discussionFormCard_overlay_cta_continue:"Continue editing",discussion_form_postType_label:"Post type","discussion_form__postType_no-category":"Post",discussion_form_title:"Write your {action}",discussion_form_titleField_label:"Title",discussion_form_titleField_placeholder:"Write something...",discussion_form_titleField_error:"Please enter a title or a body for your post.",discussion_form_question_label:"Question",discussion_form_question_placeholder:"Question",discussion_form_option_label:"Options",discussion_form_option_placeholder:"Option {number}",discussion_form_option_cta:"Add option",discussion_form_multiplePollAnswers:"Allow multiple answers",discussion_form_placeholder:"Write a {action}...",discussion_form_label:"Body",discussion_form_label_action:"Your {action}",discussion_form_explainer:"Try to make your {action} specific and practical. Be respectful and kind. See our <a>community guidelines</a>",discussion_form_success:"Your {action} has been submitted.",discussion_form_post:"Create post",discussion_form_posting:"Posting...",discussion_form_save:"Save",discussion_form_saving:"Saving...",discussion_form_cancel:"Cancel",discussion_form_submitting:"Submitting...",discussion_form_placeholder_post:"Share a question, insight, or announcement with the community",discussion_form_error:"We are unable to process your {action} right now. Please try again later or contact us if the problem persists",discussion_form_error_tooLong:"Please keep your content to {maxLength, plural, one {1 character} other {# characters}}.",discussion_form_error_tooMany:"You have posted too many times in a row. Please wait and try again.",discussion_form_error_loggedOut:"Please log in to submit your {action}.",discussion_form_error_noPermission:"You do not have permission to {action}.",discussion_form_error_alreadyExists:"This {action} already exists.",discussion_form_title_question:"Start a conversation",discussion_form_placeholder_question:"Ask your question here",discussion_form_explainer_question:"Unsure what you can post? See our <a>community guidelines</a>.",discussion_likes:"{number, plural, =0 {0 likes} one {# like} other {# likes}}",discussion_likes_short:"{number}",discussion_likes_showAll:"Show all...",discussion_likes_like:"Like this {action}",discussion_likes_unlike:"Unlike {action}",discussion_likes_show:"Show who liked this {action}",discussion_moreMenu_edit:"Edit",discussion_moreMenu_delete:"Delete",discussion_moreMenu_pin:"Pin post",discussion_moreMenu_unpin:"Unpin post",discussion_moreMenu_report:"Report",discussion_comments_screenReader:"See {count, plural, =0 {0 comments} one {# comment} other {# comments}}",discussion_comments:"{count, plural, =0 {0 comments} one {# comment} other {# comments}}",discussion_comments_loading:"... comments",discussion_responses_answer:"Answers",discussion_responses_comment:"Comments",discussion_responses_title:"{action} ({count})",discussion_responses_empty:"Be the first to respond",discussion_responses_empty_answer:"Be the first to answer this question",discussion_responses_placeholder:"Write a comment...",discussion_share_copy_link:"Copy link",discussion_share_copy_link_success:"Link copied to clipboard",discussion_thread_show:"Show {count} {count, select, 1 {reply} other {replies}}",discussion_thread_hide:"Hide replies",discussion_thread_loadMore:"Load more replies",profileModalLauncher_successMessage:"Your post has been created",profileModalLauncher_title:"Your profile is incomplete",profileModalLauncher_text:"A complete profile builds trust and amplifies your voice across the community. Ensure all your details are up to date including a photo and a bio.",contactFooter_title:"Contact us",contactFooter_text:"We're always open to new ideas, so please reach out to see how we can collaborate.",contactFooter_phone:"+44 203 608 2241",contactFooter_email:"hello@apolitical.co",contactForm_name:"Name",contactForm_email:"Email address",contactForm_organisation:"Government department or organisation",contactForm_interests:"I'm interested in",contactForm_interests_publishingCourse:"Publishing or creating a course",contactForm_interests_buyingCourse:"Buying courses for my team",contactForm_interests_learningExperience:"Customised learning experiences",contactForm_interests_somethingElse:"Something else",contactForm_message:"Message",dropdown_menu_multiselect_all:"All",dropdown_menu_multiselect_none:"None",emailHelperTextBox_fallback_title:"Who can join",emailHelperTextBox_fallback_text:"Apolitical is a private community for public servants and policymakers.",emailHelperTextBox_default_title:"Who can join",emailHelperTextBox_default_text:"Apolitical is a private community for public servants and policymakers. <link>Learn more</link>.",emailHelperTextBox_autoApproved_title:"Email check",emailHelperTextBox_autoApproved_text:"Great! Looks like you are using a **government email domain we recognise.** You will be **auto-approved** once you sign up.",emailHelperTextBox_unrecognisedEmail_title:"Not a recognised government email",emailHelperTextBox_unrecognisedEmail_text:"To confirm you work in government or policy, please add more details below. <link>Learn more</link>.",emailHelperTextBox_pendingApproval_title:"Email is pending approval",emailHelperTextBox_pendingApproval_text:"Looks like this email has been used to sign up to Apolitical before, but <strong>we have not yet approved it.</strong> If you cannot wait to join, contact <mail>concierge@apolitical.co</mail>.",emailHelperTextBox_emailUnverified_title:"Hello again!",emailHelperTextBox_emailUnverified_text:"It looks like you're already an Apolitical member. To access your account, please verify your email address. <link>Click here to get a verification code sent to your email</link>.",emailHelperTextBox_emailAlreadyExists_title:"Email is already registered",emailHelperTextBox_emailAlreadyExists_text:"Looks like this email has been used to sign up to Apolitical before, try <link>logging in</link> instead. If you're still having issues, contact <mail>concierge@apolitical.co</mail>.",emailHelperTextBox_error_verificationFailedToSend_title:"Verification code failed to send",emailHelperTextBox_error_verificationFailedToSend_text:"Error details: <em>{error}</em>{br}<link>Click here to try again</link>.{br}If you continue to have problems, contact us at <mail>concierge@apolitical.co</mail>",emailHelperTextBox_error_noFunction:"Cannot resend verification code.",form_fieldWrapper_required:"required",form_fieldWrapper_characterLimit:"Character limit:",form_fieldWrapper_characterLimit_aria_default:"You have {remaining, plural, =0 {no characters} one {1 character} other {# characters}} remaining.",form_fieldWrapper_characterLimit_aria_over:"You are {over, plural, one {1 character} other {# characters}} over the limit. Please shorten your text to {limit} characters.",form_fieldWrapper_characterLimit_info:"You can enter up to {limit} characters",form_error_generalError:"Sorry, something has gone. Please refresh the page and try again.",form_error_required:"Please fill in this required field",form_error_numbers:"Numbers are not allowed in this text field",form_error_email:"Please enter a valid email address",form_error_url:"Please enter a valid URL",form_error_multipleInputs_same:"Please enter a unique value into each field",form_cancel:"Cancel",form_submit:"Submit",form_submitting:"Submitting form...",form_submitted:"Submitted",form_success:"Thank you for submitting the form!",form_multipleInputs_label:"Input {number}",form_multipleInputs_filledInCount:"{number}/{total}",form_multipleInputs_filledInCount_aria:"{number} out of {total} available inputs have been filled in",form_multipleInputs_remove:"Remove this input",inviteForm_email_placeholder:"Add email addresses...",inviteForm_title:"Know someone who might like to join this workshop?",inviteForm_label:"Invite your colleagues by typing or pasting their email addresses below",inviteForm_message_label:"Add an invitation note",inviteForm_message_placeholder:"Add a personal note to your invitation...",inviteForm_ctaMessage:"Send",inviteForm_success:"Invitation Sent!",inviteForm_error:"Something went wrong!",inviteForm_ctaTryAgain:"Try again!",inviteForm_ctaSendMoreInvites:"Send more invites",inviteForm_ctaDone:"Done",inputAutocomplete_placeholder:"Start typing...",passwordRules_unmatched_text:"Passwords do not match",passwordRules_intro:"We advise you not to use your name or email in your password.",passwordRules_rule_label:"Password",passwordRules_rule_8Characters:"must be longer than 8 characters",passwordRules_rule_numberSymbol:"must include a number and a symbol",passwordRules_rule_lowercaseUppercase:"must include both lower and upper case characters",passwordRules_notMet:"Your password does not meet this requirement",passwordRules_currentPassword_label:"Current password",passwordRules_newPassword_label:"New password",passwordRules_confirmPassword_label:"Confirm new password",profileForm_image:"Upload photo",profileForm_name:"Full name",profileForm_name_placeholder:"What's your name, so people can recognise you?",profileForm_jobTitle:"Job title",profileForm_jobTitle_placeholder:"What's your current job title?",profileForm_organization:"Organisation",profileForm_organization_placeholder:"Where do you work?",profileForm_location:"Location",profileForm_location_placeholder:"Add your city",profileForm_location_error:"Please choose a location from the list.",profileForm_bio:"Bio",profileForm_bio_placeholder:"Tell us more about yourself...",profileForm_cta:"Save",profileForm_cta_submitting:"Saving...",profileForm_cta_submitted:"Saved",profileImageChange_cta_uploading:"Uploading image...",profileImageChange_cta_change:"Change photo",profileImageChange_cta_upload:"+ Add profile photo",profileImageChange_error:"There was an error uploading the image. Please try a different file format or reduce the file size to less than 5MB. Contact us if problem persists.",publishArticleForm_title_label:"Title",publishArticleForm_title_placeholder:"Write a snappy title",publishArticleForm_subtitle_label:"Subtitle",publishArticleForm_subtitle_placeholder:"Your topic, in a nutshell",publishArticleForm_body_label:"Body",publishArticleForm_body_placeholder:"Type or paste your article here",publishArticleForm_tags_label:"Tags (select up to three)",publishArticleForm_cover_image_label:"Cover image",publishArticleForm__tags_topic_CitiesAndLocalGovernment:"Cities and local government",publishArticleForm__tags_topic_Climate:"Climate",publishArticleForm__tags_topic_DigitalAndData:"Digital, data and AI",publishArticleForm__tags_topic_Education:"Education",publishArticleForm__tags_topic_EquityJusticeAndInclusion:"Equity, justice and inclusion",publishArticleForm__tags_topic_HealthAndSocialCare:"Health and social care",publishArticleForm__tags_topic_Innovation:"Innovation",publishArticleForm__tags_topic_LeadershipAndSkills:"Leadership and skills",publishArticleForm__tags_topic_LifeInGovernment:"Life in government",publishArticleForm__tags_topic_Policymaking:"Policymaking",publishArticleForm__tags_topic_TransportAndInfrastructure:"Transport and infrastructure",publishArticleForm__tags_topic_WorkAndTheEconomy:"Work and the economy",publishArticleForm_tags_error_over_three:"You must select no more than three options.",publishArticleForm_tags_error_required:"Please select at least one option.",publishArticleForm_disclaimer:"Ready to publish? Before you do, consider the following: Have you thoroughly proofread your writing? Are you confident in your arguments? Have you included hyperlinks to the necessary resources to support your article?",publishArticleForm_cta_submit:"Publish article",publishArticleForm_cta_submitting:"Publishing...",publishArticleForm_cta_submitted:"Published!",publishArticleForm_aria_success:"Your article is being published. You will be redirected to your article in a moment.",publishArticleForm_error:"Sorry, something went wrong.",publishArticleForm_error_underMinLength:"Please add at least {length, plural, one {1 character} other {# characters}}.",publishArticleForm_error_loggedOut:"You need to be logged in to publish an article. Please log in and try again.",publishArticleForm_progressBar:"Your article is being published",publishArticleForm_selectImage_button:"Select a cover image",publishArticleForm_replaceImage_button:"Replace Image",ratings_text:"Rate answer",ratings_stars:"{number} out of {total}",ratings_low:"this is incorrect or confusing",ratings_high:"this is a fantastic answer",ratings_success:"Thank you!",richTextEditor_placeholder:"Write something...",richTextEditor_toolbar:"Formatting options",richTextEditor_bold:"Bold",richTextEditor_heading_three:"Heading",richTextEditor_italic:"Italic",richTextEditor_strikeThrough:"Strikethrough",richTextEditor_link:"Link",richTextEditor_link_text:"Text:",richTextEditor_link_text_aria:"Text to be linked:",richTextEditor_link_url:"Link:",richTextEditor_link_placeholder:"Type or paste URL",richTextEditor_link_error_required:"Please enter a URL to link to",richTextEditor_link_open:"Open: {link}",richTextEditor_link_open_text:"Opens in a new window",richTextEditor_link_edit:"Edit",richTextEditor_link_remove:"Remove",richTextEditor_link_button:"Add link",richTextEditor_link_enrichedUrl_aria:"Remove this preview for {title}",richTextEditor_link_enrichedUrl_aria_fallback:"the link",richTextEditor_link_enrichedUrl_aria_live:"The link preview has been removed from your post",richTextEditor_ol_list:"Numbered list",richTextEditor_ul_list:"Bullet-point list",richTextEditor_block_quote:"Quote",richTextEditor_mention_fallback:"Can't find who you're looking for? Invite them to the community",search_label:"Search for:",search_placeholder:"Ask Apolitical",search_clear:"Clear search",search_cta:"Search",showpassword_show:"Show",showpassword_hide:"Hide",showpassword_aria_show:"Your password is hidden. Click to show.",showpassword_aria_hide:"Your password is visible. Click to hide.",signup_title:"Sign up",signup_full_name:"Full name",signup_full_name_placeholder:"Lionel Messi",signup_email_address:"Work email",signup_email_address_placeholder:"lionel.messi@argentina.gov",signup_job_title:"Job title",signup_job_title_placeholder:"e.g. Senior Policy Advisor",signup_organization:"Organisation",signup_organization_placeholder:"e.g. Department of Justice",signup_url:"Link to official government bio / LinkedIn <small>(optional)</small>",signup_url_placeholder:"https://organisation.com/bio",signup_expectation:"What do you want to know<small>Optional, but we will use your response to build the session!</small>",signup_expectation_placeholder:"What do you want to know?",signup_terms:"I accept Apolitical's <terms>Terms of Service</terms>, <privacy>Privacy Policy</privacy> and that I'll get essential emails for my use of Apolitical",signup_error:"We're really sorry, but we've had a problem trying to sign you up. This could be an issue with our system, so we suggest you try again later.",signup_button_join:"Join for free",signup_button_login:"Log in",signup_submitting:"Submitting form...",signup_success_title:"Thank you for applying to join Apolitical!",signup_success_text:"<p>Once we've vetted your application, you'll get a secure login link to help you get started.</p><p>Please note that trust is everything to our community, so you can't login until your identity has been verified.</p>",poll_instructions:"Select one{allowMultipleVotes, select, true { or more} other {}}",poll_num_votes:"{number, plural, one {# vote} other {# votes}}",poll_remove_vote_button:"Remove vote{number, plural, =0 {} one {} other {s}}",poll_aria_votes:"You have {number, plural, =0 {not voted on this poll} other {voted for:}}",replies_feed_missing_polls_vote_message:"Please vote above to view all the comments",tableOfContents:"Table of contents",timeToComplete_hours:"{time, plural, =0 {} one {1 hour} other {# hours}}",timeToComplete_hours_short:"{time}h",timeToComplete_minutes:"{time, plural, =0 {} one {1 minute} other {# minutes}}",timeToComplete_minutes_short:"{time}m",timeToComplete_range:"{early} - {late}",timeToComplete_range_aria:"between {early} and {late}",tooltip_loading:"Loading...",return_to_nav_button:"Back to top",progressTracker:"Step {current} of {total}",cookieBanner_title:"Cookies and your privacy",cookieBanner_text:"We take your trust and privacy very seriously. Apolitical uses safe cookies (small files on your device) to run the site. You can reject non-essential cookies, but some site features may not work without them.",cookieBanner_buttons_settings:"Change my settings",cookieBanner_buttons_reject:"Reject all",cookieBanner_buttons_accept:"Accept all",footer_platform:"Platform",footer_platform_events:"Events",footer_platform_courses:"Courses",footer_platform_qanda:"Q&A",footer_platform_articles:"Articles",footer_platform_communities:"Communities",footer_community:"Community",footer_community_support:"Support FAQ",footer_community_post:"Post on Apolitical",footer_community_join:"Who can join",footer_community_guidelines:"Guidelines & values",footer_company:"Company",footer_company_news:"News",footer_company_insights:"Insights",footer_company_story:"Our story",footer_company_team:"Meet our team",footer_company_careers:"Careers",footer_company_partner:"Partner with us",footer_company_contact:"Get in touch",footer_legal:"Legal",footer_legal_privacy:"Privacy policy",footer_legal_terms:"Terms & conditions",footer_legal_cookie:"Cookie policy",footer_legal_accessibility:"Accessibility statement",footer_legal_ai:"AI principles",footer_legal_dataProtection:"Data protection officer",footer_legal_euDataProtection:"EU data protection officer",footer_contact:"Contact",footer_contact_london:"London address",footer_contact_london_address:"251 Southwark Bridge Road{br}London, SE1 6FL{br}United Kingdom",footer_contact_registered:"Registered address",footer_contact_registered_address:"20–22 Wenlock Road{br}London, N1 7GU{br}United Kingdom",footer_contact_berlin:"Berlin address",footer_contact_berlin_address:"Torstraße 220{br}10115 Berlin{br}Germany",footer_contact_washington:"Washington DC Address",footer_contact_washington_address:"1100 15th St NW{br}Washington, DC 20005{br}United States",footer_contact_support:"For platform support",footer_contact_business:"For business inquiries",footer_social_linkedin:"LinkedIn",footer_social_twitter:"Twitter",footer_social_facebook:"Facebook",footer_copyright:"Copyright © {currentYear} Apolitical Group Limited",header_skip:"Skip to main content",header_language_switcher:"Change language",header_search_show:"Show search bar",header_search_hide:"Close search bar",header_menu_show:"Show navigation",header_menu_hide:"Close navigation",header_home_loggedOut:"Home",header_home_loggedIn:"My Home",header_communities:"Communities",header_topics:"Topics",header_topics_explore:"Explore",header_topics_explore_events:"Events",header_topics_explore_courses:"Courses","header_topics_explore_q-and-a":"Q&A",header_topics_explore_articles:"Articles",header_topics_explore_communities:"Communities",header_topics_topics:"Topics",header_topics_topics_climate:"Climate","header_topics_topics_cities-and-local-government":"Cities and local government","header_topics_topics_digital-and-data":"Digital, data and AI",header_topics_topics_education:"Education","header_topics_topics_equity-justice-and-inclusion":"Equity, justice and inclusion","header_topics_topics_health-and-social-care":"Health and social care",header_topics_topics_innovation:"Innovation","header_topics_topics_leadership-and-skills":"Leadership and skills","header_topics_topics_life-in-government":"Life in government",header_topics_topics_policymaking:"Policymaking","header_topics_topics_transport-and-infrastructure":"Transport and infrastructure","header_topics_topics_work-and-the-economy":"Work and the economy",header_partners:"For partners",header_account:"My account",header_account_show:"Show account menu",header_account_hide:"Close account menu",header_account_profile:"My profile",header_account_settings:"Settings & privacy","header_account_log-out":"Log out",header_buttons_login:"Log in",header_buttons_signup:"Sign up",header_language_unavailable_en:"This page is only available in English. <link>Learn more →</link>",header_language_unavailable_es:"Esta página sólo está disponible en inglés. <link>Más información →</link>",header_language_unavailable_fr:"Cette page est uniquement disponible en anglais. <link>En savoir plus →</link>",header_language_unavailable_pt:"Esta página está disponível apenas em inglês. <link>Saiba mais →</link>",header_language_unavailable_id:"Halaman ini tidak tersedia dalam bahasa yang dipilih. <link>Pelajari lebih lanjut →</link>","header_language_unavailable_pt-BR":"Esta página não está disponível no idioma selecionado. <link>Saiba mais →</link>",pageLayout_browserTooSmall:"Sorry, your device is too small to view this content properly. Please change to a different orientation or another device.",pageLayout_error:"An error occurred while rendering this page. Please refresh the page or try again later.",loadingBlock_loading:"Loading...",loadingBlock_almostDone:"Almost done...",loadingBlock_complete:"Complete!",progressBar:"{number}% loaded",discussionFormModal_title:"Create a post",discussionFormModal_cta:"Create post",inviteModal_title:"You’re registered",inviteModal_formTitle:"Know someone who might like to join this workshop?",inviteModal_formLabel:"Invite your colleagues by typing or pasting their email addresses below.",inviteModal_cta:"Send",overlay_close:"Close",profileModal_title:"Update your profile",breadcrumbs_label:"Go back to:",breadcrumbs_currentPage:"Current page:",filters_all:"Show all",filters_disabled:"{name} - no results",languageSwitcher_label:"I would like to read this article in...",languageSwitcher_translation_original:"original language",languageSwitcher_translation_human:"translated by person",languageSwitcher_translation_machine:"translated by machine",languageSwitcher_selected:"{language} - currently selected",languageSwitcher_disclaimer:"This content is machine translated and will occasionally get gendered language or other direct translations wrong. We’re trying to resolve this but in the meantime, if you notice something very wrong, let us know at <link>{email}</link>",loadMore_button:"Load more",loadMore_endOfFeed:"You're all caught up",loadMore_error:"We're having trouble loading more content. Please refresh the page or try again later.",moreMenu:"See more options",navigationMenu_links_homepage:"Home",navigationMenu_links_events:"Events",navigationMenu_links_microcourses:"Courses","navigationMenu_links_q-and-a":"Q&A",navigationMenu_links_articles:"Articles",navigationMenu_links_communities:"Communities",shareLinks_label:"Share",shareLinks_link_linkedin:"Share on LinkedIn",shareLinks_link_twitter:"Share on Twitter",shareLinks_link_facebook:"Share on Facebook",shareLinks_link_email:"Share by email","shareLinks_link_clipboard-copy":"Copy the link",tags_community:"From the community",editSection_placeholder_description:"Add some details",editSection_placeholder_cta:"add",editSection_edit:"Edit",notFoundError_title:"We can't find that page",notFoundError_text:"Sorry about that. We all mess up sometimes - read some ‘fail’ stories below.",notFoundError_post_1:"Why public servants must learn to fail — and 3 tips for how to do it",notFoundError_post_2:"What failure has taught me",notFoundError_post_3:"How to learn from failure without causing a scandal",notFoundError_cta:"View more articles",collapsibleSection_summary:"Find out more",contentTypeLabel_event:"Event",contentTypeLabel_learningHub:"Programme",contentTypeLabel_listPage:"List",contentTypeLabel_microcourse:"Course",contentTypeLabel_qaQuestion:"Q&A",contentTypeLabel_solutionArticle:"Article",contentTypeLabel_communityPage:"Community",hideShowTextBox_hide:"View less",hideShowTextBox_show:"View more",markdown_collapsibleSection_summary:"Resources",markdown_skip_video:"Skip past video",markdown_skip_padlet:"Skip past interactive board",markdown_skip_poll:"Skip past poll",markdown_skip_survey:"Skip past survey",markdown_skip:"Skip to next section",markdown_iframe_title:"Course information",markdown_iframe_video:"Video",markdown_iframe_padlet:"Interactive board",markdown_iframe_poll:"Poll",markdown_iframe_survey:"Survey",member_connection_accept:"Accept",member_connection_cancel:"Cancel Request",member_connection_connect:"Connect",member_connection_connected:"Connected",member_connection_pending:"Pending",member_connection_remove:"Remove Connection",member_connection_requested:"Requested",member_show_email_hide:"Email visible only to connections",member_show_email_private:"Private profile email hidden",member_show_email_show:"Show contact info",member_show_email_tooltip:"Copy email address",member_show_email_tooltip_copied:"Email copied to clipboard",member_show_email_tooltip_mine:"Visible only to your connections",member_show_email_tooltip_private:"The privacy setting for this profile is private"},GD={...uo,languageSwitcher_label:"Me gustaría leer este artículo en...",languageSwitcher_translation_original:"idioma original",languageSwitcher_translation_human:"traducido por un humano",languageSwitcher_translation_machine:"traducido por máquina",languageSwitcher_disclaimer:"Este contenido fue traducido automáticamente y ocasionalmente tendrá errores de género u otras traducciones directas. Estamos intentando resolver este problema, pero mientras tanto, si notas algún error grave, escríbenos a <link>{email}</link>"},YD={...uo,languageSwitcher_label:"Je voudrais lire cet article dans...",languageSwitcher_translation_original:"langue originale",languageSwitcher_translation_human:"traduit par un humain",languageSwitcher_translation_machine:"traduit par machine",languageSwitcher_disclaimer:"Ce contenu est traduit automatiquement et contiendra d’évantuelles erreurs de genre ou d’autres traductions directes. Nous essayons de résoudre ce problème, mais en attendant, si vous remarquez une erreur importante, faites-le nous savoir à <link>{email}</link>",collapsibleSection_summary:"En savoir plus"},ZD={...uo,languageSwitcher_label:"Eu gostaria de ler este artigo em...",languageSwitcher_translation_original:"linguagem original",languageSwitcher_translation_human:"traduzido por um humano",languageSwitcher_translation_machine:"traduzido por máquina",languageSwitcher_disclaimer:"Este conteúdo foi traduzido automaticamente e, ocasionalmente, poderão ocorrer erros de linguagem de gênero ou outras traduções diretas. Estamos tentando resolver isso, porém se perceber algo errado por favor nos avise em <link>{email}</link>"},QD={...uo,languageSwitcher_label:"Saya ingin membaca artikel ini dalam...",languageSwitcher_translation_original:"bahasa asli",languageSwitcher_translation_human:"diterjemahkan oleh manusia",languageSwitcher_translation_machine:"diterjemahkan oleh mesin",languageSwitcher_disclaimer:"Konten ini telah diterjemahkan secara otomatis dan terkadang mungkin terdapat kesalahan dalam penerjemahan gender atau terjemahan langsung lainnya. Kami sedang berusaha memperbaiki hal ini, tetapi jika Anda menemukan kesalahan, mohon beri tahu kami di <link>{email}</link>"},XD={...uo,languageSwitcher_label:"Eu gostaria de ler este artigo em...",languageSwitcher_translation_original:"idioma original",languageSwitcher_translation_human:"traduzido por humano",languageSwitcher_translation_machine:"traduzido por máquina",languageSwitcher_disclaimer:"Este conteúdo foi traduzido automaticamente e, ocasionalmente, podem ocorrer erros de linguagem de gênero ou outras traduções diretas. Estamos trabalhando para resolver isso, mas se você perceber algo errado, por favor nos avise em <link>{email}</link>"},gh=(e,t=uo)=>e in t,oi=(e,t,n,r,i={})=>{let a="";return gh(`${t}_${n}`)?a=e({id:`${t}_${n}`},i):a=e({id:t},{[r]:n,...i}),a},JD=(e,t,n)=>{if(!e||e===0)return"0";t||(t=0),n||(n=["k","m","b","t"]);let r=e.toString();t=Math.pow(10,t);for(let i=n.length-1;i>=0;i--){const a=Math.pow(10,(i+1)*3);if(a<=e){e=Math.round(e*t/a)/t,e===1e3&&i<n.length-1&&(e=1,i++),r=`${e}${n[i]}`;break}}return r},Ed=(e,t)=>E.Children.map(e,n=>Object.is(n,null)?n:E.cloneElement(n,{...t})),KC=(e=0)=>{setTimeout(()=>{const t=document.querySelector(".splash-screen");t&&t.remove(),window.prerenderReady=!0},e)},eO=e=>{var a,o;const n=["name","organization","jobTitle","biography"].every(s=>{const l=e[s];return l!=null&&l!==""}),r=((a=e.image)==null?void 0:a.thumbnail)!==void 0,i=((o=e.location)==null?void 0:o.en)!==void 0;return n&&r&&i},tO=(e,t,n)=>!t.id||!t.name?"":t.error?n.replace(/{{name}}/g,gc).replace(/{{id}}/g,gc):n.replace(/{{name}}/g,t.name).replace(/{{id}}/g,t.id),GC=async({text:e,template:t,mentions:n,listMembers:r=()=>Promise.resolve([])})=>{var a;if(!n)return e;const i=e.match(vc);if(!i)return e;for(const o of i){const s=o.replace(vc,(c,d)=>d),l=n[s];if(!l)continue;const u={};if(typeof l=="object")u.name=l.error?l.error:((a=l==null?void 0:l.data)==null?void 0:a.name)||"",u.id=l.id||"",u.error=l.error;else{const c=l;if(c.startsWith(X0))try{const d=c.replace(X0,"");u.id=d,await r({id:d}).then(f=>{const{name:h,error:m}=f;u.name=m||h||"",u.error=m})}catch{e.replace(o,"@");continue}else continue}e=e.replace(o,u.name?tO(e,u,t):o)}return e},Ov=e=>{const t=e.startsWith("http")?e:`https://${e}`,r=new URL(t).hostname;return{full:t,pretty:r}},YC=e=>new URLSearchParams(window.location.search).get(e),yc=(e="")=>e.replace(/\s+/g,"").length>0,eg=e=>{const t=e.length>8,n=/[0-9]/.test(e)&&/[`!@#$%^&*()_+\-=[\]{}£;':"\\|,.<>/?~]/.test(e),r=new RegExp("^(?=.*?[A-Z])(?=.*?[a-z])").test(e);return{isValid:t&&n&&r,matchingRules:{isMoreThanEightCharacters:t,includesNumberAndSymbol:n,includesLowerAndUppercase:r}}};const Ke=({variant:e="primary",size:t="medium",styling:n={muted:!1,fullWidth:!1},icon:r=!1,href:i=!1,element:a="button",onClick:o=!1,className:s="",disabled:l=!1,tooltip:u="",forceTooltip:c=!1,screenreaderText:d=!1,children:f=!1,...h})=>{const p=lo(typeof t=="object"),{showTooltip:y,tooltipProps:v}=kv(!!u);if(typeof t=="object"&&typeof p=="number"){const C=Object.assign({},t),x=$C(Object.keys(C));t=jC(p,x,C)}!l&&u&&!c&&(u="");const b=[];typeof t=="string"&&b.push(t),r&&(b.push("icon"),typeof r=="object"?(b.push(r.icon),r.position?b.push(r.position):b.push("left"),r.hover&&b.push(`hover_${r.hover}`),r.animate&&(b.push("animate"),typeof r.animate=="string"&&b.push(r.animate))):(b.push(r),!r.includes("right")&&!r.includes("left")&&b.push("left")));const _={...h,className:ee(e,s,b,{"no-text":!f,disabled:l,button:i,muted:n.muted,"full-width":n.fullWidth}),onClick:C=>{(!i||i[0]==="#")&&o&&(C.preventDefault(),C.stopPropagation()),o&&o(C)},disabled:typeof l=="object"&&"isClickable"in l?!l.isClickable:l};i&&(a="a",_.href=i);const T=E.createElement(a,_,f||(d?g.jsx(xt,{showOnFocus:!1,children:d}):null));return c||l&&u?g.jsxs("span",{className:"button-container",...v,children:[g.jsx(ss,{isOpen:y,accessibility:{readToScreenreadersWhenClosed:!0},children:u}),T]}):T},Fl=({buttons:e,wrappers:t=[],className:n="",...r})=>{const i=e.length>1?"ul":"p",a=e.map((o,s)=>{var l;return i==="p"?g.jsx(Ke,{...o},s):g.jsx("li",{className:((l=t[s])==null?void 0:l.className)||"",children:g.jsx(Ke,{...o})},s)});return E.createElement(i,{className:ee("button-wrapper",n),...r,children:a})};const fi=({className:e="",maxWidth:t=!1})=>{const n=t?{"--max-width":`${t/16}rem`}:{};return g.jsx("hr",{className:ee(e,{"has-max-width":t}),style:n})},_5={card:{range:[{height:320,width:320},{height:425,width:687},{height:510,width:768}],sizes:"(min-width: 1024px) 720px, 30vw"},responsiveCard:{range:[{height:125,width:200},{height:188,width:300},{height:313,width:500}],sizes:"(min-width: 1024px) 720px, 30vw"},banner:{range:[{height:124,width:425},{height:320,width:768},{height:510,width:1368}],sizes:"(min-width: 1024px) 975px, 50vw"},feed:{range:[{height:270,width:124},{height:320,width:425},{height:425,width:687}],sizes:"(min-width: 1024px) 510px, 20vw"},highlightSection:{range:[{height:200,width:674},{height:400,width:1348},{height:1e3,width:1e3},{height:2e3,width:2e3}],sizes:"(max-width: 500px) 674px, (max-width: 1024px) 1348px, (max-width: 1200px) 1000px, 2000px"},thumbnail:{range:[{height:124,width:124},{height:320,width:320},{height:510,width:510}],sizes:"(min-width: 1024px) 453px, 20vw"},fallback:{range:[{height:124,width:375},{height:320,width:687},{height:510,width:990}],sizes:"(min-width: 1024px) 885px, 35vw"}},nO=({aspect:e,range:t,sizes:n})=>{const{range:r,sizes:i}=e?_5[e]:_5.fallback;return{range:t&&t.length>0?t:r,sizes:n||i}},rO=({format:e,height:t,query:n,width:r})=>{let i=`w=${r}&h=${t}`;return i=e?`${i}&fm=${e}`:i,i=n?`${i}&${n}`:i,i},Dp=({format:e,range:t,url:n,query:r})=>t.map(({height:i,width:a})=>`${n}?${rO({format:e,height:i,query:r,width:a})} ${a}w`).join(", ");const co=({image:e,className:t,testId:n})=>{const{description:r,height:i,type:a,color:o,query:s,url:l,width:u,loading:c,decoding:d,fetchPriority:f}=e,{range:h,sizes:m}=nO(e),p=Dp({format:"avif",query:s,range:h,url:l}),y=Dp({format:"webp",query:s,range:h,url:l}),v=Dp({format:"",query:s,range:h,url:l});let b={};return o&&(b={"--color":o}),a&&a.includes("svg")?g.jsx("picture",{className:t,style:b,children:g.jsx("img",{src:l,alt:r,loading:c||"lazy",decoding:d||"async",fetchpriority:f||"auto",width:u,height:i,"data-testid":n||"image"})}):g.jsxs("picture",{className:t,style:b,children:[a!=="image/gif"&&g.jsx("source",{type:"image/avif",srcSet:p,sizes:m,"data-testid":"source"}),g.jsx("source",{type:"image/webp",srcSet:y,sizes:m,"data-testid":"source"}),g.jsx("img",{srcSet:v,sizes:m,src:l,alt:r,loading:c||"lazy",decoding:d||"async",fetchpriority:f||"auto",width:u,height:i,"data-testid":n||"image"})]})};const iO=({image:e,className:t="",testId:n})=>g.jsx("div",{className:`image-container ${t}`,"data-testid":n||"image-container",children:e&&g.jsx(co,{image:{...e},className:"image"})}),fo=({href:e,children:t,fallbackElement:n,meta:r,className:i="",onClick:a,gtmContext:o,gtmType:s,...l})=>{const{forceOnClick:u=!1}=r||{};if(e){const d={...l};return a&&(d.onClick=a),o&&(d["data-gtm-event-context"]=o),s&&(d["data-gtm-event-type"]=s),g.jsx("a",{href:e,className:ee("gtm-trackable",i),...d,children:t})}const c={};return u&&(c.onClick=a),n?E.createElement(n,{children:t,className:i,...l,...c}):g.jsx(g.Fragment,{children:t})};const ZC=E.forwardRef(({className:e="",children:t},n)=>{const r=E.useRef(null),i=n||r;return g.jsx("aside",{ref:i,className:ee("popover",e),"aria-live":"polite",children:t})}),Ml=({parent:e=document.body,children:t})=>typeof document=="object"?ph.createPortal(t,e):null,aO=Object.freeze(Object.defineProperty({__proto__:null,default:Ml},Symbol.toStringTag,{value:"Module"}));const oO=({currentStep:e=1,steps:t=1})=>g.jsxs(g.Fragment,{children:[g.jsx(xt,{children:g.jsx(me.FormattedMessage,{id:"progressTracker",values:{current:e,total:t}})}),g.jsx("div",{className:"progress-tracker",children:g.jsx("div",{className:"dots-wrapper",children:new Array(t).fill("").map((n,r)=>{const i=r+1;return g.jsxs("div",{className:"dot-wrapper",children:[g.jsx("div",{className:ee("dot",{active:i===e,completed:i<e}),"data-testid":"progress-dot"}),g.jsx("div",{className:ee("line",{active:i<e})})]},r)})})})]});const sO=({elementId:e,offset:t=20})=>{const n=me.useIntl(),r=()=>{const i=document.getElementById(e);if(!i)return;const a=document.getElementById("header");a&&window.scrollTo({top:i.offsetTop-a.clientHeight-t})};return g.jsx(Ke,{variant:"secondary",className:"return-to-nav",onClick:r,"data-gtm-event-context":"ListPageMobile","data-gtm-event-type":"back-to-nav-button-click",screenreaderText:n.formatMessage({id:"return_to_nav_button"})})};const lO=({items:e,className:t="",...n})=>g.jsx("ul",{className:ee("buckets",t),...n,children:e.map(({title:r,text:i,link:a,...o},s)=>g.jsx("li",{className:"bucket text-medium",children:g.jsxs("a",{href:a,...o,children:[g.jsx("p",{className:"title",children:r}),g.jsx("p",{children:i})]})},s))}),T5=300,C5="ease-in-out";class uO{constructor(t){this.el=t,this.summary=t.querySelector("summary"),this.content=t.querySelector(".content"),this.animation=null,this.isClosing=!1,this.isExpanding=!1,this.summary.addEventListener("click",n=>this.onClick(n))}cleanUp(){this.summary.removeEventListener("click",t=>this.onClick(t))}onClick(t){t.preventDefault(),t.stopPropagation(),this.el.style.overflow="hidden",this.isClosing||!this.el.open?this.open():(this.isExpanding||this.el.open)&&this.shrink()}shrink(){this.isClosing=!0;const t=`${this.el.offsetHeight}px`,n=`${this.summary.offsetHeight}px`;this.animation&&this.animation.cancel(),this.animation=this.el.animate({height:[t,n]},{duration:T5,easing:C5}),this.animation.onfinish=()=>this.onAnimationFinish(!1),this.animation.oncancel=()=>this.isClosing=!1}open(){this.el.style.height=`${this.el.offsetHeight}px`,this.el.open=!0,window.requestAnimationFrame(()=>this.expand())}expand(){this.isExpanding=!0;const t=`${this.el.offsetHeight}px`,n=`${this.summary.offsetHeight+this.content.offsetHeight}px`;this.animation&&this.animation.cancel(),this.animation=this.el.animate({height:[t,n]},{duration:T5,easing:C5}),this.animation.onfinish=()=>this.onAnimationFinish(!0),this.animation.oncancel=()=>this.isExpanding=!1}onAnimationFinish(t){this.el.open=t,this.animation=null,this.isClosing=!1,this.isExpanding=!1,this.el.style.height=this.el.style.overflow=""}}const vh=({label:e=!1,className:t="",children:n,shouldAnimate:r=!1})=>{const i=me.useIntl(),a=E.useRef(null);return E.useEffect(()=>{let o;return r&&(o=new uO(a.current)),()=>{r&&o&&o.cleanUp()}},[]),g.jsxs("details",{ref:a,className:ee("collapsible-section",t,{"should-animate":r}),children:[g.jsx("summary",{children:e||i.formatMessage({id:"collapsibleSection_summary"})}),g.jsx("div",{className:"content",children:n})]})},x5={cube:"box",graduationCap:"graduation-cap",person:"user",speech:"speech-bubble_round",star:"star_empty_thin"},cO=e=>{let t=e;return Object.keys(x5).includes(e)&&(t=x5[e]),`url(${Hi}icons/${t}.svg)`};const w5={customCard:"custom",microcourse:"course",courseJourney:"course",solutionArticle:"article",qaQuestion:"question",listPage:"list",learningHub:"learning-hub",communityPage:"communityPage"},QC=({contentType:e,customIcon:t,customLabel:n,className:r=""})=>{const i=me.useIntl(),a=t?{"--custom-icon":cO(t)}:{},o=gh(`contentTypeLabel_${e}`)?i.formatMessage({id:`contentTypeLabel_${e}`}):!1;return!n&&!o?null:g.jsx("small",{className:ee("content-type-label text-small",e in w5?w5[e]:e,r,{"has-custom-icon":t}),style:a,"data-testid":"content-type-label",children:n||o})};const Er=({variant:e="primary",icon:t,styling:n={},className:r="",children:i,...a})=>{const{showHighlight:o=!1,background:s="default"}=n,l=t?{"--icon":`url(${Hi}icons/${t}.svg)`}:{};return g.jsx("div",{className:ee("highlighted-text-box",e,r,{"has-icon":t,"show-highlight":o,[s]:s!=="default"}),style:l,...a,children:i})};const Ui=({variant:e="empty",text:t=!1,button:n=!1,className:r=""})=>{let i=n&&!!Object.keys(n).length;const a=typeof n=="object"&&"breakpoints"in n,o=lo(a);if(a&&typeof n=="object"&&typeof o=="number"){const d=Object.assign({},n.breakpoints),f=$C(Object.keys(d));i=jC(o,f,d)}const{breakpoints:s,text:l="",component:u,...c}=n;return g.jsx(Er,{variant:"subtle",className:ee("empty-state-box",e,r),children:g.jsxs(g.Fragment,{children:[t&&typeof t=="string"?g.jsx(Ri,{options:{forceBlock:!0},children:t}):t,i&&typeof n=="object"&&(u||g.jsx(Ke,{...c,variant:n.variant?n.variant:"secondary",children:l}))]})})};const tg=({children:e,...t})=>g.jsx("p",{...t,children:e}),XC={q:tg,blockquote:tg};for(let e=1;e<=6;e++)XC[`h${e}`]={component:tg,props:{className:"title"}};const JC=({type:e="default",className:t="",heading:n=!1,children:r,...i})=>g.jsxs("div",{...i,className:ee("helper-text-box text-small",e,t),children:[n&&g.jsx("p",{className:"title",children:n}),typeof r=="string"?g.jsx(Ri,{options:{wrapper:E.Fragment,forceBlock:!0,overrides:XC},children:r}):g.jsx("p",{children:r})]});const e3=({id:e,className:t="",show:n=!1,hide:r=!1,text:i,markdownOptions:a,fadeStyle:o="default",children:s})=>{const l=me.useIntl(),u=E.useRef(null);e||(e=Date.now().toString());const[c,d]=E.useState(""),[f,h]=E.useState("closed");E.useEffect(()=>{const y=u.current;if(y)return y.addEventListener("transitionend",m),()=>{y.removeEventListener("transitionend",m)}},[]),E.useEffect(()=>{if(!i||typeof i!="string")return;const y=i.split(`
|
|
35
|
+
Thank you for helping to protect the Apolitical community from abusive content.`,discussionFormCard_placeholder:"Create post",discussionFormCard_placeholder_long:"Write a post or ask a question...",discussionFormCard_overlay_title:"Discard post",discussionFormCard_overlay_text:"Are you sure you want to leave without posting? Changes you have made will not be saved.",discussionFormCard_overlay_cta_discard:"Discard",discussionFormCard_overlay_cta_continue:"Continue editing",discussion_form_postType_label:"Post type","discussion_form__postType_no-category":"Post",discussion_form_title:"Write your {action}",discussion_form_titleField_label:"Title",discussion_form_titleField_placeholder:"Write something...",discussion_form_titleField_error:"Please enter a title or a body for your post.",discussion_form_question_label:"Question",discussion_form_question_placeholder:"Question",discussion_form_option_label:"Options",discussion_form_option_placeholder:"Option {number}",discussion_form_option_cta:"Add option",discussion_form_multiplePollAnswers:"Allow multiple answers",discussion_form_placeholder:"Write a {action}...",discussion_form_label:"Body",discussion_form_label_action:"Your {action}",discussion_form_explainer:"Try to make your {action} specific and practical. Be respectful and kind. See our <a>community guidelines</a>",discussion_form_success:"Your {action} has been submitted.",discussion_form_post:"Create post",discussion_form_posting:"Posting...",discussion_form_save:"Save",discussion_form_saving:"Saving...",discussion_form_cancel:"Cancel",discussion_form_submitting:"Submitting...",discussion_form_placeholder_post:"Share a question, insight, or announcement with the community",discussion_form_error:"We are unable to process your {action} right now. Please try again later or contact us if the problem persists",discussion_form_error_tooLong:"Please keep your content to {maxLength, plural, one {1 character} other {# characters}}.",discussion_form_error_tooMany:"You have posted too many times in a row. Please wait and try again.",discussion_form_error_loggedOut:"Please log in to submit your {action}.",discussion_form_error_noPermission:"You do not have permission to {action}.",discussion_form_error_alreadyExists:"This {action} already exists.",discussion_form_title_question:"Start a conversation",discussion_form_placeholder_question:"Ask your question here",discussion_form_explainer_question:"Unsure what you can post? See our <a>community guidelines</a>.",discussion_likes:"{number, plural, =0 {0 likes} one {# like} other {# likes}}",discussion_likes_short:"{number}",discussion_likes_showAll:"Show all...",discussion_likes_like:"Like this {action}",discussion_likes_unlike:"Unlike {action}",discussion_likes_show:"Show who liked this {action}",discussion_moreMenu_edit:"Edit",discussion_moreMenu_delete:"Delete",discussion_moreMenu_pin:"Pin post",discussion_moreMenu_unpin:"Unpin post",discussion_moreMenu_report:"Report",discussion_comments_screenReader:"See {count, plural, =0 {0 comments} one {# comment} other {# comments}}",discussion_comments:"{count, plural, =0 {0 comments} one {# comment} other {# comments}}",discussion_comments_loading:"... comments",discussion_responses_answer:"Answers",discussion_responses_comment:"Comments",discussion_responses_title:"{action} ({count})",discussion_responses_empty:"Be the first to respond",discussion_responses_empty_answer:"Be the first to answer this question",discussion_responses_placeholder:"Write a comment...",discussion_share_copy_link:"Copy link",discussion_share_copy_link_success:"Link copied to clipboard",discussion_thread_show:"Show {count} {count, select, 1 {reply} other {replies}}",discussion_thread_hide:"Hide replies",discussion_thread_loadMore:"Load more replies",profileModalLauncher_successMessage:"Your post has been created",profileModalLauncher_title:"Your profile is incomplete",profileModalLauncher_text:"A complete profile builds trust and amplifies your voice across the community. Ensure all your details are up to date including a photo and a bio.",contactFooter_title:"Contact us",contactFooter_text:"We're always open to new ideas, so please reach out to see how we can collaborate.",contactFooter_phone:"+44 203 608 2241",contactFooter_email:"hello@apolitical.co",contactForm_name:"Name",contactForm_email:"Email address",contactForm_organisation:"Government department or organisation",contactForm_interests:"I'm interested in",contactForm_interests_publishingCourse:"Publishing or creating a course",contactForm_interests_buyingCourse:"Buying courses for my team",contactForm_interests_learningExperience:"Customised learning experiences",contactForm_interests_somethingElse:"Something else",contactForm_message:"Message",dropdown_menu_multiselect_all:"All",dropdown_menu_multiselect_none:"None",emailHelperTextBox_fallback_title:"Who can join",emailHelperTextBox_fallback_text:"Apolitical is a private community for public servants and policymakers.",emailHelperTextBox_default_title:"Who can join",emailHelperTextBox_default_text:"Apolitical is a private community for public servants and policymakers. <link>Learn more</link>.",emailHelperTextBox_autoApproved_title:"Email check",emailHelperTextBox_autoApproved_text:"Great! Looks like you are using a **government email domain we recognise.** You will be **auto-approved** once you sign up.",emailHelperTextBox_unrecognisedEmail_title:"Not a recognised government email",emailHelperTextBox_unrecognisedEmail_text:"To confirm you work in government or policy, please add more details below. <link>Learn more</link>.",emailHelperTextBox_pendingApproval_title:"Email is pending approval",emailHelperTextBox_pendingApproval_text:"Looks like this email has been used to sign up to Apolitical before, but <strong>we have not yet approved it.</strong> If you cannot wait to join, contact <mail>concierge@apolitical.co</mail>.",emailHelperTextBox_emailUnverified_title:"Hello again!",emailHelperTextBox_emailUnverified_text:"It looks like you're already an Apolitical member. To access your account, please verify your email address. <link>Click here to get a verification code sent to your email</link>.",emailHelperTextBox_emailAlreadyExists_title:"Email is already registered",emailHelperTextBox_emailAlreadyExists_text:"Looks like this email has been used to sign up to Apolitical before, try <link>logging in</link> instead. If you're still having issues, contact <mail>concierge@apolitical.co</mail>.",emailHelperTextBox_error_verificationFailedToSend_title:"Verification code failed to send",emailHelperTextBox_error_verificationFailedToSend_text:"Error details: <em>{error}</em>{br}<link>Click here to try again</link>.{br}If you continue to have problems, contact us at <mail>concierge@apolitical.co</mail>",emailHelperTextBox_error_noFunction:"Cannot resend verification code.",form_fieldWrapper_required:"required",form_fieldWrapper_characterLimit:"Character limit:",form_fieldWrapper_characterLimit_aria_default:"You have {remaining, plural, =0 {no characters} one {1 character} other {# characters}} remaining.",form_fieldWrapper_characterLimit_aria_over:"You are {over, plural, one {1 character} other {# characters}} over the limit. Please shorten your text to {limit} characters.",form_fieldWrapper_characterLimit_info:"You can enter up to {limit} characters",form_error_generalError:"Sorry, something has gone. Please refresh the page and try again.",form_error_required:"Please fill in this required field",form_error_numbers:"Numbers are not allowed in this text field",form_error_email:"Please enter a valid email address",form_error_url:"Please enter a valid URL",form_error_multipleInputs_same:"Please enter a unique value into each field",form_cancel:"Cancel",form_submit:"Submit",form_submitting:"Submitting form...",form_submitted:"Submitted",form_success:"Thank you for submitting the form!",form_multipleInputs_label:"Input {number}",form_multipleInputs_filledInCount:"{number}/{total}",form_multipleInputs_filledInCount_aria:"{number} out of {total} available inputs have been filled in",form_multipleInputs_remove:"Remove this input",inviteForm_email_placeholder:"Add email addresses...",inviteForm_title:"Know someone who might like to join this workshop?",inviteForm_label:"Invite your colleagues by typing or pasting their email addresses below",inviteForm_message_label:"Add an invitation note",inviteForm_message_placeholder:"Add a personal note to your invitation...",inviteForm_ctaMessage:"Send",inviteForm_success:"Invitation Sent!",inviteForm_error:"Something went wrong!",inviteForm_ctaTryAgain:"Try again!",inviteForm_ctaSendMoreInvites:"Send more invites",inviteForm_ctaDone:"Done",inputAutocomplete_placeholder:"Start typing...",passwordRules_unmatched_text:"Passwords do not match",passwordRules_intro:"We advise you not to use your name or email in your password.",passwordRules_rule_label:"Password",passwordRules_rule_8Characters:"must be longer than 8 characters",passwordRules_rule_numberSymbol:"must include a number and a symbol",passwordRules_rule_lowercaseUppercase:"must include both lower and upper case characters",passwordRules_notMet:"Your password does not meet this requirement",passwordRules_currentPassword_label:"Current password",passwordRules_newPassword_label:"New password",passwordRules_confirmPassword_label:"Confirm new password",profileForm_image:"Upload photo",profileForm_name:"Full name",profileForm_name_placeholder:"What's your name, so people can recognise you?",profileForm_jobTitle:"Job title",profileForm_jobTitle_placeholder:"What's your current job title?",profileForm_organization:"Organisation",profileForm_organization_placeholder:"Where do you work?",profileForm_location:"Location",profileForm_location_placeholder:"Add your city",profileForm_location_error:"Please choose a location from the list.",profileForm_bio:"Bio",profileForm_bio_placeholder:"Tell us more about yourself...",profileForm_cta:"Save",profileForm_cta_submitting:"Saving...",profileForm_cta_submitted:"Saved",profileImageChange_cta_uploading:"Uploading image...",profileImageChange_cta_change:"Change photo",profileImageChange_cta_upload:"+ Add profile photo",profileImageChange_error:"There was an error uploading the image. Please try a different file format or reduce the file size to less than 5MB. Contact us if problem persists.",publishArticleForm_title_label:"Title",publishArticleForm_title_placeholder:"Write a snappy title",publishArticleForm_subtitle_label:"Subtitle",publishArticleForm_subtitle_placeholder:"Your topic, in a nutshell",publishArticleForm_body_label:"Body",publishArticleForm_body_placeholder:"Type or paste your article here",publishArticleForm_tags_label:"Tags (select up to three)",publishArticleForm_cover_image_label:"Cover image",publishArticleForm__tags_topic_CitiesAndLocalGovernment:"Cities and local government",publishArticleForm__tags_topic_Climate:"Climate",publishArticleForm__tags_topic_DigitalAndData:"Digital, data and AI",publishArticleForm__tags_topic_Education:"Education",publishArticleForm__tags_topic_EquityJusticeAndInclusion:"Equity, justice and inclusion",publishArticleForm__tags_topic_HealthAndSocialCare:"Health and social care",publishArticleForm__tags_topic_Innovation:"Innovation",publishArticleForm__tags_topic_LeadershipAndSkills:"Leadership and skills",publishArticleForm__tags_topic_LifeInGovernment:"Life in government",publishArticleForm__tags_topic_Policymaking:"Policymaking",publishArticleForm__tags_topic_TransportAndInfrastructure:"Transport and infrastructure",publishArticleForm__tags_topic_WorkAndTheEconomy:"Work and the economy",publishArticleForm_tags_error_over_three:"You must select no more than three options.",publishArticleForm_tags_error_required:"Please select at least one option.",publishArticleForm_disclaimer:"Ready to publish? Before you do, consider the following: Have you thoroughly proofread your writing? Are you confident in your arguments? Have you included hyperlinks to the necessary resources to support your article?",publishArticleForm_cta_submit:"Publish article",publishArticleForm_cta_submitting:"Publishing...",publishArticleForm_cta_submitted:"Published!",publishArticleForm_aria_success:"Your article is being published. You will be redirected to your article in a moment.",publishArticleForm_error:"Sorry, something went wrong.",publishArticleForm_error_underMinLength:"Please add at least {length, plural, one {1 character} other {# characters}}.",publishArticleForm_error_loggedOut:"You need to be logged in to publish an article. Please log in and try again.",publishArticleForm_progressBar:"Your article is being published",publishArticleForm_selectImage_button:"Select a cover image",publishArticleForm_replaceImage_button:"Replace Image",ratings_text:"Rate answer",ratings_stars:"{number} out of {total}",ratings_low:"this is incorrect or confusing",ratings_high:"this is a fantastic answer",ratings_success:"Thank you!",richTextEditor_placeholder:"Write something...",richTextEditor_toolbar:"Formatting options",richTextEditor_bold:"Bold",richTextEditor_heading_three:"Heading",richTextEditor_italic:"Italic",richTextEditor_strikeThrough:"Strikethrough",richTextEditor_link:"Link",richTextEditor_link_text:"Text:",richTextEditor_link_text_aria:"Text to be linked:",richTextEditor_link_url:"Link:",richTextEditor_link_placeholder:"Type or paste URL",richTextEditor_link_error_required:"Please enter a URL to link to",richTextEditor_link_open:"Open: {link}",richTextEditor_link_open_text:"Opens in a new window",richTextEditor_link_edit:"Edit",richTextEditor_link_remove:"Remove",richTextEditor_link_button:"Add link",richTextEditor_link_enrichedUrl_aria:"Remove this preview for {title}",richTextEditor_link_enrichedUrl_aria_fallback:"the link",richTextEditor_link_enrichedUrl_aria_live:"The link preview has been removed from your post",richTextEditor_ol_list:"Numbered list",richTextEditor_ul_list:"Bullet-point list",richTextEditor_block_quote:"Quote",richTextEditor_mention_fallback:"Can't find who you're looking for? Invite them to the community",search_label:"Search for:",search_placeholder:"Ask Apolitical",search_clear:"Clear search",search_cta:"Search",showpassword_show:"Show",showpassword_hide:"Hide",showpassword_aria_show:"Your password is hidden. Click to show.",showpassword_aria_hide:"Your password is visible. Click to hide.",signup_title:"Sign up",signup_full_name:"Full name",signup_full_name_placeholder:"Lionel Messi",signup_email_address:"Work email",signup_email_address_placeholder:"lionel.messi@argentina.gov",signup_job_title:"Job title",signup_job_title_placeholder:"e.g. Senior Policy Advisor",signup_organization:"Organisation",signup_organization_placeholder:"e.g. Department of Justice",signup_url:"Link to official government bio / LinkedIn <small>(optional)</small>",signup_url_placeholder:"https://organisation.com/bio",signup_expectation:"What do you want to know<small>Optional, but we will use your response to build the session!</small>",signup_expectation_placeholder:"What do you want to know?",signup_terms:"I accept Apolitical's <terms>Terms of Service</terms>, <privacy>Privacy Policy</privacy> and that I'll get essential emails for my use of Apolitical",signup_error:"We're really sorry, but we've had a problem trying to sign you up. This could be an issue with our system, so we suggest you try again later.",signup_button_join:"Join for free",signup_button_login:"Log in",signup_submitting:"Submitting form...",signup_success_title:"Thank you for applying to join Apolitical!",signup_success_text:"<p>Once we've vetted your application, you'll get a secure login link to help you get started.</p><p>Please note that trust is everything to our community, so you can't login until your identity has been verified.</p>",poll_instructions:"Select one{allowMultipleVotes, select, true { or more} other {}}",poll_num_votes:"{number, plural, one {# vote} other {# votes}}",poll_remove_vote_button:"Remove vote{number, plural, =0 {} one {} other {s}}",poll_aria_votes:"You have {number, plural, =0 {not voted on this poll} other {voted for:}}",replies_feed_missing_polls_vote_message:"Please vote above to view all the comments",tableOfContents:"Table of contents",timeToComplete_hours:"{time, plural, =0 {} one {1 hour} other {# hours}}",timeToComplete_hours_short:"{time}h",timeToComplete_minutes:"{time, plural, =0 {} one {1 minute} other {# minutes}}",timeToComplete_minutes_short:"{time}m",timeToComplete_range:"{early} - {late}",timeToComplete_range_aria:"between {early} and {late}",tooltip_loading:"Loading...",return_to_nav_button:"Back to top",progressTracker:"Step {current} of {total}",cookieBanner_title:"Cookies and your privacy",cookieBanner_text:"We take your trust and privacy very seriously. Apolitical uses safe cookies (small files on your device) to run the site. You can reject non-essential cookies, but some site features may not work without them.",cookieBanner_buttons_settings:"Change my settings",cookieBanner_buttons_reject:"Reject all",cookieBanner_buttons_accept:"Accept all",footer_platform:"Platform",footer_platform_events:"Events",footer_platform_courses:"Courses",footer_platform_qanda:"Q&A",footer_platform_articles:"Articles",footer_platform_communities:"Communities",footer_community:"Community",footer_community_support:"Support FAQ",footer_community_post:"Post on Apolitical",footer_community_join:"Who can join",footer_community_guidelines:"Guidelines & values",footer_company:"Company",footer_company_news:"News",footer_company_insights:"Insights",footer_company_story:"Our story",footer_company_team:"Meet our team",footer_company_careers:"Careers",footer_company_partner:"Partner with us",footer_company_contact:"Get in touch",footer_legal:"Legal",footer_legal_privacy:"Privacy policy",footer_legal_terms:"Terms & conditions",footer_legal_cookie:"Cookie policy",footer_legal_accessibility:"Accessibility statement",footer_legal_ai:"AI principles",footer_legal_dataProtection:"Data protection officer",footer_legal_euDataProtection:"EU data protection officer",footer_contact:"Contact",footer_contact_london:"London address",footer_contact_london_address:"251 Southwark Bridge Road{br}London, SE1 6FL{br}United Kingdom",footer_contact_registered:"Registered address",footer_contact_registered_address:"20–22 Wenlock Road{br}London, N1 7GU{br}United Kingdom",footer_contact_berlin:"Berlin address",footer_contact_berlin_address:"Torstraße 220{br}10115 Berlin{br}Germany",footer_contact_washington:"Washington DC Address",footer_contact_washington_address:"1100 15th St NW{br}Washington, DC 20005{br}United States",footer_contact_support:"For platform support",footer_contact_business:"For business inquiries",footer_social_linkedin:"LinkedIn",footer_social_twitter:"Twitter",footer_social_facebook:"Facebook",footer_copyright:"Copyright © {currentYear} Apolitical Group Limited",header_skip:"Skip to main content",header_language_switcher:"Change language",header_search_show:"Show search bar",header_search_hide:"Close search bar",header_menu_show:"Show navigation",header_menu_hide:"Close navigation",header_home_loggedOut:"Home",header_home_loggedIn:"My Home",header_communities:"Communities",header_topics:"Topics",header_topics_explore:"Explore",header_topics_explore_events:"Events",header_topics_explore_courses:"Courses","header_topics_explore_q-and-a":"Q&A",header_topics_explore_articles:"Articles",header_topics_explore_communities:"Communities",header_topics_topics:"Topics",header_topics_topics_climate:"Climate","header_topics_topics_cities-and-local-government":"Cities and local government","header_topics_topics_digital-and-data":"Digital, data and AI",header_topics_topics_education:"Education","header_topics_topics_equity-justice-and-inclusion":"Equity, justice and inclusion","header_topics_topics_health-and-social-care":"Health and social care",header_topics_topics_innovation:"Innovation","header_topics_topics_leadership-and-skills":"Leadership and skills","header_topics_topics_life-in-government":"Life in government",header_topics_topics_policymaking:"Policymaking","header_topics_topics_transport-and-infrastructure":"Transport and infrastructure","header_topics_topics_work-and-the-economy":"Work and the economy",header_partners:"For partners",header_account:"My account",header_account_show:"Show account menu",header_account_hide:"Close account menu",header_account_profile:"My profile",header_account_settings:"Settings & privacy","header_account_log-out":"Log out",header_buttons_login:"Log in",header_buttons_signup:"Sign up",header_language_unavailable_en:"This page is only available in English. <link>Learn more →</link>",header_language_unavailable_es:"Esta página sólo está disponible en inglés. <link>Más información →</link>",header_language_unavailable_fr:"Cette page est uniquement disponible en anglais. <link>En savoir plus →</link>",header_language_unavailable_pt:"Esta página está disponível apenas em inglês. <link>Saiba mais →</link>",header_language_unavailable_id:"Halaman ini tidak tersedia dalam bahasa yang dipilih. <link>Pelajari lebih lanjut →</link>","header_language_unavailable_pt-BR":"Esta página não está disponível no idioma selecionado. <link>Saiba mais →</link>",pageLayout_browserTooSmall:"Sorry, your device is too small to view this content properly. Please change to a different orientation or another device.",pageLayout_error:"An error occurred while rendering this page. Please refresh the page or try again later.",loadingBlock_loading:"Loading...",loadingBlock_almostDone:"Almost done...",loadingBlock_complete:"Complete!",progressBar:"{number}% loaded",discussionFormModal_title:"Create a post",discussionFormModal_cta:"Create post",inviteModal_title:"You’re registered",inviteModal_formTitle:"Know someone who might like to join this workshop?",inviteModal_formLabel:"Invite your colleagues by typing or pasting their email addresses below.",inviteModal_cta:"Send",overlay_close:"Close",profileModal_title:"Update your profile",breadcrumbs_label:"Go back to:",breadcrumbs_currentPage:"Current page:",filters_all:"Show all",filters_disabled:"{name} - no results",languageSwitcher_label:"I would like to read this article in...",languageSwitcher_translation_original:"original language",languageSwitcher_translation_human:"translated by person",languageSwitcher_translation_machine:"translated by machine",languageSwitcher_selected:"{language} - currently selected",languageSwitcher_disclaimer:"This content is machine translated and will occasionally get gendered language or other direct translations wrong. We’re trying to resolve this but in the meantime, if you notice something very wrong, let us know at <link>{email}</link>",loadMore_button:"Load more",loadMore_endOfFeed:"You're all caught up",loadMore_error:"We're having trouble loading more content. Please refresh the page or try again later.",moreMenu:"See more options",navigationMenu_links_homepage:"Home",navigationMenu_links_events:"Events",navigationMenu_links_microcourses:"Courses","navigationMenu_links_q-and-a":"Q&A",navigationMenu_links_articles:"Articles",navigationMenu_links_communities:"Communities",shareLinks_label:"Share",shareLinks_link_linkedin:"Share on LinkedIn",shareLinks_link_twitter:"Share on Twitter",shareLinks_link_facebook:"Share on Facebook",shareLinks_link_email:"Share by email","shareLinks_link_clipboard-copy":"Copy the link",tags_community:"From the community",editSection_placeholder_description:"Add some details",editSection_placeholder_cta:"add",editSection_edit:"Edit",notFoundError_title:"We can't find that page",notFoundError_text:"Sorry about that. We all mess up sometimes - read some ‘fail’ stories below.",notFoundError_post_1:"Why public servants must learn to fail — and 3 tips for how to do it",notFoundError_post_2:"What failure has taught me",notFoundError_post_3:"How to learn from failure without causing a scandal",notFoundError_cta:"View more articles",collapsibleSection_summary:"Find out more",contentTypeLabel_event:"Event",contentTypeLabel_learningHub:"Programme",contentTypeLabel_listPage:"List",contentTypeLabel_microcourse:"Course",contentTypeLabel_qaQuestion:"Q&A",contentTypeLabel_solutionArticle:"Article",contentTypeLabel_communityPage:"Community",hideShowTextBox_hide:"View less",hideShowTextBox_show:"View more",markdown_collapsibleSection_summary:"Resources",markdown_skip_video:"Skip past video",markdown_skip_padlet:"Skip past interactive board",markdown_skip_poll:"Skip past poll",markdown_skip_survey:"Skip past survey",markdown_skip:"Skip to next section",markdown_iframe_title:"Course information",markdown_iframe_video:"Video",markdown_iframe_padlet:"Interactive board",markdown_iframe_poll:"Poll",markdown_iframe_survey:"Survey",member_connection_accept:"Accept",member_connection_cancel:"Cancel Request",member_connection_connect:"Connect",member_connection_connected:"Connected",member_connection_pending:"Pending",member_connection_remove:"Remove Connection",member_connection_requested:"Requested",member_show_email_hide:"Email visible only to connections",member_show_email_private:"Private profile email hidden",member_show_email_show:"Show contact info",member_show_email_tooltip:"Copy email address",member_show_email_tooltip_copied:"Email copied to clipboard",member_show_email_tooltip_mine:"Visible only to your connections",member_show_email_tooltip_private:"The privacy setting for this profile is private"},GD={...uo,languageSwitcher_label:"Me gustaría leer este artículo en...",languageSwitcher_translation_original:"idioma original",languageSwitcher_translation_human:"traducido por un humano",languageSwitcher_translation_machine:"traducido por máquina",languageSwitcher_disclaimer:"Este contenido fue traducido automáticamente y ocasionalmente tendrá errores de género u otras traducciones directas. Estamos intentando resolver este problema, pero mientras tanto, si notas algún error grave, escríbenos a <link>{email}</link>"},YD={...uo,languageSwitcher_label:"Je voudrais lire cet article dans...",languageSwitcher_translation_original:"langue originale",languageSwitcher_translation_human:"traduit par un humain",languageSwitcher_translation_machine:"traduit par machine",languageSwitcher_disclaimer:"Ce contenu est traduit automatiquement et contiendra d’évantuelles erreurs de genre ou d’autres traductions directes. Nous essayons de résoudre ce problème, mais en attendant, si vous remarquez une erreur importante, faites-le nous savoir à <link>{email}</link>",collapsibleSection_summary:"En savoir plus"},ZD={...uo,languageSwitcher_label:"Eu gostaria de ler este artigo em...",languageSwitcher_translation_original:"linguagem original",languageSwitcher_translation_human:"traduzido por um humano",languageSwitcher_translation_machine:"traduzido por máquina",languageSwitcher_disclaimer:"Este conteúdo foi traduzido automaticamente e, ocasionalmente, poderão ocorrer erros de linguagem de gênero ou outras traduções diretas. Estamos tentando resolver isso, porém se perceber algo errado por favor nos avise em <link>{email}</link>"},QD={...uo,languageSwitcher_label:"Saya ingin membaca artikel ini dalam...",languageSwitcher_translation_original:"bahasa asli",languageSwitcher_translation_human:"diterjemahkan oleh manusia",languageSwitcher_translation_machine:"diterjemahkan oleh mesin",languageSwitcher_disclaimer:"Konten ini telah diterjemahkan secara otomatis dan terkadang mungkin terdapat kesalahan dalam penerjemahan gender atau terjemahan langsung lainnya. Kami sedang berusaha memperbaiki hal ini, tetapi jika Anda menemukan kesalahan, mohon beri tahu kami di <link>{email}</link>"},XD={...uo,languageSwitcher_label:"Eu gostaria de ler este artigo em...",languageSwitcher_translation_original:"idioma original",languageSwitcher_translation_human:"traduzido por humano",languageSwitcher_translation_machine:"traduzido por máquina",languageSwitcher_disclaimer:"Este conteúdo foi traduzido automaticamente e, ocasionalmente, podem ocorrer erros de linguagem de gênero ou outras traduções diretas. Estamos trabalhando para resolver isso, mas se você perceber algo errado, por favor nos avise em <link>{email}</link>"},gh=(e,t=uo)=>e in t,oi=(e,t,n,r,i={})=>{let a="";return gh(`${t}_${n}`)?a=e({id:`${t}_${n}`},i):a=e({id:t},{[r]:n,...i}),a},JD=(e,t,n)=>{if(!e||e===0)return"0";t||(t=0),n||(n=["k","m","b","t"]);let r=e.toString();t=Math.pow(10,t);for(let i=n.length-1;i>=0;i--){const a=Math.pow(10,(i+1)*3);if(a<=e){e=Math.round(e*t/a)/t,e===1e3&&i<n.length-1&&(e=1,i++),r=`${e}${n[i]}`;break}}return r},Ed=(e,t)=>E.Children.map(e,n=>Object.is(n,null)?n:E.cloneElement(n,{...t})),KC=(e=0)=>{setTimeout(()=>{const t=document.querySelector(".splash-screen");t&&t.remove(),window.prerenderReady=!0},e)},eO=e=>{var a,o;const n=["name","organization","jobTitle","biography"].every(s=>{const l=e[s];return l!=null&&l!==""}),r=((a=e.image)==null?void 0:a.thumbnail)!==void 0,i=((o=e.location)==null?void 0:o.en)!==void 0;return n&&r&&i},tO=(e,t,n)=>!t.id||!t.name?"":t.error?n.replace(/{{name}}/g,gc).replace(/{{id}}/g,gc):n.replace(/{{name}}/g,t.name).replace(/{{id}}/g,t.id),GC=async({text:e,template:t,mentions:n,listMembers:r=()=>Promise.resolve([])})=>{var a;if(!n)return e;const i=e.match(vc);if(!i)return e;for(const o of i){const s=o.replace(vc,(c,d)=>d),l=n[s];if(!l)continue;const u={};if(typeof l=="object")u.name=l.error?l.error:((a=l==null?void 0:l.data)==null?void 0:a.name)||"",u.id=l.id||"",u.error=l.error;else{const c=l;if(c.startsWith(X0))try{const d=c.replace(X0,"");u.id=d,await r({id:d}).then(f=>{const{name:h,error:m}=f;u.name=m||h||"",u.error=m})}catch{e.replace(o,"@");continue}else continue}e=e.replace(o,u.name?tO(e,u,t):o)}return e},Ov=e=>{const t=e.startsWith("http")?e:`https://${e}`,r=new URL(t).hostname;return{full:t,pretty:r}},YC=e=>new URLSearchParams(window.location.search).get(e),yc=(e="")=>e.replace(/\s+/g,"").length>0,eg=e=>{const t=e.length>8,n=/[0-9]/.test(e)&&/[`!@#$%^&*()_+\-=[\]{}£;':"\\|,.<>/?~]/.test(e),r=new RegExp("^(?=.*?[A-Z])(?=.*?[a-z])").test(e);return{isValid:t&&n&&r,matchingRules:{isMoreThanEightCharacters:t,includesNumberAndSymbol:n,includesLowerAndUppercase:r}}};const Ke=({variant:e="primary",size:t="medium",styling:n={muted:!1,fullWidth:!1},icon:r=!1,href:i=!1,element:a="button",onClick:o=!1,className:s="",disabled:l=!1,tooltip:u="",forceTooltip:c=!1,screenreaderText:d=!1,children:f=!1,...h})=>{const p=lo(typeof t=="object"),{showTooltip:y,tooltipProps:v}=kv(!!u);if(typeof t=="object"&&typeof p=="number"){const C=Object.assign({},t),x=$C(Object.keys(C));t=jC(p,x,C)}!l&&u&&!c&&(u="");const b=[];typeof t=="string"&&b.push(t),r&&(b.push("icon"),typeof r=="object"?(b.push(r.icon),r.position?b.push(r.position):b.push("left"),r.hover&&b.push(`hover_${r.hover}`),r.animate&&(b.push("animate"),typeof r.animate=="string"&&b.push(r.animate))):(b.push(r),!r.includes("right")&&!r.includes("left")&&b.push("left")));const _={...h,className:ee(e,s,b,{"no-text":!f,disabled:l,button:i,muted:n.muted,"full-width":n.fullWidth}),onClick:C=>{(!i||i[0]==="#")&&o&&(C.preventDefault(),C.stopPropagation()),o&&o(C)},disabled:typeof l=="object"&&"isClickable"in l?!l.isClickable:l};i&&(a="a",_.href=i);const T=E.createElement(a,_,f||(d?g.jsx(xt,{showOnFocus:!1,children:d}):null));return c||l&&u?g.jsxs("span",{className:"button-container",...v,children:[g.jsx(ss,{isOpen:y,accessibility:{readToScreenreadersWhenClosed:!0},children:u}),T]}):T},Fl=({buttons:e,wrappers:t=[],className:n="",...r})=>{const i=e.length>1?"ul":"p",a=e.map((o,s)=>{var l;return i==="p"?g.jsx(Ke,{...o},s):g.jsx("li",{className:((l=t[s])==null?void 0:l.className)||"",children:g.jsx(Ke,{...o})},s)});return E.createElement(i,{className:ee("button-wrapper",n),...r,children:a})};const fi=({className:e="",maxWidth:t=!1})=>{const n=t?{"--max-width":`${t/16}rem`}:{};return g.jsx("hr",{className:ee(e,{"has-max-width":t}),style:n})},_5={card:{range:[{height:320,width:320},{height:425,width:687},{height:510,width:768}],sizes:"(min-width: 1024px) 720px, 30vw"},responsiveCard:{range:[{height:125,width:200},{height:188,width:300},{height:313,width:500}],sizes:"(min-width: 1024px) 720px, 30vw"},banner:{range:[{height:124,width:425},{height:320,width:768},{height:510,width:1368}],sizes:"(min-width: 1024px) 975px, 50vw"},feed:{range:[{height:270,width:124},{height:320,width:425},{height:425,width:687}],sizes:"(min-width: 1024px) 510px, 20vw"},highlightSection:{range:[{height:200,width:674},{height:400,width:1348},{height:1e3,width:1e3},{height:2e3,width:2e3}],sizes:"(max-width: 500px) 674px, (max-width: 1024px) 1348px, (max-width: 1200px) 1000px, 2000px"},thumbnail:{range:[{height:124,width:124},{height:320,width:320},{height:510,width:510}],sizes:"(min-width: 1024px) 453px, 20vw"},fallback:{range:[{height:124,width:375},{height:320,width:687},{height:510,width:990}],sizes:"(min-width: 1024px) 885px, 35vw"}},nO=({aspect:e,range:t,sizes:n})=>{const{range:r,sizes:i}=e?_5[e]:_5.fallback;return{range:t&&t.length>0?t:r,sizes:n||i}},rO=({format:e,height:t,query:n,width:r})=>{let i=`w=${r}&h=${t}`;return i=e?`${i}&fm=${e}`:i,i=n?`${i}&${n}`:i,i},Dp=({format:e,range:t,url:n,query:r})=>t.map(({height:i,width:a})=>`${n}?${rO({format:e,height:i,query:r,width:a})} ${a}w`).join(", ");const co=({image:e,className:t,testId:n})=>{const{description:r,height:i,type:a,color:o,query:s,url:l,width:u,loading:c,decoding:d,fetchPriority:f}=e,{range:h,sizes:m}=nO(e),p=Dp({format:"avif",query:s,range:h,url:l}),y=Dp({format:"webp",query:s,range:h,url:l}),v=Dp({format:"",query:s,range:h,url:l});let b={};return o&&(b={"--color":o}),a&&a.includes("svg")?g.jsx("picture",{className:t,style:b,children:g.jsx("img",{src:l,alt:r,loading:c||"lazy",decoding:d||"async",fetchpriority:f||"auto",width:u,height:i,"data-testid":n||"image"})}):g.jsxs("picture",{className:t,style:b,children:[a!=="image/gif"&&g.jsx("source",{type:"image/avif",srcSet:p,sizes:m,"data-testid":"source"}),g.jsx("source",{type:"image/webp",srcSet:y,sizes:m,"data-testid":"source"}),g.jsx("img",{srcSet:v,sizes:m,src:l,alt:r,loading:c||"lazy",decoding:d||"async",fetchpriority:f||"auto",width:u,height:i,"data-testid":n||"image"})]})};const iO=({image:e,className:t="",testId:n})=>g.jsx("div",{className:`image-container ${t}`,"data-testid":n||"image-container",children:e&&g.jsx(co,{image:{...e},className:"image"})}),fo=({href:e,children:t,fallbackElement:n,meta:r,className:i="",onClick:a,gtmContext:o,gtmType:s,...l})=>{const{forceOnClick:u=!1}=r||{};if(e){const d={...l};return a&&(d.onClick=a),o&&(d["data-gtm-event-context"]=o),s&&(d["data-gtm-event-type"]=s),g.jsx("a",{href:e,className:ee("gtm-trackable",i),...d,children:t})}const c={};return u&&(c.onClick=a),n?E.createElement(n,{children:t,className:i,...l,...c}):g.jsx(g.Fragment,{children:t})};const ZC=E.forwardRef(({className:e="",children:t},n)=>{const r=E.useRef(null),i=n||r;return g.jsx("aside",{ref:i,className:ee("popover",e),"aria-live":"polite",children:t})}),Ml=({parent:e=document.body,children:t})=>typeof document=="object"?ph.createPortal(t,e):null,aO=Object.freeze(Object.defineProperty({__proto__:null,default:Ml},Symbol.toStringTag,{value:"Module"}));const oO=({currentStep:e=1,steps:t=1})=>g.jsxs(g.Fragment,{children:[g.jsx(xt,{children:g.jsx(me.FormattedMessage,{id:"progressTracker",values:{current:e,total:t}})}),g.jsx("div",{className:"progress-tracker",children:g.jsx("div",{className:"dots-wrapper",children:new Array(t).fill("").map((n,r)=>{const i=r+1;return g.jsxs("div",{className:"dot-wrapper",children:[g.jsx("div",{className:ee("dot",{active:i===e,completed:i<e}),"data-testid":"progress-dot"}),g.jsx("div",{className:ee("line",{active:i<e})})]},r)})})})]});const sO=({elementId:e,offset:t=20})=>{const n=me.useIntl(),r=()=>{const i=document.getElementById(e);if(!i)return;const a=document.getElementById("header");a&&window.scrollTo({top:i.offsetTop-a.clientHeight-t})};return g.jsx(Ke,{variant:"secondary",className:"return-to-nav",onClick:r,"data-gtm-event-context":"ListPageMobile","data-gtm-event-type":"back-to-nav-button-click",screenreaderText:n.formatMessage({id:"return_to_nav_button"})})};const lO=({items:e,className:t="",...n})=>g.jsx("ul",{className:ee("buckets",t),...n,children:e.map(({title:r,text:i,link:a,...o},s)=>g.jsx("li",{className:"bucket text-medium",children:g.jsxs("a",{href:a,...o,children:[g.jsx("p",{className:"title",children:r}),g.jsx("p",{children:i})]})},s))}),T5=300,C5="ease-in-out";class uO{constructor(t){this.el=t,this.summary=t.querySelector("summary"),this.content=t.querySelector(".content"),this.animation=null,this.isClosing=!1,this.isExpanding=!1,this.summary.addEventListener("click",n=>this.onClick(n))}cleanUp(){this.summary.removeEventListener("click",t=>this.onClick(t))}onClick(t){t.preventDefault(),t.stopPropagation(),this.el.style.overflow="hidden",this.isClosing||!this.el.open?this.open():(this.isExpanding||this.el.open)&&this.shrink()}shrink(){this.isClosing=!0;const t=`${this.el.offsetHeight}px`,n=`${this.summary.offsetHeight}px`;this.animation&&this.animation.cancel(),this.animation=this.el.animate({height:[t,n]},{duration:T5,easing:C5}),this.animation.onfinish=()=>this.onAnimationFinish(!1),this.animation.oncancel=()=>this.isClosing=!1}open(){this.el.style.height=`${this.el.offsetHeight}px`,this.el.open=!0,window.requestAnimationFrame(()=>this.expand())}expand(){this.isExpanding=!0;const t=`${this.el.offsetHeight}px`,n=`${this.summary.offsetHeight+this.content.offsetHeight}px`;this.animation&&this.animation.cancel(),this.animation=this.el.animate({height:[t,n]},{duration:T5,easing:C5}),this.animation.onfinish=()=>this.onAnimationFinish(!0),this.animation.oncancel=()=>this.isExpanding=!1}onAnimationFinish(t){this.el.open=t,this.animation=null,this.isClosing=!1,this.isExpanding=!1,this.el.style.height=this.el.style.overflow=""}}const vh=({label:e=!1,className:t="",children:n,shouldAnimate:r=!1})=>{const i=me.useIntl(),a=E.useRef(null);return E.useEffect(()=>{let o;return r&&(o=new uO(a.current)),()=>{r&&o&&o.cleanUp()}},[]),g.jsxs("details",{ref:a,className:ee("collapsible-section",t,{"should-animate":r}),children:[g.jsx("summary",{children:e||i.formatMessage({id:"collapsibleSection_summary"})}),g.jsx("div",{className:"content",children:n})]})},x5={cube:"box",graduationCap:"graduation-cap",person:"user",speech:"speech-bubble_round",star:"star_empty_thin"},cO=e=>{let t=e;return Object.keys(x5).includes(e)&&(t=x5[e]),`url(${Hi}icons/${t}.svg)`};const w5={customCard:"custom",microcourse:"course",solutionArticle:"article",qaQuestion:"question",listPage:"list",learningHub:"learning-hub",communityPage:"communityPage"},QC=({contentType:e,customIcon:t,customLabel:n,className:r=""})=>{const i=me.useIntl(),a=t?{"--custom-icon":cO(t)}:{},o=gh(`contentTypeLabel_${e}`)?i.formatMessage({id:`contentTypeLabel_${e}`}):!1;return!n&&!o?null:g.jsx("small",{className:ee("content-type-label text-small",e in w5?w5[e]:e,r,{"has-custom-icon":t}),style:a,"data-testid":"content-type-label",children:n||o})};const Er=({variant:e="primary",icon:t,styling:n={},className:r="",children:i,...a})=>{const{showHighlight:o=!1,background:s="default"}=n,l=t?{"--icon":`url(${Hi}icons/${t}.svg)`}:{};return g.jsx("div",{className:ee("highlighted-text-box",e,r,{"has-icon":t,"show-highlight":o,[s]:s!=="default"}),style:l,...a,children:i})};const Ui=({variant:e="empty",text:t=!1,button:n=!1,className:r=""})=>{let i=n&&!!Object.keys(n).length;const a=typeof n=="object"&&"breakpoints"in n,o=lo(a);if(a&&typeof n=="object"&&typeof o=="number"){const d=Object.assign({},n.breakpoints),f=$C(Object.keys(d));i=jC(o,f,d)}const{breakpoints:s,text:l="",component:u,...c}=n;return g.jsx(Er,{variant:"subtle",className:ee("empty-state-box",e,r),children:g.jsxs(g.Fragment,{children:[t&&typeof t=="string"?g.jsx(Ri,{options:{forceBlock:!0},children:t}):t,i&&typeof n=="object"&&(u||g.jsx(Ke,{...c,variant:n.variant?n.variant:"secondary",children:l}))]})})};const tg=({children:e,...t})=>g.jsx("p",{...t,children:e}),XC={q:tg,blockquote:tg};for(let e=1;e<=6;e++)XC[`h${e}`]={component:tg,props:{className:"title"}};const JC=({type:e="default",className:t="",heading:n=!1,children:r,...i})=>g.jsxs("div",{...i,className:ee("helper-text-box text-small",e,t),children:[n&&g.jsx("p",{className:"title",children:n}),typeof r=="string"?g.jsx(Ri,{options:{wrapper:E.Fragment,forceBlock:!0,overrides:XC},children:r}):g.jsx("p",{children:r})]});const e3=({id:e,className:t="",show:n=!1,hide:r=!1,text:i,markdownOptions:a,fadeStyle:o="default",children:s})=>{const l=me.useIntl(),u=E.useRef(null);e||(e=Date.now().toString());const[c,d]=E.useState(""),[f,h]=E.useState("closed");E.useEffect(()=>{const y=u.current;if(y)return y.addEventListener("transitionend",m),()=>{y.removeEventListener("transitionend",m)}},[]),E.useEffect(()=>{if(!i||typeof i!="string")return;const y=i.split(`
|
|
36
36
|
`);d(y.length<3?`${i.substring(0,400)}...`:y.slice(0,3).join(`
|
|
37
37
|
`))},[i]),E.useEffect(()=>{f==="ready-to-close"&&h("closing")},[f]);const m=({propertyName:y})=>{y==="max-height"&&h(v=>v==="opening"?"open":v==="closing"?"closed":v)},p=["opening","open"].includes(f);return g.jsxs(Er,{variant:"subtle",className:ee("hide-show-text-box",t),children:[g.jsx("div",{ref:u,id:e,className:ee("content",f,o),children:i?g.jsxs(g.Fragment,{children:[g.jsx(Ri,{options:{forceBlock:!0,...a},children:f==="closed"?c:i}),f!=="closed"&&s]}):s}),g.jsx("p",{className:"cta",children:g.jsx(Ke,{variant:"tertiary",icon:{icon:"navigation_arrow",position:"left",animate:!0},styling:{muted:!0},className:ee({"rotate-180":p}),onClick:()=>{h(p?"ready-to-close":"opening")},"aria-expanded":p,"aria-controls":e,children:p?r||l.formatMessage({id:"hideShowTextBox_hide"}):n||l.formatMessage({id:"hideShowTextBox_show"})})})]})};const dO=({element:e="ul",layout:t="vertical",variant:n="default",items:r=[],styling:i={},className:a=""})=>{const{hasBorder:o=!1,zebraStriping:s=!1}=i;return E.createElement(e,{className:ee("icon-bulleted-list text-medium",n,a,{"has-border":o,"has-zebra-stripes":s,[t]:e!=="dl"}),children:r.map((l,u)=>{const c={wrapper:E.Fragment,forceInline:!0},d={"--icon":`url(${Hi}icons/${l.icon}.svg)`};return e==="dl"?g.jsxs(E.Fragment,{children:[g.jsx("dt",{style:d,children:g.jsx(Ri,{options:c,children:l.dt||""})},`dt-${u}`),g.jsx("dd",{children:typeof l.text=="string"?g.jsx(Ri,{options:c,children:l.text}):l.text},`dd-${u}`)]},`dl-${u}`):g.jsx("li",{style:d,children:typeof l.text=="string"?g.jsx(Ri,{options:c,children:l.text}):l.text},u)})})},An=()=>E.Fragment,fO=({children:e})=>g.jsx(Er,{variant:"secondary",children:e}),hO=({children:e})=>typeof e=="object"&&Object.keys(e||{}).length===1?g.jsx("p",{className:"center",children:e}):g.jsx("div",{className:"center",children:e}),pO=["span","strong","h1","h2","h3","h4","h5","h6","p"],mO=({children:e})=>{const t=me.useIntl();if(!e)return null;let n=t.formatMessage({id:"markdown_collapsibleSection_summary"});const r=[];for(const a of E.Children.toArray(e))if(!(!a||typeof a=="string"||typeof a=="number"))if(E.isValidElement(a)&&a.type==="summary"){if(a.props&&a.props.children){for(const o of E.Children.toArray(a.props.children))if(!(!o||typeof o=="string"||typeof o=="number")&&E.isValidElement(o)){const s=o.type;if(pO.includes(s)){for(n=o.props.children;typeof n!="string"&&(Array.isArray(n)&&n[0].props&&n[0].props.children&&n[0].props.children[0]);)n=n[0].props.children[0];break}}}}else r.push(a);const i=n?n.toString():"";return g.jsx(vh,{label:i,className:["Sources","Resources"].includes(i)?"discrete-links":"",children:r.map(a=>a)})},gO=({children:e,...t})=>{if(t.class)switch(t.class){case"casestudy":return g.jsx(Er,{variant:"secondary",children:e});case"general-textbox":case"highlight-box":return g.jsx(Er,{variant:"primary",children:e});case"pink-textbox":return g.jsx(Er,{variant:"tertiary",children:e});case"content":return typeof e=="object"&&Object.keys(e||{}).length===1?g.jsx("p",{children:e}):e;default:return g.jsx("div",{...t,children:e})}return g.jsx("div",{...t,children:e})},Pr=({children:e})=>g.jsx(g.Fragment,{children:e}),Nv=E.createContext({badges:[],isLoading:!0});function t3(){return E.useContext(Nv)}const n3=({children:e,badges:t})=>g.jsx(Nv.Provider,{value:t,children:e}),r3=({showDevTools:e=!0,children:t})=>{const n=new Rt.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!1,staleTime:6e4}}});return g.jsxs(Rt.QueryClientProvider,{client:n,children:[t,e&&g.jsx(SD.ReactQueryDevtools,{initialIsOpen:!1})]})};var i3=E.createContext({client:bd});function vO(e){var t=e.children,n=e.client,r=e.apiKey,i=e.options,a=E.useMemo(function(){return n&&r&&console.warn("[PostHog.js] You have provided both a client and an apiKey to PostHogProvider. The apiKey will be ignored in favour of the client."),n&&i&&console.warn("[PostHog.js] You have provided both a client and options to PostHogProvider. The options will be ignored in favour of the client."),n||(r&&(bd.__loaded&&console.warn("[PostHog.js] was already loaded elsewhere. This may cause issues."),bd.init(r,i)),bd)},[n,r]);return E.createElement(i3.Provider,{value:{client:a}},t)}var yO=function(){var e=E.useContext(i3).client;return e};function Op(e){var t=yO(),n=E.useState(),r=n[0],i=n[1];return E.useEffect(function(){return t.onFeatureFlags(function(){i(t.isFeatureEnabled(e))})},[t,e]),r}const a3=({children:e,user:t})=>t.isLoading?null:process.env.REACT_APP_PUBLIC_POSTHOG_KEY?g.jsx(vO,{apiKey:atob(process.env.REACT_APP_PUBLIC_POSTHOG_KEY),options:{api_host:"/ph",autocapture:!1,disable_session_recording:!0,persistence_name:"flags",secure_cookie:!0,ui_host:"eu.posthog.com",bootstrap:{distinctID:t.id||"00000000-0000-0000-0000-000000000000",isIdentifiedID:!!t.id}},children:e}):g.jsx(g.Fragment,{children:e});var o3=(e=>(e.COMMUNITY_RANKING="community-ranking",e))(o3||{});const bO={en:uo,es:GD,fr:YD,pt:ZD,id:QD,"pt-BR":XD},s3=({children:e,locale:t,messages:n})=>{const r=t||"en",i={...bO[r],...n||{}};return g.jsx(me.IntlProvider,{locale:r,messages:i,children:e})},Iv=E.createContext({}),_d={en:"English",es:"Español",fr:"Français",pt:"Português",id:"Bahasa Indonesia","pt-BR":"Português Brasileiro"},fn=E.createContext({isLoading:!0});function yh(){return E.useContext(fn)}const l3=({children:e,user:t,updateDetails:n})=>g.jsx(fn.Provider,{value:{...t,updateDetails:n},children:e}),Pv=E.createContext({registerOverlay:()=>{},unregisterOverlay:()=>{}}),u3=()=>E.useContext(Pv),c3=({children:e})=>{const[t,n]=E.useState([]);E.useEffect(()=>{t.length>0?document.body.classList.add("has-overlay"):document.body.classList.remove("has-overlay")},[t]);const r=E.useCallback(a=>{n(o=>[...o,a])},[]),i=E.useCallback(a=>{n(o=>o.filter(s=>s!==a))},[]);return g.jsx(Pv.Provider,{value:{registerOverlay:r,unregisterOverlay:i},children:e})},EO=({bootstrap:e,children:t,intl:n,showDevTools:r})=>{const[i,a]=E.useState({isLoading:!0}),[o,s]=E.useState({badges:[],isLoading:!0}),l=(n==null?void 0:n.locale)||localStorage.getItem("language")||"en",[u,c]=E.useState(l),d=f=>{localStorage.setItem("language",f),c(f)};return E.useEffect(()=>{e().then(f=>{Array.isArray(f)?(a({...f[0],isLoading:!1}),s({badges:f[1],isLoading:!1})):a({...f,isLoading:!1}),KC(5e3)}).catch(f=>{f.message===VC&&window.location.pathname!=="/user-onboarding/logout"&&(window.location.href="/user-onboarding/logout"),a({isLoading:!1}),s({badges:[],isLoading:!1})})},[]),g.jsx(Iv.Provider,{value:{language:u,updateLanguage:d},children:g.jsx(s3,{locale:u,messages:n==null?void 0:n.messages,children:g.jsx(wv.CookiesProvider,{children:g.jsx(l3,{user:i,updateDetails:a,children:g.jsx(n3,{badges:o,children:g.jsx(c3,{children:g.jsx(r3,{showDevTools:r,children:g.jsx(a3,{user:i,children:t})})})})})})})})},_O=e=>{const t=me.useIntl(),n=Date.now().toString(),r=E.useContext(fn);let i="default",a=e.src;a.includes("youtube")||a.includes("vimeo")?i="video":a.includes("riddle")||a.includes("sli.do")?i="poll":a.includes("padlet")?i="padlet":a.includes("surveysparrow")&&(i="survey",r!=null&&r.id&&(a=`${a}&user_id=${r.id}`));const o=`content-after-iframe-${n}`;return g.jsxs(g.Fragment,{children:[g.jsx(xt,{element:"a",href:`#${o}`,onClick:s=>{s.preventDefault(),s.stopPropagation();const l=document.getElementById(o);l==null||l.scrollIntoView({behavior:"smooth"}),l==null||l.focus()},children:t.formatMessage({id:`markdown_skip${i==="default"?"":`_${i}`}`})}),g.jsx("iframe",{...e,src:a,title:t.formatMessage({id:`markdown_iframe${i==="default"?"":`_${i}`}`})}),g.jsx("span",{id:o,tabIndex:0})]})},A5=e=>{let t="";return e&&typeof e!="string"&&typeof e!="number"&&typeof e!="boolean"&&"type"in e&&(t=e.type),t},TO=({children:e,...t})=>{const n=me.useIntl();let r={...t};t.href&&(t.href.includes("http:")||t.href.includes("https:"))&&!t.target&&(r.target="_blank");let i=e,a=!1;for(const s of E.Children.toArray(e))if(!(!s||typeof s=="string"||typeof s=="number")&&E.isValidElement(s)){const l=s.type;if(["button","center","span","strong"].includes(l)&&s.props&&s.props.children&&s.props.children[0])for((l==="button"||A5(s.props.children[0])==="button")&&(a=!0),i=s.props.children[0];i&&typeof i!="string"&&!(typeof i=="boolean"||typeof i=="number"||!E.isValidElement(i));)if(i.props&&i.props.children&&i.props.children[0])i=i.props.children[0],i&&A5(i)==="button"&&(a=!0);else break}const o=`@${gc}`;return i===o||Array.isArray(i)&&i[0]===o?(delete r.href,delete r.target,g.jsxs("span",{...r,className:"mention deleted-user",children:["@",n.formatMessage({id:"member_deleted"})]})):a?(r={...r,className:"button primary medium"},g.jsx("p",{className:"center",children:g.jsx(Ke,{variant:"primary",size:"medium",...r,children:i})})):g.jsx("a",{...r,children:i})},ng=({children:e,...t})=>g.jsx("span",{className:ee({url:t==null?void 0:t.href}),children:e});const CO={default:{a:TO,CollapsibleSection:vh,TextBox:Er,CaseStudy:fO,style:An,details:mO,div:gO,iframe:_O,center:hO,script:An},"text-only":{h1:An,h2:An,h3:An,h4:An,h5:An,h6:An,style:An,details:An,div:An,TextBox:An,CollapsibleSection:An,CaseStudy:An,blockquote:An,iframe:An,button:An}},Xo=({element:e="div",className:t="",options:n={},children:r,overrideType:i="default",styling:a={}})=>{if(!r)return null;const{highlightTitles:o=!1}=a;r=r.replace(/^<br\/?>/,"");const s={wrapper:E.Fragment,forceBlock:!0};let l=CO[i];return n.overrides&&(l={...l,...n.overrides}),E.createElement(e,{className:ee("markdown-text",t,{"highlight-titles":o}),children:g.jsx(Ri,{options:{...s,...n,overrides:l},children:r})})};const d3=({maxWidth:e=!1,title:t,subtitle:n,children:r,className:i="",ctaButton:a})=>{const o=e?{"--max-width":`${e/16}rem`}:{};return g.jsxs("section",{className:ee("page-heading",i),children:[g.jsxs("div",{className:ee("content",{"has-max-width":e}),style:o,children:[g.jsxs("div",{className:ee("content-wrapper",{"has-max-width":e}),children:[t&&t.text&&E.createElement(t.element||"h1",{className:"title"},t.text),n&&n.text&&E.createElement(n.element||"h2",{className:"text-medium"},n.text)]}),a&&g.jsx(Ke,{...a,className:ee("cta-button","gtm-trackable"),"data-gtm-event-context":"CreateNewArticle","data-gtm-event-type":"create-article-click",children:a.text})]}),r]})};const Fi=({size:e="medium",variant:t="default",className:n="",icon:r,tooltip:i="",children:a,element:o="span",...s})=>{const l={"--icon":`url(${Hi}icons/${r}.svg)`},{showTooltip:u,tooltipProps:c}=kv(!!i),d={},f=i?typeof i=="string"?`tooltip-${window.btoa(i)}`:i.id:void 0,h=i?typeof i=="string"?i:i.text:void 0;i&&f&&(d["aria-describedby"]=f);const m=E.createElement(i?"button":o,{className:ee("pill",e,t,n,{"has-icon":r}),style:l,children:a,...c,...d,...s});return i?E.createElement(o,{className:"pill-wrapper"},g.jsxs(g.Fragment,{children:[m,g.jsx(ss,{id:f,isOpen:u,children:h})]})):m};const gl=({element:e="p",children:t=null,className:n="",...r})=>E.createElement(e,{...r,className:ee("status-banner text-small",n),"aria-live":"assertive"},t),xO={globe:"globe",heart:"heart_empty_thick",pencil:"pencil",star:"star_empty","speech-bubble":"speech-bubble_round"};const f3=({slug:e})=>{const{badges:t}=t3(),n=t==null?void 0:t.find(s=>s.slug===e);if(!n)return null;const{name:r,icon:i,colour:a,description:o}=n;return g.jsx(Fi,{className:ee("user-badge",a==null?void 0:a.toLowerCase()),icon:i&&xO[i],element:"li",tooltip:o,children:r})};var Fn=(e=>(e.Communities="communities",e.Platform="platform",e))(Fn||{});const h3=({element:e="ul",userBadges:t,badgeOptions:n})=>{if(Object.keys(t).length!==0)return E.createElement(e,{className:"badges-list",children:(n==null?void 0:n.scopes)&&(n==null?void 0:n.scopes.map(r=>{var i,a;return(a=(i=t==null?void 0:t[r.scope])==null?void 0:i[r.area])==null?void 0:a.map((o,s)=>g.jsx(f3,{slug:o},s))}))})};var Rv=(e=>(e.Accepted="accepted",e.Cancelled="cancelled",e.Declined="declined",e.Pending="pending",e.Removed="removed",e))(Rv||{}),Fv=(e=>(e.In="in",e.Out="out",e))(Fv||{});const{In:wO,Out:k5}=Fv,{Pending:Np,Accepted:S5,Cancelled:AO,Removed:kO}=Rv,p3=({functions:e,connection:t={status:null,direction:null},disableConnect:n=!1,meta:{topLevelButton:r=!1}={},...i})=>{const{formatMessage:a}=me.useIntl(),{status:o,direction:s}=t,{onAccept:l,onCancel:u,onRemove:c,onRequest:d}=e,[f,h]=E.useState(!1),[m,p]=E.useState(o),[y,v]=E.useState(s);E.useEffect(()=>{p(o),v(s)},[o,s]);const b=async(_,T)=>{try{h(!0),await _()&&(T!=null&&T.status&&p(T.status),T!=null&&T.direction&&v(T.direction))}finally{h(!1)}};return m===Np&&y===k5?g.jsx(Ke,{onClick:async()=>{await b(l,{status:S5})},disabled:f,variant:r?"primary":"secondary",size:"small",icon:{icon:"user-plus"},...i,children:a({id:"member_connection_accept"})}):m===Np&&y===wO?g.jsxs("div",{className:"connection-cta-wrapper",children:[g.jsx("span",{className:"button secondary connection-cta pending small icon clock left",...i,children:a({id:"member_connection_pending"})}),u&&g.jsx(bf,{options:[{onClick:async()=>{await b(u,{status:AO})},text:a({id:"member_connection_cancel"})}]})]}):m===S5?g.jsxs("div",{className:"connection-cta-wrapper",children:[g.jsx("span",{className:"button secondary connection-cta connected small icon tick left",...i,children:a({id:"member_connection_connected"})}),c&&g.jsx(bf,{options:[{onClick:async()=>{await b(c,{status:kO})},text:a({id:"member_connection_remove"})}]})]}):!m&&d&&!n?g.jsx(Ke,{onClick:async()=>{await b(d,{status:Np,direction:k5})},variant:r?"primary":"secondary",size:"small",disabled:f,icon:{icon:"user-plus"},...i,children:a({id:"member_connection_connect"})}):g.jsx(g.Fragment,{})};const SO=({styling:e={},progress:t=0,text:n=!1,className:r=""})=>{const i=me.useIntl(),{showText:a=!1,layout:o="bar",size:s="default",color:l="default"}=e,u=t>75?100:t>50?75:t>25?50:t>5?25:0,c={"--progress":`${t}%`};return g.jsx("span",{className:ee(`progress-bar section-${u}`,o,r,{[s]:s!=="default",[l!=="default"?l:""]:l!=="default"}),style:c,children:E.createElement(a?"span":xt,{className:a?"text":"",children:n||i.formatMessage({id:"progressBar"},{number:t})})})},Mv=E.memo(SO);const Ip="loadingBlock_",DO=({progress:e=0,steps:t=!1,className:n=""})=>{const r=me.useIntl();t||(t={0:{text:r.formatMessage({id:`${Ip}loading`})},75:{text:r.formatMessage({id:`${Ip}almostDone`})},100:{text:r.formatMessage({id:`${Ip}complete`})}});let i=null;const a=Object.keys(t);for(let s=0;s<a.length&&!(e<parseInt(a[s]));s++)i=a[s];const o=i&&t[i].icon?{"--icon":`url(${Hi}icons/${t[i].icon}.svg)`}:{};return g.jsxs(Er,{className:ee("loading-block",n,{"has-icon":i&&t[i].icon}),variant:"subtle",style:o,children:[i&&g.jsx("span",{className:"step",children:t[i].text}),g.jsx(Mv,{progress:e})]})},m3=E.memo(DO);const qr=({element:e="div",className:t="",...n})=>g.jsx(mh,{element:e,className:ee("loading-placeholder",t),...n});const rg={header:["logo","link","link","search"],sidebar:["text","text","text","text","text"],"cards-section":["subtitle","cards"],heading:["title"],cards:["card","card","card","card"],carousel:["cards","controls"],"carousel-with-title":["title","cards","controls"],answers:["text","text","text"],"text-page":["title","text","text","text","text","subtitle","text","text","text","text","subtitle","text","text","text","text"],"form-with-answers":["question","subtitle","form","answers","answers","answers","answers","answers"],"general-website-page":["banner","text-page"],"overview-page":["header","sidebar","title","text","cards-section","cards-section","footer"],member:["profile-picture","text","text"],"course-navigation":["button","button"],"course-lesson-page":["breadcrumb","course-navigation","text-page"],"course-lesson-quiz":["text-page","quiz-box"]},g3=(e,t)=>e in rg?g.jsx("div",{className:e,children:rg[e].map((n,r)=>g3(n,r))},t):g.jsx(qr,{className:e},t),bh=({layout:e="overview-page",...t})=>g.jsx("div",{className:ee("loading-state",e),...t,children:rg[e].map((n,r)=>g3(n,r))}),v3=e=>{const t=e&&e.toUpperCase().trim().split(" ");return Array.isArray(t)&&t.length>1&&t[0]!==""?t[1]===""?t[0][0]:t[0][0]+t[t.length-1][0]:e?e.substr(0,1):""},d1=["#5AB6A3","#A2D7AF","#806056","#3962B3"],OO=e=>{const t=Math.ceil(26/d1.length),n=v3(e).toLowerCase();if(n==="")return d1[0];const r=n.charCodeAt(0)-96;for(let i=0;i<d1.length;i++)if(r<=t*(i+1))return d1[i]};const D5=256,ka=({className:e="",src:t="",name:n,alt:r,width:i=D5,height:a=D5,showInitials:o=!0,...s})=>{const[l,u]=E.useState(!1),c=E.useRef(null),d=r??n;E.useEffect(()=>{const h=c.current;if(!h)return;const m=h.getContext("2d");if(!m)return;const p=i,y=a;typeof window<"u"&&window.devicePixelRatio&&(h.width=p*window.devicePixelRatio,h.height=y*window.devicePixelRatio,m.scale(window.devicePixelRatio,window.devicePixelRatio)),m.fillStyle=OO(n),m.fillRect(0,0,p,y),m.font=`${p/3}px Arial`,m.textAlign="center",m.fillStyle="white",m.fillText(v3(n),p/2,y/1.6)},[n]);let f=!1;return t&&t!==""&&!l&&(t.includes("http")||t.includes("//"))&&(f=!0),g.jsx("figure",{className:ee("profile-picture",e,{error:l}),...s,children:f?g.jsx("img",{src:t,alt:d,onError:()=>{u(!0)},width:i,height:a}):o?g.jsx("canvas",{ref:c}):g.jsx("span",{className:"fallback"})})};var bn=(e=>(e.DISCUSSION_FORM_SUBMITTED="discussionFormSubmitted",e.DISCUSSION_POST_ADDED="discussionPostAdded",e.DISCUSSION_POST_CLICKED="discussionPostClicked",e.MEMBER_CLICKED="memberClicked",e))(bn||{});const Eh=e=>e==="apolitical"?{image:`${Hi}logos/member_apolitical.svg`}:e==="community"||e==="deleted"||typeof e=="object"&&!e.name?{image:`${Hi}logos/member_community.svg`}:{name:e.name,role:e.jobTitle||"",organisation:e.organization||"",country:e.location&&e.location.en||"",url:`/profiles/${e.id}`,image:e.image&&e.image.thumbnail,badges:e.badges},NO=({role:e="",organisation:t="",country:n="",maximumCharacters:r=80})=>{const i=e!=="",a=t!=="",o=n!=="";if(!i&&!a&&!o)return"";const s=`${e}${i&&a?` — ${t}`:t}`;let l=`${s}${(i||a)&&o?`, ${n}`:n}`;return l.length>r&&(l=s),l.length>r&&(l=pl(l,r)),l};const IO=E.lazy(()=>Promise.resolve().then(()=>aO)),PO=E.lazy(()=>Promise.resolve().then(()=>rve));let f1=null;const Ea=({element:e="div",member:t="community",alt:n="",additionalContent:r=!1,styling:i={},functions:a={},gtmContext:o="member",gtmType:s="member-click",className:l="",badges:u,connection:c,...d})=>{var $,F,ne,J,I;const f=me.useIntl(),{profile:h,connections:m,...p}=a,{size:y="medium",variant:v="inline",isCondensed:b=!0,additionalContentNewLine:_=!1}=i,T=E.useContext(fn),C=h&&T&&typeof T.id=="string",[x,w]=E.useState(!1),P=Eh(t);P.name||(P.name=f.formatMessage({id:`member_${typeof t=="string"?t:"community"}`}));const{name:O,image:M}=P;let{url:R}=P;typeof t=="object"&&t.link!==void 0&&(t.link===!1?R=void 0:R=t.link);const D=NO(P),S=r&&r.createdAt?J0(r.createdAt):!1,B=r&&r.createdAt?Dv(r.createdAt):"",H=!R&&C;return E.createElement(e,{...d,className:ee("member text-medium",y,v,l,{"has-profile-link":C}),...p,children:g.jsxs(g.Fragment,{children:[g.jsxs(fo,{href:R,className:ee({"details-wrapper":H}),fallbackElement:H?"div":void 0,gtmType:s,gtmContext:o,meta:{forceOnClick:!0},onClick:A=>{if(A==null||A.preventDefault(),A==null||A.stopPropagation(),!R){H&&w(!0);return}f1&&clearTimeout(f1),f1=setTimeout(()=>{window.location.href=R},150);const Y=new CustomEvent(bn.MEMBER_CLICKED,{detail:{link:R,timeout:f1}});document.dispatchEvent(Y)},children:[g.jsx(ka,{name:O,src:M,alt:n}),g.jsxs("div",{className:"details",children:[g.jsxs("div",{className:ee("name",{"new-line":_}),"data-testid":"member-name",children:[g.jsx("span",{children:O}),(u==null?void 0:u.showBadges)&&(P==null?void 0:P.badges)&&g.jsx(h3,{userBadges:P.badges,badgeOptions:u}),r&&g.jsxs("span",{className:ee("additional-content",{"new-line":_}),children:[r.createdAt&&S&&!(($=r==null?void 0:r.customMessage)!=null&&$.text)&&g.jsx("span",{className:"date",title:B,"aria-label":B,"data-testid":"date",children:f.formatMessage({id:`dates_${S.path}`},{number:S.number})}),r.createdAt&&S&&((F=r==null?void 0:r.customMessage)==null?void 0:F.text)&&g.jsx("span",{children:f.formatMessage({id:(ne=r.customMessage)==null?void 0:ne.text},{time:f.formatMessage({id:`dates_${S.path}`},{number:S.number}),community:(I=(J=r.customMessage)==null?void 0:J.link)==null?void 0:I.text,link:A=>{var Y,L;return g.jsx("a",{href:`${(L=(Y=r.customMessage)==null?void 0:Y.link)==null?void 0:L.url}`,onClick:U=>U.stopPropagation(),children:A})}})}),r.didEdit&&g.jsx("em",{children:f.formatMessage({id:"discussion_edited"})})]})]}),D&&!_&&g.jsx("small",{className:ee({"text-medium":y==="large"}),"data-testid":"member-details",children:b?D:g.jsxs(g.Fragment,{children:[P.role,P.organisation?` — ${P.organisation}`:g.jsx(g.Fragment,{}),g.jsx("span",{className:"location",children:P.country})]})})]})]}),m&&g.jsx(p3,{connection:c,functions:m}),D&&h&&C?g.jsxs(g.Fragment,{children:[g.jsx(Ke,{variant:"tertiary",size:"small",onClick:A=>{A.preventDefault(),A.stopPropagation(),w(!0)},"data-testid":"profile-button",children:f.formatMessage({id:"member_profile"})}),g.jsx(IO,{children:g.jsx(PO,{form:h,showModal:x,content:{title:f.formatMessage({id:"member_profile"})},functions:{onClose:()=>{w(!1)}},className:"in-portal"})})]}):g.jsx(g.Fragment,{})]})})},RO=Object.freeze(Object.defineProperty({__proto__:null,default:Ea},Symbol.toStringTag,{value:"Module"}));const O5={small:24,medium:48},Bv=({element:e="div",contributors:{total:t,data:n}={total:void 0,data:[]},styling:{showText:r,size:i,showGap:a,showPlaceholders:o}={showText:!0,size:"medium",showGap:!0,showPlaceholders:!1},cutoff:s=2,multipleText:l,className:u="",...c})=>{const d=me.useIntl();return!n||n.length===0?null:E.createElement(e,{...c,className:ee("contributors",u,i,{"has-gap":a}),children:g.jsxs(g.Fragment,{children:[g.jsx("ul",{children:n.map((f,h)=>{let m,p="";if(h<s){const{name:y="",image:v=""}=Eh(f);if(o)return g.jsx(qr,{element:"li",className:"contributor"},h);m=g.jsx(ka,{name:y,src:v,width:O5[i||"medium"],height:O5[i||"medium"]})}else if(h===s){const y=(t||n.length)-s;m=g.jsxs("small",{className:ee({"large-number":y>99}),children:["+",JD(y,0)]}),p="number-left"}return m?g.jsx("li",{className:ee("contributor",p),children:m},h):null})}),r&&g.jsx("span",{className:"label",children:typeof r=="string"?r:n.length===1?typeof n[0]=="string"?d.formatMessage({id:`member_${n[0]}`}):pl(n[0].name||"",20):l||null})]})})};const Lv=({element:e="section",children:t,className:n,variant:r,additionalContent:i,...a})=>{let o=typeof t=="string"?g.jsx("p",{children:t}):t;return i&&(o=g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"modal-content",children:typeof t=="string"?g.jsx("p",{children:t}):t}),g.jsx("div",{className:"modal-additional-content",children:typeof i=="string"?g.jsx("p",{children:i}):i})]})),E.createElement(e,{className:ee("modal",n,{"success-section":r==="success"}),children:o,...a})};var ig={exports:{}},h1={exports:{}},Mt={};/** @license React v16.13.1
|
|
38
38
|
* react-is.production.min.js
|
|
@@ -162,7 +162,7 @@ ${h}${d?"1.":"-"} ${u}${f?`
|
|
|
162
162
|
|
|
163
163
|
`.substring(0,i);return n+a+r}function sU(e){return e!=null&&(typeof e=="string"||e.nodeType&&(e.nodeType===1||e.nodeType===9||e.nodeType===11))}var lU={isHistory(e){return Dn(e)&&Array.isArray(e.redos)&&Array.isArray(e.undos)&&(e.redos.length===0||Xa.isOperationList(e.redos[0].operations))&&(e.undos.length===0||Xa.isOperationList(e.undos[0].operations))}},gm=new WeakMap,vm=new WeakMap,Gs={isHistoryEditor(e){return lU.isHistory(e.history)&&N.isEditor(e)},isMerging(e){return vm.get(e)},isSaving(e){return gm.get(e)},redo(e){e.redo()},undo(e){e.undo()},withoutMerging(e,t){var n=Gs.isMerging(e);vm.set(e,!1),t(),vm.set(e,n)},withoutSaving(e,t){var n=Gs.isSaving(e);gm.set(e,!1),t(),gm.set(e,n)}},uU=e=>{var t=e,{apply:n}=t;return t.history={undos:[],redos:[]},t.redo=()=>{var{history:r}=t,{redos:i}=r;if(i.length>0){var a=i[i.length-1];a.selectionBefore&&de.setSelection(t,a.selectionBefore),Gs.withoutSaving(t,()=>{N.withoutNormalizing(t,()=>{for(var o of a.operations)t.apply(o)})}),r.redos.pop(),t.writeHistory("undos",a)}},t.undo=()=>{var{history:r}=t,{undos:i}=r;if(i.length>0){var a=i[i.length-1];Gs.withoutSaving(t,()=>{N.withoutNormalizing(t,()=>{var o=a.operations.map(Xa.inverse).reverse();for(var s of o)t.apply(s);a.selectionBefore&&de.setSelection(t,a.selectionBefore)})}),t.writeHistory("redos",a),r.undos.pop()}},t.apply=r=>{var{operations:i,history:a}=t,{undos:o}=a,s=o[o.length-1],l=s&&s.operations[s.operations.length-1],u=Gs.isSaving(t),c=Gs.isMerging(t);if(u==null&&(u=dU(r)),u){if(c==null&&(s==null?c=!1:i.length!==0?c=!0:c=cU(r,l)),s&&c)s.operations.push(r);else{var d={operations:[r],selectionBefore:t.selection};t.writeHistory("undos",d)}for(;o.length>100;)o.shift();a.redos=[]}n(r)},t.writeHistory=(r,i)=>{t.history[r].push(i)},t},cU=(e,t)=>!!(t&&e.type==="insert_text"&&t.type==="insert_text"&&e.offset===t.offset+t.text.length&&K.equals(e.path,t.path)||t&&e.type==="remove_text"&&t.type==="remove_text"&&e.offset+e.text.length===t.offset&&K.equals(e.path,t.path)),dU=(e,t)=>e.type!=="set_selection";const fU=(e,t)=>{const{apply:n}=e;try{e.apply=r=>{if(r.type==="remove_node"&&"type"in r.node&&r.node.type===ae.link){const i=r.node;if(i.link){const a=new CustomEvent("linkRemoved",{detail:{url:i.link}});window.dispatchEvent(a)}}n(r)}}catch(r){const i=r.message;t(`Error in withLinkRemovalListener: ${i}`)}return e};var hU=vU,pU=/^(?:\w+:)?\/\/(\S+)$/,mU=/^localhost[\:?\d]*(?:[^\:?\d]\S*)?$/,gU=/^[^\s\.]+\.\S{2,}$/;function vU(e){if(typeof e!="string")return!1;var t=e.match(pU);if(!t)return!1;var n=t[1];return n?!!(mU.test(n)||gU.test(n)):!1}const yU=gi(hU),bU=(e,t,n)=>{const{insertText:r,isInline:i}=e;try{e.isInline=a=>{const o=a;return[ae.link].includes(o.type)||i(a)},e.insertText=a=>{a&&yU(a)?Cy(e,a,t):r(a)}}catch(a){const o=a.message;n(`Error in withInlines: ${o}`)}return e},EU=(e,t)=>{const{isInline:n,isVoid:r,markableVoid:i}=e;try{e.isInline=a=>a.type===ae.mention?!0:n(a),e.isVoid=a=>a.type===ae.mention?!0:r(a),e.markableVoid=a=>a.type===ae.mention||i(a)}catch(a){const o=a.message;t(`Error in withMentions: ${o}`)}return e},_U=(e,t)=>{const{normalizeNode:n}=e;try{e.normalizeNode=([r,i])=>{if(r.type===ae.link&&Ee.string(r).trim()===""){de.removeNodes(e,{at:i});return}n([r,i])}}catch(r){const i=r.message;t(`Error in withoutEmptyLinks: ${i}`)}return e};const ky=({id:e="rich-text-editor",value:t,placeholder:n,maxLength:r=0,meta:i,functions:a,autoFocus:o,data:s,styling:l,...u})=>{const c=me.useIntl(),d=KD();typeof o>"u"&&(o=!0);const{isInOverlay:f=!1}=i||{},{listMembers:h,clickMentionFallback:m,onChange:p=()=>{},onChangeData:y=()=>{},getLinkPreview:v=()=>Promise.resolve({}),onMention:b=()=>{},reportError:_=V=>{console.error(V)}}=a||{},T=[{type:ae.paragraph,children:[{text:""}]}];t==="<br>"&&(t="");const C={editorKey:null,originalValue:t||"",initialValue:t?null:T,showLinkEditor:!1,mentionPopover:{show:!1,selectedUser:0,possibleUsers:[],position:null,numberOfUsers:null},lastAnchor:null,stringValue:"",lastKey:null,hasInteracted:!1,hasLoaded:!1,enrichedUrl:!1},[x,w]=E.useReducer(Rl,C),{editorKey:P,originalValue:O,initialValue:M,stringValue:R,lastAnchor:D,lastKey:S,hasInteracted:B,hasLoaded:H,enrichedUrl:$,mentionPopover:F}=x,ne=async V=>{const z=await v(V);z.url&&w([{type:"enrichedUrl",value:z}])},J=`rte-${e}`,I=E.useCallback(V=>g.jsx(nP,{...V}),[]),A=E.useCallback(V=>g.jsx(rP,{...V}),[]),Y=E.useMemo(()=>fU(bU(EU(_U(uU(zL(WM())),_),_),J,_),_),[]),L=V=>{if(!Y||V!==J)return;const z=N.end(Y,[]);de.select(Y,z),fe.focus(Y)};E.useEffect(()=>{const V=z=>{var Q;const j=z,ue=((Q=j==null?void 0:j.detail)==null?void 0:Q.id)||null;ue&&L(ue)};return window.addEventListener("focusEditor",V),()=>{window.removeEventListener("focusEditor",V)}},[]),E.useEffect(()=>{if(Y.children.length>0&&!H){if(w([{type:"hasLoaded",value:!0}]),!o)return;L(J)}},[Y.children.length,M]),E.useEffect(()=>{O&&(async()=>{let z=$r(O);if(z.includes("<")){kc.prototype.escape=ue=>ue;const j=new kc;j.addRule("br",{filter:["br"],replacement:ue=>ue+`
|
|
164
164
|
|
|
165
|
-
`}),z=j.turndown(z)}s&&s.mentions&&(z=await GC({text:z,template:`[${Tg}{{name}}]({{id}})`,mentions:s.mentions,listMembers:h||(()=>Promise.resolve([]))})),yH(z,j=>{const ue=[{type:"initialValue",value:j},{type:"editorKey",value:O.toString()}];s!=null&&s.link&&(ue.push({type:"enrichedUrl",value:s.link}),s.link.url&&ne(s.link.url)),w(ue),setTimeout(()=>{w([{type:"stringValue",value:q2(Y)}])},150)})})()},[O]),E.useEffect(()=>{if($===void 0&&Y){const z=_H(Y);z&&ne(z)}const V=z=>{var Q;const j=z,ue=((Q=j==null?void 0:j.detail)==null?void 0:Q.url)||null;ue&&$&&$.url===ue&&w([{type:"enrichedUrl",value:void 0}])};return window.addEventListener("linkRemoved",V),()=>{window.removeEventListener("linkRemoved",V)}},[$]),E.useEffect(()=>{if(t){vc.lastIndex=0;const V=t.match(vc);V&&V.length===1&&V[0].length===t.length&&!B&&w([{type:"originalValue",value:t}])}t!==""||!Y||cf(O,t)&&!B||(N.withoutNormalizing(Y,()=>{de.delete(Y,{at:{anchor:N.start(Y,[]),focus:N.end(Y,[])}}),de.deselect(Y),Y.children.length!==0&&de.unwrapNodes(Y,{at:[0]}),de.insertNodes(Y,T,{at:[0]})}),w([{type:"initialValue",value:T},{type:"lastAnchor",value:null},{type:"enrichedUrl",value:!1}]))},[t]),E.useEffect(()=>{y({link:$})},[$]),E.useEffect(()=>{R===""&&$&&w([{type:"enrichedUrl",value:void 0}])},[R]);const U=mc(()=>{CH({editor:Y,isShowing:F.show,numberOfUsers:F.numberOfUsers,listMembers:h,dispatch:w})},100);return M?g.jsx("div",{id:J,className:"rich-text-editor input text-medium",children:g.jsxs(Da.Provider,{value:{...x,id:J,isInOverlay:f,dispatch:w,onMention:b,reportError:_},children:[g.jsxs(HL,{editor:Y,initialValue:M,onChange:V=>{if(Y.operations.some(j=>j.type!=="set_selection")){let j=wH(V);j==="<br>"&&(j=""),p(j,$),w([{type:"stringValue",value:q2(Y)}]),B||w([{type:"hasInteracted",value:!0}]),U(),d&&console.log({serialized:j,json:V})}},...u,children:[g.jsx(IL,{className:"editor",renderElement:I,renderLeaf:A,placeholder:n||c.formatMessage({id:"richTextEditor_placeholder"}),autoFocus:o,tabIndex:0,onPaste:async V=>{const z=$!==!1,j=V.clipboardData.getData("text");if((Q=>{try{return new URL(Q),!0}catch{return!1}})(j)){let Q=j;if(j){const{full:ie}=Ov(j);Q=ie}if(j&&v&&!z){const ie=await v(Q);ie.url&&w([{type:"enrichedUrl",value:ie}])}}},onKeyDown:V=>{if(V.key==="Enter"){F.show&&(V.preventDefault(),V.stopPropagation(),dw(Y,F,w,J));const{selection:z}=Y;if(z){const j=ce.isCollapsed(z),[ue,Q]=N.node(Y,z,{depth:1});let ie=ue,le=ie.type;const te=ie.children[0];if(te&&(te==null?void 0:te[ae.h3])===!0&&(V.stopPropagation(),V.preventDefault(),de.insertNodes(Y,T)),te&&[ae.ol,ae.ul].includes(te.type)&&(ie=te,le=te.type),ie&&De.isElement(ie)&&le!==ae.paragraph){if(le===ae.blockquote&&!V.shiftKey){V.stopPropagation(),V.preventDefault(),de.insertNodes(Y,T);return}if(j){const[Ae,Oe]=N.parent(Y,z,{edge:"end"}),se=Ae.type;if([ae.ul,ae.ol].includes(le))if(V.stopPropagation(),V.preventDefault(),se===ae.li&&S==="Enter"){Ae.children.length===1&&"text"in Ae.children[0]&&Ae.children[0].text===""&&de.removeNodes(Y,{at:Oe}),de.insertNodes(Y,T,{at:K.next(Q)}),de.select(Y,N.end(Y,K.next(Q)));return}else{const[ve,ke]=bH(Y,ae.li),Fe={type:ae.li,children:[{text:""}]};de.insertNodes(Y,Fe,{at:K.next(ke)}),de.select(Y,N.end(Y,K.next(ke)))}}}}}else if(V.key==="Escape"){if(F.show){V.preventDefault(),V.stopPropagation(),w([{type:"mentionPopover",value:{...F,show:!1}}]);return}}else if(["ArrowUp","ArrowDown"].includes(V.key)&&F.show){V.preventDefault(),V.stopPropagation();const{selectedUser:z,possibleUsers:j}=F;let ue=V.key==="ArrowUp"?z-1:z+1;ue<0&&(ue=j.length-1),ue>=j.length+1&&(ue=0),w([{type:"mentionPopover",value:{...F,selectedUser:ue}}])}w([{type:"lastKey",value:V.key}]),TH(V,Y,w,_)},onBlur:()=>{Y.selection&&w([{type:"lastAnchor",value:Y.selection.anchor}])},onFocus:()=>{if(D){if(!K.isPath(D.path)||!Ee.has(Y,D.path))return;const V=Ee.get(Y,D.path);let z=0;if(Pe.isText(V)?z=V.text.length:V.children&&(z=V.children.length),D.offset>z)return;try{de.select(Y,{anchor:D,focus:D})}catch(j){const ue=j.message;_(`Error focusing editor: ${ue}`)}}}}),$?g.jsx(Qv,{data:$,variant:"condensed",onClick:()=>{w([{type:"enrichedUrl",value:!1}]);const V=new CustomEvent("ariaLive",{detail:{message:c.formatMessage({id:"richTextEditor_link_enrichedUrl_aria_live"})}});document.dispatchEvent(V)},"aria-label":c.formatMessage({id:"richTextEditor_link_enrichedUrl_aria"},{title:$.title||c.formatMessage({id:"richTextEditor_link_enrichedUrl_aria_fallback"})})}):g.jsx(g.Fragment,{}),g.jsx(MH,{styling:l==null?void 0:l.toolbar}),h?g.jsx(AH,{onFallbackClick:m}):g.jsx(g.Fragment,{})]},P),g.jsx(Jv,{id:`character-limit-${e}`,limit:r,valueLength:_h(R)})]})}):g.jsx(g.Fragment,{})};const TU=({id:e="form-toggle",label:t,options:n,initialValue:r,functions:{onChange:i=()=>{}},isDisabled:a=!1,className:o=""})=>{const[s,l]=E.useState(typeof r=="boolean"||typeof r=="string"?r:n[0].value);E.useEffect(()=>{r&&l(r)},[r]);const u=c=>{a||(l(c),i(c))};return g.jsxs("div",{className:ee("toggle",o),onClick:c=>{c.preventDefault(),c.stopPropagation(),u(s===n[0].value?n[1].value:n[0].value)},children:[g.jsx("p",{children:t}),g.jsx("ul",{className:ee("toggle-options",{disabled:a,on:s===n[1].value}),children:n.map(c=>{const d=`${e}-${c.value}`;return g.jsxs("li",{className:"hidden",children:[g.jsx("input",{type:"radio",id:d,name:e,value:c.value,checked:s===c.value,onChange:()=>u(c.value),disabled:a}),g.jsx("label",{htmlFor:d,children:c.label})]},d)})})]})};function Aw({className:e="",userId:t,userName:n,src:r,uploadImage:i,button:a,callback:o}){const s=me.useIntl(),l="profileImageChange_",[u,c]=E.useState(r),[d,f]=E.useState(!1),[h,m]=E.useState(!1),p=E.useRef(null),y=async T=>{f(!0),m(!1);try{const C=T.target.files&&T.target.files[0];if(!C||!t)throw f(!1),new Error("Image file or userID is missing");const x=await i({fileObject:C,userId:t}),w={thumbnail:x.thumbnailURL,full:x.originalURL};c(w),o(w)}catch{m(!0)}finally{f(!1)}f(!1)},{upload:v=s.formatMessage({id:`${l}cta_upload`}),change:b=s.formatMessage({id:`${l}cta_change`}),uploading:_=s.formatMessage({id:`${l}cta_uploading`})}=(a==null?void 0:a.text)||{};return g.jsxs("div",{className:ee("profile-image-change-figure",e),children:[g.jsx(ka,{className:"profile-image-change-picture",name:n,src:u==null?void 0:u.thumbnail,showInitials:!1,alt:"","data-testid":"profile-picture"}),h&&g.jsx("p",{className:"error text-small",children:s.formatMessage({id:`${l}error`})}),g.jsx("input",{id:"file",type:"file",accept:"image/*",ref:p,onChange:y,hidden:!0,"data-testid":"file-input"}),g.jsx(Ke,{onClick:()=>p.current&&p.current.click(),variant:"secondary","data-gtm-event-context":"ImageField","data-gtm-event-type":`${u?"change-photo":"add-photo"}-click`,className:"gtm-trackable",disabled:d,children:d?_:u?b:v})]})}const kw=({gtm:e,functions:{onSuccess:t=async()=>{},onFailure:n=()=>{}}})=>{const{context:r="FooterContactUsForm",event:i="contact-form-submit-click"}=e||{};return g.jsx(Zi,{id:"contact-us-form",fields:[{id:"name",type:"text",className:"short",validation:[{condition:"required"}],autoComplete:"name"},{id:"email",type:"email",className:"short",validation:[{condition:"required"},{condition:"valid-email"}]},{id:"organisation",type:"text"},{id:"interests",type:"checkboxes",options:[{id:"publishingCourse",label:"Publishing or creating a course"},{id:"buyingCourse",label:"Buying courses for my team"},{id:"learningExperience",label:"Customised learning experiences"},{id:"somethingElse",label:"Something else"}]},{id:"message",type:"textarea",limit:1e3,validation:[{condition:"required"}]}],intlPath:"contactForm",gtm:{context:r,event:i},functions:{onSuccess:t,onFailure:n},button:{className:"new"}})};const CU=({emails:e,setEmails:t,setIsDisabled:n})=>{const{formatMessage:r}=me.useIntl();return g.jsx(OD.ReactMultiEmail,{id:"email-input",inputClassName:"email-input input",placeholder:r({id:"inviteForm_email_placeholder"}),emails:e,onChange:i=>{t(i),n(!i.length)},autoFocus:!1,getLabel:(i,a,o)=>g.jsxs("div",{className:"email text-medium",children:[g.jsx("div",{"data-tag-item":!0,children:i}),g.jsx(Ke,{variant:"tertiary",size:"small",icon:{icon:"close"},onClick:()=>{o(a),n(!e.length)},className:"remove-email-button",screenreaderText:r({id:"overlay_close"})})]},a)})},Sw=({title:e,label:t,messagePlaceholder:n,ctaMessage:r,titleColor:i,labelColor:a,backgroundColor:o,onClose:s,reportError:l,sendInvites:u,initialFormStatus:c="NOT_SUBMITTED",gtm:d={context:"Form",event:"form-submit-click"},secondaryActionButton:f,meta:h})=>{const[m,p]=E.useState([]),[y,v]=E.useState(!0),[b,_]=E.useState(c),{formatMessage:T}=me.useIntl(),C=async P=>{try{await u(m,P.message),p([]),_("SUCCESS")}catch(O){_("ERROR"),l(O)}},x=P=>{P.preventDefault(),_("NOT_SUBMITTED"),v(!0),p([])},w=P=>{P.preventDefault(),s(),_("CLOSED")};return b==="CLOSED"?null:b==="ERROR"||b==="SUCCESS"&&!(h!=null&&h.shouldHideDoneButtonOnSubmit)?g.jsxs("div",{className:"invite-form-wrapper",children:[g.jsx("div",{className:"content centred",children:b==="SUCCESS"?g.jsx("h2",{className:"success-title",children:T({id:"inviteForm_success"})}):g.jsxs("h2",{className:"error-title",children:[" ",T({id:"inviteForm_error"})]})}),g.jsx(fi,{}),g.jsx("div",{className:"footer",children:b==="SUCCESS"?g.jsxs(g.Fragment,{children:[g.jsx(Ke,{variant:"secondary",onClick:x,children:T({id:"inviteForm_ctaSendMoreInvites"})}),g.jsx(Ke,{onClick:w,children:T({id:"inviteForm_ctaDone"})})]}):g.jsx(Ke,{onClick:x,children:T({id:"inviteForm_ctaTryAgain"})})})]}):g.jsxs("div",{className:"invite-form-wrapper",style:{backgroundColor:o},children:[g.jsxs("div",{className:"content",children:[g.jsx("h2",{className:"title",style:{color:i},children:e}),g.jsx("label",{htmlFor:"email-input",className:"label",style:{color:a},children:t})]}),g.jsx(Zi,{id:"invite-form",fields:[{component:CU,props:{emails:m,setEmails:p,setIsDisabled:v},required:!0},{id:"message",type:"textarea",label:T({id:"inviteForm_message_label"}),placeholder:n||T({id:"inviteForm_message_placeholder"})}],functions:{onSuccess:C},button:{text:r,size:"medium",disabled:y},gtm:d,meta:h,secondaryActionButton:f})]})},Dd=e=>e.map(t=>({condition:t})),Sr={FORM_ID:"manage-account-password-change",NEW_PASSWORD:"newPassword",CONFIRMED_PASSWORD:"confirmedPassword",CURRENT_PASSWORD:"oldPassword"},xU=({functions:e,...t})=>{const{formatMessage:n}=me.useIntl(),[r,i]=E.useState(null),[a,o]=E.useState(!1),[s,l]=E.useState({isMoreThanEightCharacters:!1,includesNumberAndSymbol:!1,includesLowerAndUppercase:!1}),u=h=>h[Sr.NEW_PASSWORD]!==h[Sr.CONFIRMED_PASSWORD]?n({id:"passwordRules_unmatched_text"}):null,c=h=>!eg(h[Sr.NEW_PASSWORD]).isValid,d=[{"data-testid":Sr.NEW_PASSWORD,id:Sr.NEW_PASSWORD,type:"password",autoComplete:"new-password",placeholder:"",label:n({id:"passwordRules_newPassword_label"}),validation:Dd(["required",c]),functions:{onChange:h=>l(eg(h).matchingRules),onFocus:()=>o(!0),onBlur:()=>o(!1)}},{"data-testid":Sr.CONFIRMED_PASSWORD,id:Sr.CONFIRMED_PASSWORD,type:"password",autoComplete:"new-password",placeholder:"",label:n({id:"passwordRules_confirmPassword_label"}),validation:Dd(["required",u])}];t.isPasswordChange&&d.unshift({"data-testid":Sr.CURRENT_PASSWORD,id:Sr.CURRENT_PASSWORD,type:"password",autoComplete:"current-password",placeholder:"",label:n({id:"passwordRules_currentPassword_label"}),validation:Dd(["required"])}),a&&d.push({component:tx,props:{matchingRules:s}});const f={id:Sr.FORM_ID,fields:d,functions:{...e,onSuccess:async h=>(e.createPassword(h),e.onSuccess&&e.onSuccess(h)),onCatch:h=>i(h==null?void 0:h.statusCode),onFailure:(h,m)=>{(m.includes(Sr.NEW_PASSWORD)||m.includes(Sr.CONFIRMED_PASSWORD))&&o(!0)}},meta:{shouldReset:!0},...t};return g.jsxs(g.Fragment,{children:[g.jsx(Zi,{...f}),r&&g.jsx(Ui,{variant:"error",text:r})]})};const Dw=({isCreateProfile:e=!1,hooks:t,functions:n,meta:r={},gtm:i,...a})=>{var P;const o=me.useIntl(),s="profileForm_",l=E.useContext(fn),[u,c]=E.useState(l.image),[d,f]=E.useState(!1),{uploadImage:h=()=>{},onSuccess:m=async O=>{},onCancel:p=()=>{},onFailure:y=()=>{}}=n,{buildLocation:v,isValidPlace:b,predictPlaces:_}=t.useMaps(),{context:T="ProfileForm",event:C="profile-form-submit-click"}=i||{},x=[{id:"jobTitle",type:"text",label:o.formatMessage({id:`${s}jobTitle`}),placeholder:o.formatMessage({id:`${s}jobTitle_placeholder`}),value:l.jobTitle,validation:[{condition:"required"}]},{id:"organization",type:"text",label:o.formatMessage({id:`${s}organization`}),placeholder:o.formatMessage({id:`${s}organization_placeholder`}),value:l.organization,validation:[{condition:"required"}]},{id:"location",type:"autocomplete",label:o.formatMessage({id:`${s}location`}),placeholder:o.formatMessage({id:`${s}location_placeholder`}),value:(P=l.location)==null?void 0:P.en,validation:[{condition:"required"},{condition:({location:O})=>O&&!d?!1:!b(O),error:o.formatMessage({id:`${s}location_error`})}],functions:{onChange:()=>{d||f(!0)},onKeyInput:_}}],w=[{component:Aw,props:{userName:l.name,userId:l.id,src:u,uploadImage:h,callback:c,button:{text:{upload:o.formatMessage({id:`${s}image`})}}}},{id:"name",type:"text",label:o.formatMessage({id:`${s}name`}),placeholder:o.formatMessage({id:`${s}name_placeholder`}),value:l.name,autoComplete:"name",validation:[{condition:"required"}]},...x,{id:"biography",type:"textarea",label:o.formatMessage({id:`${s}bio`}),placeholder:o.formatMessage({id:`${s}bio_placeholder`}),limit:1e3,value:l.biography},{component:fi}];return g.jsx(Zi,{id:"profile-details-form",fields:e?x:w,meta:{shouldShowCancelButton:!e,shouldReset:!1,shouldHide:!1,showRequiredLabels:e,...r},intlPath:s,gtm:{context:T,event:C},functions:{onSuccess:async O=>{try{const M={...O,image:u||null,location:d?await v(O==null?void 0:O.location):l.location,...e?{onboardingState:"completed"}:{}};l.updateDetails&&l.updateDetails(R=>({...R,...M})),await m(M)}catch{y()}},onCancel:p,onFailure:y},button:{size:"large",text:{default:o.formatMessage({id:`${s}cta`}),submitting:o.formatMessage({id:`${s}cta_submitting`}),submitted:o.formatMessage({id:`${s}cta_submitted`})}},...a})},wU=()=>{const e=me.useIntl(),[t,n]=E.useState(0);return E.useEffect(()=>{const r=setInterval(()=>{n(i=>{if(i>=95)return clearInterval(r),95;const a=Math.round(Math.random()*10);return Math.min(i+a,95)})},800);return()=>{clearInterval(r)}},[]),g.jsx(m3,{progress:t,steps:{0:{icon:"layers",text:e.formatMessage({id:"publishArticleForm_progressBar"})}}})};function AU({coverImage:e,setShowImagePicker:t}){return e&&e.url?g.jsx(Ui,{className:"cover-image-preview",text:g.jsx(co,{className:"cover-image",image:{description:e.description||"",height:e.height,width:e.width,url:e.url,color:e.color,type:"image/jpeg"}}),button:{component:g.jsx(Ke,{variant:"tertiary",onClick:()=>t(!0),children:g.jsx(me.FormattedMessage,{id:"publishArticleForm_replaceImage_button"})})}}):g.jsx(Ui,{button:{component:g.jsx(Ke,{variant:"secondary",onClick:()=>t(!0),children:g.jsx(me.FormattedMessage,{id:"publishArticleForm_selectImage_button"})})}})}var Ow=(e=>(e.CitiesAndLocalGovernment="topic_CitiesAndLocalGovernment",e.Climate="topic_Climate",e.DigitalAndData="topic_DigitalAndData",e.Education="topic_Education",e.EquityJusticeAndInclusion="topic_EquityJusticeAndInclusion",e.HealthAndSocialCare="topic_HealthAndSocialCare",e.Innovation="topic_Innovation",e.LeadershipAndSkills="topic_LeadershipAndSkills",e.LifeInGovernment="topic_LifeInGovernment",e.Policymaking="topic_Policymaking",e.TransportAndInfrastructure="topic_TransportAndInfrastructure",e.WorkingAndTheEconomy="topic_WorkAndTheEconomy",e))(Ow||{});let ym=null;const un="publishArticleForm_",J2={},eE=10,kU=({id:e="publish-article-form",values:t=J2,setShowImagePicker:n,functions:r,meta:i,gtm:a})=>{var O;const o=me.useIntl(),s=E.useContext(fn),{create:l,onSuccess:u=()=>{},onFailure:c=()=>{}}=r||{},{isInOverlay:d=!1}=i||{},[f,h]=E.useState(!1),[m,p]=E.useState(t.body||""),[y,v]=E.useState(!1),[b,_]=E.useState("");E.useEffect(()=>{cf(t,J2)||yc(t.body)&&t.body!==m&&t.body!==void 0&&p(t.body)},[t.body]);const T=()=>{!s||!s.id?v(o.formatMessage({id:`${un}error_loggedOut`})):y&&v(!1)},C=M=>({condition:R=>{const D=R[M];return!D||typeof D!="string"?!0:D.length<eE},error:o.formatMessage({id:`${un}error_underMinLength`},{length:eE})}),x=!!m&&yc(m),w=()=>g.jsxs(g.Fragment,{children:[g.jsx(fi,{}),g.jsx("p",{className:"text-medium",children:o.formatMessage({id:`${un}disclaimer`})})]}),P=[{id:"title",type:"textarea",value:t.title||"",limit:65,label:o.formatMessage({id:`${un}title_label`}),placeholder:o.formatMessage({id:`${un}title_placeholder`}),styling:{autosizeToFit:!0},functions:{onChange:T},validation:[{condition:"required"},C("title")]},{id:"subtitle",type:"textarea",value:t.subtitle,limit:115,label:o.formatMessage({id:`${un}subtitle_label`}),styling:{autosizeToFit:!0},placeholder:o.formatMessage({id:`${un}subtitle_placeholder`}),functions:{onChange:T},validation:[{condition:"required"},C("subtitle")]},{component:Af,props:{formID:e,label:{visible:o.formatMessage({id:`${un}body_label`})},showLabel:!0}},{component:ky,props:{id:`${e}-input`,value:m,placeholder:o.formatMessage({id:`${un}body_placeholder`}),meta:{isInOverlay:d},autoFocus:!1,functions:{onChange:M=>{p(M),T()}},styling:{toolbar:{showHeadingOption:!0}},"aria-invalid":!!y,"aria-errormessage":"error-message"}},{id:"tags",label:o.formatMessage({id:`${un}tags_label`}),type:"checkboxes",styling:{displayOptionsAsPills:!0},options:Object.values(Ow).map(M=>({id:M,label:o.formatMessage({id:`${un}_tags_${M}`})})),multipleOptions:{limit:3},validation:[{condition:"required",error:o.formatMessage({id:`${un}tags_error_required`})},{condition:M=>{var R;return((R=M==null?void 0:M.tags)==null?void 0:R.length)>3},error:o.formatMessage({id:`${un}tags_error_over_three`})}]},{component:Af,props:{formID:e,label:{visible:o.formatMessage({id:`${un}cover_image_label`})},showLabel:!0}},{component:AU,props:{coverImage:t.coverImage||{},setShowImagePicker:n}}];return f?P.push({component:fi}):P.push({component:w}),g.jsxs("section",{className:"publish-article-form",children:[g.jsx(Zi,{id:e,meta:{shouldReset:!1,shouldHide:!1,showRequiredLabels:!1,shouldScrollOnSuccess:!1},functions:{onSuccess:async M=>{if(!s||!s.id||!x)return;ym&&clearTimeout(ym),h(!0);const R={...M,body:m,coverImage:t.coverImage};try{l&&await l(R),ym=setTimeout(()=>{_(o.formatMessage({id:`${un}aria_success`})),u(R)},500)}catch{v(o.formatMessage({id:`${un}error`})),_(""),c()}},onFailure:c},fields:P,intlPath:un,button:{variant:"primary",size:{mobile:"small",600:"medium"},"data-gtm-event-context":a==null?void 0:a.context,"data-gtm-event-type":"publish-article-click",disabled:!s||!s.id||!x||!((O=t==null?void 0:t.coverImage)!=null&&O.url),text:{default:o.formatMessage({id:`${un}cta_submit`}),submitting:o.formatMessage({id:`${un}cta_submitting`}),submitted:o.formatMessage({id:`${un}cta_submitted`})},customOnSubmit:y?g.jsx(g.Fragment,{}):g.jsx(wU,{})},gtm:a}),y&&g.jsx(gl,{id:"error-message",className:"error",children:typeof y=="string"&&y.includes(" ")?y:o.formatMessage({id:`${un}error`})}),b&&g.jsx(xt,{"aria-live":"polite",showOnFocus:!1,children:b})]})};const Nw=({id:e="search",className:t="",handleToggle:n=!1,defaultValue:r="",gtmContext:i="search-bar",gtmEvent:a="form-submission"})=>{const{searchIsOpen:o=!0,isDesktopVersion:s=!1}=n||{},l=me.useIntl(),u=E.useRef(null);ml(()=>{!n||s||!o||u.current&&u.current.focus()},[o]);const c=d=>{d.preventDefault(),d.stopPropagation(),!(!u.current||!u.current.value||u.current.value.length<1)&&(window.location.href=`/search?search=${encodeURIComponent(u.current.value)}`)};return g.jsx("form",{onSubmit:c,className:ee("search-form gtm-trackable",t),role:"search","data-gtm-event-context":i,"data-gtm-event-type":a,children:g.jsx("fieldset",{id:`${e}-form`,hidden:n?!o:!1,children:g.jsxs("p",{children:[g.jsx(xt,{element:"label",htmlFor:e,children:l.formatMessage({id:"search_label"})}),g.jsx("input",{ref:u,type:"search",id:e,name:e,defaultValue:r,placeholder:l.formatMessage({id:"search_placeholder"}),onKeyDown:d=>{d.key==="Enter"&&c(d)}}),g.jsx("button",{className:"clear",onClick:d=>{d.preventDefault(),d.stopPropagation(),u.current&&u.current.value&&(u.current.value="")},children:g.jsx(xt,{children:l.formatMessage({id:"search_clear"})})}),g.jsx("button",{className:"search",onClick:c,children:g.jsx(xt,{children:l.formatMessage({id:"search_cta"})})})]})})})},tE=async({ref:e,validateEmail:t,dispatch:n})=>{const r=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;if(!e.current.validity.valid||!r.test(e.current.value))return n([{type:"validFields.email",value:!1}]);const i=e.current.value.toString().toLowerCase().trim(),a={valid:!1,autoApproved:!1,exists:{auth:!1,engagement:!1,registration:!1,user:!1}};let o=Object.assign({},a);try{o=await t(i),o===void 0&&(o=a)}catch{return n([{type:"shouldManuallyApprove",value:!0},{type:"emailDetails",value:{email:i,boxType:"nonGov",isEnd2End:!1}},{type:"validFields.email",value:!1}])}const{valid:s=!1,autoApproved:l=!1,exists:u}=o;let c="";return s?c=l?"gov":"nonGov":u.registration?u.engagement&&!u.user?c=u.auth?"verify":"pending":c="exists":u.auth&&(c="exists"),n([{type:"shouldDisableButton",value:!1},{type:"shouldManuallyApprove",value:!l},{type:"emailDetails",value:{email:i,boxType:c,isEnd2End:/testing\+[0-9]+@apolitical.co$/.test(i)}},{type:"validFields.email",value:!0}])},SU=e=>{const t={};for(const n of e.entries())t[n[0]]=n[1];return{name:t.full_name.toString().trim(),email:t.email_address.toString().toLowerCase().trim(),jobTitle:t.job_title,organization:t.organization,bioLink:t.url,optIn:!0,expectation:t.expectation,page:window.location.pathname,"g-recaptcha-response":t["g-recaptcha-response"]}},DU=async({refs:e,dataToSubmit:t,createAccount:n,onSuccess:r,dispatch:i,state:a})=>{if(!e.form||!e.form.current)throw new Error("No refs.form");if(!e.form.current.checkValidity()){e.hiddenValidation&&e.hiddenValidation.current&&e.hiddenValidation.current.click();return}const o=SU(new FormData(e.form.current)),s=Object.assign(o,t);await n(s),sessionStorage.setItem(Sv.SESSION_STORAGE.EMAIL,o.email),r&&r({...o,...a.values}),i([{type:"showSuccessMessage",value:!0}])},OU=({shouldShow:e,placeholders:t,labels:n,functions:{validateEmail:r,resendVerificationCode:i},refs:a,state:o,dispatch:s,dataToSubmit:l,intl:u})=>{const{emailDetails:c}=o,d=(h,m)=>{h.current&&o.validFields[m]!==h.current.validity.valid&&s([{type:`validFields.${m}`,value:h.current.validity.valid}])},f=[{id:"full_name",type:"text",inputRef:a.name,placeholder:u.formatMessage({id:"signup_full_name_placeholder"}),functions:{onChange:()=>d(a.name,"name"),onFocus:()=>s([{type:"loadRecaptcha",value:!0}])},autoComplete:"name",validation:[{condition:"required"},{condition:"no-numbers"}],"data-testid":"signup-name-input"},{id:"email_address",type:"email",inputRef:a.email,placeholder:u.formatMessage({id:"signup_email_address_placeholder"}),"aria-describedby":"email-helper-textbox",functions:{onBlur:()=>{tE({ref:a.email,validateEmail:r,dispatch:s})},onChange:(h,m)=>{s([{type:"shouldDisableButton",value:!0}]),m&&m({type:"updateValue",payload:{key:"terms",value:!1}})},onFocus:()=>s([{type:"loadRecaptcha",value:!0}])},autoComplete:"email",validation:[{condition:"required"},{condition:"valid-email"}],"data-testid":"signup-email-input"},{component:Y3,props:{email:c.email,type:c.boxType,resendVerificationCode:i}}];return o.shouldManuallyApprove&&(f.push({id:"job_title",type:"text",inputRef:a.jobTitle,placeholder:u.formatMessage({id:"signup_job_title_placeholder"}),functions:{onChange:()=>d(a.jobTitle,"jobTitle")},validation:[{condition:"required"}],"data-testid":"signup-job-input"},{id:"organization",type:"text",inputRef:a.organisation,placeholder:u.formatMessage({id:"signup_organization_placeholder"}),functions:{onChange:()=>{d(a.organisation,"organisation")}},validation:[{condition:"required"}],autoComplete:"organization","data-testid":"signup-org-input"}),e.url&&f.push({id:"url",type:"text",label:u.formatMessage({id:"signup_url"},{small:h=>g.jsx("small",{children:h})}),placeholder:u.formatMessage({id:"signup_url_placeholder"}),validation:[{condition:"valid-url"}],"data-testid":"signup-url-input"})),e.expectation&&f.push({id:"expectation",className:"expectation",type:"text",label:(n==null?void 0:n.expectation)||u.formatMessage({id:"signup_expectation"},{small:h=>g.jsx("small",{className:"notes text-small",children:h})}),placeholder:(t==null?void 0:t.expectation)||u.formatMessage({id:"signup_expectation_placeholder"}),"data-testid":"signup-events-question"}),f.push({id:"terms",className:"text-small",type:"checkbox",inputRef:a.tc,label:u.formatMessage({id:"signup_terms"},{terms:h=>g.jsx("a",{href:"https://about.apolitical.co/terms-and-conditions","data-gtm-event-context":"SignupForm","data-gtm-event-type":"terms-of-service-click",className:"gtm-trackable",children:h}),privacy:h=>g.jsx("a",{href:"https://about.apolitical.co/privacy-policy","data-gtm-event-context":"SignupForm","data-gtm-event-type":"privacy-policy-click",className:"gtm-trackable",children:h})}),shownValue:"accepted",functions:{onChange:h=>{if(!h)return;const m=[];["name","email"].forEach(p=>{o.validFields[p]!==a[p].current.validity.valid&&(m.push({type:`validFields.${p}`,value:a[p].current.validity.valid}),p==="email"&&tE({ref:a.email,validateEmail:r,dispatch:s}))}),m.length&&s(m)}},validation:[{condition:"required"}],"data-testid":"signup-terms-checkbox"}),f};const NU=({className:e=""})=>g.jsxs("div",{className:ee("success-message",e),"data-testid":"success-message",children:[g.jsx("p",{className:"success-title",children:g.jsx(me.FormattedMessage,{id:"signup_success_title"})}),g.jsx(me.FormattedMessage,{id:"signup_success_text",values:{p:t=>g.jsx("p",{children:t})}})]});const IU={validFields:{name:!1,email:!1,jobTitle:!1,organisation:!1},emailDetails:{email:"",boxType:"",isEnd2End:!1},shouldManuallyApprove:!1,shouldDisableButton:!0,loadRecaptcha:!1,showSuccessMessage:!1,showError:!1},PU=({className:e="",labels:t={},placeholders:n={},functions:r={validateEmail:()=>Promise.resolve(),createAccount:()=>Promise.resolve(),handleError:()=>{},resendVerificationCode:()=>Promise.resolve()},shouldShow:i={},submitButton:a,dataToSubmit:o={ref:"sign-up-form"},...s})=>{const l=me.useIntl(),u=window.location.pathname.includes("/signup")?"/login":`/login?returnTo=${window.location.pathname}`,{title:c=!0,expectation:d=!1,url:f=!0,logInButton:h=!0,successMessage:m=!0}=i,p={title:c,expectation:d,url:f,logInButton:h,successMessage:m},[y,v]=E.useReducer(Rl,IU),{validFields:b,emailDetails:_,shouldManuallyApprove:T,shouldDisableButton:C,showSuccessMessage:x,showError:w}=y,[P,O]=wv.useCookies(["signup-this-session","functional-cookie-consent"]),M={form:E.createRef(),name:E.createRef(),email:E.createRef(),jobTitle:E.createRef(),organisation:E.createRef(),tc:E.createRef(),hiddenValidation:E.createRef()};E.useEffect(()=>{T===!0&&M.jobTitle.current&&M.jobTitle.current.focus()},[T]),E.useEffect(()=>{P["signup-this-session"]&&v([{type:"showSuccessMessage",value:!0}])},[P]),E.useEffect(()=>{x&&P["functional-cookie-consent"]&&O("signup-this-session","true",{path:"/",maxAge:3600})},[x]);const R=E.useMemo(()=>OU({placeholders:n,labels:t,shouldShow:p,functions:r,refs:M,state:y,dispatch:v,dataToSubmit:o,intl:l}),[o,r,l,M,p,y]),D=C?!0:T?!Object.values(b).every(S=>S===!0):!b.name||!b.email||["exists","pending","verify"].includes(_.boxType);return p.successMessage&&x?g.jsx(NU,{className:e}):g.jsxs("fieldset",{className:ee("signup-form-fieldset",e),"data-testid":"signup-form",children:[p.title&&g.jsx("p",{className:"signup-title",children:g.jsx(me.FormattedMessage,{id:"signup_title"})}),w&&g.jsx(Ui,{variant:"error",text:l.formatMessage({id:"signup_error"})}),g.jsx(Zi,{className:"signup-form",formRef:M.form,id:"sign-up-form",fields:R,intlPath:"signup",button:{variant:"primary",size:"medium",text:a||l.formatMessage({id:"signup_button_join"}),disabled:D?{isClickable:!0}:!1,styling:{fullWidth:!0},"data-testid":"signup-button"},secondaryActionButton:{className:"login-button",styling:{fullWidth:!0},variant:"tertiary",size:"medium",href:u,"data-gtm-event-context":"SignupForm","data-gtm-event-type":"login-click",text:l.formatMessage({id:"signup_button_login"})},meta:{shouldReset:!1,showRequiredLabels:!1,shouldShowCancelButton:p.logInButton},gtm:{context:"SignupForm",event:"signup-submit-click"},functions:{onSuccess:async()=>{await DU({refs:M,dataToSubmit:o,createAccount:r.createAccount,onSuccess:r.onSuccess,dispatch:v,state:y})},onCatch:S=>{r.handleError(S),v([{type:"showSuccessMessage",value:!1},{type:"showError",value:!0}])}}}),g.jsx("button",{className:"validation-button",ref:M.hiddenValidation})]})};const mo=({children:e,className:t="",styling:n={},...r})=>{const{background:i="default",padding:a="none"}=n;return g.jsx("section",{className:ee("full-width-section",t,{[i]:i!=="default",[a]:a!=="none"}),...r,children:e})};const RU=({text:e,buttons:t,className:n=""})=>{const r=[];return t.forEach(i=>{r.push({href:i.link,variant:"secondary",size:{mobile:"medium",1024:"large"},className:"gtm-trackable new","data-gtm-event-type":"download-click","data-gtm-event-context":i.eventContext||"Download",target:"_blank",children:i.text})}),g.jsx(mo,{className:ee("download-section",n),styling:{background:"dark"},children:g.jsxs("div",{className:"content-default",children:[E.createElement(typeof e=="string"?"h2":e.element,{className:"text"},typeof e=="string"?e:e.text),g.jsx(Fl,{buttons:r})]})})};const Og="editSection_";function Iw({href:e,setShowModal:t}){typeof e!="string"&&t(!0)}const FU=({icon:e,description:t,ctaMessage:n,href:r,showEditButton:i,setShowModal:a})=>{const{formatMessage:o}=me.useIntl();return g.jsxs(Er,{variant:"muted",icon:e,children:[g.jsx("p",{children:t||o({id:`${Og}placeholder_description`})}),i&&g.jsx("p",{children:g.jsx(Ke,{href:r,variant:"secondary",size:"small",onClick:()=>Iw({href:r,setShowModal:a}),children:n||o({id:`${Og}placeholder_cta`})})})]})},MU=({children:e,className:t="",formProps:n,formComponent:r,href:i,title:a,showTitle:o=!0,modalTitle:s,placeholder:l,showDivider:u=!0})=>{const{formatMessage:c}=me.useIntl(),[d,f]=E.useState(!1),h=()=>f(!1),m=!!n||!!r,p=typeof i=="string"||m;let y;return r&&(y=E.cloneElement(r,{functions:{...r.props.functions,onSuccess:async v=>{try{r.props.functions.onSuccess&&await r.props.functions.onSuccess(v)}finally{h()}},onCancel:()=>{r.props.functions.onCancel&&r.props.functions.onCancel(),h()}}})),g.jsxs("section",{className:ee("edit-section",t),children:[m&&g.jsx(Sa,{title:s||`Edit ${a}`,isOpen:d,showDivider:!1,showIcon:!1,functions:{onClose:h},className:ee("edit-section-modal"),children:y||(n?g.jsx(Zi,{...n,fields:n.fields,meta:{...n==null?void 0:n.meta,shouldShowCancelButton:!0,shouldReset:!1,showSuccessMessage:!0},functions:{...n==null?void 0:n.functions,onSuccess:async v=>{var b,_;(b=n==null?void 0:n.functions)!=null&&b.onSuccess&&await((_=n==null?void 0:n.functions)==null?void 0:_.onSuccess(v)),f(!1)},onCancel:h}}):g.jsx(g.Fragment,{}))}),g.jsxs("div",{className:ee("edit-section-header",{"no-title":!o}),children:[o&&g.jsx("h2",{className:"edit-section-header-title",children:a}),p&&g.jsx(Ke,{href:i,variant:"tertiary",size:"small",icon:"pencil",onClick:()=>Iw({href:i,setShowModal:f}),children:c({id:`${Og}edit`})})]}),e||g.jsx(FU,{...l,href:i,setShowModal:f,showEditButton:p}),u&&g.jsx(fi,{})]})};const BU=({title:e=!1,text:t,logos:n=[],styling:r={},className:i=""})=>{const a=n.length;if(a===0)return null;const o={element:typeof e=="object"?e.element:"h2",text:typeof e=="string"?e:typeof e=="object"?e.text:"",className:typeof e=="object"?e.className:""},{wrapLogos:s=!1,align:l="center",display:u="block"}=r;return g.jsxs("div",{className:ee("logos",i,`align-${l}`,{[u]:u!=="block","wrap-logos":s}),children:[e&&E.createElement(o.element,{className:ee("title",o.className)},o.text),t&&g.jsx("p",{children:t}),g.jsx("ul",{className:ee({"two-col":a===2||a===4,"three-col":a===5||a<=10&&a%3===0}),children:n.map(({logo:c,nameOfBusiness:d,link:f=!1,description:h=!1},m)=>{if(!c||!c.url)return null;const p=g.jsx("img",{src:c.url,width:c.width||"auto",height:c.height||"auto",alt:d});return g.jsxs("li",{children:[g.jsx("p",{className:"img-wrapper",children:f?g.jsx("a",{href:f,target:"_blank",rel:"nofollow noreferrer noopener",children:p}):p}),h&&g.jsx("small",{children:h})]},window.btoa(`${c.url}_${m}`))})})]})};let bm;const Em="contactFooter_",LU=({onSuccess:e=async()=>{},onFailure:t=()=>{}})=>{const n=E.useRef(null),[r,i]=E.useState(0),[a,o]=E.useState(!1),s=()=>{n.current&&i(n.current.clientHeight)},l=()=>{a||(o(!0),clearTimeout(bm),bm=setTimeout(()=>{s(),o(!1)},500))};return E.useEffect(()=>(s(),window.addEventListener("resize",l),()=>{clearTimeout(bm),window.removeEventListener("resize",l)}),[]),g.jsx(mo,{id:"contactForm",className:"contact-footer",children:g.jsxs("div",{className:"inner-wrapper",children:[g.jsx("h2",{children:g.jsx(me.FormattedMessage,{id:`${Em}title`})}),g.jsxs("div",{className:"content-wrapper",ref:n,"data-testid":"content-wrapper",style:a?{}:{minHeight:r},children:[g.jsxs("aside",{children:[g.jsx("p",{children:g.jsx(me.FormattedMessage,{id:`${Em}text`})}),g.jsx(fo,{className:"mailto-link",href:"mailto:hello@apolitical.co",children:g.jsx(me.FormattedMessage,{id:`${Em}email`})})]}),g.jsx(kw,{functions:{onSuccess:e,onFailure:t},gtm:{context:"FooterContactUsForm",event:"contact-form-submit-click"}})]})]})})},$U=({activeLink:e,profile:t,...n})=>g.jsx(mo,{children:g.jsx(K3,{layout:"1-3",children:g.jsxs(g.Fragment,{children:[g.jsx(W3,{activeLink:e,profile:t}),g.jsx(d3,{...n})]})})});const _m="cookieBanner_",Tm=["apol-cookie-banner","apolitical-performance-cookie-consent","functional-cookie-consent"],Cm=new Date(Date.now()+12*30*24*60*60*1e3),Pw=()=>{const e=me.useIntl(),[t,n,r]=wv.useCookies(Tm),[i,a]=E.useState(!t["apol-cookie-banner"]),o=()=>{Tm.forEach(c=>{n(c,!0,{path:"/",expires:Cm,domain:c==="apolitical-performance-cookie-consent"?".apolitical.co":void 0})}),a(!1),window.location.reload()},s=()=>{n("apol-cookie-banner",!0,{path:"/",expires:Cm}),Tm.forEach(c=>{if(c==="apol-cookie-banner"){n(c,!0,{path:"/",expires:Cm});return}r(c)}),a(!1)};if(!i)return null;const l=[{id:"settings",href:"/pages/cookie-policy",gtmType:"policy-page"},{id:"reject",onClick:s,gtmType:"reject-all"},{id:"accept",onClick:o,gtmType:"accepted-all"}],u=[];return l.forEach(c=>{u.push({variant:c.href?"tertiary":"primary",href:c.href,onClick:c.onClick,className:"gtm-trackable","data-gtm-event-context":"cookie-banner","data-gtm-event-type":`cookie-${c.gtmType}-click`,children:e.formatMessage({id:`${_m}buttons_${c.id}`})})}),g.jsxs("aside",{id:"cookie-banner",className:"text-medium",children:[g.jsx("h6",{children:e.formatMessage({id:`${_m}title`})}),g.jsx("p",{children:e.formatMessage({id:`${_m}text`})}),g.jsx(Fl,{buttons:u})]})},ga={platform:{order:["events","courses","articles","communities"],events:{href:"/events/",gtmType:"events-click"},courses:{href:"/microcourses/",gtmType:"microcourses-click"},articles:{href:"/solution-articles/",gtmType:"articles-click"},communities:{href:"/communities/",gtmType:"communities-click"}},community:{order:["support","post","join","guidelines"],support:{name:"Support FAQ",href:"/pages/support-faq",gtmType:"support-faq-click"},post:{href:"/pages/post-an-article",gtmType:"post-an-article-click"},join:{href:"/pages/who-can-join-the-community",gtmType:"who-can-join-click"},guidelines:{href:"/pages/values-and-guidelines",gtmType:"guidelines-and-values-click"}},company:{order:["news","insights","story","team","careers","partner","contact"],news:{href:"/learning-hub/updates/",gtmType:"news-click"},insights:{href:"/learning-hub/global-insights/",gtmType:"insights-click"},story:{href:"/pages/our-story",gtmType:"our-story-click"},team:{href:"/pages/meet-our-team",gtmType:"team-click"},careers:{href:"/pages/careers",gtmType:"careers-click"},partner:{href:"/partnerships/",gtmType:"partner-with-us-click"},contact:{href:"/pages/get-in-touch",gtmType:"contact-click"},child:"legal"},legal:{order:["privacy","terms","cookie","accessibility","ai"],privacy:{href:"https://about.apolitical.co/privacy-policy",gtmType:"privacy-policy-link"},terms:{href:"https://about.apolitical.co/terms-and-conditions",gtmType:"terms-conditions-link"},cookie:{href:"/pages/cookie-policy",gtmType:"cookie-policy-link"},ai:{href:"/pages/ai-principles",gtmType:"ai-principles-link"},accessibility:{href:"/pages/accessibility-statement",gtmType:"accessibility-link"},text:{order:["dataProtection","euDataProtection"],dataProtection:{email:zs["data-protection"].default,gtmType:"email-dpo-link"},euDataProtection:{email:zs["data-protection"].eu,gtmType:"email-eu-dpo-link"}}},contact:{text:{order:["london","washington","berlin","registered","support","business"],london:{address:!0},washington:{address:!0},registered:{address:!0},berlin:{address:!0},support:{email:zs.support,gtmType:"concierge-email-click"},business:{email:zs.general,gtmType:"hello-email-click"}}},social:{order:["linkedin","twitter","facebook"],linkedin:{href:"https://www.linkedin.com/company/apolitical"},twitter:{href:"https://twitter.com/apoliticalco"},facebook:{href:"https://www.facebook.com/apoliticalco"}}};const Ys="footer_",Sf="SiteFooter",nE=({group:e})=>{const t=ga[e].order||[];let n=!1;return"text"in ga[e]&&(n=ga[e].text),g.jsxs(E.Fragment,{children:[g.jsx("p",{className:"pre-title",children:g.jsx(me.FormattedMessage,{id:`${Ys}${e}`})}),Array.isArray(t)&&t.length>0&&g.jsx("ul",{className:"text-medium",children:t.map(r=>{if(["order","child","text"].includes(r))return null;const{href:i,gtmType:a}=ga[e][r],o={};return["legal"].includes(e)&&(o.target="_blank",o.rel="noopener"),g.jsx("li",{children:g.jsx("a",{href:i,className:"gtm-trackable","data-gtm-event-context":Sf,"data-gtm-event-type":a,...o,children:g.jsx(me.FormattedMessage,{id:`${Ys}${e}_${r}`})})},`${e}_${r}`)})}),typeof n!="boolean"&&"order"in n&&Array.isArray(n.order)&&g.jsx("dl",{className:"text-medium",children:n.order.map(r=>g.jsxs(E.Fragment,{children:[g.jsx("dt",{children:g.jsx(me.FormattedMessage,{id:`${Ys}${e}_${r}`})}),g.jsxs("dd",{children:[typeof n!="boolean"&&n[r].address&&g.jsx("address",{children:g.jsx(me.FormattedMessage,{id:`${Ys}${e}_${r}_address`,values:{br:g.jsx("br",{})}})}),typeof n!="boolean"&&n[r].email&&g.jsx("a",{href:`mailto:${n[r].email}`,className:"gtm-trackable","data-gtm-event-context":Sf,"data-gtm-event-type":n[r].gtmType,children:n[r].email})]})]},`dl-${e}-${r}`))})]},e)},Sy=()=>g.jsx("div",{id:"footer",children:g.jsxs("div",{className:"wrapper",children:[g.jsx(mh,{element:"hr"}),g.jsx(Xv,{variant:"inverted",version:"full",className:"gtm-trackable","data-gtm-event-context":Sf,"data-gtm-event-type":"logo-homepage-link"}),g.jsx("footer",{children:["platform","community","company","contact"].map(e=>g.jsxs("div",{className:"group",children:[g.jsx(nE,{group:e}),Object.keys(ga[e]).includes("child")&&g.jsx(nE,{group:ga[e].child})]},e))}),g.jsx("hr",{}),g.jsxs("div",{className:"sub-footer",children:[g.jsx("ul",{children:Array.isArray(ga.social.order)&&ga.social.order.map(e=>{const t=ga.social[e];return g.jsx("li",{className:e,children:g.jsx("a",{href:t.href,target:"_blank",rel:"noopener noreferrer",className:"gtm-trackable","data-gtm-event-context":Sf,"data-gtm-event-type":"social-click",children:g.jsx("span",{className:"hidden",children:g.jsx(me.FormattedMessage,{id:`${Ys}social_${e}`})})})},e)})}),g.jsx("small",{children:g.jsx(me.FormattedMessage,{id:`${Ys}copyright`,values:{currentYear:new Date().getFullYear()}})})]})]})});var jU=Object.defineProperty,HU=Object.defineProperties,UU=Object.getOwnPropertyDescriptors,Df=Object.getOwnPropertySymbols,Rw=Object.prototype.hasOwnProperty,Fw=Object.prototype.propertyIsEnumerable,Mw=e=>{throw TypeError(e)},rE=(e,t,n)=>t in e?jU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ye=(e,t)=>{for(var n in t||(t={}))Rw.call(t,n)&&rE(e,n,t[n]);if(Df)for(var n of Df(t))Fw.call(t,n)&&rE(e,n,t[n]);return e},an=(e,t)=>HU(e,UU(t)),Dy=(e,t)=>{var n={};for(var r in e)Rw.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Df)for(var r of Df(e))t.indexOf(r)<0&&Fw.call(e,r)&&(n[r]=e[r]);return n},Oy=(e,t,n)=>t.has(e)||Mw("Cannot "+n),oe=(e,t,n)=>(Oy(e,t,"read from private field"),n?n.call(e):t.get(e)),Ge=(e,t,n)=>t.has(e)?Mw("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Qe=(e,t,n,r)=>(Oy(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Of=(e,t,n)=>(Oy(e,t,"access private method"),n),Ve=(e,t,n)=>new Promise((r,i)=>{var a=l=>{try{s(n.next(l))}catch(u){i(u)}},o=l=>{try{s(n.throw(l))}catch(u){i(u)}},s=l=>l.done?r(l.value):Promise.resolve(l.value).then(a,o);s((n=n.apply(e,t)).next())});function Bw(e){return{all:e=e||new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map(function(i){i(n)}),(r=e.get("*"))&&r.slice().map(function(i){i(t,n)})}}}const Vi=Object.create(null);Vi.open="0";Vi.close="1";Vi.ping="2";Vi.pong="3";Vi.message="4";Vi.upgrade="5";Vi.noop="6";const Od=Object.create(null);Object.keys(Vi).forEach(e=>{Od[Vi[e]]=e});const Ng={type:"error",data:"parser error"},Lw=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",$w=typeof ArrayBuffer=="function",jw=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Dh=({type:e,data:t},n,r)=>Lw&&t instanceof Blob?n?r(t):iE(t,r):$w&&(t instanceof ArrayBuffer||jw(t))?n?r(t):iE(new Blob([t]),r):r(Vi[e]+(t||"")),iE=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function aE(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let xm;function zU(e,t){if(Lw&&e.data instanceof Blob)return e.data.arrayBuffer().then(aE).then(t);if($w&&(e.data instanceof ArrayBuffer||jw(e.data)))return t(aE(e.data));Dh(e,!1,n=>{xm||(xm=new TextEncoder),t(xm.encode(n))})}const oE="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Pu=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<oE.length;e++)Pu[oE.charCodeAt(e)]=e;const VU=e=>{let t=e.length*.75,n=e.length,r,i=0,a,o,s,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),c=new Uint8Array(u);for(r=0;r<n;r+=4)a=Pu[e.charCodeAt(r)],o=Pu[e.charCodeAt(r+1)],s=Pu[e.charCodeAt(r+2)],l=Pu[e.charCodeAt(r+3)],c[i++]=a<<2|o>>4,c[i++]=(o&15)<<4|s>>2,c[i++]=(s&3)<<6|l&63;return u},qU=typeof ArrayBuffer=="function",Oh=(e,t)=>{if(typeof e!="string")return{type:"message",data:Hw(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:WU(e.substring(1),t)}:Od[n]?e.length>1?{type:Od[n],data:e.substring(1)}:{type:Od[n]}:Ng},WU=(e,t)=>{if(qU){const n=VU(e);return Hw(n,t)}else return{base64:!0,data:e}},Hw=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},Uw=String.fromCharCode(30),zw=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((a,o)=>{Dh(a,!1,s=>{r[o]=s,++i===n&&t(r.join(Uw))})})},Vw=(e,t)=>{const n=e.split(Uw),r=[];for(let i=0;i<n.length;i++){const a=Oh(n[i],t);if(r.push(a),a.type==="error")break}return r};function qw(){return new TransformStream({transform(e,t){zU(e,n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const a=new DataView(i.buffer);a.setUint8(0,126),a.setUint16(1,r)}else{i=new Uint8Array(9);const a=new DataView(i.buffer);a.setUint8(0,127),a.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}let wm;function O1(e){return e.reduce((t,n)=>t+n.length,0)}function N1(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function Ww(e,t){wm||(wm=new TextDecoder);const n=[];let r=0,i=-1,a=!1;return new TransformStream({transform(o,s){for(n.push(o);;){if(r===0){if(O1(n)<1)break;const l=N1(n,1);a=(l[0]&128)===128,i=l[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(O1(n)<2)break;const l=N1(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(O1(n)<8)break;const l=N1(n,8),u=new DataView(l.buffer,l.byteOffset,l.length),c=u.getUint32(0);if(c>Math.pow(2,53-32)-1){s.enqueue(Ng);break}i=c*Math.pow(2,32)+u.getUint32(4),r=3}else{if(O1(n)<i)break;const l=N1(n,i);s.enqueue(Oh(a?l:wm.decode(l),t)),r=0}if(i===0||i>e){s.enqueue(Ng);break}}}})}const Nh=4;function Jt(e){if(e)return KU(e)}function KU(e){for(var t in Jt.prototype)e[t]=Jt.prototype[t];return e}Jt.prototype.on=Jt.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Jt.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};Jt.prototype.off=Jt.prototype.removeListener=Jt.prototype.removeAllListeners=Jt.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this};Jt.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this};Jt.prototype.emitReserved=Jt.prototype.emit;Jt.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Jt.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Br=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function Kw(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const GU=Br.setTimeout,YU=Br.clearTimeout;function Ih(e,t){t.useNativeTimers?(e.setTimeoutFn=GU.bind(Br),e.clearTimeoutFn=YU.bind(Br)):(e.setTimeoutFn=Br.setTimeout.bind(Br),e.clearTimeoutFn=Br.clearTimeout.bind(Br))}const ZU=1.33;function QU(e){return typeof e=="string"?XU(e):Math.ceil((e.byteLength||e.size)*ZU)}function XU(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function JU(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function ez(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let a=n[r].split("=");t[decodeURIComponent(a[0])]=decodeURIComponent(a[1])}return t}let tz=class extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}},Ny=class extends Jt{constructor(t){super(),this.writable=!1,Ih(this,t),this.opts=t,this.query=t.query,this.socket=t.socket}onError(t,n,r){return super.emitReserved("error",new tz(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=Oh(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=JU(t);return n.length?"?"+n:""}};const Gw="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Ig=64,nz={};let sE=0,I1=0,lE;function uE(e){let t="";do t=Gw[e%Ig]+t,e=Math.floor(e/Ig);while(e>0);return t}function Yw(){const e=uE(+new Date);return e!==lE?(sE=0,lE=e):e+"."+uE(sE++)}for(;I1<Ig;I1++)nz[Gw[I1]]=I1;let Zw=!1;try{Zw=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const rz=Zw;function Qw(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||rz))return new XMLHttpRequest}catch{}if(!t)try{return new Br[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function iz(){}const az=function(){return new Qw({xdomain:!1}).responseType!=null}();let oz=class extends Ny{constructor(t){if(super(t),this.polling=!1,typeof location<"u"){const r=location.protocol==="https:";let i=location.port;i||(i=r?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||i!==t.port}const n=t&&t.forceBase64;this.supportsBinary=az&&!n,this.opts.withCredentials&&(this.cookieJar=void 0)}get name(){return"polling"}doOpen(){this.poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this.polling||!this.writable){let r=0;this.polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};Vw(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,zw(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=Yw()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}request(t={}){return Object.assign(t,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new nl(this.uri(),t)}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,a)=>{this.onError("xhr post error",i,a)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}},nl=class Nd extends Jt{constructor(t,n){super(),Ih(this,n),this.opts=n,this.method=n.method||"GET",this.uri=t,this.data=n.data!==void 0?n.data:null,this.create()}create(){var t;const n=Kw(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this.opts.xd;const r=this.xhr=new Qw(n);try{r.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this.opts.extraHeaders[i])}}catch{}if(this.method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this.opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(r.timeout=this.opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this.opts.cookieJar)===null||i===void 0||i.parseCookies(r)),r.readyState===4&&(r.status===200||r.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof r.status=="number"?r.status:0)},0))},r.send(this.data)}catch(i){this.setTimeoutFn(()=>{this.onError(i)},0);return}typeof document<"u"&&(this.index=Nd.requestsCount++,Nd.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=iz,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete Nd.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}};nl.requestsCount=0;nl.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",cE);else if(typeof addEventListener=="function"){const e="onpagehide"in Br?"pagehide":"unload";addEventListener(e,cE,!1)}}function cE(){for(let e in nl.requests)nl.requests.hasOwnProperty(e)&&nl.requests[e].abort()}const Iy=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0))(),P1=Br.WebSocket||Br.MozWebSocket,dE=!0,sz="arraybuffer",fE=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";let lz=class extends Ny{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),n=this.opts.protocols,r=fE?{}:Kw(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=dE&&!fE?n?new P1(t,n):new P1(t):new P1(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;Dh(r,this.supportsBinary,a=>{const o={};try{dE&&this.ws.send(a)}catch{}i&&Iy(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=Yw()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}check(){return!!P1}},uz=class extends Ny{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(t=>{const n=Ww(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=qw();i.readable.pipeTo(t.writable),this.writer=i.writable.getWriter();const a=()=>{r.read().then(({done:s,value:l})=>{s||(this.onPacket(l),a())}).catch(s=>{})};a();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this.writer.write(o).then(()=>this.onOpen())})}))}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;this.writer.write(r).then(()=>{i&&Iy(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this.transport)===null||t===void 0||t.close()}};const cz={websocket:lz,webtransport:uz,polling:oz},dz=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,fz=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Pg(e){if(e.length>2e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=dz.exec(e||""),a={},o=14;for(;o--;)a[fz[o]]=i[o]||"";return n!=-1&&r!=-1&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=hz(a,a.path),a.queryKey=pz(a,a.query),a}function hz(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function pz(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,a){i&&(n[i]=a)}),n}let Xw=class Fs extends Jt{constructor(t,n={}){super(),this.binaryType=sz,this.writeBuffer=[],t&&typeof t=="object"&&(n=t,t=null),t?(t=Pg(t),n.hostname=t.host,n.secure=t.protocol==="https"||t.protocol==="wss",n.port=t.port,t.query&&(n.query=t.query)):n.host&&(n.hostname=Pg(n.host).host),Ih(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=ez(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=Nh,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new cz[t](r)}open(){let t;if(this.opts.rememberUpgrade&&Fs.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else t=this.transports[0];this.readyState="opening";try{t=this.createTransport(t)}catch{this.transports.shift(),this.open();return}t.open(),this.setTransport(t)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(t){let n=this.createTransport(t),r=!1;Fs.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",d=>{if(!r)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Fs.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(c(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const f=new Error("probe error");f.transport=n.name,this.emitReserved("upgradeError",f)}}))};function a(){r||(r=!0,c(),n.close(),n=null)}const o=d=>{const f=new Error("probe error: "+d);f.transport=n.name,a(),this.emitReserved("upgradeError",f)};function s(){o("transport closed")}function l(){o("socket closed")}function u(d){n&&d.name!==n.name&&a()}const c=()=>{n.removeListener("open",i),n.removeListener("error",o),n.removeListener("close",s),this.off("close",l),this.off("upgrading",u)};n.once("open",i),n.once("error",o),n.once("close",s),this.once("close",l),this.once("upgrading",u),this.upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onOpen(){if(this.readyState="open",Fs.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let t=0;const n=this.upgrades.length;for(;t<n;t++)this.probe(this.upgrades[t])}}onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),this.resetPingTimeout(),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const n=new Error("server error");n.code=t.data,this.onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this.getWritablePackets();this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=QU(i)),r>0&&n>this.maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}write(t,n,r){return this.sendPacket("message",t,n,r),this}send(t,n,r){return this.sendPacket("message",t,n,r),this}sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const a={type:t,data:n,options:r};this.emitReserved("packetCreate",a),this.writeBuffer.push(a),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this.onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}onError(t){Fs.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const n=[];let r=0;const i=t.length;for(;r<i;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}};Xw.protocol=Nh;function mz(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=Pg(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const a=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+a+":"+r.port+t,r.href=r.protocol+"://"+a+(n&&n.port===r.port?"":":"+r.port),r}const gz=typeof ArrayBuffer=="function",vz=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Jw=Object.prototype.toString,yz=typeof Blob=="function"||typeof Blob<"u"&&Jw.call(Blob)==="[object BlobConstructor]",bz=typeof File=="function"||typeof File<"u"&&Jw.call(File)==="[object FileConstructor]";function Py(e){return gz&&(e instanceof ArrayBuffer||vz(e))||yz&&e instanceof Blob||bz&&e instanceof File}function Id(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Id(e[n]))return!0;return!1}if(Py(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Id(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Id(e[n]))return!0;return!1}function Ez(e){const t=[],n=e.data,r=e;return r.data=Rg(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Rg(e,t){if(!e)return e;if(Py(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Rg(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Rg(e[r],t));return n}return e}function _z(e,t){return e.data=Fg(e.data,t),delete e.attachments,e}function Fg(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Fg(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Fg(e[n],t));return e}const Tz=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],Cz=5;var et;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(et||(et={}));class xz{constructor(t){this.replacer=t}encode(t){return(t.type===et.EVENT||t.type===et.ACK)&&Id(t)?this.encodeAsBinary({type:t.type===et.EVENT?et.BINARY_EVENT:et.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===et.BINARY_EVENT||t.type===et.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=Ez(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function hE(e){return Object.prototype.toString.call(e)==="[object Object]"}class Ry extends Jt{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===et.BINARY_EVENT;r||n.type===et.BINARY_ACK?(n.type=r?et.EVENT:et.ACK,this.reconstructor=new wz(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Py(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(et[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===et.BINARY_EVENT||r.type===et.BINARY_ACK){const a=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const o=t.substring(a,n);if(o!=Number(o)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(o)}if(t.charAt(n+1)==="/"){const a=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(a,n)}else r.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const a=n+1;for(;++n;){const o=t.charAt(n);if(o==null||Number(o)!=o){--n;break}if(n===t.length)break}r.id=Number(t.substring(a,n+1))}if(t.charAt(++n)){const a=this.tryParse(t.substr(n));if(Ry.isPayloadValid(r.type,a))r.data=a;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case et.CONNECT:return hE(n);case et.DISCONNECT:return n===void 0;case et.CONNECT_ERROR:return typeof n=="string"||hE(n);case et.EVENT:case et.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&Tz.indexOf(n[0])===-1);case et.ACK:case et.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class wz{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=_z(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const e7=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Ry,Encoder:xz,get PacketType(){return et},protocol:Cz},Symbol.toStringTag,{value:"Module"}));function si(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const Az=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});let t7=class extends Jt{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[si(t,"open",this.onopen.bind(this)),si(t,"packet",this.onpacket.bind(this)),si(t,"error",this.onerror.bind(this)),si(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){if(Az.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const r={type:et.EVENT,data:n};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const o=this.ids++,s=n.pop();this._registerAckCallback(o,s),r.id=o}const i=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!i||!this.connected)||(this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const a=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let o=0;o<this.sendBuffer.length;o++)this.sendBuffer[o].id===t&&this.sendBuffer.splice(o,1);n.call(this,new Error("operation has timed out"))},i);this.acks[t]=(...o)=>{this.io.clearTimeoutFn(a),n.apply(this,[null,...o])}}emitWithAck(t,...n){const r=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((i,a)=>{n.push((o,s)=>r?o?a(o):i(s):i(o)),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...a)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...a)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:et.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n)}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case et.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case et.EVENT:case et.BINARY_EVENT:this.onevent(t);break;case et.ACK:case et.BINARY_ACK:this.onack(t);break;case et.DISCONNECT:this.ondisconnect();break;case et.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:et.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(n.apply(this,t.data),delete this.acks[t.id])}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:et.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}};function jl(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}jl.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};jl.prototype.reset=function(){this.attempts=0};jl.prototype.setMin=function(e){this.ms=e};jl.prototype.setMax=function(e){this.max=e};jl.prototype.setJitter=function(e){this.jitter=e};let Mg=class extends Jt{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Ih(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new jl({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||e7;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new Xw(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=si(n,"open",function(){r.onopen(),t&&t()}),a=s=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",s),t?t(s):this.maybeReconnectOnOpen()},o=si(n,"error",a);if(this._timeout!==!1){const s=this._timeout,l=this.setTimeoutFn(()=>{i(),a(new Error("timeout")),n.close()},s);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(si(t,"ping",this.onping.bind(this)),si(t,"data",this.ondata.bind(this)),si(t,"error",this.onerror.bind(this)),si(t,"close",this.onclose.bind(this)),si(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Iy(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new t7(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,n){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}};const cu={};function Pd(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=mz(e,t.path||"/socket.io"),r=n.source,i=n.id,a=n.path,o=cu[i]&&a in cu[i].nsps,s=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let l;return s?l=new Mg(r,t):(cu[i]||(cu[i]=new Mg(r,t)),l=cu[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(Pd,{Manager:Mg,Socket:t7,io:Pd,connect:Pd});var Co=globalThis&&globalThis.__awaiter||function(e,t,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function s(c){try{u(r.next(c))}catch(d){o(d)}}function l(c){try{u(r.throw(c))}catch(d){o(d)}}function u(c){c.done?a(c.value):i(c.value).then(s,l)}u((r=r.apply(e,t||[])).next())})};const kz="v1",Sz="https://api.novu.co",Dz="@novu/client",Oz="2.0.0-canary.0",Nz=`${Dz}-${Oz}`;class Iz{constructor({apiVersion:t=kz,backendUrl:n=Sz,userAgent:r=Nz}={}){this.apiVersion=t,this.backendUrl=`${n}/${this.apiVersion}`,this.headers={"Content-Type":"application/json","User-Agent":r}}setAuthorizationToken(t){this.headers.Authorization=`Bearer ${t}`}disposeAuthorizationToken(){delete this.headers.Authorization}updateHeaders(t){this.headers=Object.assign(Object.assign({},this.headers),t)}getFullResponse(t,n){return Co(this,void 0,void 0,function*(){return yield(yield this.doFetch(t+this.getQueryString(n))).json()})}get(t,n){return Co(this,void 0,void 0,function*(){return(yield(yield this.doFetch(t+this.getQueryString(n))).json()).data})}post(t,n={}){return Co(this,void 0,void 0,function*(){return(yield(yield this.doFetch(t,{method:"POST",body:JSON.stringify(n)})).json()).data})}patch(t,n={}){return Co(this,void 0,void 0,function*(){return(yield(yield this.doFetch(t,{method:"PATCH",body:JSON.stringify(n)})).json()).data})}delete(t,n={}){return Co(this,void 0,void 0,function*(){return(yield(yield this.doFetch(t,{method:"DELETE",body:JSON.stringify(n)})).json()).data})}getQueryString(t){return t?"?"+new URLSearchParams(t).toString():""}doFetch(t,n={}){return Co(this,void 0,void 0,function*(){try{const r=yield fetch(this.backendUrl+t,Object.assign(Object.assign({},n),{headers:this.headers}));return yield this.checkResponseStatus(r),r}catch(r){throw r}})}checkResponseStatus(t){return Co(this,void 0,void 0,function*(){if(!t.ok){const n=yield t.json();throw new Error(`HTTP error! Status: ${t.status}, Message: ${n.message}`)}})}}globalThis&&globalThis.__awaiter;globalThis&&globalThis.__rest;var Pz=(e,t)=>e===t?!0:!e||!t||e.length!==t.length?!1:e.every((n,r)=>n===t[r]),n7=(e,t)=>Pz(e,t)||!e&&(t==null?void 0:t.length)===0||(e==null?void 0:e.length)===0&&!t,Nf=(e,t)=>n7(e.tags,t.tags)&&e.read===t.read&&e.archived===t.archived,Ms,Rz=class{constructor(){Ge(this,Ms),Qe(this,Ms,Bw())}on(e,t){return oe(this,Ms).on(e,t),()=>{this.off(e,t)}}off(e,t){oe(this,Ms).off(e,t)}emit(e,t){oe(this,Ms).emit(e,t)}};Ms=new WeakMap;var or=class extends Error{constructor(e,t){super(e),this.originalError=t}},Fo,Ru,Fy=class{constructor({inboxServiceInstance:e,eventEmitterInstance:t}){Ge(this,Fo,[]),Ge(this,Ru),this._emitter=t,this._inboxService=e,this._emitter.on("session.initialize.resolved",({error:n,data:r})=>{r?(this.onSessionSuccess(r),oe(this,Fo).forEach(i=>Ve(this,[i],function*({fn:a,resolve:o}){o(yield a())})),Qe(this,Fo,[])):n&&(this.onSessionError(n),Qe(this,Ru,n),oe(this,Fo).forEach(({resolve:i})=>{i({error:new or("Failed to initialize session, please contact the support",n)})}),Qe(this,Fo,[]))})}onSessionSuccess(e){}onSessionError(e){}callWithSession(e){return Ve(this,null,function*(){return this._inboxService.isSessionInitialized?e():oe(this,Ru)?Promise.resolve({error:new or("Failed to initialize session, please contact the support",oe(this,Ru))}):new Promise((t,n)=>{oe(this,Fo).push({fn:e,resolve:t,reject:n})})})}};Fo=new WeakMap;Ru=new WeakMap;var mr,ni,Gr=class{constructor(t,n,r){Ge(this,mr),Ge(this,ni),Qe(this,mr,n),Qe(this,ni,r),this.id=t.id,this.subject=t.subject,this.body=t.body,this.to=t.to,this.isRead=t.isRead,this.isArchived=t.isArchived,this.createdAt=t.createdAt,this.readAt=t.readAt,this.archivedAt=t.archivedAt,this.avatar=t.avatar,this.primaryAction=t.primaryAction,this.secondaryAction=t.secondaryAction,this.channelType=t.channelType,this.tags=t.tags,this.redirect=t.redirect,this.data=t.data}read(){return r7({emitter:oe(this,mr),apiService:oe(this,ni),args:{notification:this}})}unread(){return i7({emitter:oe(this,mr),apiService:oe(this,ni),args:{notification:this}})}archive(){return a7({emitter:oe(this,mr),apiService:oe(this,ni),args:{notification:this}})}unarchive(){return o7({emitter:oe(this,mr),apiService:oe(this,ni),args:{notification:this}})}completePrimary(){if(!this.primaryAction)throw new Error("Primary action is not available");return If({emitter:oe(this,mr),apiService:oe(this,ni),args:{notification:this},actionType:"primary"})}completeSecondary(){if(!this.primaryAction)throw new Error("Secondary action is not available");return If({emitter:oe(this,mr),apiService:oe(this,ni),args:{notification:this},actionType:"secondary"})}revertPrimary(){if(!this.primaryAction)throw new Error("Primary action is not available");return Pf({emitter:oe(this,mr),apiService:oe(this,ni),args:{notification:this},actionType:"primary"})}revertSecondary(){if(!this.primaryAction)throw new Error("Secondary action is not available");return Pf({emitter:oe(this,mr),apiService:oe(this,ni),args:{notification:this},actionType:"secondary"})}on(t,n){const r=oe(this,mr).on(t,n);return()=>{r()}}off(t,n){oe(this,mr).off(t,n)}};mr=new WeakMap;ni=new WeakMap;var r7=e=>Ve(void 0,[e],function*({emitter:t,apiService:n,args:r}){const{notificationId:i,optimisticValue:a}=Hl(r,{isRead:!0,readAt:new Date().toISOString(),isArchived:!1,archivedAt:void 0},{emitter:t,apiService:n});try{t.emit("notification.read.pending",{args:r,data:a});const o=yield n.read(i),s=new Gr(o,t,n);return t.emit("notification.read.resolved",{args:r,data:s}),{data:s}}catch(o){return t.emit("notification.read.resolved",{args:r,error:o}),{error:new or("Failed to read notification",o)}}}),i7=e=>Ve(void 0,[e],function*({emitter:t,apiService:n,args:r}){const{notificationId:i,optimisticValue:a}=Hl(r,{isRead:!1,readAt:null,isArchived:!1,archivedAt:void 0},{emitter:t,apiService:n});try{t.emit("notification.unread.pending",{args:r,data:a});const o=yield n.unread(i),s=new Gr(o,t,n);return t.emit("notification.unread.resolved",{args:r,data:s}),{data:s}}catch(o){return t.emit("notification.unread.resolved",{args:r,error:o}),{error:new or("Failed to unread notification",o)}}}),a7=e=>Ve(void 0,[e],function*({emitter:t,apiService:n,args:r}){const{notificationId:i,optimisticValue:a}=Hl(r,{isArchived:!0,archivedAt:new Date().toISOString(),isRead:!0,readAt:new Date().toISOString()},{emitter:t,apiService:n});try{t.emit("notification.archive.pending",{args:r,data:a});const o=yield n.archive(i),s=new Gr(o,t,n);return t.emit("notification.archive.resolved",{args:r,data:s}),{data:s}}catch(o){return t.emit("notification.archive.resolved",{args:r,error:o}),{error:new or("Failed to archive notification",o)}}}),o7=e=>Ve(void 0,[e],function*({emitter:t,apiService:n,args:r}){const{notificationId:i,optimisticValue:a}=Hl(r,{isArchived:!1,archivedAt:null,isRead:!0,readAt:new Date().toISOString()},{emitter:t,apiService:n});try{t.emit("notification.unarchive.pending",{args:r,data:a});const o=yield n.unarchive(i),s=new Gr(o,t,n);return t.emit("notification.unarchive.resolved",{args:r,data:s}),{data:s}}catch(o){return t.emit("notification.unarchive.resolved",{args:r,error:o}),{error:new or("Failed to unarchive notification",o)}}}),If=e=>Ve(void 0,[e],function*({emitter:t,apiService:n,args:r,actionType:i}){const a=i==="primary"?{primaryAction:an(Ye({},"notification"in r?r.notification.primaryAction:{}),{isCompleted:!0})}:{secondaryAction:an(Ye({},"notification"in r?r.notification.secondaryAction:{}),{isCompleted:!0})},{notificationId:o,optimisticValue:s}=Hl(r,a,{emitter:t,apiService:n});try{t.emit("notification.complete_action.pending",{args:r,data:s});const l=yield n.completeAction({actionType:i,notificationId:o}),u=new Gr(l,t,n);return t.emit("notification.complete_action.resolved",{args:r,data:u}),{data:u}}catch(l){return t.emit("notification.complete_action.resolved",{args:r,error:l}),{error:new or(`Failed to complete ${i} action on the notification`,l)}}}),Pf=e=>Ve(void 0,[e],function*({emitter:t,apiService:n,args:r,actionType:i}){const a=i==="primary"?{primaryAction:an(Ye({},"notification"in r?r.notification.primaryAction:{}),{isCompleted:!1})}:{secondaryAction:an(Ye({},"notification"in r?r.notification.secondaryAction:{}),{isCompleted:!1})},{notificationId:o,optimisticValue:s}=Hl(r,a,{emitter:t,apiService:n});try{t.emit("notification.revert_action.pending",{args:r,data:s});const l=yield n.revertAction({actionType:i,notificationId:o}),u=new Gr(l,t,n);return t.emit("notification.revert_action.resolved",{args:r,data:u}),{data:u}}catch(l){return t.emit("notification.revert_action.resolved",{args:r,error:l}),{error:new or("Failed to fetch notifications",l)}}}),Hl=(e,t,n)=>"notification"in e?{notificationId:e.notification.id,optimisticValue:new Gr(Ye(Ye({},e.notification),t),n.emitter,n.apiService)}:{notificationId:e.notificationId},Fz=e=>Ve(void 0,[e],function*({emitter:t,inboxService:n,notificationsCache:r,tags:i}){try{const o=r.getUniqueNotifications({tags:i}).map(s=>new Gr(an(Ye({},s),{isRead:!0,readAt:new Date().toISOString(),isArchived:!1,archivedAt:void 0}),t,n));return t.emit("notifications.read_all.pending",{args:{tags:i},data:o}),yield n.readAll({tags:i}),t.emit("notifications.read_all.resolved",{args:{tags:i},data:o}),{}}catch(a){return t.emit("notifications.read_all.resolved",{args:{tags:i},error:a}),{error:new or("Failed to read all notifications",a)}}}),Mz=e=>Ve(void 0,[e],function*({emitter:t,inboxService:n,notificationsCache:r,tags:i}){try{const o=r.getUniqueNotifications({tags:i}).map(s=>new Gr(an(Ye({},s),{isRead:!0,readAt:new Date().toISOString(),isArchived:!0,archivedAt:new Date().toISOString()}),t,n));return t.emit("notifications.archive_all.pending",{args:{tags:i},data:o}),yield n.archiveAll({tags:i}),t.emit("notifications.archive_all.resolved",{args:{tags:i},data:o}),{}}catch(a){return t.emit("notifications.archive_all.resolved",{args:{tags:i},error:a}),{error:new or("Failed to archive all notifications",a)}}}),Bz=e=>Ve(void 0,[e],function*({emitter:t,inboxService:n,notificationsCache:r,tags:i}){try{const o=r.getUniqueNotifications({tags:i,read:!0}).map(s=>new Gr(an(Ye({},s),{isArchived:!0,archivedAt:new Date().toISOString()}),t,n));return t.emit("notifications.archive_all_read.pending",{args:{tags:i},data:o}),yield n.archiveAllRead({tags:i}),t.emit("notifications.archive_all_read.resolved",{args:{tags:i},data:o}),{}}catch(a){return t.emit("notifications.archive_all_read.resolved",{args:{tags:i},error:a}),{error:new or("Failed to archive all read notifications",a)}}}),Ai,s7=class{constructor(){Ge(this,Ai),Qe(this,Ai,new Map)}get(e){return oe(this,Ai).get(e)}getValues(){return Array.from(oe(this,Ai).values())}entries(){return Array.from(oe(this,Ai).entries())}keys(){return Array.from(oe(this,Ai).keys())}set(e,t){oe(this,Ai).set(e,t)}remove(e){oe(this,Ai).delete(e)}clear(){oe(this,Ai).clear()}};Ai=new WeakMap;var l7=({tags:e,read:t,archived:n,limit:r,offset:i,after:a})=>Object.entries({tags:e,read:t,archived:n,limit:r,offset:i,after:a}).filter(([o,s])=>s!=null&&!(Array.isArray(s)&&s.length===0)).reduce((o,[s,l])=>(o[s]=l,o),{}),Am=({tags:e,read:t,archived:n,limit:r,offset:i,after:a})=>JSON.stringify(l7({tags:e,read:t,archived:n,limit:r,offset:i,after:a})),Lz=({tags:e,read:t,archived:n})=>JSON.stringify(l7({tags:e,read:t,archived:n})),Ts=e=>JSON.parse(e),$z=["notification.read.pending","notification.read.resolved","notification.unread.pending","notification.unread.resolved","notification.complete_action.pending","notification.complete_action.resolved","notification.revert_action.pending","notification.revert_action.resolved","notifications.read_all.pending","notifications.read_all.resolved"],jz=["notification.archive.pending","notification.unarchive.pending","notifications.archive_all.pending","notifications.archive_all_read.pending"],Mo,kn,Hz=class{constructor({emitter:e}){Ge(this,Mo),Ge(this,kn),this.updateNotification=(t,n)=>{const r=oe(this,kn).get(t);if(!r)return!1;const i=r.notifications.findIndex(o=>o.id===n.id);if(i===-1)return!1;const a=[...r.notifications];return a[i]=n,oe(this,kn).set(t,an(Ye({},r),{notifications:a})),!0},this.removeNotification=(t,n)=>{const r=oe(this,kn).get(t);if(!r)return!1;const i=r.notifications.findIndex(o=>o.id===n.id);if(i===-1)return!1;const a=[...r.notifications];return a.splice(i,1),oe(this,kn).set(t,an(Ye({},r),{notifications:a})),!0},this.handleNotificationEvent=({remove:t}={remove:!1})=>({data:n})=>{if(!n)return;const r=Array.isArray(n)?n:[n],i=new Set;oe(this,kn).keys().forEach(a=>{r.forEach(o=>{let s=!1;t?s=this.removeNotification(a,o):s=this.updateNotification(a,o),s&&i.add(Lz(Ts(a)))})}),i.forEach(a=>{const o=this.getAggregated(Ts(a));oe(this,Mo).emit("notifications.list.updated",{data:o})})},Qe(this,Mo,e),$z.forEach(t=>{oe(this,Mo).on(t,this.handleNotificationEvent())}),jz.forEach(t=>{oe(this,Mo).on(t,this.handleNotificationEvent({remove:!0}))}),Qe(this,kn,new s7)}getAggregated(e){return oe(this,kn).keys().filter(n=>{const r=Ts(n);return Nf(r,e)}).map(n=>oe(this,kn).get(n)).reduce((n,r)=>r?{hasMore:r.hasMore,filter:r.filter,notifications:[...n.notifications,...r.notifications]}:n,{hasMore:!1,filter:{},notifications:[]})}has(e){return oe(this,kn).get(Am(e))!==void 0}set(e,t){oe(this,kn).set(Am(e),t)}update(e,t){this.set(e,t);const n=this.getAggregated(Ts(Am(e)));oe(this,Mo).emit("notifications.list.updated",{data:n})}getAll(e){if(this.has(e))return this.getAggregated({tags:e.tags,read:e.read,archived:e.archived})}getUniqueNotifications({tags:e,read:t}){const n=oe(this,kn).keys(),r=new Map;return n.forEach(i=>{const a=Ts(i);if(n7(e,a.tags)){const o=oe(this,kn).get(i);if(!o)return;o.notifications.filter(s=>typeof t>"u"||t===s.isRead).forEach(s=>r.set(s.id,s))}}),Array.from(r.values())}clear(e){oe(this,kn).keys().forEach(n=>{Nf(Ts(n),e)&&oe(this,kn).remove(n)})}clearAll(){oe(this,kn).clear()}};Mo=new WeakMap;kn=new WeakMap;var Rd,Uz=class extends Fy{constructor({useCache:e,inboxServiceInstance:t,eventEmitterInstance:n}){super({eventEmitterInstance:n,inboxServiceInstance:t}),Ge(this,Rd),this.cache=new Hz({emitter:n}),Qe(this,Rd,e)}list(){return Ve(this,arguments,function*(e={}){var t=e,{limit:n=10}=t,r=Dy(t,["limit"]);return this.callWithSession(()=>Ve(this,null,function*(){const i=Ye({limit:n},r);try{const a="useCache"in i?i.useCache:oe(this,Rd);let o=a?this.cache.getAll(i):void 0;if(this._emitter.emit("notifications.list.pending",{args:i,data:o}),!o){const s=yield this._inboxService.fetchNotifications(Ye({limit:n},r));o={hasMore:s.hasMore,filter:s.filter,notifications:s.data.map(l=>new Gr(l,this._emitter,this._inboxService))},a&&(this.cache.set(i,o),o=this.cache.getAll(i))}return this._emitter.emit("notifications.list.resolved",{args:i,data:o}),{data:o}}catch(a){return this._emitter.emit("notifications.list.resolved",{args:i,error:a}),{error:new or("Failed to fetch notifications",a)}}}))})}count(e){return Ve(this,null,function*(){return this.callWithSession(()=>Ve(this,null,function*(){const t=e&&"filters"in e?e.filters:[Ye({},e)];try{this._emitter.emit("notifications.count.pending",{args:e});const n=yield this._inboxService.count({filters:t}),r=e&&"filters"in e?{counts:n.data}:n.data[0];return this._emitter.emit("notifications.count.resolved",{args:e,data:r}),{data:r}}catch(n){return this._emitter.emit("notifications.count.resolved",{args:e,error:n}),{error:new or("Failed to count notifications",n)}}}))})}read(e){return Ve(this,null,function*(){return this.callWithSession(()=>Ve(this,null,function*(){return r7({emitter:this._emitter,apiService:this._inboxService,args:e})}))})}unread(e){return Ve(this,null,function*(){return this.callWithSession(()=>Ve(this,null,function*(){return i7({emitter:this._emitter,apiService:this._inboxService,args:e})}))})}archive(e){return Ve(this,null,function*(){return this.callWithSession(()=>Ve(this,null,function*(){return a7({emitter:this._emitter,apiService:this._inboxService,args:e})}))})}unarchive(e){return Ve(this,null,function*(){return this.callWithSession(()=>Ve(this,null,function*(){return o7({emitter:this._emitter,apiService:this._inboxService,args:e})}))})}completePrimary(e){return Ve(this,null,function*(){return this.callWithSession(()=>Ve(this,null,function*(){return If({emitter:this._emitter,apiService:this._inboxService,args:e,actionType:"primary"})}))})}completeSecondary(e){return Ve(this,null,function*(){return this.callWithSession(()=>Ve(this,null,function*(){return If({emitter:this._emitter,apiService:this._inboxService,args:e,actionType:"secondary"})}))})}revertPrimary(e){return Ve(this,null,function*(){return this.callWithSession(()=>Ve(this,null,function*(){return Pf({emitter:this._emitter,apiService:this._inboxService,args:e,actionType:"primary"})}))})}revertSecondary(e){return Ve(this,null,function*(){return this.callWithSession(()=>Ve(this,null,function*(){return Pf({emitter:this._emitter,apiService:this._inboxService,args:e,actionType:"secondary"})}))})}readAll(){return Ve(this,arguments,function*({tags:e}={}){return this.callWithSession(()=>Ve(this,null,function*(){return Fz({emitter:this._emitter,inboxService:this._inboxService,notificationsCache:this.cache,tags:e})}))})}archiveAll(){return Ve(this,arguments,function*({tags:e}={}){return this.callWithSession(()=>Ve(this,null,function*(){return Mz({emitter:this._emitter,inboxService:this._inboxService,notificationsCache:this.cache,tags:e})}))})}archiveAllRead(){return Ve(this,arguments,function*({tags:e}={}){return this.callWithSession(()=>Ve(this,null,function*(){return Bz({emitter:this._emitter,inboxService:this._inboxService,notificationsCache:this.cache,tags:e})}))})}clearCache({filter:e}={}){return e?this.cache.clear(e??{}):this.cache.clearAll()}};Rd=new WeakMap;var Bs,Fd,Bo,zz=class{constructor(e,t,n){Ge(this,Bs),Ge(this,Fd),Ge(this,Bo),Qe(this,Bs,n),Qe(this,Fd,t),Qe(this,Bo,e)}initialize(){return Ve(this,null,function*(){try{const{applicationIdentifier:e,subscriberId:t,subscriberHash:n}=oe(this,Bo);oe(this,Bs).emit("session.initialize.pending",{args:oe(this,Bo)});const r=yield oe(this,Fd).initializeSession({applicationIdentifier:e,subscriberId:t,subscriberHash:n});oe(this,Bs).emit("session.initialize.resolved",{args:oe(this,Bo),data:r})}catch(e){oe(this,Bs).emit("session.initialize.resolved",{args:oe(this,Bo),error:e})}})}};Bs=new WeakMap;Fd=new WeakMap;Bo=new WeakMap;var Vz=e=>Ve(void 0,[e],function*({emitter:t,apiService:n,cache:r,useCache:i,args:a}){const{workflowId:o,channelPreferences:s}=a;try{t.emit("preference.update.pending",{args:a,data:a.preference?new Rf(an(Ye({},a.preference),{channels:Ye(Ye({},a.preference.channels),s)}),{emitterInstance:t,inboxServiceInstance:n,cache:r,useCache:i}):void 0});let l;o?l=yield n.updateWorkflowPreferences({workflowId:o,channelPreferences:s}):(qz({emitter:t,apiService:n,cache:r,useCache:i,args:a}),l=yield n.updateGlobalPreferences(s));const u=new Rf(l,{emitterInstance:t,inboxServiceInstance:n,cache:r,useCache:i});return t.emit("preference.update.resolved",{args:a,data:u}),{data:u}}catch(l){return t.emit("preference.update.resolved",{args:a,error:l}),{error:new or("Failed to fetch notifications",l)}}}),qz=({emitter:e,apiService:t,cache:n,useCache:r,args:i})=>{const a=r?n==null?void 0:n.getAll({}):void 0;a==null||a.forEach(o=>{var s;if(o.level==="template"){const l=an(Ye({},o),{channels:Object.entries(o.channels).reduce((c,[d,f])=>{var h;const m=d;return c[m]=(h=i.channelPreferences[m])!=null?h:f,c},{})}),u=i.preference?new Rf(l,{emitterInstance:e,inboxServiceInstance:t,cache:n,useCache:r}):void 0;u&&e.emit("preference.update.pending",{args:{workflowId:(s=o.workflow)==null?void 0:s.id,channelPreferences:u.channels},data:u})}})},Md,Bd,Ld,$d,Rf=class{constructor(e,{emitterInstance:t,inboxServiceInstance:n,cache:r,useCache:i}){Ge(this,Md),Ge(this,Bd),Ge(this,Ld),Ge(this,$d),Qe(this,Md,t),Qe(this,Bd,n),Qe(this,Ld,r),Qe(this,$d,i),this.level=e.level,this.enabled=e.enabled,this.channels=e.channels,this.workflow=e.workflow}update({channelPreferences:e}){var t;return Vz({emitter:oe(this,Md),apiService:oe(this,Bd),cache:oe(this,Ld),useCache:oe(this,$d),args:{workflowId:(t=this.workflow)==null?void 0:t.id,channelPreferences:e,preference:{level:this.level,enabled:this.enabled,channels:this.channels,workflow:this.workflow}}})}};Md=new WeakMap;Bd=new WeakMap;Ld=new WeakMap;$d=new WeakMap;var Wz=["preference.update.pending","preference.update.resolved"],Kz=({tags:e})=>Object.entries({tags:e}).reduce((t,[n,r])=>(r==null||Array.isArray(r)&&r.length===0||(t[n]=r),t),{}),km=({tags:e})=>JSON.stringify(Kz({tags:e})),Fu,ri,Gz=class{constructor({emitterInstance:e}){Ge(this,Fu),Ge(this,ri),this.updatePreference=(t,n)=>{const r=oe(this,ri).get(t);if(!r)return!1;const i=r.findIndex(o=>{var s,l;return((s=o.workflow)==null?void 0:s.id)===((l=n.workflow)==null?void 0:l.id)||o.level===n.level&&n.level==="global"});if(i===-1)return!1;const a=[...r];return a[i]=n,oe(this,ri).set(t,a),!0},this.handlePreferenceEvent=({data:t})=>{t&&oe(this,ri).keys().forEach(n=>{const r=this.updatePreference(n,t),i=oe(this,ri).get(n);!r||!i||oe(this,Fu).emit("preferences.list.updated",{data:i})})},Qe(this,Fu,e),Wz.forEach(t=>{oe(this,Fu).on(t,this.handlePreferenceEvent)}),Qe(this,ri,new s7)}has(e){return oe(this,ri).get(km(e))!==void 0}set(e,t){oe(this,ri).set(km(e),t)}getAll(e){if(this.has(e))return oe(this,ri).get(km(e))}clearAll(){oe(this,ri).clear()}};Fu=new WeakMap;ri=new WeakMap;var Ls,Yz=class extends Fy{constructor({useCache:t,inboxServiceInstance:n,eventEmitterInstance:r}){super({eventEmitterInstance:r,inboxServiceInstance:n}),Ge(this,Ls),this.cache=new Gz({emitterInstance:this._emitter}),Qe(this,Ls,t)}list(){return Ve(this,arguments,function*(t={}){return this.callWithSession(()=>Ve(this,null,function*(){try{let n=oe(this,Ls)?this.cache.getAll(t):void 0;return this._emitter.emit("preferences.list.pending",{args:t,data:n}),n||(n=(yield this._inboxService.fetchPreferences(t.tags)).map(i=>new Rf(i,{emitterInstance:this._emitter,inboxServiceInstance:this._inboxService,cache:this.cache,useCache:oe(this,Ls)})),oe(this,Ls)&&(this.cache.set(t,n),n=this.cache.getAll(t))),this._emitter.emit("preferences.list.resolved",{args:t,data:n}),{data:n}}catch(n){throw this._emitter.emit("preferences.list.resolved",{args:t,error:n}),n}}))})}};Ls=new WeakMap;var Zz="https://ws.novu.co",pE="notifications.notification_received",mE="notifications.unseen_count_changed",gE="notifications.unread_count_changed",Qz=({_id:e,content:t,read:n,archived:r,createdAt:i,lastReadDate:a,archivedAt:o,channel:s,subscriber:l,subject:u,avatar:c,cta:d,tags:f,data:h})=>{var m,p,y,v,b,_,T,C,x,w;const P={id:(m=l==null?void 0:l._id)!=null?m:"",firstName:l==null?void 0:l.firstName,lastName:l==null?void 0:l.lastName,avatar:l==null?void 0:l.avatar,subscriberId:(p=l==null?void 0:l.subscriberId)!=null?p:""},O=(v=(y=d.action)==null?void 0:y.buttons)==null?void 0:v.find(S=>S.type==="primary"),M=(_=(b=d.action)==null?void 0:b.buttons)==null?void 0:_.find(S=>S.type==="secondary"),R=(C=(T=d.action)==null?void 0:T.result)==null?void 0:C.type,D=(x=d.action)==null?void 0:x.status;return{id:e,subject:u,body:t,to:P,isRead:n,isArchived:r,createdAt:i,readAt:a,archivedAt:o,avatar:c,primaryAction:O&&{label:O.content,isCompleted:R==="primary"&&D==="done",redirect:O.url?{target:O.target,url:O.url}:void 0},secondaryAction:M&&{label:M.content,isCompleted:R==="secondary"&&D==="done",redirect:M.url?{target:M.target,url:M.url}:void 0},channelType:s,tags:f,redirect:(w=d.data)!=null&&w.url?{url:d.data.url,target:d.data.target}:void 0,data:h}},tc,Si,ha,Sc,My,By,Ly,jd,Bg,Xz=class extends Fy{constructor({socketUrl:t,inboxServiceInstance:n,eventEmitterInstance:r}){super({eventEmitterInstance:r,inboxServiceInstance:n}),Ge(this,jd),Ge(this,tc),Ge(this,Si),Ge(this,ha),Ge(this,Sc),Ge(this,My,({message:i})=>{oe(this,Si).emit(pE,{result:new Gr(Qz(i),oe(this,Si),this._inboxService)})}),Ge(this,By,({unseenCount:i})=>{oe(this,Si).emit(mE,{result:i})}),Ge(this,Ly,({unreadCount:i})=>{oe(this,Si).emit(gE,{result:i})}),Qe(this,Si,r),Qe(this,Sc,t??Zz)}onSessionSuccess({token:t}){Qe(this,tc,t)}isSocketEvent(t){return t===pE||t===mE||t===gE}initialize(){if(oe(this,tc)){Of(this,jd,Bg).call(this).catch(t=>{console.error(t)});return}this.callWithSession(()=>Ve(this,null,function*(){return Of(this,jd,Bg).call(this).catch(t=>{console.error(t)}),{}}))}};tc=new WeakMap;Si=new WeakMap;ha=new WeakMap;Sc=new WeakMap;My=new WeakMap;By=new WeakMap;Ly=new WeakMap;jd=new WeakSet;Bg=function(){return Ve(this,null,function*(){var e,t,n;if(oe(this,ha))return;const r={socketUrl:oe(this,Sc)};oe(this,Si).emit("socket.connect.pending",{args:r}),Qe(this,ha,Pd(oe(this,Sc),{reconnectionDelayMax:1e4,transports:["websocket"],query:{token:`${oe(this,tc)}`}})),oe(this,ha).on("connect",()=>{oe(this,Si).emit("socket.connect.resolved",{args:r})}),oe(this,ha).on("connect_error",i=>{oe(this,Si).emit("socket.connect.resolved",{args:r,error:i})}),(e=oe(this,ha))==null||e.on("notification_received",oe(this,My)),(t=oe(this,ha))==null||t.on("unseen_count_changed",oe(this,By)),(n=oe(this,ha))==null||n.on("unread_count_changed",oe(this,Ly))})};var Jz="https://api.novu.co",eV="2024-06-26",Mu="/inbox",Jr=`${Mu}/notifications`,pn,tV=class{constructor(e={}){this.isSessionInitialized=!1,Ge(this,pn),Qe(this,pn,new Iz(e)),oe(this,pn).updateHeaders({"Novu-API-Version":eV,"Novu-User-Agent":e.userAgent||"@novu/js"})}initializeSession(e){return Ve(this,arguments,function*({applicationIdentifier:t,subscriberId:n,subscriberHash:r}){const i=yield oe(this,pn).post(`${Mu}/session`,{applicationIdentifier:t,subscriberId:n,subscriberHash:r});return oe(this,pn).setAuthorizationToken(i.token),this.isSessionInitialized=!0,i})}fetchNotifications({after:e,archived:t,limit:n=10,offset:r,read:i,tags:a}){const o=new URLSearchParams(`limit=${n}`);return e&&o.append("after",e),r&&o.append("offset",`${r}`),a&&a.forEach(s=>o.append("tags[]",s)),i!==void 0&&o.append("read",`${i}`),t!==void 0&&o.append("archived",`${t}`),oe(this,pn).getFullResponse(`${Jr}?${o.toString()}`)}count({filters:e}){return oe(this,pn).getFullResponse(`${Jr}/count?filters=${JSON.stringify(e)}`)}read(e){return oe(this,pn).patch(`${Jr}/${e}/read`)}unread(e){return oe(this,pn).patch(`${Jr}/${e}/unread`)}archive(e){return oe(this,pn).patch(`${Jr}/${e}/archive`)}unarchive(e){return oe(this,pn).patch(`${Jr}/${e}/unarchive`)}readAll({tags:e}){return oe(this,pn).post(`${Jr}/read`,{tags:e})}archiveAll({tags:e}){return oe(this,pn).post(`${Jr}/archive`,{tags:e})}archiveAllRead({tags:e}){return oe(this,pn).post(`${Jr}/read-archive`,{tags:e})}completeAction({actionType:e,notificationId:t}){return oe(this,pn).patch(`${Jr}/${t}/complete`,{actionType:e})}revertAction({actionType:e,notificationId:t}){return oe(this,pn).patch(`${Jr}/${t}/revert`,{actionType:e})}fetchPreferences(e){const t=new URLSearchParams;e&&e.forEach(r=>t.append("tags[]",r));const n=t.size?`?${t.toString()}`:"";return oe(this,pn).get(`${Mu}/preferences${n}`)}updateGlobalPreferences(e){return oe(this,pn).patch(`${Mu}/preferences`,e)}updateWorkflowPreferences({workflowId:e,channelPreferences:t}){return oe(this,pn).patch(`${Mu}/preferences/${e}`,t)}};pn=new WeakMap;var nV="2.6.0",rV="@novu/js",iV=`${rV}@${nV}`,da,Hd,Bu,Lo,u7=class{constructor(e){Ge(this,da),Ge(this,Hd),Ge(this,Bu),Ge(this,Lo);var t,n,r,i;Qe(this,Lo,new tV({backendUrl:(t=e.backendUrl)!=null?t:Jz,userAgent:(n=e.__userAgent)!=null?n:iV})),Qe(this,da,new Rz),Qe(this,Hd,new zz({applicationIdentifier:e.applicationIdentifier,subscriberId:e.subscriberId,subscriberHash:e.subscriberHash},oe(this,Lo),oe(this,da))),oe(this,Hd).initialize(),this.notifications=new Uz({useCache:(r=e.useCache)!=null?r:!0,inboxServiceInstance:oe(this,Lo),eventEmitterInstance:oe(this,da)}),this.preferences=new Yz({useCache:(i=e.useCache)!=null?i:!0,inboxServiceInstance:oe(this,Lo),eventEmitterInstance:oe(this,da)}),Qe(this,Bu,new Xz({socketUrl:e.socketUrl,eventEmitterInstance:oe(this,da),inboxServiceInstance:oe(this,Lo)})),this.on=(a,o)=>{oe(this,Bu).isSocketEvent(a)&&oe(this,Bu).initialize();const s=oe(this,da).on(a,o);return()=>{s()}},this.off=(a,o)=>{oe(this,da).off(a,o)}}};da=new WeakMap;Hd=new WeakMap;Bu=new WeakMap;Lo=new WeakMap;var aV=e=>{const t=[];let n="",r=!1;for(let i=0;i<e.length;i+=1)e[i]==="\\"&&e[i+1]==="*"?(n+="*",i+=1):e[i]==="*"&&e[i+1]==="*"?(n&&(t.push({type:r?"bold":"text",content:n}),n=""),r=!r,i+=1):n+=e[i];return n&&t.push({type:r?"bold":"text",content:n}),t};const c7={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return vE(this.context.count)},getNextContextId(){return vE(this.context.count++)}};function vE(e){const t=String(e),n=t.length-1;return c7.context.id+(n?String.fromCharCode(96+n):"")+t}const oV=(e,t)=>e===t,hi=Symbol("solid-proxy"),d7=typeof Proxy=="function",Lg=Symbol("solid-track"),Ff={equals:oV};let f7=y7;const Na=1,Mf=2,h7={owned:null,cleanups:null,context:null,owner:null},Sm={};var It=null;let Dm=null,sV=null,$t=null,Mn=null,ya=null,Ph=0;function nc(e,t){const n=$t,r=It,i=e.length===0,a=t===void 0?r:t,o=i?h7:{owned:null,cleanups:null,context:a?a.context:null,owner:a},s=i?e:()=>e(()=>xn(()=>Dc(o)));It=o,$t=null;try{return qi(s,!0)}finally{$t=n,It=r}}function Me(e,t){t=t?Object.assign({},Ff,t):Ff;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=i=>(typeof i=="function"&&(i=i(n.value)),v7(n,i));return[g7.bind(n),r]}function Bf(e,t,n){const r=Rh(e,t,!0,Na);Ul(r)}function ct(e,t,n){const r=Rh(e,t,!1,Na);Ul(r)}function cn(e,t,n){f7=vV;const r=Rh(e,t,!1,Na);(!n||!n.render)&&(r.user=!0),ya?ya.push(r):Ul(r)}function He(e,t,n){n=n?Object.assign({},Ff,n):Ff;const r=Rh(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,Ul(r),g7.bind(r)}function lV(e){return e&&typeof e=="object"&&"then"in e}function p7(e,t,n){let r,i,a;arguments.length===2&&typeof t=="object"||arguments.length===1?(r=!0,i=e,a=t||{}):(r=e,i=t,a=n||{});let o=null,s=Sm,l=!1,u="initialValue"in a,c=typeof r=="function"&&He(r);const d=new Set,[f,h]=(a.storage||Me)(a.initialValue),[m,p]=Me(void 0),[y,v]=Me(void 0,{equals:!1}),[b,_]=Me(u?"ready":"unresolved");function T(P,O,M,R){return o===P&&(o=null,R!==void 0&&(u=!0),(P===s||O===s)&&a.onHydrated&&queueMicrotask(()=>a.onHydrated(R,{value:O})),s=Sm,C(O,M)),O}function C(P,O){qi(()=>{O===void 0&&h(()=>P),_(O!==void 0?"errored":u?"ready":"unresolved"),p(O);for(const M of d.keys())M.decrement();d.clear()},!1)}function x(){const P=pV,O=f(),M=m();if(M!==void 0&&!o)throw M;return $t&&!$t.user&&P&&Bf(()=>{y(),o&&(P.resolved||d.has(P)||(P.increment(),d.add(P)))}),O}function w(P=!0){if(P!==!1&&l)return;l=!1;const O=c?c():r;if(O==null||O===!1){T(o,xn(f));return}const M=s!==Sm?s:xn(()=>i(O,{value:f(),refetching:P}));return lV(M)?(o=M,"value"in M?(M.status==="success"?T(o,M.value,void 0,O):T(o,void 0,jg(M.value),O),M):(l=!0,queueMicrotask(()=>l=!1),qi(()=>{_(u?"refreshing":"pending"),v()},!1),M.then(R=>T(M,R,void 0,O),R=>T(M,void 0,jg(R),O)))):(T(o,M,void 0,O),M)}return Object.defineProperties(x,{state:{get:()=>b()},error:{get:()=>m()},loading:{get(){const P=b();return P==="pending"||P==="refreshing"}},latest:{get(){if(!u)return x();const P=m();if(P&&!o)throw P;return f()}}}),c?Bf(()=>w(!1)):w(!1),[x,{refetch:w,mutate:h}]}function xl(e){return qi(e,!1)}function xn(e){if($t===null)return e();const t=$t;$t=null;try{return e()}finally{$t=t}}function sr(e){cn(()=>xn(e))}function dn(e){return It===null||(It.cleanups===null?It.cleanups=[e]:It.cleanups.push(e)),e}function $g(){return $t}function uV(){return It}function cV(e,t){const n=It,r=$t;It=e,$t=null;try{return qi(t,!0)}catch(i){$y(i)}finally{It=n,$t=r}}function dV(e){const t=$t,n=It;return Promise.resolve().then(()=>{$t=t,It=n;let r;return qi(e,!1),$t=It=null,r?r.done:void 0})}const[fV,Uve]=Me(!1);function hV(){return[fV,dV]}function vi(e,t){const n=Symbol("context");return{id:n,Provider:yV(n),defaultValue:e}}function lr(e){let t;return It&&It.context&&(t=It.context[e.id])!==void 0?t:e.defaultValue}function m7(e){const t=He(e),n=He(()=>Hg(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let pV;function g7(){if(this.sources&&this.state)if(this.state===Na)Ul(this);else{const e=Mn;Mn=null,qi(()=>$f(this),!1),Mn=e}if($t){const e=this.observers?this.observers.length:0;$t.sources?($t.sources.push(this),$t.sourceSlots.push(e)):($t.sources=[this],$t.sourceSlots=[e]),this.observers?(this.observers.push($t),this.observerSlots.push($t.sources.length-1)):(this.observers=[$t],this.observerSlots=[$t.sources.length-1])}return this.value}function v7(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&qi(()=>{for(let i=0;i<e.observers.length;i+=1){const a=e.observers[i],o=Dm&&Dm.running;o&&Dm.disposed.has(a),(o?!a.tState:!a.state)&&(a.pure?Mn.push(a):ya.push(a),a.observers&&b7(a)),o||(a.state=Na)}if(Mn.length>1e6)throw Mn=[],new Error},!1)),t}function Ul(e){if(!e.fn)return;Dc(e);const t=Ph;mV(e,e.value,t)}function mV(e,t,n){let r;const i=It,a=$t;$t=It=e;try{r=e.fn(t)}catch(o){return e.pure&&(e.state=Na,e.owned&&e.owned.forEach(Dc),e.owned=null),e.updatedAt=n+1,$y(o)}finally{$t=a,It=i}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?v7(e,r):e.value=r,e.updatedAt=n)}function Rh(e,t,n,r=Na,i){const a={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:It,context:It?It.context:null,pure:n};return It===null||It!==h7&&(It.owned?It.owned.push(a):It.owned=[a]),a}function Lf(e){if(e.state===0)return;if(e.state===Mf)return $f(e);if(e.suspense&&xn(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<Ph);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===Na)Ul(e);else if(e.state===Mf){const r=Mn;Mn=null,qi(()=>$f(e,t[0]),!1),Mn=r}}function qi(e,t){if(Mn)return e();let n=!1;t||(Mn=[]),ya?n=!0:ya=[],Ph++;try{const r=e();return gV(n),r}catch(r){n||(ya=null),Mn=null,$y(r)}}function gV(e){if(Mn&&(y7(Mn),Mn=null),e)return;const t=ya;ya=null,t.length&&qi(()=>f7(t),!1)}function y7(e){for(let t=0;t<e.length;t++)Lf(e[t])}function vV(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:Lf(r)}for(t=0;t<n;t++)Lf(e[t])}function $f(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){const r=e.sources[n];if(r.sources){const i=r.state;i===Na?r!==t&&(!r.updatedAt||r.updatedAt<Ph)&&Lf(r):i===Mf&&$f(r,t)}}}function b7(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=Mf,n.pure?Mn.push(n):ya.push(n),n.observers&&b7(n))}}function Dc(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),r=e.sourceSlots.pop(),i=n.observers;if(i&&i.length){const a=i.pop(),o=n.observerSlots.pop();r<i.length&&(a.sourceSlots[o]=r,i[r]=a,n.observerSlots[r]=o)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)Dc(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)Dc(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function jg(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function $y(e,t=It){throw jg(e)}function Hg(e){if(typeof e=="function"&&!e.length)return Hg(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=Hg(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function yV(e,t){return function(r){let i;return ct(()=>i=xn(()=>(It.context={...It.context,[e]:r.value},m7(()=>r.children))),void 0),i}}const bV=Symbol("fallback");function yE(e){for(let t=0;t<e.length;t++)e[t]()}function EV(e,t,n={}){let r=[],i=[],a=[],o=0,s=t.length>1?[]:null;return dn(()=>yE(a)),()=>{let l=e()||[],u=l.length,c,d;return l[Lg],xn(()=>{let h,m,p,y,v,b,_,T,C;if(u===0)o!==0&&(yE(a),a=[],r=[],i=[],o=0,s&&(s=[])),n.fallback&&(r=[bV],i[0]=nc(x=>(a[0]=x,n.fallback())),o=1);else if(o===0){for(i=new Array(u),d=0;d<u;d++)r[d]=l[d],i[d]=nc(f);o=u}else{for(p=new Array(u),y=new Array(u),s&&(v=new Array(u)),b=0,_=Math.min(o,u);b<_&&r[b]===l[b];b++);for(_=o-1,T=u-1;_>=b&&T>=b&&r[_]===l[T];_--,T--)p[T]=i[_],y[T]=a[_],s&&(v[T]=s[_]);for(h=new Map,m=new Array(T+1),d=T;d>=b;d--)C=l[d],c=h.get(C),m[d]=c===void 0?-1:c,h.set(C,d);for(c=b;c<=_;c++)C=r[c],d=h.get(C),d!==void 0&&d!==-1?(p[d]=i[c],y[d]=a[c],s&&(v[d]=s[c]),d=m[d],h.set(C,d)):a[c]();for(d=b;d<u;d++)d in p?(i[d]=p[d],a[d]=y[d],s&&(s[d]=v[d],s[d](d))):i[d]=nc(f);i=i.slice(0,o=u),r=l.slice(0)}return i});function f(h){if(a[d]=h,s){const[m,p]=Me(d);return s[d]=p,t(l[d],m)}return t(l[d])}}}function Z(e,t){return xn(()=>e(t||{}))}function R1(){return!0}const Ug={get(e,t,n){return t===hi?n:e.get(t)},has(e,t){return t===hi?!0:e.has(t)},set:R1,deleteProperty:R1,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:R1,deleteProperty:R1}},ownKeys(e){return e.keys()}};function Om(e){return(e=typeof e=="function"?e():e)?e:{}}function _V(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function At(...e){let t=!1;for(let o=0;o<e.length;o++){const s=e[o];t=t||!!s&&hi in s,e[o]=typeof s=="function"?(t=!0,He(s)):s}if(d7&&t)return new Proxy({get(o){for(let s=e.length-1;s>=0;s--){const l=Om(e[s])[o];if(l!==void 0)return l}},has(o){for(let s=e.length-1;s>=0;s--)if(o in Om(e[s]))return!0;return!1},keys(){const o=[];for(let s=0;s<e.length;s++)o.push(...Object.keys(Om(e[s])));return[...new Set(o)]}},Ug);const n={},r=Object.create(null);for(let o=e.length-1;o>=0;o--){const s=e[o];if(!s)continue;const l=Object.getOwnPropertyNames(s);for(let u=l.length-1;u>=0;u--){const c=l[u];if(c==="__proto__"||c==="constructor")continue;const d=Object.getOwnPropertyDescriptor(s,c);if(!r[c])r[c]=d.get?{enumerable:!0,configurable:!0,get:_V.bind(n[c]=[d.get.bind(s)])}:d.value!==void 0?d:void 0;else{const f=n[c];f&&(d.get?f.push(d.get.bind(s)):d.value!==void 0&&f.push(()=>d.value))}}}const i={},a=Object.keys(r);for(let o=a.length-1;o>=0;o--){const s=a[o],l=r[s];l&&l.get?Object.defineProperty(i,s,l):i[s]=l?l.value:void 0}return i}function wn(e,...t){if(d7&&hi in e){const i=new Set(t.length>1?t.flat():t[0]),a=t.map(o=>new Proxy({get(s){return o.includes(s)?e[s]:void 0},has(s){return o.includes(s)&&s in e},keys(){return o.filter(s=>s in e)}},Ug));return a.push(new Proxy({get(o){return i.has(o)?void 0:e[o]},has(o){return i.has(o)?!1:o in e},keys(){return Object.keys(e).filter(o=>!i.has(o))}},Ug)),a}const n={},r=t.map(()=>({}));for(const i of Object.getOwnPropertyNames(e)){const a=Object.getOwnPropertyDescriptor(e,i),o=!a.get&&!a.set&&a.enumerable&&a.writable&&a.configurable;let s=!1,l=0;for(const u of t)u.includes(i)&&(s=!0,o?r[l][i]=a.value:Object.defineProperty(r[l],i,a)),++l;s||(o?n[i]=a.value:Object.defineProperty(n,i,a))}return[...r,n]}const E7=e=>`Stale read from <${e}>.`;function Wi(e){const t="fallback"in e&&{fallback:()=>e.fallback};return He(EV(()=>e.each,e.children,t||void 0))}function Tt(e){const t=e.keyed,n=He(()=>e.when,void 0,{equals:(r,i)=>t?r===i:!r==!i});return He(()=>{const r=n();if(r){const i=e.children;return typeof i=="function"&&i.length>0?xn(()=>i(t?r:()=>{if(!xn(n))throw E7("Show");return e.when})):i}return e.fallback},void 0,void 0)}function TV(e){let t=!1;const n=(a,o)=>(t?a[1]===o[1]:!a[1]==!o[1])&&a[2]===o[2],r=m7(()=>e.children),i=He(()=>{let a=r();Array.isArray(a)||(a=[a]);for(let o=0;o<a.length;o++){const s=a[o].when;if(s)return t=!!a[o].keyed,[o,s,a[o]]}return[-1]},void 0,{equals:n});return He(()=>{const[a,o,s]=i();if(a<0)return e.fallback;const l=s.children;return typeof l=="function"&&l.length>0?xn(()=>l(t?o:()=>{if(xn(i)[0]!==a)throw E7("Match");return s.when})):l},void 0,void 0)}function bE(e){return e}const CV=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],xV=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...CV]),wV=new Set(["innerHTML","textContent","innerText","children"]),AV=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),kV=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});function SV(e,t){const n=kV[e];return typeof n=="object"?n[t]?n.$:void 0:n}const DV=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),OV=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),NV={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function IV(e,t,n){let r=n.length,i=t.length,a=r,o=0,s=0,l=t[i-1].nextSibling,u=null;for(;o<i||s<a;){if(t[o]===n[s]){o++,s++;continue}for(;t[i-1]===n[a-1];)i--,a--;if(i===o){const c=a<r?s?n[s-1].nextSibling:n[a-s]:l;for(;s<a;)e.insertBefore(n[s++],c)}else if(a===s)for(;o<i;)(!u||!u.has(t[o]))&&t[o].remove(),o++;else if(t[o]===n[a-1]&&n[s]===t[i-1]){const c=t[--i].nextSibling;e.insertBefore(n[s++],t[o++].nextSibling),e.insertBefore(n[--a],c),t[i]=n[a]}else{if(!u){u=new Map;let d=s;for(;d<a;)u.set(n[d],d++)}const c=u.get(t[o]);if(c!=null)if(s<c&&c<a){let d=o,f=1,h;for(;++d<i&&d<a&&!((h=u.get(t[d]))==null||h!==c+f);)f++;if(f>c-s){const m=t[o];for(;s<c;)e.insertBefore(n[s++],m)}else e.replaceChild(n[s++],t[o++])}else o++;else t[o++].remove()}}}const EE="_$DX_DELEGATE";function PV(e,t,n,r={}){let i;return nc(a=>{i=a,t===document?e():Ie(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{i(),t.textContent=""}}function Le(e,t,n){let r;const i=()=>{const o=document.createElement("template");return o.innerHTML=e,n?o.content.firstChild.firstChild:o.content.firstChild},a=t?()=>xn(()=>document.importNode(r||(r=i()),!0)):()=>(r||(r=i())).cloneNode(!0);return a.cloneNode=a,a}function zl(e,t=window.document){const n=t[EE]||(t[EE]=new Set);for(let r=0,i=e.length;r<i;r++){const a=e[r];n.has(a)||(n.add(a),t.addEventListener(a,jV))}}function er(e,t,n){n==null?e.removeAttribute(t):e.setAttribute(t,n)}function RV(e,t,n,r){r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r)}function FV(e,t,n){n?e.setAttribute(t,""):e.removeAttribute(t)}function Ze(e,t){t==null?e.removeAttribute("class"):e.className=t}function _7(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const i=n[0];e.addEventListener(t,n[0]=a=>i.call(e,n[1],a))}else e.addEventListener(t,n,typeof n!="function"&&n)}function MV(e,t,n={}){const r=Object.keys(t||{}),i=Object.keys(n);let a,o;for(a=0,o=i.length;a<o;a++){const s=i[a];!s||s==="undefined"||t[s]||(_E(e,s,!1),delete n[s])}for(a=0,o=r.length;a<o;a++){const s=r[a],l=!!t[s];!s||s==="undefined"||n[s]===l||!l||(_E(e,s,!0),n[s]=l)}return n}function BV(e,t,n){if(!t)return n?er(e,"style"):t;const r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let i,a;for(a in n)t[a]==null&&r.removeProperty(a),delete n[a];for(a in t)i=t[a],i!==n[a]&&(r.setProperty(a,i),n[a]=i);return n}function Ft(e,t={},n,r){const i={};return r||ct(()=>i.children=wl(e,t.children,i.children)),ct(()=>typeof t.ref=="function"&&Ca(t.ref,e)),ct(()=>LV(e,t,n,!0,i,!0)),i}function Ca(e,t,n){return xn(()=>e(t,n))}function Ie(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return wl(e,t,r,n);ct(i=>wl(e,t(),i,n),r)}function LV(e,t,n,r,i={},a=!1){t||(t={});for(const o in i)if(!(o in t)){if(o==="children")continue;i[o]=TE(e,o,null,i[o],n,a,t)}for(const o in t){if(o==="children"){r||wl(e,t.children);continue}const s=t[o];i[o]=TE(e,o,s,i[o],n,a,t)}}function $V(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function _E(e,t,n){const r=t.trim().split(/\s+/);for(let i=0,a=r.length;i<a;i++)e.classList.toggle(r[i],n)}function TE(e,t,n,r,i,a,o){let s,l,u,c,d;if(t==="style")return BV(e,n,r);if(t==="classList")return MV(e,n,r);if(n===r)return r;if(t==="ref")a||n(e);else if(t.slice(0,3)==="on:"){const f=t.slice(3);r&&e.removeEventListener(f,r,typeof r!="function"&&r),n&&e.addEventListener(f,n,typeof n!="function"&&n)}else if(t.slice(0,10)==="oncapture:"){const f=t.slice(10);r&&e.removeEventListener(f,r,!0),n&&e.addEventListener(f,n,!0)}else if(t.slice(0,2)==="on"){const f=t.slice(2).toLowerCase(),h=DV.has(f);if(!h&&r){const m=Array.isArray(r)?r[0]:r;e.removeEventListener(f,m)}(h||n)&&(_7(e,f,n,h),h&&zl([f]))}else if(t.slice(0,5)==="attr:")er(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")FV(e,t.slice(5),n);else if((d=t.slice(0,5)==="prop:")||(u=wV.has(t))||!i&&((c=SV(t,e.tagName))||(l=xV.has(t)))||(s=e.nodeName.includes("-")||"is"in o))d&&(t=t.slice(5),l=!0),t==="class"||t==="className"?Ze(e,n):s&&!l&&!u?e[$V(t)]=n:e[c||t]=n;else{const f=i&&t.indexOf(":")>-1&&NV[t.split(":")[0]];f?RV(e,f,t,n):er(e,AV[t]||t,n)}return n}function jV(e){let t=e.target;const n=`$$${e.type}`,r=e.target,i=e.currentTarget,a=l=>Object.defineProperty(e,"target",{configurable:!0,value:l}),o=()=>{const l=t[n];if(l&&!t.disabled){const u=t[`${n}Data`];if(u!==void 0?l.call(t,u,e):l.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&a(t.host),!0},s=()=>{for(;o()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),e.composedPath){const l=e.composedPath();a(l[0]);for(let u=0;u<l.length-2&&(t=l[u],!!o());u++){if(t._$host){t=t._$host,s();break}if(t.parentNode===i)break}}else s();a(r)}function wl(e,t,n,r,i){for(;typeof n=="function";)n=n();if(t===n)return n;const a=typeof t,o=r!==void 0;if(e=o&&n[0]&&n[0].parentNode||e,a==="string"||a==="number"){if(a==="number"&&(t=t.toString(),t===n))return n;if(o){let s=n[0];s&&s.nodeType===3?s.data!==t&&(s.data=t):s=document.createTextNode(t),n=Cs(e,n,r,s)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||a==="boolean")n=Cs(e,n,r);else{if(a==="function")return ct(()=>{let s=t();for(;typeof s=="function";)s=s();n=wl(e,s,n,r)}),()=>n;if(Array.isArray(t)){const s=[],l=n&&Array.isArray(n);if(zg(s,t,n,i))return ct(()=>n=wl(e,s,n,r,!0)),()=>n;if(s.length===0){if(n=Cs(e,n,r),o)return n}else l?n.length===0?CE(e,s,r):IV(e,n,s):(n&&Cs(e),CE(e,s));n=s}else if(t.nodeType){if(Array.isArray(n)){if(o)return n=Cs(e,n,r,t);Cs(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function zg(e,t,n,r){let i=!1;for(let a=0,o=t.length;a<o;a++){let s=t[a],l=n&&n[e.length],u;if(!(s==null||s===!0||s===!1))if((u=typeof s)=="object"&&s.nodeType)e.push(s);else if(Array.isArray(s))i=zg(e,s,l)||i;else if(u==="function")if(r){for(;typeof s=="function";)s=s();i=zg(e,Array.isArray(s)?s:[s],Array.isArray(l)?l:[l])||i}else e.push(s),i=!0;else{const c=String(s);l&&l.nodeType===3&&l.data===c?e.push(l):e.push(document.createTextNode(c))}}return i}function CE(e,t,n=null){for(let r=0,i=t.length;r<i;r++)e.insertBefore(t[r],n)}function Cs(e,t,n,r){if(n===void 0)return e.textContent="";const i=r||document.createTextNode("");if(t.length){let a=!1;for(let o=t.length-1;o>=0;o--){const s=t[o];if(i!==s){const l=s.parentNode===e;!a&&!o?l?e.replaceChild(i,s):e.insertBefore(i,n):l&&s.remove()}else a=!0}}else e.insertBefore(i,n);return[i]}const HV="http://www.w3.org/2000/svg";function T7(e,t=!1){return t?document.createElementNS(HV,e):document.createElement(e)}function jy(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,i=uV();let a,o=!!c7.context;return cn(()=>{a||(a=cV(i,()=>He(()=>e.children)));const s=r();if(s instanceof HTMLHeadElement){const[l,u]=Me(!1),c=()=>u(!0);nc(d=>Ie(s,()=>l()?d():a(),null)),dn(c)}else{const l=T7(e.isSVG?"g":"div",e.isSVG),u=t&&l.attachShadow?l.attachShadow({mode:"open"}):l;Object.defineProperty(l,"_$host",{get(){return n.parentNode},configurable:!0}),Ie(u,a),s.appendChild(l),e.ref&&e.ref(l),dn(()=>s.removeChild(l))}},void 0,{render:!o}),n}function Fh(e){const[t,n]=wn(e,["component"]),r=He(()=>t.component);return He(()=>{const i=r();switch(typeof i){case"function":return xn(()=>i(n));case"string":const a=OV.has(i),o=T7(i,a);return Ft(o,n,a),o}})}const Vg=Symbol("store-raw"),rl=Symbol("store-node"),ma=Symbol("store-has"),C7=Symbol("store-self");function x7(e){let t=e[hi];if(!t&&(Object.defineProperty(e,hi,{value:t=new Proxy(e,VV)}),!Array.isArray(e))){const n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let i=0,a=n.length;i<a;i++){const o=n[i];r[o].get&&Object.defineProperty(e,o,{enumerable:r[o].enumerable,get:r[o].get.bind(t)})}}return t}function jf(e){let t;return e!=null&&typeof e=="object"&&(e[hi]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function Oc(e,t=new Set){let n,r,i,a;if(n=e!=null&&e[Vg])return n;if(!jf(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let o=0,s=e.length;o<s;o++)i=e[o],(r=Oc(i,t))!==i&&(e[o]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);const o=Object.keys(e),s=Object.getOwnPropertyDescriptors(e);for(let l=0,u=o.length;l<u;l++)a=o[l],!s[a].get&&(i=e[a],(r=Oc(i,t))!==i&&(e[a]=r))}return e}function Hf(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function Nc(e,t,n){if(e[t])return e[t];const[r,i]=Me(n,{equals:!1,internal:!0});return r.$=i,e[t]=r}function UV(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===hi||t===rl||(delete n.value,delete n.writable,n.get=()=>e[hi][t]),n}function w7(e){$g()&&Nc(Hf(e,rl),C7)()}function zV(e){return w7(e),Reflect.ownKeys(e)}const VV={get(e,t,n){if(t===Vg)return e;if(t===hi)return n;if(t===Lg)return w7(e),n;const r=Hf(e,rl),i=r[t];let a=i?i():e[t];if(t===rl||t===ma||t==="__proto__")return a;if(!i){const o=Object.getOwnPropertyDescriptor(e,t);$g()&&(typeof a!="function"||e.hasOwnProperty(t))&&!(o&&o.get)&&(a=Nc(r,t,a)())}return jf(a)?x7(a):a},has(e,t){return t===Vg||t===hi||t===Lg||t===rl||t===ma||t==="__proto__"?!0:($g()&&Nc(Hf(e,ma),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:zV,getOwnPropertyDescriptor:UV};function Uf(e,t,n,r=!1){if(!r&&e[t]===n)return;const i=e[t],a=e.length;n===void 0?(delete e[t],e[ma]&&e[ma][t]&&i!==void 0&&e[ma][t].$()):(e[t]=n,e[ma]&&e[ma][t]&&i===void 0&&e[ma][t].$());let o=Hf(e,rl),s;if((s=Nc(o,t,i))&&s.$(()=>n),Array.isArray(e)&&e.length!==a){for(let l=e.length;l<a;l++)(s=o[l])&&s.$();(s=Nc(o,"length",a))&&s.$(e.length)}(s=o[C7])&&s.$()}function A7(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const i=n[r];Uf(e,i,t[i])}}function qV(e,t){if(typeof t=="function"&&(t=t(e)),t=Oc(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){const i=t[n];e[n]!==i&&Uf(e,n,i)}Uf(e,"length",r)}else A7(e,t)}function Lu(e,t,n=[]){let r,i=e;if(t.length>1){r=t.shift();const o=typeof r,s=Array.isArray(e);if(Array.isArray(r)){for(let l=0;l<r.length;l++)Lu(e,[r[l]].concat(t),n);return}else if(s&&o==="function"){for(let l=0;l<e.length;l++)r(e[l],l)&&Lu(e,[l].concat(t),n);return}else if(s&&o==="object"){const{from:l=0,to:u=e.length-1,by:c=1}=r;for(let d=l;d<=u;d+=c)Lu(e,[d].concat(t),n);return}else if(t.length>1){Lu(e[r],t,[r].concat(n));return}i=e[r],n=[r].concat(n)}let a=t[0];typeof a=="function"&&(a=a(i,n),a===i)||r===void 0&&a==null||(a=Oc(a),r===void 0||jf(i)&&jf(a)&&!Array.isArray(a)?A7(i,a):Uf(e,r,a))}function WV(...[e,t]){const n=Oc(e||{}),r=Array.isArray(n),i=x7(n);function a(...o){xl(()=>{r&&o.length===1?qV(n,o[0]):Lu(n,o)})}return[i,a]}function k7(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=k7(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function KV(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=k7(e))&&(r&&(r+=" "),r+=t);return r}const Hy="-",GV=e=>{const t=ZV(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const s=o.split(Hy);return s[0]===""&&s.length!==1&&s.shift(),S7(s,t)||YV(o)},getConflictingClassGroupIds:(o,s)=>{const l=n[o]||[];return s&&r[o]?[...l,...r[o]]:l}}},S7=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?S7(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const a=e.join(Hy);return(o=t.validators.find(({validator:s})=>s(a)))==null?void 0:o.classGroupId},xE=/^\[(.+)\]$/,YV=e=>{if(xE.test(e)){const t=xE.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},ZV=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return XV(Object.entries(e.classGroups),n).forEach(([a,o])=>{qg(o,r,a,t)}),r},qg=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const a=i===""?t:wE(t,i);a.classGroupId=n;return}if(typeof i=="function"){if(QV(i)){qg(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([a,o])=>{qg(o,wE(t,a),n,r)})})},wE=(e,t)=>{let n=e;return t.split(Hy).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},QV=e=>e.isThemeGetter,XV=(e,t)=>t?e.map(([n,r])=>{const i=r.map(a=>typeof a=="string"?t+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([o,s])=>[t+o,s])):a);return[n,i]}):e,JV=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(a,o)=>{n.set(a,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(a){let o=n.get(a);if(o!==void 0)return o;if((o=r.get(a))!==void 0)return i(a,o),o},set(a,o){n.has(a)?n.set(a,o):i(a,o)}}},D7="!",eq=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],a=t.length,o=s=>{const l=[];let u=0,c=0,d;for(let y=0;y<s.length;y++){let v=s[y];if(u===0){if(v===i&&(r||s.slice(y,y+a)===t)){l.push(s.slice(c,y)),c=y+a;continue}if(v==="/"){d=y;continue}}v==="["?u++:v==="]"&&u--}const f=l.length===0?s:s.substring(c),h=f.startsWith(D7),m=h?f.substring(1):f,p=d&&d>c?d-c:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:p}};return n?s=>n({className:s,parseClassName:o}):o},tq=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},nq=e=>({cache:JV(e.cacheSize),parseClassName:eq(e),...GV(e)}),rq=/\s+/,iq=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,a=[],o=e.trim().split(rq);let s="";for(let l=o.length-1;l>=0;l-=1){const u=o[l],{modifiers:c,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:h}=n(u);let m=!!h,p=r(m?f.substring(0,h):f);if(!p){if(!m){s=u+(s.length>0?" "+s:s);continue}if(p=r(f),!p){s=u+(s.length>0?" "+s:s);continue}m=!1}const y=tq(c).join(":"),v=d?y+D7:y,b=v+p;if(a.includes(b))continue;a.push(b);const _=i(p,m);for(let T=0;T<_.length;++T){const C=_[T];a.push(v+C)}s=u+(s.length>0?" "+s:s)}return s};function aq(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=O7(t))&&(r&&(r+=" "),r+=n);return r}const O7=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=O7(e[r]))&&(n&&(n+=" "),n+=t);return n};function AE(e,...t){let n,r,i,a=o;function o(l){const u=t.reduce((c,d)=>d(c),e());return n=nq(u),r=n.cache.get,i=n.cache.set,a=s,s(l)}function s(l){const u=r(l);if(u)return u;const c=iq(l,n);return i(l,c),c}return function(){return a(aq.apply(null,arguments))}}const Yt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},N7=/^\[(?:([a-z-]+):)?(.+)\]$/i,oq=/^\d+\/\d+$/,sq=new Set(["px","full","screen"]),lq=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,uq=/\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$/,cq=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,dq=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,fq=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,na=e=>il(e)||sq.has(e)||oq.test(e),ja=e=>Vl(e,"length",Eq),il=e=>!!e&&!Number.isNaN(Number(e)),Nm=e=>Vl(e,"number",il),du=e=>!!e&&Number.isInteger(Number(e)),hq=e=>e.endsWith("%")&&il(e.slice(0,-1)),st=e=>N7.test(e),Ha=e=>lq.test(e),pq=new Set(["length","size","percentage"]),mq=e=>Vl(e,pq,I7),gq=e=>Vl(e,"position",I7),vq=new Set(["image","url"]),yq=e=>Vl(e,vq,Tq),bq=e=>Vl(e,"",_q),fu=()=>!0,Vl=(e,t,n)=>{const r=N7.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Eq=e=>uq.test(e)&&!cq.test(e),I7=()=>!1,_q=e=>dq.test(e),Tq=e=>fq.test(e),kE=()=>{const e=Yt("colors"),t=Yt("spacing"),n=Yt("blur"),r=Yt("brightness"),i=Yt("borderColor"),a=Yt("borderRadius"),o=Yt("borderSpacing"),s=Yt("borderWidth"),l=Yt("contrast"),u=Yt("grayscale"),c=Yt("hueRotate"),d=Yt("invert"),f=Yt("gap"),h=Yt("gradientColorStops"),m=Yt("gradientColorStopPositions"),p=Yt("inset"),y=Yt("margin"),v=Yt("opacity"),b=Yt("padding"),_=Yt("saturate"),T=Yt("scale"),C=Yt("sepia"),x=Yt("skew"),w=Yt("space"),P=Yt("translate"),O=()=>["auto","contain","none"],M=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto",st,t],D=()=>[st,t],S=()=>["",na,ja],B=()=>["auto",il,st],H=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],$=()=>["solid","dashed","dotted","double","none"],F=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ne=()=>["start","end","center","between","around","evenly","stretch"],J=()=>["","0",st],I=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>[il,st];return{cacheSize:500,separator:":",theme:{colors:[fu],spacing:[na,ja],blur:["none","",Ha,st],brightness:A(),borderColor:[e],borderRadius:["none","","full",Ha,st],borderSpacing:D(),borderWidth:S(),contrast:A(),grayscale:J(),hueRotate:A(),invert:J(),gap:D(),gradientColorStops:[e],gradientColorStopPositions:[hq,ja],inset:R(),margin:R(),opacity:A(),padding:D(),saturate:A(),scale:A(),sepia:J(),skew:A(),space:D(),translate:D()},classGroups:{aspect:[{aspect:["auto","square","video",st]}],container:["container"],columns:[{columns:[Ha]}],"break-after":[{"break-after":I()}],"break-before":[{"break-before":I()}],"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","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...H(),st]}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",du,st]}],basis:[{basis:R()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",st]}],grow:[{grow:J()}],shrink:[{shrink:J()}],order:[{order:["first","last","none",du,st]}],"grid-cols":[{"grid-cols":[fu]}],"col-start-end":[{col:["auto",{span:["full",du,st]},st]}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":[fu]}],"row-start-end":[{row:["auto",{span:[du,st]},st]}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",st]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",st]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...ne()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ne(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ne(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[w]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[w]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",st,t]}],"min-w":[{"min-w":[st,t,"min","max","fit"]}],"max-w":[{"max-w":[st,t,"none","full","min","max","fit","prose",{screen:[Ha]},Ha]}],h:[{h:[st,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[st,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[st,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[st,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ha,ja]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Nm]}],"font-family":[{font:[fu]}],"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",st]}],"line-clamp":[{"line-clamp":["none",il,Nm]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",na,st]}],"list-image":[{"list-image":["none",st]}],"list-style-type":[{list:["none","disc","decimal",st]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...$(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",na,ja]}],"underline-offset":[{"underline-offset":["auto",na,st]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",st]}],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",st]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...H(),gq]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",mq]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},yq]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...$(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:$()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...$()]}],"outline-offset":[{"outline-offset":[na,st]}],"outline-w":[{outline:[na,ja]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:S()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[na,ja]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ha,bq]}],"shadow-color":[{shadow:[fu]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...F(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":F()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Ha,st]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[_]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[_]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",st]}],duration:[{duration:A()}],ease:[{ease:["linear","in","out","in-out",st]}],delay:[{delay:A()}],animate:[{animate:["none","spin","ping","pulse","bounce",st]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[T]}],"scale-x":[{"scale-x":[T]}],"scale-y":[{"scale-y":[T]}],rotate:[{rotate:[du,st]}],"translate-x":[{"translate-x":[P]}],"translate-y":[{"translate-y":[P]}],"skew-x":[{"skew-x":[x]}],"skew-y":[{"skew-y":[x]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",st]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],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",st]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"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","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",st]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[na,ja,Nm]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},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"],size:["w","h"],"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"],"line-clamp":["display","overflow"],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-s","border-color-e","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"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Cq=(e,{cacheSize:t,prefix:n,separator:r,experimentalParseClassName:i,extend:a={},override:o={}})=>{$u(e,"cacheSize",t),$u(e,"prefix",n),$u(e,"separator",r),$u(e,"experimentalParseClassName",i);for(const s in o)xq(e[s],o[s]);for(const s in a)wq(e[s],a[s]);return e},$u=(e,t,n)=>{n!==void 0&&(e[t]=n)},xq=(e,t)=>{if(t)for(const n in t)$u(e,n,t[n])},wq=(e,t)=>{if(t)for(const n in t){const r=t[n];r!==void 0&&(e[n]=(e[n]||[]).concat(r))}},Aq=(e,...t)=>typeof e=="function"?AE(kE,e,...t):AE(()=>Cq(kE(),e),...t);function P7(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=P7(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function kq(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=P7(e))&&(r&&(r+=" "),r+=t);return r}const SE=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,DE=kq,Sq=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return DE(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:a}=t,o=Object.keys(i).map(u=>{const c=n==null?void 0:n[u],d=a==null?void 0:a[u];if(c===null)return null;const f=SE(c)||SE(d);return i[u][f]}),s=n&&Object.entries(n).reduce((u,c)=>{let[d,f]=c;return f===void 0||(u[d]=f),u},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,c)=>{let{class:d,className:f,...h}=c;return Object.entries(h).every(m=>{let[p,y]=m;return Array.isArray(y)?y.includes({...a,...s}[p]):{...a,...s}[p]===y})?[...u,d,f]:u},[]);return DE(e,o,l,n==null?void 0:n.class,n==null?void 0:n.className)};var Dq=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function OE(e){const t={};let n;for(;n=Dq.exec(e);)t[n[1]]=n[2];return t}function Oq(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=OE(e)}else typeof t=="string"&&(t=OE(t));return{...e,...t}}function R7(e,t){e.indexOf(t)===-1&&e.push(t)}function Nq(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const F7=(e,t,n)=>Math.min(Math.max(n,e),t),ui={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},Ic=e=>typeof e=="number",al=e=>Array.isArray(e)&&!Ic(e[0]),Iq=(e,t,n)=>{const r=t-e;return((n-e)%r+r)%r+e};function Pq(e,t){return al(e)?e[Iq(0,e.length,t)]:e}const M7=(e,t,n)=>-n*e+n*t+e,B7=()=>{},to=e=>e,Uy=(e,t,n)=>t-e===0?1:(n-e)/(t-e);function L7(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Uy(0,t,r);e.push(M7(n,1,i))}}function Rq(e){const t=[0];return L7(t,e-1),t}function Fq(e,t=Rq(e.length),n=to){const r=e.length,i=r-t.length;return i>0&&L7(t,i),a=>{let o=0;for(;o<r-2&&!(a<t[o+1]);o++);let s=F7(0,1,Uy(t[o],t[o+1],a));return s=Pq(n,o)(s),M7(e[o],e[o+1],s)}}const $7=e=>Array.isArray(e)&&Ic(e[0]),Wg=e=>typeof e=="object"&&!!e.createAnimation,Pc=e=>typeof e=="function",Mq=e=>typeof e=="string",Im={ms:e=>e*1e3,s:e=>e/1e3},j7=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Bq=1e-7,Lq=12;function $q(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=j7(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>Bq&&++s<Lq);return o}function ju(e,t,n,r){if(e===t&&n===r)return to;const i=a=>$q(a,0,1,e,n);return a=>a===0||a===1?a:j7(i(a),t,r)}const jq=(e,t="end")=>n=>{n=t==="end"?Math.min(n,.999):Math.max(n,.001);const r=n*e,i=t==="end"?Math.floor(r):Math.ceil(r);return F7(0,1,i/e)},Hq={ease:ju(.25,.1,.25,1),"ease-in":ju(.42,0,1,1),"ease-in-out":ju(.42,0,.58,1),"ease-out":ju(0,0,.58,1)},Uq=/\((.*?)\)/;function NE(e){if(Pc(e))return e;if($7(e))return ju(...e);const t=Hq[e];if(t)return t;if(e.startsWith("steps")){const n=Uq.exec(e);if(n){const r=n[1].split(",");return jq(parseFloat(r[0]),r[1].trim())}}return to}class zq{constructor(t,n=[0,1],{easing:r,duration:i=ui.duration,delay:a=ui.delay,endDelay:o=ui.endDelay,repeat:s=ui.repeat,offset:l,direction:u="normal",autoplay:c=!0}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=to,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise((f,h)=>{this.resolve=f,this.reject=h}),r=r||ui.easing,Wg(r)){const f=r.createAnimation(n);r=f.easing,n=f.keyframes||n,i=f.duration||i}this.repeat=s,this.easing=al(r)?to:NE(r),this.updateDuration(i);const d=Fq(n,l,al(r)?r.map(NE):to);this.tick=f=>{var h;a=a;let m=0;this.pauseTime!==void 0?m=this.pauseTime:m=(f-this.startTime)*this.rate,this.t=m,m/=1e3,m=Math.max(m-a,0),this.playState==="finished"&&this.pauseTime===void 0&&(m=this.totalDuration);const p=m/this.duration;let y=Math.floor(p),v=p%1;!v&&p>=1&&(v=1),v===1&&y--;const b=y%2;(u==="reverse"||u==="alternate"&&b||u==="alternate-reverse"&&!b)&&(v=1-v);const _=m>=this.totalDuration?1:Math.min(v,1),T=d(this.easing(_));t(T),this.pauseTime===void 0&&(this.playState==="finished"||m>=this.totalDuration+o)?(this.playState="finished",(h=this.resolve)===null||h===void 0||h.call(this,T)):this.playState!=="idle"&&(this.frameRequestId=requestAnimationFrame(this.tick))},c&&this.play()}play(){const t=performance.now();this.playState="running",this.pauseTime!==void 0?this.startTime=t-this.pauseTime:this.startTime||(this.startTime=t),this.cancelTimestamp=this.startTime,this.pauseTime=void 0,this.frameRequestId=requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=this.t}finish(){this.playState="finished",this.tick(0)}stop(){var t;this.playState="idle",this.frameRequestId!==void 0&&cancelAnimationFrame(this.frameRequestId),(t=this.reject)===null||t===void 0||t.call(this,!1)}cancel(){this.stop(),this.tick(this.cancelTimestamp)}reverse(){this.rate*=-1}commitStyles(){}updateDuration(t){this.duration=t,this.totalDuration=t*(this.repeat+1)}get currentTime(){return this.t}set currentTime(t){this.pauseTime!==void 0||this.rate===0?this.pauseTime=t:this.startTime=performance.now()-t/this.rate}get playbackRate(){return this.rate}set playbackRate(t){this.rate=t}}var H7=function(){};process.env.NODE_ENV!=="production"&&(H7=function(e,t){if(!e)throw new Error(t)});class Vq{setAnimation(t){this.animation=t,t==null||t.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}}const Pm=new WeakMap;function U7(e){return Pm.has(e)||Pm.set(e,{transforms:[],values:new Map}),Pm.get(e)}function qq(e,t){return e.has(t)||e.set(t,new Vq),e.get(t)}const Wq=["","X","Y","Z"],Kq=["translate","scale","rotate","skew"],Al={x:"translateX",y:"translateY",z:"translateZ"},IE={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:e=>e+"deg"},Gq={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:e=>e+"px"},rotate:IE,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:to},skew:IE},kl=new Map,Mh=e=>`--motion-${e}`,zf=["x","y","z"];Kq.forEach(e=>{Wq.forEach(t=>{zf.push(e+t),kl.set(Mh(e+t),Gq[e])})});const Yq=(e,t)=>zf.indexOf(e)-zf.indexOf(t),Zq=new Set(zf),zy=e=>Zq.has(e),Qq=(e,t)=>{Al[t]&&(t=Al[t]);const{transforms:n}=U7(e);R7(n,t),e.style.transform=z7(n)},z7=e=>e.sort(Yq).reduce(Xq,"").trim(),Xq=(e,t)=>`${e} ${t}(var(${Mh(t)}))`,Kg=e=>e.startsWith("--"),PE=new Set;function Jq(e){if(!PE.has(e)){PE.add(e);try{const{syntax:t,initialValue:n}=kl.has(e)?kl.get(e):{};CSS.registerProperty({name:e,inherits:!1,syntax:t,initialValue:n})}catch{}}}const Rm=(e,t)=>document.createElement("div").animate(e,t),RE={cssRegisterProperty:()=>typeof CSS<"u"&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{Rm({opacity:[1]})}catch{return!1}return!0},finished:()=>!!Rm({opacity:[0,1]},{duration:.001}).finished,linearEasing:()=>{try{Rm({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0}},Fm={},Zs={};for(const e in RE)Zs[e]=()=>(Fm[e]===void 0&&(Fm[e]=RE[e]()),Fm[e]);const eW=.015,tW=(e,t)=>{let n="";const r=Math.round(t/eW);for(let i=0;i<r;i++)n+=e(Uy(0,r-1,i))+", ";return n.substring(0,n.length-2)},FE=(e,t)=>Pc(e)?Zs.linearEasing()?`linear(${tW(e,t)})`:ui.easing:$7(e)?nW(e):e,nW=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`;function rW(e,t){for(let n=0;n<e.length;n++)e[n]===null&&(e[n]=n?e[n-1]:t());return e}const iW=e=>Array.isArray(e)?e:[e];function Gg(e){return Al[e]&&(e=Al[e]),zy(e)?Mh(e):e}const Hu={get:(e,t)=>{t=Gg(t);let n=Kg(t)?e.style.getPropertyValue(t):getComputedStyle(e)[t];if(!n&&n!==0){const r=kl.get(t);r&&(n=r.initialValue)}return n},set:(e,t,n)=>{t=Gg(t),Kg(t)?e.style.setProperty(t,n):e.style[t]=n}};function aW(e,t=!0){if(!(!e||e.playState==="finished"))try{e.stop?e.stop():(t&&e.commitStyles(),e.cancel())}catch{}}function oW(e,t){var n;let r=(t==null?void 0:t.toDefaultUnit)||to;const i=e[e.length-1];if(Mq(i)){const a=((n=i.match(/(-?[\d.]+)([a-z%]*)/))===null||n===void 0?void 0:n[2])||"";a&&(r=o=>o+a)}return r}function sW(){return window.__MOTION_DEV_TOOLS_RECORD}function lW(e,t,n,r={},i){const a=sW(),o=r.record!==!1&&a;let s,{duration:l=ui.duration,delay:u=ui.delay,endDelay:c=ui.endDelay,repeat:d=ui.repeat,easing:f=ui.easing,persist:h=!1,direction:m,offset:p,allowWebkitAcceleration:y=!1,autoplay:v=!0}=r;const b=U7(e),_=zy(t);let T=Zs.waapi();_&&Qq(e,t);const C=Gg(t),x=qq(b.values,C),w=kl.get(C);return aW(x.animation,!(Wg(f)&&x.generator)&&r.record!==!1),()=>{const P=()=>{var R,D;return(D=(R=Hu.get(e,C))!==null&&R!==void 0?R:w==null?void 0:w.initialValue)!==null&&D!==void 0?D:0};let O=rW(iW(n),P);const M=oW(O,w);if(Wg(f)){const R=f.createAnimation(O,t!=="opacity",P,C,x);f=R.easing,O=R.keyframes||O,l=R.duration||l}if(Kg(C)&&(Zs.cssRegisterProperty()?Jq(C):T=!1),_&&!Zs.linearEasing()&&(Pc(f)||al(f)&&f.some(Pc))&&(T=!1),T){w&&(O=O.map(S=>Ic(S)?w.toDefaultUnit(S):S)),O.length===1&&(!Zs.partialKeyframes()||o)&&O.unshift(P());const R={delay:Im.ms(u),duration:Im.ms(l),endDelay:Im.ms(c),easing:al(f)?void 0:FE(f,l),direction:m,iterations:d+1,fill:"both"};s=e.animate({[C]:O,offset:p,easing:al(f)?f.map(S=>FE(S,l)):void 0},R),s.finished||(s.finished=new Promise((S,B)=>{s.onfinish=S,s.oncancel=B}));const D=O[O.length-1];s.finished.then(()=>{h||(Hu.set(e,C,D),s.cancel())}).catch(B7),y||(s.playbackRate=1.000001)}else if(i&&_)O=O.map(R=>typeof R=="string"?parseFloat(R):R),O.length===1&&O.unshift(parseFloat(P())),s=new i(R=>{Hu.set(e,C,M?M(R):R)},O,Object.assign(Object.assign({},r),{duration:l,easing:f}));else{const R=O[O.length-1];Hu.set(e,C,w&&Ic(R)?w.toDefaultUnit(R):R)}return o&&a(e,t,O,{duration:l,delay:u,easing:f,repeat:d,offset:p},"motion-one"),x.setAnimation(s),s&&!v&&s.pause(),s}}const uW=(e,t)=>e[t]?Object.assign(Object.assign({},e),e[t]):Object.assign({},e);function cW(e,t){var n;return typeof e=="string"?t?((n=t[e])!==null&&n!==void 0||(t[e]=document.querySelectorAll(e)),e=t[e]):e=document.querySelectorAll(e):e instanceof Element&&(e=[e]),Array.from(e||[])}const dW={any:0,all:1};function fW(e,t,{root:n,margin:r,amount:i="any"}={}){if(typeof IntersectionObserver>"u")return()=>{};const a=cW(e),o=new WeakMap,s=u=>{u.forEach(c=>{const d=o.get(c.target);if(c.isIntersecting!==!!d)if(c.isIntersecting){const f=t(c);Pc(f)?o.set(c.target,f):l.unobserve(c.target)}else d&&(d(c),o.delete(c.target))})},l=new IntersectionObserver(s,{root:n,rootMargin:r,threshold:typeof i=="number"?i:dW[i]});return a.forEach(u=>l.observe(u)),()=>l.disconnect()}function hW(e,t){return typeof e!=typeof t?!0:Array.isArray(e)&&Array.isArray(t)?!pW(e,t):e!==t}function pW(e,t){const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function mW(e){return typeof e=="object"}function ME(e,t){if(mW(e))return e;if(e&&t)return t[e]}let no;function gW(){if(!no)return;const e=no.sort(yW).map(bW);e.forEach(BE),e.forEach(BE),no=void 0}function Mm(e){no?R7(no,e):(no=[e],requestAnimationFrame(gW))}function vW(e){no&&Nq(no,e)}const yW=(e,t)=>e.getDepth()-t.getDepth(),bW=e=>e.animateUpdates(),BE=e=>e.next(),LE=(e,t)=>new CustomEvent(e,{detail:{target:t}});function Yg(e,t,n){e.dispatchEvent(new CustomEvent(t,{detail:{originalEvent:n}}))}function $E(e,t,n){e.dispatchEvent(new CustomEvent(t,{detail:{originalEntry:n}}))}const EW={isActive:e=>!!e.inView,subscribe:(e,{enable:t,disable:n},{inViewOptions:r={}})=>{const{once:i}=r,a=NC.__rest(r,["once"]);return fW(e,o=>{if(t(),$E(e,"viewenter",o),!i)return s=>{n(),$E(e,"viewleave",s)}},a)}},jE=(e,t,n)=>r=>{r.pointerType&&r.pointerType!=="mouse"||(n(),Yg(e,t,r))},_W={isActive:e=>!!e.hover,subscribe:(e,{enable:t,disable:n})=>{const r=jE(e,"hoverstart",t),i=jE(e,"hoverend",n);return e.addEventListener("pointerenter",r),e.addEventListener("pointerleave",i),()=>{e.removeEventListener("pointerenter",r),e.removeEventListener("pointerleave",i)}}},TW={isActive:e=>!!e.press,subscribe:(e,{enable:t,disable:n})=>{const r=a=>{n(),Yg(e,"pressend",a),window.removeEventListener("pointerup",r)},i=a=>{t(),Yg(e,"pressstart",a),window.addEventListener("pointerup",r)};return e.addEventListener("pointerdown",i),()=>{e.removeEventListener("pointerdown",i),window.removeEventListener("pointerup",r)}}},Ud={inView:EW,hover:_W,press:TW},HE=["initial","animate",...Object.keys(Ud),"exit"],Zg=new WeakMap;function CW(e={},t){let n,r=t?t.getDepth()+1:0;const i={initial:!0,animate:!0},a={},o={};for(const p of HE)o[p]=typeof e[p]=="string"?e[p]:t==null?void 0:t.getContext()[p];const s=e.initial===!1?"animate":"initial";let l=ME(e[s]||o[s],e.variants)||{},u=NC.__rest(l,["transition"]);const c=Object.assign({},u);function*d(){var p,y;const v=u;u={};const b={};for(const w of HE){if(!i[w])continue;const P=ME(e[w]);if(P)for(const O in P)O!=="transition"&&(u[O]=P[O],b[O]=uW((y=(p=P.transition)!==null&&p!==void 0?p:e.transition)!==null&&y!==void 0?y:{},O))}const _=new Set([...Object.keys(u),...Object.keys(v)]),T=[];_.forEach(w=>{var P;u[w]===void 0&&(u[w]=c[w]),hW(v[w],u[w])&&((P=c[w])!==null&&P!==void 0||(c[w]=Hu.get(n,w)),T.push(lW(n,w,u[w],b[w],zq)))}),yield;const C=T.map(w=>w()).filter(Boolean);if(!C.length)return;const x=u;n.dispatchEvent(LE("motionstart",x)),Promise.all(C.map(w=>w.finished)).then(()=>{n.dispatchEvent(LE("motioncomplete",x))}).catch(B7)}const f=(p,y)=>()=>{i[p]=y,Mm(m)},h=()=>{for(const p in Ud){const y=Ud[p].isActive(e),v=a[p];y&&!v?a[p]=Ud[p].subscribe(n,{enable:f(p,!0),disable:f(p,!1)},e):!y&&v&&(v(),delete a[p])}},m={update:p=>{n&&(e=p,h(),Mm(m))},setActive:(p,y)=>{n&&(i[p]=y,Mm(m))},animateUpdates:d,getDepth:()=>r,getTarget:()=>u,getOptions:()=>e,getContext:()=>o,mount:p=>(H7(!!p,"Animation state must be mounted with valid Element"),n=p,Zg.set(n,m),h(),()=>{Zg.delete(n),vW(m);for(const y in a)a[y]()}),isMounted:()=>!!n};return m}function xW(e){const t={},n=[];for(let r in e){const i=e[r];zy(r)&&(Al[r]&&(r=Al[r]),n.push(r),r=Mh(r));let a=Array.isArray(i)?i[0]:i;const o=kl.get(r);o&&(a=Ic(i)?o.toDefaultUnit(i):i),t[r]=a}return n.length&&(t.transform=z7(n)),t}var UE=e=>e instanceof Element;function Qg(e,t){if(t(e))return e;if(typeof e=="function"&&!e.length)return Qg(e(),t);if(Array.isArray(e))for(const n of e){const r=Qg(n,t);if(r)return r}return null}function wW(e,t=UE,n=UE){const r=He(e);return He(()=>Qg(r(),t))}var AW=()=>{},zE=(e,t)=>t();function kW(e,t){const n=xn(e),r=n?[n]:[],{onEnter:i=zE,onExit:a=zE}=t,[o,s]=Me(t.appear?[]:r),[l]=hV();let u,c=!1;function d(m,p){if(!m)return p&&p();c=!0,a(m,()=>{xl(()=>{c=!1,s(y=>y.filter(v=>v!==m)),p&&p()})})}function f(m){const p=u;if(!p)return m&&m();u=void 0,s(y=>[p,...y]),i(p,m??AW)}const h=t.mode==="out-in"?m=>c||d(m,f):t.mode==="in-out"?m=>f(()=>d(m)):m=>{d(m),f()};return Bf(m=>{const p=e();return xn(l)?(l(),m):(p!==m&&(u=p,xl(()=>xn(()=>h(m)))),p)},t.appear?void 0:n),o}var V7=vi(),SW=e=>{const[t,n]=Me(!0),r={initial:e.initial??!0,mount:t},i=Z(V7.Provider,{value:r,get children(){return kW(wW(()=>e.children),{appear:r.initial,mode:e.exitBeforeEnter?"out-in":"parallel",onExit(a,o){xl(()=>{var s;n(!1),(s=Zg.get(a))!=null&&s.getOptions().exit?a.addEventListener("motioncomplete",o):o()})},onEnter(a,o){xl(()=>{n(!0),o()})}})}});return r.initial=!0,i};function DW(e,t,n,r){const i=CW((n==null?void 0:n.initial)===!1?{...t(),initial:!1}:t(),r);return cn(()=>{if(n&&!n.mount())return;const a=e(),o=i.mount(a);cn(()=>i.update(t())),dn(()=>{n&&t().exit?(i.setActive("exit",!0),a.addEventListener("motioncomplete",o)):o()})}),[i,xW(i.getTarget())]}var OW=["initial","animate","inView","inViewOptions","hover","press","variants","transition","exit"],NW=["tag"],VE=vi(),qE=e=>{const[t,,n]=wn(e,OW,NW),[r,i]=DW(()=>a,()=>({...t}),lr(V7),lr(VE));let a;return Z(VE.Provider,{value:r,get children(){return Z(Fh,At(n,{ref:o=>{var s;a=o,(s=e.ref)==null||s.call(e,o)},get component(){return e.tag||"div"},get style(){return Oq(e.style,i)}}))}})},WE=new Proxy(qE,{get:(e,t)=>n=>Z(qE,At(n,{tag:t}))});const IW=Math.min,PW=Math.max,RW={left:"right",right:"left",bottom:"top",top:"bottom"},FW={start:"end",end:"start"};function KE(e,t,n){return PW(e,IW(t,n))}function Bh(e,t){return typeof e=="function"?e(t):e}function rs(e){return e.split("-")[0]}function Lh(e){return e.split("-")[1]}function q7(e){return e==="x"?"y":"x"}function W7(e){return e==="y"?"height":"width"}function $h(e){return["top","bottom"].includes(rs(e))?"y":"x"}function K7(e){return q7($h(e))}function MW(e,t,n){n===void 0&&(n=!1);const r=Lh(e),i=K7(e),a=W7(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=Vf(o)),[o,Vf(o)]}function BW(e){const t=Vf(e);return[Xg(e),t,Xg(t)]}function Xg(e){return e.replace(/start|end/g,t=>FW[t])}function LW(e,t,n){const r=["left","right"],i=["right","left"],a=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?a:o;default:return[]}}function $W(e,t,n,r){const i=Lh(e);let a=LW(rs(e),n==="start",r);return i&&(a=a.map(o=>o+"-"+i),t&&(a=a.concat(a.map(Xg)))),a}function Vf(e){return e.replace(/left|right|bottom|top/g,t=>RW[t])}function jW(e){return{top:0,right:0,bottom:0,left:0,...e}}function HW(e){return typeof e!="number"?jW(e):{top:e,right:e,bottom:e,left:e}}function qf(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function GE(e,t,n){let{reference:r,floating:i}=e;const a=$h(t),o=K7(t),s=W7(o),l=rs(t),u=a==="y",c=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2;let h;switch(l){case"top":h={x:c,y:r.y-i.height};break;case"bottom":h={x:c,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-i.width,y:d};break;default:h={x:r.x,y:r.y}}switch(Lh(t)){case"start":h[o]-=f*(n&&u?-1:1);break;case"end":h[o]+=f*(n&&u?-1:1);break}return h}const UW=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:o}=n,s=a.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:d}=GE(u,r,l),f=r,h={},m=0;for(let p=0;p<s.length;p++){const{name:y,fn:v}=s[p],{x:b,y:_,data:T,reset:C}=await v({x:c,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:h,rects:u,platform:o,elements:{reference:e,floating:t}});c=b??c,d=_??d,h={...h,[y]:{...h[y],...T}},C&&m<=50&&(m++,typeof C=="object"&&(C.placement&&(f=C.placement),C.rects&&(u=C.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):C.rects),{x:c,y:d}=GE(u,f,l)),p=-1)}return{x:c,y:d,placement:f,strategy:i,middlewareData:h}};async function G7(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:a,rects:o,elements:s,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=Bh(t,e),m=HW(h),y=s[f?d==="floating"?"reference":"floating":d],v=qf(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(y)))==null||n?y:y.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:l})),b=d==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,_=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),T=await(a.isElement==null?void 0:a.isElement(_))?await(a.getScale==null?void 0:a.getScale(_))||{x:1,y:1}:{x:1,y:1},C=qf(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:b,offsetParent:_,strategy:l}):b);return{top:(v.top-C.top+m.top)/T.y,bottom:(C.bottom-v.bottom+m.bottom)/T.y,left:(v.left-C.left+m.left)/T.x,right:(C.right-v.right+m.right)/T.x}}const zW=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:a,rects:o,initialPlacement:s,platform:l,elements:u}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:p=!0,...y}=Bh(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const v=rs(i),b=rs(s)===s,_=await(l.isRTL==null?void 0:l.isRTL(u.floating)),T=f||(b||!p?[Vf(s)]:BW(s));!f&&m!=="none"&&T.push(...$W(s,p,m,_));const C=[s,...T],x=await G7(t,y),w=[];let P=((r=a.flip)==null?void 0:r.overflows)||[];if(c&&w.push(x[v]),d){const D=MW(i,o,_);w.push(x[D[0]],x[D[1]])}if(P=[...P,{placement:i,overflows:w}],!w.every(D=>D<=0)){var O,M;const D=(((O=a.flip)==null?void 0:O.index)||0)+1,S=C[D];if(S)return{data:{index:D,overflows:P},reset:{placement:S}};let B=(M=P.filter(H=>H.overflows[0]<=0).sort((H,$)=>H.overflows[1]-$.overflows[1])[0])==null?void 0:M.placement;if(!B)switch(h){case"bestFit":{var R;const H=(R=P.map($=>[$.placement,$.overflows.filter(F=>F>0).reduce((F,ne)=>F+ne,0)]).sort(($,F)=>$[1]-F[1])[0])==null?void 0:R[0];H&&(B=H);break}case"initialPlacement":B=s;break}if(i!==B)return{reset:{placement:B}}}return{}}}};async function VW(e,t){const{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=rs(n),s=Lh(n),l=$h(n)==="y",u=["left","top"].includes(o)?-1:1,c=a&&l?-1:1,d=Bh(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&typeof m=="number"&&(h=s==="end"?m*-1:m),l?{x:h*c,y:f*u}:{x:f*u,y:h*c}}const qW=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:a,placement:o,middlewareData:s}=t,l=await VW(t,e);return o===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:a+l.y,data:{...l,placement:o}}}}},WW=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:s={fn:y=>{let{x:v,y:b}=y;return{x:v,y:b}}},...l}=Bh(e,t),u={x:n,y:r},c=await G7(t,l),d=$h(rs(i)),f=q7(d);let h=u[f],m=u[d];if(a){const y=f==="y"?"top":"left",v=f==="y"?"bottom":"right",b=h+c[y],_=h-c[v];h=KE(b,h,_)}if(o){const y=d==="y"?"top":"left",v=d==="y"?"bottom":"right",b=m+c[y],_=m-c[v];m=KE(b,m,_)}const p=s.fn({...t,[f]:h,[d]:m});return{...p,data:{x:p.x-n,y:p.y-r}}}}},Jg=Math.min,ol=Math.max,Wf=Math.round,F1=Math.floor,Mi=e=>({x:e,y:e});function jh(){return typeof window<"u"}function ql(e){return Y7(e)?(e.nodeName||"").toLowerCase():"#document"}function _r(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Qi(e){var t;return(t=(Y7(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Y7(e){return jh()?e instanceof Node||e instanceof _r(e).Node:!1}function pi(e){return jh()?e instanceof Element||e instanceof _r(e).Element:!1}function Ki(e){return jh()?e instanceof HTMLElement||e instanceof _r(e).HTMLElement:!1}function YE(e){return!jh()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof _r(e).ShadowRoot}function Kc(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=mi(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function KW(e){return["table","td","th"].includes(ql(e))}function Hh(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Vy(e){const t=qy(),n=pi(e)?mi(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function GW(e){let t=so(e);for(;Ki(t)&&!Sl(t);){if(Vy(t))return t;if(Hh(t))return null;t=so(t)}return null}function qy(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Sl(e){return["html","body","#document"].includes(ql(e))}function mi(e){return _r(e).getComputedStyle(e)}function Uh(e){return pi(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function so(e){if(ql(e)==="html")return e;const t=e.assignedSlot||e.parentNode||YE(e)&&e.host||Qi(e);return YE(t)?t.host:t}function Z7(e){const t=so(e);return Sl(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ki(t)&&Kc(t)?t:Z7(t)}function Rc(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Z7(e),a=i===((r=e.ownerDocument)==null?void 0:r.body),o=_r(i);if(a){const s=ev(o);return t.concat(o,o.visualViewport||[],Kc(i)?i:[],s&&n?Rc(s):[])}return t.concat(i,Rc(i,[],n))}function ev(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Q7(e){const t=mi(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Ki(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Wf(n)!==a||Wf(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Wy(e){return pi(e)?e:e.contextElement}function sl(e){const t=Wy(e);if(!Ki(t))return Mi(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Q7(t);let o=(a?Wf(n.width):n.width)/r,s=(a?Wf(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}const YW=Mi(0);function X7(e){const t=_r(e);return!qy()||!t.visualViewport?YW:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ZW(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==_r(e)?!1:t}function is(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),a=Wy(e);let o=Mi(1);t&&(r?pi(r)&&(o=sl(r)):o=sl(e));const s=ZW(a,n,r)?X7(a):Mi(0);let l=(i.left+s.x)/o.x,u=(i.top+s.y)/o.y,c=i.width/o.x,d=i.height/o.y;if(a){const f=_r(a),h=r&&pi(r)?_r(r):r;let m=f,p=ev(m);for(;p&&r&&h!==m;){const y=sl(p),v=p.getBoundingClientRect(),b=mi(p),_=v.left+(p.clientLeft+parseFloat(b.paddingLeft))*y.x,T=v.top+(p.clientTop+parseFloat(b.paddingTop))*y.y;l*=y.x,u*=y.y,c*=y.x,d*=y.y,l+=_,u+=T,m=_r(p),p=ev(m)}}return qf({width:c,height:d,x:l,y:u})}function Ky(e,t){const n=Uh(e).scrollLeft;return t?t.left+n:is(Qi(e)).left+n}function J7(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=r.left+t.scrollLeft-(n?0:Ky(e,r)),a=r.top+t.scrollTop;return{x:i,y:a}}function QW(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const a=i==="fixed",o=Qi(r),s=t?Hh(t.floating):!1;if(r===o||s&&a)return n;let l={scrollLeft:0,scrollTop:0},u=Mi(1);const c=Mi(0),d=Ki(r);if((d||!d&&!a)&&((ql(r)!=="body"||Kc(o))&&(l=Uh(r)),Ki(r))){const h=is(r);u=sl(r),c.x=h.x+r.clientLeft,c.y=h.y+r.clientTop}const f=o&&!d&&!a?J7(o,l,!0):Mi(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+f.x,y:n.y*u.y-l.scrollTop*u.y+c.y+f.y}}function XW(e){return Array.from(e.getClientRects())}function JW(e){const t=Qi(e),n=Uh(e),r=e.ownerDocument.body,i=ol(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=ol(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+Ky(e);const s=-n.scrollTop;return mi(r).direction==="rtl"&&(o+=ol(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}function eK(e,t){const n=_r(e),r=Qi(e),i=n.visualViewport;let a=r.clientWidth,o=r.clientHeight,s=0,l=0;if(i){a=i.width,o=i.height;const u=qy();(!u||u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:a,height:o,x:s,y:l}}function tK(e,t){const n=is(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Ki(e)?sl(e):Mi(1),o=e.clientWidth*a.x,s=e.clientHeight*a.y,l=i*a.x,u=r*a.y;return{width:o,height:s,x:l,y:u}}function ZE(e,t,n){let r;if(t==="viewport")r=eK(e,n);else if(t==="document")r=JW(Qi(e));else if(pi(t))r=tK(t,n);else{const i=X7(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return qf(r)}function e6(e,t){const n=so(e);return n===t||!pi(n)||Sl(n)?!1:mi(n).position==="fixed"||e6(n,t)}function nK(e,t){const n=t.get(e);if(n)return n;let r=Rc(e,[],!1).filter(s=>pi(s)&&ql(s)!=="body"),i=null;const a=mi(e).position==="fixed";let o=a?so(e):e;for(;pi(o)&&!Sl(o);){const s=mi(o),l=Vy(o);!l&&s.position==="fixed"&&(i=null),(a?!l&&!i:!l&&s.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Kc(o)&&!l&&e6(e,o))?r=r.filter(c=>c!==o):i=s,o=so(o)}return t.set(e,r),r}function rK(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?Hh(t)?[]:nK(t,this._c):[].concat(n),r],s=o[0],l=o.reduce((u,c)=>{const d=ZE(t,c,i);return u.top=ol(d.top,u.top),u.right=Jg(d.right,u.right),u.bottom=Jg(d.bottom,u.bottom),u.left=ol(d.left,u.left),u},ZE(t,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function iK(e){const{width:t,height:n}=Q7(e);return{width:t,height:n}}function aK(e,t,n){const r=Ki(t),i=Qi(t),a=n==="fixed",o=is(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=Mi(0);if(r||!r&&!a)if((ql(t)!=="body"||Kc(i))&&(s=Uh(t)),r){const f=is(t,!0,a,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else i&&(l.x=Ky(i));const u=i&&!r&&!a?J7(i,s):Mi(0),c=o.left+s.scrollLeft-l.x-u.x,d=o.top+s.scrollTop-l.y-u.y;return{x:c,y:d,width:o.width,height:o.height}}function Bm(e){return mi(e).position==="static"}function QE(e,t){if(!Ki(e)||mi(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Qi(e)===n&&(n=n.ownerDocument.body),n}function t6(e,t){const n=_r(e);if(Hh(e))return n;if(!Ki(e)){let i=so(e);for(;i&&!Sl(i);){if(pi(i)&&!Bm(i))return i;i=so(i)}return n}let r=QE(e,t);for(;r&&KW(r)&&Bm(r);)r=QE(r,t);return r&&Sl(r)&&Bm(r)&&!Vy(r)?n:r||GW(e)||n}const oK=async function(e){const t=this.getOffsetParent||t6,n=this.getDimensions,r=await n(e.floating);return{reference:aK(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function sK(e){return mi(e).direction==="rtl"}const lK={convertOffsetParentRelativeRectToViewportRelativeRect:QW,getDocumentElement:Qi,getClippingRect:rK,getOffsetParent:t6,getElementRects:oK,getClientRects:XW,getDimensions:iK,getScale:sl,isElement:pi,isRTL:sK};function uK(e,t){let n=null,r;const i=Qi(e);function a(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function o(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),a();const{left:u,top:c,width:d,height:f}=e.getBoundingClientRect();if(s||t(),!d||!f)return;const h=F1(c),m=F1(i.clientWidth-(u+d)),p=F1(i.clientHeight-(c+f)),y=F1(u),b={rootMargin:-h+"px "+-m+"px "+-p+"px "+-y+"px",threshold:ol(0,Jg(1,l))||1};let _=!0;function T(C){const x=C[0].intersectionRatio;if(x!==l){if(!_)return o();x?o(!1,x):r=setTimeout(()=>{o(!1,1e-7)},1e3)}_=!1}try{n=new IntersectionObserver(T,{...b,root:i.ownerDocument})}catch{n=new IntersectionObserver(T,b)}n.observe(e)}return o(!0),a}function n6(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=Wy(e),c=i||a?[...u?Rc(u):[],...Rc(t)]:[];c.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),a&&v.addEventListener("resize",n)});const d=u&&s?uK(u,n):null;let f=-1,h=null;o&&(h=new ResizeObserver(v=>{let[b]=v;b&&b.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var _;(_=h)==null||_.observe(t)})),n()}),u&&!l&&h.observe(u),h.observe(t));let m,p=l?is(e):null;l&&y();function y(){const v=is(e);p&&(v.x!==p.x||v.y!==p.y||v.width!==p.width||v.height!==p.height)&&n(),p=v,m=requestAnimationFrame(y)}return n(),()=>{var v;c.forEach(b=>{i&&b.removeEventListener("scroll",n),a&&b.removeEventListener("resize",n)}),d==null||d(),(v=h)==null||v.disconnect(),h=null,l&&cancelAnimationFrame(m)}}const r6=qW,i6=WW,a6=zW,cK=(e,t,n)=>{const r=new Map,i={platform:lK,...n},a={...i.platform,_c:r};return UW(e,t,{...i,platform:a})};function o6(e,t,n){let r=()=>{var d;return(d=n==null?void 0:n.placement)!=null?d:"bottom"},i=()=>{var d;return(d=n==null?void 0:n.strategy)!=null?d:"absolute"},[a,o]=Me({x:null,y:null,placement:r(),strategy:i(),middlewareData:{}}),[s,l]=Me();cn(()=>{let d=s();if(d)throw d.value});let u=He(()=>(e(),t(),{}));function c(){let d=e(),f=t();if(d&&f){let h=u();cK(d,f,{middleware:n==null?void 0:n.middleware,placement:r(),strategy:i()}).then(m=>{h===u()&&o(m)},m=>{l(m)})}}return cn(()=>{let d=e(),f=t();if(n==null||n.middleware,r(),i(),d&&f)if(n!=null&&n.whileElementsMounted){let h=n.whileElementsMounted(d,f,c);h&&dn(h)}else c()}),{get x(){return a().x},get y(){return a().y},get placement(){return a().placement},get strategy(){return a().strategy},get middlewareData(){return a().middlewareData},update:c}}var dK={colorPrimary:"#0081F1",colorPrimaryForeground:"white",colorSecondary:"#F3F3F3",colorSecondaryForeground:"#1A1523",colorCounter:"#E5484D",colorCounterForeground:"white",colorBackground:"#FCFCFC",colorForeground:"#1A1523",colorNeutral:"#525252",colorShadow:"rgba(122,133,153,0.25)",fontSize:"inherit",borderRadius:"0.375rem"},fK={locale:"en-US","inbox.filters.dropdownOptions.unread":"Unread only","inbox.filters.dropdownOptions.default":"Unread & read","inbox.filters.dropdownOptions.archived":"Archived","inbox.filters.labels.unread":"Unread","inbox.filters.labels.default":"Inbox","inbox.filters.labels.archived":"Archived","notifications.emptyNotice":"No notifications","notifications.actions.readAll":"Mark all as read","notifications.actions.archiveAll":"Archive all","notifications.actions.archiveRead":"Archive read","notifications.newNotifications":({notificationCount:e})=>`${e>99?"99+":e} new ${e===1?"notification":"notifications"}`,"notification.actions.read.tooltip":"Mark as read","notification.actions.unread.tooltip":"Mark as unread","notification.actions.archive.tooltip":"Archive","notification.actions.unarchive.tooltip":"Unarchive","preferences.title":"Notification Preferences","preferences.global":"Global Preferences","preferences.workflow.disabled.notice":"Contact admin to enable subscription management for this critical notification.","preferences.workflow.disabled.tooltip":"Contact admin to edit"},[hK,pK]=Me({}),XE=["button","popoverContent","popoverTrigger","dropdownContent","dropdownTrigger","dropdownItem","dropdownItemLabel","dropdownItemLabelContainer","dropdownItemLeftIcon","dropdownItemRightIcon","tooltipContent","tooltipTrigger","back__button","skeletonText","skeletonAvatar","tabsRoot","tabsList","tabsContent","tabsTrigger","dots","root","bellIcon","bellContainer","bellDot","preferences__button","preferencesContainer","inboxHeader","loading","inboxContent","inbox__popoverTrigger","inbox__popoverContent","notificationListContainer","notificationList","notificationListEmptyNoticeContainer","notificationListEmptyNotice","notificationListEmptyNoticeIcon","notificationListNewNotificationsNotice__button","notification","notificationDot","notificationSubject","notificationSubject__strong","notificationBody","notificationBody__strong","notificationBodyContainer","notificationImage","notificationDate","notificationDefaultActions","notificationCustomActions","notificationPrimaryAction__button","notificationSecondaryAction__button","notificationRead__button","notificationUnread__button","notificationArchive__button","notificationUnarchive__button","notificationsTabs__tabsRoot","notificationsTabs__tabsList","notificationsTabs__tabsContent","notificationsTabs__tabsTrigger","notificationsTabsTriggerLabel","notificationsTabsTriggerCount","inboxStatus__title","inboxStatus__dropdownTrigger","inboxStatus__dropdownContent","inboxStatus__dropdownItem","inboxStatus__dropdownItemLabel","inboxStatus__dropdownItemLabelContainer","inboxStatus__dropdownItemLeft__icon","inboxStatus__dropdownItemRight__icon","moreActionsContainer","moreActions__dropdownTrigger","moreActions__dropdownContent","moreActions__dropdownItem","moreActions__dropdownItemLabel","moreActions__dropdownItemLeft__icon","moreActions__dots","moreTabs__button","moreTabs__dots","moreTabs__dropdownTrigger","moreTabs__dropdownContent","moreTabs__dropdownItem","moreTabs__dropdownItemLabel","moreTabs__dropdownItemRight__icon","workflowContainer","workflowLabel","workflowLabelContainer","workflowContainerDisabledNotice","workflowLabelDisabled__icon","workflowContainerRight__icon","workflowArrow__icon","channelContainer","channelsContainerCollapsible","channelsContainer","channelLabel","channelLabelContainer","channelDescription","channelName","channelSwitchContainer","channelSwitch","channelSwitchThumb","preferencesHeader","preferencesHeader__back__button","preferencesHeader__title","preferencesLoadingContainer","strong"];function mK(e){const[t,n]=Me([]),[r,i]=Me(!0),[a,o]=Me(0),[s,l]=Me(!1),[u,{mutate:c,refetch:d}]=p7(a,e);let f=()=>{};{const m=new IntersectionObserver(p=>{p.length>0&&p[0].isIntersecting&&!s()&&!u.loading&&o(o(t().length))});dn(()=>m.disconnect()),f=p=>{m.observe(p),dn(()=>m.unobserve(p))}}return Bf(()=>{const m=u.latest;m&&(i(!1),xl(()=>{m.hasMore||l(!0),n(m.data)}))}),[t,{initialLoading:r,setEl:f,offset:a,end:s,mutate:c,reset:()=>Ve(this,null,function*(){n([]),i(!0),l(!1),a()!==0?o(0):yield d()})}]}var gK="en-US",xo={inMinute:60,inHour:3600,inDay:86400,inWeek:604800,inMonth:2592e3};function vK({fromDate:e,locale:t=gK,toDate:n=new Date}){const r=n.getTime()-e.getTime(),i=new Intl.RelativeTimeFormat(t,{style:"narrow"}),a=Math.floor(r/1e3);return a<xo.inMinute?"Just now":a<xo.inHour?i.format(Math.floor(-a/xo.inMinute),"minute"):a<xo.inDay?i.format(Math.floor(-a/xo.inHour),"hour"):a<xo.inMonth?i.format(Math.floor(-a/xo.inDay),"day"):new Intl.DateTimeFormat(t,{month:"short",day:"numeric"}).format(e)}var yK=Aq({prefix:"nt-"});function Bn(...e){return yK(KV(e))}function s6(e){const t="abcdefghijklmnopqrstuvwxyz";let n="";const r=t.length;for(let i=0;i<e;i+=1)n+=t.charAt(Math.floor(Math.random()*r));return n}function bK(e,t){let n;do n=s6(t);while(e.has(n));return n}function EK(e){return Object.entries(e).map(([t,n])=>`${t.replace(/([A-Z])/g,"-$1").toLowerCase()}: ${n};`).join(" ")}function _K(e,t){const n=`novu-css-${bK(e,8)}`,r=`.${n} { ${t} }`;return e.add(n),{className:n,rule:r}}var Kf=[50,100,200,300,400,500,600,700,800,900];function ra(e){return`.${e.id} { --nv-${e.key}: oklch(from ${e.color} l c h); }`}function JE(e){const t=[];for(let n=0;n<Kf.length;n+=1){const r=Kf[n],i=`.${e.id} { --nv-${e.key}-${r}: oklch(from ${e.color} calc(l - ${(r-500)/1e3}) c h); }`;t.push(i)}return t}function wo(e){const t=[];for(let n=0;n<Kf.length;n+=1){const r=Kf[n],i=`.${e.id} { --nv-${e.key}-${r}: oklch(from ${e.color} l c h / ${r/1e3}); }`;t.push(i)}return t}var TK=(e,t)=>[ra({color:e.colorBackground,key:"color-background",id:t}),ra({color:e.colorForeground,key:"color-foreground",id:t}),ra({color:e.colorPrimary,key:"color-primary",id:t}),ra({color:e.colorPrimaryForeground,key:"color-primary-foreground",id:t}),ra({color:e.colorSecondary,key:"color-secondary",id:t}),ra({color:e.colorSecondaryForeground,key:"color-secondary-foreground",id:t}),ra({color:e.colorCounter,key:"color-counter",id:t}),ra({color:e.colorCounterForeground,key:"color-counter-foreground",id:t}),ra({color:e.colorShadow,key:"color-shadow",id:t}),...wo({color:e.colorBackground,key:"color-background-alpha",id:t}),...wo({color:e.colorForeground,key:"color-foreground-alpha",id:t}),...JE({color:e.colorPrimary,key:"color-primary",id:t}),...wo({color:e.colorPrimary,key:"color-primary-alpha",id:t}),...wo({color:e.colorPrimaryForeground,key:"color-primary-foreground-alpha",id:t}),...JE({color:e.colorSecondary,key:"color-secondary",id:t}),...wo({color:e.colorSecondary,key:"color-secondary-alpha",id:t}),...wo({color:e.colorSecondaryForeground,key:"color-secondary-foreground-alpha",id:t}),...wo({color:e.colorNeutral,key:"color-neutral-alpha",id:t})],CK=e=>{const t=[],n=new Set;for(const r in e)if(e.hasOwnProperty(r)){const i=e[r];if(typeof i=="object"){const a=EK(i),{className:o,rule:s}=_K(n,a);t.push({key:r,rule:s,className:o})}}return t},ba=e=>{var t;return((t=e==null?void 0:e.filter)==null?void 0:t.tags)||(e==null?void 0:e.value)||[]},ft=()=>{const e=Gy(),[t,n]=Me(!0);return sr(()=>{n(!1)}),He(()=>(i,a)=>{var o,s;const l=i.split("__");let u=[];for(let p=0;p<l.length;p+=1){const y=l.slice(p).join("__");XE.includes(y)&&u.push(y)}const c=(a==null?void 0:a.split(/\s+/).map(p=>p.replace(/^nv-/,"")))||[],d=c.filter(p=>XE.includes(p));u=Array.from(new Set([...u,...d])),u.sort((p,y)=>{const v=(p.match(/__/g)||[]).length;return(y.match(/__/g)||[]).length-v});const f=c.filter(p=>!u.includes(p)).join(" "),h=[];for(let p=0;p<u.length;p+=1)typeof((o=e.elements())==null?void 0:o[u[p]])=="string"&&h.push((s=e.elements())==null?void 0:s[u[p]]);const m=u.length&&!t()?u.map(p=>e.appearanceKeyToCssInJsClass[p]):[];return Bn(...u.map(p=>`nv-${p}`),"🔔",f,h,...m)})()};function xK(e){const[t,n]=Me(!!e.fallbackValue);return e.value!==void 0?[()=>!!e.value,n]:[t,n]}var wK="_blank",AK="noopener noreferrer",l6=vi(void 0),kK=e=>{const[t,n]=WV({appearanceKeyToCssInJsClass:{}}),[r,i]=Me(null),[a,o]=Me([]),[s,l]=Me([]),u=He(()=>{var m,p,y;return Array.isArray((m=e.appearance)==null?void 0:m.baseTheme)?((p=e.appearance)==null?void 0:p.baseTheme)||[]:[((y=e.appearance)==null?void 0:y.baseTheme)||{}]}),c=()=>e.id,d=()=>{var m;return((m=e.appearance)==null?void 0:m.variables)||{}},f=()=>{var m,p;return(p=(m=e.appearance)==null?void 0:m.animations)!=null?p:!0},h=He(()=>{var m;const p=u().reduce((y,v)=>Ye(Ye({},y),v.elements||{}),{});return Ye(Ye({},p),((m=e.appearance)==null?void 0:m.elements)||{})});return sr(()=>{const m=document.getElementById(e.id);if(m){i(m);return}const p=document.createElement("style");p.id=e.id,document.head.appendChild(p),i(p),dn(()=>{const y=document.getElementById(e.id);y&&y.remove()})}),cn(()=>{var m;if(!r())return;const y=Ye(Ye({},dK),u().reduce((v,b)=>Ye(Ye({},v),b.variables||{}),{}));l(TK(Ye(Ye({},y),((m=e.appearance)==null?void 0:m.variables)||{}),e.id))}),cn(()=>{if(!r())return;const p=CK(h());n("appearanceKeyToCssInJsClass",y=>Ye(Ye({},y),p.reduce((v,b)=>(v[b.key]=b.className,v),{}))),o(p.map(y=>y.rule))}),cn(()=>{const m=r();m&&(m.innerHTML=[...s(),...a()].join(" "))}),Z(l6.Provider,{get value(){return{elements:h,variables:d,appearanceKeyToCssInJsClass:t.appearanceKeyToCssInJsClass,animations:f,id:c}},get children(){return e.children}})};function Gy(){const e=lr(l6);if(!e)throw new Error("useAppearance must be used within an AppearanceProvider");return e}var u6=({event:e,eventHandler:t})=>{const n=vo();sr(()=>{const r=n.on(e,t);dn(()=>{r()})})};function SK(e,t){let n=!1,r;const i=new Promise(a=>{r=a});return navigator.locks.request(e,()=>(n||t(e),i)),()=>{n=!0,r()}}var DK=({channelName:e,onMessage:t})=>{const[n]=Me(new BroadcastChannel(e)),r=i=>{n().postMessage(i)};return sr(()=>{const i=o=>{t(o.data)},a=n();a.addEventListener("message",i),dn(()=>{a.removeEventListener("message",i)})}),{postMessage:r}},Lm=({event:e,eventHandler:t})=>{const n=vo(),{postMessage:r}=DK({channelName:`nv.${e}`,onMessage:t}),i=a=>{t(a),r(a)};sr(()=>{let a;const o=SK(`nv.${e}`,()=>{a=n.on(e,i)});dn(()=>{a&&a(),o()})})},c6=vi(void 0),OK=e=>{const t=He(()=>{const i=e.localization||{},{dynamic:a}=i,o=Dy(i,["dynamic"]);return Ye(Ye(Ye(Ye({},fK),hK()),a||{}),o)}),n=(i,...a)=>{const o=t()[i];return typeof o=="function"?o(a[0]):o},r=He(()=>t().locale);return Z(c6.Provider,{value:{t:n,locale:r},get children(){return e.children}})};function go(){const e=lr(c6);if(!e)throw new Error("useLocalization must be used within an LocalizationProvider");return e}var d6=vi(void 0),e4={unreadRead:{archived:!1},unread:{read:!1},archived:{archived:!0}},f6=10,NK=e=>{var t;const[n,r]=Me(!1),[i,a]=Me(e.tabs),[o,s]=Me((t=e.tabs[0]&&e.tabs[0].label)!=null?t:""),[l,u]=Me("unreadRead"),[c,d]=Me(f6),[f,h]=Me(an(Ye({},e4.unreadRead),{tags:e.tabs.length>0?ba(e.tabs[0]):[]})),[m,p]=Me(!1),[y,v]=Me(e.preferencesFilter),b=C=>{u(C),h(x=>an(Ye({},e4[C]),{tags:x.tags}))},_=C=>{const x=i().find(P=>P.label===C),w=ba(x);w&&(s(C),h(P=>an(Ye({},P),{tags:w})))},T=(C,x)=>{if(!C)return;if(!C.startsWith("/")){window.open(C,x??wK,AK);return}if(e.routerPush){e.routerPush(C);return}const P=new URL(C,window.location.href);window.history.pushState.bind(window.history)({},"",P)};return cn(()=>{var C;a(e.tabs);const x=e.tabs[0],w=ba(x);s((C=x==null?void 0:x.label)!=null?C:""),h(P=>an(Ye({},P),{tags:w})),v(e.preferencesFilter)}),u6({event:"session.initialize.resolved",eventHandler:({data:C})=>{C&&p(C.removeNovuBranding)}}),Z(d6.Provider,{value:{status:l,setStatus:b,filter:f,tabs:i,activeTab:o,setActiveTab:_,limit:c,setLimit:d,isOpened:n,setIsOpened:r,navigate:T,hideBranding:m,preferencesFilter:y},get children(){return e.children}})},dr=()=>{const e=lr(d6);if(!e)throw new Error("useInboxContext must be used within a InboxProvider");return e},h6=vi(void 0);function IK(e){const t=He(()=>e.novu||new u7(e.options));return Z(h6.Provider,{get value(){return t()},get children(){return e.children}})}function vo(){const e=lr(h6);if(!e)throw new Error("useNovu must be used within a NovuProvider");return e}var PK=1,Gc=vi(void 0),RK=e=>{const t=vo(),{isOpened:n,tabs:r,filter:i,limit:a}=dr(),[o,s]=Me(0),[l,u]=Me(new Map),[c,d]=Me(new Map),f=()=>Ve(void 0,null,function*(){if(r().length===0)return;const p=r().map(_=>({tags:ba(_),read:!1,archived:!1})),{data:y}=yield t.notifications.count({filters:p});if(!y)return;const v=new Map,{counts:b}=y;for(let _=0;_<b.length;_+=1){const T=Fc(b[_].filter.tags);v.set(T,y==null?void 0:y.counts[_].count)}u(v)});sr(()=>{f()}),Lm({event:"notifications.unread_count_changed",eventHandler:p=>{s(p.result),f()}}),u6({event:"session.initialize.resolved",eventHandler:({data:p})=>{p&&s(p.totalUnreadCount)}});const h=(p,y)=>{const v=t.notifications.cache,b=a(),_=an(Ye({},i()),{tags:y,offset:0,limit:b}),T=!v.has(_);if(!n()&&T)return;const C=v.getAll(_)||{hasMore:!1,filter:_,notifications:[]};if(((C==null?void 0:C.notifications.length)||0)<PK){v.update(_,an(Ye({},C),{notifications:[p,...C.notifications]}));return}d(w=>{const P=Fc(y),O=new Map(w);return O.set(P,(w.get(P)||0)+1),O})};Lm({event:"notifications.notification_received",eventHandler:p=>Ve(void 0,[p],function*({result:y}){if(i().archived)return;const v=r();if(v.length>0)for(let b=0;b<v.length;b+=1){const _=v[b],T=ba(_),C=T.length===0,x=T.some(w=>{var P;return(P=y.tags)==null?void 0:P.includes(w)});!C&&!x||h(y,T)}else h(y,[])})}),Lm({event:"notifications.notification_received",eventHandler:f});const m=p=>{d(y=>{const v=new Map(y);return v.set(p,0),v})};return Z(Gc.Provider,{value:{totalUnreadCount:o,unreadCounts:l,newNotificationCounts:c,resetNewNotificationCounts:m},get children(){return e.children}})},Fc=e=>JSON.stringify({tags:e??[]}),FK=()=>{const e=lr(Gc);if(!e)throw new Error("useTotalUnreadCount must be used within a CountProvider");return{totalUnreadCount:e.totalUnreadCount}},MK=e=>{const t=lr(Gc);if(!t)throw new Error("useNewMessagesCount must be used within a CountProvider");const n=He(()=>Fc(e.filter.tags));return{count:He(()=>t.newNotificationCounts().get(n())||0),reset:()=>t.resetNewNotificationCounts(n())}},p6=e=>{const t=lr(Gc);if(!t)throw new Error("useUnreadCount must be used within a CountProvider");return He(()=>t.unreadCounts().get(Fc(e.filter.tags))||0)},BK=e=>{const t=lr(Gc);if(!t)throw new Error("useUnreadCounts must be used within a CountProvider");return He(()=>e.filters.map(r=>t.unreadCounts().get(Fc(r.tags))||0))};function LK({element:e,enabled:t}){cn(()=>{const n=e();if(!n||!t())return;const r="a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex], [contenteditable]",i=()=>Array.from(n.querySelectorAll(r)).filter(s=>s.tabIndex>=0&&!s.hasAttribute("disabled")),a=s=>{if(s.key!=="Tab")return;const l=i(),u=l[0],c=l[l.length-1];s.shiftKey?document.activeElement===u&&(c.focus(),s.preventDefault()):document.activeElement===c&&(u.focus(),s.preventDefault())};n.addEventListener("keydown",a);const o=i();o.length>0&&o[0].focus(),dn(()=>{n.removeEventListener("keydown",a)})})}var $K=LK,m6=vi(void 0),jK=e=>{const[t,n]=Me([]),r=o=>{n(s=>[...s,o])},i=o=>{n(s=>s.filter(l=>l!==o))},a=He(()=>t().length?t()[t().length-1]:null);return $K({element:()=>a(),enabled:()=>!0}),Z(m6.Provider,{value:{focusTraps:t,active:a,setActive:r,removeActive:i},get children(){return e.children}})};function Yy(){const e=lr(m6);if(!e)throw new Error("useFocusManager must be used within an FocusManagerProvider");return e}var HK=Le("<div>"),g6=e=>{let t;const[n,r]=wn(e,["render"]);return cn(()=>{const i=n.render(t);dn(()=>{i()})}),(()=>{var i=HK();return Ca(a=>{t=a},i),Ft(i,r,!1,!1),i})()},UK=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M16.25 15V6.875L15 4.375H5L3.75 6.877V15c0 .345.28.625.625.625h11.25c.345 0 .625-.28.625-.625zM5 8.125h10v6.25H5v-6.25zm.772-2.5h8.455l.625 1.25H5.148l.625-1.25zm6.103 3.75h-3.75v1.25h3.75v-1.25z">'),Zy=e=>(()=>{var t=UK();return Ft(t,e,!0,!0),t})(),zK=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M17.117 4.358l-1.159-1.4A1.21 1.21 0 0015 2.5H5c-.392 0-.733.175-.967.458l-1.15 1.4A1.632 1.632 0 002.5 5.417v10.416c0 .917.75 1.667 1.667 1.667h11.666c.917 0 1.667-.75 1.667-1.667V5.417c0-.4-.142-.775-.383-1.059zM10 14.583L5.417 10h2.916V8.333h3.334V10h2.916L10 14.583zM4.267 4.167l.675-.834h10l.783.834H4.267z">'),VK=e=>(()=>{var t=zK();return Ft(t,e,!0,!0),t})(),qK=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M5.833 8.333L10 12.5l4.166-4.167H5.833z">'),Qy=e=>(()=>{var t=qK();return Ft(t,e,!0,!0),t})(),WK=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M10 16.667l1.175-1.175-4.65-4.659h10.142V9.167H6.525l4.659-4.65L10 3.333 3.334 10 10 16.667z">'),KK=e=>(()=>{var t=WK();return Ft(t,e,!0,!0),t})(),GK=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M10 18.333c.916 0 1.666-.75 1.666-1.666H8.333c0 .916.75 1.666 1.667 1.666zm5-5V9.167c0-2.559-1.359-4.7-3.75-5.267v-.567c0-.691-.559-1.25-1.25-1.25-.692 0-1.25.559-1.25 1.25V3.9C6.366 4.467 5 6.6 5 9.167v4.166L3.333 15v.833h13.333V15L15 13.333zm-1.667.834H6.666v-5c0-2.067 1.259-3.75 3.334-3.75s3.333 1.683 3.333 3.75v5z">');function YK(e){return(()=>{var t=GK();return Ft(t,e,!0,!0),t})()}var ZK=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M12.5 3.333v5.834H4.31l-.975.975V3.333H12.5zm.834-1.666H2.5a.836.836 0 00-.833.833v11.667L5 10.833h8.334a.836.836 0 00.833-.833V2.5a.836.836 0 00-.833-.833zM17.5 5h-1.666v7.5H5v1.667c0 .458.375.833.834.833H15l3.334 3.333v-12.5A.836.836 0 0017.5 5z">'),QK=e=>(()=>{var t=ZK();return Ft(t,e,!0,!0),t})(),XK=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M7.5 13.475L4.025 10l-1.183 1.175L7.5 15.833l10-10-1.175-1.175L7.5 13.475z">'),v6=e=>(()=>{var t=XK();return Ft(t,e,!0,!0),t})(),JK=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M5 8.333c-.917 0-1.667.75-1.667 1.667s.75 1.667 1.667 1.667c.916 0 1.666-.75 1.666-1.667S5.916 8.333 5 8.333zm10 0c-.917 0-1.667.75-1.667 1.667s.75 1.667 1.667 1.667c.916 0 1.666-.75 1.666-1.667S15.916 8.333 15 8.333zm-5 0c-.917 0-1.667.75-1.667 1.667s.75 1.667 1.667 1.667c.916 0 1.666-.75 1.666-1.667S10.916 8.333 10 8.333z">'),y6=e=>(()=>{var t=JK();return Ft(t,e,!0,!0),t})(),eG=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M16.667 3.333H3.334c-.917 0-1.659.75-1.659 1.667l-.008 10c0 .917.75 1.667 1.667 1.667h13.333c.917 0 1.667-.75 1.667-1.667V5c0-.917-.75-1.667-1.667-1.667zm0 11.667H3.334V6.667L10 10.833l6.667-4.166V15zM10 9.167L3.334 5h13.333L10 9.167z">'),tG=e=>(()=>{var t=eG();return Ft(t,e,!0,!0),t})(),nG=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 viewBox="0 0 20 20"fill=none><path fill=currentColor d="M9.99967 18.3334C10.9163 18.3334 11.6663 17.5834 11.6663 16.6667H8.33301C8.33301 17.5834 9.08301 18.3334 9.99967 18.3334ZM14.9997 13.3334V9.16671C14.9997 6.60837 13.6413 4.46671 11.2497 3.90004V3.33337C11.2497 2.64171 10.6913 2.08337 9.99967 2.08337C9.30801 2.08337 8.74967 2.64171 8.74967 3.33337V3.90004C6.36634 4.46671 4.99967 6.60004 4.99967 9.16671V13.3334L3.33301 15V15.8334H16.6663V15L14.9997 13.3334ZM13.333 14.1667H6.66634V9.16671C6.66634 7.10004 7.92467 5.41671 9.99967 5.41671C12.0747 5.41671 13.333 7.10004 13.333 9.16671V14.1667Z">'),rG=e=>(()=>{var t=nG();return Ft(t,e,!0,!0),t})(),iG=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M15.833 2.5H4.158c-.925 0-1.65.742-1.65 1.667L2.5 15.833A1.66 1.66 0 004.158 17.5h11.675c.917 0 1.667-.75 1.667-1.667V4.167A1.667 1.667 0 0015.833 2.5zm0 10H12.5c0 1.383-1.125 2.5-2.5 2.5a2.502 2.502 0 01-2.5-2.5H4.158V4.167h11.675V12.5z">'),aG=e=>(()=>{var t=iG();return Ft(t,e,!0,!0),t})(),oG=Le('<svg xmlns=http://www.w3.org/2000/svg width=13 height=12 fill=none viewBox="0 0 13 12"><path fill=currentColor d="M9.787.98A5.972 5.972 0 006.5 0c-.668 0-1.31.11-1.911.31L9.187 4.94c.221.222.6.065.6-.248V.98z"></path><path fill=currentColor d="M2.879 1.216A5.99 5.99 0 00.5 6c0 1.134.315 2.195.862 3.1V7.309c0-1.966 2.379-2.946 3.764-1.552l4.995 5.027A5.99 5.99 0 0012.5 6a5.972 5.972 0 00-.862-3.1v1.791c0 1.966-2.379 2.946-3.764 1.552L2.879 1.216z"></path><path fill=currentColor d="M8.411 11.69L3.813 7.06a.351.351 0 00-.6.248v3.711c.944.62 2.073.98 3.287.98.668 0 1.31-.11 1.911-.31z">'),sG=e=>(()=>{var t=oG();return Ft(t,e,!0,!0),t})(),lG=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M15.833.833H7.5c-.917 0-1.667.75-1.667 1.667V5H7.5V3.333h8.333v13.334H7.5V15H5.833v2.5c0 .917.75 1.667 1.667 1.667h8.333c.917 0 1.667-.75 1.667-1.667v-15c0-.917-.75-1.667-1.667-1.667zM5.842 11.225L3.717 9.1l-1.059 1.058 3.175 3.175 5.992-5.991-1.058-1.059-4.925 4.942z">'),uG=e=>(()=>{var t=lG();return Ft(t,e,!0,!0),t})(),cG=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M15.833 2.5H4.167C3.25 2.5 2.5 3.25 2.5 4.167v11.666c0 .917.75 1.667 1.667 1.667h11.666c.917 0 1.667-.75 1.667-1.667V4.167c0-.917-.75-1.667-1.667-1.667zm0 13.333H4.167V4.167h11.666v11.666zM14.992 7.5l-1.175-1.183-5.492 5.491-2.15-2.141-1.183 1.175 3.333 3.325L14.992 7.5z">'),b6=e=>(()=>{var t=cG();return Ft(t,e,!0,!0),t})(),dG=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M15.95 10.783c.033-.25.05-.508.05-.783a4.81 4.81 0 00-.059-.783L17.633 7.9a.408.408 0 00.1-.508l-1.6-2.767a.407.407 0 00-.492-.183l-1.991.8a5.885 5.885 0 00-1.35-.784L12 2.342A.403.403 0 0011.6 2H8.4c-.2 0-.359.142-.392.342l-.3 2.116c-.492.2-.942.475-1.35.784l-1.992-.8a.398.398 0 00-.491.183L2.283 7.392c-.1.175-.067.391.1.508l1.692 1.317A4.89 4.89 0 004 10c0 .258.016.533.058.783L2.366 12.1a.408.408 0 00-.1.508l1.6 2.767c.1.183.309.242.492.183l1.992-.8c.416.317.858.584 1.35.784l.3 2.116c.041.2.2.342.4.342h3.2c.2 0 .366-.142.391-.342l.3-2.116c.492-.2.942-.467 1.35-.784l1.992.8c.183.067.392 0 .492-.183l1.6-2.767c.1-.183.058-.391-.1-.508l-1.675-1.317zM10 13c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3z">'),fG=e=>(()=>{var t=dG();return Ft(t,e,!0,!0),t})(),hG=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M16.667 1.667H3.334c-.917 0-1.667.75-1.667 1.666v15L5 15h11.667c.917 0 1.667-.75 1.667-1.667v-10c0-.916-.75-1.666-1.667-1.666zm0 11.666H4.309l-.975.975V3.333h13.333v10zM5.834 7.5H7.5v1.667H5.834V7.5zm6.666 0h1.667v1.667H12.5V7.5zm-3.333 0h1.667v1.667H9.167V7.5z">'),pG=e=>(()=>{var t=hG();return Ft(t,e,!0,!0),t})(),mG=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 viewBox="0 0 20 20"fill=none><path fill=currentColor d="M17.1167 4.35833L15.9583 2.95833C15.7333 2.675 15.3917 2.5 15 2.5H5C4.60833 2.5 4.26667 2.675 4.03333 2.95833L2.88333 4.35833C2.64167 4.64167 2.5 5.01667 2.5 5.41667V15.8333C2.5 16.75 3.25 17.5 4.16667 17.5H15.8333C16.75 17.5 17.5 16.75 17.5 15.8333V5.41667C17.5 5.01667 17.3583 4.64167 17.1167 4.35833ZM5.2 4.16667H14.8L15.4917 5H4.51667L5.2 4.16667ZM4.16667 15.8333V6.66667H15.8333V15.8333H4.16667ZM6.66667 11.6667H8.79167V14.1667H11.2083V11.6667H13.3333L10 8.33333L6.66667 11.6667Z">'),gG=e=>(()=>{var t=mG();return Ft(t,e,!0,!0),t})(),vG=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M10 15v1.25H4.996a.625.625 0 01-.621-.62V4.37c0-.342.28-.62.624-.62H12.5l3.125 3.125v4.375h-1.25V7.5h-2.5V5h-6.25v10H10zm1.54-.335l2.21 2.21 3.094-3.093-.884-.884-2.21 2.21-1.326-1.326-.884.883z">'),E6=e=>(()=>{var t=vG();return Ft(t,e,!0,!0),t})(),t4=Le("<span>"),yG=e=>{const t=ft();return(()=>{var n=t4();return Ie(n,Z(YK,{get class(){return t("bellIcon")}}),null),Ie(n,Z(Tt,{get when(){return e.unreadCount>0},get children(){var r=t4();return ct(()=>Ze(r,t("bellDot","nt-absolute nt-top-2 nt-right-2 nt-block nt-size-2 nt-transform nt-translate-x-1/2 -nt-translate-y-1/2 nt-bg-primary nt-rounded-full nt-border nt-border-background"))),r}}),null),ct(()=>Ze(n,t("bellContainer","nt-h-6 nt-w-6 nt-flex nt-justify-center nt-items-center nt-rounded-md nt-relative nt-text-foreground nt-cursor-pointer"))),n})()},_6=e=>{const{totalUnreadCount:t}=FK();return Z(Tt,{get when(){return e.renderBell},get fallback(){return Z(yG,{get unreadCount(){return t()}})},get children(){return Z(g6,{render:n=>e.renderBell(n,t())})}})},bG=Le('<div class="nt-flex nt-shrink-0 nt-justify-center nt-items-center nt-gap-1 nt-mt-auto nt-pt-9 nt-pb-3 nt-text-foreground-alpha-200"><span class=nt-text-xs>Powered by Novu'),EG=()=>{const{hideBranding:e}=dr();return Z(Tt,{get when(){return!e()},get children(){var t=bG(),n=t.firstChild;return Ie(t,Z(sG,{}),n),t}})},_G=Le("<button>"),T6=Sq("nt-inline-flex nt-gap-4 nt-items-center nt-justify-center nt-whitespace-nowrap nt-rounded-lg nt-text-sm nt-font-medium nt-ring-offset-background nt-transition-colors focus-visible:nt-outline-none focus-visible:nt-ring-2 focus-visible:nt-ring-primary nt-focus-visible:nt-ring-offset-2 disabled:nt-pointer-events-none disabled:nt-opacity-50",{variants:{variant:{default:"nt-bg-primary nt-text-primary-foreground hover:nt-bg-primary-alpha-900",secondary:"nt-bg-secondary nt-text-secondary-foreground hover:nt-bg-secondary-alpha-800",icon:"nt-text-secondary-foreground-alpha-500 hover:nt-bg-neutral-alpha-50",ghost:"hover:nt-bg-neutral-alpha-50",unstyled:""},size:{none:"",icon:"nt-p-1",default:"nt-h-8 nt-px-3",sm:"nt-h-7 nt-rounded-md nt-px-3",lg:"nt-h-10 nt-px-8"}},defaultVariants:{variant:"default",size:"default"}}),yr=e=>{const[t,n]=wn(e,["class","appearanceKey"]),r=ft();return(()=>{var i=_G();return Ft(i,At({get"data-variant"(){return e.variant},get"data-size"(){return e.size},get class(){return r(t.appearanceKey||"button",Bn(T6({variant:e.variant,size:e.size}),t.class))}},n),!1,!1),i})()},TG=Le("<button>"),CG=e=>{const{onClose:t}=Yc(),[n,r]=wn(e,["onClick","asChild"]),i=a=>{typeof n.onClick=="function"&&n.onClick(a),t()};return n.asChild?Z(Fh,At({get component(){return n.asChild},onClick:i},r)):(()=>{var a=TG();return a.$$click=i,Ft(a,r,!1,!1),a})()};zl(["click"]);var C6=new Proxy(WE,{get:(e,t)=>n=>{const{animations:r}=Gy();return Z(WE,At(n,{tag:t,get transition(){return r()?n.transition:{duration:0}}}))}}),x6=vi(void 0);function xG(e){var t;const[n,r]=Me((t=e.open)!=null?t:!1),i=()=>{var m;return(m=e.onOpenChange)!=null?m:r},a=()=>{var m;return(m=e.open)!=null?m:n()},[o,s]=Me(null),[l,u]=Me(null),c=o6(o,l,{placement:e.placement||"bottom-start",whileElementsMounted:(m,p,y)=>n6(m,p,y,{elementResize:!1,ancestorScroll:!1,animationFrame:!1,layoutShift:!1}),middleware:[r6(10),a6({fallbackPlacements:e.fallbackPlacements||["top-start"]}),i6()]}),d=He(()=>{var m,p;return{position:c.strategy,top:`${(m=c.y)!=null?m:0}px`,left:`${(p=c.x)!=null?p:0}px`}}),f=()=>{i()(!1)},h=()=>{i()(m=>!m)};return Z(x6.Provider,{value:{onToggle:h,onClose:f,reference:o,setReference:s,floating:l,setFloating:u,open:a,floatingStyles:d},get children(){return e.children}})}function Yc(){const e=lr(x6);if(!e)throw new Error("usePopover must be used within Popover.Root component");return e}var wG=()=>Bn("nt-w-[400px] nt-h-[600px] nt-rounded-xl nt-bg-background","nt-shadow-popover nt-z-10 nt-cursor-default nt-flex nt-flex-col nt-overflow-hidden"),n4=e=>{const{open:t,setFloating:n,floating:r,floatingStyles:i}=Yc(),{setActive:a,removeActive:o}=Yy(),[s,l]=wn(e,["class","appearanceKey","style"]),u=ft();return sr(()=>{const c=r();a(c),dn(()=>{o(c)})}),Z(C6.div,At({ref:n,get class(){return He(()=>!!s.class)()?s.class:u(s.appearanceKey||"popoverContent",wG())},get style(){return i()},get"data-open"(){return t()},animate:{opacity:[0,1],y:[-6,0]},transition:{duration:.1,easing:"ease-out"}},l))},AG=e=>{const[t,n]=wn(e,["portal"]),{open:r,onClose:i,reference:a,floating:o}=Yc(),{active:s}=Yy(),l=c=>{var d,f;(d=a())!=null&&d.contains(c.target)||s()!==o()||(f=o())!=null&&f.contains(c.target)||i()},u=c=>{s()===o()&&c.key==="Escape"&&i()};return sr(()=>{document.body.addEventListener("click",l),document.body.addEventListener("keydown",u)}),dn(()=>{document.body.removeEventListener("click",l),document.body.removeEventListener("keydown",u)}),Z(Tt,{get when(){return r()},get children(){return Z(Tt,{get when(){return t.portal},get fallback(){return Z(n4,n)},get children(){return Z(jy,{get children(){return Z(Xy,{get children(){return Z(n4,n)}})}})}})}})},kG=Le("<button>"),SG=e=>{const{setReference:t,onToggle:n}=Yc(),r=ft(),[i,a]=wn(e,["appearanceKey","asChild","onClick"]),o=s=>{typeof i.onClick=="function"&&i.onClick(s),n()};return i.asChild?Z(Fh,At({get component(){return i.asChild},ref:t,onClick:o},a)):(()=>{var s=kG();return s.$$click=o,Ca(t,s),Ft(s,At({get class(){return r(i.appearanceKey||"dropdownTrigger")}},a),!1,!0),Ie(s,()=>e.children),s})()};zl(["click"]);var ro={Root:xG,Trigger:SG,Content:AG,Close:CG},DG=()=>"nt-w-max nt-rounded-xl nt-p-1 nt-overflow-hidden nt-flex nt-flex-col nt-min-w-52 nt-shadow-dropdown nt-z-10 nt-bg-background",OG=e=>{const t=ft(),[n,r]=wn(e,["appearanceKey"]);return Z(ro.Content,At({get class(){return t(n.appearanceKey||"dropdownContent",DG())}},r))},zh=()=>"focus:nt-outline-none nt-rounded-lg nt-items-center hover:nt-bg-neutral-alpha-50 focus-visible:nt-bg-neutral-alpha-50 nt-py-1 nt-px-3",NG=e=>{const t=ft(),[n,r]=wn(e,["appearanceKey","onClick","class"]),{onClose:i}=Yc();return Z(ro.Close,At({get class(){return He(()=>!!n.class)()?n.class:t(n.appearanceKey||"dropdownItem",zh())},onClick:a=>{typeof n.onClick=="function"&&n.onClick(a),i()}},r))},IG=e=>Z(ro.Root,At({placement:"bottom",fallbackPlacements:["top"]},e)),PG=()=>"nt-relative nt-transition nt-outline-none focus-visible:nt-outline-nonefocus-visible:nt-ring-2 focus-visible:nt-ring-primary focus-visible:nt-ring-offset-2",RG=e=>{const t=ft(),[n,r]=wn(e,["appearanceKey"]);return Z(ro.Trigger,At({get class(){return t(n.appearanceKey||"dropdownTrigger",PG())}},r))},Ur={Root:IG,Trigger:RG,Content:OG,Close:ro.Close,Item:NG},FG=Le("<div role=tablist>"),MG=Le('<div class="nt-border-t nt-border-secondary nt-mt-[-0.25rem] nt-relative nt-z-[-1]">'),BG=()=>"nt-flex nt-gap-6 nt-px-6 nt-py-1 nt-overflow-hidden",LG=e=>{const[t,n]=wn(e,["class","appearanceKey","ref","children"]),r=ft();return[(()=>{var i=FG(),a=t.ref;return typeof a=="function"?Ca(a,i):t.ref=i,Ft(i,At({get class(){return He(()=>!!t.class)()?t.class:r(t.appearanceKey||"tabsList",BG())}},n),!1,!0),Ie(i,()=>t.children),i})(),MG()]},$G=({activeTab:e,setActiveTab:t,tabsContainer:n})=>{const[r,i]=Me(!1);cn(()=>{const a=o=>{var s;if(o.key!=="Tab")return;const l=(s=n())==null?void 0:s.querySelectorAll('[role="tab"]');!l||!document.activeElement||i(Array.from(l).includes(document.activeElement))};return document.addEventListener("keyup",a),dn(()=>document.removeEventListener("keyup",a))}),cn(()=>{const a=o=>{var s,l;if(!r()||o.key!=="ArrowLeft"&&o.key!=="ArrowRight")return;const u=Array.from((l=(s=n())==null?void 0:s.querySelectorAll('[role="tab"]'))!=null?l:[]),c=u.map(p=>p.id),d=c.indexOf(e()),{length:f}=c;let h=d,m=e();o.key==="ArrowLeft"?(h=d===0?f-1:d-1,m=c[h]):o.key==="ArrowRight"&&(h=d===f-1?0:d+1,m=c[h]),u[h].focus(),t(m)};return document.addEventListener("keydown",a),dn(()=>document.removeEventListener("keydown",a))})},jG=Le("<div>"),w6=vi(void 0),A6=()=>{const e=lr(w6);if(!e)throw new Error("useTabsContext must be used within an TabsContext.Provider");return e},k6=()=>"nt-flex nt-flex-col",HG=e=>{var t;const[n,r]=wn(e,["defaultValue","value","class","appearanceKey","onChange","children"]),[i,a]=Me(),[o,s]=Me([]),[l,u]=Me((t=n.defaultValue)!=null?t:""),c=ft();return $G({tabsContainer:i,activeTab:l,setActiveTab:u}),cn(()=>{n.value&&u(n.value)}),cn(()=>{var d;(d=n.onChange)==null||d.call(n,l())}),Z(w6.Provider,{value:{activeTab:l,setActiveTab:u,visibleTabs:o,setVisibleTabs:s},get children(){var d=jG();return Ca(a,d),Ft(d,At({get class(){return He(()=>!!n.class)()?n.class:c(n.appearanceKey||"tabsRoot",k6())}},r),!1,!0),Ie(d,()=>n.children),d}})},UG=Le("<div role=tabpanel>"),zG=e=>{const[t,n]=wn(e,["value","class","appearanceKey","children"]),r=ft(),{activeTab:i}=A6();return Z(Tt,{get when(){return i()===t.value},get children(){var a=UG();return Ft(a,At({get class(){return He(()=>!!t.class)()?t.class:r(t.appearanceKey||"tabsContent",i()===t.value?"nt-block":"nt-hidden")},get id(){return`tabpanel-${t.value}`},get"aria-labelledby"(){return t.value},get"data-state"(){return i()===t.value?"active":"inactive"}},n),!1,!0),Ie(a,()=>t.children),a}})},S6=()=>"nt-relative nt-transition nt-outline-none nt-text-foreground-alpha-600 focus-visible:nt-outline-none focus-visible:nt-ring-2 focus-visible:nt-ring-primary focus-visible:nt-ring-offset-2 nt-pb-[0.625rem] after:nt-absolute after:nt-content-[''] after:nt-bottom-0 after:nt-left-0 after:nt-w-full after:nt-h-[2px] after:nt-border-b-2 data-[state=active]:after:nt-border-primary data-[state=active]:nt-text-foreground after:nt-border-b-transparent",VG=e=>{const[t,n]=wn(e,["value","class","appearanceKey","ref","onClick","children"]),r=ft(),{activeTab:i,setActiveTab:a}=A6(),o=()=>a(t.value);return Z(yr,At({variant:"unstyled",size:"none",ref(s){var l=t.ref;typeof l=="function"?l(s):t.ref=s},get id(){return t.value},get appearanceKey(){var s;return(s=t.appearanceKey)!=null?s:"tabsTrigger"},get class(){return He(()=>!!t.class)()?t.class:r(t.appearanceKey||"tabsTrigger",S6())},get onClick(){var s;return(s=t.onClick)!=null?s:o},role:"tab",tabIndex:0,get"aria-selected"(){return i()===t.value},get"aria-controls"(){return`tabpanel-${t.value}`},get"data-state"(){return i()===t.value?"active":"inactive"}},n,{get children(){return t.children}}))},Uu={Root:HG,List:LG,Trigger:VG,Content:zG},qG={unreadRead:"inbox.filters.dropdownOptions.default",unread:"inbox.filters.dropdownOptions.unread",archived:"inbox.filters.dropdownOptions.archived"},r4={unreadRead:"inbox.filters.labels.default",unread:"inbox.filters.labels.unread",archived:"inbox.filters.labels.archived"},WG=Le("<span><span></span><span>"),KG=Le("<span>"),GG=[{status:"unreadRead",icon:aG},{status:"unread",icon:E6},{status:"archived",icon:Zy}],YG=e=>Z(Wi,{each:GG,children:t=>Z(ZG,{get localizationKey(){return qG[t.status]},onClick:()=>{e.setStatus(t.status)},get isSelected(){return e.status===t.status},get icon(){return t.icon}})}),ZG=e=>{const t=ft(),{t:n}=go();return Z(Ur.Item,{get class(){return t("inboxStatus__dropdownItem",Bn(zh(),"nt-flex nt-gap-8 nt-justify-between"))},get onClick(){return e.onClick},get children(){return[(()=>{var r=WG(),i=r.firstChild,a=i.nextSibling;return Ie(i,()=>e.icon()),Ie(a,()=>n(e.localizationKey)),ct(o=>{var s=t("inboxStatus__dropdownItemLabelContainer","nt-flex nt-gap-2 nt-items-center"),l=t("inboxStatus__dropdownItemLeft__icon"),u=e.localizationKey,c=t("inboxStatus__dropdownItemLabel");return s!==o.e&&Ze(r,o.e=s),l!==o.t&&Ze(i,o.t=l),u!==o.a&&er(a,"data-localization",o.a=u),c!==o.o&&Ze(a,o.o=c),o},{e:void 0,t:void 0,a:void 0,o:void 0}),r})(),Z(Tt,{get when(){return e.isSelected},get children(){var r=KG();return Ie(r,Z(v6,{})),ct(()=>Ze(r,t("inboxStatus__dropdownItemRight__icon"))),r}})]}})},i4=Le("<span>"),QG=()=>{const e=ft(),{status:t,setStatus:n}=dr(),{t:r}=go();return Z(Ur.Root,{get children(){return[Z(Ur.Trigger,{get class(){return e("inboxStatus__dropdownTrigger",Bn(T6({variant:"unstyled",size:"none"}),"nt-gap-2"))},asChild:i=>Z(yr,At({variant:"unstyled",size:"none"},i,{get children(){return[(()=>{var a=i4();return Ie(a,()=>r(r4[t()])),ct(o=>{var s=r4[t()],l=e("inboxStatus__title","nt-text-xl nt-font-semibold");return s!==o.e&&er(a,"data-localization",o.e=s),l!==o.t&&Ze(a,o.t=l),o},{e:void 0,t:void 0}),a})(),(()=>{var a=i4();return Ie(a,Z(Qy,{})),ct(()=>Ze(a,e("inboxStatus__dropdownItemRight__icon","nt-text-foreground-alpha-600"))),a})()]}}))}),Z(Ur.Content,{appearanceKey:"inboxStatus__dropdownContent",get children(){return Z(YG,{setStatus:n,get status(){return t()}})}})]}})},XG=e=>{const t=vo();let n=Ye({},e.options());const[r,{initialLoading:i,setEl:a,end:o,mutate:s,reset:l}]=mK(c=>Ve(void 0,null,function*(){var d,f;const{data:h}=yield t.notifications.list(an(Ye({},e.options()||{}),{offset:c}));return{data:(d=h==null?void 0:h.notifications)!=null?d:[],hasMore:(f=h==null?void 0:h.hasMore)!=null?f:!1}}));return sr(()=>{const c=({data:f})=>{!f||!Nf(n,f.filter)||s({data:f.notifications,hasMore:f.hasMore})},d=t.on("notifications.list.updated",c);dn(()=>d())}),cn(()=>{const c=Ye({},e.options());Nf(n,c)||(t.notifications.clearCache(),l(),n=c)}),{data:r,initialLoading:i,setEl:a,end:o,refetch:({filter:c})=>{t.notifications.clearCache({filter:c}),l()}}},JG=e=>{const t=vo(),[n,r]=Me(!0),[i,{mutate:a,refetch:o}]=p7(e||{},s=>Ve(void 0,[s],function*({tags:l}){try{return(yield t.preferences.list({tags:l})).data}catch(u){throw console.error("Error fetching preferences:",u),u}}));return sr(()=>{const s=({data:u})=>{u&&a(u)},l=t.on("preferences.list.updated",s);dn(()=>l())}),cn(()=>{r(i.loading)}),{preferences:i,loading:n,mutate:a,refetch:o}},eY=e=>{const t=vo();return{readAll:(...r)=>Ve(void 0,[...r],function*({tags:i}={}){var a,o;try{yield t.notifications.readAll({tags:i}),(a=e==null?void 0:e.onSuccess)==null||a.call(e)}catch(s){(o=void 0)==null||o.call(e,s)}})}},tY=e=>{const t=vo();return{archiveAll:(...r)=>Ve(void 0,[...r],function*({tags:i}={}){var a,o;try{yield t.notifications.archiveAll({tags:i}),(a=e==null?void 0:e.onSuccess)==null||a.call(e)}catch(s){(o=void 0)==null||o.call(e,s)}})}},nY=e=>{const t=vo();return{archiveAllRead:(...r)=>Ve(void 0,[...r],function*({tags:i}={}){var a,o;try{yield t.notifications.archiveAllRead({tags:i}),(a=e==null?void 0:e.onSuccess)==null||a.call(e)}catch(s){(o=void 0)==null||o.call(e,s)}})}},a4=Le("<span>"),rY=()=>{const{filter:e}=dr(),{readAll:t}=eY(),{archiveAll:n}=tY(),{archiveAllRead:r}=nY();return[Z($m,{localizationKey:"notifications.actions.readAll",onClick:()=>t({tags:e().tags}),icon:b6}),Z($m,{localizationKey:"notifications.actions.archiveAll",onClick:()=>n({tags:e().tags}),icon:Zy}),Z($m,{localizationKey:"notifications.actions.archiveRead",onClick:()=>r({tags:e().tags}),icon:VK})]},$m=e=>{const t=ft(),{t:n}=go();return Z(Ur.Item,{get class(){return t("moreActions__dropdownItem",Bn(zh(),"nt-flex nt-gap-2"))},get onClick(){return e.onClick},get children(){return[(()=>{var r=a4();return Ie(r,()=>e.icon()),ct(()=>Ze(r,t("moreActions__dropdownItemLeft__icon","nt-text-foreground-alpha-600"))),r})(),(()=>{var r=a4();return Ie(r,()=>n(e.localizationKey)),ct(i=>{var a=e.localizationKey,o=t("moreActions__dropdownItemLabel");return a!==i.e&&er(r,"data-localization",i.e=a),o!==i.t&&Ze(r,i.t=o),i},{e:void 0,t:void 0}),r})()]}})},iY=()=>{const e=ft(),{status:t}=dr();return Z(Tt,{get when(){return t()!=="archived"},get children(){return Z(Ur.Root,{get children(){return[Z(Ur.Trigger,{get class(){return e("moreActions__dropdownTrigger")},asChild:n=>Z(yr,At({variant:"icon",size:"icon"},n,{get children(){return Z(y6,{get class(){return e("moreActions__dots")}})}}))}),Z(Ur.Content,{appearanceKey:"moreActions__dropdownContent",get children(){return Z(rY,{})}})]}})}})},aY=Le("<div>"),oY=e=>{const t=ft();return(()=>{var n=aY();return Ie(n,Z(iY,{}),null),Ie(n,Z(Tt,{get when(){return e.showPreferences},children:r=>Z(yr,{appearanceKey:"preferences__button",variant:"icon",size:"icon",get onClick(){return r()},get children(){return Z(fG,{})}})}),null),ct(()=>Ze(n,t("moreActionsContainer","nt-flex nt-gap-2"))),n})()},sY=Le("<div>"),lY=e=>{const t=ft();return(()=>{var n=sY();return Ie(n,Z(QG,{}),null),Ie(n,Z(oY,{get showPreferences(){return e.navigateToPreferences}}),null),ct(()=>Ze(n,t("inboxHeader",Bn("nt-flex nt-shrink-0 nt-justify-between nt-items-center nt-w-full nt-py-5 nt-px-6")))),n})()},uY=Le("<div><div data-localization=preferences.title>"),cY=Le("<button>"),dY=e=>{const t=ft(),{t:n}=go();return(()=>{var r=uY(),i=r.firstChild;return Ie(r,Z(Tt,{get when(){return e.navigateToNotifications},children:a=>(()=>{var o=cY();return _7(o,"click",a(),!0),Ie(o,Z(KK,{})),ct(()=>Ze(o,t("preferencesHeader__back__button","nt-h-6 nt-w-6 nt-flex nt-justify-center nt-items-center nt-rounded-md nt-relative hover:nt-bg-foreground-alpha-50 focus:nt-bg-foreground-alpha-50 nt-text-foreground-alpha-600"))),o})()}),i),Ie(i,()=>n("preferences.title")),ct(a=>{var o=t("preferencesHeader","nt-flex nt-items-center nt-py-5 nt-px-6 nt-gap-2"),s=t("preferencesHeader__title","nt-text-xl nt-font-semibold");return o!==a.e&&Ze(r,a.e=o),s!==a.t&&Ze(i,a.t=s),a},{e:void 0,t:void 0}),r})()};zl(["click"]);var fY=Le("<div>"),Xy=e=>{const[t,n]=wn(e,["class"]),{id:r}=Gy(),i=ft(),{hideBranding:a}=dr();return[Z(Tt,{get when(){return!a()},children:new Comment(" Powered by Novu - https://novu.co ")}),(()=>{var o=fY();return Ft(o,At({get id(){return`novu-root-${r()}`},get class(){return i("root"),Bn("novu",r(),"nt-text-foreground nt-h-full")}},n),!1,!1),o})()]},hY=Le('<label><input type=checkbox class="nt-peer nt-sr-only"><div>'),pY=e=>{const t=ft();return(()=>{var n=hY(),r=n.firstChild,i=r.nextSibling;return r.addEventListener("change",a=>{e.onChange(a.target.checked)}),ct(a=>{var o=t("channelSwitch","nt-relative nt-inline-flex nt-cursor-pointer nt-items-center"),s=t("channelSwitchThumb","nt-peer nt-h-6 nt-w-11 nt-rounded-full nt-border nt-border-neutral-alpha-200 peer-checked:nt-border-neutral-alpha-400 nt-bg-neutral-alpha-300 after:nt-absolute after:nt-left-[2px] after:nt-top-0.5 after:nt-h-5 after:nt-w-5 after:nt-rounded-full after:nt-border after:nt-border-neutral-alpha-400 after:nt-bg-background after:nt-transition-all after:nt-content-[''] peer-checked:nt-bg-primary peer-checked:after:nt-translate-x-full peer-checked:after:nt-border-background nt-transition-all nt-duration-200 after:nt-duration-200"),l=e.checked;return o!==a.e&&Ze(n,a.e=o),s!==a.t&&Ze(i,a.t=s),l!==a.a&&er(i,"data-checked",a.a=l),a},{e:void 0,t:void 0,a:void 0}),ct(()=>r.checked=e.checked),n})()},mY=Le("<div><div><div></div><span></span></div><div>"),gY=e=>{const t=ft(),n=i=>Ve(void 0,null,function*(){e.onChange({channel:e.channel,enabled:i,workflowId:e.workflowId})}),r=i=>{n(i)};return(()=>{var i=mY(),a=i.firstChild,o=a.firstChild,s=o.nextSibling,l=a.nextSibling;return Ie(o,Z(vY,{get channel(){return e.channel}})),Ie(s,()=>D6(e.channel)),Ie(l,Z(pY,{get checked(){return e.enabled},onChange:u=>r(u)})),ct(u=>{var c=t("channelContainer","nt-flex nt-justify-between nt-items-center nt-h-11 nt-gap-2 data-[disabled=true]:nt-text-foreground-alpha-600"),d=t("channelLabelContainer","nt-flex nt-items-center nt-gap-2"),f=t("channelLabel","nt-text-base nt-font-semibold"),h=t("channelSwitchContainer","nt-flex nt-items-center");return c!==u.e&&Ze(i,u.e=c),d!==u.t&&Ze(a,u.t=d),f!==u.a&&Ze(s,u.a=f),h!==u.o&&Ze(l,u.o=h),u},{e:void 0,t:void 0,a:void 0,o:void 0}),i})()},vY=e=>{switch(e.channel){case"in_app":return Z(rG,{});case"email":return Z(tG,{});case"push":return Z(uG,{});case"sms":return Z(pG,{});case"chat":return Z(QK,{});default:return null}},D6=e=>{switch(e){case"in_app":return"In-App";case"email":return"Email";case"push":return"Push";case"sms":return"SMS";case"chat":return"Chat";default:return""}},O6=Le("<div>"),jo=e=>{const t=ft();return(()=>{var n=O6();return ct(()=>Ze(n,t(e.appearanceKey,Bn("nt-w-full nt-h-3 nt-rounded nt-bg-foreground-alpha-100",e.class)))),n})()},yY=e=>{const t=ft();return(()=>{var n=O6();return ct(()=>Ze(n,t(e.appearanceKey,Bn("nt-size-8 nt-rounded-lg nt-bg-foreground-alpha-100",e.class)))),n})()},bY=Le('<div><div class="nt-flex nt-flex-col nt-self-stretch nt-gap-1 nt-flex-1"></div><div>'),EY=()=>Z(Wi,{get each(){return Array.from({length:8})},children:()=>Z(_Y,{})}),_Y=()=>{const e=ft();return(()=>{var t=bY(),n=t.firstChild,r=n.nextSibling;return Ie(n,Z(jo,{appearanceKey:"skeletonText",class:"nt-w-1/3"}),null),Ie(n,Z(jo,{appearanceKey:"skeletonText",class:"nt-w-1/3"}),null),Ie(r,Z(Qy,{})),ct(()=>Ze(t,e("preferencesLoadingContainer","nt-p-4 nt-flex nt-gap-1 nt-items-center nt-self-stretch nt-animate-pulse"))),t})()},Jy=Le("<div>"),TY=Le("<span>"),CY=Le("<div><div><div><div></div></div><span>"),xY=()=>{var e;const t=ft(),{preferencesFilter:n}=dr(),{preferences:r,loading:i}=JG({tags:(e=n())==null?void 0:e.tags}),a=He(()=>{var s,l;const u=(s=r())==null?void 0:s.find(f=>f.level==="global"),c=(l=r())==null?void 0:l.filter(f=>f.level==="template"),d=c==null?void 0:c.map(f=>{var h;return(h=f.workflow)==null?void 0:h.id});return{globalPreference:u,workflowPreferences:c,workflowPreferencesIds:d}});cn(()=>{pK(s=>{var l;return Ye(Ye({},s),(l=a().workflowPreferences)==null?void 0:l.reduce((u,c)=>(u[c.workflow.identifier]=c.workflow.name,u),{}))})});const o=s=>({channel:l,enabled:u})=>{s==null||s.update({channelPreferences:{[l]:u}})};return(()=>{var s=Jy();return Ie(s,Z(Tt,{get when(){return i()},get children(){return Z(EY,{})}}),null),Ie(s,Z(Tt,{get when(){return He(()=>!i())()&&r()},get children(){return[Z(o4,{localizationKey:"preferences.global",get channels(){var l;return((l=a().globalPreference)==null?void 0:l.channels)||{}},get onChange(){return o(a().globalPreference)}}),Z(Wi,{get each(){return a().workflowPreferencesIds},children:(l,u)=>{const c=()=>{var d;return(d=a().workflowPreferences)==null?void 0:d[u()]};return c()?Z(o4,{get localizationKey(){return c().workflow.identifier},get channels(){return c().channels},get workflowId(){var d;return(d=c().workflow)==null?void 0:d.id},get onChange(){return o(c())}}):null}})]}}),null),ct(()=>Ze(s,t("preferencesContainer","nt-p-2 nt-flex nt-flex-col nt-gap-1 nt-bg-background nt-overflow-y-auto nt-h-full"))),s})()},wY=e=>{const t=ft(),n=()=>{const r=[];for(const i in e.channels)if(e.channels[i]!==void 0){const a=!e.channels[i],o=(()=>{var s=TY();return er(s,"data-disabled",a),Ie(s,()=>D6(i)),ct(()=>Ze(s,t("channelName","data-[disabled=true]:nt-text-foreground-alpha-400"))),s})();r.push(o)}return r.map((i,a)=>[i,He(()=>a<r.length-1&&", ")])};return(()=>{var r=Jy();return Ie(r,n),ct(()=>Ze(r,t("channelDescription","nt-text-sm nt-text-foreground-alpha-600 nt-text-start"))),r})()},o4=e=>{const[t,n]=Me(!1),r=ft(),{t:i}=go(),a=He(()=>Object.keys(e.channels||{}));return Z(Tt,{get when(){return a().length>0},get children(){var o=CY(),s=o.firstChild,l=s.firstChild,u=l.firstChild,c=l.nextSibling;return s.$$click=()=>n(d=>!d),Ie(u,()=>i(e.localizationKey)),Ie(l,Z(wY,{get channels(){return e.channels}}),null),Ie(c,Z(Qy,{get class(){return r("workflowArrow__icon","nt-text-foreground-alpha-600")}})),Ie(o,Z(SW,{exitBeforeEnter:!0,get children(){return Z(Tt,{get when(){return t()},get children(){return Z(C6.div,{animate:{gridTemplateRows:["0fr","1fr"]},exit:{gridTemplateRows:["1fr","0fr"]},transition:{duration:.2,easing:"ease-out"},get class(){return r("channelsContainerCollapsible","nt-grid nt-self-stretch")},get children(){var d=Jy();return Ie(d,Z(Wi,{get each(){return a()},children:f=>Z(gY,{channel:f,get enabled(){return!!e.channels[f]},get workflowId(){return e.workflowId},get onChange(){return e.onChange}})})),ct(()=>Ze(d,r("channelsContainer","nt-overflow-hidden nt-flex-col nt-gap-1"))),d}})}})}}),null),ct(d=>{var f=r("workflowContainer","nt-p-4 nt-flex nt-flex-col nt-gap-1 nt-items-start nt-self-stretch hover:nt-bg-neutral-alpha-50 nt-rounded-lg data-[disabled=true]:nt-bg-neutral-alpha-50"),h=t(),m=r("workflowLabelContainer","nt-flex nt-justify-between nt-flex-nowrap nt-self-stretch nt-cursor-pointer nt-items-center"),p=t(),y=r("workflowLabel","nt-text-base nt-font-semibold nt-text-start nt-flex nt-items-center nt-gap-1"),v=e.localizationKey,b=t(),_=r("workflowContainerRight__icon","nt-text-foreground-alpha-600 nt-transition-all nt-duration-200 data-[open=true]:nt-transform data-[open=true]:nt-rotate-180"),T=t();return f!==d.e&&Ze(o,d.e=f),h!==d.t&&er(o,"data-open",d.t=h),m!==d.a&&Ze(s,d.a=m),p!==d.o&&er(s,"data-open",d.o=p),y!==d.i&&Ze(u,d.i=y),v!==d.n&&er(u,"data-localization",d.n=v),b!==d.s&&er(u,"data-open",d.s=b),_!==d.h&&Ze(c,d.h=_),T!==d.r&&er(c,"data-open",d.r=T),d},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0}),o}})};zl(["click"]);var AY=Le("<strong>"),kY=Le("<p>"),SY=e=>{const t=ft();return(()=>{var n=AY();return Ie(n,()=>e.children),ct(()=>Ze(n,t(e.appearanceKey||"strong","nt-font-semibold"))),n})()},DY=e=>e.children,OY=e=>{const t=e,{children:n,strongAppearanceKey:r}=t,i=Dy(t,["children","strongAppearanceKey"]),a=He(()=>aV(n));return(()=>{var o=kY();return Ft(o,i,!1,!0),Ie(o,Z(Wi,{get each(){return a()},children:s=>s.type==="bold"?Z(SY,{appearanceKey:r,get children(){return s.content}}):Z(DY,{get children(){return s.content}})})),o})()},s4=OY,N6=vi(void 0);function NY(e){const[t,n]=Me(null),[r,i]=Me(null),a=o6(t,r,{placement:e.placement||"top",whileElementsMounted:n6,middleware:[r6(10),a6({fallbackPlacements:e.fallbackPlacements||["bottom"]}),i6()]}),[o,s]=xK({value:e.open,fallbackValue:!1});return Z(N6.Provider,{value:{reference:t,setReference:n,floating:r,setFloating:i,open:o,setOpen:s,floatingStyles:()=>{var l,u;return{position:a.strategy,top:`${(l=a.y)!=null?l:0}px`,left:`${(u=a.x)!=null?u:0}px`}}},get children(){return e.children}})}function e9(){const e=lr(N6);if(!e)throw new Error("useTooltip must be used within Tooltip.Root component");return e}var IY=Le("<div>"),PY=()=>"nt-bg-foreground nt-p-2 nt-shadow-tooltip nt-rounded-lg nt-text-background nt-text-xs",RY=e=>{const{open:t,setFloating:n,floating:r,floatingStyles:i}=e9(),{setActive:a,removeActive:o}=Yy(),[s,l]=wn(e,["class","appearanceKey","style"]),u=ft();return sr(()=>{const c=r();a(c),dn(()=>{o(c)})}),(()=>{var c=IY();return Ca(n,c),Ft(c,At({get class(){return He(()=>!!s.class)()?s.class:u(s.appearanceKey||"tooltipContent",PY())},get style(){return an(Ye({},i()),{"z-index":99999})},get"data-open"(){return t()}},l),!1,!1),c})()},FY=e=>{const{open:t}=e9();return Z(Tt,{get when(){return t()},get children(){return Z(jy,{get children(){return Z(Xy,{get children(){return Z(RY,e)}})}})}})},MY=Le("<button>"),BY=e=>{const{setReference:t,setOpen:n}=e9(),r=ft(),[i,a]=wn(e,["appearanceKey","asChild","onClick"]);return i.asChild?Z(Fh,At({get component(){return i.asChild},ref:t,onMouseEnter:()=>{n(!0)},onMouseLeave:()=>{n(!1)}},a)):(()=>{var o=MY();return o.addEventListener("mouseleave",()=>{n(!1)}),o.addEventListener("mouseenter",()=>{n(!0)}),Ca(t,o),Ft(o,At({get class(){return r(i.appearanceKey||"tooltipTrigger")}},a),!1,!0),Ie(o,()=>e.children),o})()},Dr={Root:NY,Trigger:BY,Content:FY},LY=Le("<span>"),$Y=Le("<img>"),jY=Le('<a><div><div class="nt-relative nt-shrink-0 nt-float-right nt-ml-1 nt-pr-1.5"><p></p><div></div></div><div>'),HY=e=>{const t=ft(),{t:n,locale:r}=go(),{navigate:i,status:a}=dr(),[o,s]=Me(0),l=He(()=>(o(),vK({fromDate:new Date(e.notification.createdAt),locale:r()})));cn(()=>{const d=setInterval(()=>{s(f=>f+1)},6e4);return()=>clearInterval(d)});const u=d=>{var f,h,m;d.stopPropagation(),d.preventDefault(),e.notification.isRead||e.notification.read(),(f=e.onNotificationClick)==null||f.call(e,e.notification),i((h=e.notification.redirect)==null?void 0:h.url,(m=e.notification.redirect)==null?void 0:m.target)},c=(d,f)=>{var h,m,p,y,v,b,_,T,C,x;f.stopPropagation(),d==="primary"?(e.notification.completePrimary(),(h=e.onPrimaryActionClick)==null||h.call(e,e.notification),i((p=(m=e.notification.primaryAction)==null?void 0:m.redirect)==null?void 0:p.url,(v=(y=e.notification.primaryAction)==null?void 0:y.redirect)==null?void 0:v.target)):(e.notification.completeSecondary(),(b=e.onSecondaryActionClick)==null||b.call(e,e.notification),i((T=(_=e.notification.secondaryAction)==null?void 0:_.redirect)==null?void 0:T.url,(x=(C=e.notification.secondaryAction)==null?void 0:C.redirect)==null?void 0:x.target))};return(()=>{var d=jY(),f=d.firstChild,h=f.firstChild,m=h.firstChild,p=m.nextSibling,y=h.nextSibling;return d.$$click=u,Ie(d,Z(Tt,{get when(){return!e.notification.isRead},get children(){var v=LY();return ct(()=>Ze(v,t("notificationDot","nt-absolute -nt-translate-x-[1.0625rem] nt-translate-y-1/2 nt-size-2.5 nt-bg-primary nt-rounded-full nt-border nt-border-neutral-alpha-200"))),v}}),f),Ie(d,Z(Tt,{get when(){return e.notification.avatar},get children(){var v=$Y();return ct(b=>{var _=t("notificationImage","nt-size-8 nt-rounded-lg"),T=e.notification.avatar;return _!==b.e&&Ze(v,b.e=_),T!==b.t&&er(v,"src",b.t=T),b},{e:void 0,t:void 0}),v}}),f),Ie(m,l),Ie(p,Z(Tt,{get when(){return a()!=="archived"},get children(){return Z(Tt,{get when(){return e.notification.isRead},get fallback(){return Z(Dr.Root,{get children(){return[Z(Dr.Trigger,{asChild:v=>Z(yr,At({appearanceKey:"notificationRead__button",size:"icon",variant:"icon"},v,{onClick:b=>{b.stopPropagation(),e.notification.read()},class:"hover:nt-bg-neutral-alpha-50 nt-p-0.5",get children(){return Z(b6,{})}}))}),Z(Dr.Content,{"data-localization":"notification.actions.read.tooltip",get children(){return n("notification.actions.read.tooltip")}})]}})},get children(){return Z(Dr.Root,{get children(){return[Z(Dr.Trigger,{asChild:v=>Z(yr,At({appearanceKey:"notificationUnread__button",size:"icon",variant:"icon"},v,{onClick:b=>{b.stopPropagation(),e.notification.unread()},class:"hover:nt-bg-neutral-alpha-50 nt-p-0.5",get children(){return Z(E6,{})}}))}),Z(Dr.Content,{"data-localization":"notification.actions.unread.tooltip",get children(){return n("notification.actions.unread.tooltip")}})]}})}})}}),null),Ie(p,Z(Tt,{get when(){return e.notification.isArchived},get fallback(){return Z(Dr.Root,{get children(){return[Z(Dr.Trigger,{asChild:v=>Z(yr,At({appearanceKey:"notificationArchive__button",size:"icon",variant:"icon"},v,{onClick:b=>{b.stopPropagation(),e.notification.archive()},class:"hover:nt-bg-neutral-alpha-50 nt-p-0.5",get children(){return Z(Zy,{})}}))}),Z(Dr.Content,{"data-localization":"notification.actions.archive.tooltip",get children(){return n("notification.actions.archive.tooltip")}})]}})},get children(){return Z(Dr.Root,{get children(){return[Z(Dr.Trigger,{asChild:v=>Z(yr,At({appearanceKey:"notificationUnarchive__button",size:"icon",variant:"icon"},v,{onClick:b=>{b.stopPropagation(),e.notification.unarchive()},class:"hover:nt-bg-neutral-alpha-50 nt-p-0.5",get children(){return Z(gG,{})}}))}),Z(Dr.Content,{"data-localization":"notification.actions.unarchive.tooltip",get children(){return n("notification.actions.unarchive.tooltip")}})]}})}}),null),Ie(f,Z(Tt,{get when(){return e.notification.subject},children:v=>Z(s4,{get class(){return t("notificationSubject","nt-text-start")},strongAppearanceKey:"notificationSubject__strong",get children(){return v()}})}),y),Ie(f,Z(s4,{get class(){return t("notificationBody","nt-text-start")},strongAppearanceKey:"notificationBody__strong",get children(){return e.notification.body}}),y),Ie(y,Z(Tt,{get when(){return e.notification.primaryAction},keyed:!0,children:v=>Z(yr,{appearanceKey:"notificationPrimaryAction__button",variant:"default",onClick:b=>c("primary",b),get children(){return v.label}})}),null),Ie(y,Z(Tt,{get when(){return e.notification.secondaryAction},keyed:!0,children:v=>Z(yr,{appearanceKey:"notificationSecondaryAction__button",variant:"secondary",onClick:b=>c("secondary",b),get children(){return v.label}})}),null),ct(v=>{var b,_=t("notification",Bn("nt-w-full nt-text-sm hover:nt-bg-neutral-alpha-50 nt-group nt-relative nt-flex nt-py-4 nt-px-6 nt-gap-2",{"nt-cursor-pointer":!e.notification.isRead||!!((b=e.notification.redirect)!=null&&b.url)})),T=t("notificationBody","nt-overflow-hidden nt-w-full"),C=t("notificationDate","nt-transition nt-duration-100 nt-ease-out nt-text-foreground-alpha-400 nt-shrink-0 nt-float-right nt-text-right group-hover:nt-opacity-0"),x=t("notificationDefaultActions","nt-transition nt-duration-100 nt-ease-out nt-gap-2 nt-flex nt-shrink-0 nt-opacity-0 group-hover:nt-opacity-100 nt-justify-center nt-items-center nt-absolute nt-top-0 nt-right-0 nt-bg-neutral-alpha-50 nt-rounded-lg nt-backdrop-blur-md nt-p-0.5"),w=t("notificationCustomActions","nt-flex nt-flex-wrap nt-gap-4 nt-mt-4");return _!==v.e&&Ze(d,v.e=_),T!==v.t&&Ze(f,v.t=T),C!==v.a&&Ze(m,v.a=C),x!==v.o&&Ze(p,v.o=x),w!==v.i&&Ze(y,v.i=w),v},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),d})()};zl(["click"]);var UY=e=>Z(Tt,{get when(){return e.renderNotification},get fallback(){return Z(HY,{get notification(){return e.notification},get onNotificationClick(){return e.onNotificationClick},get onPrimaryActionClick(){return e.onPrimaryActionClick},get onSecondaryActionClick(){return e.onSecondaryActionClick}})},get children(){return Z(g6,{render:t=>e.renderNotification(t,e.notification)})}}),zY=Le('<svg xmlns=http://www.w3.org/2000/svg width=48 height=48 viewBox="0 0 48 48"fill=none><path fill=currentColor d="M35.2 21.62L32.38 18.8L39.5 11.7L42.32 14.52C42.1 14.58 35.2 21.62 35.2 21.62ZM26 6H22V16H26V6ZM12.8 21.62L15.62 18.8L8.52 11.68L5.68 14.52C5.9 14.58 12.8 21.62 12.8 21.62ZM40 28H33.16C31.62 31.52 28.08 34 24 34C19.92 34 16.38 31.52 14.84 28H8V38H40V28ZM40 24C42.2 24 44 25.8 44 28V38C44 40.2 42.2 42 40 42H8C5.8 42 4 40.2 4 38V28C4 25.8 5.8 24 8 24H18C18 27.32 20.68 30 24 30C27.32 30 30 27.32 30 24H40Z">');function VY(e){return(()=>{var t=zY();return Ft(t,e,!0,!0),t})()}var qY=e=>{const t=He(()=>!!e.count),{t:n}=go();return Z(Tt,{get when(){return t()},get children(){return Z(yr,{appearanceKey:"notificationListNewNotificationsNotice__button",class:"nt-absolute nt-w-fit nt-top-0 nt-mx-auto nt-inset-2 nt-z-10 nt-rounded-full hover:nt-bg-primary-600 nt-animate-in nt-slide-in-from-top-2 nt-fade-in",get onClick(){return e.onClick},"data-localization":"notifications.newNotifications",get children(){return n("notifications.newNotifications",{notificationCount:e.count})}})}})},WY=Le('<div class="nt-flex nt-gap-2 nt-px-6 nt-py-4 nt-w-full"><div class="nt-flex nt-flex-col nt-self-stretch nt-gap-3 nt-flex-1"><div class="nt-flex nt-gap-1"></div><div class="nt-flex nt-gap-1">'),I6=()=>(()=>{var e=WY(),t=e.firstChild,n=t.firstChild,r=n.nextSibling;return Ie(e,Z(yY,{appearanceKey:"skeletonAvatar"}),t),Ie(t,Z(jo,{appearanceKey:"skeletonText",class:"nt-w-1/4"}),n),Ie(n,Z(jo,{appearanceKey:"skeletonText"}),null),Ie(n,Z(jo,{appearanceKey:"skeletonText"}),null),Ie(r,Z(jo,{appearanceKey:"skeletonText",class:"nt-w-2/3"}),null),Ie(r,Z(jo,{appearanceKey:"skeletonText",class:"nt-w-1/3"}),null),e})(),KY=e=>Z(Wi,{get each(){return Array.from({length:e.count})},children:()=>Z(I6,{})}),GY=Le("<div><p data-localization=notifications.emptyNotice>"),YY=Le("<div>"),ZY=Le("<div><div>"),QY=()=>{const e=ft(),{t}=go();return(()=>{var n=GY(),r=n.firstChild;return Ie(n,Z(VY,{get class(){return e("notificationListEmptyNoticeIcon")}}),r),Ie(r,()=>t("notifications.emptyNotice")),ct(i=>{var a=e("notificationListEmptyNoticeContainer","nt-absolute nt-inset-0 nt-flex nt-flex-col nt-items-center nt-m-auto nt-h-fit nt-w-full nt-text-foreground-alpha-100"),o=e("notificationListEmptyNotice");return a!==i.e&&Ze(n,i.e=a),o!==i.t&&Ze(r,i.t=o),i},{e:void 0,t:void 0}),n})()},P6=e=>{var t,n;const r=He(()=>an(Ye({},e.filter),{limit:e.limit})),i=ft(),{data:a,setEl:o,end:s,refetch:l,initialLoading:u}=XG({options:r}),{count:c,reset:d}=MK({filter:{tags:(n=(t=e.filter)==null?void 0:t.tags)!=null?n:[]}}),{setLimit:f}=dr(),h=He(()=>a().map(y=>y.id));let m;cn(()=>{f(e.limit||f6)});const p=y=>Ve(void 0,null,function*(){y.stopPropagation(),d(),l({filter:e.filter}),m.scrollTo({top:0})});return(()=>{var y=ZY(),v=y.firstChild;return Ie(y,Z(qY,{get count(){return c()},onClick:p}),v),Ca(b=>{m=b},v),Ie(v,Z(Tt,{get when(){return!u()},get fallback(){return Z(KY,{count:8})},get children(){return Z(Tt,{get when(){return a().length>0},get fallback(){return Z(QY,{})},get children(){return[Z(Wi,{get each(){return h()},children:(b,_)=>{const T=()=>a()[_()];return Z(UY,{get notification(){return T()},get renderNotification(){return e.renderNotification},get onNotificationClick(){return e.onNotificationClick},get onPrimaryActionClick(){return e.onPrimaryActionClick},get onSecondaryActionClick(){return e.onSecondaryActionClick}})}}),Z(Tt,{get when(){return!s()},get children(){var b=YY();return Ca(o,b),Ie(b,Z(Wi,{get each(){return Array.from({length:3})},children:()=>Z(I6,{})})),b}})]}})}})),ct(b=>{var _=i("notificationListContainer","nt-relative nt-h-full nt-overflow-hidden"),T=i("notificationList","nt-relative nt-h-full nt-flex nt-flex-col nt-overflow-y-auto");return _!==b.e&&Ze(y,b.e=_),T!==b.t&&Ze(v,b.t=T),b},{e:void 0,t:void 0}),y})()},t9=Le("<span>"),XY=e=>e>=100?"99+":e,n9=e=>{const t=ft(),n=He(()=>XY(e.count));return(()=>{var r=t9();return Ie(r,n),ct(()=>Ze(r,t("notificationsTabsTriggerCount","nt-rounded-full nt-bg-counter nt-px-[6px] nt-text-counter-foreground nt-text-sm"))),r})()},l4=e=>{const{status:t}=dr(),n=ft(),r=p6({filter:{tags:ba(e)}});return Z(Uu.Trigger,{get value(){return e.label},get class(){return n("notificationsTabs__tabsTrigger",Bn(S6(),"nt-flex nt-gap-2",e.class))},get children(){return[(()=>{var i=t9();return Ie(i,()=>e.label),ct(()=>Ze(i,n("notificationsTabsTriggerLabel","nt-text-sm nt-font-medium"))),i})(),Z(Tt,{get when(){return He(()=>t()!=="archived")()&&r()},get children(){return Z(n9,{get count(){return r()}})}})]}})},JY=e=>{const{status:t}=dr(),n=ft(),r=p6({filter:{tags:ba(e)}});return Z(Ur.Item,{get class(){return n("moreTabs__dropdownItem",Bn(zh(),"nt-flex nt-justify-between nt-gap-2"))},get children(){return[(()=>{var i=t9();return Ie(i,()=>e.label),ct(()=>Ze(i,n("moreTabs__dropdownItemLabel","nt-mr-auto"))),i})(),He(()=>e.rightIcon),Z(Tt,{get when(){return He(()=>t()!=="archived")()&&r()},get children(){return Z(n9,{get count(){return r()}})}})]}})},eZ=({tabs:e})=>{const[t,n]=Me(),[r,i]=Me([]),[a,o]=Me([]);return sr(()=>{const s=t();if(!s)return;const l=[...s.querySelectorAll('[role="tab"]')],u=new IntersectionObserver(c=>{let d=c.filter(f=>f.isIntersecting&&f.intersectionRatio===1).map(f=>f.target.id);if(l.length===d.length){i(e.filter(f=>d.includes(f.label))),u.disconnect();return}d=d.slice(0,-1),i(e.filter(f=>d.includes(f.label))),o(e.filter(f=>!d.includes(f.label))),u.disconnect()},{root:s});for(const c of l)u.observe(c)}),{dropdownTabs:a,setTabsList:n,visibleTabs:r}},tZ=()=>"nt-relative after:nt-absolute after:nt-content-[''] after:nt-bottom-0 after:nt-left-0 after:nt-w-full after:nt-h-[2px] after:nt-border-b-2 nt-pb-[0.625rem]",nZ=e=>{const t=ft(),{activeTab:n,status:r,setActiveTab:i,filter:a}=dr(),{dropdownTabs:o,setTabsList:s,visibleTabs:l}=eZ({tabs:e.tabs}),u=BK({filters:o().map(h=>({tags:ba(h)}))}),c=He(()=>o().map(h=>an(Ye({},h),{rightIcon:h.label===n()?Z(v6,{get class(){return t("moreTabs__dropdownItemRight__icon")}}):void 0}))),d=He(()=>u().reduce((h,m)=>h+m,0)),f=He(()=>o().map(h=>h.label).includes(n()));return Z(Uu.Root,{get class(){return t("notificationsTabs__tabsRoot",Bn(k6(),"nt-flex-1 nt-overflow-hidden"))},get value(){return n()},onChange:i,get children(){return[Z(Tt,{get when(){return l().length>0},get fallback(){return Z(Uu.List,{ref:s,appearanceKey:"notificationsTabs__tabsList",get children(){return e.tabs.map(h=>Z(l4,At(h,{class:"nt-invisible"})))}})},get children(){return Z(Uu.List,{appearanceKey:"notificationsTabs__tabsList",get children(){return[He(()=>l().map(h=>Z(l4,h))),Z(Tt,{get when(){return o().length>0},get children(){return Z(Ur.Root,{fallbackPlacements:["bottom","top"],placement:"bottom-start",get children(){return[Z(Ur.Trigger,{appearanceKey:"moreTabs__dropdownTrigger",asChild:h=>Z(yr,At({variant:"unstyled",size:"none",appearanceKey:"moreTabs__button"},h,{get class(){return Bn(tZ(),f()?"after:nt-border-b-primary":"after:nt-border-b-transparent nt-text-foreground-alpha-600")},get children(){return[Z(y6,{get class(){return t("moreTabs__dots")}}),Z(Tt,{get when(){return He(()=>r()!=="archived")()&&d()},get children(){return Z(n9,{get count(){return d()}})}})]}}))}),Z(Ur.Content,{appearanceKey:"moreTabs__dropdownContent",get children(){return Z(Wi,{get each(){return c()},children:h=>Z(JY,At({onClick:()=>i(h.label)},h))})}})]}})}})]}})}}),He(()=>e.tabs.map(h=>Z(Uu.Content,{get value(){return h.label},get class(){return t("notificationsTabs__tabsContent",Bn(n()===h.label?"nt-block":"nt-hidden","nt-flex-1 nt-overflow-hidden"))},get children(){return Z(P6,{get renderNotification(){return e.renderNotification},get onNotificationClick(){return e.onNotificationClick},get onPrimaryActionClick(){return e.onPrimaryActionClick},get onSecondaryActionClick(){return e.onSecondaryActionClick},get filter(){return an(Ye({},a()),{tags:ba(h)})}})}})))]}})},rZ=Le("<div>"),Ho=function(e){return e.Notifications="notifications",e.Preferences="preferences",e}({}),zd=e=>{const[t,n]=Me(e.initialPage||Ho.Notifications),{tabs:r,filter:i}=dr(),a=ft(),o=He(()=>s=>{if(!e.hideNav)return()=>{n(s)}});return(()=>{var s=rZ();return Ie(s,Z(TV,{get children(){return[Z(bE,{get when(){return t()===Ho.Notifications},get children(){return[Z(lY,{get navigateToPreferences(){return o()(Ho.Preferences)}}),Z(Tt,{keyed:!0,get when(){return He(()=>!!r())()&&r().length>0},get fallback(){return Z(P6,{get renderNotification(){return e.renderNotification},get onNotificationClick(){return e.onNotificationClick},get onPrimaryActionClick(){return e.onPrimaryActionClick},get onSecondaryActionClick(){return e.onSecondaryActionClick},get filter(){return i()}})},get children(){return Z(nZ,{get renderNotification(){return e.renderNotification},get onNotificationClick(){return e.onNotificationClick},get onPrimaryActionClick(){return e.onPrimaryActionClick},get onSecondaryActionClick(){return e.onSecondaryActionClick},get tabs(){return r()}})}})]}}),Z(bE,{get when(){return t()===Ho.Preferences},get children(){return[Z(dY,{get navigateToNotifications(){return o()(Ho.Notifications)}}),Z(xY,{})]}})]}}),null),Ie(s,Z(EG,{}),null),ct(()=>Ze(s,a("inboxContent","nt-h-full nt-flex nt-flex-col"))),s})()},iZ=e=>{const t=ft(),{isOpened:n,setIsOpened:r}=dr(),i=()=>{var a;return(a=e==null?void 0:e.open)!=null?a:n()};return Z(ro.Root,{get open(){return i()},onOpenChange:r,get children(){return[Z(ro.Trigger,{asChild:a=>Z(yr,At({get class(){return t("inbox__popoverTrigger")},variant:"ghost",size:"icon"},a,{get children(){return Z(_6,{get renderBell(){return e.renderBell}})}}))}),Z(ro.Content,{appearanceKey:"inbox__popoverContent",portal:!0,get children(){return Z(zd,{get renderNotification(){return e.renderNotification},get onNotificationClick(){return e.onNotificationClick},get onPrimaryActionClick(){return e.onPrimaryActionClick},get onSecondaryActionClick(){return e.onSecondaryActionClick}})}})]}})},aZ={Inbox:iZ,InboxContent:zd,Bell:_6,Notifications:e=>Z(zd,At(e,{hideNav:!0,get initialPage(){return Ho.Notifications}})),Preferences:e=>Z(zd,At(e,{hideNav:!0,get initialPage(){return Ho.Preferences}}))},oZ=e=>{const t=()=>[...e.nodes.keys()];return sr(()=>{const n="novu-default-css";if(document.getElementById(n))return;const i=document.createElement("link");i.id=n,i.rel="stylesheet",i.href=e.cssHref,document.head.insertBefore(i,document.head.firstChild),dn(()=>{const a=document.getElementById(n);a==null||a.remove()})}),Z(IK,{get options(){return e.options},get novu(){return e.novu},get children(){return Z(OK,{get localization(){return e.localization},get children(){return Z(kK,{get id(){return e.novuUI.id},get appearance(){return e.appearance},get children(){return Z(jK,{get children(){return Z(NK,{get tabs(){return e.tabs},get preferencesFilter(){return e.preferencesFilter},get routerPush(){return e.routerPush},get children(){return Z(RK,{get children(){return Z(Wi,{get each(){return t()},children:n=>{const r=()=>e.nodes.get(n);let i;const a=aZ[r().name];return sr(()=>{["Notifications","Preferences"].includes(r().name)&&(n instanceof HTMLElement&&n.classList.add("nt-h-full"),i.classList.add("nt-h-full"))}),Z(jy,{mount:n,ref:o=>{i=o},get children(){return Z(Xy,{get children(){return Z(a,At(()=>r().props))}})}})}})}})}})}})}})}})}})},sZ="2.6.0",lZ=`https://cdn.jsdelivr.net/npm/@novu/js@${sZ}/dist/index.css`,ll,qo,rc,Qs,Gf,Vd,Yf,qd,Zf,Wd,Qf,Kd,Xf,Gd,Jf,Yd,eh,Zd,R6,F6,uZ=class{constructor(t){Ge(this,Zd),Ge(this,ll,null),Ge(this,qo),Ge(this,rc),Ge(this,Qs),Ge(this,Gf),Ge(this,Vd),Ge(this,Yf),Ge(this,qd),Ge(this,Zf),Ge(this,Wd),Ge(this,Qf),Ge(this,Kd),Ge(this,Xf),Ge(this,Gd),Ge(this,Jf),Ge(this,Yd),Ge(this,eh);var n;this.id=s6(16);const[r,i]=Me(t.appearance),[a,o]=Me(t.localization),[s,l]=Me(t.options),[u,c]=Me(new Map),[d,f]=Me((n=t.tabs)!=null?n:[]),[h,m]=Me(t.preferencesFilter),[p,y]=Me(t.routerPush);Qe(this,rc,u),Qe(this,Qs,c),Qe(this,Gf,r),Qe(this,Vd,i),Qe(this,Yf,a),Qe(this,qd,o),Qe(this,Zf,s),Qe(this,Wd,l),Qe(this,Qf,d),Qe(this,Kd,f),Qe(this,Xf,p),Qe(this,Gd,y),Qe(this,eh,t.novu),Qe(this,Jf,h),Qe(this,Yd,m),Of(this,Zd,R6).call(this)}mountComponent({name:t,element:n,props:r}){if(oe(this,rc).call(this).has(n))return Of(this,Zd,F6).call(this,n,r);oe(this,Qs).call(this,i=>{const a=new Map(i);return a.set(n,{name:t,props:r}),a})}unmountComponent(t){oe(this,Qs).call(this,n=>{const r=new Map(n);return r.delete(t),r})}updateAppearance(t){oe(this,Vd).call(this,t)}updateLocalization(t){oe(this,qd).call(this,t)}updateOptions(t){oe(this,Wd).call(this,t)}updateTabs(t){oe(this,Kd).call(this,t??[])}updatePreferencesFilter(t){oe(this,Yd).call(this,t)}updateRouterPush(t){oe(this,Gd).call(this,()=>t)}unmount(){var t,n;(t=oe(this,ll))==null||t.call(this),Qe(this,ll,null),(n=oe(this,qo))==null||n.remove()}};ll=new WeakMap;qo=new WeakMap;rc=new WeakMap;Qs=new WeakMap;Gf=new WeakMap;Vd=new WeakMap;Yf=new WeakMap;qd=new WeakMap;Zf=new WeakMap;Wd=new WeakMap;Qf=new WeakMap;Kd=new WeakMap;Xf=new WeakMap;Gd=new WeakMap;Jf=new WeakMap;Yd=new WeakMap;eh=new WeakMap;Zd=new WeakSet;R6=function(){if(oe(this,ll)!==null)return;Qe(this,qo,document.createElement("div")),oe(this,qo).setAttribute("id",`novu-ui-${this.id}`),document.body.appendChild(oe(this,qo));const e=PV(()=>{const t=this;return Z(oZ,{cssHref:lZ,novuUI:t,get nodes(){var n;return oe(n=t,rc).call(n)},get options(){var n;return oe(n=t,Zf).call(n)},get appearance(){var n;return oe(n=t,Gf).call(n)},get localization(){var n;return oe(n=t,Yf).call(n)},get tabs(){var n;return oe(n=t,Qf).call(n)},get preferencesFilter(){var n;return oe(n=t,Jf).call(n)},get routerPush(){var n;return oe(n=t,Xf).call(n)},get novu(){return oe(t,eh)}})},oe(this,qo));Qe(this,ll,e)};F6=function(e,t){oe(this,Qs).call(this,n=>{const r=new Map(n),i=r.get(e);return i&&r.set(e,an(Ye({},i),{props:t})),r})};function Vh({mount:e}){const t=E.useRef(null);return E.useEffect(()=>{let n;const r=t.current;if(r&&e){const i=e(r);i&&(n=i)}return()=>{r&&n&&n(r)}},[t,e]),g.jsx("div",{ref:t})}function cZ(e,t){if(!e)throw typeof t=="string"?new Error(t):new Error(`${t.displayName} not found`)}var M6=(e,t)=>{const{assertCtxFn:n=cZ}=t||{},r=E.createContext(void 0);return r.displayName=e,[r,()=>{const o=E.useContext(r);return n(o,`Component must be wrapped with ${r.displayName}`),o.value},()=>{const o=E.useContext(r);return o?o.value:{}}]},[dZ,qh,Vve]=M6("RendererContext"),fZ=e=>g.jsx(dZ.Provider,{value:{value:e.value},children:e.children}),hZ=e=>{const{children:t}=e,[n,r]=E.useState(new Map),i=E.useCallback((a,o)=>(r(s=>{const l=new Map(s);return l.set(a,o),l}),()=>{r(s=>{const l=new Map(s);return l.delete(a),l})}),[r]);return g.jsxs(fZ,{value:{mountElement:i},children:[[...n].map(([a,o])=>ph.createPortal(o,a)),t]})},Wh=e=>{const t=n=>g.jsx(hZ,{children:g.jsx(e,{...n})});return t.displayName=`WithRenderer(${e.displayName||e.name||"Component"})`,t},[pZ,Kh,qve]=M6("NovuUIContext"),mZ=e=>g.jsx(pZ.Provider,{value:{value:e.value},children:e.children}),gZ=E.memo(e=>{const{renderBell:t}=e,{novuUI:n}=Kh(),{mountElement:r}=qh(),i=E.useCallback(a=>n.mountComponent({name:"Bell",element:a,props:t?{renderBell:(o,s)=>r(o,t(s))}:void 0}),[t]);return g.jsx(Vh,{mount:i})});Wh(gZ);var vZ="2.6.0",yZ="@novu/react",bZ=`${yZ}@${vZ}`,r9=E.createContext(void 0),EZ=({children:e,applicationIdentifier:t,subscriberId:n,subscriberHash:r,backendUrl:i,socketUrl:a,useCache:o,userAgentType:s})=>{const l=E.useMemo(()=>new u7({applicationIdentifier:t,subscriberId:n,subscriberHash:r,backendUrl:i,socketUrl:a,useCache:o,__userAgent:`${bZ} ${s}`}),[t,n,r,i,a,o,s]);return g.jsx(r9.Provider,{value:l,children:e})},_Z=()=>{const e=E.useContext(r9);if(!e)throw new Error("useNovu must be used within a <NovuProvider />");return e},TZ=()=>E.useContext(r9),CZ=e=>{const t=E.useRef(e);return t.current=e,t},u4=({options:e,novu:t,children:n})=>{const r=CZ({...e,novu:t}),[i,a]=E.useState();return E.useEffect(()=>{const o=new uZ(r.current);return a(o),()=>{o.unmount()}},[]),E.useEffect(()=>{i&&(i.updateAppearance(e.appearance),i.updateLocalization(e.localization),i.updateTabs(e.tabs),i.updateOptions(e.options),i.updateRouterPush(e.routerPush))},[e]),i?g.jsx(mZ,{value:{novuUI:i},children:n}):null},xZ=e=>{const{open:t,renderNotification:n,renderBell:r,onNotificationClick:i,onPrimaryActionClick:a,onSecondaryActionClick:o}=e,{novuUI:s}=Kh(),{mountElement:l}=qh(),u=E.useCallback(c=>s.mountComponent({name:"Inbox",props:{open:t,renderNotification:n?(d,f)=>l(d,n(f)):void 0,renderBell:r?(d,f)=>l(d,r(f)):void 0,onNotificationClick:i,onPrimaryActionClick:a,onSecondaryActionClick:o},element:c}),[t,n,r,i,a,o]);return g.jsx(Vh,{mount:u})},wZ=Wh(xZ),AZ=E.memo(e=>{const{applicationIdentifier:t,subscriberId:n,subscriberHash:r,backendUrl:i,socketUrl:a}=e;return TZ()?g.jsx(c4,{...e}):g.jsx(EZ,{applicationIdentifier:t,subscriberId:n,subscriberHash:r,backendUrl:i,socketUrl:a,userAgentType:"components",children:g.jsx(c4,{...e})})}),c4=E.memo(e=>{const{localization:t,appearance:n,tabs:r,preferencesFilter:i,routerPush:a,applicationIdentifier:o,subscriberId:s,subscriberHash:l,backendUrl:u,socketUrl:c}=e,d=_Z(),f=E.useMemo(()=>({localization:t,appearance:n,tabs:r,preferencesFilter:i,routerPush:a,options:{applicationIdentifier:o,subscriberId:s,subscriberHash:l,backendUrl:u,socketUrl:c}}),[t,n,r,i,o,s,l,u,c]);if(kZ(e))return g.jsx(u4,{options:f,novu:d,children:e.children});const{open:h,renderNotification:m,renderBell:p,onNotificationClick:y,onPrimaryActionClick:v,onSecondaryActionClick:b}=e;return g.jsx(u4,{options:f,novu:d,children:g.jsx(wZ,{open:h,renderNotification:m,renderBell:p,onNotificationClick:y,onPrimaryActionClick:v,onSecondaryActionClick:b})})});function kZ(e){return"children"in e}var SZ=E.memo(e=>{const{onNotificationClick:t,onPrimaryActionClick:n,renderNotification:r,onSecondaryActionClick:i}=e,{novuUI:a}=Kh(),{mountElement:o}=qh(),s=E.useCallback(l=>a.mountComponent({name:"Notifications",element:l,props:{renderNotification:r?(u,c)=>o(u,r(c)):void 0,onNotificationClick:t,onPrimaryActionClick:n,onSecondaryActionClick:i}}),[r,t,n,i]);return g.jsx(Vh,{mount:s})});Wh(SZ);var DZ=E.memo(e=>{const{onNotificationClick:t,onPrimaryActionClick:n,renderNotification:r,onSecondaryActionClick:i,initialPage:a,hideNav:o}=e,{novuUI:s}=Kh(),{mountElement:l}=qh(),u=E.useCallback(c=>s.mountComponent({name:"InboxContent",element:c,props:{renderNotification:r?(d,f)=>l(d,r(f)):void 0,onNotificationClick:t,onPrimaryActionClick:n,onSecondaryActionClick:i,initialPage:a,hideNav:o}}),[r,t,n,i]);return g.jsx(Vh,{mount:u})});Wh(DZ);const Gh=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0))(),Lr=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())(),OZ="arraybuffer";function B6(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const NZ=Lr.setTimeout,IZ=Lr.clearTimeout;function Yh(e,t){t.useNativeTimers?(e.setTimeoutFn=NZ.bind(Lr),e.clearTimeoutFn=IZ.bind(Lr)):(e.setTimeoutFn=Lr.setTimeout.bind(Lr),e.clearTimeoutFn=Lr.clearTimeout.bind(Lr))}const PZ=1.33;function RZ(e){return typeof e=="string"?FZ(e):Math.ceil((e.byteLength||e.size)*PZ)}function FZ(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function L6(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function MZ(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function BZ(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let a=n[r].split("=");t[decodeURIComponent(a[0])]=decodeURIComponent(a[1])}return t}class LZ extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class i9 extends Jt{constructor(t){super(),this.writable=!1,Yh(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new LZ(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=Oh(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=MZ(t);return n.length?"?"+n:""}}class $Z extends i9{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};Vw(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,zw(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=L6()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let $6=!1;try{$6=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const jZ=$6;function HZ(){}class UZ extends $Z{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,a)=>{this.onError("xhr post error",i,a)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class Bi extends Jt{constructor(t,n,r){super(),this.createRequest=t,Yh(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=B6(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=Bi.requestsCount++,Bi.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=HZ,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Bi.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}Bi.requestsCount=0;Bi.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",d4);else if(typeof addEventListener=="function"){const e="onpagehide"in Lr?"pagehide":"unload";addEventListener(e,d4,!1)}}function d4(){for(let e in Bi.requests)Bi.requests.hasOwnProperty(e)&&Bi.requests[e].abort()}const zZ=function(){const e=j6({xdomain:!1});return e&&e.responseType!==null}();class VZ extends UZ{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=zZ&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Bi(j6,this.uri(),t)}}function j6(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||jZ))return new XMLHttpRequest}catch{}if(!t)try{return new Lr[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const H6=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class qZ extends i9{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=H6?{}:B6(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;Dh(r,this.supportsBinary,a=>{try{this.doWrite(r,a)}catch{}i&&Gh(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=L6()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const jm=Lr.WebSocket||Lr.MozWebSocket;class WZ extends qZ{createSocket(t,n,r){return H6?new jm(t,n,r):n?new jm(t,n):new jm(t)}doWrite(t,n){this.ws.send(n)}}class KZ extends i9{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=Ww(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=qw();i.readable.pipeTo(t.writable),this._writer=i.writable.getWriter();const a=()=>{r.read().then(({done:s,value:l})=>{s||(this.onPacket(l),a())}).catch(s=>{})};a();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;this._writer.write(r).then(()=>{i&&Gh(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const GZ={websocket:WZ,webtransport:KZ,polling:VZ},YZ=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,ZZ=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function tv(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=YZ.exec(e||""),a={},o=14;for(;o--;)a[ZZ[o]]=i[o]||"";return n!=-1&&r!=-1&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=QZ(a,a.path),a.queryKey=XZ(a,a.query),a}function QZ(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function XZ(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,a){i&&(n[i]=a)}),n}const nv=typeof addEventListener=="function"&&typeof removeEventListener=="function",Qd=[];nv&&addEventListener("offline",()=>{Qd.forEach(e=>e())},!1);class io extends Jt{constructor(t,n){if(super(),this.binaryType=OZ,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=tv(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=tv(n.host).host);Yh(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const i=r.prototype.name;this.transports.push(i),this._transportsByName[i]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=BZ(this.opts.query)),nv&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Qd.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=Nh,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&io.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",io.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=RZ(i)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,Gh(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const a={type:t,data:n,options:r};this.emitReserved("packetCreate",a),this.writeBuffer.push(a),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(io.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),nv&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Qd.indexOf(this._offlineEventListener);r!==-1&&Qd.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}io.protocol=Nh;class JZ extends io{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;io.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",d=>{if(!r)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;io.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(c(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const f=new Error("probe error");f.transport=n.name,this.emitReserved("upgradeError",f)}}))};function a(){r||(r=!0,c(),n.close(),n=null)}const o=d=>{const f=new Error("probe error: "+d);f.transport=n.name,a(),this.emitReserved("upgradeError",f)};function s(){o("transport closed")}function l(){o("socket closed")}function u(d){n&&d.name!==n.name&&a()}const c=()=>{n.removeListener("open",i),n.removeListener("error",o),n.removeListener("close",s),this.off("close",l),this.off("upgrading",u)};n.once("open",i),n.once("error",o),n.once("close",s),this.once("close",l),this.once("upgrading",u),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let eQ=class extends JZ{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(i=>GZ[i]).filter(i=>!!i)),super(t,r)}};function tQ(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=tv(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const a=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+a+":"+r.port+t,r.href=r.protocol+"://"+a+(n&&n.port===r.port?"":":"+r.port),r}function li(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const nQ=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class U6 extends Jt{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[li(t,"open",this.onopen.bind(this)),li(t,"packet",this.onpacket.bind(this)),li(t,"error",this.onerror.bind(this)),li(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,i,a;if(nQ.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const o={type:et.EVENT,data:n};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const c=this.ids++,d=n.pop();this._registerAckCallback(c,d),o.id=c}const s=(i=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||i===void 0?void 0:i.writable,l=this.connected&&!(!((a=this.io.engine)===null||a===void 0)&&a._hasPingExpired());return this.flags.volatile&&!s||(l?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const a=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let s=0;s<this.sendBuffer.length;s++)this.sendBuffer[s].id===t&&this.sendBuffer.splice(s,1);n.call(this,new Error("operation has timed out"))},i),o=(...s)=>{this.io.clearTimeoutFn(a),n.apply(this,s)};o.withError=!0,this.acks[t]=o}emitWithAck(t,...n){return new Promise((r,i)=>{const a=(o,s)=>o?i(o):r(s);a.withError=!0,n.push(a),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...a)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...a)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:et.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case et.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case et.EVENT:case et.BINARY_EVENT:this.onevent(t);break;case et.ACK:case et.BINARY_ACK:this.onack(t);break;case et.DISCONNECT:this.ondisconnect();break;case et.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:et.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:et.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function Wl(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Wl.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};Wl.prototype.reset=function(){this.attempts=0};Wl.prototype.setMin=function(e){this.ms=e};Wl.prototype.setMax=function(e){this.max=e};Wl.prototype.setJitter=function(e){this.jitter=e};class rv extends Jt{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Yh(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Wl({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||e7;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new eQ(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=li(n,"open",function(){r.onopen(),t&&t()}),a=s=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",s),t?t(s):this.maybeReconnectOnOpen()},o=li(n,"error",a);if(this._timeout!==!1){const s=this._timeout,l=this.setTimeoutFn(()=>{i(),a(new Error("timeout")),n.close()},s);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(li(t,"ping",this.onping.bind(this)),li(t,"data",this.ondata.bind(this)),li(t,"error",this.onerror.bind(this)),li(t,"close",this.onclose.bind(this)),li(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Gh(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new U6(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const hu={};function Xd(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=tQ(e,t.path||"/socket.io"),r=n.source,i=n.id,a=n.path,o=hu[i]&&a in hu[i].nsps,s=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let l;return s?l=new rv(r,t):(hu[i]||(hu[i]=new rv(r,t)),l=hu[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(Xd,{Manager:rv,Socket:U6,io:Xd,connect:Xd});const f4=e=>{let t;const n=new Set,r=(c,d)=>{const f=typeof c=="function"?c(t):c;if(!Object.is(f,t)){const h=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(m=>m(t,h))}},i=()=>t,l={setState:r,getState:i,getInitialState:()=>u,subscribe:c=>(n.add(c),()=>n.delete(c)),destroy:()=>{n.clear()}},u=t=e(r,i,l);return l},z6=e=>e?f4(e):f4;function br(){return br=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},br.apply(this,arguments)}class rQ extends Error{constructor(t){super(t),this.name=void 0,this.name="SuprSendError"}}function Wo(){return Math.round(Date.now())}function Ao(){var e=new Date().getTime(),t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var r=(e+Math.random()*16)%16|0;return e=Math.floor(e/16),(n=="x"?r:r&3|8).toString(16)});return t}const zn=z6()(()=>({apiUrl:"https://inboxs.live",collectorApiUrl:"https://hub.suprsend.com",socketUrl:"https://betainbox.suprsend.com",pageSize:20})),iQ={unseenCount:0,stores:{},activeStoreId:null,pageNumber:1,hasNext:!0,initialLoading:!1,fetchMoreLoading:!1,initialFetchTime:null},_t=z6()(()=>iQ);class aQ{constructor(t){this.socket=void 0,this.config=void 0,this.config=t;const n=zn.getState();this.socket=Xd(n.socketUrl,{transports:["websocket"],auth:{subscriber_id:this.config.subscriberId,distinct_id:this.config.distinctId,authorization:`${this.config.workspaceKey}:${Ao()}`,tenant_id:this.config.tenantId},reconnectionAttempts:25,reconnectionDelay:5e3,reconnectionDelayMax:1e4}),this._initializeSocketEvents()}orderNotifications(t,n){if(t.is_pinned)return[t,...n];{let r=!1,i=[];return n.forEach(a=>{a.is_pinned||r?i.push(a):(i.push(t),i.push(a),r=!0)}),r?i:[...n,t]}}_initializeSocketEvents(){var t=this;this.socket.on("new_notification",async function(n){n.n_id&&setTimeout(async function(){try{const i=await(await t.getNotificationDetails(n.n_id)).json(),a=_t.getState();if(t.config.stores){let o=!1;for(let s of t.config.stores){const l=a.stores[s.storeId];t._notificationBelongToStore(i.data,s)&&(o=!0,l.notifications=t.orderNotifications(i.data,l.notifications),l.unseenCount+=1)}o&&(a.unseenCount+=1,t.config.emitter.emit("new_notification",i.data)),_t.setState({unseenCount:a.unseenCount,stores:br({},a.stores)})}else{if(!a.activeStoreId)return;let o=a.stores[a.activeStoreId];a.unseenCount+=1,o.unseenCount+=1,o.notifications=t.orderNotifications(i.data,o.notifications),_t.setState({unseenCount:a.unseenCount,stores:br({},a.stores)}),t.config.emitter.emit("new_notification",i.data)}t.config.emitter.emit("sync_notif_store")}catch(r){console.log("SuprSend: error in new_notification event",r)}},1e3)}),this.socket.on("notification_updated",async function(n){n.n_id&&setTimeout(async function(){try{const a=await Promise.allSettled([t.getNotificationDetails(n.n_id),t.getNotificationsCount()]),o=_t.getState();let s=o.activeStoreId;if(a[0].status==="fulfilled"){var r;const u=await a[0].value.json(),c=u.data;if(!s)return;let d=o.stores[s];const f=(r=t.config.stores)==null?void 0:r.find(h=>h.storeId===s);if((n==null?void 0:n.type)==="archive"){var i;f!=null&&(i=f.query)!=null&&i.archived?t._notificationBelongToStore(c,f)&&(o.stores[s].notifications=[c,...d.notifications]):o.stores[s].notifications=d.notifications.filter(h=>h.n_id!==n.n_id)}else o.stores[s].notifications=d.notifications.map(h=>h.n_id===n.n_id?u.data:h);_t.setState({stores:br({},o.stores)})}if(a[1].status==="fulfilled"){const u=await a[1].value.json();_t.setState(c=>{for(let d in c.stores){const f=c.stores[d];f.unseenCount=u[d]||0}return{unseenCount:u.ss_bell_count,stores:br({},c.stores)}})}t.config.emitter.emit("sync_notif_store")}catch(a){console.log("SuprSend: error in notification_updated event",a)}},1e3)}),this.socket.on("update_badge",async function(){_t.setState({unseenCount:0}),t.config.emitter.emit("sync_notif_store")}),this.socket.on("mark_all_read",async function(){const n=_t.getState(),r=Wo();for(let i in n.stores){const a=n.stores[i];a.notifications.forEach(o=>{o.seen_on||(o.seen_on=r)}),a.unseenCount=0}_t.setState({stores:n.stores}),t.config.emitter.emit("sync_notif_store")})}_notificationBelongToStore(t,n){var r,i,a,o;const s=!!t.seen_on,l=t.archived,u=t.tags,c=t.n_category,d=n==null||(r=n.query)==null?void 0:r.read,f=n==null||(i=n.query)==null?void 0:i.archived,h=n==null||(a=n.query)==null?void 0:a.tags,m=n==null||(o=n.query)==null?void 0:o.categories,p=!d||s===d,y=!f||l===f;let v,b;return Array.isArray(h)&&h.length>0?h.forEach(_=>{u!=null&&u.includes(_)&&(v=!0)}):v=!0,Array.isArray(m)&&m.length>0?m.includes(c)&&(b=!0):b=!0,p&&v&&b&&y}_getStoreQueryString(t){const n=t==null?void 0:t.query;let r=(n==null?void 0:n.tags)||[],i=(n==null?void 0:n.categories)||[];const a=n==null?void 0:n.read,o=n==null?void 0:n.archived;return{store_id:t.storeId,query:{read:a,archived:o,tags:{or:r},categories:{or:i}}}}_getStoresQueryString(){const t=this.config.stores;return t==null?void 0:t.map(r=>this._getStoreQueryString(r))}getNotificationsCount(){const{apiUrl:t}=zn.getState();let n=`/notification_count/?subscriber_id=${this.config.subscriberId}&distinct_id=${this.config.distinctId}&tenant_id=${this.config.tenantId}`;if(this.config.stores){const r=this._getStoresQueryString();n+=`&stores=${encodeURIComponent(JSON.stringify(r))}`}return fetch(`${t}${n}`,{method:"GET",headers:{Authorization:`${this.config.workspaceKey}:${Ao()}`}})}getNotifications(t,n,r=20,i){const{apiUrl:a}=zn.getState();let o=`/notifications/?subscriber_id=${this.config.subscriberId}&distinct_id=${this.config.distinctId}&tenant_id=${this.config.tenantId}&page_no=${n}&page_size=${r}&before=${i}`;if(t){const s=this._getStoreQueryString(t);o+=`&store=${encodeURIComponent(JSON.stringify(s))}`}return fetch(`${a}${o}`,{method:"GET",headers:{Authorization:`${this.config.workspaceKey}:${Ao()}`}})}getNotificationDetails(t){const{apiUrl:n}=zn.getState(),r=`/notification/${t}/?subscriber_id=${this.config.subscriberId}&distinct_id=${this.config.distinctId}&tenant_id=${this.config.tenantId}`;return fetch(`${n}${r}`,{method:"GET",headers:{Authorization:`${this.config.workspaceKey}:${Ao()}`}})}markBellClicked(){const{apiUrl:t}=zn.getState(),n="/bell-clicked/",r=JSON.stringify({time:Wo(),distinct_id:this.config.distinctId,subscriber_id:this.config.subscriberId,tenant_id:this.config.tenantId});return fetch(`${t}${n}`,{method:"POST",body:r,headers:{Authorization:`${this.config.workspaceKey}:${Ao()}`,"Content-Type":"application/json"}})}markAllRead(){const{apiUrl:t}=zn.getState(),n="/mark-all-read/",r=JSON.stringify({time:Wo(),distinct_id:this.config.distinctId,subscriber_id:this.config.subscriberId,tenant_id:this.config.tenantId});return fetch(`${t}${n}`,{method:"POST",body:r,headers:{Authorization:`${this.config.workspaceKey}:${Ao()}`,"Content-Type":"application/json"}})}markNotificationClicked(t){const{collectorApiUrl:n}=zn.getState(),r={event:"$notification_clicked",env:this.config.workspaceKey,$insert_id:Ao(),$time:Wo(),properties:{id:t}};return fetch(`${n}/event/`,{method:"POST",body:JSON.stringify(r),headers:{Authorization:`${this.config.workspaceKey}:`,"Content-Type":"application/json"}})}markNotificationRead(t){const{apiUrl:n}=zn.getState();return fetch(`${n}/notification/${t}/action`,{method:"POST",body:JSON.stringify({action:"read",distinct_id:this.config.distinctId,subscriber_id:this.config.subscriberId}),headers:{Authorization:`${this.config.workspaceKey}:`,"Content-Type":"application/json"}})}markNotificationUnRead(t){const{apiUrl:n}=zn.getState();return fetch(`${n}/notification/${t}/action`,{method:"POST",body:JSON.stringify({action:"unread",distinct_id:this.config.distinctId,subscriber_id:this.config.subscriberId}),headers:{Authorization:`${this.config.workspaceKey}:`,"Content-Type":"application/json"}})}markNotificationArchive(t){const{apiUrl:n}=zn.getState();return fetch(`${n}/notification/${t}/action`,{method:"POST",body:JSON.stringify({action:"archive",distinct_id:this.config.distinctId,subscriber_id:this.config.subscriberId}),headers:{Authorization:`${this.config.workspaceKey}:`,"Content-Type":"application/json"}})}}let h4=class{constructor(t){this.config=void 0,this.config=t}_overallFirstApiCall(){const t=_t.getState();for(let n in t.stores)if(t.stores[n].isFirstCall===!1)return!1;return!0}async fetchNotifications(){var t,n;const r=this.config.client,i=_t.getState(),a=zn.getState(),o=i.activeStoreId;if(!o||!((t=i.stores)!=null&&t[o]))return;const s=i.stores[o],l=s.isFirstCall,u=i.initialFetchTime||Date.now(),c=(n=this.config.stores)==null?void 0:n.find(d=>d.storeId===o);try{if(!r||!i.hasNext)return;l?(_t.setState({initialLoading:!0}),this._overallFirstApiCall()&&this.getNotificationsCount()):i.pageNumber>1&&_t.setState({fetchMoreLoading:!0}),this.config.emitter.emit("sync_notif_store");const f=await(await r.getNotifications(c,i.pageNumber,a.pageSize,u)).json();let h;l||!l&&i.pageNumber===1?h=f.results:h=[...s.notifications,...f.results],i.stores[o].notifications=h,i.stores[o].isFirstCall=!1,_t.setState({stores:i.stores,pageNumber:i.pageNumber+1,hasNext:f.meta.current_page<f.meta.total_pages,initialFetchTime:u,initialLoading:!1,fetchMoreLoading:!1}),this.config.emitter.emit("sync_notif_store"),this.config._startExipryCheck()}catch(d){console.log("SUPRSEND: error getting latest notifications",d),_t.setState({initialLoading:!1,fetchMoreLoading:!1}),this.config.emitter.emit("sync_notif_store")}}async getNotificationsCount(){const t=this.config.client;if(t)try{const r=await(await t.getNotificationsCount()).json();_t.setState(i=>{for(let a in i.stores){const o=i.stores[a];o.unseenCount=r[a]||0}return{unseenCount:r.ss_bell_count,stores:br({},i.stores)}}),this.config.emitter.emit("sync_notif_store")}catch(n){console.log("SUPRSEND: error getting notifications count",n)}}async markClicked(t){var n;const r=this.config.client,i=_t.getState(),a=i.activeStoreId;if(!a||!((n=i.stores)!=null&&n[a]))return;const l=i.stores[a].notifications.find(c=>c.n_id===t);if(l&&(!l.interacted_on||!l.seen_on)){if(!r)return;try{l.interacted_on?l.seen_on||r.markNotificationRead(t):r.markNotificationClicked(t);const c=Wo();if(l.interacted_on=c,!l.seen_on)for(let d in i==null?void 0:i.stores){var u;const f=i.stores[d];(u=f.notifications)==null||u.forEach(h=>{h.n_id===l.n_id&&(h.seen_on=c,h.interacted_on=c,f.unseenCount>0&&(f.unseenCount-=1))})}_t.setState(br({},i)),this.config.emitter.emit("sync_notif_store")}catch(c){console.log("SUPRSEND: error marking notification clicked",c)}}}async markAllSeen(){const t=this.config.client;try{if(!t)return;t.markBellClicked(),_t.setState({unseenCount:0}),this.config.emitter.emit("sync_notif_store")}catch(n){console.log("SUPRSEND: error marking all notifications seen",n)}}async markAllRead(){const t=this.config.client;try{if(!t)return;t.markAllRead();const n=_t.getState(),r=Wo();for(let i in n.stores){const a=n.stores[i];a.notifications.forEach(o=>{o.seen_on||(o.seen_on=r)}),a.unseenCount=0}_t.setState({stores:n.stores}),this.config.emitter.emit("sync_notif_store")}catch(n){console.log("SUPRSEND: error marking all notifications read",n)}}async markRead(t){var n;const r=this.config.client,i=_t.getState(),a=i.activeStoreId;if(!a||!((n=i.stores)!=null&&n[a]))return;const l=i.stores[a].notifications.find(c=>c.n_id===t);if(l&&!l.seen_on){if(!r)return;try{r.markNotificationRead(t);const c=Wo();if(!l.seen_on)for(let d in i==null?void 0:i.stores){var u;const f=i.stores[d];(u=f.notifications)==null||u.forEach(h=>{h.n_id===l.n_id&&(h.seen_on=c,f.unseenCount>0&&(f.unseenCount-=1))})}_t.setState(br({},i)),this.config.emitter.emit("sync_notif_store")}catch(c){console.log("SUPRSEND: error marking notification read",c)}}}async markUnRead(t){var n;const r=this.config.client,i=_t.getState(),a=i.activeStoreId;if(!a||!((n=i.stores)!=null&&n[a]))return;const l=i.stores[a].notifications.find(c=>c.n_id===t);if(l&&l.seen_on){if(!r)return;try{if(r.markNotificationUnRead(t),l.seen_on)for(let c in i==null?void 0:i.stores){var u;const d=i.stores[c];(u=d.notifications)==null||u.forEach(f=>{f.n_id===l.n_id&&(f.seen_on=void 0,d.unseenCount>=0&&(d.unseenCount+=1))})}_t.setState(br({},i)),this.config.emitter.emit("sync_notif_store")}catch(c){console.log("SUPRSEND: error marking notification read",c)}}}markArchived(t){var n;const r=this.config.client,i=_t.getState(),a=i.activeStoreId;if(!a||!((n=i.stores)!=null&&n[a]))return;const s=(i==null?void 0:i.stores)[a],l=s.notifications.find(u=>u.n_id===t);if(l&&!l.archived){if(!r)return;try{r.markNotificationArchive(t),s.notifications=s.notifications.filter(u=>u.n_id!==t),!l.seen_on&&s.unseenCount>0&&(s.unseenCount-=1),_t.setState(br({},i)),this.config.emitter.emit("sync_notif_store")}catch(u){console.log("SUPRSEND: error marking notification archived",u)}}}get stores(){return this.config.stores}get data(){const t=_t.getState(),n=t.activeStoreId,r=this.stores;if(n)return{unseenCount:t.unseenCount,activeStoreId:t.activeStoreId,stores:t.stores,hasStores:r?(r==null?void 0:r.length)>0:!1,hasNext:t.hasNext,initialLoading:t.initialLoading,fetchMoreLoading:t.fetchMoreLoading}}};class oQ{constructor(t,n){this.workspaceKey="",this.tenantId=void 0,this.stores=void 0,this.distinctId=void 0,this.subscriberId=void 0,this._client=void 0,this._expiryTimerId=void 0,this.feed=new h4(this),this.emitter=Bw(),this._validateConfig(t),this._setConfigStoreState((n==null?void 0:n.host)||{}),this.tenantId=(n==null?void 0:n.tenantID)||"default",this._validateStore(n==null?void 0:n.stores),this._validatePageSize(n==null?void 0:n.pageSize),this._initializeStoreState()}_validateConfig(t){if(t)this.workspaceKey=t;else throw new rQ("workspaceKey missing")}_validateStore(t){if(!t||!Array.isArray(t))return;const n=[];t.forEach(r=>{if(!r.storeId){console.log("SuprSendInbox: storeId is mandatory if stores are used");return}const i=r==null?void 0:r.query;let a,o=[],s=[],l;typeof(i==null?void 0:i.read)=="boolean"&&(a=i.read),typeof(i==null?void 0:i.archived)=="boolean"&&(l=i.archived),typeof(i==null?void 0:i.tags)=="string"?o=[i.tags]:Array.isArray(i==null?void 0:i.tags)&&(o=i==null?void 0:i.tags.filter(u=>typeof u=="string")),typeof(i==null?void 0:i.categories)=="string"?s=[i.categories]:Array.isArray(i==null?void 0:i.categories)&&(s=i==null?void 0:i.categories.filter(u=>typeof u=="string")),n.push({storeId:r.storeId,label:r.label||r.storeId,query:{archived:l,read:a,tags:o,categories:s}})}),this.stores=n}_validatePageSize(t){if(t&&typeof t=="number"){const r=t<=50?t:50;zn.setState({pageSize:r})}}_setConfigStoreState(t){t&&(t!=null&&t.socketHost&&zn.setState({socketUrl:t.socketHost}),t!=null&&t.apiHost&&zn.setState({apiUrl:t.apiHost}),t!=null&&t.collectorHost&&zn.setState({collectorApiUrl:t.collectorHost}))}_initializeStoreState(){const t="default_store",n={notifications:[],unseenCount:0,isFirstCall:!0};if(this.stores&&Array.isArray(this.stores)&&this.stores.length>0){const r={};this.stores.map(i=>{r[i.storeId]=br({},n)}),_t.setState({stores:r,activeStoreId:this.stores[0].storeId})}else _t.setState({stores:{[t]:br({},n)},activeStoreId:t});setTimeout(()=>{this.emitter.emit("sync_notif_store")},0)}_startExipryCheck(){var t=this;this._expiryTimerId||(this._expiryTimerId=setInterval(async function(){const r=_t.getState().stores;let i=!1;for(let a in r){let o=r[a].notifications;o=o.filter(s=>(s.expiry?Date.now()>s.expiry:!1)?(i=!0,!1):!0),r[a].notifications=o}i&&(_t.setState({stores:r}),await t.feed.getNotificationsCount(),t.emitter.emit("sync_notif_store"))},3e4))}get client(){return this.distinctId&&this.subscriberId&&(this._client||(this._client=new aQ(this))),this._client}identifyUser(t,n){this.distinctId=t,this.subscriberId=n}changeActiveStore(t){var n;const r=_t.getState(),i={};if(r.activeStoreId!==t&&(n=r.stores)!=null&&n[t]){for(let a in r.stores){const o=r.stores[a],s=o.notifications.slice(0,20);i[a]={notifications:s,unseenCount:o.unseenCount,isFirstCall:o.isFirstCall}}_t.setState({activeStoreId:t,stores:i,pageNumber:1,hasNext:!0,initialLoading:!1,fetchMoreLoading:!1,initialFetchTime:null}),this.client&&this.feed.fetchNotifications()}}resetUser(){var t;_t.setState({unseenCount:0,pageNumber:1,hasNext:!0,initialLoading:!1,fetchMoreLoading:!1,initialFetchTime:null}),this._initializeStoreState(),(t=this._client)==null||t.socket.disconnect(),this.distinctId=void 0,this.subscriberId=void 0,this._client=void 0,clearInterval(this._expiryTimerId),this._expiryTimerId=void 0,this.feed=new h4(this)}}var p4=function(t){return t.reduce(function(n,r){var i=r[0],a=r[1];return n[i]=a,n},{})},m4=typeof window<"u"&&window.document&&window.document.createElement?Nn.useLayoutEffect:Nn.useEffect,rr="top",Wr="bottom",Kr="right",ir="left",a9="auto",Zc=[rr,Wr,Kr,ir],Dl="start",Mc="end",sQ="clippingParents",V6="viewport",pu="popper",lQ="reference",g4=Zc.reduce(function(e,t){return e.concat([t+"-"+Dl,t+"-"+Mc])},[]),q6=[].concat(Zc,[a9]).reduce(function(e,t){return e.concat([t,t+"-"+Dl,t+"-"+Mc])},[]),uQ="beforeRead",cQ="read",dQ="afterRead",fQ="beforeMain",hQ="main",pQ="afterMain",mQ="beforeWrite",gQ="write",vQ="afterWrite",yQ=[uQ,cQ,dQ,fQ,hQ,pQ,mQ,gQ,vQ];function Gi(e){return e?(e.nodeName||"").toLowerCase():null}function wr(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function as(e){var t=wr(e).Element;return e instanceof t||e instanceof Element}function zr(e){var t=wr(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function o9(e){if(typeof ShadowRoot>"u")return!1;var t=wr(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function bQ(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},a=t.elements[n];!zr(a)||!Gi(a)||(Object.assign(a.style,r),Object.keys(i).forEach(function(o){var s=i[o];s===!1?a.removeAttribute(o):a.setAttribute(o,s===!0?"":s)}))})}function EQ(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var i=t.elements[r],a=t.attributes[r]||{},o=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),s=o.reduce(function(l,u){return l[u]="",l},{});!zr(i)||!Gi(i)||(Object.assign(i.style,s),Object.keys(a).forEach(function(l){i.removeAttribute(l)}))})}}const _Q={name:"applyStyles",enabled:!0,phase:"write",fn:bQ,effect:EQ,requires:["computeStyles"]};function Li(e){return e.split("-")[0]}var Qo=Math.max,th=Math.min,Ol=Math.round;function iv(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function W6(){return!/^((?!chrome|android).)*safari/i.test(iv())}function Nl(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,a=1;t&&zr(e)&&(i=e.offsetWidth>0&&Ol(r.width)/e.offsetWidth||1,a=e.offsetHeight>0&&Ol(r.height)/e.offsetHeight||1);var o=as(e)?wr(e):window,s=o.visualViewport,l=!W6()&&n,u=(r.left+(l&&s?s.offsetLeft:0))/i,c=(r.top+(l&&s?s.offsetTop:0))/a,d=r.width/i,f=r.height/a;return{width:d,height:f,top:c,right:u+d,bottom:c+f,left:u,x:u,y:c}}function s9(e){var t=Nl(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function K6(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&o9(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function xa(e){return wr(e).getComputedStyle(e)}function TQ(e){return["table","td","th"].indexOf(Gi(e))>=0}function yo(e){return((as(e)?e.ownerDocument:e.document)||window.document).documentElement}function Zh(e){return Gi(e)==="html"?e:e.assignedSlot||e.parentNode||(o9(e)?e.host:null)||yo(e)}function v4(e){return!zr(e)||xa(e).position==="fixed"?null:e.offsetParent}function CQ(e){var t=/firefox/i.test(iv()),n=/Trident/i.test(iv());if(n&&zr(e)){var r=xa(e);if(r.position==="fixed")return null}var i=Zh(e);for(o9(i)&&(i=i.host);zr(i)&&["html","body"].indexOf(Gi(i))<0;){var a=xa(i);if(a.transform!=="none"||a.perspective!=="none"||a.contain==="paint"||["transform","perspective"].indexOf(a.willChange)!==-1||t&&a.willChange==="filter"||t&&a.filter&&a.filter!=="none")return i;i=i.parentNode}return null}function Qc(e){for(var t=wr(e),n=v4(e);n&&TQ(n)&&xa(n).position==="static";)n=v4(n);return n&&(Gi(n)==="html"||Gi(n)==="body"&&xa(n).position==="static")?t:n||CQ(e)||t}function l9(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function ic(e,t,n){return Qo(e,th(t,n))}function xQ(e,t,n){var r=ic(e,t,n);return r>n?n:r}function G6(){return{top:0,right:0,bottom:0,left:0}}function Y6(e){return Object.assign({},G6(),e)}function Z6(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var wQ=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,Y6(typeof t!="number"?t:Z6(t,Zc))};function AQ(e){var t,n=e.state,r=e.name,i=e.options,a=n.elements.arrow,o=n.modifiersData.popperOffsets,s=Li(n.placement),l=l9(s),u=[ir,Kr].indexOf(s)>=0,c=u?"height":"width";if(!(!a||!o)){var d=wQ(i.padding,n),f=s9(a),h=l==="y"?rr:ir,m=l==="y"?Wr:Kr,p=n.rects.reference[c]+n.rects.reference[l]-o[l]-n.rects.popper[c],y=o[l]-n.rects.reference[l],v=Qc(a),b=v?l==="y"?v.clientHeight||0:v.clientWidth||0:0,_=p/2-y/2,T=d[h],C=b-f[c]-d[m],x=b/2-f[c]/2+_,w=ic(T,x,C),P=l;n.modifiersData[r]=(t={},t[P]=w,t.centerOffset=w-x,t)}}function kQ(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||K6(t.elements.popper,i)&&(t.elements.arrow=i))}const SQ={name:"arrow",enabled:!0,phase:"main",fn:AQ,effect:kQ,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Il(e){return e.split("-")[1]}var DQ={top:"auto",right:"auto",bottom:"auto",left:"auto"};function OQ(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:Ol(n*i)/i||0,y:Ol(r*i)/i||0}}function y4(e){var t,n=e.popper,r=e.popperRect,i=e.placement,a=e.variation,o=e.offsets,s=e.position,l=e.gpuAcceleration,u=e.adaptive,c=e.roundOffsets,d=e.isFixed,f=o.x,h=f===void 0?0:f,m=o.y,p=m===void 0?0:m,y=typeof c=="function"?c({x:h,y:p}):{x:h,y:p};h=y.x,p=y.y;var v=o.hasOwnProperty("x"),b=o.hasOwnProperty("y"),_=ir,T=rr,C=window;if(u){var x=Qc(n),w="clientHeight",P="clientWidth";if(x===wr(n)&&(x=yo(n),xa(x).position!=="static"&&s==="absolute"&&(w="scrollHeight",P="scrollWidth")),x=x,i===rr||(i===ir||i===Kr)&&a===Mc){T=Wr;var O=d&&x===C&&C.visualViewport?C.visualViewport.height:x[w];p-=O-r.height,p*=l?1:-1}if(i===ir||(i===rr||i===Wr)&&a===Mc){_=Kr;var M=d&&x===C&&C.visualViewport?C.visualViewport.width:x[P];h-=M-r.width,h*=l?1:-1}}var R=Object.assign({position:s},u&&DQ),D=c===!0?OQ({x:h,y:p},wr(n)):{x:h,y:p};if(h=D.x,p=D.y,l){var S;return Object.assign({},R,(S={},S[T]=b?"0":"",S[_]=v?"0":"",S.transform=(C.devicePixelRatio||1)<=1?"translate("+h+"px, "+p+"px)":"translate3d("+h+"px, "+p+"px, 0)",S))}return Object.assign({},R,(t={},t[T]=b?p+"px":"",t[_]=v?h+"px":"",t.transform="",t))}function NQ(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,a=n.adaptive,o=a===void 0?!0:a,s=n.roundOffsets,l=s===void 0?!0:s,u={placement:Li(t.placement),variation:Il(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,y4(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,y4(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const IQ={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:NQ,data:{}};var M1={passive:!0};function PQ(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,a=i===void 0?!0:i,o=r.resize,s=o===void 0?!0:o,l=wr(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&u.forEach(function(c){c.addEventListener("scroll",n.update,M1)}),s&&l.addEventListener("resize",n.update,M1),function(){a&&u.forEach(function(c){c.removeEventListener("scroll",n.update,M1)}),s&&l.removeEventListener("resize",n.update,M1)}}const RQ={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:PQ,data:{}};var FQ={left:"right",right:"left",bottom:"top",top:"bottom"};function Jd(e){return e.replace(/left|right|bottom|top/g,function(t){return FQ[t]})}var MQ={start:"end",end:"start"};function b4(e){return e.replace(/start|end/g,function(t){return MQ[t]})}function u9(e){var t=wr(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function c9(e){return Nl(yo(e)).left+u9(e).scrollLeft}function BQ(e,t){var n=wr(e),r=yo(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,l=0;if(i){a=i.width,o=i.height;var u=W6();(u||!u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:a,height:o,x:s+c9(e),y:l}}function LQ(e){var t,n=yo(e),r=u9(e),i=(t=e.ownerDocument)==null?void 0:t.body,a=Qo(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),o=Qo(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+c9(e),l=-r.scrollTop;return xa(i||n).direction==="rtl"&&(s+=Qo(n.clientWidth,i?i.clientWidth:0)-a),{width:a,height:o,x:s,y:l}}function d9(e){var t=xa(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Q6(e){return["html","body","#document"].indexOf(Gi(e))>=0?e.ownerDocument.body:zr(e)&&d9(e)?e:Q6(Zh(e))}function ac(e,t){var n;t===void 0&&(t=[]);var r=Q6(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),a=wr(r),o=i?[a].concat(a.visualViewport||[],d9(r)?r:[]):r,s=t.concat(o);return i?s:s.concat(ac(Zh(o)))}function av(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function $Q(e,t){var n=Nl(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function E4(e,t,n){return t===V6?av(BQ(e,n)):as(t)?$Q(t,n):av(LQ(yo(e)))}function jQ(e){var t=ac(Zh(e)),n=["absolute","fixed"].indexOf(xa(e).position)>=0,r=n&&zr(e)?Qc(e):e;return as(r)?t.filter(function(i){return as(i)&&K6(i,r)&&Gi(i)!=="body"}):[]}function HQ(e,t,n,r){var i=t==="clippingParents"?jQ(e):[].concat(t),a=[].concat(i,[n]),o=a[0],s=a.reduce(function(l,u){var c=E4(e,u,r);return l.top=Qo(c.top,l.top),l.right=th(c.right,l.right),l.bottom=th(c.bottom,l.bottom),l.left=Qo(c.left,l.left),l},E4(e,o,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function X6(e){var t=e.reference,n=e.element,r=e.placement,i=r?Li(r):null,a=r?Il(r):null,o=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,l;switch(i){case rr:l={x:o,y:t.y-n.height};break;case Wr:l={x:o,y:t.y+t.height};break;case Kr:l={x:t.x+t.width,y:s};break;case ir:l={x:t.x-n.width,y:s};break;default:l={x:t.x,y:t.y}}var u=i?l9(i):null;if(u!=null){var c=u==="y"?"height":"width";switch(a){case Dl:l[u]=l[u]-(t[c]/2-n[c]/2);break;case Mc:l[u]=l[u]+(t[c]/2-n[c]/2);break}}return l}function Bc(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,a=n.strategy,o=a===void 0?e.strategy:a,s=n.boundary,l=s===void 0?sQ:s,u=n.rootBoundary,c=u===void 0?V6:u,d=n.elementContext,f=d===void 0?pu:d,h=n.altBoundary,m=h===void 0?!1:h,p=n.padding,y=p===void 0?0:p,v=Y6(typeof y!="number"?y:Z6(y,Zc)),b=f===pu?lQ:pu,_=e.rects.popper,T=e.elements[m?b:f],C=HQ(as(T)?T:T.contextElement||yo(e.elements.popper),l,c,o),x=Nl(e.elements.reference),w=X6({reference:x,element:_,strategy:"absolute",placement:i}),P=av(Object.assign({},_,w)),O=f===pu?P:x,M={top:C.top-O.top+v.top,bottom:O.bottom-C.bottom+v.bottom,left:C.left-O.left+v.left,right:O.right-C.right+v.right},R=e.modifiersData.offset;if(f===pu&&R){var D=R[i];Object.keys(M).forEach(function(S){var B=[Kr,Wr].indexOf(S)>=0?1:-1,H=[rr,Wr].indexOf(S)>=0?"y":"x";M[S]+=D[H]*B})}return M}function UQ(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,a=n.rootBoundary,o=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?q6:l,c=Il(r),d=c?s?g4:g4.filter(function(m){return Il(m)===c}):Zc,f=d.filter(function(m){return u.indexOf(m)>=0});f.length===0&&(f=d);var h=f.reduce(function(m,p){return m[p]=Bc(e,{placement:p,boundary:i,rootBoundary:a,padding:o})[Li(p)],m},{});return Object.keys(h).sort(function(m,p){return h[m]-h[p]})}function zQ(e){if(Li(e)===a9)return[];var t=Jd(e);return[b4(e),t,b4(t)]}function VQ(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,a=i===void 0?!0:i,o=n.altAxis,s=o===void 0?!0:o,l=n.fallbackPlacements,u=n.padding,c=n.boundary,d=n.rootBoundary,f=n.altBoundary,h=n.flipVariations,m=h===void 0?!0:h,p=n.allowedAutoPlacements,y=t.options.placement,v=Li(y),b=v===y,_=l||(b||!m?[Jd(y)]:zQ(y)),T=[y].concat(_).reduce(function(U,V){return U.concat(Li(V)===a9?UQ(t,{placement:V,boundary:c,rootBoundary:d,padding:u,flipVariations:m,allowedAutoPlacements:p}):V)},[]),C=t.rects.reference,x=t.rects.popper,w=new Map,P=!0,O=T[0],M=0;M<T.length;M++){var R=T[M],D=Li(R),S=Il(R)===Dl,B=[rr,Wr].indexOf(D)>=0,H=B?"width":"height",$=Bc(t,{placement:R,boundary:c,rootBoundary:d,altBoundary:f,padding:u}),F=B?S?Kr:ir:S?Wr:rr;C[H]>x[H]&&(F=Jd(F));var ne=Jd(F),J=[];if(a&&J.push($[D]<=0),s&&J.push($[F]<=0,$[ne]<=0),J.every(function(U){return U})){O=R,P=!1;break}w.set(R,J)}if(P)for(var I=m?3:1,A=function(V){var z=T.find(function(j){var ue=w.get(j);if(ue)return ue.slice(0,V).every(function(Q){return Q})});if(z)return O=z,"break"},Y=I;Y>0;Y--){var L=A(Y);if(L==="break")break}t.placement!==O&&(t.modifiersData[r]._skip=!0,t.placement=O,t.reset=!0)}}const qQ={name:"flip",enabled:!0,phase:"main",fn:VQ,requiresIfExists:["offset"],data:{_skip:!1}};function _4(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function T4(e){return[rr,Kr,Wr,ir].some(function(t){return e[t]>=0})}function WQ(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,a=t.modifiersData.preventOverflow,o=Bc(t,{elementContext:"reference"}),s=Bc(t,{altBoundary:!0}),l=_4(o,r),u=_4(s,i,a),c=T4(l),d=T4(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":d})}const KQ={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:WQ};function GQ(e,t,n){var r=Li(e),i=[ir,rr].indexOf(r)>=0?-1:1,a=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,o=a[0],s=a[1];return o=o||0,s=(s||0)*i,[ir,Kr].indexOf(r)>=0?{x:s,y:o}:{x:o,y:s}}function YQ(e){var t=e.state,n=e.options,r=e.name,i=n.offset,a=i===void 0?[0,0]:i,o=q6.reduce(function(c,d){return c[d]=GQ(d,t.rects,a),c},{}),s=o[t.placement],l=s.x,u=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=o}const ZQ={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:YQ};function QQ(e){var t=e.state,n=e.name;t.modifiersData[n]=X6({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const XQ={name:"popperOffsets",enabled:!0,phase:"read",fn:QQ,data:{}};function JQ(e){return e==="x"?"y":"x"}function eX(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,a=i===void 0?!0:i,o=n.altAxis,s=o===void 0?!1:o,l=n.boundary,u=n.rootBoundary,c=n.altBoundary,d=n.padding,f=n.tether,h=f===void 0?!0:f,m=n.tetherOffset,p=m===void 0?0:m,y=Bc(t,{boundary:l,rootBoundary:u,padding:d,altBoundary:c}),v=Li(t.placement),b=Il(t.placement),_=!b,T=l9(v),C=JQ(T),x=t.modifiersData.popperOffsets,w=t.rects.reference,P=t.rects.popper,O=typeof p=="function"?p(Object.assign({},t.rects,{placement:t.placement})):p,M=typeof O=="number"?{mainAxis:O,altAxis:O}:Object.assign({mainAxis:0,altAxis:0},O),R=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,D={x:0,y:0};if(x){if(a){var S,B=T==="y"?rr:ir,H=T==="y"?Wr:Kr,$=T==="y"?"height":"width",F=x[T],ne=F+y[B],J=F-y[H],I=h?-P[$]/2:0,A=b===Dl?w[$]:P[$],Y=b===Dl?-P[$]:-w[$],L=t.elements.arrow,U=h&&L?s9(L):{width:0,height:0},V=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:G6(),z=V[B],j=V[H],ue=ic(0,w[$],U[$]),Q=_?w[$]/2-I-ue-z-M.mainAxis:A-ue-z-M.mainAxis,ie=_?-w[$]/2+I+ue+j+M.mainAxis:Y+ue+j+M.mainAxis,le=t.elements.arrow&&Qc(t.elements.arrow),te=le?T==="y"?le.clientTop||0:le.clientLeft||0:0,Ae=(S=R==null?void 0:R[T])!=null?S:0,Oe=F+Q-Ae-te,Te=F+ie-Ae,se=ic(h?th(ne,Oe):ne,F,h?Qo(J,Te):J);x[T]=se,D[T]=se-F}if(s){var ve,ke=T==="x"?rr:ir,Fe=T==="x"?Wr:Kr,ht=x[C],gt=C==="y"?"height":"width",nt=ht+y[ke],ot=ht-y[Fe],je=[rr,ir].indexOf(v)!==-1,re=(ve=R==null?void 0:R[C])!=null?ve:0,ge=je?nt:ht-w[gt]-P[gt]-re+M.altAxis,Ne=je?ht+w[gt]+P[gt]-re-M.altAxis:ot,ye=h&&je?xQ(ge,ht,Ne):ic(h?ge:nt,ht,h?Ne:ot);x[C]=ye,D[C]=ye-ht}t.modifiersData[r]=D}}const tX={name:"preventOverflow",enabled:!0,phase:"main",fn:eX,requiresIfExists:["offset"]};function nX(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function rX(e){return e===wr(e)||!zr(e)?u9(e):nX(e)}function iX(e){var t=e.getBoundingClientRect(),n=Ol(t.width)/e.offsetWidth||1,r=Ol(t.height)/e.offsetHeight||1;return n!==1||r!==1}function aX(e,t,n){n===void 0&&(n=!1);var r=zr(t),i=zr(t)&&iX(t),a=yo(t),o=Nl(e,i,n),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((Gi(t)!=="body"||d9(a))&&(s=rX(t)),zr(t)?(l=Nl(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):a&&(l.x=c9(a))),{x:o.left+s.scrollLeft-l.x,y:o.top+s.scrollTop-l.y,width:o.width,height:o.height}}function oX(e){var t=new Map,n=new Set,r=[];e.forEach(function(a){t.set(a.name,a)});function i(a){n.add(a.name);var o=[].concat(a.requires||[],a.requiresIfExists||[]);o.forEach(function(s){if(!n.has(s)){var l=t.get(s);l&&i(l)}}),r.push(a)}return e.forEach(function(a){n.has(a.name)||i(a)}),r}function sX(e){var t=oX(e);return yQ.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function lX(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function uX(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var C4={placement:"bottom",modifiers:[],strategy:"absolute"};function x4(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function cX(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,i=t.defaultOptions,a=i===void 0?C4:i;return function(s,l,u){u===void 0&&(u=a);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},C4,a),modifiersData:{},elements:{reference:s,popper:l},attributes:{},styles:{}},d=[],f=!1,h={state:c,setOptions:function(v){var b=typeof v=="function"?v(c.options):v;p(),c.options=Object.assign({},a,c.options,b),c.scrollParents={reference:as(s)?ac(s):s.contextElement?ac(s.contextElement):[],popper:ac(l)};var _=sX(uX([].concat(r,c.options.modifiers)));return c.orderedModifiers=_.filter(function(T){return T.enabled}),m(),h.update()},forceUpdate:function(){if(!f){var v=c.elements,b=v.reference,_=v.popper;if(x4(b,_)){c.rects={reference:aX(b,Qc(_),c.options.strategy==="fixed"),popper:s9(_)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(M){return c.modifiersData[M.name]=Object.assign({},M.data)});for(var T=0;T<c.orderedModifiers.length;T++){if(c.reset===!0){c.reset=!1,T=-1;continue}var C=c.orderedModifiers[T],x=C.fn,w=C.options,P=w===void 0?{}:w,O=C.name;typeof x=="function"&&(c=x({state:c,options:P,name:O,instance:h})||c)}}}},update:lX(function(){return new Promise(function(y){h.forceUpdate(),y(c)})}),destroy:function(){p(),f=!0}};if(!x4(s,l))return h;h.setOptions(u).then(function(y){!f&&u.onFirstUpdate&&u.onFirstUpdate(y)});function m(){c.orderedModifiers.forEach(function(y){var v=y.name,b=y.options,_=b===void 0?{}:b,T=y.effect;if(typeof T=="function"){var C=T({state:c,name:v,instance:h,options:_}),x=function(){};d.push(C||x)}})}function p(){d.forEach(function(y){return y()}),d=[]}return h}}var dX=[RQ,XQ,IQ,_Q,ZQ,qQ,tX,SQ,KQ],fX=cX({defaultModifiers:dX}),hX=typeof Element<"u",pX=typeof Map=="function",mX=typeof Set=="function",gX=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function ef(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!ef(e[r],t[r]))return!1;return!0}var a;if(pX&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(a=e.entries();!(r=a.next()).done;)if(!t.has(r.value[0]))return!1;for(a=e.entries();!(r=a.next()).done;)if(!ef(r.value[1],t.get(r.value[0])))return!1;return!0}if(mX&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(a=e.entries();!(r=a.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(gX&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;if(hX&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((i[r]==="_owner"||i[r]==="__v"||i[r]==="__o")&&e.$$typeof)&&!ef(e[i[r]],t[i[r]]))return!1;return!0}return e!==e&&t!==t}var vX=function(t,n){try{return ef(t,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};const yX=gi(vX);var bX=[],EX=function(t,n,r){r===void 0&&(r={});var i=Nn.useRef(null),a={onFirstUpdate:r.onFirstUpdate,placement:r.placement||"bottom",strategy:r.strategy||"absolute",modifiers:r.modifiers||bX},o=Nn.useState({styles:{popper:{position:a.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),s=o[0],l=o[1],u=Nn.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(h){var m=h.state,p=Object.keys(m.elements);ND.flushSync(function(){l({styles:p4(p.map(function(y){return[y,m.styles[y]||{}]})),attributes:p4(p.map(function(y){return[y,m.attributes[y]]}))})})},requires:["computeStyles"]}},[]),c=Nn.useMemo(function(){var f={onFirstUpdate:a.onFirstUpdate,placement:a.placement,strategy:a.strategy,modifiers:[].concat(a.modifiers,[u,{name:"applyStyles",enabled:!1}])};return yX(i.current,f)?i.current||f:(i.current=f,f)},[a.onFirstUpdate,a.placement,a.strategy,a.modifiers,u]),d=Nn.useRef();return m4(function(){d.current&&d.current.setOptions(c)},[c]),m4(function(){if(!(t==null||n==null)){var f=r.createPopper||fX,h=f(t,n,c);return d.current=h,function(){h.destroy(),d.current=null}}},[t,n,r.createPopper]),{state:d.current?d.current.state:null,styles:s.styles,attributes:s.attributes,update:d.current?d.current.update:null,forceUpdate:d.current?d.current.forceUpdate:null}};function ov(){return ov=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},ov.apply(this,arguments)}function J6(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var _X=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,TX=J6(function(e){return _X.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),CX=!1;function xX(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function wX(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var AX=function(){function e(n){var r=this;this._insertTag=function(i){var a;r.tags.length===0?r.insertionPoint?a=r.insertionPoint.nextSibling:r.prepend?a=r.container.firstChild:a=r.before:a=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(i,a),r.tags.push(i)},this.isSpeedy=n.speedy===void 0?!CX:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(wX(this));var i=this.tags[this.tags.length-1];if(this.isSpeedy){var a=xX(i);try{a.insertRule(r,a.cssRules.length)}catch{}}else i.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){var i;return(i=r.parentNode)==null?void 0:i.removeChild(r)}),this.tags=[],this.ctr=0},e}(),Pn="-ms-",nh="-moz-",Ot="-webkit-",eA="comm",f9="rule",h9="decl",kX="@import",tA="@keyframes",SX="@layer",DX=Math.abs,Qh=String.fromCharCode,OX=Object.assign;function NX(e,t){return On(e,0)^45?(((t<<2^On(e,0))<<2^On(e,1))<<2^On(e,2))<<2^On(e,3):0}function nA(e){return e.trim()}function IX(e,t){return(e=t.exec(e))?e[0]:e}function Nt(e,t,n){return e.replace(t,n)}function sv(e,t){return e.indexOf(t)}function On(e,t){return e.charCodeAt(t)|0}function Lc(e,t,n){return e.slice(t,n)}function Di(e){return e.length}function p9(e){return e.length}function B1(e,t){return t.push(e),e}function PX(e,t){return e.map(t).join("")}var Xh=1,Pl=1,rA=0,ur=0,gn=0,Kl="";function Jh(e,t,n,r,i,a,o){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:Xh,column:Pl,length:o,return:""}}function mu(e,t){return OX(Jh("",null,null,"",null,null,0),e,{length:-e.length},t)}function RX(){return gn}function FX(){return gn=ur>0?On(Kl,--ur):0,Pl--,gn===10&&(Pl=1,Xh--),gn}function Tr(){return gn=ur<rA?On(Kl,ur++):0,Pl++,gn===10&&(Pl=1,Xh++),gn}function $i(){return On(Kl,ur)}function tf(){return ur}function Xc(e,t){return Lc(Kl,e,t)}function $c(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function iA(e){return Xh=Pl=1,rA=Di(Kl=e),ur=0,[]}function aA(e){return Kl="",e}function nf(e){return nA(Xc(ur-1,lv(e===91?e+2:e===40?e+1:e)))}function MX(e){for(;(gn=$i())&&gn<33;)Tr();return $c(e)>2||$c(gn)>3?"":" "}function BX(e,t){for(;--t&&Tr()&&!(gn<48||gn>102||gn>57&&gn<65||gn>70&&gn<97););return Xc(e,tf()+(t<6&&$i()==32&&Tr()==32))}function lv(e){for(;Tr();)switch(gn){case e:return ur;case 34:case 39:e!==34&&e!==39&&lv(gn);break;case 40:e===41&&lv(e);break;case 92:Tr();break}return ur}function LX(e,t){for(;Tr()&&e+gn!==47+10;)if(e+gn===42+42&&$i()===47)break;return"/*"+Xc(t,ur-1)+"*"+Qh(e===47?e:Tr())}function $X(e){for(;!$c($i());)Tr();return Xc(e,ur)}function jX(e){return aA(rf("",null,null,null,[""],e=iA(e),0,[0],e))}function rf(e,t,n,r,i,a,o,s,l){for(var u=0,c=0,d=o,f=0,h=0,m=0,p=1,y=1,v=1,b=0,_="",T=i,C=a,x=r,w=_;y;)switch(m=b,b=Tr()){case 40:if(m!=108&&On(w,d-1)==58){sv(w+=Nt(nf(b),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:w+=nf(b);break;case 9:case 10:case 13:case 32:w+=MX(m);break;case 92:w+=BX(tf()-1,7);continue;case 47:switch($i()){case 42:case 47:B1(HX(LX(Tr(),tf()),t,n),l);break;default:w+="/"}break;case 123*p:s[u++]=Di(w)*v;case 125*p:case 59:case 0:switch(b){case 0:case 125:y=0;case 59+c:v==-1&&(w=Nt(w,/\f/g,"")),h>0&&Di(w)-d&&B1(h>32?A4(w+";",r,n,d-1):A4(Nt(w," ","")+";",r,n,d-2),l);break;case 59:w+=";";default:if(B1(x=w4(w,t,n,u,c,i,s,_,T=[],C=[],d),a),b===123)if(c===0)rf(w,t,x,x,T,a,d,s,C);else switch(f===99&&On(w,3)===110?100:f){case 100:case 108:case 109:case 115:rf(e,x,x,r&&B1(w4(e,x,x,0,0,i,s,_,i,T=[],d),C),i,C,d,s,r?T:C);break;default:rf(w,x,x,x,[""],C,0,s,C)}}u=c=h=0,p=v=1,_=w="",d=o;break;case 58:d=1+Di(w),h=m;default:if(p<1){if(b==123)--p;else if(b==125&&p++==0&&FX()==125)continue}switch(w+=Qh(b),b*p){case 38:v=c>0?1:(w+="\f",-1);break;case 44:s[u++]=(Di(w)-1)*v,v=1;break;case 64:$i()===45&&(w+=nf(Tr())),f=$i(),c=d=Di(_=w+=$X(tf())),b++;break;case 45:m===45&&Di(w)==2&&(p=0)}}return a}function w4(e,t,n,r,i,a,o,s,l,u,c){for(var d=i-1,f=i===0?a:[""],h=p9(f),m=0,p=0,y=0;m<r;++m)for(var v=0,b=Lc(e,d+1,d=DX(p=o[m])),_=e;v<h;++v)(_=nA(p>0?f[v]+" "+b:Nt(b,/&\f/g,f[v])))&&(l[y++]=_);return Jh(e,t,n,i===0?f9:s,l,u,c)}function HX(e,t,n){return Jh(e,t,n,eA,Qh(RX()),Lc(e,2,-2),0)}function A4(e,t,n,r){return Jh(e,t,n,h9,Lc(e,0,r),Lc(e,r+1,-1),r)}function ul(e,t){for(var n="",r=p9(e),i=0;i<r;i++)n+=t(e[i],i,e,t)||"";return n}function UX(e,t,n,r){switch(e.type){case SX:if(e.children.length)break;case kX:case h9:return e.return=e.return||e.value;case eA:return"";case tA:return e.return=e.value+"{"+ul(e.children,r)+"}";case f9:e.value=e.props.join(",")}return Di(n=ul(e.children,r))?e.return=e.value+"{"+n+"}":""}function zX(e){var t=p9(e);return function(n,r,i,a){for(var o="",s=0;s<t;s++)o+=e[s](n,r,i,a)||"";return o}}function VX(e){return function(t){t.root||(t=t.return)&&e(t)}}var qX=function(t,n,r){for(var i=0,a=0;i=a,a=$i(),i===38&&a===12&&(n[r]=1),!$c(a);)Tr();return Xc(t,ur)},WX=function(t,n){var r=-1,i=44;do switch($c(i)){case 0:i===38&&$i()===12&&(n[r]=1),t[r]+=qX(ur-1,n,r);break;case 2:t[r]+=nf(i);break;case 4:if(i===44){t[++r]=$i()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=Qh(i)}while(i=Tr());return t},KX=function(t,n){return aA(WX(iA(t),n))},k4=new WeakMap,GX=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var n=t.value,r=t.parent,i=t.column===r.column&&t.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(t.props.length===1&&n.charCodeAt(0)!==58&&!k4.get(r))&&!i){k4.set(t,!0);for(var a=[],o=KX(n,a),s=r.props,l=0,u=0;l<o.length;l++)for(var c=0;c<s.length;c++,u++)t.props[u]=a[l]?o[l].replace(/&\f/g,s[c]):s[c]+" "+o[l]}}},YX=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function oA(e,t){switch(NX(e,t)){case 5103:return Ot+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Ot+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Ot+e+nh+e+Pn+e+e;case 6828:case 4268:return Ot+e+Pn+e+e;case 6165:return Ot+e+Pn+"flex-"+e+e;case 5187:return Ot+e+Nt(e,/(\w+).+(:[^]+)/,Ot+"box-$1$2"+Pn+"flex-$1$2")+e;case 5443:return Ot+e+Pn+"flex-item-"+Nt(e,/flex-|-self/,"")+e;case 4675:return Ot+e+Pn+"flex-line-pack"+Nt(e,/align-content|flex-|-self/,"")+e;case 5548:return Ot+e+Pn+Nt(e,"shrink","negative")+e;case 5292:return Ot+e+Pn+Nt(e,"basis","preferred-size")+e;case 6060:return Ot+"box-"+Nt(e,"-grow","")+Ot+e+Pn+Nt(e,"grow","positive")+e;case 4554:return Ot+Nt(e,/([^-])(transform)/g,"$1"+Ot+"$2")+e;case 6187:return Nt(Nt(Nt(e,/(zoom-|grab)/,Ot+"$1"),/(image-set)/,Ot+"$1"),e,"")+e;case 5495:case 3959:return Nt(e,/(image-set\([^]*)/,Ot+"$1$`$1");case 4968:return Nt(Nt(e,/(.+:)(flex-)?(.*)/,Ot+"box-pack:$3"+Pn+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Ot+e+e;case 4095:case 3583:case 4068:case 2532:return Nt(e,/(.+)-inline(.+)/,Ot+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Di(e)-1-t>6)switch(On(e,t+1)){case 109:if(On(e,t+4)!==45)break;case 102:return Nt(e,/(.+:)(.+)-([^]+)/,"$1"+Ot+"$2-$3$1"+nh+(On(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~sv(e,"stretch")?oA(Nt(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(On(e,t+1)!==115)break;case 6444:switch(On(e,Di(e)-3-(~sv(e,"!important")&&10))){case 107:return Nt(e,":",":"+Ot)+e;case 101:return Nt(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Ot+(On(e,14)===45?"inline-":"")+"box$3$1"+Ot+"$2$3$1"+Pn+"$2box$3")+e}break;case 5936:switch(On(e,t+11)){case 114:return Ot+e+Pn+Nt(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Ot+e+Pn+Nt(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Ot+e+Pn+Nt(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Ot+e+Pn+e+e}return e}var ZX=function(t,n,r,i){if(t.length>-1&&!t.return)switch(t.type){case h9:t.return=oA(t.value,t.length);break;case tA:return ul([mu(t,{value:Nt(t.value,"@","@"+Ot)})],i);case f9:if(t.length)return PX(t.props,function(a){switch(IX(a,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return ul([mu(t,{props:[Nt(a,/:(read-\w+)/,":"+nh+"$1")]})],i);case"::placeholder":return ul([mu(t,{props:[Nt(a,/:(plac\w+)/,":"+Ot+"input-$1")]}),mu(t,{props:[Nt(a,/:(plac\w+)/,":"+nh+"$1")]}),mu(t,{props:[Nt(a,/:(plac\w+)/,Pn+"input-$1")]})],i)}return""})}},QX=[ZX],XX=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(p){var y=p.getAttribute("data-emotion");y.indexOf(" ")!==-1&&(document.head.appendChild(p),p.setAttribute("data-s",""))})}var i=t.stylisPlugins||QX,a={},o,s=[];o=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(p){for(var y=p.getAttribute("data-emotion").split(" "),v=1;v<y.length;v++)a[y[v]]=!0;s.push(p)});var l,u=[GX,YX];{var c,d=[UX,VX(function(p){c.insert(p)})],f=zX(u.concat(i,d)),h=function(y){return ul(jX(y),f)};l=function(y,v,b,_){c=b,h(y?y+"{"+v.styles+"}":v.styles),_&&(m.inserted[v.name]=!0)}}var m={key:n,sheet:new AX({key:n,container:o,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:a,registered:{},insert:l};return m.sheet.hydrate(s),m},sA=$v(),JX={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},eJ={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},lA={};lA[sA.ForwardRef]=JX;lA[sA.Memo]=eJ;var tJ=!0;function nJ(e,t,n){var r="";return n.split(" ").forEach(function(i){e[i]!==void 0?t.push(e[i]+";"):i&&(r+=i+" ")}),r}var uA=function(t,n,r){var i=t.key+"-"+n.name;(r===!1||tJ===!1)&&t.registered[i]===void 0&&(t.registered[i]=n.styles)},rJ=function(t,n,r){uA(t,n,r);var i=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var a=n;do t.insert(n===a?"."+i:"",a,t.sheet,!0),a=a.next;while(a!==void 0)}};function iJ(e){for(var t=0,n,r=0,i=e.length;i>=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var aJ={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},oJ=!1,sJ=/[A-Z]|^ms/g,lJ=/_EMO_([^_]+?)_([^]*?)_EMO_/g,cA=function(t){return t.charCodeAt(1)===45},S4=function(t){return t!=null&&typeof t!="boolean"},Hm=J6(function(e){return cA(e)?e:e.replace(sJ,"-$&").toLowerCase()}),D4=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(lJ,function(r,i,a){return Oi={name:i,styles:a,next:Oi},i})}return aJ[t]!==1&&!cA(t)&&typeof n=="number"&&n!==0?n+"px":n},uJ="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function jc(e,t,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var i=n;if(i.anim===1)return Oi={name:i.name,styles:i.styles,next:Oi},i.name;var a=n;if(a.styles!==void 0){var o=a.next;if(o!==void 0)for(;o!==void 0;)Oi={name:o.name,styles:o.styles,next:Oi},o=o.next;var s=a.styles+";";return s}return cJ(e,t,n)}case"function":{if(e!==void 0){var l=Oi,u=n(e);return Oi=l,jc(e,t,u)}break}}var c=n;if(t==null)return c;var d=t[c];return d!==void 0?d:c}function cJ(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=jc(e,t,n[i])+";";else for(var a in n){var o=n[a];if(typeof o!="object"){var s=o;t!=null&&t[s]!==void 0?r+=a+"{"+t[s]+"}":S4(s)&&(r+=Hm(a)+":"+D4(a,s)+";")}else{if(a==="NO_COMPONENT_SELECTOR"&&oJ)throw new Error(uJ);if(Array.isArray(o)&&typeof o[0]=="string"&&(t==null||t[o[0]]===void 0))for(var l=0;l<o.length;l++)S4(o[l])&&(r+=Hm(a)+":"+D4(a,o[l])+";");else{var u=jc(e,t,o);switch(a){case"animation":case"animationName":{r+=Hm(a)+":"+u+";";break}default:r+=a+"{"+u+"}"}}}}return r}var O4=/label:\s*([^\s;{]+)\s*(;|$)/g,Oi;function dA(e,t,n){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,i="";Oi=void 0;var a=e[0];if(a==null||a.raw===void 0)r=!1,i+=jc(n,t,a);else{var o=a;i+=o[0]}for(var s=1;s<e.length;s++)if(i+=jc(n,t,e[s]),r){var l=a;i+=l[s]}O4.lastIndex=0;for(var u="",c;(c=O4.exec(i))!==null;)u+="-"+c[1];var d=iJ(i)+u;return{name:d,styles:i,next:Oi}}var dJ=function(t){return t()},fJ=Nn["useInsertionEffect"]?Nn["useInsertionEffect"]:!1,hJ=fJ||dJ,fA=Nn.createContext(typeof HTMLElement<"u"?XX({key:"css"}):null);fA.Provider;var pJ=function(t){return E.forwardRef(function(n,r){var i=E.useContext(fA);return t(n,i,r)})},mJ=Nn.createContext({});function gJ(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return dA(t)}var vJ=function(){var t=gJ.apply(void 0,arguments),n="animation-"+t.name;return{name:n,styles:"@keyframes "+n+"{"+t.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}},yJ=TX,bJ=function(t){return t!=="theme"},N4=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?yJ:bJ},I4=function(t,n,r){var i;if(n){var a=n.shouldForwardProp;i=t.__emotion_forwardProp&&a?function(o){return t.__emotion_forwardProp(o)&&a(o)}:a}return typeof i!="function"&&r&&(i=t.__emotion_forwardProp),i},EJ=!1,_J=function(t){var n=t.cache,r=t.serialized,i=t.isStringTag;return uA(n,r,i),hJ(function(){return rJ(n,r,i)}),null},TJ=function e(t,n){var r=t.__emotion_real===t,i=r&&t.__emotion_base||t,a,o;n!==void 0&&(a=n.label,o=n.target);var s=I4(t,n,r),l=s||N4(i),u=!l("as");return function(){var c=arguments,d=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(a!==void 0&&d.push("label:"+a+";"),c[0]==null||c[0].raw===void 0)d.push.apply(d,c);else{d.push(c[0][0]);for(var f=c.length,h=1;h<f;h++)d.push(c[h],c[0][h])}var m=pJ(function(p,y,v){var b=u&&p.as||i,_="",T=[],C=p;if(p.theme==null){C={};for(var x in p)C[x]=p[x];C.theme=Nn.useContext(mJ)}typeof p.className=="string"?_=nJ(y.registered,T,p.className):p.className!=null&&(_=p.className+" ");var w=dA(d.concat(T),y.registered,C);_+=y.key+"-"+w.name,o!==void 0&&(_+=" "+o);var P=u&&s===void 0?N4(b):l,O={};for(var M in p)u&&M==="as"||P(M)&&(O[M]=p[M]);return O.className=_,v&&(O.ref=v),Nn.createElement(Nn.Fragment,null,Nn.createElement(_J,{cache:y,serialized:w,isStringTag:typeof b=="string"}),Nn.createElement(b,O))});return m.displayName=a!==void 0?a:"Styled("+(typeof i=="string"?i:i.displayName||i.name||"Component")+")",m.defaultProps=t.defaultProps,m.__emotion_real=m,m.__emotion_base=i,m.__emotion_styles=d,m.__emotion_forwardProp=s,Object.defineProperty(m,"toString",{value:function(){return o===void 0&&EJ?"NO_COMPONENT_SELECTOR":"."+o}}),m.withComponent=function(p,y){return e(p,ov({},n,y,{shouldForwardProp:I4(m,y,!0)})).apply(void 0,d)},m}},CJ=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],Be=TJ.bind();CJ.forEach(function(e){Be[e]=Be(e)});var xs={}.hasOwnProperty,hA=xJ;function xJ(e){return!e||typeof e!="object"?"":xs.call(e,"position")||xs.call(e,"type")?P4(e.position):xs.call(e,"start")||xs.call(e,"end")?P4(e):xs.call(e,"line")||xs.call(e,"column")?uv(e):""}function uv(e){return(!e||typeof e!="object")&&(e={}),R4(e.line)+":"+R4(e.column)}function P4(e){return(!e||typeof e!="object")&&(e={}),uv(e.start)+"-"+uv(e.end)}function R4(e){return e&&typeof e=="number"?e:1}var wJ=hA,AJ=m9;function pA(){}pA.prototype=Error.prototype;m9.prototype=new pA;var bo=m9.prototype;bo.file="";bo.name="";bo.reason="";bo.message="";bo.stack="";bo.fatal=null;bo.column=null;bo.line=null;function m9(e,t,n){var r,i,a;typeof t=="string"&&(n=t,t=null),r=kJ(n),i=wJ(t)||"1:1",a={start:{line:null,column:null},end:{line:null,column:null}},t&&t.position&&(t=t.position),t&&(t.start?(a=t,t=t.start):a.start=t),e.stack&&(this.stack=e.stack,e=e.message),this.message=e,this.name=i,this.reason=e,this.line=t?t.line:null,this.column=t?t.column:null,this.location=a,this.source=r[0],this.ruleId=r[1]}function kJ(e){var t=[null,null],n;return typeof e=="string"&&(n=e.indexOf(":"),n===-1?t[1]=e:(t[0]=e.slice(0,n),t[1]=e.slice(n+1))),t}var Gl={};Gl.basename=SJ;Gl.dirname=DJ;Gl.extname=OJ;Gl.join=NJ;Gl.sep="/";function SJ(e,t){var n=0,r=-1,i,a,o,s;if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');if(Jc(e),i=e.length,t===void 0||!t.length||t.length>e.length){for(;i--;)if(e.charCodeAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";for(a=-1,s=t.length-1;i--;)if(e.charCodeAt(i)===47){if(o){n=i+1;break}}else a<0&&(o=!0,a=i+1),s>-1&&(e.charCodeAt(i)===t.charCodeAt(s--)?s<0&&(r=i):(s=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function DJ(e){var t,n,r;if(Jc(e),!e.length)return".";for(t=-1,r=e.length;--r;)if(e.charCodeAt(r)===47){if(n){t=r;break}}else n||(n=!0);return t<0?e.charCodeAt(0)===47?"/":".":t===1&&e.charCodeAt(0)===47?"//":e.slice(0,t)}function OJ(e){var t=-1,n=0,r=-1,i=0,a,o,s;for(Jc(e),s=e.length;s--;){if(o=e.charCodeAt(s),o===47){if(a){n=s+1;break}continue}r<0&&(a=!0,r=s+1),o===46?t<0?t=s:i!==1&&(i=1):t>-1&&(i=-1)}return t<0||r<0||i===0||i===1&&t===r-1&&t===n+1?"":e.slice(t,r)}function NJ(){for(var e=-1,t;++e<arguments.length;)Jc(arguments[e]),arguments[e]&&(t=t===void 0?arguments[e]:t+"/"+arguments[e]);return t===void 0?".":IJ(t)}function IJ(e){var t,n;return Jc(e),t=e.charCodeAt(0)===47,n=PJ(e,!t),!n.length&&!t&&(n="."),n.length&&e.charCodeAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function PJ(e,t){for(var n="",r=0,i=-1,a=0,o=-1,s,l;++o<=e.length;){if(o<e.length)s=e.charCodeAt(o);else{if(s===47)break;s=47}if(s===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.charCodeAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=o,a=0;continue}}else if(n.length){n="",r=0,i=o,a=0;continue}}t&&(n=n.length?n+"/..":"..",r=2)}else n.length?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function Jc(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}var mA={};mA.cwd=RJ;function RJ(){return"/"}/*!
|
|
165
|
+
`}),z=j.turndown(z)}s&&s.mentions&&(z=await GC({text:z,template:`[${Tg}{{name}}]({{id}})`,mentions:s.mentions,listMembers:h||(()=>Promise.resolve([]))})),yH(z,j=>{const ue=[{type:"initialValue",value:j},{type:"editorKey",value:O.toString()}];s!=null&&s.link&&(ue.push({type:"enrichedUrl",value:s.link}),s.link.url&&ne(s.link.url)),w(ue),setTimeout(()=>{w([{type:"stringValue",value:q2(Y)}])},150)})})()},[O]),E.useEffect(()=>{if($===void 0&&Y){const z=_H(Y);z&&ne(z)}const V=z=>{var Q;const j=z,ue=((Q=j==null?void 0:j.detail)==null?void 0:Q.url)||null;ue&&$&&$.url===ue&&w([{type:"enrichedUrl",value:void 0}])};return window.addEventListener("linkRemoved",V),()=>{window.removeEventListener("linkRemoved",V)}},[$]),E.useEffect(()=>{if(t){vc.lastIndex=0;const V=t.match(vc);V&&V.length===1&&V[0].length===t.length&&!B&&w([{type:"originalValue",value:t}])}t!==""||!Y||cf(O,t)&&!B||(N.withoutNormalizing(Y,()=>{de.delete(Y,{at:{anchor:N.start(Y,[]),focus:N.end(Y,[])}}),de.deselect(Y),Y.children.length!==0&&de.unwrapNodes(Y,{at:[0]}),de.insertNodes(Y,T,{at:[0]})}),w([{type:"initialValue",value:T},{type:"lastAnchor",value:null},{type:"enrichedUrl",value:!1}]))},[t]),E.useEffect(()=>{y({link:$})},[$]),E.useEffect(()=>{R===""&&$&&w([{type:"enrichedUrl",value:void 0}])},[R]);const U=mc(()=>{CH({editor:Y,isShowing:F.show,numberOfUsers:F.numberOfUsers,listMembers:h,dispatch:w})},100);return M?g.jsx("div",{id:J,className:"rich-text-editor input text-medium",children:g.jsxs(Da.Provider,{value:{...x,id:J,isInOverlay:f,dispatch:w,onMention:b,reportError:_},children:[g.jsxs(HL,{editor:Y,initialValue:M,onChange:V=>{if(Y.operations.some(j=>j.type!=="set_selection")){let j=wH(V);j==="<br>"&&(j=""),p(j,$),w([{type:"stringValue",value:q2(Y)}]),B||w([{type:"hasInteracted",value:!0}]),U(),d&&console.log({serialized:j,json:V})}},...u,children:[g.jsx(IL,{className:"editor",renderElement:I,renderLeaf:A,placeholder:n||c.formatMessage({id:"richTextEditor_placeholder"}),autoFocus:o,tabIndex:0,onPaste:async V=>{const z=$!==!1,j=V.clipboardData.getData("text");if((Q=>{try{return new URL(Q),!0}catch{return!1}})(j)){let Q=j;if(j){const{full:ie}=Ov(j);Q=ie}if(j&&v&&!z){const ie=await v(Q);ie.url&&w([{type:"enrichedUrl",value:ie}])}}},onKeyDown:V=>{if(V.key==="Enter"){F.show&&(V.preventDefault(),V.stopPropagation(),dw(Y,F,w,J));const{selection:z}=Y;if(z){const j=ce.isCollapsed(z),[ue,Q]=N.node(Y,z,{depth:1});let ie=ue,le=ie.type;const te=ie.children[0];if(te&&(te==null?void 0:te[ae.h3])===!0&&(V.stopPropagation(),V.preventDefault(),de.insertNodes(Y,T)),te&&[ae.ol,ae.ul].includes(te.type)&&(ie=te,le=te.type),ie&&De.isElement(ie)&&le!==ae.paragraph){if(le===ae.blockquote&&!V.shiftKey){V.stopPropagation(),V.preventDefault(),de.insertNodes(Y,T);return}if(j){const[Ae,Oe]=N.parent(Y,z,{edge:"end"}),se=Ae.type;if([ae.ul,ae.ol].includes(le))if(V.stopPropagation(),V.preventDefault(),se===ae.li&&S==="Enter"){Ae.children.length===1&&"text"in Ae.children[0]&&Ae.children[0].text===""&&de.removeNodes(Y,{at:Oe}),de.insertNodes(Y,T,{at:K.next(Q)}),de.select(Y,N.end(Y,K.next(Q)));return}else{const[ve,ke]=bH(Y,ae.li),Fe={type:ae.li,children:[{text:""}]};de.insertNodes(Y,Fe,{at:K.next(ke)}),de.select(Y,N.end(Y,K.next(ke)))}}}}}else if(V.key==="Escape"){if(F.show){V.preventDefault(),V.stopPropagation(),w([{type:"mentionPopover",value:{...F,show:!1}}]);return}}else if(["ArrowUp","ArrowDown"].includes(V.key)&&F.show){V.preventDefault(),V.stopPropagation();const{selectedUser:z,possibleUsers:j}=F;let ue=V.key==="ArrowUp"?z-1:z+1;ue<0&&(ue=j.length-1),ue>=j.length+1&&(ue=0),w([{type:"mentionPopover",value:{...F,selectedUser:ue}}])}w([{type:"lastKey",value:V.key}]),TH(V,Y,w,_)},onBlur:()=>{Y.selection&&w([{type:"lastAnchor",value:Y.selection.anchor}])},onFocus:()=>{if(D){if(!K.isPath(D.path)||!Ee.has(Y,D.path))return;const V=Ee.get(Y,D.path);let z=0;if(Pe.isText(V)?z=V.text.length:V.children&&(z=V.children.length),D.offset>z)return;try{de.select(Y,{anchor:D,focus:D})}catch(j){const ue=j.message;_(`Error focusing editor: ${ue}`)}}}}),$?g.jsx(Qv,{data:$,variant:"condensed",onClick:()=>{w([{type:"enrichedUrl",value:!1}]);const V=new CustomEvent("ariaLive",{detail:{message:c.formatMessage({id:"richTextEditor_link_enrichedUrl_aria_live"})}});document.dispatchEvent(V)},"aria-label":c.formatMessage({id:"richTextEditor_link_enrichedUrl_aria"},{title:$.title||c.formatMessage({id:"richTextEditor_link_enrichedUrl_aria_fallback"})})}):g.jsx(g.Fragment,{}),g.jsx(MH,{styling:l==null?void 0:l.toolbar}),h?g.jsx(AH,{onFallbackClick:m}):g.jsx(g.Fragment,{})]},P),g.jsx(Jv,{id:`character-limit-${e}`,limit:r,valueLength:_h(R)})]})}):g.jsx(g.Fragment,{})};const TU=({id:e="form-toggle",label:t,options:n,initialValue:r,functions:{onChange:i=()=>{}},isDisabled:a=!1,className:o=""})=>{const[s,l]=E.useState(typeof r=="boolean"||typeof r=="string"?r:n[0].value);E.useEffect(()=>{r&&l(r)},[r]);const u=c=>{a||(l(c),i(c))};return g.jsxs("div",{className:ee("toggle",o),onClick:c=>{c.preventDefault(),c.stopPropagation(),u(s===n[0].value?n[1].value:n[0].value)},children:[g.jsx("p",{children:t}),g.jsx("ul",{className:ee("toggle-options",{disabled:a,on:s===n[1].value}),children:n.map(c=>{const d=`${e}-${c.value}`;return g.jsxs("li",{className:"hidden",children:[g.jsx("input",{type:"radio",id:d,name:e,value:c.value,checked:s===c.value,onChange:()=>u(c.value),disabled:a}),g.jsx("label",{htmlFor:d,children:c.label})]},d)})})]})};function Aw({className:e="",userId:t,userName:n,src:r,uploadImage:i,button:a,callback:o}){const s=me.useIntl(),l="profileImageChange_",[u,c]=E.useState(r),[d,f]=E.useState(!1),[h,m]=E.useState(!1),p=E.useRef(null),y=async T=>{f(!0),m(!1);try{const C=T.target.files&&T.target.files[0];if(!C||!t)throw f(!1),new Error("Image file or userID is missing");const x=await i({fileObject:C,userId:t}),w={thumbnail:x.thumbnailURL,full:x.originalURL};c(w),o(w)}catch{m(!0)}finally{f(!1)}f(!1)},{upload:v=s.formatMessage({id:`${l}cta_upload`}),change:b=s.formatMessage({id:`${l}cta_change`}),uploading:_=s.formatMessage({id:`${l}cta_uploading`})}=(a==null?void 0:a.text)||{};return g.jsxs("div",{className:ee("profile-image-change-figure",e),children:[g.jsx(ka,{className:"profile-image-change-picture",name:n,src:u==null?void 0:u.thumbnail,showInitials:!1,alt:"","data-testid":"profile-picture"}),h&&g.jsx("p",{className:"error text-small",children:s.formatMessage({id:`${l}error`})}),g.jsx("input",{id:"file",type:"file",accept:"image/*",ref:p,onChange:y,hidden:!0,"data-testid":"file-input"}),g.jsx(Ke,{onClick:()=>p.current&&p.current.click(),variant:"secondary","data-gtm-event-context":"ImageField","data-gtm-event-type":`${u?"change-photo":"add-photo"}-click`,className:"gtm-trackable",disabled:d,children:d?_:u?b:v})]})}const kw=({gtm:e,functions:{onSuccess:t=async()=>{},onFailure:n=()=>{}}})=>{const{context:r="FooterContactUsForm",event:i="contact-form-submit-click"}=e||{};return g.jsx(Zi,{id:"contact-us-form",fields:[{id:"name",type:"text",className:"short",validation:[{condition:"required"}],autoComplete:"name"},{id:"email",type:"email",className:"short",validation:[{condition:"required"},{condition:"valid-email"}]},{id:"organisation",type:"text"},{id:"interests",type:"checkboxes",options:[{id:"publishingCourse",label:"Publishing or creating a course"},{id:"buyingCourse",label:"Buying courses for my team"},{id:"learningExperience",label:"Customised learning experiences"},{id:"somethingElse",label:"Something else"}]},{id:"message",type:"textarea",limit:1e3,validation:[{condition:"required"}]}],intlPath:"contactForm",gtm:{context:r,event:i},functions:{onSuccess:t,onFailure:n},button:{className:"new"}})};const CU=({emails:e,setEmails:t,setIsDisabled:n})=>{const{formatMessage:r}=me.useIntl();return g.jsx(OD.ReactMultiEmail,{id:"email-input",inputClassName:"email-input input",placeholder:r({id:"inviteForm_email_placeholder"}),emails:e,onChange:i=>{t(i),n(!i.length)},autoFocus:!1,getLabel:(i,a,o)=>g.jsxs("div",{className:"email text-medium",children:[g.jsx("div",{"data-tag-item":!0,children:i}),g.jsx(Ke,{variant:"tertiary",size:"small",icon:{icon:"close"},onClick:()=>{o(a),n(!e.length)},className:"remove-email-button",screenreaderText:r({id:"overlay_close"})})]},a)})},Sw=({title:e,label:t,messagePlaceholder:n,ctaMessage:r,titleColor:i,labelColor:a,backgroundColor:o,onClose:s,reportError:l,sendInvites:u,initialFormStatus:c="NOT_SUBMITTED",gtm:d={context:"Form",event:"form-submit-click"},secondaryActionButton:f,meta:h})=>{const[m,p]=E.useState([]),[y,v]=E.useState(!0),[b,_]=E.useState(c),{formatMessage:T}=me.useIntl(),C=async P=>{try{await u(m,P.message),p([]),_("SUCCESS")}catch(O){_("ERROR"),l(O)}},x=P=>{P.preventDefault(),_("NOT_SUBMITTED"),v(!0),p([])},w=P=>{P.preventDefault(),s(),_("CLOSED")};return b==="CLOSED"?null:b==="ERROR"||b==="SUCCESS"&&!(h!=null&&h.shouldHideDoneButtonOnSubmit)?g.jsxs("div",{className:"invite-form-wrapper",children:[g.jsx("div",{className:"content centred",children:b==="SUCCESS"?g.jsx("h2",{className:"success-title",children:T({id:"inviteForm_success"})}):g.jsxs("h2",{className:"error-title",children:[" ",T({id:"inviteForm_error"})]})}),g.jsx(fi,{}),g.jsx("div",{className:"footer",children:b==="SUCCESS"?g.jsxs(g.Fragment,{children:[g.jsx(Ke,{variant:"secondary",onClick:x,children:T({id:"inviteForm_ctaSendMoreInvites"})}),g.jsx(Ke,{onClick:w,children:T({id:"inviteForm_ctaDone"})})]}):g.jsx(Ke,{onClick:x,children:T({id:"inviteForm_ctaTryAgain"})})})]}):g.jsxs("div",{className:"invite-form-wrapper",style:{backgroundColor:o},children:[g.jsxs("div",{className:"content",children:[g.jsx("h2",{className:"title",style:{color:i},children:e}),g.jsx("label",{htmlFor:"email-input",className:"label",style:{color:a},children:t})]}),g.jsx(Zi,{id:"invite-form",fields:[{component:CU,props:{emails:m,setEmails:p,setIsDisabled:v},required:!0},{id:"message",type:"textarea",label:T({id:"inviteForm_message_label"}),placeholder:n||T({id:"inviteForm_message_placeholder"})}],functions:{onSuccess:C},button:{text:r,size:"medium",disabled:y},gtm:d,meta:h,secondaryActionButton:f})]})},Dd=e=>e.map(t=>({condition:t}));const Sr={FORM_ID:"manage-account-password-change",NEW_PASSWORD:"newPassword",CONFIRMED_PASSWORD:"confirmedPassword",CURRENT_PASSWORD:"oldPassword"},xU=({functions:e,...t})=>{const{formatMessage:n}=me.useIntl(),[r,i]=E.useState(null),[a,o]=E.useState(!1),[s,l]=E.useState({isMoreThanEightCharacters:!1,includesNumberAndSymbol:!1,includesLowerAndUppercase:!1}),u=h=>h[Sr.NEW_PASSWORD]!==h[Sr.CONFIRMED_PASSWORD]?n({id:"passwordRules_unmatched_text"}):null,c=h=>!eg(h[Sr.NEW_PASSWORD]).isValid,d=[{"data-testid":Sr.NEW_PASSWORD,id:Sr.NEW_PASSWORD,type:"password",autoComplete:"new-password",placeholder:"",label:n({id:"passwordRules_newPassword_label"}),validation:Dd(["required",c]),functions:{onChange:h=>l(eg(h).matchingRules),onFocus:()=>o(!0),onBlur:()=>o(!1)}},{"data-testid":Sr.CONFIRMED_PASSWORD,id:Sr.CONFIRMED_PASSWORD,type:"password",autoComplete:"new-password",placeholder:"",label:n({id:"passwordRules_confirmPassword_label"}),validation:Dd(["required",u])}];t.isPasswordChange&&d.unshift({"data-testid":Sr.CURRENT_PASSWORD,id:Sr.CURRENT_PASSWORD,type:"password",autoComplete:"current-password",placeholder:"",label:n({id:"passwordRules_currentPassword_label"}),validation:Dd(["required"])}),a&&d.push({component:tx,props:{matchingRules:s}});const f={id:Sr.FORM_ID,fields:d,functions:{...e,onSuccess:async h=>(e.createPassword(h),e.onSuccess&&e.onSuccess(h)),onCatch:h=>i(h==null?void 0:h.statusCode),onFailure:(h,m)=>{(m.includes(Sr.NEW_PASSWORD)||m.includes(Sr.CONFIRMED_PASSWORD))&&o(!0)}},meta:{shouldReset:!0},...t};return g.jsxs(g.Fragment,{children:[g.jsx(Zi,{...f}),r&&g.jsx(Ui,{variant:"error",text:r})]})};const Dw=({isCreateProfile:e=!1,hooks:t,functions:n,meta:r={},gtm:i,...a})=>{var P;const o=me.useIntl(),s="profileForm_",l=E.useContext(fn),[u,c]=E.useState(l.image),[d,f]=E.useState(!1),{uploadImage:h=()=>{},onSuccess:m=async O=>{},onCancel:p=()=>{},onFailure:y=()=>{}}=n,{buildLocation:v,isValidPlace:b,predictPlaces:_}=t.useMaps(),{context:T="ProfileForm",event:C="profile-form-submit-click"}=i||{},x=[{id:"jobTitle",type:"text",label:o.formatMessage({id:`${s}jobTitle`}),placeholder:o.formatMessage({id:`${s}jobTitle_placeholder`}),value:l.jobTitle,validation:[{condition:"required"}]},{id:"organization",type:"text",label:o.formatMessage({id:`${s}organization`}),placeholder:o.formatMessage({id:`${s}organization_placeholder`}),value:l.organization,validation:[{condition:"required"}]},{id:"location",type:"autocomplete",label:o.formatMessage({id:`${s}location`}),placeholder:o.formatMessage({id:`${s}location_placeholder`}),value:(P=l.location)==null?void 0:P.en,validation:[{condition:"required"},{condition:({location:O})=>O&&!d?!1:!b(O),error:o.formatMessage({id:`${s}location_error`})}],functions:{onChange:()=>{d||f(!0)},onKeyInput:_}}],w=[{component:Aw,props:{userName:l.name,userId:l.id,src:u,uploadImage:h,callback:c,button:{text:{upload:o.formatMessage({id:`${s}image`})}}}},{id:"name",type:"text",label:o.formatMessage({id:`${s}name`}),placeholder:o.formatMessage({id:`${s}name_placeholder`}),value:l.name,autoComplete:"name",validation:[{condition:"required"}]},...x,{id:"biography",type:"textarea",label:o.formatMessage({id:`${s}bio`}),placeholder:o.formatMessage({id:`${s}bio_placeholder`}),limit:1e3,value:l.biography},{component:fi}];return g.jsx(Zi,{id:"profile-details-form",fields:e?x:w,meta:{shouldShowCancelButton:!e,shouldReset:!1,shouldHide:!1,showRequiredLabels:e,...r},intlPath:s,gtm:{context:T,event:C},functions:{onSuccess:async O=>{try{const M={...O,image:u||null,location:d?await v(O==null?void 0:O.location):l.location,...e?{onboardingState:"completed"}:{}};l.updateDetails&&l.updateDetails(R=>({...R,...M})),await m(M)}catch{y()}},onCancel:p,onFailure:y},button:{size:"large",text:{default:o.formatMessage({id:`${s}cta`}),submitting:o.formatMessage({id:`${s}cta_submitting`}),submitted:o.formatMessage({id:`${s}cta_submitted`})}},...a})},wU=()=>{const e=me.useIntl(),[t,n]=E.useState(0);return E.useEffect(()=>{const r=setInterval(()=>{n(i=>{if(i>=95)return clearInterval(r),95;const a=Math.round(Math.random()*10);return Math.min(i+a,95)})},800);return()=>{clearInterval(r)}},[]),g.jsx(m3,{progress:t,steps:{0:{icon:"layers",text:e.formatMessage({id:"publishArticleForm_progressBar"})}}})};function AU({coverImage:e,setShowImagePicker:t}){return e&&e.url?g.jsx(Ui,{className:"cover-image-preview",text:g.jsx(co,{className:"cover-image",image:{description:e.description||"",height:e.height,width:e.width,url:e.url,color:e.color,type:"image/jpeg"}}),button:{component:g.jsx(Ke,{variant:"tertiary",onClick:()=>t(!0),children:g.jsx(me.FormattedMessage,{id:"publishArticleForm_replaceImage_button"})})}}):g.jsx(Ui,{button:{component:g.jsx(Ke,{variant:"secondary",onClick:()=>t(!0),children:g.jsx(me.FormattedMessage,{id:"publishArticleForm_selectImage_button"})})}})}var Ow=(e=>(e.CitiesAndLocalGovernment="topic_CitiesAndLocalGovernment",e.Climate="topic_Climate",e.DigitalAndData="topic_DigitalAndData",e.Education="topic_Education",e.EquityJusticeAndInclusion="topic_EquityJusticeAndInclusion",e.HealthAndSocialCare="topic_HealthAndSocialCare",e.Innovation="topic_Innovation",e.LeadershipAndSkills="topic_LeadershipAndSkills",e.LifeInGovernment="topic_LifeInGovernment",e.Policymaking="topic_Policymaking",e.TransportAndInfrastructure="topic_TransportAndInfrastructure",e.WorkingAndTheEconomy="topic_WorkAndTheEconomy",e))(Ow||{});let ym=null;const un="publishArticleForm_",J2={},eE=10,kU=({id:e="publish-article-form",values:t=J2,setShowImagePicker:n,functions:r,meta:i,gtm:a})=>{var O;const o=me.useIntl(),s=E.useContext(fn),{create:l,onSuccess:u=()=>{},onFailure:c=()=>{}}=r||{},{isInOverlay:d=!1}=i||{},[f,h]=E.useState(!1),[m,p]=E.useState(t.body||""),[y,v]=E.useState(!1),[b,_]=E.useState("");E.useEffect(()=>{cf(t,J2)||yc(t.body)&&t.body!==m&&t.body!==void 0&&p(t.body)},[t.body]);const T=()=>{!s||!s.id?v(o.formatMessage({id:`${un}error_loggedOut`})):y&&v(!1)},C=M=>({condition:R=>{const D=R[M];return!D||typeof D!="string"?!0:D.length<eE},error:o.formatMessage({id:`${un}error_underMinLength`},{length:eE})}),x=!!m&&yc(m),w=()=>g.jsxs(g.Fragment,{children:[g.jsx(fi,{}),g.jsx("p",{className:"text-medium",children:o.formatMessage({id:`${un}disclaimer`})})]}),P=[{id:"title",type:"textarea",value:t.title||"",limit:65,label:o.formatMessage({id:`${un}title_label`}),placeholder:o.formatMessage({id:`${un}title_placeholder`}),styling:{autosizeToFit:!0},functions:{onChange:T},validation:[{condition:"required"},C("title")]},{id:"subtitle",type:"textarea",value:t.subtitle,limit:115,label:o.formatMessage({id:`${un}subtitle_label`}),styling:{autosizeToFit:!0},placeholder:o.formatMessage({id:`${un}subtitle_placeholder`}),functions:{onChange:T},validation:[{condition:"required"},C("subtitle")]},{component:Af,props:{formID:e,label:{visible:o.formatMessage({id:`${un}body_label`})},showLabel:!0}},{component:ky,props:{id:`${e}-input`,value:m,placeholder:o.formatMessage({id:`${un}body_placeholder`}),meta:{isInOverlay:d},autoFocus:!1,functions:{onChange:M=>{p(M),T()}},styling:{toolbar:{showHeadingOption:!0}},"aria-invalid":!!y,"aria-errormessage":"error-message"}},{id:"tags",label:o.formatMessage({id:`${un}tags_label`}),type:"checkboxes",styling:{displayOptionsAsPills:!0},options:Object.values(Ow).map(M=>({id:M,label:o.formatMessage({id:`${un}_tags_${M}`})})),multipleOptions:{limit:3},validation:[{condition:"required",error:o.formatMessage({id:`${un}tags_error_required`})},{condition:M=>{var R;return((R=M==null?void 0:M.tags)==null?void 0:R.length)>3},error:o.formatMessage({id:`${un}tags_error_over_three`})}]},{component:Af,props:{formID:e,label:{visible:o.formatMessage({id:`${un}cover_image_label`})},showLabel:!0}},{component:AU,props:{coverImage:t.coverImage||{},setShowImagePicker:n}}];return f?P.push({component:fi}):P.push({component:w}),g.jsxs("section",{className:"publish-article-form",children:[g.jsx(Zi,{id:e,meta:{shouldReset:!1,shouldHide:!1,showRequiredLabels:!1,shouldScrollOnSuccess:!1},functions:{onSuccess:async M=>{if(!s||!s.id||!x)return;ym&&clearTimeout(ym),h(!0);const R={...M,body:m,coverImage:t.coverImage};try{l&&await l(R),ym=setTimeout(()=>{_(o.formatMessage({id:`${un}aria_success`})),u(R)},500)}catch{v(o.formatMessage({id:`${un}error`})),_(""),c()}},onFailure:c},fields:P,intlPath:un,button:{variant:"primary",size:{mobile:"small",600:"medium"},"data-gtm-event-context":a==null?void 0:a.context,"data-gtm-event-type":"publish-article-click",disabled:!s||!s.id||!x||!((O=t==null?void 0:t.coverImage)!=null&&O.url),text:{default:o.formatMessage({id:`${un}cta_submit`}),submitting:o.formatMessage({id:`${un}cta_submitting`}),submitted:o.formatMessage({id:`${un}cta_submitted`})},customOnSubmit:y?g.jsx(g.Fragment,{}):g.jsx(wU,{})},gtm:a}),y&&g.jsx(gl,{id:"error-message",className:"error",children:typeof y=="string"&&y.includes(" ")?y:o.formatMessage({id:`${un}error`})}),b&&g.jsx(xt,{"aria-live":"polite",showOnFocus:!1,children:b})]})};const Nw=({id:e="search",className:t="",handleToggle:n=!1,defaultValue:r="",gtmContext:i="search-bar",gtmEvent:a="form-submission"})=>{const{searchIsOpen:o=!0,isDesktopVersion:s=!1}=n||{},l=me.useIntl(),u=E.useRef(null);ml(()=>{!n||s||!o||u.current&&u.current.focus()},[o]);const c=d=>{d.preventDefault(),d.stopPropagation(),!(!u.current||!u.current.value||u.current.value.length<1)&&(window.location.href=`/search?search=${encodeURIComponent(u.current.value)}`)};return g.jsx("form",{onSubmit:c,className:ee("search-form gtm-trackable",t),role:"search","data-gtm-event-context":i,"data-gtm-event-type":a,children:g.jsx("fieldset",{id:`${e}-form`,hidden:n?!o:!1,children:g.jsxs("p",{children:[g.jsx(xt,{element:"label",htmlFor:e,children:l.formatMessage({id:"search_label"})}),g.jsx("input",{ref:u,type:"search",id:e,name:e,defaultValue:r,placeholder:l.formatMessage({id:"search_placeholder"}),onKeyDown:d=>{d.key==="Enter"&&c(d)}}),g.jsx("button",{className:"clear",onClick:d=>{d.preventDefault(),d.stopPropagation(),u.current&&u.current.value&&(u.current.value="")},children:g.jsx(xt,{children:l.formatMessage({id:"search_clear"})})}),g.jsx("button",{className:"search",onClick:c,children:g.jsx(xt,{children:l.formatMessage({id:"search_cta"})})})]})})})},tE=async({ref:e,validateEmail:t,dispatch:n})=>{const r=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;if(!e.current.validity.valid||!r.test(e.current.value))return n([{type:"validFields.email",value:!1}]);const i=e.current.value.toString().toLowerCase().trim(),a={valid:!1,autoApproved:!1,exists:{auth:!1,engagement:!1,registration:!1,user:!1}};let o=Object.assign({},a);try{o=await t(i),o===void 0&&(o=a)}catch{return n([{type:"shouldManuallyApprove",value:!0},{type:"emailDetails",value:{email:i,boxType:"nonGov",isEnd2End:!1}},{type:"validFields.email",value:!1}])}const{valid:s=!1,autoApproved:l=!1,exists:u}=o;let c="";return s?c=l?"gov":"nonGov":u.registration?u.engagement&&!u.user?c=u.auth?"verify":"pending":c="exists":u.auth&&(c="exists"),n([{type:"shouldDisableButton",value:!1},{type:"shouldManuallyApprove",value:!l},{type:"emailDetails",value:{email:i,boxType:c,isEnd2End:/testing\+[0-9]+@apolitical.co$/.test(i)}},{type:"validFields.email",value:!0}])},SU=e=>{const t={};for(const n of e.entries())t[n[0]]=n[1];return{name:t.full_name.toString().trim(),email:t.email_address.toString().toLowerCase().trim(),jobTitle:t.job_title,organization:t.organization,bioLink:t.url,optIn:!0,expectation:t.expectation,page:window.location.pathname,"g-recaptcha-response":t["g-recaptcha-response"]}},DU=async({refs:e,dataToSubmit:t,createAccount:n,onSuccess:r,dispatch:i,state:a})=>{if(!e.form||!e.form.current)throw new Error("No refs.form");if(!e.form.current.checkValidity()){e.hiddenValidation&&e.hiddenValidation.current&&e.hiddenValidation.current.click();return}const o=SU(new FormData(e.form.current)),s=Object.assign(o,t);await n(s),sessionStorage.setItem(Sv.SESSION_STORAGE.EMAIL,o.email),r&&r({...o,...a.values}),i([{type:"showSuccessMessage",value:!0}])},OU=({shouldShow:e,placeholders:t,labels:n,functions:{validateEmail:r,resendVerificationCode:i},refs:a,state:o,dispatch:s,dataToSubmit:l,intl:u})=>{const{emailDetails:c}=o,d=(h,m)=>{h.current&&o.validFields[m]!==h.current.validity.valid&&s([{type:`validFields.${m}`,value:h.current.validity.valid}])},f=[{id:"full_name",type:"text",inputRef:a.name,placeholder:u.formatMessage({id:"signup_full_name_placeholder"}),functions:{onChange:()=>d(a.name,"name"),onFocus:()=>s([{type:"loadRecaptcha",value:!0}])},autoComplete:"name",validation:[{condition:"required"},{condition:"no-numbers"}],"data-testid":"signup-name-input"},{id:"email_address",type:"email",inputRef:a.email,placeholder:u.formatMessage({id:"signup_email_address_placeholder"}),"aria-describedby":"email-helper-textbox",functions:{onBlur:()=>{tE({ref:a.email,validateEmail:r,dispatch:s})},onChange:(h,m)=>{s([{type:"shouldDisableButton",value:!0}]),m&&m({type:"updateValue",payload:{key:"terms",value:!1}})},onFocus:()=>s([{type:"loadRecaptcha",value:!0}])},autoComplete:"email",validation:[{condition:"required"},{condition:"valid-email"}],"data-testid":"signup-email-input"},{component:Y3,props:{email:c.email,type:c.boxType,resendVerificationCode:i}}];return o.shouldManuallyApprove&&(f.push({id:"job_title",type:"text",inputRef:a.jobTitle,placeholder:u.formatMessage({id:"signup_job_title_placeholder"}),functions:{onChange:()=>d(a.jobTitle,"jobTitle")},validation:[{condition:"required"}],"data-testid":"signup-job-input"},{id:"organization",type:"text",inputRef:a.organisation,placeholder:u.formatMessage({id:"signup_organization_placeholder"}),functions:{onChange:()=>{d(a.organisation,"organisation")}},validation:[{condition:"required"}],autoComplete:"organization","data-testid":"signup-org-input"}),e.url&&f.push({id:"url",type:"text",label:u.formatMessage({id:"signup_url"},{small:h=>g.jsx("small",{children:h})}),placeholder:u.formatMessage({id:"signup_url_placeholder"}),validation:[{condition:"valid-url"}],"data-testid":"signup-url-input"})),e.expectation&&f.push({id:"expectation",className:"expectation",type:"text",label:(n==null?void 0:n.expectation)||u.formatMessage({id:"signup_expectation"},{small:h=>g.jsx("small",{className:"notes text-small",children:h})}),placeholder:(t==null?void 0:t.expectation)||u.formatMessage({id:"signup_expectation_placeholder"}),"data-testid":"signup-events-question"}),f.push({id:"terms",className:"text-small",type:"checkbox",inputRef:a.tc,label:u.formatMessage({id:"signup_terms"},{terms:h=>g.jsx("a",{href:"https://about.apolitical.co/terms-and-conditions","data-gtm-event-context":"SignupForm","data-gtm-event-type":"terms-of-service-click",className:"gtm-trackable",children:h}),privacy:h=>g.jsx("a",{href:"https://about.apolitical.co/privacy-policy","data-gtm-event-context":"SignupForm","data-gtm-event-type":"privacy-policy-click",className:"gtm-trackable",children:h})}),shownValue:"accepted",functions:{onChange:h=>{if(!h)return;const m=[];["name","email"].forEach(p=>{o.validFields[p]!==a[p].current.validity.valid&&(m.push({type:`validFields.${p}`,value:a[p].current.validity.valid}),p==="email"&&tE({ref:a.email,validateEmail:r,dispatch:s}))}),m.length&&s(m)}},validation:[{condition:"required"}],"data-testid":"signup-terms-checkbox"}),f};const NU=({className:e=""})=>g.jsxs("div",{className:ee("success-message",e),"data-testid":"success-message",children:[g.jsx("p",{className:"success-title",children:g.jsx(me.FormattedMessage,{id:"signup_success_title"})}),g.jsx(me.FormattedMessage,{id:"signup_success_text",values:{p:t=>g.jsx("p",{children:t})}})]});const IU={validFields:{name:!1,email:!1,jobTitle:!1,organisation:!1},emailDetails:{email:"",boxType:"",isEnd2End:!1},shouldManuallyApprove:!1,shouldDisableButton:!0,loadRecaptcha:!1,showSuccessMessage:!1,showError:!1},PU=({className:e="",labels:t={},placeholders:n={},functions:r={validateEmail:()=>Promise.resolve(),createAccount:()=>Promise.resolve(),handleError:()=>{},resendVerificationCode:()=>Promise.resolve()},shouldShow:i={},submitButton:a,dataToSubmit:o={ref:"sign-up-form"},...s})=>{const l=me.useIntl(),u=window.location.pathname.includes("/signup")?"/login":`/login?returnTo=${window.location.pathname}`,{title:c=!0,expectation:d=!1,url:f=!0,logInButton:h=!0,successMessage:m=!0}=i,p={title:c,expectation:d,url:f,logInButton:h,successMessage:m},[y,v]=E.useReducer(Rl,IU),{validFields:b,emailDetails:_,shouldManuallyApprove:T,shouldDisableButton:C,showSuccessMessage:x,showError:w}=y,[P,O]=wv.useCookies(["signup-this-session","functional-cookie-consent"]),M={form:E.createRef(),name:E.createRef(),email:E.createRef(),jobTitle:E.createRef(),organisation:E.createRef(),tc:E.createRef(),hiddenValidation:E.createRef()};E.useEffect(()=>{T===!0&&M.jobTitle.current&&M.jobTitle.current.focus()},[T]),E.useEffect(()=>{P["signup-this-session"]&&v([{type:"showSuccessMessage",value:!0}])},[P]),E.useEffect(()=>{x&&P["functional-cookie-consent"]&&O("signup-this-session","true",{path:"/",maxAge:3600})},[x]);const R=E.useMemo(()=>OU({placeholders:n,labels:t,shouldShow:p,functions:r,refs:M,state:y,dispatch:v,dataToSubmit:o,intl:l}),[o,r,l,M,p,y]),D=C?!0:T?!Object.values(b).every(S=>S===!0):!b.name||!b.email||["exists","pending","verify"].includes(_.boxType);return p.successMessage&&x?g.jsx(NU,{className:e}):g.jsxs("fieldset",{className:ee("signup-form-fieldset",e),"data-testid":"signup-form",children:[p.title&&g.jsx("p",{className:"signup-title",children:g.jsx(me.FormattedMessage,{id:"signup_title"})}),w&&g.jsx(Ui,{variant:"error",text:l.formatMessage({id:"signup_error"})}),g.jsx(Zi,{className:"signup-form",formRef:M.form,id:"sign-up-form",fields:R,intlPath:"signup",button:{variant:"primary",size:"medium",text:a||l.formatMessage({id:"signup_button_join"}),disabled:D?{isClickable:!0}:!1,styling:{fullWidth:!0},"data-testid":"signup-button"},secondaryActionButton:{className:"login-button",styling:{fullWidth:!0},variant:"tertiary",size:"medium",href:u,"data-gtm-event-context":"SignupForm","data-gtm-event-type":"login-click",text:l.formatMessage({id:"signup_button_login"})},meta:{shouldReset:!1,showRequiredLabels:!1,shouldShowCancelButton:p.logInButton},gtm:{context:"SignupForm",event:"signup-submit-click"},functions:{onSuccess:async()=>{await DU({refs:M,dataToSubmit:o,createAccount:r.createAccount,onSuccess:r.onSuccess,dispatch:v,state:y})},onCatch:S=>{r.handleError(S),v([{type:"showSuccessMessage",value:!1},{type:"showError",value:!0}])}}}),g.jsx("button",{className:"validation-button",ref:M.hiddenValidation})]})};const mo=({children:e,className:t="",styling:n={},...r})=>{const{background:i="default",padding:a="none"}=n;return g.jsx("section",{className:ee("full-width-section",t,{[i]:i!=="default",[a]:a!=="none"}),...r,children:e})};const RU=({text:e,buttons:t,className:n=""})=>{const r=[];return t.forEach(i=>{r.push({href:i.link,variant:"secondary",size:{mobile:"medium",1024:"large"},className:"gtm-trackable new","data-gtm-event-type":"download-click","data-gtm-event-context":i.eventContext||"Download",target:"_blank",children:i.text})}),g.jsx(mo,{className:ee("download-section",n),styling:{background:"dark"},children:g.jsxs("div",{className:"content-default",children:[E.createElement(typeof e=="string"?"h2":e.element,{className:"text"},typeof e=="string"?e:e.text),g.jsx(Fl,{buttons:r})]})})};const Og="editSection_";function Iw({href:e,setShowModal:t}){typeof e!="string"&&t(!0)}const FU=({icon:e,description:t,ctaMessage:n,href:r,showEditButton:i,setShowModal:a})=>{const{formatMessage:o}=me.useIntl();return g.jsxs(Er,{variant:"muted",icon:e,children:[g.jsx("p",{children:t||o({id:`${Og}placeholder_description`})}),i&&g.jsx("p",{children:g.jsx(Ke,{href:r,variant:"secondary",size:"small",onClick:()=>Iw({href:r,setShowModal:a}),children:n||o({id:`${Og}placeholder_cta`})})})]})},MU=({children:e,className:t="",formProps:n,formComponent:r,href:i,title:a,showTitle:o=!0,modalTitle:s,placeholder:l,showDivider:u=!0})=>{const{formatMessage:c}=me.useIntl(),[d,f]=E.useState(!1),h=()=>f(!1),m=!!n||!!r,p=typeof i=="string"||m;let y;return r&&(y=E.cloneElement(r,{functions:{...r.props.functions,onSuccess:async v=>{try{r.props.functions.onSuccess&&await r.props.functions.onSuccess(v)}finally{h()}},onCancel:()=>{r.props.functions.onCancel&&r.props.functions.onCancel(),h()}}})),g.jsxs("section",{className:ee("edit-section",t),children:[m&&g.jsx(Sa,{title:s||`Edit ${a}`,isOpen:d,showDivider:!1,showIcon:!1,functions:{onClose:h},className:ee("edit-section-modal"),children:y||(n?g.jsx(Zi,{...n,fields:n.fields,meta:{...n==null?void 0:n.meta,shouldShowCancelButton:!0,shouldReset:!1,showSuccessMessage:!0},functions:{...n==null?void 0:n.functions,onSuccess:async v=>{var b,_;(b=n==null?void 0:n.functions)!=null&&b.onSuccess&&await((_=n==null?void 0:n.functions)==null?void 0:_.onSuccess(v)),f(!1)},onCancel:h}}):g.jsx(g.Fragment,{}))}),g.jsxs("div",{className:ee("edit-section-header",{"no-title":!o}),children:[o&&g.jsx("h2",{className:"edit-section-header-title",children:a}),p&&g.jsx(Ke,{href:i,variant:"tertiary",size:"small",icon:"pencil",onClick:()=>Iw({href:i,setShowModal:f}),children:c({id:`${Og}edit`})})]}),e||g.jsx(FU,{...l,href:i,setShowModal:f,showEditButton:p}),u&&g.jsx(fi,{})]})};const BU=({title:e=!1,text:t,logos:n=[],styling:r={},className:i=""})=>{const a=n.length;if(a===0)return null;const o={element:typeof e=="object"?e.element:"h2",text:typeof e=="string"?e:typeof e=="object"?e.text:"",className:typeof e=="object"?e.className:""},{wrapLogos:s=!1,align:l="center",display:u="block"}=r;return g.jsxs("div",{className:ee("logos",i,`align-${l}`,{[u]:u!=="block","wrap-logos":s}),children:[e&&E.createElement(o.element,{className:ee("title",o.className)},o.text),t&&g.jsx("p",{children:t}),g.jsx("ul",{className:ee({"two-col":a===2||a===4,"three-col":a===5||a<=10&&a%3===0}),children:n.map(({logo:c,nameOfBusiness:d,link:f=!1,description:h=!1},m)=>{if(!c||!c.url)return null;const p=g.jsx("img",{src:c.url,width:c.width||"auto",height:c.height||"auto",alt:d});return g.jsxs("li",{children:[g.jsx("p",{className:"img-wrapper",children:f?g.jsx("a",{href:f,target:"_blank",rel:"nofollow noreferrer noopener",children:p}):p}),h&&g.jsx("small",{children:h})]},window.btoa(`${c.url}_${m}`))})})]})};let bm;const Em="contactFooter_",LU=({onSuccess:e=async()=>{},onFailure:t=()=>{}})=>{const n=E.useRef(null),[r,i]=E.useState(0),[a,o]=E.useState(!1),s=()=>{n.current&&i(n.current.clientHeight)},l=()=>{a||(o(!0),clearTimeout(bm),bm=setTimeout(()=>{s(),o(!1)},500))};return E.useEffect(()=>(s(),window.addEventListener("resize",l),()=>{clearTimeout(bm),window.removeEventListener("resize",l)}),[]),g.jsx(mo,{id:"contactForm",className:"contact-footer",children:g.jsxs("div",{className:"inner-wrapper",children:[g.jsx("h2",{children:g.jsx(me.FormattedMessage,{id:`${Em}title`})}),g.jsxs("div",{className:"content-wrapper",ref:n,"data-testid":"content-wrapper",style:a?{}:{minHeight:r},children:[g.jsxs("aside",{children:[g.jsx("p",{children:g.jsx(me.FormattedMessage,{id:`${Em}text`})}),g.jsx(fo,{className:"mailto-link",href:"mailto:hello@apolitical.co",children:g.jsx(me.FormattedMessage,{id:`${Em}email`})})]}),g.jsx(kw,{functions:{onSuccess:e,onFailure:t},gtm:{context:"FooterContactUsForm",event:"contact-form-submit-click"}})]})]})})},$U=({activeLink:e,profile:t,...n})=>g.jsx(mo,{children:g.jsx(K3,{layout:"1-3",children:g.jsxs(g.Fragment,{children:[g.jsx(W3,{activeLink:e,profile:t}),g.jsx(d3,{...n})]})})});const _m="cookieBanner_",Tm=["apol-cookie-banner","apolitical-performance-cookie-consent","functional-cookie-consent"],Cm=new Date(Date.now()+12*30*24*60*60*1e3),Pw=()=>{const e=me.useIntl(),[t,n,r]=wv.useCookies(Tm),[i,a]=E.useState(!t["apol-cookie-banner"]),o=()=>{Tm.forEach(c=>{n(c,!0,{path:"/",expires:Cm,domain:c==="apolitical-performance-cookie-consent"?".apolitical.co":void 0})}),a(!1),window.location.reload()},s=()=>{n("apol-cookie-banner",!0,{path:"/",expires:Cm}),Tm.forEach(c=>{if(c==="apol-cookie-banner"){n(c,!0,{path:"/",expires:Cm});return}r(c)}),a(!1)};if(!i)return null;const l=[{id:"settings",href:"/pages/cookie-policy",gtmType:"policy-page"},{id:"reject",onClick:s,gtmType:"reject-all"},{id:"accept",onClick:o,gtmType:"accepted-all"}],u=[];return l.forEach(c=>{u.push({variant:c.href?"tertiary":"primary",href:c.href,onClick:c.onClick,className:"gtm-trackable","data-gtm-event-context":"cookie-banner","data-gtm-event-type":`cookie-${c.gtmType}-click`,children:e.formatMessage({id:`${_m}buttons_${c.id}`})})}),g.jsxs("aside",{id:"cookie-banner",className:"text-medium",children:[g.jsx("h6",{children:e.formatMessage({id:`${_m}title`})}),g.jsx("p",{children:e.formatMessage({id:`${_m}text`})}),g.jsx(Fl,{buttons:u})]})},ga={platform:{order:["events","courses","articles","communities"],events:{href:"/events/",gtmType:"events-click"},courses:{href:"/microcourses/",gtmType:"microcourses-click"},articles:{href:"/solution-articles/",gtmType:"articles-click"},communities:{href:"/communities/",gtmType:"communities-click"}},community:{order:["support","post","join","guidelines"],support:{name:"Support FAQ",href:"/pages/support-faq",gtmType:"support-faq-click"},post:{href:"/pages/post-an-article",gtmType:"post-an-article-click"},join:{href:"/pages/who-can-join-the-community",gtmType:"who-can-join-click"},guidelines:{href:"/pages/values-and-guidelines",gtmType:"guidelines-and-values-click"}},company:{order:["news","insights","story","team","careers","partner","contact"],news:{href:"/learning-hub/updates/",gtmType:"news-click"},insights:{href:"/learning-hub/global-insights/",gtmType:"insights-click"},story:{href:"/pages/our-story",gtmType:"our-story-click"},team:{href:"/pages/meet-our-team",gtmType:"team-click"},careers:{href:"/pages/careers",gtmType:"careers-click"},partner:{href:"/partnerships/",gtmType:"partner-with-us-click"},contact:{href:"/pages/get-in-touch",gtmType:"contact-click"},child:"legal"},legal:{order:["privacy","terms","cookie","accessibility","ai"],privacy:{href:"https://about.apolitical.co/privacy-policy",gtmType:"privacy-policy-link"},terms:{href:"https://about.apolitical.co/terms-and-conditions",gtmType:"terms-conditions-link"},cookie:{href:"/pages/cookie-policy",gtmType:"cookie-policy-link"},ai:{href:"/pages/ai-principles",gtmType:"ai-principles-link"},accessibility:{href:"/pages/accessibility-statement",gtmType:"accessibility-link"},text:{order:["dataProtection","euDataProtection"],dataProtection:{email:zs["data-protection"].default,gtmType:"email-dpo-link"},euDataProtection:{email:zs["data-protection"].eu,gtmType:"email-eu-dpo-link"}}},contact:{text:{order:["london","washington","berlin","registered","support","business"],london:{address:!0},washington:{address:!0},registered:{address:!0},berlin:{address:!0},support:{email:zs.support,gtmType:"concierge-email-click"},business:{email:zs.general,gtmType:"hello-email-click"}}},social:{order:["linkedin","twitter","facebook"],linkedin:{href:"https://www.linkedin.com/company/apolitical"},twitter:{href:"https://twitter.com/apoliticalco"},facebook:{href:"https://www.facebook.com/apoliticalco"}}};const Ys="footer_",Sf="SiteFooter",nE=({group:e})=>{const t=ga[e].order||[];let n=!1;return"text"in ga[e]&&(n=ga[e].text),g.jsxs(E.Fragment,{children:[g.jsx("p",{className:"pre-title",children:g.jsx(me.FormattedMessage,{id:`${Ys}${e}`})}),Array.isArray(t)&&t.length>0&&g.jsx("ul",{className:"text-medium",children:t.map(r=>{if(["order","child","text"].includes(r))return null;const{href:i,gtmType:a}=ga[e][r],o={};return["legal"].includes(e)&&(o.target="_blank",o.rel="noopener"),g.jsx("li",{children:g.jsx("a",{href:i,className:"gtm-trackable","data-gtm-event-context":Sf,"data-gtm-event-type":a,...o,children:g.jsx(me.FormattedMessage,{id:`${Ys}${e}_${r}`})})},`${e}_${r}`)})}),typeof n!="boolean"&&"order"in n&&Array.isArray(n.order)&&g.jsx("dl",{className:"text-medium",children:n.order.map(r=>g.jsxs(E.Fragment,{children:[g.jsx("dt",{children:g.jsx(me.FormattedMessage,{id:`${Ys}${e}_${r}`})}),g.jsxs("dd",{children:[typeof n!="boolean"&&n[r].address&&g.jsx("address",{children:g.jsx(me.FormattedMessage,{id:`${Ys}${e}_${r}_address`,values:{br:g.jsx("br",{})}})}),typeof n!="boolean"&&n[r].email&&g.jsx("a",{href:`mailto:${n[r].email}`,className:"gtm-trackable","data-gtm-event-context":Sf,"data-gtm-event-type":n[r].gtmType,children:n[r].email})]})]},`dl-${e}-${r}`))})]},e)},Sy=()=>g.jsx("div",{id:"footer",children:g.jsxs("div",{className:"wrapper",children:[g.jsx(mh,{element:"hr"}),g.jsx(Xv,{variant:"inverted",version:"full",className:"gtm-trackable","data-gtm-event-context":Sf,"data-gtm-event-type":"logo-homepage-link"}),g.jsx("footer",{children:["platform","community","company","contact"].map(e=>g.jsxs("div",{className:"group",children:[g.jsx(nE,{group:e}),Object.keys(ga[e]).includes("child")&&g.jsx(nE,{group:ga[e].child})]},e))}),g.jsx("hr",{}),g.jsxs("div",{className:"sub-footer",children:[g.jsx("ul",{children:Array.isArray(ga.social.order)&&ga.social.order.map(e=>{const t=ga.social[e];return g.jsx("li",{className:e,children:g.jsx("a",{href:t.href,target:"_blank",rel:"noopener noreferrer",className:"gtm-trackable","data-gtm-event-context":Sf,"data-gtm-event-type":"social-click",children:g.jsx("span",{className:"hidden",children:g.jsx(me.FormattedMessage,{id:`${Ys}social_${e}`})})})},e)})}),g.jsx("small",{children:g.jsx(me.FormattedMessage,{id:`${Ys}copyright`,values:{currentYear:new Date().getFullYear()}})})]})]})});var jU=Object.defineProperty,HU=Object.defineProperties,UU=Object.getOwnPropertyDescriptors,Df=Object.getOwnPropertySymbols,Rw=Object.prototype.hasOwnProperty,Fw=Object.prototype.propertyIsEnumerable,Mw=e=>{throw TypeError(e)},rE=(e,t,n)=>t in e?jU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ye=(e,t)=>{for(var n in t||(t={}))Rw.call(t,n)&&rE(e,n,t[n]);if(Df)for(var n of Df(t))Fw.call(t,n)&&rE(e,n,t[n]);return e},an=(e,t)=>HU(e,UU(t)),Dy=(e,t)=>{var n={};for(var r in e)Rw.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Df)for(var r of Df(e))t.indexOf(r)<0&&Fw.call(e,r)&&(n[r]=e[r]);return n},Oy=(e,t,n)=>t.has(e)||Mw("Cannot "+n),oe=(e,t,n)=>(Oy(e,t,"read from private field"),n?n.call(e):t.get(e)),Ge=(e,t,n)=>t.has(e)?Mw("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Qe=(e,t,n,r)=>(Oy(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Of=(e,t,n)=>(Oy(e,t,"access private method"),n),Ve=(e,t,n)=>new Promise((r,i)=>{var a=l=>{try{s(n.next(l))}catch(u){i(u)}},o=l=>{try{s(n.throw(l))}catch(u){i(u)}},s=l=>l.done?r(l.value):Promise.resolve(l.value).then(a,o);s((n=n.apply(e,t)).next())});function Bw(e){return{all:e=e||new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map(function(i){i(n)}),(r=e.get("*"))&&r.slice().map(function(i){i(t,n)})}}}const Vi=Object.create(null);Vi.open="0";Vi.close="1";Vi.ping="2";Vi.pong="3";Vi.message="4";Vi.upgrade="5";Vi.noop="6";const Od=Object.create(null);Object.keys(Vi).forEach(e=>{Od[Vi[e]]=e});const Ng={type:"error",data:"parser error"},Lw=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",$w=typeof ArrayBuffer=="function",jw=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Dh=({type:e,data:t},n,r)=>Lw&&t instanceof Blob?n?r(t):iE(t,r):$w&&(t instanceof ArrayBuffer||jw(t))?n?r(t):iE(new Blob([t]),r):r(Vi[e]+(t||"")),iE=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function aE(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let xm;function zU(e,t){if(Lw&&e.data instanceof Blob)return e.data.arrayBuffer().then(aE).then(t);if($w&&(e.data instanceof ArrayBuffer||jw(e.data)))return t(aE(e.data));Dh(e,!1,n=>{xm||(xm=new TextEncoder),t(xm.encode(n))})}const oE="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Pu=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<oE.length;e++)Pu[oE.charCodeAt(e)]=e;const VU=e=>{let t=e.length*.75,n=e.length,r,i=0,a,o,s,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),c=new Uint8Array(u);for(r=0;r<n;r+=4)a=Pu[e.charCodeAt(r)],o=Pu[e.charCodeAt(r+1)],s=Pu[e.charCodeAt(r+2)],l=Pu[e.charCodeAt(r+3)],c[i++]=a<<2|o>>4,c[i++]=(o&15)<<4|s>>2,c[i++]=(s&3)<<6|l&63;return u},qU=typeof ArrayBuffer=="function",Oh=(e,t)=>{if(typeof e!="string")return{type:"message",data:Hw(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:WU(e.substring(1),t)}:Od[n]?e.length>1?{type:Od[n],data:e.substring(1)}:{type:Od[n]}:Ng},WU=(e,t)=>{if(qU){const n=VU(e);return Hw(n,t)}else return{base64:!0,data:e}},Hw=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},Uw=String.fromCharCode(30),zw=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((a,o)=>{Dh(a,!1,s=>{r[o]=s,++i===n&&t(r.join(Uw))})})},Vw=(e,t)=>{const n=e.split(Uw),r=[];for(let i=0;i<n.length;i++){const a=Oh(n[i],t);if(r.push(a),a.type==="error")break}return r};function qw(){return new TransformStream({transform(e,t){zU(e,n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const a=new DataView(i.buffer);a.setUint8(0,126),a.setUint16(1,r)}else{i=new Uint8Array(9);const a=new DataView(i.buffer);a.setUint8(0,127),a.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}let wm;function O1(e){return e.reduce((t,n)=>t+n.length,0)}function N1(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function Ww(e,t){wm||(wm=new TextDecoder);const n=[];let r=0,i=-1,a=!1;return new TransformStream({transform(o,s){for(n.push(o);;){if(r===0){if(O1(n)<1)break;const l=N1(n,1);a=(l[0]&128)===128,i=l[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(O1(n)<2)break;const l=N1(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(O1(n)<8)break;const l=N1(n,8),u=new DataView(l.buffer,l.byteOffset,l.length),c=u.getUint32(0);if(c>Math.pow(2,53-32)-1){s.enqueue(Ng);break}i=c*Math.pow(2,32)+u.getUint32(4),r=3}else{if(O1(n)<i)break;const l=N1(n,i);s.enqueue(Oh(a?l:wm.decode(l),t)),r=0}if(i===0||i>e){s.enqueue(Ng);break}}}})}const Nh=4;function Jt(e){if(e)return KU(e)}function KU(e){for(var t in Jt.prototype)e[t]=Jt.prototype[t];return e}Jt.prototype.on=Jt.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Jt.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};Jt.prototype.off=Jt.prototype.removeListener=Jt.prototype.removeAllListeners=Jt.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this};Jt.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this};Jt.prototype.emitReserved=Jt.prototype.emit;Jt.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Jt.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Br=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function Kw(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const GU=Br.setTimeout,YU=Br.clearTimeout;function Ih(e,t){t.useNativeTimers?(e.setTimeoutFn=GU.bind(Br),e.clearTimeoutFn=YU.bind(Br)):(e.setTimeoutFn=Br.setTimeout.bind(Br),e.clearTimeoutFn=Br.clearTimeout.bind(Br))}const ZU=1.33;function QU(e){return typeof e=="string"?XU(e):Math.ceil((e.byteLength||e.size)*ZU)}function XU(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function JU(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function ez(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let a=n[r].split("=");t[decodeURIComponent(a[0])]=decodeURIComponent(a[1])}return t}let tz=class extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}},Ny=class extends Jt{constructor(t){super(),this.writable=!1,Ih(this,t),this.opts=t,this.query=t.query,this.socket=t.socket}onError(t,n,r){return super.emitReserved("error",new tz(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=Oh(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=JU(t);return n.length?"?"+n:""}};const Gw="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Ig=64,nz={};let sE=0,I1=0,lE;function uE(e){let t="";do t=Gw[e%Ig]+t,e=Math.floor(e/Ig);while(e>0);return t}function Yw(){const e=uE(+new Date);return e!==lE?(sE=0,lE=e):e+"."+uE(sE++)}for(;I1<Ig;I1++)nz[Gw[I1]]=I1;let Zw=!1;try{Zw=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const rz=Zw;function Qw(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||rz))return new XMLHttpRequest}catch{}if(!t)try{return new Br[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function iz(){}const az=function(){return new Qw({xdomain:!1}).responseType!=null}();let oz=class extends Ny{constructor(t){if(super(t),this.polling=!1,typeof location<"u"){const r=location.protocol==="https:";let i=location.port;i||(i=r?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||i!==t.port}const n=t&&t.forceBase64;this.supportsBinary=az&&!n,this.opts.withCredentials&&(this.cookieJar=void 0)}get name(){return"polling"}doOpen(){this.poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this.polling||!this.writable){let r=0;this.polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};Vw(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,zw(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=Yw()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}request(t={}){return Object.assign(t,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new nl(this.uri(),t)}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,a)=>{this.onError("xhr post error",i,a)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}},nl=class Nd extends Jt{constructor(t,n){super(),Ih(this,n),this.opts=n,this.method=n.method||"GET",this.uri=t,this.data=n.data!==void 0?n.data:null,this.create()}create(){var t;const n=Kw(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this.opts.xd;const r=this.xhr=new Qw(n);try{r.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this.opts.extraHeaders[i])}}catch{}if(this.method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this.opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(r.timeout=this.opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this.opts.cookieJar)===null||i===void 0||i.parseCookies(r)),r.readyState===4&&(r.status===200||r.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof r.status=="number"?r.status:0)},0))},r.send(this.data)}catch(i){this.setTimeoutFn(()=>{this.onError(i)},0);return}typeof document<"u"&&(this.index=Nd.requestsCount++,Nd.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=iz,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete Nd.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}};nl.requestsCount=0;nl.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",cE);else if(typeof addEventListener=="function"){const e="onpagehide"in Br?"pagehide":"unload";addEventListener(e,cE,!1)}}function cE(){for(let e in nl.requests)nl.requests.hasOwnProperty(e)&&nl.requests[e].abort()}const Iy=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0))(),P1=Br.WebSocket||Br.MozWebSocket,dE=!0,sz="arraybuffer",fE=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";let lz=class extends Ny{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),n=this.opts.protocols,r=fE?{}:Kw(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=dE&&!fE?n?new P1(t,n):new P1(t):new P1(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;Dh(r,this.supportsBinary,a=>{const o={};try{dE&&this.ws.send(a)}catch{}i&&Iy(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=Yw()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}check(){return!!P1}},uz=class extends Ny{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(t=>{const n=Ww(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=qw();i.readable.pipeTo(t.writable),this.writer=i.writable.getWriter();const a=()=>{r.read().then(({done:s,value:l})=>{s||(this.onPacket(l),a())}).catch(s=>{})};a();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this.writer.write(o).then(()=>this.onOpen())})}))}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;this.writer.write(r).then(()=>{i&&Iy(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this.transport)===null||t===void 0||t.close()}};const cz={websocket:lz,webtransport:uz,polling:oz},dz=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,fz=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Pg(e){if(e.length>2e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=dz.exec(e||""),a={},o=14;for(;o--;)a[fz[o]]=i[o]||"";return n!=-1&&r!=-1&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=hz(a,a.path),a.queryKey=pz(a,a.query),a}function hz(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function pz(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,a){i&&(n[i]=a)}),n}let Xw=class Fs extends Jt{constructor(t,n={}){super(),this.binaryType=sz,this.writeBuffer=[],t&&typeof t=="object"&&(n=t,t=null),t?(t=Pg(t),n.hostname=t.host,n.secure=t.protocol==="https"||t.protocol==="wss",n.port=t.port,t.query&&(n.query=t.query)):n.host&&(n.hostname=Pg(n.host).host),Ih(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=ez(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=Nh,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new cz[t](r)}open(){let t;if(this.opts.rememberUpgrade&&Fs.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else t=this.transports[0];this.readyState="opening";try{t=this.createTransport(t)}catch{this.transports.shift(),this.open();return}t.open(),this.setTransport(t)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(t){let n=this.createTransport(t),r=!1;Fs.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",d=>{if(!r)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Fs.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(c(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const f=new Error("probe error");f.transport=n.name,this.emitReserved("upgradeError",f)}}))};function a(){r||(r=!0,c(),n.close(),n=null)}const o=d=>{const f=new Error("probe error: "+d);f.transport=n.name,a(),this.emitReserved("upgradeError",f)};function s(){o("transport closed")}function l(){o("socket closed")}function u(d){n&&d.name!==n.name&&a()}const c=()=>{n.removeListener("open",i),n.removeListener("error",o),n.removeListener("close",s),this.off("close",l),this.off("upgrading",u)};n.once("open",i),n.once("error",o),n.once("close",s),this.once("close",l),this.once("upgrading",u),this.upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onOpen(){if(this.readyState="open",Fs.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let t=0;const n=this.upgrades.length;for(;t<n;t++)this.probe(this.upgrades[t])}}onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),this.resetPingTimeout(),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const n=new Error("server error");n.code=t.data,this.onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this.getWritablePackets();this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=QU(i)),r>0&&n>this.maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}write(t,n,r){return this.sendPacket("message",t,n,r),this}send(t,n,r){return this.sendPacket("message",t,n,r),this}sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const a={type:t,data:n,options:r};this.emitReserved("packetCreate",a),this.writeBuffer.push(a),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this.onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}onError(t){Fs.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const n=[];let r=0;const i=t.length;for(;r<i;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}};Xw.protocol=Nh;function mz(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=Pg(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const a=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+a+":"+r.port+t,r.href=r.protocol+"://"+a+(n&&n.port===r.port?"":":"+r.port),r}const gz=typeof ArrayBuffer=="function",vz=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Jw=Object.prototype.toString,yz=typeof Blob=="function"||typeof Blob<"u"&&Jw.call(Blob)==="[object BlobConstructor]",bz=typeof File=="function"||typeof File<"u"&&Jw.call(File)==="[object FileConstructor]";function Py(e){return gz&&(e instanceof ArrayBuffer||vz(e))||yz&&e instanceof Blob||bz&&e instanceof File}function Id(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Id(e[n]))return!0;return!1}if(Py(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Id(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Id(e[n]))return!0;return!1}function Ez(e){const t=[],n=e.data,r=e;return r.data=Rg(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Rg(e,t){if(!e)return e;if(Py(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Rg(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Rg(e[r],t));return n}return e}function _z(e,t){return e.data=Fg(e.data,t),delete e.attachments,e}function Fg(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Fg(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Fg(e[n],t));return e}const Tz=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],Cz=5;var et;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(et||(et={}));class xz{constructor(t){this.replacer=t}encode(t){return(t.type===et.EVENT||t.type===et.ACK)&&Id(t)?this.encodeAsBinary({type:t.type===et.EVENT?et.BINARY_EVENT:et.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===et.BINARY_EVENT||t.type===et.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=Ez(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function hE(e){return Object.prototype.toString.call(e)==="[object Object]"}class Ry extends Jt{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===et.BINARY_EVENT;r||n.type===et.BINARY_ACK?(n.type=r?et.EVENT:et.ACK,this.reconstructor=new wz(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Py(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(et[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===et.BINARY_EVENT||r.type===et.BINARY_ACK){const a=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const o=t.substring(a,n);if(o!=Number(o)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(o)}if(t.charAt(n+1)==="/"){const a=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(a,n)}else r.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const a=n+1;for(;++n;){const o=t.charAt(n);if(o==null||Number(o)!=o){--n;break}if(n===t.length)break}r.id=Number(t.substring(a,n+1))}if(t.charAt(++n)){const a=this.tryParse(t.substr(n));if(Ry.isPayloadValid(r.type,a))r.data=a;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case et.CONNECT:return hE(n);case et.DISCONNECT:return n===void 0;case et.CONNECT_ERROR:return typeof n=="string"||hE(n);case et.EVENT:case et.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&Tz.indexOf(n[0])===-1);case et.ACK:case et.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class wz{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=_z(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const e7=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Ry,Encoder:xz,get PacketType(){return et},protocol:Cz},Symbol.toStringTag,{value:"Module"}));function si(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const Az=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});let t7=class extends Jt{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[si(t,"open",this.onopen.bind(this)),si(t,"packet",this.onpacket.bind(this)),si(t,"error",this.onerror.bind(this)),si(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){if(Az.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const r={type:et.EVENT,data:n};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const o=this.ids++,s=n.pop();this._registerAckCallback(o,s),r.id=o}const i=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!i||!this.connected)||(this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const a=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let o=0;o<this.sendBuffer.length;o++)this.sendBuffer[o].id===t&&this.sendBuffer.splice(o,1);n.call(this,new Error("operation has timed out"))},i);this.acks[t]=(...o)=>{this.io.clearTimeoutFn(a),n.apply(this,[null,...o])}}emitWithAck(t,...n){const r=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((i,a)=>{n.push((o,s)=>r?o?a(o):i(s):i(o)),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...a)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...a)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:et.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n)}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case et.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case et.EVENT:case et.BINARY_EVENT:this.onevent(t);break;case et.ACK:case et.BINARY_ACK:this.onack(t);break;case et.DISCONNECT:this.ondisconnect();break;case et.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:et.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(n.apply(this,t.data),delete this.acks[t.id])}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:et.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}};function jl(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}jl.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};jl.prototype.reset=function(){this.attempts=0};jl.prototype.setMin=function(e){this.ms=e};jl.prototype.setMax=function(e){this.max=e};jl.prototype.setJitter=function(e){this.jitter=e};let Mg=class extends Jt{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Ih(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new jl({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||e7;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new Xw(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=si(n,"open",function(){r.onopen(),t&&t()}),a=s=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",s),t?t(s):this.maybeReconnectOnOpen()},o=si(n,"error",a);if(this._timeout!==!1){const s=this._timeout,l=this.setTimeoutFn(()=>{i(),a(new Error("timeout")),n.close()},s);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(si(t,"ping",this.onping.bind(this)),si(t,"data",this.ondata.bind(this)),si(t,"error",this.onerror.bind(this)),si(t,"close",this.onclose.bind(this)),si(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Iy(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new t7(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,n){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}};const cu={};function Pd(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=mz(e,t.path||"/socket.io"),r=n.source,i=n.id,a=n.path,o=cu[i]&&a in cu[i].nsps,s=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let l;return s?l=new Mg(r,t):(cu[i]||(cu[i]=new Mg(r,t)),l=cu[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(Pd,{Manager:Mg,Socket:t7,io:Pd,connect:Pd});var Co=globalThis&&globalThis.__awaiter||function(e,t,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function s(c){try{u(r.next(c))}catch(d){o(d)}}function l(c){try{u(r.throw(c))}catch(d){o(d)}}function u(c){c.done?a(c.value):i(c.value).then(s,l)}u((r=r.apply(e,t||[])).next())})};const kz="v1",Sz="https://api.novu.co",Dz="@novu/client",Oz="2.0.0-canary.0",Nz=`${Dz}-${Oz}`;class Iz{constructor({apiVersion:t=kz,backendUrl:n=Sz,userAgent:r=Nz}={}){this.apiVersion=t,this.backendUrl=`${n}/${this.apiVersion}`,this.headers={"Content-Type":"application/json","User-Agent":r}}setAuthorizationToken(t){this.headers.Authorization=`Bearer ${t}`}disposeAuthorizationToken(){delete this.headers.Authorization}updateHeaders(t){this.headers=Object.assign(Object.assign({},this.headers),t)}getFullResponse(t,n){return Co(this,void 0,void 0,function*(){return yield(yield this.doFetch(t+this.getQueryString(n))).json()})}get(t,n){return Co(this,void 0,void 0,function*(){return(yield(yield this.doFetch(t+this.getQueryString(n))).json()).data})}post(t,n={}){return Co(this,void 0,void 0,function*(){return(yield(yield this.doFetch(t,{method:"POST",body:JSON.stringify(n)})).json()).data})}patch(t,n={}){return Co(this,void 0,void 0,function*(){return(yield(yield this.doFetch(t,{method:"PATCH",body:JSON.stringify(n)})).json()).data})}delete(t,n={}){return Co(this,void 0,void 0,function*(){return(yield(yield this.doFetch(t,{method:"DELETE",body:JSON.stringify(n)})).json()).data})}getQueryString(t){return t?"?"+new URLSearchParams(t).toString():""}doFetch(t,n={}){return Co(this,void 0,void 0,function*(){try{const r=yield fetch(this.backendUrl+t,Object.assign(Object.assign({},n),{headers:this.headers}));return yield this.checkResponseStatus(r),r}catch(r){throw r}})}checkResponseStatus(t){return Co(this,void 0,void 0,function*(){if(!t.ok){const n=yield t.json();throw new Error(`HTTP error! Status: ${t.status}, Message: ${n.message}`)}})}}globalThis&&globalThis.__awaiter;globalThis&&globalThis.__rest;var Pz=(e,t)=>e===t?!0:!e||!t||e.length!==t.length?!1:e.every((n,r)=>n===t[r]),n7=(e,t)=>Pz(e,t)||!e&&(t==null?void 0:t.length)===0||(e==null?void 0:e.length)===0&&!t,Nf=(e,t)=>n7(e.tags,t.tags)&&e.read===t.read&&e.archived===t.archived,Ms,Rz=class{constructor(){Ge(this,Ms),Qe(this,Ms,Bw())}on(e,t){return oe(this,Ms).on(e,t),()=>{this.off(e,t)}}off(e,t){oe(this,Ms).off(e,t)}emit(e,t){oe(this,Ms).emit(e,t)}};Ms=new WeakMap;var or=class extends Error{constructor(e,t){super(e),this.originalError=t}},Fo,Ru,Fy=class{constructor({inboxServiceInstance:e,eventEmitterInstance:t}){Ge(this,Fo,[]),Ge(this,Ru),this._emitter=t,this._inboxService=e,this._emitter.on("session.initialize.resolved",({error:n,data:r})=>{r?(this.onSessionSuccess(r),oe(this,Fo).forEach(i=>Ve(this,[i],function*({fn:a,resolve:o}){o(yield a())})),Qe(this,Fo,[])):n&&(this.onSessionError(n),Qe(this,Ru,n),oe(this,Fo).forEach(({resolve:i})=>{i({error:new or("Failed to initialize session, please contact the support",n)})}),Qe(this,Fo,[]))})}onSessionSuccess(e){}onSessionError(e){}callWithSession(e){return Ve(this,null,function*(){return this._inboxService.isSessionInitialized?e():oe(this,Ru)?Promise.resolve({error:new or("Failed to initialize session, please contact the support",oe(this,Ru))}):new Promise((t,n)=>{oe(this,Fo).push({fn:e,resolve:t,reject:n})})})}};Fo=new WeakMap;Ru=new WeakMap;var mr,ni,Gr=class{constructor(t,n,r){Ge(this,mr),Ge(this,ni),Qe(this,mr,n),Qe(this,ni,r),this.id=t.id,this.subject=t.subject,this.body=t.body,this.to=t.to,this.isRead=t.isRead,this.isArchived=t.isArchived,this.createdAt=t.createdAt,this.readAt=t.readAt,this.archivedAt=t.archivedAt,this.avatar=t.avatar,this.primaryAction=t.primaryAction,this.secondaryAction=t.secondaryAction,this.channelType=t.channelType,this.tags=t.tags,this.redirect=t.redirect,this.data=t.data}read(){return r7({emitter:oe(this,mr),apiService:oe(this,ni),args:{notification:this}})}unread(){return i7({emitter:oe(this,mr),apiService:oe(this,ni),args:{notification:this}})}archive(){return a7({emitter:oe(this,mr),apiService:oe(this,ni),args:{notification:this}})}unarchive(){return o7({emitter:oe(this,mr),apiService:oe(this,ni),args:{notification:this}})}completePrimary(){if(!this.primaryAction)throw new Error("Primary action is not available");return If({emitter:oe(this,mr),apiService:oe(this,ni),args:{notification:this},actionType:"primary"})}completeSecondary(){if(!this.primaryAction)throw new Error("Secondary action is not available");return If({emitter:oe(this,mr),apiService:oe(this,ni),args:{notification:this},actionType:"secondary"})}revertPrimary(){if(!this.primaryAction)throw new Error("Primary action is not available");return Pf({emitter:oe(this,mr),apiService:oe(this,ni),args:{notification:this},actionType:"primary"})}revertSecondary(){if(!this.primaryAction)throw new Error("Secondary action is not available");return Pf({emitter:oe(this,mr),apiService:oe(this,ni),args:{notification:this},actionType:"secondary"})}on(t,n){const r=oe(this,mr).on(t,n);return()=>{r()}}off(t,n){oe(this,mr).off(t,n)}};mr=new WeakMap;ni=new WeakMap;var r7=e=>Ve(void 0,[e],function*({emitter:t,apiService:n,args:r}){const{notificationId:i,optimisticValue:a}=Hl(r,{isRead:!0,readAt:new Date().toISOString(),isArchived:!1,archivedAt:void 0},{emitter:t,apiService:n});try{t.emit("notification.read.pending",{args:r,data:a});const o=yield n.read(i),s=new Gr(o,t,n);return t.emit("notification.read.resolved",{args:r,data:s}),{data:s}}catch(o){return t.emit("notification.read.resolved",{args:r,error:o}),{error:new or("Failed to read notification",o)}}}),i7=e=>Ve(void 0,[e],function*({emitter:t,apiService:n,args:r}){const{notificationId:i,optimisticValue:a}=Hl(r,{isRead:!1,readAt:null,isArchived:!1,archivedAt:void 0},{emitter:t,apiService:n});try{t.emit("notification.unread.pending",{args:r,data:a});const o=yield n.unread(i),s=new Gr(o,t,n);return t.emit("notification.unread.resolved",{args:r,data:s}),{data:s}}catch(o){return t.emit("notification.unread.resolved",{args:r,error:o}),{error:new or("Failed to unread notification",o)}}}),a7=e=>Ve(void 0,[e],function*({emitter:t,apiService:n,args:r}){const{notificationId:i,optimisticValue:a}=Hl(r,{isArchived:!0,archivedAt:new Date().toISOString(),isRead:!0,readAt:new Date().toISOString()},{emitter:t,apiService:n});try{t.emit("notification.archive.pending",{args:r,data:a});const o=yield n.archive(i),s=new Gr(o,t,n);return t.emit("notification.archive.resolved",{args:r,data:s}),{data:s}}catch(o){return t.emit("notification.archive.resolved",{args:r,error:o}),{error:new or("Failed to archive notification",o)}}}),o7=e=>Ve(void 0,[e],function*({emitter:t,apiService:n,args:r}){const{notificationId:i,optimisticValue:a}=Hl(r,{isArchived:!1,archivedAt:null,isRead:!0,readAt:new Date().toISOString()},{emitter:t,apiService:n});try{t.emit("notification.unarchive.pending",{args:r,data:a});const o=yield n.unarchive(i),s=new Gr(o,t,n);return t.emit("notification.unarchive.resolved",{args:r,data:s}),{data:s}}catch(o){return t.emit("notification.unarchive.resolved",{args:r,error:o}),{error:new or("Failed to unarchive notification",o)}}}),If=e=>Ve(void 0,[e],function*({emitter:t,apiService:n,args:r,actionType:i}){const a=i==="primary"?{primaryAction:an(Ye({},"notification"in r?r.notification.primaryAction:{}),{isCompleted:!0})}:{secondaryAction:an(Ye({},"notification"in r?r.notification.secondaryAction:{}),{isCompleted:!0})},{notificationId:o,optimisticValue:s}=Hl(r,a,{emitter:t,apiService:n});try{t.emit("notification.complete_action.pending",{args:r,data:s});const l=yield n.completeAction({actionType:i,notificationId:o}),u=new Gr(l,t,n);return t.emit("notification.complete_action.resolved",{args:r,data:u}),{data:u}}catch(l){return t.emit("notification.complete_action.resolved",{args:r,error:l}),{error:new or(`Failed to complete ${i} action on the notification`,l)}}}),Pf=e=>Ve(void 0,[e],function*({emitter:t,apiService:n,args:r,actionType:i}){const a=i==="primary"?{primaryAction:an(Ye({},"notification"in r?r.notification.primaryAction:{}),{isCompleted:!1})}:{secondaryAction:an(Ye({},"notification"in r?r.notification.secondaryAction:{}),{isCompleted:!1})},{notificationId:o,optimisticValue:s}=Hl(r,a,{emitter:t,apiService:n});try{t.emit("notification.revert_action.pending",{args:r,data:s});const l=yield n.revertAction({actionType:i,notificationId:o}),u=new Gr(l,t,n);return t.emit("notification.revert_action.resolved",{args:r,data:u}),{data:u}}catch(l){return t.emit("notification.revert_action.resolved",{args:r,error:l}),{error:new or("Failed to fetch notifications",l)}}}),Hl=(e,t,n)=>"notification"in e?{notificationId:e.notification.id,optimisticValue:new Gr(Ye(Ye({},e.notification),t),n.emitter,n.apiService)}:{notificationId:e.notificationId},Fz=e=>Ve(void 0,[e],function*({emitter:t,inboxService:n,notificationsCache:r,tags:i}){try{const o=r.getUniqueNotifications({tags:i}).map(s=>new Gr(an(Ye({},s),{isRead:!0,readAt:new Date().toISOString(),isArchived:!1,archivedAt:void 0}),t,n));return t.emit("notifications.read_all.pending",{args:{tags:i},data:o}),yield n.readAll({tags:i}),t.emit("notifications.read_all.resolved",{args:{tags:i},data:o}),{}}catch(a){return t.emit("notifications.read_all.resolved",{args:{tags:i},error:a}),{error:new or("Failed to read all notifications",a)}}}),Mz=e=>Ve(void 0,[e],function*({emitter:t,inboxService:n,notificationsCache:r,tags:i}){try{const o=r.getUniqueNotifications({tags:i}).map(s=>new Gr(an(Ye({},s),{isRead:!0,readAt:new Date().toISOString(),isArchived:!0,archivedAt:new Date().toISOString()}),t,n));return t.emit("notifications.archive_all.pending",{args:{tags:i},data:o}),yield n.archiveAll({tags:i}),t.emit("notifications.archive_all.resolved",{args:{tags:i},data:o}),{}}catch(a){return t.emit("notifications.archive_all.resolved",{args:{tags:i},error:a}),{error:new or("Failed to archive all notifications",a)}}}),Bz=e=>Ve(void 0,[e],function*({emitter:t,inboxService:n,notificationsCache:r,tags:i}){try{const o=r.getUniqueNotifications({tags:i,read:!0}).map(s=>new Gr(an(Ye({},s),{isArchived:!0,archivedAt:new Date().toISOString()}),t,n));return t.emit("notifications.archive_all_read.pending",{args:{tags:i},data:o}),yield n.archiveAllRead({tags:i}),t.emit("notifications.archive_all_read.resolved",{args:{tags:i},data:o}),{}}catch(a){return t.emit("notifications.archive_all_read.resolved",{args:{tags:i},error:a}),{error:new or("Failed to archive all read notifications",a)}}}),Ai,s7=class{constructor(){Ge(this,Ai),Qe(this,Ai,new Map)}get(e){return oe(this,Ai).get(e)}getValues(){return Array.from(oe(this,Ai).values())}entries(){return Array.from(oe(this,Ai).entries())}keys(){return Array.from(oe(this,Ai).keys())}set(e,t){oe(this,Ai).set(e,t)}remove(e){oe(this,Ai).delete(e)}clear(){oe(this,Ai).clear()}};Ai=new WeakMap;var l7=({tags:e,read:t,archived:n,limit:r,offset:i,after:a})=>Object.entries({tags:e,read:t,archived:n,limit:r,offset:i,after:a}).filter(([o,s])=>s!=null&&!(Array.isArray(s)&&s.length===0)).reduce((o,[s,l])=>(o[s]=l,o),{}),Am=({tags:e,read:t,archived:n,limit:r,offset:i,after:a})=>JSON.stringify(l7({tags:e,read:t,archived:n,limit:r,offset:i,after:a})),Lz=({tags:e,read:t,archived:n})=>JSON.stringify(l7({tags:e,read:t,archived:n})),Ts=e=>JSON.parse(e),$z=["notification.read.pending","notification.read.resolved","notification.unread.pending","notification.unread.resolved","notification.complete_action.pending","notification.complete_action.resolved","notification.revert_action.pending","notification.revert_action.resolved","notifications.read_all.pending","notifications.read_all.resolved"],jz=["notification.archive.pending","notification.unarchive.pending","notifications.archive_all.pending","notifications.archive_all_read.pending"],Mo,kn,Hz=class{constructor({emitter:e}){Ge(this,Mo),Ge(this,kn),this.updateNotification=(t,n)=>{const r=oe(this,kn).get(t);if(!r)return!1;const i=r.notifications.findIndex(o=>o.id===n.id);if(i===-1)return!1;const a=[...r.notifications];return a[i]=n,oe(this,kn).set(t,an(Ye({},r),{notifications:a})),!0},this.removeNotification=(t,n)=>{const r=oe(this,kn).get(t);if(!r)return!1;const i=r.notifications.findIndex(o=>o.id===n.id);if(i===-1)return!1;const a=[...r.notifications];return a.splice(i,1),oe(this,kn).set(t,an(Ye({},r),{notifications:a})),!0},this.handleNotificationEvent=({remove:t}={remove:!1})=>({data:n})=>{if(!n)return;const r=Array.isArray(n)?n:[n],i=new Set;oe(this,kn).keys().forEach(a=>{r.forEach(o=>{let s=!1;t?s=this.removeNotification(a,o):s=this.updateNotification(a,o),s&&i.add(Lz(Ts(a)))})}),i.forEach(a=>{const o=this.getAggregated(Ts(a));oe(this,Mo).emit("notifications.list.updated",{data:o})})},Qe(this,Mo,e),$z.forEach(t=>{oe(this,Mo).on(t,this.handleNotificationEvent())}),jz.forEach(t=>{oe(this,Mo).on(t,this.handleNotificationEvent({remove:!0}))}),Qe(this,kn,new s7)}getAggregated(e){return oe(this,kn).keys().filter(n=>{const r=Ts(n);return Nf(r,e)}).map(n=>oe(this,kn).get(n)).reduce((n,r)=>r?{hasMore:r.hasMore,filter:r.filter,notifications:[...n.notifications,...r.notifications]}:n,{hasMore:!1,filter:{},notifications:[]})}has(e){return oe(this,kn).get(Am(e))!==void 0}set(e,t){oe(this,kn).set(Am(e),t)}update(e,t){this.set(e,t);const n=this.getAggregated(Ts(Am(e)));oe(this,Mo).emit("notifications.list.updated",{data:n})}getAll(e){if(this.has(e))return this.getAggregated({tags:e.tags,read:e.read,archived:e.archived})}getUniqueNotifications({tags:e,read:t}){const n=oe(this,kn).keys(),r=new Map;return n.forEach(i=>{const a=Ts(i);if(n7(e,a.tags)){const o=oe(this,kn).get(i);if(!o)return;o.notifications.filter(s=>typeof t>"u"||t===s.isRead).forEach(s=>r.set(s.id,s))}}),Array.from(r.values())}clear(e){oe(this,kn).keys().forEach(n=>{Nf(Ts(n),e)&&oe(this,kn).remove(n)})}clearAll(){oe(this,kn).clear()}};Mo=new WeakMap;kn=new WeakMap;var Rd,Uz=class extends Fy{constructor({useCache:e,inboxServiceInstance:t,eventEmitterInstance:n}){super({eventEmitterInstance:n,inboxServiceInstance:t}),Ge(this,Rd),this.cache=new Hz({emitter:n}),Qe(this,Rd,e)}list(){return Ve(this,arguments,function*(e={}){var t=e,{limit:n=10}=t,r=Dy(t,["limit"]);return this.callWithSession(()=>Ve(this,null,function*(){const i=Ye({limit:n},r);try{const a="useCache"in i?i.useCache:oe(this,Rd);let o=a?this.cache.getAll(i):void 0;if(this._emitter.emit("notifications.list.pending",{args:i,data:o}),!o){const s=yield this._inboxService.fetchNotifications(Ye({limit:n},r));o={hasMore:s.hasMore,filter:s.filter,notifications:s.data.map(l=>new Gr(l,this._emitter,this._inboxService))},a&&(this.cache.set(i,o),o=this.cache.getAll(i))}return this._emitter.emit("notifications.list.resolved",{args:i,data:o}),{data:o}}catch(a){return this._emitter.emit("notifications.list.resolved",{args:i,error:a}),{error:new or("Failed to fetch notifications",a)}}}))})}count(e){return Ve(this,null,function*(){return this.callWithSession(()=>Ve(this,null,function*(){const t=e&&"filters"in e?e.filters:[Ye({},e)];try{this._emitter.emit("notifications.count.pending",{args:e});const n=yield this._inboxService.count({filters:t}),r=e&&"filters"in e?{counts:n.data}:n.data[0];return this._emitter.emit("notifications.count.resolved",{args:e,data:r}),{data:r}}catch(n){return this._emitter.emit("notifications.count.resolved",{args:e,error:n}),{error:new or("Failed to count notifications",n)}}}))})}read(e){return Ve(this,null,function*(){return this.callWithSession(()=>Ve(this,null,function*(){return r7({emitter:this._emitter,apiService:this._inboxService,args:e})}))})}unread(e){return Ve(this,null,function*(){return this.callWithSession(()=>Ve(this,null,function*(){return i7({emitter:this._emitter,apiService:this._inboxService,args:e})}))})}archive(e){return Ve(this,null,function*(){return this.callWithSession(()=>Ve(this,null,function*(){return a7({emitter:this._emitter,apiService:this._inboxService,args:e})}))})}unarchive(e){return Ve(this,null,function*(){return this.callWithSession(()=>Ve(this,null,function*(){return o7({emitter:this._emitter,apiService:this._inboxService,args:e})}))})}completePrimary(e){return Ve(this,null,function*(){return this.callWithSession(()=>Ve(this,null,function*(){return If({emitter:this._emitter,apiService:this._inboxService,args:e,actionType:"primary"})}))})}completeSecondary(e){return Ve(this,null,function*(){return this.callWithSession(()=>Ve(this,null,function*(){return If({emitter:this._emitter,apiService:this._inboxService,args:e,actionType:"secondary"})}))})}revertPrimary(e){return Ve(this,null,function*(){return this.callWithSession(()=>Ve(this,null,function*(){return Pf({emitter:this._emitter,apiService:this._inboxService,args:e,actionType:"primary"})}))})}revertSecondary(e){return Ve(this,null,function*(){return this.callWithSession(()=>Ve(this,null,function*(){return Pf({emitter:this._emitter,apiService:this._inboxService,args:e,actionType:"secondary"})}))})}readAll(){return Ve(this,arguments,function*({tags:e}={}){return this.callWithSession(()=>Ve(this,null,function*(){return Fz({emitter:this._emitter,inboxService:this._inboxService,notificationsCache:this.cache,tags:e})}))})}archiveAll(){return Ve(this,arguments,function*({tags:e}={}){return this.callWithSession(()=>Ve(this,null,function*(){return Mz({emitter:this._emitter,inboxService:this._inboxService,notificationsCache:this.cache,tags:e})}))})}archiveAllRead(){return Ve(this,arguments,function*({tags:e}={}){return this.callWithSession(()=>Ve(this,null,function*(){return Bz({emitter:this._emitter,inboxService:this._inboxService,notificationsCache:this.cache,tags:e})}))})}clearCache({filter:e}={}){return e?this.cache.clear(e??{}):this.cache.clearAll()}};Rd=new WeakMap;var Bs,Fd,Bo,zz=class{constructor(e,t,n){Ge(this,Bs),Ge(this,Fd),Ge(this,Bo),Qe(this,Bs,n),Qe(this,Fd,t),Qe(this,Bo,e)}initialize(){return Ve(this,null,function*(){try{const{applicationIdentifier:e,subscriberId:t,subscriberHash:n}=oe(this,Bo);oe(this,Bs).emit("session.initialize.pending",{args:oe(this,Bo)});const r=yield oe(this,Fd).initializeSession({applicationIdentifier:e,subscriberId:t,subscriberHash:n});oe(this,Bs).emit("session.initialize.resolved",{args:oe(this,Bo),data:r})}catch(e){oe(this,Bs).emit("session.initialize.resolved",{args:oe(this,Bo),error:e})}})}};Bs=new WeakMap;Fd=new WeakMap;Bo=new WeakMap;var Vz=e=>Ve(void 0,[e],function*({emitter:t,apiService:n,cache:r,useCache:i,args:a}){const{workflowId:o,channelPreferences:s}=a;try{t.emit("preference.update.pending",{args:a,data:a.preference?new Rf(an(Ye({},a.preference),{channels:Ye(Ye({},a.preference.channels),s)}),{emitterInstance:t,inboxServiceInstance:n,cache:r,useCache:i}):void 0});let l;o?l=yield n.updateWorkflowPreferences({workflowId:o,channelPreferences:s}):(qz({emitter:t,apiService:n,cache:r,useCache:i,args:a}),l=yield n.updateGlobalPreferences(s));const u=new Rf(l,{emitterInstance:t,inboxServiceInstance:n,cache:r,useCache:i});return t.emit("preference.update.resolved",{args:a,data:u}),{data:u}}catch(l){return t.emit("preference.update.resolved",{args:a,error:l}),{error:new or("Failed to fetch notifications",l)}}}),qz=({emitter:e,apiService:t,cache:n,useCache:r,args:i})=>{const a=r?n==null?void 0:n.getAll({}):void 0;a==null||a.forEach(o=>{var s;if(o.level==="template"){const l=an(Ye({},o),{channels:Object.entries(o.channels).reduce((c,[d,f])=>{var h;const m=d;return c[m]=(h=i.channelPreferences[m])!=null?h:f,c},{})}),u=i.preference?new Rf(l,{emitterInstance:e,inboxServiceInstance:t,cache:n,useCache:r}):void 0;u&&e.emit("preference.update.pending",{args:{workflowId:(s=o.workflow)==null?void 0:s.id,channelPreferences:u.channels},data:u})}})},Md,Bd,Ld,$d,Rf=class{constructor(e,{emitterInstance:t,inboxServiceInstance:n,cache:r,useCache:i}){Ge(this,Md),Ge(this,Bd),Ge(this,Ld),Ge(this,$d),Qe(this,Md,t),Qe(this,Bd,n),Qe(this,Ld,r),Qe(this,$d,i),this.level=e.level,this.enabled=e.enabled,this.channels=e.channels,this.workflow=e.workflow}update({channelPreferences:e}){var t;return Vz({emitter:oe(this,Md),apiService:oe(this,Bd),cache:oe(this,Ld),useCache:oe(this,$d),args:{workflowId:(t=this.workflow)==null?void 0:t.id,channelPreferences:e,preference:{level:this.level,enabled:this.enabled,channels:this.channels,workflow:this.workflow}}})}};Md=new WeakMap;Bd=new WeakMap;Ld=new WeakMap;$d=new WeakMap;var Wz=["preference.update.pending","preference.update.resolved"],Kz=({tags:e})=>Object.entries({tags:e}).reduce((t,[n,r])=>(r==null||Array.isArray(r)&&r.length===0||(t[n]=r),t),{}),km=({tags:e})=>JSON.stringify(Kz({tags:e})),Fu,ri,Gz=class{constructor({emitterInstance:e}){Ge(this,Fu),Ge(this,ri),this.updatePreference=(t,n)=>{const r=oe(this,ri).get(t);if(!r)return!1;const i=r.findIndex(o=>{var s,l;return((s=o.workflow)==null?void 0:s.id)===((l=n.workflow)==null?void 0:l.id)||o.level===n.level&&n.level==="global"});if(i===-1)return!1;const a=[...r];return a[i]=n,oe(this,ri).set(t,a),!0},this.handlePreferenceEvent=({data:t})=>{t&&oe(this,ri).keys().forEach(n=>{const r=this.updatePreference(n,t),i=oe(this,ri).get(n);!r||!i||oe(this,Fu).emit("preferences.list.updated",{data:i})})},Qe(this,Fu,e),Wz.forEach(t=>{oe(this,Fu).on(t,this.handlePreferenceEvent)}),Qe(this,ri,new s7)}has(e){return oe(this,ri).get(km(e))!==void 0}set(e,t){oe(this,ri).set(km(e),t)}getAll(e){if(this.has(e))return oe(this,ri).get(km(e))}clearAll(){oe(this,ri).clear()}};Fu=new WeakMap;ri=new WeakMap;var Ls,Yz=class extends Fy{constructor({useCache:t,inboxServiceInstance:n,eventEmitterInstance:r}){super({eventEmitterInstance:r,inboxServiceInstance:n}),Ge(this,Ls),this.cache=new Gz({emitterInstance:this._emitter}),Qe(this,Ls,t)}list(){return Ve(this,arguments,function*(t={}){return this.callWithSession(()=>Ve(this,null,function*(){try{let n=oe(this,Ls)?this.cache.getAll(t):void 0;return this._emitter.emit("preferences.list.pending",{args:t,data:n}),n||(n=(yield this._inboxService.fetchPreferences(t.tags)).map(i=>new Rf(i,{emitterInstance:this._emitter,inboxServiceInstance:this._inboxService,cache:this.cache,useCache:oe(this,Ls)})),oe(this,Ls)&&(this.cache.set(t,n),n=this.cache.getAll(t))),this._emitter.emit("preferences.list.resolved",{args:t,data:n}),{data:n}}catch(n){throw this._emitter.emit("preferences.list.resolved",{args:t,error:n}),n}}))})}};Ls=new WeakMap;var Zz="https://ws.novu.co",pE="notifications.notification_received",mE="notifications.unseen_count_changed",gE="notifications.unread_count_changed",Qz=({_id:e,content:t,read:n,archived:r,createdAt:i,lastReadDate:a,archivedAt:o,channel:s,subscriber:l,subject:u,avatar:c,cta:d,tags:f,data:h})=>{var m,p,y,v,b,_,T,C,x,w;const P={id:(m=l==null?void 0:l._id)!=null?m:"",firstName:l==null?void 0:l.firstName,lastName:l==null?void 0:l.lastName,avatar:l==null?void 0:l.avatar,subscriberId:(p=l==null?void 0:l.subscriberId)!=null?p:""},O=(v=(y=d.action)==null?void 0:y.buttons)==null?void 0:v.find(S=>S.type==="primary"),M=(_=(b=d.action)==null?void 0:b.buttons)==null?void 0:_.find(S=>S.type==="secondary"),R=(C=(T=d.action)==null?void 0:T.result)==null?void 0:C.type,D=(x=d.action)==null?void 0:x.status;return{id:e,subject:u,body:t,to:P,isRead:n,isArchived:r,createdAt:i,readAt:a,archivedAt:o,avatar:c,primaryAction:O&&{label:O.content,isCompleted:R==="primary"&&D==="done",redirect:O.url?{target:O.target,url:O.url}:void 0},secondaryAction:M&&{label:M.content,isCompleted:R==="secondary"&&D==="done",redirect:M.url?{target:M.target,url:M.url}:void 0},channelType:s,tags:f,redirect:(w=d.data)!=null&&w.url?{url:d.data.url,target:d.data.target}:void 0,data:h}},tc,Si,ha,Sc,My,By,Ly,jd,Bg,Xz=class extends Fy{constructor({socketUrl:t,inboxServiceInstance:n,eventEmitterInstance:r}){super({eventEmitterInstance:r,inboxServiceInstance:n}),Ge(this,jd),Ge(this,tc),Ge(this,Si),Ge(this,ha),Ge(this,Sc),Ge(this,My,({message:i})=>{oe(this,Si).emit(pE,{result:new Gr(Qz(i),oe(this,Si),this._inboxService)})}),Ge(this,By,({unseenCount:i})=>{oe(this,Si).emit(mE,{result:i})}),Ge(this,Ly,({unreadCount:i})=>{oe(this,Si).emit(gE,{result:i})}),Qe(this,Si,r),Qe(this,Sc,t??Zz)}onSessionSuccess({token:t}){Qe(this,tc,t)}isSocketEvent(t){return t===pE||t===mE||t===gE}initialize(){if(oe(this,tc)){Of(this,jd,Bg).call(this).catch(t=>{console.error(t)});return}this.callWithSession(()=>Ve(this,null,function*(){return Of(this,jd,Bg).call(this).catch(t=>{console.error(t)}),{}}))}};tc=new WeakMap;Si=new WeakMap;ha=new WeakMap;Sc=new WeakMap;My=new WeakMap;By=new WeakMap;Ly=new WeakMap;jd=new WeakSet;Bg=function(){return Ve(this,null,function*(){var e,t,n;if(oe(this,ha))return;const r={socketUrl:oe(this,Sc)};oe(this,Si).emit("socket.connect.pending",{args:r}),Qe(this,ha,Pd(oe(this,Sc),{reconnectionDelayMax:1e4,transports:["websocket"],query:{token:`${oe(this,tc)}`}})),oe(this,ha).on("connect",()=>{oe(this,Si).emit("socket.connect.resolved",{args:r})}),oe(this,ha).on("connect_error",i=>{oe(this,Si).emit("socket.connect.resolved",{args:r,error:i})}),(e=oe(this,ha))==null||e.on("notification_received",oe(this,My)),(t=oe(this,ha))==null||t.on("unseen_count_changed",oe(this,By)),(n=oe(this,ha))==null||n.on("unread_count_changed",oe(this,Ly))})};var Jz="https://api.novu.co",eV="2024-06-26",Mu="/inbox",Jr=`${Mu}/notifications`,pn,tV=class{constructor(e={}){this.isSessionInitialized=!1,Ge(this,pn),Qe(this,pn,new Iz(e)),oe(this,pn).updateHeaders({"Novu-API-Version":eV,"Novu-User-Agent":e.userAgent||"@novu/js"})}initializeSession(e){return Ve(this,arguments,function*({applicationIdentifier:t,subscriberId:n,subscriberHash:r}){const i=yield oe(this,pn).post(`${Mu}/session`,{applicationIdentifier:t,subscriberId:n,subscriberHash:r});return oe(this,pn).setAuthorizationToken(i.token),this.isSessionInitialized=!0,i})}fetchNotifications({after:e,archived:t,limit:n=10,offset:r,read:i,tags:a}){const o=new URLSearchParams(`limit=${n}`);return e&&o.append("after",e),r&&o.append("offset",`${r}`),a&&a.forEach(s=>o.append("tags[]",s)),i!==void 0&&o.append("read",`${i}`),t!==void 0&&o.append("archived",`${t}`),oe(this,pn).getFullResponse(`${Jr}?${o.toString()}`)}count({filters:e}){return oe(this,pn).getFullResponse(`${Jr}/count?filters=${JSON.stringify(e)}`)}read(e){return oe(this,pn).patch(`${Jr}/${e}/read`)}unread(e){return oe(this,pn).patch(`${Jr}/${e}/unread`)}archive(e){return oe(this,pn).patch(`${Jr}/${e}/archive`)}unarchive(e){return oe(this,pn).patch(`${Jr}/${e}/unarchive`)}readAll({tags:e}){return oe(this,pn).post(`${Jr}/read`,{tags:e})}archiveAll({tags:e}){return oe(this,pn).post(`${Jr}/archive`,{tags:e})}archiveAllRead({tags:e}){return oe(this,pn).post(`${Jr}/read-archive`,{tags:e})}completeAction({actionType:e,notificationId:t}){return oe(this,pn).patch(`${Jr}/${t}/complete`,{actionType:e})}revertAction({actionType:e,notificationId:t}){return oe(this,pn).patch(`${Jr}/${t}/revert`,{actionType:e})}fetchPreferences(e){const t=new URLSearchParams;e&&e.forEach(r=>t.append("tags[]",r));const n=t.size?`?${t.toString()}`:"";return oe(this,pn).get(`${Mu}/preferences${n}`)}updateGlobalPreferences(e){return oe(this,pn).patch(`${Mu}/preferences`,e)}updateWorkflowPreferences({workflowId:e,channelPreferences:t}){return oe(this,pn).patch(`${Mu}/preferences/${e}`,t)}};pn=new WeakMap;var nV="2.6.0",rV="@novu/js",iV=`${rV}@${nV}`,da,Hd,Bu,Lo,u7=class{constructor(e){Ge(this,da),Ge(this,Hd),Ge(this,Bu),Ge(this,Lo);var t,n,r,i;Qe(this,Lo,new tV({backendUrl:(t=e.backendUrl)!=null?t:Jz,userAgent:(n=e.__userAgent)!=null?n:iV})),Qe(this,da,new Rz),Qe(this,Hd,new zz({applicationIdentifier:e.applicationIdentifier,subscriberId:e.subscriberId,subscriberHash:e.subscriberHash},oe(this,Lo),oe(this,da))),oe(this,Hd).initialize(),this.notifications=new Uz({useCache:(r=e.useCache)!=null?r:!0,inboxServiceInstance:oe(this,Lo),eventEmitterInstance:oe(this,da)}),this.preferences=new Yz({useCache:(i=e.useCache)!=null?i:!0,inboxServiceInstance:oe(this,Lo),eventEmitterInstance:oe(this,da)}),Qe(this,Bu,new Xz({socketUrl:e.socketUrl,eventEmitterInstance:oe(this,da),inboxServiceInstance:oe(this,Lo)})),this.on=(a,o)=>{oe(this,Bu).isSocketEvent(a)&&oe(this,Bu).initialize();const s=oe(this,da).on(a,o);return()=>{s()}},this.off=(a,o)=>{oe(this,da).off(a,o)}}};da=new WeakMap;Hd=new WeakMap;Bu=new WeakMap;Lo=new WeakMap;var aV=e=>{const t=[];let n="",r=!1;for(let i=0;i<e.length;i+=1)e[i]==="\\"&&e[i+1]==="*"?(n+="*",i+=1):e[i]==="*"&&e[i+1]==="*"?(n&&(t.push({type:r?"bold":"text",content:n}),n=""),r=!r,i+=1):n+=e[i];return n&&t.push({type:r?"bold":"text",content:n}),t};const c7={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return vE(this.context.count)},getNextContextId(){return vE(this.context.count++)}};function vE(e){const t=String(e),n=t.length-1;return c7.context.id+(n?String.fromCharCode(96+n):"")+t}const oV=(e,t)=>e===t,hi=Symbol("solid-proxy"),d7=typeof Proxy=="function",Lg=Symbol("solid-track"),Ff={equals:oV};let f7=y7;const Na=1,Mf=2,h7={owned:null,cleanups:null,context:null,owner:null},Sm={};var It=null;let Dm=null,sV=null,$t=null,Mn=null,ya=null,Ph=0;function nc(e,t){const n=$t,r=It,i=e.length===0,a=t===void 0?r:t,o=i?h7:{owned:null,cleanups:null,context:a?a.context:null,owner:a},s=i?e:()=>e(()=>xn(()=>Dc(o)));It=o,$t=null;try{return qi(s,!0)}finally{$t=n,It=r}}function Me(e,t){t=t?Object.assign({},Ff,t):Ff;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=i=>(typeof i=="function"&&(i=i(n.value)),v7(n,i));return[g7.bind(n),r]}function Bf(e,t,n){const r=Rh(e,t,!0,Na);Ul(r)}function ct(e,t,n){const r=Rh(e,t,!1,Na);Ul(r)}function cn(e,t,n){f7=vV;const r=Rh(e,t,!1,Na);(!n||!n.render)&&(r.user=!0),ya?ya.push(r):Ul(r)}function He(e,t,n){n=n?Object.assign({},Ff,n):Ff;const r=Rh(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,Ul(r),g7.bind(r)}function lV(e){return e&&typeof e=="object"&&"then"in e}function p7(e,t,n){let r,i,a;arguments.length===2&&typeof t=="object"||arguments.length===1?(r=!0,i=e,a=t||{}):(r=e,i=t,a=n||{});let o=null,s=Sm,l=!1,u="initialValue"in a,c=typeof r=="function"&&He(r);const d=new Set,[f,h]=(a.storage||Me)(a.initialValue),[m,p]=Me(void 0),[y,v]=Me(void 0,{equals:!1}),[b,_]=Me(u?"ready":"unresolved");function T(P,O,M,R){return o===P&&(o=null,R!==void 0&&(u=!0),(P===s||O===s)&&a.onHydrated&&queueMicrotask(()=>a.onHydrated(R,{value:O})),s=Sm,C(O,M)),O}function C(P,O){qi(()=>{O===void 0&&h(()=>P),_(O!==void 0?"errored":u?"ready":"unresolved"),p(O);for(const M of d.keys())M.decrement();d.clear()},!1)}function x(){const P=pV,O=f(),M=m();if(M!==void 0&&!o)throw M;return $t&&!$t.user&&P&&Bf(()=>{y(),o&&(P.resolved||d.has(P)||(P.increment(),d.add(P)))}),O}function w(P=!0){if(P!==!1&&l)return;l=!1;const O=c?c():r;if(O==null||O===!1){T(o,xn(f));return}const M=s!==Sm?s:xn(()=>i(O,{value:f(),refetching:P}));return lV(M)?(o=M,"value"in M?(M.status==="success"?T(o,M.value,void 0,O):T(o,void 0,jg(M.value),O),M):(l=!0,queueMicrotask(()=>l=!1),qi(()=>{_(u?"refreshing":"pending"),v()},!1),M.then(R=>T(M,R,void 0,O),R=>T(M,void 0,jg(R),O)))):(T(o,M,void 0,O),M)}return Object.defineProperties(x,{state:{get:()=>b()},error:{get:()=>m()},loading:{get(){const P=b();return P==="pending"||P==="refreshing"}},latest:{get(){if(!u)return x();const P=m();if(P&&!o)throw P;return f()}}}),c?Bf(()=>w(!1)):w(!1),[x,{refetch:w,mutate:h}]}function xl(e){return qi(e,!1)}function xn(e){if($t===null)return e();const t=$t;$t=null;try{return e()}finally{$t=t}}function sr(e){cn(()=>xn(e))}function dn(e){return It===null||(It.cleanups===null?It.cleanups=[e]:It.cleanups.push(e)),e}function $g(){return $t}function uV(){return It}function cV(e,t){const n=It,r=$t;It=e,$t=null;try{return qi(t,!0)}catch(i){$y(i)}finally{It=n,$t=r}}function dV(e){const t=$t,n=It;return Promise.resolve().then(()=>{$t=t,It=n;let r;return qi(e,!1),$t=It=null,r?r.done:void 0})}const[fV,Uve]=Me(!1);function hV(){return[fV,dV]}function vi(e,t){const n=Symbol("context");return{id:n,Provider:yV(n),defaultValue:e}}function lr(e){let t;return It&&It.context&&(t=It.context[e.id])!==void 0?t:e.defaultValue}function m7(e){const t=He(e),n=He(()=>Hg(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let pV;function g7(){if(this.sources&&this.state)if(this.state===Na)Ul(this);else{const e=Mn;Mn=null,qi(()=>$f(this),!1),Mn=e}if($t){const e=this.observers?this.observers.length:0;$t.sources?($t.sources.push(this),$t.sourceSlots.push(e)):($t.sources=[this],$t.sourceSlots=[e]),this.observers?(this.observers.push($t),this.observerSlots.push($t.sources.length-1)):(this.observers=[$t],this.observerSlots=[$t.sources.length-1])}return this.value}function v7(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&qi(()=>{for(let i=0;i<e.observers.length;i+=1){const a=e.observers[i],o=Dm&&Dm.running;o&&Dm.disposed.has(a),(o?!a.tState:!a.state)&&(a.pure?Mn.push(a):ya.push(a),a.observers&&b7(a)),o||(a.state=Na)}if(Mn.length>1e6)throw Mn=[],new Error},!1)),t}function Ul(e){if(!e.fn)return;Dc(e);const t=Ph;mV(e,e.value,t)}function mV(e,t,n){let r;const i=It,a=$t;$t=It=e;try{r=e.fn(t)}catch(o){return e.pure&&(e.state=Na,e.owned&&e.owned.forEach(Dc),e.owned=null),e.updatedAt=n+1,$y(o)}finally{$t=a,It=i}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?v7(e,r):e.value=r,e.updatedAt=n)}function Rh(e,t,n,r=Na,i){const a={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:It,context:It?It.context:null,pure:n};return It===null||It!==h7&&(It.owned?It.owned.push(a):It.owned=[a]),a}function Lf(e){if(e.state===0)return;if(e.state===Mf)return $f(e);if(e.suspense&&xn(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<Ph);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===Na)Ul(e);else if(e.state===Mf){const r=Mn;Mn=null,qi(()=>$f(e,t[0]),!1),Mn=r}}function qi(e,t){if(Mn)return e();let n=!1;t||(Mn=[]),ya?n=!0:ya=[],Ph++;try{const r=e();return gV(n),r}catch(r){n||(ya=null),Mn=null,$y(r)}}function gV(e){if(Mn&&(y7(Mn),Mn=null),e)return;const t=ya;ya=null,t.length&&qi(()=>f7(t),!1)}function y7(e){for(let t=0;t<e.length;t++)Lf(e[t])}function vV(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:Lf(r)}for(t=0;t<n;t++)Lf(e[t])}function $f(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){const r=e.sources[n];if(r.sources){const i=r.state;i===Na?r!==t&&(!r.updatedAt||r.updatedAt<Ph)&&Lf(r):i===Mf&&$f(r,t)}}}function b7(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=Mf,n.pure?Mn.push(n):ya.push(n),n.observers&&b7(n))}}function Dc(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),r=e.sourceSlots.pop(),i=n.observers;if(i&&i.length){const a=i.pop(),o=n.observerSlots.pop();r<i.length&&(a.sourceSlots[o]=r,i[r]=a,n.observerSlots[r]=o)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)Dc(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)Dc(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function jg(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function $y(e,t=It){throw jg(e)}function Hg(e){if(typeof e=="function"&&!e.length)return Hg(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=Hg(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function yV(e,t){return function(r){let i;return ct(()=>i=xn(()=>(It.context={...It.context,[e]:r.value},m7(()=>r.children))),void 0),i}}const bV=Symbol("fallback");function yE(e){for(let t=0;t<e.length;t++)e[t]()}function EV(e,t,n={}){let r=[],i=[],a=[],o=0,s=t.length>1?[]:null;return dn(()=>yE(a)),()=>{let l=e()||[],u=l.length,c,d;return l[Lg],xn(()=>{let h,m,p,y,v,b,_,T,C;if(u===0)o!==0&&(yE(a),a=[],r=[],i=[],o=0,s&&(s=[])),n.fallback&&(r=[bV],i[0]=nc(x=>(a[0]=x,n.fallback())),o=1);else if(o===0){for(i=new Array(u),d=0;d<u;d++)r[d]=l[d],i[d]=nc(f);o=u}else{for(p=new Array(u),y=new Array(u),s&&(v=new Array(u)),b=0,_=Math.min(o,u);b<_&&r[b]===l[b];b++);for(_=o-1,T=u-1;_>=b&&T>=b&&r[_]===l[T];_--,T--)p[T]=i[_],y[T]=a[_],s&&(v[T]=s[_]);for(h=new Map,m=new Array(T+1),d=T;d>=b;d--)C=l[d],c=h.get(C),m[d]=c===void 0?-1:c,h.set(C,d);for(c=b;c<=_;c++)C=r[c],d=h.get(C),d!==void 0&&d!==-1?(p[d]=i[c],y[d]=a[c],s&&(v[d]=s[c]),d=m[d],h.set(C,d)):a[c]();for(d=b;d<u;d++)d in p?(i[d]=p[d],a[d]=y[d],s&&(s[d]=v[d],s[d](d))):i[d]=nc(f);i=i.slice(0,o=u),r=l.slice(0)}return i});function f(h){if(a[d]=h,s){const[m,p]=Me(d);return s[d]=p,t(l[d],m)}return t(l[d])}}}function Z(e,t){return xn(()=>e(t||{}))}function R1(){return!0}const Ug={get(e,t,n){return t===hi?n:e.get(t)},has(e,t){return t===hi?!0:e.has(t)},set:R1,deleteProperty:R1,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:R1,deleteProperty:R1}},ownKeys(e){return e.keys()}};function Om(e){return(e=typeof e=="function"?e():e)?e:{}}function _V(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function At(...e){let t=!1;for(let o=0;o<e.length;o++){const s=e[o];t=t||!!s&&hi in s,e[o]=typeof s=="function"?(t=!0,He(s)):s}if(d7&&t)return new Proxy({get(o){for(let s=e.length-1;s>=0;s--){const l=Om(e[s])[o];if(l!==void 0)return l}},has(o){for(let s=e.length-1;s>=0;s--)if(o in Om(e[s]))return!0;return!1},keys(){const o=[];for(let s=0;s<e.length;s++)o.push(...Object.keys(Om(e[s])));return[...new Set(o)]}},Ug);const n={},r=Object.create(null);for(let o=e.length-1;o>=0;o--){const s=e[o];if(!s)continue;const l=Object.getOwnPropertyNames(s);for(let u=l.length-1;u>=0;u--){const c=l[u];if(c==="__proto__"||c==="constructor")continue;const d=Object.getOwnPropertyDescriptor(s,c);if(!r[c])r[c]=d.get?{enumerable:!0,configurable:!0,get:_V.bind(n[c]=[d.get.bind(s)])}:d.value!==void 0?d:void 0;else{const f=n[c];f&&(d.get?f.push(d.get.bind(s)):d.value!==void 0&&f.push(()=>d.value))}}}const i={},a=Object.keys(r);for(let o=a.length-1;o>=0;o--){const s=a[o],l=r[s];l&&l.get?Object.defineProperty(i,s,l):i[s]=l?l.value:void 0}return i}function wn(e,...t){if(d7&&hi in e){const i=new Set(t.length>1?t.flat():t[0]),a=t.map(o=>new Proxy({get(s){return o.includes(s)?e[s]:void 0},has(s){return o.includes(s)&&s in e},keys(){return o.filter(s=>s in e)}},Ug));return a.push(new Proxy({get(o){return i.has(o)?void 0:e[o]},has(o){return i.has(o)?!1:o in e},keys(){return Object.keys(e).filter(o=>!i.has(o))}},Ug)),a}const n={},r=t.map(()=>({}));for(const i of Object.getOwnPropertyNames(e)){const a=Object.getOwnPropertyDescriptor(e,i),o=!a.get&&!a.set&&a.enumerable&&a.writable&&a.configurable;let s=!1,l=0;for(const u of t)u.includes(i)&&(s=!0,o?r[l][i]=a.value:Object.defineProperty(r[l],i,a)),++l;s||(o?n[i]=a.value:Object.defineProperty(n,i,a))}return[...r,n]}const E7=e=>`Stale read from <${e}>.`;function Wi(e){const t="fallback"in e&&{fallback:()=>e.fallback};return He(EV(()=>e.each,e.children,t||void 0))}function Tt(e){const t=e.keyed,n=He(()=>e.when,void 0,{equals:(r,i)=>t?r===i:!r==!i});return He(()=>{const r=n();if(r){const i=e.children;return typeof i=="function"&&i.length>0?xn(()=>i(t?r:()=>{if(!xn(n))throw E7("Show");return e.when})):i}return e.fallback},void 0,void 0)}function TV(e){let t=!1;const n=(a,o)=>(t?a[1]===o[1]:!a[1]==!o[1])&&a[2]===o[2],r=m7(()=>e.children),i=He(()=>{let a=r();Array.isArray(a)||(a=[a]);for(let o=0;o<a.length;o++){const s=a[o].when;if(s)return t=!!a[o].keyed,[o,s,a[o]]}return[-1]},void 0,{equals:n});return He(()=>{const[a,o,s]=i();if(a<0)return e.fallback;const l=s.children;return typeof l=="function"&&l.length>0?xn(()=>l(t?o:()=>{if(xn(i)[0]!==a)throw E7("Match");return s.when})):l},void 0,void 0)}function bE(e){return e}const CV=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],xV=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...CV]),wV=new Set(["innerHTML","textContent","innerText","children"]),AV=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),kV=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});function SV(e,t){const n=kV[e];return typeof n=="object"?n[t]?n.$:void 0:n}const DV=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),OV=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),NV={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function IV(e,t,n){let r=n.length,i=t.length,a=r,o=0,s=0,l=t[i-1].nextSibling,u=null;for(;o<i||s<a;){if(t[o]===n[s]){o++,s++;continue}for(;t[i-1]===n[a-1];)i--,a--;if(i===o){const c=a<r?s?n[s-1].nextSibling:n[a-s]:l;for(;s<a;)e.insertBefore(n[s++],c)}else if(a===s)for(;o<i;)(!u||!u.has(t[o]))&&t[o].remove(),o++;else if(t[o]===n[a-1]&&n[s]===t[i-1]){const c=t[--i].nextSibling;e.insertBefore(n[s++],t[o++].nextSibling),e.insertBefore(n[--a],c),t[i]=n[a]}else{if(!u){u=new Map;let d=s;for(;d<a;)u.set(n[d],d++)}const c=u.get(t[o]);if(c!=null)if(s<c&&c<a){let d=o,f=1,h;for(;++d<i&&d<a&&!((h=u.get(t[d]))==null||h!==c+f);)f++;if(f>c-s){const m=t[o];for(;s<c;)e.insertBefore(n[s++],m)}else e.replaceChild(n[s++],t[o++])}else o++;else t[o++].remove()}}}const EE="_$DX_DELEGATE";function PV(e,t,n,r={}){let i;return nc(a=>{i=a,t===document?e():Ie(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{i(),t.textContent=""}}function Le(e,t,n){let r;const i=()=>{const o=document.createElement("template");return o.innerHTML=e,n?o.content.firstChild.firstChild:o.content.firstChild},a=t?()=>xn(()=>document.importNode(r||(r=i()),!0)):()=>(r||(r=i())).cloneNode(!0);return a.cloneNode=a,a}function zl(e,t=window.document){const n=t[EE]||(t[EE]=new Set);for(let r=0,i=e.length;r<i;r++){const a=e[r];n.has(a)||(n.add(a),t.addEventListener(a,jV))}}function er(e,t,n){n==null?e.removeAttribute(t):e.setAttribute(t,n)}function RV(e,t,n,r){r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r)}function FV(e,t,n){n?e.setAttribute(t,""):e.removeAttribute(t)}function Ze(e,t){t==null?e.removeAttribute("class"):e.className=t}function _7(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const i=n[0];e.addEventListener(t,n[0]=a=>i.call(e,n[1],a))}else e.addEventListener(t,n,typeof n!="function"&&n)}function MV(e,t,n={}){const r=Object.keys(t||{}),i=Object.keys(n);let a,o;for(a=0,o=i.length;a<o;a++){const s=i[a];!s||s==="undefined"||t[s]||(_E(e,s,!1),delete n[s])}for(a=0,o=r.length;a<o;a++){const s=r[a],l=!!t[s];!s||s==="undefined"||n[s]===l||!l||(_E(e,s,!0),n[s]=l)}return n}function BV(e,t,n){if(!t)return n?er(e,"style"):t;const r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let i,a;for(a in n)t[a]==null&&r.removeProperty(a),delete n[a];for(a in t)i=t[a],i!==n[a]&&(r.setProperty(a,i),n[a]=i);return n}function Ft(e,t={},n,r){const i={};return r||ct(()=>i.children=wl(e,t.children,i.children)),ct(()=>typeof t.ref=="function"&&Ca(t.ref,e)),ct(()=>LV(e,t,n,!0,i,!0)),i}function Ca(e,t,n){return xn(()=>e(t,n))}function Ie(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return wl(e,t,r,n);ct(i=>wl(e,t(),i,n),r)}function LV(e,t,n,r,i={},a=!1){t||(t={});for(const o in i)if(!(o in t)){if(o==="children")continue;i[o]=TE(e,o,null,i[o],n,a,t)}for(const o in t){if(o==="children"){r||wl(e,t.children);continue}const s=t[o];i[o]=TE(e,o,s,i[o],n,a,t)}}function $V(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function _E(e,t,n){const r=t.trim().split(/\s+/);for(let i=0,a=r.length;i<a;i++)e.classList.toggle(r[i],n)}function TE(e,t,n,r,i,a,o){let s,l,u,c,d;if(t==="style")return BV(e,n,r);if(t==="classList")return MV(e,n,r);if(n===r)return r;if(t==="ref")a||n(e);else if(t.slice(0,3)==="on:"){const f=t.slice(3);r&&e.removeEventListener(f,r,typeof r!="function"&&r),n&&e.addEventListener(f,n,typeof n!="function"&&n)}else if(t.slice(0,10)==="oncapture:"){const f=t.slice(10);r&&e.removeEventListener(f,r,!0),n&&e.addEventListener(f,n,!0)}else if(t.slice(0,2)==="on"){const f=t.slice(2).toLowerCase(),h=DV.has(f);if(!h&&r){const m=Array.isArray(r)?r[0]:r;e.removeEventListener(f,m)}(h||n)&&(_7(e,f,n,h),h&&zl([f]))}else if(t.slice(0,5)==="attr:")er(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")FV(e,t.slice(5),n);else if((d=t.slice(0,5)==="prop:")||(u=wV.has(t))||!i&&((c=SV(t,e.tagName))||(l=xV.has(t)))||(s=e.nodeName.includes("-")||"is"in o))d&&(t=t.slice(5),l=!0),t==="class"||t==="className"?Ze(e,n):s&&!l&&!u?e[$V(t)]=n:e[c||t]=n;else{const f=i&&t.indexOf(":")>-1&&NV[t.split(":")[0]];f?RV(e,f,t,n):er(e,AV[t]||t,n)}return n}function jV(e){let t=e.target;const n=`$$${e.type}`,r=e.target,i=e.currentTarget,a=l=>Object.defineProperty(e,"target",{configurable:!0,value:l}),o=()=>{const l=t[n];if(l&&!t.disabled){const u=t[`${n}Data`];if(u!==void 0?l.call(t,u,e):l.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&a(t.host),!0},s=()=>{for(;o()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),e.composedPath){const l=e.composedPath();a(l[0]);for(let u=0;u<l.length-2&&(t=l[u],!!o());u++){if(t._$host){t=t._$host,s();break}if(t.parentNode===i)break}}else s();a(r)}function wl(e,t,n,r,i){for(;typeof n=="function";)n=n();if(t===n)return n;const a=typeof t,o=r!==void 0;if(e=o&&n[0]&&n[0].parentNode||e,a==="string"||a==="number"){if(a==="number"&&(t=t.toString(),t===n))return n;if(o){let s=n[0];s&&s.nodeType===3?s.data!==t&&(s.data=t):s=document.createTextNode(t),n=Cs(e,n,r,s)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||a==="boolean")n=Cs(e,n,r);else{if(a==="function")return ct(()=>{let s=t();for(;typeof s=="function";)s=s();n=wl(e,s,n,r)}),()=>n;if(Array.isArray(t)){const s=[],l=n&&Array.isArray(n);if(zg(s,t,n,i))return ct(()=>n=wl(e,s,n,r,!0)),()=>n;if(s.length===0){if(n=Cs(e,n,r),o)return n}else l?n.length===0?CE(e,s,r):IV(e,n,s):(n&&Cs(e),CE(e,s));n=s}else if(t.nodeType){if(Array.isArray(n)){if(o)return n=Cs(e,n,r,t);Cs(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function zg(e,t,n,r){let i=!1;for(let a=0,o=t.length;a<o;a++){let s=t[a],l=n&&n[e.length],u;if(!(s==null||s===!0||s===!1))if((u=typeof s)=="object"&&s.nodeType)e.push(s);else if(Array.isArray(s))i=zg(e,s,l)||i;else if(u==="function")if(r){for(;typeof s=="function";)s=s();i=zg(e,Array.isArray(s)?s:[s],Array.isArray(l)?l:[l])||i}else e.push(s),i=!0;else{const c=String(s);l&&l.nodeType===3&&l.data===c?e.push(l):e.push(document.createTextNode(c))}}return i}function CE(e,t,n=null){for(let r=0,i=t.length;r<i;r++)e.insertBefore(t[r],n)}function Cs(e,t,n,r){if(n===void 0)return e.textContent="";const i=r||document.createTextNode("");if(t.length){let a=!1;for(let o=t.length-1;o>=0;o--){const s=t[o];if(i!==s){const l=s.parentNode===e;!a&&!o?l?e.replaceChild(i,s):e.insertBefore(i,n):l&&s.remove()}else a=!0}}else e.insertBefore(i,n);return[i]}const HV="http://www.w3.org/2000/svg";function T7(e,t=!1){return t?document.createElementNS(HV,e):document.createElement(e)}function jy(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,i=uV();let a,o=!!c7.context;return cn(()=>{a||(a=cV(i,()=>He(()=>e.children)));const s=r();if(s instanceof HTMLHeadElement){const[l,u]=Me(!1),c=()=>u(!0);nc(d=>Ie(s,()=>l()?d():a(),null)),dn(c)}else{const l=T7(e.isSVG?"g":"div",e.isSVG),u=t&&l.attachShadow?l.attachShadow({mode:"open"}):l;Object.defineProperty(l,"_$host",{get(){return n.parentNode},configurable:!0}),Ie(u,a),s.appendChild(l),e.ref&&e.ref(l),dn(()=>s.removeChild(l))}},void 0,{render:!o}),n}function Fh(e){const[t,n]=wn(e,["component"]),r=He(()=>t.component);return He(()=>{const i=r();switch(typeof i){case"function":return xn(()=>i(n));case"string":const a=OV.has(i),o=T7(i,a);return Ft(o,n,a),o}})}const Vg=Symbol("store-raw"),rl=Symbol("store-node"),ma=Symbol("store-has"),C7=Symbol("store-self");function x7(e){let t=e[hi];if(!t&&(Object.defineProperty(e,hi,{value:t=new Proxy(e,VV)}),!Array.isArray(e))){const n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let i=0,a=n.length;i<a;i++){const o=n[i];r[o].get&&Object.defineProperty(e,o,{enumerable:r[o].enumerable,get:r[o].get.bind(t)})}}return t}function jf(e){let t;return e!=null&&typeof e=="object"&&(e[hi]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function Oc(e,t=new Set){let n,r,i,a;if(n=e!=null&&e[Vg])return n;if(!jf(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let o=0,s=e.length;o<s;o++)i=e[o],(r=Oc(i,t))!==i&&(e[o]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);const o=Object.keys(e),s=Object.getOwnPropertyDescriptors(e);for(let l=0,u=o.length;l<u;l++)a=o[l],!s[a].get&&(i=e[a],(r=Oc(i,t))!==i&&(e[a]=r))}return e}function Hf(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function Nc(e,t,n){if(e[t])return e[t];const[r,i]=Me(n,{equals:!1,internal:!0});return r.$=i,e[t]=r}function UV(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===hi||t===rl||(delete n.value,delete n.writable,n.get=()=>e[hi][t]),n}function w7(e){$g()&&Nc(Hf(e,rl),C7)()}function zV(e){return w7(e),Reflect.ownKeys(e)}const VV={get(e,t,n){if(t===Vg)return e;if(t===hi)return n;if(t===Lg)return w7(e),n;const r=Hf(e,rl),i=r[t];let a=i?i():e[t];if(t===rl||t===ma||t==="__proto__")return a;if(!i){const o=Object.getOwnPropertyDescriptor(e,t);$g()&&(typeof a!="function"||e.hasOwnProperty(t))&&!(o&&o.get)&&(a=Nc(r,t,a)())}return jf(a)?x7(a):a},has(e,t){return t===Vg||t===hi||t===Lg||t===rl||t===ma||t==="__proto__"?!0:($g()&&Nc(Hf(e,ma),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:zV,getOwnPropertyDescriptor:UV};function Uf(e,t,n,r=!1){if(!r&&e[t]===n)return;const i=e[t],a=e.length;n===void 0?(delete e[t],e[ma]&&e[ma][t]&&i!==void 0&&e[ma][t].$()):(e[t]=n,e[ma]&&e[ma][t]&&i===void 0&&e[ma][t].$());let o=Hf(e,rl),s;if((s=Nc(o,t,i))&&s.$(()=>n),Array.isArray(e)&&e.length!==a){for(let l=e.length;l<a;l++)(s=o[l])&&s.$();(s=Nc(o,"length",a))&&s.$(e.length)}(s=o[C7])&&s.$()}function A7(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const i=n[r];Uf(e,i,t[i])}}function qV(e,t){if(typeof t=="function"&&(t=t(e)),t=Oc(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){const i=t[n];e[n]!==i&&Uf(e,n,i)}Uf(e,"length",r)}else A7(e,t)}function Lu(e,t,n=[]){let r,i=e;if(t.length>1){r=t.shift();const o=typeof r,s=Array.isArray(e);if(Array.isArray(r)){for(let l=0;l<r.length;l++)Lu(e,[r[l]].concat(t),n);return}else if(s&&o==="function"){for(let l=0;l<e.length;l++)r(e[l],l)&&Lu(e,[l].concat(t),n);return}else if(s&&o==="object"){const{from:l=0,to:u=e.length-1,by:c=1}=r;for(let d=l;d<=u;d+=c)Lu(e,[d].concat(t),n);return}else if(t.length>1){Lu(e[r],t,[r].concat(n));return}i=e[r],n=[r].concat(n)}let a=t[0];typeof a=="function"&&(a=a(i,n),a===i)||r===void 0&&a==null||(a=Oc(a),r===void 0||jf(i)&&jf(a)&&!Array.isArray(a)?A7(i,a):Uf(e,r,a))}function WV(...[e,t]){const n=Oc(e||{}),r=Array.isArray(n),i=x7(n);function a(...o){xl(()=>{r&&o.length===1?qV(n,o[0]):Lu(n,o)})}return[i,a]}function k7(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=k7(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function KV(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=k7(e))&&(r&&(r+=" "),r+=t);return r}const Hy="-",GV=e=>{const t=ZV(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const s=o.split(Hy);return s[0]===""&&s.length!==1&&s.shift(),S7(s,t)||YV(o)},getConflictingClassGroupIds:(o,s)=>{const l=n[o]||[];return s&&r[o]?[...l,...r[o]]:l}}},S7=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?S7(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const a=e.join(Hy);return(o=t.validators.find(({validator:s})=>s(a)))==null?void 0:o.classGroupId},xE=/^\[(.+)\]$/,YV=e=>{if(xE.test(e)){const t=xE.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},ZV=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return XV(Object.entries(e.classGroups),n).forEach(([a,o])=>{qg(o,r,a,t)}),r},qg=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const a=i===""?t:wE(t,i);a.classGroupId=n;return}if(typeof i=="function"){if(QV(i)){qg(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([a,o])=>{qg(o,wE(t,a),n,r)})})},wE=(e,t)=>{let n=e;return t.split(Hy).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},QV=e=>e.isThemeGetter,XV=(e,t)=>t?e.map(([n,r])=>{const i=r.map(a=>typeof a=="string"?t+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([o,s])=>[t+o,s])):a);return[n,i]}):e,JV=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(a,o)=>{n.set(a,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(a){let o=n.get(a);if(o!==void 0)return o;if((o=r.get(a))!==void 0)return i(a,o),o},set(a,o){n.has(a)?n.set(a,o):i(a,o)}}},D7="!",eq=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],a=t.length,o=s=>{const l=[];let u=0,c=0,d;for(let y=0;y<s.length;y++){let v=s[y];if(u===0){if(v===i&&(r||s.slice(y,y+a)===t)){l.push(s.slice(c,y)),c=y+a;continue}if(v==="/"){d=y;continue}}v==="["?u++:v==="]"&&u--}const f=l.length===0?s:s.substring(c),h=f.startsWith(D7),m=h?f.substring(1):f,p=d&&d>c?d-c:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:p}};return n?s=>n({className:s,parseClassName:o}):o},tq=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},nq=e=>({cache:JV(e.cacheSize),parseClassName:eq(e),...GV(e)}),rq=/\s+/,iq=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,a=[],o=e.trim().split(rq);let s="";for(let l=o.length-1;l>=0;l-=1){const u=o[l],{modifiers:c,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:h}=n(u);let m=!!h,p=r(m?f.substring(0,h):f);if(!p){if(!m){s=u+(s.length>0?" "+s:s);continue}if(p=r(f),!p){s=u+(s.length>0?" "+s:s);continue}m=!1}const y=tq(c).join(":"),v=d?y+D7:y,b=v+p;if(a.includes(b))continue;a.push(b);const _=i(p,m);for(let T=0;T<_.length;++T){const C=_[T];a.push(v+C)}s=u+(s.length>0?" "+s:s)}return s};function aq(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=O7(t))&&(r&&(r+=" "),r+=n);return r}const O7=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=O7(e[r]))&&(n&&(n+=" "),n+=t);return n};function AE(e,...t){let n,r,i,a=o;function o(l){const u=t.reduce((c,d)=>d(c),e());return n=nq(u),r=n.cache.get,i=n.cache.set,a=s,s(l)}function s(l){const u=r(l);if(u)return u;const c=iq(l,n);return i(l,c),c}return function(){return a(aq.apply(null,arguments))}}const Yt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},N7=/^\[(?:([a-z-]+):)?(.+)\]$/i,oq=/^\d+\/\d+$/,sq=new Set(["px","full","screen"]),lq=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,uq=/\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$/,cq=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,dq=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,fq=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,na=e=>il(e)||sq.has(e)||oq.test(e),ja=e=>Vl(e,"length",Eq),il=e=>!!e&&!Number.isNaN(Number(e)),Nm=e=>Vl(e,"number",il),du=e=>!!e&&Number.isInteger(Number(e)),hq=e=>e.endsWith("%")&&il(e.slice(0,-1)),st=e=>N7.test(e),Ha=e=>lq.test(e),pq=new Set(["length","size","percentage"]),mq=e=>Vl(e,pq,I7),gq=e=>Vl(e,"position",I7),vq=new Set(["image","url"]),yq=e=>Vl(e,vq,Tq),bq=e=>Vl(e,"",_q),fu=()=>!0,Vl=(e,t,n)=>{const r=N7.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Eq=e=>uq.test(e)&&!cq.test(e),I7=()=>!1,_q=e=>dq.test(e),Tq=e=>fq.test(e),kE=()=>{const e=Yt("colors"),t=Yt("spacing"),n=Yt("blur"),r=Yt("brightness"),i=Yt("borderColor"),a=Yt("borderRadius"),o=Yt("borderSpacing"),s=Yt("borderWidth"),l=Yt("contrast"),u=Yt("grayscale"),c=Yt("hueRotate"),d=Yt("invert"),f=Yt("gap"),h=Yt("gradientColorStops"),m=Yt("gradientColorStopPositions"),p=Yt("inset"),y=Yt("margin"),v=Yt("opacity"),b=Yt("padding"),_=Yt("saturate"),T=Yt("scale"),C=Yt("sepia"),x=Yt("skew"),w=Yt("space"),P=Yt("translate"),O=()=>["auto","contain","none"],M=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto",st,t],D=()=>[st,t],S=()=>["",na,ja],B=()=>["auto",il,st],H=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],$=()=>["solid","dashed","dotted","double","none"],F=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ne=()=>["start","end","center","between","around","evenly","stretch"],J=()=>["","0",st],I=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>[il,st];return{cacheSize:500,separator:":",theme:{colors:[fu],spacing:[na,ja],blur:["none","",Ha,st],brightness:A(),borderColor:[e],borderRadius:["none","","full",Ha,st],borderSpacing:D(),borderWidth:S(),contrast:A(),grayscale:J(),hueRotate:A(),invert:J(),gap:D(),gradientColorStops:[e],gradientColorStopPositions:[hq,ja],inset:R(),margin:R(),opacity:A(),padding:D(),saturate:A(),scale:A(),sepia:J(),skew:A(),space:D(),translate:D()},classGroups:{aspect:[{aspect:["auto","square","video",st]}],container:["container"],columns:[{columns:[Ha]}],"break-after":[{"break-after":I()}],"break-before":[{"break-before":I()}],"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","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...H(),st]}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",du,st]}],basis:[{basis:R()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",st]}],grow:[{grow:J()}],shrink:[{shrink:J()}],order:[{order:["first","last","none",du,st]}],"grid-cols":[{"grid-cols":[fu]}],"col-start-end":[{col:["auto",{span:["full",du,st]},st]}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":[fu]}],"row-start-end":[{row:["auto",{span:[du,st]},st]}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",st]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",st]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...ne()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ne(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ne(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[w]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[w]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",st,t]}],"min-w":[{"min-w":[st,t,"min","max","fit"]}],"max-w":[{"max-w":[st,t,"none","full","min","max","fit","prose",{screen:[Ha]},Ha]}],h:[{h:[st,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[st,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[st,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[st,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ha,ja]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Nm]}],"font-family":[{font:[fu]}],"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",st]}],"line-clamp":[{"line-clamp":["none",il,Nm]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",na,st]}],"list-image":[{"list-image":["none",st]}],"list-style-type":[{list:["none","disc","decimal",st]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...$(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",na,ja]}],"underline-offset":[{"underline-offset":["auto",na,st]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",st]}],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",st]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...H(),gq]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",mq]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},yq]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...$(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:$()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...$()]}],"outline-offset":[{"outline-offset":[na,st]}],"outline-w":[{outline:[na,ja]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:S()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[na,ja]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ha,bq]}],"shadow-color":[{shadow:[fu]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...F(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":F()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Ha,st]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[_]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[_]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",st]}],duration:[{duration:A()}],ease:[{ease:["linear","in","out","in-out",st]}],delay:[{delay:A()}],animate:[{animate:["none","spin","ping","pulse","bounce",st]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[T]}],"scale-x":[{"scale-x":[T]}],"scale-y":[{"scale-y":[T]}],rotate:[{rotate:[du,st]}],"translate-x":[{"translate-x":[P]}],"translate-y":[{"translate-y":[P]}],"skew-x":[{"skew-x":[x]}],"skew-y":[{"skew-y":[x]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",st]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],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",st]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"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","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",st]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[na,ja,Nm]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},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"],size:["w","h"],"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"],"line-clamp":["display","overflow"],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-s","border-color-e","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"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Cq=(e,{cacheSize:t,prefix:n,separator:r,experimentalParseClassName:i,extend:a={},override:o={}})=>{$u(e,"cacheSize",t),$u(e,"prefix",n),$u(e,"separator",r),$u(e,"experimentalParseClassName",i);for(const s in o)xq(e[s],o[s]);for(const s in a)wq(e[s],a[s]);return e},$u=(e,t,n)=>{n!==void 0&&(e[t]=n)},xq=(e,t)=>{if(t)for(const n in t)$u(e,n,t[n])},wq=(e,t)=>{if(t)for(const n in t){const r=t[n];r!==void 0&&(e[n]=(e[n]||[]).concat(r))}},Aq=(e,...t)=>typeof e=="function"?AE(kE,e,...t):AE(()=>Cq(kE(),e),...t);function P7(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=P7(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function kq(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=P7(e))&&(r&&(r+=" "),r+=t);return r}const SE=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,DE=kq,Sq=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return DE(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:a}=t,o=Object.keys(i).map(u=>{const c=n==null?void 0:n[u],d=a==null?void 0:a[u];if(c===null)return null;const f=SE(c)||SE(d);return i[u][f]}),s=n&&Object.entries(n).reduce((u,c)=>{let[d,f]=c;return f===void 0||(u[d]=f),u},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,c)=>{let{class:d,className:f,...h}=c;return Object.entries(h).every(m=>{let[p,y]=m;return Array.isArray(y)?y.includes({...a,...s}[p]):{...a,...s}[p]===y})?[...u,d,f]:u},[]);return DE(e,o,l,n==null?void 0:n.class,n==null?void 0:n.className)};var Dq=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function OE(e){const t={};let n;for(;n=Dq.exec(e);)t[n[1]]=n[2];return t}function Oq(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=OE(e)}else typeof t=="string"&&(t=OE(t));return{...e,...t}}function R7(e,t){e.indexOf(t)===-1&&e.push(t)}function Nq(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const F7=(e,t,n)=>Math.min(Math.max(n,e),t),ui={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},Ic=e=>typeof e=="number",al=e=>Array.isArray(e)&&!Ic(e[0]),Iq=(e,t,n)=>{const r=t-e;return((n-e)%r+r)%r+e};function Pq(e,t){return al(e)?e[Iq(0,e.length,t)]:e}const M7=(e,t,n)=>-n*e+n*t+e,B7=()=>{},to=e=>e,Uy=(e,t,n)=>t-e===0?1:(n-e)/(t-e);function L7(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Uy(0,t,r);e.push(M7(n,1,i))}}function Rq(e){const t=[0];return L7(t,e-1),t}function Fq(e,t=Rq(e.length),n=to){const r=e.length,i=r-t.length;return i>0&&L7(t,i),a=>{let o=0;for(;o<r-2&&!(a<t[o+1]);o++);let s=F7(0,1,Uy(t[o],t[o+1],a));return s=Pq(n,o)(s),M7(e[o],e[o+1],s)}}const $7=e=>Array.isArray(e)&&Ic(e[0]),Wg=e=>typeof e=="object"&&!!e.createAnimation,Pc=e=>typeof e=="function",Mq=e=>typeof e=="string",Im={ms:e=>e*1e3,s:e=>e/1e3},j7=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Bq=1e-7,Lq=12;function $q(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=j7(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>Bq&&++s<Lq);return o}function ju(e,t,n,r){if(e===t&&n===r)return to;const i=a=>$q(a,0,1,e,n);return a=>a===0||a===1?a:j7(i(a),t,r)}const jq=(e,t="end")=>n=>{n=t==="end"?Math.min(n,.999):Math.max(n,.001);const r=n*e,i=t==="end"?Math.floor(r):Math.ceil(r);return F7(0,1,i/e)},Hq={ease:ju(.25,.1,.25,1),"ease-in":ju(.42,0,1,1),"ease-in-out":ju(.42,0,.58,1),"ease-out":ju(0,0,.58,1)},Uq=/\((.*?)\)/;function NE(e){if(Pc(e))return e;if($7(e))return ju(...e);const t=Hq[e];if(t)return t;if(e.startsWith("steps")){const n=Uq.exec(e);if(n){const r=n[1].split(",");return jq(parseFloat(r[0]),r[1].trim())}}return to}class zq{constructor(t,n=[0,1],{easing:r,duration:i=ui.duration,delay:a=ui.delay,endDelay:o=ui.endDelay,repeat:s=ui.repeat,offset:l,direction:u="normal",autoplay:c=!0}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=to,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise((f,h)=>{this.resolve=f,this.reject=h}),r=r||ui.easing,Wg(r)){const f=r.createAnimation(n);r=f.easing,n=f.keyframes||n,i=f.duration||i}this.repeat=s,this.easing=al(r)?to:NE(r),this.updateDuration(i);const d=Fq(n,l,al(r)?r.map(NE):to);this.tick=f=>{var h;a=a;let m=0;this.pauseTime!==void 0?m=this.pauseTime:m=(f-this.startTime)*this.rate,this.t=m,m/=1e3,m=Math.max(m-a,0),this.playState==="finished"&&this.pauseTime===void 0&&(m=this.totalDuration);const p=m/this.duration;let y=Math.floor(p),v=p%1;!v&&p>=1&&(v=1),v===1&&y--;const b=y%2;(u==="reverse"||u==="alternate"&&b||u==="alternate-reverse"&&!b)&&(v=1-v);const _=m>=this.totalDuration?1:Math.min(v,1),T=d(this.easing(_));t(T),this.pauseTime===void 0&&(this.playState==="finished"||m>=this.totalDuration+o)?(this.playState="finished",(h=this.resolve)===null||h===void 0||h.call(this,T)):this.playState!=="idle"&&(this.frameRequestId=requestAnimationFrame(this.tick))},c&&this.play()}play(){const t=performance.now();this.playState="running",this.pauseTime!==void 0?this.startTime=t-this.pauseTime:this.startTime||(this.startTime=t),this.cancelTimestamp=this.startTime,this.pauseTime=void 0,this.frameRequestId=requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=this.t}finish(){this.playState="finished",this.tick(0)}stop(){var t;this.playState="idle",this.frameRequestId!==void 0&&cancelAnimationFrame(this.frameRequestId),(t=this.reject)===null||t===void 0||t.call(this,!1)}cancel(){this.stop(),this.tick(this.cancelTimestamp)}reverse(){this.rate*=-1}commitStyles(){}updateDuration(t){this.duration=t,this.totalDuration=t*(this.repeat+1)}get currentTime(){return this.t}set currentTime(t){this.pauseTime!==void 0||this.rate===0?this.pauseTime=t:this.startTime=performance.now()-t/this.rate}get playbackRate(){return this.rate}set playbackRate(t){this.rate=t}}var H7=function(){};process.env.NODE_ENV!=="production"&&(H7=function(e,t){if(!e)throw new Error(t)});class Vq{setAnimation(t){this.animation=t,t==null||t.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}}const Pm=new WeakMap;function U7(e){return Pm.has(e)||Pm.set(e,{transforms:[],values:new Map}),Pm.get(e)}function qq(e,t){return e.has(t)||e.set(t,new Vq),e.get(t)}const Wq=["","X","Y","Z"],Kq=["translate","scale","rotate","skew"],Al={x:"translateX",y:"translateY",z:"translateZ"},IE={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:e=>e+"deg"},Gq={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:e=>e+"px"},rotate:IE,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:to},skew:IE},kl=new Map,Mh=e=>`--motion-${e}`,zf=["x","y","z"];Kq.forEach(e=>{Wq.forEach(t=>{zf.push(e+t),kl.set(Mh(e+t),Gq[e])})});const Yq=(e,t)=>zf.indexOf(e)-zf.indexOf(t),Zq=new Set(zf),zy=e=>Zq.has(e),Qq=(e,t)=>{Al[t]&&(t=Al[t]);const{transforms:n}=U7(e);R7(n,t),e.style.transform=z7(n)},z7=e=>e.sort(Yq).reduce(Xq,"").trim(),Xq=(e,t)=>`${e} ${t}(var(${Mh(t)}))`,Kg=e=>e.startsWith("--"),PE=new Set;function Jq(e){if(!PE.has(e)){PE.add(e);try{const{syntax:t,initialValue:n}=kl.has(e)?kl.get(e):{};CSS.registerProperty({name:e,inherits:!1,syntax:t,initialValue:n})}catch{}}}const Rm=(e,t)=>document.createElement("div").animate(e,t),RE={cssRegisterProperty:()=>typeof CSS<"u"&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{Rm({opacity:[1]})}catch{return!1}return!0},finished:()=>!!Rm({opacity:[0,1]},{duration:.001}).finished,linearEasing:()=>{try{Rm({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0}},Fm={},Zs={};for(const e in RE)Zs[e]=()=>(Fm[e]===void 0&&(Fm[e]=RE[e]()),Fm[e]);const eW=.015,tW=(e,t)=>{let n="";const r=Math.round(t/eW);for(let i=0;i<r;i++)n+=e(Uy(0,r-1,i))+", ";return n.substring(0,n.length-2)},FE=(e,t)=>Pc(e)?Zs.linearEasing()?`linear(${tW(e,t)})`:ui.easing:$7(e)?nW(e):e,nW=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`;function rW(e,t){for(let n=0;n<e.length;n++)e[n]===null&&(e[n]=n?e[n-1]:t());return e}const iW=e=>Array.isArray(e)?e:[e];function Gg(e){return Al[e]&&(e=Al[e]),zy(e)?Mh(e):e}const Hu={get:(e,t)=>{t=Gg(t);let n=Kg(t)?e.style.getPropertyValue(t):getComputedStyle(e)[t];if(!n&&n!==0){const r=kl.get(t);r&&(n=r.initialValue)}return n},set:(e,t,n)=>{t=Gg(t),Kg(t)?e.style.setProperty(t,n):e.style[t]=n}};function aW(e,t=!0){if(!(!e||e.playState==="finished"))try{e.stop?e.stop():(t&&e.commitStyles(),e.cancel())}catch{}}function oW(e,t){var n;let r=(t==null?void 0:t.toDefaultUnit)||to;const i=e[e.length-1];if(Mq(i)){const a=((n=i.match(/(-?[\d.]+)([a-z%]*)/))===null||n===void 0?void 0:n[2])||"";a&&(r=o=>o+a)}return r}function sW(){return window.__MOTION_DEV_TOOLS_RECORD}function lW(e,t,n,r={},i){const a=sW(),o=r.record!==!1&&a;let s,{duration:l=ui.duration,delay:u=ui.delay,endDelay:c=ui.endDelay,repeat:d=ui.repeat,easing:f=ui.easing,persist:h=!1,direction:m,offset:p,allowWebkitAcceleration:y=!1,autoplay:v=!0}=r;const b=U7(e),_=zy(t);let T=Zs.waapi();_&&Qq(e,t);const C=Gg(t),x=qq(b.values,C),w=kl.get(C);return aW(x.animation,!(Wg(f)&&x.generator)&&r.record!==!1),()=>{const P=()=>{var R,D;return(D=(R=Hu.get(e,C))!==null&&R!==void 0?R:w==null?void 0:w.initialValue)!==null&&D!==void 0?D:0};let O=rW(iW(n),P);const M=oW(O,w);if(Wg(f)){const R=f.createAnimation(O,t!=="opacity",P,C,x);f=R.easing,O=R.keyframes||O,l=R.duration||l}if(Kg(C)&&(Zs.cssRegisterProperty()?Jq(C):T=!1),_&&!Zs.linearEasing()&&(Pc(f)||al(f)&&f.some(Pc))&&(T=!1),T){w&&(O=O.map(S=>Ic(S)?w.toDefaultUnit(S):S)),O.length===1&&(!Zs.partialKeyframes()||o)&&O.unshift(P());const R={delay:Im.ms(u),duration:Im.ms(l),endDelay:Im.ms(c),easing:al(f)?void 0:FE(f,l),direction:m,iterations:d+1,fill:"both"};s=e.animate({[C]:O,offset:p,easing:al(f)?f.map(S=>FE(S,l)):void 0},R),s.finished||(s.finished=new Promise((S,B)=>{s.onfinish=S,s.oncancel=B}));const D=O[O.length-1];s.finished.then(()=>{h||(Hu.set(e,C,D),s.cancel())}).catch(B7),y||(s.playbackRate=1.000001)}else if(i&&_)O=O.map(R=>typeof R=="string"?parseFloat(R):R),O.length===1&&O.unshift(parseFloat(P())),s=new i(R=>{Hu.set(e,C,M?M(R):R)},O,Object.assign(Object.assign({},r),{duration:l,easing:f}));else{const R=O[O.length-1];Hu.set(e,C,w&&Ic(R)?w.toDefaultUnit(R):R)}return o&&a(e,t,O,{duration:l,delay:u,easing:f,repeat:d,offset:p},"motion-one"),x.setAnimation(s),s&&!v&&s.pause(),s}}const uW=(e,t)=>e[t]?Object.assign(Object.assign({},e),e[t]):Object.assign({},e);function cW(e,t){var n;return typeof e=="string"?t?((n=t[e])!==null&&n!==void 0||(t[e]=document.querySelectorAll(e)),e=t[e]):e=document.querySelectorAll(e):e instanceof Element&&(e=[e]),Array.from(e||[])}const dW={any:0,all:1};function fW(e,t,{root:n,margin:r,amount:i="any"}={}){if(typeof IntersectionObserver>"u")return()=>{};const a=cW(e),o=new WeakMap,s=u=>{u.forEach(c=>{const d=o.get(c.target);if(c.isIntersecting!==!!d)if(c.isIntersecting){const f=t(c);Pc(f)?o.set(c.target,f):l.unobserve(c.target)}else d&&(d(c),o.delete(c.target))})},l=new IntersectionObserver(s,{root:n,rootMargin:r,threshold:typeof i=="number"?i:dW[i]});return a.forEach(u=>l.observe(u)),()=>l.disconnect()}function hW(e,t){return typeof e!=typeof t?!0:Array.isArray(e)&&Array.isArray(t)?!pW(e,t):e!==t}function pW(e,t){const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function mW(e){return typeof e=="object"}function ME(e,t){if(mW(e))return e;if(e&&t)return t[e]}let no;function gW(){if(!no)return;const e=no.sort(yW).map(bW);e.forEach(BE),e.forEach(BE),no=void 0}function Mm(e){no?R7(no,e):(no=[e],requestAnimationFrame(gW))}function vW(e){no&&Nq(no,e)}const yW=(e,t)=>e.getDepth()-t.getDepth(),bW=e=>e.animateUpdates(),BE=e=>e.next(),LE=(e,t)=>new CustomEvent(e,{detail:{target:t}});function Yg(e,t,n){e.dispatchEvent(new CustomEvent(t,{detail:{originalEvent:n}}))}function $E(e,t,n){e.dispatchEvent(new CustomEvent(t,{detail:{originalEntry:n}}))}const EW={isActive:e=>!!e.inView,subscribe:(e,{enable:t,disable:n},{inViewOptions:r={}})=>{const{once:i}=r,a=NC.__rest(r,["once"]);return fW(e,o=>{if(t(),$E(e,"viewenter",o),!i)return s=>{n(),$E(e,"viewleave",s)}},a)}},jE=(e,t,n)=>r=>{r.pointerType&&r.pointerType!=="mouse"||(n(),Yg(e,t,r))},_W={isActive:e=>!!e.hover,subscribe:(e,{enable:t,disable:n})=>{const r=jE(e,"hoverstart",t),i=jE(e,"hoverend",n);return e.addEventListener("pointerenter",r),e.addEventListener("pointerleave",i),()=>{e.removeEventListener("pointerenter",r),e.removeEventListener("pointerleave",i)}}},TW={isActive:e=>!!e.press,subscribe:(e,{enable:t,disable:n})=>{const r=a=>{n(),Yg(e,"pressend",a),window.removeEventListener("pointerup",r)},i=a=>{t(),Yg(e,"pressstart",a),window.addEventListener("pointerup",r)};return e.addEventListener("pointerdown",i),()=>{e.removeEventListener("pointerdown",i),window.removeEventListener("pointerup",r)}}},Ud={inView:EW,hover:_W,press:TW},HE=["initial","animate",...Object.keys(Ud),"exit"],Zg=new WeakMap;function CW(e={},t){let n,r=t?t.getDepth()+1:0;const i={initial:!0,animate:!0},a={},o={};for(const p of HE)o[p]=typeof e[p]=="string"?e[p]:t==null?void 0:t.getContext()[p];const s=e.initial===!1?"animate":"initial";let l=ME(e[s]||o[s],e.variants)||{},u=NC.__rest(l,["transition"]);const c=Object.assign({},u);function*d(){var p,y;const v=u;u={};const b={};for(const w of HE){if(!i[w])continue;const P=ME(e[w]);if(P)for(const O in P)O!=="transition"&&(u[O]=P[O],b[O]=uW((y=(p=P.transition)!==null&&p!==void 0?p:e.transition)!==null&&y!==void 0?y:{},O))}const _=new Set([...Object.keys(u),...Object.keys(v)]),T=[];_.forEach(w=>{var P;u[w]===void 0&&(u[w]=c[w]),hW(v[w],u[w])&&((P=c[w])!==null&&P!==void 0||(c[w]=Hu.get(n,w)),T.push(lW(n,w,u[w],b[w],zq)))}),yield;const C=T.map(w=>w()).filter(Boolean);if(!C.length)return;const x=u;n.dispatchEvent(LE("motionstart",x)),Promise.all(C.map(w=>w.finished)).then(()=>{n.dispatchEvent(LE("motioncomplete",x))}).catch(B7)}const f=(p,y)=>()=>{i[p]=y,Mm(m)},h=()=>{for(const p in Ud){const y=Ud[p].isActive(e),v=a[p];y&&!v?a[p]=Ud[p].subscribe(n,{enable:f(p,!0),disable:f(p,!1)},e):!y&&v&&(v(),delete a[p])}},m={update:p=>{n&&(e=p,h(),Mm(m))},setActive:(p,y)=>{n&&(i[p]=y,Mm(m))},animateUpdates:d,getDepth:()=>r,getTarget:()=>u,getOptions:()=>e,getContext:()=>o,mount:p=>(H7(!!p,"Animation state must be mounted with valid Element"),n=p,Zg.set(n,m),h(),()=>{Zg.delete(n),vW(m);for(const y in a)a[y]()}),isMounted:()=>!!n};return m}function xW(e){const t={},n=[];for(let r in e){const i=e[r];zy(r)&&(Al[r]&&(r=Al[r]),n.push(r),r=Mh(r));let a=Array.isArray(i)?i[0]:i;const o=kl.get(r);o&&(a=Ic(i)?o.toDefaultUnit(i):i),t[r]=a}return n.length&&(t.transform=z7(n)),t}var UE=e=>e instanceof Element;function Qg(e,t){if(t(e))return e;if(typeof e=="function"&&!e.length)return Qg(e(),t);if(Array.isArray(e))for(const n of e){const r=Qg(n,t);if(r)return r}return null}function wW(e,t=UE,n=UE){const r=He(e);return He(()=>Qg(r(),t))}var AW=()=>{},zE=(e,t)=>t();function kW(e,t){const n=xn(e),r=n?[n]:[],{onEnter:i=zE,onExit:a=zE}=t,[o,s]=Me(t.appear?[]:r),[l]=hV();let u,c=!1;function d(m,p){if(!m)return p&&p();c=!0,a(m,()=>{xl(()=>{c=!1,s(y=>y.filter(v=>v!==m)),p&&p()})})}function f(m){const p=u;if(!p)return m&&m();u=void 0,s(y=>[p,...y]),i(p,m??AW)}const h=t.mode==="out-in"?m=>c||d(m,f):t.mode==="in-out"?m=>f(()=>d(m)):m=>{d(m),f()};return Bf(m=>{const p=e();return xn(l)?(l(),m):(p!==m&&(u=p,xl(()=>xn(()=>h(m)))),p)},t.appear?void 0:n),o}var V7=vi(),SW=e=>{const[t,n]=Me(!0),r={initial:e.initial??!0,mount:t},i=Z(V7.Provider,{value:r,get children(){return kW(wW(()=>e.children),{appear:r.initial,mode:e.exitBeforeEnter?"out-in":"parallel",onExit(a,o){xl(()=>{var s;n(!1),(s=Zg.get(a))!=null&&s.getOptions().exit?a.addEventListener("motioncomplete",o):o()})},onEnter(a,o){xl(()=>{n(!0),o()})}})}});return r.initial=!0,i};function DW(e,t,n,r){const i=CW((n==null?void 0:n.initial)===!1?{...t(),initial:!1}:t(),r);return cn(()=>{if(n&&!n.mount())return;const a=e(),o=i.mount(a);cn(()=>i.update(t())),dn(()=>{n&&t().exit?(i.setActive("exit",!0),a.addEventListener("motioncomplete",o)):o()})}),[i,xW(i.getTarget())]}var OW=["initial","animate","inView","inViewOptions","hover","press","variants","transition","exit"],NW=["tag"],VE=vi(),qE=e=>{const[t,,n]=wn(e,OW,NW),[r,i]=DW(()=>a,()=>({...t}),lr(V7),lr(VE));let a;return Z(VE.Provider,{value:r,get children(){return Z(Fh,At(n,{ref:o=>{var s;a=o,(s=e.ref)==null||s.call(e,o)},get component(){return e.tag||"div"},get style(){return Oq(e.style,i)}}))}})},WE=new Proxy(qE,{get:(e,t)=>n=>Z(qE,At(n,{tag:t}))});const IW=Math.min,PW=Math.max,RW={left:"right",right:"left",bottom:"top",top:"bottom"},FW={start:"end",end:"start"};function KE(e,t,n){return PW(e,IW(t,n))}function Bh(e,t){return typeof e=="function"?e(t):e}function rs(e){return e.split("-")[0]}function Lh(e){return e.split("-")[1]}function q7(e){return e==="x"?"y":"x"}function W7(e){return e==="y"?"height":"width"}function $h(e){return["top","bottom"].includes(rs(e))?"y":"x"}function K7(e){return q7($h(e))}function MW(e,t,n){n===void 0&&(n=!1);const r=Lh(e),i=K7(e),a=W7(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=Vf(o)),[o,Vf(o)]}function BW(e){const t=Vf(e);return[Xg(e),t,Xg(t)]}function Xg(e){return e.replace(/start|end/g,t=>FW[t])}function LW(e,t,n){const r=["left","right"],i=["right","left"],a=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?a:o;default:return[]}}function $W(e,t,n,r){const i=Lh(e);let a=LW(rs(e),n==="start",r);return i&&(a=a.map(o=>o+"-"+i),t&&(a=a.concat(a.map(Xg)))),a}function Vf(e){return e.replace(/left|right|bottom|top/g,t=>RW[t])}function jW(e){return{top:0,right:0,bottom:0,left:0,...e}}function HW(e){return typeof e!="number"?jW(e):{top:e,right:e,bottom:e,left:e}}function qf(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function GE(e,t,n){let{reference:r,floating:i}=e;const a=$h(t),o=K7(t),s=W7(o),l=rs(t),u=a==="y",c=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2;let h;switch(l){case"top":h={x:c,y:r.y-i.height};break;case"bottom":h={x:c,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-i.width,y:d};break;default:h={x:r.x,y:r.y}}switch(Lh(t)){case"start":h[o]-=f*(n&&u?-1:1);break;case"end":h[o]+=f*(n&&u?-1:1);break}return h}const UW=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:o}=n,s=a.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:d}=GE(u,r,l),f=r,h={},m=0;for(let p=0;p<s.length;p++){const{name:y,fn:v}=s[p],{x:b,y:_,data:T,reset:C}=await v({x:c,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:h,rects:u,platform:o,elements:{reference:e,floating:t}});c=b??c,d=_??d,h={...h,[y]:{...h[y],...T}},C&&m<=50&&(m++,typeof C=="object"&&(C.placement&&(f=C.placement),C.rects&&(u=C.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):C.rects),{x:c,y:d}=GE(u,f,l)),p=-1)}return{x:c,y:d,placement:f,strategy:i,middlewareData:h}};async function G7(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:a,rects:o,elements:s,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=Bh(t,e),m=HW(h),y=s[f?d==="floating"?"reference":"floating":d],v=qf(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(y)))==null||n?y:y.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:l})),b=d==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,_=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),T=await(a.isElement==null?void 0:a.isElement(_))?await(a.getScale==null?void 0:a.getScale(_))||{x:1,y:1}:{x:1,y:1},C=qf(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:b,offsetParent:_,strategy:l}):b);return{top:(v.top-C.top+m.top)/T.y,bottom:(C.bottom-v.bottom+m.bottom)/T.y,left:(v.left-C.left+m.left)/T.x,right:(C.right-v.right+m.right)/T.x}}const zW=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:a,rects:o,initialPlacement:s,platform:l,elements:u}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:p=!0,...y}=Bh(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const v=rs(i),b=rs(s)===s,_=await(l.isRTL==null?void 0:l.isRTL(u.floating)),T=f||(b||!p?[Vf(s)]:BW(s));!f&&m!=="none"&&T.push(...$W(s,p,m,_));const C=[s,...T],x=await G7(t,y),w=[];let P=((r=a.flip)==null?void 0:r.overflows)||[];if(c&&w.push(x[v]),d){const D=MW(i,o,_);w.push(x[D[0]],x[D[1]])}if(P=[...P,{placement:i,overflows:w}],!w.every(D=>D<=0)){var O,M;const D=(((O=a.flip)==null?void 0:O.index)||0)+1,S=C[D];if(S)return{data:{index:D,overflows:P},reset:{placement:S}};let B=(M=P.filter(H=>H.overflows[0]<=0).sort((H,$)=>H.overflows[1]-$.overflows[1])[0])==null?void 0:M.placement;if(!B)switch(h){case"bestFit":{var R;const H=(R=P.map($=>[$.placement,$.overflows.filter(F=>F>0).reduce((F,ne)=>F+ne,0)]).sort(($,F)=>$[1]-F[1])[0])==null?void 0:R[0];H&&(B=H);break}case"initialPlacement":B=s;break}if(i!==B)return{reset:{placement:B}}}return{}}}};async function VW(e,t){const{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=rs(n),s=Lh(n),l=$h(n)==="y",u=["left","top"].includes(o)?-1:1,c=a&&l?-1:1,d=Bh(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&typeof m=="number"&&(h=s==="end"?m*-1:m),l?{x:h*c,y:f*u}:{x:f*u,y:h*c}}const qW=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:a,placement:o,middlewareData:s}=t,l=await VW(t,e);return o===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:a+l.y,data:{...l,placement:o}}}}},WW=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:s={fn:y=>{let{x:v,y:b}=y;return{x:v,y:b}}},...l}=Bh(e,t),u={x:n,y:r},c=await G7(t,l),d=$h(rs(i)),f=q7(d);let h=u[f],m=u[d];if(a){const y=f==="y"?"top":"left",v=f==="y"?"bottom":"right",b=h+c[y],_=h-c[v];h=KE(b,h,_)}if(o){const y=d==="y"?"top":"left",v=d==="y"?"bottom":"right",b=m+c[y],_=m-c[v];m=KE(b,m,_)}const p=s.fn({...t,[f]:h,[d]:m});return{...p,data:{x:p.x-n,y:p.y-r}}}}},Jg=Math.min,ol=Math.max,Wf=Math.round,F1=Math.floor,Mi=e=>({x:e,y:e});function jh(){return typeof window<"u"}function ql(e){return Y7(e)?(e.nodeName||"").toLowerCase():"#document"}function _r(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Qi(e){var t;return(t=(Y7(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Y7(e){return jh()?e instanceof Node||e instanceof _r(e).Node:!1}function pi(e){return jh()?e instanceof Element||e instanceof _r(e).Element:!1}function Ki(e){return jh()?e instanceof HTMLElement||e instanceof _r(e).HTMLElement:!1}function YE(e){return!jh()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof _r(e).ShadowRoot}function Kc(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=mi(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function KW(e){return["table","td","th"].includes(ql(e))}function Hh(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Vy(e){const t=qy(),n=pi(e)?mi(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function GW(e){let t=so(e);for(;Ki(t)&&!Sl(t);){if(Vy(t))return t;if(Hh(t))return null;t=so(t)}return null}function qy(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Sl(e){return["html","body","#document"].includes(ql(e))}function mi(e){return _r(e).getComputedStyle(e)}function Uh(e){return pi(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function so(e){if(ql(e)==="html")return e;const t=e.assignedSlot||e.parentNode||YE(e)&&e.host||Qi(e);return YE(t)?t.host:t}function Z7(e){const t=so(e);return Sl(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ki(t)&&Kc(t)?t:Z7(t)}function Rc(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Z7(e),a=i===((r=e.ownerDocument)==null?void 0:r.body),o=_r(i);if(a){const s=ev(o);return t.concat(o,o.visualViewport||[],Kc(i)?i:[],s&&n?Rc(s):[])}return t.concat(i,Rc(i,[],n))}function ev(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Q7(e){const t=mi(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Ki(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Wf(n)!==a||Wf(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Wy(e){return pi(e)?e:e.contextElement}function sl(e){const t=Wy(e);if(!Ki(t))return Mi(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Q7(t);let o=(a?Wf(n.width):n.width)/r,s=(a?Wf(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}const YW=Mi(0);function X7(e){const t=_r(e);return!qy()||!t.visualViewport?YW:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ZW(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==_r(e)?!1:t}function is(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),a=Wy(e);let o=Mi(1);t&&(r?pi(r)&&(o=sl(r)):o=sl(e));const s=ZW(a,n,r)?X7(a):Mi(0);let l=(i.left+s.x)/o.x,u=(i.top+s.y)/o.y,c=i.width/o.x,d=i.height/o.y;if(a){const f=_r(a),h=r&&pi(r)?_r(r):r;let m=f,p=ev(m);for(;p&&r&&h!==m;){const y=sl(p),v=p.getBoundingClientRect(),b=mi(p),_=v.left+(p.clientLeft+parseFloat(b.paddingLeft))*y.x,T=v.top+(p.clientTop+parseFloat(b.paddingTop))*y.y;l*=y.x,u*=y.y,c*=y.x,d*=y.y,l+=_,u+=T,m=_r(p),p=ev(m)}}return qf({width:c,height:d,x:l,y:u})}function Ky(e,t){const n=Uh(e).scrollLeft;return t?t.left+n:is(Qi(e)).left+n}function J7(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=r.left+t.scrollLeft-(n?0:Ky(e,r)),a=r.top+t.scrollTop;return{x:i,y:a}}function QW(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const a=i==="fixed",o=Qi(r),s=t?Hh(t.floating):!1;if(r===o||s&&a)return n;let l={scrollLeft:0,scrollTop:0},u=Mi(1);const c=Mi(0),d=Ki(r);if((d||!d&&!a)&&((ql(r)!=="body"||Kc(o))&&(l=Uh(r)),Ki(r))){const h=is(r);u=sl(r),c.x=h.x+r.clientLeft,c.y=h.y+r.clientTop}const f=o&&!d&&!a?J7(o,l,!0):Mi(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+f.x,y:n.y*u.y-l.scrollTop*u.y+c.y+f.y}}function XW(e){return Array.from(e.getClientRects())}function JW(e){const t=Qi(e),n=Uh(e),r=e.ownerDocument.body,i=ol(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=ol(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+Ky(e);const s=-n.scrollTop;return mi(r).direction==="rtl"&&(o+=ol(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}function eK(e,t){const n=_r(e),r=Qi(e),i=n.visualViewport;let a=r.clientWidth,o=r.clientHeight,s=0,l=0;if(i){a=i.width,o=i.height;const u=qy();(!u||u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:a,height:o,x:s,y:l}}function tK(e,t){const n=is(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Ki(e)?sl(e):Mi(1),o=e.clientWidth*a.x,s=e.clientHeight*a.y,l=i*a.x,u=r*a.y;return{width:o,height:s,x:l,y:u}}function ZE(e,t,n){let r;if(t==="viewport")r=eK(e,n);else if(t==="document")r=JW(Qi(e));else if(pi(t))r=tK(t,n);else{const i=X7(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return qf(r)}function e6(e,t){const n=so(e);return n===t||!pi(n)||Sl(n)?!1:mi(n).position==="fixed"||e6(n,t)}function nK(e,t){const n=t.get(e);if(n)return n;let r=Rc(e,[],!1).filter(s=>pi(s)&&ql(s)!=="body"),i=null;const a=mi(e).position==="fixed";let o=a?so(e):e;for(;pi(o)&&!Sl(o);){const s=mi(o),l=Vy(o);!l&&s.position==="fixed"&&(i=null),(a?!l&&!i:!l&&s.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Kc(o)&&!l&&e6(e,o))?r=r.filter(c=>c!==o):i=s,o=so(o)}return t.set(e,r),r}function rK(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?Hh(t)?[]:nK(t,this._c):[].concat(n),r],s=o[0],l=o.reduce((u,c)=>{const d=ZE(t,c,i);return u.top=ol(d.top,u.top),u.right=Jg(d.right,u.right),u.bottom=Jg(d.bottom,u.bottom),u.left=ol(d.left,u.left),u},ZE(t,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function iK(e){const{width:t,height:n}=Q7(e);return{width:t,height:n}}function aK(e,t,n){const r=Ki(t),i=Qi(t),a=n==="fixed",o=is(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=Mi(0);if(r||!r&&!a)if((ql(t)!=="body"||Kc(i))&&(s=Uh(t)),r){const f=is(t,!0,a,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else i&&(l.x=Ky(i));const u=i&&!r&&!a?J7(i,s):Mi(0),c=o.left+s.scrollLeft-l.x-u.x,d=o.top+s.scrollTop-l.y-u.y;return{x:c,y:d,width:o.width,height:o.height}}function Bm(e){return mi(e).position==="static"}function QE(e,t){if(!Ki(e)||mi(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Qi(e)===n&&(n=n.ownerDocument.body),n}function t6(e,t){const n=_r(e);if(Hh(e))return n;if(!Ki(e)){let i=so(e);for(;i&&!Sl(i);){if(pi(i)&&!Bm(i))return i;i=so(i)}return n}let r=QE(e,t);for(;r&&KW(r)&&Bm(r);)r=QE(r,t);return r&&Sl(r)&&Bm(r)&&!Vy(r)?n:r||GW(e)||n}const oK=async function(e){const t=this.getOffsetParent||t6,n=this.getDimensions,r=await n(e.floating);return{reference:aK(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function sK(e){return mi(e).direction==="rtl"}const lK={convertOffsetParentRelativeRectToViewportRelativeRect:QW,getDocumentElement:Qi,getClippingRect:rK,getOffsetParent:t6,getElementRects:oK,getClientRects:XW,getDimensions:iK,getScale:sl,isElement:pi,isRTL:sK};function uK(e,t){let n=null,r;const i=Qi(e);function a(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function o(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),a();const{left:u,top:c,width:d,height:f}=e.getBoundingClientRect();if(s||t(),!d||!f)return;const h=F1(c),m=F1(i.clientWidth-(u+d)),p=F1(i.clientHeight-(c+f)),y=F1(u),b={rootMargin:-h+"px "+-m+"px "+-p+"px "+-y+"px",threshold:ol(0,Jg(1,l))||1};let _=!0;function T(C){const x=C[0].intersectionRatio;if(x!==l){if(!_)return o();x?o(!1,x):r=setTimeout(()=>{o(!1,1e-7)},1e3)}_=!1}try{n=new IntersectionObserver(T,{...b,root:i.ownerDocument})}catch{n=new IntersectionObserver(T,b)}n.observe(e)}return o(!0),a}function n6(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=Wy(e),c=i||a?[...u?Rc(u):[],...Rc(t)]:[];c.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),a&&v.addEventListener("resize",n)});const d=u&&s?uK(u,n):null;let f=-1,h=null;o&&(h=new ResizeObserver(v=>{let[b]=v;b&&b.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var _;(_=h)==null||_.observe(t)})),n()}),u&&!l&&h.observe(u),h.observe(t));let m,p=l?is(e):null;l&&y();function y(){const v=is(e);p&&(v.x!==p.x||v.y!==p.y||v.width!==p.width||v.height!==p.height)&&n(),p=v,m=requestAnimationFrame(y)}return n(),()=>{var v;c.forEach(b=>{i&&b.removeEventListener("scroll",n),a&&b.removeEventListener("resize",n)}),d==null||d(),(v=h)==null||v.disconnect(),h=null,l&&cancelAnimationFrame(m)}}const r6=qW,i6=WW,a6=zW,cK=(e,t,n)=>{const r=new Map,i={platform:lK,...n},a={...i.platform,_c:r};return UW(e,t,{...i,platform:a})};function o6(e,t,n){let r=()=>{var d;return(d=n==null?void 0:n.placement)!=null?d:"bottom"},i=()=>{var d;return(d=n==null?void 0:n.strategy)!=null?d:"absolute"},[a,o]=Me({x:null,y:null,placement:r(),strategy:i(),middlewareData:{}}),[s,l]=Me();cn(()=>{let d=s();if(d)throw d.value});let u=He(()=>(e(),t(),{}));function c(){let d=e(),f=t();if(d&&f){let h=u();cK(d,f,{middleware:n==null?void 0:n.middleware,placement:r(),strategy:i()}).then(m=>{h===u()&&o(m)},m=>{l(m)})}}return cn(()=>{let d=e(),f=t();if(n==null||n.middleware,r(),i(),d&&f)if(n!=null&&n.whileElementsMounted){let h=n.whileElementsMounted(d,f,c);h&&dn(h)}else c()}),{get x(){return a().x},get y(){return a().y},get placement(){return a().placement},get strategy(){return a().strategy},get middlewareData(){return a().middlewareData},update:c}}var dK={colorPrimary:"#0081F1",colorPrimaryForeground:"white",colorSecondary:"#F3F3F3",colorSecondaryForeground:"#1A1523",colorCounter:"#E5484D",colorCounterForeground:"white",colorBackground:"#FCFCFC",colorForeground:"#1A1523",colorNeutral:"#525252",colorShadow:"rgba(122,133,153,0.25)",fontSize:"inherit",borderRadius:"0.375rem"},fK={locale:"en-US","inbox.filters.dropdownOptions.unread":"Unread only","inbox.filters.dropdownOptions.default":"Unread & read","inbox.filters.dropdownOptions.archived":"Archived","inbox.filters.labels.unread":"Unread","inbox.filters.labels.default":"Inbox","inbox.filters.labels.archived":"Archived","notifications.emptyNotice":"No notifications","notifications.actions.readAll":"Mark all as read","notifications.actions.archiveAll":"Archive all","notifications.actions.archiveRead":"Archive read","notifications.newNotifications":({notificationCount:e})=>`${e>99?"99+":e} new ${e===1?"notification":"notifications"}`,"notification.actions.read.tooltip":"Mark as read","notification.actions.unread.tooltip":"Mark as unread","notification.actions.archive.tooltip":"Archive","notification.actions.unarchive.tooltip":"Unarchive","preferences.title":"Notification Preferences","preferences.global":"Global Preferences","preferences.workflow.disabled.notice":"Contact admin to enable subscription management for this critical notification.","preferences.workflow.disabled.tooltip":"Contact admin to edit"},[hK,pK]=Me({}),XE=["button","popoverContent","popoverTrigger","dropdownContent","dropdownTrigger","dropdownItem","dropdownItemLabel","dropdownItemLabelContainer","dropdownItemLeftIcon","dropdownItemRightIcon","tooltipContent","tooltipTrigger","back__button","skeletonText","skeletonAvatar","tabsRoot","tabsList","tabsContent","tabsTrigger","dots","root","bellIcon","bellContainer","bellDot","preferences__button","preferencesContainer","inboxHeader","loading","inboxContent","inbox__popoverTrigger","inbox__popoverContent","notificationListContainer","notificationList","notificationListEmptyNoticeContainer","notificationListEmptyNotice","notificationListEmptyNoticeIcon","notificationListNewNotificationsNotice__button","notification","notificationDot","notificationSubject","notificationSubject__strong","notificationBody","notificationBody__strong","notificationBodyContainer","notificationImage","notificationDate","notificationDefaultActions","notificationCustomActions","notificationPrimaryAction__button","notificationSecondaryAction__button","notificationRead__button","notificationUnread__button","notificationArchive__button","notificationUnarchive__button","notificationsTabs__tabsRoot","notificationsTabs__tabsList","notificationsTabs__tabsContent","notificationsTabs__tabsTrigger","notificationsTabsTriggerLabel","notificationsTabsTriggerCount","inboxStatus__title","inboxStatus__dropdownTrigger","inboxStatus__dropdownContent","inboxStatus__dropdownItem","inboxStatus__dropdownItemLabel","inboxStatus__dropdownItemLabelContainer","inboxStatus__dropdownItemLeft__icon","inboxStatus__dropdownItemRight__icon","moreActionsContainer","moreActions__dropdownTrigger","moreActions__dropdownContent","moreActions__dropdownItem","moreActions__dropdownItemLabel","moreActions__dropdownItemLeft__icon","moreActions__dots","moreTabs__button","moreTabs__dots","moreTabs__dropdownTrigger","moreTabs__dropdownContent","moreTabs__dropdownItem","moreTabs__dropdownItemLabel","moreTabs__dropdownItemRight__icon","workflowContainer","workflowLabel","workflowLabelContainer","workflowContainerDisabledNotice","workflowLabelDisabled__icon","workflowContainerRight__icon","workflowArrow__icon","channelContainer","channelsContainerCollapsible","channelsContainer","channelLabel","channelLabelContainer","channelDescription","channelName","channelSwitchContainer","channelSwitch","channelSwitchThumb","preferencesHeader","preferencesHeader__back__button","preferencesHeader__title","preferencesLoadingContainer","strong"];function mK(e){const[t,n]=Me([]),[r,i]=Me(!0),[a,o]=Me(0),[s,l]=Me(!1),[u,{mutate:c,refetch:d}]=p7(a,e);let f=()=>{};{const m=new IntersectionObserver(p=>{p.length>0&&p[0].isIntersecting&&!s()&&!u.loading&&o(o(t().length))});dn(()=>m.disconnect()),f=p=>{m.observe(p),dn(()=>m.unobserve(p))}}return Bf(()=>{const m=u.latest;m&&(i(!1),xl(()=>{m.hasMore||l(!0),n(m.data)}))}),[t,{initialLoading:r,setEl:f,offset:a,end:s,mutate:c,reset:()=>Ve(this,null,function*(){n([]),i(!0),l(!1),a()!==0?o(0):yield d()})}]}var gK="en-US",xo={inMinute:60,inHour:3600,inDay:86400,inWeek:604800,inMonth:2592e3};function vK({fromDate:e,locale:t=gK,toDate:n=new Date}){const r=n.getTime()-e.getTime(),i=new Intl.RelativeTimeFormat(t,{style:"narrow"}),a=Math.floor(r/1e3);return a<xo.inMinute?"Just now":a<xo.inHour?i.format(Math.floor(-a/xo.inMinute),"minute"):a<xo.inDay?i.format(Math.floor(-a/xo.inHour),"hour"):a<xo.inMonth?i.format(Math.floor(-a/xo.inDay),"day"):new Intl.DateTimeFormat(t,{month:"short",day:"numeric"}).format(e)}var yK=Aq({prefix:"nt-"});function Bn(...e){return yK(KV(e))}function s6(e){const t="abcdefghijklmnopqrstuvwxyz";let n="";const r=t.length;for(let i=0;i<e;i+=1)n+=t.charAt(Math.floor(Math.random()*r));return n}function bK(e,t){let n;do n=s6(t);while(e.has(n));return n}function EK(e){return Object.entries(e).map(([t,n])=>`${t.replace(/([A-Z])/g,"-$1").toLowerCase()}: ${n};`).join(" ")}function _K(e,t){const n=`novu-css-${bK(e,8)}`,r=`.${n} { ${t} }`;return e.add(n),{className:n,rule:r}}var Kf=[50,100,200,300,400,500,600,700,800,900];function ra(e){return`.${e.id} { --nv-${e.key}: oklch(from ${e.color} l c h); }`}function JE(e){const t=[];for(let n=0;n<Kf.length;n+=1){const r=Kf[n],i=`.${e.id} { --nv-${e.key}-${r}: oklch(from ${e.color} calc(l - ${(r-500)/1e3}) c h); }`;t.push(i)}return t}function wo(e){const t=[];for(let n=0;n<Kf.length;n+=1){const r=Kf[n],i=`.${e.id} { --nv-${e.key}-${r}: oklch(from ${e.color} l c h / ${r/1e3}); }`;t.push(i)}return t}var TK=(e,t)=>[ra({color:e.colorBackground,key:"color-background",id:t}),ra({color:e.colorForeground,key:"color-foreground",id:t}),ra({color:e.colorPrimary,key:"color-primary",id:t}),ra({color:e.colorPrimaryForeground,key:"color-primary-foreground",id:t}),ra({color:e.colorSecondary,key:"color-secondary",id:t}),ra({color:e.colorSecondaryForeground,key:"color-secondary-foreground",id:t}),ra({color:e.colorCounter,key:"color-counter",id:t}),ra({color:e.colorCounterForeground,key:"color-counter-foreground",id:t}),ra({color:e.colorShadow,key:"color-shadow",id:t}),...wo({color:e.colorBackground,key:"color-background-alpha",id:t}),...wo({color:e.colorForeground,key:"color-foreground-alpha",id:t}),...JE({color:e.colorPrimary,key:"color-primary",id:t}),...wo({color:e.colorPrimary,key:"color-primary-alpha",id:t}),...wo({color:e.colorPrimaryForeground,key:"color-primary-foreground-alpha",id:t}),...JE({color:e.colorSecondary,key:"color-secondary",id:t}),...wo({color:e.colorSecondary,key:"color-secondary-alpha",id:t}),...wo({color:e.colorSecondaryForeground,key:"color-secondary-foreground-alpha",id:t}),...wo({color:e.colorNeutral,key:"color-neutral-alpha",id:t})],CK=e=>{const t=[],n=new Set;for(const r in e)if(e.hasOwnProperty(r)){const i=e[r];if(typeof i=="object"){const a=EK(i),{className:o,rule:s}=_K(n,a);t.push({key:r,rule:s,className:o})}}return t},ba=e=>{var t;return((t=e==null?void 0:e.filter)==null?void 0:t.tags)||(e==null?void 0:e.value)||[]},ft=()=>{const e=Gy(),[t,n]=Me(!0);return sr(()=>{n(!1)}),He(()=>(i,a)=>{var o,s;const l=i.split("__");let u=[];for(let p=0;p<l.length;p+=1){const y=l.slice(p).join("__");XE.includes(y)&&u.push(y)}const c=(a==null?void 0:a.split(/\s+/).map(p=>p.replace(/^nv-/,"")))||[],d=c.filter(p=>XE.includes(p));u=Array.from(new Set([...u,...d])),u.sort((p,y)=>{const v=(p.match(/__/g)||[]).length;return(y.match(/__/g)||[]).length-v});const f=c.filter(p=>!u.includes(p)).join(" "),h=[];for(let p=0;p<u.length;p+=1)typeof((o=e.elements())==null?void 0:o[u[p]])=="string"&&h.push((s=e.elements())==null?void 0:s[u[p]]);const m=u.length&&!t()?u.map(p=>e.appearanceKeyToCssInJsClass[p]):[];return Bn(...u.map(p=>`nv-${p}`),"🔔",f,h,...m)})()};function xK(e){const[t,n]=Me(!!e.fallbackValue);return e.value!==void 0?[()=>!!e.value,n]:[t,n]}var wK="_blank",AK="noopener noreferrer",l6=vi(void 0),kK=e=>{const[t,n]=WV({appearanceKeyToCssInJsClass:{}}),[r,i]=Me(null),[a,o]=Me([]),[s,l]=Me([]),u=He(()=>{var m,p,y;return Array.isArray((m=e.appearance)==null?void 0:m.baseTheme)?((p=e.appearance)==null?void 0:p.baseTheme)||[]:[((y=e.appearance)==null?void 0:y.baseTheme)||{}]}),c=()=>e.id,d=()=>{var m;return((m=e.appearance)==null?void 0:m.variables)||{}},f=()=>{var m,p;return(p=(m=e.appearance)==null?void 0:m.animations)!=null?p:!0},h=He(()=>{var m;const p=u().reduce((y,v)=>Ye(Ye({},y),v.elements||{}),{});return Ye(Ye({},p),((m=e.appearance)==null?void 0:m.elements)||{})});return sr(()=>{const m=document.getElementById(e.id);if(m){i(m);return}const p=document.createElement("style");p.id=e.id,document.head.appendChild(p),i(p),dn(()=>{const y=document.getElementById(e.id);y&&y.remove()})}),cn(()=>{var m;if(!r())return;const y=Ye(Ye({},dK),u().reduce((v,b)=>Ye(Ye({},v),b.variables||{}),{}));l(TK(Ye(Ye({},y),((m=e.appearance)==null?void 0:m.variables)||{}),e.id))}),cn(()=>{if(!r())return;const p=CK(h());n("appearanceKeyToCssInJsClass",y=>Ye(Ye({},y),p.reduce((v,b)=>(v[b.key]=b.className,v),{}))),o(p.map(y=>y.rule))}),cn(()=>{const m=r();m&&(m.innerHTML=[...s(),...a()].join(" "))}),Z(l6.Provider,{get value(){return{elements:h,variables:d,appearanceKeyToCssInJsClass:t.appearanceKeyToCssInJsClass,animations:f,id:c}},get children(){return e.children}})};function Gy(){const e=lr(l6);if(!e)throw new Error("useAppearance must be used within an AppearanceProvider");return e}var u6=({event:e,eventHandler:t})=>{const n=vo();sr(()=>{const r=n.on(e,t);dn(()=>{r()})})};function SK(e,t){let n=!1,r;const i=new Promise(a=>{r=a});return navigator.locks.request(e,()=>(n||t(e),i)),()=>{n=!0,r()}}var DK=({channelName:e,onMessage:t})=>{const[n]=Me(new BroadcastChannel(e)),r=i=>{n().postMessage(i)};return sr(()=>{const i=o=>{t(o.data)},a=n();a.addEventListener("message",i),dn(()=>{a.removeEventListener("message",i)})}),{postMessage:r}},Lm=({event:e,eventHandler:t})=>{const n=vo(),{postMessage:r}=DK({channelName:`nv.${e}`,onMessage:t}),i=a=>{t(a),r(a)};sr(()=>{let a;const o=SK(`nv.${e}`,()=>{a=n.on(e,i)});dn(()=>{a&&a(),o()})})},c6=vi(void 0),OK=e=>{const t=He(()=>{const i=e.localization||{},{dynamic:a}=i,o=Dy(i,["dynamic"]);return Ye(Ye(Ye(Ye({},fK),hK()),a||{}),o)}),n=(i,...a)=>{const o=t()[i];return typeof o=="function"?o(a[0]):o},r=He(()=>t().locale);return Z(c6.Provider,{value:{t:n,locale:r},get children(){return e.children}})};function go(){const e=lr(c6);if(!e)throw new Error("useLocalization must be used within an LocalizationProvider");return e}var d6=vi(void 0),e4={unreadRead:{archived:!1},unread:{read:!1},archived:{archived:!0}},f6=10,NK=e=>{var t;const[n,r]=Me(!1),[i,a]=Me(e.tabs),[o,s]=Me((t=e.tabs[0]&&e.tabs[0].label)!=null?t:""),[l,u]=Me("unreadRead"),[c,d]=Me(f6),[f,h]=Me(an(Ye({},e4.unreadRead),{tags:e.tabs.length>0?ba(e.tabs[0]):[]})),[m,p]=Me(!1),[y,v]=Me(e.preferencesFilter),b=C=>{u(C),h(x=>an(Ye({},e4[C]),{tags:x.tags}))},_=C=>{const x=i().find(P=>P.label===C),w=ba(x);w&&(s(C),h(P=>an(Ye({},P),{tags:w})))},T=(C,x)=>{if(!C)return;if(!C.startsWith("/")){window.open(C,x??wK,AK);return}if(e.routerPush){e.routerPush(C);return}const P=new URL(C,window.location.href);window.history.pushState.bind(window.history)({},"",P)};return cn(()=>{var C;a(e.tabs);const x=e.tabs[0],w=ba(x);s((C=x==null?void 0:x.label)!=null?C:""),h(P=>an(Ye({},P),{tags:w})),v(e.preferencesFilter)}),u6({event:"session.initialize.resolved",eventHandler:({data:C})=>{C&&p(C.removeNovuBranding)}}),Z(d6.Provider,{value:{status:l,setStatus:b,filter:f,tabs:i,activeTab:o,setActiveTab:_,limit:c,setLimit:d,isOpened:n,setIsOpened:r,navigate:T,hideBranding:m,preferencesFilter:y},get children(){return e.children}})},dr=()=>{const e=lr(d6);if(!e)throw new Error("useInboxContext must be used within a InboxProvider");return e},h6=vi(void 0);function IK(e){const t=He(()=>e.novu||new u7(e.options));return Z(h6.Provider,{get value(){return t()},get children(){return e.children}})}function vo(){const e=lr(h6);if(!e)throw new Error("useNovu must be used within a NovuProvider");return e}var PK=1,Gc=vi(void 0),RK=e=>{const t=vo(),{isOpened:n,tabs:r,filter:i,limit:a}=dr(),[o,s]=Me(0),[l,u]=Me(new Map),[c,d]=Me(new Map),f=()=>Ve(void 0,null,function*(){if(r().length===0)return;const p=r().map(_=>({tags:ba(_),read:!1,archived:!1})),{data:y}=yield t.notifications.count({filters:p});if(!y)return;const v=new Map,{counts:b}=y;for(let _=0;_<b.length;_+=1){const T=Fc(b[_].filter.tags);v.set(T,y==null?void 0:y.counts[_].count)}u(v)});sr(()=>{f()}),Lm({event:"notifications.unread_count_changed",eventHandler:p=>{s(p.result),f()}}),u6({event:"session.initialize.resolved",eventHandler:({data:p})=>{p&&s(p.totalUnreadCount)}});const h=(p,y)=>{const v=t.notifications.cache,b=a(),_=an(Ye({},i()),{tags:y,offset:0,limit:b}),T=!v.has(_);if(!n()&&T)return;const C=v.getAll(_)||{hasMore:!1,filter:_,notifications:[]};if(((C==null?void 0:C.notifications.length)||0)<PK){v.update(_,an(Ye({},C),{notifications:[p,...C.notifications]}));return}d(w=>{const P=Fc(y),O=new Map(w);return O.set(P,(w.get(P)||0)+1),O})};Lm({event:"notifications.notification_received",eventHandler:p=>Ve(void 0,[p],function*({result:y}){if(i().archived)return;const v=r();if(v.length>0)for(let b=0;b<v.length;b+=1){const _=v[b],T=ba(_),C=T.length===0,x=T.some(w=>{var P;return(P=y.tags)==null?void 0:P.includes(w)});!C&&!x||h(y,T)}else h(y,[])})}),Lm({event:"notifications.notification_received",eventHandler:f});const m=p=>{d(y=>{const v=new Map(y);return v.set(p,0),v})};return Z(Gc.Provider,{value:{totalUnreadCount:o,unreadCounts:l,newNotificationCounts:c,resetNewNotificationCounts:m},get children(){return e.children}})},Fc=e=>JSON.stringify({tags:e??[]}),FK=()=>{const e=lr(Gc);if(!e)throw new Error("useTotalUnreadCount must be used within a CountProvider");return{totalUnreadCount:e.totalUnreadCount}},MK=e=>{const t=lr(Gc);if(!t)throw new Error("useNewMessagesCount must be used within a CountProvider");const n=He(()=>Fc(e.filter.tags));return{count:He(()=>t.newNotificationCounts().get(n())||0),reset:()=>t.resetNewNotificationCounts(n())}},p6=e=>{const t=lr(Gc);if(!t)throw new Error("useUnreadCount must be used within a CountProvider");return He(()=>t.unreadCounts().get(Fc(e.filter.tags))||0)},BK=e=>{const t=lr(Gc);if(!t)throw new Error("useUnreadCounts must be used within a CountProvider");return He(()=>e.filters.map(r=>t.unreadCounts().get(Fc(r.tags))||0))};function LK({element:e,enabled:t}){cn(()=>{const n=e();if(!n||!t())return;const r="a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex], [contenteditable]",i=()=>Array.from(n.querySelectorAll(r)).filter(s=>s.tabIndex>=0&&!s.hasAttribute("disabled")),a=s=>{if(s.key!=="Tab")return;const l=i(),u=l[0],c=l[l.length-1];s.shiftKey?document.activeElement===u&&(c.focus(),s.preventDefault()):document.activeElement===c&&(u.focus(),s.preventDefault())};n.addEventListener("keydown",a);const o=i();o.length>0&&o[0].focus(),dn(()=>{n.removeEventListener("keydown",a)})})}var $K=LK,m6=vi(void 0),jK=e=>{const[t,n]=Me([]),r=o=>{n(s=>[...s,o])},i=o=>{n(s=>s.filter(l=>l!==o))},a=He(()=>t().length?t()[t().length-1]:null);return $K({element:()=>a(),enabled:()=>!0}),Z(m6.Provider,{value:{focusTraps:t,active:a,setActive:r,removeActive:i},get children(){return e.children}})};function Yy(){const e=lr(m6);if(!e)throw new Error("useFocusManager must be used within an FocusManagerProvider");return e}var HK=Le("<div>"),g6=e=>{let t;const[n,r]=wn(e,["render"]);return cn(()=>{const i=n.render(t);dn(()=>{i()})}),(()=>{var i=HK();return Ca(a=>{t=a},i),Ft(i,r,!1,!1),i})()},UK=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M16.25 15V6.875L15 4.375H5L3.75 6.877V15c0 .345.28.625.625.625h11.25c.345 0 .625-.28.625-.625zM5 8.125h10v6.25H5v-6.25zm.772-2.5h8.455l.625 1.25H5.148l.625-1.25zm6.103 3.75h-3.75v1.25h3.75v-1.25z">'),Zy=e=>(()=>{var t=UK();return Ft(t,e,!0,!0),t})(),zK=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M17.117 4.358l-1.159-1.4A1.21 1.21 0 0015 2.5H5c-.392 0-.733.175-.967.458l-1.15 1.4A1.632 1.632 0 002.5 5.417v10.416c0 .917.75 1.667 1.667 1.667h11.666c.917 0 1.667-.75 1.667-1.667V5.417c0-.4-.142-.775-.383-1.059zM10 14.583L5.417 10h2.916V8.333h3.334V10h2.916L10 14.583zM4.267 4.167l.675-.834h10l.783.834H4.267z">'),VK=e=>(()=>{var t=zK();return Ft(t,e,!0,!0),t})(),qK=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M5.833 8.333L10 12.5l4.166-4.167H5.833z">'),Qy=e=>(()=>{var t=qK();return Ft(t,e,!0,!0),t})(),WK=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M10 16.667l1.175-1.175-4.65-4.659h10.142V9.167H6.525l4.659-4.65L10 3.333 3.334 10 10 16.667z">'),KK=e=>(()=>{var t=WK();return Ft(t,e,!0,!0),t})(),GK=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M10 18.333c.916 0 1.666-.75 1.666-1.666H8.333c0 .916.75 1.666 1.667 1.666zm5-5V9.167c0-2.559-1.359-4.7-3.75-5.267v-.567c0-.691-.559-1.25-1.25-1.25-.692 0-1.25.559-1.25 1.25V3.9C6.366 4.467 5 6.6 5 9.167v4.166L3.333 15v.833h13.333V15L15 13.333zm-1.667.834H6.666v-5c0-2.067 1.259-3.75 3.334-3.75s3.333 1.683 3.333 3.75v5z">');function YK(e){return(()=>{var t=GK();return Ft(t,e,!0,!0),t})()}var ZK=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M12.5 3.333v5.834H4.31l-.975.975V3.333H12.5zm.834-1.666H2.5a.836.836 0 00-.833.833v11.667L5 10.833h8.334a.836.836 0 00.833-.833V2.5a.836.836 0 00-.833-.833zM17.5 5h-1.666v7.5H5v1.667c0 .458.375.833.834.833H15l3.334 3.333v-12.5A.836.836 0 0017.5 5z">'),QK=e=>(()=>{var t=ZK();return Ft(t,e,!0,!0),t})(),XK=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M7.5 13.475L4.025 10l-1.183 1.175L7.5 15.833l10-10-1.175-1.175L7.5 13.475z">'),v6=e=>(()=>{var t=XK();return Ft(t,e,!0,!0),t})(),JK=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M5 8.333c-.917 0-1.667.75-1.667 1.667s.75 1.667 1.667 1.667c.916 0 1.666-.75 1.666-1.667S5.916 8.333 5 8.333zm10 0c-.917 0-1.667.75-1.667 1.667s.75 1.667 1.667 1.667c.916 0 1.666-.75 1.666-1.667S15.916 8.333 15 8.333zm-5 0c-.917 0-1.667.75-1.667 1.667s.75 1.667 1.667 1.667c.916 0 1.666-.75 1.666-1.667S10.916 8.333 10 8.333z">'),y6=e=>(()=>{var t=JK();return Ft(t,e,!0,!0),t})(),eG=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M16.667 3.333H3.334c-.917 0-1.659.75-1.659 1.667l-.008 10c0 .917.75 1.667 1.667 1.667h13.333c.917 0 1.667-.75 1.667-1.667V5c0-.917-.75-1.667-1.667-1.667zm0 11.667H3.334V6.667L10 10.833l6.667-4.166V15zM10 9.167L3.334 5h13.333L10 9.167z">'),tG=e=>(()=>{var t=eG();return Ft(t,e,!0,!0),t})(),nG=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 viewBox="0 0 20 20"fill=none><path fill=currentColor d="M9.99967 18.3334C10.9163 18.3334 11.6663 17.5834 11.6663 16.6667H8.33301C8.33301 17.5834 9.08301 18.3334 9.99967 18.3334ZM14.9997 13.3334V9.16671C14.9997 6.60837 13.6413 4.46671 11.2497 3.90004V3.33337C11.2497 2.64171 10.6913 2.08337 9.99967 2.08337C9.30801 2.08337 8.74967 2.64171 8.74967 3.33337V3.90004C6.36634 4.46671 4.99967 6.60004 4.99967 9.16671V13.3334L3.33301 15V15.8334H16.6663V15L14.9997 13.3334ZM13.333 14.1667H6.66634V9.16671C6.66634 7.10004 7.92467 5.41671 9.99967 5.41671C12.0747 5.41671 13.333 7.10004 13.333 9.16671V14.1667Z">'),rG=e=>(()=>{var t=nG();return Ft(t,e,!0,!0),t})(),iG=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M15.833 2.5H4.158c-.925 0-1.65.742-1.65 1.667L2.5 15.833A1.66 1.66 0 004.158 17.5h11.675c.917 0 1.667-.75 1.667-1.667V4.167A1.667 1.667 0 0015.833 2.5zm0 10H12.5c0 1.383-1.125 2.5-2.5 2.5a2.502 2.502 0 01-2.5-2.5H4.158V4.167h11.675V12.5z">'),aG=e=>(()=>{var t=iG();return Ft(t,e,!0,!0),t})(),oG=Le('<svg xmlns=http://www.w3.org/2000/svg width=13 height=12 fill=none viewBox="0 0 13 12"><path fill=currentColor d="M9.787.98A5.972 5.972 0 006.5 0c-.668 0-1.31.11-1.911.31L9.187 4.94c.221.222.6.065.6-.248V.98z"></path><path fill=currentColor d="M2.879 1.216A5.99 5.99 0 00.5 6c0 1.134.315 2.195.862 3.1V7.309c0-1.966 2.379-2.946 3.764-1.552l4.995 5.027A5.99 5.99 0 0012.5 6a5.972 5.972 0 00-.862-3.1v1.791c0 1.966-2.379 2.946-3.764 1.552L2.879 1.216z"></path><path fill=currentColor d="M8.411 11.69L3.813 7.06a.351.351 0 00-.6.248v3.711c.944.62 2.073.98 3.287.98.668 0 1.31-.11 1.911-.31z">'),sG=e=>(()=>{var t=oG();return Ft(t,e,!0,!0),t})(),lG=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M15.833.833H7.5c-.917 0-1.667.75-1.667 1.667V5H7.5V3.333h8.333v13.334H7.5V15H5.833v2.5c0 .917.75 1.667 1.667 1.667h8.333c.917 0 1.667-.75 1.667-1.667v-15c0-.917-.75-1.667-1.667-1.667zM5.842 11.225L3.717 9.1l-1.059 1.058 3.175 3.175 5.992-5.991-1.058-1.059-4.925 4.942z">'),uG=e=>(()=>{var t=lG();return Ft(t,e,!0,!0),t})(),cG=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M15.833 2.5H4.167C3.25 2.5 2.5 3.25 2.5 4.167v11.666c0 .917.75 1.667 1.667 1.667h11.666c.917 0 1.667-.75 1.667-1.667V4.167c0-.917-.75-1.667-1.667-1.667zm0 13.333H4.167V4.167h11.666v11.666zM14.992 7.5l-1.175-1.183-5.492 5.491-2.15-2.141-1.183 1.175 3.333 3.325L14.992 7.5z">'),b6=e=>(()=>{var t=cG();return Ft(t,e,!0,!0),t})(),dG=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M15.95 10.783c.033-.25.05-.508.05-.783a4.81 4.81 0 00-.059-.783L17.633 7.9a.408.408 0 00.1-.508l-1.6-2.767a.407.407 0 00-.492-.183l-1.991.8a5.885 5.885 0 00-1.35-.784L12 2.342A.403.403 0 0011.6 2H8.4c-.2 0-.359.142-.392.342l-.3 2.116c-.492.2-.942.475-1.35.784l-1.992-.8a.398.398 0 00-.491.183L2.283 7.392c-.1.175-.067.391.1.508l1.692 1.317A4.89 4.89 0 004 10c0 .258.016.533.058.783L2.366 12.1a.408.408 0 00-.1.508l1.6 2.767c.1.183.309.242.492.183l1.992-.8c.416.317.858.584 1.35.784l.3 2.116c.041.2.2.342.4.342h3.2c.2 0 .366-.142.391-.342l.3-2.116c.492-.2.942-.467 1.35-.784l1.992.8c.183.067.392 0 .492-.183l1.6-2.767c.1-.183.058-.391-.1-.508l-1.675-1.317zM10 13c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3z">'),fG=e=>(()=>{var t=dG();return Ft(t,e,!0,!0),t})(),hG=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M16.667 1.667H3.334c-.917 0-1.667.75-1.667 1.666v15L5 15h11.667c.917 0 1.667-.75 1.667-1.667v-10c0-.916-.75-1.666-1.667-1.666zm0 11.666H4.309l-.975.975V3.333h13.333v10zM5.834 7.5H7.5v1.667H5.834V7.5zm6.666 0h1.667v1.667H12.5V7.5zm-3.333 0h1.667v1.667H9.167V7.5z">'),pG=e=>(()=>{var t=hG();return Ft(t,e,!0,!0),t})(),mG=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 viewBox="0 0 20 20"fill=none><path fill=currentColor d="M17.1167 4.35833L15.9583 2.95833C15.7333 2.675 15.3917 2.5 15 2.5H5C4.60833 2.5 4.26667 2.675 4.03333 2.95833L2.88333 4.35833C2.64167 4.64167 2.5 5.01667 2.5 5.41667V15.8333C2.5 16.75 3.25 17.5 4.16667 17.5H15.8333C16.75 17.5 17.5 16.75 17.5 15.8333V5.41667C17.5 5.01667 17.3583 4.64167 17.1167 4.35833ZM5.2 4.16667H14.8L15.4917 5H4.51667L5.2 4.16667ZM4.16667 15.8333V6.66667H15.8333V15.8333H4.16667ZM6.66667 11.6667H8.79167V14.1667H11.2083V11.6667H13.3333L10 8.33333L6.66667 11.6667Z">'),gG=e=>(()=>{var t=mG();return Ft(t,e,!0,!0),t})(),vG=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M10 15v1.25H4.996a.625.625 0 01-.621-.62V4.37c0-.342.28-.62.624-.62H12.5l3.125 3.125v4.375h-1.25V7.5h-2.5V5h-6.25v10H10zm1.54-.335l2.21 2.21 3.094-3.093-.884-.884-2.21 2.21-1.326-1.326-.884.883z">'),E6=e=>(()=>{var t=vG();return Ft(t,e,!0,!0),t})(),t4=Le("<span>"),yG=e=>{const t=ft();return(()=>{var n=t4();return Ie(n,Z(YK,{get class(){return t("bellIcon")}}),null),Ie(n,Z(Tt,{get when(){return e.unreadCount>0},get children(){var r=t4();return ct(()=>Ze(r,t("bellDot","nt-absolute nt-top-2 nt-right-2 nt-block nt-size-2 nt-transform nt-translate-x-1/2 -nt-translate-y-1/2 nt-bg-primary nt-rounded-full nt-border nt-border-background"))),r}}),null),ct(()=>Ze(n,t("bellContainer","nt-h-6 nt-w-6 nt-flex nt-justify-center nt-items-center nt-rounded-md nt-relative nt-text-foreground nt-cursor-pointer"))),n})()},_6=e=>{const{totalUnreadCount:t}=FK();return Z(Tt,{get when(){return e.renderBell},get fallback(){return Z(yG,{get unreadCount(){return t()}})},get children(){return Z(g6,{render:n=>e.renderBell(n,t())})}})},bG=Le('<div class="nt-flex nt-shrink-0 nt-justify-center nt-items-center nt-gap-1 nt-mt-auto nt-pt-9 nt-pb-3 nt-text-foreground-alpha-200"><span class=nt-text-xs>Powered by Novu'),EG=()=>{const{hideBranding:e}=dr();return Z(Tt,{get when(){return!e()},get children(){var t=bG(),n=t.firstChild;return Ie(t,Z(sG,{}),n),t}})},_G=Le("<button>"),T6=Sq("nt-inline-flex nt-gap-4 nt-items-center nt-justify-center nt-whitespace-nowrap nt-rounded-lg nt-text-sm nt-font-medium nt-ring-offset-background nt-transition-colors focus-visible:nt-outline-none focus-visible:nt-ring-2 focus-visible:nt-ring-primary nt-focus-visible:nt-ring-offset-2 disabled:nt-pointer-events-none disabled:nt-opacity-50",{variants:{variant:{default:"nt-bg-primary nt-text-primary-foreground hover:nt-bg-primary-alpha-900",secondary:"nt-bg-secondary nt-text-secondary-foreground hover:nt-bg-secondary-alpha-800",icon:"nt-text-secondary-foreground-alpha-500 hover:nt-bg-neutral-alpha-50",ghost:"hover:nt-bg-neutral-alpha-50",unstyled:""},size:{none:"",icon:"nt-p-1",default:"nt-h-8 nt-px-3",sm:"nt-h-7 nt-rounded-md nt-px-3",lg:"nt-h-10 nt-px-8"}},defaultVariants:{variant:"default",size:"default"}}),yr=e=>{const[t,n]=wn(e,["class","appearanceKey"]),r=ft();return(()=>{var i=_G();return Ft(i,At({get"data-variant"(){return e.variant},get"data-size"(){return e.size},get class(){return r(t.appearanceKey||"button",Bn(T6({variant:e.variant,size:e.size}),t.class))}},n),!1,!1),i})()},TG=Le("<button>"),CG=e=>{const{onClose:t}=Yc(),[n,r]=wn(e,["onClick","asChild"]),i=a=>{typeof n.onClick=="function"&&n.onClick(a),t()};return n.asChild?Z(Fh,At({get component(){return n.asChild},onClick:i},r)):(()=>{var a=TG();return a.$$click=i,Ft(a,r,!1,!1),a})()};zl(["click"]);var C6=new Proxy(WE,{get:(e,t)=>n=>{const{animations:r}=Gy();return Z(WE,At(n,{tag:t,get transition(){return r()?n.transition:{duration:0}}}))}}),x6=vi(void 0);function xG(e){var t;const[n,r]=Me((t=e.open)!=null?t:!1),i=()=>{var m;return(m=e.onOpenChange)!=null?m:r},a=()=>{var m;return(m=e.open)!=null?m:n()},[o,s]=Me(null),[l,u]=Me(null),c=o6(o,l,{placement:e.placement||"bottom-start",whileElementsMounted:(m,p,y)=>n6(m,p,y,{elementResize:!1,ancestorScroll:!1,animationFrame:!1,layoutShift:!1}),middleware:[r6(10),a6({fallbackPlacements:e.fallbackPlacements||["top-start"]}),i6()]}),d=He(()=>{var m,p;return{position:c.strategy,top:`${(m=c.y)!=null?m:0}px`,left:`${(p=c.x)!=null?p:0}px`}}),f=()=>{i()(!1)},h=()=>{i()(m=>!m)};return Z(x6.Provider,{value:{onToggle:h,onClose:f,reference:o,setReference:s,floating:l,setFloating:u,open:a,floatingStyles:d},get children(){return e.children}})}function Yc(){const e=lr(x6);if(!e)throw new Error("usePopover must be used within Popover.Root component");return e}var wG=()=>Bn("nt-w-[400px] nt-h-[600px] nt-rounded-xl nt-bg-background","nt-shadow-popover nt-z-10 nt-cursor-default nt-flex nt-flex-col nt-overflow-hidden"),n4=e=>{const{open:t,setFloating:n,floating:r,floatingStyles:i}=Yc(),{setActive:a,removeActive:o}=Yy(),[s,l]=wn(e,["class","appearanceKey","style"]),u=ft();return sr(()=>{const c=r();a(c),dn(()=>{o(c)})}),Z(C6.div,At({ref:n,get class(){return He(()=>!!s.class)()?s.class:u(s.appearanceKey||"popoverContent",wG())},get style(){return i()},get"data-open"(){return t()},animate:{opacity:[0,1],y:[-6,0]},transition:{duration:.1,easing:"ease-out"}},l))},AG=e=>{const[t,n]=wn(e,["portal"]),{open:r,onClose:i,reference:a,floating:o}=Yc(),{active:s}=Yy(),l=c=>{var d,f;(d=a())!=null&&d.contains(c.target)||s()!==o()||(f=o())!=null&&f.contains(c.target)||i()},u=c=>{s()===o()&&c.key==="Escape"&&i()};return sr(()=>{document.body.addEventListener("click",l),document.body.addEventListener("keydown",u)}),dn(()=>{document.body.removeEventListener("click",l),document.body.removeEventListener("keydown",u)}),Z(Tt,{get when(){return r()},get children(){return Z(Tt,{get when(){return t.portal},get fallback(){return Z(n4,n)},get children(){return Z(jy,{get children(){return Z(Xy,{get children(){return Z(n4,n)}})}})}})}})},kG=Le("<button>"),SG=e=>{const{setReference:t,onToggle:n}=Yc(),r=ft(),[i,a]=wn(e,["appearanceKey","asChild","onClick"]),o=s=>{typeof i.onClick=="function"&&i.onClick(s),n()};return i.asChild?Z(Fh,At({get component(){return i.asChild},ref:t,onClick:o},a)):(()=>{var s=kG();return s.$$click=o,Ca(t,s),Ft(s,At({get class(){return r(i.appearanceKey||"dropdownTrigger")}},a),!1,!0),Ie(s,()=>e.children),s})()};zl(["click"]);var ro={Root:xG,Trigger:SG,Content:AG,Close:CG},DG=()=>"nt-w-max nt-rounded-xl nt-p-1 nt-overflow-hidden nt-flex nt-flex-col nt-min-w-52 nt-shadow-dropdown nt-z-10 nt-bg-background",OG=e=>{const t=ft(),[n,r]=wn(e,["appearanceKey"]);return Z(ro.Content,At({get class(){return t(n.appearanceKey||"dropdownContent",DG())}},r))},zh=()=>"focus:nt-outline-none nt-rounded-lg nt-items-center hover:nt-bg-neutral-alpha-50 focus-visible:nt-bg-neutral-alpha-50 nt-py-1 nt-px-3",NG=e=>{const t=ft(),[n,r]=wn(e,["appearanceKey","onClick","class"]),{onClose:i}=Yc();return Z(ro.Close,At({get class(){return He(()=>!!n.class)()?n.class:t(n.appearanceKey||"dropdownItem",zh())},onClick:a=>{typeof n.onClick=="function"&&n.onClick(a),i()}},r))},IG=e=>Z(ro.Root,At({placement:"bottom",fallbackPlacements:["top"]},e)),PG=()=>"nt-relative nt-transition nt-outline-none focus-visible:nt-outline-nonefocus-visible:nt-ring-2 focus-visible:nt-ring-primary focus-visible:nt-ring-offset-2",RG=e=>{const t=ft(),[n,r]=wn(e,["appearanceKey"]);return Z(ro.Trigger,At({get class(){return t(n.appearanceKey||"dropdownTrigger",PG())}},r))},Ur={Root:IG,Trigger:RG,Content:OG,Close:ro.Close,Item:NG},FG=Le("<div role=tablist>"),MG=Le('<div class="nt-border-t nt-border-secondary nt-mt-[-0.25rem] nt-relative nt-z-[-1]">'),BG=()=>"nt-flex nt-gap-6 nt-px-6 nt-py-1 nt-overflow-hidden",LG=e=>{const[t,n]=wn(e,["class","appearanceKey","ref","children"]),r=ft();return[(()=>{var i=FG(),a=t.ref;return typeof a=="function"?Ca(a,i):t.ref=i,Ft(i,At({get class(){return He(()=>!!t.class)()?t.class:r(t.appearanceKey||"tabsList",BG())}},n),!1,!0),Ie(i,()=>t.children),i})(),MG()]},$G=({activeTab:e,setActiveTab:t,tabsContainer:n})=>{const[r,i]=Me(!1);cn(()=>{const a=o=>{var s;if(o.key!=="Tab")return;const l=(s=n())==null?void 0:s.querySelectorAll('[role="tab"]');!l||!document.activeElement||i(Array.from(l).includes(document.activeElement))};return document.addEventListener("keyup",a),dn(()=>document.removeEventListener("keyup",a))}),cn(()=>{const a=o=>{var s,l;if(!r()||o.key!=="ArrowLeft"&&o.key!=="ArrowRight")return;const u=Array.from((l=(s=n())==null?void 0:s.querySelectorAll('[role="tab"]'))!=null?l:[]),c=u.map(p=>p.id),d=c.indexOf(e()),{length:f}=c;let h=d,m=e();o.key==="ArrowLeft"?(h=d===0?f-1:d-1,m=c[h]):o.key==="ArrowRight"&&(h=d===f-1?0:d+1,m=c[h]),u[h].focus(),t(m)};return document.addEventListener("keydown",a),dn(()=>document.removeEventListener("keydown",a))})},jG=Le("<div>"),w6=vi(void 0),A6=()=>{const e=lr(w6);if(!e)throw new Error("useTabsContext must be used within an TabsContext.Provider");return e},k6=()=>"nt-flex nt-flex-col",HG=e=>{var t;const[n,r]=wn(e,["defaultValue","value","class","appearanceKey","onChange","children"]),[i,a]=Me(),[o,s]=Me([]),[l,u]=Me((t=n.defaultValue)!=null?t:""),c=ft();return $G({tabsContainer:i,activeTab:l,setActiveTab:u}),cn(()=>{n.value&&u(n.value)}),cn(()=>{var d;(d=n.onChange)==null||d.call(n,l())}),Z(w6.Provider,{value:{activeTab:l,setActiveTab:u,visibleTabs:o,setVisibleTabs:s},get children(){var d=jG();return Ca(a,d),Ft(d,At({get class(){return He(()=>!!n.class)()?n.class:c(n.appearanceKey||"tabsRoot",k6())}},r),!1,!0),Ie(d,()=>n.children),d}})},UG=Le("<div role=tabpanel>"),zG=e=>{const[t,n]=wn(e,["value","class","appearanceKey","children"]),r=ft(),{activeTab:i}=A6();return Z(Tt,{get when(){return i()===t.value},get children(){var a=UG();return Ft(a,At({get class(){return He(()=>!!t.class)()?t.class:r(t.appearanceKey||"tabsContent",i()===t.value?"nt-block":"nt-hidden")},get id(){return`tabpanel-${t.value}`},get"aria-labelledby"(){return t.value},get"data-state"(){return i()===t.value?"active":"inactive"}},n),!1,!0),Ie(a,()=>t.children),a}})},S6=()=>"nt-relative nt-transition nt-outline-none nt-text-foreground-alpha-600 focus-visible:nt-outline-none focus-visible:nt-ring-2 focus-visible:nt-ring-primary focus-visible:nt-ring-offset-2 nt-pb-[0.625rem] after:nt-absolute after:nt-content-[''] after:nt-bottom-0 after:nt-left-0 after:nt-w-full after:nt-h-[2px] after:nt-border-b-2 data-[state=active]:after:nt-border-primary data-[state=active]:nt-text-foreground after:nt-border-b-transparent",VG=e=>{const[t,n]=wn(e,["value","class","appearanceKey","ref","onClick","children"]),r=ft(),{activeTab:i,setActiveTab:a}=A6(),o=()=>a(t.value);return Z(yr,At({variant:"unstyled",size:"none",ref(s){var l=t.ref;typeof l=="function"?l(s):t.ref=s},get id(){return t.value},get appearanceKey(){var s;return(s=t.appearanceKey)!=null?s:"tabsTrigger"},get class(){return He(()=>!!t.class)()?t.class:r(t.appearanceKey||"tabsTrigger",S6())},get onClick(){var s;return(s=t.onClick)!=null?s:o},role:"tab",tabIndex:0,get"aria-selected"(){return i()===t.value},get"aria-controls"(){return`tabpanel-${t.value}`},get"data-state"(){return i()===t.value?"active":"inactive"}},n,{get children(){return t.children}}))},Uu={Root:HG,List:LG,Trigger:VG,Content:zG},qG={unreadRead:"inbox.filters.dropdownOptions.default",unread:"inbox.filters.dropdownOptions.unread",archived:"inbox.filters.dropdownOptions.archived"},r4={unreadRead:"inbox.filters.labels.default",unread:"inbox.filters.labels.unread",archived:"inbox.filters.labels.archived"},WG=Le("<span><span></span><span>"),KG=Le("<span>"),GG=[{status:"unreadRead",icon:aG},{status:"unread",icon:E6},{status:"archived",icon:Zy}],YG=e=>Z(Wi,{each:GG,children:t=>Z(ZG,{get localizationKey(){return qG[t.status]},onClick:()=>{e.setStatus(t.status)},get isSelected(){return e.status===t.status},get icon(){return t.icon}})}),ZG=e=>{const t=ft(),{t:n}=go();return Z(Ur.Item,{get class(){return t("inboxStatus__dropdownItem",Bn(zh(),"nt-flex nt-gap-8 nt-justify-between"))},get onClick(){return e.onClick},get children(){return[(()=>{var r=WG(),i=r.firstChild,a=i.nextSibling;return Ie(i,()=>e.icon()),Ie(a,()=>n(e.localizationKey)),ct(o=>{var s=t("inboxStatus__dropdownItemLabelContainer","nt-flex nt-gap-2 nt-items-center"),l=t("inboxStatus__dropdownItemLeft__icon"),u=e.localizationKey,c=t("inboxStatus__dropdownItemLabel");return s!==o.e&&Ze(r,o.e=s),l!==o.t&&Ze(i,o.t=l),u!==o.a&&er(a,"data-localization",o.a=u),c!==o.o&&Ze(a,o.o=c),o},{e:void 0,t:void 0,a:void 0,o:void 0}),r})(),Z(Tt,{get when(){return e.isSelected},get children(){var r=KG();return Ie(r,Z(v6,{})),ct(()=>Ze(r,t("inboxStatus__dropdownItemRight__icon"))),r}})]}})},i4=Le("<span>"),QG=()=>{const e=ft(),{status:t,setStatus:n}=dr(),{t:r}=go();return Z(Ur.Root,{get children(){return[Z(Ur.Trigger,{get class(){return e("inboxStatus__dropdownTrigger",Bn(T6({variant:"unstyled",size:"none"}),"nt-gap-2"))},asChild:i=>Z(yr,At({variant:"unstyled",size:"none"},i,{get children(){return[(()=>{var a=i4();return Ie(a,()=>r(r4[t()])),ct(o=>{var s=r4[t()],l=e("inboxStatus__title","nt-text-xl nt-font-semibold");return s!==o.e&&er(a,"data-localization",o.e=s),l!==o.t&&Ze(a,o.t=l),o},{e:void 0,t:void 0}),a})(),(()=>{var a=i4();return Ie(a,Z(Qy,{})),ct(()=>Ze(a,e("inboxStatus__dropdownItemRight__icon","nt-text-foreground-alpha-600"))),a})()]}}))}),Z(Ur.Content,{appearanceKey:"inboxStatus__dropdownContent",get children(){return Z(YG,{setStatus:n,get status(){return t()}})}})]}})},XG=e=>{const t=vo();let n=Ye({},e.options());const[r,{initialLoading:i,setEl:a,end:o,mutate:s,reset:l}]=mK(c=>Ve(void 0,null,function*(){var d,f;const{data:h}=yield t.notifications.list(an(Ye({},e.options()||{}),{offset:c}));return{data:(d=h==null?void 0:h.notifications)!=null?d:[],hasMore:(f=h==null?void 0:h.hasMore)!=null?f:!1}}));return sr(()=>{const c=({data:f})=>{!f||!Nf(n,f.filter)||s({data:f.notifications,hasMore:f.hasMore})},d=t.on("notifications.list.updated",c);dn(()=>d())}),cn(()=>{const c=Ye({},e.options());Nf(n,c)||(t.notifications.clearCache(),l(),n=c)}),{data:r,initialLoading:i,setEl:a,end:o,refetch:({filter:c})=>{t.notifications.clearCache({filter:c}),l()}}},JG=e=>{const t=vo(),[n,r]=Me(!0),[i,{mutate:a,refetch:o}]=p7(e||{},s=>Ve(void 0,[s],function*({tags:l}){try{return(yield t.preferences.list({tags:l})).data}catch(u){throw console.error("Error fetching preferences:",u),u}}));return sr(()=>{const s=({data:u})=>{u&&a(u)},l=t.on("preferences.list.updated",s);dn(()=>l())}),cn(()=>{r(i.loading)}),{preferences:i,loading:n,mutate:a,refetch:o}},eY=e=>{const t=vo();return{readAll:(...r)=>Ve(void 0,[...r],function*({tags:i}={}){var a,o;try{yield t.notifications.readAll({tags:i}),(a=e==null?void 0:e.onSuccess)==null||a.call(e)}catch(s){(o=void 0)==null||o.call(e,s)}})}},tY=e=>{const t=vo();return{archiveAll:(...r)=>Ve(void 0,[...r],function*({tags:i}={}){var a,o;try{yield t.notifications.archiveAll({tags:i}),(a=e==null?void 0:e.onSuccess)==null||a.call(e)}catch(s){(o=void 0)==null||o.call(e,s)}})}},nY=e=>{const t=vo();return{archiveAllRead:(...r)=>Ve(void 0,[...r],function*({tags:i}={}){var a,o;try{yield t.notifications.archiveAllRead({tags:i}),(a=e==null?void 0:e.onSuccess)==null||a.call(e)}catch(s){(o=void 0)==null||o.call(e,s)}})}},a4=Le("<span>"),rY=()=>{const{filter:e}=dr(),{readAll:t}=eY(),{archiveAll:n}=tY(),{archiveAllRead:r}=nY();return[Z($m,{localizationKey:"notifications.actions.readAll",onClick:()=>t({tags:e().tags}),icon:b6}),Z($m,{localizationKey:"notifications.actions.archiveAll",onClick:()=>n({tags:e().tags}),icon:Zy}),Z($m,{localizationKey:"notifications.actions.archiveRead",onClick:()=>r({tags:e().tags}),icon:VK})]},$m=e=>{const t=ft(),{t:n}=go();return Z(Ur.Item,{get class(){return t("moreActions__dropdownItem",Bn(zh(),"nt-flex nt-gap-2"))},get onClick(){return e.onClick},get children(){return[(()=>{var r=a4();return Ie(r,()=>e.icon()),ct(()=>Ze(r,t("moreActions__dropdownItemLeft__icon","nt-text-foreground-alpha-600"))),r})(),(()=>{var r=a4();return Ie(r,()=>n(e.localizationKey)),ct(i=>{var a=e.localizationKey,o=t("moreActions__dropdownItemLabel");return a!==i.e&&er(r,"data-localization",i.e=a),o!==i.t&&Ze(r,i.t=o),i},{e:void 0,t:void 0}),r})()]}})},iY=()=>{const e=ft(),{status:t}=dr();return Z(Tt,{get when(){return t()!=="archived"},get children(){return Z(Ur.Root,{get children(){return[Z(Ur.Trigger,{get class(){return e("moreActions__dropdownTrigger")},asChild:n=>Z(yr,At({variant:"icon",size:"icon"},n,{get children(){return Z(y6,{get class(){return e("moreActions__dots")}})}}))}),Z(Ur.Content,{appearanceKey:"moreActions__dropdownContent",get children(){return Z(rY,{})}})]}})}})},aY=Le("<div>"),oY=e=>{const t=ft();return(()=>{var n=aY();return Ie(n,Z(iY,{}),null),Ie(n,Z(Tt,{get when(){return e.showPreferences},children:r=>Z(yr,{appearanceKey:"preferences__button",variant:"icon",size:"icon",get onClick(){return r()},get children(){return Z(fG,{})}})}),null),ct(()=>Ze(n,t("moreActionsContainer","nt-flex nt-gap-2"))),n})()},sY=Le("<div>"),lY=e=>{const t=ft();return(()=>{var n=sY();return Ie(n,Z(QG,{}),null),Ie(n,Z(oY,{get showPreferences(){return e.navigateToPreferences}}),null),ct(()=>Ze(n,t("inboxHeader",Bn("nt-flex nt-shrink-0 nt-justify-between nt-items-center nt-w-full nt-py-5 nt-px-6")))),n})()},uY=Le("<div><div data-localization=preferences.title>"),cY=Le("<button>"),dY=e=>{const t=ft(),{t:n}=go();return(()=>{var r=uY(),i=r.firstChild;return Ie(r,Z(Tt,{get when(){return e.navigateToNotifications},children:a=>(()=>{var o=cY();return _7(o,"click",a(),!0),Ie(o,Z(KK,{})),ct(()=>Ze(o,t("preferencesHeader__back__button","nt-h-6 nt-w-6 nt-flex nt-justify-center nt-items-center nt-rounded-md nt-relative hover:nt-bg-foreground-alpha-50 focus:nt-bg-foreground-alpha-50 nt-text-foreground-alpha-600"))),o})()}),i),Ie(i,()=>n("preferences.title")),ct(a=>{var o=t("preferencesHeader","nt-flex nt-items-center nt-py-5 nt-px-6 nt-gap-2"),s=t("preferencesHeader__title","nt-text-xl nt-font-semibold");return o!==a.e&&Ze(r,a.e=o),s!==a.t&&Ze(i,a.t=s),a},{e:void 0,t:void 0}),r})()};zl(["click"]);var fY=Le("<div>"),Xy=e=>{const[t,n]=wn(e,["class"]),{id:r}=Gy(),i=ft(),{hideBranding:a}=dr();return[Z(Tt,{get when(){return!a()},children:new Comment(" Powered by Novu - https://novu.co ")}),(()=>{var o=fY();return Ft(o,At({get id(){return`novu-root-${r()}`},get class(){return i("root"),Bn("novu",r(),"nt-text-foreground nt-h-full")}},n),!1,!1),o})()]},hY=Le('<label><input type=checkbox class="nt-peer nt-sr-only"><div>'),pY=e=>{const t=ft();return(()=>{var n=hY(),r=n.firstChild,i=r.nextSibling;return r.addEventListener("change",a=>{e.onChange(a.target.checked)}),ct(a=>{var o=t("channelSwitch","nt-relative nt-inline-flex nt-cursor-pointer nt-items-center"),s=t("channelSwitchThumb","nt-peer nt-h-6 nt-w-11 nt-rounded-full nt-border nt-border-neutral-alpha-200 peer-checked:nt-border-neutral-alpha-400 nt-bg-neutral-alpha-300 after:nt-absolute after:nt-left-[2px] after:nt-top-0.5 after:nt-h-5 after:nt-w-5 after:nt-rounded-full after:nt-border after:nt-border-neutral-alpha-400 after:nt-bg-background after:nt-transition-all after:nt-content-[''] peer-checked:nt-bg-primary peer-checked:after:nt-translate-x-full peer-checked:after:nt-border-background nt-transition-all nt-duration-200 after:nt-duration-200"),l=e.checked;return o!==a.e&&Ze(n,a.e=o),s!==a.t&&Ze(i,a.t=s),l!==a.a&&er(i,"data-checked",a.a=l),a},{e:void 0,t:void 0,a:void 0}),ct(()=>r.checked=e.checked),n})()},mY=Le("<div><div><div></div><span></span></div><div>"),gY=e=>{const t=ft(),n=i=>Ve(void 0,null,function*(){e.onChange({channel:e.channel,enabled:i,workflowId:e.workflowId})}),r=i=>{n(i)};return(()=>{var i=mY(),a=i.firstChild,o=a.firstChild,s=o.nextSibling,l=a.nextSibling;return Ie(o,Z(vY,{get channel(){return e.channel}})),Ie(s,()=>D6(e.channel)),Ie(l,Z(pY,{get checked(){return e.enabled},onChange:u=>r(u)})),ct(u=>{var c=t("channelContainer","nt-flex nt-justify-between nt-items-center nt-h-11 nt-gap-2 data-[disabled=true]:nt-text-foreground-alpha-600"),d=t("channelLabelContainer","nt-flex nt-items-center nt-gap-2"),f=t("channelLabel","nt-text-base nt-font-semibold"),h=t("channelSwitchContainer","nt-flex nt-items-center");return c!==u.e&&Ze(i,u.e=c),d!==u.t&&Ze(a,u.t=d),f!==u.a&&Ze(s,u.a=f),h!==u.o&&Ze(l,u.o=h),u},{e:void 0,t:void 0,a:void 0,o:void 0}),i})()},vY=e=>{switch(e.channel){case"in_app":return Z(rG,{});case"email":return Z(tG,{});case"push":return Z(uG,{});case"sms":return Z(pG,{});case"chat":return Z(QK,{});default:return null}},D6=e=>{switch(e){case"in_app":return"In-App";case"email":return"Email";case"push":return"Push";case"sms":return"SMS";case"chat":return"Chat";default:return""}},O6=Le("<div>"),jo=e=>{const t=ft();return(()=>{var n=O6();return ct(()=>Ze(n,t(e.appearanceKey,Bn("nt-w-full nt-h-3 nt-rounded nt-bg-foreground-alpha-100",e.class)))),n})()},yY=e=>{const t=ft();return(()=>{var n=O6();return ct(()=>Ze(n,t(e.appearanceKey,Bn("nt-size-8 nt-rounded-lg nt-bg-foreground-alpha-100",e.class)))),n})()},bY=Le('<div><div class="nt-flex nt-flex-col nt-self-stretch nt-gap-1 nt-flex-1"></div><div>'),EY=()=>Z(Wi,{get each(){return Array.from({length:8})},children:()=>Z(_Y,{})}),_Y=()=>{const e=ft();return(()=>{var t=bY(),n=t.firstChild,r=n.nextSibling;return Ie(n,Z(jo,{appearanceKey:"skeletonText",class:"nt-w-1/3"}),null),Ie(n,Z(jo,{appearanceKey:"skeletonText",class:"nt-w-1/3"}),null),Ie(r,Z(Qy,{})),ct(()=>Ze(t,e("preferencesLoadingContainer","nt-p-4 nt-flex nt-gap-1 nt-items-center nt-self-stretch nt-animate-pulse"))),t})()},Jy=Le("<div>"),TY=Le("<span>"),CY=Le("<div><div><div><div></div></div><span>"),xY=()=>{var e;const t=ft(),{preferencesFilter:n}=dr(),{preferences:r,loading:i}=JG({tags:(e=n())==null?void 0:e.tags}),a=He(()=>{var s,l;const u=(s=r())==null?void 0:s.find(f=>f.level==="global"),c=(l=r())==null?void 0:l.filter(f=>f.level==="template"),d=c==null?void 0:c.map(f=>{var h;return(h=f.workflow)==null?void 0:h.id});return{globalPreference:u,workflowPreferences:c,workflowPreferencesIds:d}});cn(()=>{pK(s=>{var l;return Ye(Ye({},s),(l=a().workflowPreferences)==null?void 0:l.reduce((u,c)=>(u[c.workflow.identifier]=c.workflow.name,u),{}))})});const o=s=>({channel:l,enabled:u})=>{s==null||s.update({channelPreferences:{[l]:u}})};return(()=>{var s=Jy();return Ie(s,Z(Tt,{get when(){return i()},get children(){return Z(EY,{})}}),null),Ie(s,Z(Tt,{get when(){return He(()=>!i())()&&r()},get children(){return[Z(o4,{localizationKey:"preferences.global",get channels(){var l;return((l=a().globalPreference)==null?void 0:l.channels)||{}},get onChange(){return o(a().globalPreference)}}),Z(Wi,{get each(){return a().workflowPreferencesIds},children:(l,u)=>{const c=()=>{var d;return(d=a().workflowPreferences)==null?void 0:d[u()]};return c()?Z(o4,{get localizationKey(){return c().workflow.identifier},get channels(){return c().channels},get workflowId(){var d;return(d=c().workflow)==null?void 0:d.id},get onChange(){return o(c())}}):null}})]}}),null),ct(()=>Ze(s,t("preferencesContainer","nt-p-2 nt-flex nt-flex-col nt-gap-1 nt-bg-background nt-overflow-y-auto nt-h-full"))),s})()},wY=e=>{const t=ft(),n=()=>{const r=[];for(const i in e.channels)if(e.channels[i]!==void 0){const a=!e.channels[i],o=(()=>{var s=TY();return er(s,"data-disabled",a),Ie(s,()=>D6(i)),ct(()=>Ze(s,t("channelName","data-[disabled=true]:nt-text-foreground-alpha-400"))),s})();r.push(o)}return r.map((i,a)=>[i,He(()=>a<r.length-1&&", ")])};return(()=>{var r=Jy();return Ie(r,n),ct(()=>Ze(r,t("channelDescription","nt-text-sm nt-text-foreground-alpha-600 nt-text-start"))),r})()},o4=e=>{const[t,n]=Me(!1),r=ft(),{t:i}=go(),a=He(()=>Object.keys(e.channels||{}));return Z(Tt,{get when(){return a().length>0},get children(){var o=CY(),s=o.firstChild,l=s.firstChild,u=l.firstChild,c=l.nextSibling;return s.$$click=()=>n(d=>!d),Ie(u,()=>i(e.localizationKey)),Ie(l,Z(wY,{get channels(){return e.channels}}),null),Ie(c,Z(Qy,{get class(){return r("workflowArrow__icon","nt-text-foreground-alpha-600")}})),Ie(o,Z(SW,{exitBeforeEnter:!0,get children(){return Z(Tt,{get when(){return t()},get children(){return Z(C6.div,{animate:{gridTemplateRows:["0fr","1fr"]},exit:{gridTemplateRows:["1fr","0fr"]},transition:{duration:.2,easing:"ease-out"},get class(){return r("channelsContainerCollapsible","nt-grid nt-self-stretch")},get children(){var d=Jy();return Ie(d,Z(Wi,{get each(){return a()},children:f=>Z(gY,{channel:f,get enabled(){return!!e.channels[f]},get workflowId(){return e.workflowId},get onChange(){return e.onChange}})})),ct(()=>Ze(d,r("channelsContainer","nt-overflow-hidden nt-flex-col nt-gap-1"))),d}})}})}}),null),ct(d=>{var f=r("workflowContainer","nt-p-4 nt-flex nt-flex-col nt-gap-1 nt-items-start nt-self-stretch hover:nt-bg-neutral-alpha-50 nt-rounded-lg data-[disabled=true]:nt-bg-neutral-alpha-50"),h=t(),m=r("workflowLabelContainer","nt-flex nt-justify-between nt-flex-nowrap nt-self-stretch nt-cursor-pointer nt-items-center"),p=t(),y=r("workflowLabel","nt-text-base nt-font-semibold nt-text-start nt-flex nt-items-center nt-gap-1"),v=e.localizationKey,b=t(),_=r("workflowContainerRight__icon","nt-text-foreground-alpha-600 nt-transition-all nt-duration-200 data-[open=true]:nt-transform data-[open=true]:nt-rotate-180"),T=t();return f!==d.e&&Ze(o,d.e=f),h!==d.t&&er(o,"data-open",d.t=h),m!==d.a&&Ze(s,d.a=m),p!==d.o&&er(s,"data-open",d.o=p),y!==d.i&&Ze(u,d.i=y),v!==d.n&&er(u,"data-localization",d.n=v),b!==d.s&&er(u,"data-open",d.s=b),_!==d.h&&Ze(c,d.h=_),T!==d.r&&er(c,"data-open",d.r=T),d},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0}),o}})};zl(["click"]);var AY=Le("<strong>"),kY=Le("<p>"),SY=e=>{const t=ft();return(()=>{var n=AY();return Ie(n,()=>e.children),ct(()=>Ze(n,t(e.appearanceKey||"strong","nt-font-semibold"))),n})()},DY=e=>e.children,OY=e=>{const t=e,{children:n,strongAppearanceKey:r}=t,i=Dy(t,["children","strongAppearanceKey"]),a=He(()=>aV(n));return(()=>{var o=kY();return Ft(o,i,!1,!0),Ie(o,Z(Wi,{get each(){return a()},children:s=>s.type==="bold"?Z(SY,{appearanceKey:r,get children(){return s.content}}):Z(DY,{get children(){return s.content}})})),o})()},s4=OY,N6=vi(void 0);function NY(e){const[t,n]=Me(null),[r,i]=Me(null),a=o6(t,r,{placement:e.placement||"top",whileElementsMounted:n6,middleware:[r6(10),a6({fallbackPlacements:e.fallbackPlacements||["bottom"]}),i6()]}),[o,s]=xK({value:e.open,fallbackValue:!1});return Z(N6.Provider,{value:{reference:t,setReference:n,floating:r,setFloating:i,open:o,setOpen:s,floatingStyles:()=>{var l,u;return{position:a.strategy,top:`${(l=a.y)!=null?l:0}px`,left:`${(u=a.x)!=null?u:0}px`}}},get children(){return e.children}})}function e9(){const e=lr(N6);if(!e)throw new Error("useTooltip must be used within Tooltip.Root component");return e}var IY=Le("<div>"),PY=()=>"nt-bg-foreground nt-p-2 nt-shadow-tooltip nt-rounded-lg nt-text-background nt-text-xs",RY=e=>{const{open:t,setFloating:n,floating:r,floatingStyles:i}=e9(),{setActive:a,removeActive:o}=Yy(),[s,l]=wn(e,["class","appearanceKey","style"]),u=ft();return sr(()=>{const c=r();a(c),dn(()=>{o(c)})}),(()=>{var c=IY();return Ca(n,c),Ft(c,At({get class(){return He(()=>!!s.class)()?s.class:u(s.appearanceKey||"tooltipContent",PY())},get style(){return an(Ye({},i()),{"z-index":99999})},get"data-open"(){return t()}},l),!1,!1),c})()},FY=e=>{const{open:t}=e9();return Z(Tt,{get when(){return t()},get children(){return Z(jy,{get children(){return Z(Xy,{get children(){return Z(RY,e)}})}})}})},MY=Le("<button>"),BY=e=>{const{setReference:t,setOpen:n}=e9(),r=ft(),[i,a]=wn(e,["appearanceKey","asChild","onClick"]);return i.asChild?Z(Fh,At({get component(){return i.asChild},ref:t,onMouseEnter:()=>{n(!0)},onMouseLeave:()=>{n(!1)}},a)):(()=>{var o=MY();return o.addEventListener("mouseleave",()=>{n(!1)}),o.addEventListener("mouseenter",()=>{n(!0)}),Ca(t,o),Ft(o,At({get class(){return r(i.appearanceKey||"tooltipTrigger")}},a),!1,!0),Ie(o,()=>e.children),o})()},Dr={Root:NY,Trigger:BY,Content:FY},LY=Le("<span>"),$Y=Le("<img>"),jY=Le('<a><div><div class="nt-relative nt-shrink-0 nt-float-right nt-ml-1 nt-pr-1.5"><p></p><div></div></div><div>'),HY=e=>{const t=ft(),{t:n,locale:r}=go(),{navigate:i,status:a}=dr(),[o,s]=Me(0),l=He(()=>(o(),vK({fromDate:new Date(e.notification.createdAt),locale:r()})));cn(()=>{const d=setInterval(()=>{s(f=>f+1)},6e4);return()=>clearInterval(d)});const u=d=>{var f,h,m;d.stopPropagation(),d.preventDefault(),e.notification.isRead||e.notification.read(),(f=e.onNotificationClick)==null||f.call(e,e.notification),i((h=e.notification.redirect)==null?void 0:h.url,(m=e.notification.redirect)==null?void 0:m.target)},c=(d,f)=>{var h,m,p,y,v,b,_,T,C,x;f.stopPropagation(),d==="primary"?(e.notification.completePrimary(),(h=e.onPrimaryActionClick)==null||h.call(e,e.notification),i((p=(m=e.notification.primaryAction)==null?void 0:m.redirect)==null?void 0:p.url,(v=(y=e.notification.primaryAction)==null?void 0:y.redirect)==null?void 0:v.target)):(e.notification.completeSecondary(),(b=e.onSecondaryActionClick)==null||b.call(e,e.notification),i((T=(_=e.notification.secondaryAction)==null?void 0:_.redirect)==null?void 0:T.url,(x=(C=e.notification.secondaryAction)==null?void 0:C.redirect)==null?void 0:x.target))};return(()=>{var d=jY(),f=d.firstChild,h=f.firstChild,m=h.firstChild,p=m.nextSibling,y=h.nextSibling;return d.$$click=u,Ie(d,Z(Tt,{get when(){return!e.notification.isRead},get children(){var v=LY();return ct(()=>Ze(v,t("notificationDot","nt-absolute -nt-translate-x-[1.0625rem] nt-translate-y-1/2 nt-size-2.5 nt-bg-primary nt-rounded-full nt-border nt-border-neutral-alpha-200"))),v}}),f),Ie(d,Z(Tt,{get when(){return e.notification.avatar},get children(){var v=$Y();return ct(b=>{var _=t("notificationImage","nt-size-8 nt-rounded-lg"),T=e.notification.avatar;return _!==b.e&&Ze(v,b.e=_),T!==b.t&&er(v,"src",b.t=T),b},{e:void 0,t:void 0}),v}}),f),Ie(m,l),Ie(p,Z(Tt,{get when(){return a()!=="archived"},get children(){return Z(Tt,{get when(){return e.notification.isRead},get fallback(){return Z(Dr.Root,{get children(){return[Z(Dr.Trigger,{asChild:v=>Z(yr,At({appearanceKey:"notificationRead__button",size:"icon",variant:"icon"},v,{onClick:b=>{b.stopPropagation(),e.notification.read()},class:"hover:nt-bg-neutral-alpha-50 nt-p-0.5",get children(){return Z(b6,{})}}))}),Z(Dr.Content,{"data-localization":"notification.actions.read.tooltip",get children(){return n("notification.actions.read.tooltip")}})]}})},get children(){return Z(Dr.Root,{get children(){return[Z(Dr.Trigger,{asChild:v=>Z(yr,At({appearanceKey:"notificationUnread__button",size:"icon",variant:"icon"},v,{onClick:b=>{b.stopPropagation(),e.notification.unread()},class:"hover:nt-bg-neutral-alpha-50 nt-p-0.5",get children(){return Z(E6,{})}}))}),Z(Dr.Content,{"data-localization":"notification.actions.unread.tooltip",get children(){return n("notification.actions.unread.tooltip")}})]}})}})}}),null),Ie(p,Z(Tt,{get when(){return e.notification.isArchived},get fallback(){return Z(Dr.Root,{get children(){return[Z(Dr.Trigger,{asChild:v=>Z(yr,At({appearanceKey:"notificationArchive__button",size:"icon",variant:"icon"},v,{onClick:b=>{b.stopPropagation(),e.notification.archive()},class:"hover:nt-bg-neutral-alpha-50 nt-p-0.5",get children(){return Z(Zy,{})}}))}),Z(Dr.Content,{"data-localization":"notification.actions.archive.tooltip",get children(){return n("notification.actions.archive.tooltip")}})]}})},get children(){return Z(Dr.Root,{get children(){return[Z(Dr.Trigger,{asChild:v=>Z(yr,At({appearanceKey:"notificationUnarchive__button",size:"icon",variant:"icon"},v,{onClick:b=>{b.stopPropagation(),e.notification.unarchive()},class:"hover:nt-bg-neutral-alpha-50 nt-p-0.5",get children(){return Z(gG,{})}}))}),Z(Dr.Content,{"data-localization":"notification.actions.unarchive.tooltip",get children(){return n("notification.actions.unarchive.tooltip")}})]}})}}),null),Ie(f,Z(Tt,{get when(){return e.notification.subject},children:v=>Z(s4,{get class(){return t("notificationSubject","nt-text-start")},strongAppearanceKey:"notificationSubject__strong",get children(){return v()}})}),y),Ie(f,Z(s4,{get class(){return t("notificationBody","nt-text-start")},strongAppearanceKey:"notificationBody__strong",get children(){return e.notification.body}}),y),Ie(y,Z(Tt,{get when(){return e.notification.primaryAction},keyed:!0,children:v=>Z(yr,{appearanceKey:"notificationPrimaryAction__button",variant:"default",onClick:b=>c("primary",b),get children(){return v.label}})}),null),Ie(y,Z(Tt,{get when(){return e.notification.secondaryAction},keyed:!0,children:v=>Z(yr,{appearanceKey:"notificationSecondaryAction__button",variant:"secondary",onClick:b=>c("secondary",b),get children(){return v.label}})}),null),ct(v=>{var b,_=t("notification",Bn("nt-w-full nt-text-sm hover:nt-bg-neutral-alpha-50 nt-group nt-relative nt-flex nt-py-4 nt-px-6 nt-gap-2",{"nt-cursor-pointer":!e.notification.isRead||!!((b=e.notification.redirect)!=null&&b.url)})),T=t("notificationBody","nt-overflow-hidden nt-w-full"),C=t("notificationDate","nt-transition nt-duration-100 nt-ease-out nt-text-foreground-alpha-400 nt-shrink-0 nt-float-right nt-text-right group-hover:nt-opacity-0"),x=t("notificationDefaultActions","nt-transition nt-duration-100 nt-ease-out nt-gap-2 nt-flex nt-shrink-0 nt-opacity-0 group-hover:nt-opacity-100 nt-justify-center nt-items-center nt-absolute nt-top-0 nt-right-0 nt-bg-neutral-alpha-50 nt-rounded-lg nt-backdrop-blur-md nt-p-0.5"),w=t("notificationCustomActions","nt-flex nt-flex-wrap nt-gap-4 nt-mt-4");return _!==v.e&&Ze(d,v.e=_),T!==v.t&&Ze(f,v.t=T),C!==v.a&&Ze(m,v.a=C),x!==v.o&&Ze(p,v.o=x),w!==v.i&&Ze(y,v.i=w),v},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),d})()};zl(["click"]);var UY=e=>Z(Tt,{get when(){return e.renderNotification},get fallback(){return Z(HY,{get notification(){return e.notification},get onNotificationClick(){return e.onNotificationClick},get onPrimaryActionClick(){return e.onPrimaryActionClick},get onSecondaryActionClick(){return e.onSecondaryActionClick}})},get children(){return Z(g6,{render:t=>e.renderNotification(t,e.notification)})}}),zY=Le('<svg xmlns=http://www.w3.org/2000/svg width=48 height=48 viewBox="0 0 48 48"fill=none><path fill=currentColor d="M35.2 21.62L32.38 18.8L39.5 11.7L42.32 14.52C42.1 14.58 35.2 21.62 35.2 21.62ZM26 6H22V16H26V6ZM12.8 21.62L15.62 18.8L8.52 11.68L5.68 14.52C5.9 14.58 12.8 21.62 12.8 21.62ZM40 28H33.16C31.62 31.52 28.08 34 24 34C19.92 34 16.38 31.52 14.84 28H8V38H40V28ZM40 24C42.2 24 44 25.8 44 28V38C44 40.2 42.2 42 40 42H8C5.8 42 4 40.2 4 38V28C4 25.8 5.8 24 8 24H18C18 27.32 20.68 30 24 30C27.32 30 30 27.32 30 24H40Z">');function VY(e){return(()=>{var t=zY();return Ft(t,e,!0,!0),t})()}var qY=e=>{const t=He(()=>!!e.count),{t:n}=go();return Z(Tt,{get when(){return t()},get children(){return Z(yr,{appearanceKey:"notificationListNewNotificationsNotice__button",class:"nt-absolute nt-w-fit nt-top-0 nt-mx-auto nt-inset-2 nt-z-10 nt-rounded-full hover:nt-bg-primary-600 nt-animate-in nt-slide-in-from-top-2 nt-fade-in",get onClick(){return e.onClick},"data-localization":"notifications.newNotifications",get children(){return n("notifications.newNotifications",{notificationCount:e.count})}})}})},WY=Le('<div class="nt-flex nt-gap-2 nt-px-6 nt-py-4 nt-w-full"><div class="nt-flex nt-flex-col nt-self-stretch nt-gap-3 nt-flex-1"><div class="nt-flex nt-gap-1"></div><div class="nt-flex nt-gap-1">'),I6=()=>(()=>{var e=WY(),t=e.firstChild,n=t.firstChild,r=n.nextSibling;return Ie(e,Z(yY,{appearanceKey:"skeletonAvatar"}),t),Ie(t,Z(jo,{appearanceKey:"skeletonText",class:"nt-w-1/4"}),n),Ie(n,Z(jo,{appearanceKey:"skeletonText"}),null),Ie(n,Z(jo,{appearanceKey:"skeletonText"}),null),Ie(r,Z(jo,{appearanceKey:"skeletonText",class:"nt-w-2/3"}),null),Ie(r,Z(jo,{appearanceKey:"skeletonText",class:"nt-w-1/3"}),null),e})(),KY=e=>Z(Wi,{get each(){return Array.from({length:e.count})},children:()=>Z(I6,{})}),GY=Le("<div><p data-localization=notifications.emptyNotice>"),YY=Le("<div>"),ZY=Le("<div><div>"),QY=()=>{const e=ft(),{t}=go();return(()=>{var n=GY(),r=n.firstChild;return Ie(n,Z(VY,{get class(){return e("notificationListEmptyNoticeIcon")}}),r),Ie(r,()=>t("notifications.emptyNotice")),ct(i=>{var a=e("notificationListEmptyNoticeContainer","nt-absolute nt-inset-0 nt-flex nt-flex-col nt-items-center nt-m-auto nt-h-fit nt-w-full nt-text-foreground-alpha-100"),o=e("notificationListEmptyNotice");return a!==i.e&&Ze(n,i.e=a),o!==i.t&&Ze(r,i.t=o),i},{e:void 0,t:void 0}),n})()},P6=e=>{var t,n;const r=He(()=>an(Ye({},e.filter),{limit:e.limit})),i=ft(),{data:a,setEl:o,end:s,refetch:l,initialLoading:u}=XG({options:r}),{count:c,reset:d}=MK({filter:{tags:(n=(t=e.filter)==null?void 0:t.tags)!=null?n:[]}}),{setLimit:f}=dr(),h=He(()=>a().map(y=>y.id));let m;cn(()=>{f(e.limit||f6)});const p=y=>Ve(void 0,null,function*(){y.stopPropagation(),d(),l({filter:e.filter}),m.scrollTo({top:0})});return(()=>{var y=ZY(),v=y.firstChild;return Ie(y,Z(qY,{get count(){return c()},onClick:p}),v),Ca(b=>{m=b},v),Ie(v,Z(Tt,{get when(){return!u()},get fallback(){return Z(KY,{count:8})},get children(){return Z(Tt,{get when(){return a().length>0},get fallback(){return Z(QY,{})},get children(){return[Z(Wi,{get each(){return h()},children:(b,_)=>{const T=()=>a()[_()];return Z(UY,{get notification(){return T()},get renderNotification(){return e.renderNotification},get onNotificationClick(){return e.onNotificationClick},get onPrimaryActionClick(){return e.onPrimaryActionClick},get onSecondaryActionClick(){return e.onSecondaryActionClick}})}}),Z(Tt,{get when(){return!s()},get children(){var b=YY();return Ca(o,b),Ie(b,Z(Wi,{get each(){return Array.from({length:3})},children:()=>Z(I6,{})})),b}})]}})}})),ct(b=>{var _=i("notificationListContainer","nt-relative nt-h-full nt-overflow-hidden"),T=i("notificationList","nt-relative nt-h-full nt-flex nt-flex-col nt-overflow-y-auto");return _!==b.e&&Ze(y,b.e=_),T!==b.t&&Ze(v,b.t=T),b},{e:void 0,t:void 0}),y})()},t9=Le("<span>"),XY=e=>e>=100?"99+":e,n9=e=>{const t=ft(),n=He(()=>XY(e.count));return(()=>{var r=t9();return Ie(r,n),ct(()=>Ze(r,t("notificationsTabsTriggerCount","nt-rounded-full nt-bg-counter nt-px-[6px] nt-text-counter-foreground nt-text-sm"))),r})()},l4=e=>{const{status:t}=dr(),n=ft(),r=p6({filter:{tags:ba(e)}});return Z(Uu.Trigger,{get value(){return e.label},get class(){return n("notificationsTabs__tabsTrigger",Bn(S6(),"nt-flex nt-gap-2",e.class))},get children(){return[(()=>{var i=t9();return Ie(i,()=>e.label),ct(()=>Ze(i,n("notificationsTabsTriggerLabel","nt-text-sm nt-font-medium"))),i})(),Z(Tt,{get when(){return He(()=>t()!=="archived")()&&r()},get children(){return Z(n9,{get count(){return r()}})}})]}})},JY=e=>{const{status:t}=dr(),n=ft(),r=p6({filter:{tags:ba(e)}});return Z(Ur.Item,{get class(){return n("moreTabs__dropdownItem",Bn(zh(),"nt-flex nt-justify-between nt-gap-2"))},get children(){return[(()=>{var i=t9();return Ie(i,()=>e.label),ct(()=>Ze(i,n("moreTabs__dropdownItemLabel","nt-mr-auto"))),i})(),He(()=>e.rightIcon),Z(Tt,{get when(){return He(()=>t()!=="archived")()&&r()},get children(){return Z(n9,{get count(){return r()}})}})]}})},eZ=({tabs:e})=>{const[t,n]=Me(),[r,i]=Me([]),[a,o]=Me([]);return sr(()=>{const s=t();if(!s)return;const l=[...s.querySelectorAll('[role="tab"]')],u=new IntersectionObserver(c=>{let d=c.filter(f=>f.isIntersecting&&f.intersectionRatio===1).map(f=>f.target.id);if(l.length===d.length){i(e.filter(f=>d.includes(f.label))),u.disconnect();return}d=d.slice(0,-1),i(e.filter(f=>d.includes(f.label))),o(e.filter(f=>!d.includes(f.label))),u.disconnect()},{root:s});for(const c of l)u.observe(c)}),{dropdownTabs:a,setTabsList:n,visibleTabs:r}},tZ=()=>"nt-relative after:nt-absolute after:nt-content-[''] after:nt-bottom-0 after:nt-left-0 after:nt-w-full after:nt-h-[2px] after:nt-border-b-2 nt-pb-[0.625rem]",nZ=e=>{const t=ft(),{activeTab:n,status:r,setActiveTab:i,filter:a}=dr(),{dropdownTabs:o,setTabsList:s,visibleTabs:l}=eZ({tabs:e.tabs}),u=BK({filters:o().map(h=>({tags:ba(h)}))}),c=He(()=>o().map(h=>an(Ye({},h),{rightIcon:h.label===n()?Z(v6,{get class(){return t("moreTabs__dropdownItemRight__icon")}}):void 0}))),d=He(()=>u().reduce((h,m)=>h+m,0)),f=He(()=>o().map(h=>h.label).includes(n()));return Z(Uu.Root,{get class(){return t("notificationsTabs__tabsRoot",Bn(k6(),"nt-flex-1 nt-overflow-hidden"))},get value(){return n()},onChange:i,get children(){return[Z(Tt,{get when(){return l().length>0},get fallback(){return Z(Uu.List,{ref:s,appearanceKey:"notificationsTabs__tabsList",get children(){return e.tabs.map(h=>Z(l4,At(h,{class:"nt-invisible"})))}})},get children(){return Z(Uu.List,{appearanceKey:"notificationsTabs__tabsList",get children(){return[He(()=>l().map(h=>Z(l4,h))),Z(Tt,{get when(){return o().length>0},get children(){return Z(Ur.Root,{fallbackPlacements:["bottom","top"],placement:"bottom-start",get children(){return[Z(Ur.Trigger,{appearanceKey:"moreTabs__dropdownTrigger",asChild:h=>Z(yr,At({variant:"unstyled",size:"none",appearanceKey:"moreTabs__button"},h,{get class(){return Bn(tZ(),f()?"after:nt-border-b-primary":"after:nt-border-b-transparent nt-text-foreground-alpha-600")},get children(){return[Z(y6,{get class(){return t("moreTabs__dots")}}),Z(Tt,{get when(){return He(()=>r()!=="archived")()&&d()},get children(){return Z(n9,{get count(){return d()}})}})]}}))}),Z(Ur.Content,{appearanceKey:"moreTabs__dropdownContent",get children(){return Z(Wi,{get each(){return c()},children:h=>Z(JY,At({onClick:()=>i(h.label)},h))})}})]}})}})]}})}}),He(()=>e.tabs.map(h=>Z(Uu.Content,{get value(){return h.label},get class(){return t("notificationsTabs__tabsContent",Bn(n()===h.label?"nt-block":"nt-hidden","nt-flex-1 nt-overflow-hidden"))},get children(){return Z(P6,{get renderNotification(){return e.renderNotification},get onNotificationClick(){return e.onNotificationClick},get onPrimaryActionClick(){return e.onPrimaryActionClick},get onSecondaryActionClick(){return e.onSecondaryActionClick},get filter(){return an(Ye({},a()),{tags:ba(h)})}})}})))]}})},rZ=Le("<div>"),Ho=function(e){return e.Notifications="notifications",e.Preferences="preferences",e}({}),zd=e=>{const[t,n]=Me(e.initialPage||Ho.Notifications),{tabs:r,filter:i}=dr(),a=ft(),o=He(()=>s=>{if(!e.hideNav)return()=>{n(s)}});return(()=>{var s=rZ();return Ie(s,Z(TV,{get children(){return[Z(bE,{get when(){return t()===Ho.Notifications},get children(){return[Z(lY,{get navigateToPreferences(){return o()(Ho.Preferences)}}),Z(Tt,{keyed:!0,get when(){return He(()=>!!r())()&&r().length>0},get fallback(){return Z(P6,{get renderNotification(){return e.renderNotification},get onNotificationClick(){return e.onNotificationClick},get onPrimaryActionClick(){return e.onPrimaryActionClick},get onSecondaryActionClick(){return e.onSecondaryActionClick},get filter(){return i()}})},get children(){return Z(nZ,{get renderNotification(){return e.renderNotification},get onNotificationClick(){return e.onNotificationClick},get onPrimaryActionClick(){return e.onPrimaryActionClick},get onSecondaryActionClick(){return e.onSecondaryActionClick},get tabs(){return r()}})}})]}}),Z(bE,{get when(){return t()===Ho.Preferences},get children(){return[Z(dY,{get navigateToNotifications(){return o()(Ho.Notifications)}}),Z(xY,{})]}})]}}),null),Ie(s,Z(EG,{}),null),ct(()=>Ze(s,a("inboxContent","nt-h-full nt-flex nt-flex-col"))),s})()},iZ=e=>{const t=ft(),{isOpened:n,setIsOpened:r}=dr(),i=()=>{var a;return(a=e==null?void 0:e.open)!=null?a:n()};return Z(ro.Root,{get open(){return i()},onOpenChange:r,get children(){return[Z(ro.Trigger,{asChild:a=>Z(yr,At({get class(){return t("inbox__popoverTrigger")},variant:"ghost",size:"icon"},a,{get children(){return Z(_6,{get renderBell(){return e.renderBell}})}}))}),Z(ro.Content,{appearanceKey:"inbox__popoverContent",portal:!0,get children(){return Z(zd,{get renderNotification(){return e.renderNotification},get onNotificationClick(){return e.onNotificationClick},get onPrimaryActionClick(){return e.onPrimaryActionClick},get onSecondaryActionClick(){return e.onSecondaryActionClick}})}})]}})},aZ={Inbox:iZ,InboxContent:zd,Bell:_6,Notifications:e=>Z(zd,At(e,{hideNav:!0,get initialPage(){return Ho.Notifications}})),Preferences:e=>Z(zd,At(e,{hideNav:!0,get initialPage(){return Ho.Preferences}}))},oZ=e=>{const t=()=>[...e.nodes.keys()];return sr(()=>{const n="novu-default-css";if(document.getElementById(n))return;const i=document.createElement("link");i.id=n,i.rel="stylesheet",i.href=e.cssHref,document.head.insertBefore(i,document.head.firstChild),dn(()=>{const a=document.getElementById(n);a==null||a.remove()})}),Z(IK,{get options(){return e.options},get novu(){return e.novu},get children(){return Z(OK,{get localization(){return e.localization},get children(){return Z(kK,{get id(){return e.novuUI.id},get appearance(){return e.appearance},get children(){return Z(jK,{get children(){return Z(NK,{get tabs(){return e.tabs},get preferencesFilter(){return e.preferencesFilter},get routerPush(){return e.routerPush},get children(){return Z(RK,{get children(){return Z(Wi,{get each(){return t()},children:n=>{const r=()=>e.nodes.get(n);let i;const a=aZ[r().name];return sr(()=>{["Notifications","Preferences"].includes(r().name)&&(n instanceof HTMLElement&&n.classList.add("nt-h-full"),i.classList.add("nt-h-full"))}),Z(jy,{mount:n,ref:o=>{i=o},get children(){return Z(Xy,{get children(){return Z(a,At(()=>r().props))}})}})}})}})}})}})}})}})}})},sZ="2.6.0",lZ=`https://cdn.jsdelivr.net/npm/@novu/js@${sZ}/dist/index.css`,ll,qo,rc,Qs,Gf,Vd,Yf,qd,Zf,Wd,Qf,Kd,Xf,Gd,Jf,Yd,eh,Zd,R6,F6,uZ=class{constructor(t){Ge(this,Zd),Ge(this,ll,null),Ge(this,qo),Ge(this,rc),Ge(this,Qs),Ge(this,Gf),Ge(this,Vd),Ge(this,Yf),Ge(this,qd),Ge(this,Zf),Ge(this,Wd),Ge(this,Qf),Ge(this,Kd),Ge(this,Xf),Ge(this,Gd),Ge(this,Jf),Ge(this,Yd),Ge(this,eh);var n;this.id=s6(16);const[r,i]=Me(t.appearance),[a,o]=Me(t.localization),[s,l]=Me(t.options),[u,c]=Me(new Map),[d,f]=Me((n=t.tabs)!=null?n:[]),[h,m]=Me(t.preferencesFilter),[p,y]=Me(t.routerPush);Qe(this,rc,u),Qe(this,Qs,c),Qe(this,Gf,r),Qe(this,Vd,i),Qe(this,Yf,a),Qe(this,qd,o),Qe(this,Zf,s),Qe(this,Wd,l),Qe(this,Qf,d),Qe(this,Kd,f),Qe(this,Xf,p),Qe(this,Gd,y),Qe(this,eh,t.novu),Qe(this,Jf,h),Qe(this,Yd,m),Of(this,Zd,R6).call(this)}mountComponent({name:t,element:n,props:r}){if(oe(this,rc).call(this).has(n))return Of(this,Zd,F6).call(this,n,r);oe(this,Qs).call(this,i=>{const a=new Map(i);return a.set(n,{name:t,props:r}),a})}unmountComponent(t){oe(this,Qs).call(this,n=>{const r=new Map(n);return r.delete(t),r})}updateAppearance(t){oe(this,Vd).call(this,t)}updateLocalization(t){oe(this,qd).call(this,t)}updateOptions(t){oe(this,Wd).call(this,t)}updateTabs(t){oe(this,Kd).call(this,t??[])}updatePreferencesFilter(t){oe(this,Yd).call(this,t)}updateRouterPush(t){oe(this,Gd).call(this,()=>t)}unmount(){var t,n;(t=oe(this,ll))==null||t.call(this),Qe(this,ll,null),(n=oe(this,qo))==null||n.remove()}};ll=new WeakMap;qo=new WeakMap;rc=new WeakMap;Qs=new WeakMap;Gf=new WeakMap;Vd=new WeakMap;Yf=new WeakMap;qd=new WeakMap;Zf=new WeakMap;Wd=new WeakMap;Qf=new WeakMap;Kd=new WeakMap;Xf=new WeakMap;Gd=new WeakMap;Jf=new WeakMap;Yd=new WeakMap;eh=new WeakMap;Zd=new WeakSet;R6=function(){if(oe(this,ll)!==null)return;Qe(this,qo,document.createElement("div")),oe(this,qo).setAttribute("id",`novu-ui-${this.id}`),document.body.appendChild(oe(this,qo));const e=PV(()=>{const t=this;return Z(oZ,{cssHref:lZ,novuUI:t,get nodes(){var n;return oe(n=t,rc).call(n)},get options(){var n;return oe(n=t,Zf).call(n)},get appearance(){var n;return oe(n=t,Gf).call(n)},get localization(){var n;return oe(n=t,Yf).call(n)},get tabs(){var n;return oe(n=t,Qf).call(n)},get preferencesFilter(){var n;return oe(n=t,Jf).call(n)},get routerPush(){var n;return oe(n=t,Xf).call(n)},get novu(){return oe(t,eh)}})},oe(this,qo));Qe(this,ll,e)};F6=function(e,t){oe(this,Qs).call(this,n=>{const r=new Map(n),i=r.get(e);return i&&r.set(e,an(Ye({},i),{props:t})),r})};function Vh({mount:e}){const t=E.useRef(null);return E.useEffect(()=>{let n;const r=t.current;if(r&&e){const i=e(r);i&&(n=i)}return()=>{r&&n&&n(r)}},[t,e]),g.jsx("div",{ref:t})}function cZ(e,t){if(!e)throw typeof t=="string"?new Error(t):new Error(`${t.displayName} not found`)}var M6=(e,t)=>{const{assertCtxFn:n=cZ}=t||{},r=E.createContext(void 0);return r.displayName=e,[r,()=>{const o=E.useContext(r);return n(o,`Component must be wrapped with ${r.displayName}`),o.value},()=>{const o=E.useContext(r);return o?o.value:{}}]},[dZ,qh,Vve]=M6("RendererContext"),fZ=e=>g.jsx(dZ.Provider,{value:{value:e.value},children:e.children}),hZ=e=>{const{children:t}=e,[n,r]=E.useState(new Map),i=E.useCallback((a,o)=>(r(s=>{const l=new Map(s);return l.set(a,o),l}),()=>{r(s=>{const l=new Map(s);return l.delete(a),l})}),[r]);return g.jsxs(fZ,{value:{mountElement:i},children:[[...n].map(([a,o])=>ph.createPortal(o,a)),t]})},Wh=e=>{const t=n=>g.jsx(hZ,{children:g.jsx(e,{...n})});return t.displayName=`WithRenderer(${e.displayName||e.name||"Component"})`,t},[pZ,Kh,qve]=M6("NovuUIContext"),mZ=e=>g.jsx(pZ.Provider,{value:{value:e.value},children:e.children}),gZ=E.memo(e=>{const{renderBell:t}=e,{novuUI:n}=Kh(),{mountElement:r}=qh(),i=E.useCallback(a=>n.mountComponent({name:"Bell",element:a,props:t?{renderBell:(o,s)=>r(o,t(s))}:void 0}),[t]);return g.jsx(Vh,{mount:i})});Wh(gZ);var vZ="2.6.0",yZ="@novu/react",bZ=`${yZ}@${vZ}`,r9=E.createContext(void 0),EZ=({children:e,applicationIdentifier:t,subscriberId:n,subscriberHash:r,backendUrl:i,socketUrl:a,useCache:o,userAgentType:s})=>{const l=E.useMemo(()=>new u7({applicationIdentifier:t,subscriberId:n,subscriberHash:r,backendUrl:i,socketUrl:a,useCache:o,__userAgent:`${bZ} ${s}`}),[t,n,r,i,a,o,s]);return g.jsx(r9.Provider,{value:l,children:e})},_Z=()=>{const e=E.useContext(r9);if(!e)throw new Error("useNovu must be used within a <NovuProvider />");return e},TZ=()=>E.useContext(r9),CZ=e=>{const t=E.useRef(e);return t.current=e,t},u4=({options:e,novu:t,children:n})=>{const r=CZ({...e,novu:t}),[i,a]=E.useState();return E.useEffect(()=>{const o=new uZ(r.current);return a(o),()=>{o.unmount()}},[]),E.useEffect(()=>{i&&(i.updateAppearance(e.appearance),i.updateLocalization(e.localization),i.updateTabs(e.tabs),i.updateOptions(e.options),i.updateRouterPush(e.routerPush))},[e]),i?g.jsx(mZ,{value:{novuUI:i},children:n}):null},xZ=e=>{const{open:t,renderNotification:n,renderBell:r,onNotificationClick:i,onPrimaryActionClick:a,onSecondaryActionClick:o}=e,{novuUI:s}=Kh(),{mountElement:l}=qh(),u=E.useCallback(c=>s.mountComponent({name:"Inbox",props:{open:t,renderNotification:n?(d,f)=>l(d,n(f)):void 0,renderBell:r?(d,f)=>l(d,r(f)):void 0,onNotificationClick:i,onPrimaryActionClick:a,onSecondaryActionClick:o},element:c}),[t,n,r,i,a,o]);return g.jsx(Vh,{mount:u})},wZ=Wh(xZ),AZ=E.memo(e=>{const{applicationIdentifier:t,subscriberId:n,subscriberHash:r,backendUrl:i,socketUrl:a}=e;return TZ()?g.jsx(c4,{...e}):g.jsx(EZ,{applicationIdentifier:t,subscriberId:n,subscriberHash:r,backendUrl:i,socketUrl:a,userAgentType:"components",children:g.jsx(c4,{...e})})}),c4=E.memo(e=>{const{localization:t,appearance:n,tabs:r,preferencesFilter:i,routerPush:a,applicationIdentifier:o,subscriberId:s,subscriberHash:l,backendUrl:u,socketUrl:c}=e,d=_Z(),f=E.useMemo(()=>({localization:t,appearance:n,tabs:r,preferencesFilter:i,routerPush:a,options:{applicationIdentifier:o,subscriberId:s,subscriberHash:l,backendUrl:u,socketUrl:c}}),[t,n,r,i,o,s,l,u,c]);if(kZ(e))return g.jsx(u4,{options:f,novu:d,children:e.children});const{open:h,renderNotification:m,renderBell:p,onNotificationClick:y,onPrimaryActionClick:v,onSecondaryActionClick:b}=e;return g.jsx(u4,{options:f,novu:d,children:g.jsx(wZ,{open:h,renderNotification:m,renderBell:p,onNotificationClick:y,onPrimaryActionClick:v,onSecondaryActionClick:b})})});function kZ(e){return"children"in e}var SZ=E.memo(e=>{const{onNotificationClick:t,onPrimaryActionClick:n,renderNotification:r,onSecondaryActionClick:i}=e,{novuUI:a}=Kh(),{mountElement:o}=qh(),s=E.useCallback(l=>a.mountComponent({name:"Notifications",element:l,props:{renderNotification:r?(u,c)=>o(u,r(c)):void 0,onNotificationClick:t,onPrimaryActionClick:n,onSecondaryActionClick:i}}),[r,t,n,i]);return g.jsx(Vh,{mount:s})});Wh(SZ);var DZ=E.memo(e=>{const{onNotificationClick:t,onPrimaryActionClick:n,renderNotification:r,onSecondaryActionClick:i,initialPage:a,hideNav:o}=e,{novuUI:s}=Kh(),{mountElement:l}=qh(),u=E.useCallback(c=>s.mountComponent({name:"InboxContent",element:c,props:{renderNotification:r?(d,f)=>l(d,r(f)):void 0,onNotificationClick:t,onPrimaryActionClick:n,onSecondaryActionClick:i,initialPage:a,hideNav:o}}),[r,t,n,i]);return g.jsx(Vh,{mount:u})});Wh(DZ);const Gh=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0))(),Lr=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())(),OZ="arraybuffer";function B6(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const NZ=Lr.setTimeout,IZ=Lr.clearTimeout;function Yh(e,t){t.useNativeTimers?(e.setTimeoutFn=NZ.bind(Lr),e.clearTimeoutFn=IZ.bind(Lr)):(e.setTimeoutFn=Lr.setTimeout.bind(Lr),e.clearTimeoutFn=Lr.clearTimeout.bind(Lr))}const PZ=1.33;function RZ(e){return typeof e=="string"?FZ(e):Math.ceil((e.byteLength||e.size)*PZ)}function FZ(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function L6(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function MZ(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function BZ(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let a=n[r].split("=");t[decodeURIComponent(a[0])]=decodeURIComponent(a[1])}return t}class LZ extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class i9 extends Jt{constructor(t){super(),this.writable=!1,Yh(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new LZ(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=Oh(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=MZ(t);return n.length?"?"+n:""}}class $Z extends i9{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};Vw(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,zw(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=L6()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let $6=!1;try{$6=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const jZ=$6;function HZ(){}class UZ extends $Z{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,a)=>{this.onError("xhr post error",i,a)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class Bi extends Jt{constructor(t,n,r){super(),this.createRequest=t,Yh(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=B6(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=Bi.requestsCount++,Bi.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=HZ,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Bi.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}Bi.requestsCount=0;Bi.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",d4);else if(typeof addEventListener=="function"){const e="onpagehide"in Lr?"pagehide":"unload";addEventListener(e,d4,!1)}}function d4(){for(let e in Bi.requests)Bi.requests.hasOwnProperty(e)&&Bi.requests[e].abort()}const zZ=function(){const e=j6({xdomain:!1});return e&&e.responseType!==null}();class VZ extends UZ{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=zZ&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Bi(j6,this.uri(),t)}}function j6(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||jZ))return new XMLHttpRequest}catch{}if(!t)try{return new Lr[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const H6=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class qZ extends i9{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=H6?{}:B6(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;Dh(r,this.supportsBinary,a=>{try{this.doWrite(r,a)}catch{}i&&Gh(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=L6()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const jm=Lr.WebSocket||Lr.MozWebSocket;class WZ extends qZ{createSocket(t,n,r){return H6?new jm(t,n,r):n?new jm(t,n):new jm(t)}doWrite(t,n){this.ws.send(n)}}class KZ extends i9{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=Ww(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=qw();i.readable.pipeTo(t.writable),this._writer=i.writable.getWriter();const a=()=>{r.read().then(({done:s,value:l})=>{s||(this.onPacket(l),a())}).catch(s=>{})};a();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;this._writer.write(r).then(()=>{i&&Gh(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const GZ={websocket:WZ,webtransport:KZ,polling:VZ},YZ=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,ZZ=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function tv(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=YZ.exec(e||""),a={},o=14;for(;o--;)a[ZZ[o]]=i[o]||"";return n!=-1&&r!=-1&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=QZ(a,a.path),a.queryKey=XZ(a,a.query),a}function QZ(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function XZ(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,a){i&&(n[i]=a)}),n}const nv=typeof addEventListener=="function"&&typeof removeEventListener=="function",Qd=[];nv&&addEventListener("offline",()=>{Qd.forEach(e=>e())},!1);class io extends Jt{constructor(t,n){if(super(),this.binaryType=OZ,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=tv(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=tv(n.host).host);Yh(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const i=r.prototype.name;this.transports.push(i),this._transportsByName[i]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=BZ(this.opts.query)),nv&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Qd.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=Nh,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&io.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",io.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=RZ(i)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,Gh(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const a={type:t,data:n,options:r};this.emitReserved("packetCreate",a),this.writeBuffer.push(a),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(io.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),nv&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Qd.indexOf(this._offlineEventListener);r!==-1&&Qd.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}io.protocol=Nh;class JZ extends io{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;io.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",d=>{if(!r)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;io.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(c(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const f=new Error("probe error");f.transport=n.name,this.emitReserved("upgradeError",f)}}))};function a(){r||(r=!0,c(),n.close(),n=null)}const o=d=>{const f=new Error("probe error: "+d);f.transport=n.name,a(),this.emitReserved("upgradeError",f)};function s(){o("transport closed")}function l(){o("socket closed")}function u(d){n&&d.name!==n.name&&a()}const c=()=>{n.removeListener("open",i),n.removeListener("error",o),n.removeListener("close",s),this.off("close",l),this.off("upgrading",u)};n.once("open",i),n.once("error",o),n.once("close",s),this.once("close",l),this.once("upgrading",u),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let eQ=class extends JZ{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(i=>GZ[i]).filter(i=>!!i)),super(t,r)}};function tQ(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=tv(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const a=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+a+":"+r.port+t,r.href=r.protocol+"://"+a+(n&&n.port===r.port?"":":"+r.port),r}function li(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const nQ=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class U6 extends Jt{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[li(t,"open",this.onopen.bind(this)),li(t,"packet",this.onpacket.bind(this)),li(t,"error",this.onerror.bind(this)),li(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,i,a;if(nQ.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const o={type:et.EVENT,data:n};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const c=this.ids++,d=n.pop();this._registerAckCallback(c,d),o.id=c}const s=(i=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||i===void 0?void 0:i.writable,l=this.connected&&!(!((a=this.io.engine)===null||a===void 0)&&a._hasPingExpired());return this.flags.volatile&&!s||(l?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const a=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let s=0;s<this.sendBuffer.length;s++)this.sendBuffer[s].id===t&&this.sendBuffer.splice(s,1);n.call(this,new Error("operation has timed out"))},i),o=(...s)=>{this.io.clearTimeoutFn(a),n.apply(this,s)};o.withError=!0,this.acks[t]=o}emitWithAck(t,...n){return new Promise((r,i)=>{const a=(o,s)=>o?i(o):r(s);a.withError=!0,n.push(a),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...a)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...a)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:et.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case et.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case et.EVENT:case et.BINARY_EVENT:this.onevent(t);break;case et.ACK:case et.BINARY_ACK:this.onack(t);break;case et.DISCONNECT:this.ondisconnect();break;case et.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:et.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:et.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function Wl(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Wl.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};Wl.prototype.reset=function(){this.attempts=0};Wl.prototype.setMin=function(e){this.ms=e};Wl.prototype.setMax=function(e){this.max=e};Wl.prototype.setJitter=function(e){this.jitter=e};class rv extends Jt{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Yh(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Wl({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||e7;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new eQ(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=li(n,"open",function(){r.onopen(),t&&t()}),a=s=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",s),t?t(s):this.maybeReconnectOnOpen()},o=li(n,"error",a);if(this._timeout!==!1){const s=this._timeout,l=this.setTimeoutFn(()=>{i(),a(new Error("timeout")),n.close()},s);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(li(t,"ping",this.onping.bind(this)),li(t,"data",this.ondata.bind(this)),li(t,"error",this.onerror.bind(this)),li(t,"close",this.onclose.bind(this)),li(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Gh(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new U6(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const hu={};function Xd(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=tQ(e,t.path||"/socket.io"),r=n.source,i=n.id,a=n.path,o=hu[i]&&a in hu[i].nsps,s=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let l;return s?l=new rv(r,t):(hu[i]||(hu[i]=new rv(r,t)),l=hu[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(Xd,{Manager:rv,Socket:U6,io:Xd,connect:Xd});const f4=e=>{let t;const n=new Set,r=(c,d)=>{const f=typeof c=="function"?c(t):c;if(!Object.is(f,t)){const h=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(m=>m(t,h))}},i=()=>t,l={setState:r,getState:i,getInitialState:()=>u,subscribe:c=>(n.add(c),()=>n.delete(c)),destroy:()=>{n.clear()}},u=t=e(r,i,l);return l},z6=e=>e?f4(e):f4;function br(){return br=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},br.apply(this,arguments)}class rQ extends Error{constructor(t){super(t),this.name=void 0,this.name="SuprSendError"}}function Wo(){return Math.round(Date.now())}function Ao(){var e=new Date().getTime(),t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var r=(e+Math.random()*16)%16|0;return e=Math.floor(e/16),(n=="x"?r:r&3|8).toString(16)});return t}const zn=z6()(()=>({apiUrl:"https://inboxs.live",collectorApiUrl:"https://hub.suprsend.com",socketUrl:"https://betainbox.suprsend.com",pageSize:20})),iQ={unseenCount:0,stores:{},activeStoreId:null,pageNumber:1,hasNext:!0,initialLoading:!1,fetchMoreLoading:!1,initialFetchTime:null},_t=z6()(()=>iQ);class aQ{constructor(t){this.socket=void 0,this.config=void 0,this.config=t;const n=zn.getState();this.socket=Xd(n.socketUrl,{transports:["websocket"],auth:{subscriber_id:this.config.subscriberId,distinct_id:this.config.distinctId,authorization:`${this.config.workspaceKey}:${Ao()}`,tenant_id:this.config.tenantId},reconnectionAttempts:25,reconnectionDelay:5e3,reconnectionDelayMax:1e4}),this._initializeSocketEvents()}orderNotifications(t,n){if(t.is_pinned)return[t,...n];{let r=!1,i=[];return n.forEach(a=>{a.is_pinned||r?i.push(a):(i.push(t),i.push(a),r=!0)}),r?i:[...n,t]}}_initializeSocketEvents(){var t=this;this.socket.on("new_notification",async function(n){n.n_id&&setTimeout(async function(){try{const i=await(await t.getNotificationDetails(n.n_id)).json(),a=_t.getState();if(t.config.stores){let o=!1;for(let s of t.config.stores){const l=a.stores[s.storeId];t._notificationBelongToStore(i.data,s)&&(o=!0,l.notifications=t.orderNotifications(i.data,l.notifications),l.unseenCount+=1)}o&&(a.unseenCount+=1,t.config.emitter.emit("new_notification",i.data)),_t.setState({unseenCount:a.unseenCount,stores:br({},a.stores)})}else{if(!a.activeStoreId)return;let o=a.stores[a.activeStoreId];a.unseenCount+=1,o.unseenCount+=1,o.notifications=t.orderNotifications(i.data,o.notifications),_t.setState({unseenCount:a.unseenCount,stores:br({},a.stores)}),t.config.emitter.emit("new_notification",i.data)}t.config.emitter.emit("sync_notif_store")}catch(r){console.log("SuprSend: error in new_notification event",r)}},1e3)}),this.socket.on("notification_updated",async function(n){n.n_id&&setTimeout(async function(){try{const a=await Promise.allSettled([t.getNotificationDetails(n.n_id),t.getNotificationsCount()]),o=_t.getState();let s=o.activeStoreId;if(a[0].status==="fulfilled"){var r;const u=await a[0].value.json(),c=u.data;if(!s)return;let d=o.stores[s];const f=(r=t.config.stores)==null?void 0:r.find(h=>h.storeId===s);if((n==null?void 0:n.type)==="archive"){var i;f!=null&&(i=f.query)!=null&&i.archived?t._notificationBelongToStore(c,f)&&(o.stores[s].notifications=[c,...d.notifications]):o.stores[s].notifications=d.notifications.filter(h=>h.n_id!==n.n_id)}else o.stores[s].notifications=d.notifications.map(h=>h.n_id===n.n_id?u.data:h);_t.setState({stores:br({},o.stores)})}if(a[1].status==="fulfilled"){const u=await a[1].value.json();_t.setState(c=>{for(let d in c.stores){const f=c.stores[d];f.unseenCount=u[d]||0}return{unseenCount:u.ss_bell_count,stores:br({},c.stores)}})}t.config.emitter.emit("sync_notif_store")}catch(a){console.log("SuprSend: error in notification_updated event",a)}},1e3)}),this.socket.on("update_badge",async function(){_t.setState({unseenCount:0}),t.config.emitter.emit("sync_notif_store")}),this.socket.on("mark_all_read",async function(){const n=_t.getState(),r=Wo();for(let i in n.stores){const a=n.stores[i];a.notifications.forEach(o=>{o.seen_on||(o.seen_on=r)}),a.unseenCount=0}_t.setState({stores:n.stores}),t.config.emitter.emit("sync_notif_store")})}_notificationBelongToStore(t,n){var r,i,a,o;const s=!!t.seen_on,l=t.archived,u=t.tags,c=t.n_category,d=n==null||(r=n.query)==null?void 0:r.read,f=n==null||(i=n.query)==null?void 0:i.archived,h=n==null||(a=n.query)==null?void 0:a.tags,m=n==null||(o=n.query)==null?void 0:o.categories,p=!d||s===d,y=!f||l===f;let v,b;return Array.isArray(h)&&h.length>0?h.forEach(_=>{u!=null&&u.includes(_)&&(v=!0)}):v=!0,Array.isArray(m)&&m.length>0?m.includes(c)&&(b=!0):b=!0,p&&v&&b&&y}_getStoreQueryString(t){const n=t==null?void 0:t.query;let r=(n==null?void 0:n.tags)||[],i=(n==null?void 0:n.categories)||[];const a=n==null?void 0:n.read,o=n==null?void 0:n.archived;return{store_id:t.storeId,query:{read:a,archived:o,tags:{or:r},categories:{or:i}}}}_getStoresQueryString(){const t=this.config.stores;return t==null?void 0:t.map(r=>this._getStoreQueryString(r))}getNotificationsCount(){const{apiUrl:t}=zn.getState();let n=`/notification_count/?subscriber_id=${this.config.subscriberId}&distinct_id=${this.config.distinctId}&tenant_id=${this.config.tenantId}`;if(this.config.stores){const r=this._getStoresQueryString();n+=`&stores=${encodeURIComponent(JSON.stringify(r))}`}return fetch(`${t}${n}`,{method:"GET",headers:{Authorization:`${this.config.workspaceKey}:${Ao()}`}})}getNotifications(t,n,r=20,i){const{apiUrl:a}=zn.getState();let o=`/notifications/?subscriber_id=${this.config.subscriberId}&distinct_id=${this.config.distinctId}&tenant_id=${this.config.tenantId}&page_no=${n}&page_size=${r}&before=${i}`;if(t){const s=this._getStoreQueryString(t);o+=`&store=${encodeURIComponent(JSON.stringify(s))}`}return fetch(`${a}${o}`,{method:"GET",headers:{Authorization:`${this.config.workspaceKey}:${Ao()}`}})}getNotificationDetails(t){const{apiUrl:n}=zn.getState(),r=`/notification/${t}/?subscriber_id=${this.config.subscriberId}&distinct_id=${this.config.distinctId}&tenant_id=${this.config.tenantId}`;return fetch(`${n}${r}`,{method:"GET",headers:{Authorization:`${this.config.workspaceKey}:${Ao()}`}})}markBellClicked(){const{apiUrl:t}=zn.getState(),n="/bell-clicked/",r=JSON.stringify({time:Wo(),distinct_id:this.config.distinctId,subscriber_id:this.config.subscriberId,tenant_id:this.config.tenantId});return fetch(`${t}${n}`,{method:"POST",body:r,headers:{Authorization:`${this.config.workspaceKey}:${Ao()}`,"Content-Type":"application/json"}})}markAllRead(){const{apiUrl:t}=zn.getState(),n="/mark-all-read/",r=JSON.stringify({time:Wo(),distinct_id:this.config.distinctId,subscriber_id:this.config.subscriberId,tenant_id:this.config.tenantId});return fetch(`${t}${n}`,{method:"POST",body:r,headers:{Authorization:`${this.config.workspaceKey}:${Ao()}`,"Content-Type":"application/json"}})}markNotificationClicked(t){const{collectorApiUrl:n}=zn.getState(),r={event:"$notification_clicked",env:this.config.workspaceKey,$insert_id:Ao(),$time:Wo(),properties:{id:t}};return fetch(`${n}/event/`,{method:"POST",body:JSON.stringify(r),headers:{Authorization:`${this.config.workspaceKey}:`,"Content-Type":"application/json"}})}markNotificationRead(t){const{apiUrl:n}=zn.getState();return fetch(`${n}/notification/${t}/action`,{method:"POST",body:JSON.stringify({action:"read",distinct_id:this.config.distinctId,subscriber_id:this.config.subscriberId}),headers:{Authorization:`${this.config.workspaceKey}:`,"Content-Type":"application/json"}})}markNotificationUnRead(t){const{apiUrl:n}=zn.getState();return fetch(`${n}/notification/${t}/action`,{method:"POST",body:JSON.stringify({action:"unread",distinct_id:this.config.distinctId,subscriber_id:this.config.subscriberId}),headers:{Authorization:`${this.config.workspaceKey}:`,"Content-Type":"application/json"}})}markNotificationArchive(t){const{apiUrl:n}=zn.getState();return fetch(`${n}/notification/${t}/action`,{method:"POST",body:JSON.stringify({action:"archive",distinct_id:this.config.distinctId,subscriber_id:this.config.subscriberId}),headers:{Authorization:`${this.config.workspaceKey}:`,"Content-Type":"application/json"}})}}let h4=class{constructor(t){this.config=void 0,this.config=t}_overallFirstApiCall(){const t=_t.getState();for(let n in t.stores)if(t.stores[n].isFirstCall===!1)return!1;return!0}async fetchNotifications(){var t,n;const r=this.config.client,i=_t.getState(),a=zn.getState(),o=i.activeStoreId;if(!o||!((t=i.stores)!=null&&t[o]))return;const s=i.stores[o],l=s.isFirstCall,u=i.initialFetchTime||Date.now(),c=(n=this.config.stores)==null?void 0:n.find(d=>d.storeId===o);try{if(!r||!i.hasNext)return;l?(_t.setState({initialLoading:!0}),this._overallFirstApiCall()&&this.getNotificationsCount()):i.pageNumber>1&&_t.setState({fetchMoreLoading:!0}),this.config.emitter.emit("sync_notif_store");const f=await(await r.getNotifications(c,i.pageNumber,a.pageSize,u)).json();let h;l||!l&&i.pageNumber===1?h=f.results:h=[...s.notifications,...f.results],i.stores[o].notifications=h,i.stores[o].isFirstCall=!1,_t.setState({stores:i.stores,pageNumber:i.pageNumber+1,hasNext:f.meta.current_page<f.meta.total_pages,initialFetchTime:u,initialLoading:!1,fetchMoreLoading:!1}),this.config.emitter.emit("sync_notif_store"),this.config._startExipryCheck()}catch(d){console.log("SUPRSEND: error getting latest notifications",d),_t.setState({initialLoading:!1,fetchMoreLoading:!1}),this.config.emitter.emit("sync_notif_store")}}async getNotificationsCount(){const t=this.config.client;if(t)try{const r=await(await t.getNotificationsCount()).json();_t.setState(i=>{for(let a in i.stores){const o=i.stores[a];o.unseenCount=r[a]||0}return{unseenCount:r.ss_bell_count,stores:br({},i.stores)}}),this.config.emitter.emit("sync_notif_store")}catch(n){console.log("SUPRSEND: error getting notifications count",n)}}async markClicked(t){var n;const r=this.config.client,i=_t.getState(),a=i.activeStoreId;if(!a||!((n=i.stores)!=null&&n[a]))return;const l=i.stores[a].notifications.find(c=>c.n_id===t);if(l&&(!l.interacted_on||!l.seen_on)){if(!r)return;try{l.interacted_on?l.seen_on||r.markNotificationRead(t):r.markNotificationClicked(t);const c=Wo();if(l.interacted_on=c,!l.seen_on)for(let d in i==null?void 0:i.stores){var u;const f=i.stores[d];(u=f.notifications)==null||u.forEach(h=>{h.n_id===l.n_id&&(h.seen_on=c,h.interacted_on=c,f.unseenCount>0&&(f.unseenCount-=1))})}_t.setState(br({},i)),this.config.emitter.emit("sync_notif_store")}catch(c){console.log("SUPRSEND: error marking notification clicked",c)}}}async markAllSeen(){const t=this.config.client;try{if(!t)return;t.markBellClicked(),_t.setState({unseenCount:0}),this.config.emitter.emit("sync_notif_store")}catch(n){console.log("SUPRSEND: error marking all notifications seen",n)}}async markAllRead(){const t=this.config.client;try{if(!t)return;t.markAllRead();const n=_t.getState(),r=Wo();for(let i in n.stores){const a=n.stores[i];a.notifications.forEach(o=>{o.seen_on||(o.seen_on=r)}),a.unseenCount=0}_t.setState({stores:n.stores}),this.config.emitter.emit("sync_notif_store")}catch(n){console.log("SUPRSEND: error marking all notifications read",n)}}async markRead(t){var n;const r=this.config.client,i=_t.getState(),a=i.activeStoreId;if(!a||!((n=i.stores)!=null&&n[a]))return;const l=i.stores[a].notifications.find(c=>c.n_id===t);if(l&&!l.seen_on){if(!r)return;try{r.markNotificationRead(t);const c=Wo();if(!l.seen_on)for(let d in i==null?void 0:i.stores){var u;const f=i.stores[d];(u=f.notifications)==null||u.forEach(h=>{h.n_id===l.n_id&&(h.seen_on=c,f.unseenCount>0&&(f.unseenCount-=1))})}_t.setState(br({},i)),this.config.emitter.emit("sync_notif_store")}catch(c){console.log("SUPRSEND: error marking notification read",c)}}}async markUnRead(t){var n;const r=this.config.client,i=_t.getState(),a=i.activeStoreId;if(!a||!((n=i.stores)!=null&&n[a]))return;const l=i.stores[a].notifications.find(c=>c.n_id===t);if(l&&l.seen_on){if(!r)return;try{if(r.markNotificationUnRead(t),l.seen_on)for(let c in i==null?void 0:i.stores){var u;const d=i.stores[c];(u=d.notifications)==null||u.forEach(f=>{f.n_id===l.n_id&&(f.seen_on=void 0,d.unseenCount>=0&&(d.unseenCount+=1))})}_t.setState(br({},i)),this.config.emitter.emit("sync_notif_store")}catch(c){console.log("SUPRSEND: error marking notification read",c)}}}markArchived(t){var n;const r=this.config.client,i=_t.getState(),a=i.activeStoreId;if(!a||!((n=i.stores)!=null&&n[a]))return;const s=(i==null?void 0:i.stores)[a],l=s.notifications.find(u=>u.n_id===t);if(l&&!l.archived){if(!r)return;try{r.markNotificationArchive(t),s.notifications=s.notifications.filter(u=>u.n_id!==t),!l.seen_on&&s.unseenCount>0&&(s.unseenCount-=1),_t.setState(br({},i)),this.config.emitter.emit("sync_notif_store")}catch(u){console.log("SUPRSEND: error marking notification archived",u)}}}get stores(){return this.config.stores}get data(){const t=_t.getState(),n=t.activeStoreId,r=this.stores;if(n)return{unseenCount:t.unseenCount,activeStoreId:t.activeStoreId,stores:t.stores,hasStores:r?(r==null?void 0:r.length)>0:!1,hasNext:t.hasNext,initialLoading:t.initialLoading,fetchMoreLoading:t.fetchMoreLoading}}};class oQ{constructor(t,n){this.workspaceKey="",this.tenantId=void 0,this.stores=void 0,this.distinctId=void 0,this.subscriberId=void 0,this._client=void 0,this._expiryTimerId=void 0,this.feed=new h4(this),this.emitter=Bw(),this._validateConfig(t),this._setConfigStoreState((n==null?void 0:n.host)||{}),this.tenantId=(n==null?void 0:n.tenantID)||"default",this._validateStore(n==null?void 0:n.stores),this._validatePageSize(n==null?void 0:n.pageSize),this._initializeStoreState()}_validateConfig(t){if(t)this.workspaceKey=t;else throw new rQ("workspaceKey missing")}_validateStore(t){if(!t||!Array.isArray(t))return;const n=[];t.forEach(r=>{if(!r.storeId){console.log("SuprSendInbox: storeId is mandatory if stores are used");return}const i=r==null?void 0:r.query;let a,o=[],s=[],l;typeof(i==null?void 0:i.read)=="boolean"&&(a=i.read),typeof(i==null?void 0:i.archived)=="boolean"&&(l=i.archived),typeof(i==null?void 0:i.tags)=="string"?o=[i.tags]:Array.isArray(i==null?void 0:i.tags)&&(o=i==null?void 0:i.tags.filter(u=>typeof u=="string")),typeof(i==null?void 0:i.categories)=="string"?s=[i.categories]:Array.isArray(i==null?void 0:i.categories)&&(s=i==null?void 0:i.categories.filter(u=>typeof u=="string")),n.push({storeId:r.storeId,label:r.label||r.storeId,query:{archived:l,read:a,tags:o,categories:s}})}),this.stores=n}_validatePageSize(t){if(t&&typeof t=="number"){const r=t<=50?t:50;zn.setState({pageSize:r})}}_setConfigStoreState(t){t&&(t!=null&&t.socketHost&&zn.setState({socketUrl:t.socketHost}),t!=null&&t.apiHost&&zn.setState({apiUrl:t.apiHost}),t!=null&&t.collectorHost&&zn.setState({collectorApiUrl:t.collectorHost}))}_initializeStoreState(){const t="default_store",n={notifications:[],unseenCount:0,isFirstCall:!0};if(this.stores&&Array.isArray(this.stores)&&this.stores.length>0){const r={};this.stores.map(i=>{r[i.storeId]=br({},n)}),_t.setState({stores:r,activeStoreId:this.stores[0].storeId})}else _t.setState({stores:{[t]:br({},n)},activeStoreId:t});setTimeout(()=>{this.emitter.emit("sync_notif_store")},0)}_startExipryCheck(){var t=this;this._expiryTimerId||(this._expiryTimerId=setInterval(async function(){const r=_t.getState().stores;let i=!1;for(let a in r){let o=r[a].notifications;o=o.filter(s=>(s.expiry?Date.now()>s.expiry:!1)?(i=!0,!1):!0),r[a].notifications=o}i&&(_t.setState({stores:r}),await t.feed.getNotificationsCount(),t.emitter.emit("sync_notif_store"))},3e4))}get client(){return this.distinctId&&this.subscriberId&&(this._client||(this._client=new aQ(this))),this._client}identifyUser(t,n){this.distinctId=t,this.subscriberId=n}changeActiveStore(t){var n;const r=_t.getState(),i={};if(r.activeStoreId!==t&&(n=r.stores)!=null&&n[t]){for(let a in r.stores){const o=r.stores[a],s=o.notifications.slice(0,20);i[a]={notifications:s,unseenCount:o.unseenCount,isFirstCall:o.isFirstCall}}_t.setState({activeStoreId:t,stores:i,pageNumber:1,hasNext:!0,initialLoading:!1,fetchMoreLoading:!1,initialFetchTime:null}),this.client&&this.feed.fetchNotifications()}}resetUser(){var t;_t.setState({unseenCount:0,pageNumber:1,hasNext:!0,initialLoading:!1,fetchMoreLoading:!1,initialFetchTime:null}),this._initializeStoreState(),(t=this._client)==null||t.socket.disconnect(),this.distinctId=void 0,this.subscriberId=void 0,this._client=void 0,clearInterval(this._expiryTimerId),this._expiryTimerId=void 0,this.feed=new h4(this)}}var p4=function(t){return t.reduce(function(n,r){var i=r[0],a=r[1];return n[i]=a,n},{})},m4=typeof window<"u"&&window.document&&window.document.createElement?Nn.useLayoutEffect:Nn.useEffect,rr="top",Wr="bottom",Kr="right",ir="left",a9="auto",Zc=[rr,Wr,Kr,ir],Dl="start",Mc="end",sQ="clippingParents",V6="viewport",pu="popper",lQ="reference",g4=Zc.reduce(function(e,t){return e.concat([t+"-"+Dl,t+"-"+Mc])},[]),q6=[].concat(Zc,[a9]).reduce(function(e,t){return e.concat([t,t+"-"+Dl,t+"-"+Mc])},[]),uQ="beforeRead",cQ="read",dQ="afterRead",fQ="beforeMain",hQ="main",pQ="afterMain",mQ="beforeWrite",gQ="write",vQ="afterWrite",yQ=[uQ,cQ,dQ,fQ,hQ,pQ,mQ,gQ,vQ];function Gi(e){return e?(e.nodeName||"").toLowerCase():null}function wr(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function as(e){var t=wr(e).Element;return e instanceof t||e instanceof Element}function zr(e){var t=wr(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function o9(e){if(typeof ShadowRoot>"u")return!1;var t=wr(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function bQ(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},a=t.elements[n];!zr(a)||!Gi(a)||(Object.assign(a.style,r),Object.keys(i).forEach(function(o){var s=i[o];s===!1?a.removeAttribute(o):a.setAttribute(o,s===!0?"":s)}))})}function EQ(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var i=t.elements[r],a=t.attributes[r]||{},o=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),s=o.reduce(function(l,u){return l[u]="",l},{});!zr(i)||!Gi(i)||(Object.assign(i.style,s),Object.keys(a).forEach(function(l){i.removeAttribute(l)}))})}}const _Q={name:"applyStyles",enabled:!0,phase:"write",fn:bQ,effect:EQ,requires:["computeStyles"]};function Li(e){return e.split("-")[0]}var Qo=Math.max,th=Math.min,Ol=Math.round;function iv(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function W6(){return!/^((?!chrome|android).)*safari/i.test(iv())}function Nl(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,a=1;t&&zr(e)&&(i=e.offsetWidth>0&&Ol(r.width)/e.offsetWidth||1,a=e.offsetHeight>0&&Ol(r.height)/e.offsetHeight||1);var o=as(e)?wr(e):window,s=o.visualViewport,l=!W6()&&n,u=(r.left+(l&&s?s.offsetLeft:0))/i,c=(r.top+(l&&s?s.offsetTop:0))/a,d=r.width/i,f=r.height/a;return{width:d,height:f,top:c,right:u+d,bottom:c+f,left:u,x:u,y:c}}function s9(e){var t=Nl(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function K6(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&o9(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function xa(e){return wr(e).getComputedStyle(e)}function TQ(e){return["table","td","th"].indexOf(Gi(e))>=0}function yo(e){return((as(e)?e.ownerDocument:e.document)||window.document).documentElement}function Zh(e){return Gi(e)==="html"?e:e.assignedSlot||e.parentNode||(o9(e)?e.host:null)||yo(e)}function v4(e){return!zr(e)||xa(e).position==="fixed"?null:e.offsetParent}function CQ(e){var t=/firefox/i.test(iv()),n=/Trident/i.test(iv());if(n&&zr(e)){var r=xa(e);if(r.position==="fixed")return null}var i=Zh(e);for(o9(i)&&(i=i.host);zr(i)&&["html","body"].indexOf(Gi(i))<0;){var a=xa(i);if(a.transform!=="none"||a.perspective!=="none"||a.contain==="paint"||["transform","perspective"].indexOf(a.willChange)!==-1||t&&a.willChange==="filter"||t&&a.filter&&a.filter!=="none")return i;i=i.parentNode}return null}function Qc(e){for(var t=wr(e),n=v4(e);n&&TQ(n)&&xa(n).position==="static";)n=v4(n);return n&&(Gi(n)==="html"||Gi(n)==="body"&&xa(n).position==="static")?t:n||CQ(e)||t}function l9(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function ic(e,t,n){return Qo(e,th(t,n))}function xQ(e,t,n){var r=ic(e,t,n);return r>n?n:r}function G6(){return{top:0,right:0,bottom:0,left:0}}function Y6(e){return Object.assign({},G6(),e)}function Z6(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var wQ=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,Y6(typeof t!="number"?t:Z6(t,Zc))};function AQ(e){var t,n=e.state,r=e.name,i=e.options,a=n.elements.arrow,o=n.modifiersData.popperOffsets,s=Li(n.placement),l=l9(s),u=[ir,Kr].indexOf(s)>=0,c=u?"height":"width";if(!(!a||!o)){var d=wQ(i.padding,n),f=s9(a),h=l==="y"?rr:ir,m=l==="y"?Wr:Kr,p=n.rects.reference[c]+n.rects.reference[l]-o[l]-n.rects.popper[c],y=o[l]-n.rects.reference[l],v=Qc(a),b=v?l==="y"?v.clientHeight||0:v.clientWidth||0:0,_=p/2-y/2,T=d[h],C=b-f[c]-d[m],x=b/2-f[c]/2+_,w=ic(T,x,C),P=l;n.modifiersData[r]=(t={},t[P]=w,t.centerOffset=w-x,t)}}function kQ(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||K6(t.elements.popper,i)&&(t.elements.arrow=i))}const SQ={name:"arrow",enabled:!0,phase:"main",fn:AQ,effect:kQ,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Il(e){return e.split("-")[1]}var DQ={top:"auto",right:"auto",bottom:"auto",left:"auto"};function OQ(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:Ol(n*i)/i||0,y:Ol(r*i)/i||0}}function y4(e){var t,n=e.popper,r=e.popperRect,i=e.placement,a=e.variation,o=e.offsets,s=e.position,l=e.gpuAcceleration,u=e.adaptive,c=e.roundOffsets,d=e.isFixed,f=o.x,h=f===void 0?0:f,m=o.y,p=m===void 0?0:m,y=typeof c=="function"?c({x:h,y:p}):{x:h,y:p};h=y.x,p=y.y;var v=o.hasOwnProperty("x"),b=o.hasOwnProperty("y"),_=ir,T=rr,C=window;if(u){var x=Qc(n),w="clientHeight",P="clientWidth";if(x===wr(n)&&(x=yo(n),xa(x).position!=="static"&&s==="absolute"&&(w="scrollHeight",P="scrollWidth")),x=x,i===rr||(i===ir||i===Kr)&&a===Mc){T=Wr;var O=d&&x===C&&C.visualViewport?C.visualViewport.height:x[w];p-=O-r.height,p*=l?1:-1}if(i===ir||(i===rr||i===Wr)&&a===Mc){_=Kr;var M=d&&x===C&&C.visualViewport?C.visualViewport.width:x[P];h-=M-r.width,h*=l?1:-1}}var R=Object.assign({position:s},u&&DQ),D=c===!0?OQ({x:h,y:p},wr(n)):{x:h,y:p};if(h=D.x,p=D.y,l){var S;return Object.assign({},R,(S={},S[T]=b?"0":"",S[_]=v?"0":"",S.transform=(C.devicePixelRatio||1)<=1?"translate("+h+"px, "+p+"px)":"translate3d("+h+"px, "+p+"px, 0)",S))}return Object.assign({},R,(t={},t[T]=b?p+"px":"",t[_]=v?h+"px":"",t.transform="",t))}function NQ(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,a=n.adaptive,o=a===void 0?!0:a,s=n.roundOffsets,l=s===void 0?!0:s,u={placement:Li(t.placement),variation:Il(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,y4(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,y4(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const IQ={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:NQ,data:{}};var M1={passive:!0};function PQ(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,a=i===void 0?!0:i,o=r.resize,s=o===void 0?!0:o,l=wr(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&u.forEach(function(c){c.addEventListener("scroll",n.update,M1)}),s&&l.addEventListener("resize",n.update,M1),function(){a&&u.forEach(function(c){c.removeEventListener("scroll",n.update,M1)}),s&&l.removeEventListener("resize",n.update,M1)}}const RQ={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:PQ,data:{}};var FQ={left:"right",right:"left",bottom:"top",top:"bottom"};function Jd(e){return e.replace(/left|right|bottom|top/g,function(t){return FQ[t]})}var MQ={start:"end",end:"start"};function b4(e){return e.replace(/start|end/g,function(t){return MQ[t]})}function u9(e){var t=wr(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function c9(e){return Nl(yo(e)).left+u9(e).scrollLeft}function BQ(e,t){var n=wr(e),r=yo(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,l=0;if(i){a=i.width,o=i.height;var u=W6();(u||!u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:a,height:o,x:s+c9(e),y:l}}function LQ(e){var t,n=yo(e),r=u9(e),i=(t=e.ownerDocument)==null?void 0:t.body,a=Qo(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),o=Qo(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+c9(e),l=-r.scrollTop;return xa(i||n).direction==="rtl"&&(s+=Qo(n.clientWidth,i?i.clientWidth:0)-a),{width:a,height:o,x:s,y:l}}function d9(e){var t=xa(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Q6(e){return["html","body","#document"].indexOf(Gi(e))>=0?e.ownerDocument.body:zr(e)&&d9(e)?e:Q6(Zh(e))}function ac(e,t){var n;t===void 0&&(t=[]);var r=Q6(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),a=wr(r),o=i?[a].concat(a.visualViewport||[],d9(r)?r:[]):r,s=t.concat(o);return i?s:s.concat(ac(Zh(o)))}function av(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function $Q(e,t){var n=Nl(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function E4(e,t,n){return t===V6?av(BQ(e,n)):as(t)?$Q(t,n):av(LQ(yo(e)))}function jQ(e){var t=ac(Zh(e)),n=["absolute","fixed"].indexOf(xa(e).position)>=0,r=n&&zr(e)?Qc(e):e;return as(r)?t.filter(function(i){return as(i)&&K6(i,r)&&Gi(i)!=="body"}):[]}function HQ(e,t,n,r){var i=t==="clippingParents"?jQ(e):[].concat(t),a=[].concat(i,[n]),o=a[0],s=a.reduce(function(l,u){var c=E4(e,u,r);return l.top=Qo(c.top,l.top),l.right=th(c.right,l.right),l.bottom=th(c.bottom,l.bottom),l.left=Qo(c.left,l.left),l},E4(e,o,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function X6(e){var t=e.reference,n=e.element,r=e.placement,i=r?Li(r):null,a=r?Il(r):null,o=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,l;switch(i){case rr:l={x:o,y:t.y-n.height};break;case Wr:l={x:o,y:t.y+t.height};break;case Kr:l={x:t.x+t.width,y:s};break;case ir:l={x:t.x-n.width,y:s};break;default:l={x:t.x,y:t.y}}var u=i?l9(i):null;if(u!=null){var c=u==="y"?"height":"width";switch(a){case Dl:l[u]=l[u]-(t[c]/2-n[c]/2);break;case Mc:l[u]=l[u]+(t[c]/2-n[c]/2);break}}return l}function Bc(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,a=n.strategy,o=a===void 0?e.strategy:a,s=n.boundary,l=s===void 0?sQ:s,u=n.rootBoundary,c=u===void 0?V6:u,d=n.elementContext,f=d===void 0?pu:d,h=n.altBoundary,m=h===void 0?!1:h,p=n.padding,y=p===void 0?0:p,v=Y6(typeof y!="number"?y:Z6(y,Zc)),b=f===pu?lQ:pu,_=e.rects.popper,T=e.elements[m?b:f],C=HQ(as(T)?T:T.contextElement||yo(e.elements.popper),l,c,o),x=Nl(e.elements.reference),w=X6({reference:x,element:_,strategy:"absolute",placement:i}),P=av(Object.assign({},_,w)),O=f===pu?P:x,M={top:C.top-O.top+v.top,bottom:O.bottom-C.bottom+v.bottom,left:C.left-O.left+v.left,right:O.right-C.right+v.right},R=e.modifiersData.offset;if(f===pu&&R){var D=R[i];Object.keys(M).forEach(function(S){var B=[Kr,Wr].indexOf(S)>=0?1:-1,H=[rr,Wr].indexOf(S)>=0?"y":"x";M[S]+=D[H]*B})}return M}function UQ(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,a=n.rootBoundary,o=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?q6:l,c=Il(r),d=c?s?g4:g4.filter(function(m){return Il(m)===c}):Zc,f=d.filter(function(m){return u.indexOf(m)>=0});f.length===0&&(f=d);var h=f.reduce(function(m,p){return m[p]=Bc(e,{placement:p,boundary:i,rootBoundary:a,padding:o})[Li(p)],m},{});return Object.keys(h).sort(function(m,p){return h[m]-h[p]})}function zQ(e){if(Li(e)===a9)return[];var t=Jd(e);return[b4(e),t,b4(t)]}function VQ(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,a=i===void 0?!0:i,o=n.altAxis,s=o===void 0?!0:o,l=n.fallbackPlacements,u=n.padding,c=n.boundary,d=n.rootBoundary,f=n.altBoundary,h=n.flipVariations,m=h===void 0?!0:h,p=n.allowedAutoPlacements,y=t.options.placement,v=Li(y),b=v===y,_=l||(b||!m?[Jd(y)]:zQ(y)),T=[y].concat(_).reduce(function(U,V){return U.concat(Li(V)===a9?UQ(t,{placement:V,boundary:c,rootBoundary:d,padding:u,flipVariations:m,allowedAutoPlacements:p}):V)},[]),C=t.rects.reference,x=t.rects.popper,w=new Map,P=!0,O=T[0],M=0;M<T.length;M++){var R=T[M],D=Li(R),S=Il(R)===Dl,B=[rr,Wr].indexOf(D)>=0,H=B?"width":"height",$=Bc(t,{placement:R,boundary:c,rootBoundary:d,altBoundary:f,padding:u}),F=B?S?Kr:ir:S?Wr:rr;C[H]>x[H]&&(F=Jd(F));var ne=Jd(F),J=[];if(a&&J.push($[D]<=0),s&&J.push($[F]<=0,$[ne]<=0),J.every(function(U){return U})){O=R,P=!1;break}w.set(R,J)}if(P)for(var I=m?3:1,A=function(V){var z=T.find(function(j){var ue=w.get(j);if(ue)return ue.slice(0,V).every(function(Q){return Q})});if(z)return O=z,"break"},Y=I;Y>0;Y--){var L=A(Y);if(L==="break")break}t.placement!==O&&(t.modifiersData[r]._skip=!0,t.placement=O,t.reset=!0)}}const qQ={name:"flip",enabled:!0,phase:"main",fn:VQ,requiresIfExists:["offset"],data:{_skip:!1}};function _4(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function T4(e){return[rr,Kr,Wr,ir].some(function(t){return e[t]>=0})}function WQ(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,a=t.modifiersData.preventOverflow,o=Bc(t,{elementContext:"reference"}),s=Bc(t,{altBoundary:!0}),l=_4(o,r),u=_4(s,i,a),c=T4(l),d=T4(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":d})}const KQ={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:WQ};function GQ(e,t,n){var r=Li(e),i=[ir,rr].indexOf(r)>=0?-1:1,a=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,o=a[0],s=a[1];return o=o||0,s=(s||0)*i,[ir,Kr].indexOf(r)>=0?{x:s,y:o}:{x:o,y:s}}function YQ(e){var t=e.state,n=e.options,r=e.name,i=n.offset,a=i===void 0?[0,0]:i,o=q6.reduce(function(c,d){return c[d]=GQ(d,t.rects,a),c},{}),s=o[t.placement],l=s.x,u=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=o}const ZQ={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:YQ};function QQ(e){var t=e.state,n=e.name;t.modifiersData[n]=X6({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const XQ={name:"popperOffsets",enabled:!0,phase:"read",fn:QQ,data:{}};function JQ(e){return e==="x"?"y":"x"}function eX(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,a=i===void 0?!0:i,o=n.altAxis,s=o===void 0?!1:o,l=n.boundary,u=n.rootBoundary,c=n.altBoundary,d=n.padding,f=n.tether,h=f===void 0?!0:f,m=n.tetherOffset,p=m===void 0?0:m,y=Bc(t,{boundary:l,rootBoundary:u,padding:d,altBoundary:c}),v=Li(t.placement),b=Il(t.placement),_=!b,T=l9(v),C=JQ(T),x=t.modifiersData.popperOffsets,w=t.rects.reference,P=t.rects.popper,O=typeof p=="function"?p(Object.assign({},t.rects,{placement:t.placement})):p,M=typeof O=="number"?{mainAxis:O,altAxis:O}:Object.assign({mainAxis:0,altAxis:0},O),R=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,D={x:0,y:0};if(x){if(a){var S,B=T==="y"?rr:ir,H=T==="y"?Wr:Kr,$=T==="y"?"height":"width",F=x[T],ne=F+y[B],J=F-y[H],I=h?-P[$]/2:0,A=b===Dl?w[$]:P[$],Y=b===Dl?-P[$]:-w[$],L=t.elements.arrow,U=h&&L?s9(L):{width:0,height:0},V=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:G6(),z=V[B],j=V[H],ue=ic(0,w[$],U[$]),Q=_?w[$]/2-I-ue-z-M.mainAxis:A-ue-z-M.mainAxis,ie=_?-w[$]/2+I+ue+j+M.mainAxis:Y+ue+j+M.mainAxis,le=t.elements.arrow&&Qc(t.elements.arrow),te=le?T==="y"?le.clientTop||0:le.clientLeft||0:0,Ae=(S=R==null?void 0:R[T])!=null?S:0,Oe=F+Q-Ae-te,Te=F+ie-Ae,se=ic(h?th(ne,Oe):ne,F,h?Qo(J,Te):J);x[T]=se,D[T]=se-F}if(s){var ve,ke=T==="x"?rr:ir,Fe=T==="x"?Wr:Kr,ht=x[C],gt=C==="y"?"height":"width",nt=ht+y[ke],ot=ht-y[Fe],je=[rr,ir].indexOf(v)!==-1,re=(ve=R==null?void 0:R[C])!=null?ve:0,ge=je?nt:ht-w[gt]-P[gt]-re+M.altAxis,Ne=je?ht+w[gt]+P[gt]-re-M.altAxis:ot,ye=h&&je?xQ(ge,ht,Ne):ic(h?ge:nt,ht,h?Ne:ot);x[C]=ye,D[C]=ye-ht}t.modifiersData[r]=D}}const tX={name:"preventOverflow",enabled:!0,phase:"main",fn:eX,requiresIfExists:["offset"]};function nX(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function rX(e){return e===wr(e)||!zr(e)?u9(e):nX(e)}function iX(e){var t=e.getBoundingClientRect(),n=Ol(t.width)/e.offsetWidth||1,r=Ol(t.height)/e.offsetHeight||1;return n!==1||r!==1}function aX(e,t,n){n===void 0&&(n=!1);var r=zr(t),i=zr(t)&&iX(t),a=yo(t),o=Nl(e,i,n),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((Gi(t)!=="body"||d9(a))&&(s=rX(t)),zr(t)?(l=Nl(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):a&&(l.x=c9(a))),{x:o.left+s.scrollLeft-l.x,y:o.top+s.scrollTop-l.y,width:o.width,height:o.height}}function oX(e){var t=new Map,n=new Set,r=[];e.forEach(function(a){t.set(a.name,a)});function i(a){n.add(a.name);var o=[].concat(a.requires||[],a.requiresIfExists||[]);o.forEach(function(s){if(!n.has(s)){var l=t.get(s);l&&i(l)}}),r.push(a)}return e.forEach(function(a){n.has(a.name)||i(a)}),r}function sX(e){var t=oX(e);return yQ.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function lX(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function uX(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var C4={placement:"bottom",modifiers:[],strategy:"absolute"};function x4(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function cX(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,i=t.defaultOptions,a=i===void 0?C4:i;return function(s,l,u){u===void 0&&(u=a);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},C4,a),modifiersData:{},elements:{reference:s,popper:l},attributes:{},styles:{}},d=[],f=!1,h={state:c,setOptions:function(v){var b=typeof v=="function"?v(c.options):v;p(),c.options=Object.assign({},a,c.options,b),c.scrollParents={reference:as(s)?ac(s):s.contextElement?ac(s.contextElement):[],popper:ac(l)};var _=sX(uX([].concat(r,c.options.modifiers)));return c.orderedModifiers=_.filter(function(T){return T.enabled}),m(),h.update()},forceUpdate:function(){if(!f){var v=c.elements,b=v.reference,_=v.popper;if(x4(b,_)){c.rects={reference:aX(b,Qc(_),c.options.strategy==="fixed"),popper:s9(_)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(M){return c.modifiersData[M.name]=Object.assign({},M.data)});for(var T=0;T<c.orderedModifiers.length;T++){if(c.reset===!0){c.reset=!1,T=-1;continue}var C=c.orderedModifiers[T],x=C.fn,w=C.options,P=w===void 0?{}:w,O=C.name;typeof x=="function"&&(c=x({state:c,options:P,name:O,instance:h})||c)}}}},update:lX(function(){return new Promise(function(y){h.forceUpdate(),y(c)})}),destroy:function(){p(),f=!0}};if(!x4(s,l))return h;h.setOptions(u).then(function(y){!f&&u.onFirstUpdate&&u.onFirstUpdate(y)});function m(){c.orderedModifiers.forEach(function(y){var v=y.name,b=y.options,_=b===void 0?{}:b,T=y.effect;if(typeof T=="function"){var C=T({state:c,name:v,instance:h,options:_}),x=function(){};d.push(C||x)}})}function p(){d.forEach(function(y){return y()}),d=[]}return h}}var dX=[RQ,XQ,IQ,_Q,ZQ,qQ,tX,SQ,KQ],fX=cX({defaultModifiers:dX}),hX=typeof Element<"u",pX=typeof Map=="function",mX=typeof Set=="function",gX=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function ef(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!ef(e[r],t[r]))return!1;return!0}var a;if(pX&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(a=e.entries();!(r=a.next()).done;)if(!t.has(r.value[0]))return!1;for(a=e.entries();!(r=a.next()).done;)if(!ef(r.value[1],t.get(r.value[0])))return!1;return!0}if(mX&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(a=e.entries();!(r=a.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(gX&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;if(hX&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((i[r]==="_owner"||i[r]==="__v"||i[r]==="__o")&&e.$$typeof)&&!ef(e[i[r]],t[i[r]]))return!1;return!0}return e!==e&&t!==t}var vX=function(t,n){try{return ef(t,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};const yX=gi(vX);var bX=[],EX=function(t,n,r){r===void 0&&(r={});var i=Nn.useRef(null),a={onFirstUpdate:r.onFirstUpdate,placement:r.placement||"bottom",strategy:r.strategy||"absolute",modifiers:r.modifiers||bX},o=Nn.useState({styles:{popper:{position:a.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),s=o[0],l=o[1],u=Nn.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(h){var m=h.state,p=Object.keys(m.elements);ND.flushSync(function(){l({styles:p4(p.map(function(y){return[y,m.styles[y]||{}]})),attributes:p4(p.map(function(y){return[y,m.attributes[y]]}))})})},requires:["computeStyles"]}},[]),c=Nn.useMemo(function(){var f={onFirstUpdate:a.onFirstUpdate,placement:a.placement,strategy:a.strategy,modifiers:[].concat(a.modifiers,[u,{name:"applyStyles",enabled:!1}])};return yX(i.current,f)?i.current||f:(i.current=f,f)},[a.onFirstUpdate,a.placement,a.strategy,a.modifiers,u]),d=Nn.useRef();return m4(function(){d.current&&d.current.setOptions(c)},[c]),m4(function(){if(!(t==null||n==null)){var f=r.createPopper||fX,h=f(t,n,c);return d.current=h,function(){h.destroy(),d.current=null}}},[t,n,r.createPopper]),{state:d.current?d.current.state:null,styles:s.styles,attributes:s.attributes,update:d.current?d.current.update:null,forceUpdate:d.current?d.current.forceUpdate:null}};function ov(){return ov=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},ov.apply(this,arguments)}function J6(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var _X=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,TX=J6(function(e){return _X.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),CX=!1;function xX(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function wX(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var AX=function(){function e(n){var r=this;this._insertTag=function(i){var a;r.tags.length===0?r.insertionPoint?a=r.insertionPoint.nextSibling:r.prepend?a=r.container.firstChild:a=r.before:a=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(i,a),r.tags.push(i)},this.isSpeedy=n.speedy===void 0?!CX:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(wX(this));var i=this.tags[this.tags.length-1];if(this.isSpeedy){var a=xX(i);try{a.insertRule(r,a.cssRules.length)}catch{}}else i.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){var i;return(i=r.parentNode)==null?void 0:i.removeChild(r)}),this.tags=[],this.ctr=0},e}(),Pn="-ms-",nh="-moz-",Ot="-webkit-",eA="comm",f9="rule",h9="decl",kX="@import",tA="@keyframes",SX="@layer",DX=Math.abs,Qh=String.fromCharCode,OX=Object.assign;function NX(e,t){return On(e,0)^45?(((t<<2^On(e,0))<<2^On(e,1))<<2^On(e,2))<<2^On(e,3):0}function nA(e){return e.trim()}function IX(e,t){return(e=t.exec(e))?e[0]:e}function Nt(e,t,n){return e.replace(t,n)}function sv(e,t){return e.indexOf(t)}function On(e,t){return e.charCodeAt(t)|0}function Lc(e,t,n){return e.slice(t,n)}function Di(e){return e.length}function p9(e){return e.length}function B1(e,t){return t.push(e),e}function PX(e,t){return e.map(t).join("")}var Xh=1,Pl=1,rA=0,ur=0,gn=0,Kl="";function Jh(e,t,n,r,i,a,o){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:Xh,column:Pl,length:o,return:""}}function mu(e,t){return OX(Jh("",null,null,"",null,null,0),e,{length:-e.length},t)}function RX(){return gn}function FX(){return gn=ur>0?On(Kl,--ur):0,Pl--,gn===10&&(Pl=1,Xh--),gn}function Tr(){return gn=ur<rA?On(Kl,ur++):0,Pl++,gn===10&&(Pl=1,Xh++),gn}function $i(){return On(Kl,ur)}function tf(){return ur}function Xc(e,t){return Lc(Kl,e,t)}function $c(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function iA(e){return Xh=Pl=1,rA=Di(Kl=e),ur=0,[]}function aA(e){return Kl="",e}function nf(e){return nA(Xc(ur-1,lv(e===91?e+2:e===40?e+1:e)))}function MX(e){for(;(gn=$i())&&gn<33;)Tr();return $c(e)>2||$c(gn)>3?"":" "}function BX(e,t){for(;--t&&Tr()&&!(gn<48||gn>102||gn>57&&gn<65||gn>70&&gn<97););return Xc(e,tf()+(t<6&&$i()==32&&Tr()==32))}function lv(e){for(;Tr();)switch(gn){case e:return ur;case 34:case 39:e!==34&&e!==39&&lv(gn);break;case 40:e===41&&lv(e);break;case 92:Tr();break}return ur}function LX(e,t){for(;Tr()&&e+gn!==47+10;)if(e+gn===42+42&&$i()===47)break;return"/*"+Xc(t,ur-1)+"*"+Qh(e===47?e:Tr())}function $X(e){for(;!$c($i());)Tr();return Xc(e,ur)}function jX(e){return aA(rf("",null,null,null,[""],e=iA(e),0,[0],e))}function rf(e,t,n,r,i,a,o,s,l){for(var u=0,c=0,d=o,f=0,h=0,m=0,p=1,y=1,v=1,b=0,_="",T=i,C=a,x=r,w=_;y;)switch(m=b,b=Tr()){case 40:if(m!=108&&On(w,d-1)==58){sv(w+=Nt(nf(b),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:w+=nf(b);break;case 9:case 10:case 13:case 32:w+=MX(m);break;case 92:w+=BX(tf()-1,7);continue;case 47:switch($i()){case 42:case 47:B1(HX(LX(Tr(),tf()),t,n),l);break;default:w+="/"}break;case 123*p:s[u++]=Di(w)*v;case 125*p:case 59:case 0:switch(b){case 0:case 125:y=0;case 59+c:v==-1&&(w=Nt(w,/\f/g,"")),h>0&&Di(w)-d&&B1(h>32?A4(w+";",r,n,d-1):A4(Nt(w," ","")+";",r,n,d-2),l);break;case 59:w+=";";default:if(B1(x=w4(w,t,n,u,c,i,s,_,T=[],C=[],d),a),b===123)if(c===0)rf(w,t,x,x,T,a,d,s,C);else switch(f===99&&On(w,3)===110?100:f){case 100:case 108:case 109:case 115:rf(e,x,x,r&&B1(w4(e,x,x,0,0,i,s,_,i,T=[],d),C),i,C,d,s,r?T:C);break;default:rf(w,x,x,x,[""],C,0,s,C)}}u=c=h=0,p=v=1,_=w="",d=o;break;case 58:d=1+Di(w),h=m;default:if(p<1){if(b==123)--p;else if(b==125&&p++==0&&FX()==125)continue}switch(w+=Qh(b),b*p){case 38:v=c>0?1:(w+="\f",-1);break;case 44:s[u++]=(Di(w)-1)*v,v=1;break;case 64:$i()===45&&(w+=nf(Tr())),f=$i(),c=d=Di(_=w+=$X(tf())),b++;break;case 45:m===45&&Di(w)==2&&(p=0)}}return a}function w4(e,t,n,r,i,a,o,s,l,u,c){for(var d=i-1,f=i===0?a:[""],h=p9(f),m=0,p=0,y=0;m<r;++m)for(var v=0,b=Lc(e,d+1,d=DX(p=o[m])),_=e;v<h;++v)(_=nA(p>0?f[v]+" "+b:Nt(b,/&\f/g,f[v])))&&(l[y++]=_);return Jh(e,t,n,i===0?f9:s,l,u,c)}function HX(e,t,n){return Jh(e,t,n,eA,Qh(RX()),Lc(e,2,-2),0)}function A4(e,t,n,r){return Jh(e,t,n,h9,Lc(e,0,r),Lc(e,r+1,-1),r)}function ul(e,t){for(var n="",r=p9(e),i=0;i<r;i++)n+=t(e[i],i,e,t)||"";return n}function UX(e,t,n,r){switch(e.type){case SX:if(e.children.length)break;case kX:case h9:return e.return=e.return||e.value;case eA:return"";case tA:return e.return=e.value+"{"+ul(e.children,r)+"}";case f9:e.value=e.props.join(",")}return Di(n=ul(e.children,r))?e.return=e.value+"{"+n+"}":""}function zX(e){var t=p9(e);return function(n,r,i,a){for(var o="",s=0;s<t;s++)o+=e[s](n,r,i,a)||"";return o}}function VX(e){return function(t){t.root||(t=t.return)&&e(t)}}var qX=function(t,n,r){for(var i=0,a=0;i=a,a=$i(),i===38&&a===12&&(n[r]=1),!$c(a);)Tr();return Xc(t,ur)},WX=function(t,n){var r=-1,i=44;do switch($c(i)){case 0:i===38&&$i()===12&&(n[r]=1),t[r]+=qX(ur-1,n,r);break;case 2:t[r]+=nf(i);break;case 4:if(i===44){t[++r]=$i()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=Qh(i)}while(i=Tr());return t},KX=function(t,n){return aA(WX(iA(t),n))},k4=new WeakMap,GX=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var n=t.value,r=t.parent,i=t.column===r.column&&t.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(t.props.length===1&&n.charCodeAt(0)!==58&&!k4.get(r))&&!i){k4.set(t,!0);for(var a=[],o=KX(n,a),s=r.props,l=0,u=0;l<o.length;l++)for(var c=0;c<s.length;c++,u++)t.props[u]=a[l]?o[l].replace(/&\f/g,s[c]):s[c]+" "+o[l]}}},YX=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function oA(e,t){switch(NX(e,t)){case 5103:return Ot+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Ot+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Ot+e+nh+e+Pn+e+e;case 6828:case 4268:return Ot+e+Pn+e+e;case 6165:return Ot+e+Pn+"flex-"+e+e;case 5187:return Ot+e+Nt(e,/(\w+).+(:[^]+)/,Ot+"box-$1$2"+Pn+"flex-$1$2")+e;case 5443:return Ot+e+Pn+"flex-item-"+Nt(e,/flex-|-self/,"")+e;case 4675:return Ot+e+Pn+"flex-line-pack"+Nt(e,/align-content|flex-|-self/,"")+e;case 5548:return Ot+e+Pn+Nt(e,"shrink","negative")+e;case 5292:return Ot+e+Pn+Nt(e,"basis","preferred-size")+e;case 6060:return Ot+"box-"+Nt(e,"-grow","")+Ot+e+Pn+Nt(e,"grow","positive")+e;case 4554:return Ot+Nt(e,/([^-])(transform)/g,"$1"+Ot+"$2")+e;case 6187:return Nt(Nt(Nt(e,/(zoom-|grab)/,Ot+"$1"),/(image-set)/,Ot+"$1"),e,"")+e;case 5495:case 3959:return Nt(e,/(image-set\([^]*)/,Ot+"$1$`$1");case 4968:return Nt(Nt(e,/(.+:)(flex-)?(.*)/,Ot+"box-pack:$3"+Pn+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Ot+e+e;case 4095:case 3583:case 4068:case 2532:return Nt(e,/(.+)-inline(.+)/,Ot+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Di(e)-1-t>6)switch(On(e,t+1)){case 109:if(On(e,t+4)!==45)break;case 102:return Nt(e,/(.+:)(.+)-([^]+)/,"$1"+Ot+"$2-$3$1"+nh+(On(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~sv(e,"stretch")?oA(Nt(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(On(e,t+1)!==115)break;case 6444:switch(On(e,Di(e)-3-(~sv(e,"!important")&&10))){case 107:return Nt(e,":",":"+Ot)+e;case 101:return Nt(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Ot+(On(e,14)===45?"inline-":"")+"box$3$1"+Ot+"$2$3$1"+Pn+"$2box$3")+e}break;case 5936:switch(On(e,t+11)){case 114:return Ot+e+Pn+Nt(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Ot+e+Pn+Nt(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Ot+e+Pn+Nt(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Ot+e+Pn+e+e}return e}var ZX=function(t,n,r,i){if(t.length>-1&&!t.return)switch(t.type){case h9:t.return=oA(t.value,t.length);break;case tA:return ul([mu(t,{value:Nt(t.value,"@","@"+Ot)})],i);case f9:if(t.length)return PX(t.props,function(a){switch(IX(a,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return ul([mu(t,{props:[Nt(a,/:(read-\w+)/,":"+nh+"$1")]})],i);case"::placeholder":return ul([mu(t,{props:[Nt(a,/:(plac\w+)/,":"+Ot+"input-$1")]}),mu(t,{props:[Nt(a,/:(plac\w+)/,":"+nh+"$1")]}),mu(t,{props:[Nt(a,/:(plac\w+)/,Pn+"input-$1")]})],i)}return""})}},QX=[ZX],XX=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(p){var y=p.getAttribute("data-emotion");y.indexOf(" ")!==-1&&(document.head.appendChild(p),p.setAttribute("data-s",""))})}var i=t.stylisPlugins||QX,a={},o,s=[];o=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(p){for(var y=p.getAttribute("data-emotion").split(" "),v=1;v<y.length;v++)a[y[v]]=!0;s.push(p)});var l,u=[GX,YX];{var c,d=[UX,VX(function(p){c.insert(p)})],f=zX(u.concat(i,d)),h=function(y){return ul(jX(y),f)};l=function(y,v,b,_){c=b,h(y?y+"{"+v.styles+"}":v.styles),_&&(m.inserted[v.name]=!0)}}var m={key:n,sheet:new AX({key:n,container:o,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:a,registered:{},insert:l};return m.sheet.hydrate(s),m},sA=$v(),JX={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},eJ={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},lA={};lA[sA.ForwardRef]=JX;lA[sA.Memo]=eJ;var tJ=!0;function nJ(e,t,n){var r="";return n.split(" ").forEach(function(i){e[i]!==void 0?t.push(e[i]+";"):i&&(r+=i+" ")}),r}var uA=function(t,n,r){var i=t.key+"-"+n.name;(r===!1||tJ===!1)&&t.registered[i]===void 0&&(t.registered[i]=n.styles)},rJ=function(t,n,r){uA(t,n,r);var i=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var a=n;do t.insert(n===a?"."+i:"",a,t.sheet,!0),a=a.next;while(a!==void 0)}};function iJ(e){for(var t=0,n,r=0,i=e.length;i>=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var aJ={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},oJ=!1,sJ=/[A-Z]|^ms/g,lJ=/_EMO_([^_]+?)_([^]*?)_EMO_/g,cA=function(t){return t.charCodeAt(1)===45},S4=function(t){return t!=null&&typeof t!="boolean"},Hm=J6(function(e){return cA(e)?e:e.replace(sJ,"-$&").toLowerCase()}),D4=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(lJ,function(r,i,a){return Oi={name:i,styles:a,next:Oi},i})}return aJ[t]!==1&&!cA(t)&&typeof n=="number"&&n!==0?n+"px":n},uJ="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function jc(e,t,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var i=n;if(i.anim===1)return Oi={name:i.name,styles:i.styles,next:Oi},i.name;var a=n;if(a.styles!==void 0){var o=a.next;if(o!==void 0)for(;o!==void 0;)Oi={name:o.name,styles:o.styles,next:Oi},o=o.next;var s=a.styles+";";return s}return cJ(e,t,n)}case"function":{if(e!==void 0){var l=Oi,u=n(e);return Oi=l,jc(e,t,u)}break}}var c=n;if(t==null)return c;var d=t[c];return d!==void 0?d:c}function cJ(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=jc(e,t,n[i])+";";else for(var a in n){var o=n[a];if(typeof o!="object"){var s=o;t!=null&&t[s]!==void 0?r+=a+"{"+t[s]+"}":S4(s)&&(r+=Hm(a)+":"+D4(a,s)+";")}else{if(a==="NO_COMPONENT_SELECTOR"&&oJ)throw new Error(uJ);if(Array.isArray(o)&&typeof o[0]=="string"&&(t==null||t[o[0]]===void 0))for(var l=0;l<o.length;l++)S4(o[l])&&(r+=Hm(a)+":"+D4(a,o[l])+";");else{var u=jc(e,t,o);switch(a){case"animation":case"animationName":{r+=Hm(a)+":"+u+";";break}default:r+=a+"{"+u+"}"}}}}return r}var O4=/label:\s*([^\s;{]+)\s*(;|$)/g,Oi;function dA(e,t,n){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,i="";Oi=void 0;var a=e[0];if(a==null||a.raw===void 0)r=!1,i+=jc(n,t,a);else{var o=a;i+=o[0]}for(var s=1;s<e.length;s++)if(i+=jc(n,t,e[s]),r){var l=a;i+=l[s]}O4.lastIndex=0;for(var u="",c;(c=O4.exec(i))!==null;)u+="-"+c[1];var d=iJ(i)+u;return{name:d,styles:i,next:Oi}}var dJ=function(t){return t()},fJ=Nn["useInsertionEffect"]?Nn["useInsertionEffect"]:!1,hJ=fJ||dJ,fA=Nn.createContext(typeof HTMLElement<"u"?XX({key:"css"}):null);fA.Provider;var pJ=function(t){return E.forwardRef(function(n,r){var i=E.useContext(fA);return t(n,i,r)})},mJ=Nn.createContext({});function gJ(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return dA(t)}var vJ=function(){var t=gJ.apply(void 0,arguments),n="animation-"+t.name;return{name:n,styles:"@keyframes "+n+"{"+t.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}},yJ=TX,bJ=function(t){return t!=="theme"},N4=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?yJ:bJ},I4=function(t,n,r){var i;if(n){var a=n.shouldForwardProp;i=t.__emotion_forwardProp&&a?function(o){return t.__emotion_forwardProp(o)&&a(o)}:a}return typeof i!="function"&&r&&(i=t.__emotion_forwardProp),i},EJ=!1,_J=function(t){var n=t.cache,r=t.serialized,i=t.isStringTag;return uA(n,r,i),hJ(function(){return rJ(n,r,i)}),null},TJ=function e(t,n){var r=t.__emotion_real===t,i=r&&t.__emotion_base||t,a,o;n!==void 0&&(a=n.label,o=n.target);var s=I4(t,n,r),l=s||N4(i),u=!l("as");return function(){var c=arguments,d=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(a!==void 0&&d.push("label:"+a+";"),c[0]==null||c[0].raw===void 0)d.push.apply(d,c);else{d.push(c[0][0]);for(var f=c.length,h=1;h<f;h++)d.push(c[h],c[0][h])}var m=pJ(function(p,y,v){var b=u&&p.as||i,_="",T=[],C=p;if(p.theme==null){C={};for(var x in p)C[x]=p[x];C.theme=Nn.useContext(mJ)}typeof p.className=="string"?_=nJ(y.registered,T,p.className):p.className!=null&&(_=p.className+" ");var w=dA(d.concat(T),y.registered,C);_+=y.key+"-"+w.name,o!==void 0&&(_+=" "+o);var P=u&&s===void 0?N4(b):l,O={};for(var M in p)u&&M==="as"||P(M)&&(O[M]=p[M]);return O.className=_,v&&(O.ref=v),Nn.createElement(Nn.Fragment,null,Nn.createElement(_J,{cache:y,serialized:w,isStringTag:typeof b=="string"}),Nn.createElement(b,O))});return m.displayName=a!==void 0?a:"Styled("+(typeof i=="string"?i:i.displayName||i.name||"Component")+")",m.defaultProps=t.defaultProps,m.__emotion_real=m,m.__emotion_base=i,m.__emotion_styles=d,m.__emotion_forwardProp=s,Object.defineProperty(m,"toString",{value:function(){return o===void 0&&EJ?"NO_COMPONENT_SELECTOR":"."+o}}),m.withComponent=function(p,y){return e(p,ov({},n,y,{shouldForwardProp:I4(m,y,!0)})).apply(void 0,d)},m}},CJ=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],Be=TJ.bind();CJ.forEach(function(e){Be[e]=Be(e)});var xs={}.hasOwnProperty,hA=xJ;function xJ(e){return!e||typeof e!="object"?"":xs.call(e,"position")||xs.call(e,"type")?P4(e.position):xs.call(e,"start")||xs.call(e,"end")?P4(e):xs.call(e,"line")||xs.call(e,"column")?uv(e):""}function uv(e){return(!e||typeof e!="object")&&(e={}),R4(e.line)+":"+R4(e.column)}function P4(e){return(!e||typeof e!="object")&&(e={}),uv(e.start)+"-"+uv(e.end)}function R4(e){return e&&typeof e=="number"?e:1}var wJ=hA,AJ=m9;function pA(){}pA.prototype=Error.prototype;m9.prototype=new pA;var bo=m9.prototype;bo.file="";bo.name="";bo.reason="";bo.message="";bo.stack="";bo.fatal=null;bo.column=null;bo.line=null;function m9(e,t,n){var r,i,a;typeof t=="string"&&(n=t,t=null),r=kJ(n),i=wJ(t)||"1:1",a={start:{line:null,column:null},end:{line:null,column:null}},t&&t.position&&(t=t.position),t&&(t.start?(a=t,t=t.start):a.start=t),e.stack&&(this.stack=e.stack,e=e.message),this.message=e,this.name=i,this.reason=e,this.line=t?t.line:null,this.column=t?t.column:null,this.location=a,this.source=r[0],this.ruleId=r[1]}function kJ(e){var t=[null,null],n;return typeof e=="string"&&(n=e.indexOf(":"),n===-1?t[1]=e:(t[0]=e.slice(0,n),t[1]=e.slice(n+1))),t}var Gl={};Gl.basename=SJ;Gl.dirname=DJ;Gl.extname=OJ;Gl.join=NJ;Gl.sep="/";function SJ(e,t){var n=0,r=-1,i,a,o,s;if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');if(Jc(e),i=e.length,t===void 0||!t.length||t.length>e.length){for(;i--;)if(e.charCodeAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";for(a=-1,s=t.length-1;i--;)if(e.charCodeAt(i)===47){if(o){n=i+1;break}}else a<0&&(o=!0,a=i+1),s>-1&&(e.charCodeAt(i)===t.charCodeAt(s--)?s<0&&(r=i):(s=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function DJ(e){var t,n,r;if(Jc(e),!e.length)return".";for(t=-1,r=e.length;--r;)if(e.charCodeAt(r)===47){if(n){t=r;break}}else n||(n=!0);return t<0?e.charCodeAt(0)===47?"/":".":t===1&&e.charCodeAt(0)===47?"//":e.slice(0,t)}function OJ(e){var t=-1,n=0,r=-1,i=0,a,o,s;for(Jc(e),s=e.length;s--;){if(o=e.charCodeAt(s),o===47){if(a){n=s+1;break}continue}r<0&&(a=!0,r=s+1),o===46?t<0?t=s:i!==1&&(i=1):t>-1&&(i=-1)}return t<0||r<0||i===0||i===1&&t===r-1&&t===n+1?"":e.slice(t,r)}function NJ(){for(var e=-1,t;++e<arguments.length;)Jc(arguments[e]),arguments[e]&&(t=t===void 0?arguments[e]:t+"/"+arguments[e]);return t===void 0?".":IJ(t)}function IJ(e){var t,n;return Jc(e),t=e.charCodeAt(0)===47,n=PJ(e,!t),!n.length&&!t&&(n="."),n.length&&e.charCodeAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function PJ(e,t){for(var n="",r=0,i=-1,a=0,o=-1,s,l;++o<=e.length;){if(o<e.length)s=e.charCodeAt(o);else{if(s===47)break;s=47}if(s===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.charCodeAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=o,a=0;continue}}else if(n.length){n="",r=0,i=o,a=0;continue}}t&&(n=n.length?n+"/..":"..",r=2)}else n.length?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function Jc(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}var mA={};mA.cwd=RJ;function RJ(){return"/"}/*!
|
|
166
166
|
* Determine if an object is a Buffer
|
|
167
167
|
*
|
|
168
168
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
@@ -568,4 +568,4 @@ and limitations under the License.
|
|
|
568
568
|
.Toastify__toast-body {
|
|
569
569
|
padding: 0px;
|
|
570
570
|
}
|
|
571
|
-
`]))),Ege={storeData:{},unseenCount:0,hasNext:!1,initialLoading:!1,fetchMoreLoading:!1};E.createContext({notificationsData:Ege});function _ge(e){var t=e.workspaceKey,n=t===void 0?"":t,r=e.tenantId,i=r===void 0?"":r,a=e.distinctId,o=a===void 0?"":a,s=e.subscriberId,l=s===void 0?"":s,u=e.inboxId,c=u===void 0?"":u,d=e.stores,f=e.toastProps,h=e.notificationClickHandler,m=e.primaryActionClickHandler,p=e.secondaryActionClickHandler,y=e.bellComponent,v=e.badgeComponent,b=e.notificationComponent,_=e.noNotificationsComponent,T=e.loaderComponent,C=e.tabBadgeComponent,x=e.headerRightComponent,w=e.hideAvatar,P=w===void 0?!1:w,O=e.hideInbox,M=e.hideToast,R=e.theme,D=e.themeType,S=D===void 0?"light":D,B=e.pagination,H=B===void 0?!0:B,$=e.pageSize,F=e.popperPosition,ne=F===void 0?"bottom":F,J=e.showUnreadCountOnTabs,I=J===void 0?!0:J,A=e.host;c&&(l=c);var Y=E.useState(!1),L=Y[0],U=Y[1],V=E.useState(),z=V[0],j=V[1],ue=E.useState({storeData:{},count:0}),Q=ue[0],ie=ue[1],le=E.useState(""),te=le[0],Ae=le[1],Oe=E.useState(!1),Te=Oe[0],se=Oe[1];E.useEffect(function(){var ke=new oQ(n,{pageSize:$,tenantID:i,stores:d,host:A});return j(ke),ke.emitter.on("sync_notif_store",function(){var Fe=ke.feed.data;ie({storeData:(Fe==null?void 0:Fe.stores)||{},count:(Fe==null?void 0:Fe.unseenCount)||0,hasNext:Fe==null?void 0:Fe.hasNext,initialLoading:Fe==null?void 0:Fe.initialLoading,activeStoreId:Fe==null?void 0:Fe.activeStoreId}),Ae(Fe==null?void 0:Fe.activeStoreId)}),ke.emitter.on("new_notification",function(Fe){yge({notificationsData:Fe,toastProps:f})}),function(){ke.emitter.all.clear()}},[]),E.useEffect(function(){L&&l&&z&&z.feed.markAllSeen()},[L,l,z]),E.useEffect(function(){if(!(!l||!z))return ie({storeData:{},count:0}),z.identifyUser(o,l),z.feed.fetchNotifications(),function(){z.resetUser()}},[l,z]);var ve=S==="dark"?rD(Jme,R):R||{};return E.createElement(tD.Provider,{value:ve},E.createElement(eD.Provider,{value:{workspaceKey:n,notificationsData:Q,setNotificationsData:ie,notificationClickHandler:h,primaryActionClickHandler:m,secondaryActionClickHandler:p,bellComponent:y,badgeComponent:v,notificationComponent:b,noNotificationsComponent:_,tabBadgeComponent:C,headerRightComponent:x,toggleInbox:U,inbox:z,loaderComponent:T,pagination:H,hideAvatar:P,activeStore:te,setActiveStore:Ae,changingActiveStore:Te,setChangingActiveStore:se,showUnreadCountOnTabs:I,themeType:S}},!O&&E.createElement(lge,{openInbox:L,toggleInbox:U,popperPosition:ne}),!M&&E.createElement(vge,f)))}const Lt={timeouts:{},handlerCalled:{},getIsDesktopVersion:(e,t)=>{const n={navigation:{loggedIn:769,loggedOut:881},search:{loggedIn:961,loggedOut:1121}},r=a=>{const o=`logged${e?"In":"Out"}`;return t>=n[a][o]};let i={};return["navigation","search"].forEach(a=>{i[a]=r(a)}),i},shouldChangeHeaderIsVisible:(e,t,n)=>{Object.values(t).filter(i=>i===!0).length||n([{type:"headerIsVisible",value:e}])},handleMenus:({id:e,value:t,menus:n,dispatch:r,forceHandle:i=!1})=>{if(!i&&n[e]===t||!i&&e===vr.ACCOUNT&&t===!1&&n[vr.SITE]===!0)return;const a=Date.now();if(!i&&!t&&Lt.handlerCalled[e]&&a-Lt.handlerCalled[e]<500)return;Lt.handlerCalled[e]=a;let o=[{type:`menus.${e}`,value:t}];if(t===!0)Object.keys(n).forEach(s=>{s===e||n[s]===!1||o.push({type:`menus.${s}`,value:!1})});else{let s=null;switch(e){case vr.SITE:s=document.querySelector("#header .menu-button"),s||(s=document.querySelector("#navigation .navigation-button"));break;case vr.SEARCH:s=document.querySelector("#header .toggle-search-button");break;case vr.ACCOUNT:s=document.querySelector("#header .account-button");break;default:return}s&&s.focus()}r(o)},findFirstChild:(e,t,n=!1)=>{if(!e||!e[0])return!1;for(let r=0;r<=e.length;r++){if(!e[r])continue;if(e[r][t]&&(!n||e[r][t].includes(n)))return e[r];if(!t.includes("."))continue;const i=OC(e[r],t);if(!(typeof i>"u")&&(!n||i[t]&&i[t].includes(n)||i.value&&i.value.includes(n)||i.toString().includes(n)))return e[r]}return e[0].children?Lt.findFirstChild(e[0].children,t,n):!1},autoFocus:({menu:e,navigationRef:t,isDesktopVersion:n,focusElements:r,dispatch:i})=>{var l;if(!t.current||!t.current.children)return;const a=n?"desktop":"default";if(r[e][a]){(l=document.querySelector(`#header ul a[href="${r[e][a]}"]:last-child`))==null||l.focus();return}let o,s;switch(e){case vr.SITE:if(n){const u=Lt.findFirstChild(t.current.children,"className","has-submenu parent"),c=Lt.findFirstChild(u.children,"id",vr.SITE);o=Lt.findFirstChild(c.children,"href")}else o=Lt.findFirstChild(t.current.children,"href");break;case vr.ACCOUNT:if(s=Lt.findFirstChild(t.current.children,"className","account"),!s||!s.children)return;o=Lt.findFirstChild(s.children,"href");break;default:return}o&&(i([{type:`focusElements.${e}.${a}`,value:o.attributes.href.value}]),o.focus())},events:{onClick:(e,{id:t,callback:n,isOpen:r})=>{e.target&&e.target.attributes&&e.target.attributes.href||(e.preventDefault(),e.stopPropagation(),clearTimeout(Lt.timeouts[t]),n(t,!r))},onFocus:({id:e})=>{clearTimeout(Lt.timeouts[e])},onMouseEnter:({id:e,callback:t})=>{clearTimeout(Lt.timeouts[e]),t(e,!0)},onBlur:({id:e,callback:t})=>{Lt.timeouts[e]=setTimeout(()=>{t(e,!1)},250)}}},zc={order:["home","communities","topics","partners","account"],home:{href:"/home/",hasVariantText:!0,gtmType:"homepage-click"},communities:{href:"/communities/",gtmType:"communities-click",onlyShow:"logged-in"},topics:{order:["explore","topics"],menuId:"site-navigation",explore:{order:["events","courses","articles","communities"],events:{href:"/events/",className:"icon events"},courses:{href:"/microcourses/",gtmType:"microcourses-click",className:"icon courses"},articles:{href:"/solution-articles/",gtmType:"articles-click",className:"icon articles"},communities:{href:"/communities/",gtmType:"communities-click",className:"icon communities"}},topics:{order:["climate","cities-and-local-government","digital-and-data","education","equity-justice-and-inclusion","health-and-social-care","innovation","leadership-and-skills","life-in-government","policymaking","transport-and-infrastructure","work-and-the-economy"],className:"columns",climate:{href:"/topics/climate/"},"cities-and-local-government":{href:"/topics/cities-and-local-government/"},"digital-and-data":{href:"/topics/digital-and-data/"},education:{href:"/topics/education/"},"equity-justice-and-inclusion":{href:"/topics/equity-justice-and-inclusion/"},"health-and-social-care":{href:"/topics/health-and-social-care/"},innovation:{href:"/topics/innovation/"},"leadership-and-skills":{href:"/topics/leadership-and-skills/"},"life-in-government":{href:"/topics/life-in-government/"},policymaking:{href:"/topics/policymaking/"},"transport-and-infrastructure":{href:"/topics/transport-and-infrastructure/"},"work-and-the-economy":{href:"/topics/work-and-the-economy/"}}},partners:{href:"/partnerships/",onlyShow:"logged-out"},account:{menuId:"account-navigation",order:["profile","settings","log-out"],className:"account",onlyShow:"logged-in",doTrack:!1,profile:{href:"/profiles/me"},settings:{href:"/profiles/me/manage-account"},"log-out":{href:"/user-onboarding/logout",className:"divider"}},buttons:{order:["login","signup"],login:{href:"/login",withReturnTo:!0},signup:{href:"/signup?ref=header-banner",props:{variant:"primary"}}}},dh=({id:e,isLoggedIn:t=!1,isDesktopVersion:n=!1,menus:r={},callback:i=()=>{},doTrack:a=null})=>{const o=me.useIntl(),s=OC(zc,e);if(!s||s.onlyShow&&(s.onlyShow==="logged-in"&&!t||s.onlyShow==="logged-out"&&t))return null;const l="doTrack"in s,u=a===null?l?s.doTrack:!0:a,c=e.includes("buttons.");let d=`header_${e.replaceAll(".","_")}`;s.hasVariantText&&(d+=`_logged${t?"In":"Out"}`);let f=!1;if(s.href){let _=s.gtmType||`${e}-click`;if(_.includes(".")){const T=_.split("."),C=T[T.length-2];_=`${C==="topics"?`${C}-`:""}${T[T.length-1]}`}f={href:s.withReturnTo?`${s.href}?returnTo=${window.location.pathname}`:s.href},u&&(f={...f,className:"gtm-trackable","data-gtm-event-type":_,"data-gtm-event-context":"HeaderButtons"}),c&&(f={...f,variant:"secondary",size:{mobile:"small",881:"large"},...s.props||{}})}const h=s.order&&s.order[0]&&s[s.order[0]],m=h&&s[s.order[0]].order,p=f&&window.location.pathname===s.href;let y={},v={},b={};if(p&&(y={...y,"aria-current":"page"}),h){const _=s.menuId||e,T={onClick:C=>Lt.events.onClick(C,{id:_,callback:i,isOpen:r[_]}),onFocus:()=>Lt.events.onFocus({id:_}),onBlur:()=>Lt.events.onBlur({id:_,callback:i}),onMouseLeave:()=>Lt.events.onBlur({id:_,callback:i}),onMouseEnter:()=>Lt.events.onMouseEnter({id:_,callback:i})};v={...T,id:_===vr.SITE?vr.SITE:vr.ACCOUNT},n&&(m&&(b={...T,className:"navigation-button",onKeyPress:C=>{C.key==="Enter"&&Lt.events.onClick(C,{id:_,callback:i,isOpen:r[_]})},"aria-haspopup":!0,"aria-expanded":r[_],"aria-controls":_}),v={...v,hidden:_ in r?!r[_]:!0}),m||(v={...v})}return g.jsxs("li",{className:ee({[s.className]:s.className,"has-submenu":h,parent:m,active:p}),...y,children:[f?E.createElement(c?Ke:"a",f,o.formatMessage({id:d})):n&&s.order&&m?g.jsxs("button",{...b,children:[o.formatMessage({id:d}),g.jsx(xt,{children:o.formatMessage({id:`header_menu_${r[vr.SITE]?"hide":"show"}`})})]}):o.formatMessage({id:d}),s.order&&g.jsx("ul",{...v,children:s.order.map(_=>{if(!s[_])return null;const T={isLoggedIn:t,isDesktopVersion:n,menus:r,callback:i,doTrack:l?u:null};return s[_].order?g.jsxs("li",{className:ee({[s[_].className]:s[_].className}),children:[o.formatMessage({id:`${d}_${_}`}),g.jsx("ul",{children:s[_].order.map(C=>g.jsx(dh,{id:`${e}.${_}.${C}`,...T},C))})]},_):g.jsx(dh,{id:`${e}.${_}`,...T},_)})})]},e)};const Tge=({headerIsVisible:e,locale:t})=>{const n=me.useIntl();return g.jsx("div",{id:"language-unavailable-message",className:ee({visible:e}),children:g.jsx("p",{className:"text",children:n.formatMessage({id:`header_language_unavailable_${t}`},{link:r=>g.jsx("a",{href:"/home",children:r})})})})};const q0={height:67,height_desktop:83,additional_message_height:40};var vr=(e=>(e.NAVIGATION="navigation",e.SEARCH="search",e.ACCOUNT="account-navigation",e.SITE="site-navigation",e))(vr||{});const l5=({showNavigation:e=!0,showLanguageUnavailableMessage:t=!0,showLanguageSwitcher:n=!0,onLanguageSwitcherClick:r,suprSendWorkspaceKey:i,novuApplicationIdentifier:a})=>{var B,H;const o=me.useIntl(),s=E.useContext(fn),l=lo(!0,!0),u=s&&typeof s.id=="string",c=E.useMemo(()=>Lt.getIsDesktopVersion(u,l),[u,l]),d=Op("suprsend-notifications")&&i,f=(H=(B=s==null?void 0:s.externalsMetadata)==null?void 0:B.suprsend)==null?void 0:H.subscriberId,h=Op("novu-notifications")&&a,m=Op("language-switcher")&&n,[p,y]=E.useState(!1);E.useEffect(()=>{t&&m&&(s!=null&&s.id)&&(s==null?void 0:s.locale)!==yl&&y(!0)},[t,m,s]);const[v,b]=E.useReducer(Rl,{headerIsVisible:!0,menus:{"site-navigation":!1,search:!1,"account-navigation":!1},focusElements:{"site-navigation":{desktop:!1,default:!1},"account-navigation":{desktop:!1,default:!1}}}),{headerIsVisible:_,menus:T,focusElements:C}=v,x=E.useRef(v);E.useEffect(()=>{x.current=v},[v]),LC({scrollPosition:p?q0[`height${c.navigation?"_desktop":""}`]+q0.additional_message_height:q0[`height${c.navigation?"_desktop":""}`],callbacks:{scrollUp:()=>{const $=x.current.menus;!c&&$["site-navigation"]||Lt.shouldChangeHeaderIsVisible(!0,$,b)},scrollDown:()=>{const $=x.current.menus;!c&&$["site-navigation"]||Lt.shouldChangeHeaderIsVisible(!1,$,b)}}});const w=($,F,ne=!1)=>{Lt.handleMenus({id:$,value:F,menus:x.current.menus,dispatch:b,forceHandle:ne})},P=E.useRef(null),O=$=>{$.key==="Escape"&&["site-navigation","search","account-navigation"].forEach(F=>{x.current.menus[F]&&w(F,!1,!0)})};E.useEffect(()=>{var $;return($=document.getElementById("header"))==null||$.addEventListener("keydown",O),()=>{var F;(F=document.getElementById("header"))==null||F.removeEventListener("keydown",O)}},[]),ml(()=>{T["site-navigation"]&&Lt.autoFocus({menu:"site-navigation",navigationRef:P,isDesktopVersion:c.navigation,focusElements:C,dispatch:b})},[T["site-navigation"]]),ml(()=>{T["account-navigation"]&&Lt.autoFocus({menu:"account-navigation",navigationRef:P,isDesktopVersion:c.navigation,focusElements:C,dispatch:b})},[T["account-navigation"]]);const M=g.jsxs(g.Fragment,{children:[!c.search&&g.jsx("button",{className:"search toggle-search-button",onClick:$=>{$.preventDefault(),$.stopPropagation(),w("search",!T.search)},children:g.jsx(xt,{children:o.formatMessage({id:`header_search_${T.search?"hide":"show"}`})})}),g.jsx(Nw,{id:"global-search",handleToggle:{searchIsOpen:T.search,isDesktopVersion:c.search},gtmContext:"search-bar-header",gtmEvent:"form-submission"})]}),R=g.jsx("button",{className:"earth icon language-switcher-button","aria-label":"Language switcher",onClick:$=>{$.preventDefault(),$.stopPropagation(),r?r():y(!p)},children:g.jsx(xt,{children:o.formatMessage({id:"header_language_switcher"})})}),D=[d&&f&&g.jsx("div",{id:"suprsend-notifications",children:g.jsx(_ge,{workspaceKey:i,distinctId:(s==null?void 0:s.id)??"",subscriberId:f,theme:{badge:{backgroundColor:"#C34141"},header:{markAllReadText:{color:"#4F43BA"}},notification:{unseenDot:{backgroundColor:"#C34141"},container:{unreadBackgroundColor:"white",readBackgroundColor:"white",hoverBackgroundColor:"#F0F5FF",borderColor:"#D7E0EF"},headerText:{color:"#151921"},bodyText:{color:"#151921"},subtext:{color:"#404A61"},actions:[{container:{backgroundColor:"#4F43BA"}},{container:{borderColor:"#4F43BA",color:"#4F43BA",backgroundColor:"white"}}]}}})}),h&&(s==null?void 0:s.id)&&g.jsx("div",{className:"novu-notifications",children:g.jsx(AZ,{applicationIdentifier:a,subscriberId:s==null?void 0:s.id,routerPush:$=>window.location.href=$,backendUrl:"https://eu.api.novu.co",socketUrl:"https://eu.ws.novu.co",appearance:{variables:{colorBackground:"#FFFFFF",colorForeground:"#151921",colorPrimary:"#4F43BA",fontSize:"24px"},elements:{notificationPrimaryAction__button:{borderRadius:"16px"}}}})})],S=g.jsxs(g.Fragment,{children:[!c.navigation&&g.jsx("button",{className:"menu-button gtm-trackable",onClick:$=>{$.preventDefault(),$.stopPropagation(),w("site-navigation",!T["site-navigation"])},"data-gtm-event-type":"open-tab-menu-click","data-gtm-event-context":"HeaderLeft-Chevron","aria-haspopup":"true","aria-expanded":T["site-navigation"],"aria-controls":"site-navigation",children:g.jsx(xt,{children:o.formatMessage({id:`header_menu_${T["site-navigation"]?"hide":"show"}`})})}),g.jsx("ul",{ref:P,id:"navigation",hidden:c.navigation||T["account-navigation"]?!1:!T["site-navigation"],"data-showing":!c.navigation&&T["account-navigation"]?"account":"default",children:zc.order.map($=>g.jsx(dh,{id:$,isLoggedIn:u,isDesktopVersion:c.navigation,menus:{"site-navigation":T["site-navigation"],"account-navigation":T["account-navigation"]},callback:w},$))})]});return s&&s.isLoading?null:g.jsxs(g.Fragment,{children:[g.jsxs("nav",{id:"header",className:ee({"logged-in":u,"logged-out":!u,visible:_}),children:[g.jsx(xt,{element:"a",href:"#content-of-page",children:o.formatMessage({id:"header_skip"})}),g.jsx(Xv,{variant:"monochrome"}),e?g.jsxs(g.Fragment,{children:[c.navigation?g.jsxs(g.Fragment,{children:[S,M,m&&R,D]}):g.jsxs(g.Fragment,{children:[M,m&&R,D,S]}),u?g.jsxs("button",{className:"account-button",onClick:$=>Lt.events.onClick($,{id:"account-navigation",callback:w,isOpen:T["account-navigation"]}),onMouseEnter:()=>Lt.events.onMouseEnter({id:"account-navigation",callback:w}),onMouseLeave:()=>Lt.events.onBlur({id:"account-navigation",callback:w}),"aria-haspopup":"true","aria-expanded":T["account-navigation"],"aria-controls":"account-navigation",children:[g.jsx(xt,{children:o.formatMessage({id:`header_account_${T["account-navigation"]?"hide":"show"}`})}),g.jsx(ka,{name:s&&s.name||"",src:s&&s.image&&s.image.thumbnail||""})]}):g.jsx("ul",{className:"sign-in-buttons",children:zc.buttons.order.map($=>g.jsx(dh,{id:`buttons.${$}`},$))})]}):m&&R]}),p&&g.jsx(Tge,{headerIsVisible:_,locale:(s==null?void 0:s.locale)||yl}),g.jsx("hr",{id:"content-of-page"}),g.jsx("div",{className:ee("overlay",{open:T["site-navigation"]||T["account-navigation"]||!c.search&&T.search})})]})};const Cge=()=>{const e=me.useIntl();return g.jsxs(g.Fragment,{children:[g.jsx(l5,{}),g.jsx("div",{id:"content",children:g.jsx(Ui,{variant:"error",text:e.formatMessage({id:"pageLayout_error"})})}),g.jsx(Sy,{})]})},sD=({children:e,additionalContent:{prepended:t,appended:n}={},reportError:r,forceShow:i={},styling:a={},className:o="",locale:s="en",suprSendWorkspaceKey:l,novuApplicationIdentifier:u})=>{const c=me.useIntl(),{navigation:d=!0,footer:f=!0}=i,{background:h="default",variant:m="default",circle:p="default",modal:y="default"}=a,v=MC(),[b,_]=E.useState(""),T=O=>{const{detail:{message:M}}=O;_(M)};E.useEffect(()=>(window.scrollTo(0,0),document.addEventListener("ariaLive",T),()=>{document.removeEventListener("ariaLive",T)}),[v]);const C=Ed(e,{locale:s}),x=Ed(t,{locale:s}),w=Ed(n,{locale:s}),P={};return h!=="default"&&(P[h]=!0),m!=="default"&&(P[m]=!0),p!=="default"&&(P[p]=!0),g.jsx(DD.ErrorBoundary,{onError:r,fallback:g.jsx(Cge,{}),children:g.jsxs(E.Suspense,{fallback:null,children:[g.jsxs("div",{id:"wrapper",className:ee(o,P,{"has-footer":f}),"data-too-small":c.formatMessage({id:"pageLayout_browserTooSmall"}),children:[g.jsx(l5,{suprSendWorkspaceKey:l,novuApplicationIdentifier:u,showNavigation:d}),g.jsxs("main",{id:"content-wrapper",children:[x&&g.jsx("div",{className:ee("additional-content prepended",{"large-modal":y==="large"}),children:x}),E.createElement(h==="bold"?Lv:"div",{id:"content",children:C,className:ee({"large-modal":y==="large"})})]}),w&&g.jsx("div",{className:"additional-content appended",children:w}),f&&g.jsx(Sy,{}),g.jsx(Pw,{})]}),b&&g.jsx(xt,{"aria-live":"polite",showOnFocus:!1,"data-testid":"layout-aria-live",children:b})]})})},AC={default:"tags_",headerTopics:"header_topics_topics_"},W0={topic:{Climate:"climate",CitiesAndLocalGovernment:"cities-and-local-government",DigitalAndData:"digital-and-data",Education:"education",EquityJusticeAndInclusion:"equity-justice-and-inclusion",HealthAndSocialCare:"health-and-social-care",Innovation:"innovation",LeadershipAndSkills:"leadership-and-skills",LifeInGovernment:"life-in-government",Policymaking:"policymaking",TransportAndInfrastructure:"transport-and-infrastructure",WorkAndTheEconomy:"work-and-the-economy"},"from the community":"community"},xge={getTagDetails:e=>{if(e.includes("topic_")){if(e=W0.topic[e.replace("topic_","")],e){const t=zc.topics.topics[e].href;return t?{id:e,href:t,text:`${AC.headerTopics}${e}`}:null}return null}return W0[e]?(e=W0[e],{id:e,text:`${AC.default}${e}`}):null}};const wge=({tags:e=[],color:t="default",forceOneLine:n=!1,canHaveLinks:r=!0,className:i="",gtmType:a="tag-click",gtmContext:o="tags"})=>{const s=me.useIntl();if(!e||e.length<1)return null;const l=[];return e.forEach(u=>{if(!u)return;const c=xge.getTagDetails(u);c&&l.push(c)}),l.length<1?null:g.jsx("ul",{className:ee("tags text-small",t,i,{"one-line":n}),children:l.map(u=>{const c=s.formatMessage({id:u.text});return g.jsx("li",{children:u.href&&r?g.jsx("a",{href:u.href,className:"gtm-trackable","data-gtm-event-type":a,"data-gtm-event-context":o,children:c}):c},u.id)})})};const lD=25,Age=({members:{data:e=[],total:t=e.length},communitySlug:n,isMember:r=!1,hasNextPage:i=!1,loadNextPage:a=()=>{},profile:o,gtmContext:s="member",gtmType:l="member-click",showHeader:u=!0,showPlaceholders:c=!1,className:d=""})=>{const f=me.useIntl(),h="membersList",m=E.useContext(fn),[p,y]=E.useState(!1);return e.length===0&&!c?null:g.jsxs("div",{className:ee("members-list",d),children:[u?g.jsxs("h1",{children:[f.formatMessage({id:h}),g.jsx("span",{className:"count",children:t})]}):g.jsx(g.Fragment,{}),g.jsxs("ul",{children:[r?g.jsxs("li",{children:[g.jsx(Ea,{member:m,gtmContext:s,gtmType:l,badges:{showBadges:!0,scopes:[{scope:Fn.Communities,area:n||""},{scope:Fn.Platform,area:"all"}]}}),g.jsx(fo,{href:"/profiles/me",className:"text-small",onClick:v=>{v==null||v.preventDefault(),v==null||v.stopPropagation(),y(!0)},children:f.formatMessage({id:`${h}_profile`})})]}):g.jsx(g.Fragment,{}),e.map((v,b)=>m&&v.id===m.id?g.jsx(g.Fragment,{}):g.jsxs("li",{children:[g.jsx(Ea,{member:v,gtmContext:s,gtmType:l,badges:{showBadges:!0,scopes:[{scope:Fn.Communities,area:n||""},{scope:Fn.Platform,area:"all"}]}}),v.isAdmin&&g.jsx(Fi,{children:f.formatMessage({id:`${h}_admin`})})]},b)),c&&e.length===0&&t>0?[...new Array(Math.min(t,lD))].map((v,b)=>g.jsx("li",{children:g.jsx(bh,{layout:"member"})},b)):g.jsx(g.Fragment,{})]}),i&&g.jsx(Vc,{hasNextPage:i,loadNextPage:a,icon:{icon:"arrow-down",position:"right"},gtmContext:s}),o?g.jsx(xp,{form:o,showModal:p,content:{title:f.formatMessage({id:`${h}_modal_title`})},functions:{onClose:()=>{y(!1)}}}):g.jsx(g.Fragment,{})]})},uD=Age,kge=({intlPath:e,showGuidelines:t,type:n,gtmContext:r})=>{const i=me.useIntl();return t?g.jsx("small",{children:oi(i.formatMessage,`${e}explainer`,n,"action",{a:a=>g.jsx("a",{href:"https://about.apolitical.co/q-and-a-community-guidelines",target:"_blank",className:"gtm-trackable","data-gtm-event-context":r,"data-gtm-event-type":"community-guidelines-link",rel:"noreferrer",children:a})})}):g.jsx(g.Fragment,{})},Sge=({intlPath:e,type:t,...n})=>{const r=me.useIntl();return g.jsx(Af,{label:{visible:r.formatMessage({id:`${e}label`}),screenreader:oi(r.formatMessage,`${e}label_action`,t,"action")},...n})},kC=5,SC=2,Dge=e=>{var r;let t=0;const n=[];return(r=e==null?void 0:e["poll-options"])==null||r.forEach((i,a)=>{i!==""&&(t++,n.push({position:t,description:{en:i}}))}),{title:{en:e.title},options:n,settings:{allow_multiple_votes:e["multiple-answers"]||!1}}};let Rs=null;const nn="discussion_form_",l1=({id:e,parentId:t,content:n={type:at.Response,slugs:{}},userHasPermissions:r=!0,meta:i,placeholder:a,maxLength:o=0,buttons:s,forceShow:l={cancel:!1,error:!1},functions:u,data:c={},gtmContext:d="DiscussionForm"})=>{var re,ge,Ne;const f=me.useIntl(),h=E.useContext(fn),[m,p]=E.useState(n.type),[y,v]=E.useState(""),{isLoading:b=!1,isInWrapper:_=!1,isInOverlay:T=!1,isAutoFocused:C=!1,isEditing:x=!1,hasTitleField:w=!1,canBePrepopulated:P=!1,isPrepopulated:O=!1,showTitle:M=!1,showGuidelines:R=!0,showDivider:D=!1,showSuccessMessage:S=!0,showPostType:B=!1,postCategories:H=[]}=i||{},{onChange:$=()=>{},create:F=()=>{},createPoll:ne=()=>Promise,handleSaveEdit:J=()=>{},handleCancel:I=()=>{},callback:A=()=>{},onMention:Y=()=>{},listMembers:L=()=>Promise.resolve([]),clickMentionFallback:U=()=>{},getLinkPreview:V=()=>Promise.resolve({}),props:z={create:{projectNames:["questions-answers"]}}}=u,[j,ue]=E.useState({body:x&&x.text||O&&O.text||"",data:c!=null&&c.link?{link:c==null?void 0:c.link}:{}}),[Q,ie]=E.useState(l.error||!1),le={status:!1,title:w&&w.text||"",polls:0},[te,Ae]=E.useState(le);E.useEffect(()=>{P&&!x&&O&&O!==j.body&&ue(ye=>({...ye,body:O.text||""}))},[O]),E.useEffect(()=>{p(n.type)},[n.type]);const Oe=mc((ye,X)=>{ue(xe=>({...xe,body:ye,data:{link:X}})),$({body:ye});let he;!h||!h.id?he=oi(f.formatMessage,`${nn}error_loggedOut`,m,"action"):r?o>0&&ye.length>=o&&(he=`${nn}error_tooLong`):he=oi(f.formatMessage,`${nn}error_noPermission`,m,"action"),he?ie(he):Q&&ie(!1)},50);let Te=`${m}-form`;if(m===at.Response||m===at.Reply){const ye=((re=n.slugs)==null?void 0:re.reply)||((ge=n.slugs)==null?void 0:ge.answer)||((Ne=n.slugs)==null?void 0:Ne.question)||"";ye&&(Te=`${Te}-${ye.slice(-15)}`)}e&&(Te=`${e}-${Te}`);const se=async ye=>{if(!h||!h.id||!r||gt)throw new Error("You do not have permission to post.");Rs&&clearTimeout(Rs),Ae(he=>({...he,status:"submitting"}));const X=window.location.pathname;try{let he;switch(m){case at.Post:he=await F({title:ye.title,content:ye.body,categories:ye.postType,data:ye.data});break;case at.Poll:he=await ne(Dge(ye));break;case at.Question:he=await F({title:ye.body,authorId:h&&h.id,data:ye.data,...z==null?void 0:z.create});break;case at.Response:he=await F({questionSlug:n.slugs.question},{body:ye.body,authorId:h&&h.id,contentPath:X,data:ye.data});break;case at.Reply:he=await F({questionSlug:n.slugs.question,answerSlug:n.slugs.answer},{body:ye.body,authorId:h&&h.id,contentPath:X,data:ye.data});break;default:break}return await WD(1e3),A&&await A(he),Rs=setTimeout(()=>{ue({body:"",data:{}}),p(at.Post),Ae(Ue=>({...Ue,status:"submitted"})),v(oi(f.formatMessage,`${nn}success`,m,"action"));const xe=new Event(bn.DISCUSSION_FORM_SUBMITTED);document.dispatchEvent(xe),ve()},850),he}catch(he){const xe=he;let Ue=`${nn}error`;xe!=null&&xe.message.includes("entry already exists")&&(Ue=oi(f.formatMessage,`${nn}error_alreadyExists`,m,"action")),xe!=null&&xe.message.includes("429")?Ue=oi(f.formatMessage,`${nn}error_tooMany`,m,"action"):xe!=null&&xe.message.includes("400")&&(Ue=`${nn}error`),ie(Ue),ve()}},ve=()=>{Rs=setTimeout(()=>{ie(!1),Ae(le),v("")},5e3)},ke=mc(async ye=>{const X={...j,...ye};if(x){Ae(he=>({...he,status:"submitting"})),J(X);return}try{if(!await se(X))throw Error("No response from handleSubmit")}catch{Rs&&clearTimeout(Rs)}},100);if(b)return g.jsx(qr,{className:"discussion-card discussion-form","data-testid":"loading-placeholder"});const Fe=!j.body||!yc(j.body),ht=!te.title||!yc(te.title);let gt=!1;m!==at.Poll&&(gt=Fe),w&&(gt=gt&&ht);const nt=te.status==="submitting",ot=[];m===at.Poll?ot.push({id:"poll-options",label:f.formatMessage({id:`${nn}option_label`}),type:"multiple-inputs",element:"textarea",placeholder:f.formatMessage({id:`${nn}option_placeholder`}),limit:100,multipleInputs:{showCount:!0,defaultInputs:SC,maxInputs:kC,hasButton:{variant:"secondary",size:"small",styling:{muted:!0},icon:"plus",children:f.formatMessage({id:`${nn}option_cta`})}},styling:{autosizeToFit:!0},functions:{onChange:ye=>{var he;let X=0;ye&&Array.isArray(ye)&&(X=((he=ye==null?void 0:ye.filter(xe=>xe!==""))==null?void 0:he.length)||0),te.polls!==X&&Ae(xe=>({...xe,polls:X})),$({polls:ye})}},validation:[{condition:"required"}]},{type:"checkbox",id:"multiple-answers",label:f.formatMessage({id:`${nn}multiplePollAnswers`}),className:"text-medium"}):ot.push({component:Sge,props:{formID:Te,intlPath:nn,showLabel:w!==!1,type:m}},{component:ky,props:{id:`${Te}-input`,value:te.status==="submitting"&&!Q?"":j.body,placeholder:a||oi(f.formatMessage,`${nn}placeholder`,m,"action"),maxLength:o,meta:{isInOverlay:T},functions:{onChange:Oe,onChangeData:ye=>{ue(X=>({...X,data:ye}))},onMention:Y,listMembers:L,clickMentionFallback:U,getLinkPreview:V},data:c,autoFocus:x!==!1||C&&!w,"aria-invalid":!!Q,"aria-errormessage":"error-message"}},{component:kge,props:{intlPath:nn,showGuidelines:R,type:m,gtmContext:d}}),D&&ot.push({component:fi}),w&&ot.unshift({id:"title",type:"textarea",value:w.text,limit:250,label:f.formatMessage({id:`${nn}${m===at.Poll?"question":"titleField"}_label`}),styling:{autosizeToFit:!0},placeholder:f.formatMessage({id:`${nn}${m===at.Poll?"question":"titleField"}_placeholder`}),functions:{onChange:ye=>{Ae(X=>({...X,title:ye})),$({title:ye})}},validation:m===at.Poll?[{condition:"required"}]:[]}),B&&ot.unshift({id:"postType",type:"radio",value:"no-category",accessibilityOptions:{checkboxes:{navigateWithArrowKeys:!0}},styling:{displayOptionsAsPills:!0},label:f.formatMessage({id:`${nn}postType_label`}),options:H.map(ye=>({id:ye.slug,label:ye.name})),validation:[{condition:"required"}],functions:{onChange:ye=>{$({postType:ye}),ye.includes(at.Poll)?p(at.Poll):m!==at.Post&&p(at.Post)}}});let je=!h||!h.id||!r||nt;if(m===at.Poll){const ye=te.polls;je=je||ht||ye<SC||ye>kC}else je=je||gt,x&&(w?je=je||j.body===x.text&&te.title===w.text:je=je||j.body===x.text);return g.jsxs(g.Fragment,{children:[g.jsxs(Zi,{id:Te,className:ee("discussion-card discussion-form",{"no-styling":_&&x}),meta:{shouldReset:!0,shouldHide:!1,showRequiredLabels:!1,shouldShowCancelButton:x&&!nt||l.cancel},functions:{onSuccess:async ye=>{await ke(ye)},onCancel:I},fields:ot,intlPath:nn,button:{variant:"primary",size:{mobile:"small",600:"medium"},"data-gtm-event-context":d,"data-gtm-event-type":`${x?"save":"submit"}-${m}-click`,"data-testid":"save-button",disabled:je,text:{default:!x&&(s!=null&&s.submit)?s==null?void 0:s.submit:f.formatMessage({id:`${nn}${x?"save":"post"}`}),submitting:f.formatMessage({id:`${nn}${x?"saving":"posting"}`})}},secondaryActionButton:{variant:"secondary",size:{mobile:"small",600:"medium"},"data-gtm-event-context":d,"data-gtm-event-type":`cancel-${m}-click`,disabled:!l.cancel&&(!h||!h.id||!j.body),text:s!=null&&s.cancel?s==null?void 0:s.cancel:f.formatMessage({id:`${nn}cancel`})},gtm:{context:d,event:`${m}-form`},"data-testid":`discussion-${m}-form`,children:[M&&!x&&m===at.Question&&g.jsx("h2",{children:oi(f.formatMessage,`${nn}title`,m,"action")}),g.jsx(Ea,{member:h?{...h,link:!1}:"community",gtmContext:d,gtmType:"profile-click",badges:{showBadges:!0,scopes:[{scope:Fn.Communities,area:t||""},{scope:Fn.Platform,area:"all"}]}})]}),te.status==="submitted"&&S&&g.jsx(gl,{className:"success","data-testid":"success",children:oi(f.formatMessage,`${nn}success`,m,"action")}),Q&&g.jsx(gl,{id:"error-message",className:"error","data-testid":"error",children:l.error?l.error:typeof Q=="string"?Q.includes(" ")?Q:f.formatMessage({id:Q},{action:f.formatMessage({id:`discussion_action_${m}`}),maxLength:o}):Q}),y&&g.jsx(xt,{"aria-live":"polite",showOnFocus:!1,children:y})]})},Oge=Object.freeze(Object.defineProperty({__proto__:null,default:l1},Symbol.toStringTag,{value:"Module"}));const Nge={showForm:!1},Cp=E.createContext(Nge),cD=({children:e})=>{const[t,n]=E.useState({showForm:!1});return g.jsx(Cp.Provider,{value:{...t,updateConversation:n},children:e})};function Ige({author:e,originalAuthorId:t,createdAt:n,contentData:r,content:i,gtmContext:a,badges:o}){var d;const s="discussion_",l=me.useIntl(),u=(d=i==null?void 0:i.componentProps)==null?void 0:d.member.additionalContent,c=u?u.customMessage:void 0;return g.jsxs("div",{className:"author-section",children:[g.jsx(Ea,{member:e,additionalContent:{createdAt:n,didEdit:r.didEdit,customMessage:c},className:ee({highlighted:typeof e!="string"&&e.id===t}),styling:{additionalContentNewLine:!!c},gtmContext:a,gtmType:"profile-click",badges:o}),i.pinned&&g.jsx(Fi,{variant:"naked",size:"xlarge",icon:"pin",children:g.jsx(xt,{children:l.formatMessage({id:`${s}pinned_post`})})})]})}const K0=({children:e,class:t,...n})=>{const r={...n,class:ee("subtle",t)};return g.jsx("blockquote",{...r,children:e})};function Pge({content:e}){var t;return!e||!((t=e.categories)!=null&&t.length)?g.jsx(g.Fragment,{}):g.jsx("ul",{className:"categories-list",children:e.categories.map(n=>!n.slug||!n.name?g.jsx(g.Fragment,{}):g.jsx(Fi,{size:"small",element:"li",children:n.name},n.slug))})}var fh=(e=>(e.Always="always",e.AfterVoting="after-voting",e))(fh||{});const Rge=(e,t,n)=>n===void 0?0:e.some(i=>i.hasUserVoted)?t?e.findIndex(i=>!i.hasUserVoted):e.findIndex(i=>i.hasUserVoted):0,Fge=(e,t,n,r=0)=>{if(!e)return{nextElement:null,nextIndex:0};let i=n==="next"?e.nextElementSibling:e.previousElementSibling,a=r+(n==="next"?1:-1);for(;i;){if(!i.classList.contains(t))return{nextElement:i,nextIndex:a};i=n==="next"?i.nextElementSibling:i.previousElementSibling,a=a+(n==="next"?1:-1)}const o=e.parentElement;if(o)for(i=n==="next"?o.firstElementChild:o.lastElementChild,a=n==="next"?0:o.childElementCount-1;i&&i!==e;){if(!i.classList.contains(t))return{nextElement:i,nextIndex:a};i=n==="next"?i.nextElementSibling:i.previousElementSibling,a=a+(n==="next"?1:-1)}return{nextElement:null,nextIndex:0}};const Mge=({user:e,option:t,optionIndex:n,totalPollVotes:r=0,allowMultipleVotes:i=!1,showResults:a=!1,hasVotedOnPoll:o=!1,isTabbable:s=!1,functions:l})=>{var y;const[u,c]=E.useState(t.hasUserVoted);let d=0,f={};const h=(i||!o)&&!t.hasUserVoted;a&&(d=Math.round(t.numVotes/r*100)||0,f={"--vote-perc":`${d}%`});const m=v=>{v.stopPropagation(),h&&(l==null||l.createVote(t),c(!0))},p={htmlFor:t.id,className:ee({"can-vote":h}),tabIndex:s&&h?0:-1,"data-testid":"poll-option-label","data-gtm-event-type":"poll-option-click","data-gtm-event-context":"PollOption","aria-selected":t.hasUserVoted,onClick:m,onKeyDown:v=>{var b;if(v.code!=="Tab")switch(v.code){case"Enter":case"Space":v.preventDefault(),v.stopPropagation(),m(v),c(!0);break;case"ArrowUp":case"ArrowDown":v.stopPropagation(),v.preventDefault();const _=v.code==="ArrowUp"?"prev":"next",{nextElement:T,nextIndex:C}=Fge(v.currentTarget.parentElement,"selected",_,n);T&&((b=T.querySelector("label"))==null||b.focus(),l==null||l.setTabbableOption(C));break}}};return g.jsxs("li",{"data-testid":"poll-option",style:f,className:ee("poll-option text-small",{selected:t.hasUserVoted}),children:[g.jsx("label",{...p,children:g.jsx("span",{children:t.label})}),a&&g.jsxs("div",{className:"vote-details",children:[t.hasUserVoted&&g.jsx(ka,{className:"author-profile-picture",name:e.name,src:(y=e==null?void 0:e.image)==null?void 0:y.thumbnail}),g.jsxs("p",{className:"vote-perc text-medium","data-testid":"vote-perc",children:[d,"%"]})]}),g.jsx("input",{type:i?"radio":"checkbox",id:t.id,name:t.id,checked:u,tabIndex:-1})]})};const dD=({title:e,options:t,settings:n,functions:r})=>{const i="poll_",a=me.useIntl(),o=E.useContext(fn),{showRemoveVote:s=!1,allowMultipleVotes:l=!1,resultsVisibility:u=fh.AfterVoting}=n||{},[c,d]=E.useState(Rge(t,l,o==null?void 0:o.id)),f=t.reduce((v,b)=>v+b.numVotes,0),h=t.filter(v=>v.hasUserVoted).length,m=t.filter(v=>v.hasUserVoted),p=E.useCallback(async v=>{await r.createVote({reactionId:v.id})},[]),y=E.useCallback(async()=>{t.forEach(async v=>{v.hasUserVoted&&v.userVote&&r.removeVote({reactionId:v.userVote.id})})},[t]);return g.jsxs("div",{className:"poll-wrapper",children:[g.jsx("p",{className:"poll-title",children:e}),g.jsxs("aside",{className:"poll-info",children:[g.jsx("p",{className:"poll-instructions","data-testid":"poll-instructions",children:g.jsx("small",{children:a.formatMessage({id:`${i}instructions`},{allowMultipleVotes:l})})}),g.jsx("p",{className:"poll-num-votes",children:g.jsx("small",{"data-testid":"poll-total-votes",children:a.formatMessage({id:`${i}num_votes`},{number:f})})}),s&&g.jsx("p",{className:"poll-remove-vote",children:g.jsx(Ke,{variant:"tertiary",onClick:y,"data-testid":"remove-votes-button",disabled:h===0,children:g.jsx("small",{children:a.formatMessage({id:`${i}remove_vote_button`},{number:h})})})})]}),t&&g.jsx("form",{children:g.jsx("fieldset",{children:g.jsx("ul",{className:"poll-options",children:t==null?void 0:t.map((v,b)=>g.jsx(Mge,{isTabbable:c===b,user:o,option:v,optionIndex:b,totalPollVotes:f,showResults:u==fh.Always||!!h,allowMultipleVotes:l,hasVotedOnPoll:!!h,functions:{createVote:p,setTabbableOption:d}},v.id))})})}),g.jsxs(xt,{"aria-live":"polite",children:[a.formatMessage({id:`${i}aria_votes`},{number:h}),!!h&&g.jsx("ul",{children:m.map(v=>g.jsx("li",{children:v.label}))})]})]})};function Bge({content:e,contentData:t,functions:n}){return g.jsx(dD,{title:t.title,options:(e==null?void 0:e.pollOptions)||[],settings:(e==null?void 0:e.pollSettings)||{},functions:{createVote:n.createVote,removeVote:n.removeVote}})}function Lge({links:e={},contentData:t,postCutOff:n,content:r}){var i;return g.jsxs(g.Fragment,{children:[e.post?g.jsxs("a",{href:e.post,children:[(t==null?void 0:t.title)&&g.jsx("p",{className:"content-title",children:t==null?void 0:t.title}),t.postBody.length>n?g.jsx(e3,{text:t.postBody,markdownOptions:{overrides:{a:ng,blockquote:{component:K0}}}}):g.jsx(Xo,{options:{overrides:{a:ng,blockquote:{component:K0}}},children:t.postBody})]}):g.jsxs(g.Fragment,{children:[(t==null?void 0:t.title)&&g.jsx("p",{className:"content-title",children:t==null?void 0:t.title}),g.jsx(Xo,{options:{wrapper:r.type===at.Question?"h1":E.Fragment,forceWrapper:r.type===at.Question,forceInline:r.type===at.Question,forceBlock:r.type!==at.Question,overrides:{blockquote:{component:K0}}},children:t.postBody})]}),(i=t.data)!=null&&i.link?g.jsx(Qv,{data:t.data.link}):g.jsx(g.Fragment,{})]})}const ti="discussion_",$ge=195;let gd=null;const u1=({element:e="div",content:t,userHasPermissions:n=!0,userHasOwnerPermissions:r=!1,isLoading:i=!1,originalAuthorId:a,forceHide:o,functions:s,links:l={},className:u,gtmContext:c="DiscussionAnswer",children:d,isTruncated:f=!1,setFocus:h=!1,isCommunity:m=!1,badges:p,basePath:y,parentId:v,locale:b="en",disableMentions:_})=>{var je,re,ge,Ne,ye,X;const T=me.useIntl(),C=E.useContext(Cp),x=E.useContext(fn),{createContent:w=async()=>{},deleteContent:P=async()=>{},updateContent:O=async()=>{}}=s.content||{},{createLike:M=()=>{},deleteLike:R=()=>{},listLikes:D=async()=>({})}=s.likes||{},{openComments:S=()=>{}}=s.comments||{},{listMembers:B=()=>Promise.resolve([]),clickMentionFallback:H=()=>{}}=s.form||{},{createVote:$=()=>{},removeVote:F=()=>{},removePoll:ne=()=>{}}=s.polls||{},{author:J,createdAt:I,id:A,likes:Y=0,userLiked:L,comments:U=0,data:V}=t,z=fI(t.title,b),j=x&&x.id&&typeof J!="string"&&J.id&&J.id===x.id||!1,ue=j&&(!t.createdAt||VD(t.createdAt,10,"seconds")),Q=E.useRef(null),[ie,le]=E.useState({title:t.body!==z&&z||"",body:t&&t.body||"",isEditing:!1,didEdit:t&&t.isEdited||!1,postBody:"",data:t&&t.data||{}}),[te,Ae]=E.useState(!1),[Oe,Te]=E.useState(ue?"highlighted":"default"),[se,ve]=E.useState("");E.useEffect(()=>{const he=Q.current;if(!(!he||Oe==="default"))return document.addEventListener(bn.DISCUSSION_FORM_SUBMITTED,ke),he.addEventListener("transitionend",Fe),()=>{document.removeEventListener(bn.DISCUSSION_FORM_SUBMITTED,ke),he.removeEventListener("transitionend",Fe)}},[]),E.useEffect(()=>{le(he=>({...he,title:t&&z||"",body:t&&t.body||"",didEdit:t&&t.isEdited||!1,data:t&&t.data||{}}))},[t.isEdited]),E.useEffect(()=>{(async()=>{const xe=await Yv(ie.body,f,V==null?void 0:V.mentions,B);le(Ue=>({...Ue,postBody:xe}))})()},[ie.body,V==null?void 0:V.mentions]);const ke=()=>{setTimeout(()=>{Te("fading")},1e3)},Fe=({propertyName:he})=>{he==="background-color"&&Te(xe=>(xe==="default"&&(document.removeEventListener(bn.DISCUSSION_FORM_SUBMITTED,ke),Q.current&&Q.current.removeEventListener("transitionend",Fe)),xe==="fading"?"default":xe))};if(i||!t||t.type===at.Answer&&(!t.slugs||!t.slugs.question)||ie.postBody===""&&t.title==="")return g.jsx(qr,{className:"discussion-card"});const ht=async({title:he,body:xe,data:Ue})=>{he||(he=""),xe||(xe=""),ve("");try{if(!cf(he,ie.title)||!cf(xe,ie.body)){const St=t.type===at.Question?{title:xe}:{title:he,body:xe,data:Ue};await O(sg(t.slugs),St)}le(St=>({...St,title:he||"",body:xe||"",data:{...St.data,...Ue},isEditing:!1,didEdit:!0}))}catch{ve(`${ti}form_error`)}},gt=()=>{if(C&&C.updateConversation){const he={showForm:!0},xe=t.author;xe&&xe.id&&!_&&(m&&(he.prepopulateForm=`@{{${xe.id}}}`),he.mentionData={id:xe.id,name:xe.name}),C.updateConversation(he)}setTimeout(()=>{var vt,kt,sn;const xe=`reply-form-${(t.type===at.Answer?t.slug:((vt=t.slugs)==null?void 0:vt.reply)||((kt=t.slugs)==null?void 0:kt.answer)||((sn=t.slugs)==null?void 0:sn.question)||"").toLowerCase().slice(-15)}`,Ue=document.getElementById(xe),St=document.getElementById(`${xe}-input`);St&&St.focus(),Ue&&Ue.scrollIntoView({behavior:"smooth"})},0)},nt=async()=>{Ae(!1);try{t.type===at.Poll?(await ne(),window.location.href=`${y}/${v}`):await P(sg(t.slugs))}catch{ve("delete-error")}},ot=[];return n&&j&&(t.type!==at.Poll&&ot.push({text:T.formatMessage({id:`${ti}moreMenu_edit`}),onClick:()=>le(he=>({...he,isEditing:!0})),icon:"pencil-paper",className:"gtm-trackable","data-gtm-event-context":c,"data-gtm-event-type":`edit-${t.type}-click`}),ot.push({text:T.formatMessage({id:`${ti}moreMenu_delete`}),onClick:he=>{he.preventDefault(),he.stopPropagation(),Ae(!0)},icon:"trash",className:"gtm-trackable","data-gtm-event-context":c,"data-gtm-event-type":`delete-${t.type}-click`,...D3(`delete-${t.slug}-modal`,te)})),r&&s.pins&&ot.push({text:T.formatMessage({id:`${ti}moreMenu_${t.pinned?"unpin":"pin"}`}),onClick:t.pinned?s.pins.deletePin:s.pins.createPin,icon:t.pinned?"unpin":"pin",className:"gtm-trackable","data-gtm-event-context":c,"data-gtm-event-type":`edit-${t.type}-click`}),h&&((je=Q==null?void 0:Q.current)==null||je.focus(),(re=Q==null?void 0:Q.current)==null||re.scrollIntoView({behavior:"smooth"})),E.createElement(e,{className:ee("discussion-post",u,{[Oe]:!u||!u.includes("highlighted-text-box"),"has-link":l.post&&!ie.isEditing,"is-pinned":(t==null?void 0:t.pinned)||!1}),ref:Q,tabIndex:h?0:null,"data-testid":`discussion-${t.type}-thread`,"data-gtm-event-context":`${c}-post-click`,onClick:he=>{if(!l.post||ie.isEditing||t.type===at.Poll&&dI(he,["poll-options","poll-info"],"discussion-post"))return;he.preventDefault(),he.stopPropagation(),gd&&clearTimeout(gd),gd=setTimeout(()=>{window.location.href=l.post},150);const xe=new CustomEvent(bn.DISCUSSION_POST_CLICKED,{detail:{link:l.post,timeout:gd}});document.dispatchEvent(xe)},children:g.jsxs(g.Fragment,{children:[g.jsxs("div",{id:A||t.slug,className:ee("discussion-card text-medium",t.type,{editing:ie.isEditing,"has-link":l.post&&!ie.isEditing}),children:[!ie.isEditing&&g.jsx(Ige,{author:J,originalAuthorId:a,createdAt:I,contentData:{didEdit:ie.didEdit},content:t,gtmContext:c,badges:p}),ie.isEditing?g.jsx(l1,{id:`editing-${t.slug}`,content:{type:t.type,slugs:t.slugs},userHasPermissions:n,meta:{isLoading:i,isInWrapper:!0,hasTitleField:ie.title!==""?{text:ie.title}:!1,isEditing:{text:ie.body,categories:[]},canBePrepopulated:m,isPrepopulated:!1},maxLength:t.type===at.Question?250:5e4,forceShow:{error:se!==""&&se!=="delete-error"?T.formatMessage({id:se},{action:T.formatMessage({id:`${ti}action_${t.type}`})}):!1},functions:{create:w,handleSaveEdit:ht,handleCancel:()=>{ve(""),le(he=>({...he,isEditing:!1}))},listMembers:B,clickMentionFallback:H},gtmContext:`${c}Form`,data:V}):g.jsxs(g.Fragment,{children:[t.type===at.Poll?g.jsx(Bge,{content:t,contentData:ie,functions:{createVote:$,removeVote:F}}):g.jsx(Lge,{links:l,contentData:ie,postCutOff:$ge,content:t}),g.jsx(Pge,{content:t})]}),!ie.isEditing&&!(o!=null&&o.actionBar)&&g.jsx(V3,{className:t.type,gtmContext:c,contentType:t.type,likes:o!=null&&o.likes?!1:{count:Y||0,userLiked:L||!1,canLike:n??!0,peopleWhoLiked:t.peopleWhoLiked,activityId:t.id||t.slug,content:{slugs:t.slugs||{},slug:t.slug},functions:{createLike:M,deleteLike:R,listLikes:D},basePath:y,parentId:v},comments:!(o!=null&&o.comments)&&([at.Question,at.Post].includes(t.type)||l.comments)?{count:U||0,functions:{onClick:()=>{l!=null&&l.comments&&(window.location.href=l.comments),typeof S=="function"&&S()}}}:!1,replies:t.type==="answer"||t.type==="reply"?{canReply:n??!0,functions:{onClick:gt}}:!1,shareLink:!(o!=null&&o.shareLink)&&{url:`${window.location.origin}${(ge=t.slugs)==null?void 0:ge.question}/${(Ne=t.slugs)==null?void 0:Ne.answer}${(ye=t.slugs)!=null&&ye.reply?`#${(X=t.slugs)==null?void 0:X.reply}`:""}`},moreMenu:!(o!=null&&o.moreMenu)&&{options:ot,contentSlug:t.slug,reportData:{contentUrl:`${window.origin}${typeof process<"u"&&process.env.PUBLIC_URL||""}/${t.slugs.question||""}`}}})]}),d,g.jsx(Sa,{id:`delete-${t.slug}-modal`,isOpen:te,functions:{onOpen:()=>{},onClose:()=>Ae(!1)},forceShow:{error:se==="delete-error"?T.formatMessage({id:"${intlPath}delete_error"},{action:T.formatMessage({id:`${ti}action_${t.type}`})}):!1},title:T.formatMessage({id:`${ti}delete_title`},{action:T.formatMessage({id:`${ti}action_${t.type}`})}),buttons:[{variant:"secondary",onClick:()=>Ae(!1),children:T.formatMessage({id:`${ti}delete_cancel`})},{variant:"primary",className:"destructive",onClick:nt,children:T.formatMessage({id:`${ti}delete_delete`})}],gtmContext:`${(t.type||"").charAt(0).toUpperCase()}${(t.type||"").slice(1)}:${t.slug}`,children:g.jsx(me.FormattedMessage,{id:"discussion_delete_text",values:{p:he=>g.jsx("p",{children:he}),action:T.formatMessage({id:`${ti}action_${t.type}`})}})})]})})};const jge=E.lazy(()=>Promise.resolve().then(()=>eve)),Hge=65,fD=({forceShow:e,form:t,className:n})=>{const r=me.useIntl(),i="discussionFormCard_",a="DiscardDraftModal",s=E.useContext(fn)||"community",l=Eh(s);l.name||(l.name=r.formatMessage({id:`member_${typeof s=="string"?s:"community"}`}));const u=lo(!0,!1),c=u?u<768:0,{modal:d=!1}=e||{},[f,h]=E.useState({form:d||YC("showPost")==="true"||!1,warning:!1}),[m,p]=E.useState({showCachedText:!1});E.useEffect(()=>{if(!m.showCachedText)return;(async()=>{const _=await Yv(m.title||m.body||"",Hge,m.mentions);p(T=>({...T,prettifiedText:_}))})()},[m.showCachedText,m.title,m.body]);const y=b=>{if(!m.showCachedText||typeof f.warning=="string")return;let _;if("detail"in b&&b.detail.link)b.detail.timeout&&clearTimeout(b.detail.timeout),_=b.detail.link;else{const T=b;T.preventDefault(),T.stopPropagation();const x=T.target.closest("a");_=x&&x.getAttribute("href")}h(T=>({...T,warning:_||!1}))};E.useEffect(()=>{if(!m.showCachedText){document.removeEventListener(bn.DISCUSSION_POST_CLICKED,y),document.removeEventListener(bn.MEMBER_CLICKED,y),document.removeEventListener("click",y);return}return document.addEventListener(bn.DISCUSSION_POST_CLICKED,y),document.addEventListener(bn.MEMBER_CLICKED,y),document.addEventListener("click",y),()=>{document.removeEventListener(bn.DISCUSSION_POST_CLICKED,y),document.removeEventListener(bn.MEMBER_CLICKED,y),document.removeEventListener("click",y)}},[m.showCachedText]),E.useEffect(()=>{const b=_=>{if(!(!m.showCachedText||f.warning!==!1))return _.preventDefault(),_.returnValue=""};return window.addEventListener("beforeunload",b,{capture:!0}),()=>{window.removeEventListener("beforeunload",b,{capture:!0})}},[m.showCachedText,f.warning]);let v=r.formatMessage({id:`${i}placeholder${c?"":"_long"}`});return m.showCachedText&&(m.title||m.body)&&(v=m.prettifiedText||v),g.jsxs(g.Fragment,{children:[g.jsxs("button",{className:ee("discussion-form-card",n),onClick:b=>{b.preventDefault(),b.stopPropagation(),h(_=>({..._,form:!0}))},"data-testid":"discussion-form-card",children:[g.jsx(ka,{name:l.name,src:l.image,alt:""}),g.jsx(Xo,{className:ee("input",{placeholder:!m.showCachedText}),element:"span",options:{forceInline:!0,overrides:{a:Pr,blockquote:Pr,br:Pr,em:Pr,li:Pr,ol:Pr,p:Pr,s:Pr,span:Pr,strong:Pr,ul:Pr}},children:v})]}),g.jsxs(Ml,{children:[g.jsx(jge,{showModal:f.form,functions:{cacheText:p,onClose:()=>{h(b=>({...b,form:!1}))}},form:t,cachedText:m,className:"in-portal"}),g.jsx(Sa,{id:t.id?`${t.id}-warning`:"discussion-form-card-warning",className:"in-portal",isOpen:f.warning!==!1,functions:{onClose:()=>{h(b=>({...b,warning:!1}))}},title:r.formatMessage({id:`${i}overlay_title`}),buttons:[{variant:"secondary",children:r.formatMessage({id:`${i}overlay_cta_discard`}),onClick:b=>{b.preventDefault(),b.stopPropagation(),typeof f.warning=="string"&&(window.location.href=f.warning)},"data-gtm-event-type":"discard-click","data-gtm-event-context":a},{variant:"primary",children:r.formatMessage({id:`${i}overlay_cta_continue`}),onClick:()=>{h({form:!0,warning:!1})},"data-gtm-event-type":"continue-editing-click","data-gtm-event-context":a}],children:g.jsx("p",{children:r.formatMessage({id:`${i}overlay_text`})})})]})]})},Uge=E.lazy(()=>Promise.resolve().then(()=>Oge)),u5=({isCard:e=!1,form:t,parentId:n,categories:r,membershipRequiredToPost:{isMember:i,required:a,join:o,leave:s,notMemberStateText:l},locale:u=yl})=>{if(a&&!i)return g.jsx(Ui,{text:l,button:{breakpoints:{mobile:!0,901:!1},component:g.jsx(Uv,{isShort:!0,functions:{join:o,leave:s}})}});const{content:c,functions:d,meta:f,...h}=t,m={content:{type:(c==null?void 0:c.type)||"reply",slugs:(c==null?void 0:c.slugs)||{}},functions:{...d,create:(d==null?void 0:d.create)||(()=>{})},parentId:n,meta:{...f,isEditing:(f==null?void 0:f.isEditing)||!1,isPrepopulated:!1,showSuccessMessage:!1,postCategories:[{name:"Post",slug:"no-category"},...r||[]]},...h,id:`add-post-${h.id||""}`};return e?g.jsx(fD,{form:m}):g.jsx(Uge,{...m})},c5=({form:e})=>{const t=E.useContext(fn),n=me.useIntl(),[r,i]=E.useState(!1),a=()=>{eO(t)||i(!0)};E.useEffect(()=>{if(e&&!(e!=null&&e.isDisabled)||(e==null?void 0:e.isDisabled)===void 0)return document.addEventListener(bn.DISCUSSION_POST_ADDED,a),()=>{document.removeEventListener(bn.DISCUSSION_POST_ADDED,a)}});const o={};return["successMessage","title","text"].forEach(s=>{o[s]=n.formatMessage({id:`profileModalLauncher_${s}`})}),g.jsx(xp,{form:e,showModal:r,functions:{onClose:()=>{i(!1)}},content:o})};const G0="discussion_responses_",hD=({type:e="answer",responses:t=0,isLoading:n=!1})=>{const r=me.useIntl();return t=parseInt(t),g.jsxs("div",{className:"responses-heading",children:[g.jsx("h4",{children:r.formatMessage({id:`${G0}title`},{action:r.formatMessage({id:`${G0}${e}`}),count:t})}),!n&&t===0&&g.jsx("p",{children:oi(r.formatMessage,`${G0}empty`,e,e)})]})};const pD=({loadMore:{isLoading:e,hasNextPage:t,loadNextPage:n}={isLoading:!1,hasNextPage:!1,loadNextPage:()=>{}},form:r,children:i})=>{const a=me.useIntl(),o=E.useContext(Cp),s=Ed(i,{element:"li"});if(o.prepopulateForm&&(r!=null&&r.meta)&&(r.meta.isPrepopulated={text:o.prepopulateForm},o.mentionData)){const l=r.data||{};l.mentions||(l.mentions={});const u=o.mentionData.id||"1";l.mentions[u]={created_at:"",updated_at:"",id:u,data:o.mentionData},r.data=l,r.meta.isAutoFocused=!0}return g.jsxs("div",{className:ee("thread-wrapper",{"empty-thread":!s}),children:[!Object.is(s,null)&&g.jsx("ul",{className:"thread",children:s}),!e&&g.jsx(Vc,{hasNextPage:t,loadNextPage:n,size:"small",styling:{muted:!0},icon:{icon:"arrow_corner-down_right",position:"left"},messages:{button:a.formatMessage({id:"discussion_thread_loadMore"}),error:a.formatMessage({id:"loadMore_error"})}}),r&&o.showForm&&g.jsx(l1,{...r})]})};function zge(e){var n,r;let t=!1;return(r=(n=e.latest_reactions)==null?void 0:n["poll-option"])==null||r.forEach(i=>{var a,o;(o=(a=i.own_children)==null?void 0:a["poll-vote"])!=null&&o.length&&(t=!0)}),t}function Vge({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:i,user:a}){const{mutate:o}=Rt.useMutation({mutationFn:e,onMutate:({reactionId:s})=>t(l=>(N3({activity:l,reactionId:s,user:a}),l)),onError:n,onSuccess:(s,{reactionId:l},u)=>{u&&I3({activity:u,reactionId:l,correctReactionId:s.body.id,user:a}),r.setQueryData(i,u)}});return o}function qge({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=Rt.useMutation({mutationFn:e,onMutate:({content:i,title:a})=>t(o=>(o&&(i!=null&&(o.content=i),a!=null&&(o.title=a)),o)),onError:n});return r}function Wge({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:i}){const{mutate:a}=Rt.useMutation({mutationFn:e,onMutate:o=>t(s=>(s&&vf({activity:s}),s)),onError:n,onSuccess:(o,s,l)=>{l&&vf({activity:l,reaction:o}),r.setQueryData(i,l)}});return a}function Kge({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:i}){const{mutate:a}=Rt.useMutation({mutationFn:e,onMutate:o=>t(s=>(s&&yf({activity:s}),s)),onError:n,onSuccess:(o,s,l)=>{l&&yf({activity:l,reaction:o}),r.setQueryData(i,l)}});return a}function Gge({queryFn:e,queryKey:t}){const{data:n,error:r,isLoading:i,isFetching:a}=Rt.useQuery({queryFn:e,queryKey:t});return{activity:n,error:r,isLoading:i,isFetching:a}}function Yge({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:i}=Rt.useMutation({mutationFn:e,onMutate:({reactionId:a})=>t(o=>(P3({activity:o,reactionId:a}),o)),onError:n});return i}function Zge({queryFns:{read:e,edit:t,like:n,unlike:r,pin:i,unpin:a,createVote:o,removeVote:s},queryKey:l}){const u=Rt.useQueryClient(),c=yh(),d={queryClient:u,queryKey:l},f={mutationHandlers:{error:zv(d),mutate:Vv(d)},user:c,...d},h=qge({...f,mutationFn:t}),m=Wge({...f,mutationFn:n}),p=Qge({...f,mutationFn:r}),y=Kge({...f,mutationFn:i}),v=Xge({...f,mutationFn:a}),b=Vge({...f,mutationFn:o}),_=Yge({...f,mutationFn:s}),{activity:T,...C}=Gge({queryKey:l,queryFn:e});return{activity:T,mutations:{edit:h,like:m,unlike:p,pin:y,unpin:v,createVote:b,removeVote:_},user:c,...C}}function Qge({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:i}=Rt.useMutation({mutationFn:e,onMutate:a=>t(o=>(o&&R3({activity:o,user:r}),o)),onError:n});return i}function Xge({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:i}=Rt.useMutation({mutationFn:e,onMutate:a=>(console.log("unpin"),t(o=>(o&&F3({activity:o,user:r}),o))),onError:n});return i}const Jge=({basePath:e,parentId:t,activityId:n,isMember:r,isOwner:i,functions:{activities:{remove:a,...o},likes:s,reactions:l,form:u,join:c,leave:d,polls:f},profile:h,categories:m,locale:p=yl,type:y=Cn.Communities})=>{var U,V,z,j,ue,Q,ie,le,te,Ae,Oe,Te;const v=me.useIntl(),b=E.useContext(fn),_={...o,...f},{activity:T,error:C,isLoading:x,mutations:{edit:w,like:P,unlike:O,pin:M,unpin:R,createVote:D,removeVote:S}}=Zge({queryFns:_,queryKey:[e,t,n]});if(x)return g.jsx(qr,{style:{height:"400px"}});if(C||!T)return g.jsx(Ui,{variant:"error",text:v.formatMessage({id:"activitySection_notFoundError"})});const{own_reactions:B,verb:H,latest_reactions:$,mentioned_users:F,additional_data:ne}=T,J=(((U=$==null?void 0:$.like)==null?void 0:U.length)||0)>0,I=!!((V=B==null?void 0:B.like)!=null&&V.find(se=>{var ve;return((ve=se.user)==null?void 0:ve.id)===(b==null?void 0:b.id)})),A=I?B==null?void 0:B.like[0].id:"",Y=J?(z=$==null?void 0:$.like)==null?void 0:z.map(se=>{var ve,ke,Fe;return{id:(ve=se==null?void 0:se.user)==null?void 0:ve.id,name:(Fe=(ke=se==null?void 0:se.user)==null?void 0:ke.data)==null?void 0:Fe.name}}):!1,L=T==null?void 0:T.actor;return g.jsxs("section",{className:"activity-section",children:[g.jsx(u1,{className:"highlighted-text-box subtle",isCommunity:!0,content:{id:n,type:H,title:T==null?void 0:T.title,body:y===Cn.Courses?zN({content:T.content,locale:p}):T==null?void 0:T.content,categories:Zv((T==null?void 0:T.categories)||[],m||[]),createdAt:(T==null?void 0:T.time)||"",slugs:{question:`${e}/${t}`,answer:T==null?void 0:T.id},slug:n,author:Ll(L),userLiked:I,likes:((j=T==null?void 0:T.reaction_counts)==null?void 0:j.like)||0,comments:(T==null?void 0:T.total_replies)||0,peopleWhoLiked:y===Cn.Courses?!1:Y,data:{mentions:F,...ne||{}},pinned:((ue=T==null?void 0:T.reaction_counts)==null?void 0:ue.pin)&&((Q=T==null?void 0:T.reaction_counts)==null?void 0:Q.pin)>0||!1,pollOptions:O3(T,p),pollSettings:{showRemoveVote:(ie=T==null?void 0:T.settings)==null?void 0:ie.show_remove_vote,allowMultipleVotes:(le=T==null?void 0:T.settings)==null?void 0:le.allow_multiple_votes,deadlineAt:(te=T==null?void 0:T.settings)==null?void 0:te.deadline_at,hideParticipants:(Ae=T==null?void 0:T.settings)==null?void 0:Ae.hide_participants,numberOfWinners:(Oe=T==null?void 0:T.settings)==null?void 0:Oe.number_of_winners,resultsVisibility:(Te=T==null?void 0:T.settings)==null?void 0:Te.results_visibility}},originalAuthorId:L==null?void 0:L.id,forceHide:{comments:!0,shareLink:y===Cn.Courses},functions:{content:{createContent:()=>null,deleteContent:a,updateContent:(se,{title:ve,body:ke})=>w({title:ve,content:ke})},likes:{createLike:()=>P({activityId:n}),deleteLike:()=>O({activityId:n,reactionId:A}),listLikes:se=>s.list({activityId:n,...se})},comments:{openComments:()=>{}},pins:{createPin:()=>M({activityId:n}),deletePin:()=>{var se;return R({activityId:n,reactionId:(se=$==null?void 0:$.pin)==null?void 0:se[0].id})}},polls:{createVote:({reactionId:se})=>D({reactionId:se}),removeVote:({reactionId:se})=>S({reactionId:se}),removePoll:()=>f.removePoll({activityId:n})},form:u},styling:{showShareLinkButton:!0},userHasPermissions:r,userHasOwnerPermissions:i,badges:{showBadges:!0,scopes:[{scope:Fn.Communities,area:t||""},{scope:Fn.Platform,area:"all"}]},basePath:e,parentId:t},n),g.jsx(j3,{basePath:e,parentId:t,activityId:n,showReplies:H===at.Poll?zge(T):!0,activityTotalReplies:(T==null?void 0:T.total_replies)||0,isMember:r,functions:{reactions:l,likes:s,form:u,join:c,leave:d},profile:h,type:y})]})};const mD=({showModal:e=!0,functions:t,form:n,cachedText:r,className:i})=>{const a=me.useIntl(),o="discussionFormModal_",{onClose:s=()=>{},cacheText:l=()=>{}}=t,{data:u,meta:c,functions:d}=n,{title:f="",body:h="",mentions:m}=r||{},p="discussion-form-modal";return g.jsx(Sa,{id:p,title:a.formatMessage({id:`${o}title`}),isOpen:e,functions:{onClose:()=>{(f!==""||h!=="")&&l(y=>({...y,showCachedText:!0})),s()}},className:ee("discussion-form-modal",i),children:g.jsx(l1,{...n,data:{...u,mentions:m||(u==null?void 0:u.mentions)},meta:{...c,isAutoFocused:!0,isInOverlay:`${p}-overlay`,hasTitleField:{text:f},isPrepopulated:{text:h||(c==null?void 0:c.isPrepopulated)!==!1&&(c==null?void 0:c.isPrepopulated.text)||""},showGuidelines:!1,showDivider:!0,showPostType:!0},buttons:{submit:a.formatMessage({id:`${o}cta`})},functions:{...d,onChange:y=>{l(v=>({...v,...y}))},onMention:({id:y,name:v}={})=>{if(!y||!v)return;const b=m||{};b[y]={created_at:"",updated_at:"",id:y,data:{name:v}},l(_=>({..._,mentions:b}))},create:async y=>{s(),d.create&&await d.create(y),l({showCachedText:!1})},createPoll:async y=>{const v=()=>{s(),l({showCachedText:!1})};if(d.createPoll)try{const b=await d.createPoll(y);return new Promise(_=>(v(),_(b)))}catch{return new Promise((_,T)=>T())}else return v(),new Promise(b=>b({}))},handleSaveEdit:async y=>{s(),d.handleSaveEdit&&await d.handleSaveEdit(y),l({showCachedText:!1})}}})})},eve=Object.freeze(Object.defineProperty({__proto__:null,default:mD},Symbol.toStringTag,{value:"Module"}));const tve=({className:e,showModal:t=!0,title:n,messagePlaceholder:r,formTitle:i,formLabel:a,ctaMessage:o,showIcon:s,onClose:l,reportError:u=()=>{},sendInvites:c})=>{const d=me.useIntl();return i||(i=d.formatMessage({id:"inviteModal_formTitle"})),a||(a=d.formatMessage({id:"inviteModal_formLabel"})),o||(o=d.formatMessage({id:"inviteModal_cta"})),g.jsx(Sa,{id:"invite-user-modal",title:n,isOpen:t,showDivider:!1,showIcon:s,functions:{onClose:l},className:ee("invite-modal",e,{success:!!n}),children:g.jsx(Sw,{title:i,label:a,messagePlaceholder:r,ctaMessage:o,onClose:l,sendInvites:c,reportError:u})})};const nve=({showModal:e=!0,content:{successMessage:t,title:n,text:r}={},functions:i,form:a,className:o})=>{const s=me.useIntl(),[l,u]=E.useState(YC("showProfile")==="true"||e);E.useEffect(()=>{u(e)},[e]);const{onClose:c=()=>{}}=i;return g.jsx(Sa,{id:"profile-form-modal",title:t||n||s.formatMessage({id:"profileModal_title"}),isOpen:l,showDivider:!t,functions:{onClose:c},className:ee("profile-modal",o,{success:!!t}),maxWidth:700,children:g.jsxs(g.Fragment,{children:[t&&n||r?g.jsxs("div",{className:"intro",children:[t&&n?g.jsx("h3",{children:n}):"",r?g.jsx("p",{children:r}):""]}):null,g.jsx(Dw,{...a,meta:{shouldShowCancelButton:!1},functions:{...(a==null?void 0:a.functions)||{},onSuccess:async d=>{var f;try{(f=a==null?void 0:a.functions)!=null&&f.onSuccess&&await a.functions.onSuccess(d)}finally{c()}}}})]})})},xp=nve,rve=Object.freeze(Object.defineProperty({__proto__:null,default:xp},Symbol.toStringTag,{value:"Module"}));const ive=({members:e})=>{const[t,n]=E.useState(!1),r=i=>{const{fullName:a,jobTitle:o,organisation:s,photo:l}=i||{};return g.jsxs(g.Fragment,{children:[g.jsx(ka,{name:a,src:l}),g.jsx("p",{children:a}),g.jsx("small",{className:"text-medium",children:s?`${o}, ${s}`:o})]})};return g.jsxs("div",{className:"directory-wrapper",children:[g.jsx("ul",{className:"directory",children:e.map(i=>g.jsx("li",{children:g.jsx("button",{onClick:a=>{a.preventDefault(),a.stopPropagation(),n(i)},children:r(i)})},i.fullName))}),g.jsx(Sa,{isOpen:t!==!1,children:t===!1?"":g.jsxs(g.Fragment,{children:[r(t),g.jsx(Xo,{children:t.text})]}),buttons:[{size:"small",variant:"tertiary",onClick:()=>n(!1),children:"Close"}],functions:{onClose:()=>n(!1)}})]})};const ave=({email:e,settings:t={}})=>{const{formatMessage:n}=me.useIntl(),r=E.useContext(fn),{myProfile:i,isConnected:a,cannotConnect:o}=t,[s,l]=E.useState(!1),[u,c]=E.useState(!1);return r?e&&i?g.jsx(Ke,{icon:{icon:"info-inside-circle",position:"right"},size:"small",variant:"secondary",styling:{muted:!0},tooltip:n({id:"member_show_email_tooltip_mine"}),forceTooltip:!0,className:"show-email fake-button",children:e}):o?g.jsx(Ke,{icon:"email",size:"small",variant:"secondary",styling:{muted:!0},tooltip:n({id:"member_show_email_tooltip_private"}),forceTooltip:!0,className:"show-email fake-button",children:n({id:"member_show_email_private"})}):a?e&&a?g.jsx(g.Fragment,{children:s?g.jsx(Ke,{icon:{icon:"copy",position:"right"},size:"small",variant:"secondary",styling:{muted:!0},className:"show-email copy-button",tooltip:n({id:`member_show_email_tooltip${u?"_copied":""}`}),forceTooltip:!0,"data-gtm-event-context":"connections-email-address-button","data-gtm-event-type":"copy-email-click",onClick:()=>{navigator.clipboard.writeText(e).then(()=>{c(!0),setTimeout(()=>{c(!1)},2e3)})},children:e}):g.jsx(Ke,{icon:"email",size:"small","data-gtm-event-context":"connections-email-address-button","data-gtm-event-type":"show-email-click",onClick:()=>l(!0),children:n({id:"member_show_email_show"})})}):g.jsx(g.Fragment,{}):g.jsx(Ke,{icon:"email",size:"small",variant:"secondary",styling:{muted:!0},className:"show-email fake-button",children:n({id:"member_show_email_hide"})}):g.jsx(g.Fragment,{})};const ove=({author:e,authorCite:t,content:n,member:r,className:i=""})=>g.jsxs("blockquote",{className:ee("testimonial-block",i),children:[g.jsx(Ri,{className:"testimonial",children:n}),r?g.jsx(Ea,{member:r,styling:{size:"large"}}):g.jsxs(g.Fragment,{children:[e&&g.jsx("p",{className:ee("author",{"text-small":!i.includes("new")}),children:e}),t&&g.jsx("p",{className:ee("author-cite",{"text-small":!i.includes("new")}),children:g.jsx("cite",{children:t})})]})]}),sve=E.memo(ove);const lve=({items:e=[],selector:t="",className:n=""})=>{const r=me.useIntl(),[i,a]=E.useState(e);return E.useEffect(()=>{if(e.length)return;let o="";Array(6).fill(0).forEach((u,c)=>{o+=`${c>0?", ":""}${t} h${c+1}`});const l=Array.from(document.querySelectorAll(o)).filter(u=>u.id).map(u=>({id:u.id,text:u.textContent||""}));a(l)},[]),i&&i.length>0&&g.jsxs(Er,{variant:"subtle",className:ee("table-of-contents",n),children:[g.jsx("h2",{children:r.formatMessage({id:"tableOfContents"})}),g.jsx("nav",{children:g.jsx("ul",{children:i.map(({id:o,text:s})=>g.jsx("li",{children:g.jsx("a",{href:`#${o}`,children:s})},o))})})]})};const wp=({time:e,rangeTime:t,prependedText:n,appendedText:r,className:i=""})=>{const a=me.useIntl(),o="timeToComplete_";if(!e||typeof e!="number")return null;const s=c=>{const d=c/60,f=Math.floor(d),h=(d-f)*60,m=Math.round(h),p=`${a.formatMessage({id:`${o}hours`},{time:f})}${f>0&&m>0?", ":""}${a.formatMessage({id:`${o}minutes`},{time:m})}`;return{text:`${f>0?`${a.formatMessage({id:`${o}hours_short`},{time:f})} `:""}${m>0?a.formatMessage({id:`${o}minutes_short`},{time:m}):""}`,ariaText:p}};let{text:l,ariaText:u}=s(e);if(t){const{text:c,ariaText:d}=s(e+t);l=a.formatMessage({id:`${o}range`},{early:l,late:c}),u=a.formatMessage({id:`${o}range_aria`},{early:u,late:d})}return n&&(u=`${n} ${u}`,l=`${n} ${l}`),r&&(u=`${u} ${r}`,l=`${l} ${r}`),g.jsx("span",{className:ee("time-to-complete",i),"aria-label":u,children:l})};const uve=({className:e="",image:t,...n})=>t?(typeof t=="string"&&(t={width:1080,height:200,type:"image/png",url:t}),t.range=[{height:124,width:425},{height:200,width:768},{height:200,width:1368}],t.query="fit=thumb&f=center",g.jsx(co,{...n,className:ee("banner",e),image:{...t,aspect:"banner"}})):null;const cve=["small","span","strong","em","p","h1","h2","h3","h4","h5","h6","blockquote","q"],dve=({className:e="",content:t,image:n,variant:r,spacing:i="normal",styling:a,hideElements:o={eyebrow:!1,title:!1,text:!1},cta:s,children:l})=>{var m,p;const u={imageFullWidth:!0,...a};r||(r=u.imageFullWidth?"default":"light");const c=["eyebrow","title","text"],d={eyebrow:"small",title:"h1",text:"p"},f={};c.forEach(y=>{if(!t[y]){f[y]=!1;return}if(!o[y]){if(typeof t[y]=="object"){f[y]=t[y];const{text:v,element:b}=t[y];if(b&&cve.includes(b.toLowerCase()))return;f[y]={text:v,element:d[y]};return}f[y]={text:t[y],element:d[y]}}});const h=s&&s.text&&s.link;return h&&s.link[0]==="#"&&(s.props||(s.props={}),s.props.onClick=y=>{y.preventDefault(),y.stopPropagation();const v=document.getElementById(s.link.substring(1));v&&v.scrollIntoView({behavior:"smooth"})}),g.jsx(mo,{className:ee("banner-section",r,i,e,{"has-image":n,"image-full-width":n&&u.imageFullWidth,"image-inline":n&&!u.imageFullWidth,"has-cta":h,"has-extra-spacing":r!=="subtle"&&i==="normal"&&f.eyebrow&&f.title}),children:g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"content-wrapper",children:[c.map(y=>{if(f[y]&&typeof f[y]=="object"){const{text:v,element:b=""}=f[y];return y==="text"?g.jsx(Xo,{overrideType:"text-only",className:"text",children:v},y):E.createElement(b,{key:y,className:y},v)}return null}),l,h&&g.jsx(Ke,{variant:n||["light","subtle"].includes(r)?"primary":"secondary",size:{mobile:"medium",768:"large"},href:s.link,...s.props,className:ee({new:r==="subtle",[(m=s.props)==null?void 0:m.className]:(p=s.props)==null?void 0:p.className}),children:s.text})]}),n&&g.jsx(co,{image:{...n,aspect:u.imageFullWidth?"banner":n.aspect||void 0}})]})})},fve=E.memo(dve);const hve=({image:e,variant:t="default",children:n,className:r=""})=>{const i={};return e&&(i["--image"]=`url(${e})`),g.jsx(mo,{className:ee("custom-content-banner",t,r,{"has-image":e}),style:i,children:g.jsx("div",{className:"content-slim",children:n})})};const pve=({alignImage:e="left",className:t,content:n,image:r})=>{const i=typeof n=="string"?g.jsx(Xo,{children:n}):n;return g.jsxs(mo,{className:ee("highlight-section",t),children:[r&&g.jsx("div",{className:ee("highlight-container highlight-image",{[`highlight-image-${e}`]:e==="right"}),children:g.jsx(co,{image:{...r,description:"",query:"q=85",aspect:"highlightSection"}})}),g.jsx("div",{className:ee("highlight-container highlight-content-wrapper",{"no-image":!r}),children:g.jsx("div",{className:ee("highlight-content",{"highlight-content-right":e==="left"}),children:r?i:g.jsx("div",{className:"content-default",children:i})})})]})},mve=E.memo(pve);const gve=({variant:e="primary",button:t=null,title:n,text:r,gtmContext:i})=>!n&&!r?null:g.jsxs("aside",{className:ee("marketing-block",e),children:[n&&g.jsx("p",{className:"title",children:n}),r&&g.jsx("p",{children:r}),t&&g.jsx(Ke,{variant:t.variant||"secondary",size:"medium",href:t.link,className:"gtm-trackable","data-gtm-event-context":i,"data-gtm-event-type":"learn-more-click",children:t.text})]}),vve=({type:e,data:t})=>{const n=me.useIntl(),{answers:r,createdAt:i,dateHasPassed:a,isOngoingEvent:o,pill:s,readingTime:l,publishedDate:u,startDate:c}=t;if(e==="question"){const d=i&&J0(i);return g.jsxs("p",{className:"details answers","data-testid":"question-answers",children:[n.formatMessage({id:"card_answers"},{number:r}),i&&g.jsxs("span",{"data-testid":"question-created-at",children:[" ","·"," ",n.formatMessage({id:"card_time_ago"},{time:d?n.formatMessage({id:`dates_${d.path}`},{number:d.number}):0})]})]})}if(c&&!a||o)return g.jsx("p",{className:"details",children:o?n.formatMessage({id:"card_bootcamp"}):Dv(c)});if(s)return g.jsx(Fi,{variant:s==="free"?"subtle":"highlighted",className:s,"data-testid":"course-type",children:s});if(l||u){const d=u&&J0(u);return g.jsxs("ul",{className:"details",children:[l&&g.jsx("li",{"data-testid":"reading-time",children:n.formatMessage({id:"card_time_read"},{time:l})}),u&&g.jsx("li",{"data-testid":"published-date",children:n.formatMessage({id:"card_time_ago"},{time:d?n.formatMessage({id:`dates_${d.path}`},{number:d.number}):0})})]})}return null},yve={title:66,text:3e3,secondaryText:1e3,partner:34},hh={communityPage:{basePath:"/communities/",className:"communityPage",gtmEvent:"community"},customCard:{className:"custom",gtmEvent:"custom",length:{text:335,secondaryText:150}},event:{basePath:"/events/",className:"event",gtmEvent:"event"},microcourse:{basePath:"/microcourses/en/",className:"course",gtmEvent:"microcourse-overview"},courseJourney:{basePath:"/courses/",className:"course",gtmEvent:"microcourse-overview"},solutionArticle:{basePath:"/solution-articles/en/",className:"article",length:{title:60},gtmEvent:"article"},qaQuestion:{basePath:"/questions-answers/",className:"question",length:{title:190},gtmEvent:"q-and-a-question"},listPage:{basePath:"/list/en/",className:"list",gtmEvent:"list"},people:{basePath:"/profiles/",className:"people",length:{people:1e3},gtmEvent:"person"},learningHub:{basePath:"/learning-hub/",className:"learning-hub",length:{title:190},gtmEvent:"learning-hub"}},bve=({data:e,cta:t,link:n,gtmContext:r})=>{var p,y;const i=me.useIntl(),[a,o]=E.useState({loading:!1,registered:e.registered||!1});E.useEffect(()=>{e.registered&&o(v=>({...v,registered:!0}))},[e.registered]);const{customLinkText:s,startDate:l,dateHasPassed:u,pill:c,slug:d}=e,f=e.contentType;let h="";if((p=hh[f])!=null&&p.gtmEvent&&(h=hh[f].gtmEvent),l&&u)return n?g.jsx("a",{href:n,className:"details additional-link gtm-trackable","data-gtm-event-context":`${r}-CarouselCard`,"data-gtm-event-type":`${h}-click`,children:s||i.formatMessage({id:"card_watch"})}):null;if(f==="people")return n?g.jsx(Ke,{variant:"tertiary",size:"small",href:n,className:"gtm-trackable","data-gtm-event-context":`${r}-Card-Button`,"data-gtm-event-type":`${h}-click`,children:s||i.formatMessage({id:"card_cta_people"})}):null;const m=["communityPage","microcourse","event"];if(t&&t.onClick&&m.includes(f)&&c!=="premium"){const v=a.loading||a.registered||((y=e==null?void 0:e.members)==null?void 0:y.isMember),b=async _=>{var T;if(_.preventDefault(),_.stopPropagation(),window&&((T=window.dataLayer)==null||T.push({event:"gtm.click","gtm.element":n,"gtm.elementClasses":"gtm-trackable","gtm.elementUrl":n,EventType:`${r}-${f}-register-click`,EventContext:`${r}Page-${f}: ${d}`})),!(v||!t||!t.onClick)){o(C=>({...C,loading:!0}));try{const C=await t.onClick(e);o(C==="success"?()=>({registered:!0,loading:!1}):x=>({...x,loading:!1}))}catch{o(x=>({...x,loading:!1}))}}};return g.jsx("p",{className:ee("cta-wrapper",{"has-member-section":e==null?void 0:e.members}),children:g.jsx(Ke,{onClick:b,className:"gtm-trackable",size:"small",styling:{fullWidth:!0},disabled:v,"data-gtm-event-context":`${r}Page-${f}: ${d}`,"data-gtm-event-type":`${r}-${f}-register-click`,"data-testid":"in-card-button",children:s||i.formatMessage({id:`card_cta_${f}${v?`_${a.loading?"loading":"done"}`:""}`})})})}return null};function Eve({buildMemberData:e,communitySlug:t}){const n=me.useIntl(),r=E.useContext(fn),[i,a]=E.useState({count:"...",isMember:!1,memberType:""});return E.useEffect(()=>{e(t,typeof(r==null?void 0:r.id)<"u").then(o=>{if(!o)return;const{membersCount:s,role:l="",pagination:u}=o;let c=0;s?c=s:u!=null&&u.total&&(c=u==null?void 0:u.total),a({count:c.toString(),isMember:!!l,memberType:l})})},[t,e]),g.jsxs("span",{className:"member-information",children:[i.isMember&&g.jsx(Fi,{size:"small",variant:"registered",icon:(i==null?void 0:i.memberType)==="owner"?"user":"tick",children:n.formatMessage({id:`card_member_type_${i.memberType}`})}),g.jsx("span",{className:"label member-count",children:n.formatMessage({id:"card_member_count"},{count:i.count})})]})}const d5=({id:e="",className:t="",buildCardData:n,buildMemberData:r,card:i,cta:a,gtmContext:o="Carousel",handleCardClick:s,meta:l})=>{var S,B;const u=me.useIntl(),c=E.useContext(fn),d=!!(c!=null&&c.id),{isTabbable:f=!0,setFocus:h=!1}=l||{},m=E.useRef(null),[p,y]=E.useState({data:null,isLoading:!0});E.useEffect(()=>{n(i,d).then(H=>{y({data:H,isLoading:!1})}).catch(()=>y(H=>({...H,isLoading:!1})))},[i,d,n]);const{data:v,isLoading:b}=p;if(b||!v)return g.jsx(qr,{element:"li",className:"card-wrapper","data-testid":"card-placeholder"});s&&!a&&(a={text:u.formatMessage({id:`card_cta_${i.contentType}`}),onClick:s});const{contentType:_}=v;if(!_||!hh[_])return g.jsx(qr,{element:"li",className:"card-wrapper"});const{basePath:T="",className:C,length:x,gtmEvent:w}=hh[_];let P=f&&v.slug?`${T}${v.slug}`:!1;f&&v.slug&&(v.slug.slice(0,4)==="http"||v.slug.slice(0,2)==="//"||v.slug.slice(0,6)==="mailto"||v.slug.slice(0,3)==="tel")&&(P=v.slug);const O=H=>{if(P){H.preventDefault(),H.stopPropagation();const $=H.currentTarget.getAttribute("data-url");window&&window.dataLayer.push({event:"gtm.click","gtm.element":$,"gtm.elementClasses":"gtm-trackable","gtm.elementUrl":$,EventType:`${o}-CarouselCard`,EventContext:`${w}-click`}),window.location.href=$}},M={...yve,...x};let R={className:"card"},D={};return P&&(D={href:P,className:"gtm-trackable","data-gtm-event-context":`${o}-CarouselCard`,"data-gtm-event-type":`${w}-click`,"data-testid":"link"},v.openInNewTab&&(D.target="_blank"),R={onClick:O,className:"card gtm-trackable","data-gtm-event-context":`${o}-CarouselCard`,"data-gtm-event-type":`${w}-click`}),h&&(R={...R,tabIndex:"0"},(S=m==null?void 0:m.current)==null||S.focus(),(B=m==null?void 0:m.current)==null||B.scrollIntoView({behavior:"smooth"})),g.jsx("li",{className:ee("card-wrapper text-medium",C,t,{"has-link":P,"no-link":!P,"has-image":v.banner}),"data-testid":`${_}-card`,children:g.jsxs("div",{...R,ref:m,"data-url":P,children:[g.jsx(QC,{className:"card-label",contentType:_,customIcon:v.isPrivate?"lock-locked":v.customIcon,customLabel:v.customLabel}),_==="communityPage"&&(v==null?void 0:v.createdAt)&&qD(v==null?void 0:v.createdAt,60)&&g.jsx(Fi,{size:"small",variant:"information","data-testid":"new-community",children:u.formatMessage({id:"card_new"})}),v.startDate&&!v.isOngoingEvent&&g.jsx(Fi,{size:"small",variant:v.dateHasPassed?"default":"information","data-testid":"date",children:v.dateHasPassed?u.formatMessage({id:"card_ended"}):WC(v.startDate)}),v.banner?g.jsxs("p",{className:"img",children:[v.registered&&g.jsx(Fi,{size:"small",variant:"registered",children:u.formatMessage({id:"card_registered"})}),g.jsx(co,{image:{...v.banner,description:""}})]}):C==="people"?g.jsx(ka,{name:v.title||"",src:v.profile,"data-testid":"people-profile-picture"}):null,v.contributors&&g.jsx(Bv,{contributors:{data:v.contributors},styling:{size:"small",showGap:C!=="question",showText:!0},multipleText:["event","solutionArticle"].includes(_)?u.formatMessage({id:`card_contributors_${_}`}):void 0,"data-testid":"contributors"}),v.partner&&g.jsx("p",{className:"partners","data-testid":"partners",children:v.partner.length>1?u.formatMessage({id:"card_partner"},{partner:v.partner[0],number:v.partner.length-1}):pl(v.partner[0],M.partner)}),["title","text","secondaryText"].map(H=>{const $=v[H];if(!$)return null;const F=HC(H),ne={key:H,className:F,"data-testid":F},J={wrapper:"p",forceWrapper:!0,forceInline:!0},I=pl($,M[H]);return["title","text"].includes(H)&&P?(J.wrapper="a",g.jsx("p",{...ne,children:g.jsx(Ri,{options:J,...D,children:I})})):g.jsx(Ri,{options:J,...ne,children:I})}),i.contentType==="communityPage"&&(i.slug||v.slug)&&r&&g.jsx(Eve,{communitySlug:i.slug||v.slug,buildMemberData:r}),g.jsx(vve,{type:C||"",data:v}),g.jsx(bve,{data:v,cta:a,link:P||"",gtmContext:o})]})})};const gD=({cards:e,cardTypes:t,className:n="",...r})=>g.jsx("ul",{className:ee("card-block",n),children:e.map((i,a)=>{const o=i.slug?`${i.slug}-${t[a]}`:`${t[a]}-${a}`;return g.jsx(d5,{id:o,card:{...i,contentType:t[a]},meta:{setFocus:a===(r==null?void 0:r.focusCardIndex)},...r},o)})}),_ve=(e,t,n,r)=>{const i=t*n<=e,a=e<t*(n+1),o=r.includes(Math.floor(e/t));return{inView:i&&a,isLoaded:o}},Tve=({id:e,title:t})=>{const n=me.useIntl();if(!t||!t.text)return null;const{text:r,element:i="h2",variant:a="default",size:o="medium",link:s}=t;return E.createElement(i,{className:ee("title",a,o,{"highlighted-title":a==="highlighted"}),children:g.jsxs(g.Fragment,{children:[r,s&&g.jsx("a",{href:s,className:"text-medium gtm-trackable","data-gtm-event-context":"CarouselViewAll","data-gtm-event-type":`${e||window.btoa(r)}-view-all-click`,children:n.formatMessage({id:"card_carousel_viewAll"})})]})})};const Y0={fourCards:1024,threeCards:769,twoCards:480};let vd=null,Z0=null;const Cve=({id:e,cards:t,cardTypes:n,buildCardData:r,title:i,className:a,gtmContext:o,...s})=>{const l=me.useIntl(),u="carousel_pagination_",[c,d]=E.useState({cardsPerPage:4,isLoading:!0}),{cardsPerPage:f,isLoading:h}=c,[m,p]=E.useState({currentPage:0,loadedPages:[0]}),{currentPage:y,loadedPages:v}=m,[b,_]=E.useState(""),T=t.length,C=Math.ceil(T/f),x=E.useRef(null),w=lo(!0,!0,x==null?void 0:x.current);E.useEffect(()=>{let S=1;w&&(w>=Y0.fourCards?S=4:w>=Y0.threeCards?S=3:w>=Y0.twoCards&&(S=2),S>T&&(S=T)),d(B=>({...B,cardsPerPage:S,isLoading:!1}))},[w,T]);const P=(S="next")=>{Z0&&clearTimeout(Z0);let B=y;if(typeof S=="string")if(S==="next")if(y<C-1)B=y+1;else return;else if(y>0)B=y-1;else return;else B=S;_(""),p($=>({...$,currentPage:B,loadedPages:[...new Set([...v,B])]}));const H=()=>{const $=B*c.cardsPerPage,F=$+c.cardsPerPage;return t.slice($,F).length};Z0=setTimeout(()=>{_(l.formatMessage({id:`${u}ariaLive${typeof S=="string"?"":"_slide"}`},{direction:l.formatMessage({id:`${u}${typeof S=="string"?S:"next"}`}),slide:typeof S=="string"?1:S+1,count:H()}))},500)},O=S=>{vd=S.touches[0].clientX},M=S=>{if(vd===null)return;const B=S.touches[0].clientX,H=vd-B;H>5?P("next"):H<-5&&P("previous"),vd=null},R={"--width":`${w||0}px`,"--total-cards":T,"--cards-per-page":f,"--page":y};if(h)return g.jsx(bh,{layout:`carousel${i?"-with-title":""}`});const D=(S,B)=>{var $;let H=null;return($=S==null?void 0:S.sys)!=null&&$.id?H=`card-${S.sys.id}`:S!=null&&S.slug?H=`card-${S.slug}`:[n[B],S.contentType].includes("customCard")&&(H=`card-${window.btoa(`${S.title} ${S.createdAt}`)}-${B}`),H};return g.jsxs("section",{ref:x,className:ee("carousel-wrapper",a),"data-testid":"carousel",children:[g.jsx(Tve,{id:e,title:i}),g.jsx("ul",{className:"carousel",onTouchStart:O,onTouchMove:M,style:R,"data-testid":"carousel-list",children:t.map((S,B)=>{let H=D(S,B);const{inView:$,isLoaded:F}=_ve(B,f,y,v);return H&&($||F)?g.jsx(d5,{id:H,card:{...S,contentType:n[B]},buildCardData:r,gtmContext:o,meta:{isTabbable:$},...s},H):(H=H||`${e}-card-${B}`,g.jsx(qr,{element:"li",className:"card-wrapper","data-testid":"card-placeholder"},H))})}),C<=1?null:g.jsxs(g.Fragment,{children:[g.jsxs("ul",{className:"controls","data-testid":"carousel-controls",children:[g.jsx("li",{className:"arrow previous",children:g.jsx(Ke,{variant:"secondary",size:"large",icon:{icon:"chevron_left"},onClick:S=>{S.preventDefault(),S.stopPropagation(),P("previous")},screenreaderText:l.formatMessage({id:`${u}previousSlide`}),disabled:y<=0})}),[...Array(C)].map((S,B)=>g.jsx("li",{"data-testid":"carousel-controls-button",children:g.jsx("button",{className:ee("page-indicator",{selected:B===y}),onClick:H=>{H.preventDefault(),H.stopPropagation(),P(B)},children:g.jsx(xt,{showOnFocus:!1,children:l.formatMessage({id:`${u}slide`},{number:B+1,total:C})})})},`page-indicator-${B}`)),g.jsx("li",{className:"arrow next",children:g.jsx(Ke,{variant:"secondary",size:"large",icon:{icon:"chevron_right"},onClick:S=>{S.preventDefault(),S.stopPropagation(),P("next")},screenreaderText:l.formatMessage({id:`${u}nextSlide`}),disabled:y>=C-1})})]}),g.jsx(xt,{"aria-live":"polite",showOnFocus:!1,children:b})]})]})},xve=({carousels:e=[],isLoading:t,title:n,className:r="",...i})=>!e||!e.length?null:e.map(({title:a,viewAllUrl:o,cards:s,cardsTypes:l},u)=>{const c=a?window.btoa(a):`carousel-${u}`,d=u===e.length-1;return t?g.jsxs(E.Fragment,{children:[g.jsx(bh,{layout:`carousel${a?"-with-title":""}`,"data-testid":"carousel-placeholder"}),d?null:g.jsx(fi,{})]},`placeholder-${c}`):g.jsxs(E.Fragment,{children:[g.jsx(Cve,{cards:s,cardTypes:l,title:n!=null&&n.hidden?{}:{...n,text:a,link:o},...i}),d?null:g.jsx(fi,{})]},`carousel-${c}`)});const wve=({element:e="div",className:t="",card:n,gtmContext:r="NarrowCard"})=>{const{banner:i,title:a,text:o,isPrivate:s,slug:l}=n;let u={};return l&&(u={onClick:d=>{l&&(d.preventDefault(),d.stopPropagation(),window.location.href=l)},tabIndex:"0","data-gtm-event-context":`${r}-NarrowCard`,"data-gtm-event-type":`${r}-click`}),E.createElement(e,{className:ee("narrow-card",t,{"has-link":l,"gtm-trackable":l,"no-link":!l}),...u,children:g.jsxs(g.Fragment,{children:[g.jsx("div",{className:ee("img",{private:s,"no-image":!i}),children:i&&g.jsx(co,{image:i})}),g.jsxs("div",{className:"content",children:[a&&g.jsx("p",{className:"title text-medium",children:a}),o&&g.jsx("p",{className:"text text-medium",children:o})]})]})})};const Ave=({element:e="p",data:{timeLeftToFinish:t,percentageCompleted:{inTime:n=0,inLessons:r=0},shouldShowTimes:i=!0},graph:a,styling:o={},className:s=""})=>{const l=me.useIntl();let u=i?n:r;u>99?u=100:u<1&&(u=0);const{highlightPercentage:c=!1}=o;return E.createElement(e,{className:ee("course-progression",s,{"highlight-percentage":c,"has-circle-graph":a==="circle"}),children:g.jsxs(g.Fragment,{children:[g.jsx(Mv,{progress:u,styling:{layout:a||"bar",size:a&&a==="circle"?"small":"default"}}),g.jsx("span",{className:"percentage",children:l.formatMessage({id:"courseProgression_done"},{percent:d=>g.jsx("strong",{children:d}),number:u})}),u<100&&i&&g.jsx(wp,{time:t,appendedText:l.formatMessage({id:"courseProgression_timeLeft"})})]})})};const vD=({element:e="span",sectionId:t,subsectionId:n,title:r,className:i=""})=>E.createElement(e,{className:ee("lesson-name",i),"data-number":`${t}.${n}`,children:r});const yD=({size:e="default",completionTime:t,icon:n,optional:r,type:i,children:a})=>{const o=me.useIntl(),s=gh(`lessonType_${i}`)?o.formatMessage({id:`lessonType_${i}`}):zC(i||"");return g.jsxs("small",{className:ee("content-type",{[e]:e!=="default"}),children:[g.jsx("span",{className:ee("type",n),children:s})," ",t>0&&!r&&g.jsx(wp,{time:t})," ",a?g.jsx("span",{className:"additional",children:a}):null]})};const kve=({course:{articles:e,canAccessCourse:t,description:n,hideTimes:r,isEnrolled:i,sectionId:a,sectionTime:o,slug:s,timeLeft:l,title:u},quizScores:c})=>{const d=me.useIntl(),f="courseStructure_",h=u.toLowerCase().includes("course conclusion");return g.jsxs(vh,{className:"course-structure",label:g.jsxs(g.Fragment,{children:[g.jsxs("small",{children:[d.formatMessage({id:`${f}section${h?"_end":""}`},{number:a})," ",!r&&o>=0&&g.jsx("span",{className:"time",children:i&&l===0?d.formatMessage({id:`${f}time_completed`}):g.jsx(wp,{time:o,appendedText:i?d.formatMessage({id:`${f}time_left`}):""})})]}),g.jsx("h3",{children:u})]}),shouldAnimate:!0,children:[g.jsx("p",{children:n}),g.jsx("ol",{children:e&&e.length>0&&e.map(({completed:m,completionTime:p,contentType:y,icon:v,image:b,isIntroduction:_,optional:T,slug:C,subsectionId:x,title:w,type:P})=>{const O=i&&t||_,M={};return b&&(M.style={"--image":`url(${b})`}),g.jsx("li",{className:ee({article:y===Du.ARTICLE,discussion:y===Du.DISCUSSION,quiz:y===Du.QUIZ,completed:m&&y===Du.ARTICLE,locked:!O}),...M,children:g.jsx(fo,{href:O?`/microcourses/en/${s}/${C}`:void 0,fallbackElement:"span",className:"inner",gtmContext:`MicrocourseOutline${UC(w)}`,gtmType:"article-click",children:g.jsxs(g.Fragment,{children:[g.jsx(vD,{sectionId:a,subsectionId:x,title:w,className:"course-title"})," ",g.jsx(yD,{completionTime:p,icon:v,optional:T,type:P,children:c&&c[C]&&g.jsx("span",{className:"quiz-score",children:`${c[C]}%`})})]})})},C)})})]})};const Sve=({isComplete:e=!1,onClick:t,...n})=>{const r=me.useIntl();return n["data-gtm-event-context"]||(n["data-gtm-event-context"]="LessonIntroduction"),g.jsx(Ke,{...n,variant:"tertiary",icon:e?{icon:"check-inside-circle_no-overlap_inverted"}:{icon:"check-inside-circle_no-overlap",hover:"check-inside-circle_no-overlap_inverted"},onClick:t,className:ee("mark-complete-button center gtm-trackable",{completed:e}),"data-gtm-event-type":"mark-as-complete",disabled:e,children:r.formatMessage({id:`markCompleteButton${e?"_completed":""}`})})},Dve=({id:e,data:{jobTitle:t,name:n,organization:r,thumbnail:i}})=>({id:e,name:n,jobTitle:t,organization:r,image:{thumbnail:i}}),DC=[{contentType:"solutionArticle",banner:{description:"",url:"//images.ctfassets.net/txbhe1wabmyx/kCcBdXurt3uOKu6NdTPm0/1b6d19179b21f98dbdadf2477c03d267/devin-avery-7gwqj0yyrhm-unsplash.jpg",width:295,height:180,type:"image/jpeg",aspect:"responsiveCard",query:"w=295&h=180&fit=thumb&f=center"},slug:"why-public-servants-must-learn-to-fail",contributors:["community"]},{contentType:"solutionArticle",banner:{description:"",url:"//images.ctfassets.net/txbhe1wabmyx/12Y0W1K0zVcDKzgLZlbfyC/6eb0757a02cbeea19b1b42d7da04d553/ashkan-forouzani-m0l9nbcivuk-unsplash.jpg",width:295,height:180,type:"image/jpeg",aspect:"responsiveCard",query:"w=295&h=180&fit=thumb&f=center"},slug:"organisational-culture-change-and-failure",contributors:[{name:"Mari-Liis",id:"bdb7509c-89ed-4633-8bc0-dbf11f5d9be1"}]},{contentType:"solutionArticle",banner:{description:"",url:"//images.ctfassets.net/txbhe1wabmyx/26TEwu0xVkbQDguuW89fY6/d54ce406cdd652d68979770d526398ab/nik-shuliahin-bunwp1bl0nc-unsplash.jpg",width:295,height:180,type:"image/jpeg",aspect:"responsiveCard",query:"w=295&h=180&fit=thumb&f=center"},slug:"how-to-learn-from-failure-without-causing-a-scandal",contributors:["community"]}];const yd="notFoundError_",Ove=()=>{const e=me.useIntl(),t=[];return DC.forEach((n,r)=>{n.title=e.formatMessage({id:`${yd}post_${r+1}`}),t.push("solutionArticle")}),g.jsxs(sD,{styling:{background:"bold",circle:"small",variant:"alt-2"},additionalContent:{appended:g.jsxs(mo,{children:[g.jsx(gD,{cards:DC,cardTypes:t,buildCardData:n=>new Promise((r,i)=>{r(n)})}),g.jsx(Ke,{href:"/solution-articles/",children:e.formatMessage({id:`${yd}cta`})})]})},reportError:()=>{},className:"not-found-error",children:[g.jsx("h1",{children:e.formatMessage({id:`${yd}title`})}),g.jsx("p",{children:e.formatMessage({id:`${yd}text`})})]})};exports.ASSETS_URL=Hi;exports.ActionBar=V3;exports.ActionButton=bc;exports.ActivitiesFeed=hI;exports.ActivitySection=Jge;exports.ActivityType=Bl;exports.AddPost=u5;exports.Badge=f3;exports.BadgeScope=Fn;exports.Badges=h3;exports.BadgesContext=Nv;exports.BadgesProvider=n3;exports.Banner=uve;exports.BannerSection=fve;exports.Breadcrumbs=RI;exports.Buckets=lO;exports.Button=Ke;exports.ButtonWrapper=Fl;exports.COURSE_CONTENT_TYPES=Du;exports.CacheProvider=r3;exports.Card=d5;exports.CardBlock=gD;exports.Carousel=xve;exports.CharacterLimit=Jv;exports.Checkbox=ey;exports.CollapsibleSection=vh;exports.Columns=K3;exports.CommunityDetails=NN;exports.ConnectionCta=p3;exports.ConnectionDirectionType=Fv;exports.ConnectionStatusType=Rv;exports.ContactFooter=LU;exports.ContactForm=kw;exports.ContentTypeLabel=QC;exports.Contributors=Bv;exports.ConversationContext=Cp;exports.CookieBanner=Pw;exports.CourseProgression=Ave;exports.CourseStructure=kve;exports.CustomContentBanner=hve;exports.CustomEvents=bn;exports.DELETED_USER_ID=gc;exports.Directory=ive;exports.DiscussionContentType=at;exports.DiscussionConversation=cD;exports.DiscussionForm=l1;exports.DiscussionFormCard=fD;exports.DiscussionFormModal=mD;exports.DiscussionPost=u1;exports.DiscussionThread=pD;exports.DiscussionType=Cn;exports.Divider=fi;exports.DownloadSection=RU;exports.EMAILS=zs;exports.EditSection=MU;exports.EmailHelperTextBox=Y3;exports.EmptyStateBox=Ui;exports.EnrichedUrl=Qv;exports.FeatureFlags=o3;exports.Filters=q3;exports.FlagsProvider=a3;exports.Footer=Sy;exports.Form=Zi;exports.Formatting=ae;exports.Fragment=Pr;exports.FullWidthSection=mo;exports.GET_STREAM_USER_PREFIX=X0;exports.GlobalProviders=EO;exports.Header=l5;exports.HelperTextBox=JC;exports.HiddenFromScreenReaders=mh;exports.HideShowTextBox=e3;exports.HighlightSection=mve;exports.HighlightedTextBox=Er;exports.INVALID_TOKEN=VC;exports.IconBulletedList=dO;exports.ImageContainer=iO;exports.IntlProvider=s3;exports.InviteForm=Sw;exports.InviteModal=tve;exports.JoinButton=Uv;exports.Label=Af;exports.LanguageContext=Iv;exports.LanguageSwitcher=MI;exports.LessonName=vD;exports.LessonType=yD;exports.LikesButton=L3;exports.LikesFeed=H3;exports.LikesModal=U3;exports.Link=fo;exports.LoadMore=Vc;exports.LoadingBlock=m3;exports.LoadingPlaceholder=qr;exports.LoadingState=bh;exports.Logo=Xv;exports.LogoSection=BU;exports.MEMBERS_PER_PAGE=lD;exports.MENTION_REGEX=qC;exports.MarkCompleteButton=Sve;exports.MarkdownText=Xo;exports.MarketingBlock=gve;exports.Marks=Pi;exports.Member=Ea;exports.MembersList=uD;exports.Modal=Lv;exports.MoreMenu=bf;exports.NUMBER_OF_COUNTRIES=UD;exports.NUMBER_OF_USERS=HD;exports.NarrowCard=wve;exports.NavigationMenu=W3;exports.NotFoundError=Ove;exports.Overlay=Sa;exports.OverlayContext=Pv;exports.OverlayProvider=c3;exports.PageHeading=d3;exports.PageLayout=sD;exports.Password=Z3;exports.PasswordForm=xU;exports.PasswordRules=tx;exports.Pill=Fi;exports.Poll=dD;exports.Popover=ZC;exports.Portal=Ml;exports.ProfileForm=Dw;exports.ProfileImageChange=Aw;exports.ProfileModal=xp;exports.ProfileModalLauncher=c5;exports.ProfilePicture=ka;exports.ProgressBar=Mv;exports.ProgressTracker=oO;exports.PublishArticleForm=kU;exports.Rating=JI;exports.RepliesFeed=j3;exports.ResponsesHeading=hD;exports.ResponsiveImage=co;exports.ResultsVisibility=fh;exports.ReturnToNavButton=sO;exports.RichTextEditor=ky;exports.STORAGE_KEYS=Sv;exports.SearchForm=Nw;exports.ShareLink=z3;exports.ShareLinks=UI;exports.ShowEmail=ave;exports.SignupForm=PU;exports.Span=ng;exports.StatusBanner=gl;exports.TableOfContents=lve;exports.Tabs=zI;exports.Tags=wge;exports.TestimonialBlock=sve;exports.TimeToComplete=wp;exports.Toggle=TU;exports.Tooltip=ss;exports.TopLevelPage=$U;exports.UUID_V4_REGEX=vc;exports.UserContext=fn;exports.UserProvider=l3;exports.VisuallyHidden=xt;exports.addAriaProps=D3;exports.basicReducer=Rl;exports.camelCaseToDashCase=HC;exports.checkIntlPathExists=gh;exports.courseDiscussionRepliesFeedMock=mI;exports.enrichPostCategories=Zv;exports.generateConditions=Dd;exports.generateCssIcon=zD;exports.getAuthorData=Ll;exports.getCharacterLimitProps=G3;exports.getLongDate=Dv;exports.getMember=Eh;exports.getPostBody=Yv;exports.getShortDate=WC;exports.getValueLength=_h;exports.headerData=zc;exports.likesResponseMock=II;exports.mapGetStreamData=Dve;exports.pageReady=KC;exports.passwordValidator=eg;exports.repliesFeedMock=pI;exports.supportedLanguages=_d;exports.toCamelCase=UC;exports.toCapitalisedCase=jD;exports.toSentenceCase=zC;exports.transformSlugs=sg;exports.useAutoResize=FC;exports.useBadges=t3;exports.useCurrentPath=MC;exports.useEffectAfterMount=ml;exports.useElementWidth=lo;exports.useOverlay=u3;exports.useScrollListener=LC;exports.useScrollToHash=Av;exports.useTooltips=kv;exports.useUser=yh;
|
|
571
|
+
`]))),Ege={storeData:{},unseenCount:0,hasNext:!1,initialLoading:!1,fetchMoreLoading:!1};E.createContext({notificationsData:Ege});function _ge(e){var t=e.workspaceKey,n=t===void 0?"":t,r=e.tenantId,i=r===void 0?"":r,a=e.distinctId,o=a===void 0?"":a,s=e.subscriberId,l=s===void 0?"":s,u=e.inboxId,c=u===void 0?"":u,d=e.stores,f=e.toastProps,h=e.notificationClickHandler,m=e.primaryActionClickHandler,p=e.secondaryActionClickHandler,y=e.bellComponent,v=e.badgeComponent,b=e.notificationComponent,_=e.noNotificationsComponent,T=e.loaderComponent,C=e.tabBadgeComponent,x=e.headerRightComponent,w=e.hideAvatar,P=w===void 0?!1:w,O=e.hideInbox,M=e.hideToast,R=e.theme,D=e.themeType,S=D===void 0?"light":D,B=e.pagination,H=B===void 0?!0:B,$=e.pageSize,F=e.popperPosition,ne=F===void 0?"bottom":F,J=e.showUnreadCountOnTabs,I=J===void 0?!0:J,A=e.host;c&&(l=c);var Y=E.useState(!1),L=Y[0],U=Y[1],V=E.useState(),z=V[0],j=V[1],ue=E.useState({storeData:{},count:0}),Q=ue[0],ie=ue[1],le=E.useState(""),te=le[0],Ae=le[1],Oe=E.useState(!1),Te=Oe[0],se=Oe[1];E.useEffect(function(){var ke=new oQ(n,{pageSize:$,tenantID:i,stores:d,host:A});return j(ke),ke.emitter.on("sync_notif_store",function(){var Fe=ke.feed.data;ie({storeData:(Fe==null?void 0:Fe.stores)||{},count:(Fe==null?void 0:Fe.unseenCount)||0,hasNext:Fe==null?void 0:Fe.hasNext,initialLoading:Fe==null?void 0:Fe.initialLoading,activeStoreId:Fe==null?void 0:Fe.activeStoreId}),Ae(Fe==null?void 0:Fe.activeStoreId)}),ke.emitter.on("new_notification",function(Fe){yge({notificationsData:Fe,toastProps:f})}),function(){ke.emitter.all.clear()}},[]),E.useEffect(function(){L&&l&&z&&z.feed.markAllSeen()},[L,l,z]),E.useEffect(function(){if(!(!l||!z))return ie({storeData:{},count:0}),z.identifyUser(o,l),z.feed.fetchNotifications(),function(){z.resetUser()}},[l,z]);var ve=S==="dark"?rD(Jme,R):R||{};return E.createElement(tD.Provider,{value:ve},E.createElement(eD.Provider,{value:{workspaceKey:n,notificationsData:Q,setNotificationsData:ie,notificationClickHandler:h,primaryActionClickHandler:m,secondaryActionClickHandler:p,bellComponent:y,badgeComponent:v,notificationComponent:b,noNotificationsComponent:_,tabBadgeComponent:C,headerRightComponent:x,toggleInbox:U,inbox:z,loaderComponent:T,pagination:H,hideAvatar:P,activeStore:te,setActiveStore:Ae,changingActiveStore:Te,setChangingActiveStore:se,showUnreadCountOnTabs:I,themeType:S}},!O&&E.createElement(lge,{openInbox:L,toggleInbox:U,popperPosition:ne}),!M&&E.createElement(vge,f)))}const Lt={timeouts:{},handlerCalled:{},getIsDesktopVersion:(e,t)=>{const n={navigation:{loggedIn:769,loggedOut:881},search:{loggedIn:961,loggedOut:1121}},r=a=>{const o=`logged${e?"In":"Out"}`;return t>=n[a][o]};let i={};return["navigation","search"].forEach(a=>{i[a]=r(a)}),i},shouldChangeHeaderIsVisible:(e,t,n)=>{Object.values(t).filter(i=>i===!0).length||n([{type:"headerIsVisible",value:e}])},handleMenus:({id:e,value:t,menus:n,dispatch:r,forceHandle:i=!1})=>{if(!i&&n[e]===t||!i&&e===vr.ACCOUNT&&t===!1&&n[vr.SITE]===!0)return;const a=Date.now();if(!i&&!t&&Lt.handlerCalled[e]&&a-Lt.handlerCalled[e]<500)return;Lt.handlerCalled[e]=a;let o=[{type:`menus.${e}`,value:t}];if(t===!0)Object.keys(n).forEach(s=>{s===e||n[s]===!1||o.push({type:`menus.${s}`,value:!1})});else{let s=null;switch(e){case vr.SITE:s=document.querySelector("#header .menu-button"),s||(s=document.querySelector("#navigation .navigation-button"));break;case vr.SEARCH:s=document.querySelector("#header .toggle-search-button");break;case vr.ACCOUNT:s=document.querySelector("#header .account-button");break;default:return}s&&s.focus()}r(o)},findFirstChild:(e,t,n=!1)=>{if(!e||!e[0])return!1;for(let r=0;r<=e.length;r++){if(!e[r])continue;if(e[r][t]&&(!n||e[r][t].includes(n)))return e[r];if(!t.includes("."))continue;const i=OC(e[r],t);if(!(typeof i>"u")&&(!n||i[t]&&i[t].includes(n)||i.value&&i.value.includes(n)||i.toString().includes(n)))return e[r]}return e[0].children?Lt.findFirstChild(e[0].children,t,n):!1},autoFocus:({menu:e,navigationRef:t,isDesktopVersion:n,focusElements:r,dispatch:i})=>{var l;if(!t.current||!t.current.children)return;const a=n?"desktop":"default";if(r[e][a]){(l=document.querySelector(`#header ul a[href="${r[e][a]}"]:last-child`))==null||l.focus();return}let o,s;switch(e){case vr.SITE:if(n){const u=Lt.findFirstChild(t.current.children,"className","has-submenu parent"),c=Lt.findFirstChild(u.children,"id",vr.SITE);o=Lt.findFirstChild(c.children,"href")}else o=Lt.findFirstChild(t.current.children,"href");break;case vr.ACCOUNT:if(s=Lt.findFirstChild(t.current.children,"className","account"),!s||!s.children)return;o=Lt.findFirstChild(s.children,"href");break;default:return}o&&(i([{type:`focusElements.${e}.${a}`,value:o.attributes.href.value}]),o.focus())},events:{onClick:(e,{id:t,callback:n,isOpen:r})=>{e.target&&e.target.attributes&&e.target.attributes.href||(e.preventDefault(),e.stopPropagation(),clearTimeout(Lt.timeouts[t]),n(t,!r))},onFocus:({id:e})=>{clearTimeout(Lt.timeouts[e])},onMouseEnter:({id:e,callback:t})=>{clearTimeout(Lt.timeouts[e]),t(e,!0)},onBlur:({id:e,callback:t})=>{Lt.timeouts[e]=setTimeout(()=>{t(e,!1)},250)}}},zc={order:["home","communities","topics","partners","account"],home:{href:"/home/",hasVariantText:!0,gtmType:"homepage-click"},communities:{href:"/communities/",gtmType:"communities-click",onlyShow:"logged-in"},topics:{order:["explore","topics"],menuId:"site-navigation",explore:{order:["events","courses","articles","communities"],events:{href:"/events/",className:"icon events"},courses:{href:"/microcourses/",gtmType:"microcourses-click",className:"icon courses"},articles:{href:"/solution-articles/",gtmType:"articles-click",className:"icon articles"},communities:{href:"/communities/",gtmType:"communities-click",className:"icon communities"}},topics:{order:["climate","cities-and-local-government","digital-and-data","education","equity-justice-and-inclusion","health-and-social-care","innovation","leadership-and-skills","life-in-government","policymaking","transport-and-infrastructure","work-and-the-economy"],className:"columns",climate:{href:"/topics/climate/"},"cities-and-local-government":{href:"/topics/cities-and-local-government/"},"digital-and-data":{href:"/topics/digital-and-data/"},education:{href:"/topics/education/"},"equity-justice-and-inclusion":{href:"/topics/equity-justice-and-inclusion/"},"health-and-social-care":{href:"/topics/health-and-social-care/"},innovation:{href:"/topics/innovation/"},"leadership-and-skills":{href:"/topics/leadership-and-skills/"},"life-in-government":{href:"/topics/life-in-government/"},policymaking:{href:"/topics/policymaking/"},"transport-and-infrastructure":{href:"/topics/transport-and-infrastructure/"},"work-and-the-economy":{href:"/topics/work-and-the-economy/"}}},partners:{href:"/partnerships/",onlyShow:"logged-out"},account:{menuId:"account-navigation",order:["profile","settings","log-out"],className:"account",onlyShow:"logged-in",doTrack:!1,profile:{href:"/profiles/me"},settings:{href:"/profiles/me/manage-account"},"log-out":{href:"/user-onboarding/logout",className:"divider"}},buttons:{order:["login","signup"],login:{href:"/login",withReturnTo:!0},signup:{href:"/signup?ref=header-banner",props:{variant:"primary"}}}},dh=({id:e,isLoggedIn:t=!1,isDesktopVersion:n=!1,menus:r={},callback:i=()=>{},doTrack:a=null})=>{const o=me.useIntl(),s=OC(zc,e);if(!s||s.onlyShow&&(s.onlyShow==="logged-in"&&!t||s.onlyShow==="logged-out"&&t))return null;const l="doTrack"in s,u=a===null?l?s.doTrack:!0:a,c=e.includes("buttons.");let d=`header_${e.replaceAll(".","_")}`;s.hasVariantText&&(d+=`_logged${t?"In":"Out"}`);let f=!1;if(s.href){let _=s.gtmType||`${e}-click`;if(_.includes(".")){const T=_.split("."),C=T[T.length-2];_=`${C==="topics"?`${C}-`:""}${T[T.length-1]}`}f={href:s.withReturnTo?`${s.href}?returnTo=${window.location.pathname}`:s.href},u&&(f={...f,className:"gtm-trackable","data-gtm-event-type":_,"data-gtm-event-context":"HeaderButtons"}),c&&(f={...f,variant:"secondary",size:{mobile:"small",881:"large"},...s.props||{}})}const h=s.order&&s.order[0]&&s[s.order[0]],m=h&&s[s.order[0]].order,p=f&&window.location.pathname===s.href;let y={},v={},b={};if(p&&(y={...y,"aria-current":"page"}),h){const _=s.menuId||e,T={onClick:C=>Lt.events.onClick(C,{id:_,callback:i,isOpen:r[_]}),onFocus:()=>Lt.events.onFocus({id:_}),onBlur:()=>Lt.events.onBlur({id:_,callback:i}),onMouseLeave:()=>Lt.events.onBlur({id:_,callback:i}),onMouseEnter:()=>Lt.events.onMouseEnter({id:_,callback:i})};v={...T,id:_===vr.SITE?vr.SITE:vr.ACCOUNT},n&&(m&&(b={...T,className:"navigation-button",onKeyPress:C=>{C.key==="Enter"&&Lt.events.onClick(C,{id:_,callback:i,isOpen:r[_]})},"aria-haspopup":!0,"aria-expanded":r[_],"aria-controls":_}),v={...v,hidden:_ in r?!r[_]:!0}),m||(v={...v})}return g.jsxs("li",{className:ee({[s.className]:s.className,"has-submenu":h,parent:m,active:p}),...y,children:[f?E.createElement(c?Ke:"a",f,o.formatMessage({id:d})):n&&s.order&&m?g.jsxs("button",{...b,children:[o.formatMessage({id:d}),g.jsx(xt,{children:o.formatMessage({id:`header_menu_${r[vr.SITE]?"hide":"show"}`})})]}):o.formatMessage({id:d}),s.order&&g.jsx("ul",{...v,children:s.order.map(_=>{if(!s[_])return null;const T={isLoggedIn:t,isDesktopVersion:n,menus:r,callback:i,doTrack:l?u:null};return s[_].order?g.jsxs("li",{className:ee({[s[_].className]:s[_].className}),children:[o.formatMessage({id:`${d}_${_}`}),g.jsx("ul",{children:s[_].order.map(C=>g.jsx(dh,{id:`${e}.${_}.${C}`,...T},C))})]},_):g.jsx(dh,{id:`${e}.${_}`,...T},_)})})]},e)};const Tge=({headerIsVisible:e,locale:t})=>{const n=me.useIntl();return g.jsx("div",{id:"language-unavailable-message",className:ee({visible:e}),children:g.jsx("p",{className:"text",children:n.formatMessage({id:`header_language_unavailable_${t}`},{link:r=>g.jsx("a",{href:"/home",children:r})})})})};const q0={height:67,height_desktop:83,additional_message_height:40};var vr=(e=>(e.NAVIGATION="navigation",e.SEARCH="search",e.ACCOUNT="account-navigation",e.SITE="site-navigation",e))(vr||{});const l5=({showNavigation:e=!0,showLanguageUnavailableMessage:t=!0,showLanguageSwitcher:n=!0,onLanguageSwitcherClick:r,suprSendWorkspaceKey:i,novuApplicationIdentifier:a})=>{var B,H;const o=me.useIntl(),s=E.useContext(fn),l=lo(!0,!0),u=s&&typeof s.id=="string",c=E.useMemo(()=>Lt.getIsDesktopVersion(u,l),[u,l]),d=Op("suprsend-notifications")&&i,f=(H=(B=s==null?void 0:s.externalsMetadata)==null?void 0:B.suprsend)==null?void 0:H.subscriberId,h=Op("novu-notifications")&&a,m=Op("language-switcher")&&n,[p,y]=E.useState(!1);E.useEffect(()=>{t&&m&&(s!=null&&s.id)&&(s==null?void 0:s.locale)!==yl&&y(!0)},[t,m,s]);const[v,b]=E.useReducer(Rl,{headerIsVisible:!0,menus:{"site-navigation":!1,search:!1,"account-navigation":!1},focusElements:{"site-navigation":{desktop:!1,default:!1},"account-navigation":{desktop:!1,default:!1}}}),{headerIsVisible:_,menus:T,focusElements:C}=v,x=E.useRef(v);E.useEffect(()=>{x.current=v},[v]),LC({scrollPosition:p?q0[`height${c.navigation?"_desktop":""}`]+q0.additional_message_height:q0[`height${c.navigation?"_desktop":""}`],callbacks:{scrollUp:()=>{const $=x.current.menus;!c&&$["site-navigation"]||Lt.shouldChangeHeaderIsVisible(!0,$,b)},scrollDown:()=>{const $=x.current.menus;!c&&$["site-navigation"]||Lt.shouldChangeHeaderIsVisible(!1,$,b)}}});const w=($,F,ne=!1)=>{Lt.handleMenus({id:$,value:F,menus:x.current.menus,dispatch:b,forceHandle:ne})},P=E.useRef(null),O=$=>{$.key==="Escape"&&["site-navigation","search","account-navigation"].forEach(F=>{x.current.menus[F]&&w(F,!1,!0)})};E.useEffect(()=>{var $;return($=document.getElementById("header"))==null||$.addEventListener("keydown",O),()=>{var F;(F=document.getElementById("header"))==null||F.removeEventListener("keydown",O)}},[]),ml(()=>{T["site-navigation"]&&Lt.autoFocus({menu:"site-navigation",navigationRef:P,isDesktopVersion:c.navigation,focusElements:C,dispatch:b})},[T["site-navigation"]]),ml(()=>{T["account-navigation"]&&Lt.autoFocus({menu:"account-navigation",navigationRef:P,isDesktopVersion:c.navigation,focusElements:C,dispatch:b})},[T["account-navigation"]]);const M=g.jsxs(g.Fragment,{children:[!c.search&&g.jsx("button",{className:"search toggle-search-button",onClick:$=>{$.preventDefault(),$.stopPropagation(),w("search",!T.search)},children:g.jsx(xt,{children:o.formatMessage({id:`header_search_${T.search?"hide":"show"}`})})}),g.jsx(Nw,{id:"global-search",handleToggle:{searchIsOpen:T.search,isDesktopVersion:c.search},gtmContext:"search-bar-header",gtmEvent:"form-submission"})]}),R=g.jsx("button",{className:"earth icon language-switcher-button","aria-label":"Language switcher",onClick:$=>{$.preventDefault(),$.stopPropagation(),r?r():y(!p)},children:g.jsx(xt,{children:o.formatMessage({id:"header_language_switcher"})})}),D=[d&&f&&g.jsx("div",{id:"suprsend-notifications",children:g.jsx(_ge,{workspaceKey:i,distinctId:(s==null?void 0:s.id)??"",subscriberId:f,theme:{badge:{backgroundColor:"#C34141"},header:{markAllReadText:{color:"#4F43BA"}},notification:{unseenDot:{backgroundColor:"#C34141"},container:{unreadBackgroundColor:"white",readBackgroundColor:"white",hoverBackgroundColor:"#F0F5FF",borderColor:"#D7E0EF"},headerText:{color:"#151921"},bodyText:{color:"#151921"},subtext:{color:"#404A61"},actions:[{container:{backgroundColor:"#4F43BA"}},{container:{borderColor:"#4F43BA",color:"#4F43BA",backgroundColor:"white"}}]}}})}),h&&(s==null?void 0:s.id)&&g.jsx("div",{className:"novu-notifications",children:g.jsx(AZ,{applicationIdentifier:a,subscriberId:s==null?void 0:s.id,routerPush:$=>window.location.href=$,backendUrl:"https://eu.api.novu.co",socketUrl:"https://eu.ws.novu.co",appearance:{variables:{colorBackground:"#FFFFFF",colorForeground:"#151921",colorPrimary:"#4F43BA",fontSize:"24px"},elements:{notificationPrimaryAction__button:{borderRadius:"16px"}}}})})],S=g.jsxs(g.Fragment,{children:[!c.navigation&&g.jsx("button",{className:"menu-button gtm-trackable",onClick:$=>{$.preventDefault(),$.stopPropagation(),w("site-navigation",!T["site-navigation"])},"data-gtm-event-type":"open-tab-menu-click","data-gtm-event-context":"HeaderLeft-Chevron","aria-haspopup":"true","aria-expanded":T["site-navigation"],"aria-controls":"site-navigation",children:g.jsx(xt,{children:o.formatMessage({id:`header_menu_${T["site-navigation"]?"hide":"show"}`})})}),g.jsx("ul",{ref:P,id:"navigation",hidden:c.navigation||T["account-navigation"]?!1:!T["site-navigation"],"data-showing":!c.navigation&&T["account-navigation"]?"account":"default",children:zc.order.map($=>g.jsx(dh,{id:$,isLoggedIn:u,isDesktopVersion:c.navigation,menus:{"site-navigation":T["site-navigation"],"account-navigation":T["account-navigation"]},callback:w},$))})]});return s&&s.isLoading?null:g.jsxs(g.Fragment,{children:[g.jsxs("nav",{id:"header",className:ee({"logged-in":u,"logged-out":!u,visible:_}),children:[g.jsx(xt,{element:"a",href:"#content-of-page",children:o.formatMessage({id:"header_skip"})}),g.jsx(Xv,{variant:"monochrome"}),e?g.jsxs(g.Fragment,{children:[c.navigation?g.jsxs(g.Fragment,{children:[S,M,m&&R,D]}):g.jsxs(g.Fragment,{children:[M,m&&R,D,S]}),u?g.jsxs("button",{className:"account-button",onClick:$=>Lt.events.onClick($,{id:"account-navigation",callback:w,isOpen:T["account-navigation"]}),onMouseEnter:()=>Lt.events.onMouseEnter({id:"account-navigation",callback:w}),onMouseLeave:()=>Lt.events.onBlur({id:"account-navigation",callback:w}),"aria-haspopup":"true","aria-expanded":T["account-navigation"],"aria-controls":"account-navigation",children:[g.jsx(xt,{children:o.formatMessage({id:`header_account_${T["account-navigation"]?"hide":"show"}`})}),g.jsx(ka,{name:s&&s.name||"",src:s&&s.image&&s.image.thumbnail||""})]}):g.jsx("ul",{className:"sign-in-buttons",children:zc.buttons.order.map($=>g.jsx(dh,{id:`buttons.${$}`},$))})]}):m&&R]}),p&&g.jsx(Tge,{headerIsVisible:_,locale:(s==null?void 0:s.locale)||yl}),g.jsx("hr",{id:"content-of-page"}),g.jsx("div",{className:ee("overlay",{open:T["site-navigation"]||T["account-navigation"]||!c.search&&T.search})})]})};const Cge=()=>{const e=me.useIntl();return g.jsxs(g.Fragment,{children:[g.jsx(l5,{}),g.jsx("div",{id:"content",children:g.jsx(Ui,{variant:"error",text:e.formatMessage({id:"pageLayout_error"})})}),g.jsx(Sy,{})]})},sD=({children:e,additionalContent:{prepended:t,appended:n}={},reportError:r,forceShow:i={},styling:a={},className:o="",locale:s="en",suprSendWorkspaceKey:l,novuApplicationIdentifier:u})=>{const c=me.useIntl(),{navigation:d=!0,footer:f=!0}=i,{background:h="default",variant:m="default",circle:p="default",modal:y="default"}=a,v=MC(),[b,_]=E.useState(""),T=O=>{const{detail:{message:M}}=O;_(M)};E.useEffect(()=>(window.scrollTo(0,0),document.addEventListener("ariaLive",T),()=>{document.removeEventListener("ariaLive",T)}),[v]);const C=Ed(e,{locale:s}),x=Ed(t,{locale:s}),w=Ed(n,{locale:s}),P={};return h!=="default"&&(P[h]=!0),m!=="default"&&(P[m]=!0),p!=="default"&&(P[p]=!0),g.jsx(DD.ErrorBoundary,{onError:r,fallback:g.jsx(Cge,{}),children:g.jsxs(E.Suspense,{fallback:null,children:[g.jsxs("div",{id:"wrapper",className:ee(o,P,{"has-footer":f}),"data-too-small":c.formatMessage({id:"pageLayout_browserTooSmall"}),children:[g.jsx(l5,{suprSendWorkspaceKey:l,novuApplicationIdentifier:u,showNavigation:d}),g.jsxs("main",{id:"content-wrapper",children:[x&&g.jsx("div",{className:ee("additional-content prepended",{"large-modal":y==="large"}),children:x}),E.createElement(h==="bold"?Lv:"div",{id:"content",children:C,className:ee({"large-modal":y==="large"})})]}),w&&g.jsx("div",{className:"additional-content appended",children:w}),f&&g.jsx(Sy,{}),g.jsx(Pw,{})]}),b&&g.jsx(xt,{"aria-live":"polite",showOnFocus:!1,"data-testid":"layout-aria-live",children:b})]})})},AC={default:"tags_",headerTopics:"header_topics_topics_"},W0={topic:{Climate:"climate",CitiesAndLocalGovernment:"cities-and-local-government",DigitalAndData:"digital-and-data",Education:"education",EquityJusticeAndInclusion:"equity-justice-and-inclusion",HealthAndSocialCare:"health-and-social-care",Innovation:"innovation",LeadershipAndSkills:"leadership-and-skills",LifeInGovernment:"life-in-government",Policymaking:"policymaking",TransportAndInfrastructure:"transport-and-infrastructure",WorkAndTheEconomy:"work-and-the-economy"},"from the community":"community"},xge={getTagDetails:e=>{if(e.includes("topic_")){if(e=W0.topic[e.replace("topic_","")],e){const t=zc.topics.topics[e].href;return t?{id:e,href:t,text:`${AC.headerTopics}${e}`}:null}return null}return W0[e]?(e=W0[e],{id:e,text:`${AC.default}${e}`}):null}};const wge=({tags:e=[],color:t="default",forceOneLine:n=!1,canHaveLinks:r=!0,className:i="",gtmType:a="tag-click",gtmContext:o="tags"})=>{const s=me.useIntl();if(!e||e.length<1)return null;const l=[];return e.forEach(u=>{if(!u)return;const c=xge.getTagDetails(u);c&&l.push(c)}),l.length<1?null:g.jsx("ul",{className:ee("tags text-small",t,i,{"one-line":n}),children:l.map(u=>{const c=s.formatMessage({id:u.text});return g.jsx("li",{children:u.href&&r?g.jsx("a",{href:u.href,className:"gtm-trackable","data-gtm-event-type":a,"data-gtm-event-context":o,children:c}):c},u.id)})})};const lD=25,Age=({members:{data:e=[],total:t=e.length},communitySlug:n,isMember:r=!1,hasNextPage:i=!1,loadNextPage:a=()=>{},profile:o,gtmContext:s="member",gtmType:l="member-click",showHeader:u=!0,showPlaceholders:c=!1,className:d=""})=>{const f=me.useIntl(),h="membersList",m=E.useContext(fn),[p,y]=E.useState(!1);return e.length===0&&!c?null:g.jsxs("div",{className:ee("members-list",d),children:[u?g.jsxs("h1",{children:[f.formatMessage({id:h}),g.jsx("span",{className:"count",children:t})]}):g.jsx(g.Fragment,{}),g.jsxs("ul",{children:[r?g.jsxs("li",{children:[g.jsx(Ea,{member:m,gtmContext:s,gtmType:l,badges:{showBadges:!0,scopes:[{scope:Fn.Communities,area:n||""},{scope:Fn.Platform,area:"all"}]}}),g.jsx(fo,{href:"/profiles/me",className:"text-small",onClick:v=>{v==null||v.preventDefault(),v==null||v.stopPropagation(),y(!0)},children:f.formatMessage({id:`${h}_profile`})})]}):g.jsx(g.Fragment,{}),e.map((v,b)=>m&&v.id===m.id?g.jsx(g.Fragment,{}):g.jsxs("li",{children:[g.jsx(Ea,{member:v,gtmContext:s,gtmType:l,badges:{showBadges:!0,scopes:[{scope:Fn.Communities,area:n||""},{scope:Fn.Platform,area:"all"}]}}),v.isAdmin&&g.jsx(Fi,{children:f.formatMessage({id:`${h}_admin`})})]},b)),c&&e.length===0&&t>0?[...new Array(Math.min(t,lD))].map((v,b)=>g.jsx("li",{children:g.jsx(bh,{layout:"member"})},b)):g.jsx(g.Fragment,{})]}),i&&g.jsx(Vc,{hasNextPage:i,loadNextPage:a,icon:{icon:"arrow-down",position:"right"},gtmContext:s}),o?g.jsx(xp,{form:o,showModal:p,content:{title:f.formatMessage({id:`${h}_modal_title`})},functions:{onClose:()=>{y(!1)}}}):g.jsx(g.Fragment,{})]})},uD=Age,kge=({intlPath:e,showGuidelines:t,type:n,gtmContext:r})=>{const i=me.useIntl();return t?g.jsx("small",{children:oi(i.formatMessage,`${e}explainer`,n,"action",{a:a=>g.jsx("a",{href:"https://about.apolitical.co/q-and-a-community-guidelines",target:"_blank",className:"gtm-trackable","data-gtm-event-context":r,"data-gtm-event-type":"community-guidelines-link",rel:"noreferrer",children:a})})}):g.jsx(g.Fragment,{})},Sge=({intlPath:e,type:t,...n})=>{const r=me.useIntl();return g.jsx(Af,{label:{visible:r.formatMessage({id:`${e}label`}),screenreader:oi(r.formatMessage,`${e}label_action`,t,"action")},...n})},kC=5,SC=2,Dge=e=>{var r;let t=0;const n=[];return(r=e==null?void 0:e["poll-options"])==null||r.forEach((i,a)=>{i!==""&&(t++,n.push({position:t,description:{en:i}}))}),{title:{en:e.title},options:n,settings:{allow_multiple_votes:e["multiple-answers"]||!1}}};let Rs=null;const nn="discussion_form_",l1=({id:e,parentId:t,content:n={type:at.Response,slugs:{}},userHasPermissions:r=!0,meta:i,placeholder:a,maxLength:o=0,buttons:s,forceShow:l={cancel:!1,error:!1},functions:u,data:c={},gtmContext:d="DiscussionForm"})=>{var re,ge,Ne;const f=me.useIntl(),h=E.useContext(fn),[m,p]=E.useState(n.type),[y,v]=E.useState(""),{isLoading:b=!1,isInWrapper:_=!1,isInOverlay:T=!1,isAutoFocused:C=!1,isEditing:x=!1,hasTitleField:w=!1,canBePrepopulated:P=!1,isPrepopulated:O=!1,showTitle:M=!1,showGuidelines:R=!0,showDivider:D=!1,showSuccessMessage:S=!0,showPostType:B=!1,postCategories:H=[]}=i||{},{onChange:$=()=>{},create:F=()=>{},createPoll:ne=()=>Promise,handleSaveEdit:J=()=>{},handleCancel:I=()=>{},callback:A=()=>{},onMention:Y=()=>{},listMembers:L=()=>Promise.resolve([]),clickMentionFallback:U=()=>{},getLinkPreview:V=()=>Promise.resolve({}),props:z={create:{projectNames:["questions-answers"]}}}=u,[j,ue]=E.useState({body:x&&x.text||O&&O.text||"",data:c!=null&&c.link?{link:c==null?void 0:c.link}:{}}),[Q,ie]=E.useState(l.error||!1),le={status:!1,title:w&&w.text||"",polls:0},[te,Ae]=E.useState(le);E.useEffect(()=>{P&&!x&&O&&O!==j.body&&ue(ye=>({...ye,body:O.text||""}))},[O]),E.useEffect(()=>{p(n.type)},[n.type]);const Oe=mc((ye,X)=>{ue(xe=>({...xe,body:ye,data:{link:X}})),$({body:ye});let he;!h||!h.id?he=oi(f.formatMessage,`${nn}error_loggedOut`,m,"action"):r?o>0&&ye.length>=o&&(he=`${nn}error_tooLong`):he=oi(f.formatMessage,`${nn}error_noPermission`,m,"action"),he?ie(he):Q&&ie(!1)},50);let Te=`${m}-form`;if(m===at.Response||m===at.Reply){const ye=((re=n.slugs)==null?void 0:re.reply)||((ge=n.slugs)==null?void 0:ge.answer)||((Ne=n.slugs)==null?void 0:Ne.question)||"";ye&&(Te=`${Te}-${ye.slice(-15)}`)}e&&(Te=`${e}-${Te}`);const se=async ye=>{if(!h||!h.id||!r||gt)throw new Error("You do not have permission to post.");Rs&&clearTimeout(Rs),Ae(he=>({...he,status:"submitting"}));const X=window.location.pathname;try{let he;switch(m){case at.Post:he=await F({title:ye.title,content:ye.body,categories:ye.postType,data:ye.data});break;case at.Poll:he=await ne(Dge(ye));break;case at.Question:he=await F({title:ye.body,authorId:h&&h.id,data:ye.data,...z==null?void 0:z.create});break;case at.Response:he=await F({questionSlug:n.slugs.question},{body:ye.body,authorId:h&&h.id,contentPath:X,data:ye.data});break;case at.Reply:he=await F({questionSlug:n.slugs.question,answerSlug:n.slugs.answer},{body:ye.body,authorId:h&&h.id,contentPath:X,data:ye.data});break;default:break}return await WD(1e3),A&&await A(he),Rs=setTimeout(()=>{ue({body:"",data:{}}),p(at.Post),Ae(Ue=>({...Ue,status:"submitted"})),v(oi(f.formatMessage,`${nn}success`,m,"action"));const xe=new Event(bn.DISCUSSION_FORM_SUBMITTED);document.dispatchEvent(xe),ve()},850),he}catch(he){const xe=he;let Ue=`${nn}error`;xe!=null&&xe.message.includes("entry already exists")&&(Ue=oi(f.formatMessage,`${nn}error_alreadyExists`,m,"action")),xe!=null&&xe.message.includes("429")?Ue=oi(f.formatMessage,`${nn}error_tooMany`,m,"action"):xe!=null&&xe.message.includes("400")&&(Ue=`${nn}error`),ie(Ue),ve()}},ve=()=>{Rs=setTimeout(()=>{ie(!1),Ae(le),v("")},5e3)},ke=mc(async ye=>{const X={...j,...ye};if(x){Ae(he=>({...he,status:"submitting"})),J(X);return}try{if(!await se(X))throw Error("No response from handleSubmit")}catch{Rs&&clearTimeout(Rs)}},100);if(b)return g.jsx(qr,{className:"discussion-card discussion-form","data-testid":"loading-placeholder"});const Fe=!j.body||!yc(j.body),ht=!te.title||!yc(te.title);let gt=!1;m!==at.Poll&&(gt=Fe),w&&(gt=gt&&ht);const nt=te.status==="submitting",ot=[];m===at.Poll?ot.push({id:"poll-options",label:f.formatMessage({id:`${nn}option_label`}),type:"multiple-inputs",element:"textarea",placeholder:f.formatMessage({id:`${nn}option_placeholder`}),limit:100,multipleInputs:{showCount:!0,defaultInputs:SC,maxInputs:kC,hasButton:{variant:"secondary",size:"small",styling:{muted:!0},icon:"plus",children:f.formatMessage({id:`${nn}option_cta`})}},styling:{autosizeToFit:!0},functions:{onChange:ye=>{var he;let X=0;ye&&Array.isArray(ye)&&(X=((he=ye==null?void 0:ye.filter(xe=>xe!==""))==null?void 0:he.length)||0),te.polls!==X&&Ae(xe=>({...xe,polls:X})),$({polls:ye})}},validation:[{condition:"required"}]},{type:"checkbox",id:"multiple-answers",label:f.formatMessage({id:`${nn}multiplePollAnswers`}),className:"text-medium"}):ot.push({component:Sge,props:{formID:Te,intlPath:nn,showLabel:w!==!1,type:m}},{component:ky,props:{id:`${Te}-input`,value:te.status==="submitting"&&!Q?"":j.body,placeholder:a||oi(f.formatMessage,`${nn}placeholder`,m,"action"),maxLength:o,meta:{isInOverlay:T},functions:{onChange:Oe,onChangeData:ye=>{ue(X=>({...X,data:ye}))},onMention:Y,listMembers:L,clickMentionFallback:U,getLinkPreview:V},data:c,autoFocus:x!==!1||C&&!w,"aria-invalid":!!Q,"aria-errormessage":"error-message"}},{component:kge,props:{intlPath:nn,showGuidelines:R,type:m,gtmContext:d}}),D&&ot.push({component:fi}),w&&ot.unshift({id:"title",type:"textarea",value:w.text,limit:250,label:f.formatMessage({id:`${nn}${m===at.Poll?"question":"titleField"}_label`}),styling:{autosizeToFit:!0},placeholder:f.formatMessage({id:`${nn}${m===at.Poll?"question":"titleField"}_placeholder`}),functions:{onChange:ye=>{Ae(X=>({...X,title:ye})),$({title:ye})}},validation:m===at.Poll?[{condition:"required"}]:[]}),B&&ot.unshift({id:"postType",type:"radio",value:"no-category",accessibilityOptions:{checkboxes:{navigateWithArrowKeys:!0}},styling:{displayOptionsAsPills:!0},label:f.formatMessage({id:`${nn}postType_label`}),options:H.map(ye=>({id:ye.slug,label:ye.name})),validation:[{condition:"required"}],functions:{onChange:ye=>{$({postType:ye}),ye.includes(at.Poll)?p(at.Poll):m!==at.Post&&p(at.Post)}}});let je=!h||!h.id||!r||nt;if(m===at.Poll){const ye=te.polls;je=je||ht||ye<SC||ye>kC}else je=je||gt,x&&(w?je=je||j.body===x.text&&te.title===w.text:je=je||j.body===x.text);return g.jsxs(g.Fragment,{children:[g.jsxs(Zi,{id:Te,className:ee("discussion-card discussion-form",{"no-styling":_&&x}),meta:{shouldReset:!0,shouldHide:!1,showRequiredLabels:!1,shouldShowCancelButton:x&&!nt||l.cancel},functions:{onSuccess:async ye=>{await ke(ye)},onCancel:I},fields:ot,intlPath:nn,button:{variant:"primary",size:{mobile:"small",600:"medium"},"data-gtm-event-context":d,"data-gtm-event-type":`${x?"save":"submit"}-${m}-click`,"data-testid":"save-button",disabled:je,text:{default:!x&&(s!=null&&s.submit)?s==null?void 0:s.submit:f.formatMessage({id:`${nn}${x?"save":"post"}`}),submitting:f.formatMessage({id:`${nn}${x?"saving":"posting"}`})}},secondaryActionButton:{variant:"secondary",size:{mobile:"small",600:"medium"},"data-gtm-event-context":d,"data-gtm-event-type":`cancel-${m}-click`,disabled:!l.cancel&&(!h||!h.id||!j.body),text:s!=null&&s.cancel?s==null?void 0:s.cancel:f.formatMessage({id:`${nn}cancel`})},gtm:{context:d,event:`${m}-form`},"data-testid":`discussion-${m}-form`,children:[M&&!x&&m===at.Question&&g.jsx("h2",{children:oi(f.formatMessage,`${nn}title`,m,"action")}),g.jsx(Ea,{member:h?{...h,link:!1}:"community",gtmContext:d,gtmType:"profile-click",badges:{showBadges:!0,scopes:[{scope:Fn.Communities,area:t||""},{scope:Fn.Platform,area:"all"}]}})]}),te.status==="submitted"&&S&&g.jsx(gl,{className:"success","data-testid":"success",children:oi(f.formatMessage,`${nn}success`,m,"action")}),Q&&g.jsx(gl,{id:"error-message",className:"error","data-testid":"error",children:l.error?l.error:typeof Q=="string"?Q.includes(" ")?Q:f.formatMessage({id:Q},{action:f.formatMessage({id:`discussion_action_${m}`}),maxLength:o}):Q}),y&&g.jsx(xt,{"aria-live":"polite",showOnFocus:!1,children:y})]})},Oge=Object.freeze(Object.defineProperty({__proto__:null,default:l1},Symbol.toStringTag,{value:"Module"}));const Nge={showForm:!1},Cp=E.createContext(Nge),cD=({children:e})=>{const[t,n]=E.useState({showForm:!1});return g.jsx(Cp.Provider,{value:{...t,updateConversation:n},children:e})};function Ige({author:e,originalAuthorId:t,createdAt:n,contentData:r,content:i,gtmContext:a,badges:o}){var d;const s="discussion_",l=me.useIntl(),u=(d=i==null?void 0:i.componentProps)==null?void 0:d.member.additionalContent,c=u?u.customMessage:void 0;return g.jsxs("div",{className:"author-section",children:[g.jsx(Ea,{member:e,additionalContent:{createdAt:n,didEdit:r.didEdit,customMessage:c},className:ee({highlighted:typeof e!="string"&&e.id===t}),styling:{additionalContentNewLine:!!c},gtmContext:a,gtmType:"profile-click",badges:o}),i.pinned&&g.jsx(Fi,{variant:"naked",size:"xlarge",icon:"pin",children:g.jsx(xt,{children:l.formatMessage({id:`${s}pinned_post`})})})]})}const K0=({children:e,class:t,...n})=>{const r={...n,class:ee("subtle",t)};return g.jsx("blockquote",{...r,children:e})};function Pge({content:e}){var t;return!e||!((t=e.categories)!=null&&t.length)?g.jsx(g.Fragment,{}):g.jsx("ul",{className:"categories-list",children:e.categories.map(n=>!n.slug||!n.name?g.jsx(g.Fragment,{}):g.jsx(Fi,{size:"small",element:"li",children:n.name},n.slug))})}var fh=(e=>(e.Always="always",e.AfterVoting="after-voting",e))(fh||{});const Rge=(e,t,n)=>n===void 0?0:e.some(i=>i.hasUserVoted)?t?e.findIndex(i=>!i.hasUserVoted):e.findIndex(i=>i.hasUserVoted):0,Fge=(e,t,n,r=0)=>{if(!e)return{nextElement:null,nextIndex:0};let i=n==="next"?e.nextElementSibling:e.previousElementSibling,a=r+(n==="next"?1:-1);for(;i;){if(!i.classList.contains(t))return{nextElement:i,nextIndex:a};i=n==="next"?i.nextElementSibling:i.previousElementSibling,a=a+(n==="next"?1:-1)}const o=e.parentElement;if(o)for(i=n==="next"?o.firstElementChild:o.lastElementChild,a=n==="next"?0:o.childElementCount-1;i&&i!==e;){if(!i.classList.contains(t))return{nextElement:i,nextIndex:a};i=n==="next"?i.nextElementSibling:i.previousElementSibling,a=a+(n==="next"?1:-1)}return{nextElement:null,nextIndex:0}};const Mge=({user:e,option:t,optionIndex:n,totalPollVotes:r=0,allowMultipleVotes:i=!1,showResults:a=!1,hasVotedOnPoll:o=!1,isTabbable:s=!1,functions:l})=>{var y;const[u,c]=E.useState(t.hasUserVoted);let d=0,f={};const h=(i||!o)&&!t.hasUserVoted;a&&(d=Math.round(t.numVotes/r*100)||0,f={"--vote-perc":`${d}%`});const m=v=>{v.stopPropagation(),h&&(l==null||l.createVote(t),c(!0))},p={htmlFor:t.id,className:ee({"can-vote":h}),tabIndex:s&&h?0:-1,"data-testid":"poll-option-label","data-gtm-event-type":"poll-option-click","data-gtm-event-context":"PollOption","aria-selected":t.hasUserVoted,onClick:m,onKeyDown:v=>{var b;if(v.code!=="Tab")switch(v.code){case"Enter":case"Space":v.preventDefault(),v.stopPropagation(),m(v),c(!0);break;case"ArrowUp":case"ArrowDown":v.stopPropagation(),v.preventDefault();const _=v.code==="ArrowUp"?"prev":"next",{nextElement:T,nextIndex:C}=Fge(v.currentTarget.parentElement,"selected",_,n);T&&((b=T.querySelector("label"))==null||b.focus(),l==null||l.setTabbableOption(C));break}}};return g.jsxs("li",{"data-testid":"poll-option",style:f,className:ee("poll-option text-small",{selected:t.hasUserVoted}),children:[g.jsx("label",{...p,children:g.jsx("span",{children:t.label})}),a&&g.jsxs("div",{className:"vote-details",children:[t.hasUserVoted&&g.jsx(ka,{className:"author-profile-picture",name:e.name,src:(y=e==null?void 0:e.image)==null?void 0:y.thumbnail}),g.jsxs("p",{className:"vote-perc text-medium","data-testid":"vote-perc",children:[d,"%"]})]}),g.jsx("input",{type:i?"radio":"checkbox",id:t.id,name:t.id,checked:u,tabIndex:-1})]})};const dD=({title:e,options:t,settings:n,functions:r})=>{const i="poll_",a=me.useIntl(),o=E.useContext(fn),{showRemoveVote:s=!1,allowMultipleVotes:l=!1,resultsVisibility:u=fh.AfterVoting}=n||{},[c,d]=E.useState(Rge(t,l,o==null?void 0:o.id)),f=t.reduce((v,b)=>v+b.numVotes,0),h=t.filter(v=>v.hasUserVoted).length,m=t.filter(v=>v.hasUserVoted),p=E.useCallback(async v=>{await r.createVote({reactionId:v.id})},[]),y=E.useCallback(async()=>{t.forEach(async v=>{v.hasUserVoted&&v.userVote&&r.removeVote({reactionId:v.userVote.id})})},[t]);return g.jsxs("div",{className:"poll-wrapper",children:[g.jsx("p",{className:"poll-title",children:e}),g.jsxs("aside",{className:"poll-info",children:[g.jsx("p",{className:"poll-instructions","data-testid":"poll-instructions",children:g.jsx("small",{children:a.formatMessage({id:`${i}instructions`},{allowMultipleVotes:l})})}),g.jsx("p",{className:"poll-num-votes",children:g.jsx("small",{"data-testid":"poll-total-votes",children:a.formatMessage({id:`${i}num_votes`},{number:f})})}),s&&g.jsx("p",{className:"poll-remove-vote",children:g.jsx(Ke,{variant:"tertiary",onClick:y,"data-testid":"remove-votes-button",disabled:h===0,children:g.jsx("small",{children:a.formatMessage({id:`${i}remove_vote_button`},{number:h})})})})]}),t&&g.jsx("form",{children:g.jsx("fieldset",{children:g.jsx("ul",{className:"poll-options",children:t==null?void 0:t.map((v,b)=>g.jsx(Mge,{isTabbable:c===b,user:o,option:v,optionIndex:b,totalPollVotes:f,showResults:u==fh.Always||!!h,allowMultipleVotes:l,hasVotedOnPoll:!!h,functions:{createVote:p,setTabbableOption:d}},v.id))})})}),g.jsxs(xt,{"aria-live":"polite",children:[a.formatMessage({id:`${i}aria_votes`},{number:h}),!!h&&g.jsx("ul",{children:m.map(v=>g.jsx("li",{children:v.label}))})]})]})};function Bge({content:e,contentData:t,functions:n}){return g.jsx(dD,{title:t.title,options:(e==null?void 0:e.pollOptions)||[],settings:(e==null?void 0:e.pollSettings)||{},functions:{createVote:n.createVote,removeVote:n.removeVote}})}function Lge({links:e={},contentData:t,postCutOff:n,content:r}){var i;return g.jsxs(g.Fragment,{children:[e.post?g.jsxs("a",{href:e.post,children:[(t==null?void 0:t.title)&&g.jsx("p",{className:"content-title",children:t==null?void 0:t.title}),t.postBody.length>n?g.jsx(e3,{text:t.postBody,markdownOptions:{overrides:{a:ng,blockquote:{component:K0}}}}):g.jsx(Xo,{options:{overrides:{a:ng,blockquote:{component:K0}}},children:t.postBody})]}):g.jsxs(g.Fragment,{children:[(t==null?void 0:t.title)&&g.jsx("p",{className:"content-title",children:t==null?void 0:t.title}),g.jsx(Xo,{options:{wrapper:r.type===at.Question?"h1":E.Fragment,forceWrapper:r.type===at.Question,forceInline:r.type===at.Question,forceBlock:r.type!==at.Question,overrides:{blockquote:{component:K0}}},children:t.postBody})]}),(i=t.data)!=null&&i.link?g.jsx(Qv,{data:t.data.link}):g.jsx(g.Fragment,{})]})}const ti="discussion_",$ge=195;let gd=null;const u1=({element:e="div",content:t,userHasPermissions:n=!0,userHasOwnerPermissions:r=!1,isLoading:i=!1,originalAuthorId:a,forceHide:o,functions:s,links:l={},className:u,gtmContext:c="DiscussionAnswer",children:d,isTruncated:f=!1,setFocus:h=!1,isCommunity:m=!1,badges:p,basePath:y,parentId:v,locale:b="en",disableMentions:_})=>{var je,re,ge,Ne,ye,X;const T=me.useIntl(),C=E.useContext(Cp),x=E.useContext(fn),{createContent:w=async()=>{},deleteContent:P=async()=>{},updateContent:O=async()=>{}}=s.content||{},{createLike:M=()=>{},deleteLike:R=()=>{},listLikes:D=async()=>({})}=s.likes||{},{openComments:S=()=>{}}=s.comments||{},{listMembers:B=()=>Promise.resolve([]),clickMentionFallback:H=()=>{}}=s.form||{},{createVote:$=()=>{},removeVote:F=()=>{},removePoll:ne=()=>{}}=s.polls||{},{author:J,createdAt:I,id:A,likes:Y=0,userLiked:L,comments:U=0,data:V}=t,z=fI(t.title,b),j=x&&x.id&&typeof J!="string"&&J.id&&J.id===x.id||!1,ue=j&&(!t.createdAt||VD(t.createdAt,10,"seconds")),Q=E.useRef(null),[ie,le]=E.useState({title:t.body!==z&&z||"",body:t&&t.body||"",isEditing:!1,didEdit:t&&t.isEdited||!1,postBody:"",data:t&&t.data||{}}),[te,Ae]=E.useState(!1),[Oe,Te]=E.useState(ue?"highlighted":"default"),[se,ve]=E.useState("");E.useEffect(()=>{const he=Q.current;if(!(!he||Oe==="default"))return document.addEventListener(bn.DISCUSSION_FORM_SUBMITTED,ke),he.addEventListener("transitionend",Fe),()=>{document.removeEventListener(bn.DISCUSSION_FORM_SUBMITTED,ke),he.removeEventListener("transitionend",Fe)}},[]),E.useEffect(()=>{le(he=>({...he,title:t&&z||"",body:t&&t.body||"",didEdit:t&&t.isEdited||!1,data:t&&t.data||{}}))},[t.isEdited]),E.useEffect(()=>{(async()=>{const xe=await Yv(ie.body,f,V==null?void 0:V.mentions,B);le(Ue=>({...Ue,postBody:xe}))})()},[ie.body,V==null?void 0:V.mentions]);const ke=()=>{setTimeout(()=>{Te("fading")},1e3)},Fe=({propertyName:he})=>{he==="background-color"&&Te(xe=>(xe==="default"&&(document.removeEventListener(bn.DISCUSSION_FORM_SUBMITTED,ke),Q.current&&Q.current.removeEventListener("transitionend",Fe)),xe==="fading"?"default":xe))};if(i||!t||t.type===at.Answer&&(!t.slugs||!t.slugs.question)||ie.postBody===""&&t.title==="")return g.jsx(qr,{className:"discussion-card"});const ht=async({title:he,body:xe,data:Ue})=>{he||(he=""),xe||(xe=""),ve("");try{if(!cf(he,ie.title)||!cf(xe,ie.body)){const St=t.type===at.Question?{title:xe}:{title:he,body:xe,data:Ue};await O(sg(t.slugs),St)}le(St=>({...St,title:he||"",body:xe||"",data:{...St.data,...Ue},isEditing:!1,didEdit:!0}))}catch{ve(`${ti}form_error`)}},gt=()=>{if(C&&C.updateConversation){const he={showForm:!0},xe=t.author;xe&&xe.id&&!_&&(m&&(he.prepopulateForm=`@{{${xe.id}}}`),he.mentionData={id:xe.id,name:xe.name}),C.updateConversation(he)}setTimeout(()=>{var vt,kt,sn;const xe=`reply-form-${(t.type===at.Answer?t.slug:((vt=t.slugs)==null?void 0:vt.reply)||((kt=t.slugs)==null?void 0:kt.answer)||((sn=t.slugs)==null?void 0:sn.question)||"").toLowerCase().slice(-15)}`,Ue=document.getElementById(xe),St=document.getElementById(`${xe}-input`);St&&St.focus(),Ue&&Ue.scrollIntoView({behavior:"smooth"})},0)},nt=async()=>{Ae(!1);try{t.type===at.Poll?(await ne(),window.location.href=`${y}/${v}`):await P(sg(t.slugs))}catch{ve("delete-error")}},ot=[];return n&&j&&(t.type!==at.Poll&&ot.push({text:T.formatMessage({id:`${ti}moreMenu_edit`}),onClick:()=>le(he=>({...he,isEditing:!0})),icon:"pencil-paper",className:"gtm-trackable","data-gtm-event-context":c,"data-gtm-event-type":`edit-${t.type}-click`}),ot.push({text:T.formatMessage({id:`${ti}moreMenu_delete`}),onClick:he=>{he.preventDefault(),he.stopPropagation(),Ae(!0)},icon:"trash",className:"gtm-trackable","data-gtm-event-context":c,"data-gtm-event-type":`delete-${t.type}-click`,...D3(`delete-${t.slug}-modal`,te)})),r&&s.pins&&ot.push({text:T.formatMessage({id:`${ti}moreMenu_${t.pinned?"unpin":"pin"}`}),onClick:t.pinned?s.pins.deletePin:s.pins.createPin,icon:t.pinned?"unpin":"pin",className:"gtm-trackable","data-gtm-event-context":c,"data-gtm-event-type":`edit-${t.type}-click`}),h&&((je=Q==null?void 0:Q.current)==null||je.focus(),(re=Q==null?void 0:Q.current)==null||re.scrollIntoView({behavior:"smooth"})),E.createElement(e,{className:ee("discussion-post",u,{[Oe]:!u||!u.includes("highlighted-text-box"),"has-link":l.post&&!ie.isEditing,"is-pinned":(t==null?void 0:t.pinned)||!1}),ref:Q,tabIndex:h?0:null,"data-testid":`discussion-${t.type}-thread`,"data-gtm-event-context":`${c}-post-click`,onClick:he=>{if(!l.post||ie.isEditing||t.type===at.Poll&&dI(he,["poll-options","poll-info"],"discussion-post"))return;he.preventDefault(),he.stopPropagation(),gd&&clearTimeout(gd),gd=setTimeout(()=>{window.location.href=l.post},150);const xe=new CustomEvent(bn.DISCUSSION_POST_CLICKED,{detail:{link:l.post,timeout:gd}});document.dispatchEvent(xe)},children:g.jsxs(g.Fragment,{children:[g.jsxs("div",{id:A||t.slug,className:ee("discussion-card text-medium",t.type,{editing:ie.isEditing,"has-link":l.post&&!ie.isEditing}),children:[!ie.isEditing&&g.jsx(Ige,{author:J,originalAuthorId:a,createdAt:I,contentData:{didEdit:ie.didEdit},content:t,gtmContext:c,badges:p}),ie.isEditing?g.jsx(l1,{id:`editing-${t.slug}`,content:{type:t.type,slugs:t.slugs},userHasPermissions:n,meta:{isLoading:i,isInWrapper:!0,hasTitleField:ie.title!==""?{text:ie.title}:!1,isEditing:{text:ie.body,categories:[]},canBePrepopulated:m,isPrepopulated:!1},maxLength:t.type===at.Question?250:5e4,forceShow:{error:se!==""&&se!=="delete-error"?T.formatMessage({id:se},{action:T.formatMessage({id:`${ti}action_${t.type}`})}):!1},functions:{create:w,handleSaveEdit:ht,handleCancel:()=>{ve(""),le(he=>({...he,isEditing:!1}))},listMembers:B,clickMentionFallback:H},gtmContext:`${c}Form`,data:V}):g.jsxs(g.Fragment,{children:[t.type===at.Poll?g.jsx(Bge,{content:t,contentData:ie,functions:{createVote:$,removeVote:F}}):g.jsx(Lge,{links:l,contentData:ie,postCutOff:$ge,content:t}),g.jsx(Pge,{content:t})]}),!ie.isEditing&&!(o!=null&&o.actionBar)&&g.jsx(V3,{className:t.type,gtmContext:c,contentType:t.type,likes:o!=null&&o.likes?!1:{count:Y||0,userLiked:L||!1,canLike:n??!0,peopleWhoLiked:t.peopleWhoLiked,activityId:t.id||t.slug,content:{slugs:t.slugs||{},slug:t.slug},functions:{createLike:M,deleteLike:R,listLikes:D},basePath:y,parentId:v},comments:!(o!=null&&o.comments)&&([at.Question,at.Post].includes(t.type)||l.comments)?{count:U||0,functions:{onClick:()=>{l!=null&&l.comments&&(window.location.href=l.comments),typeof S=="function"&&S()}}}:!1,replies:t.type==="answer"||t.type==="reply"?{canReply:n??!0,functions:{onClick:gt}}:!1,shareLink:!(o!=null&&o.shareLink)&&{url:`${window.location.origin}${(ge=t.slugs)==null?void 0:ge.question}/${(Ne=t.slugs)==null?void 0:Ne.answer}${(ye=t.slugs)!=null&&ye.reply?`#${(X=t.slugs)==null?void 0:X.reply}`:""}`},moreMenu:!(o!=null&&o.moreMenu)&&{options:ot,contentSlug:t.slug,reportData:{contentUrl:`${window.origin}${typeof process<"u"&&process.env.PUBLIC_URL||""}/${t.slugs.question||""}`}}})]}),d,g.jsx(Sa,{id:`delete-${t.slug}-modal`,isOpen:te,functions:{onOpen:()=>{},onClose:()=>Ae(!1)},forceShow:{error:se==="delete-error"?T.formatMessage({id:"${intlPath}delete_error"},{action:T.formatMessage({id:`${ti}action_${t.type}`})}):!1},title:T.formatMessage({id:`${ti}delete_title`},{action:T.formatMessage({id:`${ti}action_${t.type}`})}),buttons:[{variant:"secondary",onClick:()=>Ae(!1),children:T.formatMessage({id:`${ti}delete_cancel`})},{variant:"primary",className:"destructive",onClick:nt,children:T.formatMessage({id:`${ti}delete_delete`})}],gtmContext:`${(t.type||"").charAt(0).toUpperCase()}${(t.type||"").slice(1)}:${t.slug}`,children:g.jsx(me.FormattedMessage,{id:"discussion_delete_text",values:{p:he=>g.jsx("p",{children:he}),action:T.formatMessage({id:`${ti}action_${t.type}`})}})})]})})};const jge=E.lazy(()=>Promise.resolve().then(()=>eve)),Hge=65,fD=({forceShow:e,form:t,className:n})=>{const r=me.useIntl(),i="discussionFormCard_",a="DiscardDraftModal",s=E.useContext(fn)||"community",l=Eh(s);l.name||(l.name=r.formatMessage({id:`member_${typeof s=="string"?s:"community"}`}));const u=lo(!0,!1),c=u?u<768:0,{modal:d=!1}=e||{},[f,h]=E.useState({form:d||YC("showPost")==="true"||!1,warning:!1}),[m,p]=E.useState({showCachedText:!1});E.useEffect(()=>{if(!m.showCachedText)return;(async()=>{const _=await Yv(m.title||m.body||"",Hge,m.mentions);p(T=>({...T,prettifiedText:_}))})()},[m.showCachedText,m.title,m.body]);const y=b=>{if(!m.showCachedText||typeof f.warning=="string")return;let _;if("detail"in b&&b.detail.link)b.detail.timeout&&clearTimeout(b.detail.timeout),_=b.detail.link;else{const T=b;T.preventDefault(),T.stopPropagation();const x=T.target.closest("a");_=x&&x.getAttribute("href")}h(T=>({...T,warning:_||!1}))};E.useEffect(()=>{if(!m.showCachedText){document.removeEventListener(bn.DISCUSSION_POST_CLICKED,y),document.removeEventListener(bn.MEMBER_CLICKED,y),document.removeEventListener("click",y);return}return document.addEventListener(bn.DISCUSSION_POST_CLICKED,y),document.addEventListener(bn.MEMBER_CLICKED,y),document.addEventListener("click",y),()=>{document.removeEventListener(bn.DISCUSSION_POST_CLICKED,y),document.removeEventListener(bn.MEMBER_CLICKED,y),document.removeEventListener("click",y)}},[m.showCachedText]),E.useEffect(()=>{const b=_=>{if(!(!m.showCachedText||f.warning!==!1))return _.preventDefault(),_.returnValue=""};return window.addEventListener("beforeunload",b,{capture:!0}),()=>{window.removeEventListener("beforeunload",b,{capture:!0})}},[m.showCachedText,f.warning]);let v=r.formatMessage({id:`${i}placeholder${c?"":"_long"}`});return m.showCachedText&&(m.title||m.body)&&(v=m.prettifiedText||v),g.jsxs(g.Fragment,{children:[g.jsxs("button",{className:ee("discussion-form-card",n),onClick:b=>{b.preventDefault(),b.stopPropagation(),h(_=>({..._,form:!0}))},"data-testid":"discussion-form-card",children:[g.jsx(ka,{name:l.name,src:l.image,alt:""}),g.jsx(Xo,{className:ee("input",{placeholder:!m.showCachedText}),element:"span",options:{forceInline:!0,overrides:{a:Pr,blockquote:Pr,br:Pr,em:Pr,li:Pr,ol:Pr,p:Pr,s:Pr,span:Pr,strong:Pr,ul:Pr}},children:v})]}),g.jsxs(Ml,{children:[g.jsx(jge,{showModal:f.form,functions:{cacheText:p,onClose:()=>{h(b=>({...b,form:!1}))}},form:t,cachedText:m,className:"in-portal"}),g.jsx(Sa,{id:t.id?`${t.id}-warning`:"discussion-form-card-warning",className:"in-portal",isOpen:f.warning!==!1,functions:{onClose:()=>{h(b=>({...b,warning:!1}))}},title:r.formatMessage({id:`${i}overlay_title`}),buttons:[{variant:"secondary",children:r.formatMessage({id:`${i}overlay_cta_discard`}),onClick:b=>{b.preventDefault(),b.stopPropagation(),typeof f.warning=="string"&&(window.location.href=f.warning)},"data-gtm-event-type":"discard-click","data-gtm-event-context":a},{variant:"primary",children:r.formatMessage({id:`${i}overlay_cta_continue`}),onClick:()=>{h({form:!0,warning:!1})},"data-gtm-event-type":"continue-editing-click","data-gtm-event-context":a}],children:g.jsx("p",{children:r.formatMessage({id:`${i}overlay_text`})})})]})]})},Uge=E.lazy(()=>Promise.resolve().then(()=>Oge)),u5=({isCard:e=!1,form:t,parentId:n,categories:r,membershipRequiredToPost:{isMember:i,required:a,join:o,leave:s,notMemberStateText:l},locale:u=yl})=>{if(a&&!i)return g.jsx(Ui,{text:l,button:{breakpoints:{mobile:!0,901:!1},component:g.jsx(Uv,{isShort:!0,functions:{join:o,leave:s}})}});const{content:c,functions:d,meta:f,...h}=t,m={content:{type:(c==null?void 0:c.type)||"reply",slugs:(c==null?void 0:c.slugs)||{}},functions:{...d,create:(d==null?void 0:d.create)||(()=>{})},parentId:n,meta:{...f,isEditing:(f==null?void 0:f.isEditing)||!1,isPrepopulated:!1,showSuccessMessage:!1,postCategories:[{name:"Post",slug:"no-category"},...r||[]]},...h,id:`add-post-${h.id||""}`};return e?g.jsx(fD,{form:m}):g.jsx(Uge,{...m})},c5=({form:e})=>{const t=E.useContext(fn),n=me.useIntl(),[r,i]=E.useState(!1),a=()=>{eO(t)||i(!0)};E.useEffect(()=>{if(e&&!(e!=null&&e.isDisabled)||(e==null?void 0:e.isDisabled)===void 0)return document.addEventListener(bn.DISCUSSION_POST_ADDED,a),()=>{document.removeEventListener(bn.DISCUSSION_POST_ADDED,a)}});const o={};return["successMessage","title","text"].forEach(s=>{o[s]=n.formatMessage({id:`profileModalLauncher_${s}`})}),g.jsx(xp,{form:e,showModal:r,functions:{onClose:()=>{i(!1)}},content:o})};const G0="discussion_responses_",hD=({type:e="answer",responses:t=0,isLoading:n=!1})=>{const r=me.useIntl();return t=parseInt(t),g.jsxs("div",{className:"responses-heading",children:[g.jsx("h4",{children:r.formatMessage({id:`${G0}title`},{action:r.formatMessage({id:`${G0}${e}`}),count:t})}),!n&&t===0&&g.jsx("p",{children:oi(r.formatMessage,`${G0}empty`,e,e)})]})};const pD=({loadMore:{isLoading:e,hasNextPage:t,loadNextPage:n}={isLoading:!1,hasNextPage:!1,loadNextPage:()=>{}},form:r,children:i})=>{const a=me.useIntl(),o=E.useContext(Cp),s=Ed(i,{element:"li"});if(o.prepopulateForm&&(r!=null&&r.meta)&&(r.meta.isPrepopulated={text:o.prepopulateForm},o.mentionData)){const l=r.data||{};l.mentions||(l.mentions={});const u=o.mentionData.id||"1";l.mentions[u]={created_at:"",updated_at:"",id:u,data:o.mentionData},r.data=l,r.meta.isAutoFocused=!0}return g.jsxs("div",{className:ee("thread-wrapper",{"empty-thread":!s}),children:[!Object.is(s,null)&&g.jsx("ul",{className:"thread",children:s}),!e&&g.jsx(Vc,{hasNextPage:t,loadNextPage:n,size:"small",styling:{muted:!0},icon:{icon:"arrow_corner-down_right",position:"left"},messages:{button:a.formatMessage({id:"discussion_thread_loadMore"}),error:a.formatMessage({id:"loadMore_error"})}}),r&&o.showForm&&g.jsx(l1,{...r})]})};function zge(e){var n,r;let t=!1;return(r=(n=e.latest_reactions)==null?void 0:n["poll-option"])==null||r.forEach(i=>{var a,o;(o=(a=i.own_children)==null?void 0:a["poll-vote"])!=null&&o.length&&(t=!0)}),t}function Vge({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:i,user:a}){const{mutate:o}=Rt.useMutation({mutationFn:e,onMutate:({reactionId:s})=>t(l=>(N3({activity:l,reactionId:s,user:a}),l)),onError:n,onSuccess:(s,{reactionId:l},u)=>{u&&I3({activity:u,reactionId:l,correctReactionId:s.body.id,user:a}),r.setQueryData(i,u)}});return o}function qge({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=Rt.useMutation({mutationFn:e,onMutate:({content:i,title:a})=>t(o=>(o&&(i!=null&&(o.content=i),a!=null&&(o.title=a)),o)),onError:n});return r}function Wge({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:i}){const{mutate:a}=Rt.useMutation({mutationFn:e,onMutate:o=>t(s=>(s&&vf({activity:s}),s)),onError:n,onSuccess:(o,s,l)=>{l&&vf({activity:l,reaction:o}),r.setQueryData(i,l)}});return a}function Kge({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:i}){const{mutate:a}=Rt.useMutation({mutationFn:e,onMutate:o=>t(s=>(s&&yf({activity:s}),s)),onError:n,onSuccess:(o,s,l)=>{l&&yf({activity:l,reaction:o}),r.setQueryData(i,l)}});return a}function Gge({queryFn:e,queryKey:t}){const{data:n,error:r,isLoading:i,isFetching:a}=Rt.useQuery({queryFn:e,queryKey:t});return{activity:n,error:r,isLoading:i,isFetching:a}}function Yge({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:i}=Rt.useMutation({mutationFn:e,onMutate:({reactionId:a})=>t(o=>(P3({activity:o,reactionId:a}),o)),onError:n});return i}function Zge({queryFns:{read:e,edit:t,like:n,unlike:r,pin:i,unpin:a,createVote:o,removeVote:s},queryKey:l}){const u=Rt.useQueryClient(),c=yh(),d={queryClient:u,queryKey:l},f={mutationHandlers:{error:zv(d),mutate:Vv(d)},user:c,...d},h=qge({...f,mutationFn:t}),m=Wge({...f,mutationFn:n}),p=Qge({...f,mutationFn:r}),y=Kge({...f,mutationFn:i}),v=Xge({...f,mutationFn:a}),b=Vge({...f,mutationFn:o}),_=Yge({...f,mutationFn:s}),{activity:T,...C}=Gge({queryKey:l,queryFn:e});return{activity:T,mutations:{edit:h,like:m,unlike:p,pin:y,unpin:v,createVote:b,removeVote:_},user:c,...C}}function Qge({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:i}=Rt.useMutation({mutationFn:e,onMutate:a=>t(o=>(o&&R3({activity:o,user:r}),o)),onError:n});return i}function Xge({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:i}=Rt.useMutation({mutationFn:e,onMutate:a=>(console.log("unpin"),t(o=>(o&&F3({activity:o,user:r}),o))),onError:n});return i}const Jge=({basePath:e,parentId:t,activityId:n,isMember:r,isOwner:i,functions:{activities:{remove:a,...o},likes:s,reactions:l,form:u,join:c,leave:d,polls:f},profile:h,categories:m,locale:p=yl,type:y=Cn.Communities})=>{var U,V,z,j,ue,Q,ie,le,te,Ae,Oe,Te;const v=me.useIntl(),b=E.useContext(fn),_={...o,...f},{activity:T,error:C,isLoading:x,mutations:{edit:w,like:P,unlike:O,pin:M,unpin:R,createVote:D,removeVote:S}}=Zge({queryFns:_,queryKey:[e,t,n]});if(x)return g.jsx(qr,{style:{height:"400px"}});if(C||!T)return g.jsx(Ui,{variant:"error",text:v.formatMessage({id:"activitySection_notFoundError"})});const{own_reactions:B,verb:H,latest_reactions:$,mentioned_users:F,additional_data:ne}=T,J=(((U=$==null?void 0:$.like)==null?void 0:U.length)||0)>0,I=!!((V=B==null?void 0:B.like)!=null&&V.find(se=>{var ve;return((ve=se.user)==null?void 0:ve.id)===(b==null?void 0:b.id)})),A=I?B==null?void 0:B.like[0].id:"",Y=J?(z=$==null?void 0:$.like)==null?void 0:z.map(se=>{var ve,ke,Fe;return{id:(ve=se==null?void 0:se.user)==null?void 0:ve.id,name:(Fe=(ke=se==null?void 0:se.user)==null?void 0:ke.data)==null?void 0:Fe.name}}):!1,L=T==null?void 0:T.actor;return g.jsxs("section",{className:"activity-section",children:[g.jsx(u1,{className:"highlighted-text-box subtle",isCommunity:!0,content:{id:n,type:H,title:T==null?void 0:T.title,body:y===Cn.Courses?zN({content:T.content,locale:p}):T==null?void 0:T.content,categories:Zv((T==null?void 0:T.categories)||[],m||[]),createdAt:(T==null?void 0:T.time)||"",slugs:{question:`${e}/${t}`,answer:T==null?void 0:T.id},slug:n,author:Ll(L),userLiked:I,likes:((j=T==null?void 0:T.reaction_counts)==null?void 0:j.like)||0,comments:(T==null?void 0:T.total_replies)||0,peopleWhoLiked:y===Cn.Courses?!1:Y,data:{mentions:F,...ne||{}},pinned:((ue=T==null?void 0:T.reaction_counts)==null?void 0:ue.pin)&&((Q=T==null?void 0:T.reaction_counts)==null?void 0:Q.pin)>0||!1,pollOptions:O3(T,p),pollSettings:{showRemoveVote:(ie=T==null?void 0:T.settings)==null?void 0:ie.show_remove_vote,allowMultipleVotes:(le=T==null?void 0:T.settings)==null?void 0:le.allow_multiple_votes,deadlineAt:(te=T==null?void 0:T.settings)==null?void 0:te.deadline_at,hideParticipants:(Ae=T==null?void 0:T.settings)==null?void 0:Ae.hide_participants,numberOfWinners:(Oe=T==null?void 0:T.settings)==null?void 0:Oe.number_of_winners,resultsVisibility:(Te=T==null?void 0:T.settings)==null?void 0:Te.results_visibility}},originalAuthorId:L==null?void 0:L.id,forceHide:{comments:!0,shareLink:y===Cn.Courses},functions:{content:{createContent:()=>null,deleteContent:a,updateContent:(se,{title:ve,body:ke})=>w({title:ve,content:ke})},likes:{createLike:()=>P({activityId:n}),deleteLike:()=>O({activityId:n,reactionId:A}),listLikes:se=>s.list({activityId:n,...se})},comments:{openComments:()=>{}},pins:{createPin:()=>M({activityId:n}),deletePin:()=>{var se;return R({activityId:n,reactionId:(se=$==null?void 0:$.pin)==null?void 0:se[0].id})}},polls:{createVote:({reactionId:se})=>D({reactionId:se}),removeVote:({reactionId:se})=>S({reactionId:se}),removePoll:()=>f.removePoll({activityId:n})},form:u},styling:{showShareLinkButton:!0},userHasPermissions:r,userHasOwnerPermissions:i,badges:{showBadges:!0,scopes:[{scope:Fn.Communities,area:t||""},{scope:Fn.Platform,area:"all"}]},basePath:e,parentId:t},n),g.jsx(j3,{basePath:e,parentId:t,activityId:n,showReplies:H===at.Poll?zge(T):!0,activityTotalReplies:(T==null?void 0:T.total_replies)||0,isMember:r,functions:{reactions:l,likes:s,form:u,join:c,leave:d},profile:h,type:y})]})};const mD=({showModal:e=!0,functions:t,form:n,cachedText:r,className:i})=>{const a=me.useIntl(),o="discussionFormModal_",{onClose:s=()=>{},cacheText:l=()=>{}}=t,{data:u,meta:c,functions:d}=n,{title:f="",body:h="",mentions:m}=r||{},p="discussion-form-modal";return g.jsx(Sa,{id:p,title:a.formatMessage({id:`${o}title`}),isOpen:e,functions:{onClose:()=>{(f!==""||h!=="")&&l(y=>({...y,showCachedText:!0})),s()}},className:ee("discussion-form-modal",i),children:g.jsx(l1,{...n,data:{...u,mentions:m||(u==null?void 0:u.mentions)},meta:{...c,isAutoFocused:!0,isInOverlay:`${p}-overlay`,hasTitleField:{text:f},isPrepopulated:{text:h||(c==null?void 0:c.isPrepopulated)!==!1&&(c==null?void 0:c.isPrepopulated.text)||""},showGuidelines:!1,showDivider:!0,showPostType:!0},buttons:{submit:a.formatMessage({id:`${o}cta`})},functions:{...d,onChange:y=>{l(v=>({...v,...y}))},onMention:({id:y,name:v}={})=>{if(!y||!v)return;const b=m||{};b[y]={created_at:"",updated_at:"",id:y,data:{name:v}},l(_=>({..._,mentions:b}))},create:async y=>{s(),d.create&&await d.create(y),l({showCachedText:!1})},createPoll:async y=>{const v=()=>{s(),l({showCachedText:!1})};if(d.createPoll)try{const b=await d.createPoll(y);return new Promise(_=>(v(),_(b)))}catch{return new Promise((_,T)=>T())}else return v(),new Promise(b=>b({}))},handleSaveEdit:async y=>{s(),d.handleSaveEdit&&await d.handleSaveEdit(y),l({showCachedText:!1})}}})})},eve=Object.freeze(Object.defineProperty({__proto__:null,default:mD},Symbol.toStringTag,{value:"Module"}));const tve=({className:e,showModal:t=!0,title:n,messagePlaceholder:r,formTitle:i,formLabel:a,ctaMessage:o,showIcon:s,onClose:l,reportError:u=()=>{},sendInvites:c})=>{const d=me.useIntl();return i||(i=d.formatMessage({id:"inviteModal_formTitle"})),a||(a=d.formatMessage({id:"inviteModal_formLabel"})),o||(o=d.formatMessage({id:"inviteModal_cta"})),g.jsx(Sa,{id:"invite-user-modal",title:n,isOpen:t,showDivider:!1,showIcon:s,functions:{onClose:l},className:ee("invite-modal",e,{success:!!n}),children:g.jsx(Sw,{title:i,label:a,messagePlaceholder:r,ctaMessage:o,onClose:l,sendInvites:c,reportError:u})})};const nve=({showModal:e=!0,content:{successMessage:t,title:n,text:r}={},functions:i,form:a,className:o})=>{const s=me.useIntl(),[l,u]=E.useState(YC("showProfile")==="true"||e);E.useEffect(()=>{u(e)},[e]);const{onClose:c=()=>{}}=i;return g.jsx(Sa,{id:"profile-form-modal",title:t||n||s.formatMessage({id:"profileModal_title"}),isOpen:l,showDivider:!t,functions:{onClose:c},className:ee("profile-modal",o,{success:!!t}),maxWidth:700,children:g.jsxs(g.Fragment,{children:[t&&n||r?g.jsxs("div",{className:"intro",children:[t&&n?g.jsx("h3",{children:n}):"",r?g.jsx("p",{children:r}):""]}):null,g.jsx(Dw,{...a,meta:{shouldShowCancelButton:!1},functions:{...(a==null?void 0:a.functions)||{},onSuccess:async d=>{var f;try{(f=a==null?void 0:a.functions)!=null&&f.onSuccess&&await a.functions.onSuccess(d)}finally{c()}}}})]})})},xp=nve,rve=Object.freeze(Object.defineProperty({__proto__:null,default:xp},Symbol.toStringTag,{value:"Module"}));const ive=({members:e})=>{const[t,n]=E.useState(!1),r=i=>{const{fullName:a,jobTitle:o,organisation:s,photo:l}=i||{};return g.jsxs(g.Fragment,{children:[g.jsx(ka,{name:a,src:l}),g.jsx("p",{children:a}),g.jsx("small",{className:"text-medium",children:s?`${o}, ${s}`:o})]})};return g.jsxs("div",{className:"directory-wrapper",children:[g.jsx("ul",{className:"directory",children:e.map(i=>g.jsx("li",{children:g.jsx("button",{onClick:a=>{a.preventDefault(),a.stopPropagation(),n(i)},children:r(i)})},i.fullName))}),g.jsx(Sa,{isOpen:t!==!1,children:t===!1?"":g.jsxs(g.Fragment,{children:[r(t),g.jsx(Xo,{children:t.text})]}),buttons:[{size:"small",variant:"tertiary",onClick:()=>n(!1),children:"Close"}],functions:{onClose:()=>n(!1)}})]})};const ave=({email:e,settings:t={}})=>{const{formatMessage:n}=me.useIntl(),r=E.useContext(fn),{myProfile:i,isConnected:a,cannotConnect:o}=t,[s,l]=E.useState(!1),[u,c]=E.useState(!1);return r?e&&i?g.jsx(Ke,{icon:{icon:"info-inside-circle",position:"right"},size:"small",variant:"secondary",styling:{muted:!0},tooltip:n({id:"member_show_email_tooltip_mine"}),forceTooltip:!0,className:"show-email fake-button",children:e}):o?g.jsx(Ke,{icon:"email",size:"small",variant:"secondary",styling:{muted:!0},tooltip:n({id:"member_show_email_tooltip_private"}),forceTooltip:!0,className:"show-email fake-button",children:n({id:"member_show_email_private"})}):a?e&&a?g.jsx(g.Fragment,{children:s?g.jsx(Ke,{icon:{icon:"copy",position:"right"},size:"small",variant:"secondary",styling:{muted:!0},className:"show-email copy-button",tooltip:n({id:`member_show_email_tooltip${u?"_copied":""}`}),forceTooltip:!0,"data-gtm-event-context":"connections-email-address-button","data-gtm-event-type":"copy-email-click",onClick:()=>{navigator.clipboard.writeText(e).then(()=>{c(!0),setTimeout(()=>{c(!1)},2e3)})},children:e}):g.jsx(Ke,{icon:"email",size:"small","data-gtm-event-context":"connections-email-address-button","data-gtm-event-type":"show-email-click",onClick:()=>l(!0),children:n({id:"member_show_email_show"})})}):g.jsx(g.Fragment,{}):g.jsx(Ke,{icon:"email",size:"small",variant:"secondary",styling:{muted:!0},className:"show-email fake-button",children:n({id:"member_show_email_hide"})}):g.jsx(g.Fragment,{})};const ove=({author:e,authorCite:t,content:n,member:r,className:i=""})=>g.jsxs("blockquote",{className:ee("testimonial-block",i),children:[g.jsx(Ri,{className:"testimonial",children:n}),r?g.jsx(Ea,{member:r,styling:{size:"large"}}):g.jsxs(g.Fragment,{children:[e&&g.jsx("p",{className:ee("author",{"text-small":!i.includes("new")}),children:e}),t&&g.jsx("p",{className:ee("author-cite",{"text-small":!i.includes("new")}),children:g.jsx("cite",{children:t})})]})]}),sve=E.memo(ove);const lve=({items:e=[],selector:t="",className:n=""})=>{const r=me.useIntl(),[i,a]=E.useState(e);return E.useEffect(()=>{if(e.length)return;let o="";Array(6).fill(0).forEach((u,c)=>{o+=`${c>0?", ":""}${t} h${c+1}`});const l=Array.from(document.querySelectorAll(o)).filter(u=>u.id).map(u=>({id:u.id,text:u.textContent||""}));a(l)},[]),i&&i.length>0&&g.jsxs(Er,{variant:"subtle",className:ee("table-of-contents",n),children:[g.jsx("h2",{children:r.formatMessage({id:"tableOfContents"})}),g.jsx("nav",{children:g.jsx("ul",{children:i.map(({id:o,text:s})=>g.jsx("li",{children:g.jsx("a",{href:`#${o}`,children:s})},o))})})]})};const wp=({time:e,rangeTime:t,prependedText:n,appendedText:r,className:i=""})=>{const a=me.useIntl(),o="timeToComplete_";if(!e||typeof e!="number")return null;const s=c=>{const d=c/60,f=Math.floor(d),h=(d-f)*60,m=Math.round(h),p=`${a.formatMessage({id:`${o}hours`},{time:f})}${f>0&&m>0?", ":""}${a.formatMessage({id:`${o}minutes`},{time:m})}`;return{text:`${f>0?`${a.formatMessage({id:`${o}hours_short`},{time:f})} `:""}${m>0?a.formatMessage({id:`${o}minutes_short`},{time:m}):""}`,ariaText:p}};let{text:l,ariaText:u}=s(e);if(t){const{text:c,ariaText:d}=s(e+t);l=a.formatMessage({id:`${o}range`},{early:l,late:c}),u=a.formatMessage({id:`${o}range_aria`},{early:u,late:d})}return n&&(u=`${n} ${u}`,l=`${n} ${l}`),r&&(u=`${u} ${r}`,l=`${l} ${r}`),g.jsx("span",{className:ee("time-to-complete",i),"aria-label":u,children:l})};const uve=({className:e="",image:t,...n})=>t?(typeof t=="string"&&(t={width:1080,height:200,type:"image/png",url:t}),t.range=[{height:124,width:425},{height:200,width:768},{height:200,width:1368}],t.query="fit=thumb&f=center",g.jsx(co,{...n,className:ee("banner",e),image:{...t,aspect:"banner"}})):null;const cve=["small","span","strong","em","p","h1","h2","h3","h4","h5","h6","blockquote","q"],dve=({className:e="",content:t,image:n,variant:r,spacing:i="normal",styling:a,hideElements:o={eyebrow:!1,title:!1,text:!1},cta:s,children:l})=>{var m,p;const u={imageFullWidth:!0,...a};r||(r=u.imageFullWidth?"default":"light");const c=["eyebrow","title","text"],d={eyebrow:"small",title:"h1",text:"p"},f={};c.forEach(y=>{if(!t[y]){f[y]=!1;return}if(!o[y]){if(typeof t[y]=="object"){f[y]=t[y];const{text:v,element:b}=t[y];if(b&&cve.includes(b.toLowerCase()))return;f[y]={text:v,element:d[y]};return}f[y]={text:t[y],element:d[y]}}});const h=s&&s.text&&s.link;return h&&s.link[0]==="#"&&(s.props||(s.props={}),s.props.onClick=y=>{y.preventDefault(),y.stopPropagation();const v=document.getElementById(s.link.substring(1));v&&v.scrollIntoView({behavior:"smooth"})}),g.jsx(mo,{className:ee("banner-section",r,i,e,{"has-image":n,"image-full-width":n&&u.imageFullWidth,"image-inline":n&&!u.imageFullWidth,"has-cta":h,"has-extra-spacing":r!=="subtle"&&i==="normal"&&f.eyebrow&&f.title}),children:g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"content-wrapper",children:[c.map(y=>{if(f[y]&&typeof f[y]=="object"){const{text:v,element:b=""}=f[y];return y==="text"?g.jsx(Xo,{overrideType:"text-only",className:"text",children:v},y):E.createElement(b,{key:y,className:y},v)}return null}),l,h&&g.jsx(Ke,{variant:n||["light","subtle"].includes(r)?"primary":"secondary",size:{mobile:"medium",768:"large"},href:s.link,...s.props,className:ee({new:r==="subtle",[(m=s.props)==null?void 0:m.className]:(p=s.props)==null?void 0:p.className}),children:s.text})]}),n&&g.jsx(co,{image:{...n,aspect:u.imageFullWidth?"banner":n.aspect||void 0}})]})})},fve=E.memo(dve);const hve=({image:e,variant:t="default",children:n,className:r=""})=>{const i={};return e&&(i["--image"]=`url(${e})`),g.jsx(mo,{className:ee("custom-content-banner",t,r,{"has-image":e}),style:i,children:g.jsx("div",{className:"content-slim",children:n})})};const pve=({alignImage:e="left",className:t,content:n,image:r})=>{const i=typeof n=="string"?g.jsx(Xo,{children:n}):n;return g.jsxs(mo,{className:ee("highlight-section",t),children:[r&&g.jsx("div",{className:ee("highlight-container highlight-image",{[`highlight-image-${e}`]:e==="right"}),children:g.jsx(co,{image:{...r,description:"",query:"q=85",aspect:"highlightSection"}})}),g.jsx("div",{className:ee("highlight-container highlight-content-wrapper",{"no-image":!r}),children:g.jsx("div",{className:ee("highlight-content",{"highlight-content-right":e==="left"}),children:r?i:g.jsx("div",{className:"content-default",children:i})})})]})},mve=E.memo(pve);const gve=({variant:e="primary",button:t=null,title:n,text:r,gtmContext:i})=>!n&&!r?null:g.jsxs("aside",{className:ee("marketing-block",e),children:[n&&g.jsx("p",{className:"title",children:n}),r&&g.jsx("p",{children:r}),t&&g.jsx(Ke,{variant:t.variant||"secondary",size:"medium",href:t.link,className:"gtm-trackable","data-gtm-event-context":i,"data-gtm-event-type":"learn-more-click",children:t.text})]}),vve=({type:e,data:t})=>{const n=me.useIntl(),{answers:r,createdAt:i,dateHasPassed:a,isOngoingEvent:o,pill:s,readingTime:l,publishedDate:u,startDate:c}=t;if(e==="question"){const d=i&&J0(i);return g.jsxs("p",{className:"details answers","data-testid":"question-answers",children:[n.formatMessage({id:"card_answers"},{number:r}),i&&g.jsxs("span",{"data-testid":"question-created-at",children:[" ","·"," ",n.formatMessage({id:"card_time_ago"},{time:d?n.formatMessage({id:`dates_${d.path}`},{number:d.number}):0})]})]})}if(c&&!a||o)return g.jsx("p",{className:"details",children:o?n.formatMessage({id:"card_bootcamp"}):Dv(c)});if(s)return g.jsx(Fi,{variant:s==="free"?"subtle":"highlighted",className:s,"data-testid":"course-type",children:s});if(l||u){const d=u&&J0(u);return g.jsxs("ul",{className:"details",children:[l&&g.jsx("li",{"data-testid":"reading-time",children:n.formatMessage({id:"card_time_read"},{time:l})}),u&&g.jsx("li",{"data-testid":"published-date",children:n.formatMessage({id:"card_time_ago"},{time:d?n.formatMessage({id:`dates_${d.path}`},{number:d.number}):0})})]})}return null},yve={title:66,text:3e3,secondaryText:1e3,partner:34},hh={communityPage:{basePath:"/communities/",className:"communityPage",gtmEvent:"community"},customCard:{className:"custom",gtmEvent:"custom",length:{text:335,secondaryText:150}},event:{basePath:"/events/",className:"event",gtmEvent:"event"},microcourse:{basePath:"/microcourses/en/",className:"course",gtmEvent:"microcourse-overview"},solutionArticle:{basePath:"/solution-articles/en/",className:"article",length:{title:60},gtmEvent:"article"},qaQuestion:{basePath:"/questions-answers/",className:"question",length:{title:190},gtmEvent:"q-and-a-question"},listPage:{basePath:"/list/en/",className:"list",gtmEvent:"list"},people:{basePath:"/profiles/",className:"people",length:{people:1e3},gtmEvent:"person"},learningHub:{basePath:"/learning-hub/",className:"learning-hub",length:{title:190},gtmEvent:"learning-hub"}},bve=({data:e,cta:t,link:n,gtmContext:r})=>{var p,y;const i=me.useIntl(),[a,o]=E.useState({loading:!1,registered:e.registered||!1});E.useEffect(()=>{e.registered&&o(v=>({...v,registered:!0}))},[e.registered]);const{customLinkText:s,startDate:l,dateHasPassed:u,pill:c,slug:d}=e,f=e.contentType;let h="";if((p=hh[f])!=null&&p.gtmEvent&&(h=hh[f].gtmEvent),l&&u)return n?g.jsx("a",{href:n,className:"details additional-link gtm-trackable","data-gtm-event-context":`${r}-CarouselCard`,"data-gtm-event-type":`${h}-click`,children:s||i.formatMessage({id:"card_watch"})}):null;if(f==="people")return n?g.jsx(Ke,{variant:"tertiary",size:"small",href:n,className:"gtm-trackable","data-gtm-event-context":`${r}-Card-Button`,"data-gtm-event-type":`${h}-click`,children:s||i.formatMessage({id:"card_cta_people"})}):null;const m=["communityPage","microcourse","event"];if(t&&t.onClick&&m.includes(f)&&c!=="premium"){const v=a.loading||a.registered||((y=e==null?void 0:e.members)==null?void 0:y.isMember),b=async _=>{var T;if(_.preventDefault(),_.stopPropagation(),window&&((T=window.dataLayer)==null||T.push({event:"gtm.click","gtm.element":n,"gtm.elementClasses":"gtm-trackable","gtm.elementUrl":n,EventType:`${r}-${f}-register-click`,EventContext:`${r}Page-${f}: ${d}`})),!(v||!t||!t.onClick)){o(C=>({...C,loading:!0}));try{const C=await t.onClick(e);o(C==="success"?()=>({registered:!0,loading:!1}):x=>({...x,loading:!1}))}catch{o(x=>({...x,loading:!1}))}}};return g.jsx("p",{className:ee("cta-wrapper",{"has-member-section":e==null?void 0:e.members}),children:g.jsx(Ke,{onClick:b,className:"gtm-trackable",size:"small",styling:{fullWidth:!0},disabled:v,"data-gtm-event-context":`${r}Page-${f}: ${d}`,"data-gtm-event-type":`${r}-${f}-register-click`,"data-testid":"in-card-button",children:s||i.formatMessage({id:`card_cta_${f}${v?`_${a.loading?"loading":"done"}`:""}`})})})}return null};function Eve({buildMemberData:e,communitySlug:t}){const n=me.useIntl(),r=E.useContext(fn),[i,a]=E.useState({count:"...",isMember:!1,memberType:""});return E.useEffect(()=>{e(t,typeof(r==null?void 0:r.id)<"u").then(o=>{if(!o)return;const{membersCount:s,role:l="",pagination:u}=o;let c=0;s?c=s:u!=null&&u.total&&(c=u==null?void 0:u.total),a({count:c.toString(),isMember:!!l,memberType:l})})},[t,e]),g.jsxs("span",{className:"member-information",children:[i.isMember&&g.jsx(Fi,{size:"small",variant:"registered",icon:(i==null?void 0:i.memberType)==="owner"?"user":"tick",children:n.formatMessage({id:`card_member_type_${i.memberType}`})}),g.jsx("span",{className:"label member-count",children:n.formatMessage({id:"card_member_count"},{count:i.count})})]})}const d5=({id:e="",className:t="",buildCardData:n,buildMemberData:r,card:i,cta:a,gtmContext:o="Carousel",handleCardClick:s,meta:l})=>{var S,B;const u=me.useIntl(),c=E.useContext(fn),d=!!(c!=null&&c.id),{isTabbable:f=!0,setFocus:h=!1}=l||{},m=E.useRef(null),[p,y]=E.useState({data:null,isLoading:!0});E.useEffect(()=>{n(i,d).then(H=>{y({data:H,isLoading:!1})}).catch(()=>y(H=>({...H,isLoading:!1})))},[i,d,n]);const{data:v,isLoading:b}=p;if(b||!v)return g.jsx(qr,{element:"li",className:"card-wrapper","data-testid":"card-placeholder"});s&&!a&&(a={text:u.formatMessage({id:`card_cta_${i.contentType}`}),onClick:s});const{contentType:_}=v;if(!_||!hh[_])return g.jsx(qr,{element:"li",className:"card-wrapper"});const{basePath:T="",className:C,length:x,gtmEvent:w}=hh[_];let P=f&&v.slug?`${T}${v.slug}`:!1;f&&v.slug&&(v.slug.slice(0,4)==="http"||v.slug.slice(0,2)==="//"||v.slug.slice(0,6)==="mailto"||v.slug.slice(0,3)==="tel")&&(P=v.slug);const O=H=>{if(P){H.preventDefault(),H.stopPropagation();const $=H.currentTarget.getAttribute("data-url");window&&window.dataLayer.push({event:"gtm.click","gtm.element":$,"gtm.elementClasses":"gtm-trackable","gtm.elementUrl":$,EventType:`${o}-CarouselCard`,EventContext:`${w}-click`}),window.location.href=$}},M={...yve,...x};let R={className:"card"},D={};return P&&(D={href:P,className:"gtm-trackable","data-gtm-event-context":`${o}-CarouselCard`,"data-gtm-event-type":`${w}-click`,"data-testid":"link"},v.openInNewTab&&(D.target="_blank"),R={onClick:O,className:"card gtm-trackable","data-gtm-event-context":`${o}-CarouselCard`,"data-gtm-event-type":`${w}-click`}),h&&(R={...R,tabIndex:"0"},(S=m==null?void 0:m.current)==null||S.focus(),(B=m==null?void 0:m.current)==null||B.scrollIntoView({behavior:"smooth"})),g.jsx("li",{className:ee("card-wrapper text-medium",C,t,{"has-link":P,"no-link":!P,"has-image":v.banner}),"data-testid":`${_}-card`,children:g.jsxs("div",{...R,ref:m,"data-url":P,children:[g.jsx(QC,{className:"card-label",contentType:_,customIcon:v.isPrivate?"lock-locked":v.customIcon,customLabel:v.customLabel}),_==="communityPage"&&(v==null?void 0:v.createdAt)&&qD(v==null?void 0:v.createdAt,60)&&g.jsx(Fi,{size:"small",variant:"information","data-testid":"new-community",children:u.formatMessage({id:"card_new"})}),v.startDate&&!v.isOngoingEvent&&g.jsx(Fi,{size:"small",variant:v.dateHasPassed?"default":"information","data-testid":"date",children:v.dateHasPassed?u.formatMessage({id:"card_ended"}):WC(v.startDate)}),v.banner?g.jsxs("p",{className:"img",children:[v.registered&&g.jsx(Fi,{size:"small",variant:"registered",children:u.formatMessage({id:"card_registered"})}),g.jsx(co,{image:{...v.banner,description:""}})]}):C==="people"?g.jsx(ka,{name:v.title||"",src:v.profile,"data-testid":"people-profile-picture"}):null,v.contributors&&g.jsx(Bv,{contributors:{data:v.contributors},styling:{size:"small",showGap:C!=="question",showText:!0},multipleText:["event","solutionArticle"].includes(_)?u.formatMessage({id:`card_contributors_${_}`}):void 0,"data-testid":"contributors"}),v.partner&&g.jsx("p",{className:"partners","data-testid":"partners",children:v.partner.length>1?u.formatMessage({id:"card_partner"},{partner:v.partner[0],number:v.partner.length-1}):pl(v.partner[0],M.partner)}),["title","text","secondaryText"].map(H=>{const $=v[H];if(!$)return null;const F=HC(H),ne={key:H,className:F,"data-testid":F},J={wrapper:"p",forceWrapper:!0,forceInline:!0},I=pl($,M[H]);return["title","text"].includes(H)&&P?(J.wrapper="a",g.jsx("p",{...ne,children:g.jsx(Ri,{options:J,...D,children:I})})):g.jsx(Ri,{options:J,...ne,children:I})}),i.contentType==="communityPage"&&(i.slug||v.slug)&&r&&g.jsx(Eve,{communitySlug:i.slug||v.slug,buildMemberData:r}),g.jsx(vve,{type:C||"",data:v}),g.jsx(bve,{data:v,cta:a,link:P||"",gtmContext:o})]})})};const gD=({cards:e,cardTypes:t,className:n="",...r})=>g.jsx("ul",{className:ee("card-block",n),children:e.map((i,a)=>{const o=i.slug?`${i.slug}-${t[a]}`:`${t[a]}-${a}`;return g.jsx(d5,{id:o,card:{...i,contentType:t[a]},meta:{setFocus:a===(r==null?void 0:r.focusCardIndex)},...r},o)})}),_ve=(e,t,n,r)=>{const i=t*n<=e,a=e<t*(n+1),o=r.includes(Math.floor(e/t));return{inView:i&&a,isLoaded:o}},Tve=({id:e,title:t})=>{const n=me.useIntl();if(!t||!t.text)return null;const{text:r,element:i="h2",variant:a="default",size:o="medium",link:s}=t;return E.createElement(i,{className:ee("title",a,o,{"highlighted-title":a==="highlighted"}),children:g.jsxs(g.Fragment,{children:[r,s&&g.jsx("a",{href:s,className:"text-medium gtm-trackable","data-gtm-event-context":"CarouselViewAll","data-gtm-event-type":`${e||window.btoa(r)}-view-all-click`,children:n.formatMessage({id:"card_carousel_viewAll"})})]})})};const Y0={fourCards:1024,threeCards:769,twoCards:480};let vd=null,Z0=null;const Cve=({id:e,cards:t,cardTypes:n,buildCardData:r,title:i,className:a,gtmContext:o,...s})=>{const l=me.useIntl(),u="carousel_pagination_",[c,d]=E.useState({cardsPerPage:4,isLoading:!0}),{cardsPerPage:f,isLoading:h}=c,[m,p]=E.useState({currentPage:0,loadedPages:[0]}),{currentPage:y,loadedPages:v}=m,[b,_]=E.useState(""),T=t.length,C=Math.ceil(T/f),x=E.useRef(null),w=lo(!0,!0,x==null?void 0:x.current);E.useEffect(()=>{let S=1;w&&(w>=Y0.fourCards?S=4:w>=Y0.threeCards?S=3:w>=Y0.twoCards&&(S=2),S>T&&(S=T)),d(B=>({...B,cardsPerPage:S,isLoading:!1}))},[w,T]);const P=(S="next")=>{Z0&&clearTimeout(Z0);let B=y;if(typeof S=="string")if(S==="next")if(y<C-1)B=y+1;else return;else if(y>0)B=y-1;else return;else B=S;_(""),p($=>({...$,currentPage:B,loadedPages:[...new Set([...v,B])]}));const H=()=>{const $=B*c.cardsPerPage,F=$+c.cardsPerPage;return t.slice($,F).length};Z0=setTimeout(()=>{_(l.formatMessage({id:`${u}ariaLive${typeof S=="string"?"":"_slide"}`},{direction:l.formatMessage({id:`${u}${typeof S=="string"?S:"next"}`}),slide:typeof S=="string"?1:S+1,count:H()}))},500)},O=S=>{vd=S.touches[0].clientX},M=S=>{if(vd===null)return;const B=S.touches[0].clientX,H=vd-B;H>5?P("next"):H<-5&&P("previous"),vd=null},R={"--width":`${w||0}px`,"--total-cards":T,"--cards-per-page":f,"--page":y};if(h)return g.jsx(bh,{layout:`carousel${i?"-with-title":""}`});const D=(S,B)=>{var $;let H=null;return($=S==null?void 0:S.sys)!=null&&$.id?H=`card-${S.sys.id}`:S!=null&&S.slug?H=`card-${S.slug}`:[n[B],S.contentType].includes("customCard")&&(H=`card-${window.btoa(`${S.title} ${S.createdAt}`)}-${B}`),H};return g.jsxs("section",{ref:x,className:ee("carousel-wrapper",a),"data-testid":"carousel",children:[g.jsx(Tve,{id:e,title:i}),g.jsx("ul",{className:"carousel",onTouchStart:O,onTouchMove:M,style:R,"data-testid":"carousel-list",children:t.map((S,B)=>{let H=D(S,B);const{inView:$,isLoaded:F}=_ve(B,f,y,v);return H&&($||F)?g.jsx(d5,{id:H,card:{...S,contentType:n[B]},buildCardData:r,gtmContext:o,meta:{isTabbable:$},...s},H):(H=H||`${e}-card-${B}`,g.jsx(qr,{element:"li",className:"card-wrapper","data-testid":"card-placeholder"},H))})}),C<=1?null:g.jsxs(g.Fragment,{children:[g.jsxs("ul",{className:"controls","data-testid":"carousel-controls",children:[g.jsx("li",{className:"arrow previous",children:g.jsx(Ke,{variant:"secondary",size:"large",icon:{icon:"chevron_left"},onClick:S=>{S.preventDefault(),S.stopPropagation(),P("previous")},screenreaderText:l.formatMessage({id:`${u}previousSlide`}),disabled:y<=0})}),[...Array(C)].map((S,B)=>g.jsx("li",{"data-testid":"carousel-controls-button",children:g.jsx("button",{className:ee("page-indicator",{selected:B===y}),onClick:H=>{H.preventDefault(),H.stopPropagation(),P(B)},children:g.jsx(xt,{showOnFocus:!1,children:l.formatMessage({id:`${u}slide`},{number:B+1,total:C})})})},`page-indicator-${B}`)),g.jsx("li",{className:"arrow next",children:g.jsx(Ke,{variant:"secondary",size:"large",icon:{icon:"chevron_right"},onClick:S=>{S.preventDefault(),S.stopPropagation(),P("next")},screenreaderText:l.formatMessage({id:`${u}nextSlide`}),disabled:y>=C-1})})]}),g.jsx(xt,{"aria-live":"polite",showOnFocus:!1,children:b})]})]})},xve=({carousels:e=[],isLoading:t,title:n,className:r="",...i})=>!e||!e.length?null:e.map(({title:a,viewAllUrl:o,cards:s,cardsTypes:l},u)=>{const c=a?window.btoa(a):`carousel-${u}`,d=u===e.length-1;return t?g.jsxs(E.Fragment,{children:[g.jsx(bh,{layout:`carousel${a?"-with-title":""}`,"data-testid":"carousel-placeholder"}),d?null:g.jsx(fi,{})]},`placeholder-${c}`):g.jsxs(E.Fragment,{children:[g.jsx(Cve,{cards:s,cardTypes:l,title:n!=null&&n.hidden?{}:{...n,text:a,link:o},...i}),d?null:g.jsx(fi,{})]},`carousel-${c}`)});const wve=({element:e="div",className:t="",card:n,gtmContext:r="NarrowCard"})=>{const{banner:i,title:a,text:o,isPrivate:s,slug:l}=n;let u={};return l&&(u={onClick:d=>{l&&(d.preventDefault(),d.stopPropagation(),window.location.href=l)},tabIndex:"0","data-gtm-event-context":`${r}-NarrowCard`,"data-gtm-event-type":`${r}-click`}),E.createElement(e,{className:ee("narrow-card",t,{"has-link":l,"gtm-trackable":l,"no-link":!l}),...u,children:g.jsxs(g.Fragment,{children:[g.jsx("div",{className:ee("img",{private:s,"no-image":!i}),children:i&&g.jsx(co,{image:i})}),g.jsxs("div",{className:"content",children:[a&&g.jsx("p",{className:"title text-medium",children:a}),o&&g.jsx("p",{className:"text text-medium",children:o})]})]})})};const Ave=({element:e="p",data:{timeLeftToFinish:t,percentageCompleted:{inTime:n=0,inLessons:r=0},shouldShowTimes:i=!0},graph:a,styling:o={},className:s=""})=>{const l=me.useIntl();let u=i?n:r;u>99?u=100:u<1&&(u=0);const{highlightPercentage:c=!1}=o;return E.createElement(e,{className:ee("course-progression",s,{"highlight-percentage":c,"has-circle-graph":a==="circle"}),children:g.jsxs(g.Fragment,{children:[g.jsx(Mv,{progress:u,styling:{layout:a||"bar",size:a&&a==="circle"?"small":"default"}}),g.jsx("span",{className:"percentage",children:l.formatMessage({id:"courseProgression_done"},{percent:d=>g.jsx("strong",{children:d}),number:u})}),u<100&&i&&g.jsx(wp,{time:t,appendedText:l.formatMessage({id:"courseProgression_timeLeft"})})]})})};const vD=({element:e="span",sectionId:t,subsectionId:n,title:r,className:i=""})=>E.createElement(e,{className:ee("lesson-name",i),"data-number":`${t}.${n}`,children:r});const yD=({size:e="default",completionTime:t,icon:n,optional:r,type:i,children:a})=>{const o=me.useIntl(),s=gh(`lessonType_${i}`)?o.formatMessage({id:`lessonType_${i}`}):zC(i||"");return g.jsxs("small",{className:ee("content-type",{[e]:e!=="default"}),children:[g.jsx("span",{className:ee("type",n),children:s})," ",t>0&&!r&&g.jsx(wp,{time:t})," ",a?g.jsx("span",{className:"additional",children:a}):null]})};const kve=({course:{articles:e,canAccessCourse:t,description:n,hideTimes:r,isEnrolled:i,sectionId:a,sectionTime:o,slug:s,timeLeft:l,title:u},quizScores:c})=>{const d=me.useIntl(),f="courseStructure_",h=u.toLowerCase().includes("course conclusion");return g.jsxs(vh,{className:"course-structure",label:g.jsxs(g.Fragment,{children:[g.jsxs("small",{children:[d.formatMessage({id:`${f}section${h?"_end":""}`},{number:a})," ",!r&&o>=0&&g.jsx("span",{className:"time",children:i&&l===0?d.formatMessage({id:`${f}time_completed`}):g.jsx(wp,{time:o,appendedText:i?d.formatMessage({id:`${f}time_left`}):""})})]}),g.jsx("h3",{children:u})]}),shouldAnimate:!0,children:[g.jsx("p",{children:n}),g.jsx("ol",{children:e&&e.length>0&&e.map(({completed:m,completionTime:p,contentType:y,icon:v,image:b,isIntroduction:_,optional:T,slug:C,subsectionId:x,title:w,type:P})=>{const O=i&&t||_,M={};return b&&(M.style={"--image":`url(${b})`}),g.jsx("li",{className:ee({article:y===Du.ARTICLE,discussion:y===Du.DISCUSSION,quiz:y===Du.QUIZ,completed:m&&y===Du.ARTICLE,locked:!O}),...M,children:g.jsx(fo,{href:O?`/microcourses/en/${s}/${C}`:void 0,fallbackElement:"span",className:"inner",gtmContext:`MicrocourseOutline${UC(w)}`,gtmType:"article-click",children:g.jsxs(g.Fragment,{children:[g.jsx(vD,{sectionId:a,subsectionId:x,title:w,className:"course-title"})," ",g.jsx(yD,{completionTime:p,icon:v,optional:T,type:P,children:c&&c[C]&&g.jsx("span",{className:"quiz-score",children:`${c[C]}%`})})]})})},C)})})]})};const Sve=({isComplete:e=!1,onClick:t,...n})=>{const r=me.useIntl();return n["data-gtm-event-context"]||(n["data-gtm-event-context"]="LessonIntroduction"),g.jsx(Ke,{...n,variant:"tertiary",icon:e?{icon:"check-inside-circle_no-overlap_inverted"}:{icon:"check-inside-circle_no-overlap",hover:"check-inside-circle_no-overlap_inverted"},onClick:t,className:ee("mark-complete-button center gtm-trackable",{completed:e}),"data-gtm-event-type":"mark-as-complete",disabled:e,children:r.formatMessage({id:`markCompleteButton${e?"_completed":""}`})})},Dve=({id:e,data:{jobTitle:t,name:n,organization:r,thumbnail:i}})=>({id:e,name:n,jobTitle:t,organization:r,image:{thumbnail:i}}),DC=[{contentType:"solutionArticle",banner:{description:"",url:"//images.ctfassets.net/txbhe1wabmyx/kCcBdXurt3uOKu6NdTPm0/1b6d19179b21f98dbdadf2477c03d267/devin-avery-7gwqj0yyrhm-unsplash.jpg",width:295,height:180,type:"image/jpeg",aspect:"responsiveCard",query:"w=295&h=180&fit=thumb&f=center"},slug:"why-public-servants-must-learn-to-fail",contributors:["community"]},{contentType:"solutionArticle",banner:{description:"",url:"//images.ctfassets.net/txbhe1wabmyx/12Y0W1K0zVcDKzgLZlbfyC/6eb0757a02cbeea19b1b42d7da04d553/ashkan-forouzani-m0l9nbcivuk-unsplash.jpg",width:295,height:180,type:"image/jpeg",aspect:"responsiveCard",query:"w=295&h=180&fit=thumb&f=center"},slug:"organisational-culture-change-and-failure",contributors:[{name:"Mari-Liis",id:"bdb7509c-89ed-4633-8bc0-dbf11f5d9be1"}]},{contentType:"solutionArticle",banner:{description:"",url:"//images.ctfassets.net/txbhe1wabmyx/26TEwu0xVkbQDguuW89fY6/d54ce406cdd652d68979770d526398ab/nik-shuliahin-bunwp1bl0nc-unsplash.jpg",width:295,height:180,type:"image/jpeg",aspect:"responsiveCard",query:"w=295&h=180&fit=thumb&f=center"},slug:"how-to-learn-from-failure-without-causing-a-scandal",contributors:["community"]}];const yd="notFoundError_",Ove=()=>{const e=me.useIntl(),t=[];return DC.forEach((n,r)=>{n.title=e.formatMessage({id:`${yd}post_${r+1}`}),t.push("solutionArticle")}),g.jsxs(sD,{styling:{background:"bold",circle:"small",variant:"alt-2"},additionalContent:{appended:g.jsxs(mo,{children:[g.jsx(gD,{cards:DC,cardTypes:t,buildCardData:n=>new Promise((r,i)=>{r(n)})}),g.jsx(Ke,{href:"/solution-articles/",children:e.formatMessage({id:`${yd}cta`})})]})},reportError:()=>{},className:"not-found-error",children:[g.jsx("h1",{children:e.formatMessage({id:`${yd}title`})}),g.jsx("p",{children:e.formatMessage({id:`${yd}text`})})]})};exports.ASSETS_URL=Hi;exports.ActionBar=V3;exports.ActionButton=bc;exports.ActivitiesFeed=hI;exports.ActivitySection=Jge;exports.ActivityType=Bl;exports.AddPost=u5;exports.Badge=f3;exports.BadgeScope=Fn;exports.Badges=h3;exports.BadgesContext=Nv;exports.BadgesProvider=n3;exports.Banner=uve;exports.BannerSection=fve;exports.Breadcrumbs=RI;exports.Buckets=lO;exports.Button=Ke;exports.ButtonWrapper=Fl;exports.COURSE_CONTENT_TYPES=Du;exports.CacheProvider=r3;exports.Card=d5;exports.CardBlock=gD;exports.Carousel=xve;exports.CharacterLimit=Jv;exports.Checkbox=ey;exports.CollapsibleSection=vh;exports.Columns=K3;exports.CommunityDetails=NN;exports.ConnectionCta=p3;exports.ConnectionDirectionType=Fv;exports.ConnectionStatusType=Rv;exports.ContactFooter=LU;exports.ContactForm=kw;exports.ContentTypeLabel=QC;exports.Contributors=Bv;exports.ConversationContext=Cp;exports.CookieBanner=Pw;exports.CourseProgression=Ave;exports.CourseStructure=kve;exports.CustomContentBanner=hve;exports.CustomEvents=bn;exports.DELETED_USER_ID=gc;exports.Directory=ive;exports.DiscussionContentType=at;exports.DiscussionConversation=cD;exports.DiscussionForm=l1;exports.DiscussionFormCard=fD;exports.DiscussionFormModal=mD;exports.DiscussionPost=u1;exports.DiscussionThread=pD;exports.DiscussionType=Cn;exports.Divider=fi;exports.DownloadSection=RU;exports.EMAILS=zs;exports.EditSection=MU;exports.EmailHelperTextBox=Y3;exports.EmptyStateBox=Ui;exports.EnrichedUrl=Qv;exports.FeatureFlags=o3;exports.Filters=q3;exports.FlagsProvider=a3;exports.Footer=Sy;exports.Form=Zi;exports.Formatting=ae;exports.Fragment=Pr;exports.FullWidthSection=mo;exports.GET_STREAM_USER_PREFIX=X0;exports.GlobalProviders=EO;exports.Header=l5;exports.HelperTextBox=JC;exports.HiddenFromScreenReaders=mh;exports.HideShowTextBox=e3;exports.HighlightSection=mve;exports.HighlightedTextBox=Er;exports.INVALID_TOKEN=VC;exports.IconBulletedList=dO;exports.ImageContainer=iO;exports.IntlProvider=s3;exports.InviteForm=Sw;exports.InviteModal=tve;exports.JoinButton=Uv;exports.Label=Af;exports.LanguageContext=Iv;exports.LanguageSwitcher=MI;exports.LessonName=vD;exports.LessonType=yD;exports.LikesButton=L3;exports.LikesFeed=H3;exports.LikesModal=U3;exports.Link=fo;exports.LoadMore=Vc;exports.LoadingBlock=m3;exports.LoadingPlaceholder=qr;exports.LoadingState=bh;exports.Logo=Xv;exports.LogoSection=BU;exports.MEMBERS_PER_PAGE=lD;exports.MENTION_REGEX=qC;exports.MarkCompleteButton=Sve;exports.MarkdownText=Xo;exports.MarketingBlock=gve;exports.Marks=Pi;exports.Member=Ea;exports.MembersList=uD;exports.Modal=Lv;exports.MoreMenu=bf;exports.NUMBER_OF_COUNTRIES=UD;exports.NUMBER_OF_USERS=HD;exports.NarrowCard=wve;exports.NavigationMenu=W3;exports.NotFoundError=Ove;exports.Overlay=Sa;exports.OverlayContext=Pv;exports.OverlayProvider=c3;exports.PageHeading=d3;exports.PageLayout=sD;exports.Password=Z3;exports.PasswordForm=xU;exports.PasswordRules=tx;exports.Pill=Fi;exports.Poll=dD;exports.Popover=ZC;exports.Portal=Ml;exports.ProfileForm=Dw;exports.ProfileImageChange=Aw;exports.ProfileModal=xp;exports.ProfileModalLauncher=c5;exports.ProfilePicture=ka;exports.ProgressBar=Mv;exports.ProgressTracker=oO;exports.PublishArticleForm=kU;exports.Rating=JI;exports.RepliesFeed=j3;exports.ResponsesHeading=hD;exports.ResponsiveImage=co;exports.ResultsVisibility=fh;exports.ReturnToNavButton=sO;exports.RichTextEditor=ky;exports.STORAGE_KEYS=Sv;exports.SearchForm=Nw;exports.ShareLink=z3;exports.ShareLinks=UI;exports.ShowEmail=ave;exports.SignupForm=PU;exports.Span=ng;exports.StatusBanner=gl;exports.TableOfContents=lve;exports.Tabs=zI;exports.Tags=wge;exports.TestimonialBlock=sve;exports.TimeToComplete=wp;exports.Toggle=TU;exports.Tooltip=ss;exports.TopLevelPage=$U;exports.UUID_V4_REGEX=vc;exports.UserContext=fn;exports.UserProvider=l3;exports.VisuallyHidden=xt;exports.addAriaProps=D3;exports.basicReducer=Rl;exports.camelCaseToDashCase=HC;exports.checkIntlPathExists=gh;exports.courseDiscussionRepliesFeedMock=mI;exports.enrichPostCategories=Zv;exports.generateConditions=Dd;exports.generateCssIcon=zD;exports.getAuthorData=Ll;exports.getCharacterLimitProps=G3;exports.getLongDate=Dv;exports.getMember=Eh;exports.getPostBody=Yv;exports.getShortDate=WC;exports.getValueLength=_h;exports.headerData=zc;exports.likesResponseMock=II;exports.mapGetStreamData=Dve;exports.pageReady=KC;exports.passwordValidator=eg;exports.repliesFeedMock=pI;exports.supportedLanguages=_d;exports.toCamelCase=UC;exports.toCapitalisedCase=jD;exports.toSentenceCase=zC;exports.transformSlugs=sg;exports.useAutoResize=FC;exports.useBadges=t3;exports.useCurrentPath=MC;exports.useEffectAfterMount=ml;exports.useElementWidth=lo;exports.useOverlay=u3;exports.useScrollListener=LC;exports.useScrollToHash=Av;exports.useTooltips=kv;exports.useUser=yh;
|