@undrr/undrr-mangrove 2.2.0 → 2.4.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.
Files changed (100) hide show
  1. package/README.md +1 -1
  2. package/components/BookCard.js +5 -2
  3. package/components/Breadcrumbs.js +2 -2
  4. package/components/Checkbox.js +3 -2
  5. package/components/Chips.js +2 -2
  6. package/components/ContentCard.js +8 -2
  7. package/components/ContentTeaser.js +8 -2
  8. package/components/CopyButton.js +3 -2
  9. package/components/CtaButton.js +3 -2
  10. package/components/Drawer.js +2 -2
  11. package/components/Drawer.js.LICENSE.txt +1 -1
  12. package/components/DrupalContentPatterns.js +1 -1
  13. package/components/EmbedContainer.js +3 -2
  14. package/components/Footer.js +2 -2
  15. package/components/FormAction.js +3 -2
  16. package/components/FormErrorSummary.js +2 -2
  17. package/components/FormGroup.js +3 -2
  18. package/components/FullWidth.js +3 -2
  19. package/components/Gallery.js +3 -2
  20. package/components/Hero.js +6 -2
  21. package/components/HighlightBox.js +3 -2
  22. package/components/HorizontalBookCard.js +6 -2
  23. package/components/HorizontalBookCard.js.LICENSE.txt +1 -1
  24. package/components/HorizontalCard.js +6 -2
  25. package/components/HorizontalCard.js.LICENSE.txt +1 -1
  26. package/components/IconCard.js +4 -2
  27. package/components/IconCard.js.LICENSE.txt +1 -1
  28. package/components/Legend.js +3 -2
  29. package/components/Loader.js +2 -2
  30. package/components/MegaMenu.js +7 -2
  31. package/components/Notice.js +3 -2
  32. package/components/PageHeader.js +4 -2
  33. package/components/Pager.js +7 -2
  34. package/components/ProgressBar.js +3 -2
  35. package/components/QuoteHighlight.js +3 -2
  36. package/components/QuoteHighlight.js.LICENSE.txt +1 -1
  37. package/components/Radio.js +3 -2
  38. package/components/Range.js +3 -2
  39. package/components/ScrollContainer.js +2 -2
  40. package/components/SegmentedControl.js +6 -2
  41. package/components/Select.js +3 -2
  42. package/components/ServiceNotice.js +4 -2
  43. package/components/ShareButtons.js +4 -2
  44. package/components/ShowMore.js +3 -2
  45. package/components/SkipLink.js +3 -2
  46. package/components/StatsCard.js +5 -2
  47. package/components/StatsCard.js.LICENSE.txt +1 -1
  48. package/components/SyndicationSearchWidget.js +31 -2
  49. package/components/Tab.js +7 -2
  50. package/components/TextCta.js +4 -2
  51. package/components/TextCta.js.LICENSE.txt +1 -1
  52. package/components/TextInput.js +3 -2
  53. package/components/Textarea.js +3 -2
  54. package/components/Tree.js +7 -2
  55. package/components/UserFeedback.js +2 -2
  56. package/components/VerticalCard.js +6 -2
  57. package/components/VerticalCard.js.LICENSE.txt +1 -1
  58. package/components/hydrate.js +2 -2
  59. package/css/style-all.css +16 -10
  60. package/css/style-all.css.map +1 -1
  61. package/css/style-delta.css +16 -10
  62. package/css/style-delta.css.map +1 -1
  63. package/css/style-gutenberg.css +1 -1
  64. package/css/style-irp.css +16 -10
  65. package/css/style-irp.css.map +1 -1
  66. package/css/style-mcr.css +16 -10
  67. package/css/style-mcr.css.map +1 -1
  68. package/css/style-preventionweb.css +16 -10
  69. package/css/style-preventionweb.css.map +1 -1
  70. package/css/style.css +16 -10
  71. package/css/style.css.map +1 -1
  72. package/docs/EDITORIAL-MANUAL.md +2 -2
  73. package/docs/llms-editorial-manual.txt +1 -1
  74. package/docs/llms-page-building.txt +4 -2
  75. package/docs/llms-search-widget.txt +3 -1
  76. package/error-pages/401.html +1 -1
  77. package/error-pages/403.html +1 -1
  78. package/error-pages/404.html +1 -1
  79. package/error-pages/429.html +1 -1
  80. package/error-pages/500.html +1 -1
  81. package/error-pages/502.html +1 -1
  82. package/error-pages/503.html +1 -1
  83. package/error-pages/504.html +1 -1
  84. package/error-pages/5xx.html +1 -1
  85. package/error-pages/challenge.html +1 -1
  86. package/error-pages/managed-challenge.html +1 -1
  87. package/js/dialog.js +205 -0
  88. package/package.json +1 -1
  89. package/scss/Atom/BaseTypography/Code/code.scss +0 -1
  90. package/scss/Atom/Table/table.scss +0 -1
  91. package/scss/Atom/Tag/tag.scss +0 -1
  92. package/scss/Components/Buttons/ShareButtons/share-buttons.scss +18 -0
  93. package/scss/Components/Cards/StatsCard/stats-card.scss +0 -1
  94. package/scss/Components/Dialog/dialog.scss +87 -0
  95. package/scss/Components/MegaMenu/mega-menu.scss +460 -33
  96. package/scss/Components/SyndicationSearchWidget/syndication-search-widget.scss +70 -2
  97. package/scss/Patterns/Content/Publication/publication-record.scss +110 -0
  98. package/scss/Patterns/LandingPages/publication-example.scss +28 -0
  99. package/scss/assets/scss/_components.scss +1 -0
  100. package/scss/assets/scss/_variables.scss +1 -1
@@ -3,7 +3,12 @@
3
3
  * Storybook: https://mangrove.undrr.org/
4
4
  * LLMs context: https://mangrove.undrr.org/llms.txt
5
5
  * Repository: https://github.com/PreventionWeb/undrr-mangrove
6
- * Compiled on: 2026-10-17T14:23:48.871Z
6
+ * Compiled on: 2026-11-09T16:21:46.474Z
7
7
  */
8
8
  /*! For license information please see MegaMenu.js.LICENSE.txt */
9
- import{useEffect as e,useId as t,useLayoutEffect as n,useRef as r,useState as i}from"react";var a={2694(e,t,n){var r=n(6925);function i(){}function a(){}a.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,a,o){if(o!==r){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:i};return n.PropTypes=n,n}},5556(e,t,n){e.exports=n(2694)()},6925(e){e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}};const o={};function l(e){const t=o[e];if(void 0!==t)return t.exports;const n=o[e]={exports:{}};return a[e](n,n.exports,l),n.exports}l.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return l.d(t,{a:t}),t},l.cw=e=>{var t;return()=>{if(e){var n=e;e=0,t={exports:{}},n.call(t.exports,t,t.exports)}return t.exports}},l.d=(e,t)=>{for(var n in t)l.o(t,n)&&!l.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var s=l.cw(function(e,t){var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function i(e,t,r){var i=null;if(void 0!==r&&(i=""+r),void 0!==t.key&&(i=""+t.key),"key"in t)for(var a in r={},t)"key"!==a&&(r[a]=t[a]);else r=t;return t=r.ref,{$$typeof:n,type:e,key:i,ref:void 0!==t?t:null,props:r}}t.Fragment=r,t.jsx=i,t.jsxs=i}),c=l.cw(function(e,t){e.exports=s()}),m=l(5556),u=l.n(m);function d({section:t,isActive:n,index:a,sectionListRef:o,itemListRef:l}){const[c,m]=i(0),[u,d]=i(0),[g,b]=i([]),p=t?.title||"Menu section",h=r(null),f=r(null),v=e=>{if(["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(e.key)&&(e.preventDefault(),e.stopPropagation()),"ArrowDown"!==e.key&&"Tab"!==e.key||(u<g?.length-1?d(e=>e+1):(d(0),l.current?.[a+1]?.focus())),("ArrowUp"===e.key||e.shiftKey&&"Tab"===e.key)&&(u>0?d(e=>e-1):(l.current?.[a]?.focus(),d(0))),h.current&&("ArrowLeft"===e.key&&d(0),"ArrowRight"===e.key)){const e=f.current,t=e?.querySelector("ul > li > a");if(t){e.setAttribute("tabindex","-1"),t.focus();const n=g.findIndex(e=>e===t);-1!==n&&d(n)}else{f.current?.focus();const e=g.filter(e=>e===f.current);e[0]&&d(g.indexOf(e[0]))}}};return e(()=>{const e=o?.current?.[a]?.querySelectorAll("audio, button, a, canvas, details, iframe, input, select, summary, textarea, video, [tabindex]");b(Array.from(e||[]))},[o,a,c]),e(()=>{g.length>0&&u>=0&&g[u]?.focus()},[u]),(0,s().jsxs)(s().Fragment,{children:[t&&t.items&&(0,s().jsxs)("article",{className:"mg-mega-content | mg-container-full-width","aria-label":p,"aria-live":"polite","aria-hidden":!n,inert:!n||void 0,tabIndex:0,ref:e=>{o.current[a]=e},onKeyDown:v,role:"region",children:[t.bannerHeading&&t.bannerDescription&&t.items&&(0,s().jsxs)("nav",{className:"mg-mega-content__left","aria-label":`${p} categories`,ref:h,tabIndex:0,children:[(0,s().jsxs)("section",{className:"mg-mega-content__banner",children:[(0,s().jsx)("header",{children:t.bannerHeading}),t.bannerDescription.includes("<")?(0,s().jsx)("div",{dangerouslySetInnerHTML:{__html:t.bannerDescription}}):(0,s().jsx)("p",{children:t.bannerDescription}),t.bannerButton?.label&&(0,s().jsx)("a",{href:t.bannerButton.url,className:"mg-button mg-button-primary",children:t.bannerButton.label})]}),t.items.length>0&&t.items[0].items&&t.items[0].items.length>0?(0,s().jsx)("ul",{className:"mg-mega-content__section-list",role:"menu","aria-label":"Categories",children:t.items.map((e,t)=>(0,s().jsx)("li",{className:"mg-mega-content__section-list-item",onMouseEnter:()=>m(t),role:"none",children:(0,s().jsx)("a",{className:"mg-mega-content__section-list-link "+(c===t?"mg-mega-content__section-list-link--active":""),href:e.url,"aria-current":c===t?"page":void 0,onFocus:()=>m(t),role:"menuitem","aria-haspopup":e.items&&e.items.length>0?"true":void 0,children:e.title})},t))}):null]}),t.items&&(0,s().jsxs)("nav",{className:"mg-mega-content__right","aria-label":`${p} submenu`,ref:f,tabIndex:0,children:[(0,s().jsx)("ul",{role:"menu","aria-label":"Submenu items",className:"mg-mega-content__menu--mobile",children:t.items.map((e,t)=>(0,s().jsxs)("li",{role:"none",children:[(0,s().jsx)("a",{href:e.url,role:"menuitem","aria-haspopup":e.items?"true":void 0,children:e.title}),e.items&&e.items.length>0&&(0,s().jsx)("ul",{role:"menu","aria-label":`${e.title} submenu`,children:e.items.map((e,t)=>(0,s().jsxs)("li",{role:"none",children:[(0,s().jsx)("a",{href:e.url,role:"menuitem","aria-haspopup":e.items?"true":void 0,children:e.title}),e.items&&(0,s().jsx)("ul",{role:"menu","aria-label":`${e.title} nested submenu`,children:e.items.map((e,t)=>(0,s().jsx)("li",{role:"none",children:(0,s().jsx)("a",{href:e.url,role:"menuitem",children:e.title})},t))})]},t))})]},t))}),(0,s().jsx)("ul",{role:"menu","aria-label":"Submenu items",className:"mg-mega-content__menu--desktop",children:t.items[c]?.items?t.items[c].items.map((e,t)=>(0,s().jsxs)("li",{role:"none",children:[(0,s().jsx)("a",{href:e.url,role:"menuitem","aria-haspopup":e.items?"true":void 0,children:e.title}),e.items&&(0,s().jsx)("ul",{role:"menu","aria-label":`${e.title} submenu`,children:e.items.map((e,t)=>(0,s().jsx)("li",{role:"none",children:(0,s().jsx)("a",{href:e.url,role:"menuitem",children:e.title})},t))})]},t)):t.items.map((e,t)=>(0,s().jsx)("li",{role:"none",children:(0,s().jsx)("a",{href:e.url,role:"menuitem",children:e.title})},t))})]})]}),t&&!t.items&&t.bannerDescription&&(0,s().jsx)("article",{className:"mg-mega-content | mg-container-full-width","aria-live":"polite","aria-hidden":!n,inert:!n||void 0,"aria-label":p,tabIndex:0,ref:e=>{o.current[a]=e},dangerouslySetInnerHTML:{__html:t.bannerDescription},onKeyDown:v})]})}function g({inert:e,title:t,icon:n,onMouseEnter:r,activeItem:i,link:a,bannerDescription:o,handleOnKeyDown:l,ref:c,section:m,sectionListRef:u,itemListRef:g,index:b}){const p=b===i,h=Boolean(m&&m.items),f=(0,s().jsxs)(s().Fragment,{children:[n&&(0,s().jsx)("span",{className:`mg-mega-topbar__item-icon ${n}`,"aria-hidden":"true"}),t]});return(0,s().jsxs)("li",{inert:!!e||void 0,"aria-hidden":!!e||void 0,className:"mg-mega-topbar__item "+(p?"mg-mega-topbar__item--active":""),onMouseEnter:m||o?r:void 0,onFocus:r,onKeyDown:l,children:[a&&a.url?(0,s().jsx)("a",{className:"mg-mega-topbar__item-link",href:a.url,ref:c,"aria-expanded":h?String(p):void 0,children:f}):(0,s().jsx)("button",{className:"mg-mega-topbar__item-link",ref:c,"aria-expanded":h?String(p):void 0,children:f}),(0,s().jsx)(d,{section:m,isActive:p,index:b,sectionListRef:u,itemListRef:g})]})}function b({onClick:e,isOpen:t,sidebarId:n,labels:r}){return(0,s().jsx)("button",{className:"mg-mega-topbar-mobile__icon-button",onClick:e,"aria-label":t?r.closeMobileNavLabel:r.toggleMobileNavLabel,"aria-expanded":t,"aria-controls":n,"aria-haspopup":"dialog",children:(0,s().jsx)("span",{className:"mg-icon "+(t?"mg-icon-angle-circled-left":"mg-icon-menu"),"aria-hidden":"true"})})}function p({isMobile:t,sidebarId:n,labels:i,handleItemHover:a,toggleShowSidebar:o,showSidebar:l,sections:c,activeItem:m,activateItem:u,sectionListRef:d,itemListRef:p,logoSrc:h,logoAlt:f="",logoHref:v="/",logoWidth:x,logoHeight:y}){const _=r(null);e(()=>{_.current===m&&(d.current?.[m]?.focus(),_.current=null)},[m,d]);const j=c.map((e,n)=>(0,s().jsx)(g,{inert:t,index:n,ref:e=>{p.current[n]=e},title:e.title,icon:e.icon,bannerDescription:e.bannerDescription,link:e.bannerButton,onMouseEnter:()=>a(n),activeItem:m,section:e,handleOnKeyDown:e=>{((e,t)=>{["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(e.key)&&e.preventDefault();const n=p?.current;"ArrowLeft"===e.key&&t>=1&&n[t-1].focus(),"ArrowRight"===e.key&&t<n?.length-1&&n[t+1].focus(),"ArrowDown"===e.key&&d.current?.[t]&&(m===t?d.current[t].focus():(_.current=t,u(t)))})(e,n)},sectionListRef:d,itemListRef:p,children:e.sections},n));return h?(0,s().jsxs)("div",{className:"mg-mega-topbar mg-mega-topbar--branded | mg-container-full-width",children:[(0,s().jsx)("a",{className:"mg-mega-topbar__logo",href:v,"aria-label":f||"Home",children:(0,s().jsx)("img",{className:"mg-mega-topbar__logo-img",src:h,alt:f,...null!=x?{width:x}:{},...null!=y?{height:y}:{}})}),(0,s().jsx)(b,{sidebarId:n,labels:i,isOpen:l,onClick:()=>o()}),(0,s().jsx)("ul",{className:"mg-mega-topbar__nav",children:j})]}):(0,s().jsxs)("ul",{className:"mg-mega-topbar | mg-container-full-width",children:[(0,s().jsx)("li",{className:"mg-mega-topbar__mobile-trigger",children:(0,s().jsx)(b,{sidebarId:n,labels:i,isOpen:l,onClick:()=>o()})}),j]})}c();const h=[];function f({sections:e,open:a,present:o=a,onClose:l,labels:c,id:m}){const[u,d]=i(h),g=r(null),b=r(null),p=r(null),f=r(null),v=r([]),x=r(null),y=t();let _=null,j=e,w=!0;for(const e of u){if(_=j?.[e],!_){w=!1;break}j=_.items||[]}n(()=>{w||(v.current=[],x.current=null,d(h))},[w]),n(()=>{if(!a){const e=b.current?.closest(".mg-mega-wrapper"),t=window.matchMedia?.("(min-width: 900px)").matches,n=t?e?.querySelector(".mg-mega-topbar__item-link"):g.current;return g.current&&n?.focus(),void(g.current=null)}d(h),v.current=[],x.current=null;const e=b.current.closest(".mg-mega-wrapper")?.querySelector(".mg-mega-topbar-mobile__icon-button")||document.activeElement;g.current=e;const t=e=>{b.current?.contains(e.target)||p.current?.focus()};document.addEventListener("focusin",t);const n=document.body.style.overflow;return document.body.style.overflow="hidden",p.current?.focus(),()=>{document.removeEventListener("focusin",t),document.body.style.overflow=n,e?.isConnected&&e.focus()}},[a]),n(()=>{o||(d(h),v.current=[],x.current=null)},[o]),n(()=>{if(!a)return;const e=x.current;e?(f.current?.querySelectorAll("[data-mg-menu-entry]")[e.index]?.focus({preventScroll:!0}),b.current.scrollTop=e.scrollTop,x.current=null):(b.current.scrollTop=0,p.current?.focus())},[u,a]),n(()=>{a&&!b.current?.contains(document.activeElement)&&p.current?.focus()});const L=_?.url||_?.bannerButton?.url;return(0,s().jsxs)("div",{id:m,ref:b,className:"mg-mega-mobile-sidebar mg-mega-mobile-sidebar--progressive"+(a?" mg-mega-mobile-sidebar--open":""),role:"dialog","aria-modal":a?"true":void 0,"aria-labelledby":y,hidden:!o,"aria-hidden":!a,inert:!a||void 0,onKeyDown:e=>{if("Escape"===e.key&&(e.stopPropagation(),e.preventDefault(),l()),"Tab"===e.key){const t=Array.from(b.current.querySelectorAll('a[href], button, input, select, textarea, summary, iframe, [contenteditable="true"], [tabindex], audio[controls], video[controls]')).filter(e=>{if(e.tabIndex<0||e.matches(':disabled, input[type="hidden"]')||e.closest("[hidden], [inert]"))return!1;for(let t=e.parentElement?.closest("details:not([open])");t;t=t.parentElement?.closest("details:not([open])"))if(t.querySelector(":scope > summary")!==e)return!1;for(let t=e;t&&t!==b.current;t=t.parentElement){const e=window.getComputedStyle(t);if("none"===e.display||"hidden"===e.visibility)return!1}return!0}),n=t[0],r=t.at(-1);!e.shiftKey||document.activeElement!==n&&document.activeElement!==p.current?e.shiftKey||document.activeElement!==r||(e.preventDefault(),n?.focus()):(e.preventDefault(),r?.focus())}},children:[(0,s().jsx)("div",{className:"mg-mega-mobile-sidebar__header",children:(0,s().jsxs)("button",{className:"mg-mega-mobile-sidebar__close",onClick:l,"aria-label":c.closeMobileNavLabel,children:[c.closeLabel,(0,s().jsx)("span",{"aria-hidden":"true",children:"×"})]})}),(0,s().jsxs)("div",{className:"mg-mega-mobile-sidebar__page"+(u.length?" mg-mega-mobile-sidebar__page--section":""),children:[u.length>0&&(0,s().jsxs)("button",{className:"mg-mega-mobile-sidebar__back",onClick:()=>{x.current=v.current.pop(),d(e=>e.slice(0,-1))},children:[(0,s().jsx)("span",{className:"mg-mega-mobile-sidebar__arrow","aria-hidden":"true",children:"←"}),c.backLabel]}),(0,s().jsx)("h2",{id:y,ref:p,tabIndex:-1,className:"mg-mega-mobile-sidebar__title",children:L?(0,s().jsx)("a",{className:"mg-mega-mobile-sidebar__title-link",href:L,children:_.title}):_?.title||c.allSectionsLabel}),_?.url&&_.bannerButton?.url&&_.url!==_.bannerButton.url&&(0,s().jsx)("a",{className:"mg-mega-mobile-sidebar__overview",href:_.bannerButton.url,children:_.bannerButton.label||c.overviewLabel}),j?.length>0&&(0,s().jsx)("ul",{ref:f,className:"mg-mega-sidebar__list",children:(j||[]).map((e,t)=>(0,s().jsx)("li",{className:"mg-mega-sidebar-section",children:e.items?.length>0||e.bannerDescription?(0,s().jsxs)("button",{className:"mg-mega-sidebar-section__item","data-mg-menu-entry":!0,onClick:()=>(e=>{v.current.push({index:e,scrollTop:b.current.scrollTop}),d(t=>[...t,e])})(t),children:[e.title,(0,s().jsx)("svg",{className:"mg-mega-mobile-sidebar__chevron",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:(0,s().jsx)("path",{d:"m9 6 6 6-6 6"})})]}):(0,s().jsx)("a",{className:"mg-mega-sidebar-section__item","data-mg-menu-entry":!0,href:e.url||e.bannerButton?.url||"#",children:e.title})},t))}),_?.bannerDescription&&(0,s().jsxs)("div",{className:"mg-mega-mobile-sidebar__intro",children:[_.bannerHeading&&_.bannerHeading!==_.title&&(0,s().jsx)("h3",{children:_.bannerHeading}),(0,s().jsx)("div",{dangerouslySetInnerHTML:{__html:_.bannerDescription}})]})]},u.join("-"))]})}const v={navLabel:"Main Navigation",closeMobileNavLabel:"Close mobile navigation",menuLabel:"Menu",backLabel:"Back",allSectionsLabel:"All sections",closeLabel:"Close",overviewLabel:"Overview",toggleMobileNavLabel:"Open navigation menu"},x=({sections:n,delay:a=300,hoverDelay:o=180,logoSrc:l,logoAlt:c="",logoHref:m="/",logoWidth:u,logoHeight:d,labels:g=v})=>{const b={...v,...g},{navLabel:h,closeMobileNavLabel:x}=b,y=t(),_=r(null),[j,w]=i(!1),[L,k]=i(!1),N=j||L,[S,D]=i(null),[T,I]=i(!1),[A,E]=i(!1),H=r([]),M=r([]);e(()=>{if(j)return void k(!0);if(!L)return;const e=_.current?.querySelector(".mg-mega-mobile-sidebar"),t=e&&e.ownerDocument.defaultView.getComputedStyle(e),n=e=>(parseFloat(e)||0)*(e.trim().endsWith("ms")?1:1e3),r=(t?.transitionDuration||"0s").split(",").map(n),i=(t?.transitionDelay||"0s").split(",").map(n),a=(t?.transitionProperty||"all").split(","),o=Math.max(0,...a.map((e,t)=>"none"===e.trim()?0:r[t%r.length]+i[t%i.length])),l=setTimeout(()=>k(!1),o);return()=>clearTimeout(l)},[j,L]);const R=r(null),O=r(null);e(()=>{E(!0)},[]),e(()=>()=>{clearTimeout(R.current),clearTimeout(O.current)},[]);const C=()=>{const e=_.current?.ownerDocument.activeElement;_.current?.contains(e)&&e.closest(".mg-mega-content")&&(e.closest(".mg-mega-topbar__item")?.querySelector(".mg-mega-topbar__item-link")?.focus(),clearTimeout(O.current))};return e(()=>{const e=e=>{const t=_.current;t&&!t.contains(e.target)&&(C(),D(null))};if(null!==S)return document.addEventListener("click",e),()=>{document.removeEventListener("click",e)}},[S]),e(()=>{if(!window.matchMedia)return;const e=window.matchMedia("(min-width: 900px)"),t=()=>{I(!e.matches),e.matches&&w(!1)};return t(),e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]),(0,s().jsxs)("nav",{ref:_,className:`mg-mega-wrapper${A?" mg-mega-wrapper--js-active":""}${N?" mg-mega-wrapper--mobile-open":""}`,onMouseLeave:()=>{clearTimeout(O.current),R.current=setTimeout(()=>{C(),D(null)},a)},onKeyDown:e=>{if("Escape"===e.key){const t=e.target.closest(".mg-mega-content");t?.closest(".mg-mega-topbar__item")?.querySelector(".mg-mega-topbar__item-link")?.focus(),clearTimeout(O.current),D(null)}},"aria-label":h,children:[(0,s().jsx)(p,{isMobile:T,sidebarId:y,labels:b,sections:n,handleItemHover:e=>{clearTimeout(R.current),clearTimeout(O.current),O.current=setTimeout(()=>{const t=_.current?.ownerDocument.activeElement;_.current?.contains(t)&&t.closest(".mg-mega-content")&&t.closest(".mg-mega-topbar__item")!==H.current[e]?.closest(".mg-mega-topbar__item")&&(H.current[e]?.focus(),clearTimeout(O.current)),D(e)},o)},toggleShowSidebar:()=>w(e=>!e),showSidebar:j,activeItem:S,activateItem:D,itemListRef:H,sectionListRef:M,logoSrc:l,logoAlt:c,logoHref:m,logoWidth:u,logoHeight:d}),N&&(0,s().jsx)("button",{className:"mg-mega-mobile-sidebar-overlay"+(j?" mg-mega-mobile-sidebar-overlay--open":""),"aria-hidden":!j,"aria-label":x,tabIndex:-1,onClick:()=>w(!1)}),(0,s().jsx)(f,{id:y,labels:b,onClose:()=>w(!1),present:N,open:j,sections:n})]})};x.propTypes={sections:u().arrayOf(u().shape({title:u().string.isRequired,icon:u().string,bannerHeading:u().string,bannerDescription:u().string,bannerButton:u().shape({label:u().string,url:u().string}),items:u().arrayOf(u().shape({title:u().string.isRequired,url:u().string,items:u().array}))})).isRequired,delay:u().number,hoverDelay:u().number,logoSrc:u().string,logoAlt:u().string,logoHref:u().string,logoWidth:u().number,logoHeight:u().number,labels:u().shape({navLabel:u().string,closeMobileNavLabel:u().string,menuLabel:u().string,backLabel:u().string,allSectionsLabel:u().string,closeLabel:u().string,overviewLabel:u().string,toggleMobileNavLabel:u().string})};const y=x;function _(e){const{dataset:t}=e,n={delay:t.delay?parseInt(t.delay,10):300,hoverDelay:t.hoverDelay?parseInt(t.hoverDelay,10):180};if(t.logoSrc&&(n.logoSrc=t.logoSrc),t.logoAlt&&(n.logoAlt=t.logoAlt),t.logoHref&&(n.logoHref=t.logoHref),t.logoWidth&&(n.logoWidth=parseInt(t.logoWidth,10)),t.logoHeight&&(n.logoHeight=parseInt(t.logoHeight,10)),t.sections)try{n.sections=JSON.parse(t.sections)}catch{n.sections=[]}return n}export{y as default,_ as fromElement};
9
+ import{useEffect as e,useId as t,useLayoutEffect as r,useMemo as n,useRef as a,useState as l}from"react";var i={2694(e,t,r){var n=r(6925);function a(){}function l(){}l.resetWarningCache=a,e.exports=function(){function e(e,t,r,a,l,i){if(i!==n){var o=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw o.name="Invariant Violation",o}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:l,resetWarningCache:a};return r.PropTypes=r,r}},5556(e,t,r){e.exports=r(2694)()},6925(e){e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}};const o={};function s(e){const t=o[e];if(void 0!==t)return t.exports;const r=o[e]={exports:{}};return i[e](r,r.exports,s),r.exports}s.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.cw=e=>{var t;return()=>{if(e){var r=e;e=0,t={exports:{}},r.call(t.exports,t,t.exports)}return t.exports}},s.d=(e,t)=>{for(var r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var c=/*#__PURE__*/s.cw((e,t)=>{var r=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function a(e,t,n){var a=null;if(void 0!==n&&(a=""+n),void 0!==t.key&&(a=""+t.key),"key"in t)for(var l in n={},t)"key"!==l&&(n[l]=t[l]);else n=t;return t=n.ref,{$$typeof:r,type:e,key:a,ref:void 0!==t?t:null,props:n}}t.Fragment=n,t.jsx=a,t.jsxs=a}),u=/*#__PURE__*/s.cw(e=>{e.exports=c()});const m={en:"ltr",ar:"rtl",es:"ltr",fr:"ltr",ja:"ltr",ru:"ltr",zh:"ltr"};function g(e="en"){return String(e).trim().toLowerCase().split(/[-_]/)[0]}function d(e,t){const r=g(e),n=void 0!==e&&Object.hasOwn(m,r)?m[r]:void 0,a=void 0===t?n:t;return{...void 0===e?{}:{lang:e},...void 0===a?{}:{dir:a}}}function b(e){const t=e.dataset.lang??e.closest("[lang]")?.getAttribute("lang"),r=e.getAttribute("dir")?.toLowerCase();return{...null==t?{}:{lang:t},...["ltr","rtl","auto"].includes(r)?{dir:r}:{}}}const h=(f={navLabel:"Main Navigation",closeMobileNavLabel:"Close mobile navigation",menuLabel:"Menu",backLabel:"Back",allSectionsLabel:"All sections",closeLabel:"Close",overviewLabel:"Overview",toggleMobileNavLabel:"Open navigation menu",menuFilterLabel:"Find in menu",filterPlaceholder:"Find a page in this menu",clearFilterLabel:"Clear filter",noFilterResultsLabel:"No matching pages in this menu",searchSiteLabel:'Search entire site for "{query}"',filterMatchesCount:"{count} menu items found"},p={ar:{backLabel:"رجوع",menuLabel:"القائمة",allSectionsLabel:"جميع الأقسام",closeLabel:"إغلاق",overviewLabel:"نظرة عامة",toggleMobileNavLabel:"فتح قائمة التنقل",navLabel:"التنقل الرئيسي",closeMobileNavLabel:"إغلاق قائمة التنقل للجوال",menuFilterLabel:"البحث في القائمة",filterPlaceholder:"العثور على صفحة في هذه القائمة",clearFilterLabel:"مسح التصفية",noFilterResultsLabel:"لا توجد صفحات مطابقة في هذه القائمة",searchSiteLabel:'البحث في كامل الموقع عن "{query}"',filterMatchesCount:"تم العثور على {count} عنصر"},es:{backLabel:"Atrás",menuLabel:"Menú",allSectionsLabel:"Todas las secciones",closeLabel:"Cerrar",overviewLabel:"Resumen",toggleMobileNavLabel:"Abrir navegación",navLabel:"Navegación principal",closeMobileNavLabel:"Cerrar navegación móvil",menuFilterLabel:"Buscar en el menú",filterPlaceholder:"Buscar una página en este menú",clearFilterLabel:"Borrar filtro",noFilterResultsLabel:"No hay páginas coincidentes en este menú",searchSiteLabel:'Buscar en todo el sitio "{query}"',filterMatchesCount:"{count} elementos encontrados"},fr:{backLabel:"Retour",menuLabel:"Menu",allSectionsLabel:"Toutes les rubriques",closeLabel:"Fermer",overviewLabel:"Présentation",toggleMobileNavLabel:"Ouvrir la navigation",navLabel:"Navigation principale",closeMobileNavLabel:"Fermer la navigation mobile",menuFilterLabel:"Rechercher dans le menu",filterPlaceholder:"Trouver une page dans ce menu",clearFilterLabel:"Effacer le filtre",noFilterResultsLabel:"Aucune page correspondante dans ce menu",searchSiteLabel:'Rechercher sur tout le site "{query}"',filterMatchesCount:"{count} éléments trouvés"},ja:{backLabel:"戻る",menuLabel:"メニュー",allSectionsLabel:"すべてのセクション",closeLabel:"閉じる",overviewLabel:"概要",toggleMobileNavLabel:"ナビゲーションを開く",navLabel:"メインナビゲーション",closeMobileNavLabel:"モバイルナビゲーションを閉じる",menuFilterLabel:"メニュー内を探す",filterPlaceholder:"このメニューからページを探す",clearFilterLabel:"絞り込みをクリア",noFilterResultsLabel:"このメニューに一致するページはありません",searchSiteLabel:"サイト全体で「{query}」を検索",filterMatchesCount:"{count} 件の項目が見つかりました"},ru:{backLabel:"Назад",menuLabel:"Меню",allSectionsLabel:"Все разделы",closeLabel:"Закрыть",overviewLabel:"Обзор",toggleMobileNavLabel:"Открыть навигацию",navLabel:"Основная навигация",closeMobileNavLabel:"Закрыть мобильную навигацию",menuFilterLabel:"Поиск в меню",filterPlaceholder:"Найти страницу в этом меню",clearFilterLabel:"Очистить фильтр",noFilterResultsLabel:"В этом меню нет подходящих страниц",searchSiteLabel:"Искать по всему сайту «{query}»",filterMatchesCount:"Найдено элементов: {count}"},zh:{backLabel:"返回",menuLabel:"菜单",allSectionsLabel:"所有栏目",closeLabel:"关闭",overviewLabel:"概览",toggleMobileNavLabel:"打开导航",navLabel:"主导航",closeMobileNavLabel:"关闭移动导航",menuFilterLabel:"在菜单中查找",filterPlaceholder:"在此菜单中查找页面",clearFilterLabel:"清除筛选",noFilterResultsLabel:"此菜单中没有匹配的页面",searchSiteLabel:'在全站搜索 "{query}"',filterMatchesCount:"找到 {count} 个菜单项"}},(e,t)=>{const r=g(e),n=Object.hasOwn(p,r)?p[r]:void 0,a=Object.fromEntries(Object.entries(t??{}).filter(([,e])=>void 0!==e));return{...f,...n,...a}});var f,p,v=/*#__PURE__*/s(5556),y=/*#__PURE__*/s.n(v);function _(e){const t=(e.replace(/([\p{Ll}\p{N}])(\p{Lu})/gu,"$1 $2").replace(/(\p{Lu})(\p{Lu}\p{Ll})/gu,"$1 $2").match(/[\p{L}\p{N}]+/gu)||[]).filter(e=>/^\p{L}/u.test(e)),r=e=>e.map(e=>Array.from(e)[0]).join("").toLowerCase(),n=t.filter(e=>!/^(?:a|an|and|at|by|for|from|in|of|on|or|the|to|with)$/i.test(e));return[...new Set([r(t),r(n)])].filter(e=>Array.from(e).length>=2)}function x(e){return/^(?:\p{L}{2,}|\p{L}(?:[-.\s]+\p{L})+\.?)$/u.test(e)?e.replace(/[-.\s]/g,""):null}function L(e){const t=[],r=new Set,n=new Map,a=e=>(n.has(e)||n.set(e,_(e)),n.get(e)),l=(e,n=[])=>{if(e&&Array.isArray(e))for(const i of e){if(!i||!i.title)continue;const e=[...n,i.title],o=i.url||i.bannerButton?.url;if(o){const e=`${o}|${i.title}|${n.join(">")}`;r.has(e)||(r.add(e),t.push({title:i.title,url:o,path:n,fullPath:n.join(" › "),acronyms:{title:a(i.title),path:n.flatMap(a)}}))}i.items&&i.items.length>0&&l(i.items,e)}};return l(e),t}function j(e){return(e.toLowerCase().match(/[\p{L}\p{N}]+|&/gu)||[]).map(e=>"&"===e?"and":e)}function w(e,t){if(!e||!t||!t.trim())return[];const r=t.trim().toLowerCase(),n=x(r),a=n&&/[-.\s]/.test(r),l=j(r),i=l.length>0&&l.every(e=>"and"===e),o=i?["and"]:l.filter(e=>"and"!==e),s=!a&&(l.length>1||l.includes("and")),c=a?n:s?o.join(" "):r;if(!c)return[];const u=new Map,m=e=>s?(u.has(e)||u.set(e,j(e).filter(e=>i||"and"!==e).join(" ")),u.get(e)):e.toLowerCase(),g=new Map,d=e=>!!n&&(g.has(e)||g.set(e,_(e)),g.get(e).includes(n)),b=[[],[],[],[],[],[],[],[],[]];for(const t of e){const e=m(t.title||""),r=m(t.fullPath||"");e===c?b[0].push(t):e.startsWith(c)?b[1].push(t):!s&&e.includes(c)&&j(e).some(e=>e.startsWith(c))?b[2].push(t):n&&(t.acronyms?t.acronyms.title.includes(n):d(t.title||""))?b[3].push(t):e.includes(c)?b[4].push(t):s&&o.every(t=>e.includes(t))?b[5].push(t):r.includes(c)||s&&o.every(e=>r.includes(e))?b[6].push(t):s&&o.every(t=>e.includes(t)||r.includes(t))?b[7].push(t):n&&(t.acronyms?t.acronyms.path.includes(n):(t.path||(t.fullPath||"").split("›")).some(d))&&b[8].push(t)}if(b.every(e=>!e.length)&&!s&&/^[\p{L}\p{N}]{4,}$/u.test(c)){const t=Array.from(c),r=new Map,n=new Map,a=e=>{if(!n.has(e)){const a=e.toLowerCase().match(/[\p{L}\p{N}]+/gu)||[];n.set(e,a.some(e=>(r.has(e)||r.set(e,function(e,t){if(Math.abs(e.length-t.length)>1)return!1;let r=0;for(;r<e.length&&e[r]===t[r];)r++;if(r===e.length)return!0;let n=r;for(e.length<t.length?n++:e.length>t.length?r++:e[r]===t[r+1]&&e[r+1]===t[r]?(r+=2,n+=2):(r++,n++);r<e.length&&n<t.length;)if(e[r++]!==t[n++])return!1;return r===e.length&&n===t.length}(t,Array.from(e))),r.get(e))))}return n.get(e)};for(const t of e)a(t.title||"")?b[0].push(t):a(t.fullPath||"")&&b[1].push(t)}const h=[],f=new Set;for(const e of b)for(const t of e)f.has(t.url)||(f.add(t.url),h.push(t));return h}function N(e="/search",t=""){const r=encodeURIComponent((t||"").trim());return e?e.endsWith("=")?`${e}${r}`:e.includes("#")||e.includes("?")?`${e}&query=${r}`:`${e.replace(/\/+$/,"")}#query=${r}`:`/search#query=${r}`}function S(e,t={}){return"string"!=typeof e?"":Object.entries(t).reduce((e,[t,r])=>e.replace(new RegExp(`\\{${t}\\}`,"g"),()=>String(r)),e)}function k({text:e,query:t}){if(!t||!t.trim()||!e)return e||"";const r=x(t.trim().toLowerCase()),n=r&&/[-.\s]/.test(t.trim())?[r]:j(t);if(!n.length)return e;const a=[...new Set(n)].sort((e,t)=>t.length-e.length);return a.includes("and")&&a.push("&"),e.split(new RegExp(`(${a.join("|")})`,"giu")).map((e,t)=>t%2?/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("mark",{className:"mg-mega-filter__highlight",children:e},t):e)}function C({item:e,query:t}){/*#__PURE__*/ /*#__PURE__*/
10
+ return(0,c().jsxs)("span",{className:"mg-mega-filter__trail",children:[e.path.map((e,r)=>/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("span",{className:"mg-mega-filter__trail-step",children:/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)(k,{text:e,query:t})},r)),/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("span",{className:"mg-mega-filter__trail-step mg-mega-filter__item-title",children:/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)(k,{text:e.title,query:t})})]})}function M({sections:r,query:l,onQueryChange:i,onBack:o,labels:s,enableSiteSearch:u,searchUrl:m,onNavigate:g,onClose:d}){const b=t(),h=a(null),f=a(null),p=a(!1),v=n(()=>L(r),[r]),y=n(()=>w(v,l),[v,l]);e(()=>{const e=f.current,t=document.body.style.overflow;return e.showModal(),document.body.style.overflow="hidden",h.current?.focus(),()=>{e.close(),document.body.style.overflow=t}},[]);const _=e=>{e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||("function"==typeof g&&(e.preventDefault(),g(e.currentTarget.getAttribute("href"))),d())},x=e=>{if(e.target!==e.currentTarget)return!1;const t=e.currentTarget.getBoundingClientRect();return e.clientX<t.left||e.clientX>t.right||e.clientY<t.top||e.clientY>t.bottom};/*#__PURE__*/ /*#__PURE__*/
11
+ return(0,c().jsxs)("dialog",{className:"mg-dialog mg-mega-menu-finder","aria-labelledby":`${b}-title`,"aria-modal":"true",ref:f,onKeyDown:e=>{if(e.isComposing||e.nativeEvent?.isComposing)return void e.stopPropagation();if("Tab"===e.key){const t=Array.from(f.current.querySelectorAll("button:not([disabled]), input:not([disabled]), a[href]")),r=t[0],n=t.at(-1);return void(e.shiftKey&&e.target===r?(e.preventDefault(),n?.focus()):e.shiftKey||e.target!==n||(e.preventDefault(),r?.focus()))}if("Escape"===e.key)return e.preventDefault(),e.stopPropagation(),void o();if(!["Enter","ArrowDown","ArrowUp"].includes(e.key))return;const t=Array.from(f.current.querySelectorAll("a[href]")),r=t.indexOf(e.target),n=e.target===h.current;if(n&&"Enter"===e.key&&t[0])e.preventDefault(),t[0].click();else if((n||r>=0)&&("ArrowDown"===e.key||"ArrowUp"===e.key)&&t.length){e.preventDefault();const a=n?"ArrowDown"===e.key?t[0]:t.at(-1):t[r+("ArrowDown"===e.key?1:-1)];(a||h.current)?.focus(),a?.scrollIntoView?.({block:"nearest",behavior:"instant"})}},onCancel:e=>{e.preventDefault(),o()},onPointerDown:e=>{p.current=x(e)},onPointerCancel:()=>{p.current=!1},onClick:e=>{const t=p.current&&x(e);p.current=!1,t&&o()},children:[/*#__PURE__*/ /*#__PURE__*/(0,c().jsxs)("div",{className:"mg-mega-menu-finder__header",children:[/*#__PURE__*/ /*#__PURE__*/(0,c().jsxs)("div",{className:"mg-mega-menu-finder__heading",children:[/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("label",{id:`${b}-title`,className:"mg-mega-menu-finder__label",htmlFor:b,children:s.menuFilterLabel}),/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("button",{type:"button",className:"mg-mega-menu-finder__action","aria-label":s.closeLabel,onClick:o,children:/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("span",{className:"mg-icon mg-icon-close","aria-hidden":"true"})})]}),/*#__PURE__*/ /*#__PURE__*/(0,c().jsxs)("div",{className:"mg-mega-filter",children:[/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("span",{className:"mg-icon mg-icon-search mg-mega-filter__icon","aria-hidden":"true"}),/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("input",{id:b,ref:h,type:"search",className:"mg-mega-filter__input",value:l,onChange:e=>i(e.target.value)}),l&&/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("button",{type:"button",className:"mg-mega-filter__clear","aria-label":s.clearFilterLabel,onClick:()=>{i(""),h.current?.focus()},children:/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("span",{"aria-hidden":"true",children:"×"})})]})]}),l.trim()&&/*#__PURE__*/ /*#__PURE__*/(0,c().jsxs)("div",{className:"mg-mega-menu-finder__results",children:[/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("div",{role:"status","aria-live":"polite",className:y.length?"mg-u-sr-only":"mg-mega-filter__status",children:y.length?S(s.filterMatchesCount,{count:y.length}):s.noFilterResultsLabel}),y.length>0&&/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("ul",{className:"mg-mega-filter__mobile-list",children:y.map(e=>/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("li",{children:/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("a",{href:e.url,className:"mg-mega-filter__mobile-link","aria-label":e.fullPath?`${e.title} (${e.fullPath})`:e.title,onClick:_,children:/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)(C,{item:e,query:l})})},e.url))})]}),l.trim()&&u&&/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("div",{className:"mg-mega-menu-finder__footer",children:/*#__PURE__*/ /*#__PURE__*/(0,c().jsxs)("a",{href:N(m,l),className:"mg-button mg-button-secondary mg-button-outline mg-mega-filter__site-search-link",onClick:_,children:[/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("span",{children:S(s.searchSiteLabel,{query:l.trim()})}),/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("span",{className:"mg-icon mg-icon-arrow-right mg-mega-filter__fallback-arrow","aria-hidden":"true"})]})})]})}function D({section:t,sections:r,isActive:n,index:i,sectionListRef:o,itemListRef:s,enableFilter:u=!1,enableSiteSearch:m=!0,searchUrl:g="/search",onNavigate:d,onClose:b,labels:h}){const[f,p]=l(""),[v,y]=l(!1),_=Boolean(t?.bannerHeading&&t?.bannerDescription&&t?.items),x=u&&v&&n&&_,L=a(null),[j,w]=l("Ctrl K");e(()=>{const e=navigator.userAgentData?.platform||navigator.platform;/Mac|iPhone|iPad|iPod/i.test(e)&&w("⌘K")},[]);const N=a(!1);e(()=>{n&&u&&_||(v&&n&&s.current[i]?.focus(),N.current=!1,p(""),y(!1))},[n,u,_,v,s,i]),e(()=>{!v&&N.current&&(N.current=!1,L.current?.focus())},[v]);const S=u&&/*#__PURE__*/ /*#__PURE__*/(0,c().jsxs)("button",{ref:L,type:"button",className:"mg-mega-menu-finder__action mg-mega-content__finder-trigger","aria-haspopup":"dialog","aria-keyshortcuts":"Meta+k Control+k",onClick:()=>y(!0),children:[/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("span",{children:h.menuFilterLabel}),/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("kbd",{className:"mg-mega-content__finder-shortcut","aria-hidden":"true",children:j})]}),[k,C]=l(0),[D,A]=l(0),[F,T]=l([]),R=t?.title||"Menu section",q=a(null),P=a(null),I=e=>{if(!e.target.closest(".mg-mega-menu-finder")&&(!u||"Tab"!==e.key)&&(["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(e.key)&&(e.preventDefault(),e.stopPropagation()),"ArrowDown"!==e.key&&"Tab"!==e.key||(D<F?.length-1?A(e=>e+1):(A(0),s.current?.[i+1]?.focus())),("ArrowUp"===e.key||e.shiftKey&&"Tab"===e.key)&&(D>0?A(e=>e-1):(s.current?.[i]?.focus(),A(0))),q.current&&("ArrowLeft"===e.key&&A(0),"ArrowRight"===e.key))){const e=P.current,t=e?.querySelector("ul > li > a");if(t){e.setAttribute("tabindex","-1"),t.focus();const r=F.findIndex(e=>e===t);-1!==r&&A(r)}else{P.current?.focus();const e=F.filter(e=>e===P.current);e[0]&&A(F.indexOf(e[0]))}}};return e(()=>{const e=o?.current?.[i]?.querySelectorAll("audio, button, a, canvas, details, iframe, input, select, summary, textarea, video, [tabindex]");T(Array.from(e||[]))},[o,i,k,x]),e(()=>{F.length>0&&D>=0&&F[D]?.focus()},[D]),/*#__PURE__*/ /*#__PURE__*/(0,c().jsxs)(c().Fragment,{children:[t&&t.items&&/*#__PURE__*/ /*#__PURE__*/(0,c().jsxs)("article",{className:`mg-mega-content${u&&_?" mg-mega-content--filterable":""} | mg-container-full-width`,"aria-label":R,"aria-live":"polite","aria-hidden":!n,inert:!n||void 0,tabIndex:0,ref:e=>{o.current[i]=e},onKeyDown:I,role:"region",children:[x&&/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)(M,{sections:r,query:f,onQueryChange:p,onBack:()=>{N.current=!0,p(""),y(!1)},labels:h,enableSiteSearch:m,searchUrl:g,onNavigate:d,onClose:b}),t.bannerHeading&&t.bannerDescription&&t.items&&/*#__PURE__*/ /*#__PURE__*/(0,c().jsxs)("nav",{className:"mg-mega-content__left","aria-label":`${R} categories`,ref:q,tabIndex:0,children:[/*#__PURE__*/ /*#__PURE__*/(0,c().jsxs)("div",{className:u?"mg-mega-content__left-scroll":"mg-mega-content__left-contents",children:[/*#__PURE__*/ /*#__PURE__*/(0,c().jsxs)("section",{className:"mg-mega-content__banner",children:[/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("header",{children:t.bannerHeading}),t.bannerDescription.includes("<")?/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("div",{dangerouslySetInnerHTML:{__html:t.bannerDescription}}):/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("p",{children:t.bannerDescription}),t.bannerButton?.label&&/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("a",{href:t.bannerButton.url,className:"mg-button mg-button-primary",children:t.bannerButton.label})]}),t.items.length>0&&t.items[0].items&&t.items[0].items.length>0?/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("ul",{className:"mg-mega-content__section-list",role:"menu","aria-label":"Categories",children:t.items.map((e,t)=>/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("li",{className:"mg-mega-content__section-list-item",onMouseEnter:()=>C(t),role:"none",children:/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("a",{className:"mg-mega-content__section-list-link "+(k===t?"mg-mega-content__section-list-link--active":""),href:e.url,"aria-current":k===t?"page":void 0,onFocus:()=>C(t),role:"menuitem","aria-haspopup":e.items&&e.items.length>0?"true":void 0,children:e.title})},t))}):null]}),u&&/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("div",{className:"mg-mega-content__finder-footer",children:S})]}),t.items&&/*#__PURE__*/ /*#__PURE__*/(0,c().jsxs)("nav",{className:"mg-mega-content__right","aria-label":`${R} submenu`,ref:P,tabIndex:0,children:[/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("ul",{role:"menu","aria-label":"Submenu items",className:"mg-mega-content__menu--mobile",children:t.items.map((e,t)=>/*#__PURE__*/ /*#__PURE__*/(0,c().jsxs)("li",{role:"none",children:[/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("a",{href:e.url,role:"menuitem","aria-haspopup":e.items?"true":void 0,children:e.title}),e.items&&e.items.length>0&&/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("ul",{role:"menu","aria-label":`${e.title} submenu`,children:e.items.map((e,t)=>/*#__PURE__*/ /*#__PURE__*/(0,c().jsxs)("li",{role:"none",children:[/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("a",{href:e.url,role:"menuitem","aria-haspopup":e.items?"true":void 0,children:e.title}),e.items&&/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("ul",{role:"menu","aria-label":`${e.title} nested submenu`,children:e.items.map((e,t)=>/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("li",{role:"none",children:/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("a",{href:e.url,role:"menuitem",children:e.title})},t))})]},t))})]},t))}),/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("ul",{role:"menu","aria-label":"Submenu items",className:"mg-mega-content__menu--desktop",children:t.items[k]?.items?t.items[k].items.map((e,t)=>/*#__PURE__*/ /*#__PURE__*/(0,c().jsxs)("li",{role:"none",children:[/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("a",{href:e.url,role:"menuitem","aria-haspopup":e.items?"true":void 0,children:e.title}),e.items&&/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("ul",{role:"menu","aria-label":`${e.title} submenu`,children:e.items.map((e,t)=>/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("li",{role:"none",children:/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("a",{href:e.url,role:"menuitem",children:e.title})},t))})]},t)):t.items.map((e,t)=>/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("li",{role:"none",children:/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("a",{href:e.url,role:"menuitem",children:e.title})},t))})]})]}),t&&!t.items&&t.bannerDescription&&/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("article",{className:"mg-mega-content | mg-container-full-width","aria-live":"polite","aria-hidden":!n,inert:!n||void 0,"aria-label":R,tabIndex:0,ref:e=>{o.current[i]=e},dangerouslySetInnerHTML:{__html:t.bannerDescription},onKeyDown:I})]})}function A({isMobile:e,sidebarId:t,onMobileClick:r,title:n,icon:a,onMouseEnter:l,activeItem:i,link:o,bannerDescription:s,handleOnKeyDown:u,ref:m,section:g,sections:d,sectionListRef:b,itemListRef:h,index:f,enableFilter:p,enableSiteSearch:v,searchUrl:y,onNavigate:_,onCloseSection:x,labels:L}){const j=f===i,w=Boolean(g&&g.items),N=/*#__PURE__*/ /*#__PURE__*/(0,c().jsxs)(c().Fragment,{children:[a&&/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("span",{className:`mg-mega-topbar__item-icon ${a}`,"aria-hidden":"true"}),n]});/*#__PURE__*/ /*#__PURE__*/
12
+ return(0,c().jsxs)("li",{className:"mg-mega-topbar__item "+(j?"mg-mega-topbar__item--active":""),onMouseEnter:g||s?l:void 0,onFocus:e?void 0:l,onKeyDown:e=>{const t=e.target.isContentEditable||e.target.closest("input, textarea, select, [contenteditable]"),r="k"===e.key.toLowerCase()&&(e.metaKey||e.ctrlKey);if(j&&p&&r&&!t&&!e.altKey&&!e.shiftKey&&!e.repeat&&!e.isComposing&&!e.defaultPrevented){const t=b.current[f]?.querySelector(".mg-mega-content__finder-trigger");if(t)return e.preventDefault(),void t.click()}u(e)},children:[e?/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("button",{type:"button",className:"mg-mega-topbar__item-link",ref:m,onClick:r,"aria-haspopup":"dialog","aria-controls":t,children:N}):o&&o.url?/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("a",{className:"mg-mega-topbar__item-link",href:o.url,ref:m,"aria-expanded":w?String(j):void 0,children:N}):/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("button",{className:"mg-mega-topbar__item-link",ref:m,"aria-expanded":w?String(j):void 0,children:N}),/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)(D,{section:g,sections:d,isActive:j,index:f,sectionListRef:b,itemListRef:h,enableFilter:p,enableSiteSearch:v,searchUrl:y,onNavigate:_,onClose:x,labels:L})]})}function F({onClick:e,isOpen:t,sidebarId:r,labels:n}){/*#__PURE__*/ /*#__PURE__*/
13
+ return(0,c().jsx)("button",{className:"mg-mega-topbar-mobile__icon-button",onClick:e,"aria-label":t?n.closeMobileNavLabel:n.toggleMobileNavLabel,"aria-expanded":t,"aria-controls":r,"aria-haspopup":"dialog",children:/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("span",{className:"mg-icon "+(t?"mg-icon-angle-circled-left":"mg-icon-menu"),"aria-hidden":"true"})})}function T({isMobile:t,openMobileSection:r,sidebarId:n,labels:l,handleItemHover:i,toggleShowSidebar:o,showSidebar:s,sections:u,activeItem:m,activateItem:g,sectionListRef:d,itemListRef:b,logoSrc:h,logoAlt:f="",logoHref:p="/",logoWidth:v,logoHeight:y,enableFilter:_=!1,enableSiteSearch:x,searchUrl:L,onNavigate:j}){const w=function(e){const t=a(null),r=a(!1);return{onPointerDown(n){r.current=!1,e&&"mouse"===n.pointerType&&0===n.button&&(t.current={id:n.pointerId,startX:n.clientX,scrollLeft:n.currentTarget.scrollLeft,dragged:!1})},onPointerMove(n){const a=t.current;if(!e||!a||a.id!==n.pointerId)return;if(1!==n.buttons)return void(t.current=null);const l=n.clientX-a.startX;!a.dragged&&Math.abs(l)<8||(a.dragged||(a.dragged=!0,r.current=!0,n.currentTarget.setPointerCapture(n.pointerId)),n.preventDefault(),n.currentTarget.scrollLeft=a.scrollLeft-l)},onPointerLeave(){t.current?.dragged||(t.current=null)},onPointerUp(e){t.current=null,e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId)},onPointerCancel(){t.current=null},onLostPointerCapture(){t.current=null},onClickCapture(t){e&&r.current&&0!==t.detail&&(t.preventDefault(),t.stopPropagation())},onDragStart(t){e&&t.preventDefault()}}}(t),N=a(null);e(()=>{N.current===m&&(d.current?.[m]?.focus(),N.current=null)},[m,d]);const S=u.map((e,a)=>/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)(A,{isMobile:t,sidebarId:n,onMobileClick:e=>{e.currentTarget.focus({preventScroll:!0}),r(a)},index:a,ref:e=>{b.current[a]=e},title:e.title,icon:e.icon,bannerDescription:e.bannerDescription,link:e.bannerButton,onMouseEnter:()=>{t||i(a)},activeItem:m,section:e,sections:u,handleOnKeyDown:e=>{t&&"ArrowDown"===e.key?(e.preventDefault(),e.currentTarget.querySelector("button")?.focus(),r(a)):((e,t)=>{if(e.target.closest(".mg-mega-menu-finder"))return;["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(e.key)&&e.preventDefault();const r=b?.current;if("ArrowLeft"===e.key||"ArrowRight"===e.key){const n="rtl"===window.getComputedStyle(e.currentTarget).direction,a=("ArrowRight"===e.key?1:-1)*(n?-1:1);r[t+a]?.focus()}"ArrowDown"===e.key&&d.current?.[t]&&(m===t?d.current[t].focus():(N.current=t,g(t)))})(e,a)},sectionListRef:d,itemListRef:b,enableFilter:_&&!t,enableSiteSearch:x,searchUrl:L,onNavigate:j,onCloseSection:()=>g(null),labels:l,children:e.sections},a));return h?/*#__PURE__*/ /*#__PURE__*/(0,c().jsxs)("div",{className:"mg-mega-topbar mg-mega-topbar--branded | mg-container-full-width",children:[/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("a",{className:"mg-mega-topbar__logo",href:p,"aria-label":f||"Home",children:/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("img",{className:"mg-mega-topbar__logo-img",src:h,alt:f,...null!=v?{width:v}:{},...null!=y?{height:y}:{}})}),/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)(F,{sidebarId:n,labels:l,isOpen:s,onClick:()=>o()}),/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("ul",{className:"mg-mega-topbar__nav",...w,children:S})]}):/*#__PURE__*/ /*#__PURE__*/(0,c().jsxs)("div",{className:"mg-mega-topbar | mg-container-full-width",children:[/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)(F,{sidebarId:n,labels:l,isOpen:s,onClick:()=>o()}),/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("ul",{className:"mg-mega-topbar__nav",...w,children:S})]})}u(),C.propTypes={item:y().shape({path:y().arrayOf(y().string).isRequired,title:y().string.isRequired}).isRequired,query:y().string},M.propTypes={sections:y().array.isRequired,query:y().string.isRequired,onQueryChange:y().func.isRequired,onBack:y().func.isRequired,labels:y().object.isRequired,enableSiteSearch:y().bool,searchUrl:y().string,onNavigate:y().func,onClose:y().func.isRequired};const R=[];function q({sections:e,initialSection:i=null,open:o,present:s=o,onClose:u,labels:m,id:g,enableFilter:d=!1,enableSiteSearch:b=!0,searchUrl:h="/search"}){const[f,p]=l(R),[v,y]=l(""),_=a(null),x=a(null),j=a(null),k=a(null),M=a(null),D=a([]),A=a(null),F=t(),T=d&&Boolean(v.trim()),q=n(()=>T?L(e):[],[T,e]),P=n(()=>d&&v.trim()?w(q,v):[],[d,q,v]);let I=null,E=e,$=!0;for(const e of f){if(I=E?.[e],!I){$=!1;break}E=I.items||[]}r(()=>{$||(D.current=[],A.current=null,p(R))},[$]),r(()=>{if(!o){y("");const e=j.current?.closest(".mg-mega-wrapper"),t=window.matchMedia?.("(min-width: 900px)").matches,r=t?e?.querySelector(".mg-mega-topbar__item-link"):x.current;return x.current&&r?.focus(),void(x.current=null)}p(null===i?R:[i]),D.current=null===i?[]:[{index:i,scrollTop:0}],A.current=null;const e=document.activeElement,t=(e?.closest(".mg-mega-topbar")?e:null)||j.current.closest(".mg-mega-wrapper")?.querySelector(".mg-mega-topbar-mobile__icon-button")||document.activeElement;x.current=t;const r=e=>{j.current?.contains(e.target)||k.current?.focus()};document.addEventListener("focusin",r);const n=document.body.style.overflow;return document.body.style.overflow="hidden",k.current?.focus(),()=>{document.removeEventListener("focusin",r),document.body.style.overflow=n,t?.isConnected&&t.focus()}},[o,i]),r(()=>{s||(p(R),D.current=[],A.current=null)},[s]),r(()=>{if(!o)return;const e=A.current;e?(M.current?.querySelectorAll("[data-mg-menu-entry]")[e.index]?.focus({preventScroll:!0}),j.current.scrollTop=e.scrollTop,A.current=null):(j.current.scrollTop=0,k.current?.focus())},[f,o]),r(()=>{o&&!j.current?.contains(document.activeElement)&&k.current?.focus()});const O=I?.url||I?.bannerButton?.url;/*#__PURE__*/ /*#__PURE__*/
14
+ return(0,c().jsxs)("div",{id:g,ref:j,className:`mg-mega-mobile-sidebar mg-mega-mobile-sidebar--progressive${o?" mg-mega-mobile-sidebar--open":""}${d&&v.trim()?" mg-mega-mobile-sidebar--filtering":""}`,role:"dialog","aria-modal":o?"true":void 0,"aria-labelledby":F,"aria-label":m.menuLabel||"Menu",hidden:!s,"aria-hidden":!o,inert:!o||void 0,onKeyDown:e=>{if(e.isComposing||e.nativeEvent?.isComposing)e.stopPropagation();else if("Escape"===e.key&&(e.stopPropagation(),e.preventDefault(),u()),"Tab"===e.key){const t=new Map,r=Array.from(j.current.querySelectorAll('a[href], button, input, select, textarea, summary, iframe, [contenteditable="true"], [tabindex], audio[controls], video[controls]')).filter(e=>{if(e.tabIndex<0||e.matches(':disabled, input[type="hidden"]')||e.closest("[hidden], [inert]"))return!1;for(let t=e.parentElement?.closest("details:not([open])");t;t=t.parentElement?.closest("details:not([open])"))if(t.querySelector(":scope > summary")!==e)return!1;for(let r=e;r&&r!==j.current;r=r.parentElement){if(!t.has(r)){const e=window.getComputedStyle(r);t.set(r,"none"===e.display||"hidden"===e.visibility)}if(t.get(r))return!1}return!0}),n=r[0],a=r.at(-1);!e.shiftKey||document.activeElement!==n&&document.activeElement!==k.current?e.shiftKey||document.activeElement!==a||(e.preventDefault(),n?.focus()):(e.preventDefault(),a?.focus())}},children:[/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("div",{className:"mg-mega-mobile-sidebar__header",children:/*#__PURE__*/ /*#__PURE__*/(0,c().jsxs)("button",{className:"mg-mega-mobile-sidebar__close",onClick:u,"aria-label":m.closeMobileNavLabel,children:[m.closeLabel,/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("span",{"aria-hidden":"true",children:"×"})]})}),d&&/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("div",{className:"mg-mega-mobile-sidebar__filter-container",children:/*#__PURE__*/ /*#__PURE__*/(0,c().jsxs)("div",{className:"mg-mega-filter mg-mega-filter--mobile",children:[/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("span",{className:"mg-icon mg-icon-search mg-mega-filter__icon","aria-hidden":"true"}),/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("input",{type:"search",className:"mg-mega-filter__input",value:v,onChange:e=>y(e.target.value),placeholder:m.filterPlaceholder||"Filter menu items...","aria-label":m.filterPlaceholder||"Filter menu items",ref:_}),v&&/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("button",{type:"button",className:"mg-mega-filter__clear",onClick:()=>{y(""),_.current?.focus()},"aria-label":m.clearFilterLabel||"Clear filter",children:/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("span",{"aria-hidden":"true",children:"×"})})]})}),d&&v.trim()?/*#__PURE__*/ /*#__PURE__*/(0,c().jsxs)("div",{className:"mg-mega-mobile-sidebar__filter-results",children:[/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("h2",{id:F,ref:k,tabIndex:-1,className:"mg-mega-mobile-sidebar__title mg-u-sr-only",children:m.menuLabel||"Menu"}),/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("div",{className:"mg-mega-filter__status"+(P.length>0?" mg-u-sr-only":""),role:"status","aria-live":"polite",children:0===P.length?m.noFilterResultsLabel:S(m.filterMatchesCount,{count:P.length})}),P.length>0?/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("ul",{className:"mg-mega-filter__mobile-list",children:P.map((e,t)=>/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("li",{className:"mg-mega-filter__mobile-item",children:/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("a",{href:e.url,className:"mg-mega-filter__mobile-link",onClick:u,"aria-label":e.fullPath?`${e.title} (${e.fullPath})`:e.title,children:/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)(C,{item:e,query:v})})},t))}):/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("div",{className:"mg-mega-filter__empty-container",children:b&&v.trim()&&/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("div",{className:"mg-mega-filter__empty-actions",children:/*#__PURE__*/ /*#__PURE__*/(0,c().jsxs)("a",{href:N(h,v),className:"mg-button mg-button-secondary mg-button-outline mg-mega-filter__empty-search-btn",onClick:u,children:[/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("span",{children:S(m.searchSiteLabel,{query:v.trim()})}),/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("span",{className:"mg-icon mg-icon-arrow-right mg-mega-filter__fallback-arrow","aria-hidden":"true"})]})})}),b&&P.length>0&&/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("div",{className:"mg-mega-filter__fallback",children:/*#__PURE__*/ /*#__PURE__*/(0,c().jsxs)("a",{href:N(h,v),className:"mg-button mg-button-secondary mg-button-outline mg-mega-filter__site-search-link",onClick:u,children:[/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("span",{children:S(m.searchSiteLabel,{query:v.trim()})}),/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("span",{className:"mg-icon mg-icon-arrow-right mg-mega-filter__fallback-arrow","aria-hidden":"true"})]})})]}):/*#__PURE__*/ /*#__PURE__*/(0,c().jsxs)("div",{className:"mg-mega-mobile-sidebar__page"+(f.length?" mg-mega-mobile-sidebar__page--section":""),children:[f.length>0&&/*#__PURE__*/ /*#__PURE__*/(0,c().jsxs)("button",{className:"mg-mega-mobile-sidebar__back",onClick:()=>{A.current=D.current.pop(),p(e=>e.slice(0,-1))},children:[/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("span",{className:"mg-mega-mobile-sidebar__arrow","aria-hidden":"true",children:"←"}),m.backLabel]}),/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("h2",{id:F,ref:k,tabIndex:-1,className:"mg-mega-mobile-sidebar__title",children:O?/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("a",{className:"mg-mega-mobile-sidebar__title-link",href:O,children:I.title}):I?.title||m.allSectionsLabel}),I?.url&&I.bannerButton?.url&&I.url!==I.bannerButton.url&&/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("a",{className:"mg-mega-mobile-sidebar__overview",href:I.bannerButton.url,children:I.bannerButton.label||m.overviewLabel}),E?.length>0&&/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("ul",{ref:M,className:"mg-mega-sidebar__list",children:(E||[]).map((e,t)=>/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("li",{className:"mg-mega-sidebar-section",children:e.items?.length>0||e.bannerDescription?/*#__PURE__*/ /*#__PURE__*/(0,c().jsxs)("button",{className:"mg-mega-sidebar-section__item","data-mg-menu-entry":!0,onClick:()=>(e=>{D.current.push({index:e,scrollTop:j.current.scrollTop}),p(t=>[...t,e])})(t),children:[e.title,/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("svg",{className:"mg-mega-mobile-sidebar__chevron",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("path",{d:"m9 6 6 6-6 6"})})]}):/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("a",{className:"mg-mega-sidebar-section__item","data-mg-menu-entry":!0,href:e.url||e.bannerButton?.url||"#",children:e.title})},t))}),I?.bannerDescription&&/*#__PURE__*/ /*#__PURE__*/(0,c().jsxs)("div",{className:"mg-mega-mobile-sidebar__intro",children:[I.bannerHeading&&I.bannerHeading!==I.title&&/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("h3",{children:I.bannerHeading}),/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("div",{dangerouslySetInnerHTML:{__html:I.bannerDescription}})]})]},f.join("-"))]})}const P=({sections:r,delay:n=300,hoverDelay:i=180,logoSrc:o,logoAlt:s="",logoHref:u="/",logoWidth:m,logoHeight:g,enableFilter:b=!1,enableSiteSearch:f=!0,searchUrl:p="/search",onNavigate:v,lang:y,dir:_,labels:x})=>{const L=h(y,x),{navLabel:j,closeMobileNavLabel:w}=L,N=t(),S=a(null),[k,C]=l(null),[M,D]=l(!1),[A,F]=l(!1),R=M||A,[P,I]=l(null),[E,$]=l(!1),[O,H]=l(!1),B=a([]),U=a([]);e(()=>{if(M)return void F(!0);if(!A)return;const e=S.current?.querySelector(".mg-mega-mobile-sidebar"),t=e&&e.ownerDocument.defaultView.getComputedStyle(e),r=e=>(parseFloat(e)||0)*(e.trim().endsWith("ms")?1:1e3),n=(t?.transitionDuration||"0s").split(",").map(r),a=(t?.transitionDelay||"0s").split(",").map(r),l=(t?.transitionProperty||"all").split(","),i=Math.max(0,...l.map((e,t)=>"none"===e.trim()?0:n[t%n.length]+a[t%a.length])),o=setTimeout(()=>F(!1),i);return()=>clearTimeout(o)},[M,A]);const K=a(null),W=a(null);e(()=>{H(!0)},[]),e(()=>()=>{clearTimeout(K.current),clearTimeout(W.current)},[]);const X=()=>{const e=S.current?.ownerDocument.activeElement;S.current?.contains(e)&&e.closest(".mg-mega-content")&&(e.closest(".mg-mega-topbar__item")?.querySelector(".mg-mega-topbar__item-link")?.focus(),clearTimeout(W.current))};return e(()=>{const e=e=>{const t=S.current,r=t?.contains(e.target)||(e.composedPath?.()||[]).includes(t);t&&!r&&(X(),I(null))};if(null!==P)return document.addEventListener("click",e),()=>{document.removeEventListener("click",e)}},[P]),e(()=>{if(!window.matchMedia)return;const e=window.matchMedia("(min-width: 900px)"),t=()=>{$(!e.matches),e.matches&&D(!1)};return t(),e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]),/*#__PURE__*/ /*#__PURE__*/(0,c().jsxs)("nav",{...d(y,_),ref:S,className:`mg-mega-wrapper${O?" mg-mega-wrapper--js-active":""}${R?" mg-mega-wrapper--mobile-open":""}`,onMouseLeave:()=>{clearTimeout(W.current),K.current=setTimeout(()=>{S.current?.ownerDocument.activeElement?.closest(".mg-mega-menu-finder")||(X(),I(null))},n)},onKeyDown:e=>{if("Escape"===e.key){const t=e.target.closest(".mg-mega-content");t?.closest(".mg-mega-topbar__item")?.querySelector(".mg-mega-topbar__item-link")?.focus(),clearTimeout(W.current),I(null)}},"aria-label":j,children:[/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)(T,{isMobile:E,openMobileSection:e=>{C(e),D(!0)},sidebarId:N,labels:L,sections:r,handleItemHover:e=>{clearTimeout(K.current),clearTimeout(W.current),W.current=setTimeout(()=>{const t=S.current?.ownerDocument.activeElement;S.current?.contains(t)&&t.closest(".mg-mega-content")&&t.closest(".mg-mega-topbar__item")!==B.current[e]?.closest(".mg-mega-topbar__item")&&(B.current[e]?.focus(),clearTimeout(W.current)),I(e)},i)},toggleShowSidebar:()=>{C(null),D(e=>!e)},showSidebar:M,activeItem:P,activateItem:I,itemListRef:B,sectionListRef:U,logoSrc:o,logoAlt:s,logoHref:u,logoWidth:m,logoHeight:g,enableFilter:b,enableSiteSearch:f,searchUrl:p,onNavigate:v}),R&&/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)("button",{className:"mg-mega-mobile-sidebar-overlay"+(M?" mg-mega-mobile-sidebar-overlay--open":""),"aria-hidden":!M,"aria-label":w,tabIndex:-1,onClick:()=>D(!1)}),/*#__PURE__*/ /*#__PURE__*/(0,c().jsx)(q,{initialSection:k,id:N,labels:L,onClose:()=>D(!1),present:R,open:M,sections:r,enableFilter:b,enableSiteSearch:f,searchUrl:p})]})};P.propTypes={sections:y().arrayOf(y().shape({title:y().string.isRequired,icon:y().string,bannerHeading:y().string,bannerDescription:y().string,bannerButton:y().shape({label:y().string,url:y().string}),items:y().arrayOf(y().shape({title:y().string.isRequired,url:y().string,items:y().array}))})).isRequired,delay:y().number,hoverDelay:y().number,logoSrc:y().string,logoAlt:y().string,logoHref:y().string,logoWidth:y().number,logoHeight:y().number,enableFilter:y().bool,enableSiteSearch:y().bool,searchUrl:y().string,lang:y().string,dir:y().oneOf(["ltr","rtl","auto"]),labels:y().shape({navLabel:y().string,closeMobileNavLabel:y().string,menuLabel:y().string,backLabel:y().string,allSectionsLabel:y().string,closeLabel:y().string,overviewLabel:y().string,toggleMobileNavLabel:y().string,menuFilterLabel:y().string,filterPlaceholder:y().string,clearFilterLabel:y().string,noFilterResultsLabel:y().string,searchSiteLabel:y().string,filterMatchesCount:y().string})};const I=P;function E(e){const{dataset:t}=e,r=function(e){try{const t=JSON.parse(e.dataset.labels);return t&&"object"==typeof t&&!Array.isArray(t)?t:void 0}catch{return}}(e),n={...b(e),...r?{labels:r}:{},delay:t.delay?parseInt(t.delay,10):300,hoverDelay:t.hoverDelay?parseInt(t.hoverDelay,10):180};if(void 0!==t.enableFilter&&(n.enableFilter="false"!==t.enableFilter),void 0!==t.enableSiteSearch&&(n.enableSiteSearch="false"!==t.enableSiteSearch),t.searchUrl&&(n.searchUrl=t.searchUrl),t.logoSrc&&(n.logoSrc=t.logoSrc),t.logoAlt&&(n.logoAlt=t.logoAlt),t.logoHref&&(n.logoHref=t.logoHref),t.logoWidth&&(n.logoWidth=parseInt(t.logoWidth,10)),t.logoHeight&&(n.logoHeight=parseInt(t.logoHeight,10)),t.sections)try{n.sections=JSON.parse(t.sections)}catch{n.sections=[]}return n}export{I as default,E as fromElement,h as getMegaMenuLabels};
@@ -3,7 +3,8 @@
3
3
  * Storybook: https://mangrove.undrr.org/
4
4
  * LLMs context: https://mangrove.undrr.org/llms.txt
5
5
  * Repository: https://github.com/PreventionWeb/undrr-mangrove
6
- * Compiled on: 2026-10-17T14:23:48.871Z
6
+ * Compiled on: 2026-11-09T16:21:46.474Z
7
7
  */
8
8
  /*! For license information please see Notice.js.LICENSE.txt */
9
- import{useEffect as e,useRef as t,useState as n}from"react";var i={2694(e,t,n){var i=n(6925);function o(){}function r(){}r.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,r,s){if(s!==i){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:r,resetWarningCache:o};return n.PropTypes=n,n}},5556(e,t,n){e.exports=n(2694)()},6925(e){e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},6942(e,t){var n;!function(){var i={}.hasOwnProperty;function o(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=s(e,r(n)))}return e}function r(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return o.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var n in e)i.call(e,n)&&e[n]&&(t=s(t,n));return t}function s(e,t){return t?e?e+" "+t:e+t:e}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()}};const o={};function r(e){const t=o[e];if(void 0!==t)return t.exports;const n=o[e]={exports:{}};return i[e](n,n.exports,r),n.exports}r.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.cw=e=>{var t;return()=>{if(e){var n=e;e=0,t={exports:{}},n.call(t.exports,t,t.exports)}return t.exports}},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var s=r.cw(function(e,t){var n=Symbol.for("react.transitional.element");function i(e,t,i){var o=null;if(void 0!==i&&(o=""+i),void 0!==t.key&&(o=""+t.key),"key"in t)for(var r in i={},t)"key"!==r&&(i[r]=t[r]);else i=t;return t=i.ref,{$$typeof:n,type:e,key:o,ref:void 0!==t?t:null,props:i}}Symbol.for("react.fragment"),t.jsx=i,t.jsxs=i}),a=r.cw(function(e,t){e.exports=s()}),c=r(5556),l=r.n(c),u=r(6942),d=r.n(u);a();const m=["info","warning","negative","positive"],p=()=>(0,s().jsx)("svg",{viewBox:"0 0 24 24",focusable:"false","aria-hidden":"true",children:(0,s().jsx)("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"})}),f={info:"mg-icon-info-circle",warning:"mg-icon-exclamation-triangle",negative:"mg-icon-exclamation-triangle",positive:(0,s().jsx)(p,{})},v=["h2","h3","h4","h5","h6"],y=["a[href]","area[href]","button:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","iframe","summary","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])','[tabindex]:not([tabindex^="-"])'].join(",");function g(e){return!e.hidden&&!e.closest('[aria-hidden="true"], [inert]')&&("function"!=typeof e.checkVisibility||e.checkVisibility())}const b=({title:i,description:o,children:r,variant:a="info",icon:c=!0,headingLevel:l="h3",isCompact:u=!1,isProminent:p=!1,isOverlay:b=!1,isDismissible:h=!1,onDismiss:x,dismissLabel:_="Dismiss notification",actions:O,headerContent:j,role:N,className:C,...S})=>{const[P,E]=n(!1),T=t(null),k=t(null);if(e(()=>{k.current=document.activeElement},[]),P)return null;const D=m.includes(a)?a:"info",L=void 0===N?"negative"===D?"alert":"status":N||void 0,w=v.includes(l)?l:"h3",I=d()("mg-notice",`mg-notice--${D}`,{"mg-notice--compact":u,"mg-notice--prominent":p,"mg-notice--overlay":b},C);let R=null;!0===c?R=f[D]:c&&(R=c);const M=r||o;return(0,s().jsxs)("div",{ref:T,className:I,role:L,...S,children:[(i||R||h||j)&&(0,s().jsxs)("div",{className:"mg-notice__header",children:["string"==typeof R&&(0,s().jsx)("span",{className:d()("mg-icon mg-notice__icon",R),"aria-hidden":"true"}),R&&"string"!=typeof R&&(0,s().jsx)("span",{className:"mg-notice__icon","aria-hidden":"true",children:R}),i&&(0,s().jsx)(w,{className:"mg-notice__title",children:i}),j,h&&(0,s().jsx)("button",{type:"button",className:"mg-icon-button mg-icon-button--small mg-notice__dismiss",onClick:e=>{const t=T.current;if(t&&t.contains(document.activeElement)){const e=function(e,t){if(t&&t.isConnected&&t!==document.body&&!e.contains(t)&&"function"==typeof t.focus&&g(t))return t;let n=e.parentElement;for(;n;){let t=null,i=null;for(const o of n.querySelectorAll(y)){if(e.contains(o)||!g(o))continue;const n=e.compareDocumentPosition(o);n&Node.DOCUMENT_POSITION_PRECEDING?t=o:!i&&n&Node.DOCUMENT_POSITION_FOLLOWING&&(i=o)}if(t||i)return t||i;if(n===document.body)break;n=n.parentElement}return null}(t,k.current);e?e.focus():document.activeElement.blur()}k.current=null,E(!0),x&&x(e)},"aria-label":_,children:(0,s().jsx)("span",{className:"mg-icon mg-icon-close","aria-hidden":"true"})})]}),M&&(0,s().jsx)("div",{className:"mg-notice__description",children:"string"==typeof M?(0,s().jsx)("p",{children:M}):M}),O&&(0,s().jsx)("div",{className:"mg-notice__actions mg-buttons",children:O})]})};function h(e){const{dataset:t}=e;return{title:t.title||e.querySelector(".mg-notice__title")?.textContent?.trim()||null,description:t.description||e.querySelector(".mg-notice__description")?.textContent?.trim()||null,variant:t.variant||void 0,headingLevel:t.headingLevel||void 0,isCompact:"true"===t.isCompact,isProminent:"true"===t.isProminent,isOverlay:"true"===t.isOverlay,isDismissible:"true"===t.isDismissible,dismissLabel:t.dismissLabel||void 0}}b.propTypes={title:l().node,description:l().node,children:l().node,variant:l().oneOf(m),icon:l().oneOfType([l().bool,l().string,l().node]),headingLevel:l().oneOf(v),isCompact:l().bool,isProminent:l().bool,isOverlay:l().bool,isDismissible:l().bool,onDismiss:l().func,dismissLabel:l().string,actions:l().node,headerContent:l().node,role:l().string,className:l().string};export{b as Notice,b as default,h as fromElement};
9
+ import{useEffect as e,useRef as t,useState as n}from"react";var i={2694(e,t,n){var i=n(6925);function o(){}function r(){}r.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,r,s){if(s!==i){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:r,resetWarningCache:o};return n.PropTypes=n,n}},5556(e,t,n){e.exports=n(2694)()},6925(e){e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},6942(e,t){var n;!function(){var i={}.hasOwnProperty;function o(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=s(e,r(n)))}return e}function r(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return o.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var n in e)i.call(e,n)&&e[n]&&(t=s(t,n));return t}function s(e,t){return t?e?e+" "+t:e+t:e}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()}};const o={};function r(e){const t=o[e];if(void 0!==t)return t.exports;const n=o[e]={exports:{}};return i[e](n,n.exports,r),n.exports}r.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.cw=e=>{var t;return()=>{if(e){var n=e;e=0,t={exports:{}},n.call(t.exports,t,t.exports)}return t.exports}},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var s=/*#__PURE__*/r.cw((e,t)=>{var n=Symbol.for("react.transitional.element");function i(e,t,i){var o=null;if(void 0!==i&&(o=""+i),void 0!==t.key&&(o=""+t.key),"key"in t)for(var r in i={},t)"key"!==r&&(i[r]=t[r]);else i=t;return t=i.ref,{$$typeof:n,type:e,key:o,ref:void 0!==t?t:null,props:i}}Symbol.for("react.fragment"),t.jsx=i,t.jsxs=i}),a=/*#__PURE__*/r.cw(e=>{e.exports=s()}),c=/*#__PURE__*/r(5556),l=/*#__PURE__*/r.n(c),u=r(6942),d=/*#__PURE__*/r.n(u);a();const m=["info","warning","negative","positive"],p=()=>/*#__PURE__*/ /*#__PURE__*/(0,s().jsx)("svg",{viewBox:"0 0 24 24",focusable:"false","aria-hidden":"true",children:/*#__PURE__*/ /*#__PURE__*/(0,s().jsx)("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"})}),f={info:"mg-icon-info-circle",warning:"mg-icon-exclamation-triangle",negative:"mg-icon-exclamation-triangle",positive:/*#__PURE__*/ /*#__PURE__*/(0,s().jsx)(p,{})},v=["h2","h3","h4","h5","h6"],y=["a[href]","area[href]","button:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","iframe","summary","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])','[tabindex]:not([tabindex^="-"])'].join(",");function g(e){return!e.hidden&&!e.closest('[aria-hidden="true"], [inert]')&&("function"!=typeof e.checkVisibility||e.checkVisibility())}const b=({title:i,description:o,children:r,variant:a="info",icon:c=!0,headingLevel:l="h3",isCompact:u=!1,isProminent:p=!1,isOverlay:b=!1,isDismissible:h=!1,onDismiss:x,dismissLabel:_="Dismiss notification",actions:O,headerContent:j,role:N,className:C,...S})=>{const[P,E]=n(!1),T=t(null),k=t(null);if(e(()=>{k.current=document.activeElement},[]),P)return null;const D=m.includes(a)?a:"info",L=void 0===N?"negative"===D?"alert":"status":N||void 0,w=v.includes(l)?l:"h3",I=d()("mg-notice",`mg-notice--${D}`,{"mg-notice--compact":u,"mg-notice--prominent":p,"mg-notice--overlay":b},C);let R=null;!0===c?R=f[D]:c&&(R=c);const M=r||o;/*#__PURE__*/ /*#__PURE__*/
10
+ return(0,s().jsxs)("div",{ref:T,className:I,role:L,...S,children:[(i||R||h||j)&&/*#__PURE__*/ /*#__PURE__*/(0,s().jsxs)("div",{className:"mg-notice__header",children:["string"==typeof R&&/*#__PURE__*/ /*#__PURE__*/(0,s().jsx)("span",{className:d()("mg-icon mg-notice__icon",R),"aria-hidden":"true"}),R&&"string"!=typeof R&&/*#__PURE__*/ /*#__PURE__*/(0,s().jsx)("span",{className:"mg-notice__icon","aria-hidden":"true",children:R}),i&&/*#__PURE__*/ /*#__PURE__*/(0,s().jsx)(w,{className:"mg-notice__title",children:i}),j,h&&/*#__PURE__*/ /*#__PURE__*/(0,s().jsx)("button",{type:"button",className:"mg-icon-button mg-icon-button--small mg-notice__dismiss",onClick:e=>{const t=T.current;if(t&&t.contains(document.activeElement)){const e=function(e,t){if(t&&t.isConnected&&t!==document.body&&!e.contains(t)&&"function"==typeof t.focus&&g(t))return t;let n=e.parentElement;for(;n;){let t=null,i=null;for(const o of n.querySelectorAll(y)){if(e.contains(o)||!g(o))continue;const n=e.compareDocumentPosition(o);n&Node.DOCUMENT_POSITION_PRECEDING?t=o:!i&&n&Node.DOCUMENT_POSITION_FOLLOWING&&(i=o)}if(t||i)return t||i;if(n===document.body)break;n=n.parentElement}return null}(t,k.current);e?e.focus():document.activeElement.blur()}k.current=null,E(!0),x&&x(e)},"aria-label":_,children:/*#__PURE__*/ /*#__PURE__*/(0,s().jsx)("span",{className:"mg-icon mg-icon-close","aria-hidden":"true"})})]}),M&&/*#__PURE__*/ /*#__PURE__*/(0,s().jsx)("div",{className:"mg-notice__description",children:"string"==typeof M?/*#__PURE__*/ /*#__PURE__*/(0,s().jsx)("p",{children:M}):M}),O&&/*#__PURE__*/ /*#__PURE__*/(0,s().jsx)("div",{className:"mg-notice__actions mg-buttons",children:O})]})};function h(e){const{dataset:t}=e;return{title:t.title||e.querySelector(".mg-notice__title")?.textContent?.trim()||null,description:t.description||e.querySelector(".mg-notice__description")?.textContent?.trim()||null,variant:t.variant||void 0,headingLevel:t.headingLevel||void 0,isCompact:"true"===t.isCompact,isProminent:"true"===t.isProminent,isOverlay:"true"===t.isOverlay,isDismissible:"true"===t.isDismissible,dismissLabel:t.dismissLabel||void 0}}b.propTypes={title:l().node,description:l().node,children:l().node,variant:l().oneOf(m),icon:l().oneOfType([l().bool,l().string,l().node]),headingLevel:l().oneOf(v),isCompact:l().bool,isProminent:l().bool,isOverlay:l().bool,isDismissible:l().bool,onDismiss:l().func,dismissLabel:l().string,actions:l().node,headerContent:l().node,role:l().string,className:l().string};export{b as Notice,b as default,h as fromElement};
@@ -3,7 +3,9 @@
3
3
  * Storybook: https://mangrove.undrr.org/
4
4
  * LLMs context: https://mangrove.undrr.org/llms.txt
5
5
  * Repository: https://github.com/PreventionWeb/undrr-mangrove
6
- * Compiled on: 2026-10-17T14:23:48.871Z
6
+ * Compiled on: 2026-11-09T16:21:46.474Z
7
7
  */
8
8
  /*! For license information please see PageHeader.js.LICENSE.txt */
9
- import{default as e,useRef as a}from"react";var o={2694(e,a,o){var r=o(6925);function t(){}function n(){}n.resetWarningCache=t,e.exports=function(){function e(e,a,o,t,n,l){if(l!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function a(){return e}e.isRequired=e;var o={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:a,element:e,elementType:e,instanceOf:a,node:e,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o}},5556(e,a,o){e.exports=o(2694)()},6925(e){e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}};const r={};function t(e){const a=r[e];if(void 0!==a)return a.exports;const n=r[e]={exports:{}};return o[e](n,n.exports,t),n.exports}t.n=e=>{const a=e&&e.__esModule?()=>e.default:()=>e;return t.d(a,{a}),a},t.cw=e=>{var a;return()=>{if(e){var o=e;e=0,a={exports:{}},o.call(a.exports,a,a.exports)}return a.exports}},t.d=(e,a)=>{for(var o in a)t.o(a,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:a[o]})},t.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),(()=>{let e;if("string"==typeof import.meta.url&&(e=import.meta.url),!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:|[?#].*$/g,"").replace(/\/[^/]+$/,"/"),t.p=e})();var n=t.cw(function(e,a){var o=Symbol.for("react.transitional.element");function r(e,a,r){var t=null;if(void 0!==r&&(t=""+r),void 0!==a.key&&(t=""+a.key),"key"in a)for(var n in r={},a)"key"!==n&&(r[n]=a[n]);else r=a;return a=r.ref,{$$typeof:o,type:e,key:t,ref:void 0!==a?a:null,props:r}}Symbol.for("react.fragment"),a.jsx=r,a.jsxs=r}),l=t.cw(function(e,a){e.exports=n()}),s=t(5556),i=t.n(s);function g({name:e,className:a="",size:o,...r}){if(!e)return null;let t;return t=e.includes(" ")?e:e.startsWith("fa-")||e.startsWith("mg-icon-")?`mg-icon ${e}`:e.startsWith("mg-")?`mg-icon mg-icon-${e.slice(3)}`:`mg-icon mg-icon-${e}`,o&&(t+=` mg-icon--${o}`),a&&(t+=` ${a}`),(0,n().jsx)("span",{className:t,"aria-hidden":"true",...r})}l(),g.propTypes={name:i().string.isRequired,className:i().string,size:i().oneOf(["sm","lg","xl"])};const c=(...e)=>e.filter(Boolean).length>0?e.filter(Boolean).join(" "):null,d=({src:e,alt:a,title:o,width:r,height:t,lang:l,crop:s,className:i})=>(0,n().jsx)("img",{src:e,alt:a,title:o,width:r,height:t,lang:l,className:c("mg-logo",s&&`mg-logo--${s}`,i)});d.propTypes={src:i().string.isRequired,alt:i().string.isRequired,title:i().string,width:i().oneOfType([i().string,i().number]),height:i().oneOfType([i().string,i().number]),lang:i().string,crop:i().oneOf(["autocrop"]),className:i().string};const h=t.p+"assets/a4133008bd4d2c4a42e5ca0c6db8fe9b.svg",m=t.p+"assets/f1605b17c97ebdc56cfaa75033e7283d.svg",u={arabic:{code:"ar",colors:{black:{width:1318,height:490},blue:{width:1313,height:487},white:{width:1318,height:490}}},spanish:{code:"es",colors:{black:{width:971,height:388},blue:{width:971,height:388},white:{width:971,height:387}}},french:{code:"fr",colors:{black:{width:971,height:414},blue:{width:971,height:415},white:{width:971,height:414}}},russian:{code:"ru",colors:{black:{width:971,height:338},blue:{width:971,height:338},white:{width:971,height:338}}},chinese:{code:"zh",colors:{black:{width:971,height:339},white:{width:971,height:339}}}},p={blue:{src:h,lang:void 0,translated:!1},white:{src:m,lang:void 0,translated:!1}};function f({targetId:e="main-content",label:a="Skip to main content",className:o,onClick:r,...t}){const l=["mg-skip-link",o].filter(Boolean).join(" ");return(0,n().jsx)("a",{className:l,href:`#${e}`,onClick:a=>{const o="undefined"==typeof document?null:document.getElementById(e);o&&o.focus(),r&&r(a)},...t,children:a})}f.propTypes={targetId:i().string,label:i().string,className:i().string,onClick:i().func};const b=(...e)=>e.filter(Boolean).length>0?e.filter(Boolean).join(" "):null;function _({variant:o="default",className:r,idPrefix:t="",skipLinkTarget:l,skipLinkLabel:s="Skip to main content",logoUrl:i,logoAlt:c="UNDRR Logo",logoTitle:h="UNDRR Logo",logoWidth:m,logoHeight:_,logoLang:v,logoCrop:w,locale:x="english",homeUrl:y="/",showAccount:j=!0,showLanguage:k=!0,showLogo:N=!0,languageDisplay:T="dropdown",maxLanguageLinks:O=6,languages:L=[{value:"ar",label:"Arabic"},{value:"en",label:"English",selected:!0},{value:"es",label:"Spanish"}],...$}){const R=a(null),S=e=>t?`${t}-${e}`:e,C="links"===T&&L.length<=O,P=b("mg-page-header",o&&`mg-page-header--${o}`,r),E=i?null:function(e,a="blue"){const o=u[e],r=o?.colors[a];if(o&&r){const e="white"===a?"svg":"png";return{src:`https://assets.undrr.org/logos/undrr/undrr-logo-${o.code}-${a}.${e}`,lang:o.code,width:r.width,height:r.height,translated:!0}}return p[a]||p.blue}(x,"white"),U=E?.translated?E:null,q=i||U?.src||"https://assets.undrr.org/logos/undrr/undrr-logo-horizontal.svg",I=void 0!==v?v:U?.lang,W=_||"47",A=m||(U?String(Math.round(U.width/U.height*Number(W))):"324"),B=void 0!==w?w:U?null:"autocrop";return"decoration-only"===o?(0,n().jsxs)("div",{className:b("mg-page-header__decoration",r),...$,children:[(0,n().jsx)("div",{}),(0,n().jsx)("div",{}),(0,n().jsx)("div",{}),(0,n().jsx)("div",{})]}):(0,n().jsxs)(e.Fragment,{children:[l&&(0,n().jsx)(f,{targetId:l,label:s}),(0,n().jsxs)("header",{id:S("header"),className:P,...$,children:[(0,n().jsxs)("div",{className:"mg-page-header__decoration",children:[(0,n().jsx)("div",{}),(0,n().jsx)("div",{}),(0,n().jsx)("div",{}),(0,n().jsx)("div",{})]}),(0,n().jsx)("div",{className:"mg-page-header__toolbar-wrapper","data-vf-google-analytics-region":"undrr-black-bar",children:(0,n().jsx)("div",{className:"mg-page-header__container mg-container",children:(0,n().jsxs)("div",{className:"mg-page-header__region mg-page-header__region--toolbar",children:[N&&(0,n().jsx)("div",{id:S("block-undrrlogo"),className:"mg-page-header__block mg-page-header__block--logo",children:(0,n().jsx)("a",{href:y,children:(0,n().jsx)(d,{alt:c,src:q,width:A,height:W,title:h,lang:I,crop:B,className:"mg-page-header__logo-img"})})}),j&&(0,n().jsxs)("a",{title:"My account",href:"/user",children:[(0,n().jsx)(g,{name:"user",className:"mg-page-header__toolbar-icon"})," ",(0,n().jsx)("span",{className:"mg-u-sr-only",children:"My account"})]}),k&&C&&(0,n().jsx)("div",{className:"mg-page-header__block mg-page-header__block--language-links",children:(0,n().jsx)("div",{className:"mg-page-header__language-links",role:"group","aria-label":"Language",children:L.map((e,a)=>{const o=e.selected??(!L.some(e=>e.selected)&&0===a);return(0,n().jsx)("button",{type:"button",className:"mg-page-header__language-link","aria-current":o?"true":void 0,onClick:()=>{const a=R.current;a&&(a.value=e.value,a.dispatchEvent(new Event("change",{bubbles:!0})),a.form?.requestSubmit?a.form.requestSubmit():a.form?.submit())},children:e.label},e.value)})})}),k&&(0,n().jsxs)("div",{className:b("mg-page-header__block","mg-page-header__block--language",C&&"mg-page-header__block--language-fallback"),children:[(0,n().jsx)(g,{name:"languages",className:"mg-page-header__toolbar-icon mg-page-header__language-icon"}),(0,n().jsxs)("form",{className:"mg-page-header__lang-form lang-dropdown-form lang_dropdown_form",id:S("lang_dropdown_form_lang-dropdown-form"),action:"/",method:"post",acceptCharset:"UTF-8",noValidate:!0,children:[(0,n().jsxs)("div",{className:"mg-page-header__form-item form-item js-form-item form-type-select js-form-type-select form-item-lang-dropdown-select js-form-item-lang-dropdown-select form-no-label",children:[(0,n().jsx)("label",{htmlFor:S("edit-lang-dropdown-select"),className:"mg-u-sr-only",children:"Select your language"}),(0,n().jsx)("div",{className:"mg-page-header__select-wrapper",children:(0,n().jsx)("select",{ref:R,title:"Select your language",className:"mg-page-header__select lang-dropdown-select-element form-select form-control","data-lang-dropdown-id":"lang-dropdown-form",id:S("edit-lang-dropdown-select"),name:"lang_dropdown_select",defaultValue:L.find(e=>e.selected)?.value||L[0]?.value,children:L.map((e,a)=>(0,n().jsx)("option",{value:e.value,children:e.label},a))})})]}),(0,n().jsx)("noscript",{children:(0,n().jsx)("div",{children:(0,n().jsx)("button",{type:"submit",id:S("edit-submit"),name:"op",value:"Go",className:"button js-form-submit form-submit btn",children:"Go"})})})]})]})]})})})]})]})}_.propTypes={variant:i().oneOf(["default","decoration-only"]),className:i().string,idPrefix:i().string,skipLinkTarget:i().string,skipLinkLabel:i().string,logoUrl:i().string,logoAlt:i().string,logoTitle:i().string,logoWidth:i().oneOfType([i().string,i().number]),logoHeight:i().oneOfType([i().string,i().number]),logoLang:i().string,logoCrop:i().oneOf(["autocrop",null]),locale:i().string,homeUrl:i().string,showLogo:i().bool,showAccount:i().bool,showLanguage:i().bool,languageDisplay:i().oneOf(["dropdown","links"]),maxLanguageLinks:i().number,languages:i().arrayOf(i().shape({value:i().string.isRequired,label:i().string.isRequired,selected:i().bool}))};export{_ as PageHeader};
9
+ import{default as e,useRef as a}from"react";var o={2694(e,a,o){var r=o(6925);function t(){}function n(){}n.resetWarningCache=t,e.exports=function(){function e(e,a,o,t,n,l){if(l!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function a(){return e}e.isRequired=e;var o={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:a,element:e,elementType:e,instanceOf:a,node:e,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o}},5556(e,a,o){e.exports=o(2694)()},6925(e){e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}};const r={};function t(e){const a=r[e];if(void 0!==a)return a.exports;const n=r[e]={exports:{}};return o[e](n,n.exports,t),n.exports}t.n=e=>{const a=e&&e.__esModule?()=>e.default:()=>e;return t.d(a,{a}),a},t.cw=e=>{var a;return()=>{if(e){var o=e;e=0,a={exports:{}},o.call(a.exports,a,a.exports)}return a.exports}},t.d=(e,a)=>{for(var o in a)t.o(a,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:a[o]})},t.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),(()=>{let e;if("string"==typeof import.meta.url&&(e=import.meta.url),!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:|[?#].*$/g,"").replace(/\/[^/]+$/,"/"),t.p=e})();var n=/*#__PURE__*/t.cw((e,a)=>{var o=Symbol.for("react.transitional.element");function r(e,a,r){var t=null;if(void 0!==r&&(t=""+r),void 0!==a.key&&(t=""+a.key),"key"in a)for(var n in r={},a)"key"!==n&&(r[n]=a[n]);else r=a;return a=r.ref,{$$typeof:o,type:e,key:t,ref:void 0!==a?a:null,props:r}}Symbol.for("react.fragment"),a.jsx=r,a.jsxs=r}),l=/*#__PURE__*/t.cw(e=>{e.exports=n()}),s=/*#__PURE__*/t(5556),i=/*#__PURE__*/t.n(s);function g({name:e,className:a="",size:o,...r}){if(!e)return null;let t;return t=e.includes(" ")?e:e.startsWith("fa-")||e.startsWith("mg-icon-")?`mg-icon ${e}`:e.startsWith("mg-")?`mg-icon mg-icon-${e.slice(3)}`:`mg-icon mg-icon-${e}`,o&&(t+=` mg-icon--${o}`),a&&(t+=` ${a}`),/*#__PURE__*/ /*#__PURE__*/(0,n().jsx)("span",{className:t,"aria-hidden":"true",...r})}l(),g.propTypes={name:i().string.isRequired,className:i().string,size:i().oneOf(["sm","lg","xl"])};const c=(...e)=>e.filter(Boolean).length>0?e.filter(Boolean).join(" "):null,d=({src:e,alt:a,title:o,width:r,height:t,lang:l,crop:s,className:i})=>/*#__PURE__*/ /*#__PURE__*/(0,n().jsx)("img",{src:e,alt:a,title:o,width:r,height:t,lang:l,className:c("mg-logo",s&&`mg-logo--${s}`,i)});d.propTypes={src:i().string.isRequired,alt:i().string.isRequired,title:i().string,width:i().oneOfType([i().string,i().number]),height:i().oneOfType([i().string,i().number]),lang:i().string,crop:i().oneOf(["autocrop"]),className:i().string};const h=t.p+"assets/a4133008bd4d2c4a42e5ca0c6db8fe9b.svg",m=t.p+"assets/f1605b17c97ebdc56cfaa75033e7283d.svg",p={arabic:{code:"ar",colors:{black:{width:1318,height:490},blue:{width:1313,height:487},white:{width:1318,height:490}}},spanish:{code:"es",colors:{black:{width:971,height:388},blue:{width:971,height:388},white:{width:971,height:387}}},french:{code:"fr",colors:{black:{width:971,height:414},blue:{width:971,height:415},white:{width:971,height:414}}},russian:{code:"ru",colors:{black:{width:971,height:338},blue:{width:971,height:338},white:{width:971,height:338}}},chinese:{code:"zh",colors:{black:{width:971,height:339},white:{width:971,height:339}}}},u={blue:{src:h,lang:void 0,translated:!1},white:{src:m,lang:void 0,translated:!1}};function f({targetId:e="main-content",label:a="Skip to main content",className:o,onClick:r,...t}){const l=["mg-skip-link",o].filter(Boolean).join(" ");/*#__PURE__*/ /*#__PURE__*/
10
+ return(0,n().jsx)("a",{className:l,href:`#${e}`,onClick:a=>{const o="undefined"==typeof document?null:document.getElementById(e);o&&o.focus(),r&&r(a)},...t,children:a})}f.propTypes={targetId:i().string,label:i().string,className:i().string,onClick:i().func};const b=(...e)=>e.filter(Boolean).length>0?e.filter(Boolean).join(" "):null;function _({variant:o="default",className:r,idPrefix:t="",skipLinkTarget:l,skipLinkLabel:s="Skip to main content",logoUrl:i,logoAlt:c="UNDRR Logo",logoTitle:h="UNDRR Logo",logoWidth:m,logoHeight:_,logoLang:v,logoCrop:w,locale:x="english",homeUrl:y="/",showAccount:j=!0,showLanguage:k=!0,showLogo:N=!0,languageDisplay:T="dropdown",maxLanguageLinks:O=6,languages:L=[{value:"ar",label:"Arabic"},{value:"en",label:"English",selected:!0},{value:"es",label:"Spanish"}],...$}){const R=a(null),S=e=>t?`${t}-${e}`:e,C="links"===T&&L.length<=O,P=b("mg-page-header",o&&`mg-page-header--${o}`,r),E=i?null:function(e,a="blue"){const o=p[e],r=o?.colors[a];if(o&&r){const e="white"===a?"svg":"png";return{src:`https://assets.undrr.org/logos/undrr/undrr-logo-${o.code}-${a}.${e}`,lang:o.code,width:r.width,height:r.height,translated:!0}}return u[a]||u.blue}(x,"white"),U=E?.translated?E:null,q=i||U?.src||"https://assets.undrr.org/logos/undrr/undrr-logo-horizontal.svg",I=void 0!==v?v:U?.lang,W=_||"47",A=m||(U?String(Math.round(U.width/U.height*Number(W))):"324"),B=void 0!==w?w:U?null:"autocrop";return"decoration-only"===o?/*#__PURE__*/ /*#__PURE__*/(0,n().jsxs)("div",{className:b("mg-page-header__decoration",r),...$,children:[/*#__PURE__*/ /*#__PURE__*/(0,n().jsx)("div",{}),/*#__PURE__*/ /*#__PURE__*/(0,n().jsx)("div",{}),/*#__PURE__*/ /*#__PURE__*/(0,n().jsx)("div",{}),/*#__PURE__*/ /*#__PURE__*/(0,n().jsx)("div",{})]}):/*#__PURE__*/ /*#__PURE__*/(0,n().jsxs)(e.Fragment,{children:[l&&/*#__PURE__*/ /*#__PURE__*/(0,n().jsx)(f,{targetId:l,label:s}),/*#__PURE__*/ /*#__PURE__*/(0,n().jsxs)("header",{id:S("header"),className:P,...$,children:[/*#__PURE__*/ /*#__PURE__*/(0,n().jsxs)("div",{className:"mg-page-header__decoration",children:[/*#__PURE__*/ /*#__PURE__*/(0,n().jsx)("div",{}),/*#__PURE__*/ /*#__PURE__*/(0,n().jsx)("div",{}),/*#__PURE__*/ /*#__PURE__*/(0,n().jsx)("div",{}),/*#__PURE__*/ /*#__PURE__*/(0,n().jsx)("div",{})]}),/*#__PURE__*/ /*#__PURE__*/(0,n().jsx)("div",{className:"mg-page-header__toolbar-wrapper","data-vf-google-analytics-region":"undrr-black-bar",children:/*#__PURE__*/ /*#__PURE__*/(0,n().jsx)("div",{className:"mg-page-header__container mg-container",children:/*#__PURE__*/ /*#__PURE__*/(0,n().jsxs)("div",{className:"mg-page-header__region mg-page-header__region--toolbar",children:[N&&/*#__PURE__*/ /*#__PURE__*/(0,n().jsx)("div",{id:S("block-undrrlogo"),className:"mg-page-header__block mg-page-header__block--logo",children:/*#__PURE__*/ /*#__PURE__*/(0,n().jsx)("a",{href:y,children:/*#__PURE__*/ /*#__PURE__*/(0,n().jsx)(d,{alt:c,src:q,width:A,height:W,title:h,lang:I,crop:B,className:"mg-page-header__logo-img"})})}),j&&/*#__PURE__*/ /*#__PURE__*/(0,n().jsxs)("a",{title:"My account",href:"/user",children:[/*#__PURE__*/ /*#__PURE__*/(0,n().jsx)(g,{name:"user",className:"mg-page-header__toolbar-icon"})," ",/*#__PURE__*/ /*#__PURE__*/(0,n().jsx)("span",{className:"mg-u-sr-only",children:"My account"})]}),k&&C&&/*#__PURE__*/ /*#__PURE__*/(0,n().jsx)("div",{className:"mg-page-header__block mg-page-header__block--language-links",children:/*#__PURE__*/ /*#__PURE__*/(0,n().jsx)("div",{className:"mg-page-header__language-links",role:"group","aria-label":"Language",children:L.map((e,a)=>{const o=e.selected??(!L.some(e=>e.selected)&&0===a);/*#__PURE__*/ /*#__PURE__*/
11
+ return(0,n().jsx)("button",{type:"button",className:"mg-page-header__language-link","aria-current":o?"true":void 0,onClick:()=>{const a=R.current;a&&(a.value=e.value,a.dispatchEvent(new Event("change",{bubbles:!0})),a.form?.requestSubmit?a.form.requestSubmit():a.form?.submit())},children:e.label},e.value)})})}),k&&/*#__PURE__*/ /*#__PURE__*/(0,n().jsxs)("div",{className:b("mg-page-header__block","mg-page-header__block--language",C&&"mg-page-header__block--language-fallback"),children:[/*#__PURE__*/ /*#__PURE__*/(0,n().jsx)(g,{name:"languages",className:"mg-page-header__toolbar-icon mg-page-header__language-icon"}),/*#__PURE__*/ /*#__PURE__*/(0,n().jsxs)("form",{className:"mg-page-header__lang-form lang-dropdown-form lang_dropdown_form",id:S("lang_dropdown_form_lang-dropdown-form"),action:"/",method:"post",acceptCharset:"UTF-8",noValidate:!0,children:[/*#__PURE__*/ /*#__PURE__*/(0,n().jsxs)("div",{className:"mg-page-header__form-item form-item js-form-item form-type-select js-form-type-select form-item-lang-dropdown-select js-form-item-lang-dropdown-select form-no-label",children:[/*#__PURE__*/ /*#__PURE__*/(0,n().jsx)("label",{htmlFor:S("edit-lang-dropdown-select"),className:"mg-u-sr-only",children:"Select your language"}),/*#__PURE__*/ /*#__PURE__*/(0,n().jsx)("div",{className:"mg-page-header__select-wrapper",children:/*#__PURE__*/ /*#__PURE__*/(0,n().jsx)("select",{ref:R,title:"Select your language",className:"mg-page-header__select lang-dropdown-select-element form-select form-control","data-lang-dropdown-id":"lang-dropdown-form",id:S("edit-lang-dropdown-select"),name:"lang_dropdown_select",defaultValue:L.find(e=>e.selected)?.value||L[0]?.value,children:L.map((e,a)=>/*#__PURE__*/ /*#__PURE__*/(0,n().jsx)("option",{value:e.value,children:e.label},a))})})]}),/*#__PURE__*/ /*#__PURE__*/(0,n().jsx)("noscript",{children:/*#__PURE__*/ /*#__PURE__*/(0,n().jsx)("div",{children:/*#__PURE__*/ /*#__PURE__*/(0,n().jsx)("button",{type:"submit",id:S("edit-submit"),name:"op",value:"Go",className:"button js-form-submit form-submit btn",children:"Go"})})})]})]})]})})})]})]})}_.propTypes={variant:i().oneOf(["default","decoration-only"]),className:i().string,idPrefix:i().string,skipLinkTarget:i().string,skipLinkLabel:i().string,logoUrl:i().string,logoAlt:i().string,logoTitle:i().string,logoWidth:i().oneOfType([i().string,i().number]),logoHeight:i().oneOfType([i().string,i().number]),logoLang:i().string,logoCrop:i().oneOf(["autocrop",null]),locale:i().string,homeUrl:i().string,showLogo:i().bool,showAccount:i().bool,showLanguage:i().bool,languageDisplay:i().oneOf(["dropdown","links"]),maxLanguageLinks:i().number,languages:i().arrayOf(i().shape({value:i().string.isRequired,label:i().string.isRequired,selected:i().bool}))};export{_ as PageHeader};
@@ -3,7 +3,12 @@
3
3
  * Storybook: https://mangrove.undrr.org/
4
4
  * LLMs context: https://mangrove.undrr.org/llms.txt
5
5
  * Repository: https://github.com/PreventionWeb/undrr-mangrove
6
- * Compiled on: 2026-10-17T14:23:48.871Z
6
+ * Compiled on: 2026-11-09T16:21:46.474Z
7
7
  */
8
8
  /*! For license information please see Pager.js.LICENSE.txt */
9
- import{useCallback as e,useMemo as a,useState as n}from"react";var r={2694(e,a,n){var r=n(6925);function t(){}function l(){}l.resetWarningCache=t,e.exports=function(){function e(e,a,n,t,l,o){if(o!==r){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function a(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:a,element:e,elementType:e,instanceOf:a,node:e,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:l,resetWarningCache:t};return n.PropTypes=n,n}},5556(e,a,n){e.exports=n(2694)()},6925(e){e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}};const t={};function l(e){const a=t[e];if(void 0!==a)return a.exports;const n=t[e]={exports:{}};return r[e](n,n.exports,l),n.exports}l.n=e=>{const a=e&&e.__esModule?()=>e.default:()=>e;return l.d(a,{a}),a},l.cw=e=>{var a;return()=>{if(e){var n=e;e=0,a={exports:{}},n.call(a.exports,a,a.exports)}return a.exports}},l.d=(e,a)=>{for(var n in a)l.o(a,n)&&!l.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:a[n]})},l.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a);var o=l.cw(function(e,a){var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function t(e,a,r){var t=null;if(void 0!==r&&(t=""+r),void 0!==a.key&&(t=""+a.key),"key"in a)for(var l in r={},a)"key"!==l&&(r[l]=a[l]);else r=a;return a=r.ref,{$$typeof:n,type:e,key:t,ref:void 0!==a?a:null,props:r}}a.Fragment=r,a.jsx=t,a.jsxs=t}),i=l.cw(function(e,a){e.exports=o()}),s=l(5556),g=l.n(s);function p({page:n,totalPages:r,onPageChange:t,isLoading:l=!1,prevLabel:i="Previous",nextLabel:s="Next",goPrevLabel:g="Go to previous page",goNextLabel:p="Go to next page",pageLabel:u="Page {page}",currentPageLabel:c="Page {page}, current page"}){const m=a(()=>function(e,a){if(null==a)return[{type:"page",number:e}];if(a<=1)return[];const n=[],r=Math.floor(2.5);let t=Math.max(1,e-r);const l=Math.min(a,t+5-1);l-t<4&&(t=Math.max(1,l-5+1)),t>1&&(n.push({type:"page",number:1}),t>2&&n.push({type:"ellipsis",key:"start"}));for(let e=t;e<=l;e++)(1!==e&&e!==a||1===e&&1===t||e===a&&l===a)&&n.push({type:"page",number:e});return l<a&&(l<a-1&&n.push({type:"ellipsis",key:"end"}),n.push({type:"page",number:a})),n}(n,r),[n,r]),b=e(e=>{e<1||null!=r&&e>r||e!==n&&t(e)},[t,n,r]),d=e((e,a)=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),b(a))},[b]);if(null!=r&&r<=1)return null;const L=n>1,x=null==r||n<r;return(0,o().jsxs)("ul",{className:"mg-pager__list",children:[(0,o().jsx)("li",{className:"mg-pager__item mg-pager__item--prev",children:(0,o().jsxs)("button",{type:"button",className:"mg-pager__link mg-pager__link--prev "+(L?"":"mg-pager__link--disabled"),onClick:()=>b(n-1),onKeyDown:e=>d(e,n-1),disabled:!L||l,"aria-label":g,"aria-disabled":!L,children:[(0,o().jsx)("svg",{className:"mg-pager__icon",xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,o().jsx)("polyline",{points:"15 18 9 12 15 6"})}),(0,o().jsx)("span",{className:"mg-pager__text",children:i})]})}),m.map(e=>{if("ellipsis"===e.type)return(0,o().jsx)("li",{className:"mg-pager__item mg-pager__item--ellipsis","aria-hidden":"true",children:(0,o().jsx)("span",{className:"mg-pager__ellipsis",children:"…"})},e.key);const a=e.number===n;return(0,o().jsx)("li",{className:"mg-pager__item",children:(0,o().jsx)("button",{type:"button",className:"mg-pager__link mg-pager__link--number "+(a?"mg-pager__link--current":""),onClick:()=>b(e.number),onKeyDown:a=>d(a,e.number),disabled:l,"aria-label":String(a?c:u).replace(/\{page\}/g,e.number),"aria-current":a?"page":void 0,children:e.number})},e.number)}),(0,o().jsx)("li",{className:"mg-pager__item mg-pager__item--next",children:(0,o().jsxs)("button",{type:"button",className:"mg-pager__link mg-pager__link--next "+(x?"":"mg-pager__link--disabled"),onClick:()=>b(n+1),onKeyDown:e=>d(e,n+1),disabled:!x||l,"aria-label":p,"aria-disabled":!x,children:[(0,o().jsx)("span",{className:"mg-pager__text",children:s}),(0,o().jsx)("svg",{className:"mg-pager__icon",xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,o().jsx)("polyline",{points:"9 18 15 12 9 6"})})]})})]})}function u({range:e,rangeLabel:a="Showing {start}–{end}"}){if(!e)return null;const n=a.replace("{start}",e.start).replace("{end}",e.end);return(0,o().jsx)("p",{className:"mg-pager__range","aria-live":"polite",children:n})}function c({jumpToLabel:a="Go to page",jumpToAction:r="Go",onPageChange:t,totalPages:l,isLoading:i=!1}){const[s,g]=n(""),p=e(e=>{e.preventDefault();const a=parseInt(s,10);if(Number.isNaN(a)||a<1)return;let n=a;null!=l&&(n=Math.min(n,l)),n=Math.max(1,n),t(n),g("")},[s,t,l]),u="mg-pager-jump-input";return(0,o().jsxs)("form",{className:"mg-pager__jump",onSubmit:p,children:[(0,o().jsx)("label",{className:"mg-pager__jump-label",htmlFor:u,children:a}),(0,o().jsx)("input",{id:u,className:"mg-pager__jump-input",type:"number",min:1,max:null!=l?l:void 0,value:s,onChange:e=>g(e.target.value),disabled:i,"aria-label":a}),(0,o().jsx)("button",{type:"submit",className:"mg-pager__jump-btn",disabled:i||!s,children:r})]})}function m({page:e,totalPages:a=null,onPageChange:n,isLoading:r=!1,layout:t="centered",ariaLabel:l="Pagination",range:i,rangeLabel:s,showJumpTo:g=!1,jumpToLabel:m,jumpToAction:b,emptyState:d,emptyAction:L,prevLabel:x="Previous",nextLabel:h="Next",goPrevLabel:f="Go to previous page",goNextLabel:y="Go to next page",pageLabel:_="Page {page}",currentPageLabel:v="Page {page}, current page",pageOfLabel:j="Page {page} of {total}"}){return d?(0,o().jsx)("nav",{className:"mg-pager","aria-label":l,children:(0,o().jsxs)("p",{className:"mg-pager__notice",children:[d,L&&(0,o().jsxs)(o().Fragment,{children:[" ",(0,o().jsx)("button",{type:"button",className:"mg-pager__notice-action",onClick:L.onClick,children:L.label})]})]})}):"bar"===t?(0,o().jsxs)("nav",{className:"mg-pager","aria-label":l,children:[(0,o().jsxs)("div",{className:"mg-pager__bar",children:[i&&(0,o().jsx)(u,{range:i,rangeLabel:s}),(0,o().jsx)(p,{page:e,totalPages:a,onPageChange:n,isLoading:r,prevLabel:x,nextLabel:h,goPrevLabel:f,goNextLabel:y,pageLabel:_,currentPageLabel:v}),g&&(0,o().jsx)(c,{jumpToLabel:m,jumpToAction:b,onPageChange:n,totalPages:a,isLoading:r})]}),(0,o().jsx)("div",{className:"mg-u-sr-only","aria-live":"polite",children:"function"==typeof j?j({page:e,total:a??""}):String(j).replace(/\{page\}/g,e).replace(/\{total\}/g,a??"")})]}):(0,o().jsxs)("nav",{className:"mg-pager","aria-label":l,children:[(0,o().jsx)(p,{page:e,totalPages:a,onPageChange:n,isLoading:r,prevLabel:x,nextLabel:h,goPrevLabel:f,goNextLabel:y,pageLabel:_,currentPageLabel:v}),(0,o().jsx)("div",{className:"mg-u-sr-only","aria-live":"polite",children:String(j).replace(/\{page\}/g,e).replace(/\{total\}/g,a??"")})]})}i(),p.propTypes={page:g().number.isRequired,totalPages:g().number,onPageChange:g().func.isRequired,isLoading:g().bool,prevLabel:g().string,nextLabel:g().string,goPrevLabel:g().string,goNextLabel:g().string,pageLabel:g().string,currentPageLabel:g().string},u.propTypes={range:g().shape({start:g().number.isRequired,end:g().number.isRequired}),rangeLabel:g().string},c.propTypes={jumpToLabel:g().string,jumpToAction:g().string,onPageChange:g().func.isRequired,totalPages:g().number,isLoading:g().bool},m.propTypes={page:g().number.isRequired,totalPages:g().number,onPageChange:g().func.isRequired,isLoading:g().bool,layout:g().oneOf(["centered","bar"]),ariaLabel:g().string,range:g().shape({start:g().number.isRequired,end:g().number.isRequired}),rangeLabel:g().string,showJumpTo:g().bool,jumpToLabel:g().string,jumpToAction:g().string,emptyState:g().string,emptyAction:g().shape({label:g().string.isRequired,onClick:g().func.isRequired}),prevLabel:g().oneOfType([g().string,g().func]),nextLabel:g().oneOfType([g().string,g().func]),goPrevLabel:g().oneOfType([g().string,g().func]),goNextLabel:g().oneOfType([g().string,g().func]),pageLabel:g().oneOfType([g().string,g().func]),currentPageLabel:g().oneOfType([g().string,g().func]),pageOfLabel:g().oneOfType([g().string,g().func])};const b=m;function d(e){const{dataset:a}=e;return{page:a.page?parseInt(a.page,10):1,totalPages:a.totalPages?parseInt(a.totalPages,10):null,layout:a.layout||"centered",showJumpTo:"true"===a.showJumpTo,ariaLabel:a.ariaLabel||"Pagination",rangeLabel:a.rangeLabel||void 0,jumpToLabel:a.jumpToLabel||void 0,jumpToAction:a.jumpToAction||void 0,prevLabel:a.prevLabel||void 0,nextLabel:a.nextLabel||void 0,goPrevLabel:a.goPrevLabel||void 0,goNextLabel:a.goNextLabel||void 0,pageLabel:a.pageLabel||void 0,currentPageLabel:a.currentPageLabel||void 0,pageOfLabel:a.pageOfLabel||void 0}}export{m as Pager,b as default,d as fromElement};
9
+ import{useCallback as e,useMemo as a,useState as n}from"react";var r={2694(e,a,n){var r=n(6925);function t(){}function l(){}l.resetWarningCache=t,e.exports=function(){function e(e,a,n,t,l,o){if(o!==r){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function a(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:a,element:e,elementType:e,instanceOf:a,node:e,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:l,resetWarningCache:t};return n.PropTypes=n,n}},5556(e,a,n){e.exports=n(2694)()},6925(e){e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}};const t={};function l(e){const a=t[e];if(void 0!==a)return a.exports;const n=t[e]={exports:{}};return r[e](n,n.exports,l),n.exports}l.n=e=>{const a=e&&e.__esModule?()=>e.default:()=>e;return l.d(a,{a}),a},l.cw=e=>{var a;return()=>{if(e){var n=e;e=0,a={exports:{}},n.call(a.exports,a,a.exports)}return a.exports}},l.d=(e,a)=>{for(var n in a)l.o(a,n)&&!l.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:a[n]})},l.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a);var o=/*#__PURE__*/l.cw((e,a)=>{var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function t(e,a,r){var t=null;if(void 0!==r&&(t=""+r),void 0!==a.key&&(t=""+a.key),"key"in a)for(var l in r={},a)"key"!==l&&(r[l]=a[l]);else r=a;return a=r.ref,{$$typeof:n,type:e,key:t,ref:void 0!==a?a:null,props:r}}a.Fragment=r,a.jsx=t,a.jsxs=t}),i=/*#__PURE__*/l.cw(e=>{e.exports=o()}),s=/*#__PURE__*/l(5556),g=/*#__PURE__*/l.n(s);function p({page:n,totalPages:r,onPageChange:t,isLoading:l=!1,prevLabel:i="Previous",nextLabel:s="Next",goPrevLabel:g="Go to previous page",goNextLabel:p="Go to next page",pageLabel:u="Page {page}",currentPageLabel:c="Page {page}, current page"}){const m=a(()=>function(e,a){if(null==a)return[{type:"page",number:e}];if(a<=1)return[];const n=[],r=Math.floor(2.5);let t=Math.max(1,e-r);const l=Math.min(a,t+5-1);l-t<4&&(t=Math.max(1,l-5+1)),t>1&&(n.push({type:"page",number:1}),t>2&&n.push({type:"ellipsis",key:"start"}));for(let e=t;e<=l;e++)(1!==e&&e!==a||1===e&&1===t||e===a&&l===a)&&n.push({type:"page",number:e});return l<a&&(l<a-1&&n.push({type:"ellipsis",key:"end"}),n.push({type:"page",number:a})),n}(n,r),[n,r]),b=e(e=>{e<1||null!=r&&e>r||e!==n&&t(e)},[t,n,r]),d=e((e,a)=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),b(a))},[b]);if(null!=r&&r<=1)return null;const L=n>1,x=null==r||n<r;/*#__PURE__*/ /*#__PURE__*/
10
+ return(0,o().jsxs)("ul",{className:"mg-pager__list",children:[/*#__PURE__*/ /*#__PURE__*/(0,o().jsx)("li",{className:"mg-pager__item mg-pager__item--prev",children:/*#__PURE__*/ /*#__PURE__*/(0,o().jsxs)("button",{type:"button",className:"mg-pager__link mg-pager__link--prev "+(L?"":"mg-pager__link--disabled"),onClick:()=>b(n-1),onKeyDown:e=>d(e,n-1),disabled:!L||l,"aria-label":g,"aria-disabled":!L,children:[/*#__PURE__*/ /*#__PURE__*/(0,o().jsx)("svg",{className:"mg-pager__icon",xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:/*#__PURE__*/ /*#__PURE__*/(0,o().jsx)("polyline",{points:"15 18 9 12 15 6"})}),/*#__PURE__*/ /*#__PURE__*/(0,o().jsx)("span",{className:"mg-pager__text",children:i})]})}),m.map(e=>{if("ellipsis"===e.type)/*#__PURE__*/ /*#__PURE__*/
11
+ return(0,o().jsx)("li",{className:"mg-pager__item mg-pager__item--ellipsis","aria-hidden":"true",children:/*#__PURE__*/ /*#__PURE__*/(0,o().jsx)("span",{className:"mg-pager__ellipsis",children:"…"})},e.key);const a=e.number===n;/*#__PURE__*/ /*#__PURE__*/
12
+ return(0,o().jsx)("li",{className:"mg-pager__item",children:/*#__PURE__*/ /*#__PURE__*/(0,o().jsx)("button",{type:"button",className:"mg-pager__link mg-pager__link--number "+(a?"mg-pager__link--current":""),onClick:()=>b(e.number),onKeyDown:a=>d(a,e.number),disabled:l,"aria-label":String(a?c:u).replace(/\{page\}/g,e.number),"aria-current":a?"page":void 0,children:e.number})},e.number)}),/*#__PURE__*/ /*#__PURE__*/(0,o().jsx)("li",{className:"mg-pager__item mg-pager__item--next",children:/*#__PURE__*/ /*#__PURE__*/(0,o().jsxs)("button",{type:"button",className:"mg-pager__link mg-pager__link--next "+(x?"":"mg-pager__link--disabled"),onClick:()=>b(n+1),onKeyDown:e=>d(e,n+1),disabled:!x||l,"aria-label":p,"aria-disabled":!x,children:[/*#__PURE__*/ /*#__PURE__*/(0,o().jsx)("span",{className:"mg-pager__text",children:s}),/*#__PURE__*/ /*#__PURE__*/(0,o().jsx)("svg",{className:"mg-pager__icon",xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:/*#__PURE__*/ /*#__PURE__*/(0,o().jsx)("polyline",{points:"9 18 15 12 9 6"})})]})})]})}function u({range:e,rangeLabel:a="Showing {start}–{end}"}){if(!e)return null;const n=a.replace("{start}",e.start).replace("{end}",e.end);/*#__PURE__*/ /*#__PURE__*/
13
+ return(0,o().jsx)("p",{className:"mg-pager__range","aria-live":"polite",children:n})}function c({jumpToLabel:a="Go to page",jumpToAction:r="Go",onPageChange:t,totalPages:l,isLoading:i=!1}){const[s,g]=n(""),p=e(e=>{e.preventDefault();const a=parseInt(s,10);if(Number.isNaN(a)||a<1)return;let n=a;null!=l&&(n=Math.min(n,l)),n=Math.max(1,n),t(n),g("")},[s,t,l]),u="mg-pager-jump-input";/*#__PURE__*/ /*#__PURE__*/
14
+ return(0,o().jsxs)("form",{className:"mg-pager__jump",onSubmit:p,children:[/*#__PURE__*/ /*#__PURE__*/(0,o().jsx)("label",{className:"mg-pager__jump-label",htmlFor:u,children:a}),/*#__PURE__*/ /*#__PURE__*/(0,o().jsx)("input",{id:u,className:"mg-pager__jump-input",type:"number",min:1,max:null!=l?l:void 0,value:s,onChange:e=>g(e.target.value),disabled:i,"aria-label":a}),/*#__PURE__*/ /*#__PURE__*/(0,o().jsx)("button",{type:"submit",className:"mg-pager__jump-btn",disabled:i||!s,children:r})]})}function m({page:e,totalPages:a=null,onPageChange:n,isLoading:r=!1,layout:t="centered",ariaLabel:l="Pagination",range:i,rangeLabel:s,showJumpTo:g=!1,jumpToLabel:m,jumpToAction:b,emptyState:d,emptyAction:L,prevLabel:x="Previous",nextLabel:h="Next",goPrevLabel:f="Go to previous page",goNextLabel:y="Go to next page",pageLabel:_="Page {page}",currentPageLabel:v="Page {page}, current page",pageOfLabel:j="Page {page} of {total}"}){return d?/*#__PURE__*/ /*#__PURE__*/(0,o().jsx)("nav",{className:"mg-pager","aria-label":l,children:/*#__PURE__*/ /*#__PURE__*/(0,o().jsxs)("p",{className:"mg-pager__notice",children:[d,L&&/*#__PURE__*/ /*#__PURE__*/(0,o().jsxs)(o().Fragment,{children:[" ",/*#__PURE__*/ /*#__PURE__*/(0,o().jsx)("button",{type:"button",className:"mg-pager__notice-action",onClick:L.onClick,children:L.label})]})]})}):"bar"===t?/*#__PURE__*/ /*#__PURE__*/(0,o().jsxs)("nav",{className:"mg-pager","aria-label":l,children:[/*#__PURE__*/ /*#__PURE__*/(0,o().jsxs)("div",{className:"mg-pager__bar",children:[i&&/*#__PURE__*/ /*#__PURE__*/(0,o().jsx)(u,{range:i,rangeLabel:s}),/*#__PURE__*/ /*#__PURE__*/(0,o().jsx)(p,{page:e,totalPages:a,onPageChange:n,isLoading:r,prevLabel:x,nextLabel:h,goPrevLabel:f,goNextLabel:y,pageLabel:_,currentPageLabel:v}),g&&/*#__PURE__*/ /*#__PURE__*/(0,o().jsx)(c,{jumpToLabel:m,jumpToAction:b,onPageChange:n,totalPages:a,isLoading:r})]}),/*#__PURE__*/ /*#__PURE__*/(0,o().jsx)("div",{className:"mg-u-sr-only","aria-live":"polite",children:"function"==typeof j?j({page:e,total:a??""}):String(j).replace(/\{page\}/g,e).replace(/\{total\}/g,a??"")})]}):/*#__PURE__*/ /*#__PURE__*/(0,o().jsxs)("nav",{className:"mg-pager","aria-label":l,children:[/*#__PURE__*/ /*#__PURE__*/(0,o().jsx)(p,{page:e,totalPages:a,onPageChange:n,isLoading:r,prevLabel:x,nextLabel:h,goPrevLabel:f,goNextLabel:y,pageLabel:_,currentPageLabel:v}),/*#__PURE__*/ /*#__PURE__*/(0,o().jsx)("div",{className:"mg-u-sr-only","aria-live":"polite",children:String(j).replace(/\{page\}/g,e).replace(/\{total\}/g,a??"")})]})}i(),p.propTypes={page:g().number.isRequired,totalPages:g().number,onPageChange:g().func.isRequired,isLoading:g().bool,prevLabel:g().string,nextLabel:g().string,goPrevLabel:g().string,goNextLabel:g().string,pageLabel:g().string,currentPageLabel:g().string},u.propTypes={range:g().shape({start:g().number.isRequired,end:g().number.isRequired}),rangeLabel:g().string},c.propTypes={jumpToLabel:g().string,jumpToAction:g().string,onPageChange:g().func.isRequired,totalPages:g().number,isLoading:g().bool},m.propTypes={page:g().number.isRequired,totalPages:g().number,onPageChange:g().func.isRequired,isLoading:g().bool,layout:g().oneOf(["centered","bar"]),ariaLabel:g().string,range:g().shape({start:g().number.isRequired,end:g().number.isRequired}),rangeLabel:g().string,showJumpTo:g().bool,jumpToLabel:g().string,jumpToAction:g().string,emptyState:g().string,emptyAction:g().shape({label:g().string.isRequired,onClick:g().func.isRequired}),prevLabel:g().oneOfType([g().string,g().func]),nextLabel:g().oneOfType([g().string,g().func]),goPrevLabel:g().oneOfType([g().string,g().func]),goNextLabel:g().oneOfType([g().string,g().func]),pageLabel:g().oneOfType([g().string,g().func]),currentPageLabel:g().oneOfType([g().string,g().func]),pageOfLabel:g().oneOfType([g().string,g().func])};const b=m;function d(e){const{dataset:a}=e;return{page:a.page?parseInt(a.page,10):1,totalPages:a.totalPages?parseInt(a.totalPages,10):null,layout:a.layout||"centered",showJumpTo:"true"===a.showJumpTo,ariaLabel:a.ariaLabel||"Pagination",rangeLabel:a.rangeLabel||void 0,jumpToLabel:a.jumpToLabel||void 0,jumpToAction:a.jumpToAction||void 0,prevLabel:a.prevLabel||void 0,nextLabel:a.nextLabel||void 0,goPrevLabel:a.goPrevLabel||void 0,goNextLabel:a.goNextLabel||void 0,pageLabel:a.pageLabel||void 0,currentPageLabel:a.currentPageLabel||void 0,pageOfLabel:a.pageOfLabel||void 0}}export{m as Pager,b as default,d as fromElement};
@@ -3,7 +3,8 @@
3
3
  * Storybook: https://mangrove.undrr.org/
4
4
  * LLMs context: https://mangrove.undrr.org/llms.txt
5
5
  * Repository: https://github.com/PreventionWeb/undrr-mangrove
6
- * Compiled on: 2026-10-17T14:23:48.871Z
6
+ * Compiled on: 2026-11-09T16:21:46.474Z
7
7
  */
8
8
  /*! For license information please see ProgressBar.js.LICENSE.txt */
9
- import*as e from"react";var r={2694(e,r,a){var l=a(6925);function o(){}function n(){}n.resetWarningCache=o,e.exports=function(){function e(e,r,a,o,n,s){if(s!==l){var t=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw t.name="Invariant Violation",t}}function r(){return e}e.isRequired=e;var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:r,element:e,elementType:e,instanceOf:r,node:e,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:n,resetWarningCache:o};return a.PropTypes=a,a}},5556(e,r,a){e.exports=a(2694)()},6925(e){e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},9698(e,r){var a=Symbol.for("react.transitional.element");function l(e,r,l){var o=null;if(void 0!==l&&(o=""+l),void 0!==r.key&&(o=""+r.key),"key"in r)for(var n in l={},r)"key"!==n&&(l[n]=r[n]);else l=r;return r=l.ref,{$$typeof:a,type:e,key:o,ref:void 0!==r?r:null,props:l}}Symbol.for("react.fragment"),r.jsx=l,r.jsxs=l},4848(e,r,a){e.exports=a(9698)},1649(r,a,l){r.exports=(e=>{const r={};return l.d(r,e),r})({useId:()=>e.useId})}};const a={};function l(e){const o=a[e];if(void 0!==o)return o.exports;const n=a[e]={exports:{}};return r[e](n,n.exports,l),n.exports}l.n=e=>{const r=e&&e.__esModule?()=>e.default:()=>e;return l.d(r,{a:r}),r},l.d=(e,r)=>{if(Array.isArray(r))for(var a=0;a<r.length;){var o=r[a++],n=r[a++],s=0===n?{enumerable:!0,value:r[a++]}:{enumerable:!0,get:n};l.o(e,o)||Object.defineProperty(e,o,s)}else for(var o in r)l.o(r,o)&&!l.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},l.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r);let o={};l.d(o,{z:()=>p});var n=l(1649),s=l(5556),t=l.n(s),i=l(4848);function p({value:e,max:r=100,label:a,hideLabel:l=!1,helpText:o,showValue:s=!1,valueText:c,variant:u="default",className:d="",...b}){t().checkPropTypes(p.propTypes,{value:e,max:r,label:a,hideLabel:l,helpText:o,showValue:s,valueText:c,variant:u,className:d,...b},"prop","ProgressBar");const f=(0,n.useId)(),m=`${f}-label`,y=`${f}-help`,v="flush"===u,h="number"==typeof r&&r>0?r:100,x="number"==typeof e&&Number.isFinite(e),g=x?Math.min(Math.max(e,0),h):null,_=x?Math.round(g/h*100):null,T=c||`${_}%`,j=Boolean(a)&&!l&&!v,O=Boolean(o)&&!v,k={};b["aria-label"]||b["aria-labelledby"]||(j?k["aria-labelledby"]=m:a&&(k["aria-label"]=a));const N=[b["aria-describedby"],O&&y].filter(Boolean).join(" ");N&&(k["aria-describedby"]=N),x&&c&&(k["aria-valuetext"]=c);const P=["mg-progress-bar",v&&"mg-progress-bar--flush",d].filter(Boolean).join(" ");return(0,i.jsxs)("div",{className:P,children:[j&&(0,i.jsx)("div",{className:"mg-progress-bar__label",id:m,children:a}),(0,i.jsx)("div",{className:"mg-progress-bar__track",children:(0,i.jsx)("progress",{className:"mg-progress-bar__native",max:h,value:x?g:void 0,...b,...k,children:x?T:null})}),s&&x&&!v&&(0,i.jsx)("div",{className:"mg-progress-bar__value","aria-hidden":"true",children:T}),O&&(0,i.jsx)("div",{className:"mg-progress-bar__help",id:y,children:o})]})}p.propTypes={value:t().number,max:t().number,label:function(e,r,a){const l=e[r];return null!=l&&"string"!=typeof l?new Error(`Invalid prop \`${r}\` supplied to \`${a}\`: expected a string.`):l||e["aria-label"]||e["aria-labelledby"]?null:new Error(`\`${a}\` needs an accessible name: pass \`label\`, \`aria-label\` or \`aria-labelledby\`.`)},hideLabel:t().bool,helpText:t().string,showValue:t().bool,valueText:t().string,variant:t().oneOf(["default","flush"]),className:t().string};const c=p;l.d(o,["A",0,c]);const u=o.A;export{p as ProgressBar,u as default};
9
+ import*as e from"react";var r={2694(e,r,a){var l=a(6925);function o(){}function n(){}n.resetWarningCache=o,e.exports=function(){function e(e,r,a,o,n,s){if(s!==l){var t=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw t.name="Invariant Violation",t}}function r(){return e}e.isRequired=e;var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:r,element:e,elementType:e,instanceOf:r,node:e,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:n,resetWarningCache:o};return a.PropTypes=a,a}},5556(e,r,a){e.exports=a(2694)()},6925(e){e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},9698(e,r){var a=Symbol.for("react.transitional.element");function l(e,r,l){var o=null;if(void 0!==l&&(o=""+l),void 0!==r.key&&(o=""+r.key),"key"in r)for(var n in l={},r)"key"!==n&&(l[n]=r[n]);else l=r;return r=l.ref,{$$typeof:a,type:e,key:o,ref:void 0!==r?r:null,props:l}}Symbol.for("react.fragment"),r.jsx=l,r.jsxs=l},4848(e,r,a){e.exports=a(9698)},1649(r,a,l){r.exports=(e=>{const r={};return l.d(r,e),r})({useId:()=>e.useId})}};const a={};function l(e){const o=a[e];if(void 0!==o)return o.exports;const n=a[e]={exports:{}};return r[e](n,n.exports,l),n.exports}l.n=e=>{const r=e&&e.__esModule?()=>e.default:()=>e;return l.d(r,{a:r}),r},l.d=(e,r)=>{if(Array.isArray(r))for(var a=0;a<r.length;){var o=r[a++],n=r[a++],s=0===n?{enumerable:!0,value:r[a++]}:{enumerable:!0,get:n};l.o(e,o)||Object.defineProperty(e,o,s)}else for(var o in r)l.o(r,o)&&!l.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},l.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r);var o=l(1649),n=/*#__PURE__*/l(5556),s=/*#__PURE__*/l.n(n),t=l(4848);function i({value:e,max:r=100,label:a,hideLabel:l=!1,helpText:n,showValue:p=!1,valueText:c,variant:u="default",className:b="",...d}){s().checkPropTypes(i.propTypes,{value:e,max:r,label:a,hideLabel:l,helpText:n,showValue:p,valueText:c,variant:u,className:b,...d},"prop","ProgressBar");const f=(0,o.useId)(),m=`${f}-label`,y=`${f}-help`,v="flush"===u,h="number"==typeof r&&r>0?r:100,x="number"==typeof e&&Number.isFinite(e),g=x?Math.min(Math.max(e,0),h):null,_=x?Math.round(g/h*100):null,T=c||`${_}%`,j=Boolean(a)&&!l&&!v,O=Boolean(n)&&!v,k={};d["aria-label"]||d["aria-labelledby"]||(j?k["aria-labelledby"]=m:a&&(k["aria-label"]=a));const N=[d["aria-describedby"],O&&y].filter(Boolean).join(" ");N&&(k["aria-describedby"]=N),x&&c&&(k["aria-valuetext"]=c);const P=["mg-progress-bar",v&&"mg-progress-bar--flush",b].filter(Boolean).join(" ");/*#__PURE__*/ /*#__PURE__*/
10
+ return(0,t.jsxs)("div",{className:P,children:[j&&/*#__PURE__*/ /*#__PURE__*/(0,t.jsx)("div",{className:"mg-progress-bar__label",id:m,children:a}),/*#__PURE__*/ /*#__PURE__*/(0,t.jsx)("div",{className:"mg-progress-bar__track",children:/*#__PURE__*/ /*#__PURE__*/(0,t.jsx)("progress",{className:"mg-progress-bar__native",max:h,value:x?g:void 0,...d,...k,children:x?T:null})}),p&&x&&!v&&/*#__PURE__*/ /*#__PURE__*/(0,t.jsx)("div",{className:"mg-progress-bar__value","aria-hidden":"true",children:T}),O&&/*#__PURE__*/ /*#__PURE__*/(0,t.jsx)("div",{className:"mg-progress-bar__help",id:y,children:n})]})}i.propTypes={value:s().number,max:s().number,label:function(e,r,a){const l=e[r];return null!=l&&"string"!=typeof l?new Error(`Invalid prop \`${r}\` supplied to \`${a}\`: expected a string.`):l||e["aria-label"]||e["aria-labelledby"]?null:new Error(`\`${a}\` needs an accessible name: pass \`label\`, \`aria-label\` or \`aria-labelledby\`.`)},hideLabel:s().bool,helpText:s().string,showValue:s().bool,valueText:s().string,variant:s().oneOf(["default","flush"]),className:s().string};const p=i;export{i as ProgressBar,p as default};