@apolitical/component-library 8.7.32 → 8.7.33-4385.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 CHANGED
@@ -33,7 +33,7 @@ Check the top-level render call using <`+xe+">.")}return ge}}function et(K,ge){{
33
33
 
34
34
  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.
35
35
 
36
- 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_translation_seeOriginal:"See original",discussion_translation_translate:"Translate to {locale}",discussion_translation_translate_loading:"Translating to {locale}",discussion_translation_translated:"AI translated from {originalLocale}",discussion_translation_translate_error:"There was an error. Please try again.",discussion_translation_coming_soon:"Translation coming soon",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:"Energy and climate",publishArticleForm__tags_topic_DigitalAndData:"Digital, data and AI",publishArticleForm__tags_topic_Education:"Education",publishArticleForm__tags_topic_EquityJusticeAndInclusion:"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_submit_edit:"Save",publishArticleForm_cta_submitting:"Publishing...",publishArticleForm_cta_submitting_edit:"Saving...",publishArticleForm_cta_submitted:"Published!",publishArticleForm_cta_submitted_edit:"Saved!",publishArticleForm_aria_success:"Your article is being published. You will be redirected to your article in a moment.",publishArticleForm_aria_success_edit:"Your article is being saved. 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:"Energy and 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":"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_sr-Cyrl":"Ова страница је доступна само на енглеском. <link>Сазнајте више →</link>",header_language_unavailable_de:"Diese Seite ist nur auf Englisch verfügbar. <link>Mehr erfahren →</link>","header_language_unavailable_fr-CA":"Cette page est uniquement disponible en anglais. <link>En savoir plus →</link>",header_language_unavailable_ko:"이 페이지는 영어로만 제공됩니다. <link>자세히 알아보기 →</link>",header_language_unavailable_it:"Questa pagina è disponibile solo in inglese. <link>Scopri di più →</link>",header_language_unavailable_pl:"Ta strona jest dostępna tylko w języku angielskim. <link>Dowiedz się więcej →</link>",header_language_unavailable_ja:"このページは英語でのみ利用可能です。<link>詳細はこちら →</link>",header_language_unavailable_ar:"هذه الصفحة متوفرة باللغة الإنجليزية فقط. <link>اعرف المزيد →</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>","header_language_unavailable_es-419":"Esta página sólo está disponible en inglés. <link>Más información →</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"},wx={...dn,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>"},Ax={...dn,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"},Sx={...dn,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>"},kx={...dn,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>"},Dx={...dn,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>"},Ox={...dn,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>"},Nx={...dn,languageSwitcher_label:"أود قراءة هذه المقالة بـ...",languageSwitcher_translation_original:"اللغة الأصلية",languageSwitcher_translation_human:"مترجمة بواسطة إنسان",languageSwitcher_translation_machine:"مترجمة آلياً",languageSwitcher_disclaimer:"تمت ترجمة هذا المحتوى تلقائياً وقد يحتوي على أخطاء في النوع أو ترجمات حرفية أخرى. نحن نحاول معالجة هذه المشكلة، ولكن في الوقت الحالي، إذا لاحظت خطأً مهماً، يرجى إعلامنا على <link>{email}</link>",collapsibleSection_summary:"اقرأ المزيد"},Ix={...dn,languageSwitcher_label:"この記事を以下の言語で読みたい...",languageSwitcher_translation_original:"原文",languageSwitcher_translation_human:"人による翻訳",languageSwitcher_translation_machine:"機械翻訳",languageSwitcher_disclaimer:"このコンテンツは自動的に翻訳されており、性別の誤りや直訳などが含まれている可能性があります。現在、これらの問題の解決に取り組んでいますが、重大な誤りにお気づきの場合は、<link>{email}</link> までご連絡ください。",collapsibleSection_summary:"もっと読む"},Px={...dn,languageSwitcher_label:"Chciał(a)bym przeczytać ten artykuł w...",languageSwitcher_translation_original:"język oryginalny",languageSwitcher_translation_human:"przetłumaczone przez człowieka",languageSwitcher_translation_machine:"przetłumaczone maszynowo",languageSwitcher_disclaimer:"Treść została przetłumaczona automatycznie i może zawierać błędy związane z rodzajem gramatycznym lub inne dosłowne tłumaczenia. Pracujemy nad ich poprawą, ale jeśli zauważysz poważny błąd, daj nam znać na adres <link>{email}</link>",collapsibleSection_summary:"Czytaj więcej"},Rx={...dn,languageSwitcher_label:"Vorrei leggere questo articolo in...",languageSwitcher_translation_original:"lingua originale",languageSwitcher_translation_human:"tradotto da un essere umano",languageSwitcher_translation_machine:"tradotto automaticamente",languageSwitcher_disclaimer:"Questo contenuto è stato tradotto automaticamente e potrebbe contenere errori di genere o altre traduzioni letterali. Stiamo lavorando per risolvere questi problemi, ma se noti un errore importante, faccelo sapere a <link>{email}</link>",collapsibleSection_summary:"Scopri di più"},Fx={...dn,languageSwitcher_label:"Желео бих да читам овај чланак на...",languageSwitcher_translation_original:"оригиналном језику",languageSwitcher_translation_human:"превео човек",languageSwitcher_translation_machine:"машински превод",languageSwitcher_disclaimer:"Овај садржај је аутоматски преведен и може садржати грешке у роду или друге дословне преводе. Трудимо се да решимо овај проблем, али у међувремену, ако приметите озбиљну грешку, јавите нам на <link>{email}</link>",collapsibleSection_summary:"Сазнајте више"},Bx={...dn,languageSwitcher_label:"이 기사를 다음 언어로 읽고 싶습니다...",languageSwitcher_translation_original:"원본 언어",languageSwitcher_translation_human:"사람이 번역함",languageSwitcher_translation_machine:"기계 번역",languageSwitcher_disclaimer:"이 콘텐츠는 자동으로 번역되었으며, 성별 오류나 직역 등 부정확한 부분이 포함될 수 있습니다. 저희는 이 문제를 해결하기 위해 노력하고 있으며, 중요한 오류를 발견하셨다면 <link>{email}</link>로 알려주세요.",collapsibleSection_summary:"자세히 보기"},Mx={...dn,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"},Lx={...dn,languageSwitcher_label:"Ich möchte diesen Artikel lesen auf...",languageSwitcher_translation_original:"Originalsprache",languageSwitcher_translation_human:"von einem Menschen übersetzt",languageSwitcher_translation_machine:"maschinell übersetzt",languageSwitcher_disclaimer:"Dieser Inhalt wurde automatisch übersetzt und kann Fehler bei der Geschlechtszuordnung oder andere Ungenauigkeiten enthalten. Wir arbeiten daran, diese Probleme zu beheben. Wenn Ihnen ein schwerwiegender Fehler auffällt, informieren Sie uns bitte unter <link>{email}</link>.",collapsibleSection_summary:"Mehr erfahren"},m1=(e,t=dn)=>e in t,wr=(e,t,n,r,i={})=>{let a="";return m1(`${t}_${n}`)?a=e({id:`${t}_${n}`},i):a=e({id:t},{[r]:n,...i}),a},$x=(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},hc=(e,t)=>E.Children.map(e,n=>Object.is(n,null)?n:E.cloneElement(n,{...t})),w4=(e=0)=>{setTimeout(()=>{const t=document.querySelector(".splash-screen");t&&t.remove(),window.prerenderReady=!0},e)},jx=e=>{var a,s;const n=["name","organization","jobTitle","biography"].every(o=>{const l=e[o];return l!=null&&l!==""}),r=((a=e.image)==null?void 0:a.thumbnail)!==void 0,i=((s=e.location)==null?void 0:s.en)!==void 0;return n&&r&&i},Hx=(e,t,n)=>!t.id||!t.name?"":t.error?n.replace(/{{name}}/g,bl).replace(/{{id}}/g,bl):n.replace(/{{name}}/g,t.name).replace(/{{id}}/g,t.id),A4=async({text:e,template:t,mentions:n,listMembers:r=()=>Promise.resolve([])})=>{var a;if(!n)return e;const i=e.match($a);if(!i)return e;for(const s of i){const o=s.replace($a,(c,d)=>d),l=n[o];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(bh))try{const d=c.replace(bh,"");u.id=d,await r({id:d}).then(f=>{const{name:p,error:g}=f;u.name=g||p||"",u.error=g})}catch{e.replace(s,"@");continue}else continue}e=e.replace(s,u.name?Hx(e,u,t):s)}return e},Np=e=>{const t=e.startsWith("http")?e:`https://${e}`,r=new URL(t).hostname;return{full:t,pretty:r}},S4=e=>new URLSearchParams(window.location.search).get(e),Tl=(e="")=>e.replace(/\s+/g,"").length>0,_h=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}}};function Si(e){return window!=null&&window.btoa?window.btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(t,n)=>String.fromCharCode("0x"+n))):(console.error("window.btoa is not supported"),e)}const Ka=()=>{const{id:e}=E.useContext(jt);if(!e)return La.DEFAULT_LOCALE;const t=x4(kp);return t||La.DEFAULT_LOCALE},g1=()=>{const{id:e}=E.useContext(jt),[t,n]=E.useState(void 0);return E.useEffect(()=>{if(!e){n("/home/");return}const r=x4(kp);if(r){n(`/${r}`);return}n(`/${La.DEFAULT_LOCALE}`)},[e]),t},k4=({scrollPosition:e=0,offset:t={down:0,up:10},callbacks:{scrollDown:n=()=>{},scrollUp:r=()=>{}}})=>{if(!window)return;const[i,a]=E.useState({current:0,past:0})||[!1,()=>{}],[s,o]=E.useState({scrollDown:!1,scrollUp:!1})||[!1,()=>{}];E.useEffect(()=>(l(),window.addEventListener("scroll",u),()=>{u.flush(),window.removeEventListener("scroll",u)}),[]);const l=()=>{const c=window.scrollY,d=i.current,f=c-d,p=f>0?"down":"up";if(a({current:c,past:d}),p==="down"){c>=e+t.down&&!s.scrollDown&&(!s.scrollUp||f>t.up)&&(n(),o({scrollUp:!1,scrollDown:!0}));return}Math.abs(f)>=t.up&&!s.scrollUp&&(r(),o({scrollUp:!0,scrollDown:!1}))},u=m4(()=>{l()},250);return i},Ip=(e=[],t=!0)=>{e=Array.isArray(e)?e:[e];const n=E.useRef(!1);Hs(()=>{if(window&&window.location&&window.location.hash){if(n.current)return;const r=document.getElementById(window.location.hash.replace("#",""));r&&(r.scrollIntoView(t?{behavior:"smooth"}:null),n.current=!0)}},e)},Pp=(e=!1)=>{if(!e)return{showTooltip:!1,tooltipProps:{}};const[t,n]=E.useState(!1);return{showTooltip:t,tooltipProps:{onClick:()=>n(!0),onKeyDown:r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),r.stopPropagation(),n(!t))},onMouseOver:()=>n(!0),onMouseOut:()=>n(!1),onFocus:()=>n(!0),onBlur:()=>n(!1)}}};const J0={},Ux=E.forwardRef(({id:e,styling:t={},isOpen:n=!1,isLoading:r=!1,children:i,className:a="",functions:s={},callbacks:o={},accessibility:l={},...u},c)=>{const d=ue.useIntl(),[f]=E.useState(e||Date.now().toString()),p=E.useRef(null),g=c||p,[m,y]=E.useState(n?"open":"hidden"),{extraPadding:v=!0,hasPointer:b=!1,hasForm:T=!1}=t,{onOpen:_=()=>{},onClose:C=()=>{}}=o,{readToScreenreadersWhenClosed:A=!1,...S}=l,I=J0[f];E.useEffect(()=>{const N=g==null?void 0:g.current;if(N)return N.addEventListener("transitionend",B),()=>{N.removeEventListener("transitionend",B)}},[]),E.useEffect(()=>{if(m!=="open")return;const N=k=>{k.key==="Escape"&&(k.stopPropagation(),k.preventDefault(),y("closed"))};return document.addEventListener("keyup",N),()=>{document.removeEventListener("keyup",N)}},[m]);const B=({propertyName:N})=>{N==="opacity"&&(I!==!1&&clearTimeout(I),y(k=>(k==="open"?_():k==="closed"&&C(),k==="opening"?"open":k==="closing"?"closed":k==="closed"?"hidden":k)))};Hs(()=>{I!==!1&&clearTimeout(I);let N="open";n?y("opening"):(y("closing"),N="hidden"),J0[f||""]=setTimeout(()=>{y(N)},300)},[n]);const F={"aria-live":"polite",...u,...S};s&&s.onBlur&&(F.onBlur=s.onBlur);const R={className:"content"};return A?R.className=ne("content",{hidden:m==="hidden"}):R.hidden=m==="hidden",h.jsx("aside",{ref:g,id:f,className:ne("tooltip text-medium",m,a,{loading:r,"extra-padding":v,"has-pointer":b,bottom:b==="bottom","has-form":T}),...F,children:h.jsx("div",{...R,children:r?h.jsx("p",{children:d.formatMessage({id:"tooltip_loading"})}):typeof i=="string"?h.jsx("p",{children:i}):i})})}),ia=E.memo(Ux);const Fe=({variant:e="primary",size:t="medium",styling:n={muted:!1,fullWidth:!1},icon:r=!1,href:i=!1,element:a="button",onClick:s=!1,className:o="",disabled:l=!1,tooltip:u="",forceTooltip:c=!1,screenreaderText:d=!1,children:f=!1,...p})=>{const m=ra(typeof t=="object"),{showTooltip:y,tooltipProps:v}=Pp(!!u);if(typeof t=="object"&&typeof m=="number"){const C=Object.assign({},t),A=g4(Object.keys(C));t=v4(m,A,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 T={...p,className:ne(e,o,b,{"no-text":!f,disabled:l,button:i,muted:n.muted,"full-width":n.fullWidth}),onClick:C=>{(!i||i[0]==="#")&&s&&(C.preventDefault(),C.stopPropagation()),s&&s(C)},disabled:typeof l=="object"&&"isClickable"in l?!l.isClickable:l};i&&(a="a",T.href=i);const _=E.createElement(a,T,f||(d?h.jsx(ct,{showOnFocus:!1,children:d}):null));return c||l&&u?h.jsxs("span",{className:"button-container",...v,children:[h.jsx(ia,{isOpen:y,accessibility:{readToScreenreadersWhenClosed:!0},children:u}),_]}):_},to=({buttons:e,wrappers:t=[],className:n="",...r})=>{const i=e.length>1?"ul":"p",a=e.map((s,o)=>{var l;return i==="p"?h.jsx(Fe,{...s},o):h.jsx("li",{className:((l=t[o])==null?void 0:l.className)||"",children:h.jsx(Fe,{...s})},o)});return E.createElement(i,{className:ne("button-wrapper",n),...r,children:a})};const Dr=({className:e="",maxWidth:t=!1})=>{const n=t?{"--max-width":`${t/16}rem`}:{};return h.jsx("hr",{className:ne(e,{"has-max-width":t}),style:n})},eg={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"}},zx=({aspect:e,range:t,sizes:n})=>{const{range:r,sizes:i}=e?eg[e]:eg.fallback;return{range:t&&t.length>0?t:r,sizes:n||i}},qx=({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},ld=({format:e,range:t,url:n,query:r})=>t.map(({height:i,width:a})=>`${n}?${qx({format:e,height:i,query:r,width:a})} ${a}w`).join(", ");const aa=({image:e,className:t,testId:n})=>{const{description:r,height:i,type:a,color:s,query:o,url:l,width:u,loading:c,decoding:d,fetchPriority:f}=e,{range:p,sizes:g}=zx(e),m=ld({format:"avif",query:o,range:p,url:l}),y=ld({format:"webp",query:o,range:p,url:l}),v=ld({format:"",query:o,range:p,url:l});let b={};return s&&(b={"--color":s}),a&&a.includes("svg")?h.jsx("picture",{className:t,style:b,children:h.jsx("img",{src:l,alt:r,loading:c||"lazy",decoding:d||"async",fetchpriority:f||"auto",width:u,height:i,"data-testid":n||"image"})}):h.jsxs("picture",{className:t,style:b,children:[a!=="image/gif"&&h.jsx("source",{type:"image/avif",srcSet:m,sizes:g,"data-testid":"source"}),h.jsx("source",{type:"image/webp",srcSet:y,sizes:g,"data-testid":"source"}),h.jsx("img",{srcSet:v,sizes:g,src:l,alt:r,loading:c||"lazy",decoding:d||"async",fetchpriority:f||"auto",width:u,height:i,"data-testid":n||"image"})]})};const Wx=({image:e,className:t="",testId:n})=>h.jsx("div",{className:`image-container ${t}`,"data-testid":n||"image-container",children:e&&h.jsx(aa,{image:{...e},className:"image"})}),sa=({href:e,children:t,fallbackElement:n,meta:r,className:i="",onClick:a,gtmContext:s,gtmType:o,...l})=>{const{forceOnClick:u=!1}=r||{};if(e){const d={...l};return a&&(d.onClick=a),s&&(d["data-gtm-event-context"]=s),o&&(d["data-gtm-event-type"]=o),h.jsx("a",{href:e,className:ne("gtm-trackable",i),...d,children:t})}const c={};return u&&(c.onClick=a),n?E.createElement(n,{children:t,className:i,...l,...c}):h.jsx(h.Fragment,{children:t})};const D4=E.forwardRef(({className:e="",children:t},n)=>{const r=E.useRef(null),i=n||r;return h.jsx("aside",{ref:i,className:ne("popover",e),"aria-live":"polite",children:t})}),no=({parent:e=document.body,children:t})=>typeof document=="object"?Ap.createPortal(t,e):null,Vx=Object.freeze(Object.defineProperty({__proto__:null,default:no},Symbol.toStringTag,{value:"Module"}));const Kx=({currentStep:e=1,steps:t=1})=>h.jsxs(h.Fragment,{children:[h.jsx(ct,{children:h.jsx(ue.FormattedMessage,{id:"progressTracker",values:{current:e,total:t}})}),h.jsx("div",{className:"progress-tracker",children:h.jsx("div",{className:"dots-wrapper",children:new Array(t).fill("").map((n,r)=>{const i=r+1;return h.jsxs("div",{className:"dot-wrapper",children:[h.jsx("div",{className:ne("dot",{active:i===e,completed:i<e}),"data-testid":"progress-dot"}),h.jsx("div",{className:ne("line",{active:i<e})})]},r)})})})]});const Gx=({elementId:e,offset:t=20})=>{const n=ue.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 h.jsx(Fe,{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 Yx=({items:e,className:t="",...n})=>h.jsx("ul",{className:ne("buckets",t),...n,children:e.map(({title:r,text:i,link:a,...s},o)=>h.jsx("li",{className:"bucket text-medium",children:h.jsxs("a",{href:a,...s,children:[h.jsx("p",{className:"title",children:r}),h.jsx("p",{children:i})]})},o))}),tg=300,ng="ease-in-out";class Zx{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:tg,easing:ng}),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:tg,easing:ng}),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 v1=({label:e=!1,className:t="",children:n,shouldAnimate:r=!1})=>{const i=ue.useIntl(),a=E.useRef(null);return E.useEffect(()=>{let s;return r&&(s=new Zx(a.current)),()=>{r&&s&&s.cleanUp()}},[]),h.jsxs("details",{ref:a,className:ne("collapsible-section",t,{"should-animate":r}),children:[h.jsx("summary",{children:e||i.formatMessage({id:"collapsibleSection_summary"})}),h.jsx("div",{className:"content",children:n})]})},rg={cube:"box",graduationCap:"graduation-cap",person:"user",speech:"speech-bubble_round",star:"star_empty_thin"},Qx=e=>{let t=e;return Object.keys(rg).includes(e)&&(t=rg[e]),`url(${Qr}icons/${t}.svg)`};const ig={customCard:"custom",microcourse:"course",courseJourney:"course",solutionArticle:"article",qaQuestion:"question",listPage:"list",learningHub:"learning-hub",communityPage:"communityPage"},O4=({contentType:e,customIcon:t,customLabel:n,className:r=""})=>{const i=ue.useIntl(),a=t?{"--custom-icon":Qx(t)}:{},s=m1(`contentTypeLabel_${e}`)?i.formatMessage({id:`contentTypeLabel_${e}`}):!1;return!n&&!s?null:h.jsx("small",{className:ne("content-type-label text-small",e in ig?ig[e]:e,r,{"has-custom-icon":t}),style:a,"data-testid":"content-type-label",children:n||s})};const Kn=({variant:e="primary",icon:t,styling:n={},className:r="",children:i,...a})=>{const{showHighlight:s=!1,background:o="default"}=n,l=t?{"--icon":`url(${Qr}icons/${t}.svg)`}:{};return h.jsx("div",{className:ne("highlighted-text-box",e,r,{"has-icon":t,"show-highlight":s,[o]:o!=="default"}),style:l,...a,children:i})};const Xr=({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,s=ra(a);if(a&&typeof n=="object"&&typeof s=="number"){const d=Object.assign({},n.breakpoints),f=g4(Object.keys(d));i=v4(s,f,d)}const{breakpoints:o,text:l="",component:u,...c}=n;return h.jsx(Kn,{variant:"subtle",className:ne("empty-state-box",e,r),children:h.jsxs(h.Fragment,{children:[t&&typeof t=="string"?h.jsx(Wr,{options:{forceBlock:!0},children:t}):t,i&&typeof n=="object"&&(u||h.jsx(Fe,{...c,variant:n.variant?n.variant:"secondary",children:l}))]})})};const Ch=({children:e,...t})=>h.jsx("p",{...t,children:e}),N4={q:Ch,blockquote:Ch};for(let e=1;e<=6;e++)N4[`h${e}`]={component:Ch,props:{className:"title"}};const I4=({type:e="default",className:t="",heading:n=!1,children:r,...i})=>h.jsxs("div",{...i,className:ne("helper-text-box text-small",e,t),children:[n&&h.jsx("p",{className:"title",children:n}),typeof r=="string"?h.jsx(Wr,{options:{wrapper:E.Fragment,forceBlock:!0,overrides:N4},children:r}):h.jsx("p",{children:r})]});const P4=({id:e,className:t="",show:n=!1,hide:r=!1,text:i,markdownOptions:a,fadeStyle:s="default",children:o})=>{const l=ue.useIntl(),u=E.useRef(null);e||(e=Date.now().toString());const[c,d]=E.useState(""),[f,p]=E.useState("closed");E.useEffect(()=>{const y=u.current;if(y)return y.addEventListener("transitionend",g),()=>{y.removeEventListener("transitionend",g)}},[]),E.useEffect(()=>{if(!i||typeof i!="string")return;const y=i.split(`
36
+ 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_translation_seeOriginal:"See original",discussion_translation_translate:"Translate to {locale}",discussion_translation_translate_loading:"Translating to {locale}",discussion_translation_translated:"AI translated from {originalLocale}",discussion_translation_translate_error:"There was an error. Please try again.",discussion_translation_coming_soon:"Translation coming soon",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:"Energy and climate",publishArticleForm__tags_topic_DigitalAndData:"Digital, data and AI",publishArticleForm__tags_topic_Education:"Education",publishArticleForm__tags_topic_EquityJusticeAndInclusion:"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_submit_edit:"Save",publishArticleForm_cta_submitting:"Publishing...",publishArticleForm_cta_submitting_edit:"Saving...",publishArticleForm_cta_submitted:"Published!",publishArticleForm_cta_submitted_edit:"Saved!",publishArticleForm_aria_success:"Your article is being published. You will be redirected to your article in a moment.",publishArticleForm_aria_success_edit:"Your article is being saved. 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:"Enter your full name",signup_email_address:"Work email",signup_email_address_placeholder:"Enter your work email",signup_job_title:"Job title",signup_job_title_placeholder:"Enter your job title, e.g. Senior Policy Advisor",signup_organization:"Organisation",signup_organization_placeholder:"Enter your organisation, 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:"Energy and 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":"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_sr-Cyrl":"Ова страница је доступна само на енглеском. <link>Сазнајте више →</link>",header_language_unavailable_de:"Diese Seite ist nur auf Englisch verfügbar. <link>Mehr erfahren →</link>","header_language_unavailable_fr-CA":"Cette page est uniquement disponible en anglais. <link>En savoir plus →</link>",header_language_unavailable_ko:"이 페이지는 영어로만 제공됩니다. <link>자세히 알아보기 →</link>",header_language_unavailable_it:"Questa pagina è disponibile solo in inglese. <link>Scopri di più →</link>",header_language_unavailable_pl:"Ta strona jest dostępna tylko w języku angielskim. <link>Dowiedz się więcej →</link>",header_language_unavailable_ja:"このページは英語でのみ利用可能です。<link>詳細はこちら →</link>",header_language_unavailable_ar:"هذه الصفحة متوفرة باللغة الإنجليزية فقط. <link>اعرف المزيد →</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>","header_language_unavailable_es-419":"Esta página sólo está disponible en inglés. <link>Más información →</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"},wx={...dn,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>"},Ax={...dn,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"},Sx={...dn,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>"},kx={...dn,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>"},Dx={...dn,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>"},Ox={...dn,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>"},Nx={...dn,languageSwitcher_label:"أود قراءة هذه المقالة بـ...",languageSwitcher_translation_original:"اللغة الأصلية",languageSwitcher_translation_human:"مترجمة بواسطة إنسان",languageSwitcher_translation_machine:"مترجمة آلياً",languageSwitcher_disclaimer:"تمت ترجمة هذا المحتوى تلقائياً وقد يحتوي على أخطاء في النوع أو ترجمات حرفية أخرى. نحن نحاول معالجة هذه المشكلة، ولكن في الوقت الحالي، إذا لاحظت خطأً مهماً، يرجى إعلامنا على <link>{email}</link>",collapsibleSection_summary:"اقرأ المزيد"},Ix={...dn,languageSwitcher_label:"この記事を以下の言語で読みたい...",languageSwitcher_translation_original:"原文",languageSwitcher_translation_human:"人による翻訳",languageSwitcher_translation_machine:"機械翻訳",languageSwitcher_disclaimer:"このコンテンツは自動的に翻訳されており、性別の誤りや直訳などが含まれている可能性があります。現在、これらの問題の解決に取り組んでいますが、重大な誤りにお気づきの場合は、<link>{email}</link> までご連絡ください。",collapsibleSection_summary:"もっと読む"},Px={...dn,languageSwitcher_label:"Chciał(a)bym przeczytać ten artykuł w...",languageSwitcher_translation_original:"język oryginalny",languageSwitcher_translation_human:"przetłumaczone przez człowieka",languageSwitcher_translation_machine:"przetłumaczone maszynowo",languageSwitcher_disclaimer:"Treść została przetłumaczona automatycznie i może zawierać błędy związane z rodzajem gramatycznym lub inne dosłowne tłumaczenia. Pracujemy nad ich poprawą, ale jeśli zauważysz poważny błąd, daj nam znać na adres <link>{email}</link>",collapsibleSection_summary:"Czytaj więcej"},Rx={...dn,languageSwitcher_label:"Vorrei leggere questo articolo in...",languageSwitcher_translation_original:"lingua originale",languageSwitcher_translation_human:"tradotto da un essere umano",languageSwitcher_translation_machine:"tradotto automaticamente",languageSwitcher_disclaimer:"Questo contenuto è stato tradotto automaticamente e potrebbe contenere errori di genere o altre traduzioni letterali. Stiamo lavorando per risolvere questi problemi, ma se noti un errore importante, faccelo sapere a <link>{email}</link>",collapsibleSection_summary:"Scopri di più"},Fx={...dn,languageSwitcher_label:"Желео бих да читам овај чланак на...",languageSwitcher_translation_original:"оригиналном језику",languageSwitcher_translation_human:"превео човек",languageSwitcher_translation_machine:"машински превод",languageSwitcher_disclaimer:"Овај садржај је аутоматски преведен и може садржати грешке у роду или друге дословне преводе. Трудимо се да решимо овај проблем, али у међувремену, ако приметите озбиљну грешку, јавите нам на <link>{email}</link>",collapsibleSection_summary:"Сазнајте више"},Bx={...dn,languageSwitcher_label:"이 기사를 다음 언어로 읽고 싶습니다...",languageSwitcher_translation_original:"원본 언어",languageSwitcher_translation_human:"사람이 번역함",languageSwitcher_translation_machine:"기계 번역",languageSwitcher_disclaimer:"이 콘텐츠는 자동으로 번역되었으며, 성별 오류나 직역 등 부정확한 부분이 포함될 수 있습니다. 저희는 이 문제를 해결하기 위해 노력하고 있으며, 중요한 오류를 발견하셨다면 <link>{email}</link>로 알려주세요.",collapsibleSection_summary:"자세히 보기"},Mx={...dn,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"},Lx={...dn,languageSwitcher_label:"Ich möchte diesen Artikel lesen auf...",languageSwitcher_translation_original:"Originalsprache",languageSwitcher_translation_human:"von einem Menschen übersetzt",languageSwitcher_translation_machine:"maschinell übersetzt",languageSwitcher_disclaimer:"Dieser Inhalt wurde automatisch übersetzt und kann Fehler bei der Geschlechtszuordnung oder andere Ungenauigkeiten enthalten. Wir arbeiten daran, diese Probleme zu beheben. Wenn Ihnen ein schwerwiegender Fehler auffällt, informieren Sie uns bitte unter <link>{email}</link>.",collapsibleSection_summary:"Mehr erfahren"},m1=(e,t=dn)=>e in t,wr=(e,t,n,r,i={})=>{let a="";return m1(`${t}_${n}`)?a=e({id:`${t}_${n}`},i):a=e({id:t},{[r]:n,...i}),a},$x=(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},hc=(e,t)=>E.Children.map(e,n=>Object.is(n,null)?n:E.cloneElement(n,{...t})),w4=(e=0)=>{setTimeout(()=>{const t=document.querySelector(".splash-screen");t&&t.remove(),window.prerenderReady=!0},e)},jx=e=>{var a,s;const n=["name","organization","jobTitle","biography"].every(o=>{const l=e[o];return l!=null&&l!==""}),r=((a=e.image)==null?void 0:a.thumbnail)!==void 0,i=((s=e.location)==null?void 0:s.en)!==void 0;return n&&r&&i},Hx=(e,t,n)=>!t.id||!t.name?"":t.error?n.replace(/{{name}}/g,bl).replace(/{{id}}/g,bl):n.replace(/{{name}}/g,t.name).replace(/{{id}}/g,t.id),A4=async({text:e,template:t,mentions:n,listMembers:r=()=>Promise.resolve([])})=>{var a;if(!n)return e;const i=e.match($a);if(!i)return e;for(const s of i){const o=s.replace($a,(c,d)=>d),l=n[o];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(bh))try{const d=c.replace(bh,"");u.id=d,await r({id:d}).then(f=>{const{name:p,error:g}=f;u.name=g||p||"",u.error=g})}catch{e.replace(s,"@");continue}else continue}e=e.replace(s,u.name?Hx(e,u,t):s)}return e},Np=e=>{const t=e.startsWith("http")?e:`https://${e}`,r=new URL(t).hostname;return{full:t,pretty:r}},S4=e=>new URLSearchParams(window.location.search).get(e),Tl=(e="")=>e.replace(/\s+/g,"").length>0,_h=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}}};function Si(e){return window!=null&&window.btoa?window.btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(t,n)=>String.fromCharCode("0x"+n))):(console.error("window.btoa is not supported"),e)}const Ka=()=>{const{id:e}=E.useContext(jt);if(!e)return La.DEFAULT_LOCALE;const t=x4(kp);return t||La.DEFAULT_LOCALE},g1=()=>{const{id:e}=E.useContext(jt),[t,n]=E.useState(void 0);return E.useEffect(()=>{if(!e){n("/home/");return}const r=x4(kp);if(r){n(`/${r}`);return}n(`/${La.DEFAULT_LOCALE}`)},[e]),t},k4=({scrollPosition:e=0,offset:t={down:0,up:10},callbacks:{scrollDown:n=()=>{},scrollUp:r=()=>{}}})=>{if(!window)return;const[i,a]=E.useState({current:0,past:0})||[!1,()=>{}],[s,o]=E.useState({scrollDown:!1,scrollUp:!1})||[!1,()=>{}];E.useEffect(()=>(l(),window.addEventListener("scroll",u),()=>{u.flush(),window.removeEventListener("scroll",u)}),[]);const l=()=>{const c=window.scrollY,d=i.current,f=c-d,p=f>0?"down":"up";if(a({current:c,past:d}),p==="down"){c>=e+t.down&&!s.scrollDown&&(!s.scrollUp||f>t.up)&&(n(),o({scrollUp:!1,scrollDown:!0}));return}Math.abs(f)>=t.up&&!s.scrollUp&&(r(),o({scrollUp:!0,scrollDown:!1}))},u=m4(()=>{l()},250);return i},Ip=(e=[],t=!0)=>{e=Array.isArray(e)?e:[e];const n=E.useRef(!1);Hs(()=>{if(window&&window.location&&window.location.hash){if(n.current)return;const r=document.getElementById(window.location.hash.replace("#",""));r&&(r.scrollIntoView(t?{behavior:"smooth"}:null),n.current=!0)}},e)},Pp=(e=!1)=>{if(!e)return{showTooltip:!1,tooltipProps:{}};const[t,n]=E.useState(!1);return{showTooltip:t,tooltipProps:{onClick:()=>n(!0),onKeyDown:r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),r.stopPropagation(),n(!t))},onMouseOver:()=>n(!0),onMouseOut:()=>n(!1),onFocus:()=>n(!0),onBlur:()=>n(!1)}}};const J0={},Ux=E.forwardRef(({id:e,styling:t={},isOpen:n=!1,isLoading:r=!1,children:i,className:a="",functions:s={},callbacks:o={},accessibility:l={},...u},c)=>{const d=ue.useIntl(),[f]=E.useState(e||Date.now().toString()),p=E.useRef(null),g=c||p,[m,y]=E.useState(n?"open":"hidden"),{extraPadding:v=!0,hasPointer:b=!1,hasForm:T=!1}=t,{onOpen:_=()=>{},onClose:C=()=>{}}=o,{readToScreenreadersWhenClosed:A=!1,...S}=l,I=J0[f];E.useEffect(()=>{const N=g==null?void 0:g.current;if(N)return N.addEventListener("transitionend",B),()=>{N.removeEventListener("transitionend",B)}},[]),E.useEffect(()=>{if(m!=="open")return;const N=k=>{k.key==="Escape"&&(k.stopPropagation(),k.preventDefault(),y("closed"))};return document.addEventListener("keyup",N),()=>{document.removeEventListener("keyup",N)}},[m]);const B=({propertyName:N})=>{N==="opacity"&&(I!==!1&&clearTimeout(I),y(k=>(k==="open"?_():k==="closed"&&C(),k==="opening"?"open":k==="closing"?"closed":k==="closed"?"hidden":k)))};Hs(()=>{I!==!1&&clearTimeout(I);let N="open";n?y("opening"):(y("closing"),N="hidden"),J0[f||""]=setTimeout(()=>{y(N)},300)},[n]);const F={"aria-live":"polite",...u,...S};s&&s.onBlur&&(F.onBlur=s.onBlur);const R={className:"content"};return A?R.className=ne("content",{hidden:m==="hidden"}):R.hidden=m==="hidden",h.jsx("aside",{ref:g,id:f,className:ne("tooltip text-medium",m,a,{loading:r,"extra-padding":v,"has-pointer":b,bottom:b==="bottom","has-form":T}),...F,children:h.jsx("div",{...R,children:r?h.jsx("p",{children:d.formatMessage({id:"tooltip_loading"})}):typeof i=="string"?h.jsx("p",{children:i}):i})})}),ia=E.memo(Ux);const Fe=({variant:e="primary",size:t="medium",styling:n={muted:!1,fullWidth:!1},icon:r=!1,href:i=!1,element:a="button",onClick:s=!1,className:o="",disabled:l=!1,tooltip:u="",forceTooltip:c=!1,screenreaderText:d=!1,children:f=!1,...p})=>{const m=ra(typeof t=="object"),{showTooltip:y,tooltipProps:v}=Pp(!!u);if(typeof t=="object"&&typeof m=="number"){const C=Object.assign({},t),A=g4(Object.keys(C));t=v4(m,A,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 T={...p,className:ne(e,o,b,{"no-text":!f,disabled:l,button:i,muted:n.muted,"full-width":n.fullWidth}),onClick:C=>{(!i||i[0]==="#")&&s&&(C.preventDefault(),C.stopPropagation()),s&&s(C)},disabled:typeof l=="object"&&"isClickable"in l?!l.isClickable:l};i&&(a="a",T.href=i);const _=E.createElement(a,T,f||(d?h.jsx(ct,{showOnFocus:!1,children:d}):null));return c||l&&u?h.jsxs("span",{className:"button-container",...v,children:[h.jsx(ia,{isOpen:y,accessibility:{readToScreenreadersWhenClosed:!0},children:u}),_]}):_},to=({buttons:e,wrappers:t=[],className:n="",...r})=>{const i=e.length>1?"ul":"p",a=e.map((s,o)=>{var l;return i==="p"?h.jsx(Fe,{...s},o):h.jsx("li",{className:((l=t[o])==null?void 0:l.className)||"",children:h.jsx(Fe,{...s})},o)});return E.createElement(i,{className:ne("button-wrapper",n),...r,children:a})};const Dr=({className:e="",maxWidth:t=!1})=>{const n=t?{"--max-width":`${t/16}rem`}:{};return h.jsx("hr",{className:ne(e,{"has-max-width":t}),style:n})},eg={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"}},zx=({aspect:e,range:t,sizes:n})=>{const{range:r,sizes:i}=e?eg[e]:eg.fallback;return{range:t&&t.length>0?t:r,sizes:n||i}},qx=({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},ld=({format:e,range:t,url:n,query:r})=>t.map(({height:i,width:a})=>`${n}?${qx({format:e,height:i,query:r,width:a})} ${a}w`).join(", ");const aa=({image:e,className:t,testId:n})=>{const{description:r,height:i,type:a,color:s,query:o,url:l,width:u,loading:c,decoding:d,fetchPriority:f}=e,{range:p,sizes:g}=zx(e),m=ld({format:"avif",query:o,range:p,url:l}),y=ld({format:"webp",query:o,range:p,url:l}),v=ld({format:"",query:o,range:p,url:l});let b={};return s&&(b={"--color":s}),a&&a.includes("svg")?h.jsx("picture",{className:t,style:b,children:h.jsx("img",{src:l,alt:r,loading:c||"lazy",decoding:d||"async",fetchpriority:f||"auto",width:u,height:i,"data-testid":n||"image"})}):h.jsxs("picture",{className:t,style:b,children:[a!=="image/gif"&&h.jsx("source",{type:"image/avif",srcSet:m,sizes:g,"data-testid":"source"}),h.jsx("source",{type:"image/webp",srcSet:y,sizes:g,"data-testid":"source"}),h.jsx("img",{srcSet:v,sizes:g,src:l,alt:r,loading:c||"lazy",decoding:d||"async",fetchpriority:f||"auto",width:u,height:i,"data-testid":n||"image"})]})};const Wx=({image:e,className:t="",testId:n})=>h.jsx("div",{className:`image-container ${t}`,"data-testid":n||"image-container",children:e&&h.jsx(aa,{image:{...e},className:"image"})}),sa=({href:e,children:t,fallbackElement:n,meta:r,className:i="",onClick:a,gtmContext:s,gtmType:o,...l})=>{const{forceOnClick:u=!1}=r||{};if(e){const d={...l};return a&&(d.onClick=a),s&&(d["data-gtm-event-context"]=s),o&&(d["data-gtm-event-type"]=o),h.jsx("a",{href:e,className:ne("gtm-trackable",i),...d,children:t})}const c={};return u&&(c.onClick=a),n?E.createElement(n,{children:t,className:i,...l,...c}):h.jsx(h.Fragment,{children:t})};const D4=E.forwardRef(({className:e="",children:t},n)=>{const r=E.useRef(null),i=n||r;return h.jsx("aside",{ref:i,className:ne("popover",e),"aria-live":"polite",children:t})}),no=({parent:e=document.body,children:t})=>typeof document=="object"?Ap.createPortal(t,e):null,Vx=Object.freeze(Object.defineProperty({__proto__:null,default:no},Symbol.toStringTag,{value:"Module"}));const Kx=({currentStep:e=1,steps:t=1})=>h.jsxs(h.Fragment,{children:[h.jsx(ct,{children:h.jsx(ue.FormattedMessage,{id:"progressTracker",values:{current:e,total:t}})}),h.jsx("div",{className:"progress-tracker",children:h.jsx("div",{className:"dots-wrapper",children:new Array(t).fill("").map((n,r)=>{const i=r+1;return h.jsxs("div",{className:"dot-wrapper",children:[h.jsx("div",{className:ne("dot",{active:i===e,completed:i<e}),"data-testid":"progress-dot"}),h.jsx("div",{className:ne("line",{active:i<e})})]},r)})})})]});const Gx=({elementId:e,offset:t=20})=>{const n=ue.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 h.jsx(Fe,{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 Yx=({items:e,className:t="",...n})=>h.jsx("ul",{className:ne("buckets",t),...n,children:e.map(({title:r,text:i,link:a,...s},o)=>h.jsx("li",{className:"bucket text-medium",children:h.jsxs("a",{href:a,...s,children:[h.jsx("p",{className:"title",children:r}),h.jsx("p",{children:i})]})},o))}),tg=300,ng="ease-in-out";class Zx{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:tg,easing:ng}),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:tg,easing:ng}),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 v1=({label:e=!1,className:t="",children:n,shouldAnimate:r=!1})=>{const i=ue.useIntl(),a=E.useRef(null);return E.useEffect(()=>{let s;return r&&(s=new Zx(a.current)),()=>{r&&s&&s.cleanUp()}},[]),h.jsxs("details",{ref:a,className:ne("collapsible-section",t,{"should-animate":r}),children:[h.jsx("summary",{children:e||i.formatMessage({id:"collapsibleSection_summary"})}),h.jsx("div",{className:"content",children:n})]})},rg={cube:"box",graduationCap:"graduation-cap",person:"user",speech:"speech-bubble_round",star:"star_empty_thin"},Qx=e=>{let t=e;return Object.keys(rg).includes(e)&&(t=rg[e]),`url(${Qr}icons/${t}.svg)`};const ig={customCard:"custom",microcourse:"course",courseJourney:"course",solutionArticle:"article",qaQuestion:"question",listPage:"list",learningHub:"learning-hub",communityPage:"communityPage"},O4=({contentType:e,customIcon:t,customLabel:n,className:r=""})=>{const i=ue.useIntl(),a=t?{"--custom-icon":Qx(t)}:{},s=m1(`contentTypeLabel_${e}`)?i.formatMessage({id:`contentTypeLabel_${e}`}):!1;return!n&&!s?null:h.jsx("small",{className:ne("content-type-label text-small",e in ig?ig[e]:e,r,{"has-custom-icon":t}),style:a,"data-testid":"content-type-label",children:n||s})};const Kn=({variant:e="primary",icon:t,styling:n={},className:r="",children:i,...a})=>{const{showHighlight:s=!1,background:o="default"}=n,l=t?{"--icon":`url(${Qr}icons/${t}.svg)`}:{};return h.jsx("div",{className:ne("highlighted-text-box",e,r,{"has-icon":t,"show-highlight":s,[o]:o!=="default"}),style:l,...a,children:i})};const Xr=({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,s=ra(a);if(a&&typeof n=="object"&&typeof s=="number"){const d=Object.assign({},n.breakpoints),f=g4(Object.keys(d));i=v4(s,f,d)}const{breakpoints:o,text:l="",component:u,...c}=n;return h.jsx(Kn,{variant:"subtle",className:ne("empty-state-box",e,r),children:h.jsxs(h.Fragment,{children:[t&&typeof t=="string"?h.jsx(Wr,{options:{forceBlock:!0},children:t}):t,i&&typeof n=="object"&&(u||h.jsx(Fe,{...c,variant:n.variant?n.variant:"secondary",children:l}))]})})};const Ch=({children:e,...t})=>h.jsx("p",{...t,children:e}),N4={q:Ch,blockquote:Ch};for(let e=1;e<=6;e++)N4[`h${e}`]={component:Ch,props:{className:"title"}};const I4=({type:e="default",className:t="",heading:n=!1,children:r,...i})=>h.jsxs("div",{...i,className:ne("helper-text-box text-small",e,t),children:[n&&h.jsx("p",{className:"title",children:n}),typeof r=="string"?h.jsx(Wr,{options:{wrapper:E.Fragment,forceBlock:!0,overrides:N4},children:r}):h.jsx("p",{children:r})]});const P4=({id:e,className:t="",show:n=!1,hide:r=!1,text:i,markdownOptions:a,fadeStyle:s="default",children:o})=>{const l=ue.useIntl(),u=E.useRef(null);e||(e=Date.now().toString());const[c,d]=E.useState(""),[f,p]=E.useState("closed");E.useEffect(()=>{const y=u.current;if(y)return y.addEventListener("transitionend",g),()=>{y.removeEventListener("transitionend",g)}},[]),E.useEffect(()=>{if(!i||typeof i!="string")return;const y=i.split(`
37
37
  `);d(y.length<3?`${i.substring(0,400)}...`:y.slice(0,3).join(`
38
38
  `))},[i]),E.useEffect(()=>{f==="ready-to-close"&&p("closing")},[f]);const g=({propertyName:y})=>{y==="max-height"&&p(v=>v==="opening"?"open":v==="closing"?"closed":v)},m=["opening","open"].includes(f);return h.jsxs(Kn,{variant:"subtle",className:ne("hide-show-text-box",t),children:[h.jsx("div",{ref:u,id:e,className:ne("content",f,s),children:i?h.jsxs(h.Fragment,{children:[h.jsx(Wr,{options:{forceBlock:!0,...a},children:f==="closed"?c:i}),f!=="closed"&&o]}):o}),h.jsx("p",{className:"cta",children:h.jsx(Fe,{variant:"tertiary",icon:{icon:"navigation_arrow",position:"left",animate:!0},styling:{muted:!0},className:ne({"rotate-180":m}),onClick:()=>{p(m?"ready-to-close":"opening")},"aria-expanded":m,"aria-controls":e,children:m?r||l.formatMessage({id:"hideShowTextBox_hide"}):n||l.formatMessage({id:"hideShowTextBox_show"})})})]})};const Xx=({element:e="ul",layout:t="vertical",variant:n="default",items:r=[],styling:i={},className:a=""})=>{const{hasBorder:s=!1,zebraStriping:o=!1}=i;return E.createElement(e,{className:ne("icon-bulleted-list text-medium",n,a,{"has-border":s,"has-zebra-stripes":o,[t]:e!=="dl"}),children:r.map((l,u)=>{const c={wrapper:E.Fragment,forceInline:!0},d={"--icon":`url(${Qr}icons/${l.icon}.svg)`};return e==="dl"?h.jsxs(E.Fragment,{children:[h.jsx("dt",{style:d,children:h.jsx(Wr,{options:c,children:l.dt||""})},`dt-${u}`),h.jsx("dd",{children:typeof l.text=="string"?h.jsx(Wr,{options:c,children:l.text}):l.text},`dd-${u}`)]},`dl-${u}`):h.jsx("li",{style:d,children:typeof l.text=="string"?h.jsx(Wr,{options:c,children:l.text}):l.text},u)})})},an=()=>E.Fragment,Jx=({children:e})=>h.jsx(Kn,{variant:"secondary",children:e}),e7=({children:e})=>typeof e=="object"&&Object.keys(e||{}).length===1?h.jsx("p",{className:"center",children:e}):h.jsx("div",{className:"center",children:e}),t7=["span","strong","h1","h2","h3","h4","h5","h6","p"],n7=({children:e})=>{const t=ue.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 s of E.Children.toArray(a.props.children))if(!(!s||typeof s=="string"||typeof s=="number")&&E.isValidElement(s)){const o=s.type;if(t7.includes(o)){for(n=s.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 h.jsx(v1,{label:i,className:["Sources","Resources"].includes(i)?"discrete-links":"",children:r.map(a=>a)})},r7=({children:e,...t})=>{if(t.class)switch(t.class){case"casestudy":return h.jsx(Kn,{variant:"secondary",children:e});case"general-textbox":case"highlight-box":return h.jsx(Kn,{variant:"primary",children:e});case"pink-textbox":return h.jsx(Kn,{variant:"tertiary",children:e});case"content":return typeof e=="object"&&Object.keys(e||{}).length===1?h.jsx("p",{children:e}):e;default:return h.jsx("div",{...t,children:e})}return h.jsx("div",{...t,children:e})},rr=({children:e})=>h.jsx(h.Fragment,{children:e}),Rp=E.createContext({badges:[],isLoading:!0});function R4(){return E.useContext(Rp)}const F4=({children:e,badges:t})=>h.jsx(Rp.Provider,{value:t,children:e}),B4=({showDevTools:e=!0,children:t})=>{const n=new bt.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!1,staleTime:6e4}}});return h.jsxs(bt.QueryClientProvider,{client:n,children:[t,e&&h.jsx(ox.ReactQueryDevtools,{initialIsOpen:!1})]})};var M4=E.createContext({client:fc});function i7(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&&(fc.__loaded&&console.warn("[PostHog.js] was already loaded elsewhere. This may cause issues."),fc.init(r,i)),fc)},[n,r]);return E.createElement(M4.Provider,{value:{client:a}},t)}var a7=function(){var e=E.useContext(M4).client;return e};function $c(e){var t=a7(),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 L4=({children:e,user:t,disableSessionRecording:n=!1})=>t.isLoading?null:process.env.REACT_APP_PUBLIC_POSTHOG_KEY?h.jsx(i7,{apiKey:atob(process.env.REACT_APP_PUBLIC_POSTHOG_KEY),options:{api_host:"/ph",autocapture:!1,persistence_name:"flags",secure_cookie:!0,ui_host:"eu.posthog.com",bootstrap:{distinctID:t.id||"00000000-0000-0000-0000-000000000000",isIdentifiedID:!!t.id},disable_session_recording:n,session_recording:{maskAllInputs:!0,maskTextSelector:"*",maskTextFn:(r,i)=>(i==null?void 0:i.dataset.phunmask)==="true"?r:"*".repeat((r||"").trim().length)}},children:e}):h.jsx(h.Fragment,{children:e});var $4=(e=>(e.COMMUNITY_RANKING="community-ranking",e))($4||{});const s7={en:dn,es:wx,fr:Ax,pt:Sx,id:kx,"pt-BR":Dx,"es-419":Ox,"sr-Cyrl":Fx,de:Lx,"fr-CA":Mx,ko:Bx,it:Rx,pl:Px,ja:Ix,ar:Nx},j4=({children:e,locale:t,messages:n})=>{const r=t||La.DEFAULT_LOCALE,i={...s7[r],...n||{}};return h.jsx(ue.IntlProvider,{locale:r,messages:i,children:e})},Fp=E.createContext({}),jt=E.createContext({isLoading:!0});function y1(){return E.useContext(jt)}const H4=({children:e,user:t,updateDetails:n})=>h.jsx(jt.Provider,{value:{...t,updateDetails:n},children:e}),Bp=E.createContext({registerOverlay:()=>{},unregisterOverlay:()=>{}}),U4=()=>E.useContext(Bp),z4=({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(s=>[...s,a])},[]),i=E.useCallback(a=>{n(s=>s.filter(o=>o!==a))},[]);return h.jsx(Bp.Provider,{value:{registerOverlay:r,unregisterOverlay:i},children:e})},o7=({bootstrap:e,children:t,intl:n,showDevTools:r})=>{const[i,a]=E.useState({isLoading:!0}),[s,o]=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}),o({badges:f[1],isLoading:!1})):a({...f,isLoading:!1}),w4(5e3)}).catch(f=>{f.message===T4&&window.location.pathname!=="/logout"&&(window.location.href="/logout"),a({isLoading:!1}),o({badges:[],isLoading:!1})})},[]),h.jsx(Fp.Provider,{value:{language:u,updateLanguage:d},children:h.jsx(j4,{locale:u,messages:n==null?void 0:n.messages,children:h.jsx(Sp.CookiesProvider,{children:h.jsx(H4,{user:i,updateDetails:a,children:h.jsx(F4,{badges:s,children:h.jsx(z4,{children:h.jsx(B4,{showDevTools:r,children:h.jsx(L4,{user:i,children:t})})})})})})})})},l7=e=>{const t=ue.useIntl(),n=Date.now().toString(),r=E.useContext(jt);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 s=`content-after-iframe-${n}`;return h.jsxs(h.Fragment,{children:[h.jsx(ct,{element:"a",href:`#${s}`,onClick:o=>{o.preventDefault(),o.stopPropagation();const l=document.getElementById(s);l==null||l.scrollIntoView({behavior:"smooth"}),l==null||l.focus()},children:t.formatMessage({id:`markdown_skip${i==="default"?"":`_${i}`}`})}),h.jsx("iframe",{...e,src:a,title:t.formatMessage({id:`markdown_iframe${i==="default"?"":`_${i}`}`})}),h.jsx("span",{id:s,tabIndex:0})]})},ag=e=>{let t="";return e&&typeof e!="string"&&typeof e!="number"&&typeof e!="boolean"&&"type"in e&&(t=e.type),t},u7=({children:e,...t})=>{const n=ue.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 o of E.Children.toArray(e))if(!(!o||typeof o=="string"||typeof o=="number")&&E.isValidElement(o)){const l=o.type;if(["button","center","span","strong"].includes(l)&&o.props&&o.props.children&&o.props.children[0])for((l==="button"||ag(o.props.children[0])==="button")&&(a=!0),i=o.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&&ag(i)==="button"&&(a=!0);else break}const s=`@${bl}`;return i===s||Array.isArray(i)&&i[0]===s?(delete r.href,delete r.target,h.jsxs("span",{...r,className:"mention deleted-user",children:["@",n.formatMessage({id:"member_deleted"})]})):a?(r={...r,className:"button primary medium"},h.jsx("p",{className:"center",children:h.jsx(Fe,{variant:"primary",size:"medium",...r,children:i})})):h.jsx("a",{...r,children:i})},xh=({children:e,...t})=>h.jsx("span",{className:ne({url:t==null?void 0:t.href}),children:e});const c7={default:{a:u7,CollapsibleSection:v1,TextBox:Kn,CaseStudy:Jx,style:an,details:n7,div:r7,iframe:l7,center:e7,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}},ja=({element:e="div",className:t="",options:n={},children:r,overrideType:i="default",styling:a={}})=>{if(!r)return null;const{highlightTitles:s=!1}=a;r=r.replace(/^<br\/?>/,"");const o={wrapper:E.Fragment,forceBlock:!0};let l=c7[i];return n.overrides&&(l={...l,...n.overrides}),E.createElement(e,{className:ne("markdown-text",t,{"highlight-titles":s}),children:h.jsx(Wr,{options:{...o,...n,overrides:l},children:r})})};const q4=({maxWidth:e=!1,title:t,subtitle:n,children:r,className:i="",ctaButton:a})=>{const s=e?{"--max-width":`${e/16}rem`}:{};return h.jsxs("section",{className:ne("page-heading",i),children:[h.jsxs("div",{className:ne("content",{"has-max-width":e}),style:s,children:[h.jsxs("div",{className:ne("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&&h.jsx(Fe,{...a,className:ne("cta-button","gtm-trackable"),"data-gtm-event-context":"CreateNewArticle","data-gtm-event-type":"create-article-click",children:a.text})]}),r]})};const Vr=({size:e="medium",variant:t="default",className:n="",icon:r,tooltip:i="",children:a,element:s="span",...o})=>{const l={"--icon":`url(${Qr}icons/${r}.svg)`},{showTooltip:u,tooltipProps:c}=Pp(!!i),d={},f=i?typeof i=="string"?`tooltip-${Si(i)}`:i.id:void 0,p=i?typeof i=="string"?i:i.text:void 0;i&&f&&(d["aria-describedby"]=f);const g=E.createElement(i?"button":s,{className:ne("pill",e,t,n,{"has-icon":r}),style:l,children:a,...c,...d,...o});return i?E.createElement(s,{className:"pill-wrapper"},h.jsxs(h.Fragment,{children:[g,h.jsx(ia,{id:f,isOpen:u,children:p})]})):g};const Us=({element:e="p",children:t=null,className:n="",...r})=>E.createElement(e,{...r,className:ne("status-banner text-small",n),"aria-live":"assertive"},t),d7={globe:"globe",heart:"heart_empty_thick",pencil:"pencil",star:"star_empty","speech-bubble":"speech-bubble_round"};const f7=e=>e.toLowerCase().replace(/\s+/g,"-"),W4=({slug:e})=>{const t=ue.useIntl(),n="badgeName",{badges:r}=R4(),i=r==null?void 0:r.find(d=>d.slug===e);if(!i)return null;const{name:a,icon:s,colour:o,description:l}=i,u=f7(a),c=t.formatMessage({id:`${n}_${u}`,defaultMessage:a});return h.jsx(Vr,{className:ne("user-badge",o==null?void 0:o.toLowerCase()),icon:s&&d7[s],element:"li",tooltip:l,children:c})};var pn=(e=>(e.Communities="communities",e.Platform="platform",e))(pn||{});const V4=({userBadges:e,badgeOptions:{scopes:t}})=>{if(Object.keys(e).length===0||!t)return;const n=t.flatMap(r=>{var i;return(i=e==null?void 0:e[r.scope])==null?void 0:i[r.area]}).filter(Boolean);return h.jsx("ul",{className:"badges-list",children:n.map((r,i)=>h.jsx(W4,{slug:r},`${i}-${r}`))})};var Mp=(e=>(e.Accepted="accepted",e.Cancelled="cancelled",e.Declined="declined",e.Pending="pending",e.Removed="removed",e))(Mp||{}),Lp=(e=>(e.In="in",e.Out="out",e))(Lp||{});const{In:h7,Out:sg}=Lp,{Pending:ud,Accepted:og,Cancelled:p7,Removed:m7}=Mp,K4=({functions:e,connection:t={status:null,direction:null},disableConnect:n=!1,meta:{topLevelButton:r=!1}={},...i})=>{const{formatMessage:a}=ue.useIntl(),{status:s,direction:o}=t,{onAccept:l,onCancel:u,onRemove:c,onRequest:d}=e,[f,p]=E.useState(!1),[g,m]=E.useState(s),[y,v]=E.useState(o);E.useEffect(()=>{m(s),v(o)},[s,o]);const b=async(T,_)=>{try{p(!0),await T()&&(_!=null&&_.status&&m(_.status),_!=null&&_.direction&&v(_.direction))}finally{p(!1)}};return g===ud&&y===sg?h.jsx(Fe,{onClick:async()=>{await b(l,{status:og})},disabled:f,variant:r?"primary":"secondary",size:"small",icon:{icon:"user-plus"},...i,children:a({id:"member_connection_accept"})}):g===ud&&y===h7?h.jsxs("div",{className:"connection-cta-wrapper",children:[h.jsx("span",{className:"button secondary connection-cta pending small icon clock left",...i,children:a({id:"member_connection_pending"})}),u&&h.jsx(t1,{options:[{onClick:async()=>{await b(u,{status:p7})},text:a({id:"member_connection_cancel"})}]})]}):g===og?h.jsxs("div",{className:"connection-cta-wrapper",children:[h.jsx("span",{className:"button secondary connection-cta connected small icon tick left",...i,children:a({id:"member_connection_connected"})}),c&&h.jsx(t1,{options:[{onClick:async()=>{await b(c,{status:m7})},text:a({id:"member_connection_remove"})}]})]}):!g&&d&&!n?h.jsx(Fe,{onClick:async()=>{await b(d,{status:ud,direction:sg})},variant:r?"primary":"secondary",size:"small",disabled:f,icon:{icon:"user-plus"},...i,children:a({id:"member_connection_connect"})}):h.jsx(h.Fragment,{})};const g7=({styling:e={},progress:t=0,text:n=!1,className:r=""})=>{const i=ue.useIntl(),{showText:a=!1,layout:s="bar",size:o="default",color:l="default"}=e,u=t>75?100:t>50?75:t>25?50:t>5?25:0,c={"--progress":`${t}%`};return h.jsx("span",{className:ne(`progress-bar section-${u}`,s,r,{[o]:o!=="default",[l!=="default"?l:""]:l!=="default"}),style:c,children:E.createElement(a?"span":ct,{className:a?"text":"",children:n||i.formatMessage({id:"progressBar"},{number:t})})})},$p=E.memo(g7);const cd="loadingBlock_",v7=({progress:e=0,steps:t=!1,className:n=""})=>{const r=ue.useIntl();t||(t={0:{text:r.formatMessage({id:`${cd}loading`})},75:{text:r.formatMessage({id:`${cd}almostDone`})},100:{text:r.formatMessage({id:`${cd}complete`})}});let i=null;const a=Object.keys(t);for(let o=0;o<a.length&&!(e<parseInt(a[o]));o++)i=a[o];const s=i&&t[i].icon?{"--icon":`url(${Qr}icons/${t[i].icon}.svg)`}:{};return h.jsxs(Kn,{className:ne("loading-block",n,{"has-icon":i&&t[i].icon}),variant:"subtle",style:s,children:[i&&h.jsx("span",{className:"step",children:t[i].text}),h.jsx($p,{progress:e})]})},G4=E.memo(v7);const pr=({element:e="div",className:t="",...n})=>h.jsx(p1,{element:e,className:ne("loading-placeholder",t),...n});const wh={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"]},Y4=(e,t)=>e in wh?h.jsx("div",{className:e,children:wh[e].map((n,r)=>Y4(n,r))},t):h.jsx(pr,{className:e},t),E1=({layout:e="overview-page",...t})=>h.jsx("div",{className:ne("loading-state",e),...t,children:wh[e].map((n,r)=>Y4(n,r))}),Z4=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):""},su=["#5AB6A3","#A2D7AF","#806056","#3962B3"],y7=e=>{const t=Math.ceil(26/su.length),n=Z4(e).toLowerCase();if(n==="")return su[0];const r=n.charCodeAt(0)-96;for(let i=0;i<su.length;i++)if(r<=t*(i+1))return su[i]};const lg=256,ki=({className:e="",src:t="",name:n,alt:r,width:i=lg,height:a=lg,showInitials:s=!0,...o})=>{const[l,u]=E.useState(!1),c=E.useRef(null),d=r??n;E.useEffect(()=>{const p=c.current;if(!p)return;const g=p.getContext("2d");if(!g)return;const m=i,y=a;typeof window<"u"&&window.devicePixelRatio&&(p.width=m*window.devicePixelRatio,p.height=y*window.devicePixelRatio,g.scale(window.devicePixelRatio,window.devicePixelRatio)),g.fillStyle=y7(n),g.fillRect(0,0,m,y),g.font=`${m/3}px Arial`,g.textAlign="center",g.fillStyle="white",g.fillText(Z4(n),m/2,y/1.6)},[n]);let f=!1;return t&&t!==""&&!l&&(t.includes("http")||t.includes("//"))&&(f=!0),h.jsx("figure",{className:ne("profile-picture","ph-no-capture",e,{error:l}),...o,children:f?h.jsx("img",{src:t,alt:d,onError:()=>{u(!0)},width:i,height:a}):s?h.jsx("canvas",{ref:c}):h.jsx("span",{className:"fallback"})})};var Jt=(e=>(e.DISCUSSION_FORM_SUBMITTED="discussionFormSubmitted",e.DISCUSSION_POST_ADDED="discussionPostAdded",e.DISCUSSION_POST_CLICKED="discussionPostClicked",e.MEMBER_CLICKED="memberClicked",e))(Jt||{});const b1=e=>e==="apolitical"?{image:`${Qr}logos/member_apolitical.svg`}:e==="community"||e==="deleted"||typeof e=="object"&&!e.name?{image:`${Qr}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},E7=({role:e="",organisation:t="",country:n="",maximumCharacters:r=80})=>{const i=e!=="",a=t!=="",s=n!=="";if(!i&&!a&&!s)return"";const o=`${e}${i&&a?` — ${t}`:t}`;let l=`${o}${(i||a)&&s?`, ${n}`:n}`;return l.length>r&&(l=o),l.length>r&&(l=yl(l,r)),l};const b7=E.lazy(()=>Promise.resolve().then(()=>Vx)),T7=E.lazy(()=>Promise.resolve().then(()=>Sie));let ou=null;const Ti=({element:e="div",member:t="community",alt:n="",additionalContent:r=!1,styling:i={},functions:a={},gtmContext:s="member",gtmType:o="member-click",className:l="",badges:u,connection:c,...d})=>{var z,P,te,ee,D,x;const f=ue.useIntl(),{profile:p,connections:g,...m}=a,{size:y="medium",variant:v="inline",isCondensed:b=!0,additionalContentNewLine:T=!1}=i,_=E.useContext(jt),C=p&&_&&typeof _.id=="string",[A,S]=E.useState(!1),I=b1(t);I.name||(I.name=f.formatMessage({id:`member_${typeof t=="string"?t:"community"}`}));const{name:B,image:F}=I;let{url:R}=I;typeof t=="object"&&t.link!==void 0&&(t.link===!1?R=void 0:R=t.link);const N=E7(I),k=r&&r.createdAt?Th(r.createdAt):!1,M=r&&r.createdAt?Op(r.createdAt):"",$=!R&&C;return E.createElement(e,{...d,className:ne("member text-medium",y,v,l,{"has-profile-link":C}),...m,children:h.jsxs(h.Fragment,{children:[h.jsxs(sa,{href:R,className:ne({"details-wrapper":$}),fallbackElement:$?"div":void 0,gtmType:o,gtmContext:s,meta:{forceOnClick:!0},onClick:V=>{if(V==null||V.preventDefault(),V==null||V.stopPropagation(),!R){$&&S(!0);return}ou&&clearTimeout(ou),ou=setTimeout(()=>{window.location.href=R},150);const L=new CustomEvent(Jt.MEMBER_CLICKED,{detail:{link:R,timeout:ou}});document.dispatchEvent(L)},children:[h.jsx(ki,{name:B,src:F,alt:n}),h.jsxs("div",{className:"details",children:[h.jsxs("div",{className:ne("name",{"new-line":T}),"data-testid":"member-name",children:[h.jsx("span",{children:B}),(u==null?void 0:u.showBadges)&&(I==null?void 0:I.badges)&&h.jsx(V4,{userBadges:I.badges,badgeOptions:u}),r&&h.jsxs("span",{className:ne("additional-content",{"new-line":T}),children:[r.createdAt&&k&&!((z=r==null?void 0:r.customMessage)!=null&&z.text)&&h.jsx("span",{className:"date",title:M,"aria-label":M,"data-testid":"date",children:f.formatMessage({id:`dates_${k.path}`},{number:k.number})}),r.createdAt&&k&&((P=r==null?void 0:r.customMessage)==null?void 0:P.text)&&h.jsx("span",{children:f.formatMessage({id:k.path==="now"?(te=r.customMessage)==null?void 0:te.nowText:(ee=r.customMessage)==null?void 0:ee.text},{time:f.formatMessage({id:`dates_${k.path}`},{number:k.number}),community:(x=(D=r.customMessage)==null?void 0:D.link)==null?void 0:x.text,link:V=>{var L,H;return h.jsx("a",{href:`${(H=(L=r.customMessage)==null?void 0:L.link)==null?void 0:H.url}`,onClick:j=>j.stopPropagation(),children:V})}})}),r.didEdit&&h.jsx("em",{children:f.formatMessage({id:"discussion_edited"})})]})]}),N&&!T&&h.jsx("small",{className:ne({"text-medium":y==="large"}),"data-testid":"member-details",children:b?N:h.jsxs(h.Fragment,{children:[I.role,I.organisation?` — ${I.organisation}`:h.jsx(h.Fragment,{}),h.jsx("span",{className:"location",children:I.country})]})})]})]}),g&&h.jsx(K4,{connection:c,functions:g}),N&&p&&C?h.jsxs(h.Fragment,{children:[h.jsx(Fe,{variant:"tertiary",size:"small",onClick:V=>{V.preventDefault(),V.stopPropagation(),S(!0)},"data-testid":"profile-button",children:f.formatMessage({id:"member_profile"})}),h.jsx(b7,{children:h.jsx(T7,{form:p,showModal:A,content:{title:f.formatMessage({id:"member_profile"})},functions:{onClose:()=>{S(!1)}},className:"in-portal"})})]}):h.jsx(h.Fragment,{})]})})},_7=Object.freeze(Object.defineProperty({__proto__:null,default:Ti},Symbol.toStringTag,{value:"Module"}));const ug={small:24,medium:48},jp=({element:e="div",contributors:{total:t,data:n}={total:void 0,data:[]},styling:{showText:r,size:i,showGap:a,showPlaceholders:s}={showText:!0,size:"medium",showGap:!0,showPlaceholders:!1},cutoff:o=2,multipleText:l,className:u="",...c})=>{const d=ue.useIntl();return!n||n.length===0?null:E.createElement(e,{...c,className:ne("contributors",u,i,{"has-gap":a}),children:h.jsxs(h.Fragment,{children:[h.jsx("ul",{children:n.map((f,p)=>{let g,m="";if(p<o){const{name:y="",image:v=""}=b1(f);if(s)return h.jsx(pr,{element:"li",className:"contributor"},p);g=h.jsx(ki,{name:y,src:v,width:ug[i||"medium"],height:ug[i||"medium"]})}else if(p===o){const y=(t||n.length)-o;g=h.jsxs("small",{className:ne({"large-number":y>99}),children:["+",$x(y,0)]}),m="number-left"}return g?h.jsx("li",{className:ne("contributor",m),children:g},p):null})}),r&&h.jsx("span",{className:"label",children:typeof r=="string"?r:n.length===1?typeof n[0]=="string"?d.formatMessage({id:`member_${n[0]}`}):yl(n[0].name||"",20):l||null})]})})};const Hp=({element:e="section",children:t,className:n,variant:r,additionalContent:i,...a})=>{let s=typeof t=="string"?h.jsx("p",{children:t}):t;return i&&(s=h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"modal-content",children:typeof t=="string"?h.jsx("p",{children:t}):t}),h.jsx("div",{className:"modal-additional-content",children:typeof i=="string"?h.jsx("p",{children:i}):i})]})),E.createElement(e,{className:ne("modal",n,{"success-section":r==="success"}),children:s,...a})};var Ah={exports:{}},lu={exports:{}},_t={};/** @license React v16.13.1
39
39
  * react-is.production.min.js
@@ -60,7 +60,7 @@ Valid keys: `+JSON.stringify(Object.keys(D),null," "));var oe=ae(Q,W,H,j,U+"."+
60
60
  */var J4=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],jc=J4.join(","),eb=typeof Element>"u",Ha=eb?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Hc=!eb&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},Uc=function e(t,n){var r;n===void 0&&(n=!0);var i=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),a=i===""||i==="true",s=a||n&&t&&e(t.parentNode);return s},N7=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},tb=function(t,n,r){if(Uc(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(jc));return n&&Ha.call(t,jc)&&i.unshift(t),i=i.filter(r),i},nb=function e(t,n,r){for(var i=[],a=Array.from(t);a.length;){var s=a.shift();if(!Uc(s,!1))if(s.tagName==="SLOT"){var o=s.assignedElements(),l=o.length?o:s.children,u=e(l,!0,r);r.flatten?i.push.apply(i,u):i.push({scopeParent:s,candidates:u})}else{var c=Ha.call(s,jc);c&&r.filter(s)&&(n||!t.includes(s))&&i.push(s);var d=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),f=!Uc(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(d&&f){var p=e(d===!0?s.children:d.children,!0,r);r.flatten?i.push.apply(i,p):i.push({scopeParent:s,candidates:p})}else a.unshift.apply(a,s.children)}}return i},rb=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Zi=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||N7(t))&&!rb(t)?0:t.tabIndex},I7=function(t,n){var r=Zi(t);return r<0&&n&&!rb(t)?0:r},P7=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},ib=function(t){return t.tagName==="INPUT"},R7=function(t){return ib(t)&&t.type==="hidden"},F7=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},B7=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},M7=function(t){if(!t.name)return!0;var n=t.form||Hc(t),r=function(o){return n.querySelectorAll('input[type="radio"][name="'+o+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=r(window.CSS.escape(t.name));else try{i=r(t.name)}catch(s){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",s.message),!1}var a=B7(i,t.form);return!a||a===t},L7=function(t){return ib(t)&&t.type==="radio"},$7=function(t){return L7(t)&&!M7(t)},j7=function(t){var n,r=t&&Hc(t),i=(n=r)===null||n===void 0?void 0:n.host,a=!1;if(r&&r!==t){var s,o,l;for(a=!!((s=i)!==null&&s!==void 0&&(o=s.ownerDocument)!==null&&o!==void 0&&o.contains(i)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!a&&i;){var u,c,d;r=Hc(i),i=(u=r)===null||u===void 0?void 0:u.host,a=!!((c=i)!==null&&c!==void 0&&(d=c.ownerDocument)!==null&&d!==void 0&&d.contains(i))}}return a},Eg=function(t){var n=t.getBoundingClientRect(),r=n.width,i=n.height;return r===0&&i===0},H7=function(t,n){var r=n.displayCheck,i=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var a=Ha.call(t,"details>summary:first-of-type"),s=a?t.parentElement:t;if(Ha.call(s,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof i=="function"){for(var o=t;t;){var l=t.parentElement,u=Hc(t);if(l&&!l.shadowRoot&&i(l)===!0)return Eg(t);t.assignedSlot?t=t.assignedSlot:!l&&u!==t.ownerDocument?t=u.host:t=l}t=o}if(j7(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Eg(t);return!1},U7=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var i=n.children.item(r);if(i.tagName==="LEGEND")return Ha.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},zc=function(t,n){return!(n.disabled||Uc(n)||R7(n)||H7(n,t)||F7(n)||U7(n))},Sh=function(t,n){return!($7(n)||Zi(n)<0||!zc(t,n))},z7=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},q7=function e(t){var n=[],r=[];return t.forEach(function(i,a){var s=!!i.scopeParent,o=s?i.scopeParent:i,l=I7(o,s),u=s?e(i.candidates):o;l===0?s?n.push.apply(n,u):n.push(o):r.push({documentOrder:a,tabIndex:l,item:i,isScope:s,content:u})}),r.sort(P7).reduce(function(i,a){return a.isScope?i.push.apply(i,a.content):i.push(a.content),i},[]).concat(n)},ab=function(t,n){n=n||{};var r;return n.getShadowRoot?r=nb([t],n.includeContainer,{filter:Sh.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:z7}):r=tb(t,n.includeContainer,Sh.bind(null,n)),q7(r)},sb=function(t,n){n=n||{};var r;return n.getShadowRoot?r=nb([t],n.includeContainer,{filter:zc.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=tb(t,n.includeContainer,zc.bind(null,n)),r},Aa=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Ha.call(t,jc)===!1?!1:Sh(n,t)},W7=J4.concat("iframe").join(","),pc=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Ha.call(t,W7)===!1?!1:zc(n,t)};const V7=Object.freeze(Object.defineProperty({__proto__:null,focusable:sb,getTabIndex:Zi,isFocusable:pc,isTabbable:Aa,tabbable:ab},Symbol.toStringTag,{value:"Module"}));/*!
61
61
  * focus-trap 7.5.4
62
62
  * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
63
- */function bg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Tg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bg(Object(n),!0).forEach(function(r){K7(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bg(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function K7(e,t,n){return t=Y7(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function G7(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Y7(e){var t=G7(e,"string");return typeof t=="symbol"?t:String(t)}var _g={activateTrap:function(t,n){if(t.length>0){var r=t[t.length-1];r!==n&&r.pause()}var i=t.indexOf(n);i===-1||t.splice(i,1),t.push(n)},deactivateTrap:function(t,n){var r=t.indexOf(n);r!==-1&&t.splice(r,1),t.length>0&&t[t.length-1].unpause()}},Z7=function(t){return t.tagName&&t.tagName.toLowerCase()==="input"&&typeof t.select=="function"},Q7=function(t){return(t==null?void 0:t.key)==="Escape"||(t==null?void 0:t.key)==="Esc"||(t==null?void 0:t.keyCode)===27},Xo=function(t){return(t==null?void 0:t.key)==="Tab"||(t==null?void 0:t.keyCode)===9},X7=function(t){return Xo(t)&&!t.shiftKey},J7=function(t){return Xo(t)&&t.shiftKey},Cg=function(t){return setTimeout(t,0)},xg=function(t,n){var r=-1;return t.every(function(i,a){return n(i)?(r=a,!1):!0}),r},Eo=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return typeof t=="function"?t.apply(void 0,r):t},uu=function(t){return t.target.shadowRoot&&typeof t.composedPath=="function"?t.composedPath()[0]:t.target},e6=[],t6=function(t,n){var r=(n==null?void 0:n.document)||document,i=(n==null?void 0:n.trapStack)||e6,a=Tg({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:X7,isKeyBackward:J7},n),s={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},o,l=function(N,k,M){return N&&N[k]!==void 0?N[k]:a[M||k]},u=function(N,k){var M=typeof(k==null?void 0:k.composedPath)=="function"?k.composedPath():void 0;return s.containerGroups.findIndex(function($){var z=$.container,P=$.tabbableNodes;return z.contains(N)||(M==null?void 0:M.includes(z))||P.find(function(te){return te===N})})},c=function(N){var k=a[N];if(typeof k=="function"){for(var M=arguments.length,$=new Array(M>1?M-1:0),z=1;z<M;z++)$[z-1]=arguments[z];k=k.apply(void 0,$)}if(k===!0&&(k=void 0),!k){if(k===void 0||k===!1)return k;throw new Error("`".concat(N,"` was specified but was not a node, or did not return a node"))}var P=k;if(typeof k=="string"&&(P=r.querySelector(k),!P))throw new Error("`".concat(N,"` as selector refers to no known node"));return P},d=function(){var N=c("initialFocus");if(N===!1)return!1;if(N===void 0||!pc(N,a.tabbableOptions))if(u(r.activeElement)>=0)N=r.activeElement;else{var k=s.tabbableGroups[0],M=k&&k.firstTabbableNode;N=M||c("fallbackFocus")}if(!N)throw new Error("Your focus-trap needs to have at least one focusable element");return N},f=function(){if(s.containerGroups=s.containers.map(function(N){var k=ab(N,a.tabbableOptions),M=sb(N,a.tabbableOptions),$=k.length>0?k[0]:void 0,z=k.length>0?k[k.length-1]:void 0,P=M.find(function(D){return Aa(D)}),te=M.slice().reverse().find(function(D){return Aa(D)}),ee=!!k.find(function(D){return Zi(D)>0});return{container:N,tabbableNodes:k,focusableNodes:M,posTabIndexesFound:ee,firstTabbableNode:$,lastTabbableNode:z,firstDomTabbableNode:P,lastDomTabbableNode:te,nextTabbableNode:function(x){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,L=k.indexOf(x);return L<0?V?M.slice(M.indexOf(x)+1).find(function(H){return Aa(H)}):M.slice(0,M.indexOf(x)).reverse().find(function(H){return Aa(H)}):k[L+(V?1:-1)]}}}),s.tabbableGroups=s.containerGroups.filter(function(N){return N.tabbableNodes.length>0}),s.tabbableGroups.length<=0&&!c("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(s.containerGroups.find(function(N){return N.posTabIndexesFound})&&s.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},p=function R(N){var k=N.activeElement;if(k)return k.shadowRoot&&k.shadowRoot.activeElement!==null?R(k.shadowRoot):k},g=function R(N){if(N!==!1&&N!==p(document)){if(!N||!N.focus){R(d());return}N.focus({preventScroll:!!a.preventScroll}),s.mostRecentlyFocusedNode=N,Z7(N)&&N.select()}},m=function(N){var k=c("setReturnFocus",N);return k||(k===!1?!1:N)},y=function(N){var k=N.target,M=N.event,$=N.isBackward,z=$===void 0?!1:$;k=k||uu(M),f();var P=null;if(s.tabbableGroups.length>0){var te=u(k,M),ee=te>=0?s.containerGroups[te]:void 0;if(te<0)z?P=s.tabbableGroups[s.tabbableGroups.length-1].lastTabbableNode:P=s.tabbableGroups[0].firstTabbableNode;else if(z){var D=xg(s.tabbableGroups,function(U){var Q=U.firstTabbableNode;return k===Q});if(D<0&&(ee.container===k||pc(k,a.tabbableOptions)&&!Aa(k,a.tabbableOptions)&&!ee.nextTabbableNode(k,!1))&&(D=te),D>=0){var x=D===0?s.tabbableGroups.length-1:D-1,V=s.tabbableGroups[x];P=Zi(k)>=0?V.lastTabbableNode:V.lastDomTabbableNode}else Xo(M)||(P=ee.nextTabbableNode(k,!1))}else{var L=xg(s.tabbableGroups,function(U){var Q=U.lastTabbableNode;return k===Q});if(L<0&&(ee.container===k||pc(k,a.tabbableOptions)&&!Aa(k,a.tabbableOptions)&&!ee.nextTabbableNode(k))&&(L=te),L>=0){var H=L===s.tabbableGroups.length-1?0:L+1,j=s.tabbableGroups[H];P=Zi(k)>=0?j.firstTabbableNode:j.firstDomTabbableNode}else Xo(M)||(P=ee.nextTabbableNode(k))}}else P=c("fallbackFocus");return P},v=function(N){var k=uu(N);if(!(u(k,N)>=0)){if(Eo(a.clickOutsideDeactivates,N)){o.deactivate({returnFocus:a.returnFocusOnDeactivate});return}Eo(a.allowOutsideClick,N)||N.preventDefault()}},b=function(N){var k=uu(N),M=u(k,N)>=0;if(M||k instanceof Document)M&&(s.mostRecentlyFocusedNode=k);else{N.stopImmediatePropagation();var $,z=!0;if(s.mostRecentlyFocusedNode)if(Zi(s.mostRecentlyFocusedNode)>0){var P=u(s.mostRecentlyFocusedNode),te=s.containerGroups[P].tabbableNodes;if(te.length>0){var ee=te.findIndex(function(D){return D===s.mostRecentlyFocusedNode});ee>=0&&(a.isKeyForward(s.recentNavEvent)?ee+1<te.length&&($=te[ee+1],z=!1):ee-1>=0&&($=te[ee-1],z=!1))}}else s.containerGroups.some(function(D){return D.tabbableNodes.some(function(x){return Zi(x)>0})})||(z=!1);else z=!1;z&&($=y({target:s.mostRecentlyFocusedNode,isBackward:a.isKeyBackward(s.recentNavEvent)})),g($||s.mostRecentlyFocusedNode||d())}s.recentNavEvent=void 0},T=function(N){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;s.recentNavEvent=N;var M=y({event:N,isBackward:k});M&&(Xo(N)&&N.preventDefault(),g(M))},_=function(N){if(Q7(N)&&Eo(a.escapeDeactivates,N)!==!1){N.preventDefault(),o.deactivate();return}(a.isKeyForward(N)||a.isKeyBackward(N))&&T(N,a.isKeyBackward(N))},C=function(N){var k=uu(N);u(k,N)>=0||Eo(a.clickOutsideDeactivates,N)||Eo(a.allowOutsideClick,N)||(N.preventDefault(),N.stopImmediatePropagation())},A=function(){if(s.active)return _g.activateTrap(i,o),s.delayInitialFocusTimer=a.delayInitialFocus?Cg(function(){g(d())}):g(d()),r.addEventListener("focusin",b,!0),r.addEventListener("mousedown",v,{capture:!0,passive:!1}),r.addEventListener("touchstart",v,{capture:!0,passive:!1}),r.addEventListener("click",C,{capture:!0,passive:!1}),r.addEventListener("keydown",_,{capture:!0,passive:!1}),o},S=function(){if(s.active)return r.removeEventListener("focusin",b,!0),r.removeEventListener("mousedown",v,!0),r.removeEventListener("touchstart",v,!0),r.removeEventListener("click",C,!0),r.removeEventListener("keydown",_,!0),o},I=function(N){var k=N.some(function(M){var $=Array.from(M.removedNodes);return $.some(function(z){return z===s.mostRecentlyFocusedNode})});k&&g(d())},B=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(I):void 0,F=function(){B&&(B.disconnect(),s.active&&!s.paused&&s.containers.map(function(N){B.observe(N,{subtree:!0,childList:!0})}))};return o={get active(){return s.active},get paused(){return s.paused},activate:function(N){if(s.active)return this;var k=l(N,"onActivate"),M=l(N,"onPostActivate"),$=l(N,"checkCanFocusTrap");$||f(),s.active=!0,s.paused=!1,s.nodeFocusedBeforeActivation=r.activeElement,k==null||k();var z=function(){$&&f(),A(),F(),M==null||M()};return $?($(s.containers.concat()).then(z,z),this):(z(),this)},deactivate:function(N){if(!s.active)return this;var k=Tg({onDeactivate:a.onDeactivate,onPostDeactivate:a.onPostDeactivate,checkCanReturnFocus:a.checkCanReturnFocus},N);clearTimeout(s.delayInitialFocusTimer),s.delayInitialFocusTimer=void 0,S(),s.active=!1,s.paused=!1,F(),_g.deactivateTrap(i,o);var M=l(k,"onDeactivate"),$=l(k,"onPostDeactivate"),z=l(k,"checkCanReturnFocus"),P=l(k,"returnFocus","returnFocusOnDeactivate");M==null||M();var te=function(){Cg(function(){P&&g(m(s.nodeFocusedBeforeActivation)),$==null||$()})};return P&&z?(z(m(s.nodeFocusedBeforeActivation)).then(te,te),this):(te(),this)},pause:function(N){if(s.paused||!s.active)return this;var k=l(N,"onPause"),M=l(N,"onPostPause");return s.paused=!0,k==null||k(),S(),F(),M==null||M(),this},unpause:function(N){if(!s.paused||!s.active)return this;var k=l(N,"onUnpause"),M=l(N,"onPostUnpause");return s.paused=!1,k==null||k(),f(),A(),F(),M==null||M(),this},updateContainerElements:function(N){var k=[].concat(N).filter(Boolean);return s.containers=k.map(function(M){return typeof M=="string"?r.querySelector(M):M}),s.active&&f(),F(),this}},o.updateContainerElements(t),o};const n6=Object.freeze(Object.defineProperty({__proto__:null,createFocusTrap:t6},Symbol.toStringTag,{value:"Module"})),r6=d4(n6),i6=d4(V7);function zs(e){"@babel/helpers - typeof";return zs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zs(e)}function a6(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wg(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ob(r.key),r)}}function s6(e,t,n){return t&&wg(e.prototype,t),n&&wg(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function o6(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&kh(e,t)}function kh(e,t){return kh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},kh(e,t)}function l6(e){var t=c6();return function(){var r=qc(e),i;if(t){var a=qc(this).constructor;i=Reflect.construct(r,arguments,a)}else i=r.apply(this,arguments);return u6(this,i)}}function u6(e,t){if(t&&(zs(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return qo(e)}function qo(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function c6(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function qc(e){return qc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},qc(e)}function d6(e,t,n){return t=ob(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ob(e){var t=f6(e,"string");return zs(t)==="symbol"?t:String(t)}function f6(e,t){if(zs(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(zs(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var cu=E,Le=X4,h6=r6,p6=h6.createFocusTrap,m6=i6,g6=m6.isFocusable,qp=function(e){o6(n,e);var t=l6(n);function n(r){var i;a6(this,n),i=t.call(this,r),d6(qo(i),"getNodeForOption",function(o){var l,u=(l=this.internalOptions[o])!==null&&l!==void 0?l:this.originalOptions[o];if(typeof u=="function"){for(var c=arguments.length,d=new Array(c>1?c-1:0),f=1;f<c;f++)d[f-1]=arguments[f];u=u.apply(void 0,d)}if(u===!0&&(u=void 0),!u){if(u===void 0||u===!1)return u;throw new Error("`".concat(o,"` was specified but was not a node, or did not return a node"))}var p=u;if(typeof u=="string"){var g;if(p=(g=this.getDocument())===null||g===void 0?void 0:g.querySelector(u),!p)throw new Error("`".concat(o,"` as selector refers to no known node"))}return p}),i.handleDeactivate=i.handleDeactivate.bind(qo(i)),i.handlePostDeactivate=i.handlePostDeactivate.bind(qo(i)),i.handleClickOutsideDeactivates=i.handleClickOutsideDeactivates.bind(qo(i)),i.internalOptions={returnFocusOnDeactivate:!1,checkCanReturnFocus:null,onDeactivate:i.handleDeactivate,onPostDeactivate:i.handlePostDeactivate,clickOutsideDeactivates:i.handleClickOutsideDeactivates},i.originalOptions={returnFocusOnDeactivate:!0,onDeactivate:null,onPostDeactivate:null,checkCanReturnFocus:null,clickOutsideDeactivates:!1};var a=r.focusTrapOptions;for(var s in a)if(Object.prototype.hasOwnProperty.call(a,s)){if(s==="returnFocusOnDeactivate"||s==="onDeactivate"||s==="onPostDeactivate"||s==="checkCanReturnFocus"||s==="clickOutsideDeactivates"){i.originalOptions[s]=a[s];continue}i.internalOptions[s]=a[s]}return i.outsideClick=null,i.focusTrapElements=r.containerElements||[],i.updatePreviousElement(),i}return s6(n,[{key:"getDocument",value:function(){return this.props.focusTrapOptions.document||(typeof document<"u"?document:void 0)}},{key:"getReturnFocusNode",value:function(){var i=this.getNodeForOption("setReturnFocus",this.previouslyFocusedElement);return i||(i===!1?!1:this.previouslyFocusedElement)}},{key:"updatePreviousElement",value:function(){var i=this.getDocument();i&&(this.previouslyFocusedElement=i.activeElement)}},{key:"deactivateTrap",value:function(){!this.focusTrap||!this.focusTrap.active||this.focusTrap.deactivate({returnFocus:!1,checkCanReturnFocus:null,onDeactivate:this.originalOptions.onDeactivate})}},{key:"handleClickOutsideDeactivates",value:function(i){var a=typeof this.originalOptions.clickOutsideDeactivates=="function"?this.originalOptions.clickOutsideDeactivates.call(null,i):this.originalOptions.clickOutsideDeactivates;return a&&(this.outsideClick={target:i.target,allowDeactivation:a}),a}},{key:"handleDeactivate",value:function(){this.originalOptions.onDeactivate&&this.originalOptions.onDeactivate.call(null),this.deactivateTrap()}},{key:"handlePostDeactivate",value:function(){var i=this,a=function(){var o=i.getReturnFocusNode(),l=!!(i.originalOptions.returnFocusOnDeactivate&&o!==null&&o!==void 0&&o.focus&&(!i.outsideClick||i.outsideClick.allowDeactivation&&!g6(i.outsideClick.target,i.internalOptions.tabbableOptions))),u=i.internalOptions.preventScroll,c=u===void 0?!1:u;l&&o.focus({preventScroll:c}),i.originalOptions.onPostDeactivate&&i.originalOptions.onPostDeactivate.call(null),i.outsideClick=null};this.originalOptions.checkCanReturnFocus?this.originalOptions.checkCanReturnFocus.call(null,this.getReturnFocusNode()).then(a,a):a()}},{key:"setupFocusTrap",value:function(){if(this.focusTrap)this.props.active&&!this.focusTrap.active&&(this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause());else{var i=this.focusTrapElements.some(Boolean);i&&(this.focusTrap=this.props._createFocusTrap(this.focusTrapElements,this.internalOptions),this.props.active&&this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause())}}},{key:"componentDidMount",value:function(){this.props.active&&this.setupFocusTrap()}},{key:"componentDidUpdate",value:function(i){if(this.focusTrap){i.containerElements!==this.props.containerElements&&this.focusTrap.updateContainerElements(this.props.containerElements);var a=!i.active&&this.props.active,s=i.active&&!this.props.active,o=!i.paused&&this.props.paused,l=i.paused&&!this.props.paused;if(a&&(this.updatePreviousElement(),this.focusTrap.activate()),s){this.deactivateTrap();return}o&&this.focusTrap.pause(),l&&this.focusTrap.unpause()}else i.containerElements!==this.props.containerElements&&(this.focusTrapElements=this.props.containerElements),this.props.active&&(this.updatePreviousElement(),this.setupFocusTrap())}},{key:"componentWillUnmount",value:function(){this.deactivateTrap()}},{key:"render",value:function(){var i=this,a=this.props.children?cu.Children.only(this.props.children):void 0;if(a){if(a.type&&a.type===cu.Fragment)throw new Error("A focus-trap cannot use a Fragment as its child container. Try replacing it with a <div> element.");var s=function(u){var c=i.props.containerElements;a&&(typeof a.ref=="function"?a.ref(u):a.ref&&(a.ref.current=u)),i.focusTrapElements=c||[u]},o=cu.cloneElement(a,{ref:s});return o}return null}}]),n}(cu.Component),bo=typeof Element>"u"?Function:Element;qp.propTypes={active:Le.bool,paused:Le.bool,focusTrapOptions:Le.shape({document:Le.object,onActivate:Le.func,onPostActivate:Le.func,checkCanFocusTrap:Le.func,onPause:Le.func,onPostPause:Le.func,onUnpause:Le.func,onPostUnpause:Le.func,onDeactivate:Le.func,onPostDeactivate:Le.func,checkCanReturnFocus:Le.func,initialFocus:Le.oneOfType([Le.instanceOf(bo),Le.string,Le.bool,Le.func]),fallbackFocus:Le.oneOfType([Le.instanceOf(bo),Le.string,Le.func]),escapeDeactivates:Le.oneOfType([Le.bool,Le.func]),clickOutsideDeactivates:Le.oneOfType([Le.bool,Le.func]),returnFocusOnDeactivate:Le.bool,setReturnFocus:Le.oneOfType([Le.instanceOf(bo),Le.string,Le.bool,Le.func]),allowOutsideClick:Le.oneOfType([Le.bool,Le.func]),preventScroll:Le.bool,tabbableOptions:Le.shape({displayCheck:Le.oneOf(["full","legacy-full","non-zero-area","none"]),getShadowRoot:Le.oneOfType([Le.bool,Le.func])}),trapStack:Le.array,isKeyForward:Le.func,isKeyBackward:Le.func}),containerElements:Le.arrayOf(Le.instanceOf(bo)),children:Le.oneOfType([Le.element,Le.instanceOf(bo)])};qp.defaultProps={active:!0,paused:!1,focusTrapOptions:{},_createFocusTrap:p6};var v6=qp;const y6=Or(v6);const Di=({id:e="content-overlay",isOpen:t=!1,showDivider:n=!0,maxWidth:r,functions:{onOpen:i=()=>{},onClose:a=()=>{}}={},forceShow:{error:s=!1}={},title:o,children:l,buttons:u,className:c="",gtmContext:d="Modal",withFocusTrap:f=!0})=>{const p=ue.useIntl(),{registerOverlay:g,unregisterOverlay:m}=U4(),[y,v]=E.useState(t),[b,T]=E.useState(null),_=E.useRef(null),C=F=>{y&&F.key==="Escape"&&I(!1)},A=F=>{T(F.target)},S=F=>{b===_.current&&F.target===_.current&&I(!1),T(null)};E.useEffect(()=>{if(y)return window.addEventListener("keyup",C),()=>{window.removeEventListener("keyup",C)}},[y]),E.useEffect(()=>{const F=_.current;return F&&(F.addEventListener("mousedown",A),F.addEventListener("mouseup",S)),()=>{F&&(F.removeEventListener("mousedown",A),F.removeEventListener("mouseup",S))}},[b]);const I=F=>{if(v(F),F)i(),g(e);else{if(y===F)return;a(),m(e)}};E.useEffect(()=>(I(t),()=>{y&&m(e)}),[t]);const B=r?{"--max-width":`${r/16}rem`}:{};return h.jsx("div",{id:`${e}-overlay`,ref:_,className:ne("overlay",{open:y,"in-portal":c.includes("in-portal")}),role:"dialog",children:h.jsx(Hp,{id:e,className:ne("overlay-modal",c,{"has-max-width":r}),hidden:!y,style:B,children:t&&h.jsx(y6,{containerElements:[_.current],active:f,children:h.jsxs("div",{className:"overlay-content",children:[h.jsxs("div",{className:"top",children:[o&&h.jsx("h2",{className:"modal-title",children:o}),h.jsx(Fe,{variant:"tertiary",size:"medium",icon:{icon:"close"},onClick:()=>I(!1),className:"gtm-trackable","data-gtm-event-type":"close-modal-click","data-gtm-event-context":d,screenreaderText:p.formatMessage({id:"overlay_close"})})]}),n&&h.jsx(Dr,{}),l,u&&h.jsxs("div",{className:"bottom",children:[h.jsx(Dr,{}),h.jsx(to,{buttons:u})]}),s&&h.jsx(Us,{className:"error",children:s})]})})})})},lb=(e,t)=>({"aria-haspopup":!0,"aria-expanded":t,"aria-controls":e});const Li="joinCommunityButton",Wp=({isMember:e=!1,isOpen:t=!1,isShort:n=!1,disabled:r=!1,functions:{join:i,leave:a}={join:()=>{},leave:()=>{}}})=>{const s=ue.useIntl(),o=E.useContext(jt),l=o&&typeof o.id=="string",u=r||!l,[c,d]=E.useState(e),[f,p]=E.useState(e?"joined":"notJoined"),[g,m]=E.useState(!1),y=E.useRef(null);return E.useEffect(()=>{f==="joining"?p("joined"):f==="leaving"&&p("notJoined")},[c]),E.useEffect(()=>{const v=b=>{y.current&&!y.current.contains(b.target)&&m(!1)};return g&&document.addEventListener("mousedown",v),()=>{document.removeEventListener("mousedown",v)}},[g]),h.jsxs("div",{className:"root",children:[h.jsx(Fe,{variant:c?"secondary":"primary",size:"medium",styling:{fullWidth:!0},icon:c&&f!=="leaving"?{icon:"tick",position:"left"}:!1,tooltip:!t&&!c?s.formatMessage({id:`${Li}_closed_tooltip`}):"",onClick:async v=>{if(u)return;if(v.currentTarget.blur(),c){m(!0);return}p("joining");const b=new CustomEvent("ariaLive",{detail:{message:s.formatMessage({id:`${Li}_aria_live`},{action:"joining"})}});document.dispatchEvent(b);const T=i;typeof T=="function"&&setTimeout(async()=>{await T()},500),d(!0)},className:ne("join-community-button",f,{active:f==="joining"}),disabled:u,"data-testid":"join-button","aria-label":c?s.formatMessage({id:`${Li}_options_menu`}):s.formatMessage({id:`${Li}`}),children:h.jsx("span",{className:"text","aria-hidden":"true",children:s.formatMessage({id:`${Li}${["joining","leaving"].includes(f)?`_${f}`:c?"_member":n?"_short":""}`})})}),g?h.jsx("div",{className:"leave-button-overlay",tabIndex:0,children:h.jsx("div",{className:"leave-button-container",ref:y,children:h.jsx(Fe,{"data-testid":"leave-button",className:"leave-community-button",variant:"tertiary",size:"medium",onClick:async v=>{if(u)return;p("leaving");const b=new CustomEvent("ariaLive",{detail:{message:s.formatMessage({id:`${Li}_aria_live`},{action:"leaving"})}});document.dispatchEvent(b);const T=a;typeof T=="function"&&setTimeout(async()=>{await T()},500),d(!1),m(!1)},"aria-label":s.formatMessage({id:`${Li}_member_aria`}),children:s.formatMessage({id:`${Li}_member_aria`})})})}):null]})};const vd="communityDetails_",E6=({className:e="",isMember:t=!1,isOpen:n=!1,slug:r,members:{number:i=0,data:a=[]}={number:0,data:[]},functions:{invite:s,...o}})=>{const l=ue.useIntl(),{id:u}=E.useContext(jt),c=u,d=5,f=i||a.length,p=a.length?a:Array(d).fill({}),g=`/communities/${r}/members`===window.location.pathname,m=t||n,y=!n&&!t;return h.jsxs("div",{className:ne("community-details",e),children:[m?h.jsxs("div",{className:"member-details",children:[h.jsxs("div",{className:"top",children:[h.jsxs("h4",{children:[l.formatMessage({id:`${vd}members`}),h.jsx("span",{className:"count",children:f})]}),g?h.jsx(h.Fragment,{}):h.jsx("p",{className:"text-small",children:h.jsx("a",{href:`/communities/${r}/members`,children:l.formatMessage({id:`${vd}viewAll`})})})]}),c&&h.jsx(jp,{contributors:{total:i,data:p},styling:{size:"medium",showGap:!0,showPlaceholders:f===0},cutoff:d})]}):h.jsx(h.Fragment,{}),c?h.jsxs(h.Fragment,{children:[h.jsx(Wp,{isMember:t,isOpen:n,disabled:y,functions:{...o}}),t&&h.jsx(Fe,{variant:"primary",onClick:s,icon:{icon:"plus"},styling:{fullWidth:!0},children:l.formatMessage({id:`${vd}invite`})})]}):h.jsx(h.Fragment,{})]})};const Is=({icon:e,className:t="",children:n,shortText:r,...i})=>{const a={};return r&&(a["data-short-text"]=r),h.jsx(Fe,{className:ne("action-button",t),variant:"tertiary",size:{mobile:"small",769:"medium"},icon:e,...i,...a,children:h.jsx("span",{className:"inner-text",children:n})})},b6="reply",ta="00000000-0000-0000-0000-000000000000",mc="en";function Vp({queryClient:e,queryKey:t}){function n(r,i,a){e.setQueryData(t,a)}return n}function Kp({queryClient:e,queryKey:t}){async function n(r){await e.cancelQueries({queryKey:t});const i=e.getQueryData(t);return e.setQueryData(t,r),i}return n}var ro=(e=>(e.Post="post",e.Poll="poll",e))(ro||{});const Dn="poll-vote",ub=(e,t="en")=>{var r;return e.verb!==ro.Poll?[]:(((r=e==null?void 0:e.latest_reactions)==null?void 0:r["poll-option"])||[]).map(i=>{var o,l,u,c,d,f,p,g;const a=((o=i==null?void 0:i.own_children)==null?void 0:o["poll-vote"])||[],s=((d=(c=(u=(l=i.data)==null?void 0:l.payload)==null?void 0:u.data)==null?void 0:c.original)==null?void 0:d.body)||"";return{id:i.id,label:s,numVotes:((f=i==null?void 0:i.children_counts)==null?void 0:f["poll-vote"])||0,hasUserVoted:a.length>0,userVote:{id:(p=a[0])==null?void 0:p.id},position:((g=i.data)==null?void 0:g.position)||0}}).sort((i,a)=>i.position-a.position)};function cb({activity:e,reactionId:t,user:n}){var a;const r=n==null?void 0:n.id;if(!r)return;const i=(a=e.latest_reactions)==null?void 0:a["poll-option"];if(i){for(const s of i)if(s.id===t){const o={id:ta,activity_id:e.id,kind:Dn,data:{},created_at:new Date().toISOString(),updated_at:new Date().toISOString(),user_id:r,parent:s.id,latest_children:{},own_children:{},children_counts:{}};s.latest_children=s.latest_children||{},s.latest_children[Dn]=s.latest_children[Dn]||[],s.latest_children[Dn].push(o),s.own_children=s.own_children||{},s.own_children[Dn]=s.own_children[Dn]||[],s.own_children[Dn].push(o),s.children_counts=s.children_counts||{},s.children_counts[Dn]=(s.children_counts[Dn]||0)+1;break}}}function db({activity:e,reactionId:t,correctReactionId:n,user:r}){var i;(i=e.latest_reactions)==null||i["poll-option"].forEach(a=>{var s;a.id===t&&(a.latest_children[Dn].forEach(o=>{o.id===ta&&o.user_id===(r==null?void 0:r.id)&&(o.id=n)}),(s=a.own_children)==null||s[Dn].forEach(o=>{o.id===ta&&o.user_id===(r==null?void 0:r.id)&&(o.id=n)}))})}function fb({activity:e,reactionId:t}){var r,i,a;const n=(r=e.latest_reactions)==null?void 0:r["poll-option"];if(n)for(const s of n){const o=(i=s.own_children)==null?void 0:i[Dn],l=(a=s.latest_children)==null?void 0:a[Dn];if(l){const u=l.findIndex(c=>c.id===t);u!==-1&&(l.splice(u,1),s.children_counts[Dn]--)}if(o){const u=o.findIndex(c=>c.id===t);u!==-1&&o.splice(u,1)}}}function T6({id:e,position:t,body:n,locale:r},i){if(i!=null&&i.id)return{created_at:new Date().toISOString(),updated_at:new Date().toISOString(),id:e||ta,kind:"poll-option",data:{payload:{data:{original:{body:n,locale:r}}},position:t},parent:""}}function _6(){return{latest_reactions:{like:[],reply:[],"poll-option":[]},reaction_counts:{like:0,reply:0,"poll-option":0},own_reactions:{like:[],reply:[],"poll-option":[]}}}function C6(){return{latest_children:{like:[],reply:[]},children_counts:{like:0,reply:0},own_children:{like:[],reply:[]}}}function x6(e,t){const n=e.map(r=>T6(r,t));return{latest_reactions:{like:[],reply:[],"poll-option":n},reaction_counts:{like:0,reply:0,"poll-option":0},own_reactions:{like:[],reply:[],"poll-option":[]}}}function Gp(e){const{id:t="",name:n="",organization:r="",jobTitle:i="",image:a={}}=e,{thumbnail:s=""}=a;return{id:t,data:{name:n,organization:r,jobTitle:i,thumbnail:s}}}const Dh=e=>{const t={};return Object.keys(e).forEach(n=>n.includes("Id")?t[n]=e[n]:t[`${n}Slug`]=e[n]),t},Ml=e=>{var t,n,r,i,a,s;return e&&!e.error?{id:e==null?void 0:e.id,name:(t=e==null?void 0:e.data)==null?void 0:t.name,organization:(n=e==null?void 0:e.data)==null?void 0:n.organization,jobTitle:(r=e==null?void 0:e.data)==null?void 0:r.jobTitle,location:(i=e==null?void 0:e.data)==null?void 0:i.location,image:{thumbnail:((a=e==null?void 0:e.data)==null?void 0:a.thumbnail)||void 0},badges:(s=e==null?void 0:e.data)==null?void 0:s.badges}:"deleted"};function w6({title:e,content:t,categories:n,locale:r}){const i=[];return n&&!["no-category",""].includes(n)&&i.push(n),{title:e,content:t,payload:{data:{original:{title:e,body:t,locale:r},translations:{}}},categories:i,id:ta,time:new Date().toISOString(),verb:ro.Post}}function Ag({title:e,options:t,settings:n,user:r,correctActivityId:i}){return{title:e,content:"",payload:{data:{original:{title:e,locale:"en"}}},id:i||ta,time:new Date().toISOString(),verb:ro.Poll}}function Sg({activity:e,user:t,vars:n}){return{...e,payload:{data:{original:{title:n==null?void 0:n.title,body:n==null?void 0:n.content,locale:n==null?void 0:n.locale},translations:{}}},actor:Gp(t),..._6()}}function kg({activity:e,options:t,user:n}){return{...e,time:new Date().toISOString(),actor:Gp(n),...x6(t,n)}}function Wc({activity:e,reaction:t}){var n,r,i;t?(e.latest_reactions={...e.latest_reactions||{},like:[...((r=e.latest_reactions)==null?void 0:r.like)||[],t]},e.own_reactions={...e.own_reactions||{},like:[...((i=e.own_reactions)==null?void 0:i.like)||[],t]}):e.reaction_counts={...e.reaction_counts||{},like:(n=e.reaction_counts)!=null&&n.like?e.reaction_counts.like+1:1}}function hb({activity:e,user:t}){var n,r,i;e.reaction_counts={...e.reaction_counts||{},like:(n=e.reaction_counts)!=null&&n.like?e.reaction_counts.like-1:0},t!=null&&t.id&&(e.latest_reactions={...e.latest_reactions||{},like:(((r=e.latest_reactions)==null?void 0:r.like)||[]).filter(({user_id:a})=>a!==t.id)},e.own_reactions={...e.own_reactions||{},like:(((i=e.own_reactions)==null?void 0:i.like)||[]).filter(({user_id:a})=>a!==t.id)})}function Vc({activity:e,reaction:t}){var n,r,i;t?(e.latest_reactions={...e.latest_reactions||{},pin:[...((r=e.latest_reactions)==null?void 0:r.pin)||[],t]},e.own_reactions={...e.own_reactions||{},pin:[...((i=e.own_reactions)==null?void 0:i.pin)||[],t]}):e.reaction_counts={...e.reaction_counts||{},pin:(n=e.reaction_counts)!=null&&n.pin?e.reaction_counts.pin+1:1}}function pb({activity:e}){var t;e.reaction_counts={...e.reaction_counts||{},pin:(t=e.reaction_counts)!=null&&t.pin?e.reaction_counts.pin-1:0},e.latest_reactions={...e.latest_reactions||{},pin:[]},e.own_reactions={...e.own_reactions||{},pin:[]}}const Yp=(e,t,n)=>{var B,F,R,N,k,M,$,z,P,te;const{actor:r,verb:i,time:a,id:s,own_reactions:o,latest_reactions:l,reaction_counts:u,mentioned_users:c,total_replies:d,additional_data:f,settings:p,payload:g}=e,m=(((B=l==null?void 0:l.like)==null?void 0:B.length)||0)>0,y=(((F=o==null?void 0:o.like)==null?void 0:F.length)||0)>0,v=m?(R=l==null?void 0:l.like)==null?void 0:R.map(ee=>{var D,x,V;return{id:(D=ee==null?void 0:ee.user)==null?void 0:D.id,name:(V=(x=ee==null?void 0:ee.user)==null?void 0:x.data)==null?void 0:V.name}}):!1,b=(M=(k=(N=g==null?void 0:g.data)==null?void 0:N.translations)==null?void 0:k[n])==null?void 0:M.title,T=(P=(z=($=g==null?void 0:g.data)==null?void 0:$.translations)==null?void 0:z[n])==null?void 0:P.body,_=(te=g==null?void 0:g.data)==null?void 0:te.original,C=!!(b||T),A=(_==null?void 0:_.locale)===n,S=b||(_==null?void 0:_.title),I=T||(_==null?void 0:_.body);return{id:s,title:S,body:I,author:Ml(r),type:i,createdAt:a+"Z",slug:s,slugs:{},userLiked:y,likes:(u==null?void 0:u.like)||0,comments:d||0,peopleWhoLiked:v,payloadId:g==null?void 0:g.id,payloadCollection:g==null?void 0:g.collection,data:{mentions:c,...f||{},translationInfo:{hasTranslation:C,isOriginalPost:A,currentTitle:S,currentBody:I,currentLocale:n,originalTitle:_==null?void 0:_.title,originalBody:_==null?void 0:_.body,originalLocale:_==null?void 0:_.locale}},pinned:(u==null?void 0:u.pin)&&(u==null?void 0:u.pin)>0||!1,categories:Y3((e==null?void 0:e.categories)||[],t||[]),pollOptions:ub(e,"en"),pollSettings:{showRemoveVote:p==null?void 0:p.show_remove_vote,allowMultipleVotes:p==null?void 0:p.allow_multiple_votes,deadlineAt:p==null?void 0:p.deadline_at,hideParticipants:p==null?void 0:p.hide_participants,numberOfWinners:p==null?void 0:p.number_of_winners,resultsVisibility:p==null?void 0:p.results_visibility}}};function A6(e){return{pages:[{next:"",results:[e]}],pageParams:[""]}}function S6(e,t,n){const r=t.pages.length-1,i=t.pages[r].results.length-1;return n!=null&&n.replace?t.pages[r].results[i]=e:t.pages[r].results.push(e),t}function k6(e,t,n){return n!=null&&n.replace?t.pages[0].results[0]=e:t.pages[0].results=[e,...t.pages[0].results],t}function qs(e,t,n){return t?n!=null&&n.append?S6(e,t,n):k6(e,t,n):A6(e)}function Bn(e,t){if(t)for(const{results:n}of t.pages){const r=n.find(({id:i})=>i===e);if(r)return r}}function mb(e,t){for(const{results:n}of t.pages){const r=n.findIndex(({id:i})=>i===e);if(r!==-1){n.splice(r,1);break}}return t}function Zp(e){var t;return((t=e==null?void 0:e.pages)==null?void 0:t.reduce((n,r)=>[...n,...r==null?void 0:r.results],[]))||[]}function D6({activityId:e,replyId:t,content:n}){return{activity_id:e,data:{content:n},id:ta,kind:b6,parent:t||""}}function Dg({reply:e,user:t}){const n=Gp(t);return{...e,user_id:n.id,user:n,...C6()}}function Og({reply:e,reaction:t}){var n,r,i;t?(e.latest_children={...e.latest_children||{},like:[...((r=e.latest_children)==null?void 0:r.like)||[],t]},e.own_children={...e.own_children||{},like:[...((i=e.own_children)==null?void 0:i.like)||[],t]}):e.children_counts={...e.children_counts||{},like:(n=e.children_counts)!=null&&n.like?e.children_counts.like+1:1}}function O6({reply:e,user:t}){var n,r,i;e.children_counts={...e.children_counts||{},like:(n=e.children_counts)!=null&&n.like?e.children_counts.like-1:0},t!=null&&t.id&&(e.latest_children={...e.latest_children||{},like:(((r=e.latest_children)==null?void 0:r.like)||[]).filter(({user_id:a})=>a!==t.id)},e.own_children={...e.own_children||{},like:(((i=e.own_children)==null?void 0:i.like)||[]).filter(({user_id:a})=>a!==t.id)})}const Qp=(e,t)=>{const n=new CustomEvent(Jt.DISCUSSION_POST_ADDED,{detail:{id:e,type:t}});document.dispatchEvent(n)},gb=({payload:e,locale:t})=>{var n,r,i;return((r=(n=e==null?void 0:e.translations)==null?void 0:n[t])==null?void 0:r.body)||((i=e==null?void 0:e.original)==null?void 0:i.body)||""},vb=({payload:e,locale:t})=>{var n,r,i;return((r=(n=e==null?void 0:e.translations)==null?void 0:n[t])==null?void 0:r.body)||((i=e==null?void 0:e.original)==null?void 0:i.body)||""};let Ng,yd=0;const Xp=()=>{E.useEffect(()=>(document.addEventListener(Jt.DISCUSSION_POST_ADDED,e),()=>{document.removeEventListener(Jt.DISCUSSION_POST_ADDED,e)}),[]);const e=t=>{const{id:n,type:r}=t.detail;if(!n||!r||r==="activity")return;clearTimeout(Ng);const i=document.getElementById(n);if(i){i.scrollIntoView({behavior:"smooth",block:"start"}),yd=0;return}yd++,!(yd>10)&&(Ng=setTimeout(()=>{e(t)},50))}};var qt=(e=>(e.Communities="communities",e.Courses="courses",e))(qt||{}),Ve=(e=>(e.Answer="answer",e.Poll="poll",e.Post="post",e.Response="response",e.Reply="reply",e.Question="question",e))(Ve||{});const Ws=Object.freeze({id:"some-user-id-1",name:"some user name 1",organization:"some user organization 1",jobTitle:"some user job title 1",image:{thumbnail:"https://some-user-thumbnail.com/avatar1.png"},isLoading:!1}),Jr=Object.freeze({id:"some-user-id-2",name:"some user name 2",organization:"some user organization 2",jobTitle:"some user job title 2",image:{thumbnail:"https://some-user-thumbnail.com/avatar2.png"},isLoading:!1}),Jp=Object.freeze({actor:`SU:${Ws.id}`,content:"some content 1",duration:"5.53ms",feed_id:"some-feed-id-1",foreign_id:"post:some-foriegn-id-1",id:"some-activity-id-1",object:"comment",time:"2023-11-24T17:52:36.162000",verb:"post"}),N6=Object.freeze({actor:`SU:${Jr.id}`,content:"some content 2",duration:"5.53ms",feed_id:"some-feed-id-2",foreign_id:"post:some-foriegn-id-2",id:"some-activity-id-2",object:"comment",time:"2023-11-24T17:54:36.162000",verb:"post"}),I6=Object.freeze({actor:`SU:${Ws.id}`,content:"some content 3",duration:"5.53ms",feed_id:"some-feed-id-3",foreign_id:"post:some-foriegn-id-3",id:"some-activity-id-3",object:"comment",time:"2023-11-24T17:56:36.162000",verb:"post"}),P6=Object.freeze({actor:`SU:${Jr.id}`,content:"some content 4",duration:"5.53ms",feed_id:"some-feed-id-4",foreign_id:"post:some-foriegn-id-4",id:"some-activity-id-4",object:"comment",time:"2023-11-24T17:54:36.162000",verb:"post"});Object.freeze({id:"some-reaction-id-1",activity_id:Jp.id,kind:"like",created_at:"2023-11-24T17:58:36.162000",data:{},parent:"",updated_at:"2023-11-24T17:58:36.162000",user_id:Jr.id,children_counts:{},latest_children:{},latest_children_extra:{},own_children:{},user:{id:Jr.id,data:{},created_at:"2023-11-24T17:58:36.162000",updated_at:"2023-11-24T17:58:36.162000"}});Object.freeze({id:"some-reaction-id-1",activity_id:Jp.id,kind:"pin",created_at:"2023-11-24T17:58:36.162000",data:{},parent:"",updated_at:"2023-11-24T17:58:36.162000",user_id:Jr.id,children_counts:{},latest_children:{},latest_children_extra:{},own_children:{},user:{id:Jr.id,data:{},created_at:"2023-11-24T17:58:36.162000",updated_at:"2023-11-24T17:58:36.162000"}});Object.freeze({created_at:"2023-12-03T21:53:45.999851Z",updated_at:"2023-12-03T21:53:45.999851Z",id:"some-reply-id-1",user_id:Jr.id,user:{id:Jr.id,data:{},created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z"},kind:"reply",activity_id:Jp.id,data:{content:"Some content 1..."},parent:"",latest_children:{},children_counts:{}});Object.freeze({created_at:"2023-12-03T21:53:45.999851Z",updated_at:"2023-12-03T21:53:45.999851Z",id:"some-reply-id-2",user_id:Ws.id,user:{id:Ws.id,data:{},created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z"},kind:"reply",activity_id:N6.id,data:{content:"Some content 2..."},parent:"",latest_children:{},children_counts:{}});Object.freeze({created_at:"2023-12-03T21:53:45.999851Z",updated_at:"2023-12-03T21:53:45.999851Z",id:"some-reply-id-3",user_id:Jr.id,user:{id:Jr.id,data:{},created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z"},kind:"reply",activity_id:I6.id,data:{content:"Some content 3..."},parent:"",latest_children:{},children_counts:{}});Object.freeze({created_at:"2023-12-03T21:53:45.999851Z",updated_at:"2023-12-03T21:53:45.999851Z",id:"some-reply-id-3",user_id:Ws.id,user:{id:Ws.id,data:{},created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z"},kind:"reply",activity_id:P6.id,data:{content:"Some content 4..."},parent:"",latest_children:{},children_counts:{}});const R6=({question:e,answer:t,reply:n})=>({...e&&{questionSlug:e},...t&&{answerSlug:t},...n&&{replySlug:n}}),F6=(e,t=10)=>!e||e.length===0?[]:e.slice(0,t);function B6(e){return E.useCallback(t=>{var s,o,l,u;if(!t||!["ArrowUp","ArrowDown"].includes(t.key||""))return;t.stopPropagation(),t.preventDefault();const n=t.key==="ArrowUp"?"up":"down",r=(s=t.currentTarget)==null?void 0:s.parentElement;let i=r==null?void 0:r.nextElementSibling;if(n==="up"){const c=r==null?void 0:r.previousElementSibling;c?i=c:(i=(o=r==null?void 0:r.parentElement)==null?void 0:o.lastElementChild,(i==null?void 0:i.getAttribute("data-index"))==="-1"&&(i=i==null?void 0:i.previousElementSibling))}else(!i||(i==null?void 0:i.getAttribute("data-index"))==="-1")&&(i=(l=r==null?void 0:r.parentElement)==null?void 0:l.firstElementChild);if(!i)return;const a=Number((i==null?void 0:i.getAttribute("data-index"))||"0");e([{type:"tabbableLink",value:a}]),(u=i==null?void 0:i.querySelector("a,button"))==null||u.focus()},[e])}const M6=E.lazy(()=>Promise.resolve().then(()=>aF));let Jo=!1;const Ed=()=>{Jo!==!1&&(clearTimeout(Jo),Jo=!1)},L6=5;let bd=null;const yb=({element:e="div",likes:t=0,peopleWhoLiked:n=!1,isShort:r=!0,userLiked:i=!1,content:a={type:Ve.Reply,slugs:{}},canLike:s=!0,activityId:o,basePath:l,parentId:u,functions:{createLike:c=()=>{},deleteLike:d=()=>{},listLikes:f=async()=>({next:"",results:[]})}})=>{const p=ue.useIntl(),g={numberOfLikes:t,userLikedContent:i,ignoreInteractions:!1,showLikers:!1,tabbableLink:0,showLikesModal:!1},[m,y]=E.useReducer(eo,g),{numberOfLikes:v,userLikedContent:b,ignoreInteractions:T,showLikers:_,tabbableLink:C,showLikesModal:A}=m,S=B6(y);E.useEffect(()=>{y([{type:"userLikedContent",value:i}])},[i]);const I=E.useMemo(()=>F6(n,L6),[n]),B=k=>{if(k.preventDefault(),k.stopPropagation(),y([{type:"showLikers",value:!1}]),Jo)return Ed(),!1;if(Ed(),T||!s)return!1;Jo=setTimeout(F,350)},F=async()=>{if(Ed(),T||!s)return!1;let k=b?v-1:v+1;k<0&&(k=0),y([{type:"ignoreInteractions",value:!0},{type:"numberOfLikes",value:k},{type:"userLikedContent",value:!b}]);try{if(a&&a.slugs){const M=R6(a.slugs);b?await d(M):await c({...M,payload:{contentPath:window.location.pathname}})}}catch{y([{type:"numberOfLikes",value:t},{type:"userLikedContent",value:i}])}finally{y([{type:"ignoreInteractions",value:!1}])}},R=()=>{bd=setTimeout(()=>{y([{type:"showLikers",value:!1}])},500)},N=()=>{bd&&clearTimeout(bd)};return E.createElement(e,{className:"likes-wrapper",onKeyDown:k=>{k.key==="Escape"&&y([{type:"showLikers",value:!1}])},onMouseEnter:()=>{N(),y([{type:"showLikers",value:!0}])},onMouseLeave:()=>{R()}},h.jsxs(h.Fragment,{children:[h.jsx(Is,{className:ne("discussion-button text-medium action-button likes-button",{"show-spinner":T,"is-liked":b,disabled:!s}),icon:{icon:b?"heart":"heart_empty",animate:"bounce"},shortText:`${v}`,disabled:!s,"data-testid":"like-button","data-gtm-event-context":"Likes","data-gtm-event-type":`like-${a.type}-click`,onClick:B,screenreaderText:s?p.formatMessage({id:`discussion_likes_${b?"unlike":"like"}`},{action:p.formatMessage({id:`discussion_action_${a.type}`})}):!1,"aria-pressed":b,children:h.jsx("span",{"data-testid":"number-of-likes",className:"number-of-likes",children:p.formatMessage({id:`discussion_likes${r?"_short":""}`},{number:v})})}),n&&h.jsxs(h.Fragment,{children:[h.jsx(ct,{"data-testid":"like-a11y-button",element:"button",className:"tertiary small icon navigation_arrow",onFocus:()=>{N()},onBlur:()=>R,onClick:k=>{var $;k.preventDefault(),k.stopPropagation(),N(),y([{type:"showLikers",value:!0}]);const M=($=k.currentTarget.nextSibling)==null?void 0:$.childNodes[0];if(M){const z=M.querySelector("li:first-child a");z&&(y([{type:"tabbableLink",value:0}]),setTimeout(()=>{z.focus()},100))}},onKeyDown:k=>{k.key==="Escape"&&(k.preventDefault(),k.stopPropagation(),R())},"aria-expanded":_,"aria-controls":`likes-tooltip-${a.slug}`,children:h.jsx(ct,{showOnFocus:!1,children:p.formatMessage({id:"discussion_likes_show"},{action:a.type})})}),h.jsx(ia,{id:`likes-tooltip-${a.slug}`,isOpen:_,isLoading:n.length===0,children:n.length&&h.jsxs("ul",{children:[I.map((k,M)=>{if(typeof k=="string")return null;const $={};return C!==M&&($.tabIndex=-1),h.jsx("li",{"data-index":M,children:h.jsx(sa,{href:k.id?`/profiles/${k.id}`:void 0,gtmContext:"Likes",gtmType:"liked-name-click",onFocus:()=>N(),onKeyDown:S,...$,children:k.name?k.name:h.jsx("span",{className:"deleted-user",children:p.formatMessage({id:"member_deleted"})})})},k.id||Si(k.name||""))}),h.jsx("li",{"data-index":I.length,className:"show-all",children:h.jsx(Fe,{variant:"tertiary",size:{mobile:"small",769:"medium"},onClick:()=>{N(),R(),y([{type:"showLikesModal",value:!0}])},onKeyDown:S,children:p.formatMessage({id:"discussion_likes_showAll"})})})]})}),A&&h.jsx(no,{children:h.jsx(E.Suspense,{children:h.jsx(M6,{activityId:o,basePath:l,parentId:u,likeCount:t,showModal:A,functions:{onClose:()=>y([{type:"showLikesModal",value:!1}]),likes:{list:f}}})})})]})]}))};function $6({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:i,user:a}){const{mutate:s}=bt.useMutation({mutationFn:e,onMutate:o=>t(l=>{const u=Sg({activity:w6(o),vars:o,user:a});return qs(u,l)}),onError:n,onSuccess:(o,l,u)=>{const c=Sg({activity:o,vars:l,user:a});r.setQueryData(i,qs(c,u,{replace:!0})),setTimeout(()=>{Qp(c.id,"activity")},0)}});return s}function j6({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:i,user:a}){const{mutateAsync:s}=bt.useMutation({mutationFn:e,onMutate:({options:o,title:l,settings:u})=>t(c=>{const d=kg({activity:Ag({title:l,options:o,settings:u,user:a}),options:o,user:a});return qs(d,c)}),onError:(o,l,u)=>{const c=d=>{const f=d.pages;return f.forEach(p=>{p.results=p.results.filter(g=>g.id!==ta)}),{...d,pages:f}};r.setQueryData(i,d=>c(d)),n&&n(o,l,u)},onSuccess:async(o,{options:l,title:u,settings:c,locale:d},f)=>{const p=o,g=kg({activity:Ag({title:u,options:l,settings:c,user:a,correctActivityId:p.body.id}),options:l.map((m,y)=>({...m,id:p.body.options[y]})),user:a,locale:d});r.setQueryData(i,qs(g,f,{replace:!0})),setTimeout(()=>{Qp(p.body.id,"activity")},0)}});return s}function H6({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:i,user:a}){const{mutate:s}=bt.useMutation({mutationFn:e,onMutate:({activityId:o,reactionId:l})=>t(u=>{const c=Bn(o,u);return c&&cb({activity:c,reactionId:l,user:a}),u}),onError:n,onSuccess:(o,{activityId:l,reactionId:u},c)=>{const d=Bn(l,c);d&&db({activity:d,reactionId:u,correctReactionId:o.body.id,user:a}),r.setQueryData(i,c)}});return s}function U6({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=bt.useMutation({mutationFn:e,onMutate:({activityId:i,content:a,title:s})=>t(o=>{const l=Bn(i,o);return l&&(l.content=a,l.title=s),o}),onError:n});return r}function Eb({queryFns:{create:e,edit:t,like:n,list:r,remove:i,unlike:a,pin:s,unpin:o,createVote:l,createPoll:u,removeVote:c,removePoll:d},queryKey:f,filterOption:p}){const g=bt.useQueryClient(),m=y1(),y={queryClient:g,queryKey:f},v={mutationHandlers:{error:Vp(y),mutate:Kp(y)},user:m,...y},b=$6({...v,mutationFn:e}),T=U6({...v,mutationFn:t}),_=z6({...v,mutationFn:n}),C=Ig({...v,mutationFn:i}),A=K6({...v,mutationFn:a}),S=W6({...v,mutationFn:s}),I=G6({...v,mutationFn:o}),B=H6({...v,mutationFn:l}),F=j6({...v,mutationFn:u}),R=V6({...v,mutationFn:c}),N=Ig({...v,mutationFn:d}),{activities:k,...M}=q6({queryKey:f,queryFn:r,filterOption:p});return{activities:k,mutations:{create:b,edit:T,remove:C,like:_,unlike:A,pin:S,unpin:I,createVote:B,createPoll:F,removeVote:R,removePoll:N},user:m,...M}}function z6({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:i}){const{mutate:a}=bt.useMutation({mutationFn:e,onMutate:({activityId:s})=>t(o=>{const l=Bn(s,o);return l&&Wc({activity:l}),o}),onError:n,onSuccess:(s,{activityId:o},l)=>{const u=Bn(o,l);u&&Wc({activity:u,reaction:s}),r.setQueryData(i,l)}});return a}function q6({queryFn:e,queryKey:t,filterOption:n}){const{data:r,error:i,isLoading:a,hasNextPage:s,fetchNextPage:o}=bt.useInfiniteQuery({queryKey:t,queryFn:e,initialPageParam:`${n==null?void 0:n.type}=${n==null?void 0:n.id}`,getNextPageParam:l=>l!=null&&l.next?`${l==null?void 0:l.next}&${n==null?void 0:n.type}=${n==null?void 0:n.id}`:null});return{activities:Zp(r),error:i,isLoading:a,hasNextPage:s,fetchNextPage:o}}function W6({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:i}){const{mutate:a}=bt.useMutation({mutationFn:e,onMutate:({activityId:s})=>t(o=>{const l=Bn(s,o);return l&&Vc({activity:l}),o}),onError:n,onSuccess:(s,{activityId:o},l)=>{const u=Bn(o,l);u&&Vc({activity:u,reaction:s}),r.setQueryData(i,l)}});return a}function Ig({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=bt.useMutation({mutationFn:e,onMutate:({activityId:i})=>t(a=>mb(i,a)),onError:n});return r}function V6({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:i}=bt.useMutation({mutationFn:e,onMutate:({activityId:a,reactionId:s})=>t(o=>{const l=Bn(a,o);return l&&fb({activity:l,reactionId:s}),o}),onError:n});return i}function K6({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:i}=bt.useMutation({mutationFn:e,onMutate:({activityId:a})=>t(s=>{const o=Bn(a,s);return o&&hb({activity:o,user:r}),s}),onError:n});return i}function G6({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:i}=bt.useMutation({mutationFn:e,onMutate:({activityId:a})=>t(s=>{const o=Bn(a,s);return o&&pb({activity:o,user:r}),s}),onError:n});return i}const Y6=[{id:"recent_with_pin",text:"recent",type:"ranking"},{id:"community_feed_live",text:"popular",type:"ranking"}],Z6=({basePath:e,parentId:t,isMember:n,isOwner:r,categories:i=[],functions:{activities:a,form:s,join:o,leave:l,likes:u,polls:c},profile:d,translation:f})=>{const p=ue.useIntl(),g=Ka(),[m,y]=E.useState([{id:"recent_with_pin",text:"recent",type:"ranking"}]),v=E.useMemo(()=>i==null?void 0:i.map(({slug:L,name:H})=>({id:L,text:H,type:"category"})),[i]),b=E.useMemo(()=>[...Y6,...v],[v]),T={...a,...c,translate:f==null?void 0:f.onTranslate},{activities:_,error:C,fetchNextPage:A,hasNextPage:S,isLoading:I,mutations:{create:B,edit:F,remove:R,like:N,unlike:k,pin:M,unpin:$,createPoll:z,createVote:P,removeVote:te,removePoll:ee}}=Eb({queryKey:[e,t,"activities",m],queryFns:T,filterOption:m[0]}),[D,x]=E.useState(null),V=()=>{x(_.length),A()};return Xp(),C?h.jsx(Xr,{variant:"error",text:C.message}):h.jsxs("section",{className:"activities-feed",children:[h.jsx(V0,{isCard:!0,parentId:t,categories:i,form:{content:{type:ro.Post,slugs:{}},functions:{create:B,createPoll:z,...s},meta:{isEditing:!1,isAutoFocused:!1,isPrepopulated:!1,showSuccessMessage:!1}},membershipRequiredToPost:{isMember:n,required:!0,join:o,leave:l,notMemberStateText:p.formatMessage({id:"community_joinToPost"})}}),h.jsx(u8,{className:"activities-feed-filtering",options:b.map(({id:L,text:H})=>({id:L,text:p.formatMessage({id:`activitiesFeed_rankingMethod_${H}`,defaultMessage:H})})),defaultOptions:m.map(({id:L,text:H})=>({id:L,text:p.formatMessage({id:`activitiesFeed_rankingMethod_${H}`,defaultMessage:H})})),preventNoOptionSelected:!0,allowMultiple:!1,onChange:({current:L,previous:H})=>{if(L[0]===H[0])return;y([b.find(Q=>Q.id===L[0])]);const j=b.find(Q=>Q.id===L[0]);if(!j)return;const U=new CustomEvent("ariaLive",{detail:{message:p.formatMessage({id:"community_sortSuccess"},{order:p.formatMessage({id:`activitiesFeed_rankingMethod_${j.text}`,defaultMessage:j.text})})}});document.dispatchEvent(U)},gtm:{context:"activitiesFeed_sorting"}}),_==null?void 0:_.map((L,H)=>{var W;const{id:j,own_reactions:U,latest_reactions:Q}=L,J=(((W=U==null?void 0:U.like)==null?void 0:W.length)||0)>0?U==null?void 0:U.like[0].id:"";return h.jsx(E.Fragment,{children:h.jsx(eu,{content:{...Yp(L,i,g),slugs:{question:`${e}/${t}`,answer:j},slug:j},links:{post:`${e}/${t}/${j}`,comments:`${e}/${t}/${j}`},gtmContext:"community",functions:{content:{createContent:()=>null,deleteContent:()=>R({activityId:j}),updateContent:(ae,{body:oe,title:be})=>F({activityId:j,content:oe,title:be})},likes:{createLike:()=>N({activityId:j}),deleteLike:()=>k({activityId:j,reactionId:J}),listLikes:ae=>u.list({activityId:j,...ae})},comments:{openComments:()=>null},pins:{createPin:()=>M({activityId:j}),deletePin:()=>$({activityId:j,reactionId:Q==null?void 0:Q.pin[0].id})},polls:{createVote:({reactionId:ae})=>P({activityId:j,reactionId:ae}),removeVote:({reactionId:ae})=>te({activityId:j,reactionId:ae}),removePoll:()=>ee({activityId:j})},form:s},isTruncated:!0,styling:{showShareLinkButton:!0},setFocus:H===D,userHasOwnerPermissions:r,userHasPermissions:n,badges:{showBadges:!0,scopes:[{scope:pn.Communities,area:t||""},{scope:pn.Platform,area:"all"}]},basePath:e,parentId:t,locale:g,translation:f})},j)}),!I&&h.jsx(jl,{hasNextPage:S,loadNextPage:V,icon:{icon:"arrow-down",position:"right"},messages:{button:p.formatMessage({id:"loadMore_button"}),error:p.formatMessage({id:"loadMore_error"})}}),_.length===0&&!I&&h.jsx(Kn,{className:"no-activities",variant:"muted",icon:"text--input",children:m[0].type==="category"?h.jsx("p",{children:p.formatMessage({id:"activitiesFeed_noActivities_inCategories"})}):h.jsxs(h.Fragment,{children:[h.jsx("p",{children:p.formatMessage({id:"activitiesFeed_noActivities"})}),h.jsx("p",{children:h.jsx(Fe,{variant:"secondary",size:"small",href:"/communities",children:p.formatMessage({id:"activitiesFeed_noActivities_button"})})})]})}),h.jsx(K0,{form:d})]})},Q6={next:"id_lt=67ef0342-6f6e-4807-beea-5a9184ec140c&limit=5",results:[{created_at:"2023-12-03T18:47:44.081716Z",updated_at:"2023-12-03T18:47:44.081716Z",id:"256b921e-ffe6-410d-b754-ac1aaee989ce",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester",badges:{communities:{"community-slug":["orange-badge","badge-with-heart"]}}}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 17...",payload:{id:"123",collection:"reactions_payload",data:{original:{body:"Testing 17...",locale:"es"}}}},parent:"",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:02.517688Z",updated_at:"2023-12-03T18:47:24.852582Z",id:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 16 (edited)..."},parent:"",latest_children:{reply:[{created_at:"2023-12-03T19:28:09.799652Z",updated_at:"2023-12-03T19:28:09.799652Z",id:"bf1ec451-e7c3-4ebe-a60e-248b0ec2a671",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 3..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:59.756761Z",updated_at:"2023-12-03T19:27:59.756761Z",id:"7887d921-e2ba-48ef-8089-db24536dbf70",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 2..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:46.534650Z",updated_at:"2023-12-03T19:27:46.534650Z",id:"73f5bdf3-7080-48ac-a8dc-185f71b38b42",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 1..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}}]},own_children:{reply:[{created_at:"2023-12-03T19:28:09.799652Z",updated_at:"2023-12-03T19:28:09.799652Z",id:"bf1ec451-e7c3-4ebe-a60e-248b0ec2a671",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 3..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:59.756761Z",updated_at:"2023-12-03T19:27:59.756761Z",id:"7887d921-e2ba-48ef-8089-db24536dbf70",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 2..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:46.534650Z",updated_at:"2023-12-03T19:27:46.534650Z",id:"73f5bdf3-7080-48ac-a8dc-185f71b38b42",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 1..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}}]},children_counts:{reply:3}},{created_at:"2023-12-03T17:47:45.107092Z",updated_at:"2023-12-03T17:47:45.107092Z",id:"27a59e8f-f094-442f-88ec-1d5ec2f72790",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 14..."},parent:"",latest_children:{reply:[{created_at:"2023-12-03T18:47:10.603929Z",updated_at:"2023-12-03T18:47:10.603929Z",id:"c32b83d5-c5fc-4253-8531-eb99dcb01f28",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 8..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:47:04.856649Z",updated_at:"2023-12-03T18:47:04.856649Z",id:"5efd80e3-cb11-4748-8c64-f46b71df69c4",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 7..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:22.687552Z",updated_at:"2023-12-03T18:36:22.687552Z",id:"a3a2ebae-6df2-4dc0-beee-2296188b67aa",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 6..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:16.129336Z",updated_at:"2023-12-03T18:36:16.129336Z",id:"72948da5-bf3c-4bd5-9a21-2cee36e0ce8a",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 5..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:40.850756Z",updated_at:"2023-12-03T17:56:40.850756Z",id:"81ebc855-d1f6-4a2c-a788-a251bae406b6",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 4..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:34.103420Z",updated_at:"2023-12-03T17:56:34.103420Z",id:"ddc28de7-4e89-4572-8122-c95dceacc2fd",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 3..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:26.410145Z",updated_at:"2023-12-03T17:56:26.410145Z",id:"916ed4b6-ad87-47bc-9e00-7b0c46180276",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 2..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:19.921740Z",updated_at:"2023-12-03T17:56:19.921740Z",id:"92cddcb2-cbdc-4e69-9c8e-5afe3a607411",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 1..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}}]},own_children:{reply:[{created_at:"2023-12-03T18:47:10.603929Z",updated_at:"2023-12-03T18:47:10.603929Z",id:"c32b83d5-c5fc-4253-8531-eb99dcb01f28",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 8..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:47:04.856649Z",updated_at:"2023-12-03T18:47:04.856649Z",id:"5efd80e3-cb11-4748-8c64-f46b71df69c4",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 7..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:22.687552Z",updated_at:"2023-12-03T18:36:22.687552Z",id:"a3a2ebae-6df2-4dc0-beee-2296188b67aa",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 6..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:16.129336Z",updated_at:"2023-12-03T18:36:16.129336Z",id:"72948da5-bf3c-4bd5-9a21-2cee36e0ce8a",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 5..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:40.850756Z",updated_at:"2023-12-03T17:56:40.850756Z",id:"81ebc855-d1f6-4a2c-a788-a251bae406b6",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 4..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}}]},children_counts:{reply:8}},{created_at:"2023-12-03T17:47:40.066170Z",updated_at:"2023-12-03T17:47:40.066170Z",id:"9ed6a1d0-00b5-4a03-94d7-ac01e188e2e2",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 13..."},parent:"",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:47:33.107894Z",updated_at:"2023-12-03T17:47:33.107894Z",id:"67ef0342-6f6e-4807-beea-5a9184ec140c",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 12..."},parent:"",latest_children:{},children_counts:{}}],duration:"6.48ms"},X6={next:"id_lt=67ef0342-6f6e-4807-beea-5a9184ec140c&limit=5",results:[{created_at:"2023-12-03T18:47:44.081716Z",updated_at:"2023-12-03T18:47:44.081716Z",id:"256b921e-ffe6-410d-b754-ac1aaee989ce",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester",badges:{communities:{"community-slug":["orange-badge","badge-with-heart"]}}}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:{original:"Testing ENGLISH..."},locale:"en"},parent:"",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:02.517688Z",updated_at:"2023-12-03T18:47:24.852582Z",id:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:{original:"Testing ENGLISH 2..."},locale:"en"},parent:"",latest_children:{reply:[{created_at:"2023-12-03T19:28:09.799652Z",updated_at:"2023-12-03T19:28:09.799652Z",id:"bf1ec451-e7c3-4ebe-a60e-248b0ec2a671",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:{original:"Testing 3..."}},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:59.756761Z",updated_at:"2023-12-03T19:27:59.756761Z",id:"7887d921-e2ba-48ef-8089-db24536dbf70",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:{original:"Testing 2..."}},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:46.534650Z",updated_at:"2023-12-03T19:27:46.534650Z",id:"73f5bdf3-7080-48ac-a8dc-185f71b38b42",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:{original:"Testing 1..."}},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}}]},own_children:{reply:[{created_at:"2023-12-03T19:28:09.799652Z",updated_at:"2023-12-03T19:28:09.799652Z",id:"bf1ec451-e7c3-4ebe-a60e-248b0ec2a671",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:{original:"Testing 3..."}},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:59.756761Z",updated_at:"2023-12-03T19:27:59.756761Z",id:"7887d921-e2ba-48ef-8089-db24536dbf70",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:{original:"Testing 2..."}},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:46.534650Z",updated_at:"2023-12-03T19:27:46.534650Z",id:"73f5bdf3-7080-48ac-a8dc-185f71b38b42",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:{original:"Testing 1..."}},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}}]},children_counts:{reply:3}},{created_at:"2023-12-03T17:47:45.107092Z",updated_at:"2023-12-03T17:47:45.107092Z",id:"27a59e8f-f094-442f-88ec-1d5ec2f72790",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:{original:"Testing INDONESIAN..."},locale:"id"},parent:"",latest_children:{reply:[{created_at:"2023-12-03T18:47:10.603929Z",updated_at:"2023-12-03T18:47:10.603929Z",id:"c32b83d5-c5fc-4253-8531-eb99dcb01f28",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:{original:"Reply 8..."}},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:47:04.856649Z",updated_at:"2023-12-03T18:47:04.856649Z",id:"5efd80e3-cb11-4748-8c64-f46b71df69c4",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:{original:"Reply 7..."}},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:22.687552Z",updated_at:"2023-12-03T18:36:22.687552Z",id:"a3a2ebae-6df2-4dc0-beee-2296188b67aa",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:{original:"Reply 6..."}},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:16.129336Z",updated_at:"2023-12-03T18:36:16.129336Z",id:"72948da5-bf3c-4bd5-9a21-2cee36e0ce8a",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:{original:"Reply 5..."}},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:40.850756Z",updated_at:"2023-12-03T17:56:40.850756Z",id:"81ebc855-d1f6-4a2c-a788-a251bae406b6",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:{original:"Reply 4..."}},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:34.103420Z",updated_at:"2023-12-03T17:56:34.103420Z",id:"ddc28de7-4e89-4572-8122-c95dceacc2fd",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:{original:"Reply 3..."}},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:26.410145Z",updated_at:"2023-12-03T17:56:26.410145Z",id:"916ed4b6-ad87-47bc-9e00-7b0c46180276",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:{original:"Reply 2..."}},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:19.921740Z",updated_at:"2023-12-03T17:56:19.921740Z",id:"92cddcb2-cbdc-4e69-9c8e-5afe3a607411",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:{original:"Reply 1..."}},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}}]},own_children:{reply:[{created_at:"2023-12-03T18:47:10.603929Z",updated_at:"2023-12-03T18:47:10.603929Z",id:"c32b83d5-c5fc-4253-8531-eb99dcb01f28",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:{original:"Reply 8..."}},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:47:04.856649Z",updated_at:"2023-12-03T18:47:04.856649Z",id:"5efd80e3-cb11-4748-8c64-f46b71df69c4",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:{original:"Reply 7..."}},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:22.687552Z",updated_at:"2023-12-03T18:36:22.687552Z",id:"a3a2ebae-6df2-4dc0-beee-2296188b67aa",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:{original:"Reply 6..."}},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:16.129336Z",updated_at:"2023-12-03T18:36:16.129336Z",id:"72948da5-bf3c-4bd5-9a21-2cee36e0ce8a",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:{original:"Reply 5..."}},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:40.850756Z",updated_at:"2023-12-03T17:56:40.850756Z",id:"81ebc855-d1f6-4a2c-a788-a251bae406b6",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:{original:"Reply 4..."}},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}}]},children_counts:{reply:8}},{created_at:"2023-12-03T17:47:40.066170Z",updated_at:"2023-12-03T17:47:40.066170Z",id:"9ed6a1d0-00b5-4a03-94d7-ac01e188e2e2",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:{original:"Testing BRAZILLIAN..."},locale:"pt-BR"},parent:"",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:47:33.107894Z",updated_at:"2023-12-03T17:47:33.107894Z",id:"67ef0342-6f6e-4807-beea-5a9184ec140c",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:{original:"Testing NONE..."}},parent:"",latest_children:{},children_counts:{}}],duration:"6.48ms"};const em=({id:e="character-limit",limit:t,valueLength:n,...r})=>{const i=ue.useIntl(),a="form_fieldWrapper_characterLimit";if(t===0)return null;const s=t-n,o=Math.abs(n-t),l=n>=.99*t,u=n>=.9*t&&n<.99*t,c=n>t;return h.jsxs(h.Fragment,{children:[h.jsx("small",{id:e,className:ne("character-limit",{"near-limit":l,"approaching-limit":u}),"aria-live":"polite","aria-label":c?"":i.formatMessage({id:`${a}_aria_${s<0?"over":"default"}`},{remaining:s,over:o,limit:t}),children:c?i.formatMessage({id:`${a}_aria_${s<0?"over":"default"}`},{remaining:s,over:o,limit:t}):h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"hidden",children:i.formatMessage({id:a})}),n," / ",t]})}),h.jsx(ct,{showOnFocus:!1,id:`${e}-info`,children:i.formatMessage({id:`${a}_info`},{limit:t})})]})},T1=e=>(e==null?void 0:e.toString().length)||0,bb=(e,t)=>{const n={};return e===0||(n["data-character-limit"]=e,n.functions={...t,onChange:r=>{T1(r)>e&&(r=r==null?void 0:r.toString().slice(0,e)),t.onChange(r)}}),n};const du="emailHelperTextBox_",Tb=({id:e="email-helper-textbox",type:t,email:n,redirectPath:r,resendVerificationCode:i})=>{const a=ue.useIntl(),[s,o]=E.useState({path:`${du}default`,type:"default",link:{},mail:{},error:""}),[l,u]=E.useState(!1),c=E.useCallback(g=>{g.preventDefault(),g.stopPropagation();const m=y=>{o({path:`${du}error_verificationFailedToSend`,type:"error",link:{"data-gtm-event-context":"VerifyEmailBox","data-gtm-event-type":"SendEmailClick",className:"gtm-trackable",onClick:v=>c(v),href:"#","data-testid":"send-verify-email-click"},mail:{href:"mailto:concierge@apolitical.co",className:"gtm-trackable","data-gtm-event-context":"ErrorVerifyingBox","data-gtm-event-type":"email-concierge-click"},error:y})};if(typeof i!="function"){m(a.formatMessage({id:`${du}error_noFunction`}));return}u(!0),i(n).then(()=>{sessionStorage.setItem(Dp.SESSION_STORAGE.EMAIL,n),window.location.href=r||"/signup/verify-email"}).catch(y=>{m(y.message)}).finally(()=>{u(!1)})},[n,r,i]);E.useEffect(()=>{let g=du,m="default",y={},v={};switch(t){case"gov":g+="autoApproved",m="success";break;case"nonGov":g+="unrecognisedEmail",m="error",y={href:"/pages/who-can-join-the-community","data-gtm-event-context":"NonGovEmailHelperTextBox","data-gtm-event-type":"LearnMoreClick"};break;case"pending":g+="pendingApproval",m="error",v={href:"mailto:concierge@apolitical.co",className:"gtm-trackable","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"email-concierge-click"};break;case"verify":g+="emailUnverified",m="error",y={href:"#","data-gtm-event-context":"VerifyEmailBox","data-gtm-event-type":"SendEmailClick",className:"gtm-trackable",onClick:b=>c(b),"data-testid":"send-verify-email-click"};break;case"exists":g+="emailAlreadyExists",m="error",y={href:"/login","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"login-click"},v={href:"mailto:concierge@apolitical.co",className:"gtm-trackable","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"email-concierge-click"};break;default:g+="default",y={href:"/pages/who-can-join-the-community","data-gtm-event-context":"DefaultEmailHelperTextBox","data-gtm-event-type":"LearnMoreClick"};break}o({...s,path:g,type:m,link:y,mail:v})},[t]);const d={};return["link","mail"].forEach(g=>{d[g]=Object.keys(s[g]).length?m=>h.jsx("a",{...s[g],children:m}):m=>m}),h.jsx(I4,{id:e,type:s.type,heading:l?!1:a.formatMessage({id:`${s.path}_title`}),"aria-live":"assertive",children:l?h.jsxs(h.Fragment,{children:[h.jsx(pr,{element:"span"}),h.jsx(pr,{element:"span"})]}):a.formatMessage({id:`${s.path}_text`},{...d,strong:g=>h.jsx("strong",{children:g}),em:g=>h.jsx("em",{children:g}),br:h.jsxs(h.Fragment,{children:[h.jsx("br",{}),h.jsx("br",{})]}),error:s.error})})},xs=({className:e="",element:t="input",id:n,inputRef:r,functions:i={onChange:()=>{}},name:a=n,placeholder:s,type:o="text",value:l,autoFocus:u,label:c,styling:d={},...f})=>{const p=E.useRef(),g=r||p,{autosizeToFit:m=!1}=d;h4(m&&t==="textarea",g),E.useEffect(()=>{var v;u&&((v=g.current)==null||v.focus())},[]),!(f!=null&&f.autoComplete)&&["email"].includes(o)&&(f.autoComplete="email");const y={};return t==="input"&&(y.type=o),E.createElement(t,{ref:g,...f,...y,id:n,name:a,className:ne(e,t,{autoresize:m}),value:l,placeholder:s,autoFocus:u,...i,onChange:v=>{const b=v.target;i.onChange(b.value)}})};const is={UP:"ArrowUp",DOWN:"ArrowDown",ENTER:"Enter"},J6=500,ew=({id:e,name:t=e,value:n,placeholder:r,functions:i={onChange:()=>{},onKeyInput:async()=>new Promise(()=>{})},...a})=>{const{onChange:s=()=>{},onKeyInput:o=async()=>{}}=i,[{input:l,displayInput:u,debouncedInput:c},d]=E.useState({input:n,displayInput:n,debouncedInput:n}),[{predictions:f,activePredictionIndex:p,isPredictionSelected:g},m]=E.useState({predictions:[],activePredictionIndex:-1,isPredictionSelected:!!n}),{formatMessage:y}=ue.useIntl();r||(r=y({id:"inputAutocomplete_placeholder"})),E.useEffect(()=>{const _=setTimeout(()=>{g||d(C=>({...C,debouncedInput:l}))},J6);return()=>{clearTimeout(_)}},[l,g]),E.useEffect(()=>{c&&!g?(async()=>{try{const C=await o(c)||[];m(A=>({...A,predictions:C}))}catch(C){console.error("Error fetching predictions:",C),m(A=>({...A,predictions:[]}))}})():m(_=>({..._,predictions:[]}))},[c,g]),E.useEffect(()=>{p>=0&&f[p]&&d(_=>({..._,displayInput:f[p].description}))},[p,f]);const v=_=>{[is.DOWN,is.UP,is.ENTER].includes(_.key)&&(_.preventDefault(),_.key===is.DOWN&&p<f.length-1?m(C=>({...C,activePredictionIndex:p+1})):_.key===is.UP&&p>0?m(C=>({...C,activePredictionIndex:p-1})):_.key===is.ENTER&&p>-1&&(s(f[p].description),d(C=>({...C,input:f[p].description})),m(C=>({...C,predictions:[],isPredictionSelected:!0}))))},b=_=>{s(_.target.value),d(C=>({...C,input:_.target.value,displayInput:_.target.value})),m(C=>({...C,activePredictionIndex:-1,isPredictionSelected:!1}))},T=_=>{s(_.description),d(C=>({...C,input:_.description,displayInput:_.description})),m(C=>({...C,isPredictionSelected:!0,predictions:[]}))};return h.jsxs(h.Fragment,{children:[h.jsx("input",{type:"text",value:u,onChange:b,onKeyDown:v,placeholder:r,name:t,id:e,...a}),h.jsx("ul",{className:"predictions-list",children:f.map((_,C)=>h.jsx("li",{onClick:()=>T(_),onMouseEnter:()=>m(A=>({...A,activePredictionIndex:C})),className:ne("predictions-list-item",{active:C===p}),children:_.description},C))})]})};const tm=({className:e="",disabled:t,element:n="p",functions:r={onChange:()=>{}},id:i,inputRef:a,intlPath:s=!1,label:o,shownValue:l=!0,type:u="checkbox",value:c,accessibilityOptions:{checkboxes:{navigateWithArrowKeys:d=!1}={}}={},...f})=>{const p=ue.useIntl(),{onChange:g,...m}=r,y=()=>{t||g(c?null:l)},v=h.jsxs(h.Fragment,{children:[h.jsx("input",{ref:a,id:i,name:i,type:u,value:l,checked:c,readOnly:!0,disabled:t,tabIndex:-1}),h.jsx("span",{className:ne("pretty-checkbox",{radio:u==="radio"}),"data-testid":"pretty-checkbox"}),h.jsx("label",{htmlFor:i,onKeyDown:b=>{(b.key==="Enter"||b.code==="Space")&&(b.preventDefault(),b.stopPropagation(),y())},tabIndex:c||!d?0:-1,children:o||p.formatMessage({id:s?`${s}_${i}`:i})})]});return E.createElement(n,{onClick:b=>{const T=b.target;T.nodeName.toLowerCase()==="a"||T.parentNode&&T.parentNode.nodeName.toLowerCase()==="a"||(b.preventDefault(),b.stopPropagation(),y())},onKeyDown:d?b=>{var T,_,C;if(b.key!=="Tab")switch(b.code){case"Enter":case"Space":b.stopPropagation(),b.preventDefault(),y();break;case"ArrowLeft":case"ArrowRight":b.stopPropagation(),b.preventDefault();const A=b.currentTarget;let S=A==null?void 0:A.nextElementSibling;if(b.key==="ArrowLeft"){const I=A==null?void 0:A.previousElementSibling;I?S=I:S=(T=A==null?void 0:A.parentElement)==null?void 0:T.lastElementChild}else S||(S=(_=A==null?void 0:A.parentElement)==null?void 0:_.firstElementChild);S&&((C=S==null?void 0:S.querySelector("label"))==null||C.focus());break}}:void 0,className:ne(i,"checkbox-wrapper",e,{"is-checked":c}),...f,...m},v)};const tw=E.memo(function({direction:t="down"}){return h.jsx(p1,{className:ne("rotating-chevron",`direction-${t}`)})});const nw=({className:e,options:t,initialValue:n,value:r,functions:i={onChange:()=>{},onMultiSelectSubmit:()=>{}},gtm:{context:a}={context:""},placeholder:s,multiSelect:o,multiSelectOptions:l,id:u})=>{const c=ue.useIntl(),[d,f]=E.useState(!1),p=r||n,g=Array.isArray(p)?[...p]:p?[p]:[],[m,y]=E.useState(g);let v;Array.isArray(m)&&m.length===1&&typeof m[0]=="string"?v=t&&m?t.find(S=>S.id===m[0]):t?t[0]:{id:"",label:""}:Array.isArray(m)&&m.length===1&&typeof m[0]!="string"?v=m[0]:v={id:"",label:""},E.useEffect(()=>{y(g)},[r,n]);const{onChange:b,onMultiSelectSubmit:T,..._}=i,C=S=>{if(o){let I=[];m!=null&&m.includes(S.id)?I=m.filter(B=>B!==S.id):I=[...m,S.id],y([...I]),b&&b([...I])}else y([S]),b&&b(S.id),f(!1)},A=S=>{if(S==="all"){const I=(t==null?void 0:t.map(B=>B.id))||[];y(I),b&&b(I)}else y([]),b&&b([])};return h.jsxs("div",{className:ne("dropdown-wrapper",e),children:[h.jsxs("button",{className:"input","aria-expanded":d,"aria-haspopup":"listbox","aria-controls":"dropdown-list",onClick:S=>{S.preventDefault(),S.stopPropagation(),f(!d)},"data-testid":"dropdown-selector",..._,children:[o?`${s} · ${m.length}`:v.label,h.jsx(tw,{direction:d?"up":"down"})]}),h.jsx("select",{defaultValue:v.id,onChange:S=>{S.preventDefault(),S.stopPropagation();const I=t&&t.find(B=>B.id===S.target.value);C(I)},hidden:!d,..._,children:t==null?void 0:t.map(S=>h.jsx("option",{value:S.id,className:"gtm-trackable","data-gtm-event-type":`${S.id}-click`,"data-gtm-event-context":a,children:S.label},S.id))}),h.jsxs("div",{className:"menu-options input dropdown-menu",role:"menu",hidden:!d,children:[h.jsxs("div",{className:"dropdown-menu-list",children:[(l==null?void 0:l.topbar)&&h.jsxs("div",{className:"action-bar",children:[h.jsx("p",{children:`${m==null?void 0:m.length} selected`}),h.jsxs("ul",{children:[h.jsx("li",{children:h.jsx(Fe,{variant:"tertiary",size:"small",onClick:()=>A("all"),className:"gtm-trackable","data-gtm-event-type":"all-click","data-gtm-event-context":a,children:c.formatMessage({id:"dropdown_menu_multiselect_all"})})}),h.jsx("li",{children:h.jsx(Fe,{variant:"tertiary",size:"small",onClick:()=>A("none"),className:"gtm-trackable","data-gtm-event-type":"none-click","data-gtm-event-context":a,children:c.formatMessage({id:"dropdown_menu_multiselect_none"})})})]})]}),h.jsx("ul",{children:t==null?void 0:t.map(S=>{const I=S.id===v.id||(m==null?void 0:m.includes(S))||(m==null?void 0:m.includes(S.id));return h.jsx("li",{"data-testid":"dropdown-options",children:h.jsxs("button",{className:ne("gtm-trackable",{selected:I,"selected-single":I&&!o}),"data-gtm-event-type":`${S.id}-click`,"data-gtm-event-context":a,onClick:B=>{B.preventDefault(),B.stopPropagation(),C(S)},role:"menuitem","aria-current":I,"data-testid":I?"current-selection":"",children:[o&&h.jsx("span",{className:"pretty-checkbox","data-testid":"pretty-checkbox"}),h.jsx("span",{className:ne({"menu-option-label":o}),children:S.label})]})},S.id)})})]}),(l==null?void 0:l.submitSection)&&h.jsx("p",{className:"submit",children:h.jsx(Fe,{variant:"secondary",onClick:()=>{T&&T(m),document.dispatchEvent(new CustomEvent("dropdownMultiSelectSubmit",{detail:{id:u||"dropdown-multi-select",value:m}})),f(!1)},children:c.formatMessage({id:"form_submit"})})})]})]})},Wo=(e,t)=>{switch(e){case"required":if(!t||typeof t=="string"&&t.trim().length===0)return!0;break;case"no-numbers":if(t&&!/^([^0-9]*)$/.test(t))return!0;break;case"valid-email":if(t&&!/^(([^<>()[\]\\.,;:\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,}))$/.test(t))return!0;break;case"valid-url":if(t&&!/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-._~:/?#[\]@!$&'()*+,;=%]+$/i.test(t))return!0;break;default:return!1}return!1};let Td=null;const rw=({id:e,label:t,limit:n,value:r,placeholder:i,functions:a,error:s,multipleInputs:o,validation:l,fieldData:u,type:c,...d})=>{const f=ue.useIntl(),{showCount:p=!1,label:g,defaultInputs:m=1,maxInputs:y=100,hasButton:v=!1,allowDuplicateValues:b=!1}=o||{},[T,_]=E.useState(r?Array.isArray(r)?r:[r]:Array(m).fill("")),C=T.filter(F=>F!==""),A=()=>{if(!u)return;const F=ur(u.fields).filter(({id:k,name:M})=>(k||(k=M||""),k!==e&&!k.includes(`${e}-`))),R=[];T.map((k,M)=>{if(y&&M>=y)return;const $=ur(l??[]);e&&(b||$.push({condition:z=>{var D;const P=z[e].toLowerCase(),te=((D=z[`${e}-all`])==null?void 0:D.length)??0,ee=new Set(z[`${e}-all`].map(x=>x.toLowerCase()));return ee.has(P)&&ee.size<te},error:f==null?void 0:f.formatMessage({id:"form_error_multipleInputs_same"})}),$.forEach(z=>{const{condition:P,error:te}=z;if(typeof P=="function")z.condition=ee=>{var V;let D=(V=ee==null?void 0:ee[e])==null?void 0:V[M];D||(ee[e]&&!Array.isArray(ee[e])?D=ee[e]:D="");const x=ur(ee);return x[e]=D,x[`${e}-all`]=ee[e],typeof P=="function"&&P(x)?te:!1};else{const ee=P;z.condition=D=>{var V;let x=(V=D==null?void 0:D[e])==null?void 0:V[M];switch(x||(D[e]&&!Array.isArray(D[e])?x=D[e]:x=""),ee){case"required":te||(z.error=f==null?void 0:f.formatMessage({id:"form_error_required"}));break;case"no-numbers":te||(z.error=f==null?void 0:f.formatMessage({id:"form_error_numbers"}));break;case"valid-email":te||(z.error=te||(f==null?void 0:f.formatMessage({id:"form_error_email"})));break;case"valid-url":te||(z.error=f==null?void 0:f.formatMessage({id:"form_error_url"}));break;default:console.warn("WARNING! No field validation condition has been set")}return Wo(ee,x)?z.error:!1}}}),R.push({id:`${e}-${M}`,validation:$,value:k}))});const N={fieldsToValidate:F.concat(R)};u.multipleInputs.includes(e)&&(N.multipleInputs=u.multipleInputs.filter(k=>k!==e)),u.setFields(k=>({...k,...N}))};E.useEffect(()=>{A()},[T.length]),E.useEffect(()=>{!u||!u.multipleInputs||u.multipleInputs.includes(e)&&A()},[u==null?void 0:u.multipleInputs]);const S=()=>{(!y||T.length<y)&&_([...T,""])},I=F=>{const R=document.getElementById(`${e}-${F+1}`);R==null||R.focus()},B=(F,R)=>F.replace("{number}",R+1);return h.jsxs("fieldset",{className:ne("multiple-inputs field-wrapper",{"has-button":v,"has-legend":t}),children:[t?h.jsxs("legend",{className:"legend-as-label text-small",children:[t,p?h.jsxs(h.Fragment,{children:[" ",h.jsx("small",{className:"filled-in-count","aria-label":f.formatMessage({id:"form_multipleInputs_filledInCount_aria"},{number:C.length,total:y}),children:f.formatMessage({id:"form_multipleInputs_filledInCount"},{number:C.length,total:y})})]}):""]}):h.jsx(h.Fragment,{}),T.map((F,R)=>{if(y&&R>=y)return h.jsx(h.Fragment,{});let N=!1;t?N=h.jsx(ct,{showOnFocus:!1,children:f.formatMessage({id:"form_multipleInputs_label"},{number:R+1})}):g&&(N=B(g,R));const k=`${e}-${R}`,M=R+1>m;return h.jsx(Cb,{id:k,type:"text",label:N,value:F,placeholder:i?B(i,R):void 0,className:ne({"has-remove-button":M}),limit:n,error:s&&typeof s!="string"?s==null?void 0:s[k]:void 0,functions:{...a,onFocus:()=>{v||R!==T.length-1||S()},onKeyDown:$=>{$.key==="Enter"&&($.preventDefault(),$.stopPropagation(),Td&&clearTimeout(Td),R!==T.length-1?I(R):(S(),Td=setTimeout(()=>I(R),100)))},onChange:$=>{const z=T[R].toLowerCase(),P=ur(T);P[R]=$,_(P),u==null||u.dispatch({type:"removeError",payload:{key:k}}),b||P.forEach((te,ee)=>{Tl(te)&&ee!==R&&te.toLowerCase()===z&&(u==null||u.dispatch({type:"removeError",payload:{key:`${e}-${ee}`}}))}),a==null||a.onChange(P)}},siblings:M?h.jsx(Fe,{variant:"tertiary",size:"small",icon:"close",screenreaderText:f.formatMessage({id:"form_multipleInputs_remove"}),onClick:()=>{const $=ur(T);$.splice(R,1),_($),u==null||u.dispatch({type:"removeError",payload:{key:k}}),a==null||a.onChange($)}}):void 0,...d},k)}),v?h.jsx(Fe,{...v,onClick:S,disabled:!!(y&&y<=T.length)}):h.jsx(h.Fragment,{})]})};const Pg=({className:e="",functions:t={onChange:()=>{}},intlPath:n=!1,id:r,label:i,multiSelect:a=!1,name:s,options:o,required:l,type:u="checkboxes",value:c,accessibilityOptions:d,styling:{displayOptionsAsPills:f=!1}={},multipleOptions:p,...g})=>{const m=ue.useIntl(),y=a?c:[],v=c;return h.jsx("ul",{...g,className:ne("options-wrapper",e,{"with-pills filters":f}),"data-testid":`ul-${r}`,children:o==null?void 0:o.map(({id:b,label:T=!1,value:_=b,disabled:C=void 0})=>{const A=`${r}_${b}`;C===void 0&&(C=p!=null&&p.limit?y.length>=p.limit&&!y.includes(_):!1);const S=()=>{if(C)return;let I;if(a){const B=y==null?void 0:y.indexOf(_);Array.isArray(y)&&B>=0?(I=y,I.splice(B,1)):(!y||y.length===0?I=[]:I=y,I.push(_))}else I=v===_?void 0:_;t.onChange(I)};return h.jsx(tm,{element:"li",id:A,type:u==="checkboxes"?"checkbox":"radio",shownValue:_,value:a?y==null?void 0:y.includes(_):v===_,functions:{...t,onChange:S},intlPath:n,label:T||m.formatMessage({id:n?`${n}_${b}`:b}),disabled:C,accessibilityOptions:d,className:ne({disabled:C})},A)})})};const _b=({inputRef:e,type:t="password",gtm:{context:n}={context:void 0},autoComplete:r="on",...i})=>{const a=ue.useIntl(),s=E.useRef(),o=e||s,[l,u]=E.useState(!1),[c,d]=E.useState(t),f=()=>{var p;u(!l),d(l?"password":"text"),(p=o.current)==null||p.focus()};return h.jsxs(h.Fragment,{children:[h.jsx("button",{type:"button",className:ne("show-password gtm-trackable",{"password-visible":l}),"data-gtm-event-context":n,"data-gtm-event-type":`${l?"hide":"show"}-password-click`,onClick:f,"aria-label":a.formatMessage({id:`showpassword_aria_${l?"hide":"show"}`}),children:a.formatMessage({id:`showpassword_${l?"hide":"show"}`})}),h.jsx(xs,{inputRef:o,type:c,autoComplete:r,...i})]})};const as={text:{component:xs},email:{component:xs},url:{component:xs},textarea:{component:xs,props:{element:"textarea",rows:4,cols:10}},checkbox:{component:tm},checkboxes:{component:Pg,props:{multiSelect:!0}},radio:{component:Pg,props:{multiSelect:!1}},select:{component:nw},password:{component:_b},autocomplete:{component:ew},"multiple-inputs":{component:h.jsx(h.Fragment,{})}},Cb=e=>{const t=ue.useIntl(),{id:n,intlPath:r=!1,className:i="",error:a,functions:s={onChange:()=>{}},limit:o=0,showRequiredLabels:l=!0,type:u,validation:c,value:d,submitOnEnter:f,fieldData:p,siblings:g,...m}=e;if(u&&u==="multiple-inputs")return h.jsx(rw,{...e});const y=c&&c.some(({condition:M})=>M==="required"),v=T1(d),b=u&&as[u]&&as[u].component?as[u].component:xs,T=u&&["checkboxes","radio"].includes(u),_=u&&["autocomplete"].includes(u),C=a&&`error-${n}`,A=`character-limit-${n}`,S={};T?S.element="legend":S.htmlFor=n;let I={...m,id:n,name:n,className:a?"error":"",type:u,required:y,"aria-required":y,functions:ur(s),value:d};const B=M=>{I["aria-describedby"]?I["aria-describedby"]+=` ${M}`:I["aria-describedby"]=M};if(o>0){const M=bb(o,s);B(`${A}-info`),I={...I,...M},M.functions&&typeof M.functions=="object"&&(I.functions={...I.functions,...M.functions})}u&&as[u]&&as[u].props&&(I={...I,...as[u].props}),T&&(I.intlPath=`${r}_${n}`),a&&(I["aria-invalid"]=!0,I["aria-errormessage"]=C,B(C));const F=m.label||t.formatMessage({id:r?`${r}_${n}`:n}),R=({...M})=>a?E.createElement(M.as||"p",{id:C,className:"error text-small",...M},a):null;if(u&&["checkbox"].includes(u))return h.jsxs(h.Fragment,{children:[h.jsx(b,{...I,label:F,className:ne("field-wrapper",i)}),h.jsx(R,{as:"p"})]});const N={};T?S.className="legend-as-label text-small":N.className="field-label";const k=({element:M,...$})=>E.createElement(M||"label",{...$,"data-testid":`label-${n}`});return h.jsx(h.Fragment,{children:E.createElement(T?"fieldset":"div",{className:ne("field-wrapper text-small",i,`${u}-wrapper`,{"multiple-options-wrapper":T})},h.jsxs(h.Fragment,{children:[m.label===!1?h.jsx(h.Fragment,{}):E.createElement(T?E.Fragment:"p",N,h.jsxs(k,{...S,children:[F,y&&l&&h.jsxs(h.Fragment,{children:[" ",h.jsxs("small",{children:["(",t.formatMessage({id:"form_fieldWrapper_required"}),")"]})]})]})),E.createElement(T||_?"div":"p",{className:"field-component"},h.jsxs(h.Fragment,{children:[h.jsx(b,{...I}),h.jsx(em,{id:A,limit:o,valueLength:v}),g]})),h.jsx(R,{})]}))})},iw=(e,t)=>{const{type:n,payload:r}=t,i=e.errors?ur(e.errors):{},a=e.values?ur(e.values):{};switch(n){case"updateValue":if(r!=null&&r.key&&i[r==null?void 0:r.key]&&delete i[r==null?void 0:r.key],r!=null&&r.key){if(["isSubmitting","formSubmitted","errors"].includes(r==null?void 0:r.key))return{...e,errors:i,[r==null?void 0:r.key]:r==null?void 0:r.value};a[r==null?void 0:r.key]=r==null?void 0:r.value}return{...e,errors:i,values:a};case"addError":return r!=null&&r.key&&!i[r==null?void 0:r.key]&&(i[r==null?void 0:r.key]=r==null?void 0:r.value),{...e,errors:i};case"removeError":return r!=null&&r.key&&i[r==null?void 0:r.key]&&delete i[r==null?void 0:r.key],{...e,errors:i};case"submitForm":{const{fields:s=[],dispatch:o=()=>{},onSuccess:l=()=>{},onFailure:u=()=>{},intl:c}=r,d=ur(Object.keys(i));for(const f of s)if(f.validation)for(let p=0;p<f.validation.length;p++){const{condition:g="required",error:m=!1}=f.validation[p];let y=!1;if(typeof g=="function"){const v=g(a);v&&(y=m||v)}else{const v=a[f.id],b=g;switch(b){case"required":Wo(b,v)&&(y=m||(c==null?void 0:c.formatMessage({id:"form_error_required"})));break;case"no-numbers":{Wo(b,v)&&(y=m||(c==null?void 0:c.formatMessage({id:"form_error_numbers"})));break}case"valid-email":{Wo(b,v)&&(y=m||(c==null?void 0:c.formatMessage({id:"form_error_email"})));break}case"valid-url":{Wo(b,v)&&(y=m||(c==null?void 0:c.formatMessage({id:"form_error_url"})));break}default:console.warn("WARNING! No field validation condition has been set")}}if(y){o({type:"addError",payload:{key:f.id,value:y}}),d.push(f.id);break}}return d.length===0?l(a):u(a,d),e}case"formSubmitted":return{...e,isSubmitting:!1,formSubmitted:!0,errors:{}};case"formSubmittedAndReset":return{isSubmitting:!1,formSubmitted:!0,errors:{}};default:return e}};let _d=null;const Nr=({element:e="form",fields:t,className:n="",id:r=t.length?`form__${t[0].id}`:"form",formRef:i,intlPath:a=!1,button:s={variant:"primary",size:"large",customOnSubmit:!1},secondaryActionButton:o={variant:"secondary",size:"large"},meta:l,children:u,gtm:c={context:"Form",event:"form-submit-click"},functions:d,...f})=>{const p=(t||[]).filter(J=>J.type==="multiple-inputs").map(J=>J.id),[g,m]=E.useState({fieldsToValidate:t,multipleInputs:p});E.useEffect(()=>{g.multipleInputs.length||m(J=>({...J,fieldsToValidate:t,multipleInputs:p}))},[t.length]);const{customOnSubmit:y,hideButton:v,...b}=s,T=40,{shouldShowCancelButton:_=!1,shouldReset:C=!0,shouldHide:A=!0,showRequiredLabels:S=!0,showSuccessMessage:I=!1,shouldScrollOnSuccess:B=!0}=l||{},{onSuccess:F=async()=>{},onCancel:R=()=>{},onCatch:N=()=>{},onFailure:k=()=>{}}=d||{},M=ue.useIntl(),$={};t.length&&t.forEach(J=>{const W=J.id||J.name;W&&($[W]=J.value||"")});const[z,P]=E.useReducer(iw,{isSubmitting:!1,formSubmitted:!1,errors:{},values:$}),{errors:te,isSubmitting:ee,formSubmitted:D,values:x}=z;E.useEffect(()=>{C&&D&&(_d=setTimeout(()=>{P({type:"updateValue",payload:{key:"formSubmitted",value:!1}})},3e3))},[D]),E.useEffect(()=>()=>{_d&&clearTimeout(_d)},[]),E.useEffect(()=>{const J=W=>{P({type:"updateValue",payload:{key:W.detail.id,value:W.detail.value}})};return document.addEventListener("dropdownMultiSelectSubmit",J),()=>{document.removeEventListener("dropdownMultiSelectSubmit",J)}},[]);const V=E.useRef(null),L=i||V,H=El(()=>{if(!ee){if(P({type:"updateValue",payload:{key:"isSubmitting",value:!0}}),typeof s.disabled=="object"&&s.disabled.isClickable){P({type:"submitForm",payload:{fields:g.fieldsToValidate,dispatch:P,intl:M,onFailure:(J,W)=>{U(),k(J,W),P({type:"updateValue",payload:{key:"isSubmitting",value:!1}})}}});return}P({type:"submitForm",payload:{fields:g.fieldsToValidate,dispatch:P,onSuccess:async J=>{B&&U();try{await F(J),P({type:C?"formSubmittedAndReset":"formSubmitted"})}catch(W){N(W),P({type:"updateValue",payload:{key:"isSubmitting",value:!1}})}},onFailure:(J,W)=>{U(),k(J,W),P({type:"updateValue",payload:{key:"isSubmitting",value:!1}})},intl:M}})}},100);if(!t.length)return null;const j={};s.children&&(j.default=s.children),b.text&&typeof b.text=="string"&&(j.default=b.text),["default","submitting","submitted"].forEach(J=>{b.text&&typeof b.text!="string"&&J in b.text?j[J]=b.text[J]:j[J]||(j[J]=M.formatMessage({id:`form_${J==="default"?"submit":J}`}))}),delete b.text;const U=()=>{var ae;let J=0;if((ae=L==null?void 0:L.current)!=null&&ae.id){const oe=document.getElementById(L.current.id);oe&&(J=oe.getBoundingClientRect().top+window.scrollY)}const W=document.getElementById("header");W&&(J=J-W.offsetHeight-T),J<0&&(J=0),window.scrollTo({top:J,behavior:"smooth"})},Q=J=>{J.preventDefault(),J.stopPropagation(),!ee&&H()},ie=[{...b,icon:D?{icon:"tick",position:"left"}:!1,className:ne("gtm-trackable",b.className),onClick:Q,disabled:ee||D||s.disabled,"data-gtm-event-context":c.context,"data-gtm-event-type":c.event,children:j[ee?"submitting":D?"submitted":"default"]}];return _&&ie.unshift({...o,className:ne("gtm-trackable",o.className),"data-gtm-event-context":c.context,"data-gtm-event-type":c.event,disabled:ee||D,onClick:R,children:o.text||M.formatMessage({id:"form_cancel"})}),h.jsxs(h.Fragment,{children:[E.createElement(e,{...f,id:r,className:ne("form",n),ref:L},h.jsxs(h.Fragment,{children:[te!=null&&te.general?h.jsx(Xr,{variant:"error",text:M.formatMessage({id:"form_error_generalError"})}):null,u,(!A||!ee&&!D||y)&&t.map((J,W)=>{const{id:ae=J.name||W,component:oe,functions:be={onChange:()=>{}},submitOnEnter:we=!1}=J;if(oe)return h.jsx(oe,{...J.props||{}},`component-${ae}-${W}`);const He=(x==null?void 0:x[ae])||"",Be={...be,onChange:$e=>{P({type:"updateValue",payload:{key:ae,value:$e}}),be.onChange($e,P)}};return we&&(Be.onKeyDown=$e=>{$e.key==="Enter"&&($e.stopPropagation(),$e.preventDefault(),H()),be.onKeyDown&&be.onKeyDown($e)}),h.jsx(Cb,{intlPath:a,...J,showRequiredLabels:S,value:He,error:J.type==="multiple-inputs"?te:te==null?void 0:te[ae],functions:Be,fieldData:{fields:g.fieldsToValidate,multipleInputs:g.multipleInputs,setFields:m,dispatch:P}},ae)}),v?null:(ee||D)&&y?y:h.jsx(to,{className:ne("cta",{center:ee||D,submitted:D}),buttons:ie})]})),I&&D&&h.jsx(Us,{className:"success",children:typeof I=="string"?I:M.formatMessage({id:"form_success"})})]})};const fu="passwordRules_",xb="isMoreThanEightCharacters",wb="includesNumberAndSymbol",Ab="includesLowerAndUppercase",aw={[xb]:"8Characters",[wb]:"numberSymbol",[Ab]:"lowercaseUppercase"},sw=({matchingRules:e={isMoreThanEightCharacters:!1,includesNumberAndSymbol:!1,includesLowerAndUppercase:!1},className:t=""})=>{const n=ue.useIntl();return h.jsxs("aside",{className:ne("password-rules",t),children:[h.jsx("small",{children:n.formatMessage({id:`${fu}intro`})}),h.jsx("ul",{children:[xb,wb,Ab].map(r=>h.jsxs("li",{className:ne({matches:e[r]}),children:[h.jsxs(ct,{children:[n.formatMessage({id:`${fu}rule_label`})," "]}),h.jsx("span",{children:n.formatMessage({id:`${fu}rule_${aw[r]}`})}),!e[r]&&h.jsxs(ct,{element:"strong",children:[" ",n.formatMessage({id:`${fu}notMet`})]})]},`rule-${r}`))})]})},Sb=E.memo(sw);const ow=({text:e={},topRating:t=5,functions:{createRating:n=()=>null,updateRating:r=()=>{},reportError:i=()=>{}},className:a="",hasLoaded:s=!1})=>{const o=ue.useIntl(),[l,u]=E.useState({setUp:!1,id:null,rating:null,disabled:!0}),c=async()=>{try{const v=await n();u(b=>({...b,setUp:!0,id:v&&v.id,disabled:!1}))}catch(v){u(b=>({...b,setUp:!0,disabled:!0})),i(v)}};if(E.useEffect(()=>{s&&!l.setUp&&c()},[s]),!s)return h.jsx(pr,{className:"rating-placeholder"});const{id:d,rating:f,disabled:p}=l,g="ratings_",m={text:o.formatMessage({id:`${g}text`}),low:o.formatMessage({id:`${g}low`}),high:o.formatMessage({id:`${g}high`}),success:o.formatMessage({id:`${g}success`}),...e},y=async v=>{if(!(!d||p))try{u(b=>({...b,rating:v,disabled:!0})),await r({id:d,value:v})}catch(b){u(T=>({...T,rating:null})),i(b)}finally{u(b=>({...b,disabled:!1}))}};return h.jsxs("div",{className:ne("rating",a),children:[h.jsx("span",{className:"label",children:m[f?"success":"text"]}),h.jsx("ol",{children:Array.from(new Array(t).keys()).map(v=>{const b=v+1;return h.jsx("li",{className:ne({selected:f&&b<=f}),children:h.jsx(Fe,{variant:"tertiary",size:"small",icon:{icon:`star${!f||b>f?"_empty":""}`,position:"left",hover:"star"},screenreaderText:`${o.formatMessage({id:`${g}stars`},{number:b,total:t})}${b===1||b===t?` - ${m[b===1?"low":"high"]}`:""}`,onClick:T=>{T.preventDefault(),T.stopPropagation(),y(b)},disabled:p})},`rating-${b}`)})})]})},lw={id:"",showLinkEditor:!1,mentionPopover:{show:!1,selectedUser:0,possibleUsers:[],position:null,numberOfUsers:null},lastAnchor:null,isInOverlay:!1,dispatch:()=>{},enrichedUrl:void 0,onMention:()=>{},getLinkPreview:()=>Promise.resolve({}),reportError:e=>{console.error(e)}},Oi=E.createContext(lw),uw={tabbableOption:"",setFocus:()=>{},openTooltip:null,dispatch:()=>{}},Ll=E.createContext(uw);var re=(e=>(e.blockquote="block_quote",e.bold="bold",e.code="code",e.codeblock="code_block",e.heading="heading",e.hr="thematic_break",e.image="image",e.italic="italic",e.li="list_item",e.link="link",e.mention="mention",e.ol="ol_list",e.paragraph="paragraph",e.ul="ul_list",e.strikethrough="strikeThrough",e.span="span",e.h3="heading_three",e))(re||{}),qr=(e=>(e.delete="delete_mark",e.emphasis="emphasis_mark",e.code="inline_code_mark",e.strong="strong_mark",e))(qr||{});const cw=({attributes:e,children:t,element:n})=>{const r=n;switch(r.type){case re.blockquote:return h.jsx("blockquote",{className:"subtle",...e,children:t});case re.link:return h.jsx("a",{...e,children:t});case re.li:return h.jsx("li",{...e,children:t});case re.mention:const i=r;return i!=null&&i.name&&i.name===bl?h.jsxs("span",{...e,className:"mention deleted-user",children:["@",h.jsx(ue.FormattedMessage,{id:"member_deleted"}),t]}):h.jsxs("a",{...e,className:"mention",children:["@",(i==null?void 0:i.name)||"",t]});case re.ol:return h.jsx("ol",{...e,children:t});case re.ul:return h.jsx("ul",{...e,children:t});case re.span:return h.jsx("span",{...e,children:t});case re.paragraph:return h.jsx("p",{...e,children:t});case re.h3:return h.jsx("h3",{...e,children:t});default:return h.jsx("span",{...e,children:t})}},dw=({attributes:e,children:t,leaf:n})=>{const r=n;return r[re.bold]&&(t=h.jsx("strong",{children:t})),r[re.italic]&&(t=h.jsx("em",{children:t})),r[re.strikethrough]&&(t=h.jsx("s",{children:t})),h.jsx("span",{...e,children:t})};var fw=mw,kb="֑-߿יִ-﷽ﹰ-ﻼ",Db="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",hw=new RegExp("^[^"+Db+"]*["+kb+"]"),pw=new RegExp("^[^"+kb+"]*["+Db+"]");function mw(e){return e=String(e||""),hw.test(e)?"rtl":pw.test(e)?"ltr":"neutral"}const Ob=Or(fw);function gw(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var nm=gw,vw=typeof au=="object"&&au&&au.Object===Object&&au,yw=vw,Ew=yw,bw=typeof self=="object"&&self&&self.Object===Object&&self,Tw=Ew||bw||Function("return this")(),Nb=Tw,_w=Nb,Cw=function(){return _w.Date.now()},xw=Cw,ww=/\s/;function Aw(e){for(var t=e.length;t--&&ww.test(e.charAt(t)););return t}var Sw=Aw,kw=Sw,Dw=/^\s+/;function Ow(e){return e&&e.slice(0,kw(e)+1).replace(Dw,"")}var Nw=Ow,Iw=Nb,Pw=Iw.Symbol,Ib=Pw,Rg=Ib,Pb=Object.prototype,Rw=Pb.hasOwnProperty,Fw=Pb.toString,To=Rg?Rg.toStringTag:void 0;function Bw(e){var t=Rw.call(e,To),n=e[To];try{e[To]=void 0;var r=!0}catch{}var i=Fw.call(e);return r&&(t?e[To]=n:delete e[To]),i}var Mw=Bw,Lw=Object.prototype,$w=Lw.toString;function jw(e){return $w.call(e)}var Hw=jw,Fg=Ib,Uw=Mw,zw=Hw,qw="[object Null]",Ww="[object Undefined]",Bg=Fg?Fg.toStringTag:void 0;function Vw(e){return e==null?e===void 0?Ww:qw:Bg&&Bg in Object(e)?Uw(e):zw(e)}var Kw=Vw;function Gw(e){return e!=null&&typeof e=="object"}var Yw=Gw,Zw=Kw,Qw=Yw,Xw="[object Symbol]";function Jw(e){return typeof e=="symbol"||Qw(e)&&Zw(e)==Xw}var eA=Jw,tA=Nw,Mg=nm,nA=eA,Lg=0/0,rA=/^[-+]0x[0-9a-f]+$/i,iA=/^0b[01]+$/i,aA=/^0o[0-7]+$/i,sA=parseInt;function oA(e){if(typeof e=="number")return e;if(nA(e))return Lg;if(Mg(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Mg(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=tA(e);var n=iA.test(e);return n||aA.test(e)?sA(e.slice(2),n?2:8):rA.test(e)?Lg:+e}var lA=oA,uA=nm,Cd=xw,$g=lA,cA="Expected a function",dA=Math.max,fA=Math.min;function hA(e,t,n){var r,i,a,s,o,l,u=0,c=!1,d=!1,f=!0;if(typeof e!="function")throw new TypeError(cA);t=$g(t)||0,uA(n)&&(c=!!n.leading,d="maxWait"in n,a=d?dA($g(n.maxWait)||0,t):a,f="trailing"in n?!!n.trailing:f);function p(A){var S=r,I=i;return r=i=void 0,u=A,s=e.apply(I,S),s}function g(A){return u=A,o=setTimeout(v,t),c?p(A):s}function m(A){var S=A-l,I=A-u,B=t-S;return d?fA(B,a-I):B}function y(A){var S=A-l,I=A-u;return l===void 0||S>=t||S<0||d&&I>=a}function v(){var A=Cd();if(y(A))return b(A);o=setTimeout(v,m(A))}function b(A){return o=void 0,f&&r?p(A):(r=i=void 0,s)}function T(){o!==void 0&&clearTimeout(o),u=0,r=l=i=o=void 0}function _(){return o===void 0?s:b(Cd())}function C(){var A=Cd(),S=y(A);if(r=arguments,i=this,l=A,S){if(o===void 0)return g(l);if(d)return clearTimeout(o),o=setTimeout(v,t),p(l)}return o===void 0&&(o=setTimeout(v,t)),s}return C.cancel=T,C.flush=_,C}var Rb=hA;const pA=Or(Rb);var mA=Rb,gA=nm,vA="Expected a function";function yA(e,t,n){var r=!0,i=!0;if(typeof e!="function")throw new TypeError(vA);return gA(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),mA(e,t,{leading:r,maxWait:t,trailing:i})}var EA=yA;const bA=Or(EA),jg=e=>typeof e=="object"&&e!=null&&e.nodeType===1,Hg=(e,t)=>(!t||e!=="hidden")&&e!=="visible"&&e!=="clip",xd=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const n=getComputedStyle(e,null);return Hg(n.overflowY,t)||Hg(n.overflowX,t)||(r=>{const i=(a=>{if(!a.ownerDocument||!a.ownerDocument.defaultView)return null;try{return a.ownerDocument.defaultView.frameElement}catch{return null}})(r);return!!i&&(i.clientHeight<r.scrollHeight||i.clientWidth<r.scrollWidth)})(e)}return!1},hu=(e,t,n,r,i,a,s,o)=>a<e&&s>t||a>e&&s<t?0:a<=e&&o<=n||s>=t&&o>=n?a-e-r:s>t&&o<n||a<e&&o>n?s-t+i:0,TA=e=>{const t=e.parentElement;return t??(e.getRootNode().host||null)},Ug=(e,t)=>{var n,r,i,a;if(typeof document>"u")return[];const{scrollMode:s,block:o,inline:l,boundary:u,skipOverflowHiddenElements:c}=t,d=typeof u=="function"?u:z=>z!==u;if(!jg(e))throw new TypeError("Invalid target");const f=document.scrollingElement||document.documentElement,p=[];let g=e;for(;jg(g)&&d(g);){if(g=TA(g),g===f){p.push(g);break}g!=null&&g===document.body&&xd(g)&&!xd(document.documentElement)||g!=null&&xd(g,c)&&p.push(g)}const m=(r=(n=window.visualViewport)==null?void 0:n.width)!=null?r:innerWidth,y=(a=(i=window.visualViewport)==null?void 0:i.height)!=null?a:innerHeight,{scrollX:v,scrollY:b}=window,{height:T,width:_,top:C,right:A,bottom:S,left:I}=e.getBoundingClientRect(),{top:B,right:F,bottom:R,left:N}=(z=>{const P=window.getComputedStyle(z);return{top:parseFloat(P.scrollMarginTop)||0,right:parseFloat(P.scrollMarginRight)||0,bottom:parseFloat(P.scrollMarginBottom)||0,left:parseFloat(P.scrollMarginLeft)||0}})(e);let k=o==="start"||o==="nearest"?C-B:o==="end"?S+R:C+T/2-B+R,M=l==="center"?I+_/2-N+F:l==="end"?A+F:I-N;const $=[];for(let z=0;z<p.length;z++){const P=p[z],{height:te,width:ee,top:D,right:x,bottom:V,left:L}=P.getBoundingClientRect();if(s==="if-needed"&&C>=0&&I>=0&&S<=y&&A<=m&&C>=D&&S<=V&&I>=L&&A<=x)return $;const H=getComputedStyle(P),j=parseInt(H.borderLeftWidth,10),U=parseInt(H.borderTopWidth,10),Q=parseInt(H.borderRightWidth,10),ie=parseInt(H.borderBottomWidth,10);let J=0,W=0;const ae="offsetWidth"in P?P.offsetWidth-P.clientWidth-j-Q:0,oe="offsetHeight"in P?P.offsetHeight-P.clientHeight-U-ie:0,be="offsetWidth"in P?P.offsetWidth===0?0:ee/P.offsetWidth:0,we="offsetHeight"in P?P.offsetHeight===0?0:te/P.offsetHeight:0;if(f===P)J=o==="start"?k:o==="end"?k-y:o==="nearest"?hu(b,b+y,y,U,ie,b+k,b+k+T,T):k-y/2,W=l==="start"?M:l==="center"?M-m/2:l==="end"?M-m:hu(v,v+m,m,j,Q,v+M,v+M+_,_),J=Math.max(0,J+b),W=Math.max(0,W+v);else{J=o==="start"?k-D-U:o==="end"?k-V+ie+oe:o==="nearest"?hu(D,V,te,U,ie+oe,k,k+T,T):k-(D+te/2)+oe/2,W=l==="start"?M-L-j:l==="center"?M-(L+ee/2)+ae/2:l==="end"?M-x+Q+ae:hu(L,x,ee,j,Q+ae,M,M+_,_);const{scrollLeft:He,scrollTop:Be}=P;J=we===0?0:Math.max(0,Math.min(Be+J/we,P.scrollHeight-te/we+oe)),W=be===0?0:Math.max(0,Math.min(He+W/be,P.scrollWidth-ee/be+ae)),k+=Be-J,M+=He-W}$.push({el:P,top:J,left:W})}return $},_A=e=>e===!1?{block:"end",inline:"nearest"}:(t=>t===Object(t)&&Object.keys(t).length!==0)(e)?e:{block:"start",inline:"nearest"};function CA(e,t){if(!e.isConnected||!(i=>{let a=i;for(;a&&a.parentNode;){if(a.parentNode===document)return!0;a=a.parentNode instanceof ShadowRoot?a.parentNode.host:a.parentNode}return!1})(e))return;const n=(i=>{const a=window.getComputedStyle(i);return{top:parseFloat(a.scrollMarginTop)||0,right:parseFloat(a.scrollMarginRight)||0,bottom:parseFloat(a.scrollMarginBottom)||0,left:parseFloat(a.scrollMarginLeft)||0}})(e);if((i=>typeof i=="object"&&typeof i.behavior=="function")(t))return t.behavior(Ug(e,t));const r=typeof t=="boolean"||t==null?void 0:t.behavior;for(const{el:i,top:a,left:s}of Ug(e,_A(t))){const o=a-n.top+n.bottom,l=s-n.left+n.right;i.scroll({top:o,left:l,behavior:r})}}/*!
63
+ */function bg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Tg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bg(Object(n),!0).forEach(function(r){K7(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bg(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function K7(e,t,n){return t=Y7(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function G7(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Y7(e){var t=G7(e,"string");return typeof t=="symbol"?t:String(t)}var _g={activateTrap:function(t,n){if(t.length>0){var r=t[t.length-1];r!==n&&r.pause()}var i=t.indexOf(n);i===-1||t.splice(i,1),t.push(n)},deactivateTrap:function(t,n){var r=t.indexOf(n);r!==-1&&t.splice(r,1),t.length>0&&t[t.length-1].unpause()}},Z7=function(t){return t.tagName&&t.tagName.toLowerCase()==="input"&&typeof t.select=="function"},Q7=function(t){return(t==null?void 0:t.key)==="Escape"||(t==null?void 0:t.key)==="Esc"||(t==null?void 0:t.keyCode)===27},Xo=function(t){return(t==null?void 0:t.key)==="Tab"||(t==null?void 0:t.keyCode)===9},X7=function(t){return Xo(t)&&!t.shiftKey},J7=function(t){return Xo(t)&&t.shiftKey},Cg=function(t){return setTimeout(t,0)},xg=function(t,n){var r=-1;return t.every(function(i,a){return n(i)?(r=a,!1):!0}),r},Eo=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return typeof t=="function"?t.apply(void 0,r):t},uu=function(t){return t.target.shadowRoot&&typeof t.composedPath=="function"?t.composedPath()[0]:t.target},e6=[],t6=function(t,n){var r=(n==null?void 0:n.document)||document,i=(n==null?void 0:n.trapStack)||e6,a=Tg({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:X7,isKeyBackward:J7},n),s={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},o,l=function(N,k,M){return N&&N[k]!==void 0?N[k]:a[M||k]},u=function(N,k){var M=typeof(k==null?void 0:k.composedPath)=="function"?k.composedPath():void 0;return s.containerGroups.findIndex(function($){var z=$.container,P=$.tabbableNodes;return z.contains(N)||(M==null?void 0:M.includes(z))||P.find(function(te){return te===N})})},c=function(N){var k=a[N];if(typeof k=="function"){for(var M=arguments.length,$=new Array(M>1?M-1:0),z=1;z<M;z++)$[z-1]=arguments[z];k=k.apply(void 0,$)}if(k===!0&&(k=void 0),!k){if(k===void 0||k===!1)return k;throw new Error("`".concat(N,"` was specified but was not a node, or did not return a node"))}var P=k;if(typeof k=="string"&&(P=r.querySelector(k),!P))throw new Error("`".concat(N,"` as selector refers to no known node"));return P},d=function(){var N=c("initialFocus");if(N===!1)return!1;if(N===void 0||!pc(N,a.tabbableOptions))if(u(r.activeElement)>=0)N=r.activeElement;else{var k=s.tabbableGroups[0],M=k&&k.firstTabbableNode;N=M||c("fallbackFocus")}if(!N)throw new Error("Your focus-trap needs to have at least one focusable element");return N},f=function(){if(s.containerGroups=s.containers.map(function(N){var k=ab(N,a.tabbableOptions),M=sb(N,a.tabbableOptions),$=k.length>0?k[0]:void 0,z=k.length>0?k[k.length-1]:void 0,P=M.find(function(D){return Aa(D)}),te=M.slice().reverse().find(function(D){return Aa(D)}),ee=!!k.find(function(D){return Zi(D)>0});return{container:N,tabbableNodes:k,focusableNodes:M,posTabIndexesFound:ee,firstTabbableNode:$,lastTabbableNode:z,firstDomTabbableNode:P,lastDomTabbableNode:te,nextTabbableNode:function(x){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,L=k.indexOf(x);return L<0?V?M.slice(M.indexOf(x)+1).find(function(H){return Aa(H)}):M.slice(0,M.indexOf(x)).reverse().find(function(H){return Aa(H)}):k[L+(V?1:-1)]}}}),s.tabbableGroups=s.containerGroups.filter(function(N){return N.tabbableNodes.length>0}),s.tabbableGroups.length<=0&&!c("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(s.containerGroups.find(function(N){return N.posTabIndexesFound})&&s.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},p=function R(N){var k=N.activeElement;if(k)return k.shadowRoot&&k.shadowRoot.activeElement!==null?R(k.shadowRoot):k},g=function R(N){if(N!==!1&&N!==p(document)){if(!N||!N.focus){R(d());return}N.focus({preventScroll:!!a.preventScroll}),s.mostRecentlyFocusedNode=N,Z7(N)&&N.select()}},m=function(N){var k=c("setReturnFocus",N);return k||(k===!1?!1:N)},y=function(N){var k=N.target,M=N.event,$=N.isBackward,z=$===void 0?!1:$;k=k||uu(M),f();var P=null;if(s.tabbableGroups.length>0){var te=u(k,M),ee=te>=0?s.containerGroups[te]:void 0;if(te<0)z?P=s.tabbableGroups[s.tabbableGroups.length-1].lastTabbableNode:P=s.tabbableGroups[0].firstTabbableNode;else if(z){var D=xg(s.tabbableGroups,function(U){var Q=U.firstTabbableNode;return k===Q});if(D<0&&(ee.container===k||pc(k,a.tabbableOptions)&&!Aa(k,a.tabbableOptions)&&!ee.nextTabbableNode(k,!1))&&(D=te),D>=0){var x=D===0?s.tabbableGroups.length-1:D-1,V=s.tabbableGroups[x];P=Zi(k)>=0?V.lastTabbableNode:V.lastDomTabbableNode}else Xo(M)||(P=ee.nextTabbableNode(k,!1))}else{var L=xg(s.tabbableGroups,function(U){var Q=U.lastTabbableNode;return k===Q});if(L<0&&(ee.container===k||pc(k,a.tabbableOptions)&&!Aa(k,a.tabbableOptions)&&!ee.nextTabbableNode(k))&&(L=te),L>=0){var H=L===s.tabbableGroups.length-1?0:L+1,j=s.tabbableGroups[H];P=Zi(k)>=0?j.firstTabbableNode:j.firstDomTabbableNode}else Xo(M)||(P=ee.nextTabbableNode(k))}}else P=c("fallbackFocus");return P},v=function(N){var k=uu(N);if(!(u(k,N)>=0)){if(Eo(a.clickOutsideDeactivates,N)){o.deactivate({returnFocus:a.returnFocusOnDeactivate});return}Eo(a.allowOutsideClick,N)||N.preventDefault()}},b=function(N){var k=uu(N),M=u(k,N)>=0;if(M||k instanceof Document)M&&(s.mostRecentlyFocusedNode=k);else{N.stopImmediatePropagation();var $,z=!0;if(s.mostRecentlyFocusedNode)if(Zi(s.mostRecentlyFocusedNode)>0){var P=u(s.mostRecentlyFocusedNode),te=s.containerGroups[P].tabbableNodes;if(te.length>0){var ee=te.findIndex(function(D){return D===s.mostRecentlyFocusedNode});ee>=0&&(a.isKeyForward(s.recentNavEvent)?ee+1<te.length&&($=te[ee+1],z=!1):ee-1>=0&&($=te[ee-1],z=!1))}}else s.containerGroups.some(function(D){return D.tabbableNodes.some(function(x){return Zi(x)>0})})||(z=!1);else z=!1;z&&($=y({target:s.mostRecentlyFocusedNode,isBackward:a.isKeyBackward(s.recentNavEvent)})),g($||s.mostRecentlyFocusedNode||d())}s.recentNavEvent=void 0},T=function(N){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;s.recentNavEvent=N;var M=y({event:N,isBackward:k});M&&(Xo(N)&&N.preventDefault(),g(M))},_=function(N){if(Q7(N)&&Eo(a.escapeDeactivates,N)!==!1){N.preventDefault(),o.deactivate();return}(a.isKeyForward(N)||a.isKeyBackward(N))&&T(N,a.isKeyBackward(N))},C=function(N){var k=uu(N);u(k,N)>=0||Eo(a.clickOutsideDeactivates,N)||Eo(a.allowOutsideClick,N)||(N.preventDefault(),N.stopImmediatePropagation())},A=function(){if(s.active)return _g.activateTrap(i,o),s.delayInitialFocusTimer=a.delayInitialFocus?Cg(function(){g(d())}):g(d()),r.addEventListener("focusin",b,!0),r.addEventListener("mousedown",v,{capture:!0,passive:!1}),r.addEventListener("touchstart",v,{capture:!0,passive:!1}),r.addEventListener("click",C,{capture:!0,passive:!1}),r.addEventListener("keydown",_,{capture:!0,passive:!1}),o},S=function(){if(s.active)return r.removeEventListener("focusin",b,!0),r.removeEventListener("mousedown",v,!0),r.removeEventListener("touchstart",v,!0),r.removeEventListener("click",C,!0),r.removeEventListener("keydown",_,!0),o},I=function(N){var k=N.some(function(M){var $=Array.from(M.removedNodes);return $.some(function(z){return z===s.mostRecentlyFocusedNode})});k&&g(d())},B=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(I):void 0,F=function(){B&&(B.disconnect(),s.active&&!s.paused&&s.containers.map(function(N){B.observe(N,{subtree:!0,childList:!0})}))};return o={get active(){return s.active},get paused(){return s.paused},activate:function(N){if(s.active)return this;var k=l(N,"onActivate"),M=l(N,"onPostActivate"),$=l(N,"checkCanFocusTrap");$||f(),s.active=!0,s.paused=!1,s.nodeFocusedBeforeActivation=r.activeElement,k==null||k();var z=function(){$&&f(),A(),F(),M==null||M()};return $?($(s.containers.concat()).then(z,z),this):(z(),this)},deactivate:function(N){if(!s.active)return this;var k=Tg({onDeactivate:a.onDeactivate,onPostDeactivate:a.onPostDeactivate,checkCanReturnFocus:a.checkCanReturnFocus},N);clearTimeout(s.delayInitialFocusTimer),s.delayInitialFocusTimer=void 0,S(),s.active=!1,s.paused=!1,F(),_g.deactivateTrap(i,o);var M=l(k,"onDeactivate"),$=l(k,"onPostDeactivate"),z=l(k,"checkCanReturnFocus"),P=l(k,"returnFocus","returnFocusOnDeactivate");M==null||M();var te=function(){Cg(function(){P&&g(m(s.nodeFocusedBeforeActivation)),$==null||$()})};return P&&z?(z(m(s.nodeFocusedBeforeActivation)).then(te,te),this):(te(),this)},pause:function(N){if(s.paused||!s.active)return this;var k=l(N,"onPause"),M=l(N,"onPostPause");return s.paused=!0,k==null||k(),S(),F(),M==null||M(),this},unpause:function(N){if(!s.paused||!s.active)return this;var k=l(N,"onUnpause"),M=l(N,"onPostUnpause");return s.paused=!1,k==null||k(),f(),A(),F(),M==null||M(),this},updateContainerElements:function(N){var k=[].concat(N).filter(Boolean);return s.containers=k.map(function(M){return typeof M=="string"?r.querySelector(M):M}),s.active&&f(),F(),this}},o.updateContainerElements(t),o};const n6=Object.freeze(Object.defineProperty({__proto__:null,createFocusTrap:t6},Symbol.toStringTag,{value:"Module"})),r6=d4(n6),i6=d4(V7);function zs(e){"@babel/helpers - typeof";return zs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zs(e)}function a6(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wg(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ob(r.key),r)}}function s6(e,t,n){return t&&wg(e.prototype,t),n&&wg(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function o6(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&kh(e,t)}function kh(e,t){return kh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},kh(e,t)}function l6(e){var t=c6();return function(){var r=qc(e),i;if(t){var a=qc(this).constructor;i=Reflect.construct(r,arguments,a)}else i=r.apply(this,arguments);return u6(this,i)}}function u6(e,t){if(t&&(zs(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return qo(e)}function qo(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function c6(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function qc(e){return qc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},qc(e)}function d6(e,t,n){return t=ob(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ob(e){var t=f6(e,"string");return zs(t)==="symbol"?t:String(t)}function f6(e,t){if(zs(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(zs(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var cu=E,Le=X4,h6=r6,p6=h6.createFocusTrap,m6=i6,g6=m6.isFocusable,qp=function(e){o6(n,e);var t=l6(n);function n(r){var i;a6(this,n),i=t.call(this,r),d6(qo(i),"getNodeForOption",function(o){var l,u=(l=this.internalOptions[o])!==null&&l!==void 0?l:this.originalOptions[o];if(typeof u=="function"){for(var c=arguments.length,d=new Array(c>1?c-1:0),f=1;f<c;f++)d[f-1]=arguments[f];u=u.apply(void 0,d)}if(u===!0&&(u=void 0),!u){if(u===void 0||u===!1)return u;throw new Error("`".concat(o,"` was specified but was not a node, or did not return a node"))}var p=u;if(typeof u=="string"){var g;if(p=(g=this.getDocument())===null||g===void 0?void 0:g.querySelector(u),!p)throw new Error("`".concat(o,"` as selector refers to no known node"))}return p}),i.handleDeactivate=i.handleDeactivate.bind(qo(i)),i.handlePostDeactivate=i.handlePostDeactivate.bind(qo(i)),i.handleClickOutsideDeactivates=i.handleClickOutsideDeactivates.bind(qo(i)),i.internalOptions={returnFocusOnDeactivate:!1,checkCanReturnFocus:null,onDeactivate:i.handleDeactivate,onPostDeactivate:i.handlePostDeactivate,clickOutsideDeactivates:i.handleClickOutsideDeactivates},i.originalOptions={returnFocusOnDeactivate:!0,onDeactivate:null,onPostDeactivate:null,checkCanReturnFocus:null,clickOutsideDeactivates:!1};var a=r.focusTrapOptions;for(var s in a)if(Object.prototype.hasOwnProperty.call(a,s)){if(s==="returnFocusOnDeactivate"||s==="onDeactivate"||s==="onPostDeactivate"||s==="checkCanReturnFocus"||s==="clickOutsideDeactivates"){i.originalOptions[s]=a[s];continue}i.internalOptions[s]=a[s]}return i.outsideClick=null,i.focusTrapElements=r.containerElements||[],i.updatePreviousElement(),i}return s6(n,[{key:"getDocument",value:function(){return this.props.focusTrapOptions.document||(typeof document<"u"?document:void 0)}},{key:"getReturnFocusNode",value:function(){var i=this.getNodeForOption("setReturnFocus",this.previouslyFocusedElement);return i||(i===!1?!1:this.previouslyFocusedElement)}},{key:"updatePreviousElement",value:function(){var i=this.getDocument();i&&(this.previouslyFocusedElement=i.activeElement)}},{key:"deactivateTrap",value:function(){!this.focusTrap||!this.focusTrap.active||this.focusTrap.deactivate({returnFocus:!1,checkCanReturnFocus:null,onDeactivate:this.originalOptions.onDeactivate})}},{key:"handleClickOutsideDeactivates",value:function(i){var a=typeof this.originalOptions.clickOutsideDeactivates=="function"?this.originalOptions.clickOutsideDeactivates.call(null,i):this.originalOptions.clickOutsideDeactivates;return a&&(this.outsideClick={target:i.target,allowDeactivation:a}),a}},{key:"handleDeactivate",value:function(){this.originalOptions.onDeactivate&&this.originalOptions.onDeactivate.call(null),this.deactivateTrap()}},{key:"handlePostDeactivate",value:function(){var i=this,a=function(){var o=i.getReturnFocusNode(),l=!!(i.originalOptions.returnFocusOnDeactivate&&o!==null&&o!==void 0&&o.focus&&(!i.outsideClick||i.outsideClick.allowDeactivation&&!g6(i.outsideClick.target,i.internalOptions.tabbableOptions))),u=i.internalOptions.preventScroll,c=u===void 0?!1:u;l&&o.focus({preventScroll:c}),i.originalOptions.onPostDeactivate&&i.originalOptions.onPostDeactivate.call(null),i.outsideClick=null};this.originalOptions.checkCanReturnFocus?this.originalOptions.checkCanReturnFocus.call(null,this.getReturnFocusNode()).then(a,a):a()}},{key:"setupFocusTrap",value:function(){if(this.focusTrap)this.props.active&&!this.focusTrap.active&&(this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause());else{var i=this.focusTrapElements.some(Boolean);i&&(this.focusTrap=this.props._createFocusTrap(this.focusTrapElements,this.internalOptions),this.props.active&&this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause())}}},{key:"componentDidMount",value:function(){this.props.active&&this.setupFocusTrap()}},{key:"componentDidUpdate",value:function(i){if(this.focusTrap){i.containerElements!==this.props.containerElements&&this.focusTrap.updateContainerElements(this.props.containerElements);var a=!i.active&&this.props.active,s=i.active&&!this.props.active,o=!i.paused&&this.props.paused,l=i.paused&&!this.props.paused;if(a&&(this.updatePreviousElement(),this.focusTrap.activate()),s){this.deactivateTrap();return}o&&this.focusTrap.pause(),l&&this.focusTrap.unpause()}else i.containerElements!==this.props.containerElements&&(this.focusTrapElements=this.props.containerElements),this.props.active&&(this.updatePreviousElement(),this.setupFocusTrap())}},{key:"componentWillUnmount",value:function(){this.deactivateTrap()}},{key:"render",value:function(){var i=this,a=this.props.children?cu.Children.only(this.props.children):void 0;if(a){if(a.type&&a.type===cu.Fragment)throw new Error("A focus-trap cannot use a Fragment as its child container. Try replacing it with a <div> element.");var s=function(u){var c=i.props.containerElements;a&&(typeof a.ref=="function"?a.ref(u):a.ref&&(a.ref.current=u)),i.focusTrapElements=c||[u]},o=cu.cloneElement(a,{ref:s});return o}return null}}]),n}(cu.Component),bo=typeof Element>"u"?Function:Element;qp.propTypes={active:Le.bool,paused:Le.bool,focusTrapOptions:Le.shape({document:Le.object,onActivate:Le.func,onPostActivate:Le.func,checkCanFocusTrap:Le.func,onPause:Le.func,onPostPause:Le.func,onUnpause:Le.func,onPostUnpause:Le.func,onDeactivate:Le.func,onPostDeactivate:Le.func,checkCanReturnFocus:Le.func,initialFocus:Le.oneOfType([Le.instanceOf(bo),Le.string,Le.bool,Le.func]),fallbackFocus:Le.oneOfType([Le.instanceOf(bo),Le.string,Le.func]),escapeDeactivates:Le.oneOfType([Le.bool,Le.func]),clickOutsideDeactivates:Le.oneOfType([Le.bool,Le.func]),returnFocusOnDeactivate:Le.bool,setReturnFocus:Le.oneOfType([Le.instanceOf(bo),Le.string,Le.bool,Le.func]),allowOutsideClick:Le.oneOfType([Le.bool,Le.func]),preventScroll:Le.bool,tabbableOptions:Le.shape({displayCheck:Le.oneOf(["full","legacy-full","non-zero-area","none"]),getShadowRoot:Le.oneOfType([Le.bool,Le.func])}),trapStack:Le.array,isKeyForward:Le.func,isKeyBackward:Le.func}),containerElements:Le.arrayOf(Le.instanceOf(bo)),children:Le.oneOfType([Le.element,Le.instanceOf(bo)])};qp.defaultProps={active:!0,paused:!1,focusTrapOptions:{},_createFocusTrap:p6};var v6=qp;const y6=Or(v6);const Di=({id:e="content-overlay",isOpen:t=!1,showDivider:n=!0,maxWidth:r,functions:{onOpen:i=()=>{},onClose:a=()=>{}}={},forceShow:{error:s=!1}={},title:o,children:l,buttons:u,className:c="",gtmContext:d="Modal",withFocusTrap:f=!0})=>{const p=ue.useIntl(),{registerOverlay:g,unregisterOverlay:m}=U4(),[y,v]=E.useState(t),[b,T]=E.useState(null),_=E.useRef(null),C=F=>{y&&F.key==="Escape"&&I(!1)},A=F=>{T(F.target)},S=F=>{b===_.current&&F.target===_.current&&I(!1),T(null)};E.useEffect(()=>{if(y)return window.addEventListener("keyup",C),()=>{window.removeEventListener("keyup",C)}},[y]),E.useEffect(()=>{const F=_.current;return F&&(F.addEventListener("mousedown",A),F.addEventListener("mouseup",S)),()=>{F&&(F.removeEventListener("mousedown",A),F.removeEventListener("mouseup",S))}},[b]);const I=F=>{if(v(F),F)i(),g(e);else{if(y===F)return;a(),m(e)}};E.useEffect(()=>(I(t),()=>{y&&m(e)}),[t]);const B=r?{"--max-width":`${r/16}rem`}:{};return h.jsx("div",{id:`${e}-overlay`,ref:_,className:ne("overlay",{open:y,"in-portal":c.includes("in-portal")}),role:"dialog",children:h.jsx(Hp,{id:e,className:ne("overlay-modal",c,{"has-max-width":r}),hidden:!y,style:B,children:t&&h.jsx(y6,{containerElements:[_.current],active:f,children:h.jsxs("div",{className:"overlay-content",children:[h.jsxs("div",{className:"top",children:[o&&h.jsx("h2",{className:"modal-title",children:o}),h.jsx(Fe,{variant:"tertiary",size:"medium",icon:{icon:"close"},onClick:()=>I(!1),className:"gtm-trackable","data-gtm-event-type":"close-modal-click","data-gtm-event-context":d,screenreaderText:p.formatMessage({id:"overlay_close"})})]}),n&&h.jsx(Dr,{}),l,u&&h.jsxs("div",{className:"bottom",children:[h.jsx(Dr,{}),h.jsx(to,{buttons:u})]}),s&&h.jsx(Us,{className:"error",children:s})]})})})})},lb=(e,t)=>({"aria-haspopup":!0,"aria-expanded":t,"aria-controls":e});const Li="joinCommunityButton",Wp=({isMember:e=!1,isOpen:t=!1,isShort:n=!1,disabled:r=!1,functions:{join:i,leave:a}={join:()=>{},leave:()=>{}}})=>{const s=ue.useIntl(),o=E.useContext(jt),l=o&&typeof o.id=="string",u=r||!l,[c,d]=E.useState(e),[f,p]=E.useState(e?"joined":"notJoined"),[g,m]=E.useState(!1),y=E.useRef(null);return E.useEffect(()=>{f==="joining"?p("joined"):f==="leaving"&&p("notJoined")},[c]),E.useEffect(()=>{const v=b=>{y.current&&!y.current.contains(b.target)&&m(!1)};return g&&document.addEventListener("mousedown",v),()=>{document.removeEventListener("mousedown",v)}},[g]),h.jsxs("div",{className:"root",children:[h.jsx(Fe,{variant:c?"secondary":"primary",size:"medium",styling:{fullWidth:!0},icon:c&&f!=="leaving"?{icon:"tick",position:"left"}:!1,tooltip:!t&&!c?s.formatMessage({id:`${Li}_closed_tooltip`}):"",onClick:async v=>{if(u)return;if(v.currentTarget.blur(),c){m(!0);return}p("joining");const b=new CustomEvent("ariaLive",{detail:{message:s.formatMessage({id:`${Li}_aria_live`},{action:"joining"})}});document.dispatchEvent(b);const T=i;typeof T=="function"&&setTimeout(async()=>{await T()},500),d(!0)},className:ne("join-community-button",f,{active:f==="joining"}),disabled:u,"data-testid":"join-button","aria-label":c?s.formatMessage({id:`${Li}_options_menu`}):s.formatMessage({id:`${Li}`}),children:h.jsx("span",{className:"text","aria-hidden":"true",children:s.formatMessage({id:`${Li}${["joining","leaving"].includes(f)?`_${f}`:c?"_member":n?"_short":""}`})})}),g?h.jsx("div",{className:"leave-button-overlay",tabIndex:0,children:h.jsx("div",{className:"leave-button-container",ref:y,children:h.jsx(Fe,{"data-testid":"leave-button",className:"leave-community-button",variant:"tertiary",size:"medium",onClick:async v=>{if(u)return;p("leaving");const b=new CustomEvent("ariaLive",{detail:{message:s.formatMessage({id:`${Li}_aria_live`},{action:"leaving"})}});document.dispatchEvent(b);const T=a;typeof T=="function"&&setTimeout(async()=>{await T()},500),d(!1),m(!1)},"aria-label":s.formatMessage({id:`${Li}_member_aria`}),children:s.formatMessage({id:`${Li}_member_aria`})})})}):null]})};const vd="communityDetails_",E6=({className:e="",isMember:t=!1,isOpen:n=!1,slug:r,members:{number:i=0,data:a=[]}={number:0,data:[]},functions:{invite:s,...o}})=>{const l=ue.useIntl(),{id:u}=E.useContext(jt),c=u,d=5,f=i||a.length,p=a.length?a:Array(d).fill({}),g=`/communities/${r}/members`===window.location.pathname,m=t||n,y=!n&&!t;return h.jsxs("div",{className:ne("community-details",e),children:[m?h.jsxs("div",{className:"member-details",children:[h.jsxs("div",{className:"top",children:[h.jsxs("h4",{children:[l.formatMessage({id:`${vd}members`}),h.jsx("span",{className:"count",children:f})]}),g?h.jsx(h.Fragment,{}):h.jsx("p",{className:"text-small",children:h.jsx("a",{href:`/communities/${r}/members`,children:l.formatMessage({id:`${vd}viewAll`})})})]}),c&&h.jsx(jp,{contributors:{total:i,data:p},styling:{size:"medium",showGap:!0,showPlaceholders:f===0},cutoff:d})]}):h.jsx(h.Fragment,{}),c?h.jsxs(h.Fragment,{children:[h.jsx(Wp,{isMember:t,isOpen:n,disabled:y,functions:{...o}}),t&&h.jsx(Fe,{variant:"primary",onClick:s,icon:{icon:"plus"},styling:{fullWidth:!0},children:l.formatMessage({id:`${vd}invite`})})]}):h.jsx(h.Fragment,{})]})};const Is=({icon:e,className:t="",children:n,shortText:r,...i})=>{const a={};return r&&(a["data-short-text"]=r),h.jsx(Fe,{className:ne("action-button",t),variant:"tertiary",size:{mobile:"small",769:"medium"},icon:e,...i,...a,children:h.jsx("span",{className:"inner-text",children:n})})},b6="reply",ta="00000000-0000-0000-0000-000000000000",mc="en";function Vp({queryClient:e,queryKey:t}){function n(r,i,a){e.setQueryData(t,a)}return n}function Kp({queryClient:e,queryKey:t}){async function n(r){await e.cancelQueries({queryKey:t});const i=e.getQueryData(t);return e.setQueryData(t,r),i}return n}var ro=(e=>(e.Post="post",e.Poll="poll",e))(ro||{});const Dn="poll-vote",ub=(e,t="en")=>{var r;return e.verb!==ro.Poll?[]:(((r=e==null?void 0:e.latest_reactions)==null?void 0:r["poll-option"])||[]).map(i=>{var o,l,u,c,d,f,p,g;const a=((o=i==null?void 0:i.own_children)==null?void 0:o["poll-vote"])||[],s=((d=(c=(u=(l=i.data)==null?void 0:l.payload)==null?void 0:u.data)==null?void 0:c.original)==null?void 0:d.body)||"";return{id:i.id,label:s,numVotes:((f=i==null?void 0:i.children_counts)==null?void 0:f["poll-vote"])||0,hasUserVoted:a.length>0,userVote:{id:(p=a[0])==null?void 0:p.id},position:((g=i.data)==null?void 0:g.position)||0}}).sort((i,a)=>i.position-a.position)};function cb({activity:e,reactionId:t,user:n}){var a;const r=n==null?void 0:n.id;if(!r)return;const i=(a=e.latest_reactions)==null?void 0:a["poll-option"];if(i){for(const s of i)if(s.id===t){const o={id:ta,activity_id:e.id,kind:Dn,data:{},created_at:new Date().toISOString(),updated_at:new Date().toISOString(),user_id:r,parent:s.id,latest_children:{},own_children:{},children_counts:{}};s.latest_children=s.latest_children||{},s.latest_children[Dn]=s.latest_children[Dn]||[],s.latest_children[Dn].push(o),s.own_children=s.own_children||{},s.own_children[Dn]=s.own_children[Dn]||[],s.own_children[Dn].push(o),s.children_counts=s.children_counts||{},s.children_counts[Dn]=(s.children_counts[Dn]||0)+1;break}}}function db({activity:e,reactionId:t,correctReactionId:n,user:r}){var i;(i=e.latest_reactions)==null||i["poll-option"].forEach(a=>{var s;a.id===t&&(a.latest_children[Dn].forEach(o=>{o.id===ta&&o.user_id===(r==null?void 0:r.id)&&(o.id=n)}),(s=a.own_children)==null||s[Dn].forEach(o=>{o.id===ta&&o.user_id===(r==null?void 0:r.id)&&(o.id=n)}))})}function fb({activity:e,reactionId:t}){var r,i,a;const n=(r=e.latest_reactions)==null?void 0:r["poll-option"];if(n)for(const s of n){const o=(i=s.own_children)==null?void 0:i[Dn],l=(a=s.latest_children)==null?void 0:a[Dn];if(l){const u=l.findIndex(c=>c.id===t);u!==-1&&(l.splice(u,1),s.children_counts[Dn]--)}if(o){const u=o.findIndex(c=>c.id===t);u!==-1&&o.splice(u,1)}}}function T6({id:e,position:t,body:n,locale:r},i){if(i!=null&&i.id)return{created_at:new Date().toISOString(),updated_at:new Date().toISOString(),id:e||ta,kind:"poll-option",data:{payload:{data:{original:{body:n,locale:r}}},position:t},parent:""}}function _6(){return{latest_reactions:{like:[],reply:[],"poll-option":[]},reaction_counts:{like:0,reply:0,"poll-option":0},own_reactions:{like:[],reply:[],"poll-option":[]}}}function C6(){return{latest_children:{like:[],reply:[]},children_counts:{like:0,reply:0},own_children:{like:[],reply:[]}}}function x6(e,t){const n=e.map(r=>T6(r,t));return{latest_reactions:{like:[],reply:[],"poll-option":n},reaction_counts:{like:0,reply:0,"poll-option":0},own_reactions:{like:[],reply:[],"poll-option":[]}}}function Gp(e){const{id:t="",name:n="",organization:r="",jobTitle:i="",image:a={}}=e,{thumbnail:s=""}=a;return{id:t,data:{name:n,organization:r,jobTitle:i,thumbnail:s}}}const Dh=e=>{const t={};return Object.keys(e).forEach(n=>n.includes("Id")?t[n]=e[n]:t[`${n}Slug`]=e[n]),t},Ml=e=>{var t,n,r,i,a,s;return e&&!e.error?{id:e==null?void 0:e.id,name:(t=e==null?void 0:e.data)==null?void 0:t.name,organization:(n=e==null?void 0:e.data)==null?void 0:n.organization,jobTitle:(r=e==null?void 0:e.data)==null?void 0:r.jobTitle,location:(i=e==null?void 0:e.data)==null?void 0:i.location,image:{thumbnail:((a=e==null?void 0:e.data)==null?void 0:a.thumbnail)||void 0},badges:(s=e==null?void 0:e.data)==null?void 0:s.badges}:"deleted"};function w6({title:e,content:t,categories:n,locale:r}){const i=[];return n&&!["no-category",""].includes(n)&&i.push(n),{title:e,content:t,payload:{data:{original:{title:e,body:t,locale:r},translations:{}}},categories:i,id:ta,time:new Date().toISOString(),verb:ro.Post}}function Ag({title:e,options:t,settings:n,user:r,correctActivityId:i}){return{title:e,content:"",payload:{data:{original:{title:e,locale:"en"}}},id:i||ta,time:new Date().toISOString(),verb:ro.Poll}}function Sg({activity:e,user:t,vars:n}){return{...e,payload:{data:{original:{title:n==null?void 0:n.title,body:n==null?void 0:n.content,locale:n==null?void 0:n.locale},translations:{}}},actor:Gp(t),..._6()}}function kg({activity:e,options:t,user:n}){return{...e,time:new Date().toISOString(),actor:Gp(n),...x6(t,n)}}function Wc({activity:e,reaction:t}){var n,r,i;t?(e.latest_reactions={...e.latest_reactions||{},like:[...((r=e.latest_reactions)==null?void 0:r.like)||[],t]},e.own_reactions={...e.own_reactions||{},like:[...((i=e.own_reactions)==null?void 0:i.like)||[],t]}):e.reaction_counts={...e.reaction_counts||{},like:(n=e.reaction_counts)!=null&&n.like?e.reaction_counts.like+1:1}}function hb({activity:e,user:t}){var n,r,i;e.reaction_counts={...e.reaction_counts||{},like:(n=e.reaction_counts)!=null&&n.like?e.reaction_counts.like-1:0},t!=null&&t.id&&(e.latest_reactions={...e.latest_reactions||{},like:(((r=e.latest_reactions)==null?void 0:r.like)||[]).filter(({user_id:a})=>a!==t.id)},e.own_reactions={...e.own_reactions||{},like:(((i=e.own_reactions)==null?void 0:i.like)||[]).filter(({user_id:a})=>a!==t.id)})}function Vc({activity:e,reaction:t}){var n,r,i;t?(e.latest_reactions={...e.latest_reactions||{},pin:[...((r=e.latest_reactions)==null?void 0:r.pin)||[],t]},e.own_reactions={...e.own_reactions||{},pin:[...((i=e.own_reactions)==null?void 0:i.pin)||[],t]}):e.reaction_counts={...e.reaction_counts||{},pin:(n=e.reaction_counts)!=null&&n.pin?e.reaction_counts.pin+1:1}}function pb({activity:e}){var t;e.reaction_counts={...e.reaction_counts||{},pin:(t=e.reaction_counts)!=null&&t.pin?e.reaction_counts.pin-1:0},e.latest_reactions={...e.latest_reactions||{},pin:[]},e.own_reactions={...e.own_reactions||{},pin:[]}}const Yp=(e,t,n)=>{var B,F,R,N,k,M,$,z,P,te;const{actor:r,verb:i,time:a,id:s,own_reactions:o,latest_reactions:l,reaction_counts:u,mentioned_users:c,total_replies:d,additional_data:f,settings:p,payload:g}=e,m=(((B=l==null?void 0:l.like)==null?void 0:B.length)||0)>0,y=(((F=o==null?void 0:o.like)==null?void 0:F.length)||0)>0,v=m?(R=l==null?void 0:l.like)==null?void 0:R.map(ee=>{var D,x,V;return{id:(D=ee==null?void 0:ee.user)==null?void 0:D.id,name:(V=(x=ee==null?void 0:ee.user)==null?void 0:x.data)==null?void 0:V.name}}):!1,b=(M=(k=(N=g==null?void 0:g.data)==null?void 0:N.translations)==null?void 0:k[n])==null?void 0:M.title,T=(P=(z=($=g==null?void 0:g.data)==null?void 0:$.translations)==null?void 0:z[n])==null?void 0:P.body,_=(te=g==null?void 0:g.data)==null?void 0:te.original,C=!!(b||T),A=(_==null?void 0:_.locale)===n,S=b||(_==null?void 0:_.title),I=T||(_==null?void 0:_.body);return{id:s,title:S,body:I,author:Ml(r),type:i,createdAt:a+"Z",slug:s,slugs:{},userLiked:y,likes:(u==null?void 0:u.like)||0,comments:d||0,peopleWhoLiked:v,payloadId:g==null?void 0:g.id,payloadCollection:g==null?void 0:g.collection,data:{mentions:c,...f||{},translationInfo:{hasTranslation:C,isOriginalPost:A,currentTitle:S,currentBody:I,currentLocale:n,originalTitle:_==null?void 0:_.title,originalBody:_==null?void 0:_.body,originalLocale:_==null?void 0:_.locale}},pinned:(u==null?void 0:u.pin)&&(u==null?void 0:u.pin)>0||!1,categories:Y3((e==null?void 0:e.categories)||[],t||[]),pollOptions:ub(e,"en"),pollSettings:{showRemoveVote:p==null?void 0:p.show_remove_vote,allowMultipleVotes:p==null?void 0:p.allow_multiple_votes,deadlineAt:p==null?void 0:p.deadline_at,hideParticipants:p==null?void 0:p.hide_participants,numberOfWinners:p==null?void 0:p.number_of_winners,resultsVisibility:p==null?void 0:p.results_visibility}}};function A6(e){return{pages:[{next:"",results:[e]}],pageParams:[""]}}function S6(e,t,n){const r=t.pages.length-1,i=t.pages[r].results.length-1;return n!=null&&n.replace?t.pages[r].results[i]=e:t.pages[r].results.push(e),t}function k6(e,t,n){return n!=null&&n.replace?t.pages[0].results[0]=e:t.pages[0].results=[e,...t.pages[0].results],t}function qs(e,t,n){return t?n!=null&&n.append?S6(e,t,n):k6(e,t,n):A6(e)}function Bn(e,t){if(t)for(const{results:n}of t.pages){const r=n.find(({id:i})=>i===e);if(r)return r}}function mb(e,t){for(const{results:n}of t.pages){const r=n.findIndex(({id:i})=>i===e);if(r!==-1){n.splice(r,1);break}}return t}function Zp(e){var t;return((t=e==null?void 0:e.pages)==null?void 0:t.reduce((n,r)=>[...n,...r==null?void 0:r.results],[]))||[]}function D6({activityId:e,replyId:t,content:n}){return{activity_id:e,data:{content:n},id:ta,kind:b6,parent:t||""}}function Dg({reply:e,user:t}){const n=Gp(t);return{...e,user_id:n.id,user:n,...C6()}}function Og({reply:e,reaction:t}){var n,r,i;t?(e.latest_children={...e.latest_children||{},like:[...((r=e.latest_children)==null?void 0:r.like)||[],t]},e.own_children={...e.own_children||{},like:[...((i=e.own_children)==null?void 0:i.like)||[],t]}):e.children_counts={...e.children_counts||{},like:(n=e.children_counts)!=null&&n.like?e.children_counts.like+1:1}}function O6({reply:e,user:t}){var n,r,i;e.children_counts={...e.children_counts||{},like:(n=e.children_counts)!=null&&n.like?e.children_counts.like-1:0},t!=null&&t.id&&(e.latest_children={...e.latest_children||{},like:(((r=e.latest_children)==null?void 0:r.like)||[]).filter(({user_id:a})=>a!==t.id)},e.own_children={...e.own_children||{},like:(((i=e.own_children)==null?void 0:i.like)||[]).filter(({user_id:a})=>a!==t.id)})}const Qp=(e,t)=>{const n=new CustomEvent(Jt.DISCUSSION_POST_ADDED,{detail:{id:e,type:t}});document.dispatchEvent(n)},gb=({payload:e,locale:t})=>{var n,r,i;return((r=(n=e==null?void 0:e.translations)==null?void 0:n[t])==null?void 0:r.body)||((i=e==null?void 0:e.original)==null?void 0:i.body)||""},vb=({payload:e,locale:t})=>{var n,r,i;return((r=(n=e==null?void 0:e.translations)==null?void 0:n[t])==null?void 0:r.body)||((i=e==null?void 0:e.original)==null?void 0:i.body)||""};let Ng,yd=0;const Xp=()=>{E.useEffect(()=>(document.addEventListener(Jt.DISCUSSION_POST_ADDED,e),()=>{document.removeEventListener(Jt.DISCUSSION_POST_ADDED,e)}),[]);const e=t=>{const{id:n,type:r}=t.detail;if(!n||!r||r==="activity")return;clearTimeout(Ng);const i=document.getElementById(n);if(i){i.scrollIntoView({behavior:"smooth",block:"start"}),yd=0;return}yd++,!(yd>10)&&(Ng=setTimeout(()=>{e(t)},50))}};var qt=(e=>(e.Communities="communities",e.Courses="courses",e))(qt||{}),Ve=(e=>(e.Answer="answer",e.Poll="poll",e.Post="post",e.Response="response",e.Reply="reply",e.Question="question",e))(Ve||{});const Ws=Object.freeze({id:"some-user-id-1",name:"some user name 1",organization:"some user organization 1",jobTitle:"some user job title 1",image:{thumbnail:"https://some-user-thumbnail.com/avatar1.png"},isLoading:!1}),Jr=Object.freeze({id:"some-user-id-2",name:"some user name 2",organization:"some user organization 2",jobTitle:"some user job title 2",image:{thumbnail:"https://some-user-thumbnail.com/avatar2.png"},isLoading:!1}),Jp=Object.freeze({actor:`SU:${Ws.id}`,content:"some content 1",duration:"5.53ms",feed_id:"some-feed-id-1",foreign_id:"post:some-foriegn-id-1",id:"some-activity-id-1",object:"comment",time:"2023-11-24T17:52:36.162000",verb:"post"}),N6=Object.freeze({actor:`SU:${Jr.id}`,content:"some content 2",duration:"5.53ms",feed_id:"some-feed-id-2",foreign_id:"post:some-foriegn-id-2",id:"some-activity-id-2",object:"comment",time:"2023-11-24T17:54:36.162000",verb:"post"}),I6=Object.freeze({actor:`SU:${Ws.id}`,content:"some content 3",duration:"5.53ms",feed_id:"some-feed-id-3",foreign_id:"post:some-foriegn-id-3",id:"some-activity-id-3",object:"comment",time:"2023-11-24T17:56:36.162000",verb:"post"}),P6=Object.freeze({actor:`SU:${Jr.id}`,content:"some content 4",duration:"5.53ms",feed_id:"some-feed-id-4",foreign_id:"post:some-foriegn-id-4",id:"some-activity-id-4",object:"comment",time:"2023-11-24T17:54:36.162000",verb:"post"});Object.freeze({id:"some-reaction-id-1",activity_id:Jp.id,kind:"like",created_at:"2023-11-24T17:58:36.162000",data:{},parent:"",updated_at:"2023-11-24T17:58:36.162000",user_id:Jr.id,children_counts:{},latest_children:{},latest_children_extra:{},own_children:{},user:{id:Jr.id,data:{},created_at:"2023-11-24T17:58:36.162000",updated_at:"2023-11-24T17:58:36.162000"}});Object.freeze({id:"some-reaction-id-1",activity_id:Jp.id,kind:"pin",created_at:"2023-11-24T17:58:36.162000",data:{},parent:"",updated_at:"2023-11-24T17:58:36.162000",user_id:Jr.id,children_counts:{},latest_children:{},latest_children_extra:{},own_children:{},user:{id:Jr.id,data:{},created_at:"2023-11-24T17:58:36.162000",updated_at:"2023-11-24T17:58:36.162000"}});Object.freeze({created_at:"2023-12-03T21:53:45.999851Z",updated_at:"2023-12-03T21:53:45.999851Z",id:"some-reply-id-1",user_id:Jr.id,user:{id:Jr.id,data:{},created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z"},kind:"reply",activity_id:Jp.id,data:{content:"Some content 1..."},parent:"",latest_children:{},children_counts:{}});Object.freeze({created_at:"2023-12-03T21:53:45.999851Z",updated_at:"2023-12-03T21:53:45.999851Z",id:"some-reply-id-2",user_id:Ws.id,user:{id:Ws.id,data:{},created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z"},kind:"reply",activity_id:N6.id,data:{content:"Some content 2..."},parent:"",latest_children:{},children_counts:{}});Object.freeze({created_at:"2023-12-03T21:53:45.999851Z",updated_at:"2023-12-03T21:53:45.999851Z",id:"some-reply-id-3",user_id:Jr.id,user:{id:Jr.id,data:{},created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z"},kind:"reply",activity_id:I6.id,data:{content:"Some content 3..."},parent:"",latest_children:{},children_counts:{}});Object.freeze({created_at:"2023-12-03T21:53:45.999851Z",updated_at:"2023-12-03T21:53:45.999851Z",id:"some-reply-id-3",user_id:Ws.id,user:{id:Ws.id,data:{},created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z"},kind:"reply",activity_id:P6.id,data:{content:"Some content 4..."},parent:"",latest_children:{},children_counts:{}});const R6=({question:e,answer:t,reply:n})=>({...e&&{questionSlug:e},...t&&{answerSlug:t},...n&&{replySlug:n}}),F6=(e,t=10)=>!e||e.length===0?[]:e.slice(0,t);function B6(e){return E.useCallback(t=>{var s,o,l,u;if(!t||!["ArrowUp","ArrowDown"].includes(t.key||""))return;t.stopPropagation(),t.preventDefault();const n=t.key==="ArrowUp"?"up":"down",r=(s=t.currentTarget)==null?void 0:s.parentElement;let i=r==null?void 0:r.nextElementSibling;if(n==="up"){const c=r==null?void 0:r.previousElementSibling;c?i=c:(i=(o=r==null?void 0:r.parentElement)==null?void 0:o.lastElementChild,(i==null?void 0:i.getAttribute("data-index"))==="-1"&&(i=i==null?void 0:i.previousElementSibling))}else(!i||(i==null?void 0:i.getAttribute("data-index"))==="-1")&&(i=(l=r==null?void 0:r.parentElement)==null?void 0:l.firstElementChild);if(!i)return;const a=Number((i==null?void 0:i.getAttribute("data-index"))||"0");e([{type:"tabbableLink",value:a}]),(u=i==null?void 0:i.querySelector("a,button"))==null||u.focus()},[e])}const M6=E.lazy(()=>Promise.resolve().then(()=>aF));let Jo=!1;const Ed=()=>{Jo!==!1&&(clearTimeout(Jo),Jo=!1)},L6=5;let bd=null;const yb=({element:e="div",likes:t=0,peopleWhoLiked:n=!1,isShort:r=!0,userLiked:i=!1,content:a={type:Ve.Reply,slugs:{}},canLike:s=!0,activityId:o,basePath:l,parentId:u,functions:{createLike:c=()=>{},deleteLike:d=()=>{},listLikes:f=async()=>({next:"",results:[]})}})=>{const p=ue.useIntl(),g={numberOfLikes:t,userLikedContent:i,ignoreInteractions:!1,showLikers:!1,tabbableLink:0,showLikesModal:!1},[m,y]=E.useReducer(eo,g),{numberOfLikes:v,userLikedContent:b,ignoreInteractions:T,showLikers:_,tabbableLink:C,showLikesModal:A}=m,S=B6(y);E.useEffect(()=>{y([{type:"userLikedContent",value:i}])},[i]);const I=E.useMemo(()=>F6(n,L6),[n]),B=k=>{if(k.preventDefault(),k.stopPropagation(),y([{type:"showLikers",value:!1}]),Jo)return Ed(),!1;if(Ed(),T||!s)return!1;Jo=setTimeout(F,350)},F=async()=>{if(Ed(),T||!s)return!1;let k=b?v-1:v+1;k<0&&(k=0),y([{type:"ignoreInteractions",value:!0},{type:"numberOfLikes",value:k},{type:"userLikedContent",value:!b}]);try{if(a&&a.slugs){const M=R6(a.slugs);b?await d(M):await c({...M,payload:{contentPath:window.location.pathname}})}}catch{y([{type:"numberOfLikes",value:t},{type:"userLikedContent",value:i}])}finally{y([{type:"ignoreInteractions",value:!1}])}},R=()=>{bd=setTimeout(()=>{y([{type:"showLikers",value:!1}])},500)},N=()=>{bd&&clearTimeout(bd)};return E.createElement(e,{className:"likes-wrapper",onKeyDown:k=>{k.key==="Escape"&&y([{type:"showLikers",value:!1}])},onMouseEnter:()=>{N(),y([{type:"showLikers",value:!0}])},onMouseLeave:()=>{R()}},h.jsxs(h.Fragment,{children:[h.jsx(Is,{className:ne("discussion-button text-medium action-button likes-button",{"show-spinner":T,"is-liked":b,disabled:!s}),icon:{icon:b?"heart":"heart_empty",animate:"bounce"},shortText:`${v}`,disabled:!s,"data-testid":"like-button","data-gtm-event-context":"Likes","data-gtm-event-type":`like-${a.type}-click`,onClick:B,screenreaderText:s?p.formatMessage({id:`discussion_likes_${b?"unlike":"like"}`},{action:p.formatMessage({id:`discussion_action_${a.type}`})}):!1,"aria-pressed":b,children:h.jsx("span",{"data-testid":"number-of-likes",className:"number-of-likes",children:p.formatMessage({id:`discussion_likes${r?"_short":""}`},{number:v})})}),n&&h.jsxs(h.Fragment,{children:[h.jsx(ct,{"data-testid":"like-a11y-button",element:"button",className:"tertiary small icon navigation_arrow",onFocus:()=>{N()},onBlur:()=>R,onClick:k=>{var $;k.preventDefault(),k.stopPropagation(),N(),y([{type:"showLikers",value:!0}]);const M=($=k.currentTarget.nextSibling)==null?void 0:$.childNodes[0];if(M){const z=M.querySelector("li:first-child a");z&&(y([{type:"tabbableLink",value:0}]),setTimeout(()=>{z.focus()},100))}},onKeyDown:k=>{k.key==="Escape"&&(k.preventDefault(),k.stopPropagation(),R())},"aria-expanded":_,"aria-controls":`likes-tooltip-${a.slug}`,children:h.jsx(ct,{showOnFocus:!1,children:p.formatMessage({id:"discussion_likes_show"},{action:a.type})})}),h.jsx(ia,{id:`likes-tooltip-${a.slug}`,isOpen:_,isLoading:n.length===0,children:n.length&&h.jsxs("ul",{children:[I.map((k,M)=>{if(typeof k=="string")return null;const $={};return C!==M&&($.tabIndex=-1),h.jsx("li",{"data-index":M,children:h.jsx(sa,{href:k.id?`/profiles/${k.id}`:void 0,gtmContext:"Likes",gtmType:"liked-name-click",onFocus:()=>N(),onKeyDown:S,...$,children:k.name?k.name:h.jsx("span",{className:"deleted-user",children:p.formatMessage({id:"member_deleted"})})})},k.id||Si(k.name||""))}),h.jsx("li",{"data-index":I.length,className:"show-all",children:h.jsx(Fe,{variant:"tertiary",size:{mobile:"small",769:"medium"},onClick:()=>{N(),R(),y([{type:"showLikesModal",value:!0}])},onKeyDown:S,children:p.formatMessage({id:"discussion_likes_showAll"})})})]})}),A&&h.jsx(no,{children:h.jsx(E.Suspense,{children:h.jsx(M6,{activityId:o,basePath:l,parentId:u,likeCount:t,showModal:A,functions:{onClose:()=>y([{type:"showLikesModal",value:!1}]),likes:{list:f}}})})})]})]}))};function $6({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:i,user:a}){const{mutate:s}=bt.useMutation({mutationFn:e,onMutate:o=>t(l=>{const u=Sg({activity:w6(o),vars:o,user:a});return qs(u,l)}),onError:n,onSuccess:(o,l,u)=>{const c=Sg({activity:o,vars:l,user:a});r.setQueryData(i,qs(c,u,{replace:!0})),setTimeout(()=>{Qp(c.id,"activity")},0)}});return s}function j6({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:i,user:a}){const{mutateAsync:s}=bt.useMutation({mutationFn:e,onMutate:({options:o,title:l,settings:u})=>t(c=>{const d=kg({activity:Ag({title:l,options:o,settings:u,user:a}),options:o,user:a});return qs(d,c)}),onError:(o,l,u)=>{const c=d=>{const f=d.pages;return f.forEach(p=>{p.results=p.results.filter(g=>g.id!==ta)}),{...d,pages:f}};r.setQueryData(i,d=>c(d)),n&&n(o,l,u)},onSuccess:async(o,{options:l,title:u,settings:c,locale:d},f)=>{const p=o,g=kg({activity:Ag({title:u,options:l,settings:c,user:a,correctActivityId:p.body.id}),options:l.map((m,y)=>({...m,id:p.body.options[y]})),user:a,locale:d});r.setQueryData(i,qs(g,f,{replace:!0})),setTimeout(()=>{Qp(p.body.id,"activity")},0)}});return s}function H6({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:i,user:a}){const{mutate:s}=bt.useMutation({mutationFn:e,onMutate:({activityId:o,reactionId:l})=>t(u=>{const c=Bn(o,u);return c&&cb({activity:c,reactionId:l,user:a}),u}),onError:n,onSuccess:(o,{activityId:l,reactionId:u},c)=>{const d=Bn(l,c);d&&db({activity:d,reactionId:u,correctReactionId:o.body.id,user:a}),r.setQueryData(i,c)}});return s}function U6({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=bt.useMutation({mutationFn:e,onMutate:({activityId:i,content:a,title:s})=>t(o=>{const l=Bn(i,o);return l&&(l.content=a,l.title=s),o}),onError:n});return r}function Eb({queryFns:{create:e,edit:t,like:n,list:r,remove:i,unlike:a,pin:s,unpin:o,createVote:l,createPoll:u,removeVote:c,removePoll:d},queryKey:f,filterOption:p}){const g=bt.useQueryClient(),m=y1(),y={queryClient:g,queryKey:f},v={mutationHandlers:{error:Vp(y),mutate:Kp(y)},user:m,...y},b=$6({...v,mutationFn:e}),T=U6({...v,mutationFn:t}),_=z6({...v,mutationFn:n}),C=Ig({...v,mutationFn:i}),A=K6({...v,mutationFn:a}),S=W6({...v,mutationFn:s}),I=G6({...v,mutationFn:o}),B=H6({...v,mutationFn:l}),F=j6({...v,mutationFn:u}),R=V6({...v,mutationFn:c}),N=Ig({...v,mutationFn:d}),{activities:k,...M}=q6({queryKey:f,queryFn:r,filterOption:p});return{activities:k,mutations:{create:b,edit:T,remove:C,like:_,unlike:A,pin:S,unpin:I,createVote:B,createPoll:F,removeVote:R,removePoll:N},user:m,...M}}function z6({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:i}){const{mutate:a}=bt.useMutation({mutationFn:e,onMutate:({activityId:s})=>t(o=>{const l=Bn(s,o);return l&&Wc({activity:l}),o}),onError:n,onSuccess:(s,{activityId:o},l)=>{const u=Bn(o,l);u&&Wc({activity:u,reaction:s}),r.setQueryData(i,l)}});return a}function q6({queryFn:e,queryKey:t,filterOption:n}){const{data:r,error:i,isLoading:a,hasNextPage:s,fetchNextPage:o}=bt.useInfiniteQuery({queryKey:t,queryFn:e,initialPageParam:`${n==null?void 0:n.type}=${n==null?void 0:n.id}`,getNextPageParam:l=>l!=null&&l.next?`${l==null?void 0:l.next}&${n==null?void 0:n.type}=${n==null?void 0:n.id}`:null});return{activities:Zp(r),error:i,isLoading:a,hasNextPage:s,fetchNextPage:o}}function W6({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:i}){const{mutate:a}=bt.useMutation({mutationFn:e,onMutate:({activityId:s})=>t(o=>{const l=Bn(s,o);return l&&Vc({activity:l}),o}),onError:n,onSuccess:(s,{activityId:o},l)=>{const u=Bn(o,l);u&&Vc({activity:u,reaction:s}),r.setQueryData(i,l)}});return a}function Ig({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=bt.useMutation({mutationFn:e,onMutate:({activityId:i})=>t(a=>mb(i,a)),onError:n});return r}function V6({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:i}=bt.useMutation({mutationFn:e,onMutate:({activityId:a,reactionId:s})=>t(o=>{const l=Bn(a,o);return l&&fb({activity:l,reactionId:s}),o}),onError:n});return i}function K6({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:i}=bt.useMutation({mutationFn:e,onMutate:({activityId:a})=>t(s=>{const o=Bn(a,s);return o&&hb({activity:o,user:r}),s}),onError:n});return i}function G6({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:i}=bt.useMutation({mutationFn:e,onMutate:({activityId:a})=>t(s=>{const o=Bn(a,s);return o&&pb({activity:o,user:r}),s}),onError:n});return i}const Y6=[{id:"recent_with_pin",text:"recent",type:"ranking"},{id:"community_feed_live",text:"popular",type:"ranking"}],Z6=({basePath:e,parentId:t,isMember:n,isOwner:r,categories:i=[],functions:{activities:a,form:s,join:o,leave:l,likes:u,polls:c},profile:d,translation:f})=>{const p=ue.useIntl(),g=Ka(),[m,y]=E.useState([{id:"recent_with_pin",text:"recent",type:"ranking"}]),v=E.useMemo(()=>i==null?void 0:i.map(({slug:L,name:H})=>({id:L,text:H,type:"category"})),[i]),b=E.useMemo(()=>[...Y6,...v],[v]),T={...a,...c,translate:f==null?void 0:f.onTranslate},{activities:_,error:C,fetchNextPage:A,hasNextPage:S,isLoading:I,mutations:{create:B,edit:F,remove:R,like:N,unlike:k,pin:M,unpin:$,createPoll:z,createVote:P,removeVote:te,removePoll:ee}}=Eb({queryKey:[e,t,"activities",m],queryFns:T,filterOption:m[0]}),[D,x]=E.useState(null),V=()=>{x(_.length),A()};return Xp(),C?h.jsx(Xr,{variant:"error",text:C.message}):h.jsxs("section",{className:"activities-feed",children:[h.jsx(V0,{isCard:!0,parentId:t,categories:i,form:{content:{type:ro.Post,slugs:{}},functions:{create:B,createPoll:z,...s},meta:{isEditing:!1,isAutoFocused:!1,isPrepopulated:!1,showSuccessMessage:!1}},membershipRequiredToPost:{isMember:n,required:!0,join:o,leave:l,notMemberStateText:p.formatMessage({id:"community_joinToPost"})}}),h.jsx(u8,{className:"activities-feed-filtering",options:b.map(({id:L,text:H})=>({id:L,text:p.formatMessage({id:`activitiesFeed_rankingMethod_${H}`,defaultMessage:H})})),defaultOptions:m.map(({id:L,text:H})=>({id:L,text:p.formatMessage({id:`activitiesFeed_rankingMethod_${H}`,defaultMessage:H})})),preventNoOptionSelected:!0,allowMultiple:!1,onChange:({current:L,previous:H})=>{if(L[0]===H[0])return;y([b.find(Q=>Q.id===L[0])]);const j=b.find(Q=>Q.id===L[0]);if(!j)return;const U=new CustomEvent("ariaLive",{detail:{message:p.formatMessage({id:"community_sortSuccess"},{order:p.formatMessage({id:`activitiesFeed_rankingMethod_${j.text}`,defaultMessage:j.text})})}});document.dispatchEvent(U)},gtm:{context:"activitiesFeed_sorting"}}),_==null?void 0:_.map((L,H)=>{var W;const{id:j,own_reactions:U,latest_reactions:Q}=L,J=(((W=U==null?void 0:U.like)==null?void 0:W.length)||0)>0?U==null?void 0:U.like[0].id:"";return h.jsx(E.Fragment,{children:h.jsx(eu,{content:{...Yp(L,i,g),slugs:{question:`${e}/${t}`,answer:j},slug:j},links:{post:`${e}/${t}/${j}`,comments:`${e}/${t}/${j}`},gtmContext:"community",functions:{content:{createContent:()=>null,deleteContent:()=>R({activityId:j}),updateContent:(ae,{body:oe,title:be})=>F({activityId:j,content:oe,title:be})},likes:{createLike:()=>N({activityId:j}),deleteLike:()=>k({activityId:j,reactionId:J}),listLikes:ae=>u.list({activityId:j,...ae})},comments:{openComments:()=>null},pins:{createPin:()=>M({activityId:j}),deletePin:()=>$({activityId:j,reactionId:Q==null?void 0:Q.pin[0].id})},polls:{createVote:({reactionId:ae})=>P({activityId:j,reactionId:ae}),removeVote:({reactionId:ae})=>te({activityId:j,reactionId:ae}),removePoll:()=>ee({activityId:j})},form:s},isTruncated:!0,styling:{showShareLinkButton:!0},setFocus:H===D,userHasOwnerPermissions:r,userHasPermissions:n,badges:{showBadges:!0,scopes:[{scope:pn.Communities,area:t||""},{scope:pn.Platform,area:"all"}]},basePath:e,parentId:t,locale:g,translation:f})},j)}),!I&&h.jsx(jl,{hasNextPage:S,loadNextPage:V,icon:{icon:"arrow-down",position:"right"},messages:{button:p.formatMessage({id:"loadMore_button"}),error:p.formatMessage({id:"loadMore_error"})}}),_.length===0&&!I&&h.jsx(Kn,{className:"no-activities",variant:"muted",icon:"text--input",children:m[0].type==="category"?h.jsx("p",{children:p.formatMessage({id:"activitiesFeed_noActivities_inCategories"})}):h.jsxs(h.Fragment,{children:[h.jsx("p",{children:p.formatMessage({id:"activitiesFeed_noActivities"})}),h.jsx("p",{children:h.jsx(Fe,{variant:"secondary",size:"small",href:"/communities",children:p.formatMessage({id:"activitiesFeed_noActivities_button"})})})]})}),h.jsx(K0,{form:d})]})},Q6={next:"id_lt=67ef0342-6f6e-4807-beea-5a9184ec140c&limit=5",results:[{created_at:"2023-12-03T18:47:44.081716Z",updated_at:"2023-12-03T18:47:44.081716Z",id:"256b921e-ffe6-410d-b754-ac1aaee989ce",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester",badges:{communities:{"community-slug":["orange-badge","badge-with-heart"]}}}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 17...",payload:{id:"123",collection:"reactions_payload",data:{original:{body:"Testing 17...",locale:"es"}}}},parent:"",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:02.517688Z",updated_at:"2023-12-03T18:47:24.852582Z",id:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 16 (edited)..."},parent:"",latest_children:{reply:[{created_at:"2023-12-03T19:28:09.799652Z",updated_at:"2023-12-03T19:28:09.799652Z",id:"bf1ec451-e7c3-4ebe-a60e-248b0ec2a671",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 3..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:59.756761Z",updated_at:"2023-12-03T19:27:59.756761Z",id:"7887d921-e2ba-48ef-8089-db24536dbf70",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 2..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:46.534650Z",updated_at:"2023-12-03T19:27:46.534650Z",id:"73f5bdf3-7080-48ac-a8dc-185f71b38b42",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 1..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}}]},own_children:{reply:[{created_at:"2023-12-03T19:28:09.799652Z",updated_at:"2023-12-03T19:28:09.799652Z",id:"bf1ec451-e7c3-4ebe-a60e-248b0ec2a671",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 3..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:59.756761Z",updated_at:"2023-12-03T19:27:59.756761Z",id:"7887d921-e2ba-48ef-8089-db24536dbf70",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 2..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:46.534650Z",updated_at:"2023-12-03T19:27:46.534650Z",id:"73f5bdf3-7080-48ac-a8dc-185f71b38b42",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 1..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}}]},children_counts:{reply:3}},{created_at:"2023-12-03T17:47:45.107092Z",updated_at:"2023-12-03T17:47:45.107092Z",id:"27a59e8f-f094-442f-88ec-1d5ec2f72790",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 14..."},parent:"",latest_children:{reply:[{created_at:"2023-12-03T18:47:10.603929Z",updated_at:"2023-12-03T18:47:10.603929Z",id:"c32b83d5-c5fc-4253-8531-eb99dcb01f28",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 8..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:47:04.856649Z",updated_at:"2023-12-03T18:47:04.856649Z",id:"5efd80e3-cb11-4748-8c64-f46b71df69c4",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 7..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:22.687552Z",updated_at:"2023-12-03T18:36:22.687552Z",id:"a3a2ebae-6df2-4dc0-beee-2296188b67aa",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 6..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:16.129336Z",updated_at:"2023-12-03T18:36:16.129336Z",id:"72948da5-bf3c-4bd5-9a21-2cee36e0ce8a",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 5..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:40.850756Z",updated_at:"2023-12-03T17:56:40.850756Z",id:"81ebc855-d1f6-4a2c-a788-a251bae406b6",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 4..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:34.103420Z",updated_at:"2023-12-03T17:56:34.103420Z",id:"ddc28de7-4e89-4572-8122-c95dceacc2fd",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 3..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:26.410145Z",updated_at:"2023-12-03T17:56:26.410145Z",id:"916ed4b6-ad87-47bc-9e00-7b0c46180276",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 2..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:19.921740Z",updated_at:"2023-12-03T17:56:19.921740Z",id:"92cddcb2-cbdc-4e69-9c8e-5afe3a607411",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 1..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}}]},own_children:{reply:[{created_at:"2023-12-03T18:47:10.603929Z",updated_at:"2023-12-03T18:47:10.603929Z",id:"c32b83d5-c5fc-4253-8531-eb99dcb01f28",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 8..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:47:04.856649Z",updated_at:"2023-12-03T18:47:04.856649Z",id:"5efd80e3-cb11-4748-8c64-f46b71df69c4",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 7..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:22.687552Z",updated_at:"2023-12-03T18:36:22.687552Z",id:"a3a2ebae-6df2-4dc0-beee-2296188b67aa",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 6..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:16.129336Z",updated_at:"2023-12-03T18:36:16.129336Z",id:"72948da5-bf3c-4bd5-9a21-2cee36e0ce8a",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 5..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:40.850756Z",updated_at:"2023-12-03T17:56:40.850756Z",id:"81ebc855-d1f6-4a2c-a788-a251bae406b6",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 4..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}}]},children_counts:{reply:8}},{created_at:"2023-12-03T17:47:40.066170Z",updated_at:"2023-12-03T17:47:40.066170Z",id:"9ed6a1d0-00b5-4a03-94d7-ac01e188e2e2",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 13..."},parent:"",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:47:33.107894Z",updated_at:"2023-12-03T17:47:33.107894Z",id:"67ef0342-6f6e-4807-beea-5a9184ec140c",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 12..."},parent:"",latest_children:{},children_counts:{}}],duration:"6.48ms"},X6={next:"id_lt=67ef0342-6f6e-4807-beea-5a9184ec140c&limit=5",results:[{created_at:"2023-12-03T18:47:44.081716Z",updated_at:"2023-12-03T18:47:44.081716Z",id:"256b921e-ffe6-410d-b754-ac1aaee989ce",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester",badges:{communities:{"community-slug":["orange-badge","badge-with-heart"]}}}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:{original:"Testing ENGLISH..."},locale:"en"},parent:"",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:02.517688Z",updated_at:"2023-12-03T18:47:24.852582Z",id:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:{original:"Testing ENGLISH 2..."},locale:"en"},parent:"",latest_children:{reply:[{created_at:"2023-12-03T19:28:09.799652Z",updated_at:"2023-12-03T19:28:09.799652Z",id:"bf1ec451-e7c3-4ebe-a60e-248b0ec2a671",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:{original:"Testing 3..."}},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:59.756761Z",updated_at:"2023-12-03T19:27:59.756761Z",id:"7887d921-e2ba-48ef-8089-db24536dbf70",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:{original:"Testing 2..."}},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:46.534650Z",updated_at:"2023-12-03T19:27:46.534650Z",id:"73f5bdf3-7080-48ac-a8dc-185f71b38b42",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:{original:"Testing 1..."}},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}}]},own_children:{reply:[{created_at:"2023-12-03T19:28:09.799652Z",updated_at:"2023-12-03T19:28:09.799652Z",id:"bf1ec451-e7c3-4ebe-a60e-248b0ec2a671",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:{original:"Testing 3..."}},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:59.756761Z",updated_at:"2023-12-03T19:27:59.756761Z",id:"7887d921-e2ba-48ef-8089-db24536dbf70",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:{original:"Testing 2..."}},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:46.534650Z",updated_at:"2023-12-03T19:27:46.534650Z",id:"73f5bdf3-7080-48ac-a8dc-185f71b38b42",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:{original:"Testing 1..."}},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}}]},children_counts:{reply:3}},{created_at:"2023-12-03T17:47:45.107092Z",updated_at:"2023-12-03T17:47:45.107092Z",id:"27a59e8f-f094-442f-88ec-1d5ec2f72790",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:{original:"Testing INDONESIAN..."},locale:"id"},parent:"",latest_children:{reply:[{created_at:"2023-12-03T18:47:10.603929Z",updated_at:"2023-12-03T18:47:10.603929Z",id:"c32b83d5-c5fc-4253-8531-eb99dcb01f28",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:{original:"Reply 8..."}},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:47:04.856649Z",updated_at:"2023-12-03T18:47:04.856649Z",id:"5efd80e3-cb11-4748-8c64-f46b71df69c4",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:{original:"Reply 7..."}},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:22.687552Z",updated_at:"2023-12-03T18:36:22.687552Z",id:"a3a2ebae-6df2-4dc0-beee-2296188b67aa",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:{original:"Reply 6..."}},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:16.129336Z",updated_at:"2023-12-03T18:36:16.129336Z",id:"72948da5-bf3c-4bd5-9a21-2cee36e0ce8a",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:{original:"Reply 5..."}},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:40.850756Z",updated_at:"2023-12-03T17:56:40.850756Z",id:"81ebc855-d1f6-4a2c-a788-a251bae406b6",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:{original:"Reply 4..."}},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:34.103420Z",updated_at:"2023-12-03T17:56:34.103420Z",id:"ddc28de7-4e89-4572-8122-c95dceacc2fd",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:{original:"Reply 3..."}},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:26.410145Z",updated_at:"2023-12-03T17:56:26.410145Z",id:"916ed4b6-ad87-47bc-9e00-7b0c46180276",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:{original:"Reply 2..."}},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:19.921740Z",updated_at:"2023-12-03T17:56:19.921740Z",id:"92cddcb2-cbdc-4e69-9c8e-5afe3a607411",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:{original:"Reply 1..."}},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}}]},own_children:{reply:[{created_at:"2023-12-03T18:47:10.603929Z",updated_at:"2023-12-03T18:47:10.603929Z",id:"c32b83d5-c5fc-4253-8531-eb99dcb01f28",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:{original:"Reply 8..."}},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:47:04.856649Z",updated_at:"2023-12-03T18:47:04.856649Z",id:"5efd80e3-cb11-4748-8c64-f46b71df69c4",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:{original:"Reply 7..."}},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:22.687552Z",updated_at:"2023-12-03T18:36:22.687552Z",id:"a3a2ebae-6df2-4dc0-beee-2296188b67aa",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:{original:"Reply 6..."}},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:16.129336Z",updated_at:"2023-12-03T18:36:16.129336Z",id:"72948da5-bf3c-4bd5-9a21-2cee36e0ce8a",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:{original:"Reply 5..."}},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:40.850756Z",updated_at:"2023-12-03T17:56:40.850756Z",id:"81ebc855-d1f6-4a2c-a788-a251bae406b6",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:{original:"Reply 4..."}},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}}]},children_counts:{reply:8}},{created_at:"2023-12-03T17:47:40.066170Z",updated_at:"2023-12-03T17:47:40.066170Z",id:"9ed6a1d0-00b5-4a03-94d7-ac01e188e2e2",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:{original:"Testing BRAZILLIAN..."},locale:"pt-BR"},parent:"",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:47:33.107894Z",updated_at:"2023-12-03T17:47:33.107894Z",id:"67ef0342-6f6e-4807-beea-5a9184ec140c",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:{original:"Testing NONE..."}},parent:"",latest_children:{},children_counts:{}}],duration:"6.48ms"};const em=({id:e="character-limit",limit:t,valueLength:n,...r})=>{const i=ue.useIntl(),a="form_fieldWrapper_characterLimit";if(t===0)return null;const s=t-n,o=Math.abs(n-t),l=n>=.99*t,u=n>=.9*t&&n<.99*t,c=n>t;return h.jsxs(h.Fragment,{children:[h.jsx("small",{id:e,className:ne("character-limit",{"near-limit":l,"approaching-limit":u}),"aria-live":"polite","aria-label":c?"":i.formatMessage({id:`${a}_aria_${s<0?"over":"default"}`},{remaining:s,over:o,limit:t}),children:c?i.formatMessage({id:`${a}_aria_${s<0?"over":"default"}`},{remaining:s,over:o,limit:t}):h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"hidden",children:i.formatMessage({id:a})}),n," / ",t]})}),h.jsx(ct,{showOnFocus:!1,id:`${e}-info`,children:i.formatMessage({id:`${a}_info`},{limit:t})})]})},T1=e=>(e==null?void 0:e.toString().length)||0,bb=(e,t)=>{const n={};return e===0||(n["data-character-limit"]=e,n.functions={...t,onChange:r=>{T1(r)>e&&(r=r==null?void 0:r.toString().slice(0,e)),t.onChange(r)}}),n};const du="emailHelperTextBox_",Tb=({id:e="email-helper-textbox",type:t,email:n,redirectPath:r,resendVerificationCode:i})=>{const a=ue.useIntl(),[s,o]=E.useState({path:`${du}default`,type:"default",link:{},mail:{},error:""}),[l,u]=E.useState(!1),c=E.useCallback(g=>{g.preventDefault(),g.stopPropagation();const m=y=>{o({path:`${du}error_verificationFailedToSend`,type:"error",link:{"data-gtm-event-context":"VerifyEmailBox","data-gtm-event-type":"SendEmailClick",className:"gtm-trackable",onClick:v=>c(v),href:"#","data-testid":"send-verify-email-click"},mail:{href:"mailto:concierge@apolitical.co",className:"gtm-trackable","data-gtm-event-context":"ErrorVerifyingBox","data-gtm-event-type":"email-concierge-click"},error:y})};if(typeof i!="function"){m(a.formatMessage({id:`${du}error_noFunction`}));return}u(!0),i(n).then(()=>{sessionStorage.setItem(Dp.SESSION_STORAGE.EMAIL,n),window.location.href=r||"/signup/verify-email"}).catch(y=>{m(y.message)}).finally(()=>{u(!1)})},[n,r,i]);E.useEffect(()=>{let g=du,m="default",y={},v={};switch(t){case"gov":g+="autoApproved",m="success";break;case"nonGov":g+="unrecognisedEmail",m="error",y={href:"/pages/who-can-join-the-community","data-gtm-event-context":"NonGovEmailHelperTextBox","data-gtm-event-type":"LearnMoreClick"};break;case"pending":g+="pendingApproval",m="error",v={href:"mailto:concierge@apolitical.co",className:"gtm-trackable","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"email-concierge-click"};break;case"verify":g+="emailUnverified",m="error",y={href:"#","data-gtm-event-context":"VerifyEmailBox","data-gtm-event-type":"SendEmailClick",className:"gtm-trackable",onClick:b=>c(b),"data-testid":"send-verify-email-click"};break;case"exists":g+="emailAlreadyExists",m="error",y={href:"/login","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"login-click"},v={href:"mailto:concierge@apolitical.co",className:"gtm-trackable","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"email-concierge-click"};break;default:g+="default",y={href:"/pages/who-can-join-the-community","data-gtm-event-context":"DefaultEmailHelperTextBox","data-gtm-event-type":"LearnMoreClick"};break}o({...s,path:g,type:m,link:y,mail:v})},[t]);const d={};return["link","mail"].forEach(g=>{d[g]=Object.keys(s[g]).length?m=>h.jsx("a",{...s[g],children:m}):m=>m}),h.jsx(I4,{id:e,type:s.type,heading:l?!1:a.formatMessage({id:`${s.path}_title`}),children:l?h.jsxs(h.Fragment,{children:[h.jsx(pr,{element:"span"}),h.jsx(pr,{element:"span"})]}):a.formatMessage({id:`${s.path}_text`},{...d,strong:g=>h.jsx("strong",{children:g}),em:g=>h.jsx("em",{children:g}),br:h.jsxs(h.Fragment,{children:[h.jsx("br",{}),h.jsx("br",{})]}),error:s.error})})},xs=({className:e="",element:t="input",id:n,inputRef:r,functions:i={onChange:()=>{}},name:a=n,placeholder:s,type:o="text",value:l,autoFocus:u,label:c,styling:d={},...f})=>{const p=E.useRef(),g=r||p,{autosizeToFit:m=!1}=d;h4(m&&t==="textarea",g),E.useEffect(()=>{var v;u&&((v=g.current)==null||v.focus())},[]),!(f!=null&&f.autoComplete)&&["email"].includes(o)&&(f.autoComplete="email");const y={};return t==="input"&&(y.type=o),E.createElement(t,{ref:g,...f,...y,id:n,name:a,className:ne(e,t,{autoresize:m}),value:l,placeholder:s,autoFocus:u,...i,onChange:v=>{const b=v.target;i.onChange(b.value)}})};const is={UP:"ArrowUp",DOWN:"ArrowDown",ENTER:"Enter"},J6=500,ew=({id:e,name:t=e,value:n,placeholder:r,functions:i={onChange:()=>{},onKeyInput:async()=>new Promise(()=>{})},...a})=>{const{onChange:s=()=>{},onKeyInput:o=async()=>{}}=i,[{input:l,displayInput:u,debouncedInput:c},d]=E.useState({input:n,displayInput:n,debouncedInput:n}),[{predictions:f,activePredictionIndex:p,isPredictionSelected:g},m]=E.useState({predictions:[],activePredictionIndex:-1,isPredictionSelected:!!n}),{formatMessage:y}=ue.useIntl();r||(r=y({id:"inputAutocomplete_placeholder"})),E.useEffect(()=>{const _=setTimeout(()=>{g||d(C=>({...C,debouncedInput:l}))},J6);return()=>{clearTimeout(_)}},[l,g]),E.useEffect(()=>{c&&!g?(async()=>{try{const C=await o(c)||[];m(A=>({...A,predictions:C}))}catch(C){console.error("Error fetching predictions:",C),m(A=>({...A,predictions:[]}))}})():m(_=>({..._,predictions:[]}))},[c,g]),E.useEffect(()=>{p>=0&&f[p]&&d(_=>({..._,displayInput:f[p].description}))},[p,f]);const v=_=>{[is.DOWN,is.UP,is.ENTER].includes(_.key)&&(_.preventDefault(),_.key===is.DOWN&&p<f.length-1?m(C=>({...C,activePredictionIndex:p+1})):_.key===is.UP&&p>0?m(C=>({...C,activePredictionIndex:p-1})):_.key===is.ENTER&&p>-1&&(s(f[p].description),d(C=>({...C,input:f[p].description})),m(C=>({...C,predictions:[],isPredictionSelected:!0}))))},b=_=>{s(_.target.value),d(C=>({...C,input:_.target.value,displayInput:_.target.value})),m(C=>({...C,activePredictionIndex:-1,isPredictionSelected:!1}))},T=_=>{s(_.description),d(C=>({...C,input:_.description,displayInput:_.description})),m(C=>({...C,isPredictionSelected:!0,predictions:[]}))};return h.jsxs(h.Fragment,{children:[h.jsx("input",{type:"text",value:u,onChange:b,onKeyDown:v,placeholder:r,name:t,id:e,...a}),h.jsx("ul",{className:"predictions-list",children:f.map((_,C)=>h.jsx("li",{onClick:()=>T(_),onMouseEnter:()=>m(A=>({...A,activePredictionIndex:C})),className:ne("predictions-list-item",{active:C===p}),children:_.description},C))})]})};const tm=({className:e="",disabled:t,element:n="p",functions:r={onChange:()=>{}},id:i,inputRef:a,intlPath:s=!1,label:o,shownValue:l=!0,type:u="checkbox",value:c,accessibilityOptions:{checkboxes:{navigateWithArrowKeys:d=!1}={}}={},...f})=>{const p=ue.useIntl(),{onChange:g,...m}=r,y=()=>{t||g(c?null:l)},v=h.jsxs(h.Fragment,{children:[h.jsx("input",{ref:a,id:i,name:i,type:u,value:l,checked:c,readOnly:!0,disabled:t,tabIndex:-1}),h.jsx("span",{className:ne("pretty-checkbox",{radio:u==="radio"}),"data-testid":"pretty-checkbox"}),h.jsx("label",{htmlFor:i,onKeyDown:b=>{(b.key==="Enter"||b.code==="Space")&&(b.preventDefault(),b.stopPropagation(),y())},tabIndex:c||!d?0:-1,children:o||p.formatMessage({id:s?`${s}_${i}`:i})})]});return E.createElement(n,{onClick:b=>{const T=b.target;T.nodeName.toLowerCase()==="a"||T.parentNode&&T.parentNode.nodeName.toLowerCase()==="a"||(b.preventDefault(),b.stopPropagation(),y())},onKeyDown:d?b=>{var T,_,C;if(b.key!=="Tab")switch(b.code){case"Enter":case"Space":b.stopPropagation(),b.preventDefault(),y();break;case"ArrowLeft":case"ArrowRight":b.stopPropagation(),b.preventDefault();const A=b.currentTarget;let S=A==null?void 0:A.nextElementSibling;if(b.key==="ArrowLeft"){const I=A==null?void 0:A.previousElementSibling;I?S=I:S=(T=A==null?void 0:A.parentElement)==null?void 0:T.lastElementChild}else S||(S=(_=A==null?void 0:A.parentElement)==null?void 0:_.firstElementChild);S&&((C=S==null?void 0:S.querySelector("label"))==null||C.focus());break}}:void 0,className:ne(i,"checkbox-wrapper",e,{"is-checked":c}),...f,...m},v)};const tw=E.memo(function({direction:t="down"}){return h.jsx(p1,{className:ne("rotating-chevron",`direction-${t}`)})});const nw=({className:e,options:t,initialValue:n,value:r,functions:i={onChange:()=>{},onMultiSelectSubmit:()=>{}},gtm:{context:a}={context:""},placeholder:s,multiSelect:o,multiSelectOptions:l,id:u})=>{const c=ue.useIntl(),[d,f]=E.useState(!1),p=r||n,g=Array.isArray(p)?[...p]:p?[p]:[],[m,y]=E.useState(g);let v;Array.isArray(m)&&m.length===1&&typeof m[0]=="string"?v=t&&m?t.find(S=>S.id===m[0]):t?t[0]:{id:"",label:""}:Array.isArray(m)&&m.length===1&&typeof m[0]!="string"?v=m[0]:v={id:"",label:""},E.useEffect(()=>{y(g)},[r,n]);const{onChange:b,onMultiSelectSubmit:T,..._}=i,C=S=>{if(o){let I=[];m!=null&&m.includes(S.id)?I=m.filter(B=>B!==S.id):I=[...m,S.id],y([...I]),b&&b([...I])}else y([S]),b&&b(S.id),f(!1)},A=S=>{if(S==="all"){const I=(t==null?void 0:t.map(B=>B.id))||[];y(I),b&&b(I)}else y([]),b&&b([])};return h.jsxs("div",{className:ne("dropdown-wrapper",e),children:[h.jsxs("button",{className:"input","aria-expanded":d,"aria-haspopup":"listbox","aria-controls":"dropdown-list",onClick:S=>{S.preventDefault(),S.stopPropagation(),f(!d)},"data-testid":"dropdown-selector",..._,children:[o?`${s} · ${m.length}`:v.label,h.jsx(tw,{direction:d?"up":"down"})]}),h.jsx("select",{defaultValue:v.id,onChange:S=>{S.preventDefault(),S.stopPropagation();const I=t&&t.find(B=>B.id===S.target.value);C(I)},hidden:!d,..._,children:t==null?void 0:t.map(S=>h.jsx("option",{value:S.id,className:"gtm-trackable","data-gtm-event-type":`${S.id}-click`,"data-gtm-event-context":a,children:S.label},S.id))}),h.jsxs("div",{className:"menu-options input dropdown-menu",role:"menu",hidden:!d,children:[h.jsxs("div",{className:"dropdown-menu-list",children:[(l==null?void 0:l.topbar)&&h.jsxs("div",{className:"action-bar",children:[h.jsx("p",{children:`${m==null?void 0:m.length} selected`}),h.jsxs("ul",{children:[h.jsx("li",{children:h.jsx(Fe,{variant:"tertiary",size:"small",onClick:()=>A("all"),className:"gtm-trackable","data-gtm-event-type":"all-click","data-gtm-event-context":a,children:c.formatMessage({id:"dropdown_menu_multiselect_all"})})}),h.jsx("li",{children:h.jsx(Fe,{variant:"tertiary",size:"small",onClick:()=>A("none"),className:"gtm-trackable","data-gtm-event-type":"none-click","data-gtm-event-context":a,children:c.formatMessage({id:"dropdown_menu_multiselect_none"})})})]})]}),h.jsx("ul",{children:t==null?void 0:t.map(S=>{const I=S.id===v.id||(m==null?void 0:m.includes(S))||(m==null?void 0:m.includes(S.id));return h.jsx("li",{"data-testid":"dropdown-options",children:h.jsxs("button",{className:ne("gtm-trackable",{selected:I,"selected-single":I&&!o}),"data-gtm-event-type":`${S.id}-click`,"data-gtm-event-context":a,onClick:B=>{B.preventDefault(),B.stopPropagation(),C(S)},role:"menuitem","aria-current":I,"data-testid":I?"current-selection":"",children:[o&&h.jsx("span",{className:"pretty-checkbox","data-testid":"pretty-checkbox"}),h.jsx("span",{className:ne({"menu-option-label":o}),children:S.label})]})},S.id)})})]}),(l==null?void 0:l.submitSection)&&h.jsx("p",{className:"submit",children:h.jsx(Fe,{variant:"secondary",onClick:()=>{T&&T(m),document.dispatchEvent(new CustomEvent("dropdownMultiSelectSubmit",{detail:{id:u||"dropdown-multi-select",value:m}})),f(!1)},children:c.formatMessage({id:"form_submit"})})})]})]})},Wo=(e,t)=>{switch(e){case"required":if(!t||typeof t=="string"&&t.trim().length===0)return!0;break;case"no-numbers":if(t&&!/^([^0-9]*)$/.test(t))return!0;break;case"valid-email":if(t&&!/^(([^<>()[\]\\.,;:\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,}))$/.test(t))return!0;break;case"valid-url":if(t&&!/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-._~:/?#[\]@!$&'()*+,;=%]+$/i.test(t))return!0;break;default:return!1}return!1};let Td=null;const rw=({id:e,label:t,limit:n,value:r,placeholder:i,functions:a,error:s,multipleInputs:o,validation:l,fieldData:u,type:c,...d})=>{const f=ue.useIntl(),{showCount:p=!1,label:g,defaultInputs:m=1,maxInputs:y=100,hasButton:v=!1,allowDuplicateValues:b=!1}=o||{},[T,_]=E.useState(r?Array.isArray(r)?r:[r]:Array(m).fill("")),C=T.filter(F=>F!==""),A=()=>{if(!u)return;const F=ur(u.fields).filter(({id:k,name:M})=>(k||(k=M||""),k!==e&&!k.includes(`${e}-`))),R=[];T.map((k,M)=>{if(y&&M>=y)return;const $=ur(l??[]);e&&(b||$.push({condition:z=>{var D;const P=z[e].toLowerCase(),te=((D=z[`${e}-all`])==null?void 0:D.length)??0,ee=new Set(z[`${e}-all`].map(x=>x.toLowerCase()));return ee.has(P)&&ee.size<te},error:f==null?void 0:f.formatMessage({id:"form_error_multipleInputs_same"})}),$.forEach(z=>{const{condition:P,error:te}=z;if(typeof P=="function")z.condition=ee=>{var V;let D=(V=ee==null?void 0:ee[e])==null?void 0:V[M];D||(ee[e]&&!Array.isArray(ee[e])?D=ee[e]:D="");const x=ur(ee);return x[e]=D,x[`${e}-all`]=ee[e],typeof P=="function"&&P(x)?te:!1};else{const ee=P;z.condition=D=>{var V;let x=(V=D==null?void 0:D[e])==null?void 0:V[M];switch(x||(D[e]&&!Array.isArray(D[e])?x=D[e]:x=""),ee){case"required":te||(z.error=f==null?void 0:f.formatMessage({id:"form_error_required"}));break;case"no-numbers":te||(z.error=f==null?void 0:f.formatMessage({id:"form_error_numbers"}));break;case"valid-email":te||(z.error=te||(f==null?void 0:f.formatMessage({id:"form_error_email"})));break;case"valid-url":te||(z.error=f==null?void 0:f.formatMessage({id:"form_error_url"}));break;default:console.warn("WARNING! No field validation condition has been set")}return Wo(ee,x)?z.error:!1}}}),R.push({id:`${e}-${M}`,validation:$,value:k}))});const N={fieldsToValidate:F.concat(R)};u.multipleInputs.includes(e)&&(N.multipleInputs=u.multipleInputs.filter(k=>k!==e)),u.setFields(k=>({...k,...N}))};E.useEffect(()=>{A()},[T.length]),E.useEffect(()=>{!u||!u.multipleInputs||u.multipleInputs.includes(e)&&A()},[u==null?void 0:u.multipleInputs]);const S=()=>{(!y||T.length<y)&&_([...T,""])},I=F=>{const R=document.getElementById(`${e}-${F+1}`);R==null||R.focus()},B=(F,R)=>F.replace("{number}",R+1);return h.jsxs("fieldset",{className:ne("multiple-inputs field-wrapper",{"has-button":v,"has-legend":t}),children:[t?h.jsxs("legend",{className:"legend-as-label text-small",children:[t,p?h.jsxs(h.Fragment,{children:[" ",h.jsx("small",{className:"filled-in-count","aria-label":f.formatMessage({id:"form_multipleInputs_filledInCount_aria"},{number:C.length,total:y}),children:f.formatMessage({id:"form_multipleInputs_filledInCount"},{number:C.length,total:y})})]}):""]}):h.jsx(h.Fragment,{}),T.map((F,R)=>{if(y&&R>=y)return h.jsx(h.Fragment,{});let N=!1;t?N=h.jsx(ct,{showOnFocus:!1,children:f.formatMessage({id:"form_multipleInputs_label"},{number:R+1})}):g&&(N=B(g,R));const k=`${e}-${R}`,M=R+1>m;return h.jsx(Cb,{id:k,type:"text",label:N,value:F,placeholder:i?B(i,R):void 0,className:ne({"has-remove-button":M}),limit:n,error:s&&typeof s!="string"?s==null?void 0:s[k]:void 0,functions:{...a,onFocus:()=>{v||R!==T.length-1||S()},onKeyDown:$=>{$.key==="Enter"&&($.preventDefault(),$.stopPropagation(),Td&&clearTimeout(Td),R!==T.length-1?I(R):(S(),Td=setTimeout(()=>I(R),100)))},onChange:$=>{const z=T[R].toLowerCase(),P=ur(T);P[R]=$,_(P),u==null||u.dispatch({type:"removeError",payload:{key:k}}),b||P.forEach((te,ee)=>{Tl(te)&&ee!==R&&te.toLowerCase()===z&&(u==null||u.dispatch({type:"removeError",payload:{key:`${e}-${ee}`}}))}),a==null||a.onChange(P)}},siblings:M?h.jsx(Fe,{variant:"tertiary",size:"small",icon:"close",screenreaderText:f.formatMessage({id:"form_multipleInputs_remove"}),onClick:()=>{const $=ur(T);$.splice(R,1),_($),u==null||u.dispatch({type:"removeError",payload:{key:k}}),a==null||a.onChange($)}}):void 0,...d},k)}),v?h.jsx(Fe,{...v,onClick:S,disabled:!!(y&&y<=T.length)}):h.jsx(h.Fragment,{})]})};const Pg=({className:e="",functions:t={onChange:()=>{}},intlPath:n=!1,id:r,label:i,multiSelect:a=!1,name:s,options:o,required:l,type:u="checkboxes",value:c,accessibilityOptions:d,styling:{displayOptionsAsPills:f=!1}={},multipleOptions:p,...g})=>{const m=ue.useIntl(),y=a?c:[],v=c;return h.jsx("ul",{...g,className:ne("options-wrapper",e,{"with-pills filters":f}),"data-testid":`ul-${r}`,children:o==null?void 0:o.map(({id:b,label:T=!1,value:_=b,disabled:C=void 0})=>{const A=`${r}_${b}`;C===void 0&&(C=p!=null&&p.limit?y.length>=p.limit&&!y.includes(_):!1);const S=()=>{if(C)return;let I;if(a){const B=y==null?void 0:y.indexOf(_);Array.isArray(y)&&B>=0?(I=y,I.splice(B,1)):(!y||y.length===0?I=[]:I=y,I.push(_))}else I=v===_?void 0:_;t.onChange(I)};return h.jsx(tm,{element:"li",id:A,type:u==="checkboxes"?"checkbox":"radio",shownValue:_,value:a?y==null?void 0:y.includes(_):v===_,functions:{...t,onChange:S},intlPath:n,label:T||m.formatMessage({id:n?`${n}_${b}`:b}),disabled:C,accessibilityOptions:d,className:ne({disabled:C})},A)})})};const _b=({inputRef:e,type:t="password",gtm:{context:n}={context:void 0},autoComplete:r="on",...i})=>{const a=ue.useIntl(),s=E.useRef(),o=e||s,[l,u]=E.useState(!1),[c,d]=E.useState(t),f=()=>{var p;u(!l),d(l?"password":"text"),(p=o.current)==null||p.focus()};return h.jsxs(h.Fragment,{children:[h.jsx("button",{type:"button",className:ne("show-password gtm-trackable",{"password-visible":l}),"data-gtm-event-context":n,"data-gtm-event-type":`${l?"hide":"show"}-password-click`,onClick:f,"aria-label":a.formatMessage({id:`showpassword_aria_${l?"hide":"show"}`}),children:a.formatMessage({id:`showpassword_${l?"hide":"show"}`})}),h.jsx(xs,{inputRef:o,type:c,autoComplete:r,...i})]})};const as={text:{component:xs},email:{component:xs},url:{component:xs},textarea:{component:xs,props:{element:"textarea",rows:4,cols:10}},checkbox:{component:tm},checkboxes:{component:Pg,props:{multiSelect:!0}},radio:{component:Pg,props:{multiSelect:!1}},select:{component:nw},password:{component:_b},autocomplete:{component:ew},"multiple-inputs":{component:h.jsx(h.Fragment,{})}},Cb=e=>{const t=ue.useIntl(),{id:n,intlPath:r=!1,className:i="",error:a,functions:s={onChange:()=>{}},limit:o=0,showRequiredLabels:l=!0,type:u,validation:c,value:d,submitOnEnter:f,fieldData:p,siblings:g,...m}=e;if(u&&u==="multiple-inputs")return h.jsx(rw,{...e});const y=c&&c.some(({condition:M})=>M==="required"),v=T1(d),b=u&&as[u]&&as[u].component?as[u].component:xs,T=u&&["checkboxes","radio"].includes(u),_=u&&["autocomplete"].includes(u),C=a&&`error-${n}`,A=`character-limit-${n}`,S={};T?S.element="legend":S.htmlFor=n;let I={...m,id:n,name:n,className:a?"error":"",type:u,required:y,"aria-required":y,functions:ur(s),value:d};const B=M=>{I["aria-describedby"]?I["aria-describedby"]+=` ${M}`:I["aria-describedby"]=M};if(o>0){const M=bb(o,s);B(`${A}-info`),I={...I,...M},M.functions&&typeof M.functions=="object"&&(I.functions={...I.functions,...M.functions})}u&&as[u]&&as[u].props&&(I={...I,...as[u].props}),T&&(I.intlPath=`${r}_${n}`),a&&(I["aria-invalid"]=!0,I["aria-errormessage"]=C,B(C));const F=m.label||t.formatMessage({id:r?`${r}_${n}`:n}),R=({...M})=>a?E.createElement(M.as||"p",{id:C,className:"error text-small",...M},a):null;if(u&&["checkbox"].includes(u))return h.jsxs(h.Fragment,{children:[h.jsx(b,{...I,label:F,className:ne("field-wrapper",i)}),h.jsx(R,{as:"p"})]});const N={};T?S.className="legend-as-label text-small":N.className="field-label";const k=({element:M,...$})=>E.createElement(M||"label",{...$,"data-testid":`label-${n}`});return h.jsx(h.Fragment,{children:E.createElement(T?"fieldset":"div",{className:ne("field-wrapper text-small",i,`${u}-wrapper`,{"multiple-options-wrapper":T})},h.jsxs(h.Fragment,{children:[m.label===!1?h.jsx(h.Fragment,{}):E.createElement(T?E.Fragment:"p",N,h.jsxs(k,{...S,children:[F,y&&l&&h.jsxs(h.Fragment,{children:[" ",h.jsxs("small",{children:["(",t.formatMessage({id:"form_fieldWrapper_required"}),")"]})]})]})),E.createElement(T||_?"div":"p",{className:"field-component"},h.jsxs(h.Fragment,{children:[h.jsx(b,{...I}),h.jsx(em,{id:A,limit:o,valueLength:v}),g]})),h.jsx(R,{})]}))})},iw=(e,t)=>{const{type:n,payload:r}=t,i=e.errors?ur(e.errors):{},a=e.values?ur(e.values):{};switch(n){case"updateValue":if(r!=null&&r.key&&i[r==null?void 0:r.key]&&delete i[r==null?void 0:r.key],r!=null&&r.key){if(["isSubmitting","formSubmitted","errors"].includes(r==null?void 0:r.key))return{...e,errors:i,[r==null?void 0:r.key]:r==null?void 0:r.value};a[r==null?void 0:r.key]=r==null?void 0:r.value}return{...e,errors:i,values:a};case"addError":return r!=null&&r.key&&!i[r==null?void 0:r.key]&&(i[r==null?void 0:r.key]=r==null?void 0:r.value),{...e,errors:i};case"removeError":return r!=null&&r.key&&i[r==null?void 0:r.key]&&delete i[r==null?void 0:r.key],{...e,errors:i};case"submitForm":{const{fields:s=[],dispatch:o=()=>{},onSuccess:l=()=>{},onFailure:u=()=>{},intl:c}=r,d=ur(Object.keys(i));for(const f of s)if(f.validation)for(let p=0;p<f.validation.length;p++){const{condition:g="required",error:m=!1}=f.validation[p];let y=!1;if(typeof g=="function"){const v=g(a);v&&(y=m||v)}else{const v=a[f.id],b=g;switch(b){case"required":Wo(b,v)&&(y=m||(c==null?void 0:c.formatMessage({id:"form_error_required"})));break;case"no-numbers":{Wo(b,v)&&(y=m||(c==null?void 0:c.formatMessage({id:"form_error_numbers"})));break}case"valid-email":{Wo(b,v)&&(y=m||(c==null?void 0:c.formatMessage({id:"form_error_email"})));break}case"valid-url":{Wo(b,v)&&(y=m||(c==null?void 0:c.formatMessage({id:"form_error_url"})));break}default:console.warn("WARNING! No field validation condition has been set")}}if(y){o({type:"addError",payload:{key:f.id,value:y}}),d.push(f.id);break}}return d.length===0?l(a):u(a,d),e}case"formSubmitted":return{...e,isSubmitting:!1,formSubmitted:!0,errors:{}};case"formSubmittedAndReset":return{isSubmitting:!1,formSubmitted:!0,errors:{}};default:return e}};let _d=null;const Nr=({element:e="form",fields:t,className:n="",id:r=t.length?`form__${t[0].id}`:"form",formRef:i,intlPath:a=!1,button:s={variant:"primary",size:"large",customOnSubmit:!1},secondaryActionButton:o={variant:"secondary",size:"large"},meta:l,children:u,gtm:c={context:"Form",event:"form-submit-click"},functions:d,...f})=>{const p=(t||[]).filter(J=>J.type==="multiple-inputs").map(J=>J.id),[g,m]=E.useState({fieldsToValidate:t,multipleInputs:p});E.useEffect(()=>{g.multipleInputs.length||m(J=>({...J,fieldsToValidate:t,multipleInputs:p}))},[t.length]);const{customOnSubmit:y,hideButton:v,...b}=s,T=40,{shouldShowCancelButton:_=!1,shouldReset:C=!0,shouldHide:A=!0,showRequiredLabels:S=!0,showSuccessMessage:I=!1,shouldScrollOnSuccess:B=!0}=l||{},{onSuccess:F=async()=>{},onCancel:R=()=>{},onCatch:N=()=>{},onFailure:k=()=>{}}=d||{},M=ue.useIntl(),$={};t.length&&t.forEach(J=>{const W=J.id||J.name;W&&($[W]=J.value||"")});const[z,P]=E.useReducer(iw,{isSubmitting:!1,formSubmitted:!1,errors:{},values:$}),{errors:te,isSubmitting:ee,formSubmitted:D,values:x}=z;E.useEffect(()=>{C&&D&&(_d=setTimeout(()=>{P({type:"updateValue",payload:{key:"formSubmitted",value:!1}})},3e3))},[D]),E.useEffect(()=>()=>{_d&&clearTimeout(_d)},[]),E.useEffect(()=>{const J=W=>{P({type:"updateValue",payload:{key:W.detail.id,value:W.detail.value}})};return document.addEventListener("dropdownMultiSelectSubmit",J),()=>{document.removeEventListener("dropdownMultiSelectSubmit",J)}},[]);const V=E.useRef(null),L=i||V,H=El(()=>{if(!ee){if(P({type:"updateValue",payload:{key:"isSubmitting",value:!0}}),typeof s.disabled=="object"&&s.disabled.isClickable){P({type:"submitForm",payload:{fields:g.fieldsToValidate,dispatch:P,intl:M,onFailure:(J,W)=>{U(),k(J,W),P({type:"updateValue",payload:{key:"isSubmitting",value:!1}})}}});return}P({type:"submitForm",payload:{fields:g.fieldsToValidate,dispatch:P,onSuccess:async J=>{B&&U();try{await F(J),P({type:C?"formSubmittedAndReset":"formSubmitted"})}catch(W){N(W),P({type:"updateValue",payload:{key:"isSubmitting",value:!1}})}},onFailure:(J,W)=>{U(),k(J,W),P({type:"updateValue",payload:{key:"isSubmitting",value:!1}})},intl:M}})}},100);if(!t.length)return null;const j={};s.children&&(j.default=s.children),b.text&&typeof b.text=="string"&&(j.default=b.text),["default","submitting","submitted"].forEach(J=>{b.text&&typeof b.text!="string"&&J in b.text?j[J]=b.text[J]:j[J]||(j[J]=M.formatMessage({id:`form_${J==="default"?"submit":J}`}))}),delete b.text;const U=()=>{var ae;let J=0;if((ae=L==null?void 0:L.current)!=null&&ae.id){const oe=document.getElementById(L.current.id);oe&&(J=oe.getBoundingClientRect().top+window.scrollY)}const W=document.getElementById("header");W&&(J=J-W.offsetHeight-T),J<0&&(J=0),window.scrollTo({top:J,behavior:"smooth"})},Q=J=>{J.preventDefault(),J.stopPropagation(),!ee&&H()},ie=[{...b,icon:D?{icon:"tick",position:"left"}:!1,className:ne("gtm-trackable",b.className),onClick:Q,disabled:ee||D||s.disabled,"data-gtm-event-context":c.context,"data-gtm-event-type":c.event,children:j[ee?"submitting":D?"submitted":"default"]}];return _&&ie.unshift({...o,className:ne("gtm-trackable",o.className),"data-gtm-event-context":c.context,"data-gtm-event-type":c.event,disabled:ee||D,onClick:R,children:o.text||M.formatMessage({id:"form_cancel"})}),h.jsxs(h.Fragment,{children:[E.createElement(e,{...f,id:r,className:ne("form",n),ref:L},h.jsxs(h.Fragment,{children:[te!=null&&te.general?h.jsx(Xr,{variant:"error",text:M.formatMessage({id:"form_error_generalError"})}):null,u,(!A||!ee&&!D||y)&&t.map((J,W)=>{const{id:ae=J.name||W,component:oe,functions:be={onChange:()=>{}},submitOnEnter:we=!1}=J;if(oe)return h.jsx(oe,{...J.props||{}},`component-${ae}-${W}`);const He=(x==null?void 0:x[ae])||"",Be={...be,onChange:$e=>{P({type:"updateValue",payload:{key:ae,value:$e}}),be.onChange($e,P)}};return we&&(Be.onKeyDown=$e=>{$e.key==="Enter"&&($e.stopPropagation(),$e.preventDefault(),H()),be.onKeyDown&&be.onKeyDown($e)}),h.jsx(Cb,{intlPath:a,...J,showRequiredLabels:S,value:He,error:J.type==="multiple-inputs"?te:te==null?void 0:te[ae],functions:Be,fieldData:{fields:g.fieldsToValidate,multipleInputs:g.multipleInputs,setFields:m,dispatch:P}},ae)}),v?null:(ee||D)&&y?y:h.jsx(to,{className:ne("cta",{center:ee||D,submitted:D}),buttons:ie})]})),I&&D&&h.jsx(Us,{className:"success",children:typeof I=="string"?I:M.formatMessage({id:"form_success"})})]})};const fu="passwordRules_",xb="isMoreThanEightCharacters",wb="includesNumberAndSymbol",Ab="includesLowerAndUppercase",aw={[xb]:"8Characters",[wb]:"numberSymbol",[Ab]:"lowercaseUppercase"},sw=({matchingRules:e={isMoreThanEightCharacters:!1,includesNumberAndSymbol:!1,includesLowerAndUppercase:!1},className:t=""})=>{const n=ue.useIntl();return h.jsxs("aside",{className:ne("password-rules",t),children:[h.jsx("small",{children:n.formatMessage({id:`${fu}intro`})}),h.jsx("ul",{children:[xb,wb,Ab].map(r=>h.jsxs("li",{className:ne({matches:e[r]}),children:[h.jsxs(ct,{children:[n.formatMessage({id:`${fu}rule_label`})," "]}),h.jsx("span",{children:n.formatMessage({id:`${fu}rule_${aw[r]}`})}),!e[r]&&h.jsxs(ct,{element:"strong",children:[" ",n.formatMessage({id:`${fu}notMet`})]})]},`rule-${r}`))})]})},Sb=E.memo(sw);const ow=({text:e={},topRating:t=5,functions:{createRating:n=()=>null,updateRating:r=()=>{},reportError:i=()=>{}},className:a="",hasLoaded:s=!1})=>{const o=ue.useIntl(),[l,u]=E.useState({setUp:!1,id:null,rating:null,disabled:!0}),c=async()=>{try{const v=await n();u(b=>({...b,setUp:!0,id:v&&v.id,disabled:!1}))}catch(v){u(b=>({...b,setUp:!0,disabled:!0})),i(v)}};if(E.useEffect(()=>{s&&!l.setUp&&c()},[s]),!s)return h.jsx(pr,{className:"rating-placeholder"});const{id:d,rating:f,disabled:p}=l,g="ratings_",m={text:o.formatMessage({id:`${g}text`}),low:o.formatMessage({id:`${g}low`}),high:o.formatMessage({id:`${g}high`}),success:o.formatMessage({id:`${g}success`}),...e},y=async v=>{if(!(!d||p))try{u(b=>({...b,rating:v,disabled:!0})),await r({id:d,value:v})}catch(b){u(T=>({...T,rating:null})),i(b)}finally{u(b=>({...b,disabled:!1}))}};return h.jsxs("div",{className:ne("rating",a),children:[h.jsx("span",{className:"label",children:m[f?"success":"text"]}),h.jsx("ol",{children:Array.from(new Array(t).keys()).map(v=>{const b=v+1;return h.jsx("li",{className:ne({selected:f&&b<=f}),children:h.jsx(Fe,{variant:"tertiary",size:"small",icon:{icon:`star${!f||b>f?"_empty":""}`,position:"left",hover:"star"},screenreaderText:`${o.formatMessage({id:`${g}stars`},{number:b,total:t})}${b===1||b===t?` - ${m[b===1?"low":"high"]}`:""}`,onClick:T=>{T.preventDefault(),T.stopPropagation(),y(b)},disabled:p})},`rating-${b}`)})})]})},lw={id:"",showLinkEditor:!1,mentionPopover:{show:!1,selectedUser:0,possibleUsers:[],position:null,numberOfUsers:null},lastAnchor:null,isInOverlay:!1,dispatch:()=>{},enrichedUrl:void 0,onMention:()=>{},getLinkPreview:()=>Promise.resolve({}),reportError:e=>{console.error(e)}},Oi=E.createContext(lw),uw={tabbableOption:"",setFocus:()=>{},openTooltip:null,dispatch:()=>{}},Ll=E.createContext(uw);var re=(e=>(e.blockquote="block_quote",e.bold="bold",e.code="code",e.codeblock="code_block",e.heading="heading",e.hr="thematic_break",e.image="image",e.italic="italic",e.li="list_item",e.link="link",e.mention="mention",e.ol="ol_list",e.paragraph="paragraph",e.ul="ul_list",e.strikethrough="strikeThrough",e.span="span",e.h3="heading_three",e))(re||{}),qr=(e=>(e.delete="delete_mark",e.emphasis="emphasis_mark",e.code="inline_code_mark",e.strong="strong_mark",e))(qr||{});const cw=({attributes:e,children:t,element:n})=>{const r=n;switch(r.type){case re.blockquote:return h.jsx("blockquote",{className:"subtle",...e,children:t});case re.link:return h.jsx("a",{...e,children:t});case re.li:return h.jsx("li",{...e,children:t});case re.mention:const i=r;return i!=null&&i.name&&i.name===bl?h.jsxs("span",{...e,className:"mention deleted-user",children:["@",h.jsx(ue.FormattedMessage,{id:"member_deleted"}),t]}):h.jsxs("a",{...e,className:"mention",children:["@",(i==null?void 0:i.name)||"",t]});case re.ol:return h.jsx("ol",{...e,children:t});case re.ul:return h.jsx("ul",{...e,children:t});case re.span:return h.jsx("span",{...e,children:t});case re.paragraph:return h.jsx("p",{...e,children:t});case re.h3:return h.jsx("h3",{...e,children:t});default:return h.jsx("span",{...e,children:t})}},dw=({attributes:e,children:t,leaf:n})=>{const r=n;return r[re.bold]&&(t=h.jsx("strong",{children:t})),r[re.italic]&&(t=h.jsx("em",{children:t})),r[re.strikethrough]&&(t=h.jsx("s",{children:t})),h.jsx("span",{...e,children:t})};var fw=mw,kb="֑-߿יִ-﷽ﹰ-ﻼ",Db="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",hw=new RegExp("^[^"+Db+"]*["+kb+"]"),pw=new RegExp("^[^"+kb+"]*["+Db+"]");function mw(e){return e=String(e||""),hw.test(e)?"rtl":pw.test(e)?"ltr":"neutral"}const Ob=Or(fw);function gw(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var nm=gw,vw=typeof au=="object"&&au&&au.Object===Object&&au,yw=vw,Ew=yw,bw=typeof self=="object"&&self&&self.Object===Object&&self,Tw=Ew||bw||Function("return this")(),Nb=Tw,_w=Nb,Cw=function(){return _w.Date.now()},xw=Cw,ww=/\s/;function Aw(e){for(var t=e.length;t--&&ww.test(e.charAt(t)););return t}var Sw=Aw,kw=Sw,Dw=/^\s+/;function Ow(e){return e&&e.slice(0,kw(e)+1).replace(Dw,"")}var Nw=Ow,Iw=Nb,Pw=Iw.Symbol,Ib=Pw,Rg=Ib,Pb=Object.prototype,Rw=Pb.hasOwnProperty,Fw=Pb.toString,To=Rg?Rg.toStringTag:void 0;function Bw(e){var t=Rw.call(e,To),n=e[To];try{e[To]=void 0;var r=!0}catch{}var i=Fw.call(e);return r&&(t?e[To]=n:delete e[To]),i}var Mw=Bw,Lw=Object.prototype,$w=Lw.toString;function jw(e){return $w.call(e)}var Hw=jw,Fg=Ib,Uw=Mw,zw=Hw,qw="[object Null]",Ww="[object Undefined]",Bg=Fg?Fg.toStringTag:void 0;function Vw(e){return e==null?e===void 0?Ww:qw:Bg&&Bg in Object(e)?Uw(e):zw(e)}var Kw=Vw;function Gw(e){return e!=null&&typeof e=="object"}var Yw=Gw,Zw=Kw,Qw=Yw,Xw="[object Symbol]";function Jw(e){return typeof e=="symbol"||Qw(e)&&Zw(e)==Xw}var eA=Jw,tA=Nw,Mg=nm,nA=eA,Lg=0/0,rA=/^[-+]0x[0-9a-f]+$/i,iA=/^0b[01]+$/i,aA=/^0o[0-7]+$/i,sA=parseInt;function oA(e){if(typeof e=="number")return e;if(nA(e))return Lg;if(Mg(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Mg(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=tA(e);var n=iA.test(e);return n||aA.test(e)?sA(e.slice(2),n?2:8):rA.test(e)?Lg:+e}var lA=oA,uA=nm,Cd=xw,$g=lA,cA="Expected a function",dA=Math.max,fA=Math.min;function hA(e,t,n){var r,i,a,s,o,l,u=0,c=!1,d=!1,f=!0;if(typeof e!="function")throw new TypeError(cA);t=$g(t)||0,uA(n)&&(c=!!n.leading,d="maxWait"in n,a=d?dA($g(n.maxWait)||0,t):a,f="trailing"in n?!!n.trailing:f);function p(A){var S=r,I=i;return r=i=void 0,u=A,s=e.apply(I,S),s}function g(A){return u=A,o=setTimeout(v,t),c?p(A):s}function m(A){var S=A-l,I=A-u,B=t-S;return d?fA(B,a-I):B}function y(A){var S=A-l,I=A-u;return l===void 0||S>=t||S<0||d&&I>=a}function v(){var A=Cd();if(y(A))return b(A);o=setTimeout(v,m(A))}function b(A){return o=void 0,f&&r?p(A):(r=i=void 0,s)}function T(){o!==void 0&&clearTimeout(o),u=0,r=l=i=o=void 0}function _(){return o===void 0?s:b(Cd())}function C(){var A=Cd(),S=y(A);if(r=arguments,i=this,l=A,S){if(o===void 0)return g(l);if(d)return clearTimeout(o),o=setTimeout(v,t),p(l)}return o===void 0&&(o=setTimeout(v,t)),s}return C.cancel=T,C.flush=_,C}var Rb=hA;const pA=Or(Rb);var mA=Rb,gA=nm,vA="Expected a function";function yA(e,t,n){var r=!0,i=!0;if(typeof e!="function")throw new TypeError(vA);return gA(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),mA(e,t,{leading:r,maxWait:t,trailing:i})}var EA=yA;const bA=Or(EA),jg=e=>typeof e=="object"&&e!=null&&e.nodeType===1,Hg=(e,t)=>(!t||e!=="hidden")&&e!=="visible"&&e!=="clip",xd=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const n=getComputedStyle(e,null);return Hg(n.overflowY,t)||Hg(n.overflowX,t)||(r=>{const i=(a=>{if(!a.ownerDocument||!a.ownerDocument.defaultView)return null;try{return a.ownerDocument.defaultView.frameElement}catch{return null}})(r);return!!i&&(i.clientHeight<r.scrollHeight||i.clientWidth<r.scrollWidth)})(e)}return!1},hu=(e,t,n,r,i,a,s,o)=>a<e&&s>t||a>e&&s<t?0:a<=e&&o<=n||s>=t&&o>=n?a-e-r:s>t&&o<n||a<e&&o>n?s-t+i:0,TA=e=>{const t=e.parentElement;return t??(e.getRootNode().host||null)},Ug=(e,t)=>{var n,r,i,a;if(typeof document>"u")return[];const{scrollMode:s,block:o,inline:l,boundary:u,skipOverflowHiddenElements:c}=t,d=typeof u=="function"?u:z=>z!==u;if(!jg(e))throw new TypeError("Invalid target");const f=document.scrollingElement||document.documentElement,p=[];let g=e;for(;jg(g)&&d(g);){if(g=TA(g),g===f){p.push(g);break}g!=null&&g===document.body&&xd(g)&&!xd(document.documentElement)||g!=null&&xd(g,c)&&p.push(g)}const m=(r=(n=window.visualViewport)==null?void 0:n.width)!=null?r:innerWidth,y=(a=(i=window.visualViewport)==null?void 0:i.height)!=null?a:innerHeight,{scrollX:v,scrollY:b}=window,{height:T,width:_,top:C,right:A,bottom:S,left:I}=e.getBoundingClientRect(),{top:B,right:F,bottom:R,left:N}=(z=>{const P=window.getComputedStyle(z);return{top:parseFloat(P.scrollMarginTop)||0,right:parseFloat(P.scrollMarginRight)||0,bottom:parseFloat(P.scrollMarginBottom)||0,left:parseFloat(P.scrollMarginLeft)||0}})(e);let k=o==="start"||o==="nearest"?C-B:o==="end"?S+R:C+T/2-B+R,M=l==="center"?I+_/2-N+F:l==="end"?A+F:I-N;const $=[];for(let z=0;z<p.length;z++){const P=p[z],{height:te,width:ee,top:D,right:x,bottom:V,left:L}=P.getBoundingClientRect();if(s==="if-needed"&&C>=0&&I>=0&&S<=y&&A<=m&&C>=D&&S<=V&&I>=L&&A<=x)return $;const H=getComputedStyle(P),j=parseInt(H.borderLeftWidth,10),U=parseInt(H.borderTopWidth,10),Q=parseInt(H.borderRightWidth,10),ie=parseInt(H.borderBottomWidth,10);let J=0,W=0;const ae="offsetWidth"in P?P.offsetWidth-P.clientWidth-j-Q:0,oe="offsetHeight"in P?P.offsetHeight-P.clientHeight-U-ie:0,be="offsetWidth"in P?P.offsetWidth===0?0:ee/P.offsetWidth:0,we="offsetHeight"in P?P.offsetHeight===0?0:te/P.offsetHeight:0;if(f===P)J=o==="start"?k:o==="end"?k-y:o==="nearest"?hu(b,b+y,y,U,ie,b+k,b+k+T,T):k-y/2,W=l==="start"?M:l==="center"?M-m/2:l==="end"?M-m:hu(v,v+m,m,j,Q,v+M,v+M+_,_),J=Math.max(0,J+b),W=Math.max(0,W+v);else{J=o==="start"?k-D-U:o==="end"?k-V+ie+oe:o==="nearest"?hu(D,V,te,U,ie+oe,k,k+T,T):k-(D+te/2)+oe/2,W=l==="start"?M-L-j:l==="center"?M-(L+ee/2)+ae/2:l==="end"?M-x+Q+ae:hu(L,x,ee,j,Q+ae,M,M+_,_);const{scrollLeft:He,scrollTop:Be}=P;J=we===0?0:Math.max(0,Math.min(Be+J/we,P.scrollHeight-te/we+oe)),W=be===0?0:Math.max(0,Math.min(He+W/be,P.scrollWidth-ee/be+ae)),k+=Be-J,M+=He-W}$.push({el:P,top:J,left:W})}return $},_A=e=>e===!1?{block:"end",inline:"nearest"}:(t=>t===Object(t)&&Object.keys(t).length!==0)(e)?e:{block:"start",inline:"nearest"};function CA(e,t){if(!e.isConnected||!(i=>{let a=i;for(;a&&a.parentNode;){if(a.parentNode===document)return!0;a=a.parentNode instanceof ShadowRoot?a.parentNode.host:a.parentNode}return!1})(e))return;const n=(i=>{const a=window.getComputedStyle(i);return{top:parseFloat(a.scrollMarginTop)||0,right:parseFloat(a.scrollMarginRight)||0,bottom:parseFloat(a.scrollMarginBottom)||0,left:parseFloat(a.scrollMarginLeft)||0}})(e);if((i=>typeof i=="object"&&typeof i.behavior=="function")(t))return t.behavior(Ug(e,t));const r=typeof t=="boolean"||t==null?void 0:t.behavior;for(const{el:i,top:a,left:s}of Ug(e,_A(t))){const o=a-n.top+n.bottom,l=s-n.left+n.right;i.scroll({top:o,left:l,behavior:r})}}/*!
64
64
  * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
65
65
  *
66
66
  * Copyright (c) 2014-2017, Jon Schlinkert.
@@ -159,9 +159,9 @@ ${p}${d?"1.":"-"} ${u}${f?`
159
159
 
160
160
  `.substring(0,i);return n+a+r}function mR(e){return e!=null&&(typeof e=="string"||e.nodeType&&(e.nodeType===1||e.nodeType===9||e.nodeType===11))}var gR={isHistory(e){return on(e)&&Array.isArray(e.redos)&&Array.isArray(e.undos)&&(e.redos.length===0||Qi.isOperationList(e.redos[0].operations))&&(e.undos.length===0||Qi.isOperationList(e.undos[0].operations))}},Gd=new WeakMap,Yd=new WeakMap,ks={isHistoryEditor(e){return gR.isHistory(e.history)&&O.isEditor(e)},isMerging(e){return Yd.get(e)},isSaving(e){return Gd.get(e)},redo(e){e.redo()},undo(e){e.undo()},withoutMerging(e,t){var n=ks.isMerging(e);Yd.set(e,!1),t(),Yd.set(e,n)},withoutSaving(e,t){var n=ks.isSaving(e);Gd.set(e,!1),t(),Gd.set(e,n)}},vR=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&&le.setSelection(t,a.selectionBefore),ks.withoutSaving(t,()=>{O.withoutNormalizing(t,()=>{for(var s of a.operations)t.apply(s)})}),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];ks.withoutSaving(t,()=>{O.withoutNormalizing(t,()=>{var s=a.operations.map(Qi.inverse).reverse();for(var o of s)t.apply(o);a.selectionBefore&&le.setSelection(t,a.selectionBefore)})}),t.writeHistory("redos",a),r.undos.pop()}},t.apply=r=>{var{operations:i,history:a}=t,{undos:s}=a,o=s[s.length-1],l=o&&o.operations[o.operations.length-1],u=ks.isSaving(t),c=ks.isMerging(t);if(u==null&&(u=ER(r)),u){if(c==null&&(o==null?c=!1:i.length!==0?c=!0:c=yR(r,l)),o&&c)o.operations.push(r);else{var d={operations:[r],selectionBefore:t.selection};t.writeHistory("undos",d)}for(;s.length>100;)s.shift();a.redos=[]}n(r)},t.writeHistory=(r,i)=>{t.history[r].push(i)},t},yR=(e,t)=>!!(t&&e.type==="insert_text"&&t.type==="insert_text"&&e.offset===t.offset+t.text.length&&G.equals(e.path,t.path)||t&&e.type==="remove_text"&&t.type==="remove_text"&&e.offset+e.text.length===t.offset&&G.equals(e.path,t.path)),ER=(e,t)=>e.type!=="set_selection";const bR=(e,t)=>{const{apply:n}=e;try{e.apply=r=>{if(r.type==="remove_node"&&"type"in r.node&&r.node.type===re.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 TR=wR,_R=/^(?:\w+:)?\/\/(\S+)$/,CR=/^localhost[\:?\d]*(?:[^\:?\d]\S*)?$/,xR=/^[^\s\.]+\.\S{2,}$/;function wR(e){if(typeof e!="string")return!1;var t=e.match(_R);if(!t)return!1;var n=t[1];return n?!!(CR.test(n)||xR.test(n)):!1}const AR=Or(TR),SR=(e,t,n)=>{const{insertText:r,isInline:i}=e;try{e.isInline=a=>{const s=a;return[re.link].includes(s.type)||i(a)},e.insertText=a=>{a&&AR(a)?xm(e,a,t):r(a)}}catch(a){const s=a.message;n(`Error in withInlines: ${s}`)}return e},kR=(e,t)=>{const{isInline:n,isVoid:r,markableVoid:i}=e;try{e.isInline=a=>a.type===re.mention?!0:n(a),e.isVoid=a=>a.type===re.mention?!0:r(a),e.markableVoid=a=>a.type===re.mention||i(a)}catch(a){const s=a.message;t(`Error in withMentions: ${s}`)}return e},DR=(e,t)=>{const{normalizeNode:n}=e;try{e.normalizeNode=([r,i])=>{if(r.type===re.link&&ve.string(r).trim()===""){le.removeNodes(e,{at:i});return}n([r,i])}}catch(r){const i=r.message;t(`Error in withoutEmptyLinks: ${i}`)}return e};const km=({id:e="rich-text-editor",value:t,placeholder:n,maxLength:r=0,meta:i,functions:a,autoFocus:s,data:o,styling:l,...u})=>{const c=ue.useIntl(),d=xx();typeof s>"u"&&(s=!0);const{isInOverlay:f=!1}=i||{},{listMembers:p,clickMentionFallback:g,onChange:m=()=>{},onChangeData:y=()=>{},getLinkPreview:v=()=>Promise.resolve({}),onMention:b=()=>{},reportError:T=j=>{console.error(j)}}=a||{},_=[{type:re.paragraph,children:[{text:""}]}];t==="<br>"&&(t="");const C={editorKey:null,originalValue:t||"",initialValue:t?null:_,showLinkEditor:!1,mentionPopover:{show:!1,selectedUser:0,possibleUsers:[],position:null,numberOfUsers:null},lastAnchor:null,stringValue:"",lastKey:null,hasInteracted:!1,hasLoaded:!1,enrichedUrl:!1},[A,S]=E.useReducer(eo,C),{editorKey:I,originalValue:B,initialValue:F,stringValue:R,lastAnchor:N,lastKey:k,hasInteracted:M,hasLoaded:$,enrichedUrl:z,mentionPopover:P}=A,te=async j=>{const U=await v(j);U.url&&S([{type:"enrichedUrl",value:U}])},ee=`rte-${e}`,D=E.useCallback(j=>h.jsx(cw,{...j}),[]),x=E.useCallback(j=>h.jsx(dw,{...j}),[]),V=E.useMemo(()=>bR(SR(kR(DR(vR(QO(eD())),T),T),ee,T),T),[]),L=j=>{if(!V||j!==ee)return;const U=O.end(V,[]);le.select(V,U),de.focus(V)};E.useEffect(()=>{const j=U=>{var J;const Q=U,ie=((J=Q==null?void 0:Q.detail)==null?void 0:J.id)||null;ie&&L(ie)};return window.addEventListener("focusEditor",j),()=>{window.removeEventListener("focusEditor",j)}},[]),E.useEffect(()=>{if(V.children.length>0&&!$){if(S([{type:"hasLoaded",value:!0}]),!s)return;L(ee)}},[V.children.length,F]),E.useEffect(()=>{B&&(async()=>{let U=ur(B);if(U.endsWith("<br/>")&&(U=U.slice(0,-5)),U.includes("<")){Dl.prototype.escape=ie=>ie;const Q=new Dl;Q.addRule("br",{filter:["br"],replacement:ie=>ie+`
161
161
 
162
- `}),U=Q.turndown(U)}o&&o.mentions&&(U=await A4({text:U,template:`[${qh}{{name}}]({{id}})`,mentions:o.mentions,listMembers:p||(()=>Promise.resolve([]))})),AP(U,Q=>{const ie=[{type:"initialValue",value:Q},{type:"editorKey",value:B.toString()}];o!=null&&o.link&&(ie.push({type:"enrichedUrl",value:o.link}),o.link.url&&te(o.link.url)),S(ie),setTimeout(()=>{S([{type:"stringValue",value:x9(V)}])},150)})})()},[B]),E.useEffect(()=>{if(z===void 0&&V){const U=DP(V);U&&te(U)}const j=U=>{var J;const Q=U,ie=((J=Q==null?void 0:Q.detail)==null?void 0:J.url)||null;ie&&z&&z.url===ie&&S([{type:"enrichedUrl",value:void 0}])};return window.addEventListener("linkRemoved",j),()=>{window.removeEventListener("linkRemoved",j)}},[z]),E.useEffect(()=>{if(t){$a.lastIndex=0;const j=t.match($a);j&&j.length===1&&j[0].length===t.length&&!M&&S([{type:"originalValue",value:t}])}t!==""||!V||Mc(B,t)&&!M||(O.withoutNormalizing(V,()=>{le.delete(V,{at:{anchor:O.start(V,[]),focus:O.end(V,[])}}),le.deselect(V),V.children.length!==0&&le.unwrapNodes(V,{at:[0]}),le.insertNodes(V,_,{at:[0]})}),S([{type:"initialValue",value:_},{type:"lastAnchor",value:null},{type:"enrichedUrl",value:!1}]))},[t]),E.useEffect(()=>{y({link:z})},[z]),E.useEffect(()=>{R===""&&z&&S([{type:"enrichedUrl",value:void 0}])},[R]);const H=El(()=>{NP({editor:V,isShowing:P.show,numberOfUsers:P.numberOfUsers,listMembers:p,dispatch:S})},100);return F?h.jsx("div",{id:ee,className:"rich-text-editor input text-medium",children:h.jsxs(Oi.Provider,{value:{...A,id:ee,isInOverlay:f,dispatch:S,onMention:b,reportError:T},children:[h.jsxs(YO,{editor:V,initialValue:F,onChange:j=>{if(V.operations.some(Q=>Q.type!=="set_selection")){let Q=PP(j);Q==="<br>"&&(Q=""),m(Q,z),S([{type:"stringValue",value:x9(V)}]),M||S([{type:"hasInteracted",value:!0}]),H(),d&&console.log({serialized:Q,json:j})}},...u,children:[h.jsx(jO,{className:"editor",renderElement:D,renderLeaf:x,placeholder:n||c.formatMessage({id:"richTextEditor_placeholder"}),autoFocus:s,tabIndex:0,onPaste:async j=>{const U=z!==!1,Q=j.clipboardData.getData("text");if((J=>{try{return new URL(J),!0}catch{return!1}})(Q)){let J=Q;if(Q){const{full:W}=Np(Q);J=W}if(Q&&v&&!U){const W=await v(J);W.url&&S([{type:"enrichedUrl",value:W}])}}},onKeyDown:j=>{if(j.key==="Enter"){P.show&&(j.preventDefault(),j.stopPropagation(),MT(V,P,S,ee));const{selection:U}=V;if(U){const Q=se.isCollapsed(U),[ie,J]=O.node(V,U,{depth:1});let W=ie,ae=W.type;const oe=W.children[0];if(ae===re.h3){j.preventDefault(),j.stopPropagation();const be=O.start(V,J),we=O.end(V,J),He=Ze.equals(U.anchor,be),Be=Ze.equals(U.anchor,we);if(He)le.insertNodes(V,_,{at:J});else if(Be)le.insertNodes(V,_,{at:G.next(J)}),le.select(V,O.end(V,G.next(J)));else{const $e=U.anchor,[,Ye]=O.parent(V,U);le.splitNodes(V,{at:$e}),le.setNodes(V,{type:re.paragraph},{at:G.next(Ye)})}return}if(oe&&[re.ol,re.ul].includes(oe.type)&&(W=oe,ae=oe.type),W&&Ae.isElement(W)&&ae!==re.paragraph){if(ae===re.blockquote&&!j.shiftKey){j.stopPropagation(),j.preventDefault(),le.insertNodes(V,_);return}if(Q){const[be,we]=O.parent(V,U,{edge:"end"}),Be=be.type;if([re.ul,re.ol].includes(ae))if(j.stopPropagation(),j.preventDefault(),Be===re.li&&k==="Enter"){be.children.length===1&&"text"in be.children[0]&&be.children[0].text===""&&le.removeNodes(V,{at:we}),le.insertNodes(V,_,{at:G.next(J)}),le.select(V,O.end(V,G.next(J)));return}else{const[$e,Ye]=SP(V,re.li),qe={type:re.li,children:[{text:""}]};le.insertNodes(V,qe,{at:G.next(Ye)}),le.select(V,O.end(V,G.next(Ye)))}}}}}else if(j.key==="Escape"){if(P.show){j.preventDefault(),j.stopPropagation(),S([{type:"mentionPopover",value:{...P,show:!1}}]);return}}else if(["ArrowUp","ArrowDown"].includes(j.key)&&P.show){j.preventDefault(),j.stopPropagation();const{selectedUser:U,possibleUsers:Q}=P;let ie=j.key==="ArrowUp"?U-1:U+1;ie<0&&(ie=Q.length-1),ie>=Q.length+1&&(ie=0),S([{type:"mentionPopover",value:{...P,selectedUser:ie}}])}S([{type:"lastKey",value:j.key}]),OP(j,V,S,T)},onBlur:()=>{V.selection&&S([{type:"lastAnchor",value:V.selection.anchor}])},onFocus:()=>{if(N){if(!G.isPath(N.path)||!ve.has(V,N.path))return;const j=ve.get(V,N.path);let U=0;if(ke.isText(j)?U=j.text.length:j.children&&(U=j.children.length),N.offset>U)return;try{le.select(V,{anchor:N,focus:N})}catch(Q){const ie=Q.message;T(`Error focusing editor: ${ie}`)}}}}),z?h.jsx(Om,{data:z,variant:"condensed",onClick:()=>{S([{type:"enrichedUrl",value:!1}]);const j=new CustomEvent("ariaLive",{detail:{message:c.formatMessage({id:"richTextEditor_link_enrichedUrl_aria_live"})}});document.dispatchEvent(j)},"aria-label":c.formatMessage({id:"richTextEditor_link_enrichedUrl_aria"},{title:z.title||c.formatMessage({id:"richTextEditor_link_enrichedUrl_aria_fallback"})})}):h.jsx(h.Fragment,{}),h.jsx(qP,{styling:l==null?void 0:l.toolbar}),p?h.jsx(RP,{onFallbackClick:g}):h.jsx(h.Fragment,{})]},I),h.jsx(em,{id:`character-limit-${e}`,limit:r,valueLength:T1(R)})]})}):h.jsx(h.Fragment,{})};const OR=({id:e="form-toggle",label:t,options:n,initialValue:r,functions:{onChange:i=()=>{}},isDisabled:a=!1,className:s=""})=>{const[o,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 h.jsxs("div",{className:ne("toggle",s),onClick:c=>{c.preventDefault(),c.stopPropagation(),u(o===n[0].value?n[1].value:n[0].value)},children:[h.jsx("p",{children:t}),h.jsx("ul",{className:ne("toggle-options",{disabled:a,on:o===n[1].value}),children:n.map(c=>{const d=`${e}-${c.value}`;return h.jsxs("li",{className:"hidden",children:[h.jsx("input",{type:"radio",id:d,name:e,value:c.value,checked:o===c.value,onChange:()=>u(c.value),disabled:a}),h.jsx("label",{htmlFor:d,children:c.label})]},d)})})]})};function XT({className:e="",userId:t,userName:n,src:r,uploadImage:i,button:a,callback:s}){const o=ue.useIntl(),l="profileImageChange_",[u,c]=E.useState(r),[d,f]=E.useState(!1),[p,g]=E.useState(!1),m=E.useRef(null),y=async _=>{f(!0),g(!1);try{const C=_.target.files&&_.target.files[0];if(!C||!t)throw f(!1),new Error("Image file or userID is missing");const A=await i({fileObject:C,userId:t}),S={thumbnail:A.thumbnailURL,full:A.originalURL};c(S),s(S)}catch{g(!0)}finally{f(!1)}f(!1)},{upload:v=o.formatMessage({id:`${l}cta_upload`}),change:b=o.formatMessage({id:`${l}cta_change`}),uploading:T=o.formatMessage({id:`${l}cta_uploading`})}=(a==null?void 0:a.text)||{};return h.jsxs("div",{className:ne("profile-image-change-figure",e),children:[h.jsx(ki,{className:"profile-image-change-picture",name:n,src:u==null?void 0:u.thumbnail,showInitials:!1,alt:"","data-testid":"profile-picture"}),p&&h.jsx("p",{className:"error text-small",children:o.formatMessage({id:`${l}error`})}),h.jsx("input",{id:"file",type:"file",accept:"image/*",ref:m,onChange:y,hidden:!0,"data-testid":"file-input"}),h.jsx(Fe,{onClick:()=>m.current&&m.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?T:u?b:v})]})}const JT=({gtm:e,functions:{onSuccess:t=async()=>{},onFailure:n=()=>{}}})=>{const{context:r="FooterContactUsForm",event:i="contact-form-submit-click"}=e||{};return h.jsx(Nr,{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 NR=({emails:e,setEmails:t,setIsDisabled:n})=>{const{formatMessage:r}=ue.useIntl();return h.jsx(ux.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,s)=>h.jsxs("div",{className:"email text-medium",children:[h.jsx("div",{"data-tag-item":!0,children:i}),h.jsx(Fe,{variant:"tertiary",size:"small",icon:{icon:"close"},onClick:()=>{s(a),n(!e.length)},className:"remove-email-button",screenreaderText:r({id:"overlay_close"})})]},a)})},e8=({title:e,label:t,messagePlaceholder:n,ctaMessage:r,titleColor:i,labelColor:a,backgroundColor:s,onClose:o,reportError:l,sendInvites:u,initialFormStatus:c="NOT_SUBMITTED",gtm:d={context:"Form",event:"form-submit-click"},secondaryActionButton:f,meta:p})=>{const[g,m]=E.useState([]),[y,v]=E.useState(!0),[b,T]=E.useState(c),{formatMessage:_}=ue.useIntl(),C=async I=>{try{await u(g,I.message),m([]),T("SUCCESS")}catch(B){T("ERROR"),l(B)}},A=I=>{I.preventDefault(),T("NOT_SUBMITTED"),v(!0),m([])},S=I=>{I.preventDefault(),o(),T("CLOSED")};return b==="CLOSED"?null:b==="ERROR"||b==="SUCCESS"&&!(p!=null&&p.shouldHideDoneButtonOnSubmit)?h.jsxs("div",{className:"invite-form-wrapper",children:[h.jsx("div",{className:"content centred",children:b==="SUCCESS"?h.jsx("h2",{className:"success-title",children:_({id:"inviteForm_success"})}):h.jsxs("h2",{className:"error-title",children:[" ",_({id:"inviteForm_error"})]})}),h.jsx(Dr,{}),h.jsx("div",{className:"footer",children:b==="SUCCESS"?h.jsxs(h.Fragment,{children:[h.jsx(Fe,{variant:"secondary",onClick:A,children:_({id:"inviteForm_ctaSendMoreInvites"})}),h.jsx(Fe,{onClick:S,children:_({id:"inviteForm_ctaDone"})})]}):h.jsx(Fe,{onClick:A,children:_({id:"inviteForm_ctaTryAgain"})})})]}):h.jsxs("div",{className:"invite-form-wrapper",style:{backgroundColor:s},children:[h.jsxs("div",{className:"content",children:[h.jsx("h2",{className:"title",style:{color:i},children:e}),h.jsx("label",{htmlFor:"email-input",className:"label",style:{color:a},children:t})]}),h.jsx(Nr,{id:"invite-form",fields:[{component:NR,props:{emails:g,setEmails:m,setIsDisabled:v},required:!0},{id:"message",type:"textarea",label:_({id:"inviteForm_message_label"}),placeholder:n||_({id:"inviteForm_message_placeholder"})}],functions:{onSuccess:C},button:{text:r,size:"medium",disabled:y},gtm:d,meta:p,secondaryActionButton:f})]})},_c=e=>e.map(t=>({condition:t}));const Jn={FORM_ID:"manage-account-password-change",NEW_PASSWORD:"newPassword",CONFIRMED_PASSWORD:"confirmedPassword",CURRENT_PASSWORD:"oldPassword"},IR=({functions:e,...t})=>{const{formatMessage:n}=ue.useIntl(),[r,i]=E.useState(null),[a,s]=E.useState(!1),[o,l]=E.useState({isMoreThanEightCharacters:!1,includesNumberAndSymbol:!1,includesLowerAndUppercase:!1}),u=p=>p[Jn.NEW_PASSWORD]!==p[Jn.CONFIRMED_PASSWORD]?n({id:"passwordRules_unmatched_text"}):null,c=p=>!_h(p[Jn.NEW_PASSWORD]).isValid,d=[{"data-testid":Jn.NEW_PASSWORD,id:Jn.NEW_PASSWORD,type:"password",autoComplete:"new-password",placeholder:"",label:n({id:"passwordRules_newPassword_label"}),validation:_c(["required",c]),functions:{onChange:p=>l(_h(p).matchingRules),onFocus:()=>s(!0),onBlur:()=>s(!1)}},{"data-testid":Jn.CONFIRMED_PASSWORD,id:Jn.CONFIRMED_PASSWORD,type:"password",autoComplete:"new-password",placeholder:"",label:n({id:"passwordRules_confirmPassword_label"}),validation:_c(["required",u])}];t.isPasswordChange&&d.unshift({"data-testid":Jn.CURRENT_PASSWORD,id:Jn.CURRENT_PASSWORD,type:"password",autoComplete:"current-password",placeholder:"",label:n({id:"passwordRules_currentPassword_label"}),validation:_c(["required"])}),a&&d.push({component:Sb,props:{matchingRules:o}});const f={id:Jn.FORM_ID,fields:d,functions:{...e,onSuccess:async p=>(e.createPassword(p),e.onSuccess&&e.onSuccess(p)),onCatch:p=>i(p==null?void 0:p.statusCode),onFailure:(p,g)=>{(g.includes(Jn.NEW_PASSWORD)||g.includes(Jn.CONFIRMED_PASSWORD))&&s(!0)}},meta:{shouldReset:!0},...t};return h.jsxs(h.Fragment,{children:[h.jsx(Nr,{...f}),r&&h.jsx(Xr,{variant:"error",text:r})]})};const t8=({isCreateProfile:e=!1,hooks:t,functions:n,meta:r={},gtm:i,...a})=>{var I;const s=ue.useIntl(),o="profileForm_",l=E.useContext(jt),[u,c]=E.useState(l.image),[d,f]=E.useState(!1),{uploadImage:p=()=>{},onSuccess:g=async B=>{},onCancel:m=()=>{},onFailure:y=()=>{}}=n,{buildLocation:v,isValidPlace:b,predictPlaces:T}=t.useMaps(),{context:_="ProfileForm",event:C="profile-form-submit-click"}=i||{},A=[{id:"jobTitle",type:"text",label:s.formatMessage({id:`${o}jobTitle`}),placeholder:s.formatMessage({id:`${o}jobTitle_placeholder`}),value:l.jobTitle,validation:[{condition:"required"}]},{id:"organization",type:"text",label:s.formatMessage({id:`${o}organization`}),placeholder:s.formatMessage({id:`${o}organization_placeholder`}),value:l.organization,validation:[{condition:"required"}]},{id:"location",type:"autocomplete",label:s.formatMessage({id:`${o}location`}),placeholder:s.formatMessage({id:`${o}location_placeholder`}),value:(I=l.location)==null?void 0:I.en,validation:[{condition:"required"},{condition:({location:B})=>B&&!d?!1:!b(B),error:s.formatMessage({id:`${o}location_error`})}],functions:{onChange:()=>{d||f(!0)},onKeyInput:T}}],S=[{component:XT,props:{userName:l.name,userId:l.id,src:u,uploadImage:p,callback:c,button:{text:{upload:s.formatMessage({id:`${o}image`})}}}},{id:"name",type:"text",label:s.formatMessage({id:`${o}name`}),placeholder:s.formatMessage({id:`${o}name_placeholder`}),value:l.name,autoComplete:"name",validation:[{condition:"required"}]},...A,{id:"biography",type:"textarea",label:s.formatMessage({id:`${o}bio`}),placeholder:s.formatMessage({id:`${o}bio_placeholder`}),limit:1e3,value:l.biography},{component:Dr}];return h.jsx(Nr,{id:"profile-details-form",fields:e?A:S,meta:{shouldShowCancelButton:!e,shouldReset:!1,shouldHide:!1,showRequiredLabels:e,...r},intlPath:o,gtm:{context:_,event:C},functions:{onSuccess:async B=>{try{const F={...B,image:u||null,location:d?await v(B==null?void 0:B.location):l.location,...e?{onboardingState:"completed"}:{}};l.updateDetails&&l.updateDetails(R=>({...R,...F})),await g(F)}catch{y()}},onCancel:m,onFailure:y},button:{size:"large",text:{default:s.formatMessage({id:`${o}cta`}),submitting:s.formatMessage({id:`${o}cta_submitting`}),submitted:s.formatMessage({id:`${o}cta_submitted`})}},...a})},PR=()=>{const e=ue.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)}},[]),h.jsx(G4,{progress:t,steps:{0:{icon:"layers",text:e.formatMessage({id:"publishArticleForm_progressBar"})}}})};function RR({coverImage:e,setShowImagePicker:t}){return e&&e.url?h.jsx(Xr,{className:"cover-image-preview",text:h.jsx(aa,{className:"cover-image",image:{description:e.description||"",height:e.height,width:e.width,url:e.url,color:e.color,type:"image/jpeg"}}),button:{component:h.jsx(Fe,{variant:"tertiary",onClick:()=>t(!0),children:h.jsx(ue.FormattedMessage,{id:"publishArticleForm_replaceImage_button"})})}}):h.jsx(Xr,{button:{component:h.jsx(Fe,{variant:"secondary",onClick:()=>t(!0),children:h.jsx(ue.FormattedMessage,{id:"publishArticleForm_selectImage_button"})})}})}var n8=(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))(n8||{});let Zd=null;const zt="publishArticleForm_",N9={},I9=10,FR=({id:e="publish-article-form",values:t=N9,setShowImagePicker:n,functions:r,meta:i,gtm:a,isEditMode:s=!1})=>{var R;const o=ue.useIntl(),l=E.useContext(jt),{create:u,edit:c,onSuccess:d=()=>{},onFailure:f=()=>{}}=r||{},{isInOverlay:p=!1}=i||{},[g,m]=E.useState(!1),[y,v]=E.useState(t.body||""),[b,T]=E.useState(!1),[_,C]=E.useState("");E.useEffect(()=>{Mc(t,N9)||Tl(t.body)&&t.body!==y&&t.body!==void 0&&v(t.body)},[t.body]);const A=()=>{!l||!l.id?T(o.formatMessage({id:`${zt}error_loggedOut`})):b&&T(!1)},S=N=>({condition:k=>{const M=k[N];return!M||typeof M!="string"?!0:M.length<I9},error:o.formatMessage({id:`${zt}error_underMinLength`},{length:I9})}),I=!!y&&Tl(y),B=()=>h.jsxs(h.Fragment,{children:[h.jsx(Dr,{}),h.jsx("p",{className:"text-medium",children:o.formatMessage({id:`${zt}disclaimer`})})]}),F=[{id:"title",type:"textarea",value:t.title||"",limit:65,label:o.formatMessage({id:`${zt}title_label`}),placeholder:o.formatMessage({id:`${zt}title_placeholder`}),styling:{autosizeToFit:!0},functions:{onChange:A},validation:[{condition:"required"},S("title")]},{id:"subtitle",type:"textarea",value:t.subtitle,limit:115,label:o.formatMessage({id:`${zt}subtitle_label`}),styling:{autosizeToFit:!0},placeholder:o.formatMessage({id:`${zt}subtitle_placeholder`}),functions:{onChange:A},validation:[{condition:"required"},S("subtitle")]},{component:Jc,props:{formID:e,label:{visible:o.formatMessage({id:`${zt}body_label`})},showLabel:!0}},{component:km,props:{id:`${e}-input`,value:y,placeholder:o.formatMessage({id:`${zt}body_placeholder`}),meta:{isInOverlay:p},autoFocus:!1,functions:{onChange:N=>{v(N),A()}},styling:{toolbar:{showHeadingOption:!0}},"aria-invalid":!!b,"aria-errormessage":"error-message"}},{id:"tags",label:o.formatMessage({id:`${zt}tags_label`}),type:"checkboxes",styling:{displayOptionsAsPills:!0},options:Object.values(n8).map(N=>({id:N,label:o.formatMessage({id:`${zt}_tags_${N}`})})),value:t.tags||[],multipleOptions:{limit:3},validation:[{condition:"required",error:o.formatMessage({id:`${zt}tags_error_required`})},{condition:N=>{var k;return((k=N==null?void 0:N.tags)==null?void 0:k.length)>3},error:o.formatMessage({id:`${zt}tags_error_over_three`})}]},{component:Jc,props:{formID:e,label:{visible:o.formatMessage({id:`${zt}cover_image_label`})},showLabel:!0}},{component:RR,props:{coverImage:t.coverImage||{},setShowImagePicker:n}}];return g?F.push({component:Dr}):F.push({component:B}),h.jsxs("section",{className:"publish-article-form",children:[h.jsx(Nr,{id:e,meta:{shouldReset:!1,shouldHide:!1,showRequiredLabels:!1,shouldScrollOnSuccess:!1},functions:{onSuccess:async N=>{if(!l||!l.id||!I)return;Zd&&clearTimeout(Zd),m(!0);const k={...N,body:y,coverImage:t.coverImage};try{s&&c?await c(k):u&&await u(k),Zd=setTimeout(()=>{C(o.formatMessage({id:`${zt}aria_success${s?"_edit":""}`})),d(k)},500)}catch{T(o.formatMessage({id:`${zt}error`})),C(""),f()}},onFailure:f},fields:F,intlPath:zt,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:!l||!l.id||!I||!((R=t==null?void 0:t.coverImage)!=null&&R.url),text:{default:o.formatMessage({id:`${zt}cta_submit${s?"_edit":""}`}),submitting:o.formatMessage({id:`${zt}cta_submitting${s?"_edit":""}`}),submitted:o.formatMessage({id:`${zt}cta_submitted${s?"_edit":""}`})},customOnSubmit:b?h.jsx(h.Fragment,{}):h.jsx(PR,{})},gtm:a}),b&&h.jsx(Us,{id:"error-message",className:"error",children:typeof b=="string"&&b.includes(" ")?b:o.formatMessage({id:`${zt}error`})}),_&&h.jsx(ct,{"aria-live":"polite",showOnFocus:!1,children:_})]})};var ir,BR=ir={_regexEscape:/([\.\*\+\^\$\[\]\\\(\)\|\{\}\,\-\:\?])/g,_regexParseLocale:/^([a-zA-Z]*)([_\-a-zA-Z]*)$/,_escapeRegExpPattern:function(e){return typeof e!="string"?e:e.replace(ir._regexEscape,"\\$1")},_toLowerCase:function(e,t){return typeof e!="string"?t&&e:e.toLowerCase()},_toUpperCase:function(e,t){return typeof e!="string"?t&&e:e.toUpperCase()},_trim:function(e,t,n){var r=[],i,a=function(l){r.push("^"+l+"+|"+l+"+$")};if(typeof t=="boolean"&&(n=t,t=null),typeof e!="string")return n&&e;if(Array.isArray(t)&&t.map(function(l){var u=ir._escapeRegExpPattern(l);a(u)}),typeof t=="string"){var s=ir._escapeRegExpPattern(t);a(s)}t||a("\\s");var o="("+r.join("|")+")";for(i=new RegExp(o,"g");e.match(i);)e=e.replace(i,"");return e},_parseLocale:function(e){var t=ir._regexParseLocale.exec(e),n,r,i;if(!(!e||!t))return t[2]=ir._trim(t[2],["-","_"]),r=ir._toLowerCase(t[1]),i=ir._toUpperCase(t[2])||i,n={lang:r,countryCode:i},n},isRtlLang:function(e){var t=ir._parseLocale(e);if(t)return ir._BIDI_RTL_LANGS.indexOf(t.lang)>=0},getLangDir:function(e){return ir.isRtlLang(e)?"rtl":"ltr"}};Object.defineProperty(ir,"_BIDI_RTL_LANGS",{value:["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","prs","ps","sd","ug","ur","yi"],writable:!1,enumerable:!0,configurable:!1});var MR=BR,P9=MR,LR={isRtlLang:P9.isRtlLang,getLangDir:P9.getLangDir};const r8=({id:e="search",className:t="",handleToggle:n=!1,defaultValue:r="",gtmContext:i="search-bar",gtmEvent:a="form-submission"})=>{const{searchIsOpen:s=!0,isDesktopVersion:o=!1}=n||{},l=ue.useIntl(),u=E.useRef(null),c=LR.getLangDir(l.locale)||"ltr";Hs(()=>{!n||o||!s||u.current&&u.current.focus()},[s]);const d=f=>{f.preventDefault(),f.stopPropagation(),!(!u.current||!u.current.value||u.current.value.length<1)&&(window.location.href=`/search?search=${encodeURIComponent(u.current.value)}`)};return h.jsx("form",{onSubmit:d,className:ne("search-form gtm-trackable",t),role:"search","data-gtm-event-context":i,"data-gtm-event-type":a,children:h.jsx("fieldset",{id:`${e}-form`,hidden:n?!s:!1,children:h.jsxs("p",{children:[h.jsx(ct,{element:"label",htmlFor:e,children:l.formatMessage({id:"search_label"})}),h.jsx("input",{ref:u,type:"search",id:e,name:e,defaultValue:r,placeholder:l.formatMessage({id:"search_placeholder"}),onKeyDown:f=>{f.key==="Enter"&&d(f)}}),h.jsx("button",{className:"clear",onClick:f=>{f.preventDefault(),f.stopPropagation(),u.current&&u.current.value&&(u.current.value="")},children:h.jsx(ct,{children:l.formatMessage({id:"search_clear"})})}),h.jsx("button",{className:`search ${c}`,onClick:d,children:h.jsx(ct,{children:l.formatMessage({id:"search_cta"})})})]})})})},R9=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 s=Object.assign({},a);try{s=await t(i),s===void 0&&(s=a)}catch{return n([{type:"shouldManuallyApprove",value:!0},{type:"emailDetails",value:{email:i,boxType:"nonGov",isEnd2End:!1}},{type:"validFields.email",value:!1}])}const{valid:o=!1,autoApproved:l=!1,exists:u}=s;let c="";return o?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}])},$R=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"]}},jR=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 s=$R(new FormData(e.form.current)),o=Object.assign(s,t);await n(o),sessionStorage.setItem(Dp.SESSION_STORAGE.EMAIL,s.email),r&&r({...s,...a.values}),i([{type:"showSuccessMessage",value:!0}])},HR=({shouldShow:e,placeholders:t,labels:n,functions:{validateEmail:r,resendVerificationCode:i},refs:a,state:s,dispatch:o,dataToSubmit:l,intl:u})=>{const{emailDetails:c}=s,d=(p,g)=>{p.current&&s.validFields[g]!==p.current.validity.valid&&o([{type:`validFields.${g}`,value:p.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:()=>o([{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:()=>{R9({ref:a.email,validateEmail:r,dispatch:o})},onChange:(p,g)=>{o([{type:"shouldDisableButton",value:!0}]),g&&g({type:"updateValue",payload:{key:"terms",value:!1}})},onFocus:()=>o([{type:"loadRecaptcha",value:!0}])},autoComplete:"email",validation:[{condition:"required"},{condition:"valid-email"}],"data-testid":"signup-email-input"},{component:Tb,props:{email:c.email,type:c.boxType,resendVerificationCode:i}}];return s.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:p=>h.jsx("small",{children:p})}),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:p=>h.jsx("small",{className:"notes text-small",children:p})}),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:p=>h.jsx("a",{href:"/pages/terms-and-conditions","data-gtm-event-context":"SignupForm","data-gtm-event-type":"terms-of-service-click",className:"gtm-trackable",children:p}),privacy:p=>h.jsx("a",{href:"/pages/privacy-policy","data-gtm-event-context":"SignupForm","data-gtm-event-type":"privacy-policy-click",className:"gtm-trackable",children:p})}),shownValue:"accepted",functions:{onChange:p=>{if(!p)return;const g=[];["name","email"].forEach(m=>{s.validFields[m]!==a[m].current.validity.valid&&(g.push({type:`validFields.${m}`,value:a[m].current.validity.valid}),m==="email"&&R9({ref:a.email,validateEmail:r,dispatch:o}))}),g.length&&o(g)}},validation:[{condition:"required"}],"data-testid":"signup-terms-checkbox"}),f};const UR=({className:e=""})=>h.jsxs("div",{className:ne("success-message",e),"data-testid":"success-message",children:[h.jsx("p",{className:"success-title",children:h.jsx(ue.FormattedMessage,{id:"signup_success_title"})}),h.jsx(ue.FormattedMessage,{id:"signup_success_text",values:{p:t=>h.jsx("p",{children:t})}})]});const zR={validFields:{name:!1,email:!1,jobTitle:!1,organisation:!1},emailDetails:{email:"",boxType:"",isEnd2End:!1},shouldManuallyApprove:!1,shouldDisableButton:!0,loadRecaptcha:!1,showSuccessMessage:!1,showError:!1},qR=({className:e="",labels:t={},placeholders:n={},functions:r={validateEmail:()=>Promise.resolve(),createAccount:()=>Promise.resolve(),handleError:()=>{},resendVerificationCode:()=>Promise.resolve()},shouldShow:i={},submitButton:a,dataToSubmit:s={ref:"sign-up-form"},...o})=>{const l=ue.useIntl(),u=window.location.pathname.includes("/signup")?"/login":`/login?returnTo=${window.location.pathname+window.location.search}`,{title:c=!0,expectation:d=!1,url:f=!0,logInButton:p=!0,successMessage:g=!0}=i,m={title:c,expectation:d,url:f,logInButton:p,successMessage:g},[y,v]=E.useReducer(eo,zR),{validFields:b,emailDetails:T,shouldManuallyApprove:_,shouldDisableButton:C,showSuccessMessage:A,showError:S}=y,[I,B]=Sp.useCookies(["signup-this-session","functional-cookie-consent"]),F={form:E.createRef(),name:E.createRef(),email:E.createRef(),jobTitle:E.createRef(),organisation:E.createRef(),tc:E.createRef(),hiddenValidation:E.createRef()};E.useEffect(()=>{_===!0&&F.jobTitle.current&&F.jobTitle.current.focus()},[_]),E.useEffect(()=>{I["signup-this-session"]&&v([{type:"showSuccessMessage",value:!0}])},[I]),E.useEffect(()=>{A&&I["functional-cookie-consent"]&&B("signup-this-session","true",{path:"/",maxAge:3600})},[A]);const R=E.useMemo(()=>HR({placeholders:n,labels:t,shouldShow:m,functions:r,refs:F,state:y,dispatch:v,dataToSubmit:s,intl:l}),[s,r,l,F,m,y]),N=C?!0:_?!Object.values(b).every(k=>k===!0):!b.name||!b.email||["exists","pending","verify"].includes(T.boxType);return m.successMessage&&A?h.jsx(UR,{className:e}):h.jsxs("fieldset",{className:ne("signup-form-fieldset",e),"data-testid":"signup-form",children:[m.title&&h.jsx("p",{className:"signup-title",children:h.jsx(ue.FormattedMessage,{id:"signup_title"})}),S&&h.jsx(Xr,{variant:"error",text:l.formatMessage({id:"signup_error"})}),h.jsx(Nr,{className:"signup-form",formRef:F.form,id:"sign-up-form",fields:R,intlPath:"signup",button:{variant:"primary",size:"medium",text:a||l.formatMessage({id:"signup_button_join"}),disabled:N?{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:m.logInButton},gtm:{context:"SignupForm",event:"signup-submit-click"},functions:{onSuccess:async()=>{await jR({refs:F,dataToSubmit:s,createAccount:r.createAccount,onSuccess:r.onSuccess,dispatch:v,state:y})},onCatch:k=>{r.handleError(k),v([{type:"showSuccessMessage",value:!1},{type:"showError",value:!0}])}}}),h.jsx("button",{className:"validation-button",ref:F.hiddenValidation})]})};function WR({parentId:e,isMember:t,formFunctions:n,leave:r,join:i,meta:a}){const s=ue.useIntl();return h.jsx(V0,{form:{content:{type:Ve.Reply,slugs:{}},functions:n,meta:{isEditing:!1,isAutoFocused:!1,isPrepopulated:!1,showSuccessMessage:!1,...a},placeholder:s.formatMessage({id:"discussion_responses_placeholder"})},parentId:e,membershipRequiredToPost:{isMember:t,required:!0,join:i,leave:r,notMemberStateText:s.formatMessage({id:"community_joinToPost"})}})}function VR({hasNextPage:e,fetchNextPage:t,setFocusReplyIndex:n,totalReplies:r}){const i=ue.useIntl(),a=()=>{n(r),t()};return h.jsx(jl,{hasNextPage:e,loadNextPage:a,icon:{icon:"arrow-down",position:"right"},messages:{button:i.formatMessage({id:"loadMore_button"}),error:i.formatMessage({id:"loadMore_error"})}})}function KR({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:i,user:a}){const{mutate:s}=bt.useMutation({mutationFn:e,onMutate:o=>t(l=>{const u=Dg({reply:D6(o),user:a});return qs(u,l,{replace:!1,append:(o==null?void 0:o.replyId)!==void 0})}),onError:n,onSuccess:(o,l,u)=>{const c=Dg({reply:o,user:a});r.setQueryData(i,qs(c,u,{replace:!0,append:(l==null?void 0:l.replyId)!==void 0})),setTimeout(()=>{Qp(c.id,"reply")},0)}});return s}function GR({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=bt.useMutation({mutationFn:e,onMutate:({replyId:i,content:a})=>t(s=>{const o=Bn(i,s);return o&&(o.data.content=a),s}),onError:n});return r}function YR({replies:e,user:t,replyType:n,currentLocale:r}){return!e||!(t!=null&&t.id)?[]:e.map(({id:i,own_children:a,latest_children:s,children_counts:o,data:l,created_at:u,parent:c,...d})=>{var A,S,I,B,F,R,N,k,M,$,z,P,te;const f=(((A=a==null?void 0:a.like)==null?void 0:A.length)||0)>0,p=(((S=s==null?void 0:s.like)==null?void 0:S.length)||0)>0,g=f?(I=a==null?void 0:a.like)==null?void 0:I.find(ee=>{var D;return((D=ee==null?void 0:ee.user)==null?void 0:D.id)===(t==null?void 0:t.id)}):!1,m=typeof g=="object"?(g==null?void 0:g.id)??"":"",y=p?(B=s==null?void 0:s.like)==null?void 0:B.map(ee=>{var D,x,V;return{id:(D=ee==null?void 0:ee.user)==null?void 0:D.id,name:(V=(x=ee==null?void 0:ee.user)==null?void 0:x.data)==null?void 0:V.name}}):!1,v=(k=(N=(R=(F=l==null?void 0:l.payload)==null?void 0:F.data)==null?void 0:R.translations)==null?void 0:N[r])==null?void 0:k.body,b=($=(M=l==null?void 0:l.payload)==null?void 0:M.data)==null?void 0:$.original,T=!!v,_=(b==null?void 0:b.locale)===r,C=v||(b==null?void 0:b.body);return{user:d==null?void 0:d.user,body:n===qt.Courses?vb({payload:(z=l==null?void 0:l.payload)==null?void 0:z.data,locale:l==null?void 0:l.locale}):C||"",locale:l==null?void 0:l.locale,createdAt:u,data:{...ZR(l),translationInfo:{hasTranslation:T,isOriginalPost:_,currentBody:C,currentLocale:r,originalBody:b==null?void 0:b.body,originalLocale:b==null?void 0:b.locale}},likeId:m,liked:p,likes:(o==null?void 0:o.like)||0,peopleWhoLiked:y,replyId:i,parent:c,userLiked:!!g,payloadId:(P=l==null?void 0:l.payload)==null?void 0:P.id,payloadCollection:(te=l==null?void 0:l.payload)==null?void 0:te.collection}})}function ZR(e){if(!e||!e.mentioned_users)return{};const t=e==null?void 0:e.mentioned_users,n=(e==null?void 0:e.additional_data)||{};return{mentions:t,...n}}function Dm({queryFns:{create:e,edit:t,like:n,list:r,remove:i,unlike:a},queryKey:s,type:o=qt.Communities}){const l=bt.useQueryClient(),u=y1(),c=Ka(),d={queryClient:l,queryKey:s},f={mutationHandlers:{error:Vp(d),mutate:Kp(d)},user:u,...d},p=KR({...f,mutationFn:e}),g=GR({...f,mutationFn:t}),m=QR({...f,mutationFn:n}),y=JR({...f,mutationFn:i}),v=eF({...f,mutationFn:a}),{replies:b,...T}=XR({queryKey:s,queryFn:r});return{replies:YR({replies:b,user:u,replyType:o,currentLocale:c}),mutations:{create:p,edit:g,remove:y,like:m,unlike:v},user:u,...T}}function QR({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:i}){const{mutate:a}=bt.useMutation({mutationFn:e,onMutate:({replyId:s})=>t(o=>{const l=Bn(s,o);return l&&Og({reply:l}),o}),onError:n,onSuccess:(s,{replyId:o},l)=>{const u=Bn(o,l);u&&Og({reply:u,reaction:s}),r.setQueryData(i,l)}});return a}function XR({queryFn:e,queryKey:t}){const{data:n,error:r,isLoading:i,hasNextPage:a,fetchNextPage:s}=bt.useInfiniteQuery({queryKey:t,queryFn:e,initialPageParam:{next:""},getNextPageParam:o=>(o==null?void 0:o.next)||null});return{replies:Zp(n),error:r,isLoading:i,hasNextPage:a,fetchNextPage:s}}function JR({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=bt.useMutation({mutationFn:e,onMutate:({replyId:i})=>t(a=>mb(i,a)),onError:n});return r}function eF({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:i}=bt.useMutation({mutationFn:e,onMutate:({replyId:a})=>t(s=>{const o=Bn(a,s);return o&&O6({reply:o,user:r}),s}),onError:n});return i}const tF=({activityId:e,basePath:t,isMember:n,parentId:r,replyId:i,functions:{reactions:a,form:s,likes:o},type:l=qt.Communities})=>{const u=ue.useIntl(),c=3,{replies:d,fetchNextPage:f,hasNextPage:p,isLoading:g,mutations:{create:m,edit:y,like:v,remove:b,unlike:T}}=Dm({queryKey:[t,r,e,i,"replies"],queryFns:{...a,list:A=>a.list({...A,reactionId:i})},type:l});Ip([g]);const[_,C]=E.useState(!0);return h.jsxs(h.Fragment,{children:[(d==null?void 0:d.length)>=c&&h.jsx(Fe,{className:"nested-replies-show-toggle",variant:"secondary",size:"small",styling:{muted:!0},icon:{icon:`arrow_corner-${_?"up_left":"down_right"}`,position:"left"},onClick:()=>C(!_),children:u.formatMessage({id:`discussion_thread_${_?"hide":"show"}`},{count:d==null?void 0:d.length})}),_&&h.jsx(ex,{loadMore:{isLoading:g,hasNextPage:p,loadNextPage:()=>f()},form:{parentId:r,content:{type:Ve.Reply,slugs:{question:`${t}/${r}`,answer:e,reply:i}},functions:{create:(A,{body:S})=>m({activityId:e,replyId:i,content:S}),...s},meta:{isEditing:!1,isAutoFocused:!0,isPrepopulated:!1,showSuccessMessage:!1}},children:d&&d.length>0?d==null?void 0:d.map(({replyId:A,likes:S,data:I,body:B,createdAt:F,userLiked:R,peopleWhoLiked:N,parent:k,user:M,likeId:$})=>h.jsx(eu,{isCommunity:!0,content:{id:A,type:Ve.Reply,body:B,createdAt:F,slugs:{question:`${t}/${r}`,answer:e,reply:k},slug:"",author:Ml(M),userLiked:R,likes:S,peopleWhoLiked:l===qt.Courses?!1:N,data:I},forceHide:{shareLink:l===qt.Courses},userHasPermissions:n,functions:{content:{createContent:()=>null,deleteContent:()=>b({replyId:A}),updateContent:(z,{body:P})=>y({replyId:A,content:P})},likes:{createLike:()=>v({replyId:A}),deleteLike:()=>T({replyId:A,reactionId:$}),listLikes:z=>o.list({replyId:A,...z})},comments:{},form:s},styling:{showShareLinkButton:!0},badges:{showBadges:!0,scopes:[{scope:pn.Communities,area:r||""},{scope:pn.Platform,area:"all"}]},disableMentions:l===qt.Courses,basePath:t,parentId:r},A)):null})]})};function nF({formFns:e,activityId:t,basePath:n,focus:r,isMember:i,parentId:a,reply:s,type:o=qt.Communities}){const{body:l,data:u,likeId:c,likes:d,peopleWhoLiked:f,replyId:p,createdAt:g,user:m,userLiked:y}=s,{edit:v,like:b,remove:T,unlike:_}=e.mutations;return h.jsx(Z3,{children:h.jsx(eu,{isCommunity:!0,content:{id:p,type:Ve.Reply,body:l,createdAt:g,slugs:{question:`${n}/${a}`,answer:t,reply:p},slug:p,author:Ml(m),userLiked:y,likes:d,peopleWhoLiked:o===qt.Courses?!1:f,data:u},userHasPermissions:i,functions:{content:{createContent:()=>null,deleteContent:()=>T({replyId:p}),updateContent:(C,{body:A})=>v({replyId:p,content:A})},likes:{createLike:()=>b({replyId:p}),deleteLike:()=>_({replyId:p,reactionId:c}),listLikes:C=>e.likes.list({replyId:p,...C})},comments:{},form:e.form},forceHide:{shareLink:o===qt.Courses},badges:{showBadges:!0,scopes:[{scope:pn.Communities,area:a||""},{scope:pn.Platform,area:"all"}]},translation:{isTranslatable:!0,onTranslate:async({payloadId:C,payloadCollection:A})=>({body:"Translated body"})},disableMentions:o===qt.Courses,children:h.jsx(tF,{basePath:n,parentId:a,activityId:t,replyId:p,isMember:i,functions:e,type:o}),styling:{showShareLinkButton:!0},setFocus:r,basePath:n,parentId:a},p)},p)}const Cu="ALL",i8=({activityId:e,basePath:t,parentId:n,activityTotalReplies:r,isMember:i,functions:{form:a,join:s,leave:o,likes:l,reactions:u},profile:c,showReplies:d,type:f=qt.Communities,repliesFilters:p})=>{const g=ue.useIntl(),m=Ka(),{fetchNextPage:y,hasNextPage:v,isLoading:b,replies:T,mutations:{create:_,remove:C,edit:A,like:S,unlike:I}}=Dm({queryKey:[t,n,e,"replies"],queryFns:u,type:f}),[B,F]=E.useState(f===qt.Courses&&m||Cu),[R,N]=E.useState([]),k=E.useMemo(()=>T,[JSON.stringify(T)]);E.useEffect(()=>{if(!k)return;const P=!B||B===Cu||f!==qt.Courses?k:k.filter(te=>te.locale===B);N(P)},[k,B]);const[M,$]=E.useState(null);Ip([b]),Xp();const z={create:(P,te)=>{const{body:ee}=te;_({activityId:e,content:ee})},...a};return h.jsxs("section",{className:"replies-feed",children:[h.jsx(J3,{type:"comment",responses:r,isLoading:b}),d?h.jsxs(h.Fragment,{children:[h.jsx(WR,{parentId:n,isMember:i,join:s,leave:o,formFunctions:z,meta:{isAutoFocused:f===qt.Courses||!1}}),f===qt.Courses&&(p==null?void 0:p.isEnabled)&&h.jsxs("section",{className:"replies-feed-language-switcher",style:{display:"flex"},children:[h.jsx(Nr,{id:"replies-feed-language-switcher",fields:[{id:"language",label:!1,type:"select",initialValue:B,options:[{id:Cu,label:g.formatMessage({id:"activitySection_language_switcher_all_languages_option"})},...(p==null?void 0:p.options)||[]],functions:{onChange:P=>F(P)}}],functions:{},button:{hideButton:!0}}),h.jsx(Fe,{icon:"info-inside-circle",variant:"tertiary",className:"language-switcher-info-button",tooltip:g.formatMessage({id:"activitySection_language_switcher_info"}),forceTooltip:!0,children:h.jsx(ct,{children:g.formatMessage({id:"activitySection_language_switcher_info"})})})]}),R==null?void 0:R.map((P,te)=>h.jsx(nF,{activityId:e,basePath:t,focus:M===te,formFns:{form:a,likes:l,reactions:u,mutations:{remove:C,edit:A,like:S,unlike:I}},isMember:i,parentId:n,reply:P,type:f},P.replyId)),b?h.jsx(h.Fragment,{children:" "}):h.jsx(VR,{hasNextPage:v,fetchNextPage:y,setFocusReplyIndex:$,totalReplies:T.length})]}):h.jsx(Kn,{children:h.jsx(ue.FormattedMessage,{id:"replies_feed_missing_polls_vote_message"})}),h.jsx(K0,{form:c})]})};function rF({queryFn:e,queryKey:t}){const{data:n,error:r,isLoading:i,hasNextPage:a,fetchNextPage:s,refetch:o}=bt.useInfiniteQuery({queryKey:t,queryFn:e,initialPageParam:{next:""},getNextPageParam:c=>(c==null?void 0:c.next)||null}),l=Zp(n),u=`${l.length||0}${a?"+":""}`;return{likes:l,likesCount:u,error:r,isLoading:i,hasNextPage:a,fetchNextPage:s,refetch:o}}function iF({queryFns:{list:e},queryKey:t}){const{likes:n,...r}=rF({queryKey:t,queryFn:e});return{likes:n,...r}}function a8({basePath:e,parentId:t,activityId:n,likeCount:r,functions:i}){const{likes:a,fetchNextPage:s,hasNextPage:o,refetch:l}=iF({queryKey:[e,t,n,"likes"],queryFns:i.likes});E.useEffect(()=>{l()},[l]);const u=a.map(({user:c})=>c).map(c=>c?Ml(c):void 0).filter(c=>c&&typeof c!="string");return h.jsx("section",{className:"likes-feed",children:h.jsx(V3,{members:{data:u,total:r},showHeader:!1,showPlaceholders:!0,communitySlug:t,hasNextPage:o&&u.length<r,loadNextPage:s})})}const s8=({showModal:e=!0,functions:{onClose:t,likes:n},likeCount:r,className:i,...a})=>{const s=ue.useIntl();return h.jsx(Di,{id:"likes-modal",title:s.formatMessage({id:"discussion_likes"},{number:r}),isOpen:e,functions:{onClose:t},className:ne("profile-modal in-portal",i,{open:e}),maxWidth:600,children:h.jsx(a8,{...a,likeCount:r??0,functions:{likes:n}})})},aF=Object.freeze(Object.defineProperty({__proto__:null,default:s8},Symbol.toStringTag,{value:"Module"})),sF={results:[{created_at:"2024-05-16T13:17:45.940899Z",updated_at:"2024-05-16T13:17:45.940899Z",id:"ab4b7ab0-f4fe-469f-a8e7-5a52b3e55333",user_id:"9ed21585-63be-4446-96ce-3e703820eb73",user:{id:"1234",data:{name:"Han Solo",thumbnail:"https://placehold.co/400x400",jobTitle:"Smuggler",organization:"Rebel Alliance",badges:{communities:{"endor-alumni":["blue-badge"]}}}},kind:"like",activity_id:"869e5a90-0eba-11ef-8080-80017b714aaf",data:{mentioned_users:null},parent:"",latest_children:{},children_counts:{}},{created_at:"2024-05-16T13:17:45.940899Z",updated_at:"2024-05-16T13:17:45.940899Z",id:"db4b7ab0-f4fe-469f-a8e7-5a52b3e55373",user_id:"9ed21585-63be-4446-96ce-3e703820eb73",user:{created_at:"2023-08-22T11:56:10.585365Z",updated_at:"2024-03-13T11:31:49.447916Z",id:"9ed21585-63be-4446-96ce-3e703820eb73",data:{jobTitle:"Admiral",name:"Princess Leia",organization:"Rebela Alliance",thumbnail:"https://placehold.co/400x400",badges:{platform:{all:["orange-badge"]}}}},kind:"pin",activity_id:"769e5a90-0eba-11ef-8080-80017b714aaf",data:{mentioned_users:null},parent:"",latest_children:{},children_counts:{}}],next:"xy12345"};const oF=3e3,o8=({url:e,gtm:t={context:"ShareLink",event:"copy-link-click"}})=>{const n=ue.useIntl(),r="discussion_share_copy_link",[i,a]=E.useState({isOpen:!1,isCopied:!1});return h.jsxs("li",{className:"share-link-wrapper",children:[h.jsx(Is,{className:"gtm-trackable",icon:{icon:"link_chain"},onMouseOver:()=>a({...i,isOpen:!0}),onFocus:()=>a({...i,isOpen:!0}),onMouseOut:()=>a({isOpen:!1,isCopied:!1}),onBlur:()=>a({isOpen:!1,isCopied:!1}),onClick:()=>{navigator.clipboard.writeText(e).then(()=>{a({isOpen:!0,isCopied:!0});const s=new CustomEvent("ariaLive",{detail:{message:n.formatMessage({id:`${r}_success`})}});document.dispatchEvent(s),setTimeout(()=>{a({isOpen:!1,isCopied:!1})},oF)})},"data-gtm-event-context":t.context,"data-gtm-event-type":t.event,"data-testid":"share-link",screenreaderText:n.formatMessage({id:r})}),h.jsx(ia,{className:ne({copied:i.isCopied}),isOpen:i.isOpen,styling:{hasPointer:"top",extraPadding:!1},children:n.formatMessage({id:`${r}${i.isCopied?"_success":""}`})})]})};const ga="discussion_",l8=({className:e,gtmContext:t,contentType:n,likes:r,comments:i,replies:a,edit:s,shareLink:o,moreMenu:l})=>{const u=ue.useIntl(),c=[];return l&&l.reportData&&c.push({text:u.formatMessage({id:`${ga}moreMenu_report`}),onClick:d=>{d.stopPropagation()},href:`mailto:community@apolitical.co?subject=${encodeURI(u.formatMessage({id:`${ga}report_subject`}))}&body=${encodeURI(u.formatMessage({id:`${ga}report_body`},{contentType:n||"",contentSlug:l&&l.reportData&&l.contentSlug||"",contentUrl:l&&l.reportData&&l.reportData.contentUrl||""}))}`,icon:"flag"}),h.jsxs("ul",{className:ne("actions text-medium",e),"data-testid":`${n}-actions`,children:[r?h.jsx(yb,{element:"li",likes:r.count,isShort:!1,userLiked:r.userLiked,content:{type:n,slugs:r.content.slugs,slug:r.content.slug},canLike:r.canLike,peopleWhoLiked:r.peopleWhoLiked,activityId:r.activityId,functions:r.functions,basePath:r.basePath||"",parentId:r.parentId||""}):h.jsx(h.Fragment,{}),i?h.jsx("li",{children:h.jsx(Is,{shortText:`${i.count??0}`,onClick:d=>{d.preventDefault(),d.stopPropagation(),i.functions.onClick()},icon:{icon:"speech-bubble_square"},"data-testid":"comment","data-gtm-event-context":t,"data-gtm-event-type":`answer-${n}-click`,screenreaderText:u.formatMessage({id:`${ga}comments_screenReader`},{count:i.count}),children:u.formatMessage({id:`${ga}comments${i.count===null?"_loading":""}`},{count:i.count})})}):h.jsx(h.Fragment,{}),a?h.jsx("li",{children:h.jsx(Is,{styling:{muted:!0},onClick:a.functions.onClick,icon:{icon:"speech-bubble_square"},"data-testid":"reply",disabled:!a.canReply,children:u.formatMessage({id:`${ga}reply`})})}):h.jsx(h.Fragment,{}),s?h.jsx("li",{className:"edit-button-item",children:h.jsx(Is,{styling:{muted:!0},onClick:s.onClick,icon:{icon:"pencil-paper"},"data-testid":"edit",children:u.formatMessage({id:`${ga}action_edit`})})}):h.jsx(h.Fragment,{}),o?h.jsx(o8,{url:o.url,gtm:{context:t||"",event:`copy-link-${n}-click`}}):h.jsx(h.Fragment,{}),l?h.jsx(t1,{element:"li",id:`more-${l.contentSlug}`,options:[...l.options||[],...c]}):h.jsx(h.Fragment,{})]})};const lF=({breadcrumbs:e,cutoff:t=20,className:n=""})=>{const r=ue.useIntl();return h.jsxs(h.Fragment,{children:[h.jsx(ct,{element:"p",children:r.formatMessage({id:"breadcrumbs_label"})}),h.jsx("ul",{className:ne("breadcrumbs text-small",n),children:e.map(({text:i,href:a,current:s=!1},o)=>{const l={};return s&&(l["aria-current"]="location"),h.jsxs("li",{children:[s&&h.jsx(ct,{element:"span",children:r.formatMessage({id:"breadcrumbs_currentPage"})}),h.jsx(sa,{href:s?void 0:a,...l,children:yl(i,t)})]},`${Si(i)}_${o}`)})})]})};const Om=({variant:e="default",data:{image:t,url:n,title:r,description:i},onClick:a,gtm:s,...o})=>{if(!n)return h.jsx(h.Fragment,{});let l=n.split("//");l.length>1?l=l[1]:l=l[0],l=l.split("/"),l=l[0];const{context:u="EnrichedLink",event:c="enriched-link-click"}=s??{};return h.jsxs("aside",{className:ne("enriched-url gtm-trackable",{"has-image":t,[e]:e!=="default"}),onClick:d=>{if(d.preventDefault(),d.stopPropagation(),a){a(d);return}window.open(n,"_blank")},"data-gtm-event-context":u,"data-gtm-event-type":c,children:[h.jsx("small",{children:l}),h.jsx("p",{className:"title text-medium",children:h.jsx("a",{...o,href:n,target:"_blank",rel:"noreferrer",children:r})}),i&&e!=="condensed"?h.jsx("p",{className:"text-small",children:i}):h.jsx(h.Fragment,{}),t&&t.src?h.jsx("p",{className:"img",children:h.jsx("img",{src:t.src,alt:t.alt||"",loading:"lazy",fetchpriority:"low",width:t.width||"auto",height:t.height||"100%"})}):h.jsx(h.Fragment,{})]})};const u8=({options:e,defaultOptions:t=[],allOption:n=!1,allowMultiple:r=!0,onChange:i=()=>{},preventNoOptionSelected:a=!1,className:s="",styling:o,gtm:l})=>{const u=ue.useIntl(),{muted:c,large:d}=o||{},f=n?[{id:"all",text:typeof n!="boolean"&&n.text||u.formatMessage({id:"filters_all"})},...e]:e,[p,g]=E.useState(n?["all"]:t.length?t.map(b=>b.id):[]),[m,y]=E.useState(0),v=(b,T)=>{let _=[];p.includes(b)&&!a?_=p.filter(C=>C!==b):b==="all"?_=["all"]:r?_=[...p.filter(C=>C!=="all"),b]:_=[b],g(C=>(i&&typeof i=="function"&&i({current:_,previous:C}),_)),T&&typeof T=="function"&&T()};return h.jsx("ul",{className:ne("filters",s),children:f.map(({id:b,text:T,disabled:_=!1,callback:C=()=>{},content:A},S)=>{let I={tabIndex:m===S?0:-1};return _&&(I={disabled:!0,"aria-label":u.formatMessage({id:"filters_disabled"},{name:T})}),h.jsx("li",{children:h.jsx("button",{"data-gtm-event-context":(l==null?void 0:l.context)||"filters","data-gtm-event-type":(l==null?void 0:l.type)||`${T.toLowerCase().replace(" ","-")}-click`,className:ne(b,{selected:p.includes(b),large:d,muted:c}),onClick:B=>{B.preventDefault(),B.stopPropagation(),v(b,C)},onKeyDown:B=>{var k,M;let F=S+1,R,N;switch(B.code){case"Enter":case"Space":B.preventDefault(),B.stopPropagation(),v(b,C);break;case"ArrowLeft":case"ArrowRight":B.preventDefault(),B.stopPropagation(),B.code==="ArrowLeft"?(F=S-1,F<0&&(F=f.length-1)):F>=f.length&&(F=0),y(F),R=B.currentTarget.closest("li"),N=(k=R==null?void 0:R.parentElement)==null?void 0:k.children[F],(M=N==null?void 0:N.querySelector("button"))==null||M.focus();break}},"aria-selected":p.includes(b),...I,children:A||T})},b)})})},uF=(e,t,n)=>{const r=String(e);if(!n||!n.length)return t?`/${r}/${t}`:`/${r}`;let i="",a=!1;return n.forEach(({url:s,position:o})=>{o==="before-lang"?(i+=`/${s}`,a=!0):(i.includes(`/${r}/`)||(i+=`/${r}`),i+=`/${s}`)}),i.includes(`/${r}/`)||(i+=`/${r}`),t&&(i+=`/${t}`),a?{url:i,urlForRouter:`/${i.split("/").slice(2).join("/")}`}:i};const xu="languageSwitcher_",cF=({currentLanguage:e,isOriginalLanguage:t=!1,isHumanTranslation:n=!1,translations:r,onChange:i,urlParts:a,variant:s="default",label:o,className:l=""})=>{const u=ue.useIntl(),{updateLanguage:c=()=>{}}=E.useContext(Fp),[d,f]=E.useState(e);if(E.useEffect(()=>{e!==d&&f(e)},[e]),!r||!Object.values(r).some(y=>y&&y.post_name))return null;const g=Object.keys(r),m=d!==e;return h.jsxs("div",{className:ne("language-switcher text-small",s,l),children:[h.jsxs("nav",{children:[s!=="short"&&h.jsx("p",{children:o||u.formatMessage({id:`${xu}label`})}),h.jsx("ul",{children:g.map(y=>{var _;if(!La.ALL_LOCALES.includes(y))return null;const v=(_=r[y])==null?void 0:_.post_name,b=La.ALL_LOCALES_WITH_LABELS.filter(C=>C.value===y)[0].title;let T={className:y};if(d===y)T["aria-label"]=u.formatMessage({id:`${xu}selected`},{language:b});else{const C=uF(y,v,a);T={...T,href:typeof C=="string"?C:C.url,onClick:A=>{f(y),c(y),typeof i<"u"&&(A.preventDefault(),A.stopPropagation(),i(y,typeof C=="string"?C:C.urlForRouter))}}}return h.jsx("li",{children:h.jsx(sa,{...T,fallbackElement:"span",children:b})},y)})}),s!=="short"&&!m&&h.jsx("p",{children:u.formatMessage({id:`${xu}translation_${t?"original":n?"human":"machine"}`})})]}),s!=="short"&&!m&&!t&&!n&&h.jsx("small",{children:u.formatMessage({id:`${xu}disclaimer`},{email:Cs.support,link:y=>{const v=`mailto:${y}`;return h.jsx("a",{href:v,children:y})}})})]})};const Qd=ue.createIntl({locale:"en",messages:dn}),jl=({hasNextPage:e=!0,loadNextPage:t=()=>{},isLoading:n=!1,variant:r="secondary",size:i="medium",styling:a={muted:!1,fullWidth:!1},icon:s=!1,messages:o={button:Qd.formatMessage({id:"loadMore_button"}),endOfFeed:Qd.formatMessage({id:"loadMore_endOfFeed"}),error:Qd.formatMessage({id:"loadMore_error"})},className:l="",gtmContext:u="LoadMore"})=>{const[c,d]=E.useState(""),f=async p=>{if(!n)try{await t(p)}catch(g){g instanceof Error?d(g.message):d("Unknown error")}};return!c&&!e&&!o.endOfFeed?null:h.jsx("footer",{className:ne("load-more",l),children:!c&&e?h.jsx(Fe,{variant:r,size:i,styling:a,icon:s,onClick:f,"data-gtm-event-context":u,"data-gtm-event-type":"load-more-click",disabled:n,className:"gtm-trackable","data-testid":"load-more-button",children:o.button}):o.endOfFeed&&(!c||c!=null&&c.includes("Cannot read items"))?h.jsx("p",{children:o.endOfFeed}):c&&h.jsx("p",{className:"error",children:o.error})})};const Nm=({variant:e="default",version:t="default",className:n="",...r})=>{const i=g1();return h.jsx("p",{className:"logo-wrapper",children:h.jsx("a",{href:i||"/home/",className:ne("logo",e,t,n),...r,children:h.jsx(ct,{children:h.jsx(ue.FormattedMessage,{id:"apolitical"})})})})};let wu=!1;const t1=({element:e="div",id:t="more-menu",options:n,className:r=""})=>{const i=ue.useIntl(),a=E.useRef(null),[s,o]=E.useState(!1),l=u=>{a.current&&u.target instanceof HTMLElement&&!a.current.contains(u.target)&&o(!1)};return E.useEffect(()=>(document.addEventListener("click",l,!0),()=>{document.removeEventListener("click",l,!0)})),E.createElement(e,{ref:a,className:ne("more-menu text-medium",r),children:h.jsxs(h.Fragment,{children:[h.jsx(Fe,{variant:"tertiary",size:"medium","data-testid":"more-menu",icon:{icon:"ellipsis"},onClick:()=>o(!s),"aria-haspopup":"true","aria-expanded":s,"aria-controls":t,screenreaderText:i.formatMessage({id:"moreMenu"}),className:"more-menu-button"}),h.jsx("ul",{id:t,hidden:!s,children:n.map(({href:u,onClick:c,text:d,icon:f,...p},g)=>{const m={...p,onClick:y=>{o(!1),typeof c=="function"&&c(y)},onFocus:()=>{wu&&(clearTimeout(wu),wu=!1)},onBlur:()=>{wu=setTimeout(()=>{o(!1)},100)}};return u&&(m.href=u),h.jsx("li",{className:"more-menu-list-item",children:h.jsx(Fe,{variant:"tertiary",size:"medium",icon:f?{icon:f,position:"left"}:!1,...m,children:d})},`${Si(d)}_${g}`)})})]})})},dF=(e,t=!1)=>t?e.replaceAll("/","")===t:typeof window<"u"&&window.location&&window.location.pathname===e;const fF=E.lazy(()=>Promise.resolve().then(()=>_7)),F9=[{key:"homepage",href:"/home/"},{key:"events",href:"/events/"},{key:"microcourses",href:"/microcourses/"},{key:"articles",href:"/solution-articles/"},{key:"communities",href:"/communities/"}],c8=({activeLink:e,profile:t})=>{const n=ue.useIntl(),r=E.useContext(jt),i=r&&typeof r.id=="string",a=g1();return a&&(F9[0].href=a),h.jsxs("ul",{id:"navigation-menu",className:"text-medium",children:[F9.map(({key:s,href:o})=>{const l=dF(o,e),u={};return l&&(u["aria-current"]="page"),h.jsx("li",{className:ne(s,{active:l}),children:h.jsx("a",{href:o,"data-gtm-event-type":`${s}-click`,"data-gtm-event-context":"NavigationMenu",className:"gtm-trackable",...u,children:n.formatMessage({id:`navigationMenu_links_${s}`})})},s)}),i&&t&&h.jsx(fF,{element:"li",member:r,styling:{variant:"card",isCondensed:!1},functions:{profile:t},className:"profile gtm-trackable","data-testid":"profile-link",alt:"",gtmContext:"NavigationMenu",gtmType:"profile-click"})]})},xo=(e,t,n)=>`${e}?share=${t}${n?`&uuid=${n}`:""}`,hF=({title:e,link:t,referrer:n})=>[{key:"linkedin",icon:"social_linkedin",url:`https://www.linkedin.com/shareArticle?mini=true&url=${encodeURIComponent(`${xo(t,"linkedin",n)}&src=linkedin`)}&title=${encodeURIComponent(e)}&source=Apolitical`},{key:"twitter",icon:"social_twitter",url:`https://twitter.com/share?ref_src=twsrc%5Etfw&url=${encodeURIComponent(`${xo(t,"twitter",n)}&src=twitter`)}&text=${encodeURIComponent(e)}&via=${encodeURIComponent("apoliticalco")}`},{key:"facebook",icon:"social_facebook",url:`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(`${xo(t,"facebook",n)}`)}&t=${e}`},{key:"email",icon:"share_email",url:`mailto:?subject=${encodeURIComponent(e)}&body=${encodeURIComponent(`${e}
162
+ `}),U=Q.turndown(U)}o&&o.mentions&&(U=await A4({text:U,template:`[${qh}{{name}}]({{id}})`,mentions:o.mentions,listMembers:p||(()=>Promise.resolve([]))})),AP(U,Q=>{const ie=[{type:"initialValue",value:Q},{type:"editorKey",value:B.toString()}];o!=null&&o.link&&(ie.push({type:"enrichedUrl",value:o.link}),o.link.url&&te(o.link.url)),S(ie),setTimeout(()=>{S([{type:"stringValue",value:x9(V)}])},150)})})()},[B]),E.useEffect(()=>{if(z===void 0&&V){const U=DP(V);U&&te(U)}const j=U=>{var J;const Q=U,ie=((J=Q==null?void 0:Q.detail)==null?void 0:J.url)||null;ie&&z&&z.url===ie&&S([{type:"enrichedUrl",value:void 0}])};return window.addEventListener("linkRemoved",j),()=>{window.removeEventListener("linkRemoved",j)}},[z]),E.useEffect(()=>{if(t){$a.lastIndex=0;const j=t.match($a);j&&j.length===1&&j[0].length===t.length&&!M&&S([{type:"originalValue",value:t}])}t!==""||!V||Mc(B,t)&&!M||(O.withoutNormalizing(V,()=>{le.delete(V,{at:{anchor:O.start(V,[]),focus:O.end(V,[])}}),le.deselect(V),V.children.length!==0&&le.unwrapNodes(V,{at:[0]}),le.insertNodes(V,_,{at:[0]})}),S([{type:"initialValue",value:_},{type:"lastAnchor",value:null},{type:"enrichedUrl",value:!1}]))},[t]),E.useEffect(()=>{y({link:z})},[z]),E.useEffect(()=>{R===""&&z&&S([{type:"enrichedUrl",value:void 0}])},[R]);const H=El(()=>{NP({editor:V,isShowing:P.show,numberOfUsers:P.numberOfUsers,listMembers:p,dispatch:S})},100);return F?h.jsx("div",{id:ee,className:"rich-text-editor input text-medium",children:h.jsxs(Oi.Provider,{value:{...A,id:ee,isInOverlay:f,dispatch:S,onMention:b,reportError:T},children:[h.jsxs(YO,{editor:V,initialValue:F,onChange:j=>{if(V.operations.some(Q=>Q.type!=="set_selection")){let Q=PP(j);Q==="<br>"&&(Q=""),m(Q,z),S([{type:"stringValue",value:x9(V)}]),M||S([{type:"hasInteracted",value:!0}]),H(),d&&console.log({serialized:Q,json:j})}},...u,children:[h.jsx(jO,{className:"editor",renderElement:D,renderLeaf:x,placeholder:n||c.formatMessage({id:"richTextEditor_placeholder"}),autoFocus:s,tabIndex:0,onPaste:async j=>{const U=z!==!1,Q=j.clipboardData.getData("text");if((J=>{try{return new URL(J),!0}catch{return!1}})(Q)){let J=Q;if(Q){const{full:W}=Np(Q);J=W}if(Q&&v&&!U){const W=await v(J);W.url&&S([{type:"enrichedUrl",value:W}])}}},onKeyDown:j=>{if(j.key==="Enter"){P.show&&(j.preventDefault(),j.stopPropagation(),MT(V,P,S,ee));const{selection:U}=V;if(U){const Q=se.isCollapsed(U),[ie,J]=O.node(V,U,{depth:1});let W=ie,ae=W.type;const oe=W.children[0];if(ae===re.h3){j.preventDefault(),j.stopPropagation();const be=O.start(V,J),we=O.end(V,J),He=Ze.equals(U.anchor,be),Be=Ze.equals(U.anchor,we);if(He)le.insertNodes(V,_,{at:J});else if(Be)le.insertNodes(V,_,{at:G.next(J)}),le.select(V,O.end(V,G.next(J)));else{const $e=U.anchor,[,Ye]=O.parent(V,U);le.splitNodes(V,{at:$e}),le.setNodes(V,{type:re.paragraph},{at:G.next(Ye)})}return}if(oe&&[re.ol,re.ul].includes(oe.type)&&(W=oe,ae=oe.type),W&&Ae.isElement(W)&&ae!==re.paragraph){if(ae===re.blockquote&&!j.shiftKey){j.stopPropagation(),j.preventDefault(),le.insertNodes(V,_);return}if(Q){const[be,we]=O.parent(V,U,{edge:"end"}),Be=be.type;if([re.ul,re.ol].includes(ae))if(j.stopPropagation(),j.preventDefault(),Be===re.li&&k==="Enter"){be.children.length===1&&"text"in be.children[0]&&be.children[0].text===""&&le.removeNodes(V,{at:we}),le.insertNodes(V,_,{at:G.next(J)}),le.select(V,O.end(V,G.next(J)));return}else{const[$e,Ye]=SP(V,re.li),qe={type:re.li,children:[{text:""}]};le.insertNodes(V,qe,{at:G.next(Ye)}),le.select(V,O.end(V,G.next(Ye)))}}}}}else if(j.key==="Escape"){if(P.show){j.preventDefault(),j.stopPropagation(),S([{type:"mentionPopover",value:{...P,show:!1}}]);return}}else if(["ArrowUp","ArrowDown"].includes(j.key)&&P.show){j.preventDefault(),j.stopPropagation();const{selectedUser:U,possibleUsers:Q}=P;let ie=j.key==="ArrowUp"?U-1:U+1;ie<0&&(ie=Q.length-1),ie>=Q.length+1&&(ie=0),S([{type:"mentionPopover",value:{...P,selectedUser:ie}}])}S([{type:"lastKey",value:j.key}]),OP(j,V,S,T)},onBlur:()=>{V.selection&&S([{type:"lastAnchor",value:V.selection.anchor}])},onFocus:()=>{if(N){if(!G.isPath(N.path)||!ve.has(V,N.path))return;const j=ve.get(V,N.path);let U=0;if(ke.isText(j)?U=j.text.length:j.children&&(U=j.children.length),N.offset>U)return;try{le.select(V,{anchor:N,focus:N})}catch(Q){const ie=Q.message;T(`Error focusing editor: ${ie}`)}}}}),z?h.jsx(Om,{data:z,variant:"condensed",onClick:()=>{S([{type:"enrichedUrl",value:!1}]);const j=new CustomEvent("ariaLive",{detail:{message:c.formatMessage({id:"richTextEditor_link_enrichedUrl_aria_live"})}});document.dispatchEvent(j)},"aria-label":c.formatMessage({id:"richTextEditor_link_enrichedUrl_aria"},{title:z.title||c.formatMessage({id:"richTextEditor_link_enrichedUrl_aria_fallback"})})}):h.jsx(h.Fragment,{}),h.jsx(qP,{styling:l==null?void 0:l.toolbar}),p?h.jsx(RP,{onFallbackClick:g}):h.jsx(h.Fragment,{})]},I),h.jsx(em,{id:`character-limit-${e}`,limit:r,valueLength:T1(R)})]})}):h.jsx(h.Fragment,{})};const OR=({id:e="form-toggle",label:t,options:n,initialValue:r,functions:{onChange:i=()=>{}},isDisabled:a=!1,className:s=""})=>{const[o,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 h.jsxs("div",{className:ne("toggle",s),onClick:c=>{c.preventDefault(),c.stopPropagation(),u(o===n[0].value?n[1].value:n[0].value)},children:[h.jsx("p",{children:t}),h.jsx("ul",{className:ne("toggle-options",{disabled:a,on:o===n[1].value}),children:n.map(c=>{const d=`${e}-${c.value}`;return h.jsxs("li",{className:"hidden",children:[h.jsx("input",{type:"radio",id:d,name:e,value:c.value,checked:o===c.value,onChange:()=>u(c.value),disabled:a}),h.jsx("label",{htmlFor:d,children:c.label})]},d)})})]})};function XT({className:e="",userId:t,userName:n,src:r,uploadImage:i,button:a,callback:s}){const o=ue.useIntl(),l="profileImageChange_",[u,c]=E.useState(r),[d,f]=E.useState(!1),[p,g]=E.useState(!1),m=E.useRef(null),y=async _=>{f(!0),g(!1);try{const C=_.target.files&&_.target.files[0];if(!C||!t)throw f(!1),new Error("Image file or userID is missing");const A=await i({fileObject:C,userId:t}),S={thumbnail:A.thumbnailURL,full:A.originalURL};c(S),s(S)}catch{g(!0)}finally{f(!1)}f(!1)},{upload:v=o.formatMessage({id:`${l}cta_upload`}),change:b=o.formatMessage({id:`${l}cta_change`}),uploading:T=o.formatMessage({id:`${l}cta_uploading`})}=(a==null?void 0:a.text)||{};return h.jsxs("div",{className:ne("profile-image-change-figure",e),children:[h.jsx(ki,{className:"profile-image-change-picture",name:n,src:u==null?void 0:u.thumbnail,showInitials:!1,alt:"","data-testid":"profile-picture"}),p&&h.jsx("p",{className:"error text-small",children:o.formatMessage({id:`${l}error`})}),h.jsx("input",{id:"file",type:"file",accept:"image/*",ref:m,onChange:y,hidden:!0,"data-testid":"file-input"}),h.jsx(Fe,{onClick:()=>m.current&&m.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?T:u?b:v})]})}const JT=({gtm:e,functions:{onSuccess:t=async()=>{},onFailure:n=()=>{}}})=>{const{context:r="FooterContactUsForm",event:i="contact-form-submit-click"}=e||{};return h.jsx(Nr,{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 NR=({emails:e,setEmails:t,setIsDisabled:n})=>{const{formatMessage:r}=ue.useIntl();return h.jsx(ux.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,s)=>h.jsxs("div",{className:"email text-medium",children:[h.jsx("div",{"data-tag-item":!0,children:i}),h.jsx(Fe,{variant:"tertiary",size:"small",icon:{icon:"close"},onClick:()=>{s(a),n(!e.length)},className:"remove-email-button",screenreaderText:r({id:"overlay_close"})})]},a)})},e8=({title:e,label:t,messagePlaceholder:n,ctaMessage:r,titleColor:i,labelColor:a,backgroundColor:s,onClose:o,reportError:l,sendInvites:u,initialFormStatus:c="NOT_SUBMITTED",gtm:d={context:"Form",event:"form-submit-click"},secondaryActionButton:f,meta:p})=>{const[g,m]=E.useState([]),[y,v]=E.useState(!0),[b,T]=E.useState(c),{formatMessage:_}=ue.useIntl(),C=async I=>{try{await u(g,I.message),m([]),T("SUCCESS")}catch(B){T("ERROR"),l(B)}},A=I=>{I.preventDefault(),T("NOT_SUBMITTED"),v(!0),m([])},S=I=>{I.preventDefault(),o(),T("CLOSED")};return b==="CLOSED"?null:b==="ERROR"||b==="SUCCESS"&&!(p!=null&&p.shouldHideDoneButtonOnSubmit)?h.jsxs("div",{className:"invite-form-wrapper",children:[h.jsx("div",{className:"content centred",children:b==="SUCCESS"?h.jsx("h2",{className:"success-title",children:_({id:"inviteForm_success"})}):h.jsxs("h2",{className:"error-title",children:[" ",_({id:"inviteForm_error"})]})}),h.jsx(Dr,{}),h.jsx("div",{className:"footer",children:b==="SUCCESS"?h.jsxs(h.Fragment,{children:[h.jsx(Fe,{variant:"secondary",onClick:A,children:_({id:"inviteForm_ctaSendMoreInvites"})}),h.jsx(Fe,{onClick:S,children:_({id:"inviteForm_ctaDone"})})]}):h.jsx(Fe,{onClick:A,children:_({id:"inviteForm_ctaTryAgain"})})})]}):h.jsxs("div",{className:"invite-form-wrapper",style:{backgroundColor:s},children:[h.jsxs("div",{className:"content",children:[h.jsx("h2",{className:"title",style:{color:i},children:e}),h.jsx("label",{htmlFor:"email-input",className:"label",style:{color:a},children:t})]}),h.jsx(Nr,{id:"invite-form",fields:[{component:NR,props:{emails:g,setEmails:m,setIsDisabled:v},required:!0},{id:"message",type:"textarea",label:_({id:"inviteForm_message_label"}),placeholder:n||_({id:"inviteForm_message_placeholder"})}],functions:{onSuccess:C},button:{text:r,size:"medium",disabled:y},gtm:d,meta:p,secondaryActionButton:f})]})},_c=e=>e.map(t=>({condition:t}));const Jn={FORM_ID:"manage-account-password-change",NEW_PASSWORD:"newPassword",CONFIRMED_PASSWORD:"confirmedPassword",CURRENT_PASSWORD:"oldPassword"},IR=({functions:e,...t})=>{const{formatMessage:n}=ue.useIntl(),[r,i]=E.useState(null),[a,s]=E.useState(!1),[o,l]=E.useState({isMoreThanEightCharacters:!1,includesNumberAndSymbol:!1,includesLowerAndUppercase:!1}),u=p=>p[Jn.NEW_PASSWORD]!==p[Jn.CONFIRMED_PASSWORD]?n({id:"passwordRules_unmatched_text"}):null,c=p=>!_h(p[Jn.NEW_PASSWORD]).isValid,d=[{"data-testid":Jn.NEW_PASSWORD,id:Jn.NEW_PASSWORD,type:"password",autoComplete:"new-password",placeholder:"",label:n({id:"passwordRules_newPassword_label"}),validation:_c(["required",c]),functions:{onChange:p=>l(_h(p).matchingRules),onFocus:()=>s(!0),onBlur:()=>s(!1)}},{"data-testid":Jn.CONFIRMED_PASSWORD,id:Jn.CONFIRMED_PASSWORD,type:"password",autoComplete:"new-password",placeholder:"",label:n({id:"passwordRules_confirmPassword_label"}),validation:_c(["required",u])}];t.isPasswordChange&&d.unshift({"data-testid":Jn.CURRENT_PASSWORD,id:Jn.CURRENT_PASSWORD,type:"password",autoComplete:"current-password",placeholder:"",label:n({id:"passwordRules_currentPassword_label"}),validation:_c(["required"])}),a&&d.push({component:Sb,props:{matchingRules:o}});const f={id:Jn.FORM_ID,fields:d,functions:{...e,onSuccess:async p=>(e.createPassword(p),e.onSuccess&&e.onSuccess(p)),onCatch:p=>i(p==null?void 0:p.statusCode),onFailure:(p,g)=>{(g.includes(Jn.NEW_PASSWORD)||g.includes(Jn.CONFIRMED_PASSWORD))&&s(!0)}},meta:{shouldReset:!0},...t};return h.jsxs(h.Fragment,{children:[h.jsx(Nr,{...f}),r&&h.jsx(Xr,{variant:"error",text:r})]})};const t8=({isCreateProfile:e=!1,hooks:t,functions:n,meta:r={},gtm:i,...a})=>{var I;const s=ue.useIntl(),o="profileForm_",l=E.useContext(jt),[u,c]=E.useState(l.image),[d,f]=E.useState(!1),{uploadImage:p=()=>{},onSuccess:g=async B=>{},onCancel:m=()=>{},onFailure:y=()=>{}}=n,{buildLocation:v,isValidPlace:b,predictPlaces:T}=t.useMaps(),{context:_="ProfileForm",event:C="profile-form-submit-click"}=i||{},A=[{id:"jobTitle",type:"text",label:s.formatMessage({id:`${o}jobTitle`}),placeholder:s.formatMessage({id:`${o}jobTitle_placeholder`}),value:l.jobTitle,validation:[{condition:"required"}]},{id:"organization",type:"text",label:s.formatMessage({id:`${o}organization`}),placeholder:s.formatMessage({id:`${o}organization_placeholder`}),value:l.organization,validation:[{condition:"required"}]},{id:"location",type:"autocomplete",label:s.formatMessage({id:`${o}location`}),placeholder:s.formatMessage({id:`${o}location_placeholder`}),value:(I=l.location)==null?void 0:I.en,validation:[{condition:"required"},{condition:({location:B})=>B&&!d?!1:!b(B),error:s.formatMessage({id:`${o}location_error`})}],functions:{onChange:()=>{d||f(!0)},onKeyInput:T}}],S=[{component:XT,props:{userName:l.name,userId:l.id,src:u,uploadImage:p,callback:c,button:{text:{upload:s.formatMessage({id:`${o}image`})}}}},{id:"name",type:"text",label:s.formatMessage({id:`${o}name`}),placeholder:s.formatMessage({id:`${o}name_placeholder`}),value:l.name,autoComplete:"name",validation:[{condition:"required"}]},...A,{id:"biography",type:"textarea",label:s.formatMessage({id:`${o}bio`}),placeholder:s.formatMessage({id:`${o}bio_placeholder`}),limit:1e3,value:l.biography},{component:Dr}];return h.jsx(Nr,{id:"profile-details-form",fields:e?A:S,meta:{shouldShowCancelButton:!e,shouldReset:!1,shouldHide:!1,showRequiredLabels:e,...r},intlPath:o,gtm:{context:_,event:C},functions:{onSuccess:async B=>{try{const F={...B,image:u||null,location:d?await v(B==null?void 0:B.location):l.location,...e?{onboardingState:"completed"}:{}};l.updateDetails&&l.updateDetails(R=>({...R,...F})),await g(F)}catch{y()}},onCancel:m,onFailure:y},button:{size:"large",text:{default:s.formatMessage({id:`${o}cta`}),submitting:s.formatMessage({id:`${o}cta_submitting`}),submitted:s.formatMessage({id:`${o}cta_submitted`})}},...a})},PR=()=>{const e=ue.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)}},[]),h.jsx(G4,{progress:t,steps:{0:{icon:"layers",text:e.formatMessage({id:"publishArticleForm_progressBar"})}}})};function RR({coverImage:e,setShowImagePicker:t}){return e&&e.url?h.jsx(Xr,{className:"cover-image-preview",text:h.jsx(aa,{className:"cover-image",image:{description:e.description||"",height:e.height,width:e.width,url:e.url,color:e.color,type:"image/jpeg"}}),button:{component:h.jsx(Fe,{variant:"tertiary",onClick:()=>t(!0),children:h.jsx(ue.FormattedMessage,{id:"publishArticleForm_replaceImage_button"})})}}):h.jsx(Xr,{button:{component:h.jsx(Fe,{variant:"secondary",onClick:()=>t(!0),children:h.jsx(ue.FormattedMessage,{id:"publishArticleForm_selectImage_button"})})}})}var n8=(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))(n8||{});let Zd=null;const zt="publishArticleForm_",N9={},I9=10,FR=({id:e="publish-article-form",values:t=N9,setShowImagePicker:n,functions:r,meta:i,gtm:a,isEditMode:s=!1})=>{var R;const o=ue.useIntl(),l=E.useContext(jt),{create:u,edit:c,onSuccess:d=()=>{},onFailure:f=()=>{}}=r||{},{isInOverlay:p=!1}=i||{},[g,m]=E.useState(!1),[y,v]=E.useState(t.body||""),[b,T]=E.useState(!1),[_,C]=E.useState("");E.useEffect(()=>{Mc(t,N9)||Tl(t.body)&&t.body!==y&&t.body!==void 0&&v(t.body)},[t.body]);const A=()=>{!l||!l.id?T(o.formatMessage({id:`${zt}error_loggedOut`})):b&&T(!1)},S=N=>({condition:k=>{const M=k[N];return!M||typeof M!="string"?!0:M.length<I9},error:o.formatMessage({id:`${zt}error_underMinLength`},{length:I9})}),I=!!y&&Tl(y),B=()=>h.jsxs(h.Fragment,{children:[h.jsx(Dr,{}),h.jsx("p",{className:"text-medium",children:o.formatMessage({id:`${zt}disclaimer`})})]}),F=[{id:"title",type:"textarea",value:t.title||"",limit:65,label:o.formatMessage({id:`${zt}title_label`}),placeholder:o.formatMessage({id:`${zt}title_placeholder`}),styling:{autosizeToFit:!0},functions:{onChange:A},validation:[{condition:"required"},S("title")]},{id:"subtitle",type:"textarea",value:t.subtitle,limit:115,label:o.formatMessage({id:`${zt}subtitle_label`}),styling:{autosizeToFit:!0},placeholder:o.formatMessage({id:`${zt}subtitle_placeholder`}),functions:{onChange:A},validation:[{condition:"required"},S("subtitle")]},{component:Jc,props:{formID:e,label:{visible:o.formatMessage({id:`${zt}body_label`})},showLabel:!0}},{component:km,props:{id:`${e}-input`,value:y,placeholder:o.formatMessage({id:`${zt}body_placeholder`}),meta:{isInOverlay:p},autoFocus:!1,functions:{onChange:N=>{v(N),A()}},styling:{toolbar:{showHeadingOption:!0}},"aria-invalid":!!b,"aria-errormessage":"error-message"}},{id:"tags",label:o.formatMessage({id:`${zt}tags_label`}),type:"checkboxes",styling:{displayOptionsAsPills:!0},options:Object.values(n8).map(N=>({id:N,label:o.formatMessage({id:`${zt}_tags_${N}`})})),value:t.tags||[],multipleOptions:{limit:3},validation:[{condition:"required",error:o.formatMessage({id:`${zt}tags_error_required`})},{condition:N=>{var k;return((k=N==null?void 0:N.tags)==null?void 0:k.length)>3},error:o.formatMessage({id:`${zt}tags_error_over_three`})}]},{component:Jc,props:{formID:e,label:{visible:o.formatMessage({id:`${zt}cover_image_label`})},showLabel:!0}},{component:RR,props:{coverImage:t.coverImage||{},setShowImagePicker:n}}];return g?F.push({component:Dr}):F.push({component:B}),h.jsxs("section",{className:"publish-article-form",children:[h.jsx(Nr,{id:e,meta:{shouldReset:!1,shouldHide:!1,showRequiredLabels:!1,shouldScrollOnSuccess:!1},functions:{onSuccess:async N=>{if(!l||!l.id||!I)return;Zd&&clearTimeout(Zd),m(!0);const k={...N,body:y,coverImage:t.coverImage};try{s&&c?await c(k):u&&await u(k),Zd=setTimeout(()=>{C(o.formatMessage({id:`${zt}aria_success${s?"_edit":""}`})),d(k)},500)}catch{T(o.formatMessage({id:`${zt}error`})),C(""),f()}},onFailure:f},fields:F,intlPath:zt,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:!l||!l.id||!I||!((R=t==null?void 0:t.coverImage)!=null&&R.url),text:{default:o.formatMessage({id:`${zt}cta_submit${s?"_edit":""}`}),submitting:o.formatMessage({id:`${zt}cta_submitting${s?"_edit":""}`}),submitted:o.formatMessage({id:`${zt}cta_submitted${s?"_edit":""}`})},customOnSubmit:b?h.jsx(h.Fragment,{}):h.jsx(PR,{})},gtm:a}),b&&h.jsx(Us,{id:"error-message",className:"error",children:typeof b=="string"&&b.includes(" ")?b:o.formatMessage({id:`${zt}error`})}),_&&h.jsx(ct,{"aria-live":"polite",showOnFocus:!1,children:_})]})};var ir,BR=ir={_regexEscape:/([\.\*\+\^\$\[\]\\\(\)\|\{\}\,\-\:\?])/g,_regexParseLocale:/^([a-zA-Z]*)([_\-a-zA-Z]*)$/,_escapeRegExpPattern:function(e){return typeof e!="string"?e:e.replace(ir._regexEscape,"\\$1")},_toLowerCase:function(e,t){return typeof e!="string"?t&&e:e.toLowerCase()},_toUpperCase:function(e,t){return typeof e!="string"?t&&e:e.toUpperCase()},_trim:function(e,t,n){var r=[],i,a=function(l){r.push("^"+l+"+|"+l+"+$")};if(typeof t=="boolean"&&(n=t,t=null),typeof e!="string")return n&&e;if(Array.isArray(t)&&t.map(function(l){var u=ir._escapeRegExpPattern(l);a(u)}),typeof t=="string"){var s=ir._escapeRegExpPattern(t);a(s)}t||a("\\s");var o="("+r.join("|")+")";for(i=new RegExp(o,"g");e.match(i);)e=e.replace(i,"");return e},_parseLocale:function(e){var t=ir._regexParseLocale.exec(e),n,r,i;if(!(!e||!t))return t[2]=ir._trim(t[2],["-","_"]),r=ir._toLowerCase(t[1]),i=ir._toUpperCase(t[2])||i,n={lang:r,countryCode:i},n},isRtlLang:function(e){var t=ir._parseLocale(e);if(t)return ir._BIDI_RTL_LANGS.indexOf(t.lang)>=0},getLangDir:function(e){return ir.isRtlLang(e)?"rtl":"ltr"}};Object.defineProperty(ir,"_BIDI_RTL_LANGS",{value:["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","prs","ps","sd","ug","ur","yi"],writable:!1,enumerable:!0,configurable:!1});var MR=BR,P9=MR,LR={isRtlLang:P9.isRtlLang,getLangDir:P9.getLangDir};const r8=({id:e="search",className:t="",handleToggle:n=!1,defaultValue:r="",gtmContext:i="search-bar",gtmEvent:a="form-submission"})=>{const{searchIsOpen:s=!0,isDesktopVersion:o=!1}=n||{},l=ue.useIntl(),u=E.useRef(null),c=LR.getLangDir(l.locale)||"ltr";Hs(()=>{!n||o||!s||u.current&&u.current.focus()},[s]);const d=f=>{f.preventDefault(),f.stopPropagation(),!(!u.current||!u.current.value||u.current.value.length<1)&&(window.location.href=`/search?search=${encodeURIComponent(u.current.value)}`)};return h.jsx("form",{onSubmit:d,className:ne("search-form gtm-trackable",t),role:"search","data-gtm-event-context":i,"data-gtm-event-type":a,children:h.jsx("fieldset",{id:`${e}-form`,hidden:n?!s:!1,children:h.jsxs("p",{children:[h.jsx(ct,{element:"label",htmlFor:e,children:l.formatMessage({id:"search_label"})}),h.jsx("input",{ref:u,type:"search",id:e,name:e,defaultValue:r,placeholder:l.formatMessage({id:"search_placeholder"}),onKeyDown:f=>{f.key==="Enter"&&d(f)}}),h.jsx("button",{className:"clear",onClick:f=>{f.preventDefault(),f.stopPropagation(),u.current&&u.current.value&&(u.current.value="")},children:h.jsx(ct,{children:l.formatMessage({id:"search_clear"})})}),h.jsx("button",{className:`search ${c}`,onClick:d,children:h.jsx(ct,{children:l.formatMessage({id:"search_cta"})})})]})})})},R9=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 s=Object.assign({},a);try{s=await t(i),s===void 0&&(s=a)}catch{return n([{type:"shouldManuallyApprove",value:!0},{type:"emailDetails",value:{email:i,boxType:"nonGov",isEnd2End:!1}},{type:"validFields.email",value:!1}])}const{valid:o=!1,autoApproved:l=!1,exists:u}=s;let c="";return o?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}])},$R=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"]}},jR=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 s=$R(new FormData(e.form.current)),o=Object.assign(s,t);await n(o),sessionStorage.setItem(Dp.SESSION_STORAGE.EMAIL,s.email),r&&r({...s,...a.values}),i([{type:"showSuccessMessage",value:!0}])},HR=({shouldShow:e,placeholders:t,labels:n,functions:{validateEmail:r,resendVerificationCode:i},refs:a,state:s,dispatch:o,dataToSubmit:l,intl:u})=>{const{emailDetails:c}=s,d=(p,g)=>{p.current&&s.validFields[g]!==p.current.validity.valid&&o([{type:`validFields.${g}`,value:p.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:()=>o([{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"}),functions:{onBlur:()=>{R9({ref:a.email,validateEmail:r,dispatch:o})},onChange:(p,g)=>{o([{type:"shouldDisableButton",value:!0}]),g&&g({type:"updateValue",payload:{key:"terms",value:!1}})},onFocus:()=>o([{type:"loadRecaptcha",value:!0}])},autoComplete:"email",validation:[{condition:"required"},{condition:"valid-email"}],"data-testid":"signup-email-input"},{component:Tb,props:{email:c.email,type:c.boxType,resendVerificationCode:i}}];return s.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:p=>h.jsx("small",{children:p})}),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:p=>h.jsx("small",{className:"notes text-small",children:p})}),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,"aria-describedby":"signup-terms-helper-textbox",label:u.formatMessage({id:"signup_terms"},{terms:p=>h.jsx("a",{href:"/pages/terms-and-conditions","data-gtm-event-context":"SignupForm","data-gtm-event-type":"terms-of-service-click",className:"gtm-trackable",children:p}),privacy:p=>h.jsx("a",{href:"/pages/privacy-policy","data-gtm-event-context":"SignupForm","data-gtm-event-type":"privacy-policy-click",className:"gtm-trackable",children:p})}),shownValue:"accepted",functions:{onChange:p=>{if(!p)return;const g=[];["name","email"].forEach(m=>{s.validFields[m]!==a[m].current.validity.valid&&(g.push({type:`validFields.${m}`,value:a[m].current.validity.valid}),m==="email"&&R9({ref:a.email,validateEmail:r,dispatch:o}))}),g.length&&o(g)}},validation:[{condition:"required"}],"data-testid":"signup-terms-checkbox"}),f};const UR=({className:e=""})=>h.jsxs("div",{className:ne("success-message",e),"data-testid":"success-message",children:[h.jsx("p",{className:"success-title",children:h.jsx(ue.FormattedMessage,{id:"signup_success_title"})}),h.jsx(ue.FormattedMessage,{id:"signup_success_text",values:{p:t=>h.jsx("p",{children:t})}})]});const zR={validFields:{name:!1,email:!1,jobTitle:!1,organisation:!1},emailDetails:{email:"",boxType:"",isEnd2End:!1},shouldManuallyApprove:!1,shouldDisableButton:!0,loadRecaptcha:!1,showSuccessMessage:!1,showError:!1},qR=({className:e="",labels:t={},placeholders:n={},functions:r={validateEmail:()=>Promise.resolve(),createAccount:()=>Promise.resolve(),handleError:()=>{},resendVerificationCode:()=>Promise.resolve()},shouldShow:i={},submitButton:a,dataToSubmit:s={ref:"sign-up-form"},...o})=>{const l=ue.useIntl(),u=window.location.pathname.includes("/signup")?"/login":`/login?returnTo=${window.location.pathname+window.location.search}`,{title:c=!0,expectation:d=!1,url:f=!0,logInButton:p=!0,successMessage:g=!0}=i,m={title:c,expectation:d,url:f,logInButton:p,successMessage:g},[y,v]=E.useReducer(eo,zR),{validFields:b,emailDetails:T,shouldManuallyApprove:_,shouldDisableButton:C,showSuccessMessage:A,showError:S}=y,[I,B]=Sp.useCookies(["signup-this-session","functional-cookie-consent"]),F={form:E.createRef(),name:E.createRef(),email:E.createRef(),jobTitle:E.createRef(),organisation:E.createRef(),tc:E.createRef(),hiddenValidation:E.createRef()};E.useEffect(()=>{_===!0&&F.jobTitle.current&&F.jobTitle.current.focus()},[_]),E.useEffect(()=>{I["signup-this-session"]&&v([{type:"showSuccessMessage",value:!0}])},[I]),E.useEffect(()=>{A&&I["functional-cookie-consent"]&&B("signup-this-session","true",{path:"/",maxAge:3600})},[A]);const R=E.useMemo(()=>HR({placeholders:n,labels:t,shouldShow:m,functions:r,refs:F,state:y,dispatch:v,dataToSubmit:s,intl:l}),[s,r,l,F,m,y]),N=C?!0:_?!Object.values(b).every(k=>k===!0):!b.name||!b.email||["exists","pending","verify"].includes(T.boxType);return m.successMessage&&A?h.jsx(UR,{className:e}):h.jsxs("fieldset",{className:ne("signup-form-fieldset",e),"data-testid":"signup-form",children:[m.title&&h.jsx("h1",{className:"signup-title","aria-label":"Sign up to Apolitical",children:h.jsx(ue.FormattedMessage,{id:"signup_title"})}),S&&h.jsx(Xr,{"aria-live":"assertive",variant:"error",text:l.formatMessage({id:"signup_error"})}),h.jsx(Nr,{className:"signup-form",formRef:F.form,id:"sign-up-form",fields:R,intlPath:"signup",button:{variant:"primary",size:"medium",text:a||l.formatMessage({id:"signup_button_join"}),disabled:N?{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:m.logInButton},gtm:{context:"SignupForm",event:"signup-submit-click"},functions:{onSuccess:async()=>{await jR({refs:F,dataToSubmit:s,createAccount:r.createAccount,onSuccess:r.onSuccess,dispatch:v,state:y})},onCatch:k=>{r.handleError(k),v([{type:"showSuccessMessage",value:!1},{type:"showError",value:!0}])}}}),h.jsx("button",{className:"validation-button",ref:F.hiddenValidation})]})};function WR({parentId:e,isMember:t,formFunctions:n,leave:r,join:i,meta:a}){const s=ue.useIntl();return h.jsx(V0,{form:{content:{type:Ve.Reply,slugs:{}},functions:n,meta:{isEditing:!1,isAutoFocused:!1,isPrepopulated:!1,showSuccessMessage:!1,...a},placeholder:s.formatMessage({id:"discussion_responses_placeholder"})},parentId:e,membershipRequiredToPost:{isMember:t,required:!0,join:i,leave:r,notMemberStateText:s.formatMessage({id:"community_joinToPost"})}})}function VR({hasNextPage:e,fetchNextPage:t,setFocusReplyIndex:n,totalReplies:r}){const i=ue.useIntl(),a=()=>{n(r),t()};return h.jsx(jl,{hasNextPage:e,loadNextPage:a,icon:{icon:"arrow-down",position:"right"},messages:{button:i.formatMessage({id:"loadMore_button"}),error:i.formatMessage({id:"loadMore_error"})}})}function KR({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:i,user:a}){const{mutate:s}=bt.useMutation({mutationFn:e,onMutate:o=>t(l=>{const u=Dg({reply:D6(o),user:a});return qs(u,l,{replace:!1,append:(o==null?void 0:o.replyId)!==void 0})}),onError:n,onSuccess:(o,l,u)=>{const c=Dg({reply:o,user:a});r.setQueryData(i,qs(c,u,{replace:!0,append:(l==null?void 0:l.replyId)!==void 0})),setTimeout(()=>{Qp(c.id,"reply")},0)}});return s}function GR({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=bt.useMutation({mutationFn:e,onMutate:({replyId:i,content:a})=>t(s=>{const o=Bn(i,s);return o&&(o.data.content=a),s}),onError:n});return r}function YR({replies:e,user:t,replyType:n,currentLocale:r}){return!e||!(t!=null&&t.id)?[]:e.map(({id:i,own_children:a,latest_children:s,children_counts:o,data:l,created_at:u,parent:c,...d})=>{var A,S,I,B,F,R,N,k,M,$,z,P,te;const f=(((A=a==null?void 0:a.like)==null?void 0:A.length)||0)>0,p=(((S=s==null?void 0:s.like)==null?void 0:S.length)||0)>0,g=f?(I=a==null?void 0:a.like)==null?void 0:I.find(ee=>{var D;return((D=ee==null?void 0:ee.user)==null?void 0:D.id)===(t==null?void 0:t.id)}):!1,m=typeof g=="object"?(g==null?void 0:g.id)??"":"",y=p?(B=s==null?void 0:s.like)==null?void 0:B.map(ee=>{var D,x,V;return{id:(D=ee==null?void 0:ee.user)==null?void 0:D.id,name:(V=(x=ee==null?void 0:ee.user)==null?void 0:x.data)==null?void 0:V.name}}):!1,v=(k=(N=(R=(F=l==null?void 0:l.payload)==null?void 0:F.data)==null?void 0:R.translations)==null?void 0:N[r])==null?void 0:k.body,b=($=(M=l==null?void 0:l.payload)==null?void 0:M.data)==null?void 0:$.original,T=!!v,_=(b==null?void 0:b.locale)===r,C=v||(b==null?void 0:b.body);return{user:d==null?void 0:d.user,body:n===qt.Courses?vb({payload:(z=l==null?void 0:l.payload)==null?void 0:z.data,locale:l==null?void 0:l.locale}):C||"",locale:l==null?void 0:l.locale,createdAt:u,data:{...ZR(l),translationInfo:{hasTranslation:T,isOriginalPost:_,currentBody:C,currentLocale:r,originalBody:b==null?void 0:b.body,originalLocale:b==null?void 0:b.locale}},likeId:m,liked:p,likes:(o==null?void 0:o.like)||0,peopleWhoLiked:y,replyId:i,parent:c,userLiked:!!g,payloadId:(P=l==null?void 0:l.payload)==null?void 0:P.id,payloadCollection:(te=l==null?void 0:l.payload)==null?void 0:te.collection}})}function ZR(e){if(!e||!e.mentioned_users)return{};const t=e==null?void 0:e.mentioned_users,n=(e==null?void 0:e.additional_data)||{};return{mentions:t,...n}}function Dm({queryFns:{create:e,edit:t,like:n,list:r,remove:i,unlike:a},queryKey:s,type:o=qt.Communities}){const l=bt.useQueryClient(),u=y1(),c=Ka(),d={queryClient:l,queryKey:s},f={mutationHandlers:{error:Vp(d),mutate:Kp(d)},user:u,...d},p=KR({...f,mutationFn:e}),g=GR({...f,mutationFn:t}),m=QR({...f,mutationFn:n}),y=JR({...f,mutationFn:i}),v=eF({...f,mutationFn:a}),{replies:b,...T}=XR({queryKey:s,queryFn:r});return{replies:YR({replies:b,user:u,replyType:o,currentLocale:c}),mutations:{create:p,edit:g,remove:y,like:m,unlike:v},user:u,...T}}function QR({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:i}){const{mutate:a}=bt.useMutation({mutationFn:e,onMutate:({replyId:s})=>t(o=>{const l=Bn(s,o);return l&&Og({reply:l}),o}),onError:n,onSuccess:(s,{replyId:o},l)=>{const u=Bn(o,l);u&&Og({reply:u,reaction:s}),r.setQueryData(i,l)}});return a}function XR({queryFn:e,queryKey:t}){const{data:n,error:r,isLoading:i,hasNextPage:a,fetchNextPage:s}=bt.useInfiniteQuery({queryKey:t,queryFn:e,initialPageParam:{next:""},getNextPageParam:o=>(o==null?void 0:o.next)||null});return{replies:Zp(n),error:r,isLoading:i,hasNextPage:a,fetchNextPage:s}}function JR({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=bt.useMutation({mutationFn:e,onMutate:({replyId:i})=>t(a=>mb(i,a)),onError:n});return r}function eF({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:i}=bt.useMutation({mutationFn:e,onMutate:({replyId:a})=>t(s=>{const o=Bn(a,s);return o&&O6({reply:o,user:r}),s}),onError:n});return i}const tF=({activityId:e,basePath:t,isMember:n,parentId:r,replyId:i,functions:{reactions:a,form:s,likes:o},type:l=qt.Communities})=>{const u=ue.useIntl(),c=3,{replies:d,fetchNextPage:f,hasNextPage:p,isLoading:g,mutations:{create:m,edit:y,like:v,remove:b,unlike:T}}=Dm({queryKey:[t,r,e,i,"replies"],queryFns:{...a,list:A=>a.list({...A,reactionId:i})},type:l});Ip([g]);const[_,C]=E.useState(!0);return h.jsxs(h.Fragment,{children:[(d==null?void 0:d.length)>=c&&h.jsx(Fe,{className:"nested-replies-show-toggle",variant:"secondary",size:"small",styling:{muted:!0},icon:{icon:`arrow_corner-${_?"up_left":"down_right"}`,position:"left"},onClick:()=>C(!_),children:u.formatMessage({id:`discussion_thread_${_?"hide":"show"}`},{count:d==null?void 0:d.length})}),_&&h.jsx(ex,{loadMore:{isLoading:g,hasNextPage:p,loadNextPage:()=>f()},form:{parentId:r,content:{type:Ve.Reply,slugs:{question:`${t}/${r}`,answer:e,reply:i}},functions:{create:(A,{body:S})=>m({activityId:e,replyId:i,content:S}),...s},meta:{isEditing:!1,isAutoFocused:!0,isPrepopulated:!1,showSuccessMessage:!1}},children:d&&d.length>0?d==null?void 0:d.map(({replyId:A,likes:S,data:I,body:B,createdAt:F,userLiked:R,peopleWhoLiked:N,parent:k,user:M,likeId:$})=>h.jsx(eu,{isCommunity:!0,content:{id:A,type:Ve.Reply,body:B,createdAt:F,slugs:{question:`${t}/${r}`,answer:e,reply:k},slug:"",author:Ml(M),userLiked:R,likes:S,peopleWhoLiked:l===qt.Courses?!1:N,data:I},forceHide:{shareLink:l===qt.Courses},userHasPermissions:n,functions:{content:{createContent:()=>null,deleteContent:()=>b({replyId:A}),updateContent:(z,{body:P})=>y({replyId:A,content:P})},likes:{createLike:()=>v({replyId:A}),deleteLike:()=>T({replyId:A,reactionId:$}),listLikes:z=>o.list({replyId:A,...z})},comments:{},form:s},styling:{showShareLinkButton:!0},badges:{showBadges:!0,scopes:[{scope:pn.Communities,area:r||""},{scope:pn.Platform,area:"all"}]},disableMentions:l===qt.Courses,basePath:t,parentId:r},A)):null})]})};function nF({formFns:e,activityId:t,basePath:n,focus:r,isMember:i,parentId:a,reply:s,type:o=qt.Communities}){const{body:l,data:u,likeId:c,likes:d,peopleWhoLiked:f,replyId:p,createdAt:g,user:m,userLiked:y}=s,{edit:v,like:b,remove:T,unlike:_}=e.mutations;return h.jsx(Z3,{children:h.jsx(eu,{isCommunity:!0,content:{id:p,type:Ve.Reply,body:l,createdAt:g,slugs:{question:`${n}/${a}`,answer:t,reply:p},slug:p,author:Ml(m),userLiked:y,likes:d,peopleWhoLiked:o===qt.Courses?!1:f,data:u},userHasPermissions:i,functions:{content:{createContent:()=>null,deleteContent:()=>T({replyId:p}),updateContent:(C,{body:A})=>v({replyId:p,content:A})},likes:{createLike:()=>b({replyId:p}),deleteLike:()=>_({replyId:p,reactionId:c}),listLikes:C=>e.likes.list({replyId:p,...C})},comments:{},form:e.form},forceHide:{shareLink:o===qt.Courses},badges:{showBadges:!0,scopes:[{scope:pn.Communities,area:a||""},{scope:pn.Platform,area:"all"}]},translation:{isTranslatable:!0,onTranslate:async({payloadId:C,payloadCollection:A})=>({body:"Translated body"})},disableMentions:o===qt.Courses,children:h.jsx(tF,{basePath:n,parentId:a,activityId:t,replyId:p,isMember:i,functions:e,type:o}),styling:{showShareLinkButton:!0},setFocus:r,basePath:n,parentId:a},p)},p)}const Cu="ALL",i8=({activityId:e,basePath:t,parentId:n,activityTotalReplies:r,isMember:i,functions:{form:a,join:s,leave:o,likes:l,reactions:u},profile:c,showReplies:d,type:f=qt.Communities,repliesFilters:p})=>{const g=ue.useIntl(),m=Ka(),{fetchNextPage:y,hasNextPage:v,isLoading:b,replies:T,mutations:{create:_,remove:C,edit:A,like:S,unlike:I}}=Dm({queryKey:[t,n,e,"replies"],queryFns:u,type:f}),[B,F]=E.useState(f===qt.Courses&&m||Cu),[R,N]=E.useState([]),k=E.useMemo(()=>T,[JSON.stringify(T)]);E.useEffect(()=>{if(!k)return;const P=!B||B===Cu||f!==qt.Courses?k:k.filter(te=>te.locale===B);N(P)},[k,B]);const[M,$]=E.useState(null);Ip([b]),Xp();const z={create:(P,te)=>{const{body:ee}=te;_({activityId:e,content:ee})},...a};return h.jsxs("section",{className:"replies-feed",children:[h.jsx(J3,{type:"comment",responses:r,isLoading:b}),d?h.jsxs(h.Fragment,{children:[h.jsx(WR,{parentId:n,isMember:i,join:s,leave:o,formFunctions:z,meta:{isAutoFocused:f===qt.Courses||!1}}),f===qt.Courses&&(p==null?void 0:p.isEnabled)&&h.jsxs("section",{className:"replies-feed-language-switcher",style:{display:"flex"},children:[h.jsx(Nr,{id:"replies-feed-language-switcher",fields:[{id:"language",label:!1,type:"select",initialValue:B,options:[{id:Cu,label:g.formatMessage({id:"activitySection_language_switcher_all_languages_option"})},...(p==null?void 0:p.options)||[]],functions:{onChange:P=>F(P)}}],functions:{},button:{hideButton:!0}}),h.jsx(Fe,{icon:"info-inside-circle",variant:"tertiary",className:"language-switcher-info-button",tooltip:g.formatMessage({id:"activitySection_language_switcher_info"}),forceTooltip:!0,children:h.jsx(ct,{children:g.formatMessage({id:"activitySection_language_switcher_info"})})})]}),R==null?void 0:R.map((P,te)=>h.jsx(nF,{activityId:e,basePath:t,focus:M===te,formFns:{form:a,likes:l,reactions:u,mutations:{remove:C,edit:A,like:S,unlike:I}},isMember:i,parentId:n,reply:P,type:f},P.replyId)),b?h.jsx(h.Fragment,{children:" "}):h.jsx(VR,{hasNextPage:v,fetchNextPage:y,setFocusReplyIndex:$,totalReplies:T.length})]}):h.jsx(Kn,{children:h.jsx(ue.FormattedMessage,{id:"replies_feed_missing_polls_vote_message"})}),h.jsx(K0,{form:c})]})};function rF({queryFn:e,queryKey:t}){const{data:n,error:r,isLoading:i,hasNextPage:a,fetchNextPage:s,refetch:o}=bt.useInfiniteQuery({queryKey:t,queryFn:e,initialPageParam:{next:""},getNextPageParam:c=>(c==null?void 0:c.next)||null}),l=Zp(n),u=`${l.length||0}${a?"+":""}`;return{likes:l,likesCount:u,error:r,isLoading:i,hasNextPage:a,fetchNextPage:s,refetch:o}}function iF({queryFns:{list:e},queryKey:t}){const{likes:n,...r}=rF({queryKey:t,queryFn:e});return{likes:n,...r}}function a8({basePath:e,parentId:t,activityId:n,likeCount:r,functions:i}){const{likes:a,fetchNextPage:s,hasNextPage:o,refetch:l}=iF({queryKey:[e,t,n,"likes"],queryFns:i.likes});E.useEffect(()=>{l()},[l]);const u=a.map(({user:c})=>c).map(c=>c?Ml(c):void 0).filter(c=>c&&typeof c!="string");return h.jsx("section",{className:"likes-feed",children:h.jsx(V3,{members:{data:u,total:r},showHeader:!1,showPlaceholders:!0,communitySlug:t,hasNextPage:o&&u.length<r,loadNextPage:s})})}const s8=({showModal:e=!0,functions:{onClose:t,likes:n},likeCount:r,className:i,...a})=>{const s=ue.useIntl();return h.jsx(Di,{id:"likes-modal",title:s.formatMessage({id:"discussion_likes"},{number:r}),isOpen:e,functions:{onClose:t},className:ne("profile-modal in-portal",i,{open:e}),maxWidth:600,children:h.jsx(a8,{...a,likeCount:r??0,functions:{likes:n}})})},aF=Object.freeze(Object.defineProperty({__proto__:null,default:s8},Symbol.toStringTag,{value:"Module"})),sF={results:[{created_at:"2024-05-16T13:17:45.940899Z",updated_at:"2024-05-16T13:17:45.940899Z",id:"ab4b7ab0-f4fe-469f-a8e7-5a52b3e55333",user_id:"9ed21585-63be-4446-96ce-3e703820eb73",user:{id:"1234",data:{name:"Han Solo",thumbnail:"https://placehold.co/400x400",jobTitle:"Smuggler",organization:"Rebel Alliance",badges:{communities:{"endor-alumni":["blue-badge"]}}}},kind:"like",activity_id:"869e5a90-0eba-11ef-8080-80017b714aaf",data:{mentioned_users:null},parent:"",latest_children:{},children_counts:{}},{created_at:"2024-05-16T13:17:45.940899Z",updated_at:"2024-05-16T13:17:45.940899Z",id:"db4b7ab0-f4fe-469f-a8e7-5a52b3e55373",user_id:"9ed21585-63be-4446-96ce-3e703820eb73",user:{created_at:"2023-08-22T11:56:10.585365Z",updated_at:"2024-03-13T11:31:49.447916Z",id:"9ed21585-63be-4446-96ce-3e703820eb73",data:{jobTitle:"Admiral",name:"Princess Leia",organization:"Rebela Alliance",thumbnail:"https://placehold.co/400x400",badges:{platform:{all:["orange-badge"]}}}},kind:"pin",activity_id:"769e5a90-0eba-11ef-8080-80017b714aaf",data:{mentioned_users:null},parent:"",latest_children:{},children_counts:{}}],next:"xy12345"};const oF=3e3,o8=({url:e,gtm:t={context:"ShareLink",event:"copy-link-click"}})=>{const n=ue.useIntl(),r="discussion_share_copy_link",[i,a]=E.useState({isOpen:!1,isCopied:!1});return h.jsxs("li",{className:"share-link-wrapper",children:[h.jsx(Is,{className:"gtm-trackable",icon:{icon:"link_chain"},onMouseOver:()=>a({...i,isOpen:!0}),onFocus:()=>a({...i,isOpen:!0}),onMouseOut:()=>a({isOpen:!1,isCopied:!1}),onBlur:()=>a({isOpen:!1,isCopied:!1}),onClick:()=>{navigator.clipboard.writeText(e).then(()=>{a({isOpen:!0,isCopied:!0});const s=new CustomEvent("ariaLive",{detail:{message:n.formatMessage({id:`${r}_success`})}});document.dispatchEvent(s),setTimeout(()=>{a({isOpen:!1,isCopied:!1})},oF)})},"data-gtm-event-context":t.context,"data-gtm-event-type":t.event,"data-testid":"share-link",screenreaderText:n.formatMessage({id:r})}),h.jsx(ia,{className:ne({copied:i.isCopied}),isOpen:i.isOpen,styling:{hasPointer:"top",extraPadding:!1},children:n.formatMessage({id:`${r}${i.isCopied?"_success":""}`})})]})};const ga="discussion_",l8=({className:e,gtmContext:t,contentType:n,likes:r,comments:i,replies:a,edit:s,shareLink:o,moreMenu:l})=>{const u=ue.useIntl(),c=[];return l&&l.reportData&&c.push({text:u.formatMessage({id:`${ga}moreMenu_report`}),onClick:d=>{d.stopPropagation()},href:`mailto:community@apolitical.co?subject=${encodeURI(u.formatMessage({id:`${ga}report_subject`}))}&body=${encodeURI(u.formatMessage({id:`${ga}report_body`},{contentType:n||"",contentSlug:l&&l.reportData&&l.contentSlug||"",contentUrl:l&&l.reportData&&l.reportData.contentUrl||""}))}`,icon:"flag"}),h.jsxs("ul",{className:ne("actions text-medium",e),"data-testid":`${n}-actions`,children:[r?h.jsx(yb,{element:"li",likes:r.count,isShort:!1,userLiked:r.userLiked,content:{type:n,slugs:r.content.slugs,slug:r.content.slug},canLike:r.canLike,peopleWhoLiked:r.peopleWhoLiked,activityId:r.activityId,functions:r.functions,basePath:r.basePath||"",parentId:r.parentId||""}):h.jsx(h.Fragment,{}),i?h.jsx("li",{children:h.jsx(Is,{shortText:`${i.count??0}`,onClick:d=>{d.preventDefault(),d.stopPropagation(),i.functions.onClick()},icon:{icon:"speech-bubble_square"},"data-testid":"comment","data-gtm-event-context":t,"data-gtm-event-type":`answer-${n}-click`,screenreaderText:u.formatMessage({id:`${ga}comments_screenReader`},{count:i.count}),children:u.formatMessage({id:`${ga}comments${i.count===null?"_loading":""}`},{count:i.count})})}):h.jsx(h.Fragment,{}),a?h.jsx("li",{children:h.jsx(Is,{styling:{muted:!0},onClick:a.functions.onClick,icon:{icon:"speech-bubble_square"},"data-testid":"reply",disabled:!a.canReply,children:u.formatMessage({id:`${ga}reply`})})}):h.jsx(h.Fragment,{}),s?h.jsx("li",{className:"edit-button-item",children:h.jsx(Is,{styling:{muted:!0},onClick:s.onClick,icon:{icon:"pencil-paper"},"data-testid":"edit",children:u.formatMessage({id:`${ga}action_edit`})})}):h.jsx(h.Fragment,{}),o?h.jsx(o8,{url:o.url,gtm:{context:t||"",event:`copy-link-${n}-click`}}):h.jsx(h.Fragment,{}),l?h.jsx(t1,{element:"li",id:`more-${l.contentSlug}`,options:[...l.options||[],...c]}):h.jsx(h.Fragment,{})]})};const lF=({breadcrumbs:e,cutoff:t=20,className:n=""})=>{const r=ue.useIntl();return h.jsxs(h.Fragment,{children:[h.jsx(ct,{element:"p",children:r.formatMessage({id:"breadcrumbs_label"})}),h.jsx("ul",{className:ne("breadcrumbs text-small",n),children:e.map(({text:i,href:a,current:s=!1},o)=>{const l={};return s&&(l["aria-current"]="location"),h.jsxs("li",{children:[s&&h.jsx(ct,{element:"span",children:r.formatMessage({id:"breadcrumbs_currentPage"})}),h.jsx(sa,{href:s?void 0:a,...l,children:yl(i,t)})]},`${Si(i)}_${o}`)})})]})};const Om=({variant:e="default",data:{image:t,url:n,title:r,description:i},onClick:a,gtm:s,...o})=>{if(!n)return h.jsx(h.Fragment,{});let l=n.split("//");l.length>1?l=l[1]:l=l[0],l=l.split("/"),l=l[0];const{context:u="EnrichedLink",event:c="enriched-link-click"}=s??{};return h.jsxs("aside",{className:ne("enriched-url gtm-trackable",{"has-image":t,[e]:e!=="default"}),onClick:d=>{if(d.preventDefault(),d.stopPropagation(),a){a(d);return}window.open(n,"_blank")},"data-gtm-event-context":u,"data-gtm-event-type":c,children:[h.jsx("small",{children:l}),h.jsx("p",{className:"title text-medium",children:h.jsx("a",{...o,href:n,target:"_blank",rel:"noreferrer",children:r})}),i&&e!=="condensed"?h.jsx("p",{className:"text-small",children:i}):h.jsx(h.Fragment,{}),t&&t.src?h.jsx("p",{className:"img",children:h.jsx("img",{src:t.src,alt:t.alt||"",loading:"lazy",fetchpriority:"low",width:t.width||"auto",height:t.height||"100%"})}):h.jsx(h.Fragment,{})]})};const u8=({options:e,defaultOptions:t=[],allOption:n=!1,allowMultiple:r=!0,onChange:i=()=>{},preventNoOptionSelected:a=!1,className:s="",styling:o,gtm:l})=>{const u=ue.useIntl(),{muted:c,large:d}=o||{},f=n?[{id:"all",text:typeof n!="boolean"&&n.text||u.formatMessage({id:"filters_all"})},...e]:e,[p,g]=E.useState(n?["all"]:t.length?t.map(b=>b.id):[]),[m,y]=E.useState(0),v=(b,T)=>{let _=[];p.includes(b)&&!a?_=p.filter(C=>C!==b):b==="all"?_=["all"]:r?_=[...p.filter(C=>C!=="all"),b]:_=[b],g(C=>(i&&typeof i=="function"&&i({current:_,previous:C}),_)),T&&typeof T=="function"&&T()};return h.jsx("ul",{className:ne("filters",s),children:f.map(({id:b,text:T,disabled:_=!1,callback:C=()=>{},content:A},S)=>{let I={tabIndex:m===S?0:-1};return _&&(I={disabled:!0,"aria-label":u.formatMessage({id:"filters_disabled"},{name:T})}),h.jsx("li",{children:h.jsx("button",{"data-gtm-event-context":(l==null?void 0:l.context)||"filters","data-gtm-event-type":(l==null?void 0:l.type)||`${T.toLowerCase().replace(" ","-")}-click`,className:ne(b,{selected:p.includes(b),large:d,muted:c}),onClick:B=>{B.preventDefault(),B.stopPropagation(),v(b,C)},onKeyDown:B=>{var k,M;let F=S+1,R,N;switch(B.code){case"Enter":case"Space":B.preventDefault(),B.stopPropagation(),v(b,C);break;case"ArrowLeft":case"ArrowRight":B.preventDefault(),B.stopPropagation(),B.code==="ArrowLeft"?(F=S-1,F<0&&(F=f.length-1)):F>=f.length&&(F=0),y(F),R=B.currentTarget.closest("li"),N=(k=R==null?void 0:R.parentElement)==null?void 0:k.children[F],(M=N==null?void 0:N.querySelector("button"))==null||M.focus();break}},"aria-selected":p.includes(b),...I,children:A||T})},b)})})},uF=(e,t,n)=>{const r=String(e);if(!n||!n.length)return t?`/${r}/${t}`:`/${r}`;let i="",a=!1;return n.forEach(({url:s,position:o})=>{o==="before-lang"?(i+=`/${s}`,a=!0):(i.includes(`/${r}/`)||(i+=`/${r}`),i+=`/${s}`)}),i.includes(`/${r}/`)||(i+=`/${r}`),t&&(i+=`/${t}`),a?{url:i,urlForRouter:`/${i.split("/").slice(2).join("/")}`}:i};const xu="languageSwitcher_",cF=({currentLanguage:e,isOriginalLanguage:t=!1,isHumanTranslation:n=!1,translations:r,onChange:i,urlParts:a,variant:s="default",label:o,className:l=""})=>{const u=ue.useIntl(),{updateLanguage:c=()=>{}}=E.useContext(Fp),[d,f]=E.useState(e);if(E.useEffect(()=>{e!==d&&f(e)},[e]),!r||!Object.values(r).some(y=>y&&y.post_name))return null;const g=Object.keys(r),m=d!==e;return h.jsxs("div",{className:ne("language-switcher text-small",s,l),children:[h.jsxs("nav",{children:[s!=="short"&&h.jsx("p",{children:o||u.formatMessage({id:`${xu}label`})}),h.jsx("ul",{children:g.map(y=>{var _;if(!La.ALL_LOCALES.includes(y))return null;const v=(_=r[y])==null?void 0:_.post_name,b=La.ALL_LOCALES_WITH_LABELS.filter(C=>C.value===y)[0].title;let T={className:y};if(d===y)T["aria-label"]=u.formatMessage({id:`${xu}selected`},{language:b});else{const C=uF(y,v,a);T={...T,href:typeof C=="string"?C:C.url,onClick:A=>{f(y),c(y),typeof i<"u"&&(A.preventDefault(),A.stopPropagation(),i(y,typeof C=="string"?C:C.urlForRouter))}}}return h.jsx("li",{children:h.jsx(sa,{...T,fallbackElement:"span",children:b})},y)})}),s!=="short"&&!m&&h.jsx("p",{children:u.formatMessage({id:`${xu}translation_${t?"original":n?"human":"machine"}`})})]}),s!=="short"&&!m&&!t&&!n&&h.jsx("small",{children:u.formatMessage({id:`${xu}disclaimer`},{email:Cs.support,link:y=>{const v=`mailto:${y}`;return h.jsx("a",{href:v,children:y})}})})]})};const Qd=ue.createIntl({locale:"en",messages:dn}),jl=({hasNextPage:e=!0,loadNextPage:t=()=>{},isLoading:n=!1,variant:r="secondary",size:i="medium",styling:a={muted:!1,fullWidth:!1},icon:s=!1,messages:o={button:Qd.formatMessage({id:"loadMore_button"}),endOfFeed:Qd.formatMessage({id:"loadMore_endOfFeed"}),error:Qd.formatMessage({id:"loadMore_error"})},className:l="",gtmContext:u="LoadMore"})=>{const[c,d]=E.useState(""),f=async p=>{if(!n)try{await t(p)}catch(g){g instanceof Error?d(g.message):d("Unknown error")}};return!c&&!e&&!o.endOfFeed?null:h.jsx("footer",{className:ne("load-more",l),children:!c&&e?h.jsx(Fe,{variant:r,size:i,styling:a,icon:s,onClick:f,"data-gtm-event-context":u,"data-gtm-event-type":"load-more-click",disabled:n,className:"gtm-trackable","data-testid":"load-more-button",children:o.button}):o.endOfFeed&&(!c||c!=null&&c.includes("Cannot read items"))?h.jsx("p",{children:o.endOfFeed}):c&&h.jsx("p",{className:"error",children:o.error})})};const Nm=({variant:e="default",version:t="default",className:n="",...r})=>{const i=g1();return h.jsx("p",{className:"logo-wrapper",children:h.jsx("a",{href:i||"/home/",className:ne("logo",e,t,n),...r,children:h.jsx(ct,{children:h.jsx(ue.FormattedMessage,{id:"apolitical"})})})})};let wu=!1;const t1=({element:e="div",id:t="more-menu",options:n,className:r=""})=>{const i=ue.useIntl(),a=E.useRef(null),[s,o]=E.useState(!1),l=u=>{a.current&&u.target instanceof HTMLElement&&!a.current.contains(u.target)&&o(!1)};return E.useEffect(()=>(document.addEventListener("click",l,!0),()=>{document.removeEventListener("click",l,!0)})),E.createElement(e,{ref:a,className:ne("more-menu text-medium",r),children:h.jsxs(h.Fragment,{children:[h.jsx(Fe,{variant:"tertiary",size:"medium","data-testid":"more-menu",icon:{icon:"ellipsis"},onClick:()=>o(!s),"aria-haspopup":"true","aria-expanded":s,"aria-controls":t,screenreaderText:i.formatMessage({id:"moreMenu"}),className:"more-menu-button"}),h.jsx("ul",{id:t,hidden:!s,children:n.map(({href:u,onClick:c,text:d,icon:f,...p},g)=>{const m={...p,onClick:y=>{o(!1),typeof c=="function"&&c(y)},onFocus:()=>{wu&&(clearTimeout(wu),wu=!1)},onBlur:()=>{wu=setTimeout(()=>{o(!1)},100)}};return u&&(m.href=u),h.jsx("li",{className:"more-menu-list-item",children:h.jsx(Fe,{variant:"tertiary",size:"medium",icon:f?{icon:f,position:"left"}:!1,...m,children:d})},`${Si(d)}_${g}`)})})]})})},dF=(e,t=!1)=>t?e.replaceAll("/","")===t:typeof window<"u"&&window.location&&window.location.pathname===e;const fF=E.lazy(()=>Promise.resolve().then(()=>_7)),F9=[{key:"homepage",href:"/home/"},{key:"events",href:"/events/"},{key:"microcourses",href:"/microcourses/"},{key:"articles",href:"/solution-articles/"},{key:"communities",href:"/communities/"}],c8=({activeLink:e,profile:t})=>{const n=ue.useIntl(),r=E.useContext(jt),i=r&&typeof r.id=="string",a=g1();return a&&(F9[0].href=a),h.jsxs("ul",{id:"navigation-menu",className:"text-medium",children:[F9.map(({key:s,href:o})=>{const l=dF(o,e),u={};return l&&(u["aria-current"]="page"),h.jsx("li",{className:ne(s,{active:l}),children:h.jsx("a",{href:o,"data-gtm-event-type":`${s}-click`,"data-gtm-event-context":"NavigationMenu",className:"gtm-trackable",...u,children:n.formatMessage({id:`navigationMenu_links_${s}`})})},s)}),i&&t&&h.jsx(fF,{element:"li",member:r,styling:{variant:"card",isCondensed:!1},functions:{profile:t},className:"profile gtm-trackable","data-testid":"profile-link",alt:"",gtmContext:"NavigationMenu",gtmType:"profile-click"})]})},xo=(e,t,n)=>`${e}?share=${t}${n?`&uuid=${n}`:""}`,hF=({title:e,link:t,referrer:n})=>[{key:"linkedin",icon:"social_linkedin",url:`https://www.linkedin.com/shareArticle?mini=true&url=${encodeURIComponent(`${xo(t,"linkedin",n)}&src=linkedin`)}&title=${encodeURIComponent(e)}&source=Apolitical`},{key:"twitter",icon:"social_twitter",url:`https://twitter.com/share?ref_src=twsrc%5Etfw&url=${encodeURIComponent(`${xo(t,"twitter",n)}&src=twitter`)}&text=${encodeURIComponent(e)}&via=${encodeURIComponent("apoliticalco")}`},{key:"facebook",icon:"social_facebook",url:`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(`${xo(t,"facebook",n)}`)}&t=${e}`},{key:"email",icon:"share_email",url:`mailto:?subject=${encodeURIComponent(e)}&body=${encodeURIComponent(`${e}
163
163
 
164
- ${xo(t,"mailto",n)}&src=email`)}`},{key:"clipboard-copy",icon:"share_copy-link",url:xo(t,"copy",n),shouldRender:()=>navigator&&navigator.clipboard&&navigator.clipboard.writeText,onClick:(r,i)=>(r.preventDefault(),r.stopPropagation(),navigator.clipboard.writeText(i))}];const pF="shareLinks_",mF=({title:e,link:t,referrer:n,gtmContext:r="ShareLinks",size:i="large",variant:a="default",className:s=""})=>{const o=ue.useIntl(),l=hF({title:e,link:t,referrer:n});return h.jsxs("aside",{className:ne("share-links",i,a,s),children:[h.jsx("p",{className:"text-small",children:o.formatMessage({id:"shareLinks_label"})}),h.jsx("ul",{children:l.map(({key:u,icon:c,url:d,shouldRender:f=!0,onClick:p})=>{if(typeof f=="function"&&!f())return null;const g={};return p&&(g.onClick=m=>p(m,d)),h.jsx("li",{children:h.jsx(Fe,{size:i,variant:"tertiary",icon:{icon:c||u},href:d,target:"_blank",rel:"noopener noreferrer",className:"gtm-trackable","data-gtm-event-context":`${r}-SocialButtons`,"data-gtm-event-type":`${u}-click`,"data-testid":"link",screenreaderText:o.formatMessage({id:`${pF}link_${u}`}),...g})},u)})})]})};const gF=({tabs:e,className:t="",preventLocationChange:n})=>{var g;const r=(m,y,v)=>(m||(m=`panel-${Si(y)}-${v}`),m),i=ra(!0)||0;let a=e.findIndex(m=>m.current===!0);if(a<0&&(a=0),window.location.hash){const m=window.location.hash.replace("#","");if(e.find(v=>v.id===m)){for(let v=0;v<e.length;v++)if(r(e[v].id,e[v].text,v)===m){a=v;break}}}const[s,o]=E.useState((g=e[a])!=null&&g.id?e[a].id:r(e[a].id,e[a].text,a)),[l,u]=E.useState(""),c=(m,y)=>{switch(m.key){case"ArrowLeft":case"ArrowRight":{m.preventDefault();let v=y;m.key==="ArrowLeft"?y>0?v=y-1:v=e.length-1:m.key==="ArrowRight"&&(y<e.length-1?v=y+1:v=0);const b=r(e[v].id,e[v].text,v),T=document.getElementById(`tab-${b}`);T==null||T.focus(),u(b);break}case"Enter":o(l),window.location.hash=`#${l}`;break}},d=m=>{let y=!1;return m.target==="min-width"&&i>=m.value&&(y=!0),m.target==="max-width"&&i<=m.value&&(y=!0),y};E.useEffect(()=>{if(e[a].hasCarousel){const m=new CustomEvent("hiddenSectionVisible",{detail:{id:s}});window.dispatchEvent(m)}},[s]);const f=[],p=[];return e.forEach(({id:m,text:y,content:v,href:b,hasCarousel:T,breakpoint:_},C)=>{if(_&&!d(_))return;m=r(m,y,C);const A=s===m,S={};b||(S["aria-controls"]=m,S.onClick=I=>{I.preventDefault(),I.stopPropagation(),o(m),!n&&window.history.replaceState(null,"",`#${m}`)},p.push(h.jsx("section",{id:m,hidden:!A,role:"tabpanel","aria-labelledby":`tab-${m}`,"aria-live":A?"assertive":"off",children:typeof v=="string"?h.jsx("p",{children:v}):v},`section-${m}`))),f.push(h.jsx("li",{"data-testid":"navigation-tab",children:h.jsx("a",{href:b||`#${m}`,id:`tab-${m}`,"aria-controls":m,className:ne({selected:A}),role:"tab",tabIndex:A?0:-1,"aria-selected":A,onKeyDown:I=>c(I,C),...S,children:y})},`tab-${m}`))}),h.jsxs("div",{className:ne("tabs-wrapper",t),children:[h.jsx("ul",{className:"tabs",role:"tablist",children:f}),h.jsx("div",{className:"tab-content",children:p})]})};const vF={"2-1":901,"1-3":769,"1-1":769},d8=({layout:e="2-1",hideOnMobile:t=!1,hasCSSContainers:n=!1,className:r="",children:i})=>{const a=ra(!0);let s=i;return E.Children.count(i)===1&&(s=E.Children.toArray(i)[0],s.props&&(s=s.props.children)),h.jsx("section",{className:ne("columns",`layout-${e}`,r,{"has-containers":n}),children:E.Children.map(s,(o,l)=>t!==!1&&l===t&&a&&a<vF[e]?null:o)})};const ua=({children:e,className:t="",styling:n={},...r})=>{const{background:i="default",padding:a="none"}=n;return h.jsx("section",{className:ne("full-width-section",t,{[i]:i!=="default",[a]:a!=="none"}),...r,children:e})};const yF=({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})}),h.jsx(ua,{className:ne("download-section",n),styling:{background:"dark"},children:h.jsxs("div",{className:"content-default",children:[E.createElement(typeof e=="string"?"h2":e.element,{className:"text"},typeof e=="string"?e:e.text),h.jsx(to,{buttons:r})]})})};const Xh="editSection_";function f8({href:e,setShowModal:t}){typeof e!="string"&&t(!0)}const EF=({icon:e,description:t,ctaMessage:n,href:r,showEditButton:i,setShowModal:a})=>{const{formatMessage:s}=ue.useIntl();return h.jsxs(Kn,{variant:"muted",icon:e,children:[h.jsx("p",{children:t||s({id:`${Xh}placeholder_description`})}),i&&h.jsx("p",{children:h.jsx(Fe,{href:r,variant:"secondary",size:"small",onClick:()=>f8({href:r,setShowModal:a}),children:n||s({id:`${Xh}placeholder_cta`})})})]})},bF=({children:e,className:t="",formProps:n,formComponent:r,href:i,title:a,showTitle:s=!0,modalTitle:o,placeholder:l,showDivider:u=!0})=>{const{formatMessage:c}=ue.useIntl(),[d,f]=E.useState(!1),p=()=>f(!1),g=!!n||!!r,m=typeof i=="string"||g;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{p()}},onCancel:()=>{r.props.functions.onCancel&&r.props.functions.onCancel(),p()}}})),h.jsxs("section",{className:ne("edit-section",t),children:[g&&h.jsx(Di,{title:o||`Edit ${a}`,isOpen:d,showDivider:!1,showIcon:!1,functions:{onClose:p},className:ne("edit-section-modal"),children:y||(n?h.jsx(Nr,{...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,T;(b=n==null?void 0:n.functions)!=null&&b.onSuccess&&await((T=n==null?void 0:n.functions)==null?void 0:T.onSuccess(v)),f(!1)},onCancel:p}}):h.jsx(h.Fragment,{}))}),h.jsxs("div",{className:ne("edit-section-header",{"no-title":!s}),children:[s&&h.jsx("h2",{className:"edit-section-header-title",children:a}),m&&h.jsx(Fe,{href:i,variant:"tertiary",size:"small",icon:"pencil",onClick:()=>f8({href:i,setShowModal:f}),children:c({id:`${Xh}edit`})})]}),e||h.jsx(EF,{...l,href:i,setShowModal:f,showEditButton:m}),u&&h.jsx(Dr,{})]})};const TF=({title:e=!1,text:t,logos:n=[],styling:r={},className:i=""})=>{const a=n.length;if(a===0)return null;const s={element:typeof e=="object"?e.element:"h2",text:typeof e=="string"?e:typeof e=="object"?e.text:"",className:typeof e=="object"?e.className:""},{wrapLogos:o=!1,align:l="center",display:u="block"}=r;return h.jsxs("div",{className:ne("logos",i,`align-${l}`,{[u]:u!=="block","wrap-logos":o}),children:[e&&E.createElement(s.element,{className:ne("title",s.className)},s.text),t&&h.jsx("p",{children:t}),h.jsx("ul",{className:ne({"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:p=!1},g)=>{if(!c||!c.url)return null;const m=h.jsx("img",{src:c.url,width:c.width||"auto",height:c.height||"auto",alt:d});return h.jsxs("li",{children:[h.jsx("p",{className:"img-wrapper",children:f?h.jsx("a",{href:f,target:"_blank",rel:"nofollow noreferrer noopener",children:m}):m}),p&&h.jsx("small",{children:p})]},`${c.url}_${g}`)})})]})};let Xd;const Jd="contactFooter_",_F=({onSuccess:e=async()=>{},onFailure:t=()=>{}})=>{const n=E.useRef(null),[r,i]=E.useState(0),[a,s]=E.useState(!1),o=()=>{n.current&&i(n.current.clientHeight)},l=()=>{a||(s(!0),clearTimeout(Xd),Xd=setTimeout(()=>{o(),s(!1)},500))};return E.useEffect(()=>(o(),window.addEventListener("resize",l),()=>{clearTimeout(Xd),window.removeEventListener("resize",l)}),[]),h.jsx(ua,{id:"contactForm",className:"contact-footer",children:h.jsxs("div",{className:"inner-wrapper",children:[h.jsx("h2",{children:h.jsx(ue.FormattedMessage,{id:`${Jd}title`})}),h.jsxs("div",{className:"content-wrapper",ref:n,"data-testid":"content-wrapper",style:a?{}:{minHeight:r},children:[h.jsxs("aside",{children:[h.jsx("p",{children:h.jsx(ue.FormattedMessage,{id:`${Jd}text`})}),h.jsx(sa,{className:"mailto-link",href:"mailto:hello@apolitical.co",children:h.jsx(ue.FormattedMessage,{id:`${Jd}email`})})]}),h.jsx(JT,{functions:{onSuccess:e,onFailure:t},gtm:{context:"FooterContactUsForm",event:"contact-form-submit-click"}})]})]})})},CF=({activeLink:e,profile:t,...n})=>h.jsx(ua,{children:h.jsx(d8,{layout:"1-3",children:h.jsxs(h.Fragment,{children:[h.jsx(c8,{activeLink:e,profile:t}),h.jsx(q4,{...n})]})})});const ef="cookieBanner_",tf=["apol-cookie-banner","apolitical-performance-cookie-consent","functional-cookie-consent"],nf=new Date(Date.now()+12*30*24*60*60*1e3),h8=()=>{const e=ue.useIntl(),[t,n,r]=Sp.useCookies(tf),[i,a]=E.useState(!t["apol-cookie-banner"]),s=()=>{tf.forEach(c=>{n(c,!0,{path:"/",expires:nf,domain:c==="apolitical-performance-cookie-consent"?".apolitical.co":void 0})}),a(!1),window.location.reload()},o=()=>{n("apol-cookie-banner",!0,{path:"/",expires:nf}),tf.forEach(c=>{if(c==="apol-cookie-banner"){n(c,!0,{path:"/",expires:nf});return}r(c)}),a(!1)};if(!i)return null;const l=[{id:"settings",href:"/pages/cookie-policy",gtmType:"policy-page"},{id:"reject",onClick:o,gtmType:"reject-all"},{id:"accept",onClick:s,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:`${ef}buttons_${c.id}`})})}),h.jsxs("aside",{id:"cookie-banner",className:"text-medium",children:[h.jsx("h6",{children:e.formatMessage({id:`${ef}title`})}),h.jsx("p",{children:e.formatMessage({id:`${ef}text`})}),h.jsx(to,{buttons:u})]})},Ei={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:"/pages/privacy-policy",gtmType:"privacy-policy-link"},terms:{href:"/pages/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:Cs["data-protection"].default,gtmType:"email-dpo-link"},euDataProtection:{email:Cs["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:Cs.support,gtmType:"concierge-email-click"},business:{email:Cs.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 Ds="footer_",n1="SiteFooter",B9=({group:e})=>{const t=Ei[e].order||[];let n=!1;return"text"in Ei[e]&&(n=Ei[e].text),h.jsxs(E.Fragment,{children:[h.jsx("p",{className:"pre-title",children:h.jsx(ue.FormattedMessage,{id:`${Ds}${e}`})}),Array.isArray(t)&&t.length>0&&h.jsx("ul",{className:"text-medium",children:t.map(r=>{if(["order","child","text"].includes(r))return null;const{href:i,gtmType:a}=Ei[e][r],s={};return["legal"].includes(e)&&(s.target="_blank",s.rel="noopener"),h.jsx("li",{children:h.jsx("a",{href:i,className:"gtm-trackable","data-gtm-event-context":n1,"data-gtm-event-type":a,...s,children:h.jsx(ue.FormattedMessage,{id:`${Ds}${e}_${r}`})})},`${e}_${r}`)})}),typeof n!="boolean"&&"order"in n&&Array.isArray(n.order)&&h.jsx("dl",{className:"text-medium",children:n.order.map(r=>h.jsxs(E.Fragment,{children:[h.jsx("dt",{children:h.jsx(ue.FormattedMessage,{id:`${Ds}${e}_${r}`})}),h.jsxs("dd",{children:[typeof n!="boolean"&&n[r].address&&h.jsx("address",{children:h.jsx(ue.FormattedMessage,{id:`${Ds}${e}_${r}_address`,values:{br:h.jsx("br",{})}})}),typeof n!="boolean"&&n[r].email&&h.jsx("a",{href:`mailto:${n[r].email}`,className:"gtm-trackable","data-gtm-event-context":n1,"data-gtm-event-type":n[r].gtmType,children:n[r].email})]})]},`dl-${e}-${r}`))})]},e)},Im=()=>h.jsx("div",{id:"footer",children:h.jsxs("div",{className:"wrapper",children:[h.jsx(p1,{element:"hr"}),h.jsx(Nm,{variant:"inverted",version:"full",className:"gtm-trackable","data-gtm-event-context":n1,"data-gtm-event-type":"logo-homepage-link"}),h.jsx("footer",{children:["platform","community","company","contact"].map(e=>h.jsxs("div",{className:"group",children:[h.jsx(B9,{group:e}),Object.keys(Ei[e]).includes("child")&&h.jsx(B9,{group:Ei[e].child})]},e))}),h.jsx("hr",{}),h.jsxs("div",{className:"sub-footer",children:[h.jsx("ul",{children:Array.isArray(Ei.social.order)&&Ei.social.order.map(e=>{const t=Ei.social[e];return h.jsx("li",{className:e,children:h.jsx("a",{href:t.href,target:"_blank",rel:"noopener noreferrer",className:"gtm-trackable","data-gtm-event-context":n1,"data-gtm-event-type":"social-click",children:h.jsx("span",{className:"hidden",children:h.jsx(ue.FormattedMessage,{id:`${Ds}social_${e}`})})})},e)})}),h.jsx("small",{children:h.jsx(ue.FormattedMessage,{id:`${Ds}copyright`,values:{currentYear:new Date().getFullYear()}})})]})]})}),ei=Object.create(null);ei.open="0";ei.close="1";ei.ping="2";ei.pong="3";ei.message="4";ei.upgrade="5";ei.noop="6";const Cc=Object.create(null);Object.keys(ei).forEach(e=>{Cc[ei[e]]=e});const Jh={type:"error",data:"parser error"},p8=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",m8=typeof ArrayBuffer=="function",g8=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Pm=({type:e,data:t},n,r)=>p8&&t instanceof Blob?n?r(t):M9(t,r):m8&&(t instanceof ArrayBuffer||g8(t))?n?r(t):M9(new Blob([t]),r):r(ei[e]+(t||"")),M9=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function L9(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let rf;function xF(e,t){if(p8&&e.data instanceof Blob)return e.data.arrayBuffer().then(L9).then(t);if(m8&&(e.data instanceof ArrayBuffer||g8(e.data)))return t(L9(e.data));Pm(e,!1,n=>{rf||(rf=new TextEncoder),t(rf.encode(n))})}const $9="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ko=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<$9.length;e++)Ko[$9.charCodeAt(e)]=e;const wF=e=>{let t=e.length*.75,n=e.length,r,i=0,a,s,o,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=Ko[e.charCodeAt(r)],s=Ko[e.charCodeAt(r+1)],o=Ko[e.charCodeAt(r+2)],l=Ko[e.charCodeAt(r+3)],c[i++]=a<<2|s>>4,c[i++]=(s&15)<<4|o>>2,c[i++]=(o&3)<<6|l&63;return u},AF=typeof ArrayBuffer=="function",Rm=(e,t)=>{if(typeof e!="string")return{type:"message",data:v8(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:SF(e.substring(1),t)}:Cc[n]?e.length>1?{type:Cc[n],data:e.substring(1)}:{type:Cc[n]}:Jh},SF=(e,t)=>{if(AF){const n=wF(e);return v8(n,t)}else return{base64:!0,data:e}},v8=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},y8=String.fromCharCode(30),kF=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((a,s)=>{Pm(a,!1,o=>{r[s]=o,++i===n&&t(r.join(y8))})})},DF=(e,t)=>{const n=e.split(y8),r=[];for(let i=0;i<n.length;i++){const a=Rm(n[i],t);if(r.push(a),a.type==="error")break}return r};function OF(){return new TransformStream({transform(e,t){xF(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 af;function Au(e){return e.reduce((t,n)=>t+n.length,0)}function Su(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 NF(e,t){af||(af=new TextDecoder);const n=[];let r=0,i=-1,a=!1;return new TransformStream({transform(s,o){for(n.push(s);;){if(r===0){if(Au(n)<1)break;const l=Su(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(Au(n)<2)break;const l=Su(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(Au(n)<8)break;const l=Su(n,8),u=new DataView(l.buffer,l.byteOffset,l.length),c=u.getUint32(0);if(c>Math.pow(2,53-32)-1){o.enqueue(Jh);break}i=c*Math.pow(2,32)+u.getUint32(4),r=3}else{if(Au(n)<i)break;const l=Su(n,i);o.enqueue(Rm(a?l:af.decode(l),t)),r=0}if(i===0||i>e){o.enqueue(Jh);break}}}})}const E8=4;function Yt(e){if(e)return IF(e)}function IF(e){for(var t in Yt.prototype)e[t]=Yt.prototype[t];return e}Yt.prototype.on=Yt.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Yt.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};Yt.prototype.off=Yt.prototype.removeListener=Yt.prototype.removeAllListeners=Yt.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};Yt.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};Yt.prototype.emitReserved=Yt.prototype.emit;Yt.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Yt.prototype.hasListeners=function(e){return!!this.listeners(e).length};const D1=(()=>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")())(),PF="arraybuffer";function b8(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const RF=lr.setTimeout,FF=lr.clearTimeout;function O1(e,t){t.useNativeTimers?(e.setTimeoutFn=RF.bind(lr),e.clearTimeoutFn=FF.bind(lr)):(e.setTimeoutFn=lr.setTimeout.bind(lr),e.clearTimeoutFn=lr.clearTimeout.bind(lr))}const BF=1.33;function MF(e){return typeof e=="string"?LF(e):Math.ceil((e.byteLength||e.size)*BF)}function LF(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 T8(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function $F(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function jF(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 HF extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class Fm extends Yt{constructor(t){super(),this.writable=!1,O1(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 HF(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=Rm(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=$F(t);return n.length?"?"+n:""}}class UF extends Fm{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)};DF(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,kF(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]=T8()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let _8=!1;try{_8=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const zF=_8;function qF(){}class WF extends UF{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 Kr extends Yt{constructor(t,n,r){super(),this.createRequest=t,O1(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=b8(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=Kr.requestsCount++,Kr.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=qF,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Kr.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()}}Kr.requestsCount=0;Kr.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",j9);else if(typeof addEventListener=="function"){const e="onpagehide"in lr?"pagehide":"unload";addEventListener(e,j9,!1)}}function j9(){for(let e in Kr.requests)Kr.requests.hasOwnProperty(e)&&Kr.requests[e].abort()}const VF=function(){const e=C8({xdomain:!1});return e&&e.responseType!==null}();class KF extends WF{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=VF&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Kr(C8,this.uri(),t)}}function C8(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||zF))return new XMLHttpRequest}catch{}if(!t)try{return new lr[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const x8=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class GF extends Fm{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=x8?{}:b8(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;Pm(r,this.supportsBinary,a=>{try{this.doWrite(r,a)}catch{}i&&D1(()=>{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]=T8()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const sf=lr.WebSocket||lr.MozWebSocket;class YF extends GF{createSocket(t,n,r){return x8?new sf(t,n,r):n?new sf(t,n):new sf(t)}doWrite(t,n){this.ws.send(n)}}class ZF extends Fm{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=NF(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=OF();i.readable.pipeTo(t.writable),this._writer=i.writable.getWriter();const a=()=>{r.read().then(({done:o,value:l})=>{o||(this.onPacket(l),a())}).catch(o=>{})};a();const s={type:"open"};this.query.sid&&(s.data=`{"sid":"${this.query.sid}"}`),this._writer.write(s).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&&D1(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const QF={websocket:YF,webtransport:ZF,polling:KF},XF=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,JF=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function ep(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=XF.exec(e||""),a={},s=14;for(;s--;)a[JF[s]]=i[s]||"";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=eB(a,a.path),a.queryKey=tB(a,a.query),a}function eB(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 tB(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,a){i&&(n[i]=a)}),n}const tp=typeof addEventListener=="function"&&typeof removeEventListener=="function",xc=[];tp&&addEventListener("offline",()=>{xc.forEach(e=>e())},!1);class ea extends Yt{constructor(t,n){if(super(),this.binaryType=PF,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=ep(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=ep(n.host).host);O1(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=jF(this.opts.query)),tp&&(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"})},xc.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=E8,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&&ea.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",ea.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+=MF(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,D1(()=>{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(ea.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(),tp&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=xc.indexOf(this._offlineEventListener);r!==-1&&xc.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}ea.protocol=E8;class nB extends ea{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;ea.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;ea.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 s=d=>{const f=new Error("probe error: "+d);f.transport=n.name,a(),this.emitReserved("upgradeError",f)};function o(){s("transport closed")}function l(){s("socket closed")}function u(d){n&&d.name!==n.name&&a()}const c=()=>{n.removeListener("open",i),n.removeListener("error",s),n.removeListener("close",o),this.off("close",l),this.off("upgrading",u)};n.once("open",i),n.once("error",s),n.once("close",o),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 rB=class extends nB{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=>QF[i]).filter(i=>!!i)),super(t,r)}};function iB(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=ep(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 aB=typeof ArrayBuffer=="function",sB=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,w8=Object.prototype.toString,oB=typeof Blob=="function"||typeof Blob<"u"&&w8.call(Blob)==="[object BlobConstructor]",lB=typeof File=="function"||typeof File<"u"&&w8.call(File)==="[object FileConstructor]";function Bm(e){return aB&&(e instanceof ArrayBuffer||sB(e))||oB&&e instanceof Blob||lB&&e instanceof File}function wc(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(wc(e[n]))return!0;return!1}if(Bm(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return wc(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&wc(e[n]))return!0;return!1}function uB(e){const t=[],n=e.data,r=e;return r.data=np(n,t),r.attachments=t.length,{packet:r,buffers:t}}function np(e,t){if(!e)return e;if(Bm(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]=np(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]=np(e[r],t));return n}return e}function cB(e,t){return e.data=rp(e.data,t),delete e.attachments,e}function rp(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]=rp(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=rp(e[n],t));return e}const dB=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],fB=5;var ut;(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"})(ut||(ut={}));class hB{constructor(t){this.replacer=t}encode(t){return(t.type===ut.EVENT||t.type===ut.ACK)&&wc(t)?this.encodeAsBinary({type:t.type===ut.EVENT?ut.BINARY_EVENT:ut.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===ut.BINARY_EVENT||t.type===ut.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=uB(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function H9(e){return Object.prototype.toString.call(e)==="[object Object]"}class Mm extends Yt{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===ut.BINARY_EVENT;r||n.type===ut.BINARY_ACK?(n.type=r?ut.EVENT:ut.ACK,this.reconstructor=new pB(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Bm(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(ut[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===ut.BINARY_EVENT||r.type===ut.BINARY_ACK){const a=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const s=t.substring(a,n);if(s!=Number(s)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(s)}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 s=t.charAt(n);if(s==null||Number(s)!=s){--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(Mm.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 ut.CONNECT:return H9(n);case ut.DISCONNECT:return n===void 0;case ut.CONNECT_ERROR:return typeof n=="string"||H9(n);case ut.EVENT:case ut.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&dB.indexOf(n[0])===-1);case ut.ACK:case ut.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class pB{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=cB(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const mB=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Mm,Encoder:hB,get PacketType(){return ut},protocol:fB},Symbol.toStringTag,{value:"Module"}));function Ar(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const gB=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class A8 extends Yt{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=[Ar(t,"open",this.onopen.bind(this)),Ar(t,"packet",this.onpacket.bind(this)),Ar(t,"error",this.onerror.bind(this)),Ar(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(gB.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 s={type:ut.EVENT,data:n};if(s.options={},s.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const c=this.ids++,d=n.pop();this._registerAckCallback(c,d),s.id=c}const o=(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&&!o||(l?(this.notifyOutgoingListeners(s),this.packet(s)):this.sendBuffer.push(s)),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),s=(...o)=>{this.io.clearTimeoutFn(a),n.apply(this,o)};s.withError=!0,this.acks[t]=s}emitWithAck(t,...n){return new Promise((r,i)=>{const a=(s,o)=>s?i(s):r(o);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:ut.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 ut.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 ut.EVENT:case ut.BINARY_EVENT:this.onevent(t);break;case ut.ACK:case ut.BINARY_ACK:this.onack(t);break;case ut.DISCONNECT:this.ondisconnect();break;case ut.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:ut.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:ut.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 ao(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}ao.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};ao.prototype.reset=function(){this.attempts=0};ao.prototype.setMin=function(e){this.ms=e};ao.prototype.setMax=function(e){this.max=e};ao.prototype.setJitter=function(e){this.jitter=e};class ip extends Yt{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,O1(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 ao({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||mB;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 rB(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=Ar(n,"open",function(){r.onopen(),t&&t()}),a=o=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",o),t?t(o):this.maybeReconnectOnOpen()},s=Ar(n,"error",a);if(this._timeout!==!1){const o=this._timeout,l=this.setTimeoutFn(()=>{i(),a(new Error("timeout")),n.close()},o);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(s),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Ar(t,"ping",this.onping.bind(this)),Ar(t,"data",this.ondata.bind(this)),Ar(t,"error",this.onerror.bind(this)),Ar(t,"close",this.onclose.bind(this)),Ar(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){D1(()=>{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 A8(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 wo={};function Ac(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=iB(e,t.path||"/socket.io"),r=n.source,i=n.id,a=n.path,s=wo[i]&&a in wo[i].nsps,o=t.forceNew||t["force new connection"]||t.multiplex===!1||s;let l;return o?l=new ip(r,t):(wo[i]||(wo[i]=new ip(r,t)),l=wo[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(Ac,{Manager:ip,Socket:A8,io:Ac,connect:Ac});const U9=e=>{let t;const n=new Set,r=(c,d)=>{const f=typeof c=="function"?c(t):c;if(!Object.is(f,t)){const p=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(g=>g(t,p))}},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},S8=e=>e?U9(e):U9;function vB(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)})}}}function Vn(){return Vn=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},Vn.apply(this,arguments)}class yB extends Error{constructor(t){super(t),this.name=void 0,this.name="SuprSendError"}}function Ia(){return Math.round(Date.now())}function va(){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 Tn=S8()(()=>({apiUrl:"https://inboxs.live",collectorApiUrl:"https://hub.suprsend.com",socketUrl:"https://betainbox.suprsend.com",pageSize:20})),EB={unseenCount:0,stores:{},activeStoreId:null,pageNumber:1,hasNext:!0,initialLoading:!1,fetchMoreLoading:!1,initialFetchTime:null},lt=S8()(()=>EB);class bB{constructor(t){this.socket=void 0,this.config=void 0,this.config=t;const n=Tn.getState();this.socket=Ac(n.socketUrl,{transports:["websocket"],auth:{subscriber_id:this.config.subscriberId,distinct_id:this.config.distinctId,authorization:`${this.config.workspaceKey}:${va()}`,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=lt.getState();if(t.config.stores){let s=!1;for(let o of t.config.stores){const l=a.stores[o.storeId];t._notificationBelongToStore(i.data,o)&&(s=!0,l.notifications=t.orderNotifications(i.data,l.notifications),l.unseenCount+=1)}s&&(a.unseenCount+=1,t.config.emitter.emit("new_notification",i.data)),lt.setState({unseenCount:a.unseenCount,stores:Vn({},a.stores)})}else{if(!a.activeStoreId)return;let s=a.stores[a.activeStoreId];a.unseenCount+=1,s.unseenCount+=1,s.notifications=t.orderNotifications(i.data,s.notifications),lt.setState({unseenCount:a.unseenCount,stores:Vn({},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()]),s=lt.getState();let o=s.activeStoreId;if(a[0].status==="fulfilled"){var r;const u=await a[0].value.json(),c=u.data;if(!o)return;let d=s.stores[o];const f=(r=t.config.stores)==null?void 0:r.find(p=>p.storeId===o);if((n==null?void 0:n.type)==="archive"){var i;f!=null&&(i=f.query)!=null&&i.archived?t._notificationBelongToStore(c,f)&&(s.stores[o].notifications=[c,...d.notifications]):s.stores[o].notifications=d.notifications.filter(p=>p.n_id!==n.n_id)}else s.stores[o].notifications=d.notifications.map(p=>p.n_id===n.n_id?u.data:p);lt.setState({stores:Vn({},s.stores)})}if(a[1].status==="fulfilled"){const u=await a[1].value.json();lt.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:Vn({},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(){lt.setState({unseenCount:0}),t.config.emitter.emit("sync_notif_store")}),this.socket.on("mark_all_read",async function(){const n=lt.getState(),r=Ia();for(let i in n.stores){const a=n.stores[i];a.notifications.forEach(s=>{s.seen_on||(s.seen_on=r)}),a.unseenCount=0}lt.setState({stores:n.stores}),t.config.emitter.emit("sync_notif_store")})}_notificationBelongToStore(t,n){var r,i,a,s;const o=!!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,p=n==null||(a=n.query)==null?void 0:a.tags,g=n==null||(s=n.query)==null?void 0:s.categories,m=!d||o===d,y=!f||l===f;let v,b;return Array.isArray(p)&&p.length>0?p.forEach(T=>{u!=null&&u.includes(T)&&(v=!0)}):v=!0,Array.isArray(g)&&g.length>0?g.includes(c)&&(b=!0):b=!0,m&&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,s=n==null?void 0:n.archived;return{store_id:t.storeId,query:{read:a,archived:s,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}=Tn.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}:${va()}`}})}getNotifications(t,n,r=20,i){const{apiUrl:a}=Tn.getState();let s=`/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 o=this._getStoreQueryString(t);s+=`&store=${encodeURIComponent(JSON.stringify(o))}`}return fetch(`${a}${s}`,{method:"GET",headers:{Authorization:`${this.config.workspaceKey}:${va()}`}})}getNotificationDetails(t){const{apiUrl:n}=Tn.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}:${va()}`}})}markBellClicked(){const{apiUrl:t}=Tn.getState(),n="/bell-clicked/",r=JSON.stringify({time:Ia(),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}:${va()}`,"Content-Type":"application/json"}})}markAllRead(){const{apiUrl:t}=Tn.getState(),n="/mark-all-read/",r=JSON.stringify({time:Ia(),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}:${va()}`,"Content-Type":"application/json"}})}markNotificationClicked(t){const{collectorApiUrl:n}=Tn.getState(),r={event:"$notification_clicked",env:this.config.workspaceKey,$insert_id:va(),$time:Ia(),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}=Tn.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}=Tn.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}=Tn.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 z9=class{constructor(t){this.config=void 0,this.config=t}_overallFirstApiCall(){const t=lt.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=lt.getState(),a=Tn.getState(),s=i.activeStoreId;if(!s||!((t=i.stores)!=null&&t[s]))return;const o=i.stores[s],l=o.isFirstCall,u=i.initialFetchTime||Date.now(),c=(n=this.config.stores)==null?void 0:n.find(d=>d.storeId===s);try{if(!r||!i.hasNext)return;l?(lt.setState({initialLoading:!0}),this._overallFirstApiCall()&&this.getNotificationsCount()):i.pageNumber>1&&lt.setState({fetchMoreLoading:!0}),this.config.emitter.emit("sync_notif_store");const f=await(await r.getNotifications(c,i.pageNumber,a.pageSize,u)).json();let p;l||!l&&i.pageNumber===1?p=f.results:p=[...o.notifications,...f.results],i.stores[s].notifications=p,i.stores[s].isFirstCall=!1,lt.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),lt.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();lt.setState(i=>{for(let a in i.stores){const s=i.stores[a];s.unseenCount=r[a]||0}return{unseenCount:r.ss_bell_count,stores:Vn({},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=lt.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=Ia();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(p=>{p.n_id===l.n_id&&(p.seen_on=c,p.interacted_on=c,f.unseenCount>0&&(f.unseenCount-=1))})}lt.setState(Vn({},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(),lt.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=lt.getState(),r=Ia();for(let i in n.stores){const a=n.stores[i];a.notifications.forEach(s=>{s.seen_on||(s.seen_on=r)}),a.unseenCount=0}lt.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=lt.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=Ia();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(p=>{p.n_id===l.n_id&&(p.seen_on=c,f.unseenCount>0&&(f.unseenCount-=1))})}lt.setState(Vn({},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=lt.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))})}lt.setState(Vn({},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=lt.getState(),a=i.activeStoreId;if(!a||!((n=i.stores)!=null&&n[a]))return;const o=(i==null?void 0:i.stores)[a],l=o.notifications.find(u=>u.n_id===t);if(l&&!l.archived){if(!r)return;try{r.markNotificationArchive(t),o.notifications=o.notifications.filter(u=>u.n_id!==t),!l.seen_on&&o.unseenCount>0&&(o.unseenCount-=1),lt.setState(Vn({},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=lt.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 TB{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 z9(this),this.emitter=vB(),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 yB("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,s=[],o=[],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"?s=[i.tags]:Array.isArray(i==null?void 0:i.tags)&&(s=i==null?void 0:i.tags.filter(u=>typeof u=="string")),typeof(i==null?void 0:i.categories)=="string"?o=[i.categories]:Array.isArray(i==null?void 0:i.categories)&&(o=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:s,categories:o}})}),this.stores=n}_validatePageSize(t){if(t&&typeof t=="number"){const r=t<=50?t:50;Tn.setState({pageSize:r})}}_setConfigStoreState(t){t&&(t!=null&&t.socketHost&&Tn.setState({socketUrl:t.socketHost}),t!=null&&t.apiHost&&Tn.setState({apiUrl:t.apiHost}),t!=null&&t.collectorHost&&Tn.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]=Vn({},n)}),lt.setState({stores:r,activeStoreId:this.stores[0].storeId})}else lt.setState({stores:{[t]:Vn({},n)},activeStoreId:t});setTimeout(()=>{this.emitter.emit("sync_notif_store")},0)}_startExipryCheck(){var t=this;this._expiryTimerId||(this._expiryTimerId=setInterval(async function(){const r=lt.getState().stores;let i=!1;for(let a in r){let s=r[a].notifications;s=s.filter(o=>(o.expiry?Date.now()>o.expiry:!1)?(i=!0,!1):!0),r[a].notifications=s}i&&(lt.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 bB(this))),this._client}identifyUser(t,n){this.distinctId=t,this.subscriberId=n}changeActiveStore(t){var n;const r=lt.getState(),i={};if(r.activeStoreId!==t&&(n=r.stores)!=null&&n[t]){for(let a in r.stores){const s=r.stores[a],o=s.notifications.slice(0,20);i[a]={notifications:o,unseenCount:s.unseenCount,isFirstCall:s.isFirstCall}}lt.setState({activeStoreId:t,stores:i,pageNumber:1,hasNext:!0,initialLoading:!1,fetchMoreLoading:!1,initialFetchTime:null}),this.client&&this.feed.fetchNotifications()}}resetUser(){var t;lt.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 z9(this)}}var q9=function(t){return t.reduce(function(n,r){var i=r[0],a=r[1];return n[i]=a,n},{})},W9=typeof window<"u"&&window.document&&window.document.createElement?un.useLayoutEffect:un.useEffect,Rn="top",mr="bottom",gr="right",Fn="left",Lm="auto",Hl=[Rn,mr,gr,Fn],Ys="start",Ol="end",_B="clippingParents",k8="viewport",Ao="popper",CB="reference",V9=Hl.reduce(function(e,t){return e.concat([t+"-"+Ys,t+"-"+Ol])},[]),D8=[].concat(Hl,[Lm]).reduce(function(e,t){return e.concat([t,t+"-"+Ys,t+"-"+Ol])},[]),xB="beforeRead",wB="read",AB="afterRead",SB="beforeMain",kB="main",DB="afterMain",OB="beforeWrite",NB="write",IB="afterWrite",PB=[xB,wB,AB,SB,kB,DB,OB,NB,IB];function ti(e){return e?(e.nodeName||"").toLowerCase():null}function Qn(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Wa(e){var t=Qn(e).Element;return e instanceof t||e instanceof Element}function fr(e){var t=Qn(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function $m(e){if(typeof ShadowRoot>"u")return!1;var t=Qn(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function RB(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];!fr(a)||!ti(a)||(Object.assign(a.style,r),Object.keys(i).forEach(function(s){var o=i[s];o===!1?a.removeAttribute(s):a.setAttribute(s,o===!0?"":o)}))})}function FB(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]||{},s=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),o=s.reduce(function(l,u){return l[u]="",l},{});!fr(i)||!ti(i)||(Object.assign(i.style,o),Object.keys(a).forEach(function(l){i.removeAttribute(l)}))})}}const BB={name:"applyStyles",enabled:!0,phase:"write",fn:RB,effect:FB,requires:["computeStyles"]};function Gr(e){return e.split("-")[0]}var Ma=Math.max,r1=Math.min,Zs=Math.round;function ap(){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 O8(){return!/^((?!chrome|android).)*safari/i.test(ap())}function Qs(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,a=1;t&&fr(e)&&(i=e.offsetWidth>0&&Zs(r.width)/e.offsetWidth||1,a=e.offsetHeight>0&&Zs(r.height)/e.offsetHeight||1);var s=Wa(e)?Qn(e):window,o=s.visualViewport,l=!O8()&&n,u=(r.left+(l&&o?o.offsetLeft:0))/i,c=(r.top+(l&&o?o.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 jm(e){var t=Qs(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 N8(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&$m(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function xi(e){return Qn(e).getComputedStyle(e)}function MB(e){return["table","td","th"].indexOf(ti(e))>=0}function ca(e){return((Wa(e)?e.ownerDocument:e.document)||window.document).documentElement}function N1(e){return ti(e)==="html"?e:e.assignedSlot||e.parentNode||($m(e)?e.host:null)||ca(e)}function K9(e){return!fr(e)||xi(e).position==="fixed"?null:e.offsetParent}function LB(e){var t=/firefox/i.test(ap()),n=/Trident/i.test(ap());if(n&&fr(e)){var r=xi(e);if(r.position==="fixed")return null}var i=N1(e);for($m(i)&&(i=i.host);fr(i)&&["html","body"].indexOf(ti(i))<0;){var a=xi(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 Ul(e){for(var t=Qn(e),n=K9(e);n&&MB(n)&&xi(n).position==="static";)n=K9(n);return n&&(ti(n)==="html"||ti(n)==="body"&&xi(n).position==="static")?t:n||LB(e)||t}function Hm(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function sl(e,t,n){return Ma(e,r1(t,n))}function $B(e,t,n){var r=sl(e,t,n);return r>n?n:r}function I8(){return{top:0,right:0,bottom:0,left:0}}function P8(e){return Object.assign({},I8(),e)}function R8(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var jB=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,P8(typeof t!="number"?t:R8(t,Hl))};function HB(e){var t,n=e.state,r=e.name,i=e.options,a=n.elements.arrow,s=n.modifiersData.popperOffsets,o=Gr(n.placement),l=Hm(o),u=[Fn,gr].indexOf(o)>=0,c=u?"height":"width";if(!(!a||!s)){var d=jB(i.padding,n),f=jm(a),p=l==="y"?Rn:Fn,g=l==="y"?mr:gr,m=n.rects.reference[c]+n.rects.reference[l]-s[l]-n.rects.popper[c],y=s[l]-n.rects.reference[l],v=Ul(a),b=v?l==="y"?v.clientHeight||0:v.clientWidth||0:0,T=m/2-y/2,_=d[p],C=b-f[c]-d[g],A=b/2-f[c]/2+T,S=sl(_,A,C),I=l;n.modifiersData[r]=(t={},t[I]=S,t.centerOffset=S-A,t)}}function UB(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)||N8(t.elements.popper,i)&&(t.elements.arrow=i))}const zB={name:"arrow",enabled:!0,phase:"main",fn:HB,effect:UB,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Xs(e){return e.split("-")[1]}var qB={top:"auto",right:"auto",bottom:"auto",left:"auto"};function WB(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:Zs(n*i)/i||0,y:Zs(r*i)/i||0}}function G9(e){var t,n=e.popper,r=e.popperRect,i=e.placement,a=e.variation,s=e.offsets,o=e.position,l=e.gpuAcceleration,u=e.adaptive,c=e.roundOffsets,d=e.isFixed,f=s.x,p=f===void 0?0:f,g=s.y,m=g===void 0?0:g,y=typeof c=="function"?c({x:p,y:m}):{x:p,y:m};p=y.x,m=y.y;var v=s.hasOwnProperty("x"),b=s.hasOwnProperty("y"),T=Fn,_=Rn,C=window;if(u){var A=Ul(n),S="clientHeight",I="clientWidth";if(A===Qn(n)&&(A=ca(n),xi(A).position!=="static"&&o==="absolute"&&(S="scrollHeight",I="scrollWidth")),A=A,i===Rn||(i===Fn||i===gr)&&a===Ol){_=mr;var B=d&&A===C&&C.visualViewport?C.visualViewport.height:A[S];m-=B-r.height,m*=l?1:-1}if(i===Fn||(i===Rn||i===mr)&&a===Ol){T=gr;var F=d&&A===C&&C.visualViewport?C.visualViewport.width:A[I];p-=F-r.width,p*=l?1:-1}}var R=Object.assign({position:o},u&&qB),N=c===!0?WB({x:p,y:m},Qn(n)):{x:p,y:m};if(p=N.x,m=N.y,l){var k;return Object.assign({},R,(k={},k[_]=b?"0":"",k[T]=v?"0":"",k.transform=(C.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",k))}return Object.assign({},R,(t={},t[_]=b?m+"px":"",t[T]=v?p+"px":"",t.transform="",t))}function VB(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,a=n.adaptive,s=a===void 0?!0:a,o=n.roundOffsets,l=o===void 0?!0:o,u={placement:Gr(t.placement),variation:Xs(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,G9(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,G9(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 KB={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:VB,data:{}};var ku={passive:!0};function GB(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,a=i===void 0?!0:i,s=r.resize,o=s===void 0?!0:s,l=Qn(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&u.forEach(function(c){c.addEventListener("scroll",n.update,ku)}),o&&l.addEventListener("resize",n.update,ku),function(){a&&u.forEach(function(c){c.removeEventListener("scroll",n.update,ku)}),o&&l.removeEventListener("resize",n.update,ku)}}const YB={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:GB,data:{}};var ZB={left:"right",right:"left",bottom:"top",top:"bottom"};function Sc(e){return e.replace(/left|right|bottom|top/g,function(t){return ZB[t]})}var QB={start:"end",end:"start"};function Y9(e){return e.replace(/start|end/g,function(t){return QB[t]})}function Um(e){var t=Qn(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function zm(e){return Qs(ca(e)).left+Um(e).scrollLeft}function XB(e,t){var n=Qn(e),r=ca(e),i=n.visualViewport,a=r.clientWidth,s=r.clientHeight,o=0,l=0;if(i){a=i.width,s=i.height;var u=O8();(u||!u&&t==="fixed")&&(o=i.offsetLeft,l=i.offsetTop)}return{width:a,height:s,x:o+zm(e),y:l}}function JB(e){var t,n=ca(e),r=Um(e),i=(t=e.ownerDocument)==null?void 0:t.body,a=Ma(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=Ma(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),o=-r.scrollLeft+zm(e),l=-r.scrollTop;return xi(i||n).direction==="rtl"&&(o+=Ma(n.clientWidth,i?i.clientWidth:0)-a),{width:a,height:s,x:o,y:l}}function qm(e){var t=xi(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function F8(e){return["html","body","#document"].indexOf(ti(e))>=0?e.ownerDocument.body:fr(e)&&qm(e)?e:F8(N1(e))}function ol(e,t){var n;t===void 0&&(t=[]);var r=F8(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),a=Qn(r),s=i?[a].concat(a.visualViewport||[],qm(r)?r:[]):r,o=t.concat(s);return i?o:o.concat(ol(N1(s)))}function sp(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function eM(e,t){var n=Qs(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 Z9(e,t,n){return t===k8?sp(XB(e,n)):Wa(t)?eM(t,n):sp(JB(ca(e)))}function tM(e){var t=ol(N1(e)),n=["absolute","fixed"].indexOf(xi(e).position)>=0,r=n&&fr(e)?Ul(e):e;return Wa(r)?t.filter(function(i){return Wa(i)&&N8(i,r)&&ti(i)!=="body"}):[]}function nM(e,t,n,r){var i=t==="clippingParents"?tM(e):[].concat(t),a=[].concat(i,[n]),s=a[0],o=a.reduce(function(l,u){var c=Z9(e,u,r);return l.top=Ma(c.top,l.top),l.right=r1(c.right,l.right),l.bottom=r1(c.bottom,l.bottom),l.left=Ma(c.left,l.left),l},Z9(e,s,r));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function B8(e){var t=e.reference,n=e.element,r=e.placement,i=r?Gr(r):null,a=r?Xs(r):null,s=t.x+t.width/2-n.width/2,o=t.y+t.height/2-n.height/2,l;switch(i){case Rn:l={x:s,y:t.y-n.height};break;case mr:l={x:s,y:t.y+t.height};break;case gr:l={x:t.x+t.width,y:o};break;case Fn:l={x:t.x-n.width,y:o};break;default:l={x:t.x,y:t.y}}var u=i?Hm(i):null;if(u!=null){var c=u==="y"?"height":"width";switch(a){case Ys:l[u]=l[u]-(t[c]/2-n[c]/2);break;case Ol:l[u]=l[u]+(t[c]/2-n[c]/2);break}}return l}function Nl(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,a=n.strategy,s=a===void 0?e.strategy:a,o=n.boundary,l=o===void 0?_B:o,u=n.rootBoundary,c=u===void 0?k8:u,d=n.elementContext,f=d===void 0?Ao:d,p=n.altBoundary,g=p===void 0?!1:p,m=n.padding,y=m===void 0?0:m,v=P8(typeof y!="number"?y:R8(y,Hl)),b=f===Ao?CB:Ao,T=e.rects.popper,_=e.elements[g?b:f],C=nM(Wa(_)?_:_.contextElement||ca(e.elements.popper),l,c,s),A=Qs(e.elements.reference),S=B8({reference:A,element:T,strategy:"absolute",placement:i}),I=sp(Object.assign({},T,S)),B=f===Ao?I:A,F={top:C.top-B.top+v.top,bottom:B.bottom-C.bottom+v.bottom,left:C.left-B.left+v.left,right:B.right-C.right+v.right},R=e.modifiersData.offset;if(f===Ao&&R){var N=R[i];Object.keys(F).forEach(function(k){var M=[gr,mr].indexOf(k)>=0?1:-1,$=[Rn,mr].indexOf(k)>=0?"y":"x";F[k]+=N[$]*M})}return F}function rM(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,a=n.rootBoundary,s=n.padding,o=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?D8:l,c=Xs(r),d=c?o?V9:V9.filter(function(g){return Xs(g)===c}):Hl,f=d.filter(function(g){return u.indexOf(g)>=0});f.length===0&&(f=d);var p=f.reduce(function(g,m){return g[m]=Nl(e,{placement:m,boundary:i,rootBoundary:a,padding:s})[Gr(m)],g},{});return Object.keys(p).sort(function(g,m){return p[g]-p[m]})}function iM(e){if(Gr(e)===Lm)return[];var t=Sc(e);return[Y9(e),t,Y9(t)]}function aM(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,s=n.altAxis,o=s===void 0?!0:s,l=n.fallbackPlacements,u=n.padding,c=n.boundary,d=n.rootBoundary,f=n.altBoundary,p=n.flipVariations,g=p===void 0?!0:p,m=n.allowedAutoPlacements,y=t.options.placement,v=Gr(y),b=v===y,T=l||(b||!g?[Sc(y)]:iM(y)),_=[y].concat(T).reduce(function(H,j){return H.concat(Gr(j)===Lm?rM(t,{placement:j,boundary:c,rootBoundary:d,padding:u,flipVariations:g,allowedAutoPlacements:m}):j)},[]),C=t.rects.reference,A=t.rects.popper,S=new Map,I=!0,B=_[0],F=0;F<_.length;F++){var R=_[F],N=Gr(R),k=Xs(R)===Ys,M=[Rn,mr].indexOf(N)>=0,$=M?"width":"height",z=Nl(t,{placement:R,boundary:c,rootBoundary:d,altBoundary:f,padding:u}),P=M?k?gr:Fn:k?mr:Rn;C[$]>A[$]&&(P=Sc(P));var te=Sc(P),ee=[];if(a&&ee.push(z[N]<=0),o&&ee.push(z[P]<=0,z[te]<=0),ee.every(function(H){return H})){B=R,I=!1;break}S.set(R,ee)}if(I)for(var D=g?3:1,x=function(j){var U=_.find(function(Q){var ie=S.get(Q);if(ie)return ie.slice(0,j).every(function(J){return J})});if(U)return B=U,"break"},V=D;V>0;V--){var L=x(V);if(L==="break")break}t.placement!==B&&(t.modifiersData[r]._skip=!0,t.placement=B,t.reset=!0)}}const sM={name:"flip",enabled:!0,phase:"main",fn:aM,requiresIfExists:["offset"],data:{_skip:!1}};function Q9(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 X9(e){return[Rn,gr,mr,Fn].some(function(t){return e[t]>=0})}function oM(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,a=t.modifiersData.preventOverflow,s=Nl(t,{elementContext:"reference"}),o=Nl(t,{altBoundary:!0}),l=Q9(s,r),u=Q9(o,i,a),c=X9(l),d=X9(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 lM={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:oM};function uM(e,t,n){var r=Gr(e),i=[Fn,Rn].indexOf(r)>=0?-1:1,a=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,s=a[0],o=a[1];return s=s||0,o=(o||0)*i,[Fn,gr].indexOf(r)>=0?{x:o,y:s}:{x:s,y:o}}function cM(e){var t=e.state,n=e.options,r=e.name,i=n.offset,a=i===void 0?[0,0]:i,s=D8.reduce(function(c,d){return c[d]=uM(d,t.rects,a),c},{}),o=s[t.placement],l=o.x,u=o.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=s}const dM={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:cM};function fM(e){var t=e.state,n=e.name;t.modifiersData[n]=B8({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const hM={name:"popperOffsets",enabled:!0,phase:"read",fn:fM,data:{}};function pM(e){return e==="x"?"y":"x"}function mM(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,a=i===void 0?!0:i,s=n.altAxis,o=s===void 0?!1:s,l=n.boundary,u=n.rootBoundary,c=n.altBoundary,d=n.padding,f=n.tether,p=f===void 0?!0:f,g=n.tetherOffset,m=g===void 0?0:g,y=Nl(t,{boundary:l,rootBoundary:u,padding:d,altBoundary:c}),v=Gr(t.placement),b=Xs(t.placement),T=!b,_=Hm(v),C=pM(_),A=t.modifiersData.popperOffsets,S=t.rects.reference,I=t.rects.popper,B=typeof m=="function"?m(Object.assign({},t.rects,{placement:t.placement})):m,F=typeof B=="number"?{mainAxis:B,altAxis:B}:Object.assign({mainAxis:0,altAxis:0},B),R=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,N={x:0,y:0};if(A){if(a){var k,M=_==="y"?Rn:Fn,$=_==="y"?mr:gr,z=_==="y"?"height":"width",P=A[_],te=P+y[M],ee=P-y[$],D=p?-I[z]/2:0,x=b===Ys?S[z]:I[z],V=b===Ys?-I[z]:-S[z],L=t.elements.arrow,H=p&&L?jm(L):{width:0,height:0},j=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:I8(),U=j[M],Q=j[$],ie=sl(0,S[z],H[z]),J=T?S[z]/2-D-ie-U-F.mainAxis:x-ie-U-F.mainAxis,W=T?-S[z]/2+D+ie+Q+F.mainAxis:V+ie+Q+F.mainAxis,ae=t.elements.arrow&&Ul(t.elements.arrow),oe=ae?_==="y"?ae.clientTop||0:ae.clientLeft||0:0,be=(k=R==null?void 0:R[_])!=null?k:0,we=P+J-be-oe,He=P+W-be,Be=sl(p?r1(te,we):te,P,p?Ma(ee,He):ee);A[_]=Be,N[_]=Be-P}if(o){var $e,Ye=_==="x"?Rn:Fn,qe=_==="x"?mr:gr,Je=A[C],rt=C==="y"?"height":"width",pe=Je+y[Ye],ce=Je-y[qe],me=[Rn,Fn].indexOf(v)!==-1,X=($e=R==null?void 0:R[C])!=null?$e:0,he=me?pe:Je-S[rt]-I[rt]-X+F.altAxis,Se=me?Je+S[rt]+I[rt]-X-F.altAxis:ce,Oe=p&&me?$B(he,Je,Se):sl(p?he:pe,Je,p?Se:ce);A[C]=Oe,N[C]=Oe-Je}t.modifiersData[r]=N}}const gM={name:"preventOverflow",enabled:!0,phase:"main",fn:mM,requiresIfExists:["offset"]};function vM(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function yM(e){return e===Qn(e)||!fr(e)?Um(e):vM(e)}function EM(e){var t=e.getBoundingClientRect(),n=Zs(t.width)/e.offsetWidth||1,r=Zs(t.height)/e.offsetHeight||1;return n!==1||r!==1}function bM(e,t,n){n===void 0&&(n=!1);var r=fr(t),i=fr(t)&&EM(t),a=ca(t),s=Qs(e,i,n),o={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((ti(t)!=="body"||qm(a))&&(o=yM(t)),fr(t)?(l=Qs(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):a&&(l.x=zm(a))),{x:s.left+o.scrollLeft-l.x,y:s.top+o.scrollTop-l.y,width:s.width,height:s.height}}function TM(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 s=[].concat(a.requires||[],a.requiresIfExists||[]);s.forEach(function(o){if(!n.has(o)){var l=t.get(o);l&&i(l)}}),r.push(a)}return e.forEach(function(a){n.has(a.name)||i(a)}),r}function _M(e){var t=TM(e);return PB.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function CM(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function xM(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 J9={placement:"bottom",modifiers:[],strategy:"absolute"};function e5(){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 wM(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,i=t.defaultOptions,a=i===void 0?J9:i;return function(o,l,u){u===void 0&&(u=a);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},J9,a),modifiersData:{},elements:{reference:o,popper:l},attributes:{},styles:{}},d=[],f=!1,p={state:c,setOptions:function(v){var b=typeof v=="function"?v(c.options):v;m(),c.options=Object.assign({},a,c.options,b),c.scrollParents={reference:Wa(o)?ol(o):o.contextElement?ol(o.contextElement):[],popper:ol(l)};var T=_M(xM([].concat(r,c.options.modifiers)));return c.orderedModifiers=T.filter(function(_){return _.enabled}),g(),p.update()},forceUpdate:function(){if(!f){var v=c.elements,b=v.reference,T=v.popper;if(e5(b,T)){c.rects={reference:bM(b,Ul(T),c.options.strategy==="fixed"),popper:jm(T)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(F){return c.modifiersData[F.name]=Object.assign({},F.data)});for(var _=0;_<c.orderedModifiers.length;_++){if(c.reset===!0){c.reset=!1,_=-1;continue}var C=c.orderedModifiers[_],A=C.fn,S=C.options,I=S===void 0?{}:S,B=C.name;typeof A=="function"&&(c=A({state:c,options:I,name:B,instance:p})||c)}}}},update:CM(function(){return new Promise(function(y){p.forceUpdate(),y(c)})}),destroy:function(){m(),f=!0}};if(!e5(o,l))return p;p.setOptions(u).then(function(y){!f&&u.onFirstUpdate&&u.onFirstUpdate(y)});function g(){c.orderedModifiers.forEach(function(y){var v=y.name,b=y.options,T=b===void 0?{}:b,_=y.effect;if(typeof _=="function"){var C=_({state:c,name:v,instance:p,options:T}),A=function(){};d.push(C||A)}})}function m(){d.forEach(function(y){return y()}),d=[]}return p}}var AM=[YB,hM,KB,BB,dM,sM,gM,zB,lM],SM=wM({defaultModifiers:AM}),kM=typeof Element<"u",DM=typeof Map=="function",OM=typeof Set=="function",NM=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function kc(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(!kc(e[r],t[r]))return!1;return!0}var a;if(DM&&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(!kc(r.value[1],t.get(r.value[0])))return!1;return!0}if(OM&&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(NM&&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(kM&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((i[r]==="_owner"||i[r]==="__v"||i[r]==="__o")&&e.$$typeof)&&!kc(e[i[r]],t[i[r]]))return!1;return!0}return e!==e&&t!==t}var IM=function(t,n){try{return kc(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 PM=Or(IM);var RM=[],FM=function(t,n,r){r===void 0&&(r={});var i=un.useRef(null),a={onFirstUpdate:r.onFirstUpdate,placement:r.placement||"bottom",strategy:r.strategy||"absolute",modifiers:r.modifiers||RM},s=un.useState({styles:{popper:{position:a.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),o=s[0],l=s[1],u=un.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(p){var g=p.state,m=Object.keys(g.elements);cx.flushSync(function(){l({styles:q9(m.map(function(y){return[y,g.styles[y]||{}]})),attributes:q9(m.map(function(y){return[y,g.attributes[y]]}))})})},requires:["computeStyles"]}},[]),c=un.useMemo(function(){var f={onFirstUpdate:a.onFirstUpdate,placement:a.placement,strategy:a.strategy,modifiers:[].concat(a.modifiers,[u,{name:"applyStyles",enabled:!1}])};return PM(i.current,f)?i.current||f:(i.current=f,f)},[a.onFirstUpdate,a.placement,a.strategy,a.modifiers,u]),d=un.useRef();return W9(function(){d.current&&d.current.setOptions(c)},[c]),W9(function(){if(!(t==null||n==null)){var f=r.createPopper||SM,p=f(t,n,c);return d.current=p,function(){p.destroy(),d.current=null}}},[t,n,r.createPopper]),{state:d.current?d.current.state:null,styles:o.styles,attributes:o.attributes,update:d.current?d.current.update:null,forceUpdate:d.current?d.current.forceUpdate:null}};function op(){return op=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},op.apply(this,arguments)}function M8(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var BM=/^((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)-.*))$/,MM=M8(function(e){return BM.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),LM=!1;function $M(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 jM(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 HM=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?!LM: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(jM(this));var i=this.tags[this.tags.length-1];if(this.isSpeedy){var a=$M(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}(),fn="-ms-",i1="-moz-",vt="-webkit-",L8="comm",Wm="rule",Vm="decl",UM="@import",$8="@keyframes",zM="@layer",qM=Math.abs,I1=String.fromCharCode,WM=Object.assign;function VM(e,t){return ln(e,0)^45?(((t<<2^ln(e,0))<<2^ln(e,1))<<2^ln(e,2))<<2^ln(e,3):0}function j8(e){return e.trim()}function KM(e,t){return(e=t.exec(e))?e[0]:e}function yt(e,t,n){return e.replace(t,n)}function lp(e,t){return e.indexOf(t)}function ln(e,t){return e.charCodeAt(t)|0}function Il(e,t,n){return e.slice(t,n)}function jr(e){return e.length}function Km(e){return e.length}function Du(e,t){return t.push(e),e}function GM(e,t){return e.map(t).join("")}var P1=1,Js=1,H8=0,Mn=0,Gt=0,so="";function R1(e,t,n,r,i,a,s){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:P1,column:Js,length:s,return:""}}function So(e,t){return WM(R1("",null,null,"",null,null,0),e,{length:-e.length},t)}function YM(){return Gt}function ZM(){return Gt=Mn>0?ln(so,--Mn):0,Js--,Gt===10&&(Js=1,P1--),Gt}function Gn(){return Gt=Mn<H8?ln(so,Mn++):0,Js++,Gt===10&&(Js=1,P1++),Gt}function Yr(){return ln(so,Mn)}function Dc(){return Mn}function zl(e,t){return Il(so,e,t)}function Pl(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 U8(e){return P1=Js=1,H8=jr(so=e),Mn=0,[]}function z8(e){return so="",e}function Oc(e){return j8(zl(Mn-1,up(e===91?e+2:e===40?e+1:e)))}function QM(e){for(;(Gt=Yr())&&Gt<33;)Gn();return Pl(e)>2||Pl(Gt)>3?"":" "}function XM(e,t){for(;--t&&Gn()&&!(Gt<48||Gt>102||Gt>57&&Gt<65||Gt>70&&Gt<97););return zl(e,Dc()+(t<6&&Yr()==32&&Gn()==32))}function up(e){for(;Gn();)switch(Gt){case e:return Mn;case 34:case 39:e!==34&&e!==39&&up(Gt);break;case 40:e===41&&up(e);break;case 92:Gn();break}return Mn}function JM(e,t){for(;Gn()&&e+Gt!==47+10;)if(e+Gt===42+42&&Yr()===47)break;return"/*"+zl(t,Mn-1)+"*"+I1(e===47?e:Gn())}function eL(e){for(;!Pl(Yr());)Gn();return zl(e,Mn)}function tL(e){return z8(Nc("",null,null,null,[""],e=U8(e),0,[0],e))}function Nc(e,t,n,r,i,a,s,o,l){for(var u=0,c=0,d=s,f=0,p=0,g=0,m=1,y=1,v=1,b=0,T="",_=i,C=a,A=r,S=T;y;)switch(g=b,b=Gn()){case 40:if(g!=108&&ln(S,d-1)==58){lp(S+=yt(Oc(b),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:S+=Oc(b);break;case 9:case 10:case 13:case 32:S+=QM(g);break;case 92:S+=XM(Dc()-1,7);continue;case 47:switch(Yr()){case 42:case 47:Du(nL(JM(Gn(),Dc()),t,n),l);break;default:S+="/"}break;case 123*m:o[u++]=jr(S)*v;case 125*m:case 59:case 0:switch(b){case 0:case 125:y=0;case 59+c:v==-1&&(S=yt(S,/\f/g,"")),p>0&&jr(S)-d&&Du(p>32?n5(S+";",r,n,d-1):n5(yt(S," ","")+";",r,n,d-2),l);break;case 59:S+=";";default:if(Du(A=t5(S,t,n,u,c,i,o,T,_=[],C=[],d),a),b===123)if(c===0)Nc(S,t,A,A,_,a,d,o,C);else switch(f===99&&ln(S,3)===110?100:f){case 100:case 108:case 109:case 115:Nc(e,A,A,r&&Du(t5(e,A,A,0,0,i,o,T,i,_=[],d),C),i,C,d,o,r?_:C);break;default:Nc(S,A,A,A,[""],C,0,o,C)}}u=c=p=0,m=v=1,T=S="",d=s;break;case 58:d=1+jr(S),p=g;default:if(m<1){if(b==123)--m;else if(b==125&&m++==0&&ZM()==125)continue}switch(S+=I1(b),b*m){case 38:v=c>0?1:(S+="\f",-1);break;case 44:o[u++]=(jr(S)-1)*v,v=1;break;case 64:Yr()===45&&(S+=Oc(Gn())),f=Yr(),c=d=jr(T=S+=eL(Dc())),b++;break;case 45:g===45&&jr(S)==2&&(m=0)}}return a}function t5(e,t,n,r,i,a,s,o,l,u,c){for(var d=i-1,f=i===0?a:[""],p=Km(f),g=0,m=0,y=0;g<r;++g)for(var v=0,b=Il(e,d+1,d=qM(m=s[g])),T=e;v<p;++v)(T=j8(m>0?f[v]+" "+b:yt(b,/&\f/g,f[v])))&&(l[y++]=T);return R1(e,t,n,i===0?Wm:o,l,u,c)}function nL(e,t,n){return R1(e,t,n,L8,I1(YM()),Il(e,2,-2),0)}function n5(e,t,n,r){return R1(e,t,n,Vm,Il(e,0,r),Il(e,r+1,-1),r)}function Fs(e,t){for(var n="",r=Km(e),i=0;i<r;i++)n+=t(e[i],i,e,t)||"";return n}function rL(e,t,n,r){switch(e.type){case zM:if(e.children.length)break;case UM:case Vm:return e.return=e.return||e.value;case L8:return"";case $8:return e.return=e.value+"{"+Fs(e.children,r)+"}";case Wm:e.value=e.props.join(",")}return jr(n=Fs(e.children,r))?e.return=e.value+"{"+n+"}":""}function iL(e){var t=Km(e);return function(n,r,i,a){for(var s="",o=0;o<t;o++)s+=e[o](n,r,i,a)||"";return s}}function aL(e){return function(t){t.root||(t=t.return)&&e(t)}}var sL=function(t,n,r){for(var i=0,a=0;i=a,a=Yr(),i===38&&a===12&&(n[r]=1),!Pl(a);)Gn();return zl(t,Mn)},oL=function(t,n){var r=-1,i=44;do switch(Pl(i)){case 0:i===38&&Yr()===12&&(n[r]=1),t[r]+=sL(Mn-1,n,r);break;case 2:t[r]+=Oc(i);break;case 4:if(i===44){t[++r]=Yr()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=I1(i)}while(i=Gn());return t},lL=function(t,n){return z8(oL(U8(t),n))},r5=new WeakMap,uL=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&&!r5.get(r))&&!i){r5.set(t,!0);for(var a=[],s=lL(n,a),o=r.props,l=0,u=0;l<s.length;l++)for(var c=0;c<o.length;c++,u++)t.props[u]=a[l]?s[l].replace(/&\f/g,o[c]):o[c]+" "+s[l]}}},cL=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function q8(e,t){switch(VM(e,t)){case 5103:return vt+"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 vt+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return vt+e+i1+e+fn+e+e;case 6828:case 4268:return vt+e+fn+e+e;case 6165:return vt+e+fn+"flex-"+e+e;case 5187:return vt+e+yt(e,/(\w+).+(:[^]+)/,vt+"box-$1$2"+fn+"flex-$1$2")+e;case 5443:return vt+e+fn+"flex-item-"+yt(e,/flex-|-self/,"")+e;case 4675:return vt+e+fn+"flex-line-pack"+yt(e,/align-content|flex-|-self/,"")+e;case 5548:return vt+e+fn+yt(e,"shrink","negative")+e;case 5292:return vt+e+fn+yt(e,"basis","preferred-size")+e;case 6060:return vt+"box-"+yt(e,"-grow","")+vt+e+fn+yt(e,"grow","positive")+e;case 4554:return vt+yt(e,/([^-])(transform)/g,"$1"+vt+"$2")+e;case 6187:return yt(yt(yt(e,/(zoom-|grab)/,vt+"$1"),/(image-set)/,vt+"$1"),e,"")+e;case 5495:case 3959:return yt(e,/(image-set\([^]*)/,vt+"$1$`$1");case 4968:return yt(yt(e,/(.+:)(flex-)?(.*)/,vt+"box-pack:$3"+fn+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+vt+e+e;case 4095:case 3583:case 4068:case 2532:return yt(e,/(.+)-inline(.+)/,vt+"$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(jr(e)-1-t>6)switch(ln(e,t+1)){case 109:if(ln(e,t+4)!==45)break;case 102:return yt(e,/(.+:)(.+)-([^]+)/,"$1"+vt+"$2-$3$1"+i1+(ln(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~lp(e,"stretch")?q8(yt(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(ln(e,t+1)!==115)break;case 6444:switch(ln(e,jr(e)-3-(~lp(e,"!important")&&10))){case 107:return yt(e,":",":"+vt)+e;case 101:return yt(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+vt+(ln(e,14)===45?"inline-":"")+"box$3$1"+vt+"$2$3$1"+fn+"$2box$3")+e}break;case 5936:switch(ln(e,t+11)){case 114:return vt+e+fn+yt(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return vt+e+fn+yt(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return vt+e+fn+yt(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return vt+e+fn+e+e}return e}var dL=function(t,n,r,i){if(t.length>-1&&!t.return)switch(t.type){case Vm:t.return=q8(t.value,t.length);break;case $8:return Fs([So(t,{value:yt(t.value,"@","@"+vt)})],i);case Wm:if(t.length)return GM(t.props,function(a){switch(KM(a,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Fs([So(t,{props:[yt(a,/:(read-\w+)/,":"+i1+"$1")]})],i);case"::placeholder":return Fs([So(t,{props:[yt(a,/:(plac\w+)/,":"+vt+"input-$1")]}),So(t,{props:[yt(a,/:(plac\w+)/,":"+i1+"$1")]}),So(t,{props:[yt(a,/:(plac\w+)/,fn+"input-$1")]})],i)}return""})}},fL=[dL],hL=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(m){var y=m.getAttribute("data-emotion");y.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var i=t.stylisPlugins||fL,a={},s,o=[];s=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(m){for(var y=m.getAttribute("data-emotion").split(" "),v=1;v<y.length;v++)a[y[v]]=!0;o.push(m)});var l,u=[uL,cL];{var c,d=[rL,aL(function(m){c.insert(m)})],f=iL(u.concat(i,d)),p=function(y){return Fs(tL(y),f)};l=function(y,v,b,T){c=b,p(y?y+"{"+v.styles+"}":v.styles),T&&(g.inserted[v.name]=!0)}}var g={key:n,sheet:new HM({key:n,container:s,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:a,registered:{},insert:l};return g.sheet.hydrate(o),g},W8=Up(),pL={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},mL={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},V8={};V8[W8.ForwardRef]=pL;V8[W8.Memo]=mL;var gL=!0;function vL(e,t,n){var r="";return n.split(" ").forEach(function(i){e[i]!==void 0?t.push(e[i]+";"):i&&(r+=i+" ")}),r}var K8=function(t,n,r){var i=t.key+"-"+n.name;(r===!1||gL===!1)&&t.registered[i]===void 0&&(t.registered[i]=n.styles)},yL=function(t,n,r){K8(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 EL(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 bL={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},TL=!1,_L=/[A-Z]|^ms/g,CL=/_EMO_([^_]+?)_([^]*?)_EMO_/g,G8=function(t){return t.charCodeAt(1)===45},i5=function(t){return t!=null&&typeof t!="boolean"},of=M8(function(e){return G8(e)?e:e.replace(_L,"-$&").toLowerCase()}),a5=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(CL,function(r,i,a){return Hr={name:i,styles:a,next:Hr},i})}return bL[t]!==1&&!G8(t)&&typeof n=="number"&&n!==0?n+"px":n},xL="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function Rl(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 Hr={name:i.name,styles:i.styles,next:Hr},i.name;var a=n;if(a.styles!==void 0){var s=a.next;if(s!==void 0)for(;s!==void 0;)Hr={name:s.name,styles:s.styles,next:Hr},s=s.next;var o=a.styles+";";return o}return wL(e,t,n)}case"function":{if(e!==void 0){var l=Hr,u=n(e);return Hr=l,Rl(e,t,u)}break}}var c=n;if(t==null)return c;var d=t[c];return d!==void 0?d:c}function wL(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=Rl(e,t,n[i])+";";else for(var a in n){var s=n[a];if(typeof s!="object"){var o=s;t!=null&&t[o]!==void 0?r+=a+"{"+t[o]+"}":i5(o)&&(r+=of(a)+":"+a5(a,o)+";")}else{if(a==="NO_COMPONENT_SELECTOR"&&TL)throw new Error(xL);if(Array.isArray(s)&&typeof s[0]=="string"&&(t==null||t[s[0]]===void 0))for(var l=0;l<s.length;l++)i5(s[l])&&(r+=of(a)+":"+a5(a,s[l])+";");else{var u=Rl(e,t,s);switch(a){case"animation":case"animationName":{r+=of(a)+":"+u+";";break}default:r+=a+"{"+u+"}"}}}}return r}var s5=/label:\s*([^\s;{]+)\s*(;|$)/g,Hr;function Y8(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="";Hr=void 0;var a=e[0];if(a==null||a.raw===void 0)r=!1,i+=Rl(n,t,a);else{var s=a;i+=s[0]}for(var o=1;o<e.length;o++)if(i+=Rl(n,t,e[o]),r){var l=a;i+=l[o]}s5.lastIndex=0;for(var u="",c;(c=s5.exec(i))!==null;)u+="-"+c[1];var d=EL(i)+u;return{name:d,styles:i,next:Hr}}var AL=function(t){return t()},SL=un["useInsertionEffect"]?un["useInsertionEffect"]:!1,kL=SL||AL,Z8=un.createContext(typeof HTMLElement<"u"?hL({key:"css"}):null);Z8.Provider;var DL=function(t){return E.forwardRef(function(n,r){var i=E.useContext(Z8);return t(n,i,r)})},OL=un.createContext({});function NL(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Y8(t)}var IL=function(){var t=NL.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_"}}},PL=MM,RL=function(t){return t!=="theme"},o5=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?PL:RL},l5=function(t,n,r){var i;if(n){var a=n.shouldForwardProp;i=t.__emotion_forwardProp&&a?function(s){return t.__emotion_forwardProp(s)&&a(s)}:a}return typeof i!="function"&&r&&(i=t.__emotion_forwardProp),i},FL=!1,BL=function(t){var n=t.cache,r=t.serialized,i=t.isStringTag;return K8(n,r,i),kL(function(){return yL(n,r,i)}),null},ML=function e(t,n){var r=t.__emotion_real===t,i=r&&t.__emotion_base||t,a,s;n!==void 0&&(a=n.label,s=n.target);var o=l5(t,n,r),l=o||o5(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,p=1;p<f;p++)d.push(c[p],c[0][p])}var g=DL(function(m,y,v){var b=u&&m.as||i,T="",_=[],C=m;if(m.theme==null){C={};for(var A in m)C[A]=m[A];C.theme=un.useContext(OL)}typeof m.className=="string"?T=vL(y.registered,_,m.className):m.className!=null&&(T=m.className+" ");var S=Y8(d.concat(_),y.registered,C);T+=y.key+"-"+S.name,s!==void 0&&(T+=" "+s);var I=u&&o===void 0?o5(b):l,B={};for(var F in m)u&&F==="as"||I(F)&&(B[F]=m[F]);return B.className=T,v&&(B.ref=v),un.createElement(un.Fragment,null,un.createElement(BL,{cache:y,serialized:S,isStringTag:typeof b=="string"}),un.createElement(b,B))});return g.displayName=a!==void 0?a:"Styled("+(typeof i=="string"?i:i.displayName||i.name||"Component")+")",g.defaultProps=t.defaultProps,g.__emotion_real=g,g.__emotion_base=i,g.__emotion_styles=d,g.__emotion_forwardProp=o,Object.defineProperty(g,"toString",{value:function(){return s===void 0&&FL?"NO_COMPONENT_SELECTOR":"."+s}}),g.withComponent=function(m,y){return e(m,op({},n,y,{shouldForwardProp:l5(g,y,!0)})).apply(void 0,d)},g}},LL=["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"],Ie=ML.bind();LL.forEach(function(e){Ie[e]=Ie(e)});var us={}.hasOwnProperty,Q8=$L;function $L(e){return!e||typeof e!="object"?"":us.call(e,"position")||us.call(e,"type")?u5(e.position):us.call(e,"start")||us.call(e,"end")?u5(e):us.call(e,"line")||us.call(e,"column")?cp(e):""}function cp(e){return(!e||typeof e!="object")&&(e={}),c5(e.line)+":"+c5(e.column)}function u5(e){return(!e||typeof e!="object")&&(e={}),cp(e.start)+"-"+cp(e.end)}function c5(e){return e&&typeof e=="number"?e:1}var jL=Q8,HL=Gm;function X8(){}X8.prototype=Error.prototype;Gm.prototype=new X8;var da=Gm.prototype;da.file="";da.name="";da.reason="";da.message="";da.stack="";da.fatal=null;da.column=null;da.line=null;function Gm(e,t,n){var r,i,a;typeof t=="string"&&(n=t,t=null),r=UL(n),i=jL(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 UL(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 oo={};oo.basename=zL;oo.dirname=qL;oo.extname=WL;oo.join=VL;oo.sep="/";function zL(e,t){var n=0,r=-1,i,a,s,o;if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');if(ql(e),i=e.length,t===void 0||!t.length||t.length>e.length){for(;i--;)if(e.charCodeAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";for(a=-1,o=t.length-1;i--;)if(e.charCodeAt(i)===47){if(s){n=i+1;break}}else a<0&&(s=!0,a=i+1),o>-1&&(e.charCodeAt(i)===t.charCodeAt(o--)?o<0&&(r=i):(o=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function qL(e){var t,n,r;if(ql(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 WL(e){var t=-1,n=0,r=-1,i=0,a,s,o;for(ql(e),o=e.length;o--;){if(s=e.charCodeAt(o),s===47){if(a){n=o+1;break}continue}r<0&&(a=!0,r=o+1),s===46?t<0?t=o: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 VL(){for(var e=-1,t;++e<arguments.length;)ql(arguments[e]),arguments[e]&&(t=t===void 0?arguments[e]:t+"/"+arguments[e]);return t===void 0?".":KL(t)}function KL(e){var t,n;return ql(e),t=e.charCodeAt(0)===47,n=GL(e,!t),!n.length&&!t&&(n="."),n.length&&e.charCodeAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function GL(e,t){for(var n="",r=0,i=-1,a=0,s=-1,o,l;++s<=e.length;){if(s<e.length)o=e.charCodeAt(s);else{if(o===47)break;o=47}if(o===47){if(!(i===s-1||a===1))if(i!==s-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=s,a=0;continue}}else if(n.length){n="",r=0,i=s,a=0;continue}}t&&(n=n.length?n+"/..":"..",r=2)}else n.length?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,a=0}else o===46&&a>-1?a++:a=-1}return n}function ql(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}var J8={};J8.cwd=YL;function YL(){return"/"}/*!
164
+ ${xo(t,"mailto",n)}&src=email`)}`},{key:"clipboard-copy",icon:"share_copy-link",url:xo(t,"copy",n),shouldRender:()=>navigator&&navigator.clipboard&&navigator.clipboard.writeText,onClick:(r,i)=>(r.preventDefault(),r.stopPropagation(),navigator.clipboard.writeText(i))}];const pF="shareLinks_",mF=({title:e,link:t,referrer:n,gtmContext:r="ShareLinks",size:i="large",variant:a="default",className:s=""})=>{const o=ue.useIntl(),l=hF({title:e,link:t,referrer:n});return h.jsxs("aside",{className:ne("share-links",i,a,s),children:[h.jsx("p",{className:"text-small",children:o.formatMessage({id:"shareLinks_label"})}),h.jsx("ul",{children:l.map(({key:u,icon:c,url:d,shouldRender:f=!0,onClick:p})=>{if(typeof f=="function"&&!f())return null;const g={};return p&&(g.onClick=m=>p(m,d)),h.jsx("li",{children:h.jsx(Fe,{size:i,variant:"tertiary",icon:{icon:c||u},href:d,target:"_blank",rel:"noopener noreferrer",className:"gtm-trackable","data-gtm-event-context":`${r}-SocialButtons`,"data-gtm-event-type":`${u}-click`,"data-testid":"link",screenreaderText:o.formatMessage({id:`${pF}link_${u}`}),...g})},u)})})]})};const gF=({tabs:e,className:t="",preventLocationChange:n})=>{var g;const r=(m,y,v)=>(m||(m=`panel-${Si(y)}-${v}`),m),i=ra(!0)||0;let a=e.findIndex(m=>m.current===!0);if(a<0&&(a=0),window.location.hash){const m=window.location.hash.replace("#","");if(e.find(v=>v.id===m)){for(let v=0;v<e.length;v++)if(r(e[v].id,e[v].text,v)===m){a=v;break}}}const[s,o]=E.useState((g=e[a])!=null&&g.id?e[a].id:r(e[a].id,e[a].text,a)),[l,u]=E.useState(""),c=(m,y)=>{switch(m.key){case"ArrowLeft":case"ArrowRight":{m.preventDefault();let v=y;m.key==="ArrowLeft"?y>0?v=y-1:v=e.length-1:m.key==="ArrowRight"&&(y<e.length-1?v=y+1:v=0);const b=r(e[v].id,e[v].text,v),T=document.getElementById(`tab-${b}`);T==null||T.focus(),u(b);break}case"Enter":o(l),window.location.hash=`#${l}`;break}},d=m=>{let y=!1;return m.target==="min-width"&&i>=m.value&&(y=!0),m.target==="max-width"&&i<=m.value&&(y=!0),y};E.useEffect(()=>{if(e[a].hasCarousel){const m=new CustomEvent("hiddenSectionVisible",{detail:{id:s}});window.dispatchEvent(m)}},[s]);const f=[],p=[];return e.forEach(({id:m,text:y,content:v,href:b,hasCarousel:T,breakpoint:_},C)=>{if(_&&!d(_))return;m=r(m,y,C);const A=s===m,S={};b||(S["aria-controls"]=m,S.onClick=I=>{I.preventDefault(),I.stopPropagation(),o(m),!n&&window.history.replaceState(null,"",`#${m}`)},p.push(h.jsx("section",{id:m,hidden:!A,role:"tabpanel","aria-labelledby":`tab-${m}`,"aria-live":A?"assertive":"off",children:typeof v=="string"?h.jsx("p",{children:v}):v},`section-${m}`))),f.push(h.jsx("li",{"data-testid":"navigation-tab",children:h.jsx("a",{href:b||`#${m}`,id:`tab-${m}`,"aria-controls":m,className:ne({selected:A}),role:"tab",tabIndex:A?0:-1,"aria-selected":A,onKeyDown:I=>c(I,C),...S,children:y})},`tab-${m}`))}),h.jsxs("div",{className:ne("tabs-wrapper",t),children:[h.jsx("ul",{className:"tabs",role:"tablist",children:f}),h.jsx("div",{className:"tab-content",children:p})]})};const vF={"2-1":901,"1-3":769,"1-1":769},d8=({layout:e="2-1",hideOnMobile:t=!1,hasCSSContainers:n=!1,className:r="",children:i})=>{const a=ra(!0);let s=i;return E.Children.count(i)===1&&(s=E.Children.toArray(i)[0],s.props&&(s=s.props.children)),h.jsx("section",{className:ne("columns",`layout-${e}`,r,{"has-containers":n}),children:E.Children.map(s,(o,l)=>t!==!1&&l===t&&a&&a<vF[e]?null:o)})};const ua=({children:e,className:t="",styling:n={},...r})=>{const{background:i="default",padding:a="none"}=n;return h.jsx("section",{className:ne("full-width-section",t,{[i]:i!=="default",[a]:a!=="none"}),...r,children:e})};const yF=({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})}),h.jsx(ua,{className:ne("download-section",n),styling:{background:"dark"},children:h.jsxs("div",{className:"content-default",children:[E.createElement(typeof e=="string"?"h2":e.element,{className:"text"},typeof e=="string"?e:e.text),h.jsx(to,{buttons:r})]})})};const Xh="editSection_";function f8({href:e,setShowModal:t}){typeof e!="string"&&t(!0)}const EF=({icon:e,description:t,ctaMessage:n,href:r,showEditButton:i,setShowModal:a})=>{const{formatMessage:s}=ue.useIntl();return h.jsxs(Kn,{variant:"muted",icon:e,children:[h.jsx("p",{children:t||s({id:`${Xh}placeholder_description`})}),i&&h.jsx("p",{children:h.jsx(Fe,{href:r,variant:"secondary",size:"small",onClick:()=>f8({href:r,setShowModal:a}),children:n||s({id:`${Xh}placeholder_cta`})})})]})},bF=({children:e,className:t="",formProps:n,formComponent:r,href:i,title:a,showTitle:s=!0,modalTitle:o,placeholder:l,showDivider:u=!0})=>{const{formatMessage:c}=ue.useIntl(),[d,f]=E.useState(!1),p=()=>f(!1),g=!!n||!!r,m=typeof i=="string"||g;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{p()}},onCancel:()=>{r.props.functions.onCancel&&r.props.functions.onCancel(),p()}}})),h.jsxs("section",{className:ne("edit-section",t),children:[g&&h.jsx(Di,{title:o||`Edit ${a}`,isOpen:d,showDivider:!1,showIcon:!1,functions:{onClose:p},className:ne("edit-section-modal"),children:y||(n?h.jsx(Nr,{...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,T;(b=n==null?void 0:n.functions)!=null&&b.onSuccess&&await((T=n==null?void 0:n.functions)==null?void 0:T.onSuccess(v)),f(!1)},onCancel:p}}):h.jsx(h.Fragment,{}))}),h.jsxs("div",{className:ne("edit-section-header",{"no-title":!s}),children:[s&&h.jsx("h2",{className:"edit-section-header-title",children:a}),m&&h.jsx(Fe,{href:i,variant:"tertiary",size:"small",icon:"pencil",onClick:()=>f8({href:i,setShowModal:f}),children:c({id:`${Xh}edit`})})]}),e||h.jsx(EF,{...l,href:i,setShowModal:f,showEditButton:m}),u&&h.jsx(Dr,{})]})};const TF=({title:e=!1,text:t,logos:n=[],styling:r={},className:i=""})=>{const a=n.length;if(a===0)return null;const s={element:typeof e=="object"?e.element:"h2",text:typeof e=="string"?e:typeof e=="object"?e.text:"",className:typeof e=="object"?e.className:""},{wrapLogos:o=!1,align:l="center",display:u="block"}=r;return h.jsxs("div",{className:ne("logos",i,`align-${l}`,{[u]:u!=="block","wrap-logos":o}),children:[e&&E.createElement(s.element,{className:ne("title",s.className)},s.text),t&&h.jsx("p",{children:t}),h.jsx("ul",{className:ne({"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:p=!1},g)=>{if(!c||!c.url)return null;const m=h.jsx("img",{src:c.url,width:c.width||"auto",height:c.height||"auto",alt:d});return h.jsxs("li",{children:[h.jsx("p",{className:"img-wrapper",children:f?h.jsx("a",{href:f,target:"_blank",rel:"nofollow noreferrer noopener",children:m}):m}),p&&h.jsx("small",{children:p})]},`${c.url}_${g}`)})})]})};let Xd;const Jd="contactFooter_",_F=({onSuccess:e=async()=>{},onFailure:t=()=>{}})=>{const n=E.useRef(null),[r,i]=E.useState(0),[a,s]=E.useState(!1),o=()=>{n.current&&i(n.current.clientHeight)},l=()=>{a||(s(!0),clearTimeout(Xd),Xd=setTimeout(()=>{o(),s(!1)},500))};return E.useEffect(()=>(o(),window.addEventListener("resize",l),()=>{clearTimeout(Xd),window.removeEventListener("resize",l)}),[]),h.jsx(ua,{id:"contactForm",className:"contact-footer",children:h.jsxs("div",{className:"inner-wrapper",children:[h.jsx("h2",{children:h.jsx(ue.FormattedMessage,{id:`${Jd}title`})}),h.jsxs("div",{className:"content-wrapper",ref:n,"data-testid":"content-wrapper",style:a?{}:{minHeight:r},children:[h.jsxs("aside",{children:[h.jsx("p",{children:h.jsx(ue.FormattedMessage,{id:`${Jd}text`})}),h.jsx(sa,{className:"mailto-link",href:"mailto:hello@apolitical.co",children:h.jsx(ue.FormattedMessage,{id:`${Jd}email`})})]}),h.jsx(JT,{functions:{onSuccess:e,onFailure:t},gtm:{context:"FooterContactUsForm",event:"contact-form-submit-click"}})]})]})})},CF=({activeLink:e,profile:t,...n})=>h.jsx(ua,{children:h.jsx(d8,{layout:"1-3",children:h.jsxs(h.Fragment,{children:[h.jsx(c8,{activeLink:e,profile:t}),h.jsx(q4,{...n})]})})});const ef="cookieBanner_",tf=["apol-cookie-banner","apolitical-performance-cookie-consent","functional-cookie-consent"],nf=new Date(Date.now()+12*30*24*60*60*1e3),h8=()=>{const e=ue.useIntl(),[t,n,r]=Sp.useCookies(tf),[i,a]=E.useState(!t["apol-cookie-banner"]),s=()=>{tf.forEach(c=>{n(c,!0,{path:"/",expires:nf,domain:c==="apolitical-performance-cookie-consent"?".apolitical.co":void 0})}),a(!1),window.location.reload()},o=()=>{n("apol-cookie-banner",!0,{path:"/",expires:nf}),tf.forEach(c=>{if(c==="apol-cookie-banner"){n(c,!0,{path:"/",expires:nf});return}r(c)}),a(!1)};if(!i)return null;const l=[{id:"settings",href:"/pages/cookie-policy",gtmType:"policy-page"},{id:"reject",onClick:o,gtmType:"reject-all"},{id:"accept",onClick:s,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:`${ef}buttons_${c.id}`})})}),h.jsxs("section",{id:"cookie-banner","aria-labelledby":"cookie-banner-title","aria-describedby":"cookie-banner-desc","aria-live":"polite","aria-modal":"true",className:"text-medium",children:[h.jsx("h6",{id:"cookie-banner-title",children:e.formatMessage({id:`${ef}title`})}),h.jsx("p",{id:"cookie-banner-desc",children:e.formatMessage({id:`${ef}text`})}),h.jsx(to,{buttons:u})]})},Ei={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:"/pages/privacy-policy",gtmType:"privacy-policy-link"},terms:{href:"/pages/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:Cs["data-protection"].default,gtmType:"email-dpo-link"},euDataProtection:{email:Cs["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:Cs.support,gtmType:"concierge-email-click"},business:{email:Cs.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 Ds="footer_",n1="SiteFooter",B9=({group:e})=>{const t=Ei[e].order||[];let n=!1;return"text"in Ei[e]&&(n=Ei[e].text),h.jsxs(E.Fragment,{children:[h.jsx("p",{className:"pre-title",children:h.jsx(ue.FormattedMessage,{id:`${Ds}${e}`})}),Array.isArray(t)&&t.length>0&&h.jsx("ul",{className:"text-medium",children:t.map(r=>{if(["order","child","text"].includes(r))return null;const{href:i,gtmType:a}=Ei[e][r],s={};return["legal"].includes(e)&&(s.target="_blank",s.rel="noopener"),h.jsx("li",{children:h.jsx("a",{href:i,className:"gtm-trackable","data-gtm-event-context":n1,"data-gtm-event-type":a,...s,children:h.jsx(ue.FormattedMessage,{id:`${Ds}${e}_${r}`})})},`${e}_${r}`)})}),typeof n!="boolean"&&"order"in n&&Array.isArray(n.order)&&h.jsx("dl",{className:"text-medium",children:n.order.map(r=>h.jsxs(E.Fragment,{children:[h.jsx("dt",{children:h.jsx(ue.FormattedMessage,{id:`${Ds}${e}_${r}`})}),h.jsxs("dd",{children:[typeof n!="boolean"&&n[r].address&&h.jsx("address",{children:h.jsx(ue.FormattedMessage,{id:`${Ds}${e}_${r}_address`,values:{br:h.jsx("br",{})}})}),typeof n!="boolean"&&n[r].email&&h.jsx("a",{href:`mailto:${n[r].email}`,className:"gtm-trackable","data-gtm-event-context":n1,"data-gtm-event-type":n[r].gtmType,children:n[r].email})]})]},`dl-${e}-${r}`))})]},e)},Im=()=>h.jsx("div",{id:"footer",children:h.jsxs("div",{className:"wrapper",children:[h.jsx(p1,{element:"hr"}),h.jsx(Nm,{variant:"inverted",version:"full",className:"gtm-trackable","data-gtm-event-context":n1,"data-gtm-event-type":"logo-homepage-link"}),h.jsx("footer",{children:["platform","community","company","contact"].map(e=>h.jsxs("div",{className:"group",children:[h.jsx(B9,{group:e}),Object.keys(Ei[e]).includes("child")&&h.jsx(B9,{group:Ei[e].child})]},e))}),h.jsx("hr",{}),h.jsxs("div",{className:"sub-footer",children:[h.jsx("ul",{children:Array.isArray(Ei.social.order)&&Ei.social.order.map(e=>{const t=Ei.social[e];return h.jsx("li",{className:e,children:h.jsx("a",{href:t.href,target:"_blank",rel:"noopener noreferrer",className:"gtm-trackable","data-gtm-event-context":n1,"data-gtm-event-type":"social-click",children:h.jsx("span",{className:"hidden",children:h.jsx(ue.FormattedMessage,{id:`${Ds}social_${e}`})})})},e)})}),h.jsx("small",{children:h.jsx(ue.FormattedMessage,{id:`${Ds}copyright`,values:{currentYear:new Date().getFullYear()}})})]})]})}),ei=Object.create(null);ei.open="0";ei.close="1";ei.ping="2";ei.pong="3";ei.message="4";ei.upgrade="5";ei.noop="6";const Cc=Object.create(null);Object.keys(ei).forEach(e=>{Cc[ei[e]]=e});const Jh={type:"error",data:"parser error"},p8=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",m8=typeof ArrayBuffer=="function",g8=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Pm=({type:e,data:t},n,r)=>p8&&t instanceof Blob?n?r(t):M9(t,r):m8&&(t instanceof ArrayBuffer||g8(t))?n?r(t):M9(new Blob([t]),r):r(ei[e]+(t||"")),M9=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function L9(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let rf;function xF(e,t){if(p8&&e.data instanceof Blob)return e.data.arrayBuffer().then(L9).then(t);if(m8&&(e.data instanceof ArrayBuffer||g8(e.data)))return t(L9(e.data));Pm(e,!1,n=>{rf||(rf=new TextEncoder),t(rf.encode(n))})}const $9="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ko=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<$9.length;e++)Ko[$9.charCodeAt(e)]=e;const wF=e=>{let t=e.length*.75,n=e.length,r,i=0,a,s,o,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=Ko[e.charCodeAt(r)],s=Ko[e.charCodeAt(r+1)],o=Ko[e.charCodeAt(r+2)],l=Ko[e.charCodeAt(r+3)],c[i++]=a<<2|s>>4,c[i++]=(s&15)<<4|o>>2,c[i++]=(o&3)<<6|l&63;return u},AF=typeof ArrayBuffer=="function",Rm=(e,t)=>{if(typeof e!="string")return{type:"message",data:v8(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:SF(e.substring(1),t)}:Cc[n]?e.length>1?{type:Cc[n],data:e.substring(1)}:{type:Cc[n]}:Jh},SF=(e,t)=>{if(AF){const n=wF(e);return v8(n,t)}else return{base64:!0,data:e}},v8=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},y8=String.fromCharCode(30),kF=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((a,s)=>{Pm(a,!1,o=>{r[s]=o,++i===n&&t(r.join(y8))})})},DF=(e,t)=>{const n=e.split(y8),r=[];for(let i=0;i<n.length;i++){const a=Rm(n[i],t);if(r.push(a),a.type==="error")break}return r};function OF(){return new TransformStream({transform(e,t){xF(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 af;function Au(e){return e.reduce((t,n)=>t+n.length,0)}function Su(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 NF(e,t){af||(af=new TextDecoder);const n=[];let r=0,i=-1,a=!1;return new TransformStream({transform(s,o){for(n.push(s);;){if(r===0){if(Au(n)<1)break;const l=Su(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(Au(n)<2)break;const l=Su(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(Au(n)<8)break;const l=Su(n,8),u=new DataView(l.buffer,l.byteOffset,l.length),c=u.getUint32(0);if(c>Math.pow(2,53-32)-1){o.enqueue(Jh);break}i=c*Math.pow(2,32)+u.getUint32(4),r=3}else{if(Au(n)<i)break;const l=Su(n,i);o.enqueue(Rm(a?l:af.decode(l),t)),r=0}if(i===0||i>e){o.enqueue(Jh);break}}}})}const E8=4;function Yt(e){if(e)return IF(e)}function IF(e){for(var t in Yt.prototype)e[t]=Yt.prototype[t];return e}Yt.prototype.on=Yt.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Yt.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};Yt.prototype.off=Yt.prototype.removeListener=Yt.prototype.removeAllListeners=Yt.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};Yt.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};Yt.prototype.emitReserved=Yt.prototype.emit;Yt.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Yt.prototype.hasListeners=function(e){return!!this.listeners(e).length};const D1=(()=>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")())(),PF="arraybuffer";function b8(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const RF=lr.setTimeout,FF=lr.clearTimeout;function O1(e,t){t.useNativeTimers?(e.setTimeoutFn=RF.bind(lr),e.clearTimeoutFn=FF.bind(lr)):(e.setTimeoutFn=lr.setTimeout.bind(lr),e.clearTimeoutFn=lr.clearTimeout.bind(lr))}const BF=1.33;function MF(e){return typeof e=="string"?LF(e):Math.ceil((e.byteLength||e.size)*BF)}function LF(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 T8(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function $F(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function jF(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 HF extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class Fm extends Yt{constructor(t){super(),this.writable=!1,O1(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 HF(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=Rm(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=$F(t);return n.length?"?"+n:""}}class UF extends Fm{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)};DF(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,kF(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]=T8()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let _8=!1;try{_8=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const zF=_8;function qF(){}class WF extends UF{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 Kr extends Yt{constructor(t,n,r){super(),this.createRequest=t,O1(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=b8(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=Kr.requestsCount++,Kr.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=qF,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Kr.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()}}Kr.requestsCount=0;Kr.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",j9);else if(typeof addEventListener=="function"){const e="onpagehide"in lr?"pagehide":"unload";addEventListener(e,j9,!1)}}function j9(){for(let e in Kr.requests)Kr.requests.hasOwnProperty(e)&&Kr.requests[e].abort()}const VF=function(){const e=C8({xdomain:!1});return e&&e.responseType!==null}();class KF extends WF{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=VF&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Kr(C8,this.uri(),t)}}function C8(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||zF))return new XMLHttpRequest}catch{}if(!t)try{return new lr[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const x8=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class GF extends Fm{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=x8?{}:b8(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;Pm(r,this.supportsBinary,a=>{try{this.doWrite(r,a)}catch{}i&&D1(()=>{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]=T8()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const sf=lr.WebSocket||lr.MozWebSocket;class YF extends GF{createSocket(t,n,r){return x8?new sf(t,n,r):n?new sf(t,n):new sf(t)}doWrite(t,n){this.ws.send(n)}}class ZF extends Fm{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=NF(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=OF();i.readable.pipeTo(t.writable),this._writer=i.writable.getWriter();const a=()=>{r.read().then(({done:o,value:l})=>{o||(this.onPacket(l),a())}).catch(o=>{})};a();const s={type:"open"};this.query.sid&&(s.data=`{"sid":"${this.query.sid}"}`),this._writer.write(s).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&&D1(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const QF={websocket:YF,webtransport:ZF,polling:KF},XF=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,JF=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function ep(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=XF.exec(e||""),a={},s=14;for(;s--;)a[JF[s]]=i[s]||"";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=eB(a,a.path),a.queryKey=tB(a,a.query),a}function eB(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 tB(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,a){i&&(n[i]=a)}),n}const tp=typeof addEventListener=="function"&&typeof removeEventListener=="function",xc=[];tp&&addEventListener("offline",()=>{xc.forEach(e=>e())},!1);class ea extends Yt{constructor(t,n){if(super(),this.binaryType=PF,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=ep(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=ep(n.host).host);O1(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=jF(this.opts.query)),tp&&(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"})},xc.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=E8,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&&ea.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",ea.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+=MF(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,D1(()=>{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(ea.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(),tp&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=xc.indexOf(this._offlineEventListener);r!==-1&&xc.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}ea.protocol=E8;class nB extends ea{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;ea.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;ea.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 s=d=>{const f=new Error("probe error: "+d);f.transport=n.name,a(),this.emitReserved("upgradeError",f)};function o(){s("transport closed")}function l(){s("socket closed")}function u(d){n&&d.name!==n.name&&a()}const c=()=>{n.removeListener("open",i),n.removeListener("error",s),n.removeListener("close",o),this.off("close",l),this.off("upgrading",u)};n.once("open",i),n.once("error",s),n.once("close",o),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 rB=class extends nB{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=>QF[i]).filter(i=>!!i)),super(t,r)}};function iB(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=ep(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 aB=typeof ArrayBuffer=="function",sB=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,w8=Object.prototype.toString,oB=typeof Blob=="function"||typeof Blob<"u"&&w8.call(Blob)==="[object BlobConstructor]",lB=typeof File=="function"||typeof File<"u"&&w8.call(File)==="[object FileConstructor]";function Bm(e){return aB&&(e instanceof ArrayBuffer||sB(e))||oB&&e instanceof Blob||lB&&e instanceof File}function wc(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(wc(e[n]))return!0;return!1}if(Bm(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return wc(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&wc(e[n]))return!0;return!1}function uB(e){const t=[],n=e.data,r=e;return r.data=np(n,t),r.attachments=t.length,{packet:r,buffers:t}}function np(e,t){if(!e)return e;if(Bm(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]=np(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]=np(e[r],t));return n}return e}function cB(e,t){return e.data=rp(e.data,t),delete e.attachments,e}function rp(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]=rp(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=rp(e[n],t));return e}const dB=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],fB=5;var ut;(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"})(ut||(ut={}));class hB{constructor(t){this.replacer=t}encode(t){return(t.type===ut.EVENT||t.type===ut.ACK)&&wc(t)?this.encodeAsBinary({type:t.type===ut.EVENT?ut.BINARY_EVENT:ut.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===ut.BINARY_EVENT||t.type===ut.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=uB(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function H9(e){return Object.prototype.toString.call(e)==="[object Object]"}class Mm extends Yt{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===ut.BINARY_EVENT;r||n.type===ut.BINARY_ACK?(n.type=r?ut.EVENT:ut.ACK,this.reconstructor=new pB(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Bm(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(ut[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===ut.BINARY_EVENT||r.type===ut.BINARY_ACK){const a=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const s=t.substring(a,n);if(s!=Number(s)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(s)}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 s=t.charAt(n);if(s==null||Number(s)!=s){--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(Mm.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 ut.CONNECT:return H9(n);case ut.DISCONNECT:return n===void 0;case ut.CONNECT_ERROR:return typeof n=="string"||H9(n);case ut.EVENT:case ut.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&dB.indexOf(n[0])===-1);case ut.ACK:case ut.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class pB{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=cB(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const mB=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Mm,Encoder:hB,get PacketType(){return ut},protocol:fB},Symbol.toStringTag,{value:"Module"}));function Ar(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const gB=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class A8 extends Yt{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=[Ar(t,"open",this.onopen.bind(this)),Ar(t,"packet",this.onpacket.bind(this)),Ar(t,"error",this.onerror.bind(this)),Ar(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(gB.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 s={type:ut.EVENT,data:n};if(s.options={},s.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const c=this.ids++,d=n.pop();this._registerAckCallback(c,d),s.id=c}const o=(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&&!o||(l?(this.notifyOutgoingListeners(s),this.packet(s)):this.sendBuffer.push(s)),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),s=(...o)=>{this.io.clearTimeoutFn(a),n.apply(this,o)};s.withError=!0,this.acks[t]=s}emitWithAck(t,...n){return new Promise((r,i)=>{const a=(s,o)=>s?i(s):r(o);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:ut.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 ut.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 ut.EVENT:case ut.BINARY_EVENT:this.onevent(t);break;case ut.ACK:case ut.BINARY_ACK:this.onack(t);break;case ut.DISCONNECT:this.ondisconnect();break;case ut.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:ut.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:ut.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 ao(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}ao.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};ao.prototype.reset=function(){this.attempts=0};ao.prototype.setMin=function(e){this.ms=e};ao.prototype.setMax=function(e){this.max=e};ao.prototype.setJitter=function(e){this.jitter=e};class ip extends Yt{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,O1(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 ao({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||mB;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 rB(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=Ar(n,"open",function(){r.onopen(),t&&t()}),a=o=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",o),t?t(o):this.maybeReconnectOnOpen()},s=Ar(n,"error",a);if(this._timeout!==!1){const o=this._timeout,l=this.setTimeoutFn(()=>{i(),a(new Error("timeout")),n.close()},o);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(s),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Ar(t,"ping",this.onping.bind(this)),Ar(t,"data",this.ondata.bind(this)),Ar(t,"error",this.onerror.bind(this)),Ar(t,"close",this.onclose.bind(this)),Ar(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){D1(()=>{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 A8(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 wo={};function Ac(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=iB(e,t.path||"/socket.io"),r=n.source,i=n.id,a=n.path,s=wo[i]&&a in wo[i].nsps,o=t.forceNew||t["force new connection"]||t.multiplex===!1||s;let l;return o?l=new ip(r,t):(wo[i]||(wo[i]=new ip(r,t)),l=wo[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(Ac,{Manager:ip,Socket:A8,io:Ac,connect:Ac});const U9=e=>{let t;const n=new Set,r=(c,d)=>{const f=typeof c=="function"?c(t):c;if(!Object.is(f,t)){const p=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(g=>g(t,p))}},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},S8=e=>e?U9(e):U9;function vB(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)})}}}function Vn(){return Vn=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},Vn.apply(this,arguments)}class yB extends Error{constructor(t){super(t),this.name=void 0,this.name="SuprSendError"}}function Ia(){return Math.round(Date.now())}function va(){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 Tn=S8()(()=>({apiUrl:"https://inboxs.live",collectorApiUrl:"https://hub.suprsend.com",socketUrl:"https://betainbox.suprsend.com",pageSize:20})),EB={unseenCount:0,stores:{},activeStoreId:null,pageNumber:1,hasNext:!0,initialLoading:!1,fetchMoreLoading:!1,initialFetchTime:null},lt=S8()(()=>EB);class bB{constructor(t){this.socket=void 0,this.config=void 0,this.config=t;const n=Tn.getState();this.socket=Ac(n.socketUrl,{transports:["websocket"],auth:{subscriber_id:this.config.subscriberId,distinct_id:this.config.distinctId,authorization:`${this.config.workspaceKey}:${va()}`,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=lt.getState();if(t.config.stores){let s=!1;for(let o of t.config.stores){const l=a.stores[o.storeId];t._notificationBelongToStore(i.data,o)&&(s=!0,l.notifications=t.orderNotifications(i.data,l.notifications),l.unseenCount+=1)}s&&(a.unseenCount+=1,t.config.emitter.emit("new_notification",i.data)),lt.setState({unseenCount:a.unseenCount,stores:Vn({},a.stores)})}else{if(!a.activeStoreId)return;let s=a.stores[a.activeStoreId];a.unseenCount+=1,s.unseenCount+=1,s.notifications=t.orderNotifications(i.data,s.notifications),lt.setState({unseenCount:a.unseenCount,stores:Vn({},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()]),s=lt.getState();let o=s.activeStoreId;if(a[0].status==="fulfilled"){var r;const u=await a[0].value.json(),c=u.data;if(!o)return;let d=s.stores[o];const f=(r=t.config.stores)==null?void 0:r.find(p=>p.storeId===o);if((n==null?void 0:n.type)==="archive"){var i;f!=null&&(i=f.query)!=null&&i.archived?t._notificationBelongToStore(c,f)&&(s.stores[o].notifications=[c,...d.notifications]):s.stores[o].notifications=d.notifications.filter(p=>p.n_id!==n.n_id)}else s.stores[o].notifications=d.notifications.map(p=>p.n_id===n.n_id?u.data:p);lt.setState({stores:Vn({},s.stores)})}if(a[1].status==="fulfilled"){const u=await a[1].value.json();lt.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:Vn({},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(){lt.setState({unseenCount:0}),t.config.emitter.emit("sync_notif_store")}),this.socket.on("mark_all_read",async function(){const n=lt.getState(),r=Ia();for(let i in n.stores){const a=n.stores[i];a.notifications.forEach(s=>{s.seen_on||(s.seen_on=r)}),a.unseenCount=0}lt.setState({stores:n.stores}),t.config.emitter.emit("sync_notif_store")})}_notificationBelongToStore(t,n){var r,i,a,s;const o=!!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,p=n==null||(a=n.query)==null?void 0:a.tags,g=n==null||(s=n.query)==null?void 0:s.categories,m=!d||o===d,y=!f||l===f;let v,b;return Array.isArray(p)&&p.length>0?p.forEach(T=>{u!=null&&u.includes(T)&&(v=!0)}):v=!0,Array.isArray(g)&&g.length>0?g.includes(c)&&(b=!0):b=!0,m&&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,s=n==null?void 0:n.archived;return{store_id:t.storeId,query:{read:a,archived:s,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}=Tn.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}:${va()}`}})}getNotifications(t,n,r=20,i){const{apiUrl:a}=Tn.getState();let s=`/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 o=this._getStoreQueryString(t);s+=`&store=${encodeURIComponent(JSON.stringify(o))}`}return fetch(`${a}${s}`,{method:"GET",headers:{Authorization:`${this.config.workspaceKey}:${va()}`}})}getNotificationDetails(t){const{apiUrl:n}=Tn.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}:${va()}`}})}markBellClicked(){const{apiUrl:t}=Tn.getState(),n="/bell-clicked/",r=JSON.stringify({time:Ia(),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}:${va()}`,"Content-Type":"application/json"}})}markAllRead(){const{apiUrl:t}=Tn.getState(),n="/mark-all-read/",r=JSON.stringify({time:Ia(),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}:${va()}`,"Content-Type":"application/json"}})}markNotificationClicked(t){const{collectorApiUrl:n}=Tn.getState(),r={event:"$notification_clicked",env:this.config.workspaceKey,$insert_id:va(),$time:Ia(),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}=Tn.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}=Tn.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}=Tn.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 z9=class{constructor(t){this.config=void 0,this.config=t}_overallFirstApiCall(){const t=lt.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=lt.getState(),a=Tn.getState(),s=i.activeStoreId;if(!s||!((t=i.stores)!=null&&t[s]))return;const o=i.stores[s],l=o.isFirstCall,u=i.initialFetchTime||Date.now(),c=(n=this.config.stores)==null?void 0:n.find(d=>d.storeId===s);try{if(!r||!i.hasNext)return;l?(lt.setState({initialLoading:!0}),this._overallFirstApiCall()&&this.getNotificationsCount()):i.pageNumber>1&&lt.setState({fetchMoreLoading:!0}),this.config.emitter.emit("sync_notif_store");const f=await(await r.getNotifications(c,i.pageNumber,a.pageSize,u)).json();let p;l||!l&&i.pageNumber===1?p=f.results:p=[...o.notifications,...f.results],i.stores[s].notifications=p,i.stores[s].isFirstCall=!1,lt.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),lt.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();lt.setState(i=>{for(let a in i.stores){const s=i.stores[a];s.unseenCount=r[a]||0}return{unseenCount:r.ss_bell_count,stores:Vn({},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=lt.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=Ia();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(p=>{p.n_id===l.n_id&&(p.seen_on=c,p.interacted_on=c,f.unseenCount>0&&(f.unseenCount-=1))})}lt.setState(Vn({},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(),lt.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=lt.getState(),r=Ia();for(let i in n.stores){const a=n.stores[i];a.notifications.forEach(s=>{s.seen_on||(s.seen_on=r)}),a.unseenCount=0}lt.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=lt.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=Ia();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(p=>{p.n_id===l.n_id&&(p.seen_on=c,f.unseenCount>0&&(f.unseenCount-=1))})}lt.setState(Vn({},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=lt.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))})}lt.setState(Vn({},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=lt.getState(),a=i.activeStoreId;if(!a||!((n=i.stores)!=null&&n[a]))return;const o=(i==null?void 0:i.stores)[a],l=o.notifications.find(u=>u.n_id===t);if(l&&!l.archived){if(!r)return;try{r.markNotificationArchive(t),o.notifications=o.notifications.filter(u=>u.n_id!==t),!l.seen_on&&o.unseenCount>0&&(o.unseenCount-=1),lt.setState(Vn({},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=lt.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 TB{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 z9(this),this.emitter=vB(),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 yB("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,s=[],o=[],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"?s=[i.tags]:Array.isArray(i==null?void 0:i.tags)&&(s=i==null?void 0:i.tags.filter(u=>typeof u=="string")),typeof(i==null?void 0:i.categories)=="string"?o=[i.categories]:Array.isArray(i==null?void 0:i.categories)&&(o=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:s,categories:o}})}),this.stores=n}_validatePageSize(t){if(t&&typeof t=="number"){const r=t<=50?t:50;Tn.setState({pageSize:r})}}_setConfigStoreState(t){t&&(t!=null&&t.socketHost&&Tn.setState({socketUrl:t.socketHost}),t!=null&&t.apiHost&&Tn.setState({apiUrl:t.apiHost}),t!=null&&t.collectorHost&&Tn.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]=Vn({},n)}),lt.setState({stores:r,activeStoreId:this.stores[0].storeId})}else lt.setState({stores:{[t]:Vn({},n)},activeStoreId:t});setTimeout(()=>{this.emitter.emit("sync_notif_store")},0)}_startExipryCheck(){var t=this;this._expiryTimerId||(this._expiryTimerId=setInterval(async function(){const r=lt.getState().stores;let i=!1;for(let a in r){let s=r[a].notifications;s=s.filter(o=>(o.expiry?Date.now()>o.expiry:!1)?(i=!0,!1):!0),r[a].notifications=s}i&&(lt.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 bB(this))),this._client}identifyUser(t,n){this.distinctId=t,this.subscriberId=n}changeActiveStore(t){var n;const r=lt.getState(),i={};if(r.activeStoreId!==t&&(n=r.stores)!=null&&n[t]){for(let a in r.stores){const s=r.stores[a],o=s.notifications.slice(0,20);i[a]={notifications:o,unseenCount:s.unseenCount,isFirstCall:s.isFirstCall}}lt.setState({activeStoreId:t,stores:i,pageNumber:1,hasNext:!0,initialLoading:!1,fetchMoreLoading:!1,initialFetchTime:null}),this.client&&this.feed.fetchNotifications()}}resetUser(){var t;lt.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 z9(this)}}var q9=function(t){return t.reduce(function(n,r){var i=r[0],a=r[1];return n[i]=a,n},{})},W9=typeof window<"u"&&window.document&&window.document.createElement?un.useLayoutEffect:un.useEffect,Rn="top",mr="bottom",gr="right",Fn="left",Lm="auto",Hl=[Rn,mr,gr,Fn],Ys="start",Ol="end",_B="clippingParents",k8="viewport",Ao="popper",CB="reference",V9=Hl.reduce(function(e,t){return e.concat([t+"-"+Ys,t+"-"+Ol])},[]),D8=[].concat(Hl,[Lm]).reduce(function(e,t){return e.concat([t,t+"-"+Ys,t+"-"+Ol])},[]),xB="beforeRead",wB="read",AB="afterRead",SB="beforeMain",kB="main",DB="afterMain",OB="beforeWrite",NB="write",IB="afterWrite",PB=[xB,wB,AB,SB,kB,DB,OB,NB,IB];function ti(e){return e?(e.nodeName||"").toLowerCase():null}function Qn(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Wa(e){var t=Qn(e).Element;return e instanceof t||e instanceof Element}function fr(e){var t=Qn(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function $m(e){if(typeof ShadowRoot>"u")return!1;var t=Qn(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function RB(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];!fr(a)||!ti(a)||(Object.assign(a.style,r),Object.keys(i).forEach(function(s){var o=i[s];o===!1?a.removeAttribute(s):a.setAttribute(s,o===!0?"":o)}))})}function FB(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]||{},s=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),o=s.reduce(function(l,u){return l[u]="",l},{});!fr(i)||!ti(i)||(Object.assign(i.style,o),Object.keys(a).forEach(function(l){i.removeAttribute(l)}))})}}const BB={name:"applyStyles",enabled:!0,phase:"write",fn:RB,effect:FB,requires:["computeStyles"]};function Gr(e){return e.split("-")[0]}var Ma=Math.max,r1=Math.min,Zs=Math.round;function ap(){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 O8(){return!/^((?!chrome|android).)*safari/i.test(ap())}function Qs(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,a=1;t&&fr(e)&&(i=e.offsetWidth>0&&Zs(r.width)/e.offsetWidth||1,a=e.offsetHeight>0&&Zs(r.height)/e.offsetHeight||1);var s=Wa(e)?Qn(e):window,o=s.visualViewport,l=!O8()&&n,u=(r.left+(l&&o?o.offsetLeft:0))/i,c=(r.top+(l&&o?o.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 jm(e){var t=Qs(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 N8(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&$m(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function xi(e){return Qn(e).getComputedStyle(e)}function MB(e){return["table","td","th"].indexOf(ti(e))>=0}function ca(e){return((Wa(e)?e.ownerDocument:e.document)||window.document).documentElement}function N1(e){return ti(e)==="html"?e:e.assignedSlot||e.parentNode||($m(e)?e.host:null)||ca(e)}function K9(e){return!fr(e)||xi(e).position==="fixed"?null:e.offsetParent}function LB(e){var t=/firefox/i.test(ap()),n=/Trident/i.test(ap());if(n&&fr(e)){var r=xi(e);if(r.position==="fixed")return null}var i=N1(e);for($m(i)&&(i=i.host);fr(i)&&["html","body"].indexOf(ti(i))<0;){var a=xi(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 Ul(e){for(var t=Qn(e),n=K9(e);n&&MB(n)&&xi(n).position==="static";)n=K9(n);return n&&(ti(n)==="html"||ti(n)==="body"&&xi(n).position==="static")?t:n||LB(e)||t}function Hm(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function sl(e,t,n){return Ma(e,r1(t,n))}function $B(e,t,n){var r=sl(e,t,n);return r>n?n:r}function I8(){return{top:0,right:0,bottom:0,left:0}}function P8(e){return Object.assign({},I8(),e)}function R8(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var jB=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,P8(typeof t!="number"?t:R8(t,Hl))};function HB(e){var t,n=e.state,r=e.name,i=e.options,a=n.elements.arrow,s=n.modifiersData.popperOffsets,o=Gr(n.placement),l=Hm(o),u=[Fn,gr].indexOf(o)>=0,c=u?"height":"width";if(!(!a||!s)){var d=jB(i.padding,n),f=jm(a),p=l==="y"?Rn:Fn,g=l==="y"?mr:gr,m=n.rects.reference[c]+n.rects.reference[l]-s[l]-n.rects.popper[c],y=s[l]-n.rects.reference[l],v=Ul(a),b=v?l==="y"?v.clientHeight||0:v.clientWidth||0:0,T=m/2-y/2,_=d[p],C=b-f[c]-d[g],A=b/2-f[c]/2+T,S=sl(_,A,C),I=l;n.modifiersData[r]=(t={},t[I]=S,t.centerOffset=S-A,t)}}function UB(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)||N8(t.elements.popper,i)&&(t.elements.arrow=i))}const zB={name:"arrow",enabled:!0,phase:"main",fn:HB,effect:UB,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Xs(e){return e.split("-")[1]}var qB={top:"auto",right:"auto",bottom:"auto",left:"auto"};function WB(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:Zs(n*i)/i||0,y:Zs(r*i)/i||0}}function G9(e){var t,n=e.popper,r=e.popperRect,i=e.placement,a=e.variation,s=e.offsets,o=e.position,l=e.gpuAcceleration,u=e.adaptive,c=e.roundOffsets,d=e.isFixed,f=s.x,p=f===void 0?0:f,g=s.y,m=g===void 0?0:g,y=typeof c=="function"?c({x:p,y:m}):{x:p,y:m};p=y.x,m=y.y;var v=s.hasOwnProperty("x"),b=s.hasOwnProperty("y"),T=Fn,_=Rn,C=window;if(u){var A=Ul(n),S="clientHeight",I="clientWidth";if(A===Qn(n)&&(A=ca(n),xi(A).position!=="static"&&o==="absolute"&&(S="scrollHeight",I="scrollWidth")),A=A,i===Rn||(i===Fn||i===gr)&&a===Ol){_=mr;var B=d&&A===C&&C.visualViewport?C.visualViewport.height:A[S];m-=B-r.height,m*=l?1:-1}if(i===Fn||(i===Rn||i===mr)&&a===Ol){T=gr;var F=d&&A===C&&C.visualViewport?C.visualViewport.width:A[I];p-=F-r.width,p*=l?1:-1}}var R=Object.assign({position:o},u&&qB),N=c===!0?WB({x:p,y:m},Qn(n)):{x:p,y:m};if(p=N.x,m=N.y,l){var k;return Object.assign({},R,(k={},k[_]=b?"0":"",k[T]=v?"0":"",k.transform=(C.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",k))}return Object.assign({},R,(t={},t[_]=b?m+"px":"",t[T]=v?p+"px":"",t.transform="",t))}function VB(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,a=n.adaptive,s=a===void 0?!0:a,o=n.roundOffsets,l=o===void 0?!0:o,u={placement:Gr(t.placement),variation:Xs(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,G9(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,G9(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 KB={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:VB,data:{}};var ku={passive:!0};function GB(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,a=i===void 0?!0:i,s=r.resize,o=s===void 0?!0:s,l=Qn(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&u.forEach(function(c){c.addEventListener("scroll",n.update,ku)}),o&&l.addEventListener("resize",n.update,ku),function(){a&&u.forEach(function(c){c.removeEventListener("scroll",n.update,ku)}),o&&l.removeEventListener("resize",n.update,ku)}}const YB={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:GB,data:{}};var ZB={left:"right",right:"left",bottom:"top",top:"bottom"};function Sc(e){return e.replace(/left|right|bottom|top/g,function(t){return ZB[t]})}var QB={start:"end",end:"start"};function Y9(e){return e.replace(/start|end/g,function(t){return QB[t]})}function Um(e){var t=Qn(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function zm(e){return Qs(ca(e)).left+Um(e).scrollLeft}function XB(e,t){var n=Qn(e),r=ca(e),i=n.visualViewport,a=r.clientWidth,s=r.clientHeight,o=0,l=0;if(i){a=i.width,s=i.height;var u=O8();(u||!u&&t==="fixed")&&(o=i.offsetLeft,l=i.offsetTop)}return{width:a,height:s,x:o+zm(e),y:l}}function JB(e){var t,n=ca(e),r=Um(e),i=(t=e.ownerDocument)==null?void 0:t.body,a=Ma(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=Ma(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),o=-r.scrollLeft+zm(e),l=-r.scrollTop;return xi(i||n).direction==="rtl"&&(o+=Ma(n.clientWidth,i?i.clientWidth:0)-a),{width:a,height:s,x:o,y:l}}function qm(e){var t=xi(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function F8(e){return["html","body","#document"].indexOf(ti(e))>=0?e.ownerDocument.body:fr(e)&&qm(e)?e:F8(N1(e))}function ol(e,t){var n;t===void 0&&(t=[]);var r=F8(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),a=Qn(r),s=i?[a].concat(a.visualViewport||[],qm(r)?r:[]):r,o=t.concat(s);return i?o:o.concat(ol(N1(s)))}function sp(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function eM(e,t){var n=Qs(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 Z9(e,t,n){return t===k8?sp(XB(e,n)):Wa(t)?eM(t,n):sp(JB(ca(e)))}function tM(e){var t=ol(N1(e)),n=["absolute","fixed"].indexOf(xi(e).position)>=0,r=n&&fr(e)?Ul(e):e;return Wa(r)?t.filter(function(i){return Wa(i)&&N8(i,r)&&ti(i)!=="body"}):[]}function nM(e,t,n,r){var i=t==="clippingParents"?tM(e):[].concat(t),a=[].concat(i,[n]),s=a[0],o=a.reduce(function(l,u){var c=Z9(e,u,r);return l.top=Ma(c.top,l.top),l.right=r1(c.right,l.right),l.bottom=r1(c.bottom,l.bottom),l.left=Ma(c.left,l.left),l},Z9(e,s,r));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function B8(e){var t=e.reference,n=e.element,r=e.placement,i=r?Gr(r):null,a=r?Xs(r):null,s=t.x+t.width/2-n.width/2,o=t.y+t.height/2-n.height/2,l;switch(i){case Rn:l={x:s,y:t.y-n.height};break;case mr:l={x:s,y:t.y+t.height};break;case gr:l={x:t.x+t.width,y:o};break;case Fn:l={x:t.x-n.width,y:o};break;default:l={x:t.x,y:t.y}}var u=i?Hm(i):null;if(u!=null){var c=u==="y"?"height":"width";switch(a){case Ys:l[u]=l[u]-(t[c]/2-n[c]/2);break;case Ol:l[u]=l[u]+(t[c]/2-n[c]/2);break}}return l}function Nl(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,a=n.strategy,s=a===void 0?e.strategy:a,o=n.boundary,l=o===void 0?_B:o,u=n.rootBoundary,c=u===void 0?k8:u,d=n.elementContext,f=d===void 0?Ao:d,p=n.altBoundary,g=p===void 0?!1:p,m=n.padding,y=m===void 0?0:m,v=P8(typeof y!="number"?y:R8(y,Hl)),b=f===Ao?CB:Ao,T=e.rects.popper,_=e.elements[g?b:f],C=nM(Wa(_)?_:_.contextElement||ca(e.elements.popper),l,c,s),A=Qs(e.elements.reference),S=B8({reference:A,element:T,strategy:"absolute",placement:i}),I=sp(Object.assign({},T,S)),B=f===Ao?I:A,F={top:C.top-B.top+v.top,bottom:B.bottom-C.bottom+v.bottom,left:C.left-B.left+v.left,right:B.right-C.right+v.right},R=e.modifiersData.offset;if(f===Ao&&R){var N=R[i];Object.keys(F).forEach(function(k){var M=[gr,mr].indexOf(k)>=0?1:-1,$=[Rn,mr].indexOf(k)>=0?"y":"x";F[k]+=N[$]*M})}return F}function rM(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,a=n.rootBoundary,s=n.padding,o=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?D8:l,c=Xs(r),d=c?o?V9:V9.filter(function(g){return Xs(g)===c}):Hl,f=d.filter(function(g){return u.indexOf(g)>=0});f.length===0&&(f=d);var p=f.reduce(function(g,m){return g[m]=Nl(e,{placement:m,boundary:i,rootBoundary:a,padding:s})[Gr(m)],g},{});return Object.keys(p).sort(function(g,m){return p[g]-p[m]})}function iM(e){if(Gr(e)===Lm)return[];var t=Sc(e);return[Y9(e),t,Y9(t)]}function aM(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,s=n.altAxis,o=s===void 0?!0:s,l=n.fallbackPlacements,u=n.padding,c=n.boundary,d=n.rootBoundary,f=n.altBoundary,p=n.flipVariations,g=p===void 0?!0:p,m=n.allowedAutoPlacements,y=t.options.placement,v=Gr(y),b=v===y,T=l||(b||!g?[Sc(y)]:iM(y)),_=[y].concat(T).reduce(function(H,j){return H.concat(Gr(j)===Lm?rM(t,{placement:j,boundary:c,rootBoundary:d,padding:u,flipVariations:g,allowedAutoPlacements:m}):j)},[]),C=t.rects.reference,A=t.rects.popper,S=new Map,I=!0,B=_[0],F=0;F<_.length;F++){var R=_[F],N=Gr(R),k=Xs(R)===Ys,M=[Rn,mr].indexOf(N)>=0,$=M?"width":"height",z=Nl(t,{placement:R,boundary:c,rootBoundary:d,altBoundary:f,padding:u}),P=M?k?gr:Fn:k?mr:Rn;C[$]>A[$]&&(P=Sc(P));var te=Sc(P),ee=[];if(a&&ee.push(z[N]<=0),o&&ee.push(z[P]<=0,z[te]<=0),ee.every(function(H){return H})){B=R,I=!1;break}S.set(R,ee)}if(I)for(var D=g?3:1,x=function(j){var U=_.find(function(Q){var ie=S.get(Q);if(ie)return ie.slice(0,j).every(function(J){return J})});if(U)return B=U,"break"},V=D;V>0;V--){var L=x(V);if(L==="break")break}t.placement!==B&&(t.modifiersData[r]._skip=!0,t.placement=B,t.reset=!0)}}const sM={name:"flip",enabled:!0,phase:"main",fn:aM,requiresIfExists:["offset"],data:{_skip:!1}};function Q9(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 X9(e){return[Rn,gr,mr,Fn].some(function(t){return e[t]>=0})}function oM(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,a=t.modifiersData.preventOverflow,s=Nl(t,{elementContext:"reference"}),o=Nl(t,{altBoundary:!0}),l=Q9(s,r),u=Q9(o,i,a),c=X9(l),d=X9(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 lM={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:oM};function uM(e,t,n){var r=Gr(e),i=[Fn,Rn].indexOf(r)>=0?-1:1,a=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,s=a[0],o=a[1];return s=s||0,o=(o||0)*i,[Fn,gr].indexOf(r)>=0?{x:o,y:s}:{x:s,y:o}}function cM(e){var t=e.state,n=e.options,r=e.name,i=n.offset,a=i===void 0?[0,0]:i,s=D8.reduce(function(c,d){return c[d]=uM(d,t.rects,a),c},{}),o=s[t.placement],l=o.x,u=o.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=s}const dM={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:cM};function fM(e){var t=e.state,n=e.name;t.modifiersData[n]=B8({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const hM={name:"popperOffsets",enabled:!0,phase:"read",fn:fM,data:{}};function pM(e){return e==="x"?"y":"x"}function mM(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,a=i===void 0?!0:i,s=n.altAxis,o=s===void 0?!1:s,l=n.boundary,u=n.rootBoundary,c=n.altBoundary,d=n.padding,f=n.tether,p=f===void 0?!0:f,g=n.tetherOffset,m=g===void 0?0:g,y=Nl(t,{boundary:l,rootBoundary:u,padding:d,altBoundary:c}),v=Gr(t.placement),b=Xs(t.placement),T=!b,_=Hm(v),C=pM(_),A=t.modifiersData.popperOffsets,S=t.rects.reference,I=t.rects.popper,B=typeof m=="function"?m(Object.assign({},t.rects,{placement:t.placement})):m,F=typeof B=="number"?{mainAxis:B,altAxis:B}:Object.assign({mainAxis:0,altAxis:0},B),R=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,N={x:0,y:0};if(A){if(a){var k,M=_==="y"?Rn:Fn,$=_==="y"?mr:gr,z=_==="y"?"height":"width",P=A[_],te=P+y[M],ee=P-y[$],D=p?-I[z]/2:0,x=b===Ys?S[z]:I[z],V=b===Ys?-I[z]:-S[z],L=t.elements.arrow,H=p&&L?jm(L):{width:0,height:0},j=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:I8(),U=j[M],Q=j[$],ie=sl(0,S[z],H[z]),J=T?S[z]/2-D-ie-U-F.mainAxis:x-ie-U-F.mainAxis,W=T?-S[z]/2+D+ie+Q+F.mainAxis:V+ie+Q+F.mainAxis,ae=t.elements.arrow&&Ul(t.elements.arrow),oe=ae?_==="y"?ae.clientTop||0:ae.clientLeft||0:0,be=(k=R==null?void 0:R[_])!=null?k:0,we=P+J-be-oe,He=P+W-be,Be=sl(p?r1(te,we):te,P,p?Ma(ee,He):ee);A[_]=Be,N[_]=Be-P}if(o){var $e,Ye=_==="x"?Rn:Fn,qe=_==="x"?mr:gr,Je=A[C],rt=C==="y"?"height":"width",pe=Je+y[Ye],ce=Je-y[qe],me=[Rn,Fn].indexOf(v)!==-1,X=($e=R==null?void 0:R[C])!=null?$e:0,he=me?pe:Je-S[rt]-I[rt]-X+F.altAxis,Se=me?Je+S[rt]+I[rt]-X-F.altAxis:ce,Oe=p&&me?$B(he,Je,Se):sl(p?he:pe,Je,p?Se:ce);A[C]=Oe,N[C]=Oe-Je}t.modifiersData[r]=N}}const gM={name:"preventOverflow",enabled:!0,phase:"main",fn:mM,requiresIfExists:["offset"]};function vM(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function yM(e){return e===Qn(e)||!fr(e)?Um(e):vM(e)}function EM(e){var t=e.getBoundingClientRect(),n=Zs(t.width)/e.offsetWidth||1,r=Zs(t.height)/e.offsetHeight||1;return n!==1||r!==1}function bM(e,t,n){n===void 0&&(n=!1);var r=fr(t),i=fr(t)&&EM(t),a=ca(t),s=Qs(e,i,n),o={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((ti(t)!=="body"||qm(a))&&(o=yM(t)),fr(t)?(l=Qs(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):a&&(l.x=zm(a))),{x:s.left+o.scrollLeft-l.x,y:s.top+o.scrollTop-l.y,width:s.width,height:s.height}}function TM(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 s=[].concat(a.requires||[],a.requiresIfExists||[]);s.forEach(function(o){if(!n.has(o)){var l=t.get(o);l&&i(l)}}),r.push(a)}return e.forEach(function(a){n.has(a.name)||i(a)}),r}function _M(e){var t=TM(e);return PB.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function CM(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function xM(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 J9={placement:"bottom",modifiers:[],strategy:"absolute"};function e5(){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 wM(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,i=t.defaultOptions,a=i===void 0?J9:i;return function(o,l,u){u===void 0&&(u=a);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},J9,a),modifiersData:{},elements:{reference:o,popper:l},attributes:{},styles:{}},d=[],f=!1,p={state:c,setOptions:function(v){var b=typeof v=="function"?v(c.options):v;m(),c.options=Object.assign({},a,c.options,b),c.scrollParents={reference:Wa(o)?ol(o):o.contextElement?ol(o.contextElement):[],popper:ol(l)};var T=_M(xM([].concat(r,c.options.modifiers)));return c.orderedModifiers=T.filter(function(_){return _.enabled}),g(),p.update()},forceUpdate:function(){if(!f){var v=c.elements,b=v.reference,T=v.popper;if(e5(b,T)){c.rects={reference:bM(b,Ul(T),c.options.strategy==="fixed"),popper:jm(T)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(F){return c.modifiersData[F.name]=Object.assign({},F.data)});for(var _=0;_<c.orderedModifiers.length;_++){if(c.reset===!0){c.reset=!1,_=-1;continue}var C=c.orderedModifiers[_],A=C.fn,S=C.options,I=S===void 0?{}:S,B=C.name;typeof A=="function"&&(c=A({state:c,options:I,name:B,instance:p})||c)}}}},update:CM(function(){return new Promise(function(y){p.forceUpdate(),y(c)})}),destroy:function(){m(),f=!0}};if(!e5(o,l))return p;p.setOptions(u).then(function(y){!f&&u.onFirstUpdate&&u.onFirstUpdate(y)});function g(){c.orderedModifiers.forEach(function(y){var v=y.name,b=y.options,T=b===void 0?{}:b,_=y.effect;if(typeof _=="function"){var C=_({state:c,name:v,instance:p,options:T}),A=function(){};d.push(C||A)}})}function m(){d.forEach(function(y){return y()}),d=[]}return p}}var AM=[YB,hM,KB,BB,dM,sM,gM,zB,lM],SM=wM({defaultModifiers:AM}),kM=typeof Element<"u",DM=typeof Map=="function",OM=typeof Set=="function",NM=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function kc(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(!kc(e[r],t[r]))return!1;return!0}var a;if(DM&&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(!kc(r.value[1],t.get(r.value[0])))return!1;return!0}if(OM&&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(NM&&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(kM&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((i[r]==="_owner"||i[r]==="__v"||i[r]==="__o")&&e.$$typeof)&&!kc(e[i[r]],t[i[r]]))return!1;return!0}return e!==e&&t!==t}var IM=function(t,n){try{return kc(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 PM=Or(IM);var RM=[],FM=function(t,n,r){r===void 0&&(r={});var i=un.useRef(null),a={onFirstUpdate:r.onFirstUpdate,placement:r.placement||"bottom",strategy:r.strategy||"absolute",modifiers:r.modifiers||RM},s=un.useState({styles:{popper:{position:a.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),o=s[0],l=s[1],u=un.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(p){var g=p.state,m=Object.keys(g.elements);cx.flushSync(function(){l({styles:q9(m.map(function(y){return[y,g.styles[y]||{}]})),attributes:q9(m.map(function(y){return[y,g.attributes[y]]}))})})},requires:["computeStyles"]}},[]),c=un.useMemo(function(){var f={onFirstUpdate:a.onFirstUpdate,placement:a.placement,strategy:a.strategy,modifiers:[].concat(a.modifiers,[u,{name:"applyStyles",enabled:!1}])};return PM(i.current,f)?i.current||f:(i.current=f,f)},[a.onFirstUpdate,a.placement,a.strategy,a.modifiers,u]),d=un.useRef();return W9(function(){d.current&&d.current.setOptions(c)},[c]),W9(function(){if(!(t==null||n==null)){var f=r.createPopper||SM,p=f(t,n,c);return d.current=p,function(){p.destroy(),d.current=null}}},[t,n,r.createPopper]),{state:d.current?d.current.state:null,styles:o.styles,attributes:o.attributes,update:d.current?d.current.update:null,forceUpdate:d.current?d.current.forceUpdate:null}};function op(){return op=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},op.apply(this,arguments)}function M8(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var BM=/^((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)-.*))$/,MM=M8(function(e){return BM.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),LM=!1;function $M(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 jM(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 HM=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?!LM: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(jM(this));var i=this.tags[this.tags.length-1];if(this.isSpeedy){var a=$M(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}(),fn="-ms-",i1="-moz-",vt="-webkit-",L8="comm",Wm="rule",Vm="decl",UM="@import",$8="@keyframes",zM="@layer",qM=Math.abs,I1=String.fromCharCode,WM=Object.assign;function VM(e,t){return ln(e,0)^45?(((t<<2^ln(e,0))<<2^ln(e,1))<<2^ln(e,2))<<2^ln(e,3):0}function j8(e){return e.trim()}function KM(e,t){return(e=t.exec(e))?e[0]:e}function yt(e,t,n){return e.replace(t,n)}function lp(e,t){return e.indexOf(t)}function ln(e,t){return e.charCodeAt(t)|0}function Il(e,t,n){return e.slice(t,n)}function jr(e){return e.length}function Km(e){return e.length}function Du(e,t){return t.push(e),e}function GM(e,t){return e.map(t).join("")}var P1=1,Js=1,H8=0,Mn=0,Gt=0,so="";function R1(e,t,n,r,i,a,s){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:P1,column:Js,length:s,return:""}}function So(e,t){return WM(R1("",null,null,"",null,null,0),e,{length:-e.length},t)}function YM(){return Gt}function ZM(){return Gt=Mn>0?ln(so,--Mn):0,Js--,Gt===10&&(Js=1,P1--),Gt}function Gn(){return Gt=Mn<H8?ln(so,Mn++):0,Js++,Gt===10&&(Js=1,P1++),Gt}function Yr(){return ln(so,Mn)}function Dc(){return Mn}function zl(e,t){return Il(so,e,t)}function Pl(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 U8(e){return P1=Js=1,H8=jr(so=e),Mn=0,[]}function z8(e){return so="",e}function Oc(e){return j8(zl(Mn-1,up(e===91?e+2:e===40?e+1:e)))}function QM(e){for(;(Gt=Yr())&&Gt<33;)Gn();return Pl(e)>2||Pl(Gt)>3?"":" "}function XM(e,t){for(;--t&&Gn()&&!(Gt<48||Gt>102||Gt>57&&Gt<65||Gt>70&&Gt<97););return zl(e,Dc()+(t<6&&Yr()==32&&Gn()==32))}function up(e){for(;Gn();)switch(Gt){case e:return Mn;case 34:case 39:e!==34&&e!==39&&up(Gt);break;case 40:e===41&&up(e);break;case 92:Gn();break}return Mn}function JM(e,t){for(;Gn()&&e+Gt!==47+10;)if(e+Gt===42+42&&Yr()===47)break;return"/*"+zl(t,Mn-1)+"*"+I1(e===47?e:Gn())}function eL(e){for(;!Pl(Yr());)Gn();return zl(e,Mn)}function tL(e){return z8(Nc("",null,null,null,[""],e=U8(e),0,[0],e))}function Nc(e,t,n,r,i,a,s,o,l){for(var u=0,c=0,d=s,f=0,p=0,g=0,m=1,y=1,v=1,b=0,T="",_=i,C=a,A=r,S=T;y;)switch(g=b,b=Gn()){case 40:if(g!=108&&ln(S,d-1)==58){lp(S+=yt(Oc(b),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:S+=Oc(b);break;case 9:case 10:case 13:case 32:S+=QM(g);break;case 92:S+=XM(Dc()-1,7);continue;case 47:switch(Yr()){case 42:case 47:Du(nL(JM(Gn(),Dc()),t,n),l);break;default:S+="/"}break;case 123*m:o[u++]=jr(S)*v;case 125*m:case 59:case 0:switch(b){case 0:case 125:y=0;case 59+c:v==-1&&(S=yt(S,/\f/g,"")),p>0&&jr(S)-d&&Du(p>32?n5(S+";",r,n,d-1):n5(yt(S," ","")+";",r,n,d-2),l);break;case 59:S+=";";default:if(Du(A=t5(S,t,n,u,c,i,o,T,_=[],C=[],d),a),b===123)if(c===0)Nc(S,t,A,A,_,a,d,o,C);else switch(f===99&&ln(S,3)===110?100:f){case 100:case 108:case 109:case 115:Nc(e,A,A,r&&Du(t5(e,A,A,0,0,i,o,T,i,_=[],d),C),i,C,d,o,r?_:C);break;default:Nc(S,A,A,A,[""],C,0,o,C)}}u=c=p=0,m=v=1,T=S="",d=s;break;case 58:d=1+jr(S),p=g;default:if(m<1){if(b==123)--m;else if(b==125&&m++==0&&ZM()==125)continue}switch(S+=I1(b),b*m){case 38:v=c>0?1:(S+="\f",-1);break;case 44:o[u++]=(jr(S)-1)*v,v=1;break;case 64:Yr()===45&&(S+=Oc(Gn())),f=Yr(),c=d=jr(T=S+=eL(Dc())),b++;break;case 45:g===45&&jr(S)==2&&(m=0)}}return a}function t5(e,t,n,r,i,a,s,o,l,u,c){for(var d=i-1,f=i===0?a:[""],p=Km(f),g=0,m=0,y=0;g<r;++g)for(var v=0,b=Il(e,d+1,d=qM(m=s[g])),T=e;v<p;++v)(T=j8(m>0?f[v]+" "+b:yt(b,/&\f/g,f[v])))&&(l[y++]=T);return R1(e,t,n,i===0?Wm:o,l,u,c)}function nL(e,t,n){return R1(e,t,n,L8,I1(YM()),Il(e,2,-2),0)}function n5(e,t,n,r){return R1(e,t,n,Vm,Il(e,0,r),Il(e,r+1,-1),r)}function Fs(e,t){for(var n="",r=Km(e),i=0;i<r;i++)n+=t(e[i],i,e,t)||"";return n}function rL(e,t,n,r){switch(e.type){case zM:if(e.children.length)break;case UM:case Vm:return e.return=e.return||e.value;case L8:return"";case $8:return e.return=e.value+"{"+Fs(e.children,r)+"}";case Wm:e.value=e.props.join(",")}return jr(n=Fs(e.children,r))?e.return=e.value+"{"+n+"}":""}function iL(e){var t=Km(e);return function(n,r,i,a){for(var s="",o=0;o<t;o++)s+=e[o](n,r,i,a)||"";return s}}function aL(e){return function(t){t.root||(t=t.return)&&e(t)}}var sL=function(t,n,r){for(var i=0,a=0;i=a,a=Yr(),i===38&&a===12&&(n[r]=1),!Pl(a);)Gn();return zl(t,Mn)},oL=function(t,n){var r=-1,i=44;do switch(Pl(i)){case 0:i===38&&Yr()===12&&(n[r]=1),t[r]+=sL(Mn-1,n,r);break;case 2:t[r]+=Oc(i);break;case 4:if(i===44){t[++r]=Yr()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=I1(i)}while(i=Gn());return t},lL=function(t,n){return z8(oL(U8(t),n))},r5=new WeakMap,uL=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&&!r5.get(r))&&!i){r5.set(t,!0);for(var a=[],s=lL(n,a),o=r.props,l=0,u=0;l<s.length;l++)for(var c=0;c<o.length;c++,u++)t.props[u]=a[l]?s[l].replace(/&\f/g,o[c]):o[c]+" "+s[l]}}},cL=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function q8(e,t){switch(VM(e,t)){case 5103:return vt+"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 vt+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return vt+e+i1+e+fn+e+e;case 6828:case 4268:return vt+e+fn+e+e;case 6165:return vt+e+fn+"flex-"+e+e;case 5187:return vt+e+yt(e,/(\w+).+(:[^]+)/,vt+"box-$1$2"+fn+"flex-$1$2")+e;case 5443:return vt+e+fn+"flex-item-"+yt(e,/flex-|-self/,"")+e;case 4675:return vt+e+fn+"flex-line-pack"+yt(e,/align-content|flex-|-self/,"")+e;case 5548:return vt+e+fn+yt(e,"shrink","negative")+e;case 5292:return vt+e+fn+yt(e,"basis","preferred-size")+e;case 6060:return vt+"box-"+yt(e,"-grow","")+vt+e+fn+yt(e,"grow","positive")+e;case 4554:return vt+yt(e,/([^-])(transform)/g,"$1"+vt+"$2")+e;case 6187:return yt(yt(yt(e,/(zoom-|grab)/,vt+"$1"),/(image-set)/,vt+"$1"),e,"")+e;case 5495:case 3959:return yt(e,/(image-set\([^]*)/,vt+"$1$`$1");case 4968:return yt(yt(e,/(.+:)(flex-)?(.*)/,vt+"box-pack:$3"+fn+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+vt+e+e;case 4095:case 3583:case 4068:case 2532:return yt(e,/(.+)-inline(.+)/,vt+"$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(jr(e)-1-t>6)switch(ln(e,t+1)){case 109:if(ln(e,t+4)!==45)break;case 102:return yt(e,/(.+:)(.+)-([^]+)/,"$1"+vt+"$2-$3$1"+i1+(ln(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~lp(e,"stretch")?q8(yt(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(ln(e,t+1)!==115)break;case 6444:switch(ln(e,jr(e)-3-(~lp(e,"!important")&&10))){case 107:return yt(e,":",":"+vt)+e;case 101:return yt(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+vt+(ln(e,14)===45?"inline-":"")+"box$3$1"+vt+"$2$3$1"+fn+"$2box$3")+e}break;case 5936:switch(ln(e,t+11)){case 114:return vt+e+fn+yt(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return vt+e+fn+yt(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return vt+e+fn+yt(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return vt+e+fn+e+e}return e}var dL=function(t,n,r,i){if(t.length>-1&&!t.return)switch(t.type){case Vm:t.return=q8(t.value,t.length);break;case $8:return Fs([So(t,{value:yt(t.value,"@","@"+vt)})],i);case Wm:if(t.length)return GM(t.props,function(a){switch(KM(a,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Fs([So(t,{props:[yt(a,/:(read-\w+)/,":"+i1+"$1")]})],i);case"::placeholder":return Fs([So(t,{props:[yt(a,/:(plac\w+)/,":"+vt+"input-$1")]}),So(t,{props:[yt(a,/:(plac\w+)/,":"+i1+"$1")]}),So(t,{props:[yt(a,/:(plac\w+)/,fn+"input-$1")]})],i)}return""})}},fL=[dL],hL=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(m){var y=m.getAttribute("data-emotion");y.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var i=t.stylisPlugins||fL,a={},s,o=[];s=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(m){for(var y=m.getAttribute("data-emotion").split(" "),v=1;v<y.length;v++)a[y[v]]=!0;o.push(m)});var l,u=[uL,cL];{var c,d=[rL,aL(function(m){c.insert(m)})],f=iL(u.concat(i,d)),p=function(y){return Fs(tL(y),f)};l=function(y,v,b,T){c=b,p(y?y+"{"+v.styles+"}":v.styles),T&&(g.inserted[v.name]=!0)}}var g={key:n,sheet:new HM({key:n,container:s,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:a,registered:{},insert:l};return g.sheet.hydrate(o),g},W8=Up(),pL={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},mL={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},V8={};V8[W8.ForwardRef]=pL;V8[W8.Memo]=mL;var gL=!0;function vL(e,t,n){var r="";return n.split(" ").forEach(function(i){e[i]!==void 0?t.push(e[i]+";"):i&&(r+=i+" ")}),r}var K8=function(t,n,r){var i=t.key+"-"+n.name;(r===!1||gL===!1)&&t.registered[i]===void 0&&(t.registered[i]=n.styles)},yL=function(t,n,r){K8(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 EL(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 bL={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},TL=!1,_L=/[A-Z]|^ms/g,CL=/_EMO_([^_]+?)_([^]*?)_EMO_/g,G8=function(t){return t.charCodeAt(1)===45},i5=function(t){return t!=null&&typeof t!="boolean"},of=M8(function(e){return G8(e)?e:e.replace(_L,"-$&").toLowerCase()}),a5=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(CL,function(r,i,a){return Hr={name:i,styles:a,next:Hr},i})}return bL[t]!==1&&!G8(t)&&typeof n=="number"&&n!==0?n+"px":n},xL="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function Rl(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 Hr={name:i.name,styles:i.styles,next:Hr},i.name;var a=n;if(a.styles!==void 0){var s=a.next;if(s!==void 0)for(;s!==void 0;)Hr={name:s.name,styles:s.styles,next:Hr},s=s.next;var o=a.styles+";";return o}return wL(e,t,n)}case"function":{if(e!==void 0){var l=Hr,u=n(e);return Hr=l,Rl(e,t,u)}break}}var c=n;if(t==null)return c;var d=t[c];return d!==void 0?d:c}function wL(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=Rl(e,t,n[i])+";";else for(var a in n){var s=n[a];if(typeof s!="object"){var o=s;t!=null&&t[o]!==void 0?r+=a+"{"+t[o]+"}":i5(o)&&(r+=of(a)+":"+a5(a,o)+";")}else{if(a==="NO_COMPONENT_SELECTOR"&&TL)throw new Error(xL);if(Array.isArray(s)&&typeof s[0]=="string"&&(t==null||t[s[0]]===void 0))for(var l=0;l<s.length;l++)i5(s[l])&&(r+=of(a)+":"+a5(a,s[l])+";");else{var u=Rl(e,t,s);switch(a){case"animation":case"animationName":{r+=of(a)+":"+u+";";break}default:r+=a+"{"+u+"}"}}}}return r}var s5=/label:\s*([^\s;{]+)\s*(;|$)/g,Hr;function Y8(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="";Hr=void 0;var a=e[0];if(a==null||a.raw===void 0)r=!1,i+=Rl(n,t,a);else{var s=a;i+=s[0]}for(var o=1;o<e.length;o++)if(i+=Rl(n,t,e[o]),r){var l=a;i+=l[o]}s5.lastIndex=0;for(var u="",c;(c=s5.exec(i))!==null;)u+="-"+c[1];var d=EL(i)+u;return{name:d,styles:i,next:Hr}}var AL=function(t){return t()},SL=un["useInsertionEffect"]?un["useInsertionEffect"]:!1,kL=SL||AL,Z8=un.createContext(typeof HTMLElement<"u"?hL({key:"css"}):null);Z8.Provider;var DL=function(t){return E.forwardRef(function(n,r){var i=E.useContext(Z8);return t(n,i,r)})},OL=un.createContext({});function NL(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Y8(t)}var IL=function(){var t=NL.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_"}}},PL=MM,RL=function(t){return t!=="theme"},o5=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?PL:RL},l5=function(t,n,r){var i;if(n){var a=n.shouldForwardProp;i=t.__emotion_forwardProp&&a?function(s){return t.__emotion_forwardProp(s)&&a(s)}:a}return typeof i!="function"&&r&&(i=t.__emotion_forwardProp),i},FL=!1,BL=function(t){var n=t.cache,r=t.serialized,i=t.isStringTag;return K8(n,r,i),kL(function(){return yL(n,r,i)}),null},ML=function e(t,n){var r=t.__emotion_real===t,i=r&&t.__emotion_base||t,a,s;n!==void 0&&(a=n.label,s=n.target);var o=l5(t,n,r),l=o||o5(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,p=1;p<f;p++)d.push(c[p],c[0][p])}var g=DL(function(m,y,v){var b=u&&m.as||i,T="",_=[],C=m;if(m.theme==null){C={};for(var A in m)C[A]=m[A];C.theme=un.useContext(OL)}typeof m.className=="string"?T=vL(y.registered,_,m.className):m.className!=null&&(T=m.className+" ");var S=Y8(d.concat(_),y.registered,C);T+=y.key+"-"+S.name,s!==void 0&&(T+=" "+s);var I=u&&o===void 0?o5(b):l,B={};for(var F in m)u&&F==="as"||I(F)&&(B[F]=m[F]);return B.className=T,v&&(B.ref=v),un.createElement(un.Fragment,null,un.createElement(BL,{cache:y,serialized:S,isStringTag:typeof b=="string"}),un.createElement(b,B))});return g.displayName=a!==void 0?a:"Styled("+(typeof i=="string"?i:i.displayName||i.name||"Component")+")",g.defaultProps=t.defaultProps,g.__emotion_real=g,g.__emotion_base=i,g.__emotion_styles=d,g.__emotion_forwardProp=o,Object.defineProperty(g,"toString",{value:function(){return s===void 0&&FL?"NO_COMPONENT_SELECTOR":"."+s}}),g.withComponent=function(m,y){return e(m,op({},n,y,{shouldForwardProp:l5(g,y,!0)})).apply(void 0,d)},g}},LL=["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"],Ie=ML.bind();LL.forEach(function(e){Ie[e]=Ie(e)});var us={}.hasOwnProperty,Q8=$L;function $L(e){return!e||typeof e!="object"?"":us.call(e,"position")||us.call(e,"type")?u5(e.position):us.call(e,"start")||us.call(e,"end")?u5(e):us.call(e,"line")||us.call(e,"column")?cp(e):""}function cp(e){return(!e||typeof e!="object")&&(e={}),c5(e.line)+":"+c5(e.column)}function u5(e){return(!e||typeof e!="object")&&(e={}),cp(e.start)+"-"+cp(e.end)}function c5(e){return e&&typeof e=="number"?e:1}var jL=Q8,HL=Gm;function X8(){}X8.prototype=Error.prototype;Gm.prototype=new X8;var da=Gm.prototype;da.file="";da.name="";da.reason="";da.message="";da.stack="";da.fatal=null;da.column=null;da.line=null;function Gm(e,t,n){var r,i,a;typeof t=="string"&&(n=t,t=null),r=UL(n),i=jL(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 UL(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 oo={};oo.basename=zL;oo.dirname=qL;oo.extname=WL;oo.join=VL;oo.sep="/";function zL(e,t){var n=0,r=-1,i,a,s,o;if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');if(ql(e),i=e.length,t===void 0||!t.length||t.length>e.length){for(;i--;)if(e.charCodeAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";for(a=-1,o=t.length-1;i--;)if(e.charCodeAt(i)===47){if(s){n=i+1;break}}else a<0&&(s=!0,a=i+1),o>-1&&(e.charCodeAt(i)===t.charCodeAt(o--)?o<0&&(r=i):(o=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function qL(e){var t,n,r;if(ql(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 WL(e){var t=-1,n=0,r=-1,i=0,a,s,o;for(ql(e),o=e.length;o--;){if(s=e.charCodeAt(o),s===47){if(a){n=o+1;break}continue}r<0&&(a=!0,r=o+1),s===46?t<0?t=o: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 VL(){for(var e=-1,t;++e<arguments.length;)ql(arguments[e]),arguments[e]&&(t=t===void 0?arguments[e]:t+"/"+arguments[e]);return t===void 0?".":KL(t)}function KL(e){var t,n;return ql(e),t=e.charCodeAt(0)===47,n=GL(e,!t),!n.length&&!t&&(n="."),n.length&&e.charCodeAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function GL(e,t){for(var n="",r=0,i=-1,a=0,s=-1,o,l;++s<=e.length;){if(s<e.length)o=e.charCodeAt(s);else{if(o===47)break;o=47}if(o===47){if(!(i===s-1||a===1))if(i!==s-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=s,a=0;continue}}else if(n.length){n="",r=0,i=s,a=0;continue}}t&&(n=n.length?n+"/..":"..",r=2)}else n.length?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,a=0}else o===46&&a>-1?a++:a=-1}return n}function ql(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}var J8={};J8.cwd=YL;function YL(){return"/"}/*!
165
165
  * Determine if an object is a Buffer
166
166
  *
167
167
  * @author Feross Aboukhadijeh <https://feross.org>