@undrr/undrr-mangrove 2.3.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.
- package/README.md +1 -1
- package/components/BookCard.js +5 -2
- package/components/Breadcrumbs.js +2 -2
- package/components/Checkbox.js +3 -2
- package/components/Chips.js +2 -2
- package/components/ContentCard.js +8 -2
- package/components/ContentTeaser.js +8 -2
- package/components/CopyButton.js +3 -2
- package/components/CtaButton.js +3 -2
- package/components/Drawer.js +2 -2
- package/components/DrupalContentPatterns.js +1 -1
- package/components/EmbedContainer.js +3 -2
- package/components/Footer.js +2 -2
- package/components/FormAction.js +3 -2
- package/components/FormErrorSummary.js +2 -2
- package/components/FormGroup.js +3 -2
- package/components/FullWidth.js +3 -2
- package/components/Gallery.js +3 -2
- package/components/Hero.js +6 -2
- package/components/HighlightBox.js +3 -2
- package/components/HorizontalBookCard.js +6 -2
- package/components/HorizontalCard.js +6 -2
- package/components/IconCard.js +4 -2
- package/components/Legend.js +3 -2
- package/components/Loader.js +2 -2
- package/components/MegaMenu.js +7 -2
- package/components/Notice.js +3 -2
- package/components/PageHeader.js +4 -2
- package/components/Pager.js +7 -2
- package/components/ProgressBar.js +3 -2
- package/components/QuoteHighlight.js +3 -2
- package/components/Radio.js +3 -2
- package/components/Range.js +3 -2
- package/components/ScrollContainer.js +2 -2
- package/components/SegmentedControl.js +6 -2
- package/components/Select.js +3 -2
- package/components/ServiceNotice.js +4 -2
- package/components/ShareButtons.js +4 -2
- package/components/ShowMore.js +3 -2
- package/components/SkipLink.js +3 -2
- package/components/StatsCard.js +5 -2
- package/components/SyndicationSearchWidget.js +31 -2
- package/components/Tab.js +7 -2
- package/components/TextCta.js +4 -2
- package/components/TextInput.js +3 -2
- package/components/Textarea.js +3 -2
- package/components/Tree.js +7 -2
- package/components/UserFeedback.js +2 -2
- package/components/VerticalCard.js +6 -2
- package/components/hydrate.js +2 -2
- package/css/style-all.css +14 -8
- package/css/style-all.css.map +1 -1
- package/css/style-delta.css +14 -8
- package/css/style-delta.css.map +1 -1
- package/css/style-gutenberg.css +1 -1
- package/css/style-irp.css +14 -8
- package/css/style-irp.css.map +1 -1
- package/css/style-mcr.css +14 -8
- package/css/style-mcr.css.map +1 -1
- package/css/style-preventionweb.css +14 -8
- package/css/style-preventionweb.css.map +1 -1
- package/css/style.css +14 -8
- package/css/style.css.map +1 -1
- package/docs/EDITORIAL-MANUAL.md +2 -2
- package/docs/llms-editorial-manual.txt +1 -1
- package/docs/llms-page-building.txt +4 -2
- package/docs/llms-search-widget.txt +3 -1
- package/error-pages/401.html +1 -1
- package/error-pages/403.html +1 -1
- package/error-pages/404.html +1 -1
- package/error-pages/429.html +1 -1
- package/error-pages/500.html +1 -1
- package/error-pages/502.html +1 -1
- package/error-pages/503.html +1 -1
- package/error-pages/504.html +1 -1
- package/error-pages/5xx.html +1 -1
- package/error-pages/challenge.html +1 -1
- package/error-pages/managed-challenge.html +1 -1
- package/js/dialog.js +205 -0
- package/package.json +1 -1
- package/scss/Atom/BaseTypography/Code/code.scss +0 -1
- package/scss/Atom/Table/table.scss +0 -1
- package/scss/Atom/Tag/tag.scss +0 -1
- package/scss/Components/Buttons/ShareButtons/share-buttons.scss +18 -0
- package/scss/Components/Cards/StatsCard/stats-card.scss +0 -1
- package/scss/Components/Dialog/dialog.scss +87 -0
- package/scss/Components/MegaMenu/mega-menu.scss +403 -0
- package/scss/Components/SyndicationSearchWidget/syndication-search-widget.scss +70 -2
- package/scss/Patterns/Content/Publication/publication-record.scss +110 -0
- package/scss/Patterns/LandingPages/publication-example.scss +28 -0
- package/scss/assets/scss/_components.scss +1 -0
- package/scss/assets/scss/_variables.scss +1 -1
|
@@ -3,6 +3,6 @@
|
|
|
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-
|
|
6
|
+
* Compiled on: 2026-11-09T16:21:46.474Z
|
|
7
7
|
*/
|
|
8
8
|
const e={news:{type:"article",profile:"news"},publication:{type:"publication",profile:"default"},resource:{type:"resource",profile:"default"},event:{type:"event",profile:"general"},blog:{type:"article",profile:"commentary"},organization:{type:"organization",profile:"general"},collections:{type:"collection",profile:"default"},vacancy:{type:"opportunity",profile:"job"},hazard_information_profile:{type:"reference-entry",profile:"hazard-profile"},conference_event:{type:"event",profile:"programme-session"},commitment:{type:"commitment",profile:"default"},landing_page_gutenberg:{type:"landing-page",profile:"default"},national_platform:{type:"organization",profile:"coordination-platform"},terminology:{type:"reference-entry",profile:"definition"},people:{type:"person",profile:"default"}};export{e as DRUPAL_CONTENT_PATTERNS};
|
|
@@ -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-
|
|
6
|
+
* Compiled on: 2026-11-09T16:21:46.474Z
|
|
7
7
|
*/
|
|
8
8
|
/*! For license information please see EmbedContainer.js.LICENSE.txt */
|
|
9
|
-
import"react";var e={2694(e,r,t){var
|
|
9
|
+
import"react";var e={2694(e,r,t){var o=t(6925);function n(){}function a(){}a.resetWarningCache=n,e.exports=function(){function e(e,r,t,n,a,s){if(s!==o){var c=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 c.name="Invariant Violation",c}}function r(){return e}e.isRequired=e;var t={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:a,resetWarningCache:n};return t.PropTypes=t,t}},5556(e,r,t){e.exports=t(2694)()},6925(e){e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}};const r={};function t(o){const n=r[o];if(void 0!==n)return n.exports;const a=r[o]={exports:{}};return e[o](a,a.exports,t),a.exports}t.n=e=>{const r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.cw=e=>{var r;return()=>{if(e){var t=e;e=0,r={exports:{}},t.call(r.exports,r,r.exports)}return r.exports}},t.d=(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r);var o=/*#__PURE__*/t.cw((e,r)=>{var t=Symbol.for("react.transitional.element");Symbol.for("react.fragment"),r.jsx=function(e,r,o){var n=null;if(void 0!==o&&(n=""+o),void 0!==r.key&&(n=""+r.key),"key"in r)for(var a in o={},r)"key"!==a&&(o[a]=r[a]);else o=r;return r=o.ref,{$$typeof:t,type:e,key:n,ref:void 0!==r?r:null,props:o}}}),n=/*#__PURE__*/t.cw(e=>{e.exports=o()}),a=/*#__PURE__*/t(5556),s=/*#__PURE__*/t.n(a);function c({children:e,aspectRatio:r="16x9",className:t="",as:n="div"}){const a=["mg-embed-container","16x9"!==r&&`mg-embed-container--${r}`,t].filter(Boolean).join(" ");/*#__PURE__*/ /*#__PURE__*/
|
|
10
|
+
return(0,o().jsx)(n,{className:a,children:e})}n(),c.propTypes={children:s().node,aspectRatio:s().oneOf(["16x9","4x3","1x1","21x9"]),className:s().string,as:s().string};const i=c;export{c as EmbedContainer,i as default};
|
package/components/Footer.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
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-
|
|
6
|
+
* Compiled on: 2026-11-09T16:21:46.474Z
|
|
7
7
|
*/
|
|
8
8
|
/*! For license information please see Footer.js.LICENSE.txt */
|
|
9
|
-
import{useEffect as e,useMemo as n,useRef as t}from"react";var r={2694(e,n,t){var r=t(6925);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,n,t,o,i,a){if(a!==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 n(){return e}e.isRequired=e;var t={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:n,element:e,elementType:e,instanceOf:n,node:e,objectOf:n,oneOf:n,oneOfType:n,shape:n,exact:n,checkPropTypes:i,resetWarningCache:o};return t.PropTypes=t,t}},5556(e,n,t){e.exports=t(2694)()},6925(e){e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}};const o={};function i(e){const n=o[e];if(void 0!==n)return n.exports;const t=o[e]={exports:{}};return r[e](t,t.exports,i),t.exports}i.n=e=>{const n=e&&e.__esModule?()=>e.default:()=>e;return i.d(n,{a:n}),n},i.cw=e=>{var n;return()=>{if(e){var t=e;e=0,n={exports:{}},t.call(n.exports,n,n.exports)}return n.exports}},i.d=(e,n)=>{for(var t in n)i.o(n,t)&&!i.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},i.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n);var a
|
|
9
|
+
import{useEffect as e,useMemo as n,useRef as t}from"react";var r={2694(e,n,t){var r=t(6925);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,n,t,o,i,a){if(a!==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 n(){return e}e.isRequired=e;var t={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:n,element:e,elementType:e,instanceOf:n,node:e,objectOf:n,oneOf:n,oneOfType:n,shape:n,exact:n,checkPropTypes:i,resetWarningCache:o};return t.PropTypes=t,t}},5556(e,n,t){e.exports=t(2694)()},6925(e){e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}};const o={};function i(e){const n=o[e];if(void 0!==n)return n.exports;const t=o[e]={exports:{}};return r[e](t,t.exports,i),t.exports}i.n=e=>{const n=e&&e.__esModule?()=>e.default:()=>e;return i.d(n,{a:n}),n},i.cw=e=>{var n;return()=>{if(e){var t=e;e=0,n={exports:{}},t.call(n.exports,n,n.exports)}return n.exports}},i.d=(e,n)=>{for(var t in n)i.o(n,t)&&!i.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},i.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n);var a=/*#__PURE__*/i.cw((e,n)=>{var t=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function o(e,n,r){var o=null;if(void 0!==r&&(o=""+r),void 0!==n.key&&(o=""+n.key),"key"in n)for(var i in r={},n)"key"!==i&&(r[i]=n[i]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:o,ref:void 0!==n?n:null,props:r}}n.Fragment=r,n.jsx=o,n.jsxs=o}),s=/*#__PURE__*/i.cw(e=>{e.exports=a()}),c=/*#__PURE__*/i(5556),l=/*#__PURE__*/i.n(c);s();const p=(...e)=>e.filter(Boolean).length>0?e.filter(Boolean).join(" "):null,d={contenttype:"landingpage",pageid:"83835",includemetatags:!1,includecss:!1,suffixID:"footer",activedomain:"www.undrr.org"},u={};function f({variant:r="default",enableSyndication:o=!0,syndicationConfig:i=u,complementaryContent:s=null,children:c,className:l,...f}){const y=t(null),m=n(()=>({...d,...i}),[i]);return e(()=>{if(!o)return;const e=document.querySelector('script[src*="preventionweb.net/widget.js"]'),n=()=>{const e=document.createElement("script");e.type="text/javascript",e.innerHTML=`\n if (window.PW_Widget) {\n new PW_Widget.initialize({\n contenttype: "${m.contenttype}",\n pageid: "${m.pageid}",\n includemetatags: ${m.includemetatags},\n includecss: ${m.includecss},\n suffixID: "${m.suffixID}",\n activedomain: "${m.activedomain}"\n });\n }\n `,document.head.appendChild(e)};if(e)n();else{const e=document.createElement("script");e.type="text/javascript",e.src="https://publish.preventionweb.net/widget.js?rand=3d797b",document.head.appendChild(e),e.onload=()=>{n()},e.onerror=()=>{console.warn("Failed to load UNDRR syndication widget"),y.current&&(y.current.innerHTML="<p>Unable to load syndicated footer content.</p>")}}return()=>{y.current&&(y.current.innerHTML="")}},[o,m]),/*#__PURE__*/ /*#__PURE__*/(0,a().jsxs)("footer",{className:p("mg-footer",l),...f,children:[(s||c)&&/*#__PURE__*/ /*#__PURE__*/(0,a().jsx)(a().Fragment,{children:s||c}),o&&/*#__PURE__*/ /*#__PURE__*/(0,a().jsx)("div",{className:`pw-widget-${m.suffixID}`,ref:y,children:"Loading UNDRR footer content…"})]})}f.propTypes={variant:l().string,enableSyndication:l().bool,syndicationConfig:l().shape({contenttype:l().string,pageid:l().string,includemetatags:l().bool,includecss:l().bool,suffixID:l().string,activedomain:l().string}),complementaryContent:l().node,children:l().node,className:l().string};export{f as Footer};
|
package/components/FormAction.js
CHANGED
|
@@ -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-
|
|
6
|
+
* Compiled on: 2026-11-09T16:21:46.474Z
|
|
7
7
|
*/
|
|
8
8
|
/*! For license information please see FormAction.js.LICENSE.txt */
|
|
9
|
-
import{cloneElement as e,useId as r}from"react";var o={2694(e,r,o){var t=o(6925);function n(){}function a(){}a.resetWarningCache=n,e.exports=function(){function e(e,r,o,n,a,s){if(s!==t){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 r(){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:r,element:e,elementType:e,instanceOf:r,node:e,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:a,resetWarningCache:n};return o.PropTypes=o,o}},5556(e,r,o){e.exports=o(2694)()},6925(e){e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}};const t={};function n(e){const r=t[e];if(void 0!==r)return r.exports;const a=t[e]={exports:{}};return o[e](a,a.exports,n),a.exports}n.n=e=>{const r=e&&e.__esModule?()=>e.default:()=>e;return n.d(r,{a:r}),r},n.cw=e=>{var r;return()=>{if(e){var o=e;e=0,r={exports:{}},o.call(r.exports,r,r.exports)}return r.exports}},n.d=(e,r)=>{for(var o in r)n.o(r,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r);var a
|
|
9
|
+
import{cloneElement as e,useId as r}from"react";var o={2694(e,r,o){var t=o(6925);function n(){}function a(){}a.resetWarningCache=n,e.exports=function(){function e(e,r,o,n,a,s){if(s!==t){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 r(){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:r,element:e,elementType:e,instanceOf:r,node:e,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:a,resetWarningCache:n};return o.PropTypes=o,o}},5556(e,r,o){e.exports=o(2694)()},6925(e){e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}};const t={};function n(e){const r=t[e];if(void 0!==r)return r.exports;const a=t[e]={exports:{}};return o[e](a,a.exports,n),a.exports}n.n=e=>{const r=e&&e.__esModule?()=>e.default:()=>e;return n.d(r,{a:r}),r},n.cw=e=>{var r;return()=>{if(e){var o=e;e=0,r={exports:{}},o.call(r.exports,r,r.exports)}return r.exports}},n.d=(e,r)=>{for(var o in r)n.o(r,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r);var a=/*#__PURE__*/n.cw((e,r)=>{var o=Symbol.for("react.transitional.element");function t(e,r,t){var n=null;if(void 0!==t&&(n=""+t),void 0!==r.key&&(n=""+r.key),"key"in r)for(var a in t={},r)"key"!==a&&(t[a]=r[a]);else t=r;return r=t.ref,{$$typeof:o,type:e,key:n,ref:void 0!==r?r:null,props:t}}Symbol.for("react.fragment"),r.jsx=t,r.jsxs=t}),s=/*#__PURE__*/n.cw(e=>{e.exports=a()}),i=/*#__PURE__*/n(5556),l=/*#__PURE__*/n.n(i);s();const c=(e,r)=>[e,r].filter(Boolean).join(" ");function p({control:o,action:t,label:n,hideLabel:s=!1,helpText:i,errorText:l,stackOnMobile:p=!1,className:m}){const f=r(),d=o.props.id||f,y=i?`${d}-help`:void 0,u=l?`${d}-error`:void 0,b=[o.props["aria-describedby"],y,u].filter(Boolean).join(" ")||void 0,x=/*#__PURE__*/e(o,{key:o.key||"control",id:d,className:c(o.props.className,"mg-form-action__control"),"aria-describedby":b,"aria-invalid":l?"true":o.props["aria-invalid"]}),v=/*#__PURE__*/e(t,{key:t.key||"action",className:c(t.props.className,"mg-form-action__action")});/*#__PURE__*/ /*#__PURE__*/
|
|
10
|
+
return(0,a().jsxs)("div",{className:["mg-form-field",m].filter(Boolean).join(" "),children:[n&&/*#__PURE__*/ /*#__PURE__*/(0,a().jsx)("label",{className:s?"mg-u-sr-only":"mg-form-label",htmlFor:d,children:n}),/*#__PURE__*/ /*#__PURE__*/(0,a().jsxs)("div",{className:["mg-form-action",p&&"mg-form-action--stack-mobile"].filter(Boolean).join(" "),children:[x,v]}),i&&/*#__PURE__*/ /*#__PURE__*/(0,a().jsx)("p",{className:"mg-form-help",id:y,children:i}),l&&/*#__PURE__*/ /*#__PURE__*/(0,a().jsx)("p",{className:"mg-form-error",id:u,role:"alert",children:l})]})}p.propTypes={control:l().element.isRequired,action:l().element.isRequired,label:l().string,hideLabel:l().bool,helpText:l().string,errorText:l().string,stackOnMobile:l().bool,className:l().string};const m=p;export{p as FormAction,m as default};
|
|
@@ -3,7 +3,7 @@
|
|
|
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-
|
|
6
|
+
* Compiled on: 2026-11-09T16:21:46.474Z
|
|
7
7
|
*/
|
|
8
8
|
/*! For license information please see FormErrorSummary.js.LICENSE.txt */
|
|
9
|
-
import{useEffect as e,useRef as r}from"react";var t={2694(e,r,t){var
|
|
9
|
+
import{useEffect as e,useRef as r}from"react";var t={2694(e,r,t){var o=t(6925);function n(){}function s(){}s.resetWarningCache=n,e.exports=function(){function e(e,r,t,n,s,a){if(a!==o){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 r(){return e}e.isRequired=e;var t={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:s,resetWarningCache:n};return t.PropTypes=t,t}},5556(e,r,t){e.exports=t(2694)()},6925(e){e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}};const o={};function n(e){const r=o[e];if(void 0!==r)return r.exports;const s=o[e]={exports:{}};return t[e](s,s.exports,n),s.exports}n.n=e=>{const r=e&&e.__esModule?()=>e.default:()=>e;return n.d(r,{a:r}),r},n.cw=e=>{var r;return()=>{if(e){var t=e;e=0,r={exports:{}},t.call(r.exports,r,r.exports)}return r.exports}},n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r);var s=/*#__PURE__*/n.cw((e,r)=>{var t=Symbol.for("react.transitional.element");function o(e,r,o){var n=null;if(void 0!==o&&(n=""+o),void 0!==r.key&&(n=""+r.key),"key"in r)for(var s in o={},r)"key"!==s&&(o[s]=r[s]);else o=r;return r=o.ref,{$$typeof:t,type:e,key:n,ref:void 0!==r?r:null,props:o}}Symbol.for("react.fragment"),r.jsx=o,r.jsxs=o}),a=/*#__PURE__*/n.cw(e=>{e.exports=s()}),i=/*#__PURE__*/n(5556),c=/*#__PURE__*/n.n(i);function l({title:t="There is a problem",errors:o,className:n,...a}){const i=r(null),c=r(!1);return e(()=>{o?.length>0&&i.current&&!c.current&&(i.current.focus(),c.current=!0)},[o]),o&&0!==o.length?/*#__PURE__*/ /*#__PURE__*/(0,s().jsxs)("div",{className:["mg-form-error-summary",n].filter(Boolean).join(" "),role:"alert",tabIndex:-1,ref:i,...a,children:[/*#__PURE__*/ /*#__PURE__*/(0,s().jsx)("h2",{className:"mg-form-error-summary__title",children:t}),/*#__PURE__*/ /*#__PURE__*/(0,s().jsx)("ul",{className:"mg-form-error-summary__list",children:o.map(e=>/*#__PURE__*/ /*#__PURE__*/(0,s().jsx)("li",{children:/*#__PURE__*/ /*#__PURE__*/(0,s().jsx)("a",{href:`#${e.id}`,children:e.message})},e.id))})]}):null}a(),l.propTypes={title:c().string,errors:c().arrayOf(c().shape({id:c().string.isRequired,message:c().string.isRequired})).isRequired,className:c().string};const p=l;export{l as FormErrorSummary,p as default};
|
package/components/FormGroup.js
CHANGED
|
@@ -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-
|
|
6
|
+
* Compiled on: 2026-11-09T16:21:46.474Z
|
|
7
7
|
*/
|
|
8
8
|
/*! For license information please see FormGroup.js.LICENSE.txt */
|
|
9
|
-
import{useId as e}from"react";var r={2694(e,r,o){var
|
|
9
|
+
import{useId as e}from"react";var r={2694(e,r,o){var t=o(6925);function n(){}function s(){}s.resetWarningCache=n,e.exports=function(){function e(e,r,o,n,s,a){if(a!==t){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 r(){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:r,element:e,elementType:e,instanceOf:r,node:e,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:s,resetWarningCache:n};return o.PropTypes=o,o}},5556(e,r,o){e.exports=o(2694)()},6925(e){e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}};const o={};function t(e){const n=o[e];if(void 0!==n)return n.exports;const s=o[e]={exports:{}};return r[e](s,s.exports,t),s.exports}t.n=e=>{const r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.cw=e=>{var r;return()=>{if(e){var o=e;e=0,r={exports:{}},o.call(r.exports,r,r.exports)}return r.exports}},t.d=(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r);var n=/*#__PURE__*/t.cw((e,r)=>{var o=Symbol.for("react.transitional.element");function t(e,r,t){var n=null;if(void 0!==t&&(n=""+t),void 0!==r.key&&(n=""+r.key),"key"in r)for(var s in t={},r)"key"!==s&&(t[s]=r[s]);else t=r;return r=t.ref,{$$typeof:o,type:e,key:n,ref:void 0!==r?r:null,props:t}}Symbol.for("react.fragment"),r.jsx=t,r.jsxs=t}),s=/*#__PURE__*/t.cw(e=>{e.exports=n()}),a=/*#__PURE__*/t(5556),i=/*#__PURE__*/t.n(a);function l({children:r,legend:o,disabled:t=!1,error:s=!1,errorText:a,hideLegend:i=!1,className:l,...p}){const c=e(),d=s&&a?`${c}-error`:void 0,f=["mg-form-group",t&&"mg-form-group--disabled",s&&"mg-form-group--error",l].filter(Boolean).join(" "),u=["mg-form-group__legend",i&&"mg-u-sr-only"].filter(Boolean).join(" ");/*#__PURE__*/ /*#__PURE__*/
|
|
10
|
+
return(0,n().jsxs)("fieldset",{className:f,disabled:t,"aria-describedby":d,...p,children:[/*#__PURE__*/ /*#__PURE__*/(0,n().jsx)("legend",{className:u,children:o}),r,s&&a&&/*#__PURE__*/ /*#__PURE__*/(0,n().jsx)("p",{className:"mg-form-error",id:d,role:"alert",children:a})]})}s(),l.propTypes={children:i().node.isRequired,legend:i().string.isRequired,disabled:i().bool,error:i().bool,errorText:i().string,hideLegend:i().bool,className:i().string};const p=l;export{l as FormGroup,p as default};
|
package/components/FullWidth.js
CHANGED
|
@@ -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-
|
|
6
|
+
* Compiled on: 2026-11-09T16:21:46.474Z
|
|
7
7
|
*/
|
|
8
8
|
/*! For license information please see FullWidth.js.LICENSE.txt */
|
|
9
|
-
import"react";var e={2694(e,r,t){var
|
|
9
|
+
import"react";var e={2694(e,r,t){var o=t(6925);function n(){}function a(){}a.resetWarningCache=n,e.exports=function(){function e(e,r,t,n,a,s){if(s!==o){var c=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 c.name="Invariant Violation",c}}function r(){return e}e.isRequired=e;var t={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:a,resetWarningCache:n};return t.PropTypes=t,t}},5556(e,r,t){e.exports=t(2694)()},6925(e){e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}};const r={};function t(o){const n=r[o];if(void 0!==n)return n.exports;const a=r[o]={exports:{}};return e[o](a,a.exports,t),a.exports}t.n=e=>{const r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.cw=e=>{var r;return()=>{if(e){var t=e;e=0,r={exports:{}},t.call(r.exports,r,r.exports)}return r.exports}},t.d=(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r);var o=/*#__PURE__*/t.cw((e,r)=>{var t=Symbol.for("react.transitional.element");Symbol.for("react.fragment"),r.jsx=function(e,r,o){var n=null;if(void 0!==o&&(n=""+o),void 0!==r.key&&(n=""+r.key),"key"in r)for(var a in o={},r)"key"!==a&&(o[a]=r[a]);else o=r;return r=o.ref,{$$typeof:t,type:e,key:n,ref:void 0!==r?r:null,props:o}}}),n=/*#__PURE__*/t.cw(e=>{e.exports=o()}),a=/*#__PURE__*/t(5556),s=/*#__PURE__*/t.n(a);function c({children:e,className:r=""}){const t=["mg-container-full-width",r].filter(Boolean).join(" ");/*#__PURE__*/ /*#__PURE__*/
|
|
10
|
+
return(0,o().jsx)("section",{className:t,children:e})}n(),c.propTypes={children:s().node,className:s().string};const p=c;export{c as FullWidth,p as default};
|
package/components/Gallery.js
CHANGED
|
@@ -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-
|
|
6
|
+
* Compiled on: 2026-11-09T16:21:46.474Z
|
|
7
7
|
*/
|
|
8
8
|
/*! For license information please see Gallery.js.LICENSE.txt */
|
|
9
|
-
import*as e from"react";var r={1127(e,r,a){a.d(r,{aH:()=>o});var t=a(1649),l=a(5556),n=a.n(l),i=a(4848);function o({label:e="Loading",size:r="default",decorative:a=!1,className:l=""}){const[n,o]=(0,t.useState)(!1);(0,t.useEffect)(()=>{if(a)return;const e=setTimeout(()=>o(!0),100);return()=>clearTimeout(e)},[a]);const s="inline"===r?"span":"div",c=["mg-loader","inline"===r&&"mg-loader--inline",l].filter(Boolean).join(" ");return a?(0,i.jsx)(s,{className:c,"aria-hidden":"true"}):(0,i.jsx)(s,{className:c,role:"status",children:n&&(0,i.jsx)("span",{className:"mg-u-sr-only",children:e})})}o.propTypes={label:n().string,size:n().oneOf(["default","inline"]),decorative:n().bool,className:n().string}},2694(e,r,a){var t=a(6925);function l(){}function n(){}n.resetWarningCache=l,e.exports=function(){function e(e,r,a,l,n,i){if(i!==t){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 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:l};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"),t=Symbol.for("react.fragment");function l(e,r,t){var l=null;if(void 0!==t&&(l=""+t),void 0!==r.key&&(l=""+r.key),"key"in r)for(var n in t={},r)"key"!==n&&(t[n]=r[n]);else t=r;return r=t.ref,{$$typeof:a,type:e,key:l,ref:void 0!==r?r:null,props:t}}r.Fragment=t,r.jsx=l,r.jsxs=l},4848(e,r,a){e.exports=a(9698)},1649(r,a,t){r.exports=(e=>{const r={};return t.d(r,e),r})({default:()=>e.default,useCallback:()=>e.useCallback,useEffect:()=>e.useEffect,useRef:()=>e.useRef,useState:()=>e.useState})}};const a={};function t(e){const l=a[e];if(void 0!==l)return l.exports;const n=a[e]={exports:{}};return r[e](n,n.exports,t),n.exports}t.n=e=>{const r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.d=(e,r)=>{for(var a in r)t.o(r,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:r[a]})},t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r);const l={en:"ltr",ar:"rtl",es:"ltr",fr:"ltr",ja:"ltr",ru:"ltr",zh:"ltr"};function n(e="en"){return String(e).trim().toLowerCase().split(/[-_]/)[0]}function i(e,r){const a=n(e),t=void 0!==e&&Object.hasOwn(l,a)?l[a]:void 0,i=void 0===r?t:r;return{...void 0===e?{}:{lang:e},...void 0===i?{}:{dir:i}}}function o(e){const r=e.dataset.lang??e.closest("[lang]")?.getAttribute("lang"),a=e.getAttribute("dir")?.toLowerCase();return{...null==r?{}:{lang:r},...["ltr","rtl","auto"].includes(a)?{dir:a}:{}}}const s=(c={galleryAriaLabel:"Gallery",prevLabel:"Previous item",nextLabel:"Next item",loadingLabel:"Loading media"},d={ar:{galleryAriaLabel:"معرض الصور",prevLabel:"العنصر السابق",nextLabel:"العنصر التالي",loadingLabel:"جارٍ تحميل الوسائط"},es:{galleryAriaLabel:"Galería",prevLabel:"Elemento anterior",nextLabel:"Elemento siguiente",loadingLabel:"Cargando medio"},fr:{galleryAriaLabel:"Galerie",prevLabel:"Élément précédent",nextLabel:"Élément suivant",loadingLabel:"Chargement du média"},ja:{galleryAriaLabel:"ギャラリー",prevLabel:"前のアイテム",nextLabel:"次のアイテム",loadingLabel:"メディアを読み込んでいます…"},ru:{galleryAriaLabel:"Галерея",prevLabel:"Предыдущий элемент",nextLabel:"Следующий элемент",loadingLabel:"Загрузка медиа"},zh:{galleryAriaLabel:"图库",prevLabel:"上一项",nextLabel:"下一项",loadingLabel:"正在加载媒体"}},(e,r)=>{const a=n(e),t=Object.hasOwn(d,a)?d[a]:void 0,l=Object.fromEntries(Object.entries(r??{}).filter(([,e])=>void 0!==e));return{...c,...t,...l}});var c,d,u=t(1649),m=t(5556),b=t.n(m),g=t(1127),p=t(4848);const y=(...e)=>e.filter(Boolean).length>0?e.filter(Boolean).join(" "):null,h=["a[href]","area[href]","button","input","select","textarea","iframe","object","embed","summary","audio[controls]","video[controls]","[contenteditable]","[tabindex]"].join(",");function f({media:e,initialIndex:r=0,showThumbnails:a=!0,thumbnailPosition:t="left",showArrows:l=!0,arrowStyle:n="overlay",showDescription:o=!0,enableKeyboard:c=!0,loop:d=!1,onMediaChange:m,lang:b,dir:f,labels:v}){const{galleryAriaLabel:_,prevLabel:x,nextLabel:w,loadingLabel:L}=s(b,v),[j,N]=(0,u.useState)(r),[k,O]=(0,u.useState)(!1),S=(0,u.useRef)(null),A=(0,u.useRef)(null),T=(0,u.useRef)(null),C=(0,u.useRef)([]),E=(0,u.useRef)([]),R=(0,u.useRef)(null),I=(0,u.useRef)(null),D=e[j];(0,u.useEffect)(()=>{"video"===D.type||"embed"===D.type?O(!0):O(!1)},[j,D.type]),(0,u.useEffect)(()=>{E.current.forEach(e=>{e&&(e.setAttribute("inert",""),e.querySelectorAll(h).forEach(e=>e.setAttribute("tabindex","-1")))})},[e]);const P=(0,u.useCallback)(r=>{N(r),m&&m(r,e[r]);const a=C.current[r];if(a){const e=a.ownerDocument.defaultView.matchMedia("(prefers-reduced-motion: reduce)").matches;a.scrollIntoView({behavior:e?"instant":"smooth",block:"nearest",inline:"center"})}},[e,m]),M=(0,u.useCallback)(()=>{j<e.length-1?P(j+1):d&&P(0)},[j,e.length,P,d]),z=(0,u.useCallback)(()=>{j>0?P(j-1):d&&P(e.length-1)},[j,P,d,e.length]),H=(0,u.useCallback)(r=>{if(c)switch(r.key){case"ArrowLeft":r.preventDefault(),z();break;case"ArrowRight":r.preventDefault(),M();break;case"Home":r.preventDefault(),P(0);break;case"End":r.preventDefault(),P(e.length-1)}},[c,M,z,P,e.length]),K=y("mg-gallery","bottom"===t&&"mg-gallery--thumbnails-bottom");return(0,p.jsxs)("div",{...i(b,f),ref:S,className:K,role:"region","aria-label":_,tabIndex:c?0:void 0,onKeyDown:H,children:[(0,p.jsxs)("div",{className:"mg-gallery__main",role:"group",children:[(0,p.jsxs)("div",{className:"mg-gallery__image-wrapper",onTouchStart:e=>{R.current=e.touches[0].clientX,I.current=null},onTouchMove:e=>{I.current=e.touches[0].clientX},onTouchEnd:()=>{if(!R.current||!I.current)return;const e=R.current-I.current;Math.abs(e)>50&&(e>0?M():z()),R.current=null,I.current=null},children:[(!D.type||"image"===D.type)&&(0,p.jsx)("img",{ref:A,src:D.src,alt:D.alt,className:"mg-gallery__image","aria-describedby":o&&D.description?"gallery-description":void 0}),"video"===D.type&&(0,p.jsxs)("video",{ref:A,src:D.src,className:"mg-gallery__image mg-gallery__video",controls:!0,poster:D.poster,onLoadedData:()=>O(!1),onLoadStart:()=>O(!0),"aria-describedby":o&&D.description?"gallery-description":void 0,children:[(0,p.jsx)("track",{kind:"captions"}),"Your browser does not support the video tag."]}),"embed"===D.type&&(0,p.jsx)("iframe",{ref:A,src:D.embedUrl||D.src,className:"mg-gallery__image mg-gallery__embed",title:D.title||D.alt,allowFullScreen:!0,onLoad:()=>O(!1),"aria-describedby":o&&D.description?"gallery-description":void 0}),"html"===D.type&&(0,p.jsx)("div",{ref:A,className:"mg-gallery__image mg-gallery__html",dangerouslySetInnerHTML:{__html:D.html},"aria-describedby":o&&D.description?"gallery-description":void 0}),k&&(0,p.jsx)("div",{className:"mg-gallery__loading",children:(0,p.jsx)(g.aH,{size:"inline",label:L})})]}),l&&"overlay"===n&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("button",{className:"mg-gallery__arrow mg-gallery__arrow--prev",onClick:z,disabled:!d&&0===j,"aria-label":x,type:"button",children:"‹"}),(0,p.jsx)("button",{className:"mg-gallery__arrow mg-gallery__arrow--next",onClick:M,disabled:!d&&j===e.length-1,"aria-label":w,type:"button",children:"›"})]}),l&&"corner"===n&&(0,p.jsxs)("div",{className:"mg-gallery__arrow-controls",children:[(0,p.jsx)("button",{className:"mg-gallery__arrow-button mg-gallery__arrow-button--prev",onClick:z,disabled:!d&&0===j,"aria-label":x,type:"button",children:"‹"}),(0,p.jsx)("button",{className:"mg-gallery__arrow-button mg-gallery__arrow-button--next",onClick:M,disabled:!d&&j===e.length-1,"aria-label":w,type:"button",children:"›"})]})]}),o&&(D.title||D.description)&&(0,p.jsxs)("div",{className:"mg-gallery__description",id:"gallery-description",children:[D.title&&(0,p.jsx)("div",{className:"mg-gallery__title",children:D.title}),D.description&&(0,p.jsx)("p",{className:"mg-gallery__caption",children:D.description})]}),a&&(0,p.jsx)("div",{ref:T,className:"mg-gallery__thumbnails",role:"tablist","aria-label":"Gallery thumbnails",children:e.map((e,r)=>(0,p.jsxs)("button",{ref:e=>{C.current[r]=e},className:y("mg-gallery__thumbnail",r===j&&"mg-gallery__thumbnail--active","html"===e.type&&!e.thumbnail&&"mg-gallery__thumbnail--html"),onClick:()=>P(r),role:"tab","aria-selected":r===j,"aria-current":r===j?"true":void 0,"aria-label":`View ${e.title||e.alt||"content"}`,type:"button",children:["html"===e.type&&!e.thumbnail&&e.html?(0,p.jsx)("div",{ref:e=>{E.current[r]=e},className:"mg-gallery__thumbnail-html-preview","aria-hidden":"true",inert:!0,children:(0,p.jsx)("div",{className:"mg-gallery__thumbnail-html-content",dangerouslySetInnerHTML:{__html:e.html}})}):e.thumbnail||e.src?(0,p.jsx)("img",{src:e.thumbnail||e.src,alt:"",loading:"lazy"}):(0,p.jsx)("span",{className:"mg-gallery__thumbnail-placeholder","aria-hidden":"true",children:"◫"}),("video"===e.type||"embed"===e.type)&&(0,p.jsx)("span",{className:"mg-gallery__thumbnail-indicator","aria-hidden":"true",children:"▶"})]},e.id))})]})}f.propTypes={media:b().arrayOf(b().shape({id:b().string.isRequired,type:b().oneOf(["image","video","embed","html"]),src:b().string,alt:b().string,title:b().string,description:b().string,thumbnail:b().string,poster:b().string,embedUrl:b().string,html:b().string})).isRequired,initialIndex:b().number,showThumbnails:b().bool,thumbnailPosition:b().oneOf(["left","bottom"]),showArrows:b().bool,arrowStyle:b().oneOf(["overlay","corner"]),showDescription:b().bool,enableKeyboard:b().bool,loop:b().bool,onMediaChange:b().func,lang:b().string,dir:b().oneOf(["ltr","rtl","auto"]),labels:b().shape({galleryAriaLabel:b().string,prevLabel:b().string,nextLabel:b().string,loadingLabel:b().string})};const v=u.default.memo(f);function _(e){const{dataset:r}=e,a=function(e){try{const r=JSON.parse(e.dataset.labels);return r&&"object"==typeof r&&!Array.isArray(r)?r:void 0}catch{return}}(e),t={...o(e),...a?{labels:a}:{},initialIndex:r.initialIndex?parseInt(r.initialIndex,10):0,showThumbnails:"false"!==r.showThumbnails,thumbnailPosition:r.thumbnailPosition||"left",showArrows:"false"!==r.showArrows,arrowStyle:r.arrowStyle||"overlay",showDescription:"false"!==r.showDescription,enableKeyboard:"false"!==r.enableKeyboard,loop:"true"===r.loop};try{t.media=r.media?JSON.parse(r.media):[]}catch{t.media=[]}return t}export{v as Gallery,v as default,_ as fromElement,s as getGalleryLabels};
|
|
9
|
+
import*as e from"react";var r={1127(e,r,a){a.d(r,{aH:()=>o});var t=a(1649),l=/*#__PURE__*/a(5556),n=/*#__PURE__*/a.n(l),i=a(4848);function o({label:e="Loading",size:r="default",decorative:a=!1,className:l=""}){const[n,o]=(0,t.useState)(!1);(0,t.useEffect)(()=>{if(a)return;const e=setTimeout(()=>o(!0),100);return()=>clearTimeout(e)},[a]);const s="inline"===r?"span":"div",c=["mg-loader","inline"===r&&"mg-loader--inline",l].filter(Boolean).join(" ");return a?/*#__PURE__*/ /*#__PURE__*/(0,i.jsx)(s,{className:c,"aria-hidden":"true"}):/*#__PURE__*/ /*#__PURE__*/(0,i.jsx)(s,{className:c,role:"status",children:n&&/*#__PURE__*/ /*#__PURE__*/(0,i.jsx)("span",{className:"mg-u-sr-only",children:e})})}o.propTypes={label:n().string,size:n().oneOf(["default","inline"]),decorative:n().bool,className:n().string}},2694(e,r,a){var t=a(6925);function l(){}function n(){}n.resetWarningCache=l,e.exports=function(){function e(e,r,a,l,n,i){if(i!==t){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 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:l};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"),t=Symbol.for("react.fragment");function l(e,r,t){var l=null;if(void 0!==t&&(l=""+t),void 0!==r.key&&(l=""+r.key),"key"in r)for(var n in t={},r)"key"!==n&&(t[n]=r[n]);else t=r;return r=t.ref,{$$typeof:a,type:e,key:l,ref:void 0!==r?r:null,props:t}}r.Fragment=t,r.jsx=l,r.jsxs=l},4848(e,r,a){e.exports=a(9698)},1649(r,a,t){r.exports=(e=>{const r={};return t.d(r,e),r})({default:()=>e.default,useCallback:()=>e.useCallback,useEffect:()=>e.useEffect,useRef:()=>e.useRef,useState:()=>e.useState})}};const a={};function t(e){const l=a[e];if(void 0!==l)return l.exports;const n=a[e]={exports:{}};return r[e](n,n.exports,t),n.exports}t.n=e=>{const r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.d=(e,r)=>{for(var a in r)t.o(r,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:r[a]})},t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r);const l={en:"ltr",ar:"rtl",es:"ltr",fr:"ltr",ja:"ltr",ru:"ltr",zh:"ltr"};function n(e="en"){return String(e).trim().toLowerCase().split(/[-_]/)[0]}function i(e,r){const a=n(e),t=void 0!==e&&Object.hasOwn(l,a)?l[a]:void 0,i=void 0===r?t:r;return{...void 0===e?{}:{lang:e},...void 0===i?{}:{dir:i}}}function o(e){const r=e.dataset.lang??e.closest("[lang]")?.getAttribute("lang"),a=e.getAttribute("dir")?.toLowerCase();return{...null==r?{}:{lang:r},...["ltr","rtl","auto"].includes(a)?{dir:a}:{}}}const s=(c={galleryAriaLabel:"Gallery",prevLabel:"Previous item",nextLabel:"Next item",loadingLabel:"Loading media"},d={ar:{galleryAriaLabel:"معرض الصور",prevLabel:"العنصر السابق",nextLabel:"العنصر التالي",loadingLabel:"جارٍ تحميل الوسائط"},es:{galleryAriaLabel:"Galería",prevLabel:"Elemento anterior",nextLabel:"Elemento siguiente",loadingLabel:"Cargando medio"},fr:{galleryAriaLabel:"Galerie",prevLabel:"Élément précédent",nextLabel:"Élément suivant",loadingLabel:"Chargement du média"},ja:{galleryAriaLabel:"ギャラリー",prevLabel:"前のアイテム",nextLabel:"次のアイテム",loadingLabel:"メディアを読み込んでいます…"},ru:{galleryAriaLabel:"Галерея",prevLabel:"Предыдущий элемент",nextLabel:"Следующий элемент",loadingLabel:"Загрузка медиа"},zh:{galleryAriaLabel:"图库",prevLabel:"上一项",nextLabel:"下一项",loadingLabel:"正在加载媒体"}},(e,r)=>{const a=n(e),t=Object.hasOwn(d,a)?d[a]:void 0,l=Object.fromEntries(Object.entries(r??{}).filter(([,e])=>void 0!==e));return{...c,...t,...l}});var c,d,u=t(1649),m=/*#__PURE__*/t(5556),b=/*#__PURE__*/t.n(m),g=t(1127),p=t(4848);const y=(...e)=>e.filter(Boolean).length>0?e.filter(Boolean).join(" "):null,h=["a[href]","area[href]","button","input","select","textarea","iframe","object","embed","summary","audio[controls]","video[controls]","[contenteditable]","[tabindex]"].join(",");function f({media:e,initialIndex:r=0,showThumbnails:a=!0,thumbnailPosition:t="left",showArrows:l=!0,arrowStyle:n="overlay",showDescription:o=!0,enableKeyboard:c=!0,loop:d=!1,onMediaChange:m,lang:b,dir:f,labels:v}){const{galleryAriaLabel:_,prevLabel:x,nextLabel:w,loadingLabel:L}=s(b,v),[j,N]=(0,u.useState)(r),[k,O]=(0,u.useState)(!1),S=(0,u.useRef)(null),A=(0,u.useRef)(null),T=(0,u.useRef)(null),C=(0,u.useRef)([]),E=(0,u.useRef)([]),R=(0,u.useRef)(null),I=(0,u.useRef)(null),D=e[j];(0,u.useEffect)(()=>{"video"===D.type||"embed"===D.type?O(!0):O(!1)},[j,D.type]),(0,u.useEffect)(()=>{E.current.forEach(e=>{e&&(e.setAttribute("inert",""),e.querySelectorAll(h).forEach(e=>e.setAttribute("tabindex","-1")))})},[e]);const P=(0,u.useCallback)(r=>{N(r),m&&m(r,e[r]);const a=C.current[r];if(a){const e=a.ownerDocument.defaultView.matchMedia("(prefers-reduced-motion: reduce)").matches;a.scrollIntoView({behavior:e?"instant":"smooth",block:"nearest",inline:"center"})}},[e,m]),M=(0,u.useCallback)(()=>{j<e.length-1?P(j+1):d&&P(0)},[j,e.length,P,d]),z=(0,u.useCallback)(()=>{j>0?P(j-1):d&&P(e.length-1)},[j,P,d,e.length]),H=(0,u.useCallback)(r=>{if(c)switch(r.key){case"ArrowLeft":r.preventDefault(),z();break;case"ArrowRight":r.preventDefault(),M();break;case"Home":r.preventDefault(),P(0);break;case"End":r.preventDefault(),P(e.length-1)}},[c,M,z,P,e.length]),K=y("mg-gallery","bottom"===t&&"mg-gallery--thumbnails-bottom");/*#__PURE__*/ /*#__PURE__*/
|
|
10
|
+
return(0,p.jsxs)("div",{...i(b,f),ref:S,className:K,role:"region","aria-label":_,tabIndex:c?0:void 0,onKeyDown:H,children:[/*#__PURE__*/ /*#__PURE__*/(0,p.jsxs)("div",{className:"mg-gallery__main",role:"group",children:[/*#__PURE__*/ /*#__PURE__*/(0,p.jsxs)("div",{className:"mg-gallery__image-wrapper",onTouchStart:e=>{R.current=e.touches[0].clientX,I.current=null},onTouchMove:e=>{I.current=e.touches[0].clientX},onTouchEnd:()=>{if(!R.current||!I.current)return;const e=R.current-I.current;Math.abs(e)>50&&(e>0?M():z()),R.current=null,I.current=null},children:[(!D.type||"image"===D.type)&&/*#__PURE__*/ /*#__PURE__*/(0,p.jsx)("img",{ref:A,src:D.src,alt:D.alt,className:"mg-gallery__image","aria-describedby":o&&D.description?"gallery-description":void 0}),"video"===D.type&&/*#__PURE__*/ /*#__PURE__*/(0,p.jsxs)("video",{ref:A,src:D.src,className:"mg-gallery__image mg-gallery__video",controls:!0,poster:D.poster,onLoadedData:()=>O(!1),onLoadStart:()=>O(!0),"aria-describedby":o&&D.description?"gallery-description":void 0,children:[/*#__PURE__*/ /*#__PURE__*/(0,p.jsx)("track",{kind:"captions"}),"Your browser does not support the video tag."]}),"embed"===D.type&&/*#__PURE__*/ /*#__PURE__*/(0,p.jsx)("iframe",{ref:A,src:D.embedUrl||D.src,className:"mg-gallery__image mg-gallery__embed",title:D.title||D.alt,allowFullScreen:!0,onLoad:()=>O(!1),"aria-describedby":o&&D.description?"gallery-description":void 0}),"html"===D.type&&/*#__PURE__*/ /*#__PURE__*/(0,p.jsx)("div",{ref:A,className:"mg-gallery__image mg-gallery__html",dangerouslySetInnerHTML:{__html:D.html},"aria-describedby":o&&D.description?"gallery-description":void 0}),k&&/*#__PURE__*/ /*#__PURE__*/(0,p.jsx)("div",{className:"mg-gallery__loading",children:/*#__PURE__*/ /*#__PURE__*/(0,p.jsx)(g.aH,{size:"inline",label:L})})]}),l&&"overlay"===n&&/*#__PURE__*/ /*#__PURE__*/(0,p.jsxs)(p.Fragment,{children:[/*#__PURE__*/ /*#__PURE__*/(0,p.jsx)("button",{className:"mg-gallery__arrow mg-gallery__arrow--prev",onClick:z,disabled:!d&&0===j,"aria-label":x,type:"button",children:"‹"}),/*#__PURE__*/ /*#__PURE__*/(0,p.jsx)("button",{className:"mg-gallery__arrow mg-gallery__arrow--next",onClick:M,disabled:!d&&j===e.length-1,"aria-label":w,type:"button",children:"›"})]}),l&&"corner"===n&&/*#__PURE__*/ /*#__PURE__*/(0,p.jsxs)("div",{className:"mg-gallery__arrow-controls",children:[/*#__PURE__*/ /*#__PURE__*/(0,p.jsx)("button",{className:"mg-gallery__arrow-button mg-gallery__arrow-button--prev",onClick:z,disabled:!d&&0===j,"aria-label":x,type:"button",children:"‹"}),/*#__PURE__*/ /*#__PURE__*/(0,p.jsx)("button",{className:"mg-gallery__arrow-button mg-gallery__arrow-button--next",onClick:M,disabled:!d&&j===e.length-1,"aria-label":w,type:"button",children:"›"})]})]}),o&&(D.title||D.description)&&/*#__PURE__*/ /*#__PURE__*/(0,p.jsxs)("div",{className:"mg-gallery__description",id:"gallery-description",children:[D.title&&/*#__PURE__*/ /*#__PURE__*/(0,p.jsx)("div",{className:"mg-gallery__title",children:D.title}),D.description&&/*#__PURE__*/ /*#__PURE__*/(0,p.jsx)("p",{className:"mg-gallery__caption",children:D.description})]}),a&&/*#__PURE__*/ /*#__PURE__*/(0,p.jsx)("div",{ref:T,className:"mg-gallery__thumbnails",role:"tablist","aria-label":"Gallery thumbnails",children:e.map((e,r)=>/*#__PURE__*/ /*#__PURE__*/(0,p.jsxs)("button",{ref:e=>{C.current[r]=e},className:y("mg-gallery__thumbnail",r===j&&"mg-gallery__thumbnail--active","html"===e.type&&!e.thumbnail&&"mg-gallery__thumbnail--html"),onClick:()=>P(r),role:"tab","aria-selected":r===j,"aria-current":r===j?"true":void 0,"aria-label":`View ${e.title||e.alt||"content"}`,type:"button",children:["html"===e.type&&!e.thumbnail&&e.html?/*#__PURE__*/ /*#__PURE__*/(0,p.jsx)("div",{ref:e=>{E.current[r]=e},className:"mg-gallery__thumbnail-html-preview","aria-hidden":"true",inert:!0,children:/*#__PURE__*/ /*#__PURE__*/(0,p.jsx)("div",{className:"mg-gallery__thumbnail-html-content",dangerouslySetInnerHTML:{__html:e.html}})}):e.thumbnail||e.src?/*#__PURE__*/ /*#__PURE__*/(0,p.jsx)("img",{src:e.thumbnail||e.src,alt:"",loading:"lazy"}):/*#__PURE__*/ /*#__PURE__*/(0,p.jsx)("span",{className:"mg-gallery__thumbnail-placeholder","aria-hidden":"true",children:"◫"}),("video"===e.type||"embed"===e.type)&&/*#__PURE__*/ /*#__PURE__*/(0,p.jsx)("span",{className:"mg-gallery__thumbnail-indicator","aria-hidden":"true",children:"▶"})]},e.id))})]})}f.propTypes={media:b().arrayOf(b().shape({id:b().string.isRequired,type:b().oneOf(["image","video","embed","html"]),src:b().string,alt:b().string,title:b().string,description:b().string,thumbnail:b().string,poster:b().string,embedUrl:b().string,html:b().string})).isRequired,initialIndex:b().number,showThumbnails:b().bool,thumbnailPosition:b().oneOf(["left","bottom"]),showArrows:b().bool,arrowStyle:b().oneOf(["overlay","corner"]),showDescription:b().bool,enableKeyboard:b().bool,loop:b().bool,onMediaChange:b().func,lang:b().string,dir:b().oneOf(["ltr","rtl","auto"]),labels:b().shape({galleryAriaLabel:b().string,prevLabel:b().string,nextLabel:b().string,loadingLabel:b().string})};const v=/*#__PURE__*/u.default.memo(f);function _(e){const{dataset:r}=e,a=function(e){try{const r=JSON.parse(e.dataset.labels);return r&&"object"==typeof r&&!Array.isArray(r)?r:void 0}catch{return}}(e),t={...o(e),...a?{labels:a}:{},initialIndex:r.initialIndex?parseInt(r.initialIndex,10):0,showThumbnails:"false"!==r.showThumbnails,thumbnailPosition:r.thumbnailPosition||"left",showArrows:"false"!==r.showArrows,arrowStyle:r.arrowStyle||"overlay",showDescription:"false"!==r.showDescription,enableKeyboard:"false"!==r.enableKeyboard,loop:"true"===r.loop};try{t.media=r.media?JSON.parse(r.media):[]}catch{t.media=[]}return t}export{v as Gallery,v as default,_ as fromElement,s as getGalleryLabels};
|
package/components/Hero.js
CHANGED
|
@@ -3,7 +3,11 @@
|
|
|
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-
|
|
6
|
+
* Compiled on: 2026-11-09T16:21:46.474Z
|
|
7
7
|
*/
|
|
8
8
|
/*! For license information please see Hero.js.LICENSE.txt */
|
|
9
|
-
import"react";var e={2694(e,r,a){var t=a(6925);function n(){}function i(){}i.resetWarningCache=n,e.exports=function(){function e(e,r,a,n,i,s){if(s!==t){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 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:i,resetWarningCache:n};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"}};const r={};function a(t){const n=r[t];if(void 0!==n)return n.exports;const i=r[t]={exports:{}};return e[t](i,i.exports,a),i.exports}a.n=e=>{const r=e&&e.__esModule?()=>e.default:()=>e;return a.d(r,{a:r}),r},a.cw=e=>{var r;return()=>{if(e){var a=e;e=0,r={exports:{}},a.call(r.exports,r,r.exports)}return r.exports}},a.d=(e,r)=>{for(var t in r)a.o(r,t)&&!a.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},a.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r);var t
|
|
9
|
+
import"react";var e={2694(e,r,a){var t=a(6925);function n(){}function i(){}i.resetWarningCache=n,e.exports=function(){function e(e,r,a,n,i,s){if(s!==t){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 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:i,resetWarningCache:n};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"}};const r={};function a(t){const n=r[t];if(void 0!==n)return n.exports;const i=r[t]={exports:{}};return e[t](i,i.exports,a),i.exports}a.n=e=>{const r=e&&e.__esModule?()=>e.default:()=>e;return a.d(r,{a:r}),r},a.cw=e=>{var r;return()=>{if(e){var a=e;e=0,r={exports:{}},a.call(r.exports,r,r.exports)}return r.exports}},a.d=(e,r)=>{for(var t in r)a.o(r,t)&&!a.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},a.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r);var t=/*#__PURE__*/a.cw((e,r)=>{var a=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(e,r,t){var n=null;if(void 0!==t&&(n=""+t),void 0!==r.key&&(n=""+r.key),"key"in r)for(var i in t={},r)"key"!==i&&(t[i]=r[i]);else t=r;return r=t.ref,{$$typeof:a,type:e,key:n,ref:void 0!==r?r:null,props:t}}r.Fragment=t,r.jsx=n,r.jsxs=n}),n=/*#__PURE__*/a.cw(e=>{e.exports=t()}),i=/*#__PURE__*/a(5556),s=/*#__PURE__*/a.n(i);function l({label:e,Type:r="Primary",Variant:a="Default",Outline:n=!1,State:i="Default",href:s="#",onClick:l,className:o,...m}){const c="Disabled"===i,d=["mg-button","CTA"===a&&"mg-button-cta","mg-button-"+("Secondary"===r?"secondary":"primary"),n&&"mg-button-outline",c&&"disabled",o].filter(Boolean).join(" ");/*#__PURE__*/ /*#__PURE__*/
|
|
10
|
+
return(0,t().jsx)("a",{className:d,...m,...c?{"aria-disabled":"true",tabIndex:-1}:{href:s,onClick:l},children:e})}n(),l.propTypes={label:s().string.isRequired,Type:s().oneOf(["Primary","Secondary"]),Variant:s().oneOf(["Default","CTA"]),Outline:s().bool,State:s().oneOf(["Default","Disabled"]),href:s().string,onClick:s().func,className:s().string};const o=(...e)=>e.filter(Boolean).length>0?e.filter(Boolean).join(" "):null,m={primary:"",secondary:"secondary",tertiary:"tertiary",quaternary:"quaternary",neutral:"neutral"},c={"2/3":"2-3","1/2":"1-2","1/3":"1-3"};function d({item:e,HeadingTag:r}){return e.link?/*#__PURE__*/ /*#__PURE__*/(0,t().jsx)(r,{className:"mg-hero__title",children:/*#__PURE__*/ /*#__PURE__*/(0,t().jsx)("a",{href:e.link,dangerouslySetInnerHTML:{__html:e.title}})}):/*#__PURE__*/ /*#__PURE__*/(0,t().jsx)(r,{className:"mg-hero__title",dangerouslySetInnerHTML:{__html:e.title}})}function g({media:e}){if(!e)return null;const r=e.type||"image";return"video"===r?/*#__PURE__*/ /*#__PURE__*/(0,t().jsx)("div",{className:"mg-hero__media mg-hero__media--video",children:/*#__PURE__*/ /*#__PURE__*/(0,t().jsx)("iframe",{src:e.src,title:e.title||"Embedded video",className:"mg-hero__media-iframe",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowFullScreen:!0})}):"html"===r?/*#__PURE__*/ /*#__PURE__*/(0,t().jsx)("div",{className:"mg-hero__media mg-hero__media--html",dangerouslySetInnerHTML:{__html:e.html||""}}):/*#__PURE__*/ /*#__PURE__*/(0,t().jsx)("div",{className:"mg-hero__media",children:/*#__PURE__*/ /*#__PURE__*/(0,t().jsx)("img",{src:e.src,alt:e.alt||"",className:"mg-hero__media-img"})})}const u=(e,r)=>e.imgback&&"neutral"!==r;function h({tags:e,label:r}){return e?.length?/*#__PURE__*/ /*#__PURE__*/(0,t().jsx)("ul",{className:"mg-hero__tags","aria-label":r,children:e.map(e=>/*#__PURE__*/ /*#__PURE__*/(0,t().jsx)("li",{children:e.href?/*#__PURE__*/ /*#__PURE__*/(0,t().jsx)("a",{className:"mg-tag",href:e.href,children:e.label}):/*#__PURE__*/ /*#__PURE__*/(0,t().jsx)("span",{className:"mg-tag",children:e.label})},`${e.label}-${e.href||""}`))}):null}function p({item:e,HeadingTag:r}){const a=e.buttons||[e.primary_button&&{label:e.primary_button,type:"Primary"},e.secondary_button&&{label:e.secondary_button,type:"Secondary"}].filter(Boolean);/*#__PURE__*/ /*#__PURE__*/
|
|
11
|
+
return(0,t().jsxs)("article",{className:"mg-hero__content",children:[e.logo?.src&&/*#__PURE__*/ /*#__PURE__*/(0,t().jsx)("img",{className:"mg-hero__logo",src:e.logo.src,alt:e.logo.alt||""}),/*#__PURE__*/ /*#__PURE__*/(0,t().jsx)("div",{className:"mg-hero__meta",children:e.label&&/*#__PURE__*/ /*#__PURE__*/(0,t().jsx)("span",{className:"mg-hero__label",children:e.label})}),/*#__PURE__*/ /*#__PURE__*/(0,t().jsx)(d,{item:e,HeadingTag:r}),e.summaryText&&/*#__PURE__*/ /*#__PURE__*/(0,t().jsx)("div",{className:"mg-hero__summaryText",children:/*#__PURE__*/ /*#__PURE__*/(0,t().jsx)("span",{dangerouslySetInnerHTML:{__html:e.summaryText}})}),/*#__PURE__*/ /*#__PURE__*/(0,t().jsx)("div",{className:"mg-hero__meta meta-detail",children:e.detail&&/*#__PURE__*/ /*#__PURE__*/(0,t().jsx)("span",{className:"mg-hero__label detail",children:e.detail})}),/*#__PURE__*/ /*#__PURE__*/(0,t().jsx)(h,{tags:e.tags,label:e.tagsLabel||"Topics"}),a.length>0&&/*#__PURE__*/ /*#__PURE__*/(0,t().jsx)("div",{className:"mg-hero__buttons",children:a.map((e,r)=>/*#__PURE__*/ /*#__PURE__*/(0,t().jsx)(l,{Type:e.type,Variant:"CTA",label:e.label,href:e.url,onClick:e.onClick,target:e.target,rel:e.rel,"data-vf-analytics-label":e.analyticsLabel},`${e.label}-${r}`))})]})}function y({data:e,variant:r="primary",layout:a="background",headingLevel:n="h1",split:i="2/3",size:s="default",contained:l=!1}){const d=m[r],h=n;if("split"===a){const r=c[i]||"2-3";/*#__PURE__*/ /*#__PURE__*/
|
|
12
|
+
return(0,t().jsx)(t().Fragment,{children:e.map((e,a)=>/*#__PURE__*/ /*#__PURE__*/(0,t().jsx)("section",{className:o("mg-hero","mg-hero--split",`mg-hero--split-${r}`,"immersive"===s&&"mg-hero--immersive",l&&"mg-hero--contained",d&&`mg-hero--${d}`),children:/*#__PURE__*/ /*#__PURE__*/(0,t().jsxs)("div",{className:o("mg-hero__split-grid","mg-container",!e.media&&"mg-hero__split-grid--no-media"),children:[/*#__PURE__*/ /*#__PURE__*/(0,t().jsx)(p,{item:e,HeadingTag:h}),e.media&&/*#__PURE__*/ /*#__PURE__*/(0,t().jsx)(g,{media:e.media})]})},a))})}/*#__PURE__*/ /*#__PURE__*/
|
|
13
|
+
return(0,t().jsx)(t().Fragment,{children:e.map((e,a)=>/*#__PURE__*/ /*#__PURE__*/(0,t().jsx)("section",{className:o("mg-hero","immersive"===s&&"mg-hero--immersive",l&&"mg-hero--contained",!u(e,r)&&"mg-hero--no-image",d&&`mg-hero--${d}`),style:u(e,r)?{backgroundImage:`url(${e.imgback})`}:void 0,children:/*#__PURE__*/ /*#__PURE__*/(0,t().jsx)("div",{className:"mg-hero__overlay",children:/*#__PURE__*/ /*#__PURE__*/(0,t().jsx)(p,{item:e,HeadingTag:h})})},a))})}y.propTypes={data:s().arrayOf(s().shape({imgback:s().string,label:s().node,title:s().string.isRequired,link:s().string,summaryText:s().string,detail:s().node,tags:s().arrayOf(s().shape({label:s().string.isRequired,href:s().string})),tagsLabel:s().string,primary_button:s().string,secondary_button:s().string,logo:s().shape({src:s().string.isRequired,alt:s().string}),buttons:s().arrayOf(s().shape({label:s().string.isRequired,url:s().string,type:s().oneOf(["Primary","Secondary"]),onClick:s().func,target:s().string,rel:s().string,analyticsLabel:s().string})),media:s().shape({type:s().oneOf(["image","video","html"]),src:s().string,alt:s().string,title:s().string,html:s().string})})).isRequired,variant:s().oneOf(["primary","secondary","tertiary","quaternary","neutral"]),layout:s().oneOf(["background","split"]),headingLevel:s().oneOf(["h1","h2","h3"]),split:s().oneOf(["2/3","1/2","1/3"]),size:s().oneOf(["default","immersive"]),contained:s().bool};export{y as Hero,m as variantOptions};
|
|
@@ -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-
|
|
6
|
+
* Compiled on: 2026-11-09T16:21:46.474Z
|
|
7
7
|
*/
|
|
8
8
|
/*! For license information please see HighlightBox.js.LICENSE.txt */
|
|
9
|
-
import"react";var e={2694(e,r,t){var o=t(6925);function n(){}function a(){}a.resetWarningCache=n,e.exports=function(){function e(e,r,t,n,a,i){if(i!==o){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 r(){return e}e.isRequired=e;var t={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:a,resetWarningCache:n};return t.PropTypes=t,t}},5556(e,r,t){e.exports=t(2694)()},6925(e){e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}};const r={};function t(o){const n=r[o];if(void 0!==n)return n.exports;const a=r[o]={exports:{}};return e[o](a,a.exports,t),a.exports}t.n=e=>{const r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.cw=e=>{var r;return()=>{if(e){var t=e;e=0,r={exports:{}},t.call(r.exports,r,r.exports)}return r.exports}},t.d=(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r);var o
|
|
9
|
+
import"react";var e={2694(e,r,t){var o=t(6925);function n(){}function a(){}a.resetWarningCache=n,e.exports=function(){function e(e,r,t,n,a,i){if(i!==o){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 r(){return e}e.isRequired=e;var t={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:a,resetWarningCache:n};return t.PropTypes=t,t}},5556(e,r,t){e.exports=t(2694)()},6925(e){e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}};const r={};function t(o){const n=r[o];if(void 0!==n)return n.exports;const a=r[o]={exports:{}};return e[o](a,a.exports,t),a.exports}t.n=e=>{const r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.cw=e=>{var r;return()=>{if(e){var t=e;e=0,r={exports:{}},t.call(r.exports,r,r.exports)}return r.exports}},t.d=(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r);var o=/*#__PURE__*/t.cw((e,r)=>{var t=Symbol.for("react.transitional.element");Symbol.for("react.fragment"),r.jsx=function(e,r,o){var n=null;if(void 0!==o&&(n=""+o),void 0!==r.key&&(n=""+r.key),"key"in r)for(var a in o={},r)"key"!==a&&(o[a]=r[a]);else o=r;return r=o.ref,{$$typeof:t,type:e,key:n,ref:void 0!==r?r:null,props:o}}}),n=/*#__PURE__*/t.cw(e=>{e.exports=o()}),a=/*#__PURE__*/t(5556),i=/*#__PURE__*/t.n(a);function s({children:e,variant:r="default",centered:t=!1,float:n=null,className:a=""}){const i=["mg-highlight-box","default"!==r&&`mg-highlight-box--${r}`,t&&"mg-highlight-box--centered",n&&`mg-highlight-box--float-${n}`,a].filter(Boolean).join(" ");/*#__PURE__*/ /*#__PURE__*/
|
|
10
|
+
return(0,o().jsx)("div",{className:i,children:e})}n(),s.propTypes={children:i().node,variant:i().oneOf(["default","primary","secondary"]),centered:i().bool,float:i().oneOf(["start","end"]),className:i().string};const c=s;export{s as HighlightBox,c as default};
|
|
@@ -3,7 +3,11 @@
|
|
|
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-
|
|
6
|
+
* Compiled on: 2026-11-09T16:21:46.474Z
|
|
7
7
|
*/
|
|
8
8
|
/*! For license information please see HorizontalBookCard.js.LICENSE.txt */
|
|
9
|
-
import"react";var t={2694(t,e,n){var r=n(6925);function o(){}function i(){}i.resetWarningCache=o,t.exports=function(){function t(t,e,n,o,i,a){if(a!==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 e(){return t}t.isRequired=t;var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},5556(t,e,n){t.exports=n(2694)()},6925(t){t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}};const e={};function n(r){const o=e[r];if(void 0!==o)return o.exports;const i=e[r]={exports:{}};return t[r](i,i.exports,n),i.exports}n.n=t=>{const e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.cw=t=>{var e;return()=>{if(t){var n=t;t=0,e={exports:{}},n.call(e.exports,e,e.exports)}return e.exports}},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var r=n.cw(function(t,e){var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function o(t,e,r){var o=null;if(void 0!==r&&(o=""+r),void 0!==e.key&&(o=""+e.key),"key"in e)for(var i in r={},e)"key"!==i&&(r[i]=e[i]);else r=e;return e=r.ref,{$$typeof:n,type:t,key:o,ref:void 0!==e?e:null,props:r}}e.Fragment=r,e.jsx=o,e.jsxs=o}),o=n.cw(function(t,e){t.exports=r()}),i=n(5556),a=n.n(i);function l(t,e){this.v=t,this.k=e}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function s(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,l=[],c=!0,s=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==e);c=!0);}catch(t){s=!0,o=t}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}(t,e)||function(t,e){if(t){if("string"==typeof t)return c(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(t){var e,n;function r(e,n){try{var i=t[e](n),a=i.value,c=a instanceof l;Promise.resolve(c?a.v:a).then(function(n){if(c){var l="return"===e&&a.k?e:"next";if(!a.k||n.done)return r(l,n);n=t[l](n).value}o(!!i.done,n)},function(t){r("throw",t)})}catch(t){o(2,t)}}function o(t,o){2===t?e.reject(o):e.resolve({value:o,done:t}),(e=e.next)?r(e.key,e.arg):n=null}this._invoke=function(t,o){return new Promise(function(i,a){var l={key:t,arg:o,resolve:i,reject:a,next:null};n?n=n.next=l:(e=n=l,r(t,o))})},"function"!=typeof t.return&&(this.return=void 0)}u.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},u.prototype.next=function(t){return this._invoke("next",t)},u.prototype.throw=function(t){return this._invoke("throw",t)},u.prototype.return=function(t){return this._invoke("return",t)};const f=Object.entries,p=Object.setPrototypeOf,m=Object.isFrozen,d=Object.getPrototypeOf,h=Object.getOwnPropertyDescriptor;let y=Object.freeze,g=Object.seal,b=Object.create,T="undefined"!=typeof Reflect&&Reflect,S=T.apply,v=T.construct;y||(y=function(t){return t}),g||(g=function(t){return t}),S||(S=function(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return t.apply(e,r)}),v||(v=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return new t(...n)});const A=q(Array.prototype.forEach);Array.prototype.indexOf;const w=q(Array.prototype.lastIndexOf),x=q(Array.prototype.pop),_=q(Array.prototype.push),E=q(Array.prototype.slice),O=q(Array.prototype.splice),k=Array.isArray,N=$(Set),D=q(Set.prototype.add),C=q(Set.prototype.has),R=q(String.prototype.toLowerCase),I=q(String.prototype.toString),L=q(String.prototype.match),z=q(String.prototype.replace),P=q(String.prototype.indexOf),M=q(String.prototype.trim),j=q(Number.prototype.toString),U=q(Boolean.prototype.toString),F="undefined"==typeof BigInt?null:q(BigInt.prototype.toString),H="undefined"==typeof Symbol?null:q(Symbol.prototype.toString),B=q(Object.prototype.hasOwnProperty),W=q(Object.prototype.toString),Y=q(RegExp.prototype.test),G=$(TypeError);function q(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return S(t,e,r)}}function $(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return v(t,n)}}function V(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:R;if(p&&p(t,null),!k(e))return t;let r=e.length;for(;r--;){let o=e[r];if("string"==typeof o){const t=n(o);t!==o&&(m(e)||(e[r]=t),o=t)}t[o]=!0}return t}function X(t){for(let e=0;e<t.length;e++)B(t,e)||(t[e]=null);return t}function K(t){const e=b(null);for(const r of f(t)){var n=s(r,2);const o=n[0],i=n[1];B(t,o)&&(k(i)?e[o]=X(i):i&&"object"==typeof i&&i.constructor===Object?e[o]=K(i):e[o]=i)}return e}function Z(t,e){for(;null!==t;){const n=h(t,e);if(n){if(n.get)return q(n.get);if("function"==typeof n.value)return q(n.value)}t=d(t)}return function(){return null}}const J=y(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Q=y(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),tt=y(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),et=y(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),nt=y(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),rt=y(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),ot=y(["#text"]),it=y(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),at=y(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),lt=y(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),ct=y(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),st=g(/{{[\w\W]*|^[\w\W]*}}/g),ut=g(/<%[\w\W]*|^[\w\W]*%>/g),ft=g(/\${[\w\W]*/g),pt=g(/^data-[\-\w.\u00B7-\uFFFF]+$/),mt=g(/^aria-[\-\w]+$/),dt=g(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ht=g(/^(?:\w+script|data):/i),yt=g(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),gt=g(/^html$/i),bt=g(/^[a-z][.\w]*(-[.\w]+)+$/i),Tt=g(/<[/\w!]/g),St=g(/<[/\w]/g),vt=g(/<\/no(script|embed|frames)/i),At=g(/\/>/i),wt=y(V({},["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"])),xt=function(){return"undefined"==typeof window?null:window},_t=function(t,e,n,r){return B(t,e)&&k(t[e])?V(r.base?K(r.base):{},t[e],r.transform):n},Et=function(t,e,n){const r=B(t,e)?t[e]:void 0;return r&&"object"==typeof r?K(r):n()};var Ot=function t(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:xt();const n=e=>t(e);if(n.version="3.4.17",n.removed=[],!e||!e.document||9!==e.document.nodeType||!e.Element)return n.isSupported=!1,n;let r=e.document;const o=r,i=o.currentScript;e.DocumentFragment;const a=e.HTMLTemplateElement,l=e.Node,c=e.Element,s=e.NodeFilter;void 0===e.NamedNodeMap&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;const u=e.DOMParser,p=e.trustedTypes,m=c.prototype,T=Z(m,"cloneNode"),S=Z(m,"remove"),v=Z(m,"removeAttributeNode"),$=Z(m,"nextSibling"),X=Z(m,"childNodes"),Ot=Z(m,"parentNode"),kt=Z(m,"shadowRoot"),Nt=Z(m,"attributes"),Dt=l&&l.prototype?Z(l.prototype,"nodeType"):null,Ct=l&&l.prototype?Z(l.prototype,"nodeName"):null,Rt=l&&l.prototype?Z(l.prototype,"ownerDocument"):null,It=function(t){return Dt?Dt(t):t.nodeType},Lt=function(t){return Ct?Ct(t):t.nodeName},zt=function(t){for(;null!==t;){const e=h(t,"namespaceURI");if(e)return e.get?q(e.get):null;t=d(t)}return null}(m),Pt=function(t){return zt?zt(t):t.namespaceURI};if("function"==typeof a){const t=r.createElement("template");t.content&&t.content.ownerDocument&&(r=t.content.ownerDocument)}let Mt,jt,Ut="",Ft=!1,Ht=0;const Bt=function(){if(Ht>0)throw G('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},Wt=function(t){Bt(),Ht++;try{return Mt.createHTML(t)}finally{Ht--}},Yt=r,Gt=Yt.implementation,qt=Yt.createNodeIterator,$t=Yt.createDocumentFragment,Vt=Yt.getElementsByTagName,Xt=o.importNode;let Kt={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof f&&"function"==typeof Ot&&Gt&&void 0!==Gt.createHTMLDocument;const Zt=st,Jt=ut,Qt=ft,te=pt,ee=mt,ne=ht,re=yt,oe=bt;let ie=dt,ae=null;const le=V({},[...J,...Q,...tt,...nt,...ot]);let ce=null;const se=V({},[...it,...at,...lt,...ct]);let ue=Object.seal(b(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),fe=null,pe=null;const me=Object.seal(b(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let de=!0,he=!0,ye=!1,ge=!0,be=!1,Te=!0,Se=!1,ve=!1,Ae=null,we=null,xe=!1,_e=!1,Ee=!1,Oe=!1,ke=!0,Ne=!1;const De="user-content-";let Ce=!0,Re=!1,Ie=null,Le={},ze=null;const Pe=V({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Me=null;const je=V({},["audio","video","img","source","image","track"]);let Ue=null;const Fe=V({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),He="http://www.w3.org/1998/Math/MathML",Be="http://www.w3.org/2000/svg",We="http://www.w3.org/1999/xhtml";let Ye=We,Ge=!1,qe=null;const $e=V({},[He,Be,We],I),Ve=y(["mi","mo","mn","ms","mtext"]);let Xe=V({},Ve);const Ke=y(["annotation-xml"]);let Ze=V({},Ke);const Je=V({},["title","style","font","a","script"]);let Qe=null;const tn=["application/xhtml+xml","text/html"];let en=null,nn=null;const rn=r.createElement("form"),on=function(t){return t instanceof RegExp||t instanceof Function},an=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(nn&&nn===t)return;t&&"object"==typeof t||(t={}),t=K(t),Qe=-1===tn.indexOf(t.PARSER_MEDIA_TYPE)?"text/html":t.PARSER_MEDIA_TYPE,en="application/xhtml+xml"===Qe?I:R,ae=_t(t,"ALLOWED_TAGS",le,{transform:en}),ce=_t(t,"ALLOWED_ATTR",se,{transform:en}),qe=_t(t,"ALLOWED_NAMESPACES",$e,{transform:I}),Ue=_t(t,"ADD_URI_SAFE_ATTR",Fe,{transform:en,base:Fe}),Me=_t(t,"ADD_DATA_URI_TAGS",je,{transform:en,base:je}),ze=_t(t,"FORBID_CONTENTS",Pe,{transform:en}),fe=_t(t,"FORBID_TAGS",K({}),{transform:en}),pe=_t(t,"FORBID_ATTR",K({}),{transform:en}),Le=!!B(t,"USE_PROFILES")&&(t.USE_PROFILES&&"object"==typeof t.USE_PROFILES?K(t.USE_PROFILES):t.USE_PROFILES),de=!1!==t.ALLOW_ARIA_ATTR,he=!1!==t.ALLOW_DATA_ATTR,ye=t.ALLOW_UNKNOWN_PROTOCOLS||!1,ge=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,be=t.SAFE_FOR_TEMPLATES||!1,Te=!1!==t.SAFE_FOR_XML,Se=t.WHOLE_DOCUMENT||!1,_e=t.RETURN_DOM||!1,Ee=t.RETURN_DOM_FRAGMENT||!1,Oe=t.RETURN_TRUSTED_TYPE||!1,xe=t.FORCE_BODY||!1,ke=!1!==t.SANITIZE_DOM,Ne=t.SANITIZE_NAMED_PROPS||!1,Ce=!1!==t.KEEP_CONTENT,Re=t.IN_PLACE||!1,ie=function(t){try{return Y(t,""),!0}catch(t){return!1}}(t.ALLOWED_URI_REGEXP)?t.ALLOWED_URI_REGEXP:dt,Ye="string"==typeof t.NAMESPACE?t.NAMESPACE:We,Xe=Et(t,"MATHML_TEXT_INTEGRATION_POINTS",()=>V({},Ve)),Ze=Et(t,"HTML_INTEGRATION_POINTS",()=>V({},Ke));const e=Et(t,"CUSTOM_ELEMENT_HANDLING",()=>b(null));if(ue=b(null),B(e,"tagNameCheck")&&on(e.tagNameCheck)&&(ue.tagNameCheck=e.tagNameCheck),B(e,"attributeNameCheck")&&on(e.attributeNameCheck)&&(ue.attributeNameCheck=e.attributeNameCheck),B(e,"allowCustomizedBuiltInElements")&&"boolean"==typeof e.allowCustomizedBuiltInElements&&(ue.allowCustomizedBuiltInElements=e.allowCustomizedBuiltInElements),g(ue),be&&(he=!1),Ee&&(_e=!0),Le&&(ae=V({},ot),ce=b(null),!0===Le.html&&(V(ae,J),V(ce,it)),!0===Le.svg&&(V(ae,Q),V(ce,at),V(ce,ct)),!0===Le.svgFilters&&(V(ae,tt),V(ce,at),V(ce,ct)),!0===Le.mathMl&&(V(ae,nt),V(ce,lt),V(ce,ct))),me.tagCheck=null,me.attributeCheck=null,B(t,"ADD_TAGS")&&("function"==typeof t.ADD_TAGS?me.tagCheck=t.ADD_TAGS:k(t.ADD_TAGS)&&(ae===le&&(ae=K(ae)),V(ae,t.ADD_TAGS,en))),B(t,"ADD_ATTR")&&("function"==typeof t.ADD_ATTR?me.attributeCheck=t.ADD_ATTR:k(t.ADD_ATTR)&&(ce===se&&(ce=K(ce)),V(ce,t.ADD_ATTR,en))),B(t,"ADD_FORBID_CONTENTS")&&k(t.ADD_FORBID_CONTENTS)&&(ze===Pe&&(ze=K(ze)),V(ze,t.ADD_FORBID_CONTENTS,en)),Ce&&(ae["#text"]=!0),Se&&V(ae,["html","head","body"]),ae.table&&(V(ae,["tbody"]),delete fe.tbody),t.TRUSTED_TYPES_POLICY){if("function"!=typeof t.TRUSTED_TYPES_POLICY.createHTML)throw G('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof t.TRUSTED_TYPES_POLICY.createScriptURL)throw G('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const e=Mt;Mt=t.TRUSTED_TYPES_POLICY;try{Ut=Wt("")}catch(t){throw Mt=e,t}}else null===t.TRUSTED_TYPES_POLICY?(Mt=void 0,Ut=""):(void 0===Mt&&(Ft||(jt=function(t,e){if("object"!=typeof t||"function"!=typeof t.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";e&&e.hasAttribute(r)&&(n=e.getAttribute(r));const o="dompurify"+(n?"#"+n:"");try{return t.createPolicy(o,{createHTML:t=>t,createScriptURL:t=>t})}catch(t){return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(p,i),Ft=!0),Mt=jt),Mt&&"string"==typeof Ut&&(Ut=Wt("")));y&&y(t),nn=t},ln=V({},[...Q,...tt,...et]),cn=V({},[...nt,...rt]),sn=function(t){_(n.removed,{element:t});try{Ot(t).removeChild(t)}catch(e){if(S(t),!Ot(t))throw G("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},un=function(t,e,n){try{v(t,e)}catch(e){try{t.removeAttribute(n)}catch(t){}}},fn=function(t){hn(t);const e=X(t);e&&A(E(e),t=>{try{S(t)}catch(t){}});const n=1===It(t)?Nt(t):null;if(n)for(let e=n.length-1;e>=0;--e){const r=n[e],o=r&&r.name;"string"==typeof o&&un(t,r,o)}},pn=function(t,e,r){if(!r)try{r=e.getAttributeNode(t)}catch(t){r=null}_(n.removed,{attribute:r||null,from:e});try{r?v(e,r):e.removeAttribute(t)}catch(n){try{e.removeAttribute(t)}catch(t){}}if("is"===t)if(_e||Ee)try{sn(e)}catch(t){}else try{e.setAttribute(t,"")}catch(t){}},mn=function(t){const e=Nt(t);if(e)for(let n=e.length-1;n>=0;--n){const r=e[n],o=r&&r.name;"string"!=typeof o||ce[en(o)]||un(t,r,o)}},dn=function(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=[t];for(;r.length>0;){const t=r.pop();if(!1===e(t))continue;if(n&&1===It(t)){const e=kt(t);En(e)&&r.push(e)}const o=X(t);if(o)for(let t=o.length-1;t>=0;--t)r.push(o[t])}},hn=function(t){dn(t,t=>{1===It(t)&&mn(t)})},yn=function(t){const e=[];return dn(t,t=>{e.push(t)},!0),e},gn=function(t,e){let r=!1;return A(n.removed,e=>{e.element&&(r=r||e.element===t,hn(e.element))}),function(t,e){const n=N();A(yn(t),t=>{1===It(t)&&D(n,t)}),A(e,t=>{1!==It(t)||C(n,t)||mn(t)})}(t,e),r},bn=function(t,e,n,r){const o=vn(t);let i;for(;i=o.nextNode();)C(r,i)&&!C(Ie,i)&&(e&&kn(Kt.uponSanitizeShadowNode,i,null),Rn(i,n),Un(i,n),En(i.content)&&Fn(i.content))},Tn=function(t,e){return!!Te&&("patchsrc"===t||"for"===t&&"label"!==e&&"output"!==e)},Sn=function(t){let e=null,n=null;if(xe)t="<remove></remove>"+t;else{const e=L(t,/^[\r\n\t ]+/);n=e&&e[0]}"application/xhtml+xml"===Qe&&Ye===We&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");const o=Mt?Wt(t):t;if(Ye===We)try{e=(new u).parseFromString(o,Qe)}catch(t){}if(!e||!e.documentElement){e=Gt.createDocument(Ye,"template",null);try{e.documentElement.innerHTML=Ge?Ut:o}catch(t){}}const i=e.body||e.documentElement;return t&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),Ye===We?Vt.call(e,Se?"html":"body")[0]:Se?e.documentElement:i},vn=function(t){const e=Rt?Rt(t):t.ownerDocument;return qt.call(e||t,t,s.SHOW_ELEMENT|s.SHOW_COMMENT|s.SHOW_TEXT|s.SHOW_PROCESSING_INSTRUCTION|s.SHOW_CDATA_SECTION,null)},An=function(t){return t=z(t,Zt," "),t=z(t,Jt," "),z(t,Qt," ")},wn=function(t){var e;xn(t);const n=null===(e=t.querySelectorAll)||void 0===e?void 0:e.call(t,"template");n&&A(n,t=>{En(t.content)&&wn(t.content)})},xn=function(t){t.normalize();const e=Rt?Rt(t):t.ownerDocument,n=qt.call(e||t,t,s.SHOW_TEXT|s.SHOW_COMMENT|s.SHOW_CDATA_SECTION|s.SHOW_PROCESSING_INSTRUCTION,null);let r=n.nextNode();for(;r;)r.data=An(r.data),r=n.nextNode()},_n=function(t){const e=Ct?Ct(t):null;return"string"==typeof e&&"form"===en(e)&&("string"!=typeof t.nodeName||"string"!=typeof t.textContent||"function"!=typeof t.removeChild||t.attributes!==Nt(t)||"function"!=typeof t.removeAttribute||"function"!=typeof t.removeAttributeNode||"function"!=typeof t.getAttributeNode||"function"!=typeof t.setAttribute||"string"!=typeof t.namespaceURI||"function"!=typeof t.insertBefore||"function"!=typeof t.hasChildNodes||t.nodeType!==Dt(t)||t.childNodes!==X(t))},En=function(t){if(!Dt||"object"!=typeof t||null===t)return!1;try{return 11===Dt(t)}catch(t){return!1}},On=function(t){if(!Dt||"object"!=typeof t||null===t)return!1;try{return"number"==typeof Dt(t)}catch(t){return!1}};function kn(t,e,r){0!==t.length&&A(t,t=>{t.call(n,e,r,nn)})}const Nn=function(t,e){if(t instanceof RegExp)return Y(t,e);if(t instanceof Function){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return Boolean(t(e,...r))}return!1},Dn=function(t,e,n,r){return 0===t.length?e:e===n||e===r?K(e):e},Cn=function(t,e){return t!==e&&null===Ot(t)&&(Re&&hn(t),!0)},Rn=function(t,e){if(Ie&&D(Ie,t),kn(Kt.beforeSanitizeElements,t,null),Cn(t,e))return!0;if(_n(t))return sn(t),!0;const r=en(Lt(t));if(ae=Dn(Kt.uponSanitizeElement,ae,le,Ae),kn(Kt.uponSanitizeElement,t,{tagName:r,allowedTags:ae}),Cn(t,e))return!0;if(function(t,e){return!!(Te&&t.hasChildNodes()&&!On(t.firstElementChild)&&Y(Tt,t.textContent)&&Y(Tt,t.innerHTML))||!!(Te&&wt[e]&&1===It(t)&&Pt(t)===We&&(On(t.firstElementChild)||"string"==typeof t.textContent&&Y(Tt,t.textContent)))||7===t.nodeType||!(!Te||8!==t.nodeType||!Y(St,t.data))}(t,r))return sn(t),!0;if(fe[r]||!(me.tagCheck instanceof Function&&me.tagCheck(r))&&!ae[r]){const n=function(t,e,n){if(!fe[e]&&zn(e)&&Nn(ue.tagNameCheck,e))return!1;if(Ce&&!ze[e]&&!ze[R(e)]){const e=Ot(t),r=X(t);if(r&&e)for(let o=r.length-1;o>=0;--o){const i=t===n?T(r[o],!0):r[o];e.insertBefore(i,$(t))}}return sn(t),!0}(t,r,e);return!(!1!==n||(kn(Kt.afterSanitizeElements,t,null),!Cn(t,e)))||n}if(1===It(t)&&!function(t){const e=Pt(t),n=R(Lt(t)),r=Ot(t);let o,i;return r&&1===It(r)?(o={namespaceURI:Pt(r)},i=R(Lt(r))):(o={namespaceURI:Ye},i="template"),!!qe[e]&&(e===Be?function(t,e,n){return e.namespaceURI===We?"svg"===t:e.namespaceURI===He?"svg"===t&&("annotation-xml"===n||Xe[n]):Boolean(ln[t])}(n,o,i):e===He?function(t,e,n){return e.namespaceURI===We?"math"===t:e.namespaceURI===Be?"math"===t&&Ze[n]:Boolean(cn[t])}(n,o,i):e===We?function(t,e,n){return!(e.namespaceURI===Be&&!Ze[n])&&!(e.namespaceURI===He&&!Xe[n])&&!cn[t]&&(Je[t]||!ln[t])}(n,o,i):!("application/xhtml+xml"!==Qe||!qe[e]))}(t))return sn(t),!0;if(("noscript"===r||"noembed"===r||"noframes"===r)&&Y(vt,t.innerHTML))return sn(t),!0;if(be&&3===t.nodeType){const e=An(t.textContent);t.textContent!==e&&(_(n.removed,{element:t.cloneNode()}),t.textContent=e)}return kn(Kt.afterSanitizeElements,t,null),Cn(t,e)},In=function(t,e,n){if(pe[e])return!1;if(Tn(e,t))return!1;if(ke&&("id"===e||"name"===e)&&(n in r||n in rn))return!1;const o=ce[e]||me.attributeCheck instanceof Function&&me.attributeCheck(e,t);return!(!he||!Y(te,e))||!(!de||!Y(ee,e))||(o?!(!Ue[e]&&!Y(ie,z(n,re,""))&&("src"!==e&&"xlink:href"!==e&&"href"!==e||"script"===t||0!==P(n,"data:")||!Me[t])&&(!ye||Y(ne,z(n,re,"")))&&n):zn(t)&&Nn(ue.tagNameCheck,t)&&Nn(ue.attributeNameCheck,e,t)||"is"===e&&ue.allowCustomizedBuiltInElements&&Nn(ue.tagNameCheck,n))},Ln=V({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),zn=function(t){return!Ln[R(t)]&&Y(oe,t)},Pn=function(t,e,n,r){if(Mt&&"object"==typeof p&&"function"==typeof p.getAttributeType&&!n)switch(p.getAttributeType(t,e)){case"TrustedHTML":return Wt(r);case"TrustedScriptURL":return function(t){Bt(),Ht++;try{return Mt.createScriptURL(t)}finally{Ht--}}(r)}return r},Mn=function(t,e,n,r){try{return n?t.setAttributeNS(n,e,r):t.setAttribute(e,r),!_n(t)||(sn(t),!1)}catch(n){return pn(e,t),!1}},jn=function(t,e){return!(!Te||!Y(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,e))||"attributename"===R(t)&&null!==L(e,"href")},Un=function(t,e){if(kn(Kt.beforeSanitizeAttributes,t,null),Cn(t,e))return;const r=t.attributes;if(!r||_n(t))return;ce=Dn(Kt.uponSanitizeAttribute,ce,se,we);const o={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ce,forceKeepAttr:void 0};let i=r.length;const a=en(t.nodeName);for(;i--;){const e=r[i],l=e.name,c=e.namespaceURI,s=e.value,u=en(l),f=s;let p="value"===l?f:M(f),m=!1;o.attrName=u,o.attrValue=p,o.keepAttr=!0,o.forceKeepAttr=void 0,kn(Kt.uponSanitizeAttribute,t,o),p=o.attrValue,!Ne||"id"!==u&&"name"!==u||0===P(p,De)||(pn(l,t,e),p=De+p,m=!0),jn(l,p)?pn(l,t,e):o.forceKeepAttr||(!o.keepAttr||!ge&&Y(At,p)?pn(l,t,e):(be&&(p=An(p)),In(a,u,p)?(p=Pn(a,u,c,p),p!==f&&Mn(t,l,c,p)&&m&&x(n.removed)):pn(l,t,e)))}kn(Kt.afterSanitizeAttributes,t,null),Cn(t,e)},Fn=function(t){let e=null;const n=vn(t);for(kn(Kt.beforeSanitizeShadowDOM,t,null);e=n.nextNode();)if(kn(Kt.uponSanitizeShadowNode,e,null),Rn(e,t),Un(e,t),En(e.content)&&Fn(e.content),1===It(e)){const t=kt(e);En(t)&&(Hn(t),Fn(t))}be&&xn(t),kn(Kt.afterSanitizeShadowDOM,t,null)},Hn=function(t){const e=[{node:t,shadow:null}];for(;e.length>0;){const t=e.pop();if(t.shadow){Fn(t.shadow);continue}const n=t.node,r=1===It(n),o=X(n);if(o)for(let t=o.length-1;t>=0;--t)e.push({node:o[t],shadow:null});if(r){const t=Ct?Ct(n):null;if("string"==typeof t&&"template"===en(t)){const t=n.content;En(t)&&e.push({node:t,shadow:null})}}if(r){const t=kt(n);En(t)&&e.push({node:null,shadow:t},{node:t,shadow:null})}}};return n.sanitize=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,i=null,a=null,l=null;if(Ge=!t,Ge&&(t="\x3c!--\x3e"),"string"!=typeof t&&!On(t)&&"string"!=typeof(t=function(t){switch(typeof t){case"string":return t;case"number":return j(t);case"boolean":return U(t);case"bigint":return F?F(t):"0";case"symbol":return H?H(t):"Symbol()";case"undefined":default:return W(t);case"function":case"object":{if(null===t)return W(t);const e=t,n=Z(e,"toString");if("function"==typeof n){const t=n(e);return"string"==typeof t?t:W(t)}return W(t)}}}(t)))throw G("dirty is not a string, aborting");if(!n.isSupported)return t;ve?(ae=Ae,ce=we):an(e),(Kt.uponSanitizeElement.length>0||Kt.uponSanitizeAttribute.length>0)&&(ae=K(ae)),Kt.uponSanitizeAttribute.length>0&&(ce=K(ce)),n.removed=[];const c=Re&&"string"!=typeof t&&On(t);let s=[];const u=Ie;if(c){Te&&dn(t,t=>{const e=It(t);if(7===e||8===e&&Y(St,t.data)){try{S(t)}catch(t){}return!1}if(1===e){const e=t,n=en(Lt(t));try{e.hasAttribute&&e.hasAttribute("patchsrc")&&e.removeAttribute("patchsrc"),e.hasAttribute&&e.hasAttribute("for")&&Tn("for",n)&&e.removeAttribute("for")}catch(t){}}return!0});const e=Lt(t);if("string"==typeof e){const n=en(e);if(!ae[n]||fe[n])throw fn(t),G("root node is forbidden and cannot be sanitized in-place")}if(_n(t))throw fn(t),G("root node is clobbered and cannot be sanitized in-place");s=yn(t),Ie=N()}else if(On(t))r=Sn("\x3c!----\x3e"),i=r.ownerDocument.importNode(t,!0),1===i.nodeType&&"BODY"===i.nodeName||"HTML"===i.nodeName?r=i:r.appendChild(i),Hn(r);else{if(!_e&&!be&&!Se&&-1===t.indexOf("<"))return Mt&&Oe?Wt(t):t;if(r=Sn(t),!r)return _e?null:Oe?Ut:""}r&&xe&&sn(r.firstChild);const f=c?t:r;try{c&&Hn(t);const e=vn(f);for(;a=e.nextNode();)Rn(a,f),Un(a,f),En(a.content)&&Fn(a.content);c&&function(t,e){const n=Ie;let r=null;const o=()=>(r||(r=N(),A(e,t=>{D(r,t)})),r);for(let e=0;;e++){const r=yn(t),i=[t];let a=!1;if(A(r,t=>{11===It(t)?_(i,t):a||C(n,t)||(a=C(o(),t))}),!a)return;if(e>=8)throw G("the tree kept changing during in-place sanitization; refusing to return it");A(i,(e,n)=>{bn(e,n>0,t,o())})}}(t,s)}catch(e){throw c&&(fn(t),gn(t,s)),e}finally{Ie=u}if(c){if(gn(t,s))throw G("a node selected for removal could not be safely returned; refusing to sanitize in place");return be&&wn(t),t}if(_e){if(be&&wn(r),Ee)for(l=$t.call(r.ownerDocument);r.firstChild;)l.appendChild(r.firstChild);else l=r;return(ce.shadowroot||ce.shadowrootmode)&&(l=Xt.call(o,l,!0)),l}let p=Se?r.outerHTML:r.innerHTML;return Se&&ae["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&Y(gt,r.ownerDocument.doctype.name)&&(p="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+p),be&&(p=An(p)),Mt&&Oe?Wt(p):p},n.setConfig=function(){an(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),ve=!0,Ae=ae,we=ce},n.clearConfig=function(){nn=null,ve=!1,Ae=null,we=null,Mt=jt,Ut=""},n.isValidAttribute=function(t,e,n){nn||an({});const r=en(t),o=en(e);return("string"!=typeof n||!(jn(e,n)||!ge&&Y(At,n)))&&In(r,o,n)},n.addHook=function(t,e){"function"==typeof e&&B(Kt,t)&&_(Kt[t],e)},n.removeHook=function(t,e){if(B(Kt,t)){if(void 0!==e){const n=w(Kt[t],e);return-1===n?void 0:O(Kt[t],n,1)[0]}return x(Kt[t])}},n.removeHooks=function(t){B(Kt,t)&&(Kt[t]=[])},n.removeAllHooks=function(){Kt={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}();function kt({label:t,Type:e="Primary",Variant:n="Default",Outline:o=!1,State:i="Default",href:a="#",onClick:l,className:c,...s}){const u="Disabled"===i,f=["mg-button","CTA"===n&&"mg-button-cta","mg-button-"+("Secondary"===e?"secondary":"primary"),o&&"mg-button-outline",u&&"disabled",c].filter(Boolean).join(" ");return(0,r().jsx)("a",{className:f,...s,...u?{"aria-disabled":"true",tabIndex:-1}:{href:a,onClick:l},children:t})}function Nt(t){return"string"==typeof t&&""!==t.trim()?t:null}function Dt({title:t,link:e=null,target:n,rel:o}){const i=t?.trim();return(0,r().jsx)("header",{className:"mg-card__title",children:e?(0,r().jsx)("a",{href:e,target:n,rel:o,children:i}):i})}function Ct({label:t,link:e=null}){return t?e?(0,r().jsx)("a",{href:e,className:"mg-card__label mg-card__label--active",children:t}):(0,r().jsx)("span",{className:"mg-card__label",children:t}):null}o(),kt.propTypes={label:a().string.isRequired,Type:a().oneOf(["Primary","Secondary"]),Variant:a().oneOf(["Default","CTA"]),Outline:a().bool,State:a().oneOf(["Default","Disabled"]),href:a().string,onClick:a().func,className:a().string},Dt.propTypes={title:a().string,link:a().string,target:a().string,rel:a().string},Ct.propTypes={label:a().string,link:a().string};const Rt=(...t)=>t.filter(Boolean).length>0?t.filter(Boolean).join(" "):null;function It({data:t,variant:e="primary",className:n}){const o=e&&"primary"!==e?`mg-card--${e}`:null;return(0,r().jsx)(r().Fragment,{children:t.map((t,e)=>{const i=Nt(t.link),a=Nt(t.buttonLink)??i;return(0,r().jsxs)("article",{className:Rt("mg-card","mg-card__hc","mg-card-book__hc",o,!i&&"mg-card--no-link",n),children:[t.imgback&&(0,r().jsx)("div",{className:"mg-card__visual",children:(0,r().jsx)("img",{src:t.imgback,alt:t.imgalt,className:"mg-card__image"})}),(0,r().jsxs)("div",{className:"mg-card__content",children:[(t.label1||t.label2)&&(0,r().jsxs)("div",{className:"mg-card__meta",children:[(0,r().jsx)(Ct,{label:t.label1,link:i}),(0,r().jsx)(Ct,{label:t.label2,link:i})]}),(0,r().jsx)(Dt,{title:t.title,link:i,target:t.target,rel:t.rel}),t.summaryText&&(0,r().jsx)("p",{className:"mg-card__summary",dangerouslySetInnerHTML:{__html:Ot.sanitize(t.summaryText)}}),t.button&&a&&(0,r().jsx)(kt,{Type:"Primary",Variant:"CTA",label:t.button,href:a,target:t.target,rel:t.rel})]})]},e)})})}It.propTypes={data:a().array.isRequired,variant:a().oneOf(["primary","secondary","tertiary","quaternary"]),className:a().string};export{It as HorizontalBookCard};
|
|
9
|
+
import"react";var t={2694(t,e,n){var r=n(6925);function o(){}function i(){}i.resetWarningCache=o,t.exports=function(){function t(t,e,n,o,i,a){if(a!==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 e(){return t}t.isRequired=t;var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},5556(t,e,n){t.exports=n(2694)()},6925(t){t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}};const e={};function n(r){const o=e[r];if(void 0!==o)return o.exports;const i=e[r]={exports:{}};return t[r](i,i.exports,n),i.exports}n.n=t=>{const e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.cw=t=>{var e;return()=>{if(t){var n=t;t=0,e={exports:{}},n.call(e.exports,e,e.exports)}return e.exports}},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var r=/*#__PURE__*/n.cw((t,e)=>{var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function o(t,e,r){var o=null;if(void 0!==r&&(o=""+r),void 0!==e.key&&(o=""+e.key),"key"in e)for(var i in r={},e)"key"!==i&&(r[i]=e[i]);else r=e;return e=r.ref,{$$typeof:n,type:t,key:o,ref:void 0!==e?e:null,props:r}}e.Fragment=r,e.jsx=o,e.jsxs=o}),o=/*#__PURE__*/n.cw(t=>{t.exports=r()}),i=/*#__PURE__*/n(5556),a=/*#__PURE__*/n.n(i);function l(t,e){this.v=t,this.k=e}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function s(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,l=[],c=!0,s=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==e);c=!0);}catch(t){s=!0,o=t}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}(t,e)||function(t,e){if(t){if("string"==typeof t)return c(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(t){var e,n;function r(e,n){try{var i=t[e](n),a=i.value,c=a instanceof l;Promise.resolve(c?a.v:a).then(function(n){if(c){var l="return"===e&&a.k?e:"next";if(!a.k||n.done)return r(l,n);n=t[l](n).value}o(!!i.done,n)},function(t){r("throw",t)})}catch(t){o(2,t)}}function o(t,o){2===t?e.reject(o):e.resolve({value:o,done:t}),(e=e.next)?r(e.key,e.arg):n=null}this._invoke=function(t,o){return new Promise(function(i,a){var l={key:t,arg:o,resolve:i,reject:a,next:null};n?n=n.next=l:(e=n=l,r(t,o))})},"function"!=typeof t.return&&(this.return=void 0)}u.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},u.prototype.next=function(t){return this._invoke("next",t)},u.prototype.throw=function(t){return this._invoke("throw",t)},u.prototype.return=function(t){return this._invoke("return",t)};const f=Object.entries,p=Object.setPrototypeOf,m=Object.isFrozen,d=Object.getPrototypeOf,h=Object.getOwnPropertyDescriptor;let y=Object.freeze,g=Object.seal,b=Object.create,T="undefined"!=typeof Reflect&&Reflect,S=T.apply,v=T.construct;y||(y=function(t){return t}),g||(g=function(t){return t}),S||(S=function(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return t.apply(e,r)}),v||(v=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return new t(...n)});const A=q(Array.prototype.forEach);Array.prototype.indexOf;const w=q(Array.prototype.lastIndexOf),x=q(Array.prototype.pop),_=q(Array.prototype.push),E=q(Array.prototype.slice),O=q(Array.prototype.splice),k=Array.isArray,N=$(Set),D=q(Set.prototype.add),C=q(Set.prototype.has),R=q(String.prototype.toLowerCase),I=q(String.prototype.toString),L=q(String.prototype.match),z=q(String.prototype.replace),P=q(String.prototype.indexOf),M=q(String.prototype.trim),j=q(Number.prototype.toString),U=q(Boolean.prototype.toString),F="undefined"==typeof BigInt?null:q(BigInt.prototype.toString),H="undefined"==typeof Symbol?null:q(Symbol.prototype.toString),B=q(Object.prototype.hasOwnProperty),W=q(Object.prototype.toString),Y=q(RegExp.prototype.test),G=$(TypeError);function q(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return S(t,e,r)}}function $(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return v(t,n)}}function V(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:R;if(p&&p(t,null),!k(e))return t;let r=e.length;for(;r--;){let o=e[r];if("string"==typeof o){const t=n(o);t!==o&&(m(e)||(e[r]=t),o=t)}t[o]=!0}return t}function X(t){for(let e=0;e<t.length;e++)B(t,e)||(t[e]=null);return t}function K(t){const e=b(null);for(const r of f(t)){var n=s(r,2);const o=n[0],i=n[1];B(t,o)&&(k(i)?e[o]=X(i):i&&"object"==typeof i&&i.constructor===Object?e[o]=K(i):e[o]=i)}return e}function Z(t,e){for(;null!==t;){const n=h(t,e);if(n){if(n.get)return q(n.get);if("function"==typeof n.value)return q(n.value)}t=d(t)}return function(){return null}}const J=y(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Q=y(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),tt=y(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),et=y(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),nt=y(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),rt=y(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),ot=y(["#text"]),it=y(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),at=y(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),lt=y(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),ct=y(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),st=g(/{{[\w\W]*|^[\w\W]*}}/g),ut=g(/<%[\w\W]*|^[\w\W]*%>/g),ft=g(/\${[\w\W]*/g),pt=g(/^data-[\-\w.\u00B7-\uFFFF]+$/),mt=g(/^aria-[\-\w]+$/),dt=g(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ht=g(/^(?:\w+script|data):/i),yt=g(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),gt=g(/^html$/i),bt=g(/^[a-z][.\w]*(-[.\w]+)+$/i),Tt=g(/<[/\w!]/g),St=g(/<[/\w]/g),vt=g(/<\/no(script|embed|frames)/i),At=g(/\/>/i),wt=y(V({},["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"])),xt=function(){return"undefined"==typeof window?null:window},_t=function(t,e,n,r){return B(t,e)&&k(t[e])?V(r.base?K(r.base):{},t[e],r.transform):n},Et=function(t,e,n){const r=B(t,e)?t[e]:void 0;return r&&"object"==typeof r?K(r):n()};var Ot=function t(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:xt();const n=e=>t(e);if(n.version="3.4.17",n.removed=[],!e||!e.document||9!==e.document.nodeType||!e.Element)return n.isSupported=!1,n;let r=e.document;const o=r,i=o.currentScript;e.DocumentFragment;const a=e.HTMLTemplateElement,l=e.Node,c=e.Element,s=e.NodeFilter;void 0===e.NamedNodeMap&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;const u=e.DOMParser,p=e.trustedTypes,m=c.prototype,T=Z(m,"cloneNode"),S=Z(m,"remove"),v=Z(m,"removeAttributeNode"),$=Z(m,"nextSibling"),X=Z(m,"childNodes"),Ot=Z(m,"parentNode"),kt=Z(m,"shadowRoot"),Nt=Z(m,"attributes"),Dt=l&&l.prototype?Z(l.prototype,"nodeType"):null,Ct=l&&l.prototype?Z(l.prototype,"nodeName"):null,Rt=l&&l.prototype?Z(l.prototype,"ownerDocument"):null,It=function(t){return Dt?Dt(t):t.nodeType},Lt=function(t){return Ct?Ct(t):t.nodeName},zt=function(t){for(;null!==t;){const e=h(t,"namespaceURI");if(e)return e.get?q(e.get):null;t=d(t)}return null}(m),Pt=function(t){return zt?zt(t):t.namespaceURI};if("function"==typeof a){const t=r.createElement("template");t.content&&t.content.ownerDocument&&(r=t.content.ownerDocument)}let Mt,jt,Ut="",Ft=!1,Ht=0;const Bt=function(){if(Ht>0)throw G('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},Wt=function(t){Bt(),Ht++;try{return Mt.createHTML(t)}finally{Ht--}},Yt=r,Gt=Yt.implementation,qt=Yt.createNodeIterator,$t=Yt.createDocumentFragment,Vt=Yt.getElementsByTagName,Xt=o.importNode;let Kt={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof f&&"function"==typeof Ot&&Gt&&void 0!==Gt.createHTMLDocument;const Zt=st,Jt=ut,Qt=ft,te=pt,ee=mt,ne=ht,re=yt,oe=bt;let ie=dt,ae=null;const le=V({},[...J,...Q,...tt,...nt,...ot]);let ce=null;const se=V({},[...it,...at,...lt,...ct]);let ue=Object.seal(b(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),fe=null,pe=null;const me=Object.seal(b(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let de=!0,he=!0,ye=!1,ge=!0,be=!1,Te=!0,Se=!1,ve=!1,Ae=null,we=null,xe=!1,_e=!1,Ee=!1,Oe=!1,ke=!0,Ne=!1;const De="user-content-";let Ce=!0,Re=!1,Ie=null,Le={},ze=null;const Pe=V({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Me=null;const je=V({},["audio","video","img","source","image","track"]);let Ue=null;const Fe=V({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),He="http://www.w3.org/1998/Math/MathML",Be="http://www.w3.org/2000/svg",We="http://www.w3.org/1999/xhtml";let Ye=We,Ge=!1,qe=null;const $e=V({},[He,Be,We],I),Ve=y(["mi","mo","mn","ms","mtext"]);let Xe=V({},Ve);const Ke=y(["annotation-xml"]);let Ze=V({},Ke);const Je=V({},["title","style","font","a","script"]);let Qe=null;const tn=["application/xhtml+xml","text/html"];let en=null,nn=null;const rn=r.createElement("form"),on=function(t){return t instanceof RegExp||t instanceof Function},an=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(nn&&nn===t)return;t&&"object"==typeof t||(t={}),t=K(t),Qe=-1===tn.indexOf(t.PARSER_MEDIA_TYPE)?"text/html":t.PARSER_MEDIA_TYPE,en="application/xhtml+xml"===Qe?I:R,ae=_t(t,"ALLOWED_TAGS",le,{transform:en}),ce=_t(t,"ALLOWED_ATTR",se,{transform:en}),qe=_t(t,"ALLOWED_NAMESPACES",$e,{transform:I}),Ue=_t(t,"ADD_URI_SAFE_ATTR",Fe,{transform:en,base:Fe}),Me=_t(t,"ADD_DATA_URI_TAGS",je,{transform:en,base:je}),ze=_t(t,"FORBID_CONTENTS",Pe,{transform:en}),fe=_t(t,"FORBID_TAGS",K({}),{transform:en}),pe=_t(t,"FORBID_ATTR",K({}),{transform:en}),Le=!!B(t,"USE_PROFILES")&&(t.USE_PROFILES&&"object"==typeof t.USE_PROFILES?K(t.USE_PROFILES):t.USE_PROFILES),de=!1!==t.ALLOW_ARIA_ATTR,he=!1!==t.ALLOW_DATA_ATTR,ye=t.ALLOW_UNKNOWN_PROTOCOLS||!1,ge=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,be=t.SAFE_FOR_TEMPLATES||!1,Te=!1!==t.SAFE_FOR_XML,Se=t.WHOLE_DOCUMENT||!1,_e=t.RETURN_DOM||!1,Ee=t.RETURN_DOM_FRAGMENT||!1,Oe=t.RETURN_TRUSTED_TYPE||!1,xe=t.FORCE_BODY||!1,ke=!1!==t.SANITIZE_DOM,Ne=t.SANITIZE_NAMED_PROPS||!1,Ce=!1!==t.KEEP_CONTENT,Re=t.IN_PLACE||!1,ie=function(t){try{return Y(t,""),!0}catch(t){return!1}}(t.ALLOWED_URI_REGEXP)?t.ALLOWED_URI_REGEXP:dt,Ye="string"==typeof t.NAMESPACE?t.NAMESPACE:We,Xe=Et(t,"MATHML_TEXT_INTEGRATION_POINTS",()=>V({},Ve)),Ze=Et(t,"HTML_INTEGRATION_POINTS",()=>V({},Ke));const e=Et(t,"CUSTOM_ELEMENT_HANDLING",()=>b(null));if(ue=b(null),B(e,"tagNameCheck")&&on(e.tagNameCheck)&&(ue.tagNameCheck=e.tagNameCheck),B(e,"attributeNameCheck")&&on(e.attributeNameCheck)&&(ue.attributeNameCheck=e.attributeNameCheck),B(e,"allowCustomizedBuiltInElements")&&"boolean"==typeof e.allowCustomizedBuiltInElements&&(ue.allowCustomizedBuiltInElements=e.allowCustomizedBuiltInElements),g(ue),be&&(he=!1),Ee&&(_e=!0),Le&&(ae=V({},ot),ce=b(null),!0===Le.html&&(V(ae,J),V(ce,it)),!0===Le.svg&&(V(ae,Q),V(ce,at),V(ce,ct)),!0===Le.svgFilters&&(V(ae,tt),V(ce,at),V(ce,ct)),!0===Le.mathMl&&(V(ae,nt),V(ce,lt),V(ce,ct))),me.tagCheck=null,me.attributeCheck=null,B(t,"ADD_TAGS")&&("function"==typeof t.ADD_TAGS?me.tagCheck=t.ADD_TAGS:k(t.ADD_TAGS)&&(ae===le&&(ae=K(ae)),V(ae,t.ADD_TAGS,en))),B(t,"ADD_ATTR")&&("function"==typeof t.ADD_ATTR?me.attributeCheck=t.ADD_ATTR:k(t.ADD_ATTR)&&(ce===se&&(ce=K(ce)),V(ce,t.ADD_ATTR,en))),B(t,"ADD_FORBID_CONTENTS")&&k(t.ADD_FORBID_CONTENTS)&&(ze===Pe&&(ze=K(ze)),V(ze,t.ADD_FORBID_CONTENTS,en)),Ce&&(ae["#text"]=!0),Se&&V(ae,["html","head","body"]),ae.table&&(V(ae,["tbody"]),delete fe.tbody),t.TRUSTED_TYPES_POLICY){if("function"!=typeof t.TRUSTED_TYPES_POLICY.createHTML)throw G('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof t.TRUSTED_TYPES_POLICY.createScriptURL)throw G('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const e=Mt;Mt=t.TRUSTED_TYPES_POLICY;try{Ut=Wt("")}catch(t){throw Mt=e,t}}else null===t.TRUSTED_TYPES_POLICY?(Mt=void 0,Ut=""):(void 0===Mt&&(Ft||(jt=function(t,e){if("object"!=typeof t||"function"!=typeof t.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";e&&e.hasAttribute(r)&&(n=e.getAttribute(r));const o="dompurify"+(n?"#"+n:"");try{return t.createPolicy(o,{createHTML:t=>t,createScriptURL:t=>t})}catch(t){return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(p,i),Ft=!0),Mt=jt),Mt&&"string"==typeof Ut&&(Ut=Wt("")));y&&y(t),nn=t},ln=V({},[...Q,...tt,...et]),cn=V({},[...nt,...rt]),sn=function(t){_(n.removed,{element:t});try{Ot(t).removeChild(t)}catch(e){if(S(t),!Ot(t))throw G("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},un=function(t,e,n){try{v(t,e)}catch(e){try{t.removeAttribute(n)}catch(t){}}},fn=function(t){hn(t);const e=X(t);e&&A(E(e),t=>{try{S(t)}catch(t){}});const n=1===It(t)?Nt(t):null;if(n)for(let e=n.length-1;e>=0;--e){const r=n[e],o=r&&r.name;"string"==typeof o&&un(t,r,o)}},pn=function(t,e,r){if(!r)try{r=e.getAttributeNode(t)}catch(t){r=null}_(n.removed,{attribute:r||null,from:e});try{r?v(e,r):e.removeAttribute(t)}catch(n){try{e.removeAttribute(t)}catch(t){}}if("is"===t)if(_e||Ee)try{sn(e)}catch(t){}else try{e.setAttribute(t,"")}catch(t){}},mn=function(t){const e=Nt(t);if(e)for(let n=e.length-1;n>=0;--n){const r=e[n],o=r&&r.name;"string"!=typeof o||ce[en(o)]||un(t,r,o)}},dn=function(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=[t];for(;r.length>0;){const t=r.pop();if(!1===e(t))continue;if(n&&1===It(t)){const e=kt(t);En(e)&&r.push(e)}const o=X(t);if(o)for(let t=o.length-1;t>=0;--t)r.push(o[t])}},hn=function(t){dn(t,t=>{1===It(t)&&mn(t)})},yn=function(t){const e=[];return dn(t,t=>{e.push(t)},!0),e},gn=function(t,e){let r=!1;return A(n.removed,e=>{e.element&&(r=r||e.element===t,hn(e.element))}),function(t,e){const n=N();A(yn(t),t=>{1===It(t)&&D(n,t)}),A(e,t=>{1!==It(t)||C(n,t)||mn(t)})}(t,e),r},bn=function(t,e,n,r){const o=vn(t);let i;for(;i=o.nextNode();)C(r,i)&&!C(Ie,i)&&(e&&kn(Kt.uponSanitizeShadowNode,i,null),Rn(i,n),Un(i,n),En(i.content)&&Fn(i.content))},Tn=function(t,e){return!!Te&&("patchsrc"===t||"for"===t&&"label"!==e&&"output"!==e)},Sn=function(t){let e=null,n=null;if(xe)t="<remove></remove>"+t;else{const e=L(t,/^[\r\n\t ]+/);n=e&&e[0]}"application/xhtml+xml"===Qe&&Ye===We&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");const o=Mt?Wt(t):t;if(Ye===We)try{e=(new u).parseFromString(o,Qe)}catch(t){}if(!e||!e.documentElement){e=Gt.createDocument(Ye,"template",null);try{e.documentElement.innerHTML=Ge?Ut:o}catch(t){}}const i=e.body||e.documentElement;return t&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),Ye===We?Vt.call(e,Se?"html":"body")[0]:Se?e.documentElement:i},vn=function(t){const e=Rt?Rt(t):t.ownerDocument;return qt.call(e||t,t,s.SHOW_ELEMENT|s.SHOW_COMMENT|s.SHOW_TEXT|s.SHOW_PROCESSING_INSTRUCTION|s.SHOW_CDATA_SECTION,null)},An=function(t){return t=z(t,Zt," "),t=z(t,Jt," "),z(t,Qt," ")},wn=function(t){var e;xn(t);const n=null===(e=t.querySelectorAll)||void 0===e?void 0:e.call(t,"template");n&&A(n,t=>{En(t.content)&&wn(t.content)})},xn=function(t){t.normalize();const e=Rt?Rt(t):t.ownerDocument,n=qt.call(e||t,t,s.SHOW_TEXT|s.SHOW_COMMENT|s.SHOW_CDATA_SECTION|s.SHOW_PROCESSING_INSTRUCTION,null);let r=n.nextNode();for(;r;)r.data=An(r.data),r=n.nextNode()},_n=function(t){const e=Ct?Ct(t):null;return"string"==typeof e&&"form"===en(e)&&("string"!=typeof t.nodeName||"string"!=typeof t.textContent||"function"!=typeof t.removeChild||t.attributes!==Nt(t)||"function"!=typeof t.removeAttribute||"function"!=typeof t.removeAttributeNode||"function"!=typeof t.getAttributeNode||"function"!=typeof t.setAttribute||"string"!=typeof t.namespaceURI||"function"!=typeof t.insertBefore||"function"!=typeof t.hasChildNodes||t.nodeType!==Dt(t)||t.childNodes!==X(t))},En=function(t){if(!Dt||"object"!=typeof t||null===t)return!1;try{return 11===Dt(t)}catch(t){return!1}},On=function(t){if(!Dt||"object"!=typeof t||null===t)return!1;try{return"number"==typeof Dt(t)}catch(t){return!1}};function kn(t,e,r){0!==t.length&&A(t,t=>{t.call(n,e,r,nn)})}const Nn=function(t,e){if(t instanceof RegExp)return Y(t,e);if(t instanceof Function){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return Boolean(t(e,...r))}return!1},Dn=function(t,e,n,r){return 0===t.length?e:e===n||e===r?K(e):e},Cn=function(t,e){return t!==e&&null===Ot(t)&&(Re&&hn(t),!0)},Rn=function(t,e){if(Ie&&D(Ie,t),kn(Kt.beforeSanitizeElements,t,null),Cn(t,e))return!0;if(_n(t))return sn(t),!0;const r=en(Lt(t));if(ae=Dn(Kt.uponSanitizeElement,ae,le,Ae),kn(Kt.uponSanitizeElement,t,{tagName:r,allowedTags:ae}),Cn(t,e))return!0;if(function(t,e){return!!(Te&&t.hasChildNodes()&&!On(t.firstElementChild)&&Y(Tt,t.textContent)&&Y(Tt,t.innerHTML))||!!(Te&&wt[e]&&1===It(t)&&Pt(t)===We&&(On(t.firstElementChild)||"string"==typeof t.textContent&&Y(Tt,t.textContent)))||7===t.nodeType||!(!Te||8!==t.nodeType||!Y(St,t.data))}(t,r))return sn(t),!0;if(fe[r]||!(me.tagCheck instanceof Function&&me.tagCheck(r))&&!ae[r]){const n=function(t,e,n){if(!fe[e]&&zn(e)&&Nn(ue.tagNameCheck,e))return!1;if(Ce&&!ze[e]&&!ze[R(e)]){const e=Ot(t),r=X(t);if(r&&e)for(let o=r.length-1;o>=0;--o){const i=t===n?T(r[o],!0):r[o];e.insertBefore(i,$(t))}}return sn(t),!0}(t,r,e);return!(!1!==n||(kn(Kt.afterSanitizeElements,t,null),!Cn(t,e)))||n}if(1===It(t)&&!function(t){const e=Pt(t),n=R(Lt(t)),r=Ot(t);let o,i;return r&&1===It(r)?(o={namespaceURI:Pt(r)},i=R(Lt(r))):(o={namespaceURI:Ye},i="template"),!!qe[e]&&(e===Be?function(t,e,n){return e.namespaceURI===We?"svg"===t:e.namespaceURI===He?"svg"===t&&("annotation-xml"===n||Xe[n]):Boolean(ln[t])}(n,o,i):e===He?function(t,e,n){return e.namespaceURI===We?"math"===t:e.namespaceURI===Be?"math"===t&&Ze[n]:Boolean(cn[t])}(n,o,i):e===We?function(t,e,n){return!(e.namespaceURI===Be&&!Ze[n])&&!(e.namespaceURI===He&&!Xe[n])&&!cn[t]&&(Je[t]||!ln[t])}(n,o,i):!("application/xhtml+xml"!==Qe||!qe[e]))}(t))return sn(t),!0;if(("noscript"===r||"noembed"===r||"noframes"===r)&&Y(vt,t.innerHTML))return sn(t),!0;if(be&&3===t.nodeType){const e=An(t.textContent);t.textContent!==e&&(_(n.removed,{element:t.cloneNode()}),t.textContent=e)}return kn(Kt.afterSanitizeElements,t,null),Cn(t,e)},In=function(t,e,n){if(pe[e])return!1;if(Tn(e,t))return!1;if(ke&&("id"===e||"name"===e)&&(n in r||n in rn))return!1;const o=ce[e]||me.attributeCheck instanceof Function&&me.attributeCheck(e,t);return!(!he||!Y(te,e))||!(!de||!Y(ee,e))||(o?!(!Ue[e]&&!Y(ie,z(n,re,""))&&("src"!==e&&"xlink:href"!==e&&"href"!==e||"script"===t||0!==P(n,"data:")||!Me[t])&&(!ye||Y(ne,z(n,re,"")))&&n):zn(t)&&Nn(ue.tagNameCheck,t)&&Nn(ue.attributeNameCheck,e,t)||"is"===e&&ue.allowCustomizedBuiltInElements&&Nn(ue.tagNameCheck,n))},Ln=V({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),zn=function(t){return!Ln[R(t)]&&Y(oe,t)},Pn=function(t,e,n,r){if(Mt&&"object"==typeof p&&"function"==typeof p.getAttributeType&&!n)switch(p.getAttributeType(t,e)){case"TrustedHTML":return Wt(r);case"TrustedScriptURL":return function(t){Bt(),Ht++;try{return Mt.createScriptURL(t)}finally{Ht--}}(r)}return r},Mn=function(t,e,n,r){try{return n?t.setAttributeNS(n,e,r):t.setAttribute(e,r),!_n(t)||(sn(t),!1)}catch(n){return pn(e,t),!1}},jn=function(t,e){return!(!Te||!Y(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,e))||"attributename"===R(t)&&null!==L(e,"href")},Un=function(t,e){if(kn(Kt.beforeSanitizeAttributes,t,null),Cn(t,e))return;const r=t.attributes;if(!r||_n(t))return;ce=Dn(Kt.uponSanitizeAttribute,ce,se,we);const o={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ce,forceKeepAttr:void 0};let i=r.length;const a=en(t.nodeName);for(;i--;){const e=r[i],l=e.name,c=e.namespaceURI,s=e.value,u=en(l),f=s;let p="value"===l?f:M(f),m=!1;o.attrName=u,o.attrValue=p,o.keepAttr=!0,o.forceKeepAttr=void 0,kn(Kt.uponSanitizeAttribute,t,o),p=o.attrValue,!Ne||"id"!==u&&"name"!==u||0===P(p,De)||(pn(l,t,e),p=De+p,m=!0),jn(l,p)?pn(l,t,e):o.forceKeepAttr||(!o.keepAttr||!ge&&Y(At,p)?pn(l,t,e):(be&&(p=An(p)),In(a,u,p)?(p=Pn(a,u,c,p),p!==f&&Mn(t,l,c,p)&&m&&x(n.removed)):pn(l,t,e)))}kn(Kt.afterSanitizeAttributes,t,null),Cn(t,e)},Fn=function(t){let e=null;const n=vn(t);for(kn(Kt.beforeSanitizeShadowDOM,t,null);e=n.nextNode();)if(kn(Kt.uponSanitizeShadowNode,e,null),Rn(e,t),Un(e,t),En(e.content)&&Fn(e.content),1===It(e)){const t=kt(e);En(t)&&(Hn(t),Fn(t))}be&&xn(t),kn(Kt.afterSanitizeShadowDOM,t,null)},Hn=function(t){const e=[{node:t,shadow:null}];for(;e.length>0;){const t=e.pop();if(t.shadow){Fn(t.shadow);continue}const n=t.node,r=1===It(n),o=X(n);if(o)for(let t=o.length-1;t>=0;--t)e.push({node:o[t],shadow:null});if(r){const t=Ct?Ct(n):null;if("string"==typeof t&&"template"===en(t)){const t=n.content;En(t)&&e.push({node:t,shadow:null})}}if(r){const t=kt(n);En(t)&&e.push({node:null,shadow:t},{node:t,shadow:null})}}};return n.sanitize=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,i=null,a=null,l=null;if(Ge=!t,Ge&&(t="\x3c!--\x3e"),"string"!=typeof t&&!On(t)&&"string"!=typeof(t=function(t){switch(typeof t){case"string":return t;case"number":return j(t);case"boolean":return U(t);case"bigint":return F?F(t):"0";case"symbol":return H?H(t):"Symbol()";case"undefined":default:return W(t);case"function":case"object":{if(null===t)return W(t);const e=t,n=Z(e,"toString");if("function"==typeof n){const t=n(e);return"string"==typeof t?t:W(t)}return W(t)}}}(t)))throw G("dirty is not a string, aborting");if(!n.isSupported)return t;ve?(ae=Ae,ce=we):an(e),(Kt.uponSanitizeElement.length>0||Kt.uponSanitizeAttribute.length>0)&&(ae=K(ae)),Kt.uponSanitizeAttribute.length>0&&(ce=K(ce)),n.removed=[];const c=Re&&"string"!=typeof t&&On(t);let s=[];const u=Ie;if(c){Te&&dn(t,t=>{const e=It(t);if(7===e||8===e&&Y(St,t.data)){try{S(t)}catch(t){}return!1}if(1===e){const e=t,n=en(Lt(t));try{e.hasAttribute&&e.hasAttribute("patchsrc")&&e.removeAttribute("patchsrc"),e.hasAttribute&&e.hasAttribute("for")&&Tn("for",n)&&e.removeAttribute("for")}catch(t){}}return!0});const e=Lt(t);if("string"==typeof e){const n=en(e);if(!ae[n]||fe[n])throw fn(t),G("root node is forbidden and cannot be sanitized in-place")}if(_n(t))throw fn(t),G("root node is clobbered and cannot be sanitized in-place");s=yn(t),Ie=N()}else if(On(t))r=Sn("\x3c!----\x3e"),i=r.ownerDocument.importNode(t,!0),1===i.nodeType&&"BODY"===i.nodeName||"HTML"===i.nodeName?r=i:r.appendChild(i),Hn(r);else{if(!_e&&!be&&!Se&&-1===t.indexOf("<"))return Mt&&Oe?Wt(t):t;if(r=Sn(t),!r)return _e?null:Oe?Ut:""}r&&xe&&sn(r.firstChild);const f=c?t:r;try{c&&Hn(t);const e=vn(f);for(;a=e.nextNode();)Rn(a,f),Un(a,f),En(a.content)&&Fn(a.content);c&&function(t,e){const n=Ie;let r=null;const o=()=>(r||(r=N(),A(e,t=>{D(r,t)})),r);for(let e=0;;e++){const r=yn(t),i=[t];let a=!1;if(A(r,t=>{11===It(t)?_(i,t):a||C(n,t)||(a=C(o(),t))}),!a)return;if(e>=8)throw G("the tree kept changing during in-place sanitization; refusing to return it");A(i,(e,n)=>{bn(e,n>0,t,o())})}}(t,s)}catch(e){throw c&&(fn(t),gn(t,s)),e}finally{Ie=u}if(c){if(gn(t,s))throw G("a node selected for removal could not be safely returned; refusing to sanitize in place");return be&&wn(t),t}if(_e){if(be&&wn(r),Ee)for(l=$t.call(r.ownerDocument);r.firstChild;)l.appendChild(r.firstChild);else l=r;return(ce.shadowroot||ce.shadowrootmode)&&(l=Xt.call(o,l,!0)),l}let p=Se?r.outerHTML:r.innerHTML;return Se&&ae["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&Y(gt,r.ownerDocument.doctype.name)&&(p="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+p),be&&(p=An(p)),Mt&&Oe?Wt(p):p},n.setConfig=function(){an(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),ve=!0,Ae=ae,we=ce},n.clearConfig=function(){nn=null,ve=!1,Ae=null,we=null,Mt=jt,Ut=""},n.isValidAttribute=function(t,e,n){nn||an({});const r=en(t),o=en(e);return("string"!=typeof n||!(jn(e,n)||!ge&&Y(At,n)))&&In(r,o,n)},n.addHook=function(t,e){"function"==typeof e&&B(Kt,t)&&_(Kt[t],e)},n.removeHook=function(t,e){if(B(Kt,t)){if(void 0!==e){const n=w(Kt[t],e);return-1===n?void 0:O(Kt[t],n,1)[0]}return x(Kt[t])}},n.removeHooks=function(t){B(Kt,t)&&(Kt[t]=[])},n.removeAllHooks=function(){Kt={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}();function kt({label:t,Type:e="Primary",Variant:n="Default",Outline:o=!1,State:i="Default",href:a="#",onClick:l,className:c,...s}){const u="Disabled"===i,f=["mg-button","CTA"===n&&"mg-button-cta","mg-button-"+("Secondary"===e?"secondary":"primary"),o&&"mg-button-outline",u&&"disabled",c].filter(Boolean).join(" ");/*#__PURE__*/ /*#__PURE__*/
|
|
10
|
+
return(0,r().jsx)("a",{className:f,...s,...u?{"aria-disabled":"true",tabIndex:-1}:{href:a,onClick:l},children:t})}function Nt(t){return"string"==typeof t&&""!==t.trim()?t:null}function Dt({title:t,link:e=null,target:n,rel:o}){const i=t?.trim();/*#__PURE__*/ /*#__PURE__*/
|
|
11
|
+
return(0,r().jsx)("header",{className:"mg-card__title",children:e?/*#__PURE__*/ /*#__PURE__*/(0,r().jsx)("a",{href:e,target:n,rel:o,children:i}):i})}function Ct({label:t,link:e=null}){return t?e?/*#__PURE__*/ /*#__PURE__*/(0,r().jsx)("a",{href:e,className:"mg-card__label mg-card__label--active",children:t}):/*#__PURE__*/ /*#__PURE__*/(0,r().jsx)("span",{className:"mg-card__label",children:t}):null}o(),kt.propTypes={label:a().string.isRequired,Type:a().oneOf(["Primary","Secondary"]),Variant:a().oneOf(["Default","CTA"]),Outline:a().bool,State:a().oneOf(["Default","Disabled"]),href:a().string,onClick:a().func,className:a().string},Dt.propTypes={title:a().string,link:a().string,target:a().string,rel:a().string},Ct.propTypes={label:a().string,link:a().string};const Rt=(...t)=>t.filter(Boolean).length>0?t.filter(Boolean).join(" "):null;function It({data:t,variant:e="primary",className:n}){const o=e&&"primary"!==e?`mg-card--${e}`:null;/*#__PURE__*/ /*#__PURE__*/
|
|
12
|
+
return(0,r().jsx)(r().Fragment,{children:t.map((t,e)=>{const i=Nt(t.link),a=Nt(t.buttonLink)??i;/*#__PURE__*/ /*#__PURE__*/
|
|
13
|
+
return(0,r().jsxs)("article",{className:Rt("mg-card","mg-card__hc","mg-card-book__hc",o,!i&&"mg-card--no-link",n),children:[t.imgback&&/*#__PURE__*/ /*#__PURE__*/(0,r().jsx)("div",{className:"mg-card__visual",children:/*#__PURE__*/ /*#__PURE__*/(0,r().jsx)("img",{src:t.imgback,alt:t.imgalt,className:"mg-card__image"})}),/*#__PURE__*/ /*#__PURE__*/(0,r().jsxs)("div",{className:"mg-card__content",children:[(t.label1||t.label2)&&/*#__PURE__*/ /*#__PURE__*/(0,r().jsxs)("div",{className:"mg-card__meta",children:[/*#__PURE__*/ /*#__PURE__*/(0,r().jsx)(Ct,{label:t.label1,link:i}),/*#__PURE__*/ /*#__PURE__*/(0,r().jsx)(Ct,{label:t.label2,link:i})]}),/*#__PURE__*/ /*#__PURE__*/(0,r().jsx)(Dt,{title:t.title,link:i,target:t.target,rel:t.rel}),t.summaryText&&/*#__PURE__*/ /*#__PURE__*/(0,r().jsx)("p",{className:"mg-card__summary",dangerouslySetInnerHTML:{__html:Ot.sanitize(t.summaryText)}}),t.button&&a&&/*#__PURE__*/ /*#__PURE__*/(0,r().jsx)(kt,{Type:"Primary",Variant:"CTA",label:t.button,href:a,target:t.target,rel:t.rel})]})]},e)})})}It.propTypes={data:a().array.isRequired,variant:a().oneOf(["primary","secondary","tertiary","quaternary"]),className:a().string};export{It as HorizontalBookCard};
|