@apolitical/component-library 4.7.5-beta.1 → 4.7.5-test.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,8 +1,8 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react"),se=require("react-intl"),yn=require("lodash.clonedeep"),Rh=require("lodash.set"),Fc=require("react-dom"),It=require("markdown-to-jsx"),Gn=require("truncate"),Ye=require("@tanstack/react-query"),Ih=require("@tanstack/react-query-devtools"),pa=require("posthog-js"),Ws=require("react-cookie"),ls=require("lodash.isequal"),$h=require("react-multi-email"),Ac=require("lodash.get"),Lh=require("react-error-boundary");var Vr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Tn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Tc(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,a.get?a:{enumerable:!0,get:function(){return e[r]}})}),n}var Sc={exports:{}};/*!
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("react"),oe=require("react-intl"),yn=require("lodash.clonedeep"),Nh=require("lodash.set"),Fc=require("react-dom"),It=require("markdown-to-jsx"),Gn=require("truncate"),Ye=require("@tanstack/react-query"),Rh=require("@tanstack/react-query-devtools"),pa=require("posthog-js"),Ws=require("react-cookie"),ls=require("lodash.isequal"),Mh=require("react-multi-email"),Bc=require("lodash.get"),Ih=require("react-error-boundary");var Vr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Tn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ac(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,a.get?a:{enumerable:!0,get:function(){return e[r]}})}),n}var Tc={exports:{}};/*!
2
2
  Copyright (c) 2018 Jed Watson.
3
3
  Licensed under the MIT License (MIT), see
4
4
  http://jedwatson.github.io/classnames
5
- */(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var r=[],a=0;a<arguments.length;a++){var i=arguments[a];if(i){var s=typeof i;if(s==="string"||s==="number")r.push(i);else if(Array.isArray(i)){if(i.length){var o=n.apply(null,i);o&&r.push(o)}}else if(s==="object"){if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]")){r.push(i.toString());continue}for(var l in i)t.call(i,l)&&i[l]&&r.push(l)}}}return r.join(" ")}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(Sc);var zh=Sc.exports;const G=Tn(zh),qh=({element:e="span",showOnFocus:t=!0,children:n,className:r="",...a})=>y.createElement(e,{...a,className:G("hidden",r,{"show-on-focus":t}),children:n}),Ie=y.memo(qh),Wh=({element:e="span",children:t=null,...n})=>y.createElement(e,{...n,"aria-hidden":!0},t),Ka=y.memo(Wh);var cs={exports:{}},lr={};/**
5
+ */(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var r=[],a=0;a<arguments.length;a++){var i=arguments[a];if(i){var s=typeof i;if(s==="string"||s==="number")r.push(i);else if(Array.isArray(i)){if(i.length){var o=n.apply(null,i);o&&r.push(o)}}else if(s==="object"){if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]")){r.push(i.toString());continue}for(var l in i)t.call(i,l)&&i[l]&&r.push(l)}}}return r.join(" ")}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(Tc);var $h=Tc.exports;const Y=Tn($h),Lh=({element:e="span",showOnFocus:t=!0,children:n,className:r="",...a})=>C.createElement(e,{...a,className:Y("hidden",r,{"show-on-focus":t}),children:n}),Ie=C.memo(Lh),zh=({element:e="span",children:t=null,...n})=>C.createElement(e,{...n,"aria-hidden":!0},t),Ka=C.memo(zh);var cs={exports:{}},lr={};/**
6
6
  * @license React
7
7
  * react-jsx-runtime.production.min.js
8
8
  *
@@ -10,7 +10,7 @@
10
10
  *
11
11
  * This source code is licensed under the MIT license found in the
12
12
  * LICENSE file in the root directory of this source tree.
13
- */var Vo;function Uh(){if(Vo)return lr;Vo=1;var e=y,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,a=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function s(o,l,u){var c,h={},p=null,m=null;u!==void 0&&(p=""+u),l.key!==void 0&&(p=""+l.key),l.ref!==void 0&&(m=l.ref);for(c in l)r.call(l,c)&&!i.hasOwnProperty(c)&&(h[c]=l[c]);if(o&&o.defaultProps)for(c in l=o.defaultProps,l)h[c]===void 0&&(h[c]=l[c]);return{$$typeof:t,type:o,key:p,ref:m,props:h,_owner:a.current}}return lr.Fragment=n,lr.jsx=s,lr.jsxs=s,lr}var cr={};/**
13
+ */var Ho;function qh(){if(Ho)return lr;Ho=1;var e=C,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,a=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function s(o,l,u){var c,h={},p=null,m=null;u!==void 0&&(p=""+u),l.key!==void 0&&(p=""+l.key),l.ref!==void 0&&(m=l.ref);for(c in l)r.call(l,c)&&!i.hasOwnProperty(c)&&(h[c]=l[c]);if(o&&o.defaultProps)for(c in l=o.defaultProps,l)h[c]===void 0&&(h[c]=l[c]);return{$$typeof:t,type:o,key:p,ref:m,props:h,_owner:a.current}}return lr.Fragment=n,lr.jsx=s,lr.jsxs=s,lr}var cr={};/**
14
14
  * @license React
15
15
  * react-jsx-runtime.development.js
16
16
  *
@@ -18,56 +18,56 @@
18
18
  *
19
19
  * This source code is licensed under the MIT license found in the
20
20
  * LICENSE file in the root directory of this source tree.
21
- */var Ko;function Hh(){return Ko||(Ko=1,process.env.NODE_ENV!=="production"&&function(){var e=y,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen"),g=Symbol.iterator,f="@@iterator";function b(O){if(O===null||typeof O!="object")return null;var oe=g&&O[g]||O[f];return typeof oe=="function"?oe:null}var v=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function E(O){{for(var oe=arguments.length,ce=new Array(oe>1?oe-1:0),De=1;De<oe;De++)ce[De-1]=arguments[De];k("error",O,ce)}}function k(O,oe,ce){{var De=v.ReactDebugCurrentFrame,Oe=De.getStackAddendum();Oe!==""&&(oe+="%s",ce=ce.concat([Oe]));var Le=ce.map(function(je){return String(je)});Le.unshift("Warning: "+oe),Function.prototype.apply.call(console[O],console,Le)}}var x=!1,w=!1,A=!1,S=!1,W=!1,R;R=Symbol.for("react.module.reference");function I(O){return!!(typeof O=="string"||typeof O=="function"||O===r||O===i||W||O===a||O===u||O===c||S||O===m||x||w||A||typeof O=="object"&&O!==null&&(O.$$typeof===p||O.$$typeof===h||O.$$typeof===s||O.$$typeof===o||O.$$typeof===l||O.$$typeof===R||O.getModuleId!==void 0))}function N(O,oe,ce){var De=O.displayName;if(De)return De;var Oe=oe.displayName||oe.name||"";return Oe!==""?ce+"("+Oe+")":ce}function _(O){return O.displayName||"Context"}function F(O){if(O==null)return null;if(typeof O.tag=="number"&&E("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof O=="function")return O.displayName||O.name||null;if(typeof O=="string")return O;switch(O){case r:return"Fragment";case n:return"Portal";case i:return"Profiler";case a:return"StrictMode";case u:return"Suspense";case c:return"SuspenseList"}if(typeof O=="object")switch(O.$$typeof){case o:var oe=O;return _(oe)+".Consumer";case s:var ce=O;return _(ce._context)+".Provider";case l:return N(O,O.render,"ForwardRef");case h:var De=O.displayName||null;return De!==null?De:F(O.type)||"Memo";case p:{var Oe=O,Le=Oe._payload,je=Oe._init;try{return F(je(Le))}catch{return null}}}return null}var j=Object.assign,$=0,V,K,Q,ae,D,L,q;function B(){}B.__reactDisabledLog=!0;function T(){{if($===0){V=console.log,K=console.info,Q=console.warn,ae=console.error,D=console.group,L=console.groupCollapsed,q=console.groupEnd;var O={configurable:!0,enumerable:!0,value:B,writable:!0};Object.defineProperties(console,{info:O,log:O,warn:O,error:O,group:O,groupCollapsed:O,groupEnd:O})}$++}}function z(){{if($--,$===0){var O={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:j({},O,{value:V}),info:j({},O,{value:K}),warn:j({},O,{value:Q}),error:j({},O,{value:ae}),group:j({},O,{value:D}),groupCollapsed:j({},O,{value:L}),groupEnd:j({},O,{value:q})})}$<0&&E("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var M=v.ReactCurrentDispatcher,H;function ne(O,oe,ce){{if(H===void 0)try{throw Error()}catch(Oe){var De=Oe.stack.trim().match(/\n( *(at )?)/);H=De&&De[1]||""}return`
22
- `+H+O}}var ee=!1,re;{var le=typeof WeakMap=="function"?WeakMap:Map;re=new le}function J(O,oe){if(!O||ee)return"";{var ce=re.get(O);if(ce!==void 0)return ce}var De;ee=!0;var Oe=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Le;Le=M.current,M.current=null,T();try{if(oe){var je=function(){throw Error()};if(Object.defineProperty(je.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(je,[])}catch(Wt){De=Wt}Reflect.construct(O,[],je)}else{try{je.call()}catch(Wt){De=Wt}O.call(je.prototype)}}else{try{throw Error()}catch(Wt){De=Wt}O()}}catch(Wt){if(Wt&&De&&typeof Wt.stack=="string"){for(var Fe=Wt.stack.split(`
23
- `),it=De.stack.split(`
24
- `),Ze=Fe.length-1,Ge=it.length-1;Ze>=1&&Ge>=0&&Fe[Ze]!==it[Ge];)Ge--;for(;Ze>=1&&Ge>=0;Ze--,Ge--)if(Fe[Ze]!==it[Ge]){if(Ze!==1||Ge!==1)do if(Ze--,Ge--,Ge<0||Fe[Ze]!==it[Ge]){var Ct=`
25
- `+Fe[Ze].replace(" at new "," at ");return O.displayName&&Ct.includes("<anonymous>")&&(Ct=Ct.replace("<anonymous>",O.displayName)),typeof O=="function"&&re.set(O,Ct),Ct}while(Ze>=1&&Ge>=0);break}}}finally{ee=!1,M.current=Le,z(),Error.prepareStackTrace=Oe}var Nn=O?O.displayName||O.name:"",Ho=Nn?ne(Nn):"";return typeof O=="function"&&re.set(O,Ho),Ho}function he(O,oe,ce){return J(O,!1)}function me(O){var oe=O.prototype;return!!(oe&&oe.isReactComponent)}function ve(O,oe,ce){if(O==null)return"";if(typeof O=="function")return J(O,me(O));if(typeof O=="string")return ne(O);switch(O){case u:return ne("Suspense");case c:return ne("SuspenseList")}if(typeof O=="object")switch(O.$$typeof){case l:return he(O.render);case h:return ve(O.type,oe,ce);case p:{var De=O,Oe=De._payload,Le=De._init;try{return ve(Le(Oe),oe,ce)}catch{}}}return""}var Ee=Object.prototype.hasOwnProperty,Ae={},ze=v.ReactDebugCurrentFrame;function Se(O){if(O){var oe=O._owner,ce=ve(O.type,O._source,oe?oe.type:null);ze.setExtraStackFrame(ce)}else ze.setExtraStackFrame(null)}function Te(O,oe,ce,De,Oe){{var Le=Function.call.bind(Ee);for(var je in O)if(Le(O,je)){var Fe=void 0;try{if(typeof O[je]!="function"){var it=Error((De||"React class")+": "+ce+" type `"+je+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof O[je]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw it.name="Invariant Violation",it}Fe=O[je](oe,je,De,ce,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Ze){Fe=Ze}Fe&&!(Fe instanceof Error)&&(Se(Oe),E("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",De||"React class",ce,je,typeof Fe),Se(null)),Fe instanceof Error&&!(Fe.message in Ae)&&(Ae[Fe.message]=!0,Se(Oe),E("Failed %s type: %s",ce,Fe.message),Se(null))}}}var Ne=Array.isArray;function ke(O){return Ne(O)}function He(O){{var oe=typeof Symbol=="function"&&Symbol.toStringTag,ce=oe&&O[Symbol.toStringTag]||O.constructor.name||"Object";return ce}}function ge(O){try{return U(O),!1}catch{return!0}}function U(O){return""+O}function ie(O){if(ge(O))return E("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",He(O)),U(O)}var pe=v.ReactCurrentOwner,be={key:!0,ref:!0,__self:!0,__source:!0},we,Ke,Qe;Qe={};function pt(O){if(Ee.call(O,"ref")){var oe=Object.getOwnPropertyDescriptor(O,"ref").get;if(oe&&oe.isReactWarning)return!1}return O.ref!==void 0}function qt(O){if(Ee.call(O,"key")){var oe=Object.getOwnPropertyDescriptor(O,"key").get;if(oe&&oe.isReactWarning)return!1}return O.key!==void 0}function Ft(O,oe){if(typeof O.ref=="string"&&pe.current&&oe&&pe.current.stateNode!==oe){var ce=F(pe.current.type);Qe[ce]||(E('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',F(pe.current.type),O.ref),Qe[ce]=!0)}}function et(O,oe){{var ce=function(){we||(we=!0,E("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",oe))};ce.isReactWarning=!0,Object.defineProperty(O,"key",{get:ce,configurable:!0})}}function jt(O,oe){{var ce=function(){Ke||(Ke=!0,E("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",oe))};ce.isReactWarning=!0,Object.defineProperty(O,"ref",{get:ce,configurable:!0})}}var gt=function(O,oe,ce,De,Oe,Le,je){var Fe={$$typeof:t,type:O,key:oe,ref:ce,props:je,_owner:Le};return Fe._store={},Object.defineProperty(Fe._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Fe,"_self",{configurable:!1,enumerable:!1,writable:!1,value:De}),Object.defineProperty(Fe,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Oe}),Object.freeze&&(Object.freeze(Fe.props),Object.freeze(Fe)),Fe};function li(O,oe,ce,De,Oe){{var Le,je={},Fe=null,it=null;ce!==void 0&&(ie(ce),Fe=""+ce),qt(oe)&&(ie(oe.key),Fe=""+oe.key),pt(oe)&&(it=oe.ref,Ft(oe,Oe));for(Le in oe)Ee.call(oe,Le)&&!be.hasOwnProperty(Le)&&(je[Le]=oe[Le]);if(O&&O.defaultProps){var Ze=O.defaultProps;for(Le in Ze)je[Le]===void 0&&(je[Le]=Ze[Le])}if(Fe||it){var Ge=typeof O=="function"?O.displayName||O.name||"Unknown":O;Fe&&et(je,Ge),it&&jt(je,Ge)}return gt(O,Fe,it,Oe,De,pe.current,je)}}var ur=v.ReactCurrentOwner,Hr=v.ReactDebugCurrentFrame;function Pn(O){if(O){var oe=O._owner,ce=ve(O.type,O._source,oe?oe.type:null);Hr.setExtraStackFrame(ce)}else Hr.setExtraStackFrame(null)}var ci;ci=!1;function di(O){return typeof O=="object"&&O!==null&&O.$$typeof===t}function Lo(){{if(ur.current){var O=F(ur.current.type);if(O)return`
21
+ */var Vo;function Wh(){return Vo||(Vo=1,process.env.NODE_ENV!=="production"&&function(){var e=C,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen"),g=Symbol.iterator,f="@@iterator";function b(O){if(O===null||typeof O!="object")return null;var se=g&&O[g]||O[f];return typeof se=="function"?se:null}var v=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function E(O){{for(var se=arguments.length,ce=new Array(se>1?se-1:0),De=1;De<se;De++)ce[De-1]=arguments[De];k("error",O,ce)}}function k(O,se,ce){{var De=v.ReactDebugCurrentFrame,Oe=De.getStackAddendum();Oe!==""&&(se+="%s",ce=ce.concat([Oe]));var Le=ce.map(function(je){return String(je)});Le.unshift("Warning: "+se),Function.prototype.apply.call(console[O],console,Le)}}var x=!1,w=!1,A=!1,S=!1,q=!1,$;$=Symbol.for("react.module.reference");function N(O){return!!(typeof O=="string"||typeof O=="function"||O===r||O===i||q||O===a||O===u||O===c||S||O===m||x||w||A||typeof O=="object"&&O!==null&&(O.$$typeof===p||O.$$typeof===h||O.$$typeof===s||O.$$typeof===o||O.$$typeof===l||O.$$typeof===$||O.getModuleId!==void 0))}function L(O,se,ce){var De=O.displayName;if(De)return De;var Oe=se.displayName||se.name||"";return Oe!==""?ce+"("+Oe+")":ce}function _(O){return O.displayName||"Context"}function B(O){if(O==null)return null;if(typeof O.tag=="number"&&E("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof O=="function")return O.displayName||O.name||null;if(typeof O=="string")return O;switch(O){case r:return"Fragment";case n:return"Portal";case i:return"Profiler";case a:return"StrictMode";case u:return"Suspense";case c:return"SuspenseList"}if(typeof O=="object")switch(O.$$typeof){case o:var se=O;return _(se)+".Consumer";case s:var ce=O;return _(ce._context)+".Provider";case l:return L(O,O.render,"ForwardRef");case h:var De=O.displayName||null;return De!==null?De:B(O.type)||"Memo";case p:{var Oe=O,Le=Oe._payload,je=Oe._init;try{return B(je(Le))}catch{return null}}}return null}var j=Object.assign,I=0,G,V,Q,ae,D,M,W;function F(){}F.__reactDisabledLog=!0;function T(){{if(I===0){G=console.log,V=console.info,Q=console.warn,ae=console.error,D=console.group,M=console.groupCollapsed,W=console.groupEnd;var O={configurable:!0,enumerable:!0,value:F,writable:!0};Object.defineProperties(console,{info:O,log:O,warn:O,error:O,group:O,groupCollapsed:O,groupEnd:O})}I++}}function z(){{if(I--,I===0){var O={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:j({},O,{value:G}),info:j({},O,{value:V}),warn:j({},O,{value:Q}),error:j({},O,{value:ae}),group:j({},O,{value:D}),groupCollapsed:j({},O,{value:M}),groupEnd:j({},O,{value:W})})}I<0&&E("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var R=v.ReactCurrentDispatcher,H;function re(O,se,ce){{if(H===void 0)try{throw Error()}catch(Oe){var De=Oe.stack.trim().match(/\n( *(at )?)/);H=De&&De[1]||""}return`
22
+ `+H+O}}var X=!1,ne;{var le=typeof WeakMap=="function"?WeakMap:Map;ne=new le}function ee(O,se){if(!O||X)return"";{var ce=ne.get(O);if(ce!==void 0)return ce}var De;X=!0;var Oe=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Le;Le=R.current,R.current=null,T();try{if(se){var je=function(){throw Error()};if(Object.defineProperty(je.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(je,[])}catch(Wt){De=Wt}Reflect.construct(O,[],je)}else{try{je.call()}catch(Wt){De=Wt}O.call(je.prototype)}}else{try{throw Error()}catch(Wt){De=Wt}O()}}catch(Wt){if(Wt&&De&&typeof Wt.stack=="string"){for(var Fe=Wt.stack.split(`
23
+ `),at=De.stack.split(`
24
+ `),Ze=Fe.length-1,Ge=at.length-1;Ze>=1&&Ge>=0&&Fe[Ze]!==at[Ge];)Ge--;for(;Ze>=1&&Ge>=0;Ze--,Ge--)if(Fe[Ze]!==at[Ge]){if(Ze!==1||Ge!==1)do if(Ze--,Ge--,Ge<0||Fe[Ze]!==at[Ge]){var yt=`
25
+ `+Fe[Ze].replace(" at new "," at ");return O.displayName&&yt.includes("<anonymous>")&&(yt=yt.replace("<anonymous>",O.displayName)),typeof O=="function"&&ne.set(O,yt),yt}while(Ze>=1&&Ge>=0);break}}}finally{X=!1,R.current=Le,z(),Error.prepareStackTrace=Oe}var Nn=O?O.displayName||O.name:"",Uo=Nn?re(Nn):"";return typeof O=="function"&&ne.set(O,Uo),Uo}function he(O,se,ce){return ee(O,!1)}function me(O){var se=O.prototype;return!!(se&&se.isReactComponent)}function ye(O,se,ce){if(O==null)return"";if(typeof O=="function")return ee(O,me(O));if(typeof O=="string")return re(O);switch(O){case u:return re("Suspense");case c:return re("SuspenseList")}if(typeof O=="object")switch(O.$$typeof){case l:return he(O.render);case h:return ye(O.type,se,ce);case p:{var De=O,Oe=De._payload,Le=De._init;try{return ye(Le(Oe),se,ce)}catch{}}}return""}var Be=Object.prototype.hasOwnProperty,Ae={},Ue=v.ReactDebugCurrentFrame;function Se(O){if(O){var se=O._owner,ce=ye(O.type,O._source,se?se.type:null);Ue.setExtraStackFrame(ce)}else Ue.setExtraStackFrame(null)}function Te(O,se,ce,De,Oe){{var Le=Function.call.bind(Be);for(var je in O)if(Le(O,je)){var Fe=void 0;try{if(typeof O[je]!="function"){var at=Error((De||"React class")+": "+ce+" type `"+je+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof O[je]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw at.name="Invariant Violation",at}Fe=O[je](se,je,De,ce,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Ze){Fe=Ze}Fe&&!(Fe instanceof Error)&&(Se(Oe),E("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",De||"React class",ce,je,typeof Fe),Se(null)),Fe instanceof Error&&!(Fe.message in Ae)&&(Ae[Fe.message]=!0,Se(Oe),E("Failed %s type: %s",ce,Fe.message),Se(null))}}}var Ne=Array.isArray;function _e(O){return Ne(O)}function He(O){{var se=typeof Symbol=="function"&&Symbol.toStringTag,ce=se&&O[Symbol.toStringTag]||O.constructor.name||"Object";return ce}}function ge(O){try{return U(O),!1}catch{return!0}}function U(O){return""+O}function ie(O){if(ge(O))return E("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",He(O)),U(O)}var pe=v.ReactCurrentOwner,ve={key:!0,ref:!0,__self:!0,__source:!0},we,Ke,Qe;Qe={};function mt(O){if(Be.call(O,"ref")){var se=Object.getOwnPropertyDescriptor(O,"ref").get;if(se&&se.isReactWarning)return!1}return O.ref!==void 0}function qt(O){if(Be.call(O,"key")){var se=Object.getOwnPropertyDescriptor(O,"key").get;if(se&&se.isReactWarning)return!1}return O.key!==void 0}function kt(O,se){if(typeof O.ref=="string"&&pe.current&&se&&pe.current.stateNode!==se){var ce=B(pe.current.type);Qe[ce]||(E('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',B(pe.current.type),O.ref),Qe[ce]=!0)}}function et(O,se){{var ce=function(){we||(we=!0,E("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",se))};ce.isReactWarning=!0,Object.defineProperty(O,"key",{get:ce,configurable:!0})}}function St(O,se){{var ce=function(){Ke||(Ke=!0,E("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",se))};ce.isReactWarning=!0,Object.defineProperty(O,"ref",{get:ce,configurable:!0})}}var pt=function(O,se,ce,De,Oe,Le,je){var Fe={$$typeof:t,type:O,key:se,ref:ce,props:je,_owner:Le};return Fe._store={},Object.defineProperty(Fe._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Fe,"_self",{configurable:!1,enumerable:!1,writable:!1,value:De}),Object.defineProperty(Fe,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Oe}),Object.freeze&&(Object.freeze(Fe.props),Object.freeze(Fe)),Fe};function li(O,se,ce,De,Oe){{var Le,je={},Fe=null,at=null;ce!==void 0&&(ie(ce),Fe=""+ce),qt(se)&&(ie(se.key),Fe=""+se.key),mt(se)&&(at=se.ref,kt(se,Oe));for(Le in se)Be.call(se,Le)&&!ve.hasOwnProperty(Le)&&(je[Le]=se[Le]);if(O&&O.defaultProps){var Ze=O.defaultProps;for(Le in Ze)je[Le]===void 0&&(je[Le]=Ze[Le])}if(Fe||at){var Ge=typeof O=="function"?O.displayName||O.name||"Unknown":O;Fe&&et(je,Ge),at&&St(je,Ge)}return pt(O,Fe,at,Oe,De,pe.current,je)}}var ur=v.ReactCurrentOwner,Hr=v.ReactDebugCurrentFrame;function Pn(O){if(O){var se=O._owner,ce=ye(O.type,O._source,se?se.type:null);Hr.setExtraStackFrame(ce)}else Hr.setExtraStackFrame(null)}var ci;ci=!1;function di(O){return typeof O=="object"&&O!==null&&O.$$typeof===t}function $o(){{if(ur.current){var O=B(ur.current.type);if(O)return`
26
26
 
27
- Check the render method of \``+O+"`."}return""}}function Ah(O){{if(O!==void 0){var oe=O.fileName.replace(/^.*[\\\/]/,""),ce=O.lineNumber;return`
27
+ Check the render method of \``+O+"`."}return""}}function Fh(O){{if(O!==void 0){var se=O.fileName.replace(/^.*[\\\/]/,""),ce=O.lineNumber;return`
28
28
 
29
- Check your code at `+oe+":"+ce+"."}return""}}var zo={};function Th(O){{var oe=Lo();if(!oe){var ce=typeof O=="string"?O:O.displayName||O.name;ce&&(oe=`
29
+ Check your code at `+se+":"+ce+"."}return""}}var Lo={};function Bh(O){{var se=$o();if(!se){var ce=typeof O=="string"?O:O.displayName||O.name;ce&&(se=`
30
30
 
31
- Check the top-level render call using <`+ce+">.")}return oe}}function qo(O,oe){{if(!O._store||O._store.validated||O.key!=null)return;O._store.validated=!0;var ce=Th(oe);if(zo[ce])return;zo[ce]=!0;var De="";O&&O._owner&&O._owner!==ur.current&&(De=" It was passed a child from "+F(O._owner.type)+"."),Pn(O),E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',ce,De),Pn(null)}}function Wo(O,oe){{if(typeof O!="object")return;if(ke(O))for(var ce=0;ce<O.length;ce++){var De=O[ce];di(De)&&qo(De,oe)}else if(di(O))O._store&&(O._store.validated=!0);else if(O){var Oe=b(O);if(typeof Oe=="function"&&Oe!==O.entries)for(var Le=Oe.call(O),je;!(je=Le.next()).done;)di(je.value)&&qo(je.value,oe)}}}function Sh(O){{var oe=O.type;if(oe==null||typeof oe=="string")return;var ce;if(typeof oe=="function")ce=oe.propTypes;else if(typeof oe=="object"&&(oe.$$typeof===l||oe.$$typeof===h))ce=oe.propTypes;else return;if(ce){var De=F(oe);Te(ce,O.props,"prop",De,O)}else if(oe.PropTypes!==void 0&&!ci){ci=!0;var Oe=F(oe);E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Oe||"Unknown")}typeof oe.getDefaultProps=="function"&&!oe.getDefaultProps.isReactClassApproved&&E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function jh(O){{for(var oe=Object.keys(O.props),ce=0;ce<oe.length;ce++){var De=oe[ce];if(De!=="children"&&De!=="key"){Pn(O),E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",De),Pn(null);break}}O.ref!==null&&(Pn(O),E("Invalid attribute `ref` supplied to `React.Fragment`."),Pn(null))}}function Uo(O,oe,ce,De,Oe,Le){{var je=I(O);if(!je){var Fe="";(O===void 0||typeof O=="object"&&O!==null&&Object.keys(O).length===0)&&(Fe+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var it=Ah(Oe);it?Fe+=it:Fe+=Lo();var Ze;O===null?Ze="null":ke(O)?Ze="array":O!==void 0&&O.$$typeof===t?(Ze="<"+(F(O.type)||"Unknown")+" />",Fe=" Did you accidentally export a JSX literal instead of a component?"):Ze=typeof O,E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Ze,Fe)}var Ge=li(O,oe,ce,Oe,Le);if(Ge==null)return Ge;if(je){var Ct=oe.children;if(Ct!==void 0)if(De)if(ke(Ct)){for(var Nn=0;Nn<Ct.length;Nn++)Wo(Ct[Nn],O);Object.freeze&&Object.freeze(Ct)}else E("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Wo(Ct,O)}return O===r?jh(Ge):Sh(Ge),Ge}}function Oh(O,oe,ce){return Uo(O,oe,ce,!0)}function Ph(O,oe,ce){return Uo(O,oe,ce,!1)}var Nh=Ph,Mh=Oh;cr.Fragment=r,cr.jsx=Nh,cr.jsxs=Mh}()),cr}process.env.NODE_ENV==="production"?cs.exports=Uh():cs.exports=Hh();var d=cs.exports;const jc=()=>{const[e,t]=y.useState(window.location.pathname),n=()=>{const r=window.location.pathname;t(r)};return y.useEffect(()=>(window.addEventListener("popstate",n),()=>{window.removeEventListener("popstate",n)}),[]),e},Qn=(e,t)=>{const n=y.useRef(!1);y.useEffect(()=>{n.current?e():n.current=!0},t)};function Oc(e,t,n){var r=this,a=y.useRef(null),i=y.useRef(0),s=y.useRef(null),o=y.useRef([]),l=y.useRef(),u=y.useRef(),c=y.useRef(e),h=y.useRef(!0);c.current=e;var p=typeof window<"u",m=!t&&t!==0&&p;if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var g=!!(n=n||{}).leading,f=!("trailing"in n)||!!n.trailing,b="maxWait"in n,v="debounceOnServer"in n&&!!n.debounceOnServer,E=b?Math.max(+n.maxWait||0,t):null;y.useEffect(function(){return h.current=!0,function(){h.current=!1}},[]);var k=y.useMemo(function(){var x=function(I){var N=o.current,_=l.current;return o.current=l.current=null,i.current=I,u.current=c.current.apply(_,N)},w=function(I,N){m&&cancelAnimationFrame(s.current),s.current=m?requestAnimationFrame(I):setTimeout(I,N)},A=function(I){if(!h.current)return!1;var N=I-a.current;return!a.current||N>=t||N<0||b&&I-i.current>=E},S=function(I){return s.current=null,f&&o.current?x(I):(o.current=l.current=null,u.current)},W=function I(){var N=Date.now();if(A(N))return S(N);if(h.current){var _=t-(N-a.current),F=b?Math.min(_,E-(N-i.current)):_;w(I,F)}},R=function(){if(p||v){var I=Date.now(),N=A(I);if(o.current=[].slice.call(arguments),l.current=r,a.current=I,N){if(!s.current&&h.current)return i.current=a.current,w(W,t),g?x(a.current):u.current;if(b)return w(W,t),x(a.current)}return s.current||w(W,t),u.current}};return R.cancel=function(){s.current&&(m?cancelAnimationFrame(s.current):clearTimeout(s.current)),i.current=0,o.current=a.current=l.current=s.current=null},R.isPending=function(){return!!s.current},R.flush=function(){return s.current?S(Date.now()):u.current},R},[g,b,t,E,f,m,p,v]);return k}function Pc(e,t,n){var r=n===void 0?{}:n,a=r.leading,i=r.trailing;return Oc(e,t,{maxWait:t,leading:a===void 0||a,trailing:i===void 0||i})}let fi;const rr=(e=!0,t=!1,n="window")=>{if(!e)return;const[r,a]=y.useState(0)||[!1,()=>{}],i=n==="window"?[]:[n];y.useEffect(()=>(o(),window.addEventListener("resize",u),window.addEventListener("hashchange",u),window.addEventListener("hiddenSectionVisible",l),()=>{clearTimeout(fi),u.flush(),window.removeEventListener("resize",u),window.removeEventListener("hashchange",u),window.removeEventListener("hiddenSectionVisible",l)}),i);const s=()=>{if(n)return n==="window"?window.innerWidth:n.offsetWidth},o=()=>{a(s())},l=({detail:c})=>{const{id:h}=c;n==="window"||!n.closest(`#${h}`)||s()===r||o()},u=Pc(()=>{s()!==r&&(t&&(clearTimeout(fi),document.body.classList.add("is-resizing"),fi=setTimeout(()=>{document.body.classList.remove("is-resizing")},550)),o())},500,{leading:!0});return r},Nc=({scrollPosition:e=0,offset:t={down:0,up:10},callbacks:{scrollDown:n=()=>{},scrollUp:r=()=>{}}})=>{if(!window)return;const[a,i]=y.useState({current:0,past:0})||[!1,()=>{}],[s,o]=y.useState({scrollDown:!1,scrollUp:!1})||[!1,()=>{}];y.useEffect(()=>(l(),window.addEventListener("scroll",u),()=>{u.flush(),window.removeEventListener("scroll",u)}),[]);const l=()=>{const c=window.scrollY,h=a.current,p=c-h,m=p>0?"down":"up";if(i({current:c,past:h}),m==="down"){c>=e+t.down&&!s.scrollDown&&(!s.scrollUp||p>t.up)&&(n(),o({scrollUp:!1,scrollDown:!0}));return}Math.abs(p)>=t.up&&!s.scrollUp&&(r(),o({scrollUp:!0,scrollDown:!1}))},u=Pc(()=>{l()},250);return a},Us=(e=[],t=!0)=>{e=Array.isArray(e)?e:[e];const n=y.useRef(!1);Qn(()=>{if(window&&window.location&&window.location.hash){if(n.current)return;const r=document.getElementById(window.location.hash.replace("#",""));r&&(r.scrollIntoView(t?{behavior:"smooth"}:null),n.current=!0)}},e)},Hs=(e=!1)=>{if(!e)return{showTooltip:!1,tooltipProps:{}};const[t,n]=y.useState(!1);return{showTooltip:t,tooltipProps:{onMouseOver:()=>n(!0),onMouseOut:()=>n(!1),onFocus:()=>n(!0),onBlur:()=>n(!1),tabIndex:0}}};const Zo={},Sn=y.forwardRef(({id:e,styling:t={},isOpen:n=!1,isLoading:r=!1,children:a,className:i="",functions:s={},callbacks:o={},...l},u)=>{const c=se.useIntl(),h=y.useRef(null),p=u||h,[m,g]=y.useState(n?"open":"hidden"),{extraPadding:f=!0,hasPointer:b=!1,hasForm:v=!1}=t,{onOpen:E=()=>{},onClose:k=()=>{}}=o;e||(e=Date.now().toString());const x=Zo[e];y.useEffect(()=>{const W=p==null?void 0:p.current;if(W)return W.addEventListener("transitionend",w),W.addEventListener("keydown",A),()=>{W.removeEventListener("transitionend",w),W.removeEventListener("keydown",A)}},[]);const w=({propertyName:W})=>{W==="opacity"&&(x!==!1&&clearTimeout(x),g(R=>(R==="open"?E():R==="closed"&&k(),R==="opening"?"open":R==="closing"?"closed":R==="closed"?"hidden":R)))},A=W=>{W.key==="Escape"&&(W.stopPropagation(),W.preventDefault(),g("closing"))};Qn(()=>{x!==!1&&clearTimeout(x);let W="open";n?g("opening"):(g("closing"),W="hidden"),Zo[e||""]=setTimeout(()=>{g(W)},300)},[n]);const S={...l};return s&&s.onBlur&&(S.onBlur=s.onBlur),d.jsx("aside",{ref:p,className:G("tooltip text-medium",m,i,{loading:r,"extra-padding":f,"has-pointer":b,bottom:b==="bottom","has-form":v}),...S,children:d.jsx("div",{className:"content",hidden:m==="hidden",children:r?d.jsx("p",{children:c.formatMessage({id:"tooltip_loading"})}):typeof a=="string"?d.jsx("p",{children:a}):a})})}),Lr=(e,t)=>{Array.isArray(t)||(t=[t]);const n=yn(e);return t.forEach(({type:r,value:a})=>{Rh(n,r,a)}),n},Mc=e=>{const t=[];return e.forEach(n=>{const r=parseInt(n);isNaN(r)||t.push(r)}),t.sort((n,r)=>n-r)},Rc=(e,t,n)=>{let r=n.mobile;for(const a in t){const i=parseInt(String(t[a]));if(e>=i)r=n[i];else if(e<i)break}return r},Ic=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),$c=(e="")=>e.replace(/(?:^\w|[A-Z]|\b\w)/g,t=>t.toUpperCase()).replace(/[&\s]+/g,""),Lc=(e="")=>e.charAt(0).toUpperCase()+e.slice(1),Vh=(e="")=>e.replace(/(?:^\w|[A-Z]|\b\w)/g,t=>t.toUpperCase()),Lt="https://storage.googleapis.com/apolitical-assets/",zn={general:"hello@apolitical.co",support:"concierge@apolitical.co","data-protection":{default:"dpo@apolitical.co",eu:"dpo.agl@apolitical.foundation"}},br={ARTICLE:"microcourseArticle",DISCUSSION:"microcourseDiscussion",QUIZ:"assessmentQuiz"},ds="SU:",zc="Invalid token error: Logging user out...",Kh="200,000+",Zh="160+",Ar=/@{{([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})}}/g,qc=new RegExp("(?<=^|\\s)@([A-Za-z]+(?:[- ]?[A-Za-z]*)*)$");function Wc(e){return e?{"--icon":`url(${Lt}icons/${e}.svg)`}:{}}const vn={milliseconds:{inSecond:1e3,inMinute:6e4,inHour:36e5,inDay:864e5},year:{weeks:52,days:365}},Uc=(e,t="en")=>new Date(e).toLocaleString(t,{day:"numeric",month:"short"}),Vs=(e,t="en")=>new Date(e).toLocaleString(t,{weekday:"long",day:"numeric",month:"short",year:"numeric"}),fs=e=>{let t;const n=ka(),r=ka(new Date(e));try{t=n.getTime()-r.getTime()}catch{return""}const a=t/vn.milliseconds.inHour,i=Math.floor(t/vn.milliseconds.inDay);if(i<1)return a<1?{path:"now"}:{path:"hours",number:Math.floor(a)};if(i<7)return{path:"days",number:i};const s=Math.floor(i/7);return s<=vn.year.weeks?{path:"weeks",number:s}:{path:"years",number:Math.floor(i/vn.year.days)}},ka=e=>{const n=(e||new Date).toUTCString();return new Date(n)},Yh=(e,t,n)=>{let r;const a=ka(),i=ka(new Date(e));try{r=a.getTime()-i.getTime()}catch{return!1}switch(n){case"seconds":return r/vn.milliseconds.inSecond<=t;case"minutes":return r/vn.milliseconds.inMinute<=t;case"hours":return r/vn.milliseconds.inHour<=t}return!1},Gh=(e,t)=>{const n=new Date(e);return Math.abs(new Date().getTime()-n.getTime())/(1e3*60*60*24)<t},Qh=e=>new Promise(t=>setTimeout(t,e)),Jh=()=>{let e=!1;return typeof window<"u"&&(e=!!(window&&window.location&&window.location.href&&window.location.href.includes("localhost"))),e},ar={apolitical:"Apolitical",dates_now:"now",dates_hours:"{number}h",dates_days:"{number}d",dates_weeks:"{number}w",dates_years:"{number}y",card_carousel_viewAll:"View all",card_label_communityPage:"Community",card_label_event:"Event",card_label_learningHub:"Programme",card_label_listPage:"List",card_label_microcourse:"Course",card_label_qaQuestion:"Q&A",card_label_solutionArticle:"Article",card_bootcamp:"Email boot camp",card_ended:"Ended",card_new:"New",card_registered:"Registered",card_partner:"{partner} and {number} more",card_contributors_event:"Multiple speakers",card_contributors_solutionArticle:"Multiple authors",card_answers:"{number, plural, =0 {0 answers} one {# answer} other {# answers}}",card_time_ago:"{time} ago",card_time_read:"{time} min read",card_watch:"Watch recording",card_member_type_owner:"Admin",card_member_type_member:"Member",card_member_count:"{count} members",card_cta_people:"View profile",card_cta_communityPage:"Join now",card_cta_event:"Register now",card_cta_microcourse:"Enrol now",card_cta_communityPage_loading:"Joining...",card_cta_event_loading:"Registering...",card_cta_microcourse_loading:"Enrolling...",card_cta_communityPage_done:"Joined",card_cta_event_done:"Registered",card_cta_microcourse_done:"Enrolled",carousel_pagination_previous:"Previous",carousel_pagination_next:"Next",carousel_pagination_page:"Page {number} of {total}",carousel_pagination_aria_live:"{direction} {count} cards available",activitySection_notFoundError:"Post not found",activitiesFeed_sorting_label:"Choose feed sorting method",activitiesFeed_rankingMethod_recent:"Recent",activitiesFeed_rankingMethod_popular:"Popular",activitiesFeed_rankingMethod_internalTesting:"Testing",communityDetails_members:"Members",communityDetails_viewAll:"View all",communityDetails_invite:"Invite colleagues",community_joinToPost:"Join community to create a post.",joinCommunityButton:"Join community",joinCommunityButton_short:"Join",joinCommunityButton_joining:"Joining...",joinCommunityButton_member:"Member",joinCommunityButton_member_aria:"Leave community",joinCommunityButton_leave:"Leave",joinCommunityButton_leaving:"Leaving...",joinCommunityButton_closed_tooltip:"Please contact the admin of this closed community if you would like to join it.",joinCommunityButton_aria_live:"You are {action} this community",member_apolitical:"Apolitical",member_community:"Community post",membersList:"Members",membersList_admin:"Admin",courseStructure_section:"{number, plural, =0 {Start here} other {Section #}}",courseStructure_section_end:"End here",courseStructure_time_left:"left",courseStructure_time_completed:"Completed",courseProgression_done:"<percent>{number}%</percent> done",courseProgression_timeLeft:"left","lessonType_analyse-data":"Analyse data","lessonType_analyse-scenarios":"Analyse scenarios","lessonType_attend-webinar":"Attend webinar","lessonType_brainstorm-ideas":"Brainstorm ideas","lessonType_discuss-with-peers":"Discuss with peers","lessonType_discuss-with-team":"Discuss with team","lessonType_do-activity":"Do activity","lessonType_do-assessment":"Do assessment","lessonType_explore-casebook":"Explore casebook","lessonType_fill-out-workbook":"Fill out workbook","lessonType_fill-out-worksheet":"Fill out worksheet","lessonType_investigate-interview":"Investigate interview","lessonType_listen-to-audio":"Listen to audio","lessonType_listen-to-audiocast":"Listen to audiocast","lessonType_listen-to-podcast":"Listen to podcast","lessonType_read-article":"Read article","lessonType_read-article-by-expert":"Read article by expert","lessonType_read-article-by-public-servant":"Read article by public servant","lessonType_read-conclusion":"Read conclusion","lessonType_read-infographic":"Read infographic","lessonType_read-introduction":"Read introduction","lessonType_read-resource":"Read resource","lessonType_reflect-on-content":"Reflect on content","lessonType_share-experiences":"Share experiences","lessonType_take-quiz":"Take quiz","lessonType_use-toolkit":"Use toolkit","lessonType_watch-video":"Watch video","lessonType_watch-webinar":"Watch webinar",markCompleteButton:"Mark as complete",markCompleteButton_completed:"Lesson complete",discussion_action_answer:"answer",discussion_action_comment:"comment",discussion_action_post:"post",discussion_action_response:"response",discussion_action_reply:"reply",discussion_action_question:"question",discussion_edited:"Edited",discussion_delete_title:"Delete {action}",discussion_delete_text:"<p>Are you sure you want to delete your {action}?</p><p>This can't be undone.</p>",discussion_delete_cancel:"Cancel",discussion_delete_delete:"Delete",discussion_delete_error:"We are unable to delete your {action} at the moment. Please try again later or contact us if problem persists.",discussion_reply:"Reply",discussion_report_subject:"Report a post on Apolitical",discussion_report_body:`I'd like to report the {contentType} <{contentSlug}> at {contentUrl}.
31
+ Check the top-level render call using <`+ce+">.")}return se}}function zo(O,se){{if(!O._store||O._store.validated||O.key!=null)return;O._store.validated=!0;var ce=Bh(se);if(Lo[ce])return;Lo[ce]=!0;var De="";O&&O._owner&&O._owner!==ur.current&&(De=" It was passed a child from "+B(O._owner.type)+"."),Pn(O),E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',ce,De),Pn(null)}}function qo(O,se){{if(typeof O!="object")return;if(_e(O))for(var ce=0;ce<O.length;ce++){var De=O[ce];di(De)&&zo(De,se)}else if(di(O))O._store&&(O._store.validated=!0);else if(O){var Oe=b(O);if(typeof Oe=="function"&&Oe!==O.entries)for(var Le=Oe.call(O),je;!(je=Le.next()).done;)di(je.value)&&zo(je.value,se)}}}function Ah(O){{var se=O.type;if(se==null||typeof se=="string")return;var ce;if(typeof se=="function")ce=se.propTypes;else if(typeof se=="object"&&(se.$$typeof===l||se.$$typeof===h))ce=se.propTypes;else return;if(ce){var De=B(se);Te(ce,O.props,"prop",De,O)}else if(se.PropTypes!==void 0&&!ci){ci=!0;var Oe=B(se);E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Oe||"Unknown")}typeof se.getDefaultProps=="function"&&!se.getDefaultProps.isReactClassApproved&&E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Th(O){{for(var se=Object.keys(O.props),ce=0;ce<se.length;ce++){var De=se[ce];if(De!=="children"&&De!=="key"){Pn(O),E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",De),Pn(null);break}}O.ref!==null&&(Pn(O),E("Invalid attribute `ref` supplied to `React.Fragment`."),Pn(null))}}function Wo(O,se,ce,De,Oe,Le){{var je=N(O);if(!je){var Fe="";(O===void 0||typeof O=="object"&&O!==null&&Object.keys(O).length===0)&&(Fe+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var at=Fh(Oe);at?Fe+=at:Fe+=$o();var Ze;O===null?Ze="null":_e(O)?Ze="array":O!==void 0&&O.$$typeof===t?(Ze="<"+(B(O.type)||"Unknown")+" />",Fe=" Did you accidentally export a JSX literal instead of a component?"):Ze=typeof O,E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Ze,Fe)}var Ge=li(O,se,ce,Oe,Le);if(Ge==null)return Ge;if(je){var yt=se.children;if(yt!==void 0)if(De)if(_e(yt)){for(var Nn=0;Nn<yt.length;Nn++)qo(yt[Nn],O);Object.freeze&&Object.freeze(yt)}else E("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else qo(yt,O)}return O===r?Th(Ge):Ah(Ge),Ge}}function Sh(O,se,ce){return Wo(O,se,ce,!0)}function jh(O,se,ce){return Wo(O,se,ce,!1)}var Oh=jh,Ph=Sh;cr.Fragment=r,cr.jsx=Oh,cr.jsxs=Ph}()),cr}process.env.NODE_ENV==="production"?cs.exports=qh():cs.exports=Wh();var d=cs.exports;const Sc=()=>{const[e,t]=C.useState(window.location.pathname),n=()=>{const r=window.location.pathname;t(r)};return C.useEffect(()=>(window.addEventListener("popstate",n),()=>{window.removeEventListener("popstate",n)}),[]),e},Qn=(e,t)=>{const n=C.useRef(!1);C.useEffect(()=>{n.current?e():n.current=!0},t)};function jc(e,t,n){var r=this,a=C.useRef(null),i=C.useRef(0),s=C.useRef(null),o=C.useRef([]),l=C.useRef(),u=C.useRef(),c=C.useRef(e),h=C.useRef(!0);c.current=e;var p=typeof window<"u",m=!t&&t!==0&&p;if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var g=!!(n=n||{}).leading,f=!("trailing"in n)||!!n.trailing,b="maxWait"in n,v="debounceOnServer"in n&&!!n.debounceOnServer,E=b?Math.max(+n.maxWait||0,t):null;C.useEffect(function(){return h.current=!0,function(){h.current=!1}},[]);var k=C.useMemo(function(){var x=function(N){var L=o.current,_=l.current;return o.current=l.current=null,i.current=N,u.current=c.current.apply(_,L)},w=function(N,L){m&&cancelAnimationFrame(s.current),s.current=m?requestAnimationFrame(N):setTimeout(N,L)},A=function(N){if(!h.current)return!1;var L=N-a.current;return!a.current||L>=t||L<0||b&&N-i.current>=E},S=function(N){return s.current=null,f&&o.current?x(N):(o.current=l.current=null,u.current)},q=function N(){var L=Date.now();if(A(L))return S(L);if(h.current){var _=t-(L-a.current),B=b?Math.min(_,E-(L-i.current)):_;w(N,B)}},$=function(){if(p||v){var N=Date.now(),L=A(N);if(o.current=[].slice.call(arguments),l.current=r,a.current=N,L){if(!s.current&&h.current)return i.current=a.current,w(q,t),g?x(a.current):u.current;if(b)return w(q,t),x(a.current)}return s.current||w(q,t),u.current}};return $.cancel=function(){s.current&&(m?cancelAnimationFrame(s.current):clearTimeout(s.current)),i.current=0,o.current=a.current=l.current=s.current=null},$.isPending=function(){return!!s.current},$.flush=function(){return s.current?S(Date.now()):u.current},$},[g,b,t,E,f,m,p,v]);return k}function Oc(e,t,n){var r=n===void 0?{}:n,a=r.leading,i=r.trailing;return jc(e,t,{maxWait:t,leading:a===void 0||a,trailing:i===void 0||i})}let fi;const rr=(e=!0,t=!1,n="window")=>{if(!e)return;const[r,a]=C.useState(0)||[!1,()=>{}],i=n==="window"?[]:[n];C.useEffect(()=>(o(),window.addEventListener("resize",u),window.addEventListener("hashchange",u),window.addEventListener("hiddenSectionVisible",l),()=>{clearTimeout(fi),u.flush(),window.removeEventListener("resize",u),window.removeEventListener("hashchange",u),window.removeEventListener("hiddenSectionVisible",l)}),i);const s=()=>{if(n)return n==="window"?window.innerWidth:n.offsetWidth},o=()=>{a(s())},l=({detail:c})=>{const{id:h}=c;n==="window"||!n.closest(`#${h}`)||s()===r||o()},u=Oc(()=>{s()!==r&&(t&&(clearTimeout(fi),document.body.classList.add("is-resizing"),fi=setTimeout(()=>{document.body.classList.remove("is-resizing")},550)),o())},500,{leading:!0});return r},Pc=({scrollPosition:e=0,offset:t={down:0,up:10},callbacks:{scrollDown:n=()=>{},scrollUp:r=()=>{}}})=>{if(!window)return;const[a,i]=C.useState({current:0,past:0})||[!1,()=>{}],[s,o]=C.useState({scrollDown:!1,scrollUp:!1})||[!1,()=>{}];C.useEffect(()=>(l(),window.addEventListener("scroll",u),()=>{u.flush(),window.removeEventListener("scroll",u)}),[]);const l=()=>{const c=window.scrollY,h=a.current,p=c-h,m=p>0?"down":"up";if(i({current:c,past:h}),m==="down"){c>=e+t.down&&!s.scrollDown&&(!s.scrollUp||p>t.up)&&(n(),o({scrollUp:!1,scrollDown:!0}));return}Math.abs(p)>=t.up&&!s.scrollUp&&(r(),o({scrollUp:!0,scrollDown:!1}))},u=Oc(()=>{l()},250);return a},Us=(e=[],t=!0)=>{e=Array.isArray(e)?e:[e];const n=C.useRef(!1);Qn(()=>{if(window&&window.location&&window.location.hash){if(n.current)return;const r=document.getElementById(window.location.hash.replace("#",""));r&&(r.scrollIntoView(t?{behavior:"smooth"}:null),n.current=!0)}},e)},Hs=(e=!1)=>{if(!e)return{showTooltip:!1,tooltipProps:{}};const[t,n]=C.useState(!1);return{showTooltip:t,tooltipProps:{onMouseOver:()=>n(!0),onMouseOut:()=>n(!1),onFocus:()=>n(!0),onBlur:()=>n(!1),tabIndex:0}}};const Ko={},Sn=C.forwardRef(({id:e,styling:t={},isOpen:n=!1,isLoading:r=!1,children:a,className:i="",functions:s={},callbacks:o={},...l},u)=>{const c=oe.useIntl(),h=C.useRef(null),p=u||h,[m,g]=C.useState(n?"open":"hidden"),{extraPadding:f=!0,hasPointer:b=!1,hasForm:v=!1}=t,{onOpen:E=()=>{},onClose:k=()=>{}}=o;e||(e=Date.now().toString());const x=Ko[e];C.useEffect(()=>{const q=p==null?void 0:p.current;if(q)return q.addEventListener("transitionend",w),q.addEventListener("keydown",A),()=>{q.removeEventListener("transitionend",w),q.removeEventListener("keydown",A)}},[]);const w=({propertyName:q})=>{q==="opacity"&&(x!==!1&&clearTimeout(x),g($=>($==="open"?E():$==="closed"&&k(),$==="opening"?"open":$==="closing"?"closed":$==="closed"?"hidden":$)))},A=q=>{q.key==="Escape"&&(q.stopPropagation(),q.preventDefault(),g("closing"))};Qn(()=>{x!==!1&&clearTimeout(x);let q="open";n?g("opening"):(g("closing"),q="hidden"),Ko[e||""]=setTimeout(()=>{g(q)},300)},[n]);const S={...l};return s&&s.onBlur&&(S.onBlur=s.onBlur),d.jsx("aside",{ref:p,className:Y("tooltip text-medium",m,i,{loading:r,"extra-padding":f,"has-pointer":b,bottom:b==="bottom","has-form":v}),...S,children:d.jsx("div",{className:"content",hidden:m==="hidden",children:r?d.jsx("p",{children:c.formatMessage({id:"tooltip_loading"})}):typeof a=="string"?d.jsx("p",{children:a}):a})})}),Lr=(e,t)=>{Array.isArray(t)||(t=[t]);const n=yn(e);return t.forEach(({type:r,value:a})=>{Nh(n,r,a)}),n},Nc=e=>{const t=[];return e.forEach(n=>{const r=parseInt(n);isNaN(r)||t.push(r)}),t.sort((n,r)=>n-r)},Rc=(e,t,n)=>{let r=n.mobile;for(const a in t){const i=parseInt(String(t[a]));if(e>=i)r=n[i];else if(e<i)break}return r},Mc=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),Ic=(e="")=>e.replace(/(?:^\w|[A-Z]|\b\w)/g,t=>t.toUpperCase()).replace(/[&\s]+/g,""),$c=(e="")=>e.charAt(0).toUpperCase()+e.slice(1),Uh=(e="")=>e.replace(/(?:^\w|[A-Z]|\b\w)/g,t=>t.toUpperCase()),Lt="https://storage.googleapis.com/apolitical-assets/",zn={general:"hello@apolitical.co",support:"concierge@apolitical.co","data-protection":{default:"dpo@apolitical.co",eu:"dpo.agl@apolitical.foundation"}},br={ARTICLE:"microcourseArticle",DISCUSSION:"microcourseDiscussion",QUIZ:"assessmentQuiz"},ds="SU:",Lc="Invalid token error: Logging user out...",Hh="200,000+",Vh="160+",Ar=/@{{([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})}}/g,zc=new RegExp("(?<=^|\\s)@([A-Za-z]+(?:[- ]?[A-Za-z]*)*)$");function qc(e){return e?{"--icon":`url(${Lt}icons/${e}.svg)`}:{}}const vn={milliseconds:{inSecond:1e3,inMinute:6e4,inHour:36e5,inDay:864e5},year:{weeks:52,days:365}},Wc=(e,t="en")=>new Date(e).toLocaleString(t,{day:"numeric",month:"short"}),Vs=(e,t="en")=>new Date(e).toLocaleString(t,{weekday:"long",day:"numeric",month:"short",year:"numeric"}),fs=e=>{let t;const n=ka(),r=ka(new Date(e));try{t=n.getTime()-r.getTime()}catch{return""}const a=t/vn.milliseconds.inHour,i=Math.floor(t/vn.milliseconds.inDay);if(i<1)return a<1?{path:"now"}:{path:"hours",number:Math.floor(a)};if(i<7)return{path:"days",number:i};const s=Math.floor(i/7);return s<=vn.year.weeks?{path:"weeks",number:s}:{path:"years",number:Math.floor(i/vn.year.days)}},ka=e=>{const n=(e||new Date).toUTCString();return new Date(n)},Kh=(e,t,n)=>{let r;const a=ka(),i=ka(new Date(e));try{r=a.getTime()-i.getTime()}catch{return!1}switch(n){case"seconds":return r/vn.milliseconds.inSecond<=t;case"minutes":return r/vn.milliseconds.inMinute<=t;case"hours":return r/vn.milliseconds.inHour<=t}return!1},Zh=(e,t)=>{const n=new Date(e);return Math.abs(new Date().getTime()-n.getTime())/(1e3*60*60*24)<t},Yh=e=>new Promise(t=>setTimeout(t,e)),Gh=()=>{let e=!1;return typeof window<"u"&&(e=!!(window&&window.location&&window.location.href&&window.location.href.includes("localhost"))),e},ar={apolitical:"Apolitical",dates_now:"now",dates_hours:"{number}h",dates_days:"{number}d",dates_weeks:"{number}w",dates_years:"{number}y",card_carousel_viewAll:"View all",card_label_communityPage:"Community",card_label_event:"Event",card_label_learningHub:"Programme",card_label_listPage:"List",card_label_microcourse:"Course",card_label_qaQuestion:"Q&A",card_label_solutionArticle:"Article",card_bootcamp:"Email boot camp",card_ended:"Ended",card_new:"New",card_registered:"Registered",card_partner:"{partner} and {number} more",card_contributors_event:"Multiple speakers",card_contributors_solutionArticle:"Multiple authors",card_answers:"{number, plural, =0 {0 answers} one {# answer} other {# answers}}",card_time_ago:"{time} ago",card_time_read:"{time} min read",card_watch:"Watch recording",card_member_type_owner:"Admin",card_member_type_member:"Member",card_member_count:"{count} members",card_cta_people:"View profile",card_cta_communityPage:"Join now",card_cta_event:"Register now",card_cta_microcourse:"Enrol now",card_cta_communityPage_loading:"Joining...",card_cta_event_loading:"Registering...",card_cta_microcourse_loading:"Enrolling...",card_cta_communityPage_done:"Joined",card_cta_event_done:"Registered",card_cta_microcourse_done:"Enrolled",carousel_pagination_previous:"Previous",carousel_pagination_next:"Next",carousel_pagination_page:"Page {number} of {total}",carousel_pagination_aria_live:"{direction} {count} cards available",activitySection_notFoundError:"Post not found",activitiesFeed_sorting_label:"Choose feed sorting method",activitiesFeed_rankingMethod_recent:"Recent",activitiesFeed_rankingMethod_popular:"Popular",activitiesFeed_rankingMethod_internalTesting:"Testing",communityDetails_members:"Members",communityDetails_viewAll:"View all",communityDetails_invite:"Invite colleagues",community_joinToPost:"Join community to create a post.",joinCommunityButton:"Join community",joinCommunityButton_short:"Join",joinCommunityButton_joining:"Joining...",joinCommunityButton_member:"Member",joinCommunityButton_member_aria:"Leave community",joinCommunityButton_leave:"Leave",joinCommunityButton_leaving:"Leaving...",joinCommunityButton_closed_tooltip:"Please contact the admin of this closed community if you would like to join it.",joinCommunityButton_aria_live:"You are {action} this community",member_apolitical:"Apolitical",member_community:"Community post",membersList:"Members",membersList_admin:"Admin",courseStructure_section:"{number, plural, =0 {Start here} other {Section #}}",courseStructure_section_end:"End here",courseStructure_time_left:"left",courseStructure_time_completed:"Completed",courseProgression_done:"<percent>{number}%</percent> done",courseProgression_timeLeft:"left","lessonType_analyse-data":"Analyse data","lessonType_analyse-scenarios":"Analyse scenarios","lessonType_attend-webinar":"Attend webinar","lessonType_brainstorm-ideas":"Brainstorm ideas","lessonType_discuss-with-peers":"Discuss with peers","lessonType_discuss-with-team":"Discuss with team","lessonType_do-activity":"Do activity","lessonType_do-assessment":"Do assessment","lessonType_explore-casebook":"Explore casebook","lessonType_fill-out-workbook":"Fill out workbook","lessonType_fill-out-worksheet":"Fill out worksheet","lessonType_investigate-interview":"Investigate interview","lessonType_listen-to-audio":"Listen to audio","lessonType_listen-to-audiocast":"Listen to audiocast","lessonType_listen-to-podcast":"Listen to podcast","lessonType_read-article":"Read article","lessonType_read-article-by-expert":"Read article by expert","lessonType_read-article-by-public-servant":"Read article by public servant","lessonType_read-conclusion":"Read conclusion","lessonType_read-infographic":"Read infographic","lessonType_read-introduction":"Read introduction","lessonType_read-resource":"Read resource","lessonType_reflect-on-content":"Reflect on content","lessonType_share-experiences":"Share experiences","lessonType_take-quiz":"Take quiz","lessonType_use-toolkit":"Use toolkit","lessonType_watch-video":"Watch video","lessonType_watch-webinar":"Watch webinar",markCompleteButton:"Mark as complete",markCompleteButton_completed:"Lesson complete",discussion_action_answer:"answer",discussion_action_comment:"comment",discussion_action_post:"post",discussion_action_response:"response",discussion_action_reply:"reply",discussion_action_question:"question",discussion_edited:"Edited",discussion_delete_title:"Delete {action}",discussion_delete_text:"<p>Are you sure you want to delete your {action}?</p><p>This can't be undone.</p>",discussion_delete_cancel:"Cancel",discussion_delete_delete:"Delete",discussion_delete_error:"We are unable to delete your {action} at the moment. Please try again later or contact us if problem persists.",discussion_reply:"Reply",discussion_report_subject:"Report a post on Apolitical",discussion_report_body:`I'd like to report the {contentType} <{contentSlug}> at {contentUrl}.
32
32
 
33
33
  Please explain why you're reporting this post. Reasons could include: inappropriate language, harassment, spam, hate speech, false information, among others. Include as much detail as you feel comfortable.
34
34
 
35
- Thank you for helping to protect the Apolitical community from abusive content.`,discussionFormCard_placeholder:"Write a post or ask a question...",discussionFormCard_overlay_title:"Discard post",discussionFormCard_overlay_text:"Are you sure you want to leave without posting? Changes you have made will not be saved.",discussionFormCard_overlay_cta_discard:"Discard",discussionFormCard_overlay_cta_continue:"Continue editing",discussion_form_title:"Write your {action}",discussion_form_titleField_label:"Title",discussion_form_titleField_placeholder:"Write something...",discussion_form_titleField_error:"Please enter a title or a body for your post.",discussion_form_placeholder:"Write a {action}...",discussion_form_label:"Body",discussion_form_label_action:"Your {action}",discussion_form_explainer:"Try to make your {action} specific and practical. Be respectful and kind. See our <a>community guidelines</a>",discussion_form_success:"Your {action} has been submitted.",discussion_form_post:"Post",discussion_form_posting:"Posting...",discussion_form_save:"Save",discussion_form_saving:"Saving...",discussion_form_cancel:"Cancel",discussion_form_submitting:"Submitting...",discussion_form_placeholder_post:"Share a question, insight, or announcement with the community",discussion_form_error:"We are unable to process your {action} right now. Please try again later or contact us if the problem persists",discussion_form_error_tooLong:"Please keep your content to {maxLength, plural, one {1 character} other {# characters}}.",discussion_form_error_tooMany:"You have posted too many times in a row. Please wait and try again.",discussion_form_error_loggedOut:"Please log in to submit your {action}.",discussion_form_error_noPermission:"You do not have permission to {action}.",discussion_form_error_alreadyExists:"This {action} already exists.",discussion_form_title_question:"Start a conversation",discussion_form_placeholder_question:"Ask your question here",discussion_form_explainer_question:"Unsure what you can post? See our <a>community guidelines</a>.",discussion_likes:"{number, plural, =0 {0 likes} one {# like} other {# likes}}",discussion_likes_short:"{number}",discussion_likes_more:"and {number} more...",discussion_likes_like:"Like this {action}",discussion_likes_unlike:"Unlike {action}",discussion_likes_show:"Show who liked this {action}",discussion_moreMenu_edit:"Edit",discussion_moreMenu_delete:"Delete",discussion_moreMenu_report:"Report",discussion_comments_screenReader:"See {count, plural, =0 {0 comments} one {# comment} other {# comments}}",discussion_comments:"{count, plural, =0 {0 comments} one {# comment} other {# comments}}",discussion_responses_answer:"Answers",discussion_responses_comment:"Comments",discussion_responses_title:"{action} ({count})",discussion_responses_empty:"Be the first to respond",discussion_responses_empty_answer:"Be the first to answer this question",discussion_responses_placeholder:"Write a comment...",discussion_share_copy_link:"Copy link",discussion_share_copy_link_success:"Link copied to clipboard",discussion_thread_show:"Show {count} {count, select, 1 {reply} other {replies}}",discussion_thread_hide:"Hide replies",discussion_thread_loadMore:"Load more replies",profileModalLauncher_successMessage:"Your post has been created",profileModalLauncher_title:"Your profile is incomplete",profileModalLauncher_text:"A complete profile builds trust and amplifies your voice across the community. Ensure all your details are up to date including a photo and a bio.",contactFooter_title:"Contact us",contactFooter_text:"We're always open to new ideas, so please reach out to see how we can collaborate.",contactFooter_phone:"+44 203 608 2241",contactFooter_email:"hello@apolitical.co",contactForm_name:"Name",contactForm_email:"Email address",contactForm_organisation:"Government department or organisation",contactForm_interests:"I'm interested in",contactForm_interests_publishingCourse:"Publishing or creating a course",contactForm_interests_buyingCourse:"Buying courses for my team",contactForm_interests_learningExperience:"Customised learning experiences",contactForm_interests_somethingElse:"Something else",contactForm_message:"Message",dropdown_menu_multiselect_all:"All",dropdown_menu_multiselect_none:"None",emailHelperTextBox_fallback_title:"Who can join",emailHelperTextBox_fallback_text:"Apolitical is a private community for public servants and policymakers.",emailHelperTextBox_default_title:"Who can join",emailHelperTextBox_default_text:"Apolitical is a private community for public servants and policymakers. <link>Learn more</link>.",emailHelperTextBox_autoApproved_title:"Email check",emailHelperTextBox_autoApproved_text:"Great! Looks like you are using a **government email domain we recognise.** You will be **auto-approved** once you sign up.",emailHelperTextBox_unrecognisedEmail_title:"Not a recognised government email",emailHelperTextBox_unrecognisedEmail_text:"To confirm you work in government or policy, please add more details below. <link>Learn more</link>.",emailHelperTextBox_pendingApproval_title:"Email is pending approval",emailHelperTextBox_pendingApproval_text:"Looks like this email has been used to sign up to Apolitical before, but <strong>we have not yet approved it.</strong> If you cannot wait to join, contact <mail>concierge@apolitical.co</mail>.",emailHelperTextBox_emailUnverified_title:"Hello again!",emailHelperTextBox_emailUnverified_text:"It looks like you're already an Apolitical member. To access your account, please verify your email address. <link>Click here to get a verification code sent to your email</link>.",emailHelperTextBox_emailAlreadyExists_title:"Email is already registered",emailHelperTextBox_emailAlreadyExists_text:"Looks like this email has been used to sign up to Apolitical before, try <link>logging in</link> instead. If you're still having issues, contact <mail>concierge@apolitical.co</mail>.",emailHelperTextBox_error_verificationFailedToSend_title:"Verification code failed to send",emailHelperTextBox_error_verificationFailedToSend_text:"Error details: <em>{error}</em>{br}<link>Click here to try again</link>.{br}If you continue to have problems, contact us at <mail>concierge@apolitical.co</mail>",emailHelperTextBox_error_noFunction:"Cannot resend verification code.",form_fieldWrapper_required:"required",form_fieldWrapper_characterLimit:"Character limit:",form_fieldWrapper_characterLimit_aria_default:"You have {remaining, plural, =0 {no characters} one {1 character} other {# characters}} remaining.",form_fieldWrapper_characterLimit_aria_over:"You are {over, plural, one {1 character} other {# characters}} over the limit. Please shorten your text to {limit} characters.",form_fieldWrapper_characterLimit_info:"You can enter up to {limit} characters",form_error_generalError:"Sorry, something has gone. Please refresh the page and try again.",form_error_required:"Please fill in this required field",form_error_numbers:"Numbers are not allowed in this text field",form_error_email:"Please enter a valid email address",form_error_url:"Please enter a valid URL",form_cancel:"Cancel",form_submit:"Submit",form_submitting:"Submitting form...",form_submitted:"Submitted",form_success:"Thank you for submitting the form!",inviteForm_email_placeholder:"Add email addresses...",inviteForm_title:"Know someone who might like to join this workshop?",inviteForm_label:"Invite your colleagues by typing or pasting their email addresses below",inviteForm_ctaMessage:"Send",inviteForm_success:"Invitation Sent!",inviteForm_error:"Something went wrong!",inviteForm_ctaTryAgain:"Try again!",inviteForm_ctaSendMoreInvites:"Send more invites",inviteForm_ctaDone:"Done",inputAutocomplete_placeholder:"Start typing...",passwordRules_unmatched_text:"Passwords do not match",passwordRules_intro:"We advise you not to use your name or email in your password.",passwordRules_rule_label:"Password",passwordRules_rule_8Characters:"must be longer than 8 characters",passwordRules_rule_numberSymbol:"must include a number and a symbol",passwordRules_rule_lowercaseUppercase:"must include both lower and upper case characters",passwordRules_notMet:"Your password does not meet this requirement",passwordRules_currentPassword_label:"Current password",passwordRules_newPassword_label:"New password",passwordRules_confirmPassword_label:"Confirm new password",profileForm_image:"Upload photo",profileForm_name:"Full name",profileForm_name_placeholder:"What's your name, so people can recognise you?",profileForm_jobTitle:"Job title",profileForm_jobTitle_placeholder:"What's your current job title?",profileForm_organization:"Organisation",profileForm_organization_placeholder:"Where do you work?",profileForm_location:"Location",profileForm_location_placeholder:"Add your city",profileForm_location_error:"Please choose a location from the list.",profileForm_bio:"Bio",profileForm_bio_placeholder:"Tell us more about yourself...",profileForm_cta:"Save",profileImageChange_cta_uploading:"Uploading image...",profileImageChange_cta_change:"Change photo",profileImageChange_cta_upload:"+ Add profile photo",profileImageChange_error:"There was an error uploading the image. Please try a different file format or reduce the file size to less than 5MB. Contact us if problem persists.",ratings_text:"Rate answer",ratings_stars:"{number} out of {total}",ratings_low:"this is incorrect or confusing",ratings_high:"this is a fantastic answer",ratings_success:"Thank you!",richTextEditor_placeholder:"Write something...",richTextEditor_toolbar:"Formatting options",richTextEditor_bold:"Bold",richTextEditor_italic:"Italic",richTextEditor_strikeThrough:"Strikethrough",richTextEditor_link:"Link",richTextEditor_link_text:"Text:",richTextEditor_link_text_aria:"Text to be linked:",richTextEditor_link_url:"Link:",richTextEditor_link_placeholder:"Type or paste URL",richTextEditor_link_error_required:"Please enter a URL to link to",richTextEditor_link_open:"Open: {link}",richTextEditor_link_open_text:"Opens in a new window",richTextEditor_link_edit:"Edit",richTextEditor_link_remove:"Remove",richTextEditor_link_button:"Add link",richTextEditor_ol_list:"Numbered list",richTextEditor_ul_list:"Bullet-point list",richTextEditor_block_quote:"Quote",richTextEditor_mention_fallback:"Can't find who you're looking for? Invite them to the community",search_label:"Search for:",search_placeholder:"Ask Apolitical",search_clear:"Clear search",search_cta:"Search",showpassword_show:"Show",showpassword_hide:"Hide",showpassword_aria_show:"Your password is hidden. Click to show.",showpassword_aria_hide:"Your password is visible. Click to hide.",signup_title:"Sign up",signup_full_name:"Full name",signup_full_name_placeholder:"Lionel Messi",signup_email_address:"Work email",signup_email_address_placeholder:"lionel.messi@argentina.gov",signup_job_title:"Job title",signup_job_title_placeholder:"e.g. Senior Policy Advisor",signup_organization:"Organisation",signup_organization_placeholder:"e.g. Department of Justice",signup_url:"Link to official government bio / LinkedIn <small>(optional)</small>",signup_url_placeholder:"https://organisation.com/bio",signup_expectation:"What do you want to know<small>Optional, but we will use your response to build the session!</small>",signup_expectation_placeholder:"What do you want to know?",signup_terms:"I accept Apolitical's <terms>Terms of Service</terms>, <privacy>Privacy Policy</privacy> and that I'll get essential emails for my use of Apolitical",signup_error:"We're really sorry, but we've had a problem trying to sign you up. This could be an issue with our system, so we suggest you try again later.",signup_button_join:"Join for free",signup_button_login:"Log in",signup_submitting:"Submitting form...",signup_success_title:"Thank you for applying to join Apolitical!",signup_success_text:"<p>Once we've vetted your application, you'll get a secure login link to help you get started.</p><p>Please note that trust is everything to our community, so you can't login until your identity has been verified.</p>",tableOfContents:"Table of contents",timeToComplete_hours:"{time, plural, =0 {} one {1 hour} other {# hours}}",timeToComplete_hours_short:"{time}h",timeToComplete_minutes:"{time, plural, =0 {} one {1 minute} other {# minutes}}",timeToComplete_minutes_short:"{time}m",timeToComplete_range:"{early} - {late}",timeToComplete_range_aria:"between {early} and {late}",tooltip_loading:"Loading...",return_to_nav_button:"Back to top",progressTracker:"Step {current} of {total}",cookieBanner_title:"Cookies and your privacy",cookieBanner_text:"We take your trust and privacy very seriously. Apolitical uses safe cookies (small files on your device) to run the site. You can reject non-essential cookies, but some site features may not work without them.",cookieBanner_buttons_settings:"Change my settings",cookieBanner_buttons_reject:"Reject all",cookieBanner_buttons_accept:"Accept all",footer_platform:"Platform",footer_platform_events:"Events",footer_platform_courses:"Courses",footer_platform_qanda:"Q&A",footer_platform_articles:"Articles",footer_platform_communities:"Communities",footer_community:"Community",footer_community_support:"Support FAQ",footer_community_post:"Post on Apolitical",footer_community_join:"Who can join",footer_community_guidelines:"Guidelines & values",footer_company:"Company",footer_company_news:"News",footer_company_insights:"Insights",footer_company_story:"Our story",footer_company_team:"Meet our team",footer_company_careers:"Careers",footer_company_partner:"Partner with us",footer_company_contact:"Get in touch",footer_legal:"Legal",footer_legal_privacy:"Privacy policy",footer_legal_terms:"Terms & conditions",footer_legal_cookie:"Cookie policy",footer_legal_accessibility:"Accessibility statement",footer_legal_ai:"AI principles",footer_legal_dataProtection:"Data protection officer",footer_legal_euDataProtection:"EU data protection officer",footer_contact:"Contact",footer_contact_correspondence:"Correspondence address",footer_contact_correspondence_address:"251 Southwark Bridge Road{br}London, SE1 6FL{br}United Kingdom",footer_contact_registered:"Registered address",footer_contact_registered_address:"20–22 Wenlock Road{br}London, N1 7GU{br}United Kingdom",footer_contact_berlin:"Berlin address",footer_contact_berlin_address:"Torstraße 220{br}10115 Berlin{br}Germany",footer_contact_support:"For platform support",footer_contact_business:"For business inquiries",footer_social_linkedin:"LinkedIn",footer_social_twitter:"Twitter",footer_social_facebook:"Facebook",footer_copyright:"Copyright © {currentYear} Apolitical Group Limited",header_skip:"Skip to main content",header_search_show:"Show search bar",header_search_hide:"Close search bar",header_menu_show:"Show navigation",header_menu_hide:"Close navigation",header_home_loggedOut:"Home",header_home_loggedIn:"My Home",header_topics:"Topics",header_topics_explore:"Explore",header_topics_explore_events:"Events",header_topics_explore_courses:"Courses","header_topics_explore_q-and-a":"Q&A",header_topics_explore_articles:"Articles",header_topics_explore_communities:"Communities",header_topics_topics:"Topics",header_topics_topics_climate:"Climate","header_topics_topics_cities-and-local-government":"Cities and local government","header_topics_topics_digital-and-data":"Digital and data",header_topics_topics_education:"Education","header_topics_topics_equity-justice-and-inclusion":"Equity, justice and inclusion","header_topics_topics_health-and-social-care":"Health and social care",header_topics_topics_innovation:"Innovation","header_topics_topics_leadership-and-skills":"Leadership and skills","header_topics_topics_life-in-government":"Life in government",header_topics_topics_policymaking:"Policymaking","header_topics_topics_transport-and-infrastructure":"Transport and infrastructure","header_topics_topics_work-and-the-economy":"Work and the economy",header_partners:"For partners",header_account:"My account",header_account_show:"Show account menu",header_account_hide:"Close account menu",header_account_profile:"My profile",header_account_settings:"Settings & privacy","header_account_log-out":"Log out",header_buttons_login:"Log in",header_buttons_signup:"Sign up",pageLayout_error:"An error occurred while rendering this page. Please refresh the page or try again later.",loadingBlock_loading:"Loading...",loadingBlock_almostDone:"Almost done...",loadingBlock_complete:"Complete!",progressBar:"{number}% loaded",discussionFormModal_title:"Create a post",discussionFormModal_cta:"Create post",inviteModal_title:"You’re registered",inviteModal_formTitle:"Know someone who might like to join this workshop?",inviteModal_formLabel:"Invite your colleagues by typing or pasting their email addresses below.",inviteModal_cta:"Send",overlay_close:"Close",profileModal_title:"Update your profile",breadcrumbs_label:"Go back to:",breadcrumbs_currentPage:"Current page:",filters_all:"Show all",filters_disabled:"{name} - no results",languageSwitcher_label:"I would like to read this article in...",languageSwitcher_translation_original:"original language",languageSwitcher_translation_human:"translated by person",languageSwitcher_translation_machine:"translated by machine",languageSwitcher_selected:"{language} - currently selected",languageSwitcher_disclaimer:"This content is machine translated and will occasionally get gendered language or other direct translations wrong. We’re trying to resolve this but in the meantime, if you notice something very wrong, let us know at <link>{email}</link>",loadMore_button:"Load more",loadMore_endOfFeed:"You're all caught up",loadMore_error:"We're having trouble loading more content. Please refresh the page or try again later.",moreMenu:"See more options",navigationMenu_links_homepage:"Home",navigationMenu_links_events:"Events",navigationMenu_links_microcourses:"Courses","navigationMenu_links_q-and-a":"Q&A",navigationMenu_links_articles:"Articles",navigationMenu_links_communities:"Communities",navigationMenu_profile:"My profile",shareLinks_label:"Share",shareLinks_link_linkedin:"Share on LinkedIn",shareLinks_link_twitter:"Share on Twitter",shareLinks_link_facebook:"Share on Facebook",shareLinks_link_email:"Share by email","shareLinks_link_clipboard-copy":"Copy the link",tags_community:"From the community",editSection_placeholder_description:"Add some details",editSection_placeholder_cta:"add",editSection_edit:"Edit",notFoundError_title:"We can't find that page",notFoundError_text:"Sorry about that. We all mess up sometimes - read some ‘fail’ stories below.",notFoundError_post_1:"Why public servants must learn to fail — and 3 tips for how to do it",notFoundError_post_2:"What failure has taught me",notFoundError_post_3:"How to learn from failure without causing a scandal",notFoundError_cta:"View more articles",collapsibleSection_summary:"Find out more",contentTypeLabel_event:"Event",contentTypeLabel_learningHub:"Programme",contentTypeLabel_listPage:"List",contentTypeLabel_microcourse:"Course",contentTypeLabel_qaQuestion:"Q&A",contentTypeLabel_solutionArticle:"Article",contentTypeLabel_communityPage:"Community",hideShowTextBox_hide:"View less",hideShowTextBox_show:"View more",markdown_collapsibleSection_summary:"Resources",markdown_skip_video:"Skip past video",markdown_skip_padlet:"Skip past interactive board",markdown_skip_poll:"Skip past poll",markdown_skip:"Skip to next section",markdown_iframe_title:"Course information",markdown_iframe_video:"Video",markdown_iframe_padlet:"Interactive board",markdown_iframe_poll:"Poll"},Xh={...ar,languageSwitcher_label:"Me gustaría leer este artículo en...",languageSwitcher_translation_original:"idioma original",languageSwitcher_translation_human:"traducido por un humano",languageSwitcher_translation_machine:"traducido por máquina",languageSwitcher_disclaimer:"Este contenido fue traducido automáticamente y ocasionalmente tendrá errores de género u otras traducciones directas. Estamos intentando resolver este problema, pero mientras tanto, si notas algún error grave, escríbenos a <link>{email}</link>"},em={...ar,languageSwitcher_label:"Je voudrais lire cet article dans...",languageSwitcher_translation_original:"langue originale",languageSwitcher_translation_human:"traduit par un humain",languageSwitcher_translation_machine:"traduit par machine",languageSwitcher_disclaimer:"Ce contenu est traduit automatiquement et contiendra d’évantuelles erreurs de genre ou d’autres traductions directes. Nous essayons de résoudre ce problème, mais en attendant, si vous remarquez une erreur importante, faites-le nous savoir à <link>{email}</link>",collapsibleSection_summary:"En savoir plus"},tm={...ar,languageSwitcher_label:"Eu gostaria de ler este artigo em...",languageSwitcher_translation_original:"linguagem original",languageSwitcher_translation_human:"traduzido por um humano",languageSwitcher_translation_machine:"traduzido por máquina",languageSwitcher_disclaimer:"Este conteúdo foi traduzido automaticamente e, ocasionalmente, poderão ocorrer erros de linguagem de gênero ou outras traduções diretas. Estamos tentando resolver isso, porém se perceber algo errado por favor nos avise em <link>{email}</link>"},nm=Object.freeze(Object.defineProperty({__proto__:null,en:ar,es:Xh,fr:em,pt:tm},Symbol.toStringTag,{value:"Module"})),Za=(e,t=ar)=>e in t,At=(e,t,n,r,a={})=>{let i="";return Za(`${t}_${n}`)?i=e({id:`${t}_${n}`},a):i=e({id:t},{[r]:n,...a}),i},rm=(e,t,n)=>{if(!e||e===0)return"0";t||(t=0),n||(n=["k","m","b","t"]);let r=e.toString();t=Math.pow(10,t);for(let a=n.length-1;a>=0;a--){const i=Math.pow(10,(a+1)*3);if(i<=e){e=Math.round(e*t/i)/t,e===1e3&&a<n.length-1&&(e=1,a++),r=`${e}${n[a]}`;break}}return r},ga=(e,t)=>y.Children.map(e,n=>Object.is(n,null)?n:y.cloneElement(n,{...t})),Hc=(e=0)=>{setTimeout(()=>{const t=document.querySelector(".splash-screen");t&&t.remove(),window.prerenderReady=!0},e)},am=e=>{var i,s,o;const n=["name","organization","jobTitle","biography"].every(l=>{const u=e[l];return u!=null&&u!==""}),r=((i=e.image)==null?void 0:i.thumbnail)!==void 0,a=((s=e.location)==null?void 0:s.en)!==void 0||((o=e.location)==null?void 0:o.country)!==void 0;return n&&r&&a},im=(e,t,n)=>!t.id||!t.name?"":n.replace(/{{name}}/g,t.name).replace(/{{id}}/g,t.id),Vc=async({text:e,template:t,mentions:n,listMembers:r=()=>Promise.resolve([])})=>{var i;if(!n)return e;const a=e.match(Ar);if(!a)return e;for(const s of a){const o=s.replace(Ar,(c,h)=>h),l=n[o];if(!l)continue;const u={};if(typeof l=="object")u.name=((i=l==null?void 0:l.data)==null?void 0:i.name)||"",u.id=l.id||"";else{const c=l;if(c.startsWith(ds))try{const h=c.replace(ds,"");u.id=h,await r({id:h}).then(p=>{const{name:m}=p;u.name=m||""})}catch{e.replace(s,"@");continue}else continue}e=e.replace(s,u.name?im(e,u,t):s)}return e},Kc=e=>{const t=e.startsWith("http")?e:`https://${e}`,r=new URL(t).hostname;return{full:t,pretty:r}},Zc=e=>new URLSearchParams(window.location.search).get(e),Yo=(e="")=>e.replace(/\s+/g,"").length>0,hs=e=>{const t=e.length>8,n=/[0-9]/.test(e)&&/[`!@#$%^&*()_+\-=[\]{}£;':"\\|,.<>/?~]/.test(e),r=new RegExp("^(?=.*?[A-Z])(?=.*?[a-z])").test(e);return{isValid:t&&n&&r,matchingRules:{isMoreThanEightCharacters:t,includesNumberAndSymbol:n,includesLowerAndUppercase:r}}};const Be=({variant:e="primary",size:t="medium",styling:n={muted:!1,fullWidth:!1},icon:r=!1,href:a=!1,element:i="button",onClick:s=!1,className:o="",disabled:l=!1,tooltip:u="",screenreaderText:c=!1,children:h=!1,...p})=>{const g=rr(typeof t=="object"),{showTooltip:f,tooltipProps:b}=Hs(!!u);if(typeof t=="object"&&typeof g=="number"){const x=Object.assign({},t),w=Mc(Object.keys(x));t=Rc(g,w,x)}!l&&u&&(u="");const v=[];typeof t=="string"&&v.push(t),r&&(v.push("icon"),typeof r=="object"?(v.push(r.icon),r.position?v.push(r.position):v.push("left"),r.hover&&v.push(`hover_${r.hover}`),r.animate&&(v.push("animate"),typeof r.animate=="string"&&v.push(r.animate))):(v.push(r),!r.includes("right")&&!r.includes("left")&&v.push("left"))),n.muted&&v.push("muted"),n.fullWidth&&v.push("full-width");const E={...p,className:G(e,o,v,{"no-text":!h,disabled:l,button:a}),onClick:x=>{(!a||a[0]==="#")&&s&&(x.preventDefault(),x.stopPropagation()),s&&s(x)},disabled:typeof l=="object"&&"isClickable"in l?!l.isClickable:l};a&&(i="a",E.href=a);const k=y.createElement(i,E,h||(c?d.jsx(Ie,{showOnFocus:!1,children:c}):null));return l&&u?d.jsxs("span",{className:"button-container",...b,children:[d.jsx(Sn,{isOpen:f,children:u}),k]}):k},ir=({buttons:e,wrappers:t=[],className:n="",...r})=>{const a=e.length>1?"ul":"p",i=e.map((s,o)=>{var l;return a==="p"?d.jsx(Be,{...s},o):d.jsx("li",{className:((l=t[o])==null?void 0:l.className)||"",children:d.jsx(Be,{...s})},o)});return y.createElement(a,{className:G("button-wrapper",n),...r,children:i})};const zt=({className:e="",maxWidth:t=!1})=>{const n=t?{"--max-width":`${t/16}rem`}:{};return d.jsx("hr",{className:G(e,{"has-max-width":t}),style:n})},Go={card:{range:[{height:320,width:320},{height:425,width:687},{height:510,width:768}],sizes:"(min-width: 1024px) 720px, 30vw"},responsiveCard:{range:[{height:125,width:200},{height:188,width:300},{height:313,width:500}],sizes:"(min-width: 1024px) 720px, 30vw"},banner:{range:[{height:124,width:425},{height:320,width:768},{height:510,width:1368}],sizes:"(min-width: 1024px) 975px, 50vw"},feed:{range:[{height:270,width:124},{height:320,width:425},{height:425,width:687}],sizes:"(min-width: 1024px) 510px, 20vw"},fallback:{range:[{height:124,width:375},{height:320,width:687},{height:510,width:990}],sizes:"(min-width: 1024px) 885px, 35vw"},thumbnail:{range:[{height:124,width:124},{height:320,width:320},{height:510,width:510}],sizes:"(min-width: 1024px) 453px, 20vw"}},sm=({aspect:e,range:t,sizes:n})=>{const{range:r,sizes:a}=e?Go[e]:Go.fallback;return{range:t&&t.length>0?t:r,sizes:n||a}},om=({format:e,height:t,query:n,width:r})=>{let a=`w=${r}&h=${t}`;return a=e?`${a}&fm=${e}`:a,a=n?`${a}&${n}`:a,a},hi=({format:e,range:t,url:n,query:r})=>t.map(({height:a,width:i})=>`${n}?${om({format:e,height:a,query:r,width:i})} ${i}w`).join(", ");const sr=({image:e,className:t,testId:n})=>{const{description:r,height:a,type:i,query:s,url:o,width:l,loading:u,decoding:c,fetchPriority:h}=e,{range:p,sizes:m}=sm(e),g=hi({format:"avif",query:s,range:p,url:o}),f=hi({format:"webp",query:s,range:p,url:o}),b=hi({format:"",query:s,range:p,url:o});return i&&i.includes("svg")?d.jsx("picture",{className:t,children:d.jsx("img",{src:o,alt:r,loading:u||"lazy",decoding:c||"async",fetchpriority:h||"auto",width:l,height:a,"data-testid":n||"image"})}):d.jsxs("picture",{className:t,children:[i!=="image/gif"&&d.jsx("source",{type:"image/avif",srcSet:g,sizes:m,"data-testid":"source"}),d.jsx("source",{type:"image/webp",srcSet:f,sizes:m,"data-testid":"source"}),d.jsx("img",{srcSet:b,sizes:m,src:o,alt:r,loading:u||"lazy",decoding:c||"async",fetchpriority:h||"auto",width:l,height:a,"data-testid":n||"image"})]})};const um=({image:e,className:t="",testId:n})=>d.jsx("div",{className:`image-container ${t}`,"data-testid":n||"image-container",children:e&&d.jsx(sr,{image:{...e},className:"image"})}),jn=({href:e,children:t,fallbackElement:n,className:r="",onClick:a,gtmContext:i,gtmType:s,...o})=>{if(e){const l={...o};return a&&(l.onClick=a),i&&(l["data-gtm-event-context"]=i),s&&(l["data-gtm-event-type"]=s),d.jsx("a",{href:e,className:G("gtm-trackable",r),...l,children:t})}return n?y.createElement(n,{children:t,className:r,...o}):d.jsx(d.Fragment,{children:t})};const Yc=y.forwardRef(({className:e="",children:t},n)=>{const r=y.useRef(null),a=n||r;return d.jsx("aside",{ref:a,className:G("popover",e),"aria-live":"polite",children:t})}),Ya=({parent:e=document.body,children:t})=>typeof document=="object"?Fc.createPortal(t,e):null;const lm=({currentStep:e=1,steps:t=1})=>d.jsxs(d.Fragment,{children:[d.jsx(Ie,{children:d.jsx(se.FormattedMessage,{id:"progressTracker",values:{current:e,total:t}})}),d.jsx("div",{className:"progress-tracker",children:d.jsx("div",{className:"dots-wrapper",children:new Array(t).fill("").map((n,r)=>{const a=r+1;return d.jsxs("div",{className:"dot-wrapper",children:[d.jsx("div",{className:G("dot",{active:a===e,completed:a<e}),"data-testid":"progress-dot"}),d.jsx("div",{className:G("line",{active:a<e})})]},r)})})})]});const cm=({elementId:e,offset:t=20})=>{const n=se.useIntl(),r=()=>{const a=document.getElementById(e);if(!a)return;const i=document.getElementById("header");i&&window.scrollTo({top:a.offsetTop-i.clientHeight-t})};return d.jsx(Be,{variant:"secondary",className:"return-to-nav",onClick:r,"data-gtm-event-context":"ListPageMobile","data-gtm-event-type":"back-to-nav-button-click",screenreaderText:n.formatMessage({id:"return_to_nav_button"})})};const dm=({items:e,className:t="",...n})=>d.jsx("ul",{className:G("buckets",t),...n,children:e.map(({title:r,text:a,link:i,...s},o)=>d.jsx("li",{className:"bucket text-medium",children:d.jsxs("a",{href:i,...s,children:[d.jsx("p",{className:"title",children:r}),d.jsx("p",{children:a})]})},o))}),Qo=300,Jo="ease-in-out";class fm{constructor(t){this.el=t,this.summary=t.querySelector("summary"),this.content=t.querySelector(".content"),this.animation=null,this.isClosing=!1,this.isExpanding=!1,this.summary.addEventListener("click",n=>this.onClick(n))}cleanUp(){this.summary.removeEventListener("click",t=>this.onClick(t))}onClick(t){t.preventDefault(),t.stopPropagation(),this.el.style.overflow="hidden",this.isClosing||!this.el.open?this.open():(this.isExpanding||this.el.open)&&this.shrink()}shrink(){this.isClosing=!0;const t=`${this.el.offsetHeight}px`,n=`${this.summary.offsetHeight}px`;this.animation&&this.animation.cancel(),this.animation=this.el.animate({height:[t,n]},{duration:Qo,easing:Jo}),this.animation.onfinish=()=>this.onAnimationFinish(!1),this.animation.oncancel=()=>this.isClosing=!1}open(){this.el.style.height=`${this.el.offsetHeight}px`,this.el.open=!0,window.requestAnimationFrame(()=>this.expand())}expand(){this.isExpanding=!0;const t=`${this.el.offsetHeight}px`,n=`${this.summary.offsetHeight+this.content.offsetHeight}px`;this.animation&&this.animation.cancel(),this.animation=this.el.animate({height:[t,n]},{duration:Qo,easing:Jo}),this.animation.onfinish=()=>this.onAnimationFinish(!0),this.animation.oncancel=()=>this.isExpanding=!1}onAnimationFinish(t){this.el.open=t,this.animation=null,this.isClosing=!1,this.isExpanding=!1,this.el.style.height=this.el.style.overflow=""}}const Ga=({label:e=!1,className:t="",children:n,shouldAnimate:r=!1})=>{const a=se.useIntl(),i=y.useRef(null);return y.useEffect(()=>{let s;return r&&(s=new fm(i.current)),()=>{r&&s&&s.cleanUp()}},[]),d.jsxs("details",{ref:i,className:G("collapsible-section",t,{"should-animate":r}),children:[d.jsx("summary",{children:e||a.formatMessage({id:"collapsibleSection_summary"})}),d.jsx("div",{className:"content",children:n})]})},Xo={cube:"box",graduationCap:"graduation-cap",person:"user",speech:"speech-bubble_round",star:"star_empty_thin"},hm=e=>{let t=e;return Object.keys(Xo).includes(e)&&(t=Xo[e]),`url(${Lt}icons/${t}.svg)`};const eu={customCard:"custom",microcourse:"course",solutionArticle:"article",qaQuestion:"question",listPage:"list",learningHub:"learning-hub",communityPage:"communityPage"},Gc=({contentType:e,customIcon:t,customLabel:n,className:r=""})=>{const a=se.useIntl(),i=t?{"--custom-icon":hm(t)}:{},s=Za(`contentTypeLabel_${e}`)?a.formatMessage({id:`contentTypeLabel_${e}`}):!1;return!n&&!s?null:d.jsx("small",{className:G("content-type-label text-small",e in eu?eu[e]:e,r,{"has-custom-icon":t}),style:i,"data-testid":"content-type-label",children:n||s})};const $t=({variant:e="primary",icon:t,styling:n={},className:r="",children:a,...i})=>{const{showHighlight:s=!1,background:o="default"}=n,l=t?{"--icon":`url(${Lt}icons/${t}.svg)`}:{};return d.jsx("div",{className:G("highlighted-text-box",e,r,{"has-icon":t,"show-highlight":s,[o]:o!=="default"}),style:l,...i,children:a})};const cn=({variant:e="empty",text:t=!1,button:n=!1,className:r=""})=>{let a=n&&!!Object.keys(n).length;const i=typeof n=="object"&&"breakpoints"in n,s=rr(i);if(i&&typeof n=="object"&&typeof s=="number"){const h=Object.assign({},n.breakpoints),p=Mc(Object.keys(h));a=Rc(s,p,h)}const{breakpoints:o,text:l="",component:u,...c}=n;return d.jsx($t,{variant:"subtle",className:G("empty-state-box",e,r),children:d.jsxs(d.Fragment,{children:[t&&typeof t=="string"?d.jsx(It,{options:{forceBlock:!0},children:t}):t,a&&typeof n=="object"&&(u||d.jsx(Be,{...c,variant:n.variant?n.variant:"secondary",children:l}))]})})};const ms=({children:e,...t})=>d.jsx("p",{...t,children:e}),Qc={q:ms,blockquote:ms};for(let e=1;e<=6;e++)Qc[`h${e}`]={component:ms,props:{className:"title"}};const Jc=({type:e="default",className:t="",heading:n=!1,children:r,...a})=>d.jsxs("div",{...a,className:G("helper-text-box text-small",e,t),children:[n&&d.jsx("p",{className:"title",children:n}),typeof r=="string"?d.jsx(It,{options:{wrapper:y.Fragment,forceBlock:!0,overrides:Qc},children:r}):d.jsx("p",{children:r})]});const Xc=({id:e,className:t="",show:n=!1,hide:r=!1,text:a,markdownOptions:i,children:s})=>{const o=se.useIntl(),l=y.useRef(null);e||(e=Date.now().toString());const[u,c]=y.useState(""),[h,p]=y.useState("closed");y.useEffect(()=>{const f=l.current;if(f)return f.addEventListener("transitionend",m),()=>{f.removeEventListener("transitionend",m)}},[]),y.useEffect(()=>{if(!a||typeof a!="string")return;const f=a.split(`
35
+ Thank you for helping to protect the Apolitical community from abusive content.`,discussionFormCard_placeholder:"Write a post or ask a question...",discussionFormCard_overlay_title:"Discard post",discussionFormCard_overlay_text:"Are you sure you want to leave without posting? Changes you have made will not be saved.",discussionFormCard_overlay_cta_discard:"Discard",discussionFormCard_overlay_cta_continue:"Continue editing",discussion_form_title:"Write your {action}",discussion_form_titleField_label:"Title",discussion_form_titleField_placeholder:"Write something...",discussion_form_titleField_error:"Please enter a title or a body for your post.",discussion_form_placeholder:"Write a {action}...",discussion_form_label:"Body",discussion_form_label_action:"Your {action}",discussion_form_explainer:"Try to make your {action} specific and practical. Be respectful and kind. See our <a>community guidelines</a>",discussion_form_success:"Your {action} has been submitted.",discussion_form_post:"Post",discussion_form_posting:"Posting...",discussion_form_save:"Save",discussion_form_saving:"Saving...",discussion_form_cancel:"Cancel",discussion_form_submitting:"Submitting...",discussion_form_placeholder_post:"Share a question, insight, or announcement with the community",discussion_form_error:"We are unable to process your {action} right now. Please try again later or contact us if the problem persists",discussion_form_error_tooLong:"Please keep your content to {maxLength, plural, one {1 character} other {# characters}}.",discussion_form_error_tooMany:"You have posted too many times in a row. Please wait and try again.",discussion_form_error_loggedOut:"Please log in to submit your {action}.",discussion_form_error_noPermission:"You do not have permission to {action}.",discussion_form_error_alreadyExists:"This {action} already exists.",discussion_form_title_question:"Start a conversation",discussion_form_placeholder_question:"Ask your question here",discussion_form_explainer_question:"Unsure what you can post? See our <a>community guidelines</a>.",discussion_likes:"{number, plural, =0 {0 likes} one {# like} other {# likes}}",discussion_likes_short:"{number}",discussion_likes_more:"and {number} more...",discussion_likes_like:"Like this {action}",discussion_likes_unlike:"Unlike {action}",discussion_likes_show:"Show who liked this {action}",discussion_moreMenu_edit:"Edit",discussion_moreMenu_delete:"Delete",discussion_moreMenu_report:"Report",discussion_comments_screenReader:"See {count, plural, =0 {0 comments} one {# comment} other {# comments}}",discussion_comments:"{count, plural, =0 {0 comments} one {# comment} other {# comments}}",discussion_responses_answer:"Answers",discussion_responses_comment:"Comments",discussion_responses_title:"{action} ({count})",discussion_responses_empty:"Be the first to respond",discussion_responses_empty_answer:"Be the first to answer this question",discussion_responses_placeholder:"Write a comment...",discussion_share_copy_link:"Copy link",discussion_share_copy_link_success:"Link copied to clipboard",discussion_thread_show:"Show {count} {count, select, 1 {reply} other {replies}}",discussion_thread_hide:"Hide replies",discussion_thread_loadMore:"Load more replies",contactFooter_title:"Contact us",contactFooter_text:"We're always open to new ideas, so please reach out to see how we can collaborate.",contactFooter_phone:"+44 203 608 2241",contactFooter_email:"hello@apolitical.co",contactForm_name:"Name",contactForm_email:"Email address",contactForm_organisation:"Government department or organisation",contactForm_interests:"I'm interested in",contactForm_interests_publishingCourse:"Publishing or creating a course",contactForm_interests_buyingCourse:"Buying courses for my team",contactForm_interests_learningExperience:"Customised learning experiences",contactForm_interests_somethingElse:"Something else",contactForm_message:"Message",dropdown_menu_multiselect_all:"All",dropdown_menu_multiselect_none:"None",emailHelperTextBox_fallback_title:"Who can join",emailHelperTextBox_fallback_text:"Apolitical is a private community for public servants and policymakers.",emailHelperTextBox_default_title:"Who can join",emailHelperTextBox_default_text:"Apolitical is a private community for public servants and policymakers. <link>Learn more</link>.",emailHelperTextBox_autoApproved_title:"Email check",emailHelperTextBox_autoApproved_text:"Great! Looks like you are using a **government email domain we recognise.** You will be **auto-approved** once you sign up.",emailHelperTextBox_unrecognisedEmail_title:"Not a recognised government email",emailHelperTextBox_unrecognisedEmail_text:"To confirm you work in government or policy, please add more details below. <link>Learn more</link>.",emailHelperTextBox_pendingApproval_title:"Email is pending approval",emailHelperTextBox_pendingApproval_text:"Looks like this email has been used to sign up to Apolitical before, but <strong>we have not yet approved it.</strong> If you cannot wait to join, contact <mail>concierge@apolitical.co</mail>.",emailHelperTextBox_emailUnverified_title:"Hello again!",emailHelperTextBox_emailUnverified_text:"It looks like you're already an Apolitical member. To access your account, please verify your email address. <link>Click here to get a verification code sent to your email</link>.",emailHelperTextBox_emailAlreadyExists_title:"Email is already registered",emailHelperTextBox_emailAlreadyExists_text:"Looks like this email has been used to sign up to Apolitical before, try <link>logging in</link> instead. If you're still having issues, contact <mail>concierge@apolitical.co</mail>.",emailHelperTextBox_error_verificationFailedToSend_title:"Verification code failed to send",emailHelperTextBox_error_verificationFailedToSend_text:"Error details: <em>{error}</em>{br}<link>Click here to try again</link>.{br}If you continue to have problems, contact us at <mail>concierge@apolitical.co</mail>",emailHelperTextBox_error_noFunction:"Cannot resend verification code.",form_fieldWrapper_required:"required",form_fieldWrapper_characterLimit:"Character limit:",form_fieldWrapper_characterLimit_aria_default:"You have {remaining, plural, =0 {no characters} one {1 character} other {# characters}} remaining.",form_fieldWrapper_characterLimit_aria_over:"You are {over, plural, one {1 character} other {# characters}} over the limit. Please shorten your text to {limit} characters.",form_fieldWrapper_characterLimit_info:"You can enter up to {limit} characters",form_error_generalError:"Sorry, something has gone. Please refresh the page and try again.",form_error_required:"Please fill in this required field",form_error_numbers:"Numbers are not allowed in this text field",form_error_email:"Please enter a valid email address",form_error_url:"Please enter a valid URL",form_cancel:"Cancel",form_submit:"Submit",form_submitting:"Submitting form...",form_submitted:"Submitted",form_success:"Thank you for submitting the form!",inviteForm_email_placeholder:"Add email addresses...",inviteForm_title:"Know someone who might like to join this workshop?",inviteForm_label:"Invite your colleagues by typing or pasting their email addresses below",inviteForm_ctaMessage:"Send",inviteForm_success:"Invitation Sent!",inviteForm_error:"Something went wrong!",inviteForm_ctaTryAgain:"Try again!",inviteForm_ctaSendMoreInvites:"Send more invites",inviteForm_ctaDone:"Done",inputAutocomplete_placeholder:"Start typing...",passwordRules_unmatched_text:"Passwords do not match",passwordRules_intro:"We advise you not to use your name or email in your password.",passwordRules_rule_label:"Password",passwordRules_rule_8Characters:"must be longer than 8 characters",passwordRules_rule_numberSymbol:"must include a number and a symbol",passwordRules_rule_lowercaseUppercase:"must include both lower and upper case characters",passwordRules_notMet:"Your password does not meet this requirement",passwordRules_currentPassword_label:"Current password",passwordRules_newPassword_label:"New password",passwordRules_confirmPassword_label:"Confirm new password",profileForm_image:"Upload photo",profileForm_name:"Full name",profileForm_name_placeholder:"What's your name, so people can recognise you?",profileForm_jobTitle:"Job title",profileForm_jobTitle_placeholder:"What's your current job title?",profileForm_organization:"Organisation",profileForm_organization_placeholder:"Where do you work?",profileForm_location:"Location",profileForm_location_placeholder:"Add your city",profileForm_location_error:"Please choose a location from the list.",profileForm_bio:"Bio",profileForm_bio_placeholder:"Tell us more about yourself...",profileForm_cta:"Save",profileImageChange_cta_uploading:"Uploading image...",profileImageChange_cta_change:"Change photo",profileImageChange_cta_upload:"+ Add profile photo",profileImageChange_error:"There was an error uploading the image. Please try a different file format or reduce the file size to less than 5MB. Contact us if problem persists.",ratings_text:"Rate answer",ratings_stars:"{number} out of {total}",ratings_low:"this is incorrect or confusing",ratings_high:"this is a fantastic answer",ratings_success:"Thank you!",richTextEditor_placeholder:"Write something...",richTextEditor_toolbar:"Formatting options",richTextEditor_bold:"Bold",richTextEditor_italic:"Italic",richTextEditor_strikeThrough:"Strikethrough",richTextEditor_link:"Link",richTextEditor_link_text:"Text:",richTextEditor_link_text_aria:"Text to be linked:",richTextEditor_link_url:"Link:",richTextEditor_link_placeholder:"Type or paste URL",richTextEditor_link_error_required:"Please enter a URL to link to",richTextEditor_link_open:"Open: {link}",richTextEditor_link_open_text:"Opens in a new window",richTextEditor_link_edit:"Edit",richTextEditor_link_remove:"Remove",richTextEditor_link_button:"Add link",richTextEditor_ol_list:"Numbered list",richTextEditor_ul_list:"Bullet-point list",richTextEditor_block_quote:"Quote",richTextEditor_mention_fallback:"Can't find who you're looking for? Invite them to the community",search_label:"Search for:",search_placeholder:"Ask Apolitical",search_clear:"Clear search",search_cta:"Search",showpassword_show:"Show",showpassword_hide:"Hide",showpassword_aria_show:"Your password is hidden. Click to show.",showpassword_aria_hide:"Your password is visible. Click to hide.",signup_title:"Sign up",signup_full_name:"Full name",signup_full_name_placeholder:"Lionel Messi",signup_email_address:"Work email",signup_email_address_placeholder:"lionel.messi@argentina.gov",signup_job_title:"Job title",signup_job_title_placeholder:"e.g. Senior Policy Advisor",signup_organization:"Organisation",signup_organization_placeholder:"e.g. Department of Justice",signup_url:"Link to official government bio / LinkedIn <small>(optional)</small>",signup_url_placeholder:"https://organisation.com/bio",signup_expectation:"What do you want to know<small>Optional, but we will use your response to build the session!</small>",signup_expectation_placeholder:"What do you want to know?",signup_terms:"I accept Apolitical's <terms>Terms of Service</terms>, <privacy>Privacy Policy</privacy> and that I'll get essential emails for my use of Apolitical",signup_error:"We're really sorry, but we've had a problem trying to sign you up. This could be an issue with our system, so we suggest you try again later.",signup_button_join:"Join for free",signup_button_login:"Log in",signup_submitting:"Submitting form...",signup_success_title:"Thank you for applying to join Apolitical!",signup_success_text:"<p>Once we've vetted your application, you'll get a secure login link to help you get started.</p><p>Please note that trust is everything to our community, so you can't login until your identity has been verified.</p>",tableOfContents:"Table of contents",timeToComplete_hours:"{time, plural, =0 {} one {1 hour} other {# hours}}",timeToComplete_hours_short:"{time}h",timeToComplete_minutes:"{time, plural, =0 {} one {1 minute} other {# minutes}}",timeToComplete_minutes_short:"{time}m",timeToComplete_range:"{early} - {late}",timeToComplete_range_aria:"between {early} and {late}",tooltip_loading:"Loading...",return_to_nav_button:"Back to top",progressTracker:"Step {current} of {total}",cookieBanner_title:"Cookies and your privacy",cookieBanner_text:"We take your trust and privacy very seriously. Apolitical uses safe cookies (small files on your device) to run the site. You can reject non-essential cookies, but some site features may not work without them.",cookieBanner_buttons_settings:"Change my settings",cookieBanner_buttons_reject:"Reject all",cookieBanner_buttons_accept:"Accept all",footer_platform:"Platform",footer_platform_events:"Events",footer_platform_courses:"Courses",footer_platform_qanda:"Q&A",footer_platform_articles:"Articles",footer_platform_communities:"Communities",footer_community:"Community",footer_community_support:"Support FAQ",footer_community_post:"Post on Apolitical",footer_community_join:"Who can join",footer_community_guidelines:"Guidelines & values",footer_company:"Company",footer_company_news:"News",footer_company_insights:"Insights",footer_company_story:"Our story",footer_company_team:"Meet our team",footer_company_careers:"Careers",footer_company_partner:"Partner with us",footer_company_contact:"Get in touch",footer_legal:"Legal",footer_legal_privacy:"Privacy policy",footer_legal_terms:"Terms & conditions",footer_legal_cookie:"Cookie policy",footer_legal_accessibility:"Accessibility statement",footer_legal_ai:"AI principles",footer_legal_dataProtection:"Data protection officer",footer_legal_euDataProtection:"EU data protection officer",footer_contact:"Contact",footer_contact_correspondence:"Correspondence address",footer_contact_correspondence_address:"251 Southwark Bridge Road{br}London, SE1 6FL{br}United Kingdom",footer_contact_registered:"Registered address",footer_contact_registered_address:"20–22 Wenlock Road{br}London, N1 7GU{br}United Kingdom",footer_contact_berlin:"Berlin address",footer_contact_berlin_address:"Torstraße 220{br}10115 Berlin{br}Germany",footer_contact_support:"For platform support",footer_contact_business:"For business inquiries",footer_social_linkedin:"LinkedIn",footer_social_twitter:"Twitter",footer_social_facebook:"Facebook",footer_copyright:"Copyright © {currentYear} Apolitical Group Limited",header_skip:"Skip to main content",header_search_show:"Show search bar",header_search_hide:"Close search bar",header_menu_show:"Show navigation",header_menu_hide:"Close navigation",header_home_loggedOut:"Home",header_home_loggedIn:"My Home",header_topics:"Topics",header_topics_explore:"Explore",header_topics_explore_events:"Events",header_topics_explore_courses:"Courses","header_topics_explore_q-and-a":"Q&A",header_topics_explore_articles:"Articles",header_topics_explore_communities:"Communities",header_topics_topics:"Topics",header_topics_topics_climate:"Climate","header_topics_topics_cities-and-local-government":"Cities and local government","header_topics_topics_digital-and-data":"Digital and data",header_topics_topics_education:"Education","header_topics_topics_equity-justice-and-inclusion":"Equity, justice and inclusion","header_topics_topics_health-and-social-care":"Health and social care",header_topics_topics_innovation:"Innovation","header_topics_topics_leadership-and-skills":"Leadership and skills","header_topics_topics_life-in-government":"Life in government",header_topics_topics_policymaking:"Policymaking","header_topics_topics_transport-and-infrastructure":"Transport and infrastructure","header_topics_topics_work-and-the-economy":"Work and the economy",header_partners:"For partners",header_account:"My account",header_account_show:"Show account menu",header_account_hide:"Close account menu",header_account_profile:"My profile",header_account_settings:"Settings & privacy","header_account_log-out":"Log out",header_buttons_login:"Log in",header_buttons_signup:"Sign up",pageLayout_error:"An error occurred while rendering this page. Please refresh the page or try again later.",loadingBlock_loading:"Loading...",loadingBlock_almostDone:"Almost done...",loadingBlock_complete:"Complete!",progressBar:"{number}% loaded",discussionFormModal_title:"Create a post",discussionFormModal_cta:"Create post",inviteModal_title:"You’re registered",inviteModal_formTitle:"Know someone who might like to join this workshop?",inviteModal_formLabel:"Invite your colleagues by typing or pasting their email addresses below.",inviteModal_cta:"Send",overlay_close:"Close",profileModal_title:"Update your profile",breadcrumbs_label:"Go back to:",breadcrumbs_currentPage:"Current page:",filters_all:"Show all",filters_disabled:"{name} - no results",languageSwitcher_label:"I would like to read this article in...",languageSwitcher_translation_original:"original language",languageSwitcher_translation_human:"translated by person",languageSwitcher_translation_machine:"translated by machine",languageSwitcher_selected:"{language} - currently selected",languageSwitcher_disclaimer:"This content is machine translated and will occasionally get gendered language or other direct translations wrong. We’re trying to resolve this but in the meantime, if you notice something very wrong, let us know at <link>{email}</link>",loadMore_button:"Load more",loadMore_endOfFeed:"You're all caught up",loadMore_error:"We're having trouble loading more content. Please refresh the page or try again later.",moreMenu:"See more options",navigationMenu_links_homepage:"Home",navigationMenu_links_events:"Events",navigationMenu_links_microcourses:"Courses","navigationMenu_links_q-and-a":"Q&A",navigationMenu_links_articles:"Articles",navigationMenu_links_communities:"Communities",navigationMenu_profile:"My profile",shareLinks_label:"Share",shareLinks_link_linkedin:"Share on LinkedIn",shareLinks_link_twitter:"Share on Twitter",shareLinks_link_facebook:"Share on Facebook",shareLinks_link_email:"Share by email","shareLinks_link_clipboard-copy":"Copy the link",tags_community:"From the community",editSection_placeholder_description:"Add some details",editSection_placeholder_cta:"add",editSection_edit:"Edit",notFoundError_title:"We can't find that page",notFoundError_text:"Sorry about that. We all mess up sometimes - read some ‘fail’ stories below.",notFoundError_post_1:"Why public servants must learn to fail — and 3 tips for how to do it",notFoundError_post_2:"What failure has taught me",notFoundError_post_3:"How to learn from failure without causing a scandal",notFoundError_cta:"View more articles",collapsibleSection_summary:"Find out more",contentTypeLabel_event:"Event",contentTypeLabel_learningHub:"Programme",contentTypeLabel_listPage:"List",contentTypeLabel_microcourse:"Course",contentTypeLabel_qaQuestion:"Q&A",contentTypeLabel_solutionArticle:"Article",contentTypeLabel_communityPage:"Community",hideShowTextBox_hide:"View less",hideShowTextBox_show:"View more",markdown_collapsibleSection_summary:"Resources",markdown_skip_video:"Skip past video",markdown_skip_padlet:"Skip past interactive board",markdown_skip_poll:"Skip past poll",markdown_skip:"Skip to next section",markdown_iframe_title:"Course information",markdown_iframe_video:"Video",markdown_iframe_padlet:"Interactive board",markdown_iframe_poll:"Poll"},Qh={...ar,languageSwitcher_label:"Me gustaría leer este artículo en...",languageSwitcher_translation_original:"idioma original",languageSwitcher_translation_human:"traducido por un humano",languageSwitcher_translation_machine:"traducido por máquina",languageSwitcher_disclaimer:"Este contenido fue traducido automáticamente y ocasionalmente tendrá errores de género u otras traducciones directas. Estamos intentando resolver este problema, pero mientras tanto, si notas algún error grave, escríbenos a <link>{email}</link>"},Jh={...ar,languageSwitcher_label:"Je voudrais lire cet article dans...",languageSwitcher_translation_original:"langue originale",languageSwitcher_translation_human:"traduit par un humain",languageSwitcher_translation_machine:"traduit par machine",languageSwitcher_disclaimer:"Ce contenu est traduit automatiquement et contiendra d’évantuelles erreurs de genre ou d’autres traductions directes. Nous essayons de résoudre ce problème, mais en attendant, si vous remarquez une erreur importante, faites-le nous savoir à <link>{email}</link>",collapsibleSection_summary:"En savoir plus"},Xh={...ar,languageSwitcher_label:"Eu gostaria de ler este artigo em...",languageSwitcher_translation_original:"linguagem original",languageSwitcher_translation_human:"traduzido por um humano",languageSwitcher_translation_machine:"traduzido por máquina",languageSwitcher_disclaimer:"Este conteúdo foi traduzido automaticamente e, ocasionalmente, poderão ocorrer erros de linguagem de gênero ou outras traduções diretas. Estamos tentando resolver isso, porém se perceber algo errado por favor nos avise em <link>{email}</link>"},em=Object.freeze(Object.defineProperty({__proto__:null,en:ar,es:Qh,fr:Jh,pt:Xh},Symbol.toStringTag,{value:"Module"})),Za=(e,t=ar)=>e in t,Ft=(e,t,n,r,a={})=>{let i="";return Za(`${t}_${n}`)?i=e({id:`${t}_${n}`},a):i=e({id:t},{[r]:n,...a}),i},tm=(e,t,n)=>{if(!e||e===0)return"0";t||(t=0),n||(n=["k","m","b","t"]);let r=e.toString();t=Math.pow(10,t);for(let a=n.length-1;a>=0;a--){const i=Math.pow(10,(a+1)*3);if(i<=e){e=Math.round(e*t/i)/t,e===1e3&&a<n.length-1&&(e=1,a++),r=`${e}${n[a]}`;break}}return r},ga=(e,t)=>C.Children.map(e,n=>Object.is(n,null)?n:C.cloneElement(n,{...t})),Uc=(e=0)=>{setTimeout(()=>{const t=document.querySelector(".splash-screen");t&&t.remove(),window.prerenderReady=!0},e)},nm=(e,t,n)=>!t.id||!t.name?"":n.replace(/{{name}}/g,t.name).replace(/{{id}}/g,t.id),Hc=async({text:e,template:t,mentions:n,listMembers:r=()=>Promise.resolve([])})=>{var i;if(!n)return e;const a=e.match(Ar);if(!a)return e;for(const s of a){const o=s.replace(Ar,(c,h)=>h),l=n[o];if(!l)continue;const u={};if(typeof l=="object")u.name=((i=l==null?void 0:l.data)==null?void 0:i.name)||"",u.id=l.id||"";else{const c=l;if(c.startsWith(ds))try{const h=c.replace(ds,"");u.id=h,await r({id:h}).then(p=>{const{name:m}=p;u.name=m||""})}catch{e.replace(s,"@");continue}else continue}e=e.replace(s,u.name?nm(e,u,t):s)}return e},Vc=e=>{const t=e.startsWith("http")?e:`https://${e}`,r=new URL(t).hostname;return{full:t,pretty:r}},Kc=e=>new URLSearchParams(window.location.search).get(e),Zo=(e="")=>e.replace(/\s+/g,"").length>0,hs=e=>{const t=e.length>8,n=/[0-9]/.test(e)&&/[`!@#$%^&*()_+\-=[\]{}£;':"\\|,.<>/?~]/.test(e),r=new RegExp("^(?=.*?[A-Z])(?=.*?[a-z])").test(e);return{isValid:t&&n&&r,matchingRules:{isMoreThanEightCharacters:t,includesNumberAndSymbol:n,includesLowerAndUppercase:r}}};const ke=({variant:e="primary",size:t="medium",styling:n={muted:!1,fullWidth:!1},icon:r=!1,href:a=!1,element:i="button",onClick:s=!1,className:o="",disabled:l=!1,tooltip:u="",screenreaderText:c=!1,children:h=!1,...p})=>{const g=rr(typeof t=="object"),{showTooltip:f,tooltipProps:b}=Hs(!!u);if(typeof t=="object"&&typeof g=="number"){const x=Object.assign({},t),w=Nc(Object.keys(x));t=Rc(g,w,x)}!l&&u&&(u="");const v=[];typeof t=="string"&&v.push(t),r&&(v.push("icon"),typeof r=="object"?(v.push(r.icon),r.position?v.push(r.position):v.push("left"),r.hover&&v.push(`hover_${r.hover}`),r.animate&&(v.push("animate"),typeof r.animate=="string"&&v.push(r.animate))):(v.push(r),!r.includes("right")&&!r.includes("left")&&v.push("left"))),n.muted&&v.push("muted"),n.fullWidth&&v.push("full-width");const E={...p,className:Y(e,o,v,{"no-text":!h,disabled:l,button:a}),onClick:x=>{(!a||a[0]==="#")&&s&&(x.preventDefault(),x.stopPropagation()),s&&s(x)},disabled:typeof l=="object"&&"isClickable"in l?!l.isClickable:l};a&&(i="a",E.href=a);const k=C.createElement(i,E,h||(c?d.jsx(Ie,{showOnFocus:!1,children:c}):null));return l&&u?d.jsxs("span",{className:"button-container",...b,children:[d.jsx(Sn,{isOpen:f,children:u}),k]}):k},ir=({buttons:e,wrappers:t=[],className:n="",...r})=>{const a=e.length>1?"ul":"p",i=e.map((s,o)=>{var l;return a==="p"?d.jsx(ke,{...s},o):d.jsx("li",{className:((l=t[o])==null?void 0:l.className)||"",children:d.jsx(ke,{...s})},o)});return C.createElement(a,{className:Y("button-wrapper",n),...r,children:i})};const zt=({className:e="",maxWidth:t=!1})=>{const n=t?{"--max-width":`${t/16}rem`}:{};return d.jsx("hr",{className:Y(e,{"has-max-width":t}),style:n})},Yo={card:{range:[{height:320,width:320},{height:425,width:687},{height:510,width:768}],sizes:"(min-width: 1024px) 720px, 30vw"},responsiveCard:{range:[{height:125,width:200},{height:188,width:300},{height:313,width:500}],sizes:"(min-width: 1024px) 720px, 30vw"},banner:{range:[{height:124,width:425},{height:320,width:768},{height:510,width:1368}],sizes:"(min-width: 1024px) 975px, 50vw"},feed:{range:[{height:270,width:124},{height:320,width:425},{height:425,width:687}],sizes:"(min-width: 1024px) 510px, 20vw"},fallback:{range:[{height:124,width:375},{height:320,width:687},{height:510,width:990}],sizes:"(min-width: 1024px) 885px, 35vw"},thumbnail:{range:[{height:124,width:124},{height:320,width:320},{height:510,width:510}],sizes:"(min-width: 1024px) 453px, 20vw"}},rm=({aspect:e,range:t,sizes:n})=>{const{range:r,sizes:a}=e?Yo[e]:Yo.fallback;return{range:t&&t.length>0?t:r,sizes:n||a}},am=({format:e,height:t,query:n,width:r})=>{let a=`w=${r}&h=${t}`;return a=e?`${a}&fm=${e}`:a,a=n?`${a}&${n}`:a,a},hi=({format:e,range:t,url:n,query:r})=>t.map(({height:a,width:i})=>`${n}?${am({format:e,height:a,query:r,width:i})} ${i}w`).join(", ");const sr=({image:e,className:t,testId:n})=>{const{description:r,height:a,type:i,query:s,url:o,width:l,loading:u,decoding:c,fetchPriority:h}=e,{range:p,sizes:m}=rm(e),g=hi({format:"avif",query:s,range:p,url:o}),f=hi({format:"webp",query:s,range:p,url:o}),b=hi({format:"",query:s,range:p,url:o});return i&&i.includes("svg")?d.jsx("picture",{className:t,children:d.jsx("img",{src:o,alt:r,loading:u||"lazy",decoding:c||"async",fetchpriority:h||"auto",width:l,height:a,"data-testid":n||"image"})}):d.jsxs("picture",{className:t,children:[i!=="image/gif"&&d.jsx("source",{type:"image/avif",srcSet:g,sizes:m,"data-testid":"source"}),d.jsx("source",{type:"image/webp",srcSet:f,sizes:m,"data-testid":"source"}),d.jsx("img",{srcSet:b,sizes:m,src:o,alt:r,loading:u||"lazy",decoding:c||"async",fetchpriority:h||"auto",width:l,height:a,"data-testid":n||"image"})]})};const im=({image:e,className:t="",testId:n})=>d.jsx("div",{className:`image-container ${t}`,"data-testid":n||"image-container",children:e&&d.jsx(sr,{image:{...e},className:"image"})}),jn=({href:e,children:t,fallbackElement:n,className:r="",onClick:a,gtmContext:i,gtmType:s,...o})=>{if(e){const l={...o};return a&&(l.onClick=a),i&&(l["data-gtm-event-context"]=i),s&&(l["data-gtm-event-type"]=s),d.jsx("a",{href:e,className:Y("gtm-trackable",r),...l,children:t})}return n?C.createElement(n,{children:t,className:r,...o}):d.jsx(d.Fragment,{children:t})};const Zc=C.forwardRef(({className:e="",children:t},n)=>{const r=C.useRef(null),a=n||r;return d.jsx("aside",{ref:a,className:Y("popover",e),"aria-live":"polite",children:t})}),Ya=({parent:e=document.body,children:t})=>typeof document=="object"?Fc.createPortal(t,e):null;const sm=({currentStep:e=1,steps:t=1})=>d.jsxs(d.Fragment,{children:[d.jsx(Ie,{children:d.jsx(oe.FormattedMessage,{id:"progressTracker",values:{current:e,total:t}})}),d.jsx("div",{className:"progress-tracker",children:d.jsx("div",{className:"dots-wrapper",children:new Array(t).fill("").map((n,r)=>{const a=r+1;return d.jsxs("div",{className:"dot-wrapper",children:[d.jsx("div",{className:Y("dot",{active:a===e,completed:a<e}),"data-testid":"progress-dot"}),d.jsx("div",{className:Y("line",{active:a<e})})]},r)})})})]});const om=({elementId:e,offset:t=20})=>{const n=oe.useIntl(),r=()=>{const a=document.getElementById(e);if(!a)return;const i=document.getElementById("header");i&&window.scrollTo({top:a.offsetTop-i.clientHeight-t})};return d.jsx(ke,{variant:"secondary",className:"return-to-nav",onClick:r,"data-gtm-event-context":"ListPageMobile","data-gtm-event-type":"back-to-nav-button-click",screenreaderText:n.formatMessage({id:"return_to_nav_button"})})};const um=({items:e,className:t="",...n})=>d.jsx("ul",{className:Y("buckets",t),...n,children:e.map(({title:r,text:a,link:i,...s},o)=>d.jsx("li",{className:"bucket text-medium",children:d.jsxs("a",{href:i,...s,children:[d.jsx("p",{className:"title",children:r}),d.jsx("p",{children:a})]})},o))}),Go=300,Qo="ease-in-out";class lm{constructor(t){this.el=t,this.summary=t.querySelector("summary"),this.content=t.querySelector(".content"),this.animation=null,this.isClosing=!1,this.isExpanding=!1,this.summary.addEventListener("click",n=>this.onClick(n))}cleanUp(){this.summary.removeEventListener("click",t=>this.onClick(t))}onClick(t){t.preventDefault(),t.stopPropagation(),this.el.style.overflow="hidden",this.isClosing||!this.el.open?this.open():(this.isExpanding||this.el.open)&&this.shrink()}shrink(){this.isClosing=!0;const t=`${this.el.offsetHeight}px`,n=`${this.summary.offsetHeight}px`;this.animation&&this.animation.cancel(),this.animation=this.el.animate({height:[t,n]},{duration:Go,easing:Qo}),this.animation.onfinish=()=>this.onAnimationFinish(!1),this.animation.oncancel=()=>this.isClosing=!1}open(){this.el.style.height=`${this.el.offsetHeight}px`,this.el.open=!0,window.requestAnimationFrame(()=>this.expand())}expand(){this.isExpanding=!0;const t=`${this.el.offsetHeight}px`,n=`${this.summary.offsetHeight+this.content.offsetHeight}px`;this.animation&&this.animation.cancel(),this.animation=this.el.animate({height:[t,n]},{duration:Go,easing:Qo}),this.animation.onfinish=()=>this.onAnimationFinish(!0),this.animation.oncancel=()=>this.isExpanding=!1}onAnimationFinish(t){this.el.open=t,this.animation=null,this.isClosing=!1,this.isExpanding=!1,this.el.style.height=this.el.style.overflow=""}}const Ga=({label:e=!1,className:t="",children:n,shouldAnimate:r=!1})=>{const a=oe.useIntl(),i=C.useRef(null);return C.useEffect(()=>{let s;return r&&(s=new lm(i.current)),()=>{r&&s&&s.cleanUp()}},[]),d.jsxs("details",{ref:i,className:Y("collapsible-section",t,{"should-animate":r}),children:[d.jsx("summary",{children:e||a.formatMessage({id:"collapsibleSection_summary"})}),d.jsx("div",{className:"content",children:n})]})},Jo={cube:"box",graduationCap:"graduation-cap",person:"user",speech:"speech-bubble_round",star:"star_empty_thin"},cm=e=>{let t=e;return Object.keys(Jo).includes(e)&&(t=Jo[e]),`url(${Lt}icons/${t}.svg)`};const Xo={customCard:"custom",microcourse:"course",solutionArticle:"article",qaQuestion:"question",listPage:"list",learningHub:"learning-hub",communityPage:"communityPage"},Yc=({contentType:e,customIcon:t,customLabel:n,className:r=""})=>{const a=oe.useIntl(),i=t?{"--custom-icon":cm(t)}:{},s=Za(`contentTypeLabel_${e}`)?a.formatMessage({id:`contentTypeLabel_${e}`}):!1;return!n&&!s?null:d.jsx("small",{className:Y("content-type-label text-small",e in Xo?Xo[e]:e,r,{"has-custom-icon":t}),style:i,"data-testid":"content-type-label",children:n||s})};const $t=({variant:e="primary",icon:t,styling:n={},className:r="",children:a,...i})=>{const{showHighlight:s=!1,background:o="default"}=n,l=t?{"--icon":`url(${Lt}icons/${t}.svg)`}:{};return d.jsx("div",{className:Y("highlighted-text-box",e,r,{"has-icon":t,"show-highlight":s,[o]:o!=="default"}),style:l,...i,children:a})};const cn=({variant:e="empty",text:t=!1,button:n=!1,className:r=""})=>{let a=n&&!!Object.keys(n).length;const i=typeof n=="object"&&"breakpoints"in n,s=rr(i);if(i&&typeof n=="object"&&typeof s=="number"){const h=Object.assign({},n.breakpoints),p=Nc(Object.keys(h));a=Rc(s,p,h)}const{breakpoints:o,text:l="",component:u,...c}=n;return d.jsx($t,{variant:"subtle",className:Y("empty-state-box",e,r),children:d.jsxs(d.Fragment,{children:[t&&typeof t=="string"?d.jsx(It,{options:{forceBlock:!0},children:t}):t,a&&typeof n=="object"&&(u||d.jsx(ke,{...c,variant:n.variant?n.variant:"secondary",children:l}))]})})};const ms=({children:e,...t})=>d.jsx("p",{...t,children:e}),Gc={q:ms,blockquote:ms};for(let e=1;e<=6;e++)Gc[`h${e}`]={component:ms,props:{className:"title"}};const Qc=({type:e="default",className:t="",heading:n=!1,children:r,...a})=>d.jsxs("div",{...a,className:Y("helper-text-box text-small",e,t),children:[n&&d.jsx("p",{className:"title",children:n}),typeof r=="string"?d.jsx(It,{options:{wrapper:C.Fragment,forceBlock:!0,overrides:Gc},children:r}):d.jsx("p",{children:r})]});const Jc=({id:e,className:t="",show:n=!1,hide:r=!1,text:a,markdownOptions:i,children:s})=>{const o=oe.useIntl(),l=C.useRef(null);e||(e=Date.now().toString());const[u,c]=C.useState(""),[h,p]=C.useState("closed");C.useEffect(()=>{const f=l.current;if(f)return f.addEventListener("transitionend",m),()=>{f.removeEventListener("transitionend",m)}},[]),C.useEffect(()=>{if(!a||typeof a!="string")return;const f=a.split(`
36
36
  `);c(f.length<3?`${a.substring(0,400)}...`:f.slice(0,3).join(`
37
- `))},[a]),y.useEffect(()=>{h==="ready-to-close"&&p("closing")},[h]);const m=({propertyName:f})=>{f==="max-height"&&p(b=>b==="opening"?"open":b==="closing"?"closed":b)};if(!a)return null;const g=["opening","open"].includes(h);return d.jsxs($t,{variant:"subtle",className:G("hide-show-text-box",t),children:[d.jsxs("div",{ref:l,id:e,className:G("content",h),children:[d.jsx(It,{options:{forceBlock:!0,...i},children:h==="closed"?u:a}),h!=="closed"&&s]}),d.jsx("p",{className:"cta",children:d.jsx(Be,{variant:"tertiary",icon:{icon:"navigation_arrow",position:"left",animate:!0},styling:{muted:!0},className:G({"rotate-180":g}),onClick:()=>{p(g?"ready-to-close":"opening")},"aria-expanded":g,"aria-controls":e,children:g?r||o.formatMessage({id:"hideShowTextBox_hide"}):n||o.formatMessage({id:"hideShowTextBox_show"})})})]})};const mm=({element:e="ul",layout:t="vertical",variant:n="default",items:r=[],styling:a={},className:i=""})=>{const{hasBorder:s=!1,zebraStriping:o=!1}=a;return y.createElement(e,{className:G("icon-bulleted-list text-medium",n,i,{"has-border":s,"has-zebra-stripes":o,[t]:e!=="dl"}),children:r.map((l,u)=>{const c={wrapper:y.Fragment,forceInline:!0},h={"--icon":`url(${Lt}icons/${l.icon}.svg)`};return e==="dl"?d.jsxs(y.Fragment,{children:[d.jsx("dt",{style:h,children:d.jsx(It,{options:c,children:l.dt||""})},`dt-${u}`),d.jsx("dd",{children:typeof l.text=="string"?d.jsx(It,{options:c,children:l.text}):l.text},`dd-${u}`)]},`dl-${u}`):d.jsx("li",{style:h,children:typeof l.text=="string"?d.jsx(It,{options:c,children:l.text}):l.text},u)})})},nt=()=>y.Fragment,pm=({children:e})=>d.jsx($t,{variant:"secondary",children:e}),gm=({children:e})=>typeof e=="object"&&Object.keys(e||{}).length===1?d.jsx("p",{className:"center",children:e}):d.jsx("div",{className:"center",children:e}),vm=["span","strong","h1","h2","h3","h4","h5","h6","p"],bm=({children:e})=>{const t=se.useIntl();if(!e)return null;let n=t.formatMessage({id:"markdown_collapsibleSection_summary"});const r=[];for(const i of y.Children.toArray(e))if(!(!i||typeof i=="string"||typeof i=="number"))if(y.isValidElement(i)&&i.type==="summary"){if(i.props&&i.props.children){for(const s of y.Children.toArray(i.props.children))if(!(!s||typeof s=="string"||typeof s=="number")&&y.isValidElement(s)){const o=s.type;if(vm.includes(o)){for(n=s.props.children;typeof n!="string"&&(Array.isArray(n)&&n[0].props&&n[0].props.children&&n[0].props.children[0]);)n=n[0].props.children[0];break}}}}else r.push(i);const a=n?n.toString():"";return d.jsx(Ga,{label:a,className:["Sources","Resources"].includes(a)?"discrete-links":"",children:r.map(i=>i)})},ym=({children:e,...t})=>{if(t.class)switch(t.class){case"casestudy":return d.jsx($t,{variant:"secondary",children:e});case"general-textbox":case"highlight-box":return d.jsx($t,{variant:"primary",children:e});case"pink-textbox":return d.jsx($t,{variant:"tertiary",children:e});case"content":return typeof e=="object"&&Object.keys(e||{}).length===1?d.jsx("p",{children:e}):e;default:return d.jsx("div",{...t,children:e})}return d.jsx("div",{...t,children:e})},xt=({children:e})=>d.jsx(d.Fragment,{children:e}),Cm=e=>{const t=se.useIntl(),n=Date.now().toString();let r="default";const a=e.src;return a.includes("youtube")||a.includes("vimeo")?r="video":a.includes("riddle")||a.includes("sli.do")?r="poll":a.includes("padlet")&&(r="padlet"),d.jsxs(d.Fragment,{children:[d.jsx(Ie,{element:"a",href:`#content-after-iframe-${n}`,onClick:i=>{var s;i.preventDefault(),i.stopPropagation(),(s=document.getElementById(`content-after-iframe-${n}`))==null||s.scrollIntoView({behavior:"smooth"})},children:t.formatMessage({id:`markdown_skip${r==="default"?"":`_${r}`}`})}),d.jsx("iframe",{...e,title:t.formatMessage({id:`markdown_iframe${r==="default"?"":`_${r}`}`})}),d.jsx("span",{id:`content-after-iframe-${n}`})]})},tu=e=>{let t="";return e&&typeof e!="string"&&typeof e!="number"&&typeof e!="boolean"&&"type"in e&&(t=e.type),t},Dm=({children:e,...t})=>{let n={...t};t.href&&(t.href.includes("http:")||t.href.includes("https:"))&&!t.target&&(n.target="_blank");let r=e,a=!1;for(const i of y.Children.toArray(e))if(!(!i||typeof i=="string"||typeof i=="number")&&y.isValidElement(i)){const s=i.type;if(["button","center","span","strong"].includes(s)&&i.props&&i.props.children&&i.props.children[0])for((s==="button"||tu(i.props.children[0])==="button")&&(a=!0),r=i.props.children[0];r&&typeof r!="string"&&!(typeof r=="boolean"||typeof r=="number"||!y.isValidElement(r));)if(r.props&&r.props.children&&r.props.children[0])r=r.props.children[0],r&&tu(r)==="button"&&(a=!0);else break}return a?(n={...n,className:"button primary medium"},d.jsx("p",{className:"center",children:d.jsx(Be,{variant:"primary",size:"medium",...n,children:r})})):d.jsx("a",{...n,children:r})},ps=({children:e,...t})=>d.jsx("span",{className:G({url:t==null?void 0:t.href}),children:e});const xm={default:{a:Dm,CollapsibleSection:Ga,TextBox:$t,CaseStudy:pm,style:nt,details:bm,div:ym,iframe:Cm,center:gm},"text-only":{h1:nt,h2:nt,h3:nt,h4:nt,h5:nt,h6:nt,style:nt,details:nt,div:nt,TextBox:nt,CollapsibleSection:nt,CaseStudy:nt,blockquote:nt,iframe:nt,button:nt}},En=({element:e="div",className:t="",options:n={},children:r,overrideType:a="default",styling:i={}})=>{if(!r)return null;const{highlightTitles:s=!1}=i;r=r.replace(/^<br\/?>/,"");const o={wrapper:y.Fragment,forceBlock:!0};let l=xm[a];return n.overrides&&(l={...l,...n.overrides}),y.createElement(e,{className:G("markdown-text",t,{"highlight-titles":s}),children:d.jsx(It,{options:{...o,...n,overrides:l},children:r})})};const ed=({maxWidth:e=!1,title:t,subtitle:n,children:r,className:a=""})=>{const i=e?{"--max-width":`${e/16}rem`}:{};return d.jsxs("section",{className:G("page-heading",a),children:[d.jsxs("div",{className:G("content",{"has-max-width":e}),style:i,children:[t&&t.text&&y.createElement(t.element||"h1",{className:"title"},t.text),n&&n.text&&y.createElement(n.element||"h2",{className:"text-medium"},n.text)]}),r]})};const Cn=({size:e="medium",variant:t="default",className:n="",icon:r,tooltip:a="",children:i,...s})=>{const o={"--icon":`url(${Lt}icons/${r}.svg)`},{showTooltip:l,tooltipProps:u}=Hs(!!a),c=d.jsx("span",{...u,className:G("pill",e,t,n,{"has-icon":r}),style:o,...s,children:i});return a?d.jsxs("span",{className:"pill-wrapper",children:[d.jsx(Sn,{isOpen:l,children:a}),c]}):c};const Tr=({element:e="p",children:t=null,className:n="",...r})=>y.createElement(e,{...r,className:G("status-banner text-small",n),"aria-live":"assertive"},t);const wm=({styling:e={},progress:t=0,text:n=!1,className:r=""})=>{const a=se.useIntl(),{showText:i=!1,layout:s="bar",size:o="default",color:l="default"}=e,u=t>75?100:t>50?75:t>25?50:t>5?25:0,c={"--progress":`${t}%`};return d.jsx("span",{className:G(`progress-bar section-${u}`,s,r,{[o]:o!=="default",[l!=="default"?l:""]:l!=="default"}),style:c,children:y.createElement(i?"span":Ie,{className:i?"text":"",children:n||a.formatMessage({id:"progressBar"},{number:t})})})},Ks=y.memo(wm);const mi="loadingBlock_",Em=({progress:e=0,steps:t=!1,className:n=""})=>{const r=se.useIntl();t||(t={0:{text:r.formatMessage({id:`${mi}loading`})},75:{text:r.formatMessage({id:`${mi}almostDone`})},100:{text:r.formatMessage({id:`${mi}complete`})}});let a=null;const i=Object.keys(t);for(let o=0;o<i.length&&!(e<parseInt(i[o]));o++)a=i[o];const s=a&&t[a].icon?{"--icon":`url(${Lt}icons/${t[a].icon}.svg)`}:{};return d.jsxs($t,{className:G("loading-block",n,{"has-icon":a&&t[a].icon}),variant:"subtle",style:s,children:[a&&d.jsx("span",{className:"step",children:t[a].text}),d.jsx(Ks,{progress:e})]})},_m=y.memo(Em);const kt=({element:e="div",className:t="",...n})=>d.jsx(Ka,{element:e,className:G("loading-placeholder",t),...n});const gs={header:["logo","link","link","search"],sidebar:["text","text","text","text","text"],"cards-section":["subtitle","cards"],heading:["title"],cards:["card","card","card","card"],carousel:["cards","controls"],"carousel-with-title":["title","cards","controls"],answers:["text","text","text"],"text-page":["title","text","text","text","text","subtitle","text","text","text","text","subtitle","text","text","text","text"],"form-with-answers":["question","subtitle","form","answers","answers","answers","answers","answers"],"general-website-page":["banner","text-page"],"overview-page":["header","sidebar","title","text","cards-section","cards-section","footer"],"course-navigation":["button","button"],"course-lesson-page":["breadcrumb","course-navigation","text-page"],"course-lesson-quiz":["text-page","quiz-box"]},td=(e,t)=>e in gs?d.jsx("div",{className:e,children:gs[e].map((n,r)=>td(n,r))},t):d.jsx(kt,{className:e},t),Zs=({layout:e="overview-page",...t})=>d.jsx("div",{className:G("loading-state",e),...t,children:gs[e].map((n,r)=>td(n,r))}),nd=e=>{const t=e&&e.toUpperCase().trim().split(" ");return Array.isArray(t)&&t.length>1&&t[0]!==""?t[1]===""?t[0][0]:t[0][0]+t[t.length-1][0]:e?e.substr(0,1):""},Kr=["#5AB6A3","#A2D7AF","#806056","#3962B3"],km=e=>{const t=Math.ceil(26/Kr.length),n=nd(e).toLowerCase();if(n==="")return Kr[0];const r=n.charCodeAt(0)-96;for(let a=0;a<Kr.length;a++)if(r<=t*(a+1))return Kr[a]};const nu=256,Gt=({className:e="",src:t="",name:n,alt:r,width:a=nu,height:i=nu,showInitials:s=!0,...o})=>{const[l,u]=y.useState(!1),c=y.useRef(null),h=r??n;y.useEffect(()=>{const m=c.current;if(!m)return;const g=m.getContext("2d");if(!g)return;const f=a,b=i;typeof window<"u"&&window.devicePixelRatio&&(m.width=f*window.devicePixelRatio,m.height=b*window.devicePixelRatio,g.scale(window.devicePixelRatio,window.devicePixelRatio)),g.fillStyle=km(n),g.fillRect(0,0,f,b),g.font=`${f/3}px Arial`,g.textAlign="center",g.fillStyle="white",g.fillText(nd(n),f/2,b/1.6)},[n]);let p=!1;return t&&t!==""&&!l&&(t.includes("http")||t.includes("//"))&&(p=!0),d.jsx("figure",{className:G("profile-picture",e,{error:l}),...o,children:p?d.jsx("img",{src:t,alt:h,onError:()=>{u(!0)},width:a,height:i}):s?d.jsx("canvas",{ref:c}):d.jsx("span",{className:"fallback"})})};var rt=(e=>(e.DISCUSSION_FORM_SUBMITTED="discussionFormSubmitted",e.DISCUSSION_POST_CLICKED="discussionPostClicked",e.MEMBER_CLICKED="memberClicked",e))(rt||{});const Qa=e=>e==="apolitical"?{image:`${Lt}logos/member_apolitical.svg`}:e==="community"||typeof e=="object"&&!e.name?{image:`${Lt}logos/member_community.svg`}:{name:e.name,role:e.jobTitle||"",organisation:e.organization||"",country:e.location&&e.location.country||"",url:`/profiles/${e.id}`,image:e.image&&e.image.thumbnail},Bm=({role:e="",organisation:t="",country:n="",maximumCharacters:r=80})=>{const a=e!=="",i=t!=="",s=n!=="";if(!a&&!i&&!s)return"";const o=`${e}${a&&i?` — ${t}`:t}`;let l=`${o}${(a||i)&&s?`, ${n}`:n}`;return l.length>r&&(l=o),l.length>r&&(l=Gn(l,r)),l};let Zr=null;const _n=({element:e="div",member:t="community",additionalContent:n=!1,styling:r={},functions:a={},gtmContext:i="member",gtmType:s="member-click",className:o="",alt:l=""})=>{const u=se.useIntl(),{size:c="medium"}=r,h=Qa(t);h.name||(h.name=u.formatMessage({id:`member_${typeof t=="string"?t:"community"}`}));const{name:p,image:m}=h;let{url:g}=h;t.link!==void 0&&(t.link===!1?g=void 0:g=t.link);const f=Bm(h),b=n&&n.createdAt?fs(n.createdAt):!1,v=n&&n.createdAt?Vs(n.createdAt):"";return y.createElement(e,{className:G("member text-medium",c,o),...a,children:d.jsxs(jn,{href:g,gtmType:s,gtmContext:i,onClick:E=>{E==null||E.preventDefault(),E==null||E.stopPropagation(),Zr&&clearTimeout(Zr),Zr=setTimeout(()=>{window.location.href=g},150);const k=new CustomEvent(rt.MEMBER_CLICKED,{detail:{link:g,timeout:Zr}});document.dispatchEvent(k)},children:[d.jsx(Gt,{name:p,src:m,alt:l}),d.jsxs("p",{className:"details",children:[d.jsxs("strong",{children:[p,n&&d.jsxs("span",{className:"additional-content",children:[n.createdAt&&b&&d.jsx("span",{className:"date",title:v,"aria-label":v,children:u.formatMessage({id:`dates_${b.path}`},{number:b.number})}),n.didEdit&&d.jsx("em",{children:u.formatMessage({id:"discussion_edited"})})]})]}),f&&d.jsx("small",{className:G({"text-medium":c==="large"}),children:f})]})]})})};const ru={small:24,medium:48},Ys=({element:e="div",contributors:{total:t,data:n}={total:void 0,data:[]},styling:{showText:r,size:a,showGap:i,showPlaceholders:s}={showText:!0,size:"medium",showGap:!0,showPlaceholders:!1},cutoff:o=2,multipleText:l,className:u="",...c})=>{const h=se.useIntl();return!n||n.length===0?null:y.createElement(e,{...c,className:G("contributors",u,a,{"has-gap":i}),children:d.jsxs(d.Fragment,{children:[d.jsx("ul",{children:n.map((p,m)=>{let g,f="";if(m<o){const{name:b="",image:v=""}=Qa(p);if(s)return d.jsx(kt,{element:"li",className:"contributor"},m);g=d.jsx(Gt,{name:b,src:v,width:ru[a||"medium"],height:ru[a||"medium"]})}else if(m===o){const b=(t||n.length)-o;g=d.jsxs("small",{className:G({"large-number":b>99}),children:["+",rm(b,0)]}),f="number-left"}return g?d.jsx("li",{className:G("contributor",f),children:g},m):null})}),r&&d.jsx("span",{className:"label",children:typeof r=="string"?r:n.length===1?typeof n[0]=="string"?h.formatMessage({id:`member_${n[0]}`}):Gn(n[0].name||"",20):l||null})]})})};const Gs=({element:e="section",children:t,className:n,...r})=>y.createElement(e,{className:G("modal",n),children:typeof t=="string"?d.jsx("p",{children:t}):t,...r});var vs={exports:{}},Yr={exports:{}},Me={};/** @license React v16.13.1
37
+ `))},[a]),C.useEffect(()=>{h==="ready-to-close"&&p("closing")},[h]);const m=({propertyName:f})=>{f==="max-height"&&p(b=>b==="opening"?"open":b==="closing"?"closed":b)};if(!a)return null;const g=["opening","open"].includes(h);return d.jsxs($t,{variant:"subtle",className:Y("hide-show-text-box",t),children:[d.jsxs("div",{ref:l,id:e,className:Y("content",h),children:[d.jsx(It,{options:{forceBlock:!0,...i},children:h==="closed"?u:a}),h!=="closed"&&s]}),d.jsx("p",{className:"cta",children:d.jsx(ke,{variant:"tertiary",icon:{icon:"navigation_arrow",position:"left",animate:!0},styling:{muted:!0},className:Y({"rotate-180":g}),onClick:()=>{p(g?"ready-to-close":"opening")},"aria-expanded":g,"aria-controls":e,children:g?r||o.formatMessage({id:"hideShowTextBox_hide"}):n||o.formatMessage({id:"hideShowTextBox_show"})})})]})};const dm=({element:e="ul",layout:t="vertical",variant:n="default",items:r=[],styling:a={},className:i=""})=>{const{hasBorder:s=!1,zebraStriping:o=!1}=a;return C.createElement(e,{className:Y("icon-bulleted-list text-medium",n,i,{"has-border":s,"has-zebra-stripes":o,[t]:e!=="dl"}),children:r.map((l,u)=>{const c={wrapper:C.Fragment,forceInline:!0},h={"--icon":`url(${Lt}icons/${l.icon}.svg)`};return e==="dl"?d.jsxs(C.Fragment,{children:[d.jsx("dt",{style:h,children:d.jsx(It,{options:c,children:l.dt||""})},`dt-${u}`),d.jsx("dd",{children:typeof l.text=="string"?d.jsx(It,{options:c,children:l.text}):l.text},`dd-${u}`)]},`dl-${u}`):d.jsx("li",{style:h,children:typeof l.text=="string"?d.jsx(It,{options:c,children:l.text}):l.text},u)})})},nt=()=>C.Fragment,fm=({children:e})=>d.jsx($t,{variant:"secondary",children:e}),hm=({children:e})=>typeof e=="object"&&Object.keys(e||{}).length===1?d.jsx("p",{className:"center",children:e}):d.jsx("div",{className:"center",children:e}),mm=["span","strong","h1","h2","h3","h4","h5","h6","p"],pm=({children:e})=>{const t=oe.useIntl();if(!e)return null;let n=t.formatMessage({id:"markdown_collapsibleSection_summary"});const r=[];for(const i of C.Children.toArray(e))if(!(!i||typeof i=="string"||typeof i=="number"))if(C.isValidElement(i)&&i.type==="summary"){if(i.props&&i.props.children){for(const s of C.Children.toArray(i.props.children))if(!(!s||typeof s=="string"||typeof s=="number")&&C.isValidElement(s)){const o=s.type;if(mm.includes(o)){for(n=s.props.children;typeof n!="string"&&(Array.isArray(n)&&n[0].props&&n[0].props.children&&n[0].props.children[0]);)n=n[0].props.children[0];break}}}}else r.push(i);const a=n?n.toString():"";return d.jsx(Ga,{label:a,className:["Sources","Resources"].includes(a)?"discrete-links":"",children:r.map(i=>i)})},gm=({children:e,...t})=>{if(t.class)switch(t.class){case"casestudy":return d.jsx($t,{variant:"secondary",children:e});case"general-textbox":case"highlight-box":return d.jsx($t,{variant:"primary",children:e});case"pink-textbox":return d.jsx($t,{variant:"tertiary",children:e});case"content":return typeof e=="object"&&Object.keys(e||{}).length===1?d.jsx("p",{children:e}):e;default:return d.jsx("div",{...t,children:e})}return d.jsx("div",{...t,children:e})},Dt=({children:e})=>d.jsx(d.Fragment,{children:e}),vm=e=>{const t=oe.useIntl(),n=Date.now().toString();let r="default";const a=e.src;return a.includes("youtube")||a.includes("vimeo")?r="video":a.includes("riddle")||a.includes("sli.do")?r="poll":a.includes("padlet")&&(r="padlet"),d.jsxs(d.Fragment,{children:[d.jsx(Ie,{element:"a",href:`#content-after-iframe-${n}`,onClick:i=>{var s;i.preventDefault(),i.stopPropagation(),(s=document.getElementById(`content-after-iframe-${n}`))==null||s.scrollIntoView({behavior:"smooth"})},children:t.formatMessage({id:`markdown_skip${r==="default"?"":`_${r}`}`})}),d.jsx("iframe",{...e,title:t.formatMessage({id:`markdown_iframe${r==="default"?"":`_${r}`}`})}),d.jsx("span",{id:`content-after-iframe-${n}`})]})},eu=e=>{let t="";return e&&typeof e!="string"&&typeof e!="number"&&typeof e!="boolean"&&"type"in e&&(t=e.type),t},bm=({children:e,...t})=>{let n={...t};t.href&&(t.href.includes("http:")||t.href.includes("https:"))&&!t.target&&(n.target="_blank");let r=e,a=!1;for(const i of C.Children.toArray(e))if(!(!i||typeof i=="string"||typeof i=="number")&&C.isValidElement(i)){const s=i.type;if(["button","center","span","strong"].includes(s)&&i.props&&i.props.children&&i.props.children[0])for((s==="button"||eu(i.props.children[0])==="button")&&(a=!0),r=i.props.children[0];r&&typeof r!="string"&&!(typeof r=="boolean"||typeof r=="number"||!C.isValidElement(r));)if(r.props&&r.props.children&&r.props.children[0])r=r.props.children[0],r&&eu(r)==="button"&&(a=!0);else break}return a?(n={...n,className:"button primary medium"},d.jsx("p",{className:"center",children:d.jsx(ke,{variant:"primary",size:"medium",...n,children:r})})):d.jsx("a",{...n,children:r})},ps=({children:e,...t})=>d.jsx("span",{className:Y({url:t==null?void 0:t.href}),children:e});const ym={default:{a:bm,CollapsibleSection:Ga,TextBox:$t,CaseStudy:fm,style:nt,details:pm,div:gm,iframe:vm,center:hm},"text-only":{h1:nt,h2:nt,h3:nt,h4:nt,h5:nt,h6:nt,style:nt,details:nt,div:nt,TextBox:nt,CollapsibleSection:nt,CaseStudy:nt,blockquote:nt,iframe:nt,button:nt}},En=({element:e="div",className:t="",options:n={},children:r,overrideType:a="default",styling:i={}})=>{if(!r)return null;const{highlightTitles:s=!1}=i;r=r.replace(/^<br\/?>/,"");const o={wrapper:C.Fragment,forceBlock:!0};let l=ym[a];return n.overrides&&(l={...l,...n.overrides}),C.createElement(e,{className:Y("markdown-text",t,{"highlight-titles":s}),children:d.jsx(It,{options:{...o,...n,overrides:l},children:r})})};const Xc=({maxWidth:e=!1,title:t,subtitle:n,children:r,className:a=""})=>{const i=e?{"--max-width":`${e/16}rem`}:{};return d.jsxs("section",{className:Y("page-heading",a),children:[d.jsxs("div",{className:Y("content",{"has-max-width":e}),style:i,children:[t&&t.text&&C.createElement(t.element||"h1",{className:"title"},t.text),n&&n.text&&C.createElement(n.element||"h2",{className:"text-medium"},n.text)]}),r]})};const Cn=({size:e="medium",variant:t="default",className:n="",icon:r,tooltip:a="",children:i,...s})=>{const o={"--icon":`url(${Lt}icons/${r}.svg)`},{showTooltip:l,tooltipProps:u}=Hs(!!a),c=d.jsx("span",{...u,className:Y("pill",e,t,n,{"has-icon":r}),style:o,...s,children:i});return a?d.jsxs("span",{className:"pill-wrapper",children:[d.jsx(Sn,{isOpen:l,children:a}),c]}):c};const Tr=({element:e="p",children:t=null,className:n="",...r})=>C.createElement(e,{...r,className:Y("status-banner text-small",n),"aria-live":"assertive"},t);const Cm=({styling:e={},progress:t=0,text:n=!1,className:r=""})=>{const a=oe.useIntl(),{showText:i=!1,layout:s="bar",size:o="default",color:l="default"}=e,u=t>75?100:t>50?75:t>25?50:t>5?25:0,c={"--progress":`${t}%`};return d.jsx("span",{className:Y(`progress-bar section-${u}`,s,r,{[o]:o!=="default",[l!=="default"?l:""]:l!=="default"}),style:c,children:C.createElement(i?"span":Ie,{className:i?"text":"",children:n||a.formatMessage({id:"progressBar"},{number:t})})})},Ks=C.memo(Cm);const mi="loadingBlock_",Dm=({progress:e=0,steps:t=!1,className:n=""})=>{const r=oe.useIntl();t||(t={0:{text:r.formatMessage({id:`${mi}loading`})},75:{text:r.formatMessage({id:`${mi}almostDone`})},100:{text:r.formatMessage({id:`${mi}complete`})}});let a=null;const i=Object.keys(t);for(let o=0;o<i.length&&!(e<parseInt(i[o]));o++)a=i[o];const s=a&&t[a].icon?{"--icon":`url(${Lt}icons/${t[a].icon}.svg)`}:{};return d.jsxs($t,{className:Y("loading-block",n,{"has-icon":a&&t[a].icon}),variant:"subtle",style:s,children:[a&&d.jsx("span",{className:"step",children:t[a].text}),d.jsx(Ks,{progress:e})]})},xm=C.memo(Dm);const _t=({element:e="div",className:t="",...n})=>d.jsx(Ka,{element:e,className:Y("loading-placeholder",t),...n});const gs={header:["logo","link","link","search"],sidebar:["text","text","text","text","text"],"cards-section":["subtitle","cards"],heading:["title"],cards:["card","card","card","card"],carousel:["cards","controls"],"carousel-with-title":["title","cards","controls"],answers:["text","text","text"],"text-page":["title","text","text","text","text","subtitle","text","text","text","text","subtitle","text","text","text","text"],"form-with-answers":["question","subtitle","form","answers","answers","answers","answers","answers"],"general-website-page":["banner","text-page"],"overview-page":["header","sidebar","title","text","cards-section","cards-section","footer"],"course-navigation":["button","button"],"course-lesson-page":["breadcrumb","course-navigation","text-page"],"course-lesson-quiz":["text-page","quiz-box"]},ed=(e,t)=>e in gs?d.jsx("div",{className:e,children:gs[e].map((n,r)=>ed(n,r))},t):d.jsx(_t,{className:e},t),Zs=({layout:e="overview-page",...t})=>d.jsx("div",{className:Y("loading-state",e),...t,children:gs[e].map((n,r)=>ed(n,r))}),td=e=>{const t=e&&e.toUpperCase().trim().split(" ");return Array.isArray(t)&&t.length>1&&t[0]!==""?t[1]===""?t[0][0]:t[0][0]+t[t.length-1][0]:e?e.substr(0,1):""},Kr=["#5AB6A3","#A2D7AF","#806056","#3962B3"],wm=e=>{const t=Math.ceil(26/Kr.length),n=td(e).toLowerCase();if(n==="")return Kr[0];const r=n.charCodeAt(0)-96;for(let a=0;a<Kr.length;a++)if(r<=t*(a+1))return Kr[a]};const tu=256,Gt=({className:e="",src:t="",name:n,alt:r,width:a=tu,height:i=tu,showInitials:s=!0,...o})=>{const[l,u]=C.useState(!1),c=C.useRef(null),h=r??n;C.useEffect(()=>{const m=c.current;if(!m)return;const g=m.getContext("2d");if(!g)return;const f=a,b=i;typeof window<"u"&&window.devicePixelRatio&&(m.width=f*window.devicePixelRatio,m.height=b*window.devicePixelRatio,g.scale(window.devicePixelRatio,window.devicePixelRatio)),g.fillStyle=wm(n),g.fillRect(0,0,f,b),g.font=`${f/3}px Arial`,g.textAlign="center",g.fillStyle="white",g.fillText(td(n),f/2,b/1.6)},[n]);let p=!1;return t&&t!==""&&!l&&(t.includes("http")||t.includes("//"))&&(p=!0),d.jsx("figure",{className:Y("profile-picture",e,{error:l}),...o,children:p?d.jsx("img",{src:t,alt:h,onError:()=>{u(!0)},width:a,height:i}):s?d.jsx("canvas",{ref:c}):d.jsx("span",{className:"fallback"})})};var Nt=(e=>(e.DISCUSSION_POST_CLICKED="discussionPostClicked",e.MEMBER_CLICKED="memberClicked",e))(Nt||{});const Qa=e=>e==="apolitical"?{image:`${Lt}logos/member_apolitical.svg`}:e==="community"||typeof e=="object"&&!e.name?{image:`${Lt}logos/member_community.svg`}:{name:e.name,role:e.jobTitle||"",organisation:e.organization||"",country:e.location&&e.location.country||"",url:`/profiles/${e.id}`,image:e.image&&e.image.thumbnail},Em=({role:e="",organisation:t="",country:n="",maximumCharacters:r=80})=>{const a=e!=="",i=t!=="",s=n!=="";if(!a&&!i&&!s)return"";const o=`${e}${a&&i?` — ${t}`:t}`;let l=`${o}${(a||i)&&s?`, ${n}`:n}`;return l.length>r&&(l=o),l.length>r&&(l=Gn(l,r)),l};let Zr=null;const _n=({element:e="div",member:t="community",additionalContent:n=!1,styling:r={},functions:a={},gtmContext:i="member",gtmType:s="member-click",className:o="",alt:l=""})=>{const u=oe.useIntl(),{size:c="medium"}=r,h=Qa(t);h.name||(h.name=u.formatMessage({id:`member_${typeof t=="string"?t:"community"}`}));const{name:p,image:m}=h;let{url:g}=h;t.link!==void 0&&(t.link===!1?g=void 0:g=t.link);const f=Em(h),b=n&&n.createdAt?fs(n.createdAt):!1,v=n&&n.createdAt?Vs(n.createdAt):"";return C.createElement(e,{className:Y("member text-medium",c,o),...a,children:d.jsxs(jn,{href:g,gtmType:s,gtmContext:i,onClick:E=>{E==null||E.preventDefault(),E==null||E.stopPropagation(),Zr&&clearTimeout(Zr),Zr=setTimeout(()=>{window.location.href=g},150);const k=new CustomEvent(Nt.MEMBER_CLICKED,{detail:{link:g,timeout:Zr}});document.dispatchEvent(k)},children:[d.jsx(Gt,{name:p,src:m,alt:l}),d.jsxs("p",{className:"details",children:[d.jsxs("strong",{children:[p,n&&d.jsxs("span",{className:"additional-content",children:[n.createdAt&&b&&d.jsx("span",{className:"date",title:v,"aria-label":v,children:u.formatMessage({id:`dates_${b.path}`},{number:b.number})}),n.didEdit&&d.jsx("em",{children:u.formatMessage({id:"discussion_edited"})})]})]}),f&&d.jsx("small",{className:Y({"text-medium":c==="large"}),children:f})]})]})})};const nu={small:24,medium:48},Ys=({element:e="div",contributors:{total:t,data:n}={total:void 0,data:[]},styling:{showText:r,size:a,showGap:i,showPlaceholders:s}={showText:!0,size:"medium",showGap:!0,showPlaceholders:!1},cutoff:o=2,multipleText:l,className:u="",...c})=>{const h=oe.useIntl();return!n||n.length===0?null:C.createElement(e,{...c,className:Y("contributors",u,a,{"has-gap":i}),children:d.jsxs(d.Fragment,{children:[d.jsx("ul",{children:n.map((p,m)=>{let g,f="";if(m<o){const{name:b="",image:v=""}=Qa(p);if(s)return d.jsx(_t,{element:"li",className:"contributor"},m);g=d.jsx(Gt,{name:b,src:v,width:nu[a||"medium"],height:nu[a||"medium"]})}else if(m===o){const b=(t||n.length)-o;g=d.jsxs("small",{className:Y({"large-number":b>99}),children:["+",tm(b,0)]}),f="number-left"}return g?d.jsx("li",{className:Y("contributor",f),children:g},m):null})}),r&&d.jsx("span",{className:"label",children:typeof r=="string"?r:n.length===1?typeof n[0]=="string"?h.formatMessage({id:`member_${n[0]}`}):Gn(n[0].name||"",20):l||null})]})})};const Gs=({element:e="section",children:t,className:n,...r})=>C.createElement(e,{className:Y("modal",n),children:typeof t=="string"?d.jsx("p",{children:t}):t,...r});var vs={exports:{}},Yr={exports:{}},Re={};/** @license React v16.13.1
38
38
  * react-is.production.min.js
39
39
  *
40
40
  * Copyright (c) Facebook, Inc. and its affiliates.
41
41
  *
42
42
  * This source code is licensed under the MIT license found in the
43
43
  * LICENSE file in the root directory of this source tree.
44
- */var au;function Fm(){if(au)return Me;au=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,a=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,o=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,h=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,m=e?Symbol.for("react.memo"):60115,g=e?Symbol.for("react.lazy"):60116,f=e?Symbol.for("react.block"):60121,b=e?Symbol.for("react.fundamental"):60117,v=e?Symbol.for("react.responder"):60118,E=e?Symbol.for("react.scope"):60119;function k(w){if(typeof w=="object"&&w!==null){var A=w.$$typeof;switch(A){case t:switch(w=w.type,w){case l:case u:case r:case i:case a:case h:return w;default:switch(w=w&&w.$$typeof,w){case o:case c:case g:case m:case s:return w;default:return A}}case n:return A}}}function x(w){return k(w)===u}return Me.AsyncMode=l,Me.ConcurrentMode=u,Me.ContextConsumer=o,Me.ContextProvider=s,Me.Element=t,Me.ForwardRef=c,Me.Fragment=r,Me.Lazy=g,Me.Memo=m,Me.Portal=n,Me.Profiler=i,Me.StrictMode=a,Me.Suspense=h,Me.isAsyncMode=function(w){return x(w)||k(w)===l},Me.isConcurrentMode=x,Me.isContextConsumer=function(w){return k(w)===o},Me.isContextProvider=function(w){return k(w)===s},Me.isElement=function(w){return typeof w=="object"&&w!==null&&w.$$typeof===t},Me.isForwardRef=function(w){return k(w)===c},Me.isFragment=function(w){return k(w)===r},Me.isLazy=function(w){return k(w)===g},Me.isMemo=function(w){return k(w)===m},Me.isPortal=function(w){return k(w)===n},Me.isProfiler=function(w){return k(w)===i},Me.isStrictMode=function(w){return k(w)===a},Me.isSuspense=function(w){return k(w)===h},Me.isValidElementType=function(w){return typeof w=="string"||typeof w=="function"||w===r||w===u||w===i||w===a||w===h||w===p||typeof w=="object"&&w!==null&&(w.$$typeof===g||w.$$typeof===m||w.$$typeof===s||w.$$typeof===o||w.$$typeof===c||w.$$typeof===b||w.$$typeof===v||w.$$typeof===E||w.$$typeof===f)},Me.typeOf=k,Me}var Re={};/** @license React v16.13.1
44
+ */var ru;function _m(){if(ru)return Re;ru=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,a=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,o=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,h=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,m=e?Symbol.for("react.memo"):60115,g=e?Symbol.for("react.lazy"):60116,f=e?Symbol.for("react.block"):60121,b=e?Symbol.for("react.fundamental"):60117,v=e?Symbol.for("react.responder"):60118,E=e?Symbol.for("react.scope"):60119;function k(w){if(typeof w=="object"&&w!==null){var A=w.$$typeof;switch(A){case t:switch(w=w.type,w){case l:case u:case r:case i:case a:case h:return w;default:switch(w=w&&w.$$typeof,w){case o:case c:case g:case m:case s:return w;default:return A}}case n:return A}}}function x(w){return k(w)===u}return Re.AsyncMode=l,Re.ConcurrentMode=u,Re.ContextConsumer=o,Re.ContextProvider=s,Re.Element=t,Re.ForwardRef=c,Re.Fragment=r,Re.Lazy=g,Re.Memo=m,Re.Portal=n,Re.Profiler=i,Re.StrictMode=a,Re.Suspense=h,Re.isAsyncMode=function(w){return x(w)||k(w)===l},Re.isConcurrentMode=x,Re.isContextConsumer=function(w){return k(w)===o},Re.isContextProvider=function(w){return k(w)===s},Re.isElement=function(w){return typeof w=="object"&&w!==null&&w.$$typeof===t},Re.isForwardRef=function(w){return k(w)===c},Re.isFragment=function(w){return k(w)===r},Re.isLazy=function(w){return k(w)===g},Re.isMemo=function(w){return k(w)===m},Re.isPortal=function(w){return k(w)===n},Re.isProfiler=function(w){return k(w)===i},Re.isStrictMode=function(w){return k(w)===a},Re.isSuspense=function(w){return k(w)===h},Re.isValidElementType=function(w){return typeof w=="string"||typeof w=="function"||w===r||w===u||w===i||w===a||w===h||w===p||typeof w=="object"&&w!==null&&(w.$$typeof===g||w.$$typeof===m||w.$$typeof===s||w.$$typeof===o||w.$$typeof===c||w.$$typeof===b||w.$$typeof===v||w.$$typeof===E||w.$$typeof===f)},Re.typeOf=k,Re}var Me={};/** @license React v16.13.1
45
45
  * react-is.development.js
46
46
  *
47
47
  * Copyright (c) Facebook, Inc. and its affiliates.
48
48
  *
49
49
  * This source code is licensed under the MIT license found in the
50
50
  * LICENSE file in the root directory of this source tree.
51
- */var iu;function Am(){return iu||(iu=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,a=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,o=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,h=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,m=e?Symbol.for("react.memo"):60115,g=e?Symbol.for("react.lazy"):60116,f=e?Symbol.for("react.block"):60121,b=e?Symbol.for("react.fundamental"):60117,v=e?Symbol.for("react.responder"):60118,E=e?Symbol.for("react.scope"):60119;function k(J){return typeof J=="string"||typeof J=="function"||J===r||J===u||J===i||J===a||J===h||J===p||typeof J=="object"&&J!==null&&(J.$$typeof===g||J.$$typeof===m||J.$$typeof===s||J.$$typeof===o||J.$$typeof===c||J.$$typeof===b||J.$$typeof===v||J.$$typeof===E||J.$$typeof===f)}function x(J){if(typeof J=="object"&&J!==null){var he=J.$$typeof;switch(he){case t:var me=J.type;switch(me){case l:case u:case r:case i:case a:case h:return me;default:var ve=me&&me.$$typeof;switch(ve){case o:case c:case g:case m:case s:return ve;default:return he}}case n:return he}}}var w=l,A=u,S=o,W=s,R=t,I=c,N=r,_=g,F=m,j=n,$=i,V=a,K=h,Q=!1;function ae(J){return Q||(Q=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),D(J)||x(J)===l}function D(J){return x(J)===u}function L(J){return x(J)===o}function q(J){return x(J)===s}function B(J){return typeof J=="object"&&J!==null&&J.$$typeof===t}function T(J){return x(J)===c}function z(J){return x(J)===r}function M(J){return x(J)===g}function H(J){return x(J)===m}function ne(J){return x(J)===n}function ee(J){return x(J)===i}function re(J){return x(J)===a}function le(J){return x(J)===h}Re.AsyncMode=w,Re.ConcurrentMode=A,Re.ContextConsumer=S,Re.ContextProvider=W,Re.Element=R,Re.ForwardRef=I,Re.Fragment=N,Re.Lazy=_,Re.Memo=F,Re.Portal=j,Re.Profiler=$,Re.StrictMode=V,Re.Suspense=K,Re.isAsyncMode=ae,Re.isConcurrentMode=D,Re.isContextConsumer=L,Re.isContextProvider=q,Re.isElement=B,Re.isForwardRef=T,Re.isFragment=z,Re.isLazy=M,Re.isMemo=H,Re.isPortal=ne,Re.isProfiler=ee,Re.isStrictMode=re,Re.isSuspense=le,Re.isValidElementType=k,Re.typeOf=x}()),Re}var su;function rd(){return su||(su=1,process.env.NODE_ENV==="production"?Yr.exports=Fm():Yr.exports=Am()),Yr.exports}/*
51
+ */var au;function km(){return au||(au=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,a=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,o=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,h=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,m=e?Symbol.for("react.memo"):60115,g=e?Symbol.for("react.lazy"):60116,f=e?Symbol.for("react.block"):60121,b=e?Symbol.for("react.fundamental"):60117,v=e?Symbol.for("react.responder"):60118,E=e?Symbol.for("react.scope"):60119;function k(ee){return typeof ee=="string"||typeof ee=="function"||ee===r||ee===u||ee===i||ee===a||ee===h||ee===p||typeof ee=="object"&&ee!==null&&(ee.$$typeof===g||ee.$$typeof===m||ee.$$typeof===s||ee.$$typeof===o||ee.$$typeof===c||ee.$$typeof===b||ee.$$typeof===v||ee.$$typeof===E||ee.$$typeof===f)}function x(ee){if(typeof ee=="object"&&ee!==null){var he=ee.$$typeof;switch(he){case t:var me=ee.type;switch(me){case l:case u:case r:case i:case a:case h:return me;default:var ye=me&&me.$$typeof;switch(ye){case o:case c:case g:case m:case s:return ye;default:return he}}case n:return he}}}var w=l,A=u,S=o,q=s,$=t,N=c,L=r,_=g,B=m,j=n,I=i,G=a,V=h,Q=!1;function ae(ee){return Q||(Q=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),D(ee)||x(ee)===l}function D(ee){return x(ee)===u}function M(ee){return x(ee)===o}function W(ee){return x(ee)===s}function F(ee){return typeof ee=="object"&&ee!==null&&ee.$$typeof===t}function T(ee){return x(ee)===c}function z(ee){return x(ee)===r}function R(ee){return x(ee)===g}function H(ee){return x(ee)===m}function re(ee){return x(ee)===n}function X(ee){return x(ee)===i}function ne(ee){return x(ee)===a}function le(ee){return x(ee)===h}Me.AsyncMode=w,Me.ConcurrentMode=A,Me.ContextConsumer=S,Me.ContextProvider=q,Me.Element=$,Me.ForwardRef=N,Me.Fragment=L,Me.Lazy=_,Me.Memo=B,Me.Portal=j,Me.Profiler=I,Me.StrictMode=G,Me.Suspense=V,Me.isAsyncMode=ae,Me.isConcurrentMode=D,Me.isContextConsumer=M,Me.isContextProvider=W,Me.isElement=F,Me.isForwardRef=T,Me.isFragment=z,Me.isLazy=R,Me.isMemo=H,Me.isPortal=re,Me.isProfiler=X,Me.isStrictMode=ne,Me.isSuspense=le,Me.isValidElementType=k,Me.typeOf=x}()),Me}var iu;function nd(){return iu||(iu=1,process.env.NODE_ENV==="production"?Yr.exports=_m():Yr.exports=km()),Yr.exports}/*
52
52
  object-assign
53
53
  (c) Sindre Sorhus
54
54
  @license MIT
55
- */var pi,ou;function Tm(){if(ou)return pi;ou=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function a(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var s={},o=0;o<10;o++)s["_"+String.fromCharCode(o)]=o;var l=Object.getOwnPropertyNames(s).map(function(c){return s[c]});if(l.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(c){u[c]=c}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return pi=a()?Object.assign:function(i,s){for(var o,l=r(i),u,c=1;c<arguments.length;c++){o=Object(arguments[c]);for(var h in o)t.call(o,h)&&(l[h]=o[h]);if(e){u=e(o);for(var p=0;p<u.length;p++)n.call(o,u[p])&&(l[u[p]]=o[u[p]])}}return l},pi}var gi,uu;function Qs(){if(uu)return gi;uu=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return gi=e,gi}var vi,lu;function ad(){return lu||(lu=1,vi=Function.call.bind(Object.prototype.hasOwnProperty)),vi}var bi,cu;function Sm(){if(cu)return bi;cu=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Qs(),n={},r=ad();e=function(i){var s="Warning: "+i;typeof console<"u"&&console.error(s);try{throw new Error(s)}catch{}}}function a(i,s,o,l,u){if(process.env.NODE_ENV!=="production"){for(var c in i)if(r(i,c)){var h;try{if(typeof i[c]!="function"){var p=Error((l||"React class")+": "+o+" type `"+c+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[c]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw p.name="Invariant Violation",p}h=i[c](s,c,l,o,null,t)}catch(g){h=g}if(h&&!(h instanceof Error)&&e((l||"React class")+": type specification of "+o+" `"+c+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof h+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),h instanceof Error&&!(h.message in n)){n[h.message]=!0;var m=u?u():"";e("Failed "+o+" type: "+h.message+(m??""))}}}}return a.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},bi=a,bi}var yi,du;function jm(){if(du)return yi;du=1;var e=rd(),t=Tm(),n=Qs(),r=ad(),a=Sm(),i=function(){};process.env.NODE_ENV!=="production"&&(i=function(o){var l="Warning: "+o;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function s(){return null}return yi=function(o,l){var u=typeof Symbol=="function"&&Symbol.iterator,c="@@iterator";function h(D){var L=D&&(u&&D[u]||D[c]);if(typeof L=="function")return L}var p="<<anonymous>>",m={array:v("array"),bigint:v("bigint"),bool:v("boolean"),func:v("function"),number:v("number"),object:v("object"),string:v("string"),symbol:v("symbol"),any:E(),arrayOf:k,element:x(),elementType:w(),instanceOf:A,node:I(),objectOf:W,oneOf:S,oneOfType:R,shape:_,exact:F};function g(D,L){return D===L?D!==0||1/D===1/L:D!==D&&L!==L}function f(D,L){this.message=D,this.data=L&&typeof L=="object"?L:{},this.stack=""}f.prototype=Error.prototype;function b(D){if(process.env.NODE_ENV!=="production")var L={},q=0;function B(z,M,H,ne,ee,re,le){if(ne=ne||p,re=re||H,le!==n){if(l){var J=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 J.name="Invariant Violation",J}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var he=ne+":"+H;!L[he]&&q<3&&(i("You are manually calling a React.PropTypes validation function for the `"+re+"` prop on `"+ne+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),L[he]=!0,q++)}}return M[H]==null?z?M[H]===null?new f("The "+ee+" `"+re+"` is marked as required "+("in `"+ne+"`, but its value is `null`.")):new f("The "+ee+" `"+re+"` is marked as required in "+("`"+ne+"`, but its value is `undefined`.")):null:D(M,H,ne,ee,re)}var T=B.bind(null,!1);return T.isRequired=B.bind(null,!0),T}function v(D){function L(q,B,T,z,M,H){var ne=q[B],ee=V(ne);if(ee!==D){var re=K(ne);return new f("Invalid "+z+" `"+M+"` of type "+("`"+re+"` supplied to `"+T+"`, expected ")+("`"+D+"`."),{expectedType:D})}return null}return b(L)}function E(){return b(s)}function k(D){function L(q,B,T,z,M){if(typeof D!="function")return new f("Property `"+M+"` of component `"+T+"` has invalid PropType notation inside arrayOf.");var H=q[B];if(!Array.isArray(H)){var ne=V(H);return new f("Invalid "+z+" `"+M+"` of type "+("`"+ne+"` supplied to `"+T+"`, expected an array."))}for(var ee=0;ee<H.length;ee++){var re=D(H,ee,T,z,M+"["+ee+"]",n);if(re instanceof Error)return re}return null}return b(L)}function x(){function D(L,q,B,T,z){var M=L[q];if(!o(M)){var H=V(M);return new f("Invalid "+T+" `"+z+"` of type "+("`"+H+"` supplied to `"+B+"`, expected a single ReactElement."))}return null}return b(D)}function w(){function D(L,q,B,T,z){var M=L[q];if(!e.isValidElementType(M)){var H=V(M);return new f("Invalid "+T+" `"+z+"` of type "+("`"+H+"` supplied to `"+B+"`, expected a single ReactElement type."))}return null}return b(D)}function A(D){function L(q,B,T,z,M){if(!(q[B]instanceof D)){var H=D.name||p,ne=ae(q[B]);return new f("Invalid "+z+" `"+M+"` of type "+("`"+ne+"` supplied to `"+T+"`, expected ")+("instance of `"+H+"`."))}return null}return b(L)}function S(D){if(!Array.isArray(D))return process.env.NODE_ENV!=="production"&&(arguments.length>1?i("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):i("Invalid argument supplied to oneOf, expected an array.")),s;function L(q,B,T,z,M){for(var H=q[B],ne=0;ne<D.length;ne++)if(g(H,D[ne]))return null;var ee=JSON.stringify(D,function(le,J){var he=K(J);return he==="symbol"?String(J):J});return new f("Invalid "+z+" `"+M+"` of value `"+String(H)+"` "+("supplied to `"+T+"`, expected one of "+ee+"."))}return b(L)}function W(D){function L(q,B,T,z,M){if(typeof D!="function")return new f("Property `"+M+"` of component `"+T+"` has invalid PropType notation inside objectOf.");var H=q[B],ne=V(H);if(ne!=="object")return new f("Invalid "+z+" `"+M+"` of type "+("`"+ne+"` supplied to `"+T+"`, expected an object."));for(var ee in H)if(r(H,ee)){var re=D(H,ee,T,z,M+"."+ee,n);if(re instanceof Error)return re}return null}return b(L)}function R(D){if(!Array.isArray(D))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var L=0;L<D.length;L++){var q=D[L];if(typeof q!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+Q(q)+" at index "+L+"."),s}function B(T,z,M,H,ne){for(var ee=[],re=0;re<D.length;re++){var le=D[re],J=le(T,z,M,H,ne,n);if(J==null)return null;J.data&&r(J.data,"expectedType")&&ee.push(J.data.expectedType)}var he=ee.length>0?", expected one of type ["+ee.join(", ")+"]":"";return new f("Invalid "+H+" `"+ne+"` supplied to "+("`"+M+"`"+he+"."))}return b(B)}function I(){function D(L,q,B,T,z){return j(L[q])?null:new f("Invalid "+T+" `"+z+"` supplied to "+("`"+B+"`, expected a ReactNode."))}return b(D)}function N(D,L,q,B,T){return new f((D||"React class")+": "+L+" type `"+q+"."+B+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+T+"`.")}function _(D){function L(q,B,T,z,M){var H=q[B],ne=V(H);if(ne!=="object")return new f("Invalid "+z+" `"+M+"` of type `"+ne+"` "+("supplied to `"+T+"`, expected `object`."));for(var ee in D){var re=D[ee];if(typeof re!="function")return N(T,z,M,ee,K(re));var le=re(H,ee,T,z,M+"."+ee,n);if(le)return le}return null}return b(L)}function F(D){function L(q,B,T,z,M){var H=q[B],ne=V(H);if(ne!=="object")return new f("Invalid "+z+" `"+M+"` of type `"+ne+"` "+("supplied to `"+T+"`, expected `object`."));var ee=t({},q[B],D);for(var re in ee){var le=D[re];if(r(D,re)&&typeof le!="function")return N(T,z,M,re,K(le));if(!le)return new f("Invalid "+z+" `"+M+"` key `"+re+"` supplied to `"+T+"`.\nBad object: "+JSON.stringify(q[B],null," ")+`
56
- Valid keys: `+JSON.stringify(Object.keys(D),null," "));var J=le(H,re,T,z,M+"."+re,n);if(J)return J}return null}return b(L)}function j(D){switch(typeof D){case"number":case"string":case"undefined":return!0;case"boolean":return!D;case"object":if(Array.isArray(D))return D.every(j);if(D===null||o(D))return!0;var L=h(D);if(L){var q=L.call(D),B;if(L!==D.entries){for(;!(B=q.next()).done;)if(!j(B.value))return!1}else for(;!(B=q.next()).done;){var T=B.value;if(T&&!j(T[1]))return!1}}else return!1;return!0;default:return!1}}function $(D,L){return D==="symbol"?!0:L?L["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&L instanceof Symbol:!1}function V(D){var L=typeof D;return Array.isArray(D)?"array":D instanceof RegExp?"object":$(L,D)?"symbol":L}function K(D){if(typeof D>"u"||D===null)return""+D;var L=V(D);if(L==="object"){if(D instanceof Date)return"date";if(D instanceof RegExp)return"regexp"}return L}function Q(D){var L=K(D);switch(L){case"array":case"object":return"an "+L;case"boolean":case"date":case"regexp":return"a "+L;default:return L}}function ae(D){return!D.constructor||!D.constructor.name?p:D.constructor.name}return m.checkPropTypes=a,m.resetWarningCache=a.resetWarningCache,m.PropTypes=m,m},yi}var Ci,fu;function Om(){if(fu)return Ci;fu=1;var e=Qs();function t(){}function n(){}return n.resetWarningCache=t,Ci=function(){function r(s,o,l,u,c,h){if(h!==e){var p=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 p.name="Invariant Violation",p}}r.isRequired=r;function a(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:a,element:r,elementType:r,instanceOf:a,node:r,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},Ci}if(process.env.NODE_ENV!=="production"){var Pm=rd(),Nm=!0;vs.exports=jm()(Pm.isElement,Nm)}else vs.exports=Om()();var Mm=vs.exports;/*!
55
+ */var pi,su;function Fm(){if(su)return pi;su=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function a(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var s={},o=0;o<10;o++)s["_"+String.fromCharCode(o)]=o;var l=Object.getOwnPropertyNames(s).map(function(c){return s[c]});if(l.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(c){u[c]=c}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return pi=a()?Object.assign:function(i,s){for(var o,l=r(i),u,c=1;c<arguments.length;c++){o=Object(arguments[c]);for(var h in o)t.call(o,h)&&(l[h]=o[h]);if(e){u=e(o);for(var p=0;p<u.length;p++)n.call(o,u[p])&&(l[u[p]]=o[u[p]])}}return l},pi}var gi,ou;function Qs(){if(ou)return gi;ou=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return gi=e,gi}var vi,uu;function rd(){return uu||(uu=1,vi=Function.call.bind(Object.prototype.hasOwnProperty)),vi}var bi,lu;function Bm(){if(lu)return bi;lu=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Qs(),n={},r=rd();e=function(i){var s="Warning: "+i;typeof console<"u"&&console.error(s);try{throw new Error(s)}catch{}}}function a(i,s,o,l,u){if(process.env.NODE_ENV!=="production"){for(var c in i)if(r(i,c)){var h;try{if(typeof i[c]!="function"){var p=Error((l||"React class")+": "+o+" type `"+c+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[c]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw p.name="Invariant Violation",p}h=i[c](s,c,l,o,null,t)}catch(g){h=g}if(h&&!(h instanceof Error)&&e((l||"React class")+": type specification of "+o+" `"+c+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof h+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),h instanceof Error&&!(h.message in n)){n[h.message]=!0;var m=u?u():"";e("Failed "+o+" type: "+h.message+(m??""))}}}}return a.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},bi=a,bi}var yi,cu;function Am(){if(cu)return yi;cu=1;var e=nd(),t=Fm(),n=Qs(),r=rd(),a=Bm(),i=function(){};process.env.NODE_ENV!=="production"&&(i=function(o){var l="Warning: "+o;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function s(){return null}return yi=function(o,l){var u=typeof Symbol=="function"&&Symbol.iterator,c="@@iterator";function h(D){var M=D&&(u&&D[u]||D[c]);if(typeof M=="function")return M}var p="<<anonymous>>",m={array:v("array"),bigint:v("bigint"),bool:v("boolean"),func:v("function"),number:v("number"),object:v("object"),string:v("string"),symbol:v("symbol"),any:E(),arrayOf:k,element:x(),elementType:w(),instanceOf:A,node:N(),objectOf:q,oneOf:S,oneOfType:$,shape:_,exact:B};function g(D,M){return D===M?D!==0||1/D===1/M:D!==D&&M!==M}function f(D,M){this.message=D,this.data=M&&typeof M=="object"?M:{},this.stack=""}f.prototype=Error.prototype;function b(D){if(process.env.NODE_ENV!=="production")var M={},W=0;function F(z,R,H,re,X,ne,le){if(re=re||p,ne=ne||H,le!==n){if(l){var ee=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 ee.name="Invariant Violation",ee}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var he=re+":"+H;!M[he]&&W<3&&(i("You are manually calling a React.PropTypes validation function for the `"+ne+"` prop on `"+re+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),M[he]=!0,W++)}}return R[H]==null?z?R[H]===null?new f("The "+X+" `"+ne+"` is marked as required "+("in `"+re+"`, but its value is `null`.")):new f("The "+X+" `"+ne+"` is marked as required in "+("`"+re+"`, but its value is `undefined`.")):null:D(R,H,re,X,ne)}var T=F.bind(null,!1);return T.isRequired=F.bind(null,!0),T}function v(D){function M(W,F,T,z,R,H){var re=W[F],X=G(re);if(X!==D){var ne=V(re);return new f("Invalid "+z+" `"+R+"` of type "+("`"+ne+"` supplied to `"+T+"`, expected ")+("`"+D+"`."),{expectedType:D})}return null}return b(M)}function E(){return b(s)}function k(D){function M(W,F,T,z,R){if(typeof D!="function")return new f("Property `"+R+"` of component `"+T+"` has invalid PropType notation inside arrayOf.");var H=W[F];if(!Array.isArray(H)){var re=G(H);return new f("Invalid "+z+" `"+R+"` of type "+("`"+re+"` supplied to `"+T+"`, expected an array."))}for(var X=0;X<H.length;X++){var ne=D(H,X,T,z,R+"["+X+"]",n);if(ne instanceof Error)return ne}return null}return b(M)}function x(){function D(M,W,F,T,z){var R=M[W];if(!o(R)){var H=G(R);return new f("Invalid "+T+" `"+z+"` of type "+("`"+H+"` supplied to `"+F+"`, expected a single ReactElement."))}return null}return b(D)}function w(){function D(M,W,F,T,z){var R=M[W];if(!e.isValidElementType(R)){var H=G(R);return new f("Invalid "+T+" `"+z+"` of type "+("`"+H+"` supplied to `"+F+"`, expected a single ReactElement type."))}return null}return b(D)}function A(D){function M(W,F,T,z,R){if(!(W[F]instanceof D)){var H=D.name||p,re=ae(W[F]);return new f("Invalid "+z+" `"+R+"` of type "+("`"+re+"` supplied to `"+T+"`, expected ")+("instance of `"+H+"`."))}return null}return b(M)}function S(D){if(!Array.isArray(D))return process.env.NODE_ENV!=="production"&&(arguments.length>1?i("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):i("Invalid argument supplied to oneOf, expected an array.")),s;function M(W,F,T,z,R){for(var H=W[F],re=0;re<D.length;re++)if(g(H,D[re]))return null;var X=JSON.stringify(D,function(le,ee){var he=V(ee);return he==="symbol"?String(ee):ee});return new f("Invalid "+z+" `"+R+"` of value `"+String(H)+"` "+("supplied to `"+T+"`, expected one of "+X+"."))}return b(M)}function q(D){function M(W,F,T,z,R){if(typeof D!="function")return new f("Property `"+R+"` of component `"+T+"` has invalid PropType notation inside objectOf.");var H=W[F],re=G(H);if(re!=="object")return new f("Invalid "+z+" `"+R+"` of type "+("`"+re+"` supplied to `"+T+"`, expected an object."));for(var X in H)if(r(H,X)){var ne=D(H,X,T,z,R+"."+X,n);if(ne instanceof Error)return ne}return null}return b(M)}function $(D){if(!Array.isArray(D))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var M=0;M<D.length;M++){var W=D[M];if(typeof W!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+Q(W)+" at index "+M+"."),s}function F(T,z,R,H,re){for(var X=[],ne=0;ne<D.length;ne++){var le=D[ne],ee=le(T,z,R,H,re,n);if(ee==null)return null;ee.data&&r(ee.data,"expectedType")&&X.push(ee.data.expectedType)}var he=X.length>0?", expected one of type ["+X.join(", ")+"]":"";return new f("Invalid "+H+" `"+re+"` supplied to "+("`"+R+"`"+he+"."))}return b(F)}function N(){function D(M,W,F,T,z){return j(M[W])?null:new f("Invalid "+T+" `"+z+"` supplied to "+("`"+F+"`, expected a ReactNode."))}return b(D)}function L(D,M,W,F,T){return new f((D||"React class")+": "+M+" type `"+W+"."+F+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+T+"`.")}function _(D){function M(W,F,T,z,R){var H=W[F],re=G(H);if(re!=="object")return new f("Invalid "+z+" `"+R+"` of type `"+re+"` "+("supplied to `"+T+"`, expected `object`."));for(var X in D){var ne=D[X];if(typeof ne!="function")return L(T,z,R,X,V(ne));var le=ne(H,X,T,z,R+"."+X,n);if(le)return le}return null}return b(M)}function B(D){function M(W,F,T,z,R){var H=W[F],re=G(H);if(re!=="object")return new f("Invalid "+z+" `"+R+"` of type `"+re+"` "+("supplied to `"+T+"`, expected `object`."));var X=t({},W[F],D);for(var ne in X){var le=D[ne];if(r(D,ne)&&typeof le!="function")return L(T,z,R,ne,V(le));if(!le)return new f("Invalid "+z+" `"+R+"` key `"+ne+"` supplied to `"+T+"`.\nBad object: "+JSON.stringify(W[F],null," ")+`
56
+ Valid keys: `+JSON.stringify(Object.keys(D),null," "));var ee=le(H,ne,T,z,R+"."+ne,n);if(ee)return ee}return null}return b(M)}function j(D){switch(typeof D){case"number":case"string":case"undefined":return!0;case"boolean":return!D;case"object":if(Array.isArray(D))return D.every(j);if(D===null||o(D))return!0;var M=h(D);if(M){var W=M.call(D),F;if(M!==D.entries){for(;!(F=W.next()).done;)if(!j(F.value))return!1}else for(;!(F=W.next()).done;){var T=F.value;if(T&&!j(T[1]))return!1}}else return!1;return!0;default:return!1}}function I(D,M){return D==="symbol"?!0:M?M["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&M instanceof Symbol:!1}function G(D){var M=typeof D;return Array.isArray(D)?"array":D instanceof RegExp?"object":I(M,D)?"symbol":M}function V(D){if(typeof D>"u"||D===null)return""+D;var M=G(D);if(M==="object"){if(D instanceof Date)return"date";if(D instanceof RegExp)return"regexp"}return M}function Q(D){var M=V(D);switch(M){case"array":case"object":return"an "+M;case"boolean":case"date":case"regexp":return"a "+M;default:return M}}function ae(D){return!D.constructor||!D.constructor.name?p:D.constructor.name}return m.checkPropTypes=a,m.resetWarningCache=a.resetWarningCache,m.PropTypes=m,m},yi}var Ci,du;function Tm(){if(du)return Ci;du=1;var e=Qs();function t(){}function n(){}return n.resetWarningCache=t,Ci=function(){function r(s,o,l,u,c,h){if(h!==e){var p=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 p.name="Invariant Violation",p}}r.isRequired=r;function a(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:a,element:r,elementType:r,instanceOf:a,node:r,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},Ci}if(process.env.NODE_ENV!=="production"){var Sm=nd(),jm=!0;vs.exports=Am()(Sm.isElement,jm)}else vs.exports=Tm()();var Om=vs.exports;/*!
57
57
  * tabbable 6.2.0
58
58
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
59
- */var id=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Ba=id.join(","),sd=typeof Element>"u",kn=sd?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Fa=!sd&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},Aa=function e(t,n){var r;n===void 0&&(n=!0);var a=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),i=a===""||a==="true",s=i||n&&t&&e(t.parentNode);return s},Rm=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},od=function(t,n,r){if(Aa(t))return[];var a=Array.prototype.slice.apply(t.querySelectorAll(Ba));return n&&kn.call(t,Ba)&&a.unshift(t),a=a.filter(r),a},ud=function e(t,n,r){for(var a=[],i=Array.from(t);i.length;){var s=i.shift();if(!Aa(s,!1))if(s.tagName==="SLOT"){var o=s.assignedElements(),l=o.length?o:s.children,u=e(l,!0,r);r.flatten?a.push.apply(a,u):a.push({scopeParent:s,candidates:u})}else{var c=kn.call(s,Ba);c&&r.filter(s)&&(n||!t.includes(s))&&a.push(s);var h=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),p=!Aa(h,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(h&&p){var m=e(h===!0?s.children:h.children,!0,r);r.flatten?a.push.apply(a,m):a.push({scopeParent:s,candidates:m})}else i.unshift.apply(i,s.children)}}return a},ld=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},an=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Rm(t))&&!ld(t)?0:t.tabIndex},Im=function(t,n){var r=an(t);return r<0&&n&&!ld(t)?0:r},$m=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},cd=function(t){return t.tagName==="INPUT"},Lm=function(t){return cd(t)&&t.type==="hidden"},zm=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},qm=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},Wm=function(t){if(!t.name)return!0;var n=t.form||Fa(t),r=function(o){return n.querySelectorAll('input[type="radio"][name="'+o+'"]')},a;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")a=r(window.CSS.escape(t.name));else try{a=r(t.name)}catch(s){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",s.message),!1}var i=qm(a,t.form);return!i||i===t},Um=function(t){return cd(t)&&t.type==="radio"},Hm=function(t){return Um(t)&&!Wm(t)},Vm=function(t){var n,r=t&&Fa(t),a=(n=r)===null||n===void 0?void 0:n.host,i=!1;if(r&&r!==t){var s,o,l;for(i=!!((s=a)!==null&&s!==void 0&&(o=s.ownerDocument)!==null&&o!==void 0&&o.contains(a)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!i&&a;){var u,c,h;r=Fa(a),a=(u=r)===null||u===void 0?void 0:u.host,i=!!((c=a)!==null&&c!==void 0&&(h=c.ownerDocument)!==null&&h!==void 0&&h.contains(a))}}return i},hu=function(t){var n=t.getBoundingClientRect(),r=n.width,a=n.height;return r===0&&a===0},Km=function(t,n){var r=n.displayCheck,a=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var i=kn.call(t,"details>summary:first-of-type"),s=i?t.parentElement:t;if(kn.call(s,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof a=="function"){for(var o=t;t;){var l=t.parentElement,u=Fa(t);if(l&&!l.shadowRoot&&a(l)===!0)return hu(t);t.assignedSlot?t=t.assignedSlot:!l&&u!==t.ownerDocument?t=u.host:t=l}t=o}if(Vm(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return hu(t);return!1},Zm=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var a=n.children.item(r);if(a.tagName==="LEGEND")return kn.call(n,"fieldset[disabled] *")?!0:!a.contains(t)}return!0}n=n.parentElement}return!1},Ta=function(t,n){return!(n.disabled||Aa(n)||Lm(n)||Km(n,t)||zm(n)||Zm(n))},bs=function(t,n){return!(Hm(n)||an(n)<0||!Ta(t,n))},Ym=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Gm=function e(t){var n=[],r=[];return t.forEach(function(a,i){var s=!!a.scopeParent,o=s?a.scopeParent:a,l=Im(o,s),u=s?e(a.candidates):o;l===0?s?n.push.apply(n,u):n.push(o):r.push({documentOrder:i,tabIndex:l,item:a,isScope:s,content:u})}),r.sort($m).reduce(function(a,i){return i.isScope?a.push.apply(a,i.content):a.push(i.content),a},[]).concat(n)},dd=function(t,n){n=n||{};var r;return n.getShadowRoot?r=ud([t],n.includeContainer,{filter:bs.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Ym}):r=od(t,n.includeContainer,bs.bind(null,n)),Gm(r)},fd=function(t,n){n=n||{};var r;return n.getShadowRoot?r=ud([t],n.includeContainer,{filter:Ta.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=od(t,n.includeContainer,Ta.bind(null,n)),r},pn=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return kn.call(t,Ba)===!1?!1:bs(n,t)},Qm=id.concat("iframe").join(","),va=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return kn.call(t,Qm)===!1?!1:Ta(n,t)};const Jm=Object.freeze(Object.defineProperty({__proto__:null,focusable:fd,getTabIndex:an,isFocusable:va,isTabbable:pn,tabbable:dd},Symbol.toStringTag,{value:"Module"}));/*!
59
+ */var ad=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Fa=ad.join(","),id=typeof Element>"u",kn=id?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ba=!id&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},Aa=function e(t,n){var r;n===void 0&&(n=!0);var a=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),i=a===""||a==="true",s=i||n&&t&&e(t.parentNode);return s},Pm=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},sd=function(t,n,r){if(Aa(t))return[];var a=Array.prototype.slice.apply(t.querySelectorAll(Fa));return n&&kn.call(t,Fa)&&a.unshift(t),a=a.filter(r),a},od=function e(t,n,r){for(var a=[],i=Array.from(t);i.length;){var s=i.shift();if(!Aa(s,!1))if(s.tagName==="SLOT"){var o=s.assignedElements(),l=o.length?o:s.children,u=e(l,!0,r);r.flatten?a.push.apply(a,u):a.push({scopeParent:s,candidates:u})}else{var c=kn.call(s,Fa);c&&r.filter(s)&&(n||!t.includes(s))&&a.push(s);var h=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),p=!Aa(h,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(h&&p){var m=e(h===!0?s.children:h.children,!0,r);r.flatten?a.push.apply(a,m):a.push({scopeParent:s,candidates:m})}else i.unshift.apply(i,s.children)}}return a},ud=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},an=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Pm(t))&&!ud(t)?0:t.tabIndex},Nm=function(t,n){var r=an(t);return r<0&&n&&!ud(t)?0:r},Rm=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},ld=function(t){return t.tagName==="INPUT"},Mm=function(t){return ld(t)&&t.type==="hidden"},Im=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},$m=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},Lm=function(t){if(!t.name)return!0;var n=t.form||Ba(t),r=function(o){return n.querySelectorAll('input[type="radio"][name="'+o+'"]')},a;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")a=r(window.CSS.escape(t.name));else try{a=r(t.name)}catch(s){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",s.message),!1}var i=$m(a,t.form);return!i||i===t},zm=function(t){return ld(t)&&t.type==="radio"},qm=function(t){return zm(t)&&!Lm(t)},Wm=function(t){var n,r=t&&Ba(t),a=(n=r)===null||n===void 0?void 0:n.host,i=!1;if(r&&r!==t){var s,o,l;for(i=!!((s=a)!==null&&s!==void 0&&(o=s.ownerDocument)!==null&&o!==void 0&&o.contains(a)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!i&&a;){var u,c,h;r=Ba(a),a=(u=r)===null||u===void 0?void 0:u.host,i=!!((c=a)!==null&&c!==void 0&&(h=c.ownerDocument)!==null&&h!==void 0&&h.contains(a))}}return i},fu=function(t){var n=t.getBoundingClientRect(),r=n.width,a=n.height;return r===0&&a===0},Um=function(t,n){var r=n.displayCheck,a=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var i=kn.call(t,"details>summary:first-of-type"),s=i?t.parentElement:t;if(kn.call(s,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof a=="function"){for(var o=t;t;){var l=t.parentElement,u=Ba(t);if(l&&!l.shadowRoot&&a(l)===!0)return fu(t);t.assignedSlot?t=t.assignedSlot:!l&&u!==t.ownerDocument?t=u.host:t=l}t=o}if(Wm(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return fu(t);return!1},Hm=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var a=n.children.item(r);if(a.tagName==="LEGEND")return kn.call(n,"fieldset[disabled] *")?!0:!a.contains(t)}return!0}n=n.parentElement}return!1},Ta=function(t,n){return!(n.disabled||Aa(n)||Mm(n)||Um(n,t)||Im(n)||Hm(n))},bs=function(t,n){return!(qm(n)||an(n)<0||!Ta(t,n))},Vm=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Km=function e(t){var n=[],r=[];return t.forEach(function(a,i){var s=!!a.scopeParent,o=s?a.scopeParent:a,l=Nm(o,s),u=s?e(a.candidates):o;l===0?s?n.push.apply(n,u):n.push(o):r.push({documentOrder:i,tabIndex:l,item:a,isScope:s,content:u})}),r.sort(Rm).reduce(function(a,i){return i.isScope?a.push.apply(a,i.content):a.push(i.content),a},[]).concat(n)},cd=function(t,n){n=n||{};var r;return n.getShadowRoot?r=od([t],n.includeContainer,{filter:bs.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Vm}):r=sd(t,n.includeContainer,bs.bind(null,n)),Km(r)},dd=function(t,n){n=n||{};var r;return n.getShadowRoot?r=od([t],n.includeContainer,{filter:Ta.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=sd(t,n.includeContainer,Ta.bind(null,n)),r},pn=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return kn.call(t,Fa)===!1?!1:bs(n,t)},Zm=ad.concat("iframe").join(","),va=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return kn.call(t,Zm)===!1?!1:Ta(n,t)};const Ym=Object.freeze(Object.defineProperty({__proto__:null,focusable:dd,getTabIndex:an,isFocusable:va,isTabbable:pn,tabbable:cd},Symbol.toStringTag,{value:"Module"}));/*!
60
60
  * focus-trap 7.5.4
61
61
  * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
62
- */function mu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function pu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mu(Object(n),!0).forEach(function(r){Xm(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Xm(e,t,n){return t=tp(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ep(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function tp(e){var t=ep(e,"string");return typeof t=="symbol"?t:String(t)}var gu={activateTrap:function(t,n){if(t.length>0){var r=t[t.length-1];r!==n&&r.pause()}var a=t.indexOf(n);a===-1||t.splice(a,1),t.push(n)},deactivateTrap:function(t,n){var r=t.indexOf(n);r!==-1&&t.splice(r,1),t.length>0&&t[t.length-1].unpause()}},np=function(t){return t.tagName&&t.tagName.toLowerCase()==="input"&&typeof t.select=="function"},rp=function(t){return(t==null?void 0:t.key)==="Escape"||(t==null?void 0:t.key)==="Esc"||(t==null?void 0:t.keyCode)===27},Dr=function(t){return(t==null?void 0:t.key)==="Tab"||(t==null?void 0:t.keyCode)===9},ap=function(t){return Dr(t)&&!t.shiftKey},ip=function(t){return Dr(t)&&t.shiftKey},vu=function(t){return setTimeout(t,0)},bu=function(t,n){var r=-1;return t.every(function(a,i){return n(a)?(r=i,!1):!0}),r},dr=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return typeof t=="function"?t.apply(void 0,r):t},Gr=function(t){return t.target.shadowRoot&&typeof t.composedPath=="function"?t.composedPath()[0]:t.target},sp=[],op=function(t,n){var r=(n==null?void 0:n.document)||document,a=(n==null?void 0:n.trapStack)||sp,i=pu({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:ap,isKeyBackward:ip},n),s={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},o,l=function(_,F,j){return _&&_[F]!==void 0?_[F]:i[j||F]},u=function(_,F){var j=typeof(F==null?void 0:F.composedPath)=="function"?F.composedPath():void 0;return s.containerGroups.findIndex(function($){var V=$.container,K=$.tabbableNodes;return V.contains(_)||(j==null?void 0:j.includes(V))||K.find(function(Q){return Q===_})})},c=function(_){var F=i[_];if(typeof F=="function"){for(var j=arguments.length,$=new Array(j>1?j-1:0),V=1;V<j;V++)$[V-1]=arguments[V];F=F.apply(void 0,$)}if(F===!0&&(F=void 0),!F){if(F===void 0||F===!1)return F;throw new Error("`".concat(_,"` was specified but was not a node, or did not return a node"))}var K=F;if(typeof F=="string"&&(K=r.querySelector(F),!K))throw new Error("`".concat(_,"` as selector refers to no known node"));return K},h=function(){var _=c("initialFocus");if(_===!1)return!1;if(_===void 0||!va(_,i.tabbableOptions))if(u(r.activeElement)>=0)_=r.activeElement;else{var F=s.tabbableGroups[0],j=F&&F.firstTabbableNode;_=j||c("fallbackFocus")}if(!_)throw new Error("Your focus-trap needs to have at least one focusable element");return _},p=function(){if(s.containerGroups=s.containers.map(function(_){var F=dd(_,i.tabbableOptions),j=fd(_,i.tabbableOptions),$=F.length>0?F[0]:void 0,V=F.length>0?F[F.length-1]:void 0,K=j.find(function(D){return pn(D)}),Q=j.slice().reverse().find(function(D){return pn(D)}),ae=!!F.find(function(D){return an(D)>0});return{container:_,tabbableNodes:F,focusableNodes:j,posTabIndexesFound:ae,firstTabbableNode:$,lastTabbableNode:V,firstDomTabbableNode:K,lastDomTabbableNode:Q,nextTabbableNode:function(L){var q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,B=F.indexOf(L);return B<0?q?j.slice(j.indexOf(L)+1).find(function(T){return pn(T)}):j.slice(0,j.indexOf(L)).reverse().find(function(T){return pn(T)}):F[B+(q?1:-1)]}}}),s.tabbableGroups=s.containerGroups.filter(function(_){return _.tabbableNodes.length>0}),s.tabbableGroups.length<=0&&!c("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(s.containerGroups.find(function(_){return _.posTabIndexesFound})&&s.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},m=function N(_){var F=_.activeElement;if(F)return F.shadowRoot&&F.shadowRoot.activeElement!==null?N(F.shadowRoot):F},g=function N(_){if(_!==!1&&_!==m(document)){if(!_||!_.focus){N(h());return}_.focus({preventScroll:!!i.preventScroll}),s.mostRecentlyFocusedNode=_,np(_)&&_.select()}},f=function(_){var F=c("setReturnFocus",_);return F||(F===!1?!1:_)},b=function(_){var F=_.target,j=_.event,$=_.isBackward,V=$===void 0?!1:$;F=F||Gr(j),p();var K=null;if(s.tabbableGroups.length>0){var Q=u(F,j),ae=Q>=0?s.containerGroups[Q]:void 0;if(Q<0)V?K=s.tabbableGroups[s.tabbableGroups.length-1].lastTabbableNode:K=s.tabbableGroups[0].firstTabbableNode;else if(V){var D=bu(s.tabbableGroups,function(M){var H=M.firstTabbableNode;return F===H});if(D<0&&(ae.container===F||va(F,i.tabbableOptions)&&!pn(F,i.tabbableOptions)&&!ae.nextTabbableNode(F,!1))&&(D=Q),D>=0){var L=D===0?s.tabbableGroups.length-1:D-1,q=s.tabbableGroups[L];K=an(F)>=0?q.lastTabbableNode:q.lastDomTabbableNode}else Dr(j)||(K=ae.nextTabbableNode(F,!1))}else{var B=bu(s.tabbableGroups,function(M){var H=M.lastTabbableNode;return F===H});if(B<0&&(ae.container===F||va(F,i.tabbableOptions)&&!pn(F,i.tabbableOptions)&&!ae.nextTabbableNode(F))&&(B=Q),B>=0){var T=B===s.tabbableGroups.length-1?0:B+1,z=s.tabbableGroups[T];K=an(F)>=0?z.firstTabbableNode:z.firstDomTabbableNode}else Dr(j)||(K=ae.nextTabbableNode(F))}}else K=c("fallbackFocus");return K},v=function(_){var F=Gr(_);if(!(u(F,_)>=0)){if(dr(i.clickOutsideDeactivates,_)){o.deactivate({returnFocus:i.returnFocusOnDeactivate});return}dr(i.allowOutsideClick,_)||_.preventDefault()}},E=function(_){var F=Gr(_),j=u(F,_)>=0;if(j||F instanceof Document)j&&(s.mostRecentlyFocusedNode=F);else{_.stopImmediatePropagation();var $,V=!0;if(s.mostRecentlyFocusedNode)if(an(s.mostRecentlyFocusedNode)>0){var K=u(s.mostRecentlyFocusedNode),Q=s.containerGroups[K].tabbableNodes;if(Q.length>0){var ae=Q.findIndex(function(D){return D===s.mostRecentlyFocusedNode});ae>=0&&(i.isKeyForward(s.recentNavEvent)?ae+1<Q.length&&($=Q[ae+1],V=!1):ae-1>=0&&($=Q[ae-1],V=!1))}}else s.containerGroups.some(function(D){return D.tabbableNodes.some(function(L){return an(L)>0})})||(V=!1);else V=!1;V&&($=b({target:s.mostRecentlyFocusedNode,isBackward:i.isKeyBackward(s.recentNavEvent)})),g($||s.mostRecentlyFocusedNode||h())}s.recentNavEvent=void 0},k=function(_){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;s.recentNavEvent=_;var j=b({event:_,isBackward:F});j&&(Dr(_)&&_.preventDefault(),g(j))},x=function(_){if(rp(_)&&dr(i.escapeDeactivates,_)!==!1){_.preventDefault(),o.deactivate();return}(i.isKeyForward(_)||i.isKeyBackward(_))&&k(_,i.isKeyBackward(_))},w=function(_){var F=Gr(_);u(F,_)>=0||dr(i.clickOutsideDeactivates,_)||dr(i.allowOutsideClick,_)||(_.preventDefault(),_.stopImmediatePropagation())},A=function(){if(s.active)return gu.activateTrap(a,o),s.delayInitialFocusTimer=i.delayInitialFocus?vu(function(){g(h())}):g(h()),r.addEventListener("focusin",E,!0),r.addEventListener("mousedown",v,{capture:!0,passive:!1}),r.addEventListener("touchstart",v,{capture:!0,passive:!1}),r.addEventListener("click",w,{capture:!0,passive:!1}),r.addEventListener("keydown",x,{capture:!0,passive:!1}),o},S=function(){if(s.active)return r.removeEventListener("focusin",E,!0),r.removeEventListener("mousedown",v,!0),r.removeEventListener("touchstart",v,!0),r.removeEventListener("click",w,!0),r.removeEventListener("keydown",x,!0),o},W=function(_){var F=_.some(function(j){var $=Array.from(j.removedNodes);return $.some(function(V){return V===s.mostRecentlyFocusedNode})});F&&g(h())},R=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(W):void 0,I=function(){R&&(R.disconnect(),s.active&&!s.paused&&s.containers.map(function(_){R.observe(_,{subtree:!0,childList:!0})}))};return o={get active(){return s.active},get paused(){return s.paused},activate:function(_){if(s.active)return this;var F=l(_,"onActivate"),j=l(_,"onPostActivate"),$=l(_,"checkCanFocusTrap");$||p(),s.active=!0,s.paused=!1,s.nodeFocusedBeforeActivation=r.activeElement,F==null||F();var V=function(){$&&p(),A(),I(),j==null||j()};return $?($(s.containers.concat()).then(V,V),this):(V(),this)},deactivate:function(_){if(!s.active)return this;var F=pu({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},_);clearTimeout(s.delayInitialFocusTimer),s.delayInitialFocusTimer=void 0,S(),s.active=!1,s.paused=!1,I(),gu.deactivateTrap(a,o);var j=l(F,"onDeactivate"),$=l(F,"onPostDeactivate"),V=l(F,"checkCanReturnFocus"),K=l(F,"returnFocus","returnFocusOnDeactivate");j==null||j();var Q=function(){vu(function(){K&&g(f(s.nodeFocusedBeforeActivation)),$==null||$()})};return K&&V?(V(f(s.nodeFocusedBeforeActivation)).then(Q,Q),this):(Q(),this)},pause:function(_){if(s.paused||!s.active)return this;var F=l(_,"onPause"),j=l(_,"onPostPause");return s.paused=!0,F==null||F(),S(),I(),j==null||j(),this},unpause:function(_){if(!s.paused||!s.active)return this;var F=l(_,"onUnpause"),j=l(_,"onPostUnpause");return s.paused=!1,F==null||F(),p(),A(),I(),j==null||j(),this},updateContainerElements:function(_){var F=[].concat(_).filter(Boolean);return s.containers=F.map(function(j){return typeof j=="string"?r.querySelector(j):j}),s.active&&p(),I(),this}},o.updateContainerElements(t),o};const up=Object.freeze(Object.defineProperty({__proto__:null,createFocusTrap:op},Symbol.toStringTag,{value:"Module"})),lp=Tc(up),cp=Tc(Jm);function Jn(e){"@babel/helpers - typeof";return Jn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jn(e)}function dp(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,hd(r.key),r)}}function fp(e,t,n){return t&&yu(e.prototype,t),n&&yu(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function hp(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ys(e,t)}function ys(e,t){return ys=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},ys(e,t)}function mp(e){var t=gp();return function(){var r=Sa(e),a;if(t){var i=Sa(this).constructor;a=Reflect.construct(r,arguments,i)}else a=r.apply(this,arguments);return pp(this,a)}}function pp(e,t){if(t&&(Jn(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return yr(e)}function yr(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function gp(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Sa(e){return Sa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Sa(e)}function vp(e,t,n){return t=hd(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hd(e){var t=bp(e,"string");return Jn(t)==="symbol"?t:String(t)}function bp(e,t){if(Jn(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Jn(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Qr=y,ye=Mm,yp=lp,Cp=yp.createFocusTrap,Dp=cp,xp=Dp.isFocusable,Js=function(e){hp(n,e);var t=mp(n);function n(r){var a;dp(this,n),a=t.call(this,r),vp(yr(a),"getNodeForOption",function(o){var l,u=(l=this.internalOptions[o])!==null&&l!==void 0?l:this.originalOptions[o];if(typeof u=="function"){for(var c=arguments.length,h=new Array(c>1?c-1:0),p=1;p<c;p++)h[p-1]=arguments[p];u=u.apply(void 0,h)}if(u===!0&&(u=void 0),!u){if(u===void 0||u===!1)return u;throw new Error("`".concat(o,"` was specified but was not a node, or did not return a node"))}var m=u;if(typeof u=="string"){var g;if(m=(g=this.getDocument())===null||g===void 0?void 0:g.querySelector(u),!m)throw new Error("`".concat(o,"` as selector refers to no known node"))}return m}),a.handleDeactivate=a.handleDeactivate.bind(yr(a)),a.handlePostDeactivate=a.handlePostDeactivate.bind(yr(a)),a.handleClickOutsideDeactivates=a.handleClickOutsideDeactivates.bind(yr(a)),a.internalOptions={returnFocusOnDeactivate:!1,checkCanReturnFocus:null,onDeactivate:a.handleDeactivate,onPostDeactivate:a.handlePostDeactivate,clickOutsideDeactivates:a.handleClickOutsideDeactivates},a.originalOptions={returnFocusOnDeactivate:!0,onDeactivate:null,onPostDeactivate:null,checkCanReturnFocus:null,clickOutsideDeactivates:!1};var i=r.focusTrapOptions;for(var s in i)if(Object.prototype.hasOwnProperty.call(i,s)){if(s==="returnFocusOnDeactivate"||s==="onDeactivate"||s==="onPostDeactivate"||s==="checkCanReturnFocus"||s==="clickOutsideDeactivates"){a.originalOptions[s]=i[s];continue}a.internalOptions[s]=i[s]}return a.outsideClick=null,a.focusTrapElements=r.containerElements||[],a.updatePreviousElement(),a}return fp(n,[{key:"getDocument",value:function(){return this.props.focusTrapOptions.document||(typeof document<"u"?document:void 0)}},{key:"getReturnFocusNode",value:function(){var a=this.getNodeForOption("setReturnFocus",this.previouslyFocusedElement);return a||(a===!1?!1:this.previouslyFocusedElement)}},{key:"updatePreviousElement",value:function(){var a=this.getDocument();a&&(this.previouslyFocusedElement=a.activeElement)}},{key:"deactivateTrap",value:function(){!this.focusTrap||!this.focusTrap.active||this.focusTrap.deactivate({returnFocus:!1,checkCanReturnFocus:null,onDeactivate:this.originalOptions.onDeactivate})}},{key:"handleClickOutsideDeactivates",value:function(a){var i=typeof this.originalOptions.clickOutsideDeactivates=="function"?this.originalOptions.clickOutsideDeactivates.call(null,a):this.originalOptions.clickOutsideDeactivates;return i&&(this.outsideClick={target:a.target,allowDeactivation:i}),i}},{key:"handleDeactivate",value:function(){this.originalOptions.onDeactivate&&this.originalOptions.onDeactivate.call(null),this.deactivateTrap()}},{key:"handlePostDeactivate",value:function(){var a=this,i=function(){var o=a.getReturnFocusNode(),l=!!(a.originalOptions.returnFocusOnDeactivate&&o!==null&&o!==void 0&&o.focus&&(!a.outsideClick||a.outsideClick.allowDeactivation&&!xp(a.outsideClick.target,a.internalOptions.tabbableOptions))),u=a.internalOptions.preventScroll,c=u===void 0?!1:u;l&&o.focus({preventScroll:c}),a.originalOptions.onPostDeactivate&&a.originalOptions.onPostDeactivate.call(null),a.outsideClick=null};this.originalOptions.checkCanReturnFocus?this.originalOptions.checkCanReturnFocus.call(null,this.getReturnFocusNode()).then(i,i):i()}},{key:"setupFocusTrap",value:function(){if(this.focusTrap)this.props.active&&!this.focusTrap.active&&(this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause());else{var a=this.focusTrapElements.some(Boolean);a&&(this.focusTrap=this.props._createFocusTrap(this.focusTrapElements,this.internalOptions),this.props.active&&this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause())}}},{key:"componentDidMount",value:function(){this.props.active&&this.setupFocusTrap()}},{key:"componentDidUpdate",value:function(a){if(this.focusTrap){a.containerElements!==this.props.containerElements&&this.focusTrap.updateContainerElements(this.props.containerElements);var i=!a.active&&this.props.active,s=a.active&&!this.props.active,o=!a.paused&&this.props.paused,l=a.paused&&!this.props.paused;if(i&&(this.updatePreviousElement(),this.focusTrap.activate()),s){this.deactivateTrap();return}o&&this.focusTrap.pause(),l&&this.focusTrap.unpause()}else a.containerElements!==this.props.containerElements&&(this.focusTrapElements=this.props.containerElements),this.props.active&&(this.updatePreviousElement(),this.setupFocusTrap())}},{key:"componentWillUnmount",value:function(){this.deactivateTrap()}},{key:"render",value:function(){var a=this,i=this.props.children?Qr.Children.only(this.props.children):void 0;if(i){if(i.type&&i.type===Qr.Fragment)throw new Error("A focus-trap cannot use a Fragment as its child container. Try replacing it with a <div> element.");var s=function(u){var c=a.props.containerElements;i&&(typeof i.ref=="function"?i.ref(u):i.ref&&(i.ref.current=u)),a.focusTrapElements=c||[u]},o=Qr.cloneElement(i,{ref:s});return o}return null}}]),n}(Qr.Component),fr=typeof Element>"u"?Function:Element;Js.propTypes={active:ye.bool,paused:ye.bool,focusTrapOptions:ye.shape({document:ye.object,onActivate:ye.func,onPostActivate:ye.func,checkCanFocusTrap:ye.func,onPause:ye.func,onPostPause:ye.func,onUnpause:ye.func,onPostUnpause:ye.func,onDeactivate:ye.func,onPostDeactivate:ye.func,checkCanReturnFocus:ye.func,initialFocus:ye.oneOfType([ye.instanceOf(fr),ye.string,ye.bool,ye.func]),fallbackFocus:ye.oneOfType([ye.instanceOf(fr),ye.string,ye.func]),escapeDeactivates:ye.oneOfType([ye.bool,ye.func]),clickOutsideDeactivates:ye.oneOfType([ye.bool,ye.func]),returnFocusOnDeactivate:ye.bool,setReturnFocus:ye.oneOfType([ye.instanceOf(fr),ye.string,ye.bool,ye.func]),allowOutsideClick:ye.oneOfType([ye.bool,ye.func]),preventScroll:ye.bool,tabbableOptions:ye.shape({displayCheck:ye.oneOf(["full","legacy-full","non-zero-area","none"]),getShadowRoot:ye.oneOfType([ye.bool,ye.func])}),trapStack:ye.array,isKeyForward:ye.func,isKeyBackward:ye.func}),containerElements:ye.arrayOf(ye.instanceOf(fr)),children:ye.oneOfType([ye.element,ye.instanceOf(fr)])};Js.defaultProps={active:!0,paused:!1,focusTrapOptions:{},_createFocusTrap:Cp};var wp=Js;const Ep=Tn(wp),md=({showDevTools:e=!0,children:t})=>{const n=new Ye.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!1,staleTime:6e4}}});return d.jsxs(Ye.QueryClientProvider,{client:n,children:[t,e&&d.jsx(Ih.ReactQueryDevtools,{initialIsOpen:!1})]})};var pd=y.createContext({client:pa});function _p(e){var t=e.children,n=e.client,r=e.apiKey,a=e.options,i=y.useMemo(function(){return n&&r&&console.warn("[PostHog.js] You have provided both a client and an apiKey to PostHogProvider. The apiKey will be ignored in favour of the client."),n&&a&&console.warn("[PostHog.js] You have provided both a client and options to PostHogProvider. The options will be ignored in favour of the client."),n||(r&&(pa.__loaded&&console.warn("[PostHog.js] was already loaded elsewhere. This may cause issues."),pa.init(r,a)),pa)},[n,r]);return y.createElement(pd.Provider,{value:{client:i}},t)}var kp=function(){var e=y.useContext(pd).client;return e};function Bp(e){var t=kp(),n=y.useState(),r=n[0],a=n[1];return y.useEffect(function(){return t.onFeatureFlags(function(){a(t.getFeatureFlagPayload(e))})},[t,e]),r}const gd=({children:e,user:t})=>t.isLoading?null:process.env.REACT_APP_PUBLIC_POSTHOG_KEY?d.jsx(_p,{apiKey:atob(process.env.REACT_APP_PUBLIC_POSTHOG_KEY),options:{api_host:"/ph",autocapture:!1,disable_session_recording:!0,persistence_name:"flags",secure_cookie:!0,ui_host:"eu.posthog.com",bootstrap:{distinctID:t.id||"00000000-0000-0000-0000-000000000000",isIdentifiedID:!!t.id}},children:e}):d.jsx(d.Fragment,{children:e});var Xs=(e=>(e.COMMUNITY_RANKING="community-ranking",e))(Xs||{});const vd=({children:e,locale:t,messages:n})=>{const r=t||"en",a={...nm[r],...n||{}};return d.jsx(se.IntlProvider,{locale:r,messages:a,children:e})},eo=y.createContext({}),ba={en:"English",es:"Español",fr:"Français",pt:"Português"},Bt=y.createContext({isLoading:!0});function Ja(){return y.useContext(Bt)}const bd=({children:e,user:t,updateDetails:n})=>d.jsx(Bt.Provider,{value:{...t,updateDetails:n},children:e}),to=y.createContext({registerOverlay:()=>{},unregisterOverlay:()=>{}}),yd=()=>y.useContext(to),Cd=({children:e})=>{const[t,n]=y.useState([]);y.useEffect(()=>{t.length>0?document.body.classList.add("has-overlay"):document.body.classList.remove("has-overlay")},[t]);const r=y.useCallback(i=>{n(s=>[...s,i])},[]),a=y.useCallback(i=>{n(s=>s.filter(o=>o!==i))},[]);return d.jsx(to.Provider,{value:{registerOverlay:r,unregisterOverlay:a},children:e})},Fp=({bootstrap:e,children:t,intl:n,showDevTools:r})=>{const[a,i]=y.useState({isLoading:!0}),s=(n==null?void 0:n.locale)||localStorage.getItem("language")||"en",[o,l]=y.useState(s),u=c=>{localStorage.setItem("language",c),l(c)};return y.useEffect(()=>{e().then(c=>{i({...c,isLoading:!1}),Hc(5e3)}).catch(c=>{c.message===zc&&window.location.pathname!=="/user-onboarding/logout"&&(window.location.href="/user-onboarding/logout"),i({isLoading:!1})})},[]),d.jsx(eo.Provider,{value:{language:o,updateLanguage:u},children:d.jsx(vd,{locale:o,messages:n==null?void 0:n.messages,children:d.jsx(Ws.CookiesProvider,{children:d.jsx(bd,{user:a,updateDetails:i,children:d.jsx(Cd,{children:d.jsx(md,{showDevTools:r,children:d.jsx(gd,{user:a,children:t})})})})})})})};const dn=({id:e="content-overlay",isOpen:t=!1,showDivider:n=!0,maxWidth:r,functions:{onOpen:a=()=>{},onClose:i=()=>{}}={},forceShow:{error:s=!1}={},title:o,children:l,buttons:u,className:c="",gtmContext:h="Modal"})=>{const p=se.useIntl(),{registerOverlay:m,unregisterOverlay:g}=yd(),[f,b]=y.useState(t),v=y.useRef(null),E=w=>{w.key==="Escape"&&k(!1)};y.useEffect(()=>(window.addEventListener("keyup",E),()=>{window.removeEventListener("keyup",E)}));const k=w=>{if(b(w),w)a(),m(e);else{if(f===w)return;i(),g(e)}};y.useEffect(()=>(k(t),()=>{f&&g(e)}),[t]);const x=r?{"--max-width":`${r/16}rem`}:{};return d.jsx("div",{id:`${e}-overlay`,ref:v,className:G("overlay",{open:f,"in-portal":c.includes("in-portal")}),role:"dialog",onClick:w=>{w.currentTarget===w.target&&(w.preventDefault(),w.stopPropagation(),k(!1))},children:d.jsx(Gs,{id:e,className:G("overlay-modal",c,{"has-max-width":r}),hidden:!f,style:x,children:t&&d.jsx(Ep,{containerElements:[v.current],children:d.jsxs("div",{className:"overlay-content",children:[d.jsxs("div",{className:"top",children:[o&&d.jsx("h2",{className:"modal-title",children:o}),d.jsx(Be,{variant:"tertiary",size:"medium",icon:{icon:"close"},onClick:()=>k(!1),className:"gtm-trackable","data-gtm-event-type":"close-modal-click","data-gtm-event-context":h,screenreaderText:p.formatMessage({id:"overlay_close"})})]}),n&&d.jsx(zt,{}),l,u&&d.jsxs("div",{className:"bottom",children:[d.jsx(zt,{}),d.jsx(ir,{buttons:u})]}),s&&d.jsx(Tr,{className:"error",children:s})]})})})})},Dd=(e,t)=>({"aria-haspopup":!0,"aria-expanded":t,"aria-controls":e});const hr="joinCommunityButton",no=({isMember:e=!1,isOpen:t=!1,isShort:n=!1,disabled:r=!1,functions:{join:a,leave:i}={join:()=>{},leave:()=>{}}})=>{const s=se.useIntl(),o=y.useContext(Bt),l=o&&typeof o.id=="string",u=r||!l,[c,h]=y.useState(e),[p,m]=y.useState(e?"joined":"notJoined");y.useEffect(()=>{p==="joining"?m("joined"):p==="leaving"&&m("notJoined")},[c]);const g={},f={};return c&&p!=="leaving"&&(g["data-hover-text"]=s.formatMessage({id:`${hr}_leave`}),g["aria-label"]=s.formatMessage({id:`${hr}_member_aria`}),f["aria-hidden"]="true"),d.jsx(Be,{variant:c?"secondary":"primary",size:"medium",styling:{fullWidth:!0},icon:c&&p!=="leaving"?{icon:"tick",position:"left"}:!1,tooltip:!t&&!c?s.formatMessage({id:`${hr}_closed_tooltip`}):"",onClick:async b=>{if(u)return;b.currentTarget.blur(),m(c?"leaving":"joining");const v=new CustomEvent("ariaLive",{detail:{message:s.formatMessage({id:`${hr}_aria_live`},{action:c?"leaving":"joining"})}});document.dispatchEvent(v);const E=c?i:a;typeof E=="function"&&setTimeout(async()=>{await E()},500),h(!c)},className:G("join-community-button",p,{active:p==="joining"}),disabled:u,"data-testid":"join-button",...g,children:d.jsx("span",{className:"text",...f,children:s.formatMessage({id:`${hr}${["joining","leaving"].includes(p)?`_${p}`:c?"_member":n?"_short":""}`})})})};const Di="communityDetails_",Ap=({className:e="",isMember:t=!1,isOpen:n=!1,slug:r,members:{number:a=0,data:i=[]}={number:0,data:[]},functions:{invite:s,...o}})=>{const l=se.useIntl(),u=5,c=a||i.length,h=i.length?i:Array(u).fill({}),p=`/communities/${r}/members`===window.location.pathname,m=t||n,g=!n&&!t;return d.jsxs("div",{className:G("community-details",e),children:[m&&d.jsxs("div",{className:"member-details",children:[d.jsxs("div",{className:"top",children:[d.jsxs("h4",{children:[l.formatMessage({id:`${Di}members`}),d.jsx("span",{className:"count",children:c})]}),!p&&d.jsx("p",{className:"text-small",children:d.jsx("a",{href:`/communities/${r}/members`,children:l.formatMessage({id:`${Di}viewAll`})})})]}),d.jsx(Ys,{contributors:{total:a,data:h},styling:{size:"medium",showGap:!0,showPlaceholders:c===0},cutoff:u})]}),d.jsx(no,{isMember:t,isOpen:n,disabled:g,functions:{...o}}),t&&d.jsx(Be,{variant:"primary",onClick:s,icon:{icon:"plus"},styling:{fullWidth:!0},children:l.formatMessage({id:`${Di}invite`})})]})};const Tp=({breadcrumbs:e,cutoff:t=20,className:n=""})=>{const r=se.useIntl();return d.jsxs(d.Fragment,{children:[d.jsx(Ie,{element:"p",children:r.formatMessage({id:"breadcrumbs_label"})}),d.jsx("ul",{className:G("breadcrumbs text-small",n),children:e.map(({text:a,href:i,current:s=!1},o)=>{const l={};return s&&(l["aria-current"]="location"),d.jsxs("li",{children:[s&&d.jsx(Ie,{element:"span",children:r.formatMessage({id:"breadcrumbs_currentPage"})}),d.jsx(jn,{href:s?void 0:i,...l,children:Gn(a,t)})]},`${window.btoa(a)}_${o}`)})})]})};const Sp=({options:e,allOption:t=!1,allowMultiple:n=!0,onChange:r=()=>{},className:a=""})=>{const i=se.useIntl(),s=t?[{id:"all",text:typeof t!="boolean"&&t.text||i.formatMessage({id:"filters_all"})},...e]:e,[o,l]=y.useState(t?["all"]:[]),u=(c,h)=>{let p=[];o.includes(c)?p=o.filter(m=>m!==c):c==="all"?p=["all"]:n?p=[...o.filter(m=>m!=="all"),c]:p=[c],l(m=>(r&&typeof r=="function"&&r({current:p,previous:m}),p)),h&&typeof h=="function"&&h()};return d.jsx("ul",{className:G("filters",a),children:s.map(({id:c,text:h,disabled:p=!1,callback:m=()=>{}})=>{let g={};return p&&(g={disabled:!0,"aria-label":i.formatMessage({id:"filters_disabled"},{name:h})}),d.jsx("li",{children:d.jsx("button",{className:G(c,{selected:o.includes(c)}),onClick:f=>{f.preventDefault(),f.stopPropagation(),u(c,m)},...g,children:h})},c)})})},jp=(e,t,n)=>{const r=String(e);if(!n||!n.length)return t?`/${r}/${t}`:`/${r}`;let a="",i=!1;return n.forEach(({url:s,position:o})=>{o==="before-lang"?(a+=`/${s}`,i=!0):(a.includes(`/${r}/`)||(a+=`/${r}`),a+=`/${s}`)}),a.includes(`/${r}/`)||(a+=`/${r}`),t&&(a+=`/${t}`),i?{url:a,urlForRouter:`/${a.split("/").slice(2).join("/")}`}:a};const Jr="languageSwitcher_",Op=({currentLanguage:e,isOriginalLanguage:t=!1,isHumanTranslation:n=!1,translations:r,onChange:a,urlParts:i,variant:s="default",label:o,className:l=""})=>{const u=se.useIntl(),{updateLanguage:c=()=>{}}=y.useContext(eo),[h,p]=y.useState(e);if(y.useEffect(()=>{e!==h&&p(e)},[e]),!r||!Object.values(r).some(b=>b&&b.post_name))return null;const g=Object.keys(r),f=h!==e;return d.jsxs("div",{className:G("language-switcher text-small",s,l),children:[d.jsxs("nav",{children:[s!=="short"&&d.jsx("p",{children:o||u.formatMessage({id:`${Jr}label`})}),d.jsx("ul",{children:g.map(b=>{var k;if(!ba[b])return null;const v=(k=r[b])==null?void 0:k.post_name;let E={className:b};if(h===b)E["aria-label"]=u.formatMessage({id:`${Jr}selected`},{language:ba[b]});else{const x=jp(b,v,i);E={...E,href:typeof x=="string"?x:x.url,onClick:w=>{p(b),c(b),typeof a<"u"&&(w.preventDefault(),w.stopPropagation(),a(b,typeof x=="string"?x:x.urlForRouter))}}}return d.jsx("li",{children:d.jsx(jn,{...E,fallbackElement:"span",children:ba[b]})},b)})}),s!=="short"&&!f&&d.jsx("p",{children:u.formatMessage({id:`${Jr}translation_${t?"original":n?"human":"machine"}`})})]}),s!=="short"&&!f&&!t&&!n&&d.jsx("small",{children:u.formatMessage({id:`${Jr}disclaimer`},{email:zn.support,link:b=>{const v=`mailto:${b}`;return d.jsx("a",{href:v,children:b})}})})]})};const xi=se.createIntl({locale:"en",messages:ar}),zr=({hasNextPage:e=!0,loadNextPage:t=()=>{},isLoading:n=!1,variant:r="secondary",size:a="medium",styling:i={muted:!1,fullWidth:!1},icon:s=!1,messages:o={button:xi.formatMessage({id:"loadMore_button"}),endOfFeed:xi.formatMessage({id:"loadMore_endOfFeed"}),error:xi.formatMessage({id:"loadMore_error"})},className:l="",gtmContext:u="LoadMore"})=>{const[c,h]=y.useState(""),p=async m=>{if(!n)try{await t(m)}catch(g){g instanceof Error?h(g.message):h("Unknown error")}};return!c&&!e&&!o.endOfFeed?null:d.jsx("footer",{className:G("load-more",l),children:!c&&e?d.jsx(Be,{variant:r,size:a,styling:i,icon:s,onClick:p,"data-gtm-event-context":u,"data-gtm-event-type":"load-more-click",disabled:n,className:"gtm-trackable","data-testid":"load-more-button",children:o.button}):o.endOfFeed&&(!c||c!=null&&c.includes("Cannot read items"))?d.jsx("p",{children:o.endOfFeed}):c&&d.jsx("p",{className:"error",children:o.error})})};const ro=({variant:e="default",version:t="default",className:n="",...r})=>d.jsx("p",{className:"logo-wrapper",children:d.jsx("a",{href:"/home/",className:G("logo",e,t,n),...r,children:d.jsx(Ie,{children:d.jsx(se.FormattedMessage,{id:"apolitical"})})})});let Xr=!1;const xd=({element:e="div",id:t="more-menu",options:n,className:r=""})=>{const a=se.useIntl(),i=y.useRef(null),[s,o]=y.useState(!1),l=u=>{i.current&&u.target instanceof HTMLElement&&!i.current.contains(u.target)&&o(!1)};return y.useEffect(()=>(document.addEventListener("click",l,!0),()=>{document.removeEventListener("click",l,!0)})),y.createElement(e,{ref:i,className:G("more-menu text-medium",r),children:d.jsxs(d.Fragment,{children:[d.jsx(Be,{variant:"tertiary",size:"medium",icon:{icon:"ellipsis"},onClick:()=>o(!s),"aria-haspopup":"true","aria-expanded":s,"aria-controls":t,screenreaderText:a.formatMessage({id:"moreMenu"}),className:"more-menu-button"}),d.jsx("ul",{id:t,hidden:!s,children:n.map(({href:u,onClick:c,text:h,icon:p,...m},g)=>{const f={...m,onClick:b=>{o(!1),typeof c=="function"&&c(b)},onFocus:()=>{Xr&&(clearTimeout(Xr),Xr=!1)},onBlur:()=>{Xr=setTimeout(()=>{o(!1)},100)}};return u&&(f.href=u),d.jsx("li",{className:"more-menu-list-item",children:d.jsx(Be,{variant:"tertiary",size:"medium",icon:p?{icon:p,position:"left"}:!1,...f,children:h})},`${window.btoa(h)}_${g}`)})})]})})},Pp=(e,t=!1)=>t?e.replaceAll("/","")===t:typeof window<"u"&&window.location&&window.location.pathname===e;const Np=[{key:"homepage",href:"/home/"},{key:"events",href:"/events/"},{key:"microcourses",href:"/microcourses/"},{key:"articles",href:"/solution-articles/"},{key:"communities",href:"/communities/"}],wd=({activeLink:e})=>{const t=se.useIntl(),n=y.useContext(Bt),r=n&&typeof n.id=="string";return d.jsxs("ul",{id:"navigation-menu",className:"text-medium",children:[Np.map(({key:a,href:i})=>{const s=Pp(i,e),o={};return s&&(o["aria-current"]="page"),d.jsx("li",{className:G(a,{active:s}),children:d.jsx("a",{href:i,"data-gtm-event-type":`${a}-click`,"data-gtm-event-context":"NavigationMenu",className:"gtm-trackable",...o,children:t.formatMessage({id:`navigationMenu_links_${a}`})})},a)}),r&&d.jsx("li",{className:"profile","data-testid":"profile-link",children:d.jsxs("a",{href:"/profiles/me","data-gtm-event-type":"profile-click","data-gtm-event-context":"NavigationMenu",className:"gtm-trackable",children:[d.jsx(Gt,{name:(n==null?void 0:n.name)||"",src:n!=null&&n.image?n.image.thumbnail:""}),d.jsx("span",{children:t.formatMessage({id:"navigationMenu_profile"})})]})})]})},mr=(e,t,n)=>`${e}?share=${t}${n?`&uuid=${n}`:""}`,Mp=({title:e,link:t,referrer:n})=>[{key:"linkedin",icon:"social_linkedin",url:`https://www.linkedin.com/shareArticle?mini=true&url=${encodeURIComponent(`${mr(t,"linkedin",n)}&src=linkedin`)}&title=${encodeURIComponent(e)}&source=Apolitical`},{key:"twitter",icon:"social_twitter",url:`https://twitter.com/share?ref_src=twsrc%5Etfw&url=${encodeURIComponent(`${mr(t,"twitter",n)}&src=twitter`)}&text=${encodeURIComponent(e)}&via=${encodeURIComponent("apoliticalco")}`},{key:"facebook",icon:"social_facebook",url:`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(`${mr(t,"facebook",n)}`)}&t=${e}`},{key:"email",icon:"share_email",url:`mailto:?subject=${encodeURIComponent(e)}&body=${encodeURIComponent(`${e}
62
+ */function hu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function mu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hu(Object(n),!0).forEach(function(r){Gm(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Gm(e,t,n){return t=Jm(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qm(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Jm(e){var t=Qm(e,"string");return typeof t=="symbol"?t:String(t)}var pu={activateTrap:function(t,n){if(t.length>0){var r=t[t.length-1];r!==n&&r.pause()}var a=t.indexOf(n);a===-1||t.splice(a,1),t.push(n)},deactivateTrap:function(t,n){var r=t.indexOf(n);r!==-1&&t.splice(r,1),t.length>0&&t[t.length-1].unpause()}},Xm=function(t){return t.tagName&&t.tagName.toLowerCase()==="input"&&typeof t.select=="function"},ep=function(t){return(t==null?void 0:t.key)==="Escape"||(t==null?void 0:t.key)==="Esc"||(t==null?void 0:t.keyCode)===27},Dr=function(t){return(t==null?void 0:t.key)==="Tab"||(t==null?void 0:t.keyCode)===9},tp=function(t){return Dr(t)&&!t.shiftKey},np=function(t){return Dr(t)&&t.shiftKey},gu=function(t){return setTimeout(t,0)},vu=function(t,n){var r=-1;return t.every(function(a,i){return n(a)?(r=i,!1):!0}),r},dr=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return typeof t=="function"?t.apply(void 0,r):t},Gr=function(t){return t.target.shadowRoot&&typeof t.composedPath=="function"?t.composedPath()[0]:t.target},rp=[],ap=function(t,n){var r=(n==null?void 0:n.document)||document,a=(n==null?void 0:n.trapStack)||rp,i=mu({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:tp,isKeyBackward:np},n),s={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},o,l=function(_,B,j){return _&&_[B]!==void 0?_[B]:i[j||B]},u=function(_,B){var j=typeof(B==null?void 0:B.composedPath)=="function"?B.composedPath():void 0;return s.containerGroups.findIndex(function(I){var G=I.container,V=I.tabbableNodes;return G.contains(_)||(j==null?void 0:j.includes(G))||V.find(function(Q){return Q===_})})},c=function(_){var B=i[_];if(typeof B=="function"){for(var j=arguments.length,I=new Array(j>1?j-1:0),G=1;G<j;G++)I[G-1]=arguments[G];B=B.apply(void 0,I)}if(B===!0&&(B=void 0),!B){if(B===void 0||B===!1)return B;throw new Error("`".concat(_,"` was specified but was not a node, or did not return a node"))}var V=B;if(typeof B=="string"&&(V=r.querySelector(B),!V))throw new Error("`".concat(_,"` as selector refers to no known node"));return V},h=function(){var _=c("initialFocus");if(_===!1)return!1;if(_===void 0||!va(_,i.tabbableOptions))if(u(r.activeElement)>=0)_=r.activeElement;else{var B=s.tabbableGroups[0],j=B&&B.firstTabbableNode;_=j||c("fallbackFocus")}if(!_)throw new Error("Your focus-trap needs to have at least one focusable element");return _},p=function(){if(s.containerGroups=s.containers.map(function(_){var B=cd(_,i.tabbableOptions),j=dd(_,i.tabbableOptions),I=B.length>0?B[0]:void 0,G=B.length>0?B[B.length-1]:void 0,V=j.find(function(D){return pn(D)}),Q=j.slice().reverse().find(function(D){return pn(D)}),ae=!!B.find(function(D){return an(D)>0});return{container:_,tabbableNodes:B,focusableNodes:j,posTabIndexesFound:ae,firstTabbableNode:I,lastTabbableNode:G,firstDomTabbableNode:V,lastDomTabbableNode:Q,nextTabbableNode:function(M){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,F=B.indexOf(M);return F<0?W?j.slice(j.indexOf(M)+1).find(function(T){return pn(T)}):j.slice(0,j.indexOf(M)).reverse().find(function(T){return pn(T)}):B[F+(W?1:-1)]}}}),s.tabbableGroups=s.containerGroups.filter(function(_){return _.tabbableNodes.length>0}),s.tabbableGroups.length<=0&&!c("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(s.containerGroups.find(function(_){return _.posTabIndexesFound})&&s.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},m=function L(_){var B=_.activeElement;if(B)return B.shadowRoot&&B.shadowRoot.activeElement!==null?L(B.shadowRoot):B},g=function L(_){if(_!==!1&&_!==m(document)){if(!_||!_.focus){L(h());return}_.focus({preventScroll:!!i.preventScroll}),s.mostRecentlyFocusedNode=_,Xm(_)&&_.select()}},f=function(_){var B=c("setReturnFocus",_);return B||(B===!1?!1:_)},b=function(_){var B=_.target,j=_.event,I=_.isBackward,G=I===void 0?!1:I;B=B||Gr(j),p();var V=null;if(s.tabbableGroups.length>0){var Q=u(B,j),ae=Q>=0?s.containerGroups[Q]:void 0;if(Q<0)G?V=s.tabbableGroups[s.tabbableGroups.length-1].lastTabbableNode:V=s.tabbableGroups[0].firstTabbableNode;else if(G){var D=vu(s.tabbableGroups,function(R){var H=R.firstTabbableNode;return B===H});if(D<0&&(ae.container===B||va(B,i.tabbableOptions)&&!pn(B,i.tabbableOptions)&&!ae.nextTabbableNode(B,!1))&&(D=Q),D>=0){var M=D===0?s.tabbableGroups.length-1:D-1,W=s.tabbableGroups[M];V=an(B)>=0?W.lastTabbableNode:W.lastDomTabbableNode}else Dr(j)||(V=ae.nextTabbableNode(B,!1))}else{var F=vu(s.tabbableGroups,function(R){var H=R.lastTabbableNode;return B===H});if(F<0&&(ae.container===B||va(B,i.tabbableOptions)&&!pn(B,i.tabbableOptions)&&!ae.nextTabbableNode(B))&&(F=Q),F>=0){var T=F===s.tabbableGroups.length-1?0:F+1,z=s.tabbableGroups[T];V=an(B)>=0?z.firstTabbableNode:z.firstDomTabbableNode}else Dr(j)||(V=ae.nextTabbableNode(B))}}else V=c("fallbackFocus");return V},v=function(_){var B=Gr(_);if(!(u(B,_)>=0)){if(dr(i.clickOutsideDeactivates,_)){o.deactivate({returnFocus:i.returnFocusOnDeactivate});return}dr(i.allowOutsideClick,_)||_.preventDefault()}},E=function(_){var B=Gr(_),j=u(B,_)>=0;if(j||B instanceof Document)j&&(s.mostRecentlyFocusedNode=B);else{_.stopImmediatePropagation();var I,G=!0;if(s.mostRecentlyFocusedNode)if(an(s.mostRecentlyFocusedNode)>0){var V=u(s.mostRecentlyFocusedNode),Q=s.containerGroups[V].tabbableNodes;if(Q.length>0){var ae=Q.findIndex(function(D){return D===s.mostRecentlyFocusedNode});ae>=0&&(i.isKeyForward(s.recentNavEvent)?ae+1<Q.length&&(I=Q[ae+1],G=!1):ae-1>=0&&(I=Q[ae-1],G=!1))}}else s.containerGroups.some(function(D){return D.tabbableNodes.some(function(M){return an(M)>0})})||(G=!1);else G=!1;G&&(I=b({target:s.mostRecentlyFocusedNode,isBackward:i.isKeyBackward(s.recentNavEvent)})),g(I||s.mostRecentlyFocusedNode||h())}s.recentNavEvent=void 0},k=function(_){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;s.recentNavEvent=_;var j=b({event:_,isBackward:B});j&&(Dr(_)&&_.preventDefault(),g(j))},x=function(_){if(ep(_)&&dr(i.escapeDeactivates,_)!==!1){_.preventDefault(),o.deactivate();return}(i.isKeyForward(_)||i.isKeyBackward(_))&&k(_,i.isKeyBackward(_))},w=function(_){var B=Gr(_);u(B,_)>=0||dr(i.clickOutsideDeactivates,_)||dr(i.allowOutsideClick,_)||(_.preventDefault(),_.stopImmediatePropagation())},A=function(){if(s.active)return pu.activateTrap(a,o),s.delayInitialFocusTimer=i.delayInitialFocus?gu(function(){g(h())}):g(h()),r.addEventListener("focusin",E,!0),r.addEventListener("mousedown",v,{capture:!0,passive:!1}),r.addEventListener("touchstart",v,{capture:!0,passive:!1}),r.addEventListener("click",w,{capture:!0,passive:!1}),r.addEventListener("keydown",x,{capture:!0,passive:!1}),o},S=function(){if(s.active)return r.removeEventListener("focusin",E,!0),r.removeEventListener("mousedown",v,!0),r.removeEventListener("touchstart",v,!0),r.removeEventListener("click",w,!0),r.removeEventListener("keydown",x,!0),o},q=function(_){var B=_.some(function(j){var I=Array.from(j.removedNodes);return I.some(function(G){return G===s.mostRecentlyFocusedNode})});B&&g(h())},$=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(q):void 0,N=function(){$&&($.disconnect(),s.active&&!s.paused&&s.containers.map(function(_){$.observe(_,{subtree:!0,childList:!0})}))};return o={get active(){return s.active},get paused(){return s.paused},activate:function(_){if(s.active)return this;var B=l(_,"onActivate"),j=l(_,"onPostActivate"),I=l(_,"checkCanFocusTrap");I||p(),s.active=!0,s.paused=!1,s.nodeFocusedBeforeActivation=r.activeElement,B==null||B();var G=function(){I&&p(),A(),N(),j==null||j()};return I?(I(s.containers.concat()).then(G,G),this):(G(),this)},deactivate:function(_){if(!s.active)return this;var B=mu({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},_);clearTimeout(s.delayInitialFocusTimer),s.delayInitialFocusTimer=void 0,S(),s.active=!1,s.paused=!1,N(),pu.deactivateTrap(a,o);var j=l(B,"onDeactivate"),I=l(B,"onPostDeactivate"),G=l(B,"checkCanReturnFocus"),V=l(B,"returnFocus","returnFocusOnDeactivate");j==null||j();var Q=function(){gu(function(){V&&g(f(s.nodeFocusedBeforeActivation)),I==null||I()})};return V&&G?(G(f(s.nodeFocusedBeforeActivation)).then(Q,Q),this):(Q(),this)},pause:function(_){if(s.paused||!s.active)return this;var B=l(_,"onPause"),j=l(_,"onPostPause");return s.paused=!0,B==null||B(),S(),N(),j==null||j(),this},unpause:function(_){if(!s.paused||!s.active)return this;var B=l(_,"onUnpause"),j=l(_,"onPostUnpause");return s.paused=!1,B==null||B(),p(),A(),N(),j==null||j(),this},updateContainerElements:function(_){var B=[].concat(_).filter(Boolean);return s.containers=B.map(function(j){return typeof j=="string"?r.querySelector(j):j}),s.active&&p(),N(),this}},o.updateContainerElements(t),o};const ip=Object.freeze(Object.defineProperty({__proto__:null,createFocusTrap:ap},Symbol.toStringTag,{value:"Module"})),sp=Ac(ip),op=Ac(Ym);function Jn(e){"@babel/helpers - typeof";return Jn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jn(e)}function up(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,fd(r.key),r)}}function lp(e,t,n){return t&&bu(e.prototype,t),n&&bu(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function cp(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ys(e,t)}function ys(e,t){return ys=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},ys(e,t)}function dp(e){var t=hp();return function(){var r=Sa(e),a;if(t){var i=Sa(this).constructor;a=Reflect.construct(r,arguments,i)}else a=r.apply(this,arguments);return fp(this,a)}}function fp(e,t){if(t&&(Jn(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return yr(e)}function yr(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hp(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Sa(e){return Sa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Sa(e)}function mp(e,t,n){return t=fd(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fd(e){var t=pp(e,"string");return Jn(t)==="symbol"?t:String(t)}function pp(e,t){if(Jn(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Jn(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Qr=C,be=Om,gp=sp,vp=gp.createFocusTrap,bp=op,yp=bp.isFocusable,Js=function(e){cp(n,e);var t=dp(n);function n(r){var a;up(this,n),a=t.call(this,r),mp(yr(a),"getNodeForOption",function(o){var l,u=(l=this.internalOptions[o])!==null&&l!==void 0?l:this.originalOptions[o];if(typeof u=="function"){for(var c=arguments.length,h=new Array(c>1?c-1:0),p=1;p<c;p++)h[p-1]=arguments[p];u=u.apply(void 0,h)}if(u===!0&&(u=void 0),!u){if(u===void 0||u===!1)return u;throw new Error("`".concat(o,"` was specified but was not a node, or did not return a node"))}var m=u;if(typeof u=="string"){var g;if(m=(g=this.getDocument())===null||g===void 0?void 0:g.querySelector(u),!m)throw new Error("`".concat(o,"` as selector refers to no known node"))}return m}),a.handleDeactivate=a.handleDeactivate.bind(yr(a)),a.handlePostDeactivate=a.handlePostDeactivate.bind(yr(a)),a.handleClickOutsideDeactivates=a.handleClickOutsideDeactivates.bind(yr(a)),a.internalOptions={returnFocusOnDeactivate:!1,checkCanReturnFocus:null,onDeactivate:a.handleDeactivate,onPostDeactivate:a.handlePostDeactivate,clickOutsideDeactivates:a.handleClickOutsideDeactivates},a.originalOptions={returnFocusOnDeactivate:!0,onDeactivate:null,onPostDeactivate:null,checkCanReturnFocus:null,clickOutsideDeactivates:!1};var i=r.focusTrapOptions;for(var s in i)if(Object.prototype.hasOwnProperty.call(i,s)){if(s==="returnFocusOnDeactivate"||s==="onDeactivate"||s==="onPostDeactivate"||s==="checkCanReturnFocus"||s==="clickOutsideDeactivates"){a.originalOptions[s]=i[s];continue}a.internalOptions[s]=i[s]}return a.outsideClick=null,a.focusTrapElements=r.containerElements||[],a.updatePreviousElement(),a}return lp(n,[{key:"getDocument",value:function(){return this.props.focusTrapOptions.document||(typeof document<"u"?document:void 0)}},{key:"getReturnFocusNode",value:function(){var a=this.getNodeForOption("setReturnFocus",this.previouslyFocusedElement);return a||(a===!1?!1:this.previouslyFocusedElement)}},{key:"updatePreviousElement",value:function(){var a=this.getDocument();a&&(this.previouslyFocusedElement=a.activeElement)}},{key:"deactivateTrap",value:function(){!this.focusTrap||!this.focusTrap.active||this.focusTrap.deactivate({returnFocus:!1,checkCanReturnFocus:null,onDeactivate:this.originalOptions.onDeactivate})}},{key:"handleClickOutsideDeactivates",value:function(a){var i=typeof this.originalOptions.clickOutsideDeactivates=="function"?this.originalOptions.clickOutsideDeactivates.call(null,a):this.originalOptions.clickOutsideDeactivates;return i&&(this.outsideClick={target:a.target,allowDeactivation:i}),i}},{key:"handleDeactivate",value:function(){this.originalOptions.onDeactivate&&this.originalOptions.onDeactivate.call(null),this.deactivateTrap()}},{key:"handlePostDeactivate",value:function(){var a=this,i=function(){var o=a.getReturnFocusNode(),l=!!(a.originalOptions.returnFocusOnDeactivate&&o!==null&&o!==void 0&&o.focus&&(!a.outsideClick||a.outsideClick.allowDeactivation&&!yp(a.outsideClick.target,a.internalOptions.tabbableOptions))),u=a.internalOptions.preventScroll,c=u===void 0?!1:u;l&&o.focus({preventScroll:c}),a.originalOptions.onPostDeactivate&&a.originalOptions.onPostDeactivate.call(null),a.outsideClick=null};this.originalOptions.checkCanReturnFocus?this.originalOptions.checkCanReturnFocus.call(null,this.getReturnFocusNode()).then(i,i):i()}},{key:"setupFocusTrap",value:function(){if(this.focusTrap)this.props.active&&!this.focusTrap.active&&(this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause());else{var a=this.focusTrapElements.some(Boolean);a&&(this.focusTrap=this.props._createFocusTrap(this.focusTrapElements,this.internalOptions),this.props.active&&this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause())}}},{key:"componentDidMount",value:function(){this.props.active&&this.setupFocusTrap()}},{key:"componentDidUpdate",value:function(a){if(this.focusTrap){a.containerElements!==this.props.containerElements&&this.focusTrap.updateContainerElements(this.props.containerElements);var i=!a.active&&this.props.active,s=a.active&&!this.props.active,o=!a.paused&&this.props.paused,l=a.paused&&!this.props.paused;if(i&&(this.updatePreviousElement(),this.focusTrap.activate()),s){this.deactivateTrap();return}o&&this.focusTrap.pause(),l&&this.focusTrap.unpause()}else a.containerElements!==this.props.containerElements&&(this.focusTrapElements=this.props.containerElements),this.props.active&&(this.updatePreviousElement(),this.setupFocusTrap())}},{key:"componentWillUnmount",value:function(){this.deactivateTrap()}},{key:"render",value:function(){var a=this,i=this.props.children?Qr.Children.only(this.props.children):void 0;if(i){if(i.type&&i.type===Qr.Fragment)throw new Error("A focus-trap cannot use a Fragment as its child container. Try replacing it with a <div> element.");var s=function(u){var c=a.props.containerElements;i&&(typeof i.ref=="function"?i.ref(u):i.ref&&(i.ref.current=u)),a.focusTrapElements=c||[u]},o=Qr.cloneElement(i,{ref:s});return o}return null}}]),n}(Qr.Component),fr=typeof Element>"u"?Function:Element;Js.propTypes={active:be.bool,paused:be.bool,focusTrapOptions:be.shape({document:be.object,onActivate:be.func,onPostActivate:be.func,checkCanFocusTrap:be.func,onPause:be.func,onPostPause:be.func,onUnpause:be.func,onPostUnpause:be.func,onDeactivate:be.func,onPostDeactivate:be.func,checkCanReturnFocus:be.func,initialFocus:be.oneOfType([be.instanceOf(fr),be.string,be.bool,be.func]),fallbackFocus:be.oneOfType([be.instanceOf(fr),be.string,be.func]),escapeDeactivates:be.oneOfType([be.bool,be.func]),clickOutsideDeactivates:be.oneOfType([be.bool,be.func]),returnFocusOnDeactivate:be.bool,setReturnFocus:be.oneOfType([be.instanceOf(fr),be.string,be.bool,be.func]),allowOutsideClick:be.oneOfType([be.bool,be.func]),preventScroll:be.bool,tabbableOptions:be.shape({displayCheck:be.oneOf(["full","legacy-full","non-zero-area","none"]),getShadowRoot:be.oneOfType([be.bool,be.func])}),trapStack:be.array,isKeyForward:be.func,isKeyBackward:be.func}),containerElements:be.arrayOf(be.instanceOf(fr)),children:be.oneOfType([be.element,be.instanceOf(fr)])};Js.defaultProps={active:!0,paused:!1,focusTrapOptions:{},_createFocusTrap:vp};var Cp=Js;const Dp=Tn(Cp),hd=({showDevTools:e=!0,children:t})=>{const n=new Ye.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!1,staleTime:6e4}}});return d.jsxs(Ye.QueryClientProvider,{client:n,children:[t,e&&d.jsx(Rh.ReactQueryDevtools,{initialIsOpen:!1})]})};var md=C.createContext({client:pa});function xp(e){var t=e.children,n=e.client,r=e.apiKey,a=e.options,i=C.useMemo(function(){return n&&r&&console.warn("[PostHog.js] You have provided both a client and an apiKey to PostHogProvider. The apiKey will be ignored in favour of the client."),n&&a&&console.warn("[PostHog.js] You have provided both a client and options to PostHogProvider. The options will be ignored in favour of the client."),n||(r&&(pa.__loaded&&console.warn("[PostHog.js] was already loaded elsewhere. This may cause issues."),pa.init(r,a)),pa)},[n,r]);return C.createElement(md.Provider,{value:{client:i}},t)}var wp=function(){var e=C.useContext(md).client;return e};function Ep(e){var t=wp(),n=C.useState(),r=n[0],a=n[1];return C.useEffect(function(){return t.onFeatureFlags(function(){a(t.getFeatureFlagPayload(e))})},[t,e]),r}const pd=({children:e,user:t})=>t.isLoading?null:process.env.REACT_APP_PUBLIC_POSTHOG_KEY?d.jsx(xp,{apiKey:atob(process.env.REACT_APP_PUBLIC_POSTHOG_KEY),options:{api_host:"/ph",autocapture:!1,disable_session_recording:!0,persistence_name:"flags",secure_cookie:!0,ui_host:"eu.posthog.com",bootstrap:{distinctID:t.id||"00000000-0000-0000-0000-000000000000",isIdentifiedID:!!t.id}},children:e}):d.jsx(d.Fragment,{children:e});var Xs=(e=>(e.COMMUNITY_RANKING="community-ranking",e))(Xs||{});const gd=({children:e,locale:t,messages:n})=>{const r=t||"en",a={...em[r],...n||{}};return d.jsx(oe.IntlProvider,{locale:r,messages:a,children:e})},eo=C.createContext({}),ba={en:"English",es:"Español",fr:"Français",pt:"Português"},Tt=C.createContext({isLoading:!0});function Ja(){return C.useContext(Tt)}const vd=({children:e,user:t,updateDetails:n})=>d.jsx(Tt.Provider,{value:{...t,updateDetails:n},children:e}),to=C.createContext({registerOverlay:()=>{},unregisterOverlay:()=>{}}),bd=()=>C.useContext(to),yd=({children:e})=>{const[t,n]=C.useState([]);C.useEffect(()=>{t.length>0?document.body.classList.add("has-overlay"):document.body.classList.remove("has-overlay")},[t]);const r=C.useCallback(i=>{n(s=>[...s,i])},[]),a=C.useCallback(i=>{n(s=>s.filter(o=>o!==i))},[]);return d.jsx(to.Provider,{value:{registerOverlay:r,unregisterOverlay:a},children:e})},_p=({bootstrap:e,children:t,intl:n,showDevTools:r})=>{const[a,i]=C.useState({isLoading:!0}),s=(n==null?void 0:n.locale)||localStorage.getItem("language")||"en",[o,l]=C.useState(s),u=c=>{localStorage.setItem("language",c),l(c)};return C.useEffect(()=>{e().then(c=>{i({...c,isLoading:!1}),Uc(5e3)}).catch(c=>{c.message===Lc&&window.location.pathname!=="/user-onboarding/logout"&&(window.location.href="/user-onboarding/logout"),i({isLoading:!1})})},[]),d.jsx(eo.Provider,{value:{language:o,updateLanguage:u},children:d.jsx(gd,{locale:o,messages:n==null?void 0:n.messages,children:d.jsx(Ws.CookiesProvider,{children:d.jsx(vd,{user:a,updateDetails:i,children:d.jsx(yd,{children:d.jsx(hd,{showDevTools:r,children:d.jsx(pd,{user:a,children:t})})})})})})})};const dn=({id:e="content-overlay",isOpen:t=!1,showDivider:n=!0,maxWidth:r,functions:{onOpen:a=()=>{},onClose:i=()=>{}}={},forceShow:{error:s=!1}={},title:o,children:l,buttons:u,className:c="",gtmContext:h="Modal"})=>{const p=oe.useIntl(),{registerOverlay:m,unregisterOverlay:g}=bd(),[f,b]=C.useState(t),v=C.useRef(null),E=w=>{w.key==="Escape"&&k(!1)};C.useEffect(()=>(window.addEventListener("keyup",E),()=>{window.removeEventListener("keyup",E)}));const k=w=>{if(b(w),w)a(),m(e);else{if(f===w)return;i(),g(e)}};C.useEffect(()=>(k(t),()=>{f&&g(e)}),[t]);const x=r?{"--max-width":`${r/16}rem`}:{};return d.jsx("div",{id:`${e}-overlay`,ref:v,className:Y("overlay",{open:f,"in-portal":c.includes("in-portal")}),role:"dialog",onClick:w=>{w.currentTarget===w.target&&(w.preventDefault(),w.stopPropagation(),k(!1))},children:d.jsx(Gs,{id:e,className:Y("overlay-modal",c,{"has-max-width":r}),hidden:!f,style:x,children:t&&d.jsx(Dp,{containerElements:[v.current],children:d.jsxs("div",{className:"overlay-content",children:[d.jsxs("div",{className:"top",children:[o&&d.jsx("h2",{className:"modal-title",children:o}),d.jsx(ke,{variant:"tertiary",size:"medium",icon:{icon:"close"},onClick:()=>k(!1),className:"gtm-trackable","data-gtm-event-type":"close-modal-click","data-gtm-event-context":h,screenreaderText:p.formatMessage({id:"overlay_close"})})]}),n&&d.jsx(zt,{}),l,u&&d.jsxs("div",{className:"bottom",children:[d.jsx(zt,{}),d.jsx(ir,{buttons:u})]}),s&&d.jsx(Tr,{className:"error",children:s})]})})})})},Cd=(e,t)=>({"aria-haspopup":!0,"aria-expanded":t,"aria-controls":e});const hr="joinCommunityButton",no=({isMember:e=!1,isOpen:t=!1,isShort:n=!1,disabled:r=!1,functions:{join:a,leave:i}={join:()=>{},leave:()=>{}}})=>{const s=oe.useIntl(),o=C.useContext(Tt),l=o&&typeof o.id=="string",u=r||!l,[c,h]=C.useState(e),[p,m]=C.useState(e?"joined":"notJoined");C.useEffect(()=>{p==="joining"?m("joined"):p==="leaving"&&m("notJoined")},[c]);const g={},f={};return c&&p!=="leaving"&&(g["data-hover-text"]=s.formatMessage({id:`${hr}_leave`}),g["aria-label"]=s.formatMessage({id:`${hr}_member_aria`}),f["aria-hidden"]="true"),d.jsx(ke,{variant:c?"secondary":"primary",size:"medium",styling:{fullWidth:!0},icon:c&&p!=="leaving"?{icon:"tick",position:"left"}:!1,tooltip:!t&&!c?s.formatMessage({id:`${hr}_closed_tooltip`}):"",onClick:async b=>{if(u)return;b.currentTarget.blur(),m(c?"leaving":"joining");const v=new CustomEvent("ariaLive",{detail:{message:s.formatMessage({id:`${hr}_aria_live`},{action:c?"leaving":"joining"})}});document.dispatchEvent(v);const E=c?i:a;typeof E=="function"&&setTimeout(async()=>{await E()},500),h(!c)},className:Y("join-community-button",p,{active:p==="joining"}),disabled:u,"data-testid":"join-button",...g,children:d.jsx("span",{className:"text",...f,children:s.formatMessage({id:`${hr}${["joining","leaving"].includes(p)?`_${p}`:c?"_member":n?"_short":""}`})})})};const Di="communityDetails_",kp=({className:e="",isMember:t=!1,isOpen:n=!1,slug:r,members:{number:a=0,data:i=[]}={number:0,data:[]},functions:{invite:s,...o}})=>{const l=oe.useIntl(),u=5,c=a||i.length,h=i.length?i:Array(u).fill({}),p=`/communities/${r}/members`===window.location.pathname,m=t||n,g=!n&&!t;return d.jsxs("div",{className:Y("community-details",e),children:[m&&d.jsxs("div",{className:"member-details",children:[d.jsxs("div",{className:"top",children:[d.jsxs("h4",{children:[l.formatMessage({id:`${Di}members`}),d.jsx("span",{className:"count",children:c})]}),!p&&d.jsx("p",{className:"text-small",children:d.jsx("a",{href:`/communities/${r}/members`,children:l.formatMessage({id:`${Di}viewAll`})})})]}),d.jsx(Ys,{contributors:{total:a,data:h},styling:{size:"medium",showGap:!0,showPlaceholders:c===0},cutoff:u})]}),d.jsx(no,{isMember:t,isOpen:n,disabled:g,functions:{...o}}),t&&d.jsx(ke,{variant:"primary",onClick:s,icon:{icon:"plus"},styling:{fullWidth:!0},children:l.formatMessage({id:`${Di}invite`})})]})};const Fp=({breadcrumbs:e,cutoff:t=20,className:n=""})=>{const r=oe.useIntl();return d.jsxs(d.Fragment,{children:[d.jsx(Ie,{element:"p",children:r.formatMessage({id:"breadcrumbs_label"})}),d.jsx("ul",{className:Y("breadcrumbs text-small",n),children:e.map(({text:a,href:i,current:s=!1},o)=>{const l={};return s&&(l["aria-current"]="location"),d.jsxs("li",{children:[s&&d.jsx(Ie,{element:"span",children:r.formatMessage({id:"breadcrumbs_currentPage"})}),d.jsx(jn,{href:s?void 0:i,...l,children:Gn(a,t)})]},`${window.btoa(a)}_${o}`)})})]})};const Bp=({options:e,allOption:t=!1,allowMultiple:n=!0,onChange:r=()=>{},className:a=""})=>{const i=oe.useIntl(),s=t?[{id:"all",text:typeof t!="boolean"&&t.text||i.formatMessage({id:"filters_all"})},...e]:e,[o,l]=C.useState(t?["all"]:[]),u=(c,h)=>{let p=[];o.includes(c)?p=o.filter(m=>m!==c):c==="all"?p=["all"]:n?p=[...o.filter(m=>m!=="all"),c]:p=[c],l(m=>(r&&typeof r=="function"&&r({current:p,previous:m}),p)),h&&typeof h=="function"&&h()};return d.jsx("ul",{className:Y("filters",a),children:s.map(({id:c,text:h,disabled:p=!1,callback:m=()=>{}})=>{let g={};return p&&(g={disabled:!0,"aria-label":i.formatMessage({id:"filters_disabled"},{name:h})}),d.jsx("li",{children:d.jsx("button",{className:Y(c,{selected:o.includes(c)}),onClick:f=>{f.preventDefault(),f.stopPropagation(),u(c,m)},...g,children:h})},c)})})},Ap=(e,t,n)=>{const r=String(e);if(!n||!n.length)return t?`/${r}/${t}`:`/${r}`;let a="",i=!1;return n.forEach(({url:s,position:o})=>{o==="before-lang"?(a+=`/${s}`,i=!0):(a.includes(`/${r}/`)||(a+=`/${r}`),a+=`/${s}`)}),a.includes(`/${r}/`)||(a+=`/${r}`),t&&(a+=`/${t}`),i?{url:a,urlForRouter:`/${a.split("/").slice(2).join("/")}`}:a};const Jr="languageSwitcher_",Tp=({currentLanguage:e,isOriginalLanguage:t=!1,isHumanTranslation:n=!1,translations:r,onChange:a,urlParts:i,variant:s="default",label:o,className:l=""})=>{const u=oe.useIntl(),{updateLanguage:c=()=>{}}=C.useContext(eo),[h,p]=C.useState(e);if(C.useEffect(()=>{e!==h&&p(e)},[e]),!r||!Object.values(r).some(b=>b&&b.post_name))return null;const g=Object.keys(r),f=h!==e;return d.jsxs("div",{className:Y("language-switcher text-small",s,l),children:[d.jsxs("nav",{children:[s!=="short"&&d.jsx("p",{children:o||u.formatMessage({id:`${Jr}label`})}),d.jsx("ul",{children:g.map(b=>{var k;if(!ba[b])return null;const v=(k=r[b])==null?void 0:k.post_name;let E={className:b};if(h===b)E["aria-label"]=u.formatMessage({id:`${Jr}selected`},{language:ba[b]});else{const x=Ap(b,v,i);E={...E,href:typeof x=="string"?x:x.url,onClick:w=>{p(b),c(b),typeof a<"u"&&(w.preventDefault(),w.stopPropagation(),a(b,typeof x=="string"?x:x.urlForRouter))}}}return d.jsx("li",{children:d.jsx(jn,{...E,fallbackElement:"span",children:ba[b]})},b)})}),s!=="short"&&!f&&d.jsx("p",{children:u.formatMessage({id:`${Jr}translation_${t?"original":n?"human":"machine"}`})})]}),s!=="short"&&!f&&!t&&!n&&d.jsx("small",{children:u.formatMessage({id:`${Jr}disclaimer`},{email:zn.support,link:b=>{const v=`mailto:${b}`;return d.jsx("a",{href:v,children:b})}})})]})};const xi=oe.createIntl({locale:"en",messages:ar}),zr=({hasNextPage:e=!0,loadNextPage:t=()=>{},isLoading:n=!1,variant:r="secondary",size:a="medium",styling:i={muted:!1,fullWidth:!1},icon:s=!1,messages:o={button:xi.formatMessage({id:"loadMore_button"}),endOfFeed:xi.formatMessage({id:"loadMore_endOfFeed"}),error:xi.formatMessage({id:"loadMore_error"})},className:l="",gtmContext:u="LoadMore"})=>{const[c,h]=C.useState(""),p=async m=>{if(!n)try{await t(m)}catch(g){g instanceof Error?h(g.message):h("Unknown error")}};return!c&&!e&&!o.endOfFeed?null:d.jsx("footer",{className:Y("load-more",l),children:!c&&e?d.jsx(ke,{variant:r,size:a,styling:i,icon:s,onClick:p,"data-gtm-event-context":u,"data-gtm-event-type":"load-more-click",disabled:n,className:"gtm-trackable","data-testid":"load-more-button",children:o.button}):o.endOfFeed&&(!c||c!=null&&c.includes("Cannot read items"))?d.jsx("p",{children:o.endOfFeed}):c&&d.jsx("p",{className:"error",children:o.error})})};const ro=({variant:e="default",version:t="default",className:n="",...r})=>d.jsx("p",{className:"logo-wrapper",children:d.jsx("a",{href:"/home/",className:Y("logo",e,t,n),...r,children:d.jsx(Ie,{children:d.jsx(oe.FormattedMessage,{id:"apolitical"})})})});let Xr=!1;const Dd=({element:e="div",id:t="more-menu",options:n,className:r=""})=>{const a=oe.useIntl(),i=C.useRef(null),[s,o]=C.useState(!1),l=u=>{i.current&&u.target instanceof HTMLElement&&!i.current.contains(u.target)&&o(!1)};return C.useEffect(()=>(document.addEventListener("click",l,!0),()=>{document.removeEventListener("click",l,!0)})),C.createElement(e,{ref:i,className:Y("more-menu text-medium",r),children:d.jsxs(d.Fragment,{children:[d.jsx(ke,{variant:"tertiary",size:"medium",icon:{icon:"ellipsis"},onClick:()=>o(!s),"aria-haspopup":"true","aria-expanded":s,"aria-controls":t,screenreaderText:a.formatMessage({id:"moreMenu"}),className:"more-menu-button"}),d.jsx("ul",{id:t,hidden:!s,children:n.map(({href:u,onClick:c,text:h,icon:p,...m},g)=>{const f={...m,onClick:b=>{o(!1),typeof c=="function"&&c(b)},onFocus:()=>{Xr&&(clearTimeout(Xr),Xr=!1)},onBlur:()=>{Xr=setTimeout(()=>{o(!1)},100)}};return u&&(f.href=u),d.jsx("li",{className:"more-menu-list-item",children:d.jsx(ke,{variant:"tertiary",size:"medium",icon:p?{icon:p,position:"left"}:!1,...f,children:h})},`${window.btoa(h)}_${g}`)})})]})})},Sp=(e,t=!1)=>t?e.replaceAll("/","")===t:typeof window<"u"&&window.location&&window.location.pathname===e;const jp=[{key:"homepage",href:"/home/"},{key:"events",href:"/events/"},{key:"microcourses",href:"/microcourses/"},{key:"articles",href:"/solution-articles/"},{key:"communities",href:"/communities/"}],xd=({activeLink:e})=>{const t=oe.useIntl(),n=C.useContext(Tt),r=n&&typeof n.id=="string";return d.jsxs("ul",{id:"navigation-menu",className:"text-medium",children:[jp.map(({key:a,href:i})=>{const s=Sp(i,e),o={};return s&&(o["aria-current"]="page"),d.jsx("li",{className:Y(a,{active:s}),children:d.jsx("a",{href:i,"data-gtm-event-type":`${a}-click`,"data-gtm-event-context":"NavigationMenu",className:"gtm-trackable",...o,children:t.formatMessage({id:`navigationMenu_links_${a}`})})},a)}),r&&d.jsx("li",{className:"profile","data-testid":"profile-link",children:d.jsxs("a",{href:"/profiles/me","data-gtm-event-type":"profile-click","data-gtm-event-context":"NavigationMenu",className:"gtm-trackable",children:[d.jsx(Gt,{name:(n==null?void 0:n.name)||"",src:n!=null&&n.image?n.image.thumbnail:""}),d.jsx("span",{children:t.formatMessage({id:"navigationMenu_profile"})})]})})]})},mr=(e,t,n)=>`${e}?share=${t}${n?`&uuid=${n}`:""}`,Op=({title:e,link:t,referrer:n})=>[{key:"linkedin",icon:"social_linkedin",url:`https://www.linkedin.com/shareArticle?mini=true&url=${encodeURIComponent(`${mr(t,"linkedin",n)}&src=linkedin`)}&title=${encodeURIComponent(e)}&source=Apolitical`},{key:"twitter",icon:"social_twitter",url:`https://twitter.com/share?ref_src=twsrc%5Etfw&url=${encodeURIComponent(`${mr(t,"twitter",n)}&src=twitter`)}&text=${encodeURIComponent(e)}&via=${encodeURIComponent("apoliticalco")}`},{key:"facebook",icon:"social_facebook",url:`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(`${mr(t,"facebook",n)}`)}&t=${e}`},{key:"email",icon:"share_email",url:`mailto:?subject=${encodeURIComponent(e)}&body=${encodeURIComponent(`${e}
63
63
 
64
- ${mr(t,"mailto",n)}&src=email`)}`},{key:"clipboard-copy",icon:"share_copy-link",url:mr(t,"copy",n),shouldRender:()=>navigator&&navigator.clipboard&&navigator.clipboard.writeText,onClick:(r,a)=>(r.preventDefault(),r.stopPropagation(),navigator.clipboard.writeText(a))}];const Rp="shareLinks_",Ip=({title:e,link:t,referrer:n,gtmContext:r="ShareLinks",size:a="large",variant:i="default",className:s=""})=>{const o=se.useIntl(),l=Mp({title:e,link:t,referrer:n});return d.jsxs("aside",{className:G("share-links",a,i,s),children:[d.jsx("p",{className:"text-small",children:o.formatMessage({id:"shareLinks_label"})}),d.jsx("ul",{children:l.map(({key:u,icon:c,url:h,shouldRender:p=!0,onClick:m})=>{if(typeof p=="function"&&!p())return null;const g={};return m&&(g.onClick=f=>m(f,h)),d.jsx("li",{children:d.jsx(Be,{size:a,variant:"tertiary",icon:{icon:c||u},href:h,target:"_blank",rel:"noopener noreferrer",className:"gtm-trackable","data-gtm-event-context":`${r}-SocialButtons`,"data-gtm-event-type":`${u}-click`,"data-testid":"link",screenreaderText:o.formatMessage({id:`${Rp}link_${u}`}),...g})},u)})})]})};const $p=({tabs:e,className:t="",preventLocationChange:n})=>{var p;const r=(m,g,f)=>(m||(m=`panel-${window.btoa(g)}-${f}`),m);let a=e.findIndex(m=>m.current===!0);if(a<0&&(a=0),window.location.hash){const m=window.location.hash.replace("#","");if(e.find(f=>f.id===m)){for(let f=0;f<e.length;f++)if(r(e[f].id,e[f].text,f)===m){a=f;break}}}const[i,s]=y.useState((p=e[a])!=null&&p.id?e[a].id:r(e[a].id,e[a].text,a)),[o,l]=y.useState(""),u=(m,g)=>{switch(m.key){case"ArrowLeft":case"ArrowRight":{m.preventDefault();let f=g;m.key==="ArrowLeft"?g>0?f=g-1:f=e.length-1:m.key==="ArrowRight"&&(g<e.length-1?f=g+1:f=0);const b=r(e[f].id,e[f].text,f),v=document.getElementById(`tab-${b}`);v==null||v.focus(),l(b);break}case"Enter":s(o),window.location.hash=`#${o}`;break}};y.useEffect(()=>{if(e[a].hasCarousel){const m=new CustomEvent("hiddenSectionVisible",{detail:{id:i}});window.dispatchEvent(m)}},[i]);const c=[],h=[];return e.forEach(({id:m,text:g,content:f,href:b,hasCarousel:v},E)=>{m=r(m,g,E);const k=i===m,x={};b||(x["aria-controls"]=m,x.onClick=w=>{w.preventDefault(),w.stopPropagation(),s(m),!n&&(window.location.hash=`#${m}`)},h.push(d.jsx("section",{id:m,hidden:!k,role:"tabpanel","aria-labelledby":`tab-${m}`,"aria-live":k?"assertive":"off",children:typeof f=="string"?d.jsx("p",{children:f}):f},`section-${m}`))),c.push(d.jsx("li",{"data-testid":"navigation-tab",children:d.jsx("a",{href:b||`#${m}`,id:`tab-${m}`,"aria-controls":m,className:G({selected:k}),role:"tab",tabIndex:k?0:-1,"aria-selected":k,onKeyDown:w=>u(w,E),...x,children:g})},`tab-${m}`))}),d.jsxs("div",{className:G("tabs-wrapper",t),children:[d.jsx("ul",{className:"tabs",role:"tablist",children:c}),d.jsx("div",{className:"tab-content",children:h})]})};const Lp={"2-1":901,"1-3":769,"1-1":769},Ed=({layout:e="2-1",hideOnMobile:t=!1,hasCSSContainers:n=!1,className:r="",children:a})=>{const i=rr(!0);let s=a;return y.Children.count(a)===1&&(s=y.Children.toArray(a)[0],s.props&&(s=s.props.children)),d.jsx("section",{className:G("columns",`layout-${e}`,r,{"has-containers":n}),children:y.Children.map(s,(o,l)=>t!==!1&&l===t&&i&&i<Lp[e]?null:o)})};const ao=({id:e="character-limit",limit:t,valueLength:n,...r})=>{const a=se.useIntl(),i="form_fieldWrapper_characterLimit";if(t===0)return null;const s=t-n,o=Math.abs(n-t),l=n>=.99*t,u=n>=.9*t&&n<.99*t,c=n>t;return d.jsxs(d.Fragment,{children:[d.jsx("small",{id:e,className:G("character-limit",{"near-limit":l,"approaching-limit":u}),"aria-live":"polite","aria-label":c?"":a.formatMessage({id:`${i}_aria_${s<0?"over":"default"}`},{remaining:s,over:o,limit:t}),children:c?a.formatMessage({id:`${i}_aria_${s<0?"over":"default"}`},{remaining:s,over:o,limit:t}):d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"hidden",children:a.formatMessage({id:i})}),n," / ",t]})}),d.jsx(Ie,{showOnFocus:!1,id:`${e}-info`,children:a.formatMessage({id:`${i}_info`},{limit:t})})]})},Xa=e=>(e==null?void 0:e.toString().length)||0,_d=(e,t=null)=>{const n={};return e===0||(n["data-character-limit"]=e,t&&(n.functions={onChange:r=>{Xa(r)>e&&(r=r==null?void 0:r.toString().slice(0,e)),t(r)}})),n};const ea="emailHelperTextBox_",kd=({id:e="email-helper-textbox",type:t,email:n,redirectPath:r,resendVerificationCode:a})=>{const i=se.useIntl(),[s,o]=y.useState({path:`${ea}default`,type:"default",link:{},mail:{},error:""}),[l,u]=y.useState(!1),c=y.useCallback(g=>{g.preventDefault(),g.stopPropagation();const f=b=>{o({path:`${ea}error_verificationFailedToSend`,type:"error",link:{"data-gtm-event-context":"VerifyEmailBox","data-gtm-event-type":"SendEmailClick",className:"gtm-trackable",onClick:v=>c(v),href:"#","data-testid":"send-verify-email-click"},mail:{href:"mailto:concierge@apolitical.co",className:"gtm-trackable","data-gtm-event-context":"ErrorVerifyingBox","data-gtm-event-type":"email-concierge-click"},error:b})};if(typeof a!="function"){f(i.formatMessage({id:`${ea}error_noFunction`}));return}u(!0),a(n).then(()=>{localStorage.setItem("email",n),window.location.href=r||"/signup/verify-email"}).catch(b=>{f(b.message)}).finally(()=>{u(!1)})},[n,r,a]);y.useEffect(()=>{let g=ea,f="default",b={},v={};switch(t){case"gov":g+="autoApproved",f="success";break;case"nonGov":g+="unrecognisedEmail",f="error",b={href:"https://about.apolitical.co/who-can-join-the-community","data-gtm-event-context":"NonGovEmailHelperTextBox","data-gtm-event-type":"LearnMoreClick"};break;case"pending":g+="pendingApproval",f="error",v={href:"mailto:concierge@apolitical.co",className:"gtm-trackable","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"email-concierge-click"};break;case"verify":g+="emailUnverified",f="error",b={href:"#","data-gtm-event-context":"VerifyEmailBox","data-gtm-event-type":"SendEmailClick",className:"gtm-trackable",onClick:E=>c(E),"data-testid":"send-verify-email-click"};break;case"exists":g+="emailAlreadyExists",f="error",b={href:"/user-onboarding/login","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"login-click"},v={href:"mailto:concierge@apolitical.co",className:"gtm-trackable","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"email-concierge-click"};break;default:g+="default",b={href:"https://about.apolitical.co/who-can-join-the-community","data-gtm-event-context":"DefaultEmailHelperTextBox","data-gtm-event-type":"LearnMoreClick"};break}o({...s,path:g,type:f,link:b,mail:v})},[t]);const h={};return["link","mail"].forEach(g=>{h[g]=Object.keys(s[g]).length?f=>d.jsx("a",{...s[g],children:f}):f=>f}),d.jsx(Jc,{id:e,type:s.type,heading:l?!1:i.formatMessage({id:`${s.path}_title`}),children:l?d.jsxs(d.Fragment,{children:[d.jsx(kt,{element:"span"}),d.jsx(kt,{element:"span"})]}):i.formatMessage({id:`${s.path}_text`},{...h,strong:g=>d.jsx("strong",{children:g}),em:g=>d.jsx("em",{children:g}),br:d.jsxs(d.Fragment,{children:[d.jsx("br",{}),d.jsx("br",{})]}),error:s.error})})},qn=({className:e="",element:t="input",id:n,inputRef:r,functions:a={onChange:()=>{}},name:i=n,placeholder:s,type:o="text",value:l,autoFocus:u,...c})=>{const h=y.useRef(),p=r||h;return y.useEffect(()=>{var m;u&&((m=p.current)==null||m.focus())},[]),!(c!=null&&c.autoComplete)&&["email"].includes(o)&&(c.autoComplete="email"),y.createElement(t,{ref:p,...c,type:o,id:n,name:i,className:G(e,t,{"has-scrollbar":o==="textarea"&&p.current&&p.current.clientHeight<p.current.scrollHeight}),value:l,placeholder:s,autoFocus:u,...a,onChange:m=>{const g=m.target;a.onChange(g.value)}})};const Mn={UP:"ArrowUp",DOWN:"ArrowDown",ENTER:"Enter"},zp=500,qp=({id:e,name:t=e,value:n,placeholder:r,functions:a={onChange:()=>{},onKeyInput:async()=>new Promise(()=>{})},...i})=>{const{onChange:s=()=>{},onKeyInput:o=async()=>{}}=a,[{input:l,displayInput:u,debouncedInput:c},h]=y.useState({input:n,displayInput:n,debouncedInput:n}),[{predictions:p,activePredictionIndex:m,isPredictionSelected:g},f]=y.useState({predictions:[],activePredictionIndex:-1,isPredictionSelected:!!n}),{formatMessage:b}=se.useIntl();r||(r=b({id:"inputAutocomplete_placeholder"})),y.useEffect(()=>{const x=setTimeout(()=>{g||h(w=>({...w,debouncedInput:l}))},zp);return()=>{clearTimeout(x)}},[l,g]),y.useEffect(()=>{c&&!g?(async()=>{try{const w=await o(c)||[];f(A=>({...A,predictions:w}))}catch(w){console.error("Error fetching predictions:",w),f(A=>({...A,predictions:[]}))}})():f(x=>({...x,predictions:[]}))},[c,g]),y.useEffect(()=>{m>=0&&p[m]&&h(x=>({...x,displayInput:p[m].description}))},[m,p]);const v=x=>{[Mn.DOWN,Mn.UP,Mn.ENTER].includes(x.key)&&(x.preventDefault(),x.key===Mn.DOWN&&m<p.length-1?f(w=>({...w,activePredictionIndex:m+1})):x.key===Mn.UP&&m>0?f(w=>({...w,activePredictionIndex:m-1})):x.key===Mn.ENTER&&m>-1&&(s(p[m].description),h(w=>({...w,input:p[m].description})),f(w=>({...w,predictions:[],isPredictionSelected:!0}))))},E=x=>{s(x.target.value),h(w=>({...w,input:x.target.value,displayInput:x.target.value})),f(w=>({...w,activePredictionIndex:-1,isPredictionSelected:!1}))},k=x=>{s(x.description),h(w=>({...w,input:x.description,displayInput:x.description})),f(w=>({...w,isPredictionSelected:!0,predictions:[]}))};return d.jsxs(d.Fragment,{children:[d.jsx("input",{type:"text",value:u,onChange:E,onKeyDown:v,placeholder:r,name:t,id:e,...i}),d.jsx("ul",{className:"predictions-list",children:p.map((x,w)=>d.jsx("li",{onClick:()=>k(x),onMouseEnter:()=>f(A=>({...A,activePredictionIndex:w})),className:G("predictions-list-item",{active:w===m}),children:x.description},w))})]})};const Bd=({className:e="",disabled:t,element:n="p",functions:r={onChange:()=>{}},id:a,inputRef:i,intlPath:s=!1,label:o,shownValue:l=!0,type:u="checkbox",value:c,...h})=>{const p=se.useIntl(),{onChange:m,...g}=r,f=()=>{t||m(c?null:l)},b=d.jsxs(d.Fragment,{children:[d.jsx("input",{ref:i,id:a,name:a,type:u,value:l,checked:c,onKeyDown:v=>{(v.key==="Enter"||v.code==="Space")&&(v.preventDefault(),v.stopPropagation(),f())},readOnly:!0,disabled:t}),d.jsx("span",{className:"pretty-checkbox","data-testid":"pretty-checkbox"}),d.jsx("label",{htmlFor:a,children:o||p.formatMessage({id:s?`${s}_${a}`:a})})]});return y.createElement(n,{onClick:v=>{const E=v.target;E.nodeName.toLowerCase()==="a"||E.parentNode&&E.parentNode.nodeName.toLowerCase()==="a"||(v.preventDefault(),v.stopPropagation(),f())},className:G("checkbox-wrapper",e),...h,...g},b)};const Wp=y.memo(function({direction:t="down"}){return d.jsx(Ka,{className:G("rotating-chevron",`direction-${t}`)})});const Up=({className:e,options:t,initialValue:n,value:r,functions:a={onChange:()=>{},onMultiSelectSubmit:()=>{}},gtm:{context:i}={context:""},placeholder:s,multiSelect:o,multiSelectOptions:l,id:u})=>{const c=se.useIntl(),[h,p]=y.useState(!1),m=r||n,g=Array.isArray(m)?[...m]:m?[m]:[],[f,b]=y.useState(g);let v;Array.isArray(f)&&f.length===1&&typeof f[0]=="string"?v=t&&f?t.find(S=>S.id===f[0]):t?t[0]:{id:"",label:""}:Array.isArray(f)&&f.length===1&&typeof f[0]!="string"?v=f[0]:v={id:"",label:""},y.useEffect(()=>{b(g)},[r,n]);const{onChange:E,onMultiSelectSubmit:k,...x}=a,w=S=>{if(o){let W=[];f!=null&&f.includes(S.id)?W=f.filter(R=>R!==S.id):W=[...f,S.id],b([...W]),E&&E([...W])}else b([S]),E&&E(S.id),p(!1)},A=S=>{if(S==="all"){const W=(t==null?void 0:t.map(R=>R.id))||[];b(W),E&&E(W)}else b([]),E&&E([])};return d.jsxs("div",{className:G("dropdown-wrapper",e),children:[d.jsxs("button",{className:"input","aria-expanded":h,"aria-haspopup":"listbox","aria-controls":"dropdown-list",onClick:S=>{S.preventDefault(),S.stopPropagation(),p(!h)},"data-testid":"dropdown-selector",...x,children:[o?`${s} · ${f.length}`:v.label,d.jsx(Wp,{direction:h?"up":"down"})]}),d.jsx("select",{defaultValue:v.id,onChange:S=>{S.preventDefault(),S.stopPropagation();const W=t&&t.find(R=>R.id===S.target.value);w(W)},hidden:!h,...x,children:t==null?void 0:t.map(S=>d.jsx("option",{value:S.id,className:"gtm-trackable","data-gtm-event-type":`${S.id}-click`,"data-gtm-event-context":i,children:S.label},S.id))}),d.jsxs("div",{className:"menu-options input dropdown-menu",role:"menu",hidden:!h,children:[d.jsxs("div",{className:"dropdown-menu-list",children:[(l==null?void 0:l.topbar)&&d.jsxs("div",{className:"action-bar",children:[d.jsx("p",{children:`${f==null?void 0:f.length} selected`}),d.jsxs("ul",{children:[d.jsx("li",{children:d.jsx(Be,{variant:"tertiary",size:"small",onClick:()=>A("all"),className:"gtm-trackable","data-gtm-event-type":"all-click","data-gtm-event-context":i,children:c.formatMessage({id:"dropdown_menu_multiselect_all"})})}),d.jsx("li",{children:d.jsx(Be,{variant:"tertiary",size:"small",onClick:()=>A("none"),className:"gtm-trackable","data-gtm-event-type":"none-click","data-gtm-event-context":i,children:c.formatMessage({id:"dropdown_menu_multiselect_none"})})})]})]}),d.jsx("ul",{children:t==null?void 0:t.map(S=>{const W=S.id===v.id||(f==null?void 0:f.includes(S))||(f==null?void 0:f.includes(S.id));return d.jsx("li",{"data-testid":"dropdown-options",children:d.jsxs("button",{className:G("gtm-trackable",{selected:W,"selected-single":W&&!o}),"data-gtm-event-type":`${S.id}-click`,"data-gtm-event-context":i,onClick:R=>{R.preventDefault(),R.stopPropagation(),w(S)},role:"menuitem","aria-current":W,"data-testid":W?"current-selection":"",children:[o&&d.jsx("span",{className:"pretty-checkbox","data-testid":"pretty-checkbox"}),d.jsx("span",{className:G({"menu-option-label":o}),children:S.label})]})},S.id)})})]}),(l==null?void 0:l.submitSection)&&d.jsx("p",{className:"submit",children:d.jsx(Be,{variant:"secondary",onClick:()=>{k&&k(f),document.dispatchEvent(new CustomEvent("dropdownMultiSelectSubmit",{detail:{id:u||"dropdown-multi-select",value:f}})),p(!1)},children:c.formatMessage({id:"form_submit"})})})]})]})};const Hp=({className:e="",functions:t={onChange:()=>{}},intlPath:n=!1,id:r,label:a,multiSelect:i=!1,name:s,options:o,required:l,type:u="checkboxes",value:c,...h})=>{const p=se.useIntl(),m=i?c:[],g=c;return d.jsx("ul",{...h,className:G("options-wrapper",e),"data-testid":`ul-${r}`,children:o==null?void 0:o.map(({id:f,label:b=!1,value:v=f,disabled:E=!1})=>{const k=`${r}_${f}`,x=()=>{if(E)return;let w;if(i){const A=m==null?void 0:m.indexOf(v);Array.isArray(m)&&A>=0?(w=m,w.splice(A,1)):(!m||m.length===0?w=[]:w=m,w.push(v))}else w=g===v?void 0:v;t.onChange(w)};return d.jsx(Bd,{element:"li",id:k,type:u==="checkboxes"?"checkbox":"radio",shownValue:v,value:i?m==null?void 0:m.includes(v):g===v,functions:{...t,onChange:x},intlPath:n,label:b||p.formatMessage({id:n?`${n}_${f}`:f}),disabled:E},k)})})};const Vp=({inputRef:e,type:t="password",gtm:{context:n}={context:void 0},autoComplete:r="on",...a})=>{const i=se.useIntl(),s=y.useRef(),o=e||s,[l,u]=y.useState(!1),[c,h]=y.useState(t),p=()=>{var m;u(!l),h(l?"password":"text"),(m=o.current)==null||m.focus()};return d.jsxs(d.Fragment,{children:[d.jsx("button",{type:"button",className:G("show-password gtm-trackable",{"password-visible":l}),"data-gtm-event-context":n,"data-gtm-event-type":`${l?"hide":"show"}-password-click`,onClick:p,"aria-label":i.formatMessage({id:`showpassword_aria_${l?"hide":"show"}`}),children:i.formatMessage({id:`showpassword_${l?"hide":"show"}`})}),d.jsx(qn,{inputRef:o,type:c,autoComplete:r,...a})]})};const Rn={text:{component:qn},email:{component:qn},url:{component:qn},textarea:{component:qn,props:{element:"textarea",rows:4,cols:10}},checkbox:{component:Bd},checkboxes:{component:Hp,props:{multiSelect:!0}},select:{component:Up},password:{component:Vp},autocomplete:{component:qp}},Kp=({id:e,intlPath:t=!1,className:n="",error:r,functions:a={onChange:()=>{}},limit:i=0,showRequiredLabels:s=!0,type:o,validation:l,value:u,submitOnEnter:c,...h})=>{const p=se.useIntl(),m=l&&l.some(({condition:I})=>I==="required"),g=Xa(u),f=o&&Rn[o]&&Rn[o].component?Rn[o].component:qn,b=o&&["checkboxes"].includes(o),v=o&&["autocomplete"].includes(o),E=r&&`error-${e}`,k=`character-limit-${e}`,x={};b?x.element="legend":x.htmlFor=e;let w={...h,id:e,name:e,className:r?"error":"",type:o,required:m,"aria-required":m,functions:yn(a),value:u};const A=I=>{w["aria-describedby"]?w["aria-describedby"]+=` ${I}`:w["aria-describedby"]=I};if(i>0){const I=_d(i,a.onChange);A(`${k}-info`),w={...w,...I},I.functions&&typeof I.functions=="object"&&(w.functions={...w.functions,...I.functions})}o&&Rn[o]&&Rn[o].props&&(w={...w,...Rn[o].props}),b&&(w.intlPath=`${t}_${e}`),r&&(w["aria-invalid"]=!0,w["aria-errormessage"]=E,A(E));const S=h.label||p.formatMessage({id:t?`${t}_${e}`:e}),W=({...I})=>r?y.createElement(I.as||"p",{id:E,className:"error text-small",...I},r):null;if(o&&["checkbox"].includes(o))return d.jsxs(d.Fragment,{children:[d.jsx(f,{...w,label:S,className:G("field-wrapper",n)}),d.jsx(W,{as:"p"})]});const R=I=>y.createElement(I.element||"label",{...I,className:"checkboxes-label text-small","data-testid":`label-${e}`});return d.jsx(d.Fragment,{children:y.createElement(b?"fieldset":"div",{className:G("field-wrapper text-medium",n)},d.jsxs(d.Fragment,{children:[y.createElement(b?"div":"p",{className:"field-label"},d.jsx(d.Fragment,{children:d.jsxs(R,{...x,children:[S,m&&s&&d.jsxs(d.Fragment,{children:[" ",d.jsxs("small",{children:["(",p.formatMessage({id:"form_fieldWrapper_required"}),")"]})]})]})})),y.createElement(b||v?"div":"p",{className:"field-component"},d.jsxs(d.Fragment,{children:[d.jsx(f,{...w}),d.jsx(ao,{id:k,limit:i,valueLength:g})]})),d.jsx(W,{})]}))})},Zp=(e,t)=>{const{type:n,payload:r}=t,a=e.errors?yn(e.errors):{},i=e.values?yn(e.values):{};switch(n){case"updateValue":if(r!=null&&r.key&&a[r==null?void 0:r.key]&&delete a[r==null?void 0:r.key],r!=null&&r.key){if(["isSubmitting","formSubmitted","errors"].includes(r==null?void 0:r.key))return{...e,errors:a,[r==null?void 0:r.key]:r==null?void 0:r.value};i[r==null?void 0:r.key]=r==null?void 0:r.value}return{...e,errors:a,values:i};case"addError":return r!=null&&r.key&&!a[r==null?void 0:r.key]&&(a[r==null?void 0:r.key]=r==null?void 0:r.value),{...e,errors:a};case"removeError":return r!=null&&r.key&&a[r==null?void 0:r.key]&&delete a[r==null?void 0:r.key],{...e,errors:a};case"submitForm":{const{fields:s=[],dispatch:o=()=>{},onSuccess:l=()=>{},onFailure:u=()=>{},intl:c}=r,h=yn(Object.keys(a));for(const p of s)if(p.validation)for(let m=0;m<p.validation.length;m++){const{condition:g="required",error:f=!1}=p.validation[m];let b=!1;if(typeof g=="function"){const v=g(i);v&&(b=f||v)}else{const v=i[p.id];switch(g){case"required":(!v||typeof v=="string"&&v.trim().length===0)&&(b=f||(c==null?void 0:c.formatMessage({id:"form_error_required"})));break;case"no-numbers":{v&&!/^([^0-9]*)$/.test(v)&&(b=f||(c==null?void 0:c.formatMessage({id:"form_error_numbers"})));break}case"valid-email":{v&&!/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(v)&&(b=f||(c==null?void 0:c.formatMessage({id:"form_error_email"})));break}case"valid-url":{v&&!/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$/.test(v)&&(b=f||(c==null?void 0:c.formatMessage({id:"form_error_url"})));break}default:console.warn("WARNING! No field validation condition has been set")}}if(b){o({type:"addError",payload:{key:p.id,value:b}}),h.push(p.id);break}}return h.length===0?l(i):u(i,h),e}case"formSubmitted":return{...e,isSubmitting:!1,formSubmitted:!0,errors:{}};case"formSubmittedAndReset":return{isSubmitting:!1,formSubmitted:!0,errors:{}};default:return e}};let wi=null;const Qt=({element:e="form",fields:t,className:n="",id:r=t.length?`form__${t[0].id}`:"form",formRef:a,intlPath:i=!1,button:s={variant:"primary",size:"large",customOnSubmit:!1},secondaryActionButton:o={variant:"secondary",size:"large"},meta:l,children:u,gtm:c={context:"Form",event:"form-submit-click"},functions:h,...p})=>{const{customOnSubmit:m,hideButton:g,overwriteSubmittingText:f=!1,...b}=s,v=40,{shouldShowCancelButton:E=!1,shouldReset:k=!0,shouldHide:x=!0,showRequiredLabels:w=!0,showSuccessMessage:A=!1}=l||{},{onSuccess:S=async()=>{},onCancel:W=()=>{},onCatch:R=()=>{},onFailure:I=()=>{}}=h||{},N=se.useIntl(),_={};t.length&&t.forEach(z=>{const M=z.id||z.name;M&&(_[M]=z.value||"")});const[F,j]=y.useReducer(Zp,{isSubmitting:!1,formSubmitted:!1,errors:{},values:_}),{errors:$,isSubmitting:V,formSubmitted:K,values:Q}=F;y.useEffect(()=>{k&&K&&(wi=setTimeout(()=>{j({type:"updateValue",payload:{key:"formSubmitted",value:!1}})},3e3))},[K]),y.useEffect(()=>()=>{wi&&clearTimeout(wi)},[]),y.useEffect(()=>{const z=M=>{j({type:"updateValue",payload:{key:M.detail.id,value:M.detail.value}})};return document.addEventListener("dropdownMultiSelectSubmit",z),()=>{document.removeEventListener("dropdownMultiSelectSubmit",z)}},[]);const ae=y.useRef(null),D=a||ae;if(!t.length)return null;let L=b.text;L||(L=s.children||N.formatMessage({id:"form_submit"})),delete b.text;const q=()=>{if(!V){if(j({type:"updateValue",payload:{key:"isSubmitting",value:!0}}),s.disabled){typeof s.disabled=="object"&&s.disabled.isClickable&&j({type:"submitForm",payload:{fields:t,dispatch:j,intl:N}});return}j({type:"submitForm",payload:{fields:t,dispatch:j,onSuccess:async z=>{try{await S(z),j({type:k?"formSubmittedAndReset":"formSubmitted"})}catch(M){R(M),j({type:"updateValue",payload:{key:"isSubmitting",value:!1}})}},onFailure:(z,M)=>{I(z,M),j({type:"updateValue",payload:{key:"isSubmitting",value:!1}})},intl:N}})}},T=[{...b,icon:K?{icon:"tick",position:"left"}:!1,className:"gtm-trackable",onClick:z=>{var ne;if(z.preventDefault(),z.stopPropagation(),V)return;let M=0;if((ne=D==null?void 0:D.current)!=null&&ne.id){const ee=document.getElementById(D.current.id);ee&&(M=ee.getBoundingClientRect().top+window.scrollY)}const H=document.getElementById("header");H&&(M=M-H.offsetHeight-v),M<0&&(M=0),window.scrollTo({top:M,behavior:"smooth"}),q()},disabled:V||K||s.disabled,"data-gtm-event-context":c.context,"data-gtm-event-type":c.event,children:f?L:V||K?N.formatMessage({id:`form_${V?"submitting":"submitted"}`}):L}];return E&&T.unshift({...o,className:"gtm-trackable","data-gtm-event-context":c.context,"data-gtm-event-type":c.event,disabled:V||K,onClick:W,children:o.text||N.formatMessage({id:"form_cancel"})}),d.jsxs(d.Fragment,{children:[y.createElement(e,{...p,id:r,className:G("form",n),ref:D},d.jsxs(d.Fragment,{children:[$!=null&&$.general?d.jsx(cn,{variant:"error",text:N.formatMessage({id:"form_error_generalError"})}):null,u,(!x||!V&&!K||m)&&t.map((z,M)=>{const{id:H=z.name||M,component:ne,functions:ee={onChange:()=>{}},submitOnEnter:re=!1}=z;if(ne)return d.jsx(ne,{...z.props||{}},`component-${H}-${M}`);const le=(Q==null?void 0:Q[H])||"",J={...ee,onChange:he=>{j({type:"updateValue",payload:{key:H,value:he}}),ee.onChange(he&&he.toString(),j)}};return re&&(J.onKeyDown=he=>{he.key==="Enter"&&(he.stopPropagation(),he.preventDefault(),q()),ee.onKeyDown&&ee.onKeyDown(he)}),d.jsx(Kp,{intlPath:i,...z,showRequiredLabels:w,value:le,error:$==null?void 0:$[H],functions:J},H)}),g?null:(V||K)&&m?m:d.jsx(ir,{className:G("cta",{center:V||K,submitted:K}),buttons:T})]})),A&&K&&d.jsx(Tr,{className:"success",children:typeof A=="string"?A:N.formatMessage({id:"form_success"})})]})};const ta="passwordRules_",Fd="isMoreThanEightCharacters",Ad="includesNumberAndSymbol",Td="includesLowerAndUppercase",Yp={[Fd]:"8Characters",[Ad]:"numberSymbol",[Td]:"lowercaseUppercase"},Gp=({matchingRules:e={isMoreThanEightCharacters:!1,includesNumberAndSymbol:!1,includesLowerAndUppercase:!1},className:t=""})=>{const n=se.useIntl();return d.jsxs("aside",{className:G("password-rules",t),children:[d.jsx("small",{children:n.formatMessage({id:`${ta}intro`})}),d.jsx("ul",{children:[Fd,Ad,Td].map(r=>d.jsxs("li",{className:G({matches:e[r]}),children:[d.jsxs(Ie,{children:[n.formatMessage({id:`${ta}rule_label`})," "]}),d.jsx("span",{children:n.formatMessage({id:`${ta}rule_${Yp[r]}`})}),!e[r]&&d.jsxs(Ie,{element:"strong",children:[" ",n.formatMessage({id:`${ta}notMet`})]})]},`rule-${r}`))})]})},Sd=y.memo(Gp);const Qp=({text:e={},topRating:t=5,functions:{createRating:n=()=>null,updateRating:r=()=>{},reportError:a=()=>{}},className:i="",hasLoaded:s=!1})=>{const o=se.useIntl(),[l,u]=y.useState({setUp:!1,id:null,rating:null,disabled:!0}),c=async()=>{try{const v=await n();u(E=>({...E,setUp:!0,id:v&&v.id,disabled:!1}))}catch(v){u(E=>({...E,setUp:!0,disabled:!0})),a(v)}};if(y.useEffect(()=>{s&&!l.setUp&&c()},[s]),!s)return d.jsx(kt,{className:"rating-placeholder"});const{id:h,rating:p,disabled:m}=l,g="ratings_",f={text:o.formatMessage({id:`${g}text`}),low:o.formatMessage({id:`${g}low`}),high:o.formatMessage({id:`${g}high`}),success:o.formatMessage({id:`${g}success`}),...e},b=async v=>{if(!(!h||m))try{u(E=>({...E,rating:v,disabled:!0})),await r({id:h,value:v})}catch(E){u(k=>({...k,rating:null})),a(E)}finally{u(E=>({...E,disabled:!1}))}};return d.jsxs("div",{className:G("rating",i),children:[d.jsx("span",{className:"label",children:f[p?"success":"text"]}),d.jsx("ol",{children:Array.from(new Array(t).keys()).map(v=>{const E=v+1;return d.jsx("li",{className:G({selected:p&&E<=p}),children:d.jsx(Be,{variant:"tertiary",size:"small",icon:{icon:`star${!p||E>p?"_empty":""}`,position:"left",hover:"star"},screenreaderText:`${o.formatMessage({id:`${g}stars`},{number:E,total:t})}${E===1||E===t?` - ${f[E===1?"low":"high"]}`:""}`,onClick:k=>{k.preventDefault(),k.stopPropagation(),b(E)},disabled:m})},`rating-${E}`)})})]})};function Jp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}function Cs(e,t){return Array(t+1).join(e)}function Xp(e){return e.replace(/^\n*/,"")}function eg(e){for(var t=e.length;t>0&&e[t-1]===`
65
- `;)t--;return e.substring(0,t)}var tg=["ADDRESS","ARTICLE","ASIDE","AUDIO","BLOCKQUOTE","BODY","CANVAS","CENTER","DD","DIR","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","FRAMESET","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","HTML","ISINDEX","LI","MAIN","MENU","NAV","NOFRAMES","NOSCRIPT","OL","OUTPUT","P","PRE","SECTION","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR","UL"];function io(e){return so(e,tg)}var jd=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];function Od(e){return so(e,jd)}function ng(e){return Nd(e,jd)}var Pd=["A","TABLE","THEAD","TBODY","TFOOT","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"];function rg(e){return so(e,Pd)}function ag(e){return Nd(e,Pd)}function so(e,t){return t.indexOf(e.nodeName)>=0}function Nd(e,t){return e.getElementsByTagName&&t.some(function(n){return e.getElementsByTagName(n).length})}var at={};at.paragraph={filter:"p",replacement:function(e){return`
64
+ ${mr(t,"mailto",n)}&src=email`)}`},{key:"clipboard-copy",icon:"share_copy-link",url:mr(t,"copy",n),shouldRender:()=>navigator&&navigator.clipboard&&navigator.clipboard.writeText,onClick:(r,a)=>(r.preventDefault(),r.stopPropagation(),navigator.clipboard.writeText(a))}];const Pp="shareLinks_",Np=({title:e,link:t,referrer:n,gtmContext:r="ShareLinks",size:a="large",variant:i="default",className:s=""})=>{const o=oe.useIntl(),l=Op({title:e,link:t,referrer:n});return d.jsxs("aside",{className:Y("share-links",a,i,s),children:[d.jsx("p",{className:"text-small",children:o.formatMessage({id:"shareLinks_label"})}),d.jsx("ul",{children:l.map(({key:u,icon:c,url:h,shouldRender:p=!0,onClick:m})=>{if(typeof p=="function"&&!p())return null;const g={};return m&&(g.onClick=f=>m(f,h)),d.jsx("li",{children:d.jsx(ke,{size:a,variant:"tertiary",icon:{icon:c||u},href:h,target:"_blank",rel:"noopener noreferrer",className:"gtm-trackable","data-gtm-event-context":`${r}-SocialButtons`,"data-gtm-event-type":`${u}-click`,"data-testid":"link",screenreaderText:o.formatMessage({id:`${Pp}link_${u}`}),...g})},u)})})]})};const Rp=({tabs:e,className:t="",preventLocationChange:n})=>{var p;const r=(m,g,f)=>(m||(m=`panel-${window.btoa(g)}-${f}`),m);let a=e.findIndex(m=>m.current===!0);if(a<0&&(a=0),window.location.hash){const m=window.location.hash.replace("#","");if(e.find(f=>f.id===m)){for(let f=0;f<e.length;f++)if(r(e[f].id,e[f].text,f)===m){a=f;break}}}const[i,s]=C.useState((p=e[a])!=null&&p.id?e[a].id:r(e[a].id,e[a].text,a)),[o,l]=C.useState(""),u=(m,g)=>{switch(m.key){case"ArrowLeft":case"ArrowRight":{m.preventDefault();let f=g;m.key==="ArrowLeft"?g>0?f=g-1:f=e.length-1:m.key==="ArrowRight"&&(g<e.length-1?f=g+1:f=0);const b=r(e[f].id,e[f].text,f),v=document.getElementById(`tab-${b}`);v==null||v.focus(),l(b);break}case"Enter":s(o),window.location.hash=`#${o}`;break}};C.useEffect(()=>{if(e[a].hasCarousel){const m=new CustomEvent("hiddenSectionVisible",{detail:{id:i}});window.dispatchEvent(m)}},[i]);const c=[],h=[];return e.forEach(({id:m,text:g,content:f,href:b,hasCarousel:v},E)=>{m=r(m,g,E);const k=i===m,x={};b||(x["aria-controls"]=m,x.onClick=w=>{w.preventDefault(),w.stopPropagation(),s(m),!n&&(window.location.hash=`#${m}`)},h.push(d.jsx("section",{id:m,hidden:!k,role:"tabpanel","aria-labelledby":`tab-${m}`,"aria-live":k?"assertive":"off",children:typeof f=="string"?d.jsx("p",{children:f}):f},`section-${m}`))),c.push(d.jsx("li",{"data-testid":"navigation-tab",children:d.jsx("a",{href:b||`#${m}`,id:`tab-${m}`,"aria-controls":m,className:Y({selected:k}),role:"tab",tabIndex:k?0:-1,"aria-selected":k,onKeyDown:w=>u(w,E),...x,children:g})},`tab-${m}`))}),d.jsxs("div",{className:Y("tabs-wrapper",t),children:[d.jsx("ul",{className:"tabs",role:"tablist",children:c}),d.jsx("div",{className:"tab-content",children:h})]})};const Mp={"2-1":901,"1-3":769,"1-1":769},wd=({layout:e="2-1",hideOnMobile:t=!1,hasCSSContainers:n=!1,className:r="",children:a})=>{const i=rr(!0);let s=a;return C.Children.count(a)===1&&(s=C.Children.toArray(a)[0],s.props&&(s=s.props.children)),d.jsx("section",{className:Y("columns",`layout-${e}`,r,{"has-containers":n}),children:C.Children.map(s,(o,l)=>t!==!1&&l===t&&i&&i<Mp[e]?null:o)})};const ao=({id:e="character-limit",limit:t,valueLength:n,...r})=>{const a=oe.useIntl(),i="form_fieldWrapper_characterLimit";if(t===0)return null;const s=t-n,o=Math.abs(n-t),l=n>=.99*t,u=n>=.9*t&&n<.99*t,c=n>t;return d.jsxs(d.Fragment,{children:[d.jsx("small",{id:e,className:Y("character-limit",{"near-limit":l,"approaching-limit":u}),"aria-live":"polite","aria-label":c?"":a.formatMessage({id:`${i}_aria_${s<0?"over":"default"}`},{remaining:s,over:o,limit:t}),children:c?a.formatMessage({id:`${i}_aria_${s<0?"over":"default"}`},{remaining:s,over:o,limit:t}):d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"hidden",children:a.formatMessage({id:i})}),n," / ",t]})}),d.jsx(Ie,{showOnFocus:!1,id:`${e}-info`,children:a.formatMessage({id:`${i}_info`},{limit:t})})]})},Xa=e=>(e==null?void 0:e.toString().length)||0,Ed=(e,t=null)=>{const n={};return e===0||(n["data-character-limit"]=e,t&&(n.functions={onChange:r=>{Xa(r)>e&&(r=r==null?void 0:r.toString().slice(0,e)),t(r)}})),n};const ea="emailHelperTextBox_",_d=({id:e="email-helper-textbox",type:t,email:n,redirectPath:r,resendVerificationCode:a})=>{const i=oe.useIntl(),[s,o]=C.useState({path:`${ea}default`,type:"default",link:{},mail:{},error:""}),[l,u]=C.useState(!1),c=C.useCallback(g=>{g.preventDefault(),g.stopPropagation();const f=b=>{o({path:`${ea}error_verificationFailedToSend`,type:"error",link:{"data-gtm-event-context":"VerifyEmailBox","data-gtm-event-type":"SendEmailClick",className:"gtm-trackable",onClick:v=>c(v),href:"#","data-testid":"send-verify-email-click"},mail:{href:"mailto:concierge@apolitical.co",className:"gtm-trackable","data-gtm-event-context":"ErrorVerifyingBox","data-gtm-event-type":"email-concierge-click"},error:b})};if(typeof a!="function"){f(i.formatMessage({id:`${ea}error_noFunction`}));return}u(!0),a(n).then(()=>{localStorage.setItem("email",n),window.location.href=r||"/signup/verify-email"}).catch(b=>{f(b.message)}).finally(()=>{u(!1)})},[n,r,a]);C.useEffect(()=>{let g=ea,f="default",b={},v={};switch(t){case"gov":g+="autoApproved",f="success";break;case"nonGov":g+="unrecognisedEmail",f="error",b={href:"https://about.apolitical.co/who-can-join-the-community","data-gtm-event-context":"NonGovEmailHelperTextBox","data-gtm-event-type":"LearnMoreClick"};break;case"pending":g+="pendingApproval",f="error",v={href:"mailto:concierge@apolitical.co",className:"gtm-trackable","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"email-concierge-click"};break;case"verify":g+="emailUnverified",f="error",b={href:"#","data-gtm-event-context":"VerifyEmailBox","data-gtm-event-type":"SendEmailClick",className:"gtm-trackable",onClick:E=>c(E),"data-testid":"send-verify-email-click"};break;case"exists":g+="emailAlreadyExists",f="error",b={href:"/user-onboarding/login","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"login-click"},v={href:"mailto:concierge@apolitical.co",className:"gtm-trackable","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"email-concierge-click"};break;default:g+="default",b={href:"https://about.apolitical.co/who-can-join-the-community","data-gtm-event-context":"DefaultEmailHelperTextBox","data-gtm-event-type":"LearnMoreClick"};break}o({...s,path:g,type:f,link:b,mail:v})},[t]);const h={};return["link","mail"].forEach(g=>{h[g]=Object.keys(s[g]).length?f=>d.jsx("a",{...s[g],children:f}):f=>f}),d.jsx(Qc,{id:e,type:s.type,heading:l?!1:i.formatMessage({id:`${s.path}_title`}),children:l?d.jsxs(d.Fragment,{children:[d.jsx(_t,{element:"span"}),d.jsx(_t,{element:"span"})]}):i.formatMessage({id:`${s.path}_text`},{...h,strong:g=>d.jsx("strong",{children:g}),em:g=>d.jsx("em",{children:g}),br:d.jsxs(d.Fragment,{children:[d.jsx("br",{}),d.jsx("br",{})]}),error:s.error})})},qn=({className:e="",element:t="input",id:n,inputRef:r,functions:a={onChange:()=>{}},name:i=n,placeholder:s,type:o="text",value:l,autoFocus:u,...c})=>{const h=C.useRef(),p=r||h;return C.useEffect(()=>{var m;u&&((m=p.current)==null||m.focus())},[]),!(c!=null&&c.autoComplete)&&["email"].includes(o)&&(c.autoComplete="email"),C.createElement(t,{ref:p,...c,type:o,id:n,name:i,className:Y(e,t,{"has-scrollbar":o==="textarea"&&p.current&&p.current.clientHeight<p.current.scrollHeight}),value:l,placeholder:s,autoFocus:u,...a,onChange:m=>{const g=m.target;a.onChange(g.value)}})};const Rn={UP:"ArrowUp",DOWN:"ArrowDown",ENTER:"Enter"},Ip=500,$p=({id:e,name:t=e,value:n,placeholder:r,functions:a={onChange:()=>{},onKeyInput:async()=>new Promise(()=>{})},...i})=>{const{onChange:s=()=>{},onKeyInput:o=async()=>{}}=a,[{input:l,displayInput:u,debouncedInput:c},h]=C.useState({input:n,displayInput:n,debouncedInput:n}),[{predictions:p,activePredictionIndex:m,isPredictionSelected:g},f]=C.useState({predictions:[],activePredictionIndex:-1,isPredictionSelected:!!n}),{formatMessage:b}=oe.useIntl();r||(r=b({id:"inputAutocomplete_placeholder"})),C.useEffect(()=>{const x=setTimeout(()=>{g||h(w=>({...w,debouncedInput:l}))},Ip);return()=>{clearTimeout(x)}},[l,g]),C.useEffect(()=>{c&&!g?(async()=>{try{const w=await o(c)||[];f(A=>({...A,predictions:w}))}catch(w){console.error("Error fetching predictions:",w),f(A=>({...A,predictions:[]}))}})():f(x=>({...x,predictions:[]}))},[c,g]),C.useEffect(()=>{m>=0&&p[m]&&h(x=>({...x,displayInput:p[m].description}))},[m,p]);const v=x=>{[Rn.DOWN,Rn.UP,Rn.ENTER].includes(x.key)&&(x.preventDefault(),x.key===Rn.DOWN&&m<p.length-1?f(w=>({...w,activePredictionIndex:m+1})):x.key===Rn.UP&&m>0?f(w=>({...w,activePredictionIndex:m-1})):x.key===Rn.ENTER&&m>-1&&(s(p[m].description),h(w=>({...w,input:p[m].description})),f(w=>({...w,predictions:[],isPredictionSelected:!0}))))},E=x=>{s(x.target.value),h(w=>({...w,input:x.target.value,displayInput:x.target.value})),f(w=>({...w,activePredictionIndex:-1,isPredictionSelected:!1}))},k=x=>{s(x.description),h(w=>({...w,input:x.description,displayInput:x.description})),f(w=>({...w,isPredictionSelected:!0,predictions:[]}))};return d.jsxs(d.Fragment,{children:[d.jsx("input",{type:"text",value:u,onChange:E,onKeyDown:v,placeholder:r,name:t,id:e,...i}),d.jsx("ul",{className:"predictions-list",children:p.map((x,w)=>d.jsx("li",{onClick:()=>k(x),onMouseEnter:()=>f(A=>({...A,activePredictionIndex:w})),className:Y("predictions-list-item",{active:w===m}),children:x.description},w))})]})};const kd=({className:e="",disabled:t,element:n="p",functions:r={onChange:()=>{}},id:a,inputRef:i,intlPath:s=!1,label:o,shownValue:l=!0,type:u="checkbox",value:c,...h})=>{const p=oe.useIntl(),{onChange:m,...g}=r,f=()=>{t||m(c?null:l)},b=d.jsxs(d.Fragment,{children:[d.jsx("input",{ref:i,id:a,name:a,type:u,value:l,checked:c,onKeyDown:v=>{(v.key==="Enter"||v.code==="Space")&&(v.preventDefault(),v.stopPropagation(),f())},readOnly:!0,disabled:t}),d.jsx("span",{className:"pretty-checkbox","data-testid":"pretty-checkbox"}),d.jsx("label",{htmlFor:a,children:o||p.formatMessage({id:s?`${s}_${a}`:a})})]});return C.createElement(n,{onClick:v=>{const E=v.target;E.nodeName.toLowerCase()==="a"||E.parentNode&&E.parentNode.nodeName.toLowerCase()==="a"||(v.preventDefault(),v.stopPropagation(),f())},className:Y("checkbox-wrapper",e),...h,...g},b)};const Lp=C.memo(function({direction:t="down"}){return d.jsx(Ka,{className:Y("rotating-chevron",`direction-${t}`)})});const zp=({className:e,options:t,initialValue:n,value:r,functions:a={onChange:()=>{},onMultiSelectSubmit:()=>{}},gtm:{context:i}={context:""},placeholder:s,multiSelect:o,multiSelectOptions:l,id:u})=>{const c=oe.useIntl(),[h,p]=C.useState(!1),m=r||n,g=Array.isArray(m)?[...m]:m?[m]:[],[f,b]=C.useState(g);let v;Array.isArray(f)&&f.length===1&&typeof f[0]=="string"?v=t&&f?t.find(S=>S.id===f[0]):t?t[0]:{id:"",label:""}:Array.isArray(f)&&f.length===1&&typeof f[0]!="string"?v=f[0]:v={id:"",label:""},C.useEffect(()=>{b(g)},[r,n]);const{onChange:E,onMultiSelectSubmit:k,...x}=a,w=S=>{if(o){let q=[];f!=null&&f.includes(S.id)?q=f.filter($=>$!==S.id):q=[...f,S.id],b([...q]),E&&E([...q])}else b([S]),E&&E(S.id),p(!1)},A=S=>{if(S==="all"){const q=(t==null?void 0:t.map($=>$.id))||[];b(q),E&&E(q)}else b([]),E&&E([])};return d.jsxs("div",{className:Y("dropdown-wrapper",e),children:[d.jsxs("button",{className:"input","aria-expanded":h,"aria-haspopup":"listbox","aria-controls":"dropdown-list",onClick:S=>{S.preventDefault(),S.stopPropagation(),p(!h)},"data-testid":"dropdown-selector",...x,children:[o?`${s} · ${f.length}`:v.label,d.jsx(Lp,{direction:h?"up":"down"})]}),d.jsx("select",{defaultValue:v.id,onChange:S=>{S.preventDefault(),S.stopPropagation();const q=t&&t.find($=>$.id===S.target.value);w(q)},hidden:!h,...x,children:t==null?void 0:t.map(S=>d.jsx("option",{value:S.id,className:"gtm-trackable","data-gtm-event-type":`${S.id}-click`,"data-gtm-event-context":i,children:S.label},S.id))}),d.jsxs("div",{className:"menu-options input dropdown-menu",role:"menu",hidden:!h,children:[d.jsxs("div",{className:"dropdown-menu-list",children:[(l==null?void 0:l.topbar)&&d.jsxs("div",{className:"action-bar",children:[d.jsx("p",{children:`${f==null?void 0:f.length} selected`}),d.jsxs("ul",{children:[d.jsx("li",{children:d.jsx(ke,{variant:"tertiary",size:"small",onClick:()=>A("all"),className:"gtm-trackable","data-gtm-event-type":"all-click","data-gtm-event-context":i,children:c.formatMessage({id:"dropdown_menu_multiselect_all"})})}),d.jsx("li",{children:d.jsx(ke,{variant:"tertiary",size:"small",onClick:()=>A("none"),className:"gtm-trackable","data-gtm-event-type":"none-click","data-gtm-event-context":i,children:c.formatMessage({id:"dropdown_menu_multiselect_none"})})})]})]}),d.jsx("ul",{children:t==null?void 0:t.map(S=>{const q=S.id===v.id||(f==null?void 0:f.includes(S))||(f==null?void 0:f.includes(S.id));return d.jsx("li",{"data-testid":"dropdown-options",children:d.jsxs("button",{className:Y("gtm-trackable",{selected:q,"selected-single":q&&!o}),"data-gtm-event-type":`${S.id}-click`,"data-gtm-event-context":i,onClick:$=>{$.preventDefault(),$.stopPropagation(),w(S)},role:"menuitem","aria-current":q,"data-testid":q?"current-selection":"",children:[o&&d.jsx("span",{className:"pretty-checkbox","data-testid":"pretty-checkbox"}),d.jsx("span",{className:Y({"menu-option-label":o}),children:S.label})]})},S.id)})})]}),(l==null?void 0:l.submitSection)&&d.jsx("p",{className:"submit",children:d.jsx(ke,{variant:"secondary",onClick:()=>{k&&k(f),document.dispatchEvent(new CustomEvent("dropdownMultiSelectSubmit",{detail:{id:u||"dropdown-multi-select",value:f}})),p(!1)},children:c.formatMessage({id:"form_submit"})})})]})]})};const qp=({className:e="",functions:t={onChange:()=>{}},intlPath:n=!1,id:r,label:a,multiSelect:i=!1,name:s,options:o,required:l,type:u="checkboxes",value:c,...h})=>{const p=oe.useIntl(),m=i?c:[],g=c;return d.jsx("ul",{...h,className:Y("options-wrapper",e),"data-testid":`ul-${r}`,children:o==null?void 0:o.map(({id:f,label:b=!1,value:v=f,disabled:E=!1})=>{const k=`${r}_${f}`,x=()=>{if(E)return;let w;if(i){const A=m==null?void 0:m.indexOf(v);Array.isArray(m)&&A>=0?(w=m,w.splice(A,1)):(!m||m.length===0?w=[]:w=m,w.push(v))}else w=g===v?void 0:v;t.onChange(w)};return d.jsx(kd,{element:"li",id:k,type:u==="checkboxes"?"checkbox":"radio",shownValue:v,value:i?m==null?void 0:m.includes(v):g===v,functions:{...t,onChange:x},intlPath:n,label:b||p.formatMessage({id:n?`${n}_${f}`:f}),disabled:E},k)})})};const Wp=({inputRef:e,type:t="password",gtm:{context:n}={context:void 0},autoComplete:r="on",...a})=>{const i=oe.useIntl(),s=C.useRef(),o=e||s,[l,u]=C.useState(!1),[c,h]=C.useState(t),p=()=>{var m;u(!l),h(l?"password":"text"),(m=o.current)==null||m.focus()};return d.jsxs(d.Fragment,{children:[d.jsx("button",{type:"button",className:Y("show-password gtm-trackable",{"password-visible":l}),"data-gtm-event-context":n,"data-gtm-event-type":`${l?"hide":"show"}-password-click`,onClick:p,"aria-label":i.formatMessage({id:`showpassword_aria_${l?"hide":"show"}`}),children:i.formatMessage({id:`showpassword_${l?"hide":"show"}`})}),d.jsx(qn,{inputRef:o,type:c,autoComplete:r,...a})]})};const Mn={text:{component:qn},email:{component:qn},url:{component:qn},textarea:{component:qn,props:{element:"textarea",rows:4,cols:10}},checkbox:{component:kd},checkboxes:{component:qp,props:{multiSelect:!0}},select:{component:zp},password:{component:Wp},autocomplete:{component:$p}},Up=({id:e,intlPath:t=!1,className:n="",error:r,functions:a={onChange:()=>{}},limit:i=0,showRequiredLabels:s=!0,type:o,validation:l,value:u,submitOnEnter:c,...h})=>{const p=oe.useIntl(),m=l&&l.some(({condition:N})=>N==="required"),g=Xa(u),f=o&&Mn[o]&&Mn[o].component?Mn[o].component:qn,b=o&&["checkboxes"].includes(o),v=o&&["autocomplete"].includes(o),E=r&&`error-${e}`,k=`character-limit-${e}`,x={};b?x.element="legend":x.htmlFor=e;let w={...h,id:e,name:e,className:r?"error":"",type:o,required:m,"aria-required":m,functions:yn(a),value:u};const A=N=>{w["aria-describedby"]?w["aria-describedby"]+=` ${N}`:w["aria-describedby"]=N};if(i>0){const N=Ed(i,a.onChange);A(`${k}-info`),w={...w,...N},N.functions&&typeof N.functions=="object"&&(w.functions={...w.functions,...N.functions})}o&&Mn[o]&&Mn[o].props&&(w={...w,...Mn[o].props}),b&&(w.intlPath=`${t}_${e}`),r&&(w["aria-invalid"]=!0,w["aria-errormessage"]=E,A(E));const S=h.label||p.formatMessage({id:t?`${t}_${e}`:e}),q=({...N})=>r?C.createElement(N.as||"p",{id:E,className:"error text-small",...N},r):null;if(o&&["checkbox"].includes(o))return d.jsxs(d.Fragment,{children:[d.jsx(f,{...w,label:S,className:Y("field-wrapper",n)}),d.jsx(q,{as:"p"})]});const $=N=>C.createElement(N.element||"label",{...N,className:"checkboxes-label text-small","data-testid":`label-${e}`});return d.jsx(d.Fragment,{children:C.createElement(b?"fieldset":"div",{className:Y("field-wrapper text-medium",n)},d.jsxs(d.Fragment,{children:[C.createElement(b?"div":"p",{className:"field-label"},d.jsx(d.Fragment,{children:d.jsxs($,{...x,children:[S,m&&s&&d.jsxs(d.Fragment,{children:[" ",d.jsxs("small",{children:["(",p.formatMessage({id:"form_fieldWrapper_required"}),")"]})]})]})})),C.createElement(b||v?"div":"p",{className:"field-component"},d.jsxs(d.Fragment,{children:[d.jsx(f,{...w}),d.jsx(ao,{id:k,limit:i,valueLength:g})]})),d.jsx(q,{})]}))})},Hp=(e,t)=>{const{type:n,payload:r}=t,a=e.errors?yn(e.errors):{},i=e.values?yn(e.values):{};switch(n){case"toggleSubmitting":return{...e,isSubmitting:!e.isSubmitting};case"updateValue":if(r!=null&&r.key&&a[r==null?void 0:r.key]&&delete a[r==null?void 0:r.key],r!=null&&r.key){if(["isSubmitting","formSubmitted","errors"].includes(r==null?void 0:r.key))return{...e,errors:a,[r==null?void 0:r.key]:r==null?void 0:r.value};i[r==null?void 0:r.key]=r==null?void 0:r.value}return{...e,errors:a,values:i};case"addError":return r!=null&&r.key&&!a[r==null?void 0:r.key]&&(a[r==null?void 0:r.key]=r==null?void 0:r.value),{...e,errors:a};case"removeError":return r!=null&&r.key&&a[r==null?void 0:r.key]&&delete a[r==null?void 0:r.key],{...e,errors:a};case"submitForm":{const{fields:s=[],dispatch:o=()=>{},onSuccess:l=()=>{},onFailure:u=()=>{},intl:c}=r,h=yn(Object.keys(a));for(const p of s)if(p.validation)for(let m=0;m<p.validation.length;m++){const{condition:g="required",error:f=!1}=p.validation[m];let b=!1;if(typeof g=="function"){const v=g(i);v&&(b=f||v)}else{const v=i[p.id];switch(g){case"required":(!v||typeof v=="string"&&v.trim().length===0)&&(b=f||(c==null?void 0:c.formatMessage({id:"form_error_required"})));break;case"no-numbers":{v&&!/^([^0-9]*)$/.test(v)&&(b=f||(c==null?void 0:c.formatMessage({id:"form_error_numbers"})));break}case"valid-email":{v&&!/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(v)&&(b=f||(c==null?void 0:c.formatMessage({id:"form_error_email"})));break}case"valid-url":{v&&!/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$/.test(v)&&(b=f||(c==null?void 0:c.formatMessage({id:"form_error_url"})));break}default:console.warn("WARNING! No field validation condition has been set")}}if(b){o({type:"addError",payload:{key:p.id,value:b}}),h.push(p.id);break}}return h.length===0?l(i):u(i,h),{...e,isSubmitting:!1}}case"formSubmitted":return{...e,isSubmitting:!1,formSubmitted:!0,errors:{}};case"formSubmittedAndReset":return{isSubmitting:!1,formSubmitted:!0,errors:{}};default:return e}};let wi=null;const Qt=({element:e="form",fields:t,className:n="",id:r=t.length?`form__${t[0].id}`:"form",formRef:a,intlPath:i=!1,button:s={variant:"primary",size:"large",customOnSubmit:!1},secondaryActionButton:o={variant:"secondary",size:"large"},meta:l,children:u,gtm:c={context:"Form",event:"form-submit-click"},functions:h,...p})=>{const{customOnSubmit:m,hideButton:g,overwriteSubmittingText:f=!1,...b}=s,v=40,{shouldShowCancelButton:E=!1,shouldReset:k=!0,shouldHide:x=!0,showRequiredLabels:w=!0,showSuccessMessage:A=!1}=l||{},{onSuccess:S=async()=>{},onCancel:q=()=>{},onCatch:$=()=>{},onFailure:N=()=>{}}=h||{},L=oe.useIntl(),_={};t.length&&t.forEach(z=>{const R=z.id||z.name;R&&(_[R]=z.value||"")});const[B,j]=C.useReducer(Hp,{isSubmitting:!1,formSubmitted:!1,errors:{},values:_}),{errors:I,isSubmitting:G,formSubmitted:V,values:Q}=B;C.useEffect(()=>{k&&V&&(wi=setTimeout(()=>{j({type:"updateValue",payload:{key:"formSubmitted",value:!1}})},3e3))},[V]),C.useEffect(()=>()=>{wi&&clearTimeout(wi)},[]),C.useEffect(()=>{const z=R=>{j({type:"updateValue",payload:{key:R.detail.id,value:R.detail.value}})};return document.addEventListener("dropdownMultiSelectSubmit",z),()=>{document.removeEventListener("dropdownMultiSelectSubmit",z)}},[]);const ae=C.useRef(null),D=a||ae;if(!t.length)return null;let M=b.text;M||(M=s.children||L.formatMessage({id:"form_submit"})),delete b.text;const W=()=>{if(!G){if(j({type:"toggleSubmitting"}),s.disabled){typeof s.disabled=="object"&&s.disabled.isClickable&&j({type:"submitForm",payload:{fields:t,dispatch:j,intl:L}});return}j({type:"submitForm",payload:{fields:t,dispatch:j,onSuccess:async z=>{try{await S(z),j({type:k?"formSubmittedAndReset":"formSubmitted"})}catch(R){$(R),j({type:"updateValue",payload:{key:"isSubmitting",value:!1}})}},onFailure:(z,R)=>{N(z,R),j({type:"updateValue",payload:{key:"isSubmitting",value:!1}})},intl:L}})}},T=[{...b,icon:V?{icon:"tick",position:"left"}:!1,className:"gtm-trackable",onClick:z=>{var re;if(z.preventDefault(),z.stopPropagation(),G)return;let R=0;if((re=D==null?void 0:D.current)!=null&&re.id){const X=document.getElementById(D.current.id);X&&(R=X.getBoundingClientRect().top+window.scrollY)}const H=document.getElementById("header");H&&(R=R-H.offsetHeight-v),R<0&&(R=0),window.scrollTo({top:R,behavior:"smooth"}),W()},disabled:G||V||s.disabled,"data-gtm-event-context":c.context,"data-gtm-event-type":c.event,children:f?M:G||V?L.formatMessage({id:`form_${G?"submitting":"submitted"}`}):M}];return E&&T.unshift({...o,className:"gtm-trackable","data-gtm-event-context":c.context,"data-gtm-event-type":c.event,disabled:G||V,onClick:q,children:o.text||L.formatMessage({id:"form_cancel"})}),d.jsxs(d.Fragment,{children:[C.createElement(e,{...p,id:r,className:Y("form",n),ref:D},d.jsxs(d.Fragment,{children:[I!=null&&I.general?d.jsx(cn,{variant:"error",text:L.formatMessage({id:"form_error_generalError"})}):null,u,(!x||!G&&!V||m)&&t.map((z,R)=>{const{id:H=z.name||R,component:re,functions:X={onChange:()=>{}},submitOnEnter:ne=!1}=z;if(re)return d.jsx(re,{...z.props||{}},`component-${H}-${R}`);const le=(Q==null?void 0:Q[H])||"",ee={...X,onChange:he=>{j({type:"updateValue",payload:{key:H,value:he}}),X.onChange(he&&he.toString(),j)}};return ne&&(ee.onKeyDown=he=>{he.key==="Enter"&&(he.stopPropagation(),he.preventDefault(),W()),X.onKeyDown&&X.onKeyDown(he)}),d.jsx(Up,{intlPath:i,...z,showRequiredLabels:w,value:le,error:I==null?void 0:I[H],functions:ee},H)}),g?null:(G||V)&&m?m:d.jsx(ir,{className:Y("cta",{center:G||V,submitted:V}),buttons:T})]})),A&&V&&d.jsx(Tr,{className:"success",children:typeof A=="string"?A:L.formatMessage({id:"form_success"})})]})};const ta="passwordRules_",Fd="isMoreThanEightCharacters",Bd="includesNumberAndSymbol",Ad="includesLowerAndUppercase",Vp={[Fd]:"8Characters",[Bd]:"numberSymbol",[Ad]:"lowercaseUppercase"},Kp=({matchingRules:e={isMoreThanEightCharacters:!1,includesNumberAndSymbol:!1,includesLowerAndUppercase:!1},className:t=""})=>{const n=oe.useIntl();return d.jsxs("aside",{className:Y("password-rules",t),children:[d.jsx("small",{children:n.formatMessage({id:`${ta}intro`})}),d.jsx("ul",{children:[Fd,Bd,Ad].map(r=>d.jsxs("li",{className:Y({matches:e[r]}),children:[d.jsxs(Ie,{children:[n.formatMessage({id:`${ta}rule_label`})," "]}),d.jsx("span",{children:n.formatMessage({id:`${ta}rule_${Vp[r]}`})}),!e[r]&&d.jsxs(Ie,{element:"strong",children:[" ",n.formatMessage({id:`${ta}notMet`})]})]},`rule-${r}`))})]})},Td=C.memo(Kp);const Zp=({text:e={},topRating:t=5,functions:{createRating:n=()=>null,updateRating:r=()=>{},reportError:a=()=>{}},className:i="",hasLoaded:s=!1})=>{const o=oe.useIntl(),[l,u]=C.useState({setUp:!1,id:null,rating:null,disabled:!0}),c=async()=>{try{const v=await n();u(E=>({...E,setUp:!0,id:v&&v.id,disabled:!1}))}catch(v){u(E=>({...E,setUp:!0,disabled:!0})),a(v)}};if(C.useEffect(()=>{s&&!l.setUp&&c()},[s]),!s)return d.jsx(_t,{className:"rating-placeholder"});const{id:h,rating:p,disabled:m}=l,g="ratings_",f={text:o.formatMessage({id:`${g}text`}),low:o.formatMessage({id:`${g}low`}),high:o.formatMessage({id:`${g}high`}),success:o.formatMessage({id:`${g}success`}),...e},b=async v=>{if(!(!h||m))try{u(E=>({...E,rating:v,disabled:!0})),await r({id:h,value:v})}catch(E){u(k=>({...k,rating:null})),a(E)}finally{u(E=>({...E,disabled:!1}))}};return d.jsxs("div",{className:Y("rating",i),children:[d.jsx("span",{className:"label",children:f[p?"success":"text"]}),d.jsx("ol",{children:Array.from(new Array(t).keys()).map(v=>{const E=v+1;return d.jsx("li",{className:Y({selected:p&&E<=p}),children:d.jsx(ke,{variant:"tertiary",size:"small",icon:{icon:`star${!p||E>p?"_empty":""}`,position:"left",hover:"star"},screenreaderText:`${o.formatMessage({id:`${g}stars`},{number:E,total:t})}${E===1||E===t?` - ${f[E===1?"low":"high"]}`:""}`,onClick:k=>{k.preventDefault(),k.stopPropagation(),b(E)},disabled:m})},`rating-${E}`)})})]})};function Yp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}function Cs(e,t){return Array(t+1).join(e)}function Gp(e){return e.replace(/^\n*/,"")}function Qp(e){for(var t=e.length;t>0&&e[t-1]===`
65
+ `;)t--;return e.substring(0,t)}var Jp=["ADDRESS","ARTICLE","ASIDE","AUDIO","BLOCKQUOTE","BODY","CANVAS","CENTER","DD","DIR","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","FRAMESET","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","HTML","ISINDEX","LI","MAIN","MENU","NAV","NOFRAMES","NOSCRIPT","OL","OUTPUT","P","PRE","SECTION","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR","UL"];function io(e){return so(e,Jp)}var Sd=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];function jd(e){return so(e,Sd)}function Xp(e){return Pd(e,Sd)}var Od=["A","TABLE","THEAD","TBODY","TFOOT","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"];function eg(e){return so(e,Od)}function tg(e){return Pd(e,Od)}function so(e,t){return t.indexOf(e.nodeName)>=0}function Pd(e,t){return e.getElementsByTagName&&t.some(function(n){return e.getElementsByTagName(n).length})}var rt={};rt.paragraph={filter:"p",replacement:function(e){return`
66
66
 
67
67
  `+e+`
68
68
 
69
- `}};at.lineBreak={filter:"br",replacement:function(e,t,n){return n.br+`
70
- `}};at.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(e,t,n){var r=Number(t.nodeName.charAt(1));if(n.headingStyle==="setext"&&r<3){var a=Cs(r===1?"=":"-",e.length);return`
69
+ `}};rt.lineBreak={filter:"br",replacement:function(e,t,n){return n.br+`
70
+ `}};rt.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(e,t,n){var r=Number(t.nodeName.charAt(1));if(n.headingStyle==="setext"&&r<3){var a=Cs(r===1?"=":"-",e.length);return`
71
71
 
72
72
  `+e+`
73
73
  `+a+`
@@ -76,40 +76,40 @@ ${mr(t,"mailto",n)}&src=email`)}`},{key:"clipboard-copy",icon:"share_copy-link",
76
76
 
77
77
  `+Cs("#",r)+" "+e+`
78
78
 
79
- `}};at.blockquote={filter:"blockquote",replacement:function(e){return e=e.replace(/^\n+|\n+$/g,""),e=e.replace(/^/gm,"> "),`
79
+ `}};rt.blockquote={filter:"blockquote",replacement:function(e){return e=e.replace(/^\n+|\n+$/g,""),e=e.replace(/^/gm,"> "),`
80
80
 
81
81
  `+e+`
82
82
 
83
- `}};at.list={filter:["ul","ol"],replacement:function(e,t){var n=t.parentNode;return n.nodeName==="LI"&&n.lastElementChild===t?`
83
+ `}};rt.list={filter:["ul","ol"],replacement:function(e,t){var n=t.parentNode;return n.nodeName==="LI"&&n.lastElementChild===t?`
84
84
  `+e:`
85
85
 
86
86
  `+e+`
87
87
 
88
- `}};at.listItem={filter:"li",replacement:function(e,t,n){e=e.replace(/^\n+/,"").replace(/\n+$/,`
88
+ `}};rt.listItem={filter:"li",replacement:function(e,t,n){e=e.replace(/^\n+/,"").replace(/\n+$/,`
89
89
  `).replace(/\n/gm,`
90
90
  `);var r=n.bulletListMarker+" ",a=t.parentNode;if(a.nodeName==="OL"){var i=a.getAttribute("start"),s=Array.prototype.indexOf.call(a.children,t);r=(i?Number(i)+s:s+1)+". "}return r+e+(t.nextSibling&&!/\n$/.test(e)?`
91
- `:"")}};at.indentedCodeBlock={filter:function(e,t){return t.codeBlockStyle==="indented"&&e.nodeName==="PRE"&&e.firstChild&&e.firstChild.nodeName==="CODE"},replacement:function(e,t,n){return`
91
+ `:"")}};rt.indentedCodeBlock={filter:function(e,t){return t.codeBlockStyle==="indented"&&e.nodeName==="PRE"&&e.firstChild&&e.firstChild.nodeName==="CODE"},replacement:function(e,t,n){return`
92
92
 
93
93
  `+t.firstChild.textContent.replace(/\n/g,`
94
94
  `)+`
95
95
 
96
- `}};at.fencedCodeBlock={filter:function(e,t){return t.codeBlockStyle==="fenced"&&e.nodeName==="PRE"&&e.firstChild&&e.firstChild.nodeName==="CODE"},replacement:function(e,t,n){for(var r=t.firstChild.getAttribute("class")||"",a=(r.match(/language-(\S+)/)||[null,""])[1],i=t.firstChild.textContent,s=n.fence.charAt(0),o=3,l=new RegExp("^"+s+"{3,}","gm"),u;u=l.exec(i);)u[0].length>=o&&(o=u[0].length+1);var c=Cs(s,o);return`
96
+ `}};rt.fencedCodeBlock={filter:function(e,t){return t.codeBlockStyle==="fenced"&&e.nodeName==="PRE"&&e.firstChild&&e.firstChild.nodeName==="CODE"},replacement:function(e,t,n){for(var r=t.firstChild.getAttribute("class")||"",a=(r.match(/language-(\S+)/)||[null,""])[1],i=t.firstChild.textContent,s=n.fence.charAt(0),o=3,l=new RegExp("^"+s+"{3,}","gm"),u;u=l.exec(i);)u[0].length>=o&&(o=u[0].length+1);var c=Cs(s,o);return`
97
97
 
98
98
  `+c+a+`
99
99
  `+i.replace(/\n$/,"")+`
100
100
  `+c+`
101
101
 
102
- `}};at.horizontalRule={filter:"hr",replacement:function(e,t,n){return`
102
+ `}};rt.horizontalRule={filter:"hr",replacement:function(e,t,n){return`
103
103
 
104
104
  `+n.hr+`
105
105
 
106
- `}};at.inlineLink={filter:function(e,t){return t.linkStyle==="inlined"&&e.nodeName==="A"&&e.getAttribute("href")},replacement:function(e,t){var n=t.getAttribute("href"),r=ja(t.getAttribute("title"));return r&&(r=' "'+r+'"'),"["+e+"]("+n+r+")"}};at.referenceLink={filter:function(e,t){return t.linkStyle==="referenced"&&e.nodeName==="A"&&e.getAttribute("href")},replacement:function(e,t,n){var r=t.getAttribute("href"),a=ja(t.getAttribute("title"));a&&(a=' "'+a+'"');var i,s;switch(n.linkReferenceStyle){case"collapsed":i="["+e+"][]",s="["+e+"]: "+r+a;break;case"shortcut":i="["+e+"]",s="["+e+"]: "+r+a;break;default:var o=this.references.length+1;i="["+e+"]["+o+"]",s="["+o+"]: "+r+a}return this.references.push(s),i},references:[],append:function(e){var t="";return this.references.length&&(t=`
106
+ `}};rt.inlineLink={filter:function(e,t){return t.linkStyle==="inlined"&&e.nodeName==="A"&&e.getAttribute("href")},replacement:function(e,t){var n=t.getAttribute("href"),r=ja(t.getAttribute("title"));return r&&(r=' "'+r+'"'),"["+e+"]("+n+r+")"}};rt.referenceLink={filter:function(e,t){return t.linkStyle==="referenced"&&e.nodeName==="A"&&e.getAttribute("href")},replacement:function(e,t,n){var r=t.getAttribute("href"),a=ja(t.getAttribute("title"));a&&(a=' "'+a+'"');var i,s;switch(n.linkReferenceStyle){case"collapsed":i="["+e+"][]",s="["+e+"]: "+r+a;break;case"shortcut":i="["+e+"]",s="["+e+"]: "+r+a;break;default:var o=this.references.length+1;i="["+e+"]["+o+"]",s="["+o+"]: "+r+a}return this.references.push(s),i},references:[],append:function(e){var t="";return this.references.length&&(t=`
107
107
 
108
108
  `+this.references.join(`
109
109
  `)+`
110
110
 
111
- `,this.references=[]),t}};at.emphasis={filter:["em","i"],replacement:function(e,t,n){return e.trim()?n.emDelimiter+e+n.emDelimiter:""}};at.strong={filter:["strong","b"],replacement:function(e,t,n){return e.trim()?n.strongDelimiter+e+n.strongDelimiter:""}};at.code={filter:function(e){var t=e.previousSibling||e.nextSibling,n=e.parentNode.nodeName==="PRE"&&!t;return e.nodeName==="CODE"&&!n},replacement:function(e){if(!e)return"";e=e.replace(/\r?\n|\r/g," ");for(var t=/^`|^ .*?[^ ].* $|`$/.test(e)?" ":"",n="`",r=e.match(/`+/gm)||[];r.indexOf(n)!==-1;)n=n+"`";return n+t+e+t+n}};at.image={filter:"img",replacement:function(e,t){var n=ja(t.getAttribute("alt")),r=t.getAttribute("src")||"",a=ja(t.getAttribute("title")),i=a?' "'+a+'"':"";return r?"!["+n+"]("+r+i+")":""}};function ja(e){return e?e.replace(/(\n+\s*)+/g,`
112
- `):""}function Md(e){this.options=e,this._keep=[],this._remove=[],this.blankRule={replacement:e.blankReplacement},this.keepReplacement=e.keepReplacement,this.defaultRule={replacement:e.defaultReplacement},this.array=[];for(var t in e.rules)this.array.push(e.rules[t])}Md.prototype={add:function(e,t){this.array.unshift(t)},keep:function(e){this._keep.unshift({filter:e,replacement:this.keepReplacement})},remove:function(e){this._remove.unshift({filter:e,replacement:function(){return""}})},forNode:function(e){if(e.isBlank)return this.blankRule;var t;return(t=Ei(this.array,e,this.options))||(t=Ei(this._keep,e,this.options))||(t=Ei(this._remove,e,this.options))?t:this.defaultRule},forEach:function(e){for(var t=0;t<this.array.length;t++)e(this.array[t],t)}};function Ei(e,t,n){for(var r=0;r<e.length;r++){var a=e[r];if(ig(a,t,n))return a}}function ig(e,t,n){var r=e.filter;if(typeof r=="string"){if(r===t.nodeName.toLowerCase())return!0}else if(Array.isArray(r)){if(r.indexOf(t.nodeName.toLowerCase())>-1)return!0}else if(typeof r=="function"){if(r.call(e,t,n))return!0}else throw new TypeError("`filter` needs to be a string, array, or function")}function sg(e){var t=e.element,n=e.isBlock,r=e.isVoid,a=e.isPre||function(h){return h.nodeName==="PRE"};if(!(!t.firstChild||a(t))){for(var i=null,s=!1,o=null,l=Cu(o,t,a);l!==t;){if(l.nodeType===3||l.nodeType===4){var u=l.data.replace(/[ \r\n\t]+/g," ");if((!i||/ $/.test(i.data))&&!s&&u[0]===" "&&(u=u.substr(1)),!u){l=_i(l);continue}l.data=u,i=l}else if(l.nodeType===1)n(l)||l.nodeName==="BR"?(i&&(i.data=i.data.replace(/ $/,"")),i=null,s=!1):r(l)||a(l)?(i=null,s=!0):i&&(s=!1);else{l=_i(l);continue}var c=Cu(o,l,a);o=l,l=c}i&&(i.data=i.data.replace(/ $/,""),i.data||_i(i))}}function _i(e){var t=e.nextSibling||e.parentNode;return e.parentNode.removeChild(e),t}function Cu(e,t,n){return e&&e.parentNode===t||n(t)?t.nextSibling||t.parentNode:t.firstChild||t.nextSibling||t.parentNode}var oo=typeof window<"u"?window:{};function og(){var e=oo.DOMParser,t=!1;try{new e().parseFromString("","text/html")&&(t=!0)}catch{}return t}function ug(){var e=function(){};return lg()?e.prototype.parseFromString=function(t){var n=new window.ActiveXObject("htmlfile");return n.designMode="on",n.open(),n.write(t),n.close(),n}:e.prototype.parseFromString=function(t){var n=document.implementation.createHTMLDocument("");return n.open(),n.write(t),n.close(),n},e}function lg(){var e=!1;try{document.implementation.createHTMLDocument("").open()}catch{oo.ActiveXObject&&(e=!0)}return e}var cg=og()?oo.DOMParser:ug();function dg(e,t){var n;if(typeof e=="string"){var r=fg().parseFromString('<x-turndown id="turndown-root">'+e+"</x-turndown>","text/html");n=r.getElementById("turndown-root")}else n=e.cloneNode(!0);return sg({element:n,isBlock:io,isVoid:Od,isPre:t.preformattedCode?hg:null}),n}var ki;function fg(){return ki=ki||new cg,ki}function hg(e){return e.nodeName==="PRE"||e.nodeName==="CODE"}function mg(e,t){return e.isBlock=io(e),e.isCode=e.nodeName==="CODE"||e.parentNode.isCode,e.isBlank=pg(e),e.flankingWhitespace=gg(e,t),e}function pg(e){return!Od(e)&&!rg(e)&&/^\s*$/i.test(e.textContent)&&!ng(e)&&!ag(e)}function gg(e,t){if(e.isBlock||t.preformattedCode&&e.isCode)return{leading:"",trailing:""};var n=vg(e.textContent);return n.leadingAscii&&Du("left",e,t)&&(n.leading=n.leadingNonAscii),n.trailingAscii&&Du("right",e,t)&&(n.trailing=n.trailingNonAscii),{leading:n.leading,trailing:n.trailing}}function vg(e){var t=e.match(/^(([ \t\r\n]*)(\s*))(?:(?=\S)[\s\S]*\S)?((\s*?)([ \t\r\n]*))$/);return{leading:t[1],leadingAscii:t[2],leadingNonAscii:t[3],trailing:t[4],trailingNonAscii:t[5],trailingAscii:t[6]}}function Du(e,t,n){var r,a,i;return e==="left"?(r=t.previousSibling,a=/ $/):(r=t.nextSibling,a=/^ /),r&&(r.nodeType===3?i=a.test(r.nodeValue):n.preformattedCode&&r.nodeName==="CODE"?i=!1:r.nodeType===1&&!io(r)&&(i=a.test(r.textContent))),i}var bg=Array.prototype.reduce,yg=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function Sr(e){if(!(this instanceof Sr))return new Sr(e);var t={rules:at,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",preformattedCode:!1,blankReplacement:function(n,r){return r.isBlock?`
111
+ `,this.references=[]),t}};rt.emphasis={filter:["em","i"],replacement:function(e,t,n){return e.trim()?n.emDelimiter+e+n.emDelimiter:""}};rt.strong={filter:["strong","b"],replacement:function(e,t,n){return e.trim()?n.strongDelimiter+e+n.strongDelimiter:""}};rt.code={filter:function(e){var t=e.previousSibling||e.nextSibling,n=e.parentNode.nodeName==="PRE"&&!t;return e.nodeName==="CODE"&&!n},replacement:function(e){if(!e)return"";e=e.replace(/\r?\n|\r/g," ");for(var t=/^`|^ .*?[^ ].* $|`$/.test(e)?" ":"",n="`",r=e.match(/`+/gm)||[];r.indexOf(n)!==-1;)n=n+"`";return n+t+e+t+n}};rt.image={filter:"img",replacement:function(e,t){var n=ja(t.getAttribute("alt")),r=t.getAttribute("src")||"",a=ja(t.getAttribute("title")),i=a?' "'+a+'"':"";return r?"!["+n+"]("+r+i+")":""}};function ja(e){return e?e.replace(/(\n+\s*)+/g,`
112
+ `):""}function Nd(e){this.options=e,this._keep=[],this._remove=[],this.blankRule={replacement:e.blankReplacement},this.keepReplacement=e.keepReplacement,this.defaultRule={replacement:e.defaultReplacement},this.array=[];for(var t in e.rules)this.array.push(e.rules[t])}Nd.prototype={add:function(e,t){this.array.unshift(t)},keep:function(e){this._keep.unshift({filter:e,replacement:this.keepReplacement})},remove:function(e){this._remove.unshift({filter:e,replacement:function(){return""}})},forNode:function(e){if(e.isBlank)return this.blankRule;var t;return(t=Ei(this.array,e,this.options))||(t=Ei(this._keep,e,this.options))||(t=Ei(this._remove,e,this.options))?t:this.defaultRule},forEach:function(e){for(var t=0;t<this.array.length;t++)e(this.array[t],t)}};function Ei(e,t,n){for(var r=0;r<e.length;r++){var a=e[r];if(ng(a,t,n))return a}}function ng(e,t,n){var r=e.filter;if(typeof r=="string"){if(r===t.nodeName.toLowerCase())return!0}else if(Array.isArray(r)){if(r.indexOf(t.nodeName.toLowerCase())>-1)return!0}else if(typeof r=="function"){if(r.call(e,t,n))return!0}else throw new TypeError("`filter` needs to be a string, array, or function")}function rg(e){var t=e.element,n=e.isBlock,r=e.isVoid,a=e.isPre||function(h){return h.nodeName==="PRE"};if(!(!t.firstChild||a(t))){for(var i=null,s=!1,o=null,l=yu(o,t,a);l!==t;){if(l.nodeType===3||l.nodeType===4){var u=l.data.replace(/[ \r\n\t]+/g," ");if((!i||/ $/.test(i.data))&&!s&&u[0]===" "&&(u=u.substr(1)),!u){l=_i(l);continue}l.data=u,i=l}else if(l.nodeType===1)n(l)||l.nodeName==="BR"?(i&&(i.data=i.data.replace(/ $/,"")),i=null,s=!1):r(l)||a(l)?(i=null,s=!0):i&&(s=!1);else{l=_i(l);continue}var c=yu(o,l,a);o=l,l=c}i&&(i.data=i.data.replace(/ $/,""),i.data||_i(i))}}function _i(e){var t=e.nextSibling||e.parentNode;return e.parentNode.removeChild(e),t}function yu(e,t,n){return e&&e.parentNode===t||n(t)?t.nextSibling||t.parentNode:t.firstChild||t.nextSibling||t.parentNode}var oo=typeof window<"u"?window:{};function ag(){var e=oo.DOMParser,t=!1;try{new e().parseFromString("","text/html")&&(t=!0)}catch{}return t}function ig(){var e=function(){};return sg()?e.prototype.parseFromString=function(t){var n=new window.ActiveXObject("htmlfile");return n.designMode="on",n.open(),n.write(t),n.close(),n}:e.prototype.parseFromString=function(t){var n=document.implementation.createHTMLDocument("");return n.open(),n.write(t),n.close(),n},e}function sg(){var e=!1;try{document.implementation.createHTMLDocument("").open()}catch{oo.ActiveXObject&&(e=!0)}return e}var og=ag()?oo.DOMParser:ig();function ug(e,t){var n;if(typeof e=="string"){var r=lg().parseFromString('<x-turndown id="turndown-root">'+e+"</x-turndown>","text/html");n=r.getElementById("turndown-root")}else n=e.cloneNode(!0);return rg({element:n,isBlock:io,isVoid:jd,isPre:t.preformattedCode?cg:null}),n}var ki;function lg(){return ki=ki||new og,ki}function cg(e){return e.nodeName==="PRE"||e.nodeName==="CODE"}function dg(e,t){return e.isBlock=io(e),e.isCode=e.nodeName==="CODE"||e.parentNode.isCode,e.isBlank=fg(e),e.flankingWhitespace=hg(e,t),e}function fg(e){return!jd(e)&&!eg(e)&&/^\s*$/i.test(e.textContent)&&!Xp(e)&&!tg(e)}function hg(e,t){if(e.isBlock||t.preformattedCode&&e.isCode)return{leading:"",trailing:""};var n=mg(e.textContent);return n.leadingAscii&&Cu("left",e,t)&&(n.leading=n.leadingNonAscii),n.trailingAscii&&Cu("right",e,t)&&(n.trailing=n.trailingNonAscii),{leading:n.leading,trailing:n.trailing}}function mg(e){var t=e.match(/^(([ \t\r\n]*)(\s*))(?:(?=\S)[\s\S]*\S)?((\s*?)([ \t\r\n]*))$/);return{leading:t[1],leadingAscii:t[2],leadingNonAscii:t[3],trailing:t[4],trailingNonAscii:t[5],trailingAscii:t[6]}}function Cu(e,t,n){var r,a,i;return e==="left"?(r=t.previousSibling,a=/ $/):(r=t.nextSibling,a=/^ /),r&&(r.nodeType===3?i=a.test(r.nodeValue):n.preformattedCode&&r.nodeName==="CODE"?i=!1:r.nodeType===1&&!io(r)&&(i=a.test(r.textContent))),i}var pg=Array.prototype.reduce,gg=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function Sr(e){if(!(this instanceof Sr))return new Sr(e);var t={rules:rt,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",preformattedCode:!1,blankReplacement:function(n,r){return r.isBlock?`
113
113
 
114
114
  `:""},keepReplacement:function(n,r){return r.isBlock?`
115
115
 
@@ -119,47 +119,47 @@ ${mr(t,"mailto",n)}&src=email`)}`},{key:"clipboard-copy",icon:"share_copy-link",
119
119
 
120
120
  `+n+`
121
121
 
122
- `:n}};this.options=Jp({},t,e),this.rules=new Md(this.options)}Sr.prototype={turndown:function(e){if(!xg(e))throw new TypeError(e+" is not a string, or an element/document/fragment node.");if(e==="")return"";var t=Rd.call(this,new dg(e,this.options));return Cg.call(this,t)},use:function(e){if(Array.isArray(e))for(var t=0;t<e.length;t++)this.use(e[t]);else if(typeof e=="function")e(this);else throw new TypeError("plugin must be a Function or an Array of Functions");return this},addRule:function(e,t){return this.rules.add(e,t),this},keep:function(e){return this.rules.keep(e),this},remove:function(e){return this.rules.remove(e),this},escape:function(e){return yg.reduce(function(t,n){return t.replace(n[0],n[1])},e)}};function Rd(e){var t=this;return bg.call(e.childNodes,function(n,r){r=new mg(r,t.options);var a="";return r.nodeType===3?a=r.isCode?r.nodeValue:t.escape(r.nodeValue):r.nodeType===1&&(a=Dg.call(t,r)),Id(n,a)},"")}function Cg(e){var t=this;return this.rules.forEach(function(n){typeof n.append=="function"&&(e=Id(e,n.append(t.options)))}),e.replace(/^[\t\r\n]+/,"").replace(/[\t\r\n\s]+$/,"")}function Dg(e){var t=this.rules.forNode(e),n=Rd.call(this,e),r=e.flankingWhitespace;return(r.leading||r.trailing)&&(n=n.trim()),r.leading+t.replacement(n,e,this.options)+r.trailing}function Id(e,t){var n=eg(e),r=Xp(t),a=Math.max(e.length-n.length,t.length-r.length),i=`
122
+ `:n}};this.options=Yp({},t,e),this.rules=new Nd(this.options)}Sr.prototype={turndown:function(e){if(!yg(e))throw new TypeError(e+" is not a string, or an element/document/fragment node.");if(e==="")return"";var t=Rd.call(this,new ug(e,this.options));return vg.call(this,t)},use:function(e){if(Array.isArray(e))for(var t=0;t<e.length;t++)this.use(e[t]);else if(typeof e=="function")e(this);else throw new TypeError("plugin must be a Function or an Array of Functions");return this},addRule:function(e,t){return this.rules.add(e,t),this},keep:function(e){return this.rules.keep(e),this},remove:function(e){return this.rules.remove(e),this},escape:function(e){return gg.reduce(function(t,n){return t.replace(n[0],n[1])},e)}};function Rd(e){var t=this;return pg.call(e.childNodes,function(n,r){r=new dg(r,t.options);var a="";return r.nodeType===3?a=r.isCode?r.nodeValue:t.escape(r.nodeValue):r.nodeType===1&&(a=bg.call(t,r)),Md(n,a)},"")}function vg(e){var t=this;return this.rules.forEach(function(n){typeof n.append=="function"&&(e=Md(e,n.append(t.options)))}),e.replace(/^[\t\r\n]+/,"").replace(/[\t\r\n\s]+$/,"")}function bg(e){var t=this.rules.forNode(e),n=Rd.call(this,e),r=e.flankingWhitespace;return(r.leading||r.trailing)&&(n=n.trim()),r.leading+t.replacement(n,e,this.options)+r.trailing}function Md(e,t){var n=Qp(e),r=Gp(t),a=Math.max(e.length-n.length,t.length-r.length),i=`
123
123
 
124
- `.substring(0,a);return n+i+r}function xg(e){return e!=null&&(typeof e=="string"||e.nodeType&&(e.nodeType===1||e.nodeType===9||e.nodeType===11))}/*!
124
+ `.substring(0,a);return n+i+r}function yg(e){return e!=null&&(typeof e=="string"||e.nodeType&&(e.nodeType===1||e.nodeType===9||e.nodeType===11))}/*!
125
125
  * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
126
126
  *
127
127
  * Copyright (c) 2014-2017, Jon Schlinkert.
128
128
  * Released under the MIT License.
129
- */function xu(e){return Object.prototype.toString.call(e)==="[object Object]"}function tt(e){var t,n;return xu(e)===!1?!1:(t=e.constructor,t===void 0?!0:(n=t.prototype,!(xu(n)===!1||n.hasOwnProperty("isPrototypeOf")===!1)))}var $d=Symbol.for("immer-nothing"),wu=Symbol.for("immer-draftable"),bt=Symbol.for("immer-state"),wg=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function ft(e,...t){if(process.env.NODE_ENV!=="production"){const n=wg[e],r=typeof n=="function"?n.apply(null,t):n;throw new Error(`[Immer] ${r}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Xn=Object.getPrototypeOf;function Bn(e){return!!e&&!!e[bt]}function Fn(e){var t;return e?Ld(e)||Array.isArray(e)||!!e[wu]||!!((t=e.constructor)!=null&&t[wu])||ti(e)||ni(e):!1}var Eg=Object.prototype.constructor.toString();function Ld(e){if(!e||typeof e!="object")return!1;const t=Xn(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===Eg}function Oa(e,t){ei(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function ei(e){const t=e[bt];return t?t.type_:Array.isArray(e)?1:ti(e)?2:ni(e)?3:0}function Ds(e,t){return ei(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function zd(e,t,n){const r=ei(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function _g(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function ti(e){return e instanceof Map}function ni(e){return e instanceof Set}function gn(e){return e.copy_||e.base_}function xs(e,t){if(ti(e))return new Map(e);if(ni(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=Ld(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[bt];let a=Reflect.ownKeys(r);for(let i=0;i<a.length;i++){const s=a[i],o=r[s];o.writable===!1&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(r[s]={configurable:!0,writable:!0,enumerable:o.enumerable,value:e[s]})}return Object.create(Xn(e),r)}else{const r=Xn(e);if(r!==null&&n)return{...e};const a=Object.create(r);return Object.assign(a,e)}}function uo(e,t=!1){return ri(e)||Bn(e)||!Fn(e)||(ei(e)>1&&(e.set=e.add=e.clear=e.delete=kg),Object.freeze(e),t&&Object.entries(e).forEach(([n,r])=>uo(r,!0))),e}function kg(){ft(2)}function ri(e){return Object.isFrozen(e)}var Bg={};function An(e){const t=Bg[e];return t||ft(0,e),t}var jr;function qd(){return jr}function Fg(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Eu(e,t){t&&(An("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function ws(e){Es(e),e.drafts_.forEach(Ag),e.drafts_=null}function Es(e){e===jr&&(jr=e.parent_)}function _u(e){return jr=Fg(jr,e)}function Ag(e){const t=e[bt];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function ku(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[bt].modified_&&(ws(t),ft(4)),Fn(e)&&(e=Pa(t,e),t.parent_||Na(t,e)),t.patches_&&An("Patches").generateReplacementPatches_(n[bt].base_,e,t.patches_,t.inversePatches_)):e=Pa(t,n,[]),ws(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==$d?e:void 0}function Pa(e,t,n){if(ri(t))return t;const r=t[bt];if(!r)return Oa(t,(a,i)=>Bu(e,r,t,a,i,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return Na(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const a=r.copy_;let i=a,s=!1;r.type_===3&&(i=new Set(a),a.clear(),s=!0),Oa(i,(o,l)=>Bu(e,r,a,o,l,n,s)),Na(e,a,!1),n&&e.patches_&&An("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function Bu(e,t,n,r,a,i,s){if(process.env.NODE_ENV!=="production"&&a===n&&ft(5),Bn(a)){const o=i&&t&&t.type_!==3&&!Ds(t.assigned_,r)?i.concat(r):void 0,l=Pa(e,a,o);if(zd(n,r,l),Bn(l))e.canAutoFreeze_=!1;else return}else s&&n.add(a);if(Fn(a)&&!ri(a)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Pa(e,a),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,r)&&Na(e,a)}}function Na(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&uo(t,n)}function Tg(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:qd(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let a=r,i=lo;n&&(a=[r],i=Or);const{revoke:s,proxy:o}=Proxy.revocable(a,i);return r.draft_=o,r.revoke_=s,o}var lo={get(e,t){if(t===bt)return e;const n=gn(e);if(!Ds(n,t))return Sg(e,n,t);const r=n[t];return e.finalized_||!Fn(r)?r:r===Bi(e.base_,t)?(Fi(e),e.copy_[t]=ks(r,e)):r},has(e,t){return t in gn(e)},ownKeys(e){return Reflect.ownKeys(gn(e))},set(e,t,n){const r=Wd(gn(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const a=Bi(gn(e),t),i=a==null?void 0:a[bt];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(_g(n,a)&&(n!==void 0||Ds(e.base_,t)))return!0;Fi(e),_s(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return Bi(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Fi(e),_s(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=gn(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){ft(11)},getPrototypeOf(e){return Xn(e.base_)},setPrototypeOf(){ft(12)}},Or={};Oa(lo,(e,t)=>{Or[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Or.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&ft(13),Or.set.call(this,e,t,void 0)};Or.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&ft(14),lo.set.call(this,e[0],t,n,e[0])};function Bi(e,t){const n=e[bt];return(n?gn(n):e)[t]}function Sg(e,t,n){var a;const r=Wd(t,n);return r?"value"in r?r.value:(a=r.get)==null?void 0:a.call(e.draft_):void 0}function Wd(e,t){if(!(t in e))return;let n=Xn(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Xn(n)}}function _s(e){e.modified_||(e.modified_=!0,e.parent_&&_s(e.parent_))}function Fi(e){e.copy_||(e.copy_=xs(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var jg=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const i=n;n=t;const s=this;return function(l=i,...u){return s.produce(l,c=>n.call(this,c,...u))}}typeof n!="function"&&ft(6),r!==void 0&&typeof r!="function"&&ft(7);let a;if(Fn(t)){const i=_u(this),s=ks(t,void 0);let o=!0;try{a=n(s),o=!1}finally{o?ws(i):Es(i)}return Eu(i,r),ku(a,i)}else if(!t||typeof t!="object"){if(a=n(t),a===void 0&&(a=t),a===$d&&(a=void 0),this.autoFreeze_&&uo(a,!0),r){const i=[],s=[];An("Patches").generateReplacementPatches_(t,a,i,s),r(i,s)}return a}else ft(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(s,...o)=>this.produceWithPatches(s,l=>t(l,...o));let r,a;return[this.produce(t,n,(s,o)=>{r=s,a=o}),r,a]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Fn(e)||ft(8),Bn(e)&&(e=Og(e));const t=_u(this),n=ks(e,void 0);return n[bt].isManual_=!0,Es(t),n}finishDraft(e,t){const n=e&&e[bt];(!n||!n.isManual_)&&ft(9);const{scope_:r}=n;return Eu(r,t),ku(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const a=t[n];if(a.path.length===0&&a.op==="replace"){e=a.value;break}}n>-1&&(t=t.slice(n+1));const r=An("Patches").applyPatches_;return Bn(e)?r(e,t):this.produce(e,a=>r(a,t))}};function ks(e,t){const n=ti(e)?An("MapSet").proxyMap_(e,t):ni(e)?An("MapSet").proxySet_(e,t):Tg(e,t);return(t?t.scope_:qd()).drafts_.push(n),n}function Og(e){return Bn(e)||ft(10,e),Ud(e)}function Ud(e){if(!Fn(e)||ri(e))return e;const t=e[bt];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=xs(e,t.scope_.immer_.useStrictShallowCopy_)}else n=xs(e,!0);return Oa(n,(r,a)=>{zd(n,r,Ud(a))}),t&&(t.finalized_=!1),n}var yt=new jg,co=yt.produce;yt.produceWithPatches.bind(yt);yt.setAutoFreeze.bind(yt);yt.setUseStrictShallowCopy.bind(yt);yt.applyPatches.bind(yt);var Fu=yt.createDraft.bind(yt),Au=yt.finishDraft.bind(yt),Pg={transform(e,t){var{current:n,affinity:r}=e;if(n!=null){var a=P.transform(n,t,{affinity:r});e.current=a,a==null&&e.unref()}}},Ng={transform(e,t){var{current:n,affinity:r}=e;if(n!=null){var a=_e.transform(n,t,{affinity:r});e.current=a,a==null&&e.unref()}}},Mg={transform(e,t){var{current:n,affinity:r}=e;if(n!=null){var a=Z.transform(n,t,{affinity:r});e.current=a,a==null&&e.unref()}}},Ma=new WeakMap,Ra=new WeakMap,xr=new WeakMap,Hd=new WeakMap,Tu=new WeakMap,Su=new WeakMap,ju=new WeakMap,P={ancestors(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{reverse:n=!1}=t,r=P.levels(e,t);return n?r=r.slice(1):r=r.slice(0,-1),r},common(e,t){for(var n=[],r=0;r<e.length&&r<t.length;r++){var a=e[r],i=t[r];if(a!==i)break;n.push(a)}return n},compare(e,t){for(var n=Math.min(e.length,t.length),r=0;r<n;r++){if(e[r]<t[r])return-1;if(e[r]>t[r])return 1}return 0},endsAfter(e,t){var n=e.length-1,r=e.slice(0,n),a=t.slice(0,n),i=e[n],s=t[n];return P.equals(r,a)&&i>s},endsAt(e,t){var n=e.length,r=e.slice(0,n),a=t.slice(0,n);return P.equals(r,a)},endsBefore(e,t){var n=e.length-1,r=e.slice(0,n),a=t.slice(0,n),i=e[n],s=t[n];return P.equals(r,a)&&i<s},equals(e,t){return e.length===t.length&&e.every((n,r)=>n===t[r])},hasPrevious(e){return e[e.length-1]>0},isAfter(e,t){return P.compare(e,t)===1},isAncestor(e,t){return e.length<t.length&&P.compare(e,t)===0},isBefore(e,t){return P.compare(e,t)===-1},isChild(e,t){return e.length===t.length+1&&P.compare(e,t)===0},isCommon(e,t){return e.length<=t.length&&P.compare(e,t)===0},isDescendant(e,t){return e.length>t.length&&P.compare(e,t)===0},isParent(e,t){return e.length+1===t.length&&P.compare(e,t)===0},isPath(e){return Array.isArray(e)&&(e.length===0||typeof e[0]=="number")},isSibling(e,t){if(e.length!==t.length)return!1;var n=e.slice(0,-1),r=t.slice(0,-1),a=e[e.length-1],i=t[t.length-1];return a!==i&&P.equals(n,r)},levels(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{reverse:n=!1}=t,r=[],a=0;a<=e.length;a++)r.push(e.slice(0,a));return n&&r.reverse(),r},next(e){if(e.length===0)throw new Error("Cannot get the next path of a root path [".concat(e,"], because it has no next index."));var t=e[e.length-1];return e.slice(0,-1).concat(t+1)},operationCanTransformPath(e){switch(e.type){case"insert_node":case"remove_node":case"merge_node":case"split_node":case"move_node":return!0;default:return!1}},parent(e){if(e.length===0)throw new Error("Cannot get the parent path of the root path [".concat(e,"]."));return e.slice(0,-1)},previous(e){if(e.length===0)throw new Error("Cannot get the previous path of a root path [".concat(e,"], because it has no previous index."));var t=e[e.length-1];if(t<=0)throw new Error("Cannot get the previous path of a first child path [".concat(e,"] because it would result in a negative index."));return e.slice(0,-1).concat(t-1)},relative(e,t){if(!P.isAncestor(t,e)&&!P.equals(e,t))throw new Error("Cannot get the relative path of [".concat(e,"] inside ancestor [").concat(t,"], because it is not above or equal to the path."));return e.slice(t.length)},transform(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!e)return null;var r=[...e],{affinity:a="forward"}=n;if(e.length===0)return r;switch(t.type){case"insert_node":{var{path:i}=t;(P.equals(i,r)||P.endsBefore(i,r)||P.isAncestor(i,r))&&(r[i.length-1]+=1);break}case"remove_node":{var{path:s}=t;if(P.equals(s,r)||P.isAncestor(s,r))return null;P.endsBefore(s,r)&&(r[s.length-1]-=1);break}case"merge_node":{var{path:o,position:l}=t;P.equals(o,r)||P.endsBefore(o,r)?r[o.length-1]-=1:P.isAncestor(o,r)&&(r[o.length-1]-=1,r[o.length]+=l);break}case"split_node":{var{path:u,position:c}=t;if(P.equals(u,r)){if(a==="forward")r[r.length-1]+=1;else if(a!=="backward")return null}else P.endsBefore(u,r)?r[u.length-1]+=1:P.isAncestor(u,r)&&e[u.length]>=c&&(r[u.length-1]+=1,r[u.length]-=c);break}case"move_node":{var{path:h,newPath:p}=t;if(P.equals(h,p))return r;if(P.isAncestor(h,r)||P.equals(h,r)){var m=p.slice();return P.endsBefore(h,p)&&h.length<p.length&&(m[h.length-1]-=1),m.concat(r.slice(h.length))}else P.isSibling(h,p)&&(P.isAncestor(p,r)||P.equals(p,r))?P.endsBefore(h,r)?r[h.length-1]-=1:r[h.length-1]+=1:P.endsBefore(p,r)||P.equals(p,r)||P.isAncestor(p,r)?(P.endsBefore(h,r)&&(r[h.length-1]-=1),r[p.length-1]+=1):P.endsBefore(h,r)&&(P.equals(p,r)&&(r[p.length-1]+=1),r[h.length-1]-=1);break}}return r}};function Pr(e){"@babel/helpers - typeof";return Pr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pr(e)}function Rg(e,t){if(Pr(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Pr(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ig(e){var t=Rg(e,"string");return Pr(t)==="symbol"?t:String(t)}function lt(e,t,n){return t=Ig(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ou(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function pr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ou(Object(n),!0).forEach(function(r){lt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ou(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var $g=(e,t,n)=>{switch(n.type){case"insert_node":{var{path:r,node:a}=n,i=ue.parent(e,r),s=r[r.length-1];if(s>i.children.length)throw new Error('Cannot apply an "insert_node" operation at path ['.concat(r,"] because the destination is past the end of the node."));if(i.children.splice(s,0,a),t)for(var[o,l]of Z.points(t))t[l]=_e.transform(o,n);break}case"insert_text":{var{path:u,offset:c,text:h}=n;if(h.length===0)break;var p=ue.leaf(e,u),m=p.text.slice(0,c),g=p.text.slice(c);if(p.text=m+h+g,t)for(var[f,b]of Z.points(t))t[b]=_e.transform(f,n);break}case"merge_node":{var{path:v}=n,E=ue.get(e,v),k=P.previous(v),x=ue.get(e,k),w=ue.parent(e,v),A=v[v.length-1];if(fe.isText(E)&&fe.isText(x))x.text+=E.text;else if(!fe.isText(E)&&!fe.isText(x))x.children.push(...E.children);else throw new Error('Cannot apply a "merge_node" operation at path ['.concat(v,"] to nodes of different interfaces: ").concat(Xe.stringify(E)," ").concat(Xe.stringify(x)));if(w.children.splice(A,1),t)for(var[S,W]of Z.points(t))t[W]=_e.transform(S,n);break}case"move_node":{var{path:R,newPath:I}=n;if(P.isAncestor(R,I))throw new Error("Cannot move a path [".concat(R,"] to new path [").concat(I,"] because the destination is inside itself."));var N=ue.get(e,R),_=ue.parent(e,R),F=R[R.length-1];_.children.splice(F,1);var j=P.transform(R,n),$=ue.get(e,P.parent(j)),V=j[j.length-1];if($.children.splice(V,0,N),t)for(var[K,Q]of Z.points(t))t[Q]=_e.transform(K,n);break}case"remove_node":{var{path:ae}=n,D=ae[ae.length-1],L=ue.parent(e,ae);if(L.children.splice(D,1),t)for(var[q,B]of Z.points(t)){var T=_e.transform(q,n);if(t!=null&&T!=null)t[B]=T;else{var z=void 0,M=void 0;for(var[H,ne]of ue.texts(e))if(P.compare(ne,ae)===-1)z=[H,ne];else{M=[H,ne];break}var ee=!1;z&&M&&(P.equals(M[1],ae)?ee=!P.hasPrevious(M[1]):ee=P.common(z[1],ae).length<P.common(M[1],ae).length),z&&!ee?(q.path=z[1],q.offset=z[0].text.length):M?(q.path=M[1],q.offset=0):t=null}}break}case"remove_text":{var{path:re,offset:le,text:J}=n;if(J.length===0)break;var he=ue.leaf(e,re),me=he.text.slice(0,le),ve=he.text.slice(le+J.length);if(he.text=me+ve,t)for(var[Ee,Ae]of Z.points(t))t[Ae]=_e.transform(Ee,n);break}case"set_node":{var{path:ze,properties:Se,newProperties:Te}=n;if(ze.length===0)throw new Error("Cannot set properties on the root node!");var Ne=ue.get(e,ze);for(var ke in Te){if(ke==="children"||ke==="text")throw new Error('Cannot set the "'.concat(ke,'" property of nodes!'));var He=Te[ke];He==null?delete Ne[ke]:Ne[ke]=He}for(var ge in Se)Te.hasOwnProperty(ge)||delete Ne[ge];break}case"set_selection":{var{newProperties:U}=n;if(U==null)t=U;else{if(t==null){if(!Z.isRange(U))throw new Error('Cannot apply an incomplete "set_selection" operation properties '.concat(Xe.stringify(U)," when there is no current selection."));t=pr({},U)}for(var ie in U){var pe=U[ie];if(pe==null){if(ie==="anchor"||ie==="focus")throw new Error('Cannot remove the "'.concat(ie,'" selection property'));delete t[ie]}else t[ie]=pe}}break}case"split_node":{var{path:be,position:we,properties:Ke}=n;if(be.length===0)throw new Error('Cannot apply a "split_node" operation at path ['.concat(be,"] because the root node cannot be split."));var Qe=ue.get(e,be),pt=ue.parent(e,be),qt=be[be.length-1],Ft;if(fe.isText(Qe)){var et=Qe.text.slice(0,we),jt=Qe.text.slice(we);Qe.text=et,Ft=pr(pr({},Ke),{},{text:jt})}else{var gt=Qe.children.slice(0,we),li=Qe.children.slice(we);Qe.children=gt,Ft=pr(pr({},Ke),{},{children:li})}if(pt.children.splice(qt+1,0,Ft),t)for(var[ur,Hr]of Z.points(t))t[Hr]=_e.transform(ur,n);break}}return t},Lg={transform(e,t){e.children=Fu(e.children);var n=e.selection&&Fu(e.selection);try{n=$g(e,n,t)}finally{e.children=Au(e.children),n?e.selection=Bn(n)?Au(n):n:e.selection=null}}},zg={insertNodes(e,t,n){e.insertNodes(t,n)},liftNodes(e,t){e.liftNodes(t)},mergeNodes(e,t){e.mergeNodes(t)},moveNodes(e,t){e.moveNodes(t)},removeNodes(e,t){e.removeNodes(t)},setNodes(e,t,n){e.setNodes(t,n)},splitNodes(e,t){e.splitNodes(t)},unsetNodes(e,t,n){e.unsetNodes(t,n)},unwrapNodes(e,t){e.unwrapNodes(t)},wrapNodes(e,t,n){e.wrapNodes(t,n)}},qg={collapse(e,t){e.collapse(t)},deselect(e){e.deselect()},move(e,t){e.move(t)},select(e,t){e.select(t)},setPoint(e,t,n){e.setPoint(t,n)},setSelection(e,t){e.setSelection(t)}},Vd=(e,t)=>{for(var n in e){var r=e[n],a=t[n];if(tt(r)&&tt(a)){if(!Vd(r,a))return!1}else if(Array.isArray(r)&&Array.isArray(a)){if(r.length!==a.length)return!1;for(var i=0;i<r.length;i++)if(r[i]!==a[i])return!1}else if(r!==a)return!1}for(var s in t)if(e[s]===void 0&&t[s]!==void 0)return!1;return!0};function Wg(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,i;for(i=0;i<r.length;i++)a=r[i],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function Zt(e,t){if(e==null)return{};var n=Wg(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var Ug=["anchor","focus"];function Pu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Hg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Pu(Object(n),!0).forEach(function(r){lt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Z={edges(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{reverse:n=!1}=t,{anchor:r,focus:a}=e;return Z.isBackward(e)===n?[r,a]:[a,r]},end(e){var[,t]=Z.edges(e);return t},equals(e,t){return _e.equals(e.anchor,t.anchor)&&_e.equals(e.focus,t.focus)},includes(e,t){if(Z.isRange(t)){if(Z.includes(e,t.anchor)||Z.includes(e,t.focus))return!0;var[n,r]=Z.edges(e),[a,i]=Z.edges(t);return _e.isBefore(n,a)&&_e.isAfter(r,i)}var[s,o]=Z.edges(e),l=!1,u=!1;return _e.isPoint(t)?(l=_e.compare(t,s)>=0,u=_e.compare(t,o)<=0):(l=P.compare(t,s.path)>=0,u=P.compare(t,o.path)<=0),l&&u},intersection(e,t){var n=Zt(e,Ug),[r,a]=Z.edges(e),[i,s]=Z.edges(t),o=_e.isBefore(r,i)?i:r,l=_e.isBefore(a,s)?a:s;return _e.isBefore(l,o)?null:Hg({anchor:o,focus:l},n)},isBackward(e){var{anchor:t,focus:n}=e;return _e.isAfter(t,n)},isCollapsed(e){var{anchor:t,focus:n}=e;return _e.equals(t,n)},isExpanded(e){return!Z.isCollapsed(e)},isForward(e){return!Z.isBackward(e)},isRange(e){return tt(e)&&_e.isPoint(e.anchor)&&_e.isPoint(e.focus)},*points(e){yield[e.anchor,"anchor"],yield[e.focus,"focus"]},start(e){var[t]=Z.edges(e);return t},transform(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return co(e,r=>{if(r===null)return null;var{affinity:a="inward"}=n,i,s;if(a==="inward"){var o=Z.isCollapsed(r);Z.isForward(r)?(i="forward",s=o?i:"backward"):(i="backward",s=o?i:"forward")}else a==="outward"?Z.isForward(r)?(i="backward",s="forward"):(i="forward",s="backward"):(i=a,s=a);var l=_e.transform(r.anchor,t,{affinity:i}),u=_e.transform(r.focus,t,{affinity:s});if(!l||!u)return null;r.anchor=l,r.focus=u})}},Nu=e=>tt(e)&&ue.isNodeList(e.children)&&!C.isEditor(e),de={isAncestor(e){return tt(e)&&ue.isNodeList(e.children)},isElement:Nu,isElementList(e){return Array.isArray(e)&&e.every(t=>de.isElement(t))},isElementProps(e){return e.children!==void 0},isElementType:function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"type";return Nu(t)&&t[r]===n},matches(e,t){for(var n in t)if(n!=="children"&&e[n]!==t[n])return!1;return!0}},Vg=["children"],Kg=["text"],Mu=new WeakMap,ue={ancestor(e,t){var n=ue.get(e,t);if(fe.isText(n))throw new Error("Cannot get the ancestor node at path [".concat(t,"] because it refers to a text node instead: ").concat(Xe.stringify(n)));return n},ancestors(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return function*(){for(var r of P.ancestors(t,n)){var a=ue.ancestor(e,r),i=[a,r];yield i}}()},child(e,t){if(fe.isText(e))throw new Error("Cannot get the child of a text node: ".concat(Xe.stringify(e)));var n=e.children[t];if(n==null)throw new Error("Cannot get child at index `".concat(t,"` in node: ").concat(Xe.stringify(e)));return n},children(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return function*(){for(var{reverse:r=!1}=n,a=ue.ancestor(e,t),{children:i}=a,s=r?i.length-1:0;r?s>=0:s<i.length;){var o=ue.child(a,s),l=t.concat(s);yield[o,l],s=r?s-1:s+1}}()},common(e,t,n){var r=P.common(t,n),a=ue.get(e,r);return[a,r]},descendant(e,t){var n=ue.get(e,t);if(C.isEditor(n))throw new Error("Cannot get the descendant node at path [".concat(t,"] because it refers to the root editor node instead: ").concat(Xe.stringify(n)));return n},descendants(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){for(var[n,r]of ue.nodes(e,t))r.length!==0&&(yield[n,r])}()},elements(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){for(var[n,r]of ue.nodes(e,t))de.isElement(n)&&(yield[n,r])}()},extractProps(e){if(de.isAncestor(e)){var t=Zt(e,Vg);return t}else{var t=Zt(e,Kg);return t}},first(e,t){for(var n=t.slice(),r=ue.get(e,n);r&&!(fe.isText(r)||r.children.length===0);)r=r.children[0],n.push(0);return[r,n]},fragment(e,t){if(fe.isText(e))throw new Error("Cannot get a fragment starting from a root text node: ".concat(Xe.stringify(e)));var n=co({children:e.children},r=>{var[a,i]=Z.edges(t),s=ue.nodes(r,{reverse:!0,pass:p=>{var[,m]=p;return!Z.includes(t,m)}});for(var[,o]of s){if(!Z.includes(t,o)){var l=ue.parent(r,o),u=o[o.length-1];l.children.splice(u,1)}if(P.equals(o,i.path)){var c=ue.leaf(r,o);c.text=c.text.slice(0,i.offset)}if(P.equals(o,a.path)){var h=ue.leaf(r,o);h.text=h.text.slice(a.offset)}}C.isEditor(r)&&(r.selection=null)});return n.children},get(e,t){for(var n=e,r=0;r<t.length;r++){var a=t[r];if(fe.isText(n)||!n.children[a])throw new Error("Cannot find a descendant at path [".concat(t,"] in node: ").concat(Xe.stringify(e)));n=n.children[a]}return n},has(e,t){for(var n=e,r=0;r<t.length;r++){var a=t[r];if(fe.isText(n)||!n.children[a])return!1;n=n.children[a]}return!0},isNode(e){return fe.isText(e)||de.isElement(e)||C.isEditor(e)},isNodeList(e){if(!Array.isArray(e))return!1;var t=Mu.get(e);if(t!==void 0)return t;var n=e.every(r=>ue.isNode(r));return Mu.set(e,n),n},last(e,t){for(var n=t.slice(),r=ue.get(e,n);r&&!(fe.isText(r)||r.children.length===0);){var a=r.children.length-1;r=r.children[a],n.push(a)}return[r,n]},leaf(e,t){var n=ue.get(e,t);if(!fe.isText(n))throw new Error("Cannot get the leaf node at path [".concat(t,"] because it refers to a non-leaf node: ").concat(Xe.stringify(n)));return n},levels(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return function*(){for(var r of P.levels(t,n)){var a=ue.get(e,r);yield[a,r]}}()},matches(e,t){return de.isElement(e)&&de.isElementProps(t)&&de.matches(e,t)||fe.isText(e)&&fe.isTextProps(t)&&fe.matches(e,t)},nodes(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){for(var{pass:n,reverse:r=!1}=t,{from:a=[],to:i}=t,s=new Set,o=[],l=e;!(i&&(r?P.isBefore(o,i):P.isAfter(o,i)));){if(s.has(l)||(yield[l,o]),!s.has(l)&&!fe.isText(l)&&l.children.length!==0&&(n==null||n([l,o])===!1)){s.add(l);var u=r?l.children.length-1:0;P.isAncestor(o,a)&&(u=a[o.length]),o=o.concat(u),l=ue.get(e,o);continue}if(o.length===0)break;if(!r){var c=P.next(o);if(ue.has(e,c)){o=c,l=ue.get(e,o);continue}}if(r&&o[o.length-1]!==0){var h=P.previous(o);o=h,l=ue.get(e,o);continue}o=P.parent(o),l=ue.get(e,o),s.add(l)}}()},parent(e,t){var n=P.parent(t),r=ue.get(e,n);if(fe.isText(r))throw new Error("Cannot get the parent of path [".concat(t,"] because it does not exist in the root."));return r},string(e){return fe.isText(e)?e.text:e.children.map(ue.string).join("")},texts(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){for(var[n,r]of ue.nodes(e,t))fe.isText(n)&&(yield[n,r])}()}};function Ru(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function We(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ru(Object(n),!0).forEach(function(r){lt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ru(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var sn={isNodeOperation(e){return sn.isOperation(e)&&e.type.endsWith("_node")},isOperation(e){if(!tt(e))return!1;switch(e.type){case"insert_node":return P.isPath(e.path)&&ue.isNode(e.node);case"insert_text":return typeof e.offset=="number"&&typeof e.text=="string"&&P.isPath(e.path);case"merge_node":return typeof e.position=="number"&&P.isPath(e.path)&&tt(e.properties);case"move_node":return P.isPath(e.path)&&P.isPath(e.newPath);case"remove_node":return P.isPath(e.path)&&ue.isNode(e.node);case"remove_text":return typeof e.offset=="number"&&typeof e.text=="string"&&P.isPath(e.path);case"set_node":return P.isPath(e.path)&&tt(e.properties)&&tt(e.newProperties);case"set_selection":return e.properties===null&&Z.isRange(e.newProperties)||e.newProperties===null&&Z.isRange(e.properties)||tt(e.properties)&&tt(e.newProperties);case"split_node":return P.isPath(e.path)&&typeof e.position=="number"&&tt(e.properties);default:return!1}},isOperationList(e){return Array.isArray(e)&&e.every(t=>sn.isOperation(t))},isSelectionOperation(e){return sn.isOperation(e)&&e.type.endsWith("_selection")},isTextOperation(e){return sn.isOperation(e)&&e.type.endsWith("_text")},inverse(e){switch(e.type){case"insert_node":return We(We({},e),{},{type:"remove_node"});case"insert_text":return We(We({},e),{},{type:"remove_text"});case"merge_node":return We(We({},e),{},{type:"split_node",path:P.previous(e.path)});case"move_node":{var{newPath:t,path:n}=e;if(P.equals(t,n))return e;if(P.isSibling(n,t))return We(We({},e),{},{path:t,newPath:n});var r=P.transform(n,e),a=P.transform(P.next(n),e);return We(We({},e),{},{path:r,newPath:a})}case"remove_node":return We(We({},e),{},{type:"insert_node"});case"remove_text":return We(We({},e),{},{type:"insert_text"});case"set_node":{var{properties:i,newProperties:s}=e;return We(We({},e),{},{properties:s,newProperties:i})}case"set_selection":{var{properties:o,newProperties:l}=e;return o==null?We(We({},e),{},{properties:l,newProperties:null}):l==null?We(We({},e),{},{properties:null,newProperties:o}):We(We({},e),{},{properties:l,newProperties:o})}case"split_node":return We(We({},e),{},{type:"merge_node",path:P.next(e.path)})}}},Iu=new WeakMap,Zg=e=>{var t=Iu.get(e);if(t!==void 0)return t;if(!tt(e))return!1;var n=typeof e.addMark=="function"&&typeof e.apply=="function"&&typeof e.deleteFragment=="function"&&typeof e.insertBreak=="function"&&typeof e.insertSoftBreak=="function"&&typeof e.insertFragment=="function"&&typeof e.insertNode=="function"&&typeof e.insertText=="function"&&typeof e.isElementReadOnly=="function"&&typeof e.isInline=="function"&&typeof e.isSelectable=="function"&&typeof e.isVoid=="function"&&typeof e.normalizeNode=="function"&&typeof e.onChange=="function"&&typeof e.removeMark=="function"&&typeof e.getDirtyPaths=="function"&&(e.marks===null||tt(e.marks))&&(e.selection===null||Z.isRange(e.selection))&&ue.isNodeList(e.children)&&sn.isOperationList(e.operations);return Iu.set(e,n),n},C={above(e,t){return e.above(t)},addMark(e,t,n){e.addMark(t,n)},after(e,t,n){return e.after(t,n)},before(e,t,n){return e.before(t,n)},deleteBackward(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{unit:n="character"}=t;e.deleteBackward(n)},deleteForward(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{unit:n="character"}=t;e.deleteForward(n)},deleteFragment(e,t){e.deleteFragment(t)},edges(e,t){return e.edges(t)},elementReadOnly(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return e.elementReadOnly(t)},end(e,t){return e.end(t)},first(e,t){return e.first(t)},fragment(e,t){return e.fragment(t)},hasBlocks(e,t){return e.hasBlocks(t)},hasInlines(e,t){return e.hasInlines(t)},hasPath(e,t){return e.hasPath(t)},hasTexts(e,t){return e.hasTexts(t)},insertBreak(e){e.insertBreak()},insertFragment(e,t,n){e.insertFragment(t,n)},insertNode(e,t){e.insertNode(t)},insertSoftBreak(e){e.insertSoftBreak()},insertText(e,t){e.insertText(t)},isBlock(e,t){return e.isBlock(t)},isEdge(e,t,n){return e.isEdge(t,n)},isEditor(e){return Zg(e)},isElementReadOnly(e,t){return e.isElementReadOnly(t)},isEmpty(e,t){return e.isEmpty(t)},isEnd(e,t,n){return e.isEnd(t,n)},isInline(e,t){return e.isInline(t)},isNormalizing(e){return e.isNormalizing()},isSelectable(e,t){return e.isSelectable(t)},isStart(e,t,n){return e.isStart(t,n)},isVoid(e,t){return e.isVoid(t)},last(e,t){return e.last(t)},leaf(e,t,n){return e.leaf(t,n)},levels(e,t){return e.levels(t)},marks(e){return e.getMarks()},next(e,t){return e.next(t)},node(e,t,n){return e.node(t,n)},nodes(e,t){return e.nodes(t)},normalize(e,t){e.normalize(t)},parent(e,t,n){return e.parent(t,n)},path(e,t,n){return e.path(t,n)},pathRef(e,t,n){return e.pathRef(t,n)},pathRefs(e){return e.pathRefs()},point(e,t,n){return e.point(t,n)},pointRef(e,t,n){return e.pointRef(t,n)},pointRefs(e){return e.pointRefs()},positions(e,t){return e.positions(t)},previous(e,t){return e.previous(t)},range(e,t,n){return e.range(t,n)},rangeRef(e,t,n){return e.rangeRef(t,n)},rangeRefs(e){return e.rangeRefs()},removeMark(e,t){e.removeMark(t)},setNormalizing(e,t){e.setNormalizing(t)},start(e,t){return e.start(t)},string(e,t,n){return e.string(t,n)},unhangRange(e,t,n){return e.unhangRange(t,n)},void(e,t){return e.void(t)},withoutNormalizing(e,t){e.withoutNormalizing(t)}},Yg={isSpan(e){return Array.isArray(e)&&e.length===2&&e.every(P.isPath)}};function $u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Lu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$u(Object(n),!0).forEach(function(r){lt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$u(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var _e={compare(e,t){var n=P.compare(e.path,t.path);return n===0?e.offset<t.offset?-1:e.offset>t.offset?1:0:n},isAfter(e,t){return _e.compare(e,t)===1},isBefore(e,t){return _e.compare(e,t)===-1},equals(e,t){return e.offset===t.offset&&P.equals(e.path,t.path)},isPoint(e){return tt(e)&&typeof e.offset=="number"&&P.isPath(e.path)},transform(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return co(e,r=>{if(r===null)return null;var{affinity:a="forward"}=n,{path:i,offset:s}=r;switch(t.type){case"insert_node":case"move_node":{r.path=P.transform(i,t,n);break}case"insert_text":{P.equals(t.path,i)&&(t.offset<s||t.offset===s&&a==="forward")&&(r.offset+=t.text.length);break}case"merge_node":{P.equals(t.path,i)&&(r.offset+=t.position),r.path=P.transform(i,t,n);break}case"remove_text":{P.equals(t.path,i)&&t.offset<=s&&(r.offset-=Math.min(s-t.offset,t.text.length));break}case"remove_node":{if(P.equals(t.path,i)||P.isAncestor(t.path,i))return null;r.path=P.transform(i,t,n);break}case"split_node":{if(P.equals(t.path,i)){if(t.position===s&&a==null)return null;(t.position<s||t.position===s&&a==="forward")&&(r.offset-=t.position,r.path=P.transform(i,t,Lu(Lu({},n),{},{affinity:"forward"})))}else r.path=P.transform(i,t,n);break}}})}},zu=void 0,Xe={setScrubber(e){zu=e},stringify(e){return JSON.stringify(e,zu)}},Gg=["text"],Qg=["anchor","focus"];function qu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Ut(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qu(Object(n),!0).forEach(function(r){lt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var fe={equals(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{loose:r=!1}=n;function a(i){var s=Zt(i,Gg);return s}return Vd(r?a(e):e,r?a(t):t)},isText(e){return tt(e)&&typeof e.text=="string"},isTextList(e){return Array.isArray(e)&&e.every(t=>fe.isText(t))},isTextProps(e){return e.text!==void 0},matches(e,t){for(var n in t)if(n!=="text"&&(!e.hasOwnProperty(n)||e[n]!==t[n]))return!1;return!0},decorations(e,t){var n=[Ut({},e)];for(var r of t){var a=Zt(r,Qg),[i,s]=Z.edges(r),o=[],l=0,u=i.offset,c=s.offset;for(var h of n){var{length:p}=h.text,m=l;if(l+=p,u<=m&&l<=c){Object.assign(h,a),o.push(h);continue}if(u!==c&&(u===l||c===m)||u>l||c<m||c===m&&m!==0){o.push(h);continue}var g=h,f=void 0,b=void 0;if(c<l){var v=c-m;b=Ut(Ut({},g),{},{text:g.text.slice(v)}),g=Ut(Ut({},g),{},{text:g.text.slice(0,v)})}if(u>m){var E=u-m;f=Ut(Ut({},g),{},{text:g.text.slice(0,E)}),g=Ut(Ut({},g),{},{text:g.text.slice(E)})}Object.assign(g,a),f&&o.push(f),o.push(g),b&&o.push(b)}n=o}return n}},fo=e=>e.selection?e.selection:e.children.length>0?C.end(e,[]):[0],or=(e,t)=>{var[n]=C.node(e,t);return r=>r===n},ho=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=!n,a=n?rv(t):t,i=xe.None,s=xe.None,o=0,l=null,u=null;for(var c of a){var h=c.codePointAt(0);if(!h)break;var p=pv(c,h);if([i,s]=r?[s,p]:[p,i],Wn(i,xe.ZWJ)&&Wn(s,xe.ExtPict)&&(r?l=Wu(t.substring(0,o)):l=Wu(t.substring(0,t.length-o)),!l)||Wn(i,xe.RI)&&Wn(s,xe.RI)&&(u!==null?u=!u:r?u=!0:u=Cv(t.substring(0,t.length-o)),!u)||i!==xe.None&&s!==xe.None&&vv(i,s))break;o+=c.length}return o||1},Jg=/\s/,Xg=/[\u002B\u0021-\u0023\u0025-\u002A\u002C-\u002F\u003A\u003B\u003F\u0040\u005B-\u005D\u005F\u007B\u007D\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E3B\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/,ev=/['\u2018\u2019]/,tv=function(t){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=0,a=!1;t.length>0;){var i=ho(t,n),[s,o]=mo(t,i,n);if(nv(s,o,n))a=!0,r+=i;else if(!a)r+=i;else break;t=o}return r},mo=(e,t,n)=>{if(n){var r=e.length-t;return[e.slice(r,e.length),e.slice(0,r)]}return[e.slice(0,t),e.slice(t)]},nv=function e(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(Jg.test(t))return!1;if(ev.test(t)){var a=ho(n,r),[i,s]=mo(n,a,r);if(e(i,s,r))return!0}return!Xg.test(t)},rv=function*(t){for(var n=t.length-1,r=0;r<t.length;r++){var a=t.charAt(n-r);if(iv(a.charCodeAt(0))){var i=t.charAt(n-r-1);if(av(i.charCodeAt(0))){yield i+a,r++;continue}}yield a}},av=e=>e>=55296&&e<=56319,iv=e=>e>=56320&&e<=57343,xe;(function(e){e[e.None=0]="None",e[e.Extend=1]="Extend",e[e.ZWJ=2]="ZWJ",e[e.RI=4]="RI",e[e.Prepend=8]="Prepend",e[e.SpacingMark=16]="SpacingMark",e[e.L=32]="L",e[e.V=64]="V",e[e.T=128]="T",e[e.LV=256]="LV",e[e.LVT=512]="LVT",e[e.ExtPict=1024]="ExtPict",e[e.Any=2048]="Any"})(xe||(xe={}));var sv=/^(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC01\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDE41\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4\uDF00\uDF01\uDF36-\uDF3A\uDF40\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])$/,ov=/^(?:[\u0600-\u0605\u06DD\u070F\u0890\u0891\u08E2\u0D4E]|\uD804[\uDCBD\uDCCD\uDDC2\uDDC3]|\uD806[\uDD3F\uDD41\uDE3A\uDE84-\uDE89]|\uD807\uDD46)$/,uv=/^(?:[\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E\u094F\u0982\u0983\u09BF\u09C0\u09C7\u09C8\u09CB\u09CC\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB\u0ACC\u0B02\u0B03\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0C01-\u0C03\u0C41-\u0C44\u0C82\u0C83\u0CBE\u0CC0\u0CC1\u0CC3\u0CC4\u0CC7\u0CC8\u0CCA\u0CCB\u0D02\u0D03\u0D3F\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D82\u0D83\u0DD0\u0DD1\u0DD8-\u0DDE\u0DF2\u0DF3\u0E33\u0EB3\u0F3E\u0F3F\u0F7F\u1031\u103B\u103C\u1056\u1057\u1084\u1715\u1734\u17B6\u17BE-\u17C5\u17C7\u17C8\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1A19\u1A1A\u1A55\u1A57\u1A6D-\u1A72\u1B04\u1B3B\u1B3D-\u1B41\u1B43\u1B44\u1B82\u1BA1\u1BA6\u1BA7\u1BAA\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1C24-\u1C2B\u1C34\u1C35\u1CE1\u1CF7\uA823\uA824\uA827\uA880\uA881\uA8B4-\uA8C3\uA952\uA953\uA983\uA9B4\uA9B5\uA9BA\uA9BB\uA9BE-\uA9C0\uAA2F\uAA30\uAA33\uAA34\uAA4D\uAAEB\uAAEE\uAAEF\uAAF5\uABE3\uABE4\uABE6\uABE7\uABE9\uABEA\uABEC]|\uD804[\uDC00\uDC02\uDC82\uDCB0-\uDCB2\uDCB7\uDCB8\uDD2C\uDD45\uDD46\uDD82\uDDB3-\uDDB5\uDDBF\uDDC0\uDDCE\uDE2C-\uDE2E\uDE32\uDE33\uDE35\uDEE0-\uDEE2\uDF02\uDF03\uDF3F\uDF41-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF62\uDF63]|\uD805[\uDC35-\uDC37\uDC40\uDC41\uDC45\uDCB1\uDCB2\uDCB9\uDCBB\uDCBC\uDCBE\uDCC1\uDDB0\uDDB1\uDDB8-\uDDBB\uDDBE\uDE30-\uDE32\uDE3B\uDE3C\uDE3E\uDEAC\uDEAE\uDEAF\uDEB6\uDF26]|\uD806[\uDC2C-\uDC2E\uDC38\uDD31-\uDD35\uDD37\uDD38\uDD3D\uDD40\uDD42\uDDD1-\uDDD3\uDDDC-\uDDDF\uDDE4\uDE39\uDE57\uDE58\uDE97]|\uD807[\uDC2F\uDC3E\uDCA9\uDCB1\uDCB4\uDD8A-\uDD8E\uDD93\uDD94\uDD96\uDEF5\uDEF6]|\uD81B[\uDF51-\uDF87\uDFF0\uDFF1]|\uD834[\uDD66\uDD6D])$/,lv=/^[\u1100-\u115F\uA960-\uA97C]$/,cv=/^[\u1160-\u11A7\uD7B0-\uD7C6]$/,dv=/^[\u11A8-\u11FF\uD7CB-\uD7FB]$/,fv=/^[\uAC00\uAC1C\uAC38\uAC54\uAC70\uAC8C\uACA8\uACC4\uACE0\uACFC\uAD18\uAD34\uAD50\uAD6C\uAD88\uADA4\uADC0\uADDC\uADF8\uAE14\uAE30\uAE4C\uAE68\uAE84\uAEA0\uAEBC\uAED8\uAEF4\uAF10\uAF2C\uAF48\uAF64\uAF80\uAF9C\uAFB8\uAFD4\uAFF0\uB00C\uB028\uB044\uB060\uB07C\uB098\uB0B4\uB0D0\uB0EC\uB108\uB124\uB140\uB15C\uB178\uB194\uB1B0\uB1CC\uB1E8\uB204\uB220\uB23C\uB258\uB274\uB290\uB2AC\uB2C8\uB2E4\uB300\uB31C\uB338\uB354\uB370\uB38C\uB3A8\uB3C4\uB3E0\uB3FC\uB418\uB434\uB450\uB46C\uB488\uB4A4\uB4C0\uB4DC\uB4F8\uB514\uB530\uB54C\uB568\uB584\uB5A0\uB5BC\uB5D8\uB5F4\uB610\uB62C\uB648\uB664\uB680\uB69C\uB6B8\uB6D4\uB6F0\uB70C\uB728\uB744\uB760\uB77C\uB798\uB7B4\uB7D0\uB7EC\uB808\uB824\uB840\uB85C\uB878\uB894\uB8B0\uB8CC\uB8E8\uB904\uB920\uB93C\uB958\uB974\uB990\uB9AC\uB9C8\uB9E4\uBA00\uBA1C\uBA38\uBA54\uBA70\uBA8C\uBAA8\uBAC4\uBAE0\uBAFC\uBB18\uBB34\uBB50\uBB6C\uBB88\uBBA4\uBBC0\uBBDC\uBBF8\uBC14\uBC30\uBC4C\uBC68\uBC84\uBCA0\uBCBC\uBCD8\uBCF4\uBD10\uBD2C\uBD48\uBD64\uBD80\uBD9C\uBDB8\uBDD4\uBDF0\uBE0C\uBE28\uBE44\uBE60\uBE7C\uBE98\uBEB4\uBED0\uBEEC\uBF08\uBF24\uBF40\uBF5C\uBF78\uBF94\uBFB0\uBFCC\uBFE8\uC004\uC020\uC03C\uC058\uC074\uC090\uC0AC\uC0C8\uC0E4\uC100\uC11C\uC138\uC154\uC170\uC18C\uC1A8\uC1C4\uC1E0\uC1FC\uC218\uC234\uC250\uC26C\uC288\uC2A4\uC2C0\uC2DC\uC2F8\uC314\uC330\uC34C\uC368\uC384\uC3A0\uC3BC\uC3D8\uC3F4\uC410\uC42C\uC448\uC464\uC480\uC49C\uC4B8\uC4D4\uC4F0\uC50C\uC528\uC544\uC560\uC57C\uC598\uC5B4\uC5D0\uC5EC\uC608\uC624\uC640\uC65C\uC678\uC694\uC6B0\uC6CC\uC6E8\uC704\uC720\uC73C\uC758\uC774\uC790\uC7AC\uC7C8\uC7E4\uC800\uC81C\uC838\uC854\uC870\uC88C\uC8A8\uC8C4\uC8E0\uC8FC\uC918\uC934\uC950\uC96C\uC988\uC9A4\uC9C0\uC9DC\uC9F8\uCA14\uCA30\uCA4C\uCA68\uCA84\uCAA0\uCABC\uCAD8\uCAF4\uCB10\uCB2C\uCB48\uCB64\uCB80\uCB9C\uCBB8\uCBD4\uCBF0\uCC0C\uCC28\uCC44\uCC60\uCC7C\uCC98\uCCB4\uCCD0\uCCEC\uCD08\uCD24\uCD40\uCD5C\uCD78\uCD94\uCDB0\uCDCC\uCDE8\uCE04\uCE20\uCE3C\uCE58\uCE74\uCE90\uCEAC\uCEC8\uCEE4\uCF00\uCF1C\uCF38\uCF54\uCF70\uCF8C\uCFA8\uCFC4\uCFE0\uCFFC\uD018\uD034\uD050\uD06C\uD088\uD0A4\uD0C0\uD0DC\uD0F8\uD114\uD130\uD14C\uD168\uD184\uD1A0\uD1BC\uD1D8\uD1F4\uD210\uD22C\uD248\uD264\uD280\uD29C\uD2B8\uD2D4\uD2F0\uD30C\uD328\uD344\uD360\uD37C\uD398\uD3B4\uD3D0\uD3EC\uD408\uD424\uD440\uD45C\uD478\uD494\uD4B0\uD4CC\uD4E8\uD504\uD520\uD53C\uD558\uD574\uD590\uD5AC\uD5C8\uD5E4\uD600\uD61C\uD638\uD654\uD670\uD68C\uD6A8\uD6C4\uD6E0\uD6FC\uD718\uD734\uD750\uD76C\uD788]$/,hv=/^[\uAC01-\uAC1B\uAC1D-\uAC37\uAC39-\uAC53\uAC55-\uAC6F\uAC71-\uAC8B\uAC8D-\uACA7\uACA9-\uACC3\uACC5-\uACDF\uACE1-\uACFB\uACFD-\uAD17\uAD19-\uAD33\uAD35-\uAD4F\uAD51-\uAD6B\uAD6D-\uAD87\uAD89-\uADA3\uADA5-\uADBF\uADC1-\uADDB\uADDD-\uADF7\uADF9-\uAE13\uAE15-\uAE2F\uAE31-\uAE4B\uAE4D-\uAE67\uAE69-\uAE83\uAE85-\uAE9F\uAEA1-\uAEBB\uAEBD-\uAED7\uAED9-\uAEF3\uAEF5-\uAF0F\uAF11-\uAF2B\uAF2D-\uAF47\uAF49-\uAF63\uAF65-\uAF7F\uAF81-\uAF9B\uAF9D-\uAFB7\uAFB9-\uAFD3\uAFD5-\uAFEF\uAFF1-\uB00B\uB00D-\uB027\uB029-\uB043\uB045-\uB05F\uB061-\uB07B\uB07D-\uB097\uB099-\uB0B3\uB0B5-\uB0CF\uB0D1-\uB0EB\uB0ED-\uB107\uB109-\uB123\uB125-\uB13F\uB141-\uB15B\uB15D-\uB177\uB179-\uB193\uB195-\uB1AF\uB1B1-\uB1CB\uB1CD-\uB1E7\uB1E9-\uB203\uB205-\uB21F\uB221-\uB23B\uB23D-\uB257\uB259-\uB273\uB275-\uB28F\uB291-\uB2AB\uB2AD-\uB2C7\uB2C9-\uB2E3\uB2E5-\uB2FF\uB301-\uB31B\uB31D-\uB337\uB339-\uB353\uB355-\uB36F\uB371-\uB38B\uB38D-\uB3A7\uB3A9-\uB3C3\uB3C5-\uB3DF\uB3E1-\uB3FB\uB3FD-\uB417\uB419-\uB433\uB435-\uB44F\uB451-\uB46B\uB46D-\uB487\uB489-\uB4A3\uB4A5-\uB4BF\uB4C1-\uB4DB\uB4DD-\uB4F7\uB4F9-\uB513\uB515-\uB52F\uB531-\uB54B\uB54D-\uB567\uB569-\uB583\uB585-\uB59F\uB5A1-\uB5BB\uB5BD-\uB5D7\uB5D9-\uB5F3\uB5F5-\uB60F\uB611-\uB62B\uB62D-\uB647\uB649-\uB663\uB665-\uB67F\uB681-\uB69B\uB69D-\uB6B7\uB6B9-\uB6D3\uB6D5-\uB6EF\uB6F1-\uB70B\uB70D-\uB727\uB729-\uB743\uB745-\uB75F\uB761-\uB77B\uB77D-\uB797\uB799-\uB7B3\uB7B5-\uB7CF\uB7D1-\uB7EB\uB7ED-\uB807\uB809-\uB823\uB825-\uB83F\uB841-\uB85B\uB85D-\uB877\uB879-\uB893\uB895-\uB8AF\uB8B1-\uB8CB\uB8CD-\uB8E7\uB8E9-\uB903\uB905-\uB91F\uB921-\uB93B\uB93D-\uB957\uB959-\uB973\uB975-\uB98F\uB991-\uB9AB\uB9AD-\uB9C7\uB9C9-\uB9E3\uB9E5-\uB9FF\uBA01-\uBA1B\uBA1D-\uBA37\uBA39-\uBA53\uBA55-\uBA6F\uBA71-\uBA8B\uBA8D-\uBAA7\uBAA9-\uBAC3\uBAC5-\uBADF\uBAE1-\uBAFB\uBAFD-\uBB17\uBB19-\uBB33\uBB35-\uBB4F\uBB51-\uBB6B\uBB6D-\uBB87\uBB89-\uBBA3\uBBA5-\uBBBF\uBBC1-\uBBDB\uBBDD-\uBBF7\uBBF9-\uBC13\uBC15-\uBC2F\uBC31-\uBC4B\uBC4D-\uBC67\uBC69-\uBC83\uBC85-\uBC9F\uBCA1-\uBCBB\uBCBD-\uBCD7\uBCD9-\uBCF3\uBCF5-\uBD0F\uBD11-\uBD2B\uBD2D-\uBD47\uBD49-\uBD63\uBD65-\uBD7F\uBD81-\uBD9B\uBD9D-\uBDB7\uBDB9-\uBDD3\uBDD5-\uBDEF\uBDF1-\uBE0B\uBE0D-\uBE27\uBE29-\uBE43\uBE45-\uBE5F\uBE61-\uBE7B\uBE7D-\uBE97\uBE99-\uBEB3\uBEB5-\uBECF\uBED1-\uBEEB\uBEED-\uBF07\uBF09-\uBF23\uBF25-\uBF3F\uBF41-\uBF5B\uBF5D-\uBF77\uBF79-\uBF93\uBF95-\uBFAF\uBFB1-\uBFCB\uBFCD-\uBFE7\uBFE9-\uC003\uC005-\uC01F\uC021-\uC03B\uC03D-\uC057\uC059-\uC073\uC075-\uC08F\uC091-\uC0AB\uC0AD-\uC0C7\uC0C9-\uC0E3\uC0E5-\uC0FF\uC101-\uC11B\uC11D-\uC137\uC139-\uC153\uC155-\uC16F\uC171-\uC18B\uC18D-\uC1A7\uC1A9-\uC1C3\uC1C5-\uC1DF\uC1E1-\uC1FB\uC1FD-\uC217\uC219-\uC233\uC235-\uC24F\uC251-\uC26B\uC26D-\uC287\uC289-\uC2A3\uC2A5-\uC2BF\uC2C1-\uC2DB\uC2DD-\uC2F7\uC2F9-\uC313\uC315-\uC32F\uC331-\uC34B\uC34D-\uC367\uC369-\uC383\uC385-\uC39F\uC3A1-\uC3BB\uC3BD-\uC3D7\uC3D9-\uC3F3\uC3F5-\uC40F\uC411-\uC42B\uC42D-\uC447\uC449-\uC463\uC465-\uC47F\uC481-\uC49B\uC49D-\uC4B7\uC4B9-\uC4D3\uC4D5-\uC4EF\uC4F1-\uC50B\uC50D-\uC527\uC529-\uC543\uC545-\uC55F\uC561-\uC57B\uC57D-\uC597\uC599-\uC5B3\uC5B5-\uC5CF\uC5D1-\uC5EB\uC5ED-\uC607\uC609-\uC623\uC625-\uC63F\uC641-\uC65B\uC65D-\uC677\uC679-\uC693\uC695-\uC6AF\uC6B1-\uC6CB\uC6CD-\uC6E7\uC6E9-\uC703\uC705-\uC71F\uC721-\uC73B\uC73D-\uC757\uC759-\uC773\uC775-\uC78F\uC791-\uC7AB\uC7AD-\uC7C7\uC7C9-\uC7E3\uC7E5-\uC7FF\uC801-\uC81B\uC81D-\uC837\uC839-\uC853\uC855-\uC86F\uC871-\uC88B\uC88D-\uC8A7\uC8A9-\uC8C3\uC8C5-\uC8DF\uC8E1-\uC8FB\uC8FD-\uC917\uC919-\uC933\uC935-\uC94F\uC951-\uC96B\uC96D-\uC987\uC989-\uC9A3\uC9A5-\uC9BF\uC9C1-\uC9DB\uC9DD-\uC9F7\uC9F9-\uCA13\uCA15-\uCA2F\uCA31-\uCA4B\uCA4D-\uCA67\uCA69-\uCA83\uCA85-\uCA9F\uCAA1-\uCABB\uCABD-\uCAD7\uCAD9-\uCAF3\uCAF5-\uCB0F\uCB11-\uCB2B\uCB2D-\uCB47\uCB49-\uCB63\uCB65-\uCB7F\uCB81-\uCB9B\uCB9D-\uCBB7\uCBB9-\uCBD3\uCBD5-\uCBEF\uCBF1-\uCC0B\uCC0D-\uCC27\uCC29-\uCC43\uCC45-\uCC5F\uCC61-\uCC7B\uCC7D-\uCC97\uCC99-\uCCB3\uCCB5-\uCCCF\uCCD1-\uCCEB\uCCED-\uCD07\uCD09-\uCD23\uCD25-\uCD3F\uCD41-\uCD5B\uCD5D-\uCD77\uCD79-\uCD93\uCD95-\uCDAF\uCDB1-\uCDCB\uCDCD-\uCDE7\uCDE9-\uCE03\uCE05-\uCE1F\uCE21-\uCE3B\uCE3D-\uCE57\uCE59-\uCE73\uCE75-\uCE8F\uCE91-\uCEAB\uCEAD-\uCEC7\uCEC9-\uCEE3\uCEE5-\uCEFF\uCF01-\uCF1B\uCF1D-\uCF37\uCF39-\uCF53\uCF55-\uCF6F\uCF71-\uCF8B\uCF8D-\uCFA7\uCFA9-\uCFC3\uCFC5-\uCFDF\uCFE1-\uCFFB\uCFFD-\uD017\uD019-\uD033\uD035-\uD04F\uD051-\uD06B\uD06D-\uD087\uD089-\uD0A3\uD0A5-\uD0BF\uD0C1-\uD0DB\uD0DD-\uD0F7\uD0F9-\uD113\uD115-\uD12F\uD131-\uD14B\uD14D-\uD167\uD169-\uD183\uD185-\uD19F\uD1A1-\uD1BB\uD1BD-\uD1D7\uD1D9-\uD1F3\uD1F5-\uD20F\uD211-\uD22B\uD22D-\uD247\uD249-\uD263\uD265-\uD27F\uD281-\uD29B\uD29D-\uD2B7\uD2B9-\uD2D3\uD2D5-\uD2EF\uD2F1-\uD30B\uD30D-\uD327\uD329-\uD343\uD345-\uD35F\uD361-\uD37B\uD37D-\uD397\uD399-\uD3B3\uD3B5-\uD3CF\uD3D1-\uD3EB\uD3ED-\uD407\uD409-\uD423\uD425-\uD43F\uD441-\uD45B\uD45D-\uD477\uD479-\uD493\uD495-\uD4AF\uD4B1-\uD4CB\uD4CD-\uD4E7\uD4E9-\uD503\uD505-\uD51F\uD521-\uD53B\uD53D-\uD557\uD559-\uD573\uD575-\uD58F\uD591-\uD5AB\uD5AD-\uD5C7\uD5C9-\uD5E3\uD5E5-\uD5FF\uD601-\uD61B\uD61D-\uD637\uD639-\uD653\uD655-\uD66F\uD671-\uD68B\uD68D-\uD6A7\uD6A9-\uD6C3\uD6C5-\uD6DF\uD6E1-\uD6FB\uD6FD-\uD717\uD719-\uD733\uD735-\uD74F\uD751-\uD76B\uD76D-\uD787\uD789-\uD7A3]$/,mv=/^(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])$/,pv=(e,t)=>{var n=xe.Any;return e.search(sv)!==-1&&(n|=xe.Extend),t===8205&&(n|=xe.ZWJ),t>=127462&&t<=127487&&(n|=xe.RI),e.search(ov)!==-1&&(n|=xe.Prepend),e.search(uv)!==-1&&(n|=xe.SpacingMark),e.search(lv)!==-1&&(n|=xe.L),e.search(cv)!==-1&&(n|=xe.V),e.search(dv)!==-1&&(n|=xe.T),e.search(fv)!==-1&&(n|=xe.LV),e.search(hv)!==-1&&(n|=xe.LVT),e.search(mv)!==-1&&(n|=xe.ExtPict),n};function Wn(e,t){return(e&t)!==0}var gv=[[xe.L,xe.L|xe.V|xe.LV|xe.LVT],[xe.LV|xe.V,xe.V|xe.T],[xe.LVT|xe.T,xe.T],[xe.Any,xe.Extend|xe.ZWJ],[xe.Any,xe.SpacingMark],[xe.Prepend,xe.Any],[xe.ZWJ,xe.ExtPict],[xe.RI,xe.RI]];function vv(e,t){return gv.findIndex(n=>Wn(e,n[0])&&Wn(t,n[1]))===-1}var bv=/(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC01\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDE41\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4\uDF00\uDF01\uDF36-\uDF3A\uDF40\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])*\u200D$/,Wu=e=>e.search(bv)!==-1,yv=/(?:\uD83C[\uDDE6-\uDDFF])+$/g,Cv=e=>{var t=e.match(yv);if(t===null)return!1;var n=t[0].length/2;return n%2===1},Dv={delete(e,t){e.delete(t)},insertFragment(e,t,n){e.insertFragment(t,n)},insertText(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};C.withoutNormalizing(e,()=>{var{voids:r=!1}=n,{at:a=fo(e)}=n;if(P.isPath(a)&&(a=C.range(e,a)),Z.isRange(a))if(Z.isCollapsed(a))a=a.anchor;else{var i=Z.end(a);if(!r&&C.void(e,{at:i}))return;var s=Z.start(a),o=C.pointRef(e,s),l=C.pointRef(e,i);X.delete(e,{at:a,voids:r});var u=o.unref(),c=l.unref();a=u||c,X.setSelection(e,{anchor:a,focus:a})}if(!(!r&&C.void(e,{at:a})||C.elementReadOnly(e,{at:a}))){var{path:h,offset:p}=a;t.length>0&&e.apply({type:"insert_text",path:h,offset:p,text:t})}})}};function Uu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function na(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Uu(Object(n),!0).forEach(function(r){lt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Uu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var X=na(na(na(na({},Lg),zg),qg),Dv),ya=new WeakMap,xv=e=>ya.get(e)||!1,wv=(e,t,n)=>{var r=ya.get(e)||!1;ya.set(e,!0);try{t(),n()}finally{ya.set(e,r)}};function Kd(e,t,n){var r=Ma.get(e)||[],a=Ra.get(e)||new Set,i,s,o=h=>{if(h){var p=h.join(",");s.has(p)||(s.add(p),i.push(h))}};if(n){i=[],s=new Set;for(var l of r){var u=n(l);o(u)}}else i=r,s=a;for(var c of t)o(c);Ma.set(e,i),Ra.set(e,s)}var Ev=(e,t)=>{for(var n of C.pathRefs(e))Pg.transform(n,t);for(var r of C.pointRefs(e))Ng.transform(r,t);for(var a of C.rangeRefs(e))Mg.transform(a,t);if(!xv(e)){var i=P.operationCanTransformPath(t)?s=>P.transform(s,t):void 0;Kd(e,e.getDirtyPaths(t),i)}X.transform(e,t),e.operations.push(t),C.normalize(e,{operation:t}),t.type==="set_selection"&&(e.marks=null),xr.get(e)||(xr.set(e,!0),Promise.resolve().then(()=>{xr.set(e,!1),e.onChange({operation:t}),e.operations=[]}))},_v=(e,t)=>{switch(t.type){case"insert_text":case"remove_text":case"set_node":{var{path:n}=t;return P.levels(n)}case"insert_node":{var{node:r,path:a}=t,i=P.levels(a),s=fe.isText(r)?[]:Array.from(ue.nodes(r),I=>{var[,N]=I;return a.concat(N)});return[...i,...s]}case"merge_node":{var{path:o}=t,l=P.ancestors(o),u=P.previous(o);return[...l,u]}case"move_node":{var{path:c,newPath:h}=t;if(P.equals(c,h))return[];var p=[],m=[];for(var g of P.ancestors(c)){var f=P.transform(g,t);p.push(f)}for(var b of P.ancestors(h)){var v=P.transform(b,t);m.push(v)}var E=m[m.length-1],k=h[h.length-1],x=E.concat(k);return[...p,...m,x]}case"remove_node":{var{path:w}=t,A=P.ancestors(w);return[...A]}case"split_node":{var{path:S}=t,W=P.levels(S),R=P.next(S);return[...W,R]}default:return[]}},kv=e=>{var{selection:t}=e;return t?ue.fragment(e,t):[]},Bv=(e,t)=>{var[n,r]=t;if(!fe.isText(n)){if(de.isElement(n)&&n.children.length===0){var a={text:""};X.insertNodes(e,a,{at:r.concat(0),voids:!0});return}for(var i=C.isEditor(n)?!1:de.isElement(n)&&(e.isInline(n)||n.children.length===0||fe.isText(n.children[0])||e.isInline(n.children[0])),s=0,o=0;o<n.children.length;o++,s++){var l=ue.get(e,r);if(!fe.isText(l)){var u=l.children[s],c=l.children[s-1],h=o===n.children.length-1,p=fe.isText(u)||de.isElement(u)&&e.isInline(u);if(p!==i)X.removeNodes(e,{at:r.concat(s),voids:!0}),s--;else if(de.isElement(u)){if(e.isInline(u)){if(c==null||!fe.isText(c)){var m={text:""};X.insertNodes(e,m,{at:r.concat(s),voids:!0}),s++}else if(h){var g={text:""};X.insertNodes(e,g,{at:r.concat(s+1),voids:!0}),s++}}}else c!=null&&fe.isText(c)&&(fe.equals(u,c,{loose:!0})?(X.mergeNodes(e,{at:r.concat(s),voids:!0}),s--):c.text===""?(X.removeNodes(e,{at:r.concat(s-1),voids:!0}),s--):u.text===""&&(X.removeNodes(e,{at:r.concat(s),voids:!0}),s--))}}}},Fv=(e,t)=>{var{iteration:n,initialDirtyPathsLength:r}=t,a=r*42;if(n>a)throw new Error("Could not completely normalize the editor after ".concat(a," iterations! This is usually due to incorrect normalization logic that leaves a node in an invalid state."));return!0},Av=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{voids:r=!1,mode:a="lowest",at:i=t.selection,match:s}=n;if(i){var o=C.path(t,i),l=a==="lowest";for(var[u,c]of C.levels(t,{at:o,voids:r,match:s,reverse:l}))if(!fe.isText(u)){if(Z.isRange(i)){if(P.isAncestor(c,i.anchor.path)&&P.isAncestor(c,i.focus.path))return[u,c]}else if(!P.equals(o,c))return[u,c]}}};function Hu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Vu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Hu(Object(n),!0).forEach(function(r){lt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Tv=(e,t,n)=>{var{selection:r}=e;if(r){var a=(h,p)=>{if(!fe.isText(h))return!1;var[m,g]=C.parent(e,p);return!e.isVoid(m)||e.markableVoid(m)},i=Z.isExpanded(r),s=!1;if(!i){var[o,l]=C.node(e,r);if(o&&a(o,l)){var[u]=C.parent(e,l);s=u&&e.markableVoid(u)}}if(i||s)X.setNodes(e,{[t]:n},{match:a,split:!0,voids:!0});else{var c=Vu(Vu({},C.marks(e)||{}),{},{[t]:n});e.marks=c,xr.get(e)||e.onChange()}}};function Ku(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Zu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ku(Object(n),!0).forEach(function(r){lt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ku(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Sv=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=C.point(t,n,{edge:"end"}),i=C.end(t,[]),s={anchor:a,focus:i},{distance:o=1}=r,l=0,u;for(var c of C.positions(t,Zu(Zu({},r),{},{at:s}))){if(l>o)break;l!==0&&(u=c),l++}return u};function Yu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Gu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Yu(Object(n),!0).forEach(function(r){lt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var jv=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=C.start(t,[]),i=C.point(t,n,{edge:"start"}),s={anchor:a,focus:i},{distance:o=1}=r,l=0,u;for(var c of C.positions(t,Gu(Gu({},r),{},{at:s,reverse:!0}))){if(l>o)break;l!==0&&(u=c),l++}return u},Ov=(e,t)=>{var{selection:n}=e;n&&Z.isCollapsed(n)&&X.delete(e,{unit:t,reverse:!0})},Pv=(e,t)=>{var{selection:n}=e;n&&Z.isCollapsed(n)&&X.delete(e,{unit:t})},Nv=function(t){var{direction:n="forward"}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{selection:r}=t;r&&Z.isExpanded(r)&&X.delete(t,{reverse:n==="backward"})},Mv=(e,t)=>[C.start(e,t),C.end(e,t)];function Qu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Ju(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Qu(Object(n),!0).forEach(function(r){lt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Rv=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return C.above(t,Ju(Ju({},n),{},{match:r=>de.isElement(r)&&C.isElementReadOnly(t,r)}))},Iv=(e,t)=>C.point(e,t,{edge:"end"}),$v=(e,t)=>{var n=C.path(e,t,{edge:"start"});return C.node(e,n)},Lv=(e,t)=>{var n=C.range(e,t);return ue.fragment(e,n)};function Xu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function el(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Xu(Object(n),!0).forEach(function(r){lt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var zv=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return C.above(t,el(el({},n),{},{match:r=>de.isElement(r)&&C.isVoid(t,r)}))},qv=(e,t)=>t.children.some(n=>de.isElement(n)&&C.isBlock(e,n)),Wv=(e,t)=>t.children.some(n=>fe.isText(n)||C.isInline(e,n)),Uv=(e,t)=>ue.has(e,t),Hv=(e,t)=>t.children.every(n=>fe.isText(n)),Vv=e=>{X.splitNodes(e,{always:!0})},Kv=(e,t,n)=>{X.insertNodes(e,t,n)},Zv=e=>{X.splitNodes(e,{always:!0})};function tl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Yv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tl(Object(n),!0).forEach(function(r){lt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tl(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Gv=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{selection:a,marks:i}=t;if(a){if(i){var s=Yv({text:n},i);X.insertNodes(t,s,{at:r.at,voids:r.voids})}else X.insertText(t,n,r);t.marks=null}},Qv=(e,t)=>!e.isInline(t),Jv=(e,t,n)=>C.isStart(e,t,n)||C.isEnd(e,t,n),Xv=(e,t)=>{var{children:n}=t,[r]=n;return n.length===0||n.length===1&&fe.isText(r)&&r.text===""&&!e.isVoid(t)},e0=(e,t,n)=>{var r=C.end(e,n);return _e.equals(t,r)},t0=e=>{var t=Hd.get(e);return t===void 0?!0:t},n0=(e,t,n)=>{if(t.offset!==0)return!1;var r=C.start(e,n);return _e.equals(t,r)},r0=(e,t)=>{var n=C.path(e,t,{edge:"end"});return C.node(e,n)},a0=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=C.path(t,n,r),i=ue.leaf(t,a);return[i,a]};function i0(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){var{at:n=e.selection,reverse:r=!1,voids:a=!1}=t,{match:i}=t;if(i==null&&(i=()=>!0),!!n){var s=[],o=C.path(e,n);for(var[l,u]of ue.levels(e,o))if(i(l,u)&&(s.push([l,u]),!a&&de.isElement(l)&&C.isVoid(e,l)))break;r&&s.reverse(),yield*s}}()}var s0=["text"],o0=["text"],u0=function(t){var{marks:n,selection:r}=t;if(!r)return null;var{anchor:a,focus:i}=r;if(n)return n;if(Z.isExpanded(r)){var s=C.isEnd(t,a,a.path);if(s){var o=C.after(t,a);o&&(a=o)}var[l]=C.nodes(t,{match:fe.isText,at:{anchor:a,focus:i}});if(l){var[u]=l,c=Zt(u,s0);return c}else return{}}var{path:h}=a,[p]=C.leaf(t,h);if(a.offset===0){var m=C.previous(t,{at:h,match:fe.isText}),g=C.above(t,{match:x=>de.isElement(x)&&C.isVoid(t,x)&&t.markableVoid(x)});if(!g){var f=C.above(t,{match:x=>de.isElement(x)&&C.isBlock(t,x)});if(m&&f){var[b,v]=m,[,E]=f;P.isAncestor(E,v)&&(p=b)}}}var k=Zt(p,o0);return k},l0=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{mode:r="lowest",voids:a=!1}=n,{match:i,at:s=t.selection}=n;if(s){var o=C.after(t,s,{voids:a});if(o){var[,l]=C.last(t,[]),u=[o.path,l];if(P.isPath(s)&&s.length===0)throw new Error("Cannot get the next node from the root node!");if(i==null)if(P.isPath(s)){var[c]=C.parent(t,s);i=p=>c.children.includes(p)}else i=()=>!0;var[h]=C.nodes(t,{at:u,match:i,mode:r,voids:a});return h}}},c0=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=C.path(t,n,r),i=ue.get(t,a);return[i,a]};function d0(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){var{at:n=e.selection,mode:r="all",universal:a=!1,reverse:i=!1,voids:s=!1,ignoreNonSelectable:o=!1}=t,{match:l}=t;if(l||(l=()=>!0),!!n){var u,c;if(Yg.isSpan(n))u=n[0],c=n[1];else{var h=C.path(e,n,{edge:"start"}),p=C.path(e,n,{edge:"end"});u=i?p:h,c=i?h:p}var m=ue.nodes(e,{reverse:i,from:u,to:c,pass:x=>{var[w]=x;return de.isElement(w)?!!(!s&&(C.isVoid(e,w)||C.isElementReadOnly(e,w))||o&&!C.isSelectable(e,w)):!1}}),g=[],f;for(var[b,v]of m)if(!(o&&de.isElement(b)&&!C.isSelectable(e,b))){var E=f&&P.compare(v,f[1])===0;if(!(r==="highest"&&E)){if(!l(b,v)){if(a&&!E&&fe.isText(b))return;continue}if(r==="lowest"&&E){f=[b,v];continue}var k=r==="lowest"?f:[b,v];k&&(a?g.push(k):yield k),f=[b,v]}}r==="lowest"&&f&&(a?g.push(f):yield f),a&&(yield*g)}}()}var f0=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{force:r=!1,operation:a}=n,i=c=>Ma.get(c)||[],s=c=>Ra.get(c)||new Set,o=c=>{var h=i(c).pop(),p=h.join(",");return s(c).delete(p),h};if(C.isNormalizing(t)){if(r){var l=Array.from(ue.nodes(t),c=>{var[,h]=c;return h}),u=new Set(l.map(c=>c.join(",")));Ma.set(t,l),Ra.set(t,u)}i(t).length!==0&&C.withoutNormalizing(t,()=>{for(var c of i(t))if(ue.has(t,c)){var h=C.node(t,c),[p,m]=h;de.isElement(p)&&p.children.length===0&&t.normalizeNode(h,{operation:a})}for(var g=i(t),f=g.length,b=0;g.length!==0;){if(!t.shouldNormalize({dirtyPaths:g,iteration:b,initialDirtyPathsLength:f,operation:a}))return;var v=o(t);if(ue.has(t,v)){var E=C.node(t,v);t.normalizeNode(E,{operation:a})}b++,g=i(t)}})}},h0=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=C.path(t,n,r),i=P.parent(a),s=C.node(t,i);return s},m0=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{affinity:a="forward"}=r,i={current:n,affinity:a,unref(){var{current:o}=i,l=C.pathRefs(t);return l.delete(i),i.current=null,o}},s=C.pathRefs(t);return s.add(i),i},p0=e=>{var t=Tu.get(e);return t||(t=new Set,Tu.set(e,t)),t},g0=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{depth:a,edge:i}=r;if(P.isPath(n)){if(i==="start"){var[,s]=ue.first(t,n);n=s}else if(i==="end"){var[,o]=ue.last(t,n);n=o}}return Z.isRange(n)&&(i==="start"?n=Z.start(n):i==="end"?n=Z.end(n):n=P.common(n.anchor.path,n.focus.path)),_e.isPoint(n)&&(n=n.path),a!=null&&(n=n.slice(0,a)),n},v0=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{affinity:a="forward"}=r,i={current:n,affinity:a,unref(){var{current:o}=i,l=C.pointRefs(t);return l.delete(i),i.current=null,o}},s=C.pointRefs(t);return s.add(i),i},b0=e=>{var t=Su.get(e);return t||(t=new Set,Su.set(e,t)),t},y0=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{edge:a="start"}=r;if(P.isPath(n)){var i;if(a==="end"){var[,s]=ue.last(t,n);i=s}else{var[,o]=ue.first(t,n);i=o}var l=ue.get(t,i);if(!fe.isText(l))throw new Error("Cannot get the ".concat(a," point in the node at path [").concat(n,"] because it has no ").concat(a," text node."));return{path:i,offset:a==="end"?l.text.length:0}}if(Z.isRange(n)){var[u,c]=Z.edges(n);return a==="start"?u:c}return n};function C0(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){var{at:n=e.selection,unit:r="offset",reverse:a=!1,voids:i=!1,ignoreNonSelectable:s=!1}=t;if(!n)return;var o=C.range(e,n),[l,u]=Z.edges(o),c=a?u:l,h=!1,p="",m=0,g=0,f=0;for(var[b,v]of C.nodes(e,{at:n,reverse:a,voids:i,ignoreNonSelectable:s})){if(de.isElement(b)){if(!i&&(e.isVoid(b)||e.isElementReadOnly(b))){yield C.start(e,v);continue}if(e.isInline(b))continue;if(C.hasInlines(e,b)){var E=P.isAncestor(v,u.path)?u:C.end(e,v),k=P.isAncestor(v,l.path)?l:C.start(e,v);p=C.string(e,{anchor:k,focus:E},{voids:i}),h=!0}}if(fe.isText(b)){var x=P.equals(v,c.path);for(x?(g=a?c.offset:b.text.length-c.offset,f=c.offset):(g=b.text.length,f=a?g:0),(x||h||r==="offset")&&(yield{path:v,offset:f},h=!1);;){if(m===0){if(p==="")break;m=w(p,r,a),p=mo(p,m,a)[1]}if(f=a?f-m:f+m,g=g-m,g<0){m=-g;break}m=0,yield{path:v,offset:f}}}}function w(A,S,W){return S==="character"?ho(A,W):S==="word"?tv(A,W):S==="line"||S==="block"?A.length:1}}()}var D0=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{mode:r="lowest",voids:a=!1}=n,{match:i,at:s=t.selection}=n;if(s){var o=C.before(t,s,{voids:a});if(o){var[,l]=C.first(t,[]),u=[o.path,l];if(P.isPath(s)&&s.length===0)throw new Error("Cannot get the previous node from the root node!");if(i==null)if(P.isPath(s)){var[c]=C.parent(t,s);i=p=>c.children.includes(p)}else i=()=>!0;var[h]=C.nodes(t,{reverse:!0,at:u,match:i,mode:r,voids:a});return h}}},x0=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{affinity:a="forward"}=r,i={current:n,affinity:a,unref(){var{current:o}=i,l=C.rangeRefs(t);return l.delete(i),i.current=null,o}},s=C.rangeRefs(t);return s.add(i),i},w0=e=>{var t=ju.get(e);return t||(t=new Set,ju.set(e,t)),t},E0=(e,t,n)=>{if(Z.isRange(t)&&!n)return t;var r=C.start(e,t),a=C.end(e,n||t);return{anchor:r,focus:a}};function nl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function _0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nl(Object(n),!0).forEach(function(r){lt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nl(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var k0=(e,t)=>{var{selection:n}=e;if(n){var r=(c,h)=>{if(!fe.isText(c))return!1;var[p,m]=C.parent(e,h);return!e.isVoid(p)||e.markableVoid(p)},a=Z.isExpanded(n),i=!1;if(!a){var[s,o]=C.node(e,n);if(s&&r(s,o)){var[l]=C.parent(e,o);i=l&&e.markableVoid(l)}}if(a||i)X.unsetNodes(e,t,{match:r,split:!0,voids:!0});else{var u=_0({},C.marks(e)||{});delete u[t],e.marks=u,xr.get(e)||e.onChange()}}},B0=(e,t)=>{Hd.set(e,t)},F0=(e,t)=>C.point(e,t,{edge:"start"}),A0=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{voids:a=!1}=r,i=C.range(t,n),[s,o]=Z.edges(i),l="";for(var[u,c]of C.nodes(t,{at:i,match:fe.isText,voids:a})){var h=u.text;P.equals(c,o.path)&&(h=h.slice(0,o.offset)),P.equals(c,s.path)&&(h=h.slice(s.offset)),l+=h}return l},T0=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{voids:a=!1}=r,[i,s]=Z.edges(n);if(i.offset!==0||s.offset!==0||Z.isCollapsed(n)||P.hasPrevious(s.path))return n;var o=C.above(t,{at:s,match:g=>de.isElement(g)&&C.isBlock(t,g),voids:a}),l=o?o[1]:[],u=C.start(t,i),c={anchor:u,focus:s},h=!0;for(var[p,m]of C.nodes(t,{at:c,match:fe.isText,reverse:!0,voids:a})){if(h){h=!1;continue}if(p.text!==""||P.isBefore(m,l)){s={path:m,offset:p.text.length};break}}return{anchor:i,focus:s}},S0=(e,t)=>{var n=C.isNormalizing(e);C.setNormalizing(e,!1);try{t()}finally{C.setNormalizing(e,n)}C.normalize(e)},j0=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};C.withoutNormalizing(t,()=>{var r,a,{reverse:i=!1,unit:s="character",distance:o=1,voids:l=!1}=n,{at:u=t.selection,hanging:c=!1}=n;if(u){var h=!1;if(Z.isRange(u)&&Z.isCollapsed(u)&&(h=!0,u=u.anchor),_e.isPoint(u)){var p=C.void(t,{at:u,mode:"highest"});if(!l&&p){var[,m]=p;u=m}else{var g={unit:s,distance:o},f=i?C.before(t,u,g)||C.start(t,[]):C.after(t,u,g)||C.end(t,[]);u={anchor:u,focus:f},c=!0}}if(P.isPath(u)){X.removeNodes(t,{at:u,voids:l});return}if(!Z.isCollapsed(u)){if(!c){var[,b]=Z.edges(u),v=C.end(t,[]);_e.equals(b,v)||(u=C.unhangRange(t,u,{voids:l}))}var[E,k]=Z.edges(u),x=C.above(t,{match:me=>de.isElement(me)&&C.isBlock(t,me),at:E,voids:l}),w=C.above(t,{match:me=>de.isElement(me)&&C.isBlock(t,me),at:k,voids:l}),A=x&&w&&!P.equals(x[1],w[1]),S=P.equals(E.path,k.path),W=l?null:(r=C.void(t,{at:E,mode:"highest"}))!==null&&r!==void 0?r:C.elementReadOnly(t,{at:E,mode:"highest"}),R=l?null:(a=C.void(t,{at:k,mode:"highest"}))!==null&&a!==void 0?a:C.elementReadOnly(t,{at:k,mode:"highest"});if(W){var I=C.before(t,E);I&&x&&P.isAncestor(x[1],I.path)&&(E=I)}if(R){var N=C.after(t,k);N&&w&&P.isAncestor(w[1],N.path)&&(k=N)}var _=[],F;for(var j of C.nodes(t,{at:u,voids:l})){var[$,V]=j;F&&P.compare(V,F)===0||(!l&&de.isElement($)&&(C.isVoid(t,$)||C.isElementReadOnly(t,$))||!P.isCommon(V,E.path)&&!P.isCommon(V,k.path))&&(_.push(j),F=V)}var K=Array.from(_,me=>{var[,ve]=me;return C.pathRef(t,ve)}),Q=C.pointRef(t,E),ae=C.pointRef(t,k),D="";if(!S&&!W){var L=Q.current,[q]=C.leaf(t,L),{path:B}=L,{offset:T}=E,z=q.text.slice(T);z.length>0&&(t.apply({type:"remove_text",path:B,offset:T,text:z}),D=z)}if(K.reverse().map(me=>me.unref()).filter(me=>me!==null).forEach(me=>X.removeNodes(t,{at:me,voids:l})),!R){var M=ae.current,[H]=C.leaf(t,M),{path:ne}=M,ee=S?E.offset:0,re=H.text.slice(ee,k.offset);re.length>0&&(t.apply({type:"remove_text",path:ne,offset:ee,text:re}),D=re)}!S&&A&&ae.current&&Q.current&&X.mergeNodes(t,{at:ae.current,hanging:!0,voids:l}),h&&i&&s==="character"&&D.length>1&&D.match(/[\u0E00-\u0E7F]+/)&&X.insertText(t,D.slice(0,D.length-o));var le=Q.unref(),J=ae.unref(),he=i?le||J:J||le;n.at==null&&he&&X.select(t,he)}}})},O0=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};C.withoutNormalizing(t,()=>{var{hanging:a=!1,voids:i=!1}=r,{at:s=fo(t),batchDirty:o=!0}=r;if(n.length){if(Z.isRange(s))if(a||(s=C.unhangRange(t,s,{voids:i})),Z.isCollapsed(s))s=s.anchor;else{var[,l]=Z.edges(s);if(!i&&C.void(t,{at:l}))return;var u=C.pointRef(t,l);X.delete(t,{at:s}),s=u.unref()}else P.isPath(s)&&(s=C.start(t,s));if(!(!i&&C.void(t,{at:s}))){var c=C.above(t,{at:s,match:z=>de.isElement(z)&&C.isInline(t,z),mode:"highest",voids:i});if(c){var[,h]=c;if(C.isEnd(t,s,h)){var p=C.after(t,h);s=p}else if(C.isStart(t,s,h)){var m=C.before(t,h);s=m}}var g=C.above(t,{match:z=>de.isElement(z)&&C.isBlock(t,z),at:s,voids:i}),[,f]=g,b=C.isStart(t,s,f),v=C.isEnd(t,s,f),E=b&&v,k=!b||b&&v,x=!v,[,w]=ue.first({children:n},[]),[,A]=ue.last({children:n},[]),S=[],W=z=>{var[M,H]=z,ne=H.length===0;return ne?!1:E?!0:!(k&&P.isAncestor(H,w)&&de.isElement(M)&&!t.isVoid(M)&&!t.isInline(M)||x&&P.isAncestor(H,A)&&de.isElement(M)&&!t.isVoid(M)&&!t.isInline(M))};for(var R of ue.nodes({children:n},{pass:W}))W(R)&&S.push(R);var I=[],N=[],_=[],F=!0,j=!1;for(var[$]of S)de.isElement($)&&!t.isInline($)?(F=!1,j=!0,N.push($)):F?I.push($):_.push($);var[V]=C.nodes(t,{at:s,match:z=>fe.isText(z)||C.isInline(t,z),mode:"highest",voids:i}),[,K]=V,Q=C.isStart(t,s,K),ae=C.isEnd(t,s,K),D=C.pathRef(t,v&&!_.length?P.next(f):f),L=C.pathRef(t,ae?P.next(K):K);X.splitNodes(t,{at:s,match:z=>j?de.isElement(z)&&C.isBlock(t,z):fe.isText(z)||C.isInline(t,z),mode:j?"lowest":"highest",always:j&&(!b||I.length>0)&&(!v||_.length>0),voids:i});var q=C.pathRef(t,!Q||Q&&ae?P.next(K):K);if(X.insertNodes(t,I,{at:q.current,match:z=>fe.isText(z)||C.isInline(t,z),mode:"highest",voids:i,batchDirty:o}),E&&!I.length&&N.length&&!_.length&&X.delete(t,{at:f,voids:i}),X.insertNodes(t,N,{at:D.current,match:z=>de.isElement(z)&&C.isBlock(t,z),mode:"lowest",voids:i,batchDirty:o}),X.insertNodes(t,_,{at:L.current,match:z=>fe.isText(z)||C.isInline(t,z),mode:"highest",voids:i,batchDirty:o}),!r.at){var B;if(_.length>0&&L.current?B=P.previous(L.current):N.length>0&&D.current?B=P.previous(D.current):q.current&&(B=P.previous(q.current)),B){var T=C.end(t,B);X.select(t,T)}}q.unref(),D.unref(),L.unref()}}})},P0=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{edge:r="anchor"}=n,{selection:a}=t;if(a){if(r==="anchor")X.select(t,a.anchor);else if(r==="focus")X.select(t,a.focus);else if(r==="start"){var[i]=Z.edges(a);X.select(t,i)}else if(r==="end"){var[,s]=Z.edges(a);X.select(t,s)}}else return},N0=e=>{var{selection:t}=e;t&&e.apply({type:"set_selection",properties:t,newProperties:null})},M0=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{selection:r}=t,{distance:a=1,unit:i="character",reverse:s=!1}=n,{edge:o=null}=n;if(r){o==="start"&&(o=Z.isBackward(r)?"focus":"anchor"),o==="end"&&(o=Z.isBackward(r)?"anchor":"focus");var{anchor:l,focus:u}=r,c={distance:a,unit:i,ignoreNonSelectable:!0},h={};if(o==null||o==="anchor"){var p=s?C.before(t,l,c):C.after(t,l,c);p&&(h.anchor=p)}if(o==null||o==="focus"){var m=s?C.before(t,u,c):C.after(t,u,c);m&&(h.focus=m)}X.setSelection(t,h)}},R0=(e,t)=>{var{selection:n}=e;if(t=C.range(e,t),n){X.setSelection(e,t);return}if(!Z.isRange(t))throw new Error("When setting the selection and the current selection is `null` you must provide at least an `anchor` and `focus`, but you passed: ".concat(Xe.stringify(t)));e.apply({type:"set_selection",properties:n,newProperties:t})};function rl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function al(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?rl(Object(n),!0).forEach(function(r){lt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rl(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var I0=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{selection:a}=t,{edge:i="both"}=r;if(a){i==="start"&&(i=Z.isBackward(a)?"focus":"anchor"),i==="end"&&(i=Z.isBackward(a)?"anchor":"focus");var{anchor:s,focus:o}=a,l=i==="anchor"?s:o;X.setSelection(t,{[i==="anchor"?"anchor":"focus"]:al(al({},l),n)})}},$0=(e,t)=>{var{selection:n}=e,r={},a={};if(n){for(var i in t)(i==="anchor"&&t.anchor!=null&&!_e.equals(t.anchor,n.anchor)||i==="focus"&&t.focus!=null&&!_e.equals(t.focus,n.focus)||i!=="anchor"&&i!=="focus"&&t[i]!==n[i])&&(r[i]=n[i],a[i]=t[i]);Object.keys(r).length>0&&e.apply({type:"set_selection",properties:r,newProperties:a})}},L0=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};C.withoutNormalizing(t,()=>{var{hanging:a=!1,voids:i=!1,mode:s="lowest",batchDirty:o=!0}=r,{at:l,match:u,select:c}=r;if(ue.isNode(n)&&(n=[n]),n.length!==0){var[h]=n;if(l||(l=fo(t),c!==!1&&(c=!0)),c==null&&(c=!1),Z.isRange(l))if(a||(l=C.unhangRange(t,l,{voids:i})),Z.isCollapsed(l))l=l.anchor;else{var[,p]=Z.edges(l),m=C.pointRef(t,p);X.delete(t,{at:l}),l=m.unref()}if(_e.isPoint(l)){u==null&&(fe.isText(h)?u=I=>fe.isText(I):t.isInline(h)?u=I=>fe.isText(I)||C.isInline(t,I):u=I=>de.isElement(I)&&C.isBlock(t,I));var[g]=C.nodes(t,{at:l.path,match:u,mode:s,voids:i});if(g){var[,f]=g,b=C.pathRef(t,f),v=C.isEnd(t,l,f);X.splitNodes(t,{at:l,match:u,mode:s,voids:i});var E=b.unref();l=v?P.next(E):E}else return}var k=P.parent(l),x=l[l.length-1];if(!(!i&&C.void(t,{at:k}))){if(o){var w=[],A=P.levels(k);wv(t,()=>{var I=function(){var F=k.concat(x);x++;var j={type:"insert_node",path:F,node:N};t.apply(j),l=P.next(l),w.push(j),fe.isText?A.push(...Array.from(ue.nodes(N),$=>{var[,V]=$;return F.concat(V)})):A.push(F)};for(var N of n)I()},()=>{Kd(t,A,I=>{var N=I;for(var _ of w)if(P.operationCanTransformPath(_)&&(N=P.transform(N,_),!N))return null;return N})})}else for(var S of n){var W=k.concat(x);x++,t.apply({type:"insert_node",path:W,node:S}),l=P.next(l)}if(l=P.previous(l),c){var R=C.end(t,l);R&&X.select(t,R)}}}})},z0=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};C.withoutNormalizing(t,()=>{var{at:r=t.selection,mode:a="lowest",voids:i=!1}=n,{match:s}=n;if(s==null&&(s=P.isPath(r)?or(t,r):x=>de.isElement(x)&&C.isBlock(t,x)),!!r){var o=C.nodes(t,{at:r,match:s,mode:a,voids:i}),l=Array.from(o,x=>{var[,w]=x;return C.pathRef(t,w)});for(var u of l){var c=u.unref();if(c.length<2)throw new Error("Cannot lift node at a path [".concat(c,"] because it has a depth of less than `2`."));var h=C.node(t,P.parent(c)),[p,m]=h,g=c[c.length-1],{length:f}=p.children;if(f===1){var b=P.next(m);X.moveNodes(t,{at:c,to:b,voids:i}),X.removeNodes(t,{at:m,voids:i})}else if(g===0)X.moveNodes(t,{at:c,to:m,voids:i});else if(g===f-1){var v=P.next(m);X.moveNodes(t,{at:c,to:v,voids:i})}else{var E=P.next(c),k=P.next(m);X.splitNodes(t,{at:E,voids:i}),X.moveNodes(t,{at:c,to:k,voids:i})}}}})},q0=["text"],W0=["children"],Zd=(e,t)=>{if(de.isElement(t)){var n=t;return C.isVoid(e,t)?!0:n.children.length===1?Zd(e,n.children[0]):!1}else return!C.isEditor(t)},U0=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};C.withoutNormalizing(t,()=>{var{match:r,at:a=t.selection}=n,{hanging:i=!1,voids:s=!1,mode:o="lowest"}=n;if(a){if(r==null)if(P.isPath(a)){var[l]=C.parent(t,a);r=I=>l.children.includes(I)}else r=I=>de.isElement(I)&&C.isBlock(t,I);if(!i&&Z.isRange(a)&&(a=C.unhangRange(t,a,{voids:s})),Z.isRange(a))if(Z.isCollapsed(a))a=a.anchor;else{var[,u]=Z.edges(a),c=C.pointRef(t,u);X.delete(t,{at:a}),a=c.unref(),n.at==null&&X.select(t,a)}var[h]=C.nodes(t,{at:a,match:r,voids:s,mode:o}),p=C.previous(t,{at:a,match:r,voids:s,mode:o});if(!(!h||!p)){var[m,g]=h,[f,b]=p;if(!(g.length===0||b.length===0)){var v=P.next(b),E=P.common(g,b),k=P.isSibling(g,b),x=Array.from(C.levels(t,{at:g}),I=>{var[N]=I;return N}).slice(E.length).slice(0,-1),w=C.above(t,{at:g,mode:"highest",match:I=>x.includes(I)&&Zd(t,I)}),A=w&&C.pathRef(t,w[1]),S,W;if(fe.isText(m)&&fe.isText(f)){var R=Zt(m,q0);W=f.text.length,S=R}else if(de.isElement(m)&&de.isElement(f)){var R=Zt(m,W0);W=f.children.length,S=R}else throw new Error("Cannot merge the node at path [".concat(g,"] with the previous sibling because it is not the same kind: ").concat(Xe.stringify(m)," ").concat(Xe.stringify(f)));k||X.moveNodes(t,{at:g,to:v,voids:s}),A&&X.removeNodes(t,{at:A.current,voids:s}),de.isElement(f)&&C.isEmpty(t,f)||fe.isText(f)&&f.text===""&&b[b.length-1]!==0?X.removeNodes(t,{at:b,voids:s}):t.apply({type:"merge_node",path:v,position:W,properties:S}),A&&A.unref()}}}})},H0=(e,t)=>{C.withoutNormalizing(e,()=>{var{to:n,at:r=e.selection,mode:a="lowest",voids:i=!1}=t,{match:s}=t;if(r){s==null&&(s=P.isPath(r)?or(e,r):m=>de.isElement(m)&&C.isBlock(e,m));var o=C.pathRef(e,n),l=C.nodes(e,{at:r,match:s,mode:a,voids:i}),u=Array.from(l,m=>{var[,g]=m;return C.pathRef(e,g)});for(var c of u){var h=c.unref(),p=o.current;h.length!==0&&e.apply({type:"move_node",path:h,newPath:p}),o.current&&P.isSibling(p,h)&&P.isAfter(p,h)&&(o.current=P.next(o.current))}o.unref()}})},V0=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};C.withoutNormalizing(t,()=>{var{hanging:r=!1,voids:a=!1,mode:i="lowest"}=n,{at:s=t.selection,match:o}=n;if(s){o==null&&(o=P.isPath(s)?or(t,s):m=>de.isElement(m)&&C.isBlock(t,m)),!r&&Z.isRange(s)&&(s=C.unhangRange(t,s,{voids:a}));var l=C.nodes(t,{at:s,match:o,mode:i,voids:a}),u=Array.from(l,m=>{var[,g]=m;return C.pathRef(t,g)});for(var c of u){var h=c.unref();if(h){var[p]=C.node(t,h);t.apply({type:"remove_node",path:h,node:p})}}}})},K0=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};C.withoutNormalizing(t,()=>{var{match:a,at:i=t.selection,compare:s,merge:o}=r,{hanging:l=!1,mode:u="lowest",split:c=!1,voids:h=!1}=r;if(i){if(a==null&&(a=P.isPath(i)?or(t,i):W=>de.isElement(W)&&C.isBlock(t,W)),!l&&Z.isRange(i)&&(i=C.unhangRange(t,i,{voids:h})),c&&Z.isRange(i)){if(Z.isCollapsed(i)&&C.leaf(t,i.anchor)[0].text.length>0)return;var p=C.rangeRef(t,i,{affinity:"inward"}),[m,g]=Z.edges(i),f=u==="lowest"?"lowest":"highest",b=C.isEnd(t,g,g.path);X.splitNodes(t,{at:g,match:a,mode:f,voids:h,always:!b});var v=C.isStart(t,m,m.path);X.splitNodes(t,{at:m,match:a,mode:f,voids:h,always:!v}),i=p.unref(),r.at==null&&X.select(t,i)}s||(s=(W,R)=>W!==R);for(var[E,k]of C.nodes(t,{at:i,match:a,mode:u,voids:h})){var x={},w={};if(k.length!==0){var A=!1;for(var S in n)S==="children"||S==="text"||s(n[S],E[S])&&(A=!0,E.hasOwnProperty(S)&&(x[S]=E[S]),o?n[S]!=null&&(w[S]=o(E[S],n[S])):n[S]!=null&&(w[S]=n[S]));A&&t.apply({type:"set_node",path:k,properties:x,newProperties:w})}}}})},Z0=(e,t)=>{if(Z.isCollapsed(t))return t.anchor;var[,n]=Z.edges(t),r=C.pointRef(e,n);return X.delete(e,{at:t}),r.unref()},Y0=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};C.withoutNormalizing(t,()=>{var{mode:r="lowest",voids:a=!1}=n,{match:i,at:s=t.selection,height:o=0,always:l=!1}=n;if(i==null&&(i=ae=>de.isElement(ae)&&C.isBlock(t,ae)),Z.isRange(s)&&(s=Z0(t,s)),P.isPath(s)){var u=s,c=C.point(t,u),[h]=C.parent(t,u);i=ae=>ae===h,o=c.path.length-u.length+1,s=c,l=!0}if(s){var p=C.pointRef(t,s,{affinity:"backward"}),m;try{var[g]=C.nodes(t,{at:s,match:i,mode:r,voids:a});if(!g)return;var f=C.void(t,{at:s,mode:"highest"}),b=0;if(!a&&f){var[v,E]=f;if(de.isElement(v)&&t.isInline(v)){var k=C.after(t,E);if(!k){var x={text:""},w=P.next(E);X.insertNodes(t,x,{at:w,voids:a}),k=C.point(t,w)}s=k,l=!0}var A=s.path.length-E.length;o=A+1,l=!0}m=C.pointRef(t,s);var S=s.path.length-o,[,W]=g,R=s.path.slice(0,S),I=o===0?s.offset:s.path[S]+b;for(var[N,_]of C.levels(t,{at:R,reverse:!0,voids:a})){var F=!1;if(_.length<W.length||_.length===0||!a&&de.isElement(N)&&C.isVoid(t,N))break;var j=p.current,$=C.isEnd(t,j,_);if(l||!p||!C.isEdge(t,j,_)){F=!0;var V=ue.extractProps(N);t.apply({type:"split_node",path:_,position:I,properties:V})}I=_[_.length-1]+(F||$?1:0)}if(n.at==null){var K=m.current||C.end(t,[]);X.select(t,K)}}finally{var Q;p.unref(),(Q=m)===null||Q===void 0||Q.unref()}}})},G0=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Array.isArray(n)||(n=[n]);var a={};for(var i of n)a[i]=null;X.setNodes(t,a,r)},Q0=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};C.withoutNormalizing(t,()=>{var{mode:r="lowest",split:a=!1,voids:i=!1}=n,{at:s=t.selection,match:o}=n;if(s){o==null&&(o=P.isPath(s)?or(t,s):m=>de.isElement(m)&&C.isBlock(t,m)),P.isPath(s)&&(s=C.range(t,s));var l=Z.isRange(s)?C.rangeRef(t,s):null,u=C.nodes(t,{at:s,match:o,mode:r,voids:i}),c=Array.from(u,m=>{var[,g]=m;return C.pathRef(t,g)}).reverse(),h=function(){var g=p.unref(),[f]=C.node(t,g),b=C.range(t,g);a&&l&&(b=Z.intersection(l.current,b)),X.liftNodes(t,{at:b,match:v=>de.isAncestor(f)&&f.children.includes(v),voids:i})};for(var p of c)h();l&&l.unref()}})};function il(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function sl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?il(Object(n),!0).forEach(function(r){lt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):il(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var J0=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};C.withoutNormalizing(t,()=>{var{mode:a="lowest",split:i=!1,voids:s=!1}=r,{match:o,at:l=t.selection}=r;if(l){if(o==null&&(P.isPath(l)?o=or(t,l):t.isInline(n)?o=b=>de.isElement(b)&&C.isInline(t,b)||fe.isText(b):o=b=>de.isElement(b)&&C.isBlock(t,b)),i&&Z.isRange(l)){var[u,c]=Z.edges(l),h=C.rangeRef(t,l,{affinity:"inward"});X.splitNodes(t,{at:c,match:o,voids:s}),X.splitNodes(t,{at:u,match:o,voids:s}),l=h.unref(),r.at==null&&X.select(t,l)}var p=Array.from(C.nodes(t,{at:l,match:t.isInline(n)?b=>de.isElement(b)&&C.isBlock(t,b):b=>C.isEditor(b),mode:"lowest",voids:s})),m=function(){var v=Z.isRange(l)?Z.intersection(l,C.range(t,f)):l;if(!v)return 0;var E=Array.from(C.nodes(t,{at:v,match:o,mode:a,voids:s}));if(E.length>0){var[k]=E,x=E[E.length-1],[,w]=k,[,A]=x;if(w.length===0&&A.length===0)return 0;var S=P.equals(w,A)?P.parent(w):P.common(w,A),W=C.range(t,w,A),R=C.node(t,S),[I]=R,N=S.length+1,_=P.next(A.slice(0,N)),F=sl(sl({},n),{},{children:[]});X.insertNodes(t,F,{at:_,voids:s}),X.moveNodes(t,{at:W,match:j=>de.isAncestor(I)&&I.children.includes(j),to:_.concat(0),voids:s})}},g;for(var[,f]of p)g=m()}})},X0=()=>{var e={children:[],operations:[],selection:null,marks:null,isElementReadOnly:()=>!1,isInline:()=>!1,isSelectable:()=>!0,isVoid:()=>!1,markableVoid:()=>!1,onChange:()=>{},apply:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Ev(e,...r)},addMark:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Tv(e,...r)},deleteBackward:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Ov(e,...r)},deleteForward:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Pv(e,...r)},deleteFragment:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Nv(e,...r)},getFragment:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return kv(e,...r)},insertBreak:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Vv(e,...r)},insertSoftBreak:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Zv(e,...r)},insertFragment:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return O0(e,...r)},insertNode:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Kv(e,...r)},insertText:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Gv(e,...r)},normalizeNode:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Bv(e,...r)},removeMark:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return k0(e,...r)},getDirtyPaths:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return _v(e,...r)},shouldNormalize:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Fv(e,...r)},above:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Av(e,...r)},after:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Sv(e,...r)},before:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return jv(e,...r)},collapse:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return P0(e,...r)},delete:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return j0(e,...r)},deselect:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return N0(e,...r)},edges:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Mv(e,...r)},elementReadOnly:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Rv(e,...r)},end:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Iv(e,...r)},first:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return $v(e,...r)},fragment:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Lv(e,...r)},getMarks:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return u0(e,...r)},hasBlocks:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return qv(e,...r)},hasInlines:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Wv(e,...r)},hasPath:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Uv(e,...r)},hasTexts:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Hv(e,...r)},insertNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return L0(e,...r)},isBlock:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Qv(e,...r)},isEdge:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Jv(e,...r)},isEmpty:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Xv(e,...r)},isEnd:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return e0(e,...r)},isNormalizing:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return t0(e,...r)},isStart:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return n0(e,...r)},last:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return r0(e,...r)},leaf:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return a0(e,...r)},levels:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return i0(e,...r)},liftNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return z0(e,...r)},mergeNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return U0(e,...r)},move:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return M0(e,...r)},moveNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return H0(e,...r)},next:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return l0(e,...r)},node:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return c0(e,...r)},nodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return d0(e,...r)},normalize:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return f0(e,...r)},parent:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return h0(e,...r)},path:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return g0(e,...r)},pathRef:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return m0(e,...r)},pathRefs:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return p0(e,...r)},point:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return y0(e,...r)},pointRef:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return v0(e,...r)},pointRefs:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return b0(e,...r)},positions:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return C0(e,...r)},previous:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return D0(e,...r)},range:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return E0(e,...r)},rangeRef:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return x0(e,...r)},rangeRefs:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return w0(e,...r)},removeNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return V0(e,...r)},select:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return R0(e,...r)},setNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return K0(e,...r)},setNormalizing:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return B0(e,...r)},setPoint:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return I0(e,...r)},setSelection:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return $0(e,...r)},splitNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Y0(e,...r)},start:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return F0(e,...r)},string:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return A0(e,...r)},unhangRange:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return T0(e,...r)},unsetNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return G0(e,...r)},unwrapNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Q0(e,...r)},void:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return zv(e,...r)},withoutNormalizing:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return S0(e,...r)},wrapNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return J0(e,...r)}};return e},eb={isHistory(e){return tt(e)&&Array.isArray(e.redos)&&Array.isArray(e.undos)&&(e.redos.length===0||sn.isOperationList(e.redos[0].operations))&&(e.undos.length===0||sn.isOperationList(e.undos[0].operations))}},Ai=new WeakMap,Ti=new WeakMap,Un={isHistoryEditor(e){return eb.isHistory(e.history)&&C.isEditor(e)},isMerging(e){return Ti.get(e)},isSaving(e){return Ai.get(e)},redo(e){e.redo()},undo(e){e.undo()},withoutMerging(e,t){var n=Un.isMerging(e);Ti.set(e,!1),t(),Ti.set(e,n)},withoutSaving(e,t){var n=Un.isSaving(e);Ai.set(e,!1),t(),Ai.set(e,n)}},tb=e=>{var t=e,{apply:n}=t;return t.history={undos:[],redos:[]},t.redo=()=>{var{history:r}=t,{redos:a}=r;if(a.length>0){var i=a[a.length-1];i.selectionBefore&&X.setSelection(t,i.selectionBefore),Un.withoutSaving(t,()=>{C.withoutNormalizing(t,()=>{for(var s of i.operations)t.apply(s)})}),r.redos.pop(),t.writeHistory("undos",i)}},t.undo=()=>{var{history:r}=t,{undos:a}=r;if(a.length>0){var i=a[a.length-1];Un.withoutSaving(t,()=>{C.withoutNormalizing(t,()=>{var s=i.operations.map(sn.inverse).reverse();for(var o of s)t.apply(o);i.selectionBefore&&X.setSelection(t,i.selectionBefore)})}),t.writeHistory("redos",i),r.undos.pop()}},t.apply=r=>{var{operations:a,history:i}=t,{undos:s}=i,o=s[s.length-1],l=o&&o.operations[o.operations.length-1],u=Un.isSaving(t),c=Un.isMerging(t);if(u==null&&(u=rb(r)),u){if(c==null&&(o==null?c=!1:a.length!==0?c=!0:c=nb(r,l)),o&&c)o.operations.push(r);else{var h={operations:[r],selectionBefore:t.selection};t.writeHistory("undos",h)}for(;s.length>100;)s.shift();i.redos=[]}n(r)},t.writeHistory=(r,a)=>{t.history[r].push(a)},t},nb=(e,t)=>!!(t&&e.type==="insert_text"&&t.type==="insert_text"&&e.offset===t.offset+t.text.length&&P.equals(e.path,t.path)||t&&e.type==="remove_text"&&t.type==="remove_text"&&e.offset+e.text.length===t.offset&&P.equals(e.path,t.path)),rb=(e,t)=>e.type!=="set_selection",ab=ob,Yd="֑-߿יִ-﷽ﹰ-ﻼ",Gd="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",ib=new RegExp("^[^"+Gd+"]*["+Yd+"]"),sb=new RegExp("^[^"+Yd+"]*["+Gd+"]");function ob(e){return e=String(e||""),ib.test(e)?"rtl":sb.test(e)?"ltr":"neutral"}const Qd=Tn(ab);function ub(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var po=ub,lb=typeof Vr=="object"&&Vr&&Vr.Object===Object&&Vr,cb=lb,db=cb,fb=typeof self=="object"&&self&&self.Object===Object&&self,hb=db||fb||Function("return this")(),Jd=hb,mb=Jd,pb=function(){return mb.Date.now()},gb=pb,vb=/\s/;function bb(e){for(var t=e.length;t--&&vb.test(e.charAt(t)););return t}var yb=bb,Cb=yb,Db=/^\s+/;function xb(e){return e&&e.slice(0,Cb(e)+1).replace(Db,"")}var wb=xb,Eb=Jd,_b=Eb.Symbol,Xd=_b,ol=Xd,ef=Object.prototype,kb=ef.hasOwnProperty,Bb=ef.toString,gr=ol?ol.toStringTag:void 0;function Fb(e){var t=kb.call(e,gr),n=e[gr];try{e[gr]=void 0;var r=!0}catch{}var a=Bb.call(e);return r&&(t?e[gr]=n:delete e[gr]),a}var Ab=Fb,Tb=Object.prototype,Sb=Tb.toString;function jb(e){return Sb.call(e)}var Ob=jb,ul=Xd,Pb=Ab,Nb=Ob,Mb="[object Null]",Rb="[object Undefined]",ll=ul?ul.toStringTag:void 0;function Ib(e){return e==null?e===void 0?Rb:Mb:ll&&ll in Object(e)?Pb(e):Nb(e)}var $b=Ib;function Lb(e){return e!=null&&typeof e=="object"}var zb=Lb,qb=$b,Wb=zb,Ub="[object Symbol]";function Hb(e){return typeof e=="symbol"||Wb(e)&&qb(e)==Ub}var Vb=Hb,Kb=wb,cl=po,Zb=Vb,dl=0/0,Yb=/^[-+]0x[0-9a-f]+$/i,Gb=/^0b[01]+$/i,Qb=/^0o[0-7]+$/i,Jb=parseInt;function Xb(e){if(typeof e=="number")return e;if(Zb(e))return dl;if(cl(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=cl(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Kb(e);var n=Gb.test(e);return n||Qb.test(e)?Jb(e.slice(2),n?2:8):Yb.test(e)?dl:+e}var ey=Xb,ty=po,Si=gb,fl=ey,ny="Expected a function",ry=Math.max,ay=Math.min;function iy(e,t,n){var r,a,i,s,o,l,u=0,c=!1,h=!1,p=!0;if(typeof e!="function")throw new TypeError(ny);t=fl(t)||0,ty(n)&&(c=!!n.leading,h="maxWait"in n,i=h?ry(fl(n.maxWait)||0,t):i,p="trailing"in n?!!n.trailing:p);function m(A){var S=r,W=a;return r=a=void 0,u=A,s=e.apply(W,S),s}function g(A){return u=A,o=setTimeout(v,t),c?m(A):s}function f(A){var S=A-l,W=A-u,R=t-S;return h?ay(R,i-W):R}function b(A){var S=A-l,W=A-u;return l===void 0||S>=t||S<0||h&&W>=i}function v(){var A=Si();if(b(A))return E(A);o=setTimeout(v,f(A))}function E(A){return o=void 0,p&&r?m(A):(r=a=void 0,s)}function k(){o!==void 0&&clearTimeout(o),u=0,r=l=a=o=void 0}function x(){return o===void 0?s:E(Si())}function w(){var A=Si(),S=b(A);if(r=arguments,a=this,l=A,S){if(o===void 0)return g(l);if(h)return clearTimeout(o),o=setTimeout(v,t),m(l)}return o===void 0&&(o=setTimeout(v,t)),s}return w.cancel=k,w.flush=x,w}var tf=iy;const sy=Tn(tf);var oy=tf,uy=po,ly="Expected a function";function cy(e,t,n){var r=!0,a=!0;if(typeof e!="function")throw new TypeError(ly);return uy(n)&&(r="leading"in n?!!n.leading:r,a="trailing"in n?!!n.trailing:a),oy(e,t,{leading:r,maxWait:t,trailing:a})}var dy=cy;const fy=Tn(dy),hl=e=>typeof e=="object"&&e!=null&&e.nodeType===1,ml=(e,t)=>(!t||e!=="hidden")&&e!=="visible"&&e!=="clip",ji=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const n=getComputedStyle(e,null);return ml(n.overflowY,t)||ml(n.overflowX,t)||(r=>{const a=(i=>{if(!i.ownerDocument||!i.ownerDocument.defaultView)return null;try{return i.ownerDocument.defaultView.frameElement}catch{return null}})(r);return!!a&&(a.clientHeight<r.scrollHeight||a.clientWidth<r.scrollWidth)})(e)}return!1},ra=(e,t,n,r,a,i,s,o)=>i<e&&s>t||i>e&&s<t?0:i<=e&&o<=n||s>=t&&o>=n?i-e-r:s>t&&o<n||i<e&&o>n?s-t+a:0,hy=e=>{const t=e.parentElement;return t??(e.getRootNode().host||null)},pl=(e,t)=>{var n,r,a,i;if(typeof document>"u")return[];const{scrollMode:s,block:o,inline:l,boundary:u,skipOverflowHiddenElements:c}=t,h=typeof u=="function"?u:V=>V!==u;if(!hl(e))throw new TypeError("Invalid target");const p=document.scrollingElement||document.documentElement,m=[];let g=e;for(;hl(g)&&h(g);){if(g=hy(g),g===p){m.push(g);break}g!=null&&g===document.body&&ji(g)&&!ji(document.documentElement)||g!=null&&ji(g,c)&&m.push(g)}const f=(r=(n=window.visualViewport)==null?void 0:n.width)!=null?r:innerWidth,b=(i=(a=window.visualViewport)==null?void 0:a.height)!=null?i:innerHeight,{scrollX:v,scrollY:E}=window,{height:k,width:x,top:w,right:A,bottom:S,left:W}=e.getBoundingClientRect(),{top:R,right:I,bottom:N,left:_}=(V=>{const K=window.getComputedStyle(V);return{top:parseFloat(K.scrollMarginTop)||0,right:parseFloat(K.scrollMarginRight)||0,bottom:parseFloat(K.scrollMarginBottom)||0,left:parseFloat(K.scrollMarginLeft)||0}})(e);let F=o==="start"||o==="nearest"?w-R:o==="end"?S+N:w+k/2-R+N,j=l==="center"?W+x/2-_+I:l==="end"?A+I:W-_;const $=[];for(let V=0;V<m.length;V++){const K=m[V],{height:Q,width:ae,top:D,right:L,bottom:q,left:B}=K.getBoundingClientRect();if(s==="if-needed"&&w>=0&&W>=0&&S<=b&&A<=f&&w>=D&&S<=q&&W>=B&&A<=L)return $;const T=getComputedStyle(K),z=parseInt(T.borderLeftWidth,10),M=parseInt(T.borderTopWidth,10),H=parseInt(T.borderRightWidth,10),ne=parseInt(T.borderBottomWidth,10);let ee=0,re=0;const le="offsetWidth"in K?K.offsetWidth-K.clientWidth-z-H:0,J="offsetHeight"in K?K.offsetHeight-K.clientHeight-M-ne:0,he="offsetWidth"in K?K.offsetWidth===0?0:ae/K.offsetWidth:0,me="offsetHeight"in K?K.offsetHeight===0?0:Q/K.offsetHeight:0;if(p===K)ee=o==="start"?F:o==="end"?F-b:o==="nearest"?ra(E,E+b,b,M,ne,E+F,E+F+k,k):F-b/2,re=l==="start"?j:l==="center"?j-f/2:l==="end"?j-f:ra(v,v+f,f,z,H,v+j,v+j+x,x),ee=Math.max(0,ee+E),re=Math.max(0,re+v);else{ee=o==="start"?F-D-M:o==="end"?F-q+ne+J:o==="nearest"?ra(D,q,Q,M,ne+J,F,F+k,k):F-(D+Q/2)+J/2,re=l==="start"?j-B-z:l==="center"?j-(B+ae/2)+le/2:l==="end"?j-L+H+le:ra(B,L,ae,z,H+le,j,j+x,x);const{scrollLeft:ve,scrollTop:Ee}=K;ee=me===0?0:Math.max(0,Math.min(Ee+ee/me,K.scrollHeight-Q/me+J)),re=he===0?0:Math.max(0,Math.min(ve+re/he,K.scrollWidth-ae/he+le)),F+=Ee-ee,j+=ve-re}$.push({el:K,top:ee,left:re})}return $},my=e=>e===!1?{block:"end",inline:"nearest"}:(t=>t===Object(t)&&Object.keys(t).length!==0)(e)?e:{block:"start",inline:"nearest"};function py(e,t){if(!e.isConnected||!(a=>{let i=a;for(;i&&i.parentNode;){if(i.parentNode===document)return!0;i=i.parentNode instanceof ShadowRoot?i.parentNode.host:i.parentNode}return!1})(e))return;const n=(a=>{const i=window.getComputedStyle(a);return{top:parseFloat(i.scrollMarginTop)||0,right:parseFloat(i.scrollMarginRight)||0,bottom:parseFloat(i.scrollMarginBottom)||0,left:parseFloat(i.scrollMarginLeft)||0}})(e);if((a=>typeof a=="object"&&typeof a.behavior=="function")(t))return t.behavior(pl(e,t));const r=typeof t=="boolean"||t==null?void 0:t.behavior;for(const{el:a,top:i,left:s}of pl(e,my(t))){const o=i-n.top+n.bottom,l=s-n.left+n.right;a.scroll({top:o,left:l,behavior:r})}}var Dn=[],gy=function(){return Dn.some(function(e){return e.activeTargets.length>0})},vy=function(){return Dn.some(function(e){return e.skippedTargets.length>0})},gl="ResizeObserver loop completed with undelivered notifications.",by=function(){var e;typeof ErrorEvent=="function"?e=new ErrorEvent("error",{message:gl}):(e=document.createEvent("Event"),e.initEvent("error",!1,!1),e.message=gl),window.dispatchEvent(e)},Nr;(function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(Nr||(Nr={}));var xn=function(e){return Object.freeze(e)},yy=function(){function e(t,n){this.inlineSize=t,this.blockSize=n,xn(this)}return e}(),nf=function(){function e(t,n,r,a){return this.x=t,this.y=n,this.width=r,this.height=a,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,xn(this)}return e.prototype.toJSON=function(){var t=this,n=t.x,r=t.y,a=t.top,i=t.right,s=t.bottom,o=t.left,l=t.width,u=t.height;return{x:n,y:r,top:a,right:i,bottom:s,left:o,width:l,height:u}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),go=function(e){return e instanceof SVGElement&&"getBBox"in e},rf=function(e){if(go(e)){var t=e.getBBox(),n=t.width,r=t.height;return!n&&!r}var a=e,i=a.offsetWidth,s=a.offsetHeight;return!(i||s||e.getClientRects().length)},vl=function(e){var t;if(e instanceof Element)return!0;var n=(t=e==null?void 0:e.ownerDocument)===null||t===void 0?void 0:t.defaultView;return!!(n&&e instanceof n.Element)},Cy=function(e){switch(e.tagName){case"INPUT":if(e.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},wr=typeof window<"u"?window:{},aa=new WeakMap,bl=/auto|scroll/,Dy=/^tb|vertical/,xy=/msie|trident/i.test(wr.navigator&&wr.navigator.userAgent),Ot=function(e){return parseFloat(e||"0")},Zn=function(e,t,n){return e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=!1),new yy((n?t:e)||0,(n?e:t)||0)},yl=xn({devicePixelContentBoxSize:Zn(),borderBoxSize:Zn(),contentBoxSize:Zn(),contentRect:new nf(0,0,0,0)}),af=function(e,t){if(t===void 0&&(t=!1),aa.has(e)&&!t)return aa.get(e);if(rf(e))return aa.set(e,yl),yl;var n=getComputedStyle(e),r=go(e)&&e.ownerSVGElement&&e.getBBox(),a=!xy&&n.boxSizing==="border-box",i=Dy.test(n.writingMode||""),s=!r&&bl.test(n.overflowY||""),o=!r&&bl.test(n.overflowX||""),l=r?0:Ot(n.paddingTop),u=r?0:Ot(n.paddingRight),c=r?0:Ot(n.paddingBottom),h=r?0:Ot(n.paddingLeft),p=r?0:Ot(n.borderTopWidth),m=r?0:Ot(n.borderRightWidth),g=r?0:Ot(n.borderBottomWidth),f=r?0:Ot(n.borderLeftWidth),b=h+u,v=l+c,E=f+m,k=p+g,x=o?e.offsetHeight-k-e.clientHeight:0,w=s?e.offsetWidth-E-e.clientWidth:0,A=a?b+E:0,S=a?v+k:0,W=r?r.width:Ot(n.width)-A-w,R=r?r.height:Ot(n.height)-S-x,I=W+b+w+E,N=R+v+x+k,_=xn({devicePixelContentBoxSize:Zn(Math.round(W*devicePixelRatio),Math.round(R*devicePixelRatio),i),borderBoxSize:Zn(I,N,i),contentBoxSize:Zn(W,R,i),contentRect:new nf(h,l,W,R)});return aa.set(e,_),_},sf=function(e,t,n){var r=af(e,n),a=r.borderBoxSize,i=r.contentBoxSize,s=r.devicePixelContentBoxSize;switch(t){case Nr.DEVICE_PIXEL_CONTENT_BOX:return s;case Nr.BORDER_BOX:return a;default:return i}},wy=function(){function e(t){var n=af(t);this.target=t,this.contentRect=n.contentRect,this.borderBoxSize=xn([n.borderBoxSize]),this.contentBoxSize=xn([n.contentBoxSize]),this.devicePixelContentBoxSize=xn([n.devicePixelContentBoxSize])}return e}(),of=function(e){if(rf(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},Ey=function(){var e=1/0,t=[];Dn.forEach(function(s){if(s.activeTargets.length!==0){var o=[];s.activeTargets.forEach(function(u){var c=new wy(u.target),h=of(u.target);o.push(c),u.lastReportedSize=sf(u.target,u.observedBox),h<e&&(e=h)}),t.push(function(){s.callback.call(s.observer,o,s.observer)}),s.activeTargets.splice(0,s.activeTargets.length)}});for(var n=0,r=t;n<r.length;n++){var a=r[n];a()}return e},Cl=function(e){Dn.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(a){a.isActive()&&(of(a.target)>e?n.activeTargets.push(a):n.skippedTargets.push(a))})})},_y=function(){var e=0;for(Cl(e);gy();)e=Ey(),Cl(e);return vy()&&by(),e>0},Oi,uf=[],ky=function(){return uf.splice(0).forEach(function(e){return e()})},By=function(e){if(!Oi){var t=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return ky()}).observe(n,r),Oi=function(){n.textContent="".concat(t?t--:t++)}}uf.push(e),Oi()},Fy=function(e){By(function(){requestAnimationFrame(e)})},Ca=0,Ay=function(){return!!Ca},Ty=250,Sy={attributes:!0,characterData:!0,childList:!0,subtree:!0},Dl=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],xl=function(e){return e===void 0&&(e=0),Date.now()+e},Pi=!1,jy=function(){function e(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return e.prototype.run=function(t){var n=this;if(t===void 0&&(t=Ty),!Pi){Pi=!0;var r=xl(t);Fy(function(){var a=!1;try{a=_y()}finally{if(Pi=!1,t=r-xl(),!Ay())return;a?n.run(1e3):t>0?n.run(t):n.start()}})}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var t=this,n=function(){return t.observer&&t.observer.observe(document.body,Sy)};document.body?n():wr.addEventListener("DOMContentLoaded",n)},e.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Dl.forEach(function(n){return wr.addEventListener(n,t.listener,!0)}))},e.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),Dl.forEach(function(n){return wr.removeEventListener(n,t.listener,!0)}),this.stopped=!0)},e}(),Bs=new jy,wl=function(e){!Ca&&e>0&&Bs.start(),Ca+=e,!Ca&&Bs.stop()},Oy=function(e){return!go(e)&&!Cy(e)&&getComputedStyle(e).display==="inline"},Py=function(){function e(t,n){this.target=t,this.observedBox=n||Nr.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var t=sf(this.target,this.observedBox,!0);return Oy(this.target)&&(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),Ny=function(){function e(t,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=n}return e}(),ia=new WeakMap,El=function(e,t){for(var n=0;n<e.length;n+=1)if(e[n].target===t)return n;return-1},sa=function(){function e(){}return e.connect=function(t,n){var r=new Ny(t,n);ia.set(t,r)},e.observe=function(t,n,r){var a=ia.get(t),i=a.observationTargets.length===0;El(a.observationTargets,n)<0&&(i&&Dn.push(a),a.observationTargets.push(new Py(n,r&&r.box)),wl(1),Bs.schedule())},e.unobserve=function(t,n){var r=ia.get(t),a=El(r.observationTargets,n),i=r.observationTargets.length===1;a>=0&&(i&&Dn.splice(Dn.indexOf(r),1),r.observationTargets.splice(a,1),wl(-1))},e.disconnect=function(t){var n=this,r=ia.get(t);r.observationTargets.slice().forEach(function(a){return n.unobserve(t,a.target)}),r.activeTargets.splice(0,r.activeTargets.length)},e}(),My=function(){function e(t){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof t!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");sa.connect(this,t)}return e.prototype.observe=function(t,n){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!vl(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");sa.observe(this,t,n)},e.prototype.unobserve=function(t){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!vl(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");sa.unobserve(this,t)},e.prototype.disconnect=function(){sa.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}(),Jt={};Object.defineProperty(Jt,"__esModule",{value:!0});var Ry=typeof window<"u"&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),Ni={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},lf={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:Ry?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},vo={backspace:8,tab:9,enter:13,shift:16,control:17,alt:18,pause:19,capslock:20,escape:27," ":32,pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,insert:45,delete:46,meta:91,numlock:144,scrolllock:145,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222};for(var oa=1;oa<20;oa++)vo["f"+oa]=111+oa;function ai(e,t,n){t&&!("byKey"in t)&&(n=t,t=null),Array.isArray(e)||(e=[e]);var r=e.map(function(s){return cf(s,t)}),a=function(o){return r.some(function(l){return df(l,o)})},i=n==null?a:a(n);return i}function Iy(e,t){return ai(e,t)}function $y(e,t){return ai(e,{byKey:!0},t)}function cf(e,t){var n=t&&t.byKey,r={};e=e.replace("++","+add");var a=e.split("+"),i=a.length;for(var s in Ni)r[Ni[s]]=!1;var o=!0,l=!1,u=void 0;try{for(var c=a[Symbol.iterator](),h;!(o=(h=c.next()).done);o=!0){var p=h.value,m=p.endsWith("?")&&p.length>1;m&&(p=p.slice(0,-1));var g=bo(p),f=Ni[g];if(p.length>1&&!f&&!lf[p]&&!vo[g])throw new TypeError('Unknown modifier: "'+p+'"');(i===1||!f)&&(n?r.key=g:r.which=ff(p)),f&&(r[f]=m?null:!0)}}catch(b){l=!0,u=b}finally{try{!o&&c.return&&c.return()}finally{if(l)throw u}}return r}function df(e,t){for(var n in e){var r=e[n],a=void 0;if(r!=null&&(n==="key"&&t.key!=null?a=t.key.toLowerCase():n==="which"?a=r===91&&t.which===93?91:t.which:a=t[n],!(a==null&&r===!1)&&a!==r))return!1}return!0}function ff(e){e=bo(e);var t=vo[e]||e.toUpperCase().charCodeAt(0);return t}function bo(e){return e=e.toLowerCase(),e=lf[e]||e,e}var Ly=Jt.default=ai,Mi=Jt.isHotkey=ai;Jt.isCodeHotkey=Iy;Jt.isKeyHotkey=$y;Jt.parseHotkey=cf;Jt.compareHotkey=df;Jt.toKeyCode=ff;Jt.toKeyName=bo;function zy(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,i;for(i=0;i<r.length;i++)a=r[i],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function er(e,t){if(e==null)return{};var n=zy(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Mr(e){"@babel/helpers - typeof";return Mr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mr(e)}function qy(e,t){if(Mr(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Mr(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Wy(e){var t=qy(e,"string");return Mr(t)==="symbol"?t:String(t)}function _t(e,t,n){return t=Wy(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var yo=y.createContext(null),fn=()=>{var e=y.useContext(yo);if(!e)throw new Error("The `useSlateStatic` hook must be used inside the <Slate> component's context.");return e},hf=parseInt(y.version.split(".")[0],10),Uy=typeof navigator<"u"&&typeof window<"u"&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,_l=typeof navigator<"u"&&/Mac OS X/.test(navigator.userAgent),ut=typeof navigator<"u"&&/Android/.test(navigator.userAgent),Hn=typeof navigator<"u"&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Cr=typeof navigator<"u"&&/AppleWebKit(?!.*Chrome)/i.test(navigator.userAgent),Hy=typeof navigator<"u"&&/Edge?\/(?:[0-6][0-9]|[0-7][0-8])(?:\.)/i.test(navigator.userAgent),mf=typeof navigator<"u"&&/Chrome/i.test(navigator.userAgent),Vy=typeof navigator<"u"&&/Chrome?\/(?:[0-7][0-5]|[0-6][0-9])(?:\.)/i.test(navigator.userAgent),Ky=ut&&typeof navigator<"u"&&/Chrome?\/(?:[0-5]?\d)(?:\.)/i.test(navigator.userAgent),Zy=typeof navigator<"u"&&/^(?!.*Seamonkey)(?=.*Firefox\/(?:[0-7][0-9]|[0-8][0-6])(?:\.)).*/i.test(navigator.userAgent),Yy=typeof navigator<"u"&&/.*UCBrowser/.test(navigator.userAgent),Gy=typeof navigator<"u"&&/.*Wechat/.test(navigator.userAgent)&&!/.*MacWechat/.test(navigator.userAgent),Da=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",en=(!Vy||!Ky)&&!Hy&&typeof globalThis<"u"&&globalThis.InputEvent&&typeof globalThis.InputEvent.prototype.getTargetRanges=="function",Co=new WeakMap,Do=new WeakMap,pf=new WeakMap,xa=new WeakMap,Fs=new WeakMap,Rr=new WeakMap,wn=new WeakMap,Ia=new WeakMap,ii=new WeakMap,As=new WeakMap,on=new WeakMap,bn=new WeakMap,Er=new WeakMap,Ts=new WeakMap,xo=new WeakMap,Tt=new WeakMap,Kt=new WeakMap,dt=new WeakMap,nn=new WeakMap,rn=new WeakMap,gf=new WeakMap,tr=Symbol("placeholder"),vf=Symbol("mark-placeholder"),Qy=globalThis.Text,wo=e=>e&&e.ownerDocument&&e.ownerDocument.defaultView||null,Jy=e=>un(e)&&e.nodeType===8,Et=e=>un(e)&&e.nodeType===1,un=e=>{var t=wo(e);return!!t&&e instanceof t.Node},Ss=e=>{var t=e&&e.anchorNode&&wo(e.anchorNode);return!!t&&e instanceof t.Selection},bf=e=>un(e)&&e.nodeType===3,Xy=e=>e.clipboardData&&e.clipboardData.getData("text/plain")!==""&&e.clipboardData.types.length===1,e1=e=>{var[t,n]=e;if(Et(t)&&t.childNodes.length){var r=n===t.childNodes.length,a=r?n-1:n;for([t,a]=yf(t,a,r?"backward":"forward"),r=a<n;Et(t)&&t.childNodes.length;){var i=r?t.childNodes.length-1:0;t=n1(t,i,r?"backward":"forward")}n=r&&t.textContent!=null?t.textContent.length:0}return[t,n]},t1=e=>{for(var t=e&&e.parentNode;t;){if(t.toString()==="[object ShadowRoot]")return!0;t=t.parentNode}return!1},yf=(e,t,n)=>{for(var{childNodes:r}=e,a=r[t],i=t,s=!1,o=!1;(Jy(a)||Et(a)&&a.childNodes.length===0||Et(a)&&a.getAttribute("contenteditable")==="false")&&!(s&&o);){if(i>=r.length){s=!0,i=t-1,n="backward";continue}if(i<0){o=!0,i=t+1,n="forward";continue}a=r[i],t=i,i+=n==="forward"?1:-1}return[a,t]},n1=(e,t,n)=>{var[r]=yf(e,t,n);return r},Cf=e=>{var t="";if(bf(e)&&e.nodeValue)return e.nodeValue;if(Et(e)){for(var n of Array.from(e.childNodes))t+=Cf(n);var r=getComputedStyle(e).getPropertyValue("display");(r==="block"||r==="list"||e.tagName==="BR")&&(t+=`
130
- `)}return t},r1=/data-slate-fragment="(.+?)"/m,a1=e=>{var t=e.getData("text/html"),[,n]=t.match(r1)||[];return n},Eo=(e,t,n)=>{var{target:r}=t;if(Et(r)&&r.matches('[contentEditable="false"]'))return!1;var{document:a}=te.getWindow(e);if(a.contains(r))return te.hasDOMNode(e,r,{editable:!0});var i=n.find(s=>{var{addedNodes:o,removedNodes:l}=s;for(var u of o)if(u===r||u.contains(r))return!0;for(var c of l)if(c===r||c.contains(r))return!0});return!i||i===t?!1:Eo(e,i,n)},i1=0;class s1{constructor(){_t(this,"id",void 0),this.id="".concat(i1++)}}var te={androidPendingDiffs:e=>dt.get(e),androidScheduleFlush:e=>{var t;(t=xo.get(e))===null||t===void 0||t()},blur:e=>{var t=te.toDOMNode(e,e),n=te.findDocumentOrShadowRoot(e);on.set(e,!1),n.activeElement===t&&t.blur()},deselect:e=>{var{selection:t}=e,n=te.findDocumentOrShadowRoot(e),r=n.getSelection();r&&r.rangeCount>0&&r.removeAllRanges(),t&&X.deselect(e)},findDocumentOrShadowRoot:e=>{var t=te.toDOMNode(e,e),n=t.getRootNode();return(n instanceof Document||n instanceof ShadowRoot)&&n.getSelection!=null?n:t.ownerDocument},findEventRange:(e,t)=>{"nativeEvent"in t&&(t=t.nativeEvent);var{clientX:n,clientY:r,target:a}=t;if(n==null||r==null)throw new Error("Cannot resolve a Slate range from a DOM event: ".concat(t));var i=te.toSlateNode(e,t.target),s=te.findPath(e,i);if(de.isElement(i)&&C.isVoid(e,i)){var o=a.getBoundingClientRect(),l=e.isInline(i)?n-o.left<o.left+o.width-n:r-o.top<o.top+o.height-r,u=C.point(e,s,{edge:l?"start":"end"}),c=l?C.before(e,u):C.after(e,u);if(c){var h=C.range(e,c);return h}}var p,{document:m}=te.getWindow(e);if(m.caretRangeFromPoint)p=m.caretRangeFromPoint(n,r);else{var g=m.caretPositionFromPoint(n,r);g&&(p=m.createRange(),p.setStart(g.offsetNode,g.offset),p.setEnd(g.offsetNode,g.offset))}if(!p)throw new Error("Cannot resolve a Slate range from a DOM event: ".concat(t));var f=te.toSlateRange(e,p,{exactMatch:!1,suppressThrow:!1});return f},findKey:(e,t)=>{var n=Ia.get(t);return n||(n=new s1,Ia.set(t,n)),n},findPath:(e,t)=>{for(var n=[],r=t;;){var a=Do.get(r);if(a==null){if(C.isEditor(r))return n;break}var i=Co.get(r);if(i==null)break;n.unshift(i),r=a}throw new Error("Unable to find the path for Slate node: ".concat(Xe.stringify(t)))},focus:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{retries:5};if(!on.get(t)){if(n.retries<=0)throw new Error("Could not set focus, editor seems stuck with pending operations");if(t.operations.length>0){setTimeout(()=>{te.focus(t,{retries:n.retries-1})},10);return}var r=te.toDOMNode(t,t),a=te.findDocumentOrShadowRoot(t);if(a.activeElement!==r){if(t.selection&&a instanceof Document){var i=a.getSelection(),s=te.toDOMRange(t,t.selection);i==null||i.removeAllRanges(),i==null||i.addRange(s)}t.selection||(X.select(t,C.start(t,[])),t.onChange()),on.set(t,!0),r.focus({preventScroll:!0})}}},getWindow:e=>{var t=pf.get(e);if(!t)throw new Error("Unable to find a host window element for this editor");return t},hasDOMNode:function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{editable:a=!1}=r,i=te.toDOMNode(t,t),s;try{s=Et(n)?n:n.parentElement}catch(o){if(o instanceof Error&&!o.message.includes('Permission denied to access property "nodeType"'))throw o}return s?s.closest("[data-slate-editor]")===i&&(!a||s.isContentEditable?!0:typeof s.isContentEditable=="boolean"&&s.closest('[contenteditable="false"]')===i||!!s.getAttribute("data-slate-zero-width")):!1},hasEditableTarget:(e,t)=>un(t)&&te.hasDOMNode(e,t,{editable:!0}),hasRange:(e,t)=>{var{anchor:n,focus:r}=t;return C.hasPath(e,n.path)&&C.hasPath(e,r.path)},hasSelectableTarget:(e,t)=>te.hasEditableTarget(e,t)||te.isTargetInsideNonReadonlyVoid(e,t),hasTarget:(e,t)=>un(t)&&te.hasDOMNode(e,t),insertData:(e,t)=>{e.insertData(t)},insertFragmentData:(e,t)=>e.insertFragmentData(t),insertTextData:(e,t)=>e.insertTextData(t),isComposing:e=>!!bn.get(e),isFocused:e=>!!on.get(e),isReadOnly:e=>!!As.get(e),isTargetInsideNonReadonlyVoid:(e,t)=>{if(As.get(e))return!1;var n=te.hasTarget(e,t)&&te.toSlateNode(e,t);return de.isElement(n)&&C.isVoid(e,n)},setFragmentData:(e,t,n)=>e.setFragmentData(t,n),toDOMNode:(e,t)=>{var n=ii.get(e),r=C.isEditor(t)?xa.get(e):n==null?void 0:n.get(te.findKey(e,t));if(!r)throw new Error("Cannot resolve a DOM node from Slate node: ".concat(Xe.stringify(t)));return r},toDOMPoint:(e,t)=>{var[n]=C.node(e,t.path),r=te.toDOMNode(e,n),a;C.void(e,{at:t})&&(t={path:t.path,offset:0});for(var i="[data-slate-string], [data-slate-zero-width]",s=Array.from(r.querySelectorAll(i)),o=0,l=0;l<s.length;l++){var u=s[l],c=u.childNodes[0];if(!(c==null||c.textContent==null)){var{length:h}=c.textContent,p=u.getAttribute("data-slate-length"),m=p==null?h:parseInt(p,10),g=o+m,f=s[l+1];if(t.offset===g&&f!==null&&f!==void 0&&f.hasAttribute("data-slate-mark-placeholder")){var b,v=f.childNodes[0];a=[v instanceof Qy?v:f,(b=f.textContent)!==null&&b!==void 0&&b.startsWith("\uFEFF")?1:0];break}if(t.offset<=g){var E=Math.min(h,Math.max(0,t.offset-o));a=[c,E];break}o=g}}if(!a)throw new Error("Cannot resolve a DOM point from Slate point: ".concat(Xe.stringify(t)));return a},toDOMRange:(e,t)=>{var{anchor:n,focus:r}=t,a=Z.isBackward(t),i=te.toDOMPoint(e,n),s=Z.isCollapsed(t)?i:te.toDOMPoint(e,r),o=te.getWindow(e),l=o.document.createRange(),[u,c]=a?s:i,[h,p]=a?i:s,m=Et(u)?u:u.parentElement,g=!!m.getAttribute("data-slate-zero-width"),f=Et(h)?h:h.parentElement,b=!!f.getAttribute("data-slate-zero-width");return l.setStart(u,g?1:c),l.setEnd(h,b?1:p),l},toSlateNode:(e,t)=>{var n=Et(t)?t:t.parentElement;n&&!n.hasAttribute("data-slate-node")&&(n=n.closest("[data-slate-node]"));var r=n?Rr.get(n):null;if(!r)throw new Error("Cannot resolve a Slate node from DOM node: ".concat(n));return r},toSlatePoint:(e,t,n)=>{var{exactMatch:r,suppressThrow:a}=n,[i,s]=r?t:e1(t),o=i.parentNode,l=null,u=0;if(o){var c,h,p=te.toDOMNode(e,e),m=o.closest('[data-slate-void="true"]'),g=m&&p.contains(m)?m:null,f=o.closest("[data-slate-leaf]"),b=null;if(f){if(l=f.closest('[data-slate-node="text"]'),l){var v=te.getWindow(e),E=v.document.createRange();E.setStart(l,0),E.setEnd(i,s);var k=E.cloneContents(),x=[...Array.prototype.slice.call(k.querySelectorAll("[data-slate-zero-width]")),...Array.prototype.slice.call(k.querySelectorAll("[contenteditable=false]"))];x.forEach(j=>{if(ut&&!r&&j.hasAttribute("data-slate-zero-width")&&j.textContent.length>0&&j.textContext!=="\uFEFF"){j.textContent.startsWith("\uFEFF")&&(j.textContent=j.textContent.slice(1));return}j.parentNode.removeChild(j)}),u=k.textContent.length,b=l}}else if(g){for(var w=g.querySelectorAll("[data-slate-leaf]"),A=0;A<w.length;A++){var S=w[A];if(te.hasDOMNode(e,S)){f=S;break}}f?(l=f.closest('[data-slate-node="text"]'),b=f,u=b.textContent.length,b.querySelectorAll("[data-slate-zero-width]").forEach(j=>{u-=j.textContent.length})):u=1}b&&u===b.textContent.length&&ut&&b.getAttribute("data-slate-zero-width")==="z"&&(c=b.textContent)!==null&&c!==void 0&&c.startsWith("\uFEFF")&&(o.hasAttribute("data-slate-zero-width")||Hn&&(h=b.textContent)!==null&&h!==void 0&&h.endsWith(`
129
+ */function Du(e){return Object.prototype.toString.call(e)==="[object Object]"}function tt(e){var t,n;return Du(e)===!1?!1:(t=e.constructor,t===void 0?!0:(n=t.prototype,!(Du(n)===!1||n.hasOwnProperty("isPrototypeOf")===!1)))}var Id=Symbol.for("immer-nothing"),xu=Symbol.for("immer-draftable"),vt=Symbol.for("immer-state"),Cg=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function dt(e,...t){if(process.env.NODE_ENV!=="production"){const n=Cg[e],r=typeof n=="function"?n.apply(null,t):n;throw new Error(`[Immer] ${r}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Xn=Object.getPrototypeOf;function Fn(e){return!!e&&!!e[vt]}function Bn(e){var t;return e?$d(e)||Array.isArray(e)||!!e[xu]||!!((t=e.constructor)!=null&&t[xu])||ti(e)||ni(e):!1}var Dg=Object.prototype.constructor.toString();function $d(e){if(!e||typeof e!="object")return!1;const t=Xn(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===Dg}function Oa(e,t){ei(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function ei(e){const t=e[vt];return t?t.type_:Array.isArray(e)?1:ti(e)?2:ni(e)?3:0}function Ds(e,t){return ei(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Ld(e,t,n){const r=ei(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function xg(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function ti(e){return e instanceof Map}function ni(e){return e instanceof Set}function gn(e){return e.copy_||e.base_}function xs(e,t){if(ti(e))return new Map(e);if(ni(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=$d(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[vt];let a=Reflect.ownKeys(r);for(let i=0;i<a.length;i++){const s=a[i],o=r[s];o.writable===!1&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(r[s]={configurable:!0,writable:!0,enumerable:o.enumerable,value:e[s]})}return Object.create(Xn(e),r)}else{const r=Xn(e);if(r!==null&&n)return{...e};const a=Object.create(r);return Object.assign(a,e)}}function uo(e,t=!1){return ri(e)||Fn(e)||!Bn(e)||(ei(e)>1&&(e.set=e.add=e.clear=e.delete=wg),Object.freeze(e),t&&Object.entries(e).forEach(([n,r])=>uo(r,!0))),e}function wg(){dt(2)}function ri(e){return Object.isFrozen(e)}var Eg={};function An(e){const t=Eg[e];return t||dt(0,e),t}var jr;function zd(){return jr}function _g(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function wu(e,t){t&&(An("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function ws(e){Es(e),e.drafts_.forEach(kg),e.drafts_=null}function Es(e){e===jr&&(jr=e.parent_)}function Eu(e){return jr=_g(jr,e)}function kg(e){const t=e[vt];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function _u(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[vt].modified_&&(ws(t),dt(4)),Bn(e)&&(e=Pa(t,e),t.parent_||Na(t,e)),t.patches_&&An("Patches").generateReplacementPatches_(n[vt].base_,e,t.patches_,t.inversePatches_)):e=Pa(t,n,[]),ws(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Id?e:void 0}function Pa(e,t,n){if(ri(t))return t;const r=t[vt];if(!r)return Oa(t,(a,i)=>ku(e,r,t,a,i,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return Na(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const a=r.copy_;let i=a,s=!1;r.type_===3&&(i=new Set(a),a.clear(),s=!0),Oa(i,(o,l)=>ku(e,r,a,o,l,n,s)),Na(e,a,!1),n&&e.patches_&&An("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function ku(e,t,n,r,a,i,s){if(process.env.NODE_ENV!=="production"&&a===n&&dt(5),Fn(a)){const o=i&&t&&t.type_!==3&&!Ds(t.assigned_,r)?i.concat(r):void 0,l=Pa(e,a,o);if(Ld(n,r,l),Fn(l))e.canAutoFreeze_=!1;else return}else s&&n.add(a);if(Bn(a)&&!ri(a)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Pa(e,a),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,r)&&Na(e,a)}}function Na(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&uo(t,n)}function Fg(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:zd(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let a=r,i=lo;n&&(a=[r],i=Or);const{revoke:s,proxy:o}=Proxy.revocable(a,i);return r.draft_=o,r.revoke_=s,o}var lo={get(e,t){if(t===vt)return e;const n=gn(e);if(!Ds(n,t))return Bg(e,n,t);const r=n[t];return e.finalized_||!Bn(r)?r:r===Fi(e.base_,t)?(Bi(e),e.copy_[t]=ks(r,e)):r},has(e,t){return t in gn(e)},ownKeys(e){return Reflect.ownKeys(gn(e))},set(e,t,n){const r=qd(gn(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const a=Fi(gn(e),t),i=a==null?void 0:a[vt];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(xg(n,a)&&(n!==void 0||Ds(e.base_,t)))return!0;Bi(e),_s(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return Fi(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Bi(e),_s(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=gn(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){dt(11)},getPrototypeOf(e){return Xn(e.base_)},setPrototypeOf(){dt(12)}},Or={};Oa(lo,(e,t)=>{Or[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Or.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&dt(13),Or.set.call(this,e,t,void 0)};Or.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&dt(14),lo.set.call(this,e[0],t,n,e[0])};function Fi(e,t){const n=e[vt];return(n?gn(n):e)[t]}function Bg(e,t,n){var a;const r=qd(t,n);return r?"value"in r?r.value:(a=r.get)==null?void 0:a.call(e.draft_):void 0}function qd(e,t){if(!(t in e))return;let n=Xn(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Xn(n)}}function _s(e){e.modified_||(e.modified_=!0,e.parent_&&_s(e.parent_))}function Bi(e){e.copy_||(e.copy_=xs(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Ag=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const i=n;n=t;const s=this;return function(l=i,...u){return s.produce(l,c=>n.call(this,c,...u))}}typeof n!="function"&&dt(6),r!==void 0&&typeof r!="function"&&dt(7);let a;if(Bn(t)){const i=Eu(this),s=ks(t,void 0);let o=!0;try{a=n(s),o=!1}finally{o?ws(i):Es(i)}return wu(i,r),_u(a,i)}else if(!t||typeof t!="object"){if(a=n(t),a===void 0&&(a=t),a===Id&&(a=void 0),this.autoFreeze_&&uo(a,!0),r){const i=[],s=[];An("Patches").generateReplacementPatches_(t,a,i,s),r(i,s)}return a}else dt(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(s,...o)=>this.produceWithPatches(s,l=>t(l,...o));let r,a;return[this.produce(t,n,(s,o)=>{r=s,a=o}),r,a]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Bn(e)||dt(8),Fn(e)&&(e=Tg(e));const t=Eu(this),n=ks(e,void 0);return n[vt].isManual_=!0,Es(t),n}finishDraft(e,t){const n=e&&e[vt];(!n||!n.isManual_)&&dt(9);const{scope_:r}=n;return wu(r,t),_u(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const a=t[n];if(a.path.length===0&&a.op==="replace"){e=a.value;break}}n>-1&&(t=t.slice(n+1));const r=An("Patches").applyPatches_;return Fn(e)?r(e,t):this.produce(e,a=>r(a,t))}};function ks(e,t){const n=ti(e)?An("MapSet").proxyMap_(e,t):ni(e)?An("MapSet").proxySet_(e,t):Fg(e,t);return(t?t.scope_:zd()).drafts_.push(n),n}function Tg(e){return Fn(e)||dt(10,e),Wd(e)}function Wd(e){if(!Bn(e)||ri(e))return e;const t=e[vt];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=xs(e,t.scope_.immer_.useStrictShallowCopy_)}else n=xs(e,!0);return Oa(n,(r,a)=>{Ld(n,r,Wd(a))}),t&&(t.finalized_=!1),n}var bt=new Ag,co=bt.produce;bt.produceWithPatches.bind(bt);bt.setAutoFreeze.bind(bt);bt.setUseStrictShallowCopy.bind(bt);bt.applyPatches.bind(bt);var Fu=bt.createDraft.bind(bt),Bu=bt.finishDraft.bind(bt),Sg={transform(e,t){var{current:n,affinity:r}=e;if(n!=null){var a=P.transform(n,t,{affinity:r});e.current=a,a==null&&e.unref()}}},jg={transform(e,t){var{current:n,affinity:r}=e;if(n!=null){var a=Ee.transform(n,t,{affinity:r});e.current=a,a==null&&e.unref()}}},Og={transform(e,t){var{current:n,affinity:r}=e;if(n!=null){var a=K.transform(n,t,{affinity:r});e.current=a,a==null&&e.unref()}}},Ra=new WeakMap,Ma=new WeakMap,xr=new WeakMap,Ud=new WeakMap,Au=new WeakMap,Tu=new WeakMap,Su=new WeakMap,P={ancestors(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{reverse:n=!1}=t,r=P.levels(e,t);return n?r=r.slice(1):r=r.slice(0,-1),r},common(e,t){for(var n=[],r=0;r<e.length&&r<t.length;r++){var a=e[r],i=t[r];if(a!==i)break;n.push(a)}return n},compare(e,t){for(var n=Math.min(e.length,t.length),r=0;r<n;r++){if(e[r]<t[r])return-1;if(e[r]>t[r])return 1}return 0},endsAfter(e,t){var n=e.length-1,r=e.slice(0,n),a=t.slice(0,n),i=e[n],s=t[n];return P.equals(r,a)&&i>s},endsAt(e,t){var n=e.length,r=e.slice(0,n),a=t.slice(0,n);return P.equals(r,a)},endsBefore(e,t){var n=e.length-1,r=e.slice(0,n),a=t.slice(0,n),i=e[n],s=t[n];return P.equals(r,a)&&i<s},equals(e,t){return e.length===t.length&&e.every((n,r)=>n===t[r])},hasPrevious(e){return e[e.length-1]>0},isAfter(e,t){return P.compare(e,t)===1},isAncestor(e,t){return e.length<t.length&&P.compare(e,t)===0},isBefore(e,t){return P.compare(e,t)===-1},isChild(e,t){return e.length===t.length+1&&P.compare(e,t)===0},isCommon(e,t){return e.length<=t.length&&P.compare(e,t)===0},isDescendant(e,t){return e.length>t.length&&P.compare(e,t)===0},isParent(e,t){return e.length+1===t.length&&P.compare(e,t)===0},isPath(e){return Array.isArray(e)&&(e.length===0||typeof e[0]=="number")},isSibling(e,t){if(e.length!==t.length)return!1;var n=e.slice(0,-1),r=t.slice(0,-1),a=e[e.length-1],i=t[t.length-1];return a!==i&&P.equals(n,r)},levels(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{reverse:n=!1}=t,r=[],a=0;a<=e.length;a++)r.push(e.slice(0,a));return n&&r.reverse(),r},next(e){if(e.length===0)throw new Error("Cannot get the next path of a root path [".concat(e,"], because it has no next index."));var t=e[e.length-1];return e.slice(0,-1).concat(t+1)},operationCanTransformPath(e){switch(e.type){case"insert_node":case"remove_node":case"merge_node":case"split_node":case"move_node":return!0;default:return!1}},parent(e){if(e.length===0)throw new Error("Cannot get the parent path of the root path [".concat(e,"]."));return e.slice(0,-1)},previous(e){if(e.length===0)throw new Error("Cannot get the previous path of a root path [".concat(e,"], because it has no previous index."));var t=e[e.length-1];if(t<=0)throw new Error("Cannot get the previous path of a first child path [".concat(e,"] because it would result in a negative index."));return e.slice(0,-1).concat(t-1)},relative(e,t){if(!P.isAncestor(t,e)&&!P.equals(e,t))throw new Error("Cannot get the relative path of [".concat(e,"] inside ancestor [").concat(t,"], because it is not above or equal to the path."));return e.slice(t.length)},transform(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!e)return null;var r=[...e],{affinity:a="forward"}=n;if(e.length===0)return r;switch(t.type){case"insert_node":{var{path:i}=t;(P.equals(i,r)||P.endsBefore(i,r)||P.isAncestor(i,r))&&(r[i.length-1]+=1);break}case"remove_node":{var{path:s}=t;if(P.equals(s,r)||P.isAncestor(s,r))return null;P.endsBefore(s,r)&&(r[s.length-1]-=1);break}case"merge_node":{var{path:o,position:l}=t;P.equals(o,r)||P.endsBefore(o,r)?r[o.length-1]-=1:P.isAncestor(o,r)&&(r[o.length-1]-=1,r[o.length]+=l);break}case"split_node":{var{path:u,position:c}=t;if(P.equals(u,r)){if(a==="forward")r[r.length-1]+=1;else if(a!=="backward")return null}else P.endsBefore(u,r)?r[u.length-1]+=1:P.isAncestor(u,r)&&e[u.length]>=c&&(r[u.length-1]+=1,r[u.length]-=c);break}case"move_node":{var{path:h,newPath:p}=t;if(P.equals(h,p))return r;if(P.isAncestor(h,r)||P.equals(h,r)){var m=p.slice();return P.endsBefore(h,p)&&h.length<p.length&&(m[h.length-1]-=1),m.concat(r.slice(h.length))}else P.isSibling(h,p)&&(P.isAncestor(p,r)||P.equals(p,r))?P.endsBefore(h,r)?r[h.length-1]-=1:r[h.length-1]+=1:P.endsBefore(p,r)||P.equals(p,r)||P.isAncestor(p,r)?(P.endsBefore(h,r)&&(r[h.length-1]-=1),r[p.length-1]+=1):P.endsBefore(h,r)&&(P.equals(p,r)&&(r[p.length-1]+=1),r[h.length-1]-=1);break}}return r}};function Pr(e){"@babel/helpers - typeof";return Pr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pr(e)}function Pg(e,t){if(Pr(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Pr(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ng(e){var t=Pg(e,"string");return Pr(t)==="symbol"?t:String(t)}function ut(e,t,n){return t=Ng(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ju(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function pr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ju(Object(n),!0).forEach(function(r){ut(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ju(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Rg=(e,t,n)=>{switch(n.type){case"insert_node":{var{path:r,node:a}=n,i=ue.parent(e,r),s=r[r.length-1];if(s>i.children.length)throw new Error('Cannot apply an "insert_node" operation at path ['.concat(r,"] because the destination is past the end of the node."));if(i.children.splice(s,0,a),t)for(var[o,l]of K.points(t))t[l]=Ee.transform(o,n);break}case"insert_text":{var{path:u,offset:c,text:h}=n;if(h.length===0)break;var p=ue.leaf(e,u),m=p.text.slice(0,c),g=p.text.slice(c);if(p.text=m+h+g,t)for(var[f,b]of K.points(t))t[b]=Ee.transform(f,n);break}case"merge_node":{var{path:v}=n,E=ue.get(e,v),k=P.previous(v),x=ue.get(e,k),w=ue.parent(e,v),A=v[v.length-1];if(fe.isText(E)&&fe.isText(x))x.text+=E.text;else if(!fe.isText(E)&&!fe.isText(x))x.children.push(...E.children);else throw new Error('Cannot apply a "merge_node" operation at path ['.concat(v,"] to nodes of different interfaces: ").concat(Xe.stringify(E)," ").concat(Xe.stringify(x)));if(w.children.splice(A,1),t)for(var[S,q]of K.points(t))t[q]=Ee.transform(S,n);break}case"move_node":{var{path:$,newPath:N}=n;if(P.isAncestor($,N))throw new Error("Cannot move a path [".concat($,"] to new path [").concat(N,"] because the destination is inside itself."));var L=ue.get(e,$),_=ue.parent(e,$),B=$[$.length-1];_.children.splice(B,1);var j=P.transform($,n),I=ue.get(e,P.parent(j)),G=j[j.length-1];if(I.children.splice(G,0,L),t)for(var[V,Q]of K.points(t))t[Q]=Ee.transform(V,n);break}case"remove_node":{var{path:ae}=n,D=ae[ae.length-1],M=ue.parent(e,ae);if(M.children.splice(D,1),t)for(var[W,F]of K.points(t)){var T=Ee.transform(W,n);if(t!=null&&T!=null)t[F]=T;else{var z=void 0,R=void 0;for(var[H,re]of ue.texts(e))if(P.compare(re,ae)===-1)z=[H,re];else{R=[H,re];break}var X=!1;z&&R&&(P.equals(R[1],ae)?X=!P.hasPrevious(R[1]):X=P.common(z[1],ae).length<P.common(R[1],ae).length),z&&!X?(W.path=z[1],W.offset=z[0].text.length):R?(W.path=R[1],W.offset=0):t=null}}break}case"remove_text":{var{path:ne,offset:le,text:ee}=n;if(ee.length===0)break;var he=ue.leaf(e,ne),me=he.text.slice(0,le),ye=he.text.slice(le+ee.length);if(he.text=me+ye,t)for(var[Be,Ae]of K.points(t))t[Ae]=Ee.transform(Be,n);break}case"set_node":{var{path:Ue,properties:Se,newProperties:Te}=n;if(Ue.length===0)throw new Error("Cannot set properties on the root node!");var Ne=ue.get(e,Ue);for(var _e in Te){if(_e==="children"||_e==="text")throw new Error('Cannot set the "'.concat(_e,'" property of nodes!'));var He=Te[_e];He==null?delete Ne[_e]:Ne[_e]=He}for(var ge in Se)Te.hasOwnProperty(ge)||delete Ne[ge];break}case"set_selection":{var{newProperties:U}=n;if(U==null)t=U;else{if(t==null){if(!K.isRange(U))throw new Error('Cannot apply an incomplete "set_selection" operation properties '.concat(Xe.stringify(U)," when there is no current selection."));t=pr({},U)}for(var ie in U){var pe=U[ie];if(pe==null){if(ie==="anchor"||ie==="focus")throw new Error('Cannot remove the "'.concat(ie,'" selection property'));delete t[ie]}else t[ie]=pe}}break}case"split_node":{var{path:ve,position:we,properties:Ke}=n;if(ve.length===0)throw new Error('Cannot apply a "split_node" operation at path ['.concat(ve,"] because the root node cannot be split."));var Qe=ue.get(e,ve),mt=ue.parent(e,ve),qt=ve[ve.length-1],kt;if(fe.isText(Qe)){var et=Qe.text.slice(0,we),St=Qe.text.slice(we);Qe.text=et,kt=pr(pr({},Ke),{},{text:St})}else{var pt=Qe.children.slice(0,we),li=Qe.children.slice(we);Qe.children=pt,kt=pr(pr({},Ke),{},{children:li})}if(mt.children.splice(qt+1,0,kt),t)for(var[ur,Hr]of K.points(t))t[Hr]=Ee.transform(ur,n);break}}return t},Mg={transform(e,t){e.children=Fu(e.children);var n=e.selection&&Fu(e.selection);try{n=Rg(e,n,t)}finally{e.children=Bu(e.children),n?e.selection=Fn(n)?Bu(n):n:e.selection=null}}},Ig={insertNodes(e,t,n){e.insertNodes(t,n)},liftNodes(e,t){e.liftNodes(t)},mergeNodes(e,t){e.mergeNodes(t)},moveNodes(e,t){e.moveNodes(t)},removeNodes(e,t){e.removeNodes(t)},setNodes(e,t,n){e.setNodes(t,n)},splitNodes(e,t){e.splitNodes(t)},unsetNodes(e,t,n){e.unsetNodes(t,n)},unwrapNodes(e,t){e.unwrapNodes(t)},wrapNodes(e,t,n){e.wrapNodes(t,n)}},$g={collapse(e,t){e.collapse(t)},deselect(e){e.deselect()},move(e,t){e.move(t)},select(e,t){e.select(t)},setPoint(e,t,n){e.setPoint(t,n)},setSelection(e,t){e.setSelection(t)}},Hd=(e,t)=>{for(var n in e){var r=e[n],a=t[n];if(tt(r)&&tt(a)){if(!Hd(r,a))return!1}else if(Array.isArray(r)&&Array.isArray(a)){if(r.length!==a.length)return!1;for(var i=0;i<r.length;i++)if(r[i]!==a[i])return!1}else if(r!==a)return!1}for(var s in t)if(e[s]===void 0&&t[s]!==void 0)return!1;return!0};function Lg(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,i;for(i=0;i<r.length;i++)a=r[i],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function Zt(e,t){if(e==null)return{};var n=Lg(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var zg=["anchor","focus"];function Ou(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function qg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ou(Object(n),!0).forEach(function(r){ut(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ou(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var K={edges(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{reverse:n=!1}=t,{anchor:r,focus:a}=e;return K.isBackward(e)===n?[r,a]:[a,r]},end(e){var[,t]=K.edges(e);return t},equals(e,t){return Ee.equals(e.anchor,t.anchor)&&Ee.equals(e.focus,t.focus)},includes(e,t){if(K.isRange(t)){if(K.includes(e,t.anchor)||K.includes(e,t.focus))return!0;var[n,r]=K.edges(e),[a,i]=K.edges(t);return Ee.isBefore(n,a)&&Ee.isAfter(r,i)}var[s,o]=K.edges(e),l=!1,u=!1;return Ee.isPoint(t)?(l=Ee.compare(t,s)>=0,u=Ee.compare(t,o)<=0):(l=P.compare(t,s.path)>=0,u=P.compare(t,o.path)<=0),l&&u},intersection(e,t){var n=Zt(e,zg),[r,a]=K.edges(e),[i,s]=K.edges(t),o=Ee.isBefore(r,i)?i:r,l=Ee.isBefore(a,s)?a:s;return Ee.isBefore(l,o)?null:qg({anchor:o,focus:l},n)},isBackward(e){var{anchor:t,focus:n}=e;return Ee.isAfter(t,n)},isCollapsed(e){var{anchor:t,focus:n}=e;return Ee.equals(t,n)},isExpanded(e){return!K.isCollapsed(e)},isForward(e){return!K.isBackward(e)},isRange(e){return tt(e)&&Ee.isPoint(e.anchor)&&Ee.isPoint(e.focus)},*points(e){yield[e.anchor,"anchor"],yield[e.focus,"focus"]},start(e){var[t]=K.edges(e);return t},transform(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return co(e,r=>{if(r===null)return null;var{affinity:a="inward"}=n,i,s;if(a==="inward"){var o=K.isCollapsed(r);K.isForward(r)?(i="forward",s=o?i:"backward"):(i="backward",s=o?i:"forward")}else a==="outward"?K.isForward(r)?(i="backward",s="forward"):(i="forward",s="backward"):(i=a,s=a);var l=Ee.transform(r.anchor,t,{affinity:i}),u=Ee.transform(r.focus,t,{affinity:s});if(!l||!u)return null;r.anchor=l,r.focus=u})}},Pu=e=>tt(e)&&ue.isNodeList(e.children)&&!y.isEditor(e),de={isAncestor(e){return tt(e)&&ue.isNodeList(e.children)},isElement:Pu,isElementList(e){return Array.isArray(e)&&e.every(t=>de.isElement(t))},isElementProps(e){return e.children!==void 0},isElementType:function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"type";return Pu(t)&&t[r]===n},matches(e,t){for(var n in t)if(n!=="children"&&e[n]!==t[n])return!1;return!0}},Wg=["children"],Ug=["text"],Nu=new WeakMap,ue={ancestor(e,t){var n=ue.get(e,t);if(fe.isText(n))throw new Error("Cannot get the ancestor node at path [".concat(t,"] because it refers to a text node instead: ").concat(Xe.stringify(n)));return n},ancestors(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return function*(){for(var r of P.ancestors(t,n)){var a=ue.ancestor(e,r),i=[a,r];yield i}}()},child(e,t){if(fe.isText(e))throw new Error("Cannot get the child of a text node: ".concat(Xe.stringify(e)));var n=e.children[t];if(n==null)throw new Error("Cannot get child at index `".concat(t,"` in node: ").concat(Xe.stringify(e)));return n},children(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return function*(){for(var{reverse:r=!1}=n,a=ue.ancestor(e,t),{children:i}=a,s=r?i.length-1:0;r?s>=0:s<i.length;){var o=ue.child(a,s),l=t.concat(s);yield[o,l],s=r?s-1:s+1}}()},common(e,t,n){var r=P.common(t,n),a=ue.get(e,r);return[a,r]},descendant(e,t){var n=ue.get(e,t);if(y.isEditor(n))throw new Error("Cannot get the descendant node at path [".concat(t,"] because it refers to the root editor node instead: ").concat(Xe.stringify(n)));return n},descendants(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){for(var[n,r]of ue.nodes(e,t))r.length!==0&&(yield[n,r])}()},elements(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){for(var[n,r]of ue.nodes(e,t))de.isElement(n)&&(yield[n,r])}()},extractProps(e){if(de.isAncestor(e)){var t=Zt(e,Wg);return t}else{var t=Zt(e,Ug);return t}},first(e,t){for(var n=t.slice(),r=ue.get(e,n);r&&!(fe.isText(r)||r.children.length===0);)r=r.children[0],n.push(0);return[r,n]},fragment(e,t){if(fe.isText(e))throw new Error("Cannot get a fragment starting from a root text node: ".concat(Xe.stringify(e)));var n=co({children:e.children},r=>{var[a,i]=K.edges(t),s=ue.nodes(r,{reverse:!0,pass:p=>{var[,m]=p;return!K.includes(t,m)}});for(var[,o]of s){if(!K.includes(t,o)){var l=ue.parent(r,o),u=o[o.length-1];l.children.splice(u,1)}if(P.equals(o,i.path)){var c=ue.leaf(r,o);c.text=c.text.slice(0,i.offset)}if(P.equals(o,a.path)){var h=ue.leaf(r,o);h.text=h.text.slice(a.offset)}}y.isEditor(r)&&(r.selection=null)});return n.children},get(e,t){for(var n=e,r=0;r<t.length;r++){var a=t[r];if(fe.isText(n)||!n.children[a])throw new Error("Cannot find a descendant at path [".concat(t,"] in node: ").concat(Xe.stringify(e)));n=n.children[a]}return n},has(e,t){for(var n=e,r=0;r<t.length;r++){var a=t[r];if(fe.isText(n)||!n.children[a])return!1;n=n.children[a]}return!0},isNode(e){return fe.isText(e)||de.isElement(e)||y.isEditor(e)},isNodeList(e){if(!Array.isArray(e))return!1;var t=Nu.get(e);if(t!==void 0)return t;var n=e.every(r=>ue.isNode(r));return Nu.set(e,n),n},last(e,t){for(var n=t.slice(),r=ue.get(e,n);r&&!(fe.isText(r)||r.children.length===0);){var a=r.children.length-1;r=r.children[a],n.push(a)}return[r,n]},leaf(e,t){var n=ue.get(e,t);if(!fe.isText(n))throw new Error("Cannot get the leaf node at path [".concat(t,"] because it refers to a non-leaf node: ").concat(Xe.stringify(n)));return n},levels(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return function*(){for(var r of P.levels(t,n)){var a=ue.get(e,r);yield[a,r]}}()},matches(e,t){return de.isElement(e)&&de.isElementProps(t)&&de.matches(e,t)||fe.isText(e)&&fe.isTextProps(t)&&fe.matches(e,t)},nodes(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){for(var{pass:n,reverse:r=!1}=t,{from:a=[],to:i}=t,s=new Set,o=[],l=e;!(i&&(r?P.isBefore(o,i):P.isAfter(o,i)));){if(s.has(l)||(yield[l,o]),!s.has(l)&&!fe.isText(l)&&l.children.length!==0&&(n==null||n([l,o])===!1)){s.add(l);var u=r?l.children.length-1:0;P.isAncestor(o,a)&&(u=a[o.length]),o=o.concat(u),l=ue.get(e,o);continue}if(o.length===0)break;if(!r){var c=P.next(o);if(ue.has(e,c)){o=c,l=ue.get(e,o);continue}}if(r&&o[o.length-1]!==0){var h=P.previous(o);o=h,l=ue.get(e,o);continue}o=P.parent(o),l=ue.get(e,o),s.add(l)}}()},parent(e,t){var n=P.parent(t),r=ue.get(e,n);if(fe.isText(r))throw new Error("Cannot get the parent of path [".concat(t,"] because it does not exist in the root."));return r},string(e){return fe.isText(e)?e.text:e.children.map(ue.string).join("")},texts(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){for(var[n,r]of ue.nodes(e,t))fe.isText(n)&&(yield[n,r])}()}};function Ru(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function qe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ru(Object(n),!0).forEach(function(r){ut(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ru(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var sn={isNodeOperation(e){return sn.isOperation(e)&&e.type.endsWith("_node")},isOperation(e){if(!tt(e))return!1;switch(e.type){case"insert_node":return P.isPath(e.path)&&ue.isNode(e.node);case"insert_text":return typeof e.offset=="number"&&typeof e.text=="string"&&P.isPath(e.path);case"merge_node":return typeof e.position=="number"&&P.isPath(e.path)&&tt(e.properties);case"move_node":return P.isPath(e.path)&&P.isPath(e.newPath);case"remove_node":return P.isPath(e.path)&&ue.isNode(e.node);case"remove_text":return typeof e.offset=="number"&&typeof e.text=="string"&&P.isPath(e.path);case"set_node":return P.isPath(e.path)&&tt(e.properties)&&tt(e.newProperties);case"set_selection":return e.properties===null&&K.isRange(e.newProperties)||e.newProperties===null&&K.isRange(e.properties)||tt(e.properties)&&tt(e.newProperties);case"split_node":return P.isPath(e.path)&&typeof e.position=="number"&&tt(e.properties);default:return!1}},isOperationList(e){return Array.isArray(e)&&e.every(t=>sn.isOperation(t))},isSelectionOperation(e){return sn.isOperation(e)&&e.type.endsWith("_selection")},isTextOperation(e){return sn.isOperation(e)&&e.type.endsWith("_text")},inverse(e){switch(e.type){case"insert_node":return qe(qe({},e),{},{type:"remove_node"});case"insert_text":return qe(qe({},e),{},{type:"remove_text"});case"merge_node":return qe(qe({},e),{},{type:"split_node",path:P.previous(e.path)});case"move_node":{var{newPath:t,path:n}=e;if(P.equals(t,n))return e;if(P.isSibling(n,t))return qe(qe({},e),{},{path:t,newPath:n});var r=P.transform(n,e),a=P.transform(P.next(n),e);return qe(qe({},e),{},{path:r,newPath:a})}case"remove_node":return qe(qe({},e),{},{type:"insert_node"});case"remove_text":return qe(qe({},e),{},{type:"insert_text"});case"set_node":{var{properties:i,newProperties:s}=e;return qe(qe({},e),{},{properties:s,newProperties:i})}case"set_selection":{var{properties:o,newProperties:l}=e;return o==null?qe(qe({},e),{},{properties:l,newProperties:null}):l==null?qe(qe({},e),{},{properties:null,newProperties:o}):qe(qe({},e),{},{properties:l,newProperties:o})}case"split_node":return qe(qe({},e),{},{type:"merge_node",path:P.next(e.path)})}}},Mu=new WeakMap,Hg=e=>{var t=Mu.get(e);if(t!==void 0)return t;if(!tt(e))return!1;var n=typeof e.addMark=="function"&&typeof e.apply=="function"&&typeof e.deleteFragment=="function"&&typeof e.insertBreak=="function"&&typeof e.insertSoftBreak=="function"&&typeof e.insertFragment=="function"&&typeof e.insertNode=="function"&&typeof e.insertText=="function"&&typeof e.isElementReadOnly=="function"&&typeof e.isInline=="function"&&typeof e.isSelectable=="function"&&typeof e.isVoid=="function"&&typeof e.normalizeNode=="function"&&typeof e.onChange=="function"&&typeof e.removeMark=="function"&&typeof e.getDirtyPaths=="function"&&(e.marks===null||tt(e.marks))&&(e.selection===null||K.isRange(e.selection))&&ue.isNodeList(e.children)&&sn.isOperationList(e.operations);return Mu.set(e,n),n},y={above(e,t){return e.above(t)},addMark(e,t,n){e.addMark(t,n)},after(e,t,n){return e.after(t,n)},before(e,t,n){return e.before(t,n)},deleteBackward(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{unit:n="character"}=t;e.deleteBackward(n)},deleteForward(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{unit:n="character"}=t;e.deleteForward(n)},deleteFragment(e,t){e.deleteFragment(t)},edges(e,t){return e.edges(t)},elementReadOnly(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return e.elementReadOnly(t)},end(e,t){return e.end(t)},first(e,t){return e.first(t)},fragment(e,t){return e.fragment(t)},hasBlocks(e,t){return e.hasBlocks(t)},hasInlines(e,t){return e.hasInlines(t)},hasPath(e,t){return e.hasPath(t)},hasTexts(e,t){return e.hasTexts(t)},insertBreak(e){e.insertBreak()},insertFragment(e,t,n){e.insertFragment(t,n)},insertNode(e,t){e.insertNode(t)},insertSoftBreak(e){e.insertSoftBreak()},insertText(e,t){e.insertText(t)},isBlock(e,t){return e.isBlock(t)},isEdge(e,t,n){return e.isEdge(t,n)},isEditor(e){return Hg(e)},isElementReadOnly(e,t){return e.isElementReadOnly(t)},isEmpty(e,t){return e.isEmpty(t)},isEnd(e,t,n){return e.isEnd(t,n)},isInline(e,t){return e.isInline(t)},isNormalizing(e){return e.isNormalizing()},isSelectable(e,t){return e.isSelectable(t)},isStart(e,t,n){return e.isStart(t,n)},isVoid(e,t){return e.isVoid(t)},last(e,t){return e.last(t)},leaf(e,t,n){return e.leaf(t,n)},levels(e,t){return e.levels(t)},marks(e){return e.getMarks()},next(e,t){return e.next(t)},node(e,t,n){return e.node(t,n)},nodes(e,t){return e.nodes(t)},normalize(e,t){e.normalize(t)},parent(e,t,n){return e.parent(t,n)},path(e,t,n){return e.path(t,n)},pathRef(e,t,n){return e.pathRef(t,n)},pathRefs(e){return e.pathRefs()},point(e,t,n){return e.point(t,n)},pointRef(e,t,n){return e.pointRef(t,n)},pointRefs(e){return e.pointRefs()},positions(e,t){return e.positions(t)},previous(e,t){return e.previous(t)},range(e,t,n){return e.range(t,n)},rangeRef(e,t,n){return e.rangeRef(t,n)},rangeRefs(e){return e.rangeRefs()},removeMark(e,t){e.removeMark(t)},setNormalizing(e,t){e.setNormalizing(t)},start(e,t){return e.start(t)},string(e,t,n){return e.string(t,n)},unhangRange(e,t,n){return e.unhangRange(t,n)},void(e,t){return e.void(t)},withoutNormalizing(e,t){e.withoutNormalizing(t)}},Vg={isSpan(e){return Array.isArray(e)&&e.length===2&&e.every(P.isPath)}};function Iu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function $u(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Iu(Object(n),!0).forEach(function(r){ut(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Iu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Ee={compare(e,t){var n=P.compare(e.path,t.path);return n===0?e.offset<t.offset?-1:e.offset>t.offset?1:0:n},isAfter(e,t){return Ee.compare(e,t)===1},isBefore(e,t){return Ee.compare(e,t)===-1},equals(e,t){return e.offset===t.offset&&P.equals(e.path,t.path)},isPoint(e){return tt(e)&&typeof e.offset=="number"&&P.isPath(e.path)},transform(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return co(e,r=>{if(r===null)return null;var{affinity:a="forward"}=n,{path:i,offset:s}=r;switch(t.type){case"insert_node":case"move_node":{r.path=P.transform(i,t,n);break}case"insert_text":{P.equals(t.path,i)&&(t.offset<s||t.offset===s&&a==="forward")&&(r.offset+=t.text.length);break}case"merge_node":{P.equals(t.path,i)&&(r.offset+=t.position),r.path=P.transform(i,t,n);break}case"remove_text":{P.equals(t.path,i)&&t.offset<=s&&(r.offset-=Math.min(s-t.offset,t.text.length));break}case"remove_node":{if(P.equals(t.path,i)||P.isAncestor(t.path,i))return null;r.path=P.transform(i,t,n);break}case"split_node":{if(P.equals(t.path,i)){if(t.position===s&&a==null)return null;(t.position<s||t.position===s&&a==="forward")&&(r.offset-=t.position,r.path=P.transform(i,t,$u($u({},n),{},{affinity:"forward"})))}else r.path=P.transform(i,t,n);break}}})}},Lu=void 0,Xe={setScrubber(e){Lu=e},stringify(e){return JSON.stringify(e,Lu)}},Kg=["text"],Zg=["anchor","focus"];function zu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Ut(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zu(Object(n),!0).forEach(function(r){ut(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var fe={equals(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{loose:r=!1}=n;function a(i){var s=Zt(i,Kg);return s}return Hd(r?a(e):e,r?a(t):t)},isText(e){return tt(e)&&typeof e.text=="string"},isTextList(e){return Array.isArray(e)&&e.every(t=>fe.isText(t))},isTextProps(e){return e.text!==void 0},matches(e,t){for(var n in t)if(n!=="text"&&(!e.hasOwnProperty(n)||e[n]!==t[n]))return!1;return!0},decorations(e,t){var n=[Ut({},e)];for(var r of t){var a=Zt(r,Zg),[i,s]=K.edges(r),o=[],l=0,u=i.offset,c=s.offset;for(var h of n){var{length:p}=h.text,m=l;if(l+=p,u<=m&&l<=c){Object.assign(h,a),o.push(h);continue}if(u!==c&&(u===l||c===m)||u>l||c<m||c===m&&m!==0){o.push(h);continue}var g=h,f=void 0,b=void 0;if(c<l){var v=c-m;b=Ut(Ut({},g),{},{text:g.text.slice(v)}),g=Ut(Ut({},g),{},{text:g.text.slice(0,v)})}if(u>m){var E=u-m;f=Ut(Ut({},g),{},{text:g.text.slice(0,E)}),g=Ut(Ut({},g),{},{text:g.text.slice(E)})}Object.assign(g,a),f&&o.push(f),o.push(g),b&&o.push(b)}n=o}return n}},fo=e=>e.selection?e.selection:e.children.length>0?y.end(e,[]):[0],or=(e,t)=>{var[n]=y.node(e,t);return r=>r===n},ho=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=!n,a=n?ev(t):t,i=xe.None,s=xe.None,o=0,l=null,u=null;for(var c of a){var h=c.codePointAt(0);if(!h)break;var p=fv(c,h);if([i,s]=r?[s,p]:[p,i],Wn(i,xe.ZWJ)&&Wn(s,xe.ExtPict)&&(r?l=qu(t.substring(0,o)):l=qu(t.substring(0,t.length-o)),!l)||Wn(i,xe.RI)&&Wn(s,xe.RI)&&(u!==null?u=!u:r?u=!0:u=vv(t.substring(0,t.length-o)),!u)||i!==xe.None&&s!==xe.None&&mv(i,s))break;o+=c.length}return o||1},Yg=/\s/,Gg=/[\u002B\u0021-\u0023\u0025-\u002A\u002C-\u002F\u003A\u003B\u003F\u0040\u005B-\u005D\u005F\u007B\u007D\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E3B\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/,Qg=/['\u2018\u2019]/,Jg=function(t){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=0,a=!1;t.length>0;){var i=ho(t,n),[s,o]=mo(t,i,n);if(Xg(s,o,n))a=!0,r+=i;else if(!a)r+=i;else break;t=o}return r},mo=(e,t,n)=>{if(n){var r=e.length-t;return[e.slice(r,e.length),e.slice(0,r)]}return[e.slice(0,t),e.slice(t)]},Xg=function e(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(Yg.test(t))return!1;if(Qg.test(t)){var a=ho(n,r),[i,s]=mo(n,a,r);if(e(i,s,r))return!0}return!Gg.test(t)},ev=function*(t){for(var n=t.length-1,r=0;r<t.length;r++){var a=t.charAt(n-r);if(nv(a.charCodeAt(0))){var i=t.charAt(n-r-1);if(tv(i.charCodeAt(0))){yield i+a,r++;continue}}yield a}},tv=e=>e>=55296&&e<=56319,nv=e=>e>=56320&&e<=57343,xe;(function(e){e[e.None=0]="None",e[e.Extend=1]="Extend",e[e.ZWJ=2]="ZWJ",e[e.RI=4]="RI",e[e.Prepend=8]="Prepend",e[e.SpacingMark=16]="SpacingMark",e[e.L=32]="L",e[e.V=64]="V",e[e.T=128]="T",e[e.LV=256]="LV",e[e.LVT=512]="LVT",e[e.ExtPict=1024]="ExtPict",e[e.Any=2048]="Any"})(xe||(xe={}));var rv=/^(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC01\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDE41\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4\uDF00\uDF01\uDF36-\uDF3A\uDF40\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])$/,av=/^(?:[\u0600-\u0605\u06DD\u070F\u0890\u0891\u08E2\u0D4E]|\uD804[\uDCBD\uDCCD\uDDC2\uDDC3]|\uD806[\uDD3F\uDD41\uDE3A\uDE84-\uDE89]|\uD807\uDD46)$/,iv=/^(?:[\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E\u094F\u0982\u0983\u09BF\u09C0\u09C7\u09C8\u09CB\u09CC\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB\u0ACC\u0B02\u0B03\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0C01-\u0C03\u0C41-\u0C44\u0C82\u0C83\u0CBE\u0CC0\u0CC1\u0CC3\u0CC4\u0CC7\u0CC8\u0CCA\u0CCB\u0D02\u0D03\u0D3F\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D82\u0D83\u0DD0\u0DD1\u0DD8-\u0DDE\u0DF2\u0DF3\u0E33\u0EB3\u0F3E\u0F3F\u0F7F\u1031\u103B\u103C\u1056\u1057\u1084\u1715\u1734\u17B6\u17BE-\u17C5\u17C7\u17C8\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1A19\u1A1A\u1A55\u1A57\u1A6D-\u1A72\u1B04\u1B3B\u1B3D-\u1B41\u1B43\u1B44\u1B82\u1BA1\u1BA6\u1BA7\u1BAA\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1C24-\u1C2B\u1C34\u1C35\u1CE1\u1CF7\uA823\uA824\uA827\uA880\uA881\uA8B4-\uA8C3\uA952\uA953\uA983\uA9B4\uA9B5\uA9BA\uA9BB\uA9BE-\uA9C0\uAA2F\uAA30\uAA33\uAA34\uAA4D\uAAEB\uAAEE\uAAEF\uAAF5\uABE3\uABE4\uABE6\uABE7\uABE9\uABEA\uABEC]|\uD804[\uDC00\uDC02\uDC82\uDCB0-\uDCB2\uDCB7\uDCB8\uDD2C\uDD45\uDD46\uDD82\uDDB3-\uDDB5\uDDBF\uDDC0\uDDCE\uDE2C-\uDE2E\uDE32\uDE33\uDE35\uDEE0-\uDEE2\uDF02\uDF03\uDF3F\uDF41-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF62\uDF63]|\uD805[\uDC35-\uDC37\uDC40\uDC41\uDC45\uDCB1\uDCB2\uDCB9\uDCBB\uDCBC\uDCBE\uDCC1\uDDB0\uDDB1\uDDB8-\uDDBB\uDDBE\uDE30-\uDE32\uDE3B\uDE3C\uDE3E\uDEAC\uDEAE\uDEAF\uDEB6\uDF26]|\uD806[\uDC2C-\uDC2E\uDC38\uDD31-\uDD35\uDD37\uDD38\uDD3D\uDD40\uDD42\uDDD1-\uDDD3\uDDDC-\uDDDF\uDDE4\uDE39\uDE57\uDE58\uDE97]|\uD807[\uDC2F\uDC3E\uDCA9\uDCB1\uDCB4\uDD8A-\uDD8E\uDD93\uDD94\uDD96\uDEF5\uDEF6]|\uD81B[\uDF51-\uDF87\uDFF0\uDFF1]|\uD834[\uDD66\uDD6D])$/,sv=/^[\u1100-\u115F\uA960-\uA97C]$/,ov=/^[\u1160-\u11A7\uD7B0-\uD7C6]$/,uv=/^[\u11A8-\u11FF\uD7CB-\uD7FB]$/,lv=/^[\uAC00\uAC1C\uAC38\uAC54\uAC70\uAC8C\uACA8\uACC4\uACE0\uACFC\uAD18\uAD34\uAD50\uAD6C\uAD88\uADA4\uADC0\uADDC\uADF8\uAE14\uAE30\uAE4C\uAE68\uAE84\uAEA0\uAEBC\uAED8\uAEF4\uAF10\uAF2C\uAF48\uAF64\uAF80\uAF9C\uAFB8\uAFD4\uAFF0\uB00C\uB028\uB044\uB060\uB07C\uB098\uB0B4\uB0D0\uB0EC\uB108\uB124\uB140\uB15C\uB178\uB194\uB1B0\uB1CC\uB1E8\uB204\uB220\uB23C\uB258\uB274\uB290\uB2AC\uB2C8\uB2E4\uB300\uB31C\uB338\uB354\uB370\uB38C\uB3A8\uB3C4\uB3E0\uB3FC\uB418\uB434\uB450\uB46C\uB488\uB4A4\uB4C0\uB4DC\uB4F8\uB514\uB530\uB54C\uB568\uB584\uB5A0\uB5BC\uB5D8\uB5F4\uB610\uB62C\uB648\uB664\uB680\uB69C\uB6B8\uB6D4\uB6F0\uB70C\uB728\uB744\uB760\uB77C\uB798\uB7B4\uB7D0\uB7EC\uB808\uB824\uB840\uB85C\uB878\uB894\uB8B0\uB8CC\uB8E8\uB904\uB920\uB93C\uB958\uB974\uB990\uB9AC\uB9C8\uB9E4\uBA00\uBA1C\uBA38\uBA54\uBA70\uBA8C\uBAA8\uBAC4\uBAE0\uBAFC\uBB18\uBB34\uBB50\uBB6C\uBB88\uBBA4\uBBC0\uBBDC\uBBF8\uBC14\uBC30\uBC4C\uBC68\uBC84\uBCA0\uBCBC\uBCD8\uBCF4\uBD10\uBD2C\uBD48\uBD64\uBD80\uBD9C\uBDB8\uBDD4\uBDF0\uBE0C\uBE28\uBE44\uBE60\uBE7C\uBE98\uBEB4\uBED0\uBEEC\uBF08\uBF24\uBF40\uBF5C\uBF78\uBF94\uBFB0\uBFCC\uBFE8\uC004\uC020\uC03C\uC058\uC074\uC090\uC0AC\uC0C8\uC0E4\uC100\uC11C\uC138\uC154\uC170\uC18C\uC1A8\uC1C4\uC1E0\uC1FC\uC218\uC234\uC250\uC26C\uC288\uC2A4\uC2C0\uC2DC\uC2F8\uC314\uC330\uC34C\uC368\uC384\uC3A0\uC3BC\uC3D8\uC3F4\uC410\uC42C\uC448\uC464\uC480\uC49C\uC4B8\uC4D4\uC4F0\uC50C\uC528\uC544\uC560\uC57C\uC598\uC5B4\uC5D0\uC5EC\uC608\uC624\uC640\uC65C\uC678\uC694\uC6B0\uC6CC\uC6E8\uC704\uC720\uC73C\uC758\uC774\uC790\uC7AC\uC7C8\uC7E4\uC800\uC81C\uC838\uC854\uC870\uC88C\uC8A8\uC8C4\uC8E0\uC8FC\uC918\uC934\uC950\uC96C\uC988\uC9A4\uC9C0\uC9DC\uC9F8\uCA14\uCA30\uCA4C\uCA68\uCA84\uCAA0\uCABC\uCAD8\uCAF4\uCB10\uCB2C\uCB48\uCB64\uCB80\uCB9C\uCBB8\uCBD4\uCBF0\uCC0C\uCC28\uCC44\uCC60\uCC7C\uCC98\uCCB4\uCCD0\uCCEC\uCD08\uCD24\uCD40\uCD5C\uCD78\uCD94\uCDB0\uCDCC\uCDE8\uCE04\uCE20\uCE3C\uCE58\uCE74\uCE90\uCEAC\uCEC8\uCEE4\uCF00\uCF1C\uCF38\uCF54\uCF70\uCF8C\uCFA8\uCFC4\uCFE0\uCFFC\uD018\uD034\uD050\uD06C\uD088\uD0A4\uD0C0\uD0DC\uD0F8\uD114\uD130\uD14C\uD168\uD184\uD1A0\uD1BC\uD1D8\uD1F4\uD210\uD22C\uD248\uD264\uD280\uD29C\uD2B8\uD2D4\uD2F0\uD30C\uD328\uD344\uD360\uD37C\uD398\uD3B4\uD3D0\uD3EC\uD408\uD424\uD440\uD45C\uD478\uD494\uD4B0\uD4CC\uD4E8\uD504\uD520\uD53C\uD558\uD574\uD590\uD5AC\uD5C8\uD5E4\uD600\uD61C\uD638\uD654\uD670\uD68C\uD6A8\uD6C4\uD6E0\uD6FC\uD718\uD734\uD750\uD76C\uD788]$/,cv=/^[\uAC01-\uAC1B\uAC1D-\uAC37\uAC39-\uAC53\uAC55-\uAC6F\uAC71-\uAC8B\uAC8D-\uACA7\uACA9-\uACC3\uACC5-\uACDF\uACE1-\uACFB\uACFD-\uAD17\uAD19-\uAD33\uAD35-\uAD4F\uAD51-\uAD6B\uAD6D-\uAD87\uAD89-\uADA3\uADA5-\uADBF\uADC1-\uADDB\uADDD-\uADF7\uADF9-\uAE13\uAE15-\uAE2F\uAE31-\uAE4B\uAE4D-\uAE67\uAE69-\uAE83\uAE85-\uAE9F\uAEA1-\uAEBB\uAEBD-\uAED7\uAED9-\uAEF3\uAEF5-\uAF0F\uAF11-\uAF2B\uAF2D-\uAF47\uAF49-\uAF63\uAF65-\uAF7F\uAF81-\uAF9B\uAF9D-\uAFB7\uAFB9-\uAFD3\uAFD5-\uAFEF\uAFF1-\uB00B\uB00D-\uB027\uB029-\uB043\uB045-\uB05F\uB061-\uB07B\uB07D-\uB097\uB099-\uB0B3\uB0B5-\uB0CF\uB0D1-\uB0EB\uB0ED-\uB107\uB109-\uB123\uB125-\uB13F\uB141-\uB15B\uB15D-\uB177\uB179-\uB193\uB195-\uB1AF\uB1B1-\uB1CB\uB1CD-\uB1E7\uB1E9-\uB203\uB205-\uB21F\uB221-\uB23B\uB23D-\uB257\uB259-\uB273\uB275-\uB28F\uB291-\uB2AB\uB2AD-\uB2C7\uB2C9-\uB2E3\uB2E5-\uB2FF\uB301-\uB31B\uB31D-\uB337\uB339-\uB353\uB355-\uB36F\uB371-\uB38B\uB38D-\uB3A7\uB3A9-\uB3C3\uB3C5-\uB3DF\uB3E1-\uB3FB\uB3FD-\uB417\uB419-\uB433\uB435-\uB44F\uB451-\uB46B\uB46D-\uB487\uB489-\uB4A3\uB4A5-\uB4BF\uB4C1-\uB4DB\uB4DD-\uB4F7\uB4F9-\uB513\uB515-\uB52F\uB531-\uB54B\uB54D-\uB567\uB569-\uB583\uB585-\uB59F\uB5A1-\uB5BB\uB5BD-\uB5D7\uB5D9-\uB5F3\uB5F5-\uB60F\uB611-\uB62B\uB62D-\uB647\uB649-\uB663\uB665-\uB67F\uB681-\uB69B\uB69D-\uB6B7\uB6B9-\uB6D3\uB6D5-\uB6EF\uB6F1-\uB70B\uB70D-\uB727\uB729-\uB743\uB745-\uB75F\uB761-\uB77B\uB77D-\uB797\uB799-\uB7B3\uB7B5-\uB7CF\uB7D1-\uB7EB\uB7ED-\uB807\uB809-\uB823\uB825-\uB83F\uB841-\uB85B\uB85D-\uB877\uB879-\uB893\uB895-\uB8AF\uB8B1-\uB8CB\uB8CD-\uB8E7\uB8E9-\uB903\uB905-\uB91F\uB921-\uB93B\uB93D-\uB957\uB959-\uB973\uB975-\uB98F\uB991-\uB9AB\uB9AD-\uB9C7\uB9C9-\uB9E3\uB9E5-\uB9FF\uBA01-\uBA1B\uBA1D-\uBA37\uBA39-\uBA53\uBA55-\uBA6F\uBA71-\uBA8B\uBA8D-\uBAA7\uBAA9-\uBAC3\uBAC5-\uBADF\uBAE1-\uBAFB\uBAFD-\uBB17\uBB19-\uBB33\uBB35-\uBB4F\uBB51-\uBB6B\uBB6D-\uBB87\uBB89-\uBBA3\uBBA5-\uBBBF\uBBC1-\uBBDB\uBBDD-\uBBF7\uBBF9-\uBC13\uBC15-\uBC2F\uBC31-\uBC4B\uBC4D-\uBC67\uBC69-\uBC83\uBC85-\uBC9F\uBCA1-\uBCBB\uBCBD-\uBCD7\uBCD9-\uBCF3\uBCF5-\uBD0F\uBD11-\uBD2B\uBD2D-\uBD47\uBD49-\uBD63\uBD65-\uBD7F\uBD81-\uBD9B\uBD9D-\uBDB7\uBDB9-\uBDD3\uBDD5-\uBDEF\uBDF1-\uBE0B\uBE0D-\uBE27\uBE29-\uBE43\uBE45-\uBE5F\uBE61-\uBE7B\uBE7D-\uBE97\uBE99-\uBEB3\uBEB5-\uBECF\uBED1-\uBEEB\uBEED-\uBF07\uBF09-\uBF23\uBF25-\uBF3F\uBF41-\uBF5B\uBF5D-\uBF77\uBF79-\uBF93\uBF95-\uBFAF\uBFB1-\uBFCB\uBFCD-\uBFE7\uBFE9-\uC003\uC005-\uC01F\uC021-\uC03B\uC03D-\uC057\uC059-\uC073\uC075-\uC08F\uC091-\uC0AB\uC0AD-\uC0C7\uC0C9-\uC0E3\uC0E5-\uC0FF\uC101-\uC11B\uC11D-\uC137\uC139-\uC153\uC155-\uC16F\uC171-\uC18B\uC18D-\uC1A7\uC1A9-\uC1C3\uC1C5-\uC1DF\uC1E1-\uC1FB\uC1FD-\uC217\uC219-\uC233\uC235-\uC24F\uC251-\uC26B\uC26D-\uC287\uC289-\uC2A3\uC2A5-\uC2BF\uC2C1-\uC2DB\uC2DD-\uC2F7\uC2F9-\uC313\uC315-\uC32F\uC331-\uC34B\uC34D-\uC367\uC369-\uC383\uC385-\uC39F\uC3A1-\uC3BB\uC3BD-\uC3D7\uC3D9-\uC3F3\uC3F5-\uC40F\uC411-\uC42B\uC42D-\uC447\uC449-\uC463\uC465-\uC47F\uC481-\uC49B\uC49D-\uC4B7\uC4B9-\uC4D3\uC4D5-\uC4EF\uC4F1-\uC50B\uC50D-\uC527\uC529-\uC543\uC545-\uC55F\uC561-\uC57B\uC57D-\uC597\uC599-\uC5B3\uC5B5-\uC5CF\uC5D1-\uC5EB\uC5ED-\uC607\uC609-\uC623\uC625-\uC63F\uC641-\uC65B\uC65D-\uC677\uC679-\uC693\uC695-\uC6AF\uC6B1-\uC6CB\uC6CD-\uC6E7\uC6E9-\uC703\uC705-\uC71F\uC721-\uC73B\uC73D-\uC757\uC759-\uC773\uC775-\uC78F\uC791-\uC7AB\uC7AD-\uC7C7\uC7C9-\uC7E3\uC7E5-\uC7FF\uC801-\uC81B\uC81D-\uC837\uC839-\uC853\uC855-\uC86F\uC871-\uC88B\uC88D-\uC8A7\uC8A9-\uC8C3\uC8C5-\uC8DF\uC8E1-\uC8FB\uC8FD-\uC917\uC919-\uC933\uC935-\uC94F\uC951-\uC96B\uC96D-\uC987\uC989-\uC9A3\uC9A5-\uC9BF\uC9C1-\uC9DB\uC9DD-\uC9F7\uC9F9-\uCA13\uCA15-\uCA2F\uCA31-\uCA4B\uCA4D-\uCA67\uCA69-\uCA83\uCA85-\uCA9F\uCAA1-\uCABB\uCABD-\uCAD7\uCAD9-\uCAF3\uCAF5-\uCB0F\uCB11-\uCB2B\uCB2D-\uCB47\uCB49-\uCB63\uCB65-\uCB7F\uCB81-\uCB9B\uCB9D-\uCBB7\uCBB9-\uCBD3\uCBD5-\uCBEF\uCBF1-\uCC0B\uCC0D-\uCC27\uCC29-\uCC43\uCC45-\uCC5F\uCC61-\uCC7B\uCC7D-\uCC97\uCC99-\uCCB3\uCCB5-\uCCCF\uCCD1-\uCCEB\uCCED-\uCD07\uCD09-\uCD23\uCD25-\uCD3F\uCD41-\uCD5B\uCD5D-\uCD77\uCD79-\uCD93\uCD95-\uCDAF\uCDB1-\uCDCB\uCDCD-\uCDE7\uCDE9-\uCE03\uCE05-\uCE1F\uCE21-\uCE3B\uCE3D-\uCE57\uCE59-\uCE73\uCE75-\uCE8F\uCE91-\uCEAB\uCEAD-\uCEC7\uCEC9-\uCEE3\uCEE5-\uCEFF\uCF01-\uCF1B\uCF1D-\uCF37\uCF39-\uCF53\uCF55-\uCF6F\uCF71-\uCF8B\uCF8D-\uCFA7\uCFA9-\uCFC3\uCFC5-\uCFDF\uCFE1-\uCFFB\uCFFD-\uD017\uD019-\uD033\uD035-\uD04F\uD051-\uD06B\uD06D-\uD087\uD089-\uD0A3\uD0A5-\uD0BF\uD0C1-\uD0DB\uD0DD-\uD0F7\uD0F9-\uD113\uD115-\uD12F\uD131-\uD14B\uD14D-\uD167\uD169-\uD183\uD185-\uD19F\uD1A1-\uD1BB\uD1BD-\uD1D7\uD1D9-\uD1F3\uD1F5-\uD20F\uD211-\uD22B\uD22D-\uD247\uD249-\uD263\uD265-\uD27F\uD281-\uD29B\uD29D-\uD2B7\uD2B9-\uD2D3\uD2D5-\uD2EF\uD2F1-\uD30B\uD30D-\uD327\uD329-\uD343\uD345-\uD35F\uD361-\uD37B\uD37D-\uD397\uD399-\uD3B3\uD3B5-\uD3CF\uD3D1-\uD3EB\uD3ED-\uD407\uD409-\uD423\uD425-\uD43F\uD441-\uD45B\uD45D-\uD477\uD479-\uD493\uD495-\uD4AF\uD4B1-\uD4CB\uD4CD-\uD4E7\uD4E9-\uD503\uD505-\uD51F\uD521-\uD53B\uD53D-\uD557\uD559-\uD573\uD575-\uD58F\uD591-\uD5AB\uD5AD-\uD5C7\uD5C9-\uD5E3\uD5E5-\uD5FF\uD601-\uD61B\uD61D-\uD637\uD639-\uD653\uD655-\uD66F\uD671-\uD68B\uD68D-\uD6A7\uD6A9-\uD6C3\uD6C5-\uD6DF\uD6E1-\uD6FB\uD6FD-\uD717\uD719-\uD733\uD735-\uD74F\uD751-\uD76B\uD76D-\uD787\uD789-\uD7A3]$/,dv=/^(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])$/,fv=(e,t)=>{var n=xe.Any;return e.search(rv)!==-1&&(n|=xe.Extend),t===8205&&(n|=xe.ZWJ),t>=127462&&t<=127487&&(n|=xe.RI),e.search(av)!==-1&&(n|=xe.Prepend),e.search(iv)!==-1&&(n|=xe.SpacingMark),e.search(sv)!==-1&&(n|=xe.L),e.search(ov)!==-1&&(n|=xe.V),e.search(uv)!==-1&&(n|=xe.T),e.search(lv)!==-1&&(n|=xe.LV),e.search(cv)!==-1&&(n|=xe.LVT),e.search(dv)!==-1&&(n|=xe.ExtPict),n};function Wn(e,t){return(e&t)!==0}var hv=[[xe.L,xe.L|xe.V|xe.LV|xe.LVT],[xe.LV|xe.V,xe.V|xe.T],[xe.LVT|xe.T,xe.T],[xe.Any,xe.Extend|xe.ZWJ],[xe.Any,xe.SpacingMark],[xe.Prepend,xe.Any],[xe.ZWJ,xe.ExtPict],[xe.RI,xe.RI]];function mv(e,t){return hv.findIndex(n=>Wn(e,n[0])&&Wn(t,n[1]))===-1}var pv=/(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC01\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDE41\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4\uDF00\uDF01\uDF36-\uDF3A\uDF40\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])*\u200D$/,qu=e=>e.search(pv)!==-1,gv=/(?:\uD83C[\uDDE6-\uDDFF])+$/g,vv=e=>{var t=e.match(gv);if(t===null)return!1;var n=t[0].length/2;return n%2===1},bv={delete(e,t){e.delete(t)},insertFragment(e,t,n){e.insertFragment(t,n)},insertText(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};y.withoutNormalizing(e,()=>{var{voids:r=!1}=n,{at:a=fo(e)}=n;if(P.isPath(a)&&(a=y.range(e,a)),K.isRange(a))if(K.isCollapsed(a))a=a.anchor;else{var i=K.end(a);if(!r&&y.void(e,{at:i}))return;var s=K.start(a),o=y.pointRef(e,s),l=y.pointRef(e,i);J.delete(e,{at:a,voids:r});var u=o.unref(),c=l.unref();a=u||c,J.setSelection(e,{anchor:a,focus:a})}if(!(!r&&y.void(e,{at:a})||y.elementReadOnly(e,{at:a}))){var{path:h,offset:p}=a;t.length>0&&e.apply({type:"insert_text",path:h,offset:p,text:t})}})}};function Wu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function na(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Wu(Object(n),!0).forEach(function(r){ut(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var J=na(na(na(na({},Mg),Ig),$g),bv),ya=new WeakMap,yv=e=>ya.get(e)||!1,Cv=(e,t,n)=>{var r=ya.get(e)||!1;ya.set(e,!0);try{t(),n()}finally{ya.set(e,r)}};function Vd(e,t,n){var r=Ra.get(e)||[],a=Ma.get(e)||new Set,i,s,o=h=>{if(h){var p=h.join(",");s.has(p)||(s.add(p),i.push(h))}};if(n){i=[],s=new Set;for(var l of r){var u=n(l);o(u)}}else i=r,s=a;for(var c of t)o(c);Ra.set(e,i),Ma.set(e,s)}var Dv=(e,t)=>{for(var n of y.pathRefs(e))Sg.transform(n,t);for(var r of y.pointRefs(e))jg.transform(r,t);for(var a of y.rangeRefs(e))Og.transform(a,t);if(!yv(e)){var i=P.operationCanTransformPath(t)?s=>P.transform(s,t):void 0;Vd(e,e.getDirtyPaths(t),i)}J.transform(e,t),e.operations.push(t),y.normalize(e,{operation:t}),t.type==="set_selection"&&(e.marks=null),xr.get(e)||(xr.set(e,!0),Promise.resolve().then(()=>{xr.set(e,!1),e.onChange({operation:t}),e.operations=[]}))},xv=(e,t)=>{switch(t.type){case"insert_text":case"remove_text":case"set_node":{var{path:n}=t;return P.levels(n)}case"insert_node":{var{node:r,path:a}=t,i=P.levels(a),s=fe.isText(r)?[]:Array.from(ue.nodes(r),N=>{var[,L]=N;return a.concat(L)});return[...i,...s]}case"merge_node":{var{path:o}=t,l=P.ancestors(o),u=P.previous(o);return[...l,u]}case"move_node":{var{path:c,newPath:h}=t;if(P.equals(c,h))return[];var p=[],m=[];for(var g of P.ancestors(c)){var f=P.transform(g,t);p.push(f)}for(var b of P.ancestors(h)){var v=P.transform(b,t);m.push(v)}var E=m[m.length-1],k=h[h.length-1],x=E.concat(k);return[...p,...m,x]}case"remove_node":{var{path:w}=t,A=P.ancestors(w);return[...A]}case"split_node":{var{path:S}=t,q=P.levels(S),$=P.next(S);return[...q,$]}default:return[]}},wv=e=>{var{selection:t}=e;return t?ue.fragment(e,t):[]},Ev=(e,t)=>{var[n,r]=t;if(!fe.isText(n)){if(de.isElement(n)&&n.children.length===0){var a={text:""};J.insertNodes(e,a,{at:r.concat(0),voids:!0});return}for(var i=y.isEditor(n)?!1:de.isElement(n)&&(e.isInline(n)||n.children.length===0||fe.isText(n.children[0])||e.isInline(n.children[0])),s=0,o=0;o<n.children.length;o++,s++){var l=ue.get(e,r);if(!fe.isText(l)){var u=l.children[s],c=l.children[s-1],h=o===n.children.length-1,p=fe.isText(u)||de.isElement(u)&&e.isInline(u);if(p!==i)J.removeNodes(e,{at:r.concat(s),voids:!0}),s--;else if(de.isElement(u)){if(e.isInline(u)){if(c==null||!fe.isText(c)){var m={text:""};J.insertNodes(e,m,{at:r.concat(s),voids:!0}),s++}else if(h){var g={text:""};J.insertNodes(e,g,{at:r.concat(s+1),voids:!0}),s++}}}else c!=null&&fe.isText(c)&&(fe.equals(u,c,{loose:!0})?(J.mergeNodes(e,{at:r.concat(s),voids:!0}),s--):c.text===""?(J.removeNodes(e,{at:r.concat(s-1),voids:!0}),s--):u.text===""&&(J.removeNodes(e,{at:r.concat(s),voids:!0}),s--))}}}},_v=(e,t)=>{var{iteration:n,initialDirtyPathsLength:r}=t,a=r*42;if(n>a)throw new Error("Could not completely normalize the editor after ".concat(a," iterations! This is usually due to incorrect normalization logic that leaves a node in an invalid state."));return!0},kv=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{voids:r=!1,mode:a="lowest",at:i=t.selection,match:s}=n;if(i){var o=y.path(t,i),l=a==="lowest";for(var[u,c]of y.levels(t,{at:o,voids:r,match:s,reverse:l}))if(!fe.isText(u)){if(K.isRange(i)){if(P.isAncestor(c,i.anchor.path)&&P.isAncestor(c,i.focus.path))return[u,c]}else if(!P.equals(o,c))return[u,c]}}};function Uu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Hu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Uu(Object(n),!0).forEach(function(r){ut(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Uu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Fv=(e,t,n)=>{var{selection:r}=e;if(r){var a=(h,p)=>{if(!fe.isText(h))return!1;var[m,g]=y.parent(e,p);return!e.isVoid(m)||e.markableVoid(m)},i=K.isExpanded(r),s=!1;if(!i){var[o,l]=y.node(e,r);if(o&&a(o,l)){var[u]=y.parent(e,l);s=u&&e.markableVoid(u)}}if(i||s)J.setNodes(e,{[t]:n},{match:a,split:!0,voids:!0});else{var c=Hu(Hu({},y.marks(e)||{}),{},{[t]:n});e.marks=c,xr.get(e)||e.onChange()}}};function Vu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Ku(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Vu(Object(n),!0).forEach(function(r){ut(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Bv=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=y.point(t,n,{edge:"end"}),i=y.end(t,[]),s={anchor:a,focus:i},{distance:o=1}=r,l=0,u;for(var c of y.positions(t,Ku(Ku({},r),{},{at:s}))){if(l>o)break;l!==0&&(u=c),l++}return u};function Zu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Yu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Zu(Object(n),!0).forEach(function(r){ut(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Av=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=y.start(t,[]),i=y.point(t,n,{edge:"start"}),s={anchor:a,focus:i},{distance:o=1}=r,l=0,u;for(var c of y.positions(t,Yu(Yu({},r),{},{at:s,reverse:!0}))){if(l>o)break;l!==0&&(u=c),l++}return u},Tv=(e,t)=>{var{selection:n}=e;n&&K.isCollapsed(n)&&J.delete(e,{unit:t,reverse:!0})},Sv=(e,t)=>{var{selection:n}=e;n&&K.isCollapsed(n)&&J.delete(e,{unit:t})},jv=function(t){var{direction:n="forward"}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{selection:r}=t;r&&K.isExpanded(r)&&J.delete(t,{reverse:n==="backward"})},Ov=(e,t)=>[y.start(e,t),y.end(e,t)];function Gu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Qu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Gu(Object(n),!0).forEach(function(r){ut(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Pv=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return y.above(t,Qu(Qu({},n),{},{match:r=>de.isElement(r)&&y.isElementReadOnly(t,r)}))},Nv=(e,t)=>y.point(e,t,{edge:"end"}),Rv=(e,t)=>{var n=y.path(e,t,{edge:"start"});return y.node(e,n)},Mv=(e,t)=>{var n=y.range(e,t);return ue.fragment(e,n)};function Ju(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Xu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ju(Object(n),!0).forEach(function(r){ut(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ju(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Iv=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return y.above(t,Xu(Xu({},n),{},{match:r=>de.isElement(r)&&y.isVoid(t,r)}))},$v=(e,t)=>t.children.some(n=>de.isElement(n)&&y.isBlock(e,n)),Lv=(e,t)=>t.children.some(n=>fe.isText(n)||y.isInline(e,n)),zv=(e,t)=>ue.has(e,t),qv=(e,t)=>t.children.every(n=>fe.isText(n)),Wv=e=>{J.splitNodes(e,{always:!0})},Uv=(e,t,n)=>{J.insertNodes(e,t,n)},Hv=e=>{J.splitNodes(e,{always:!0})};function el(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Vv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?el(Object(n),!0).forEach(function(r){ut(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):el(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Kv=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{selection:a,marks:i}=t;if(a){if(i){var s=Vv({text:n},i);J.insertNodes(t,s,{at:r.at,voids:r.voids})}else J.insertText(t,n,r);t.marks=null}},Zv=(e,t)=>!e.isInline(t),Yv=(e,t,n)=>y.isStart(e,t,n)||y.isEnd(e,t,n),Gv=(e,t)=>{var{children:n}=t,[r]=n;return n.length===0||n.length===1&&fe.isText(r)&&r.text===""&&!e.isVoid(t)},Qv=(e,t,n)=>{var r=y.end(e,n);return Ee.equals(t,r)},Jv=e=>{var t=Ud.get(e);return t===void 0?!0:t},Xv=(e,t,n)=>{if(t.offset!==0)return!1;var r=y.start(e,n);return Ee.equals(t,r)},e0=(e,t)=>{var n=y.path(e,t,{edge:"end"});return y.node(e,n)},t0=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=y.path(t,n,r),i=ue.leaf(t,a);return[i,a]};function n0(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){var{at:n=e.selection,reverse:r=!1,voids:a=!1}=t,{match:i}=t;if(i==null&&(i=()=>!0),!!n){var s=[],o=y.path(e,n);for(var[l,u]of ue.levels(e,o))if(i(l,u)&&(s.push([l,u]),!a&&de.isElement(l)&&y.isVoid(e,l)))break;r&&s.reverse(),yield*s}}()}var r0=["text"],a0=["text"],i0=function(t){var{marks:n,selection:r}=t;if(!r)return null;var{anchor:a,focus:i}=r;if(n)return n;if(K.isExpanded(r)){var s=y.isEnd(t,a,a.path);if(s){var o=y.after(t,a);o&&(a=o)}var[l]=y.nodes(t,{match:fe.isText,at:{anchor:a,focus:i}});if(l){var[u]=l,c=Zt(u,r0);return c}else return{}}var{path:h}=a,[p]=y.leaf(t,h);if(a.offset===0){var m=y.previous(t,{at:h,match:fe.isText}),g=y.above(t,{match:x=>de.isElement(x)&&y.isVoid(t,x)&&t.markableVoid(x)});if(!g){var f=y.above(t,{match:x=>de.isElement(x)&&y.isBlock(t,x)});if(m&&f){var[b,v]=m,[,E]=f;P.isAncestor(E,v)&&(p=b)}}}var k=Zt(p,a0);return k},s0=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{mode:r="lowest",voids:a=!1}=n,{match:i,at:s=t.selection}=n;if(s){var o=y.after(t,s,{voids:a});if(o){var[,l]=y.last(t,[]),u=[o.path,l];if(P.isPath(s)&&s.length===0)throw new Error("Cannot get the next node from the root node!");if(i==null)if(P.isPath(s)){var[c]=y.parent(t,s);i=p=>c.children.includes(p)}else i=()=>!0;var[h]=y.nodes(t,{at:u,match:i,mode:r,voids:a});return h}}},o0=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=y.path(t,n,r),i=ue.get(t,a);return[i,a]};function u0(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){var{at:n=e.selection,mode:r="all",universal:a=!1,reverse:i=!1,voids:s=!1,ignoreNonSelectable:o=!1}=t,{match:l}=t;if(l||(l=()=>!0),!!n){var u,c;if(Vg.isSpan(n))u=n[0],c=n[1];else{var h=y.path(e,n,{edge:"start"}),p=y.path(e,n,{edge:"end"});u=i?p:h,c=i?h:p}var m=ue.nodes(e,{reverse:i,from:u,to:c,pass:x=>{var[w]=x;return de.isElement(w)?!!(!s&&(y.isVoid(e,w)||y.isElementReadOnly(e,w))||o&&!y.isSelectable(e,w)):!1}}),g=[],f;for(var[b,v]of m)if(!(o&&de.isElement(b)&&!y.isSelectable(e,b))){var E=f&&P.compare(v,f[1])===0;if(!(r==="highest"&&E)){if(!l(b,v)){if(a&&!E&&fe.isText(b))return;continue}if(r==="lowest"&&E){f=[b,v];continue}var k=r==="lowest"?f:[b,v];k&&(a?g.push(k):yield k),f=[b,v]}}r==="lowest"&&f&&(a?g.push(f):yield f),a&&(yield*g)}}()}var l0=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{force:r=!1,operation:a}=n,i=c=>Ra.get(c)||[],s=c=>Ma.get(c)||new Set,o=c=>{var h=i(c).pop(),p=h.join(",");return s(c).delete(p),h};if(y.isNormalizing(t)){if(r){var l=Array.from(ue.nodes(t),c=>{var[,h]=c;return h}),u=new Set(l.map(c=>c.join(",")));Ra.set(t,l),Ma.set(t,u)}i(t).length!==0&&y.withoutNormalizing(t,()=>{for(var c of i(t))if(ue.has(t,c)){var h=y.node(t,c),[p,m]=h;de.isElement(p)&&p.children.length===0&&t.normalizeNode(h,{operation:a})}for(var g=i(t),f=g.length,b=0;g.length!==0;){if(!t.shouldNormalize({dirtyPaths:g,iteration:b,initialDirtyPathsLength:f,operation:a}))return;var v=o(t);if(ue.has(t,v)){var E=y.node(t,v);t.normalizeNode(E,{operation:a})}b++,g=i(t)}})}},c0=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=y.path(t,n,r),i=P.parent(a),s=y.node(t,i);return s},d0=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{affinity:a="forward"}=r,i={current:n,affinity:a,unref(){var{current:o}=i,l=y.pathRefs(t);return l.delete(i),i.current=null,o}},s=y.pathRefs(t);return s.add(i),i},f0=e=>{var t=Au.get(e);return t||(t=new Set,Au.set(e,t)),t},h0=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{depth:a,edge:i}=r;if(P.isPath(n)){if(i==="start"){var[,s]=ue.first(t,n);n=s}else if(i==="end"){var[,o]=ue.last(t,n);n=o}}return K.isRange(n)&&(i==="start"?n=K.start(n):i==="end"?n=K.end(n):n=P.common(n.anchor.path,n.focus.path)),Ee.isPoint(n)&&(n=n.path),a!=null&&(n=n.slice(0,a)),n},m0=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{affinity:a="forward"}=r,i={current:n,affinity:a,unref(){var{current:o}=i,l=y.pointRefs(t);return l.delete(i),i.current=null,o}},s=y.pointRefs(t);return s.add(i),i},p0=e=>{var t=Tu.get(e);return t||(t=new Set,Tu.set(e,t)),t},g0=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{edge:a="start"}=r;if(P.isPath(n)){var i;if(a==="end"){var[,s]=ue.last(t,n);i=s}else{var[,o]=ue.first(t,n);i=o}var l=ue.get(t,i);if(!fe.isText(l))throw new Error("Cannot get the ".concat(a," point in the node at path [").concat(n,"] because it has no ").concat(a," text node."));return{path:i,offset:a==="end"?l.text.length:0}}if(K.isRange(n)){var[u,c]=K.edges(n);return a==="start"?u:c}return n};function v0(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){var{at:n=e.selection,unit:r="offset",reverse:a=!1,voids:i=!1,ignoreNonSelectable:s=!1}=t;if(!n)return;var o=y.range(e,n),[l,u]=K.edges(o),c=a?u:l,h=!1,p="",m=0,g=0,f=0;for(var[b,v]of y.nodes(e,{at:n,reverse:a,voids:i,ignoreNonSelectable:s})){if(de.isElement(b)){if(!i&&(e.isVoid(b)||e.isElementReadOnly(b))){yield y.start(e,v);continue}if(e.isInline(b))continue;if(y.hasInlines(e,b)){var E=P.isAncestor(v,u.path)?u:y.end(e,v),k=P.isAncestor(v,l.path)?l:y.start(e,v);p=y.string(e,{anchor:k,focus:E},{voids:i}),h=!0}}if(fe.isText(b)){var x=P.equals(v,c.path);for(x?(g=a?c.offset:b.text.length-c.offset,f=c.offset):(g=b.text.length,f=a?g:0),(x||h||r==="offset")&&(yield{path:v,offset:f},h=!1);;){if(m===0){if(p==="")break;m=w(p,r,a),p=mo(p,m,a)[1]}if(f=a?f-m:f+m,g=g-m,g<0){m=-g;break}m=0,yield{path:v,offset:f}}}}function w(A,S,q){return S==="character"?ho(A,q):S==="word"?Jg(A,q):S==="line"||S==="block"?A.length:1}}()}var b0=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{mode:r="lowest",voids:a=!1}=n,{match:i,at:s=t.selection}=n;if(s){var o=y.before(t,s,{voids:a});if(o){var[,l]=y.first(t,[]),u=[o.path,l];if(P.isPath(s)&&s.length===0)throw new Error("Cannot get the previous node from the root node!");if(i==null)if(P.isPath(s)){var[c]=y.parent(t,s);i=p=>c.children.includes(p)}else i=()=>!0;var[h]=y.nodes(t,{reverse:!0,at:u,match:i,mode:r,voids:a});return h}}},y0=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{affinity:a="forward"}=r,i={current:n,affinity:a,unref(){var{current:o}=i,l=y.rangeRefs(t);return l.delete(i),i.current=null,o}},s=y.rangeRefs(t);return s.add(i),i},C0=e=>{var t=Su.get(e);return t||(t=new Set,Su.set(e,t)),t},D0=(e,t,n)=>{if(K.isRange(t)&&!n)return t;var r=y.start(e,t),a=y.end(e,n||t);return{anchor:r,focus:a}};function tl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function x0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tl(Object(n),!0).forEach(function(r){ut(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tl(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var w0=(e,t)=>{var{selection:n}=e;if(n){var r=(c,h)=>{if(!fe.isText(c))return!1;var[p,m]=y.parent(e,h);return!e.isVoid(p)||e.markableVoid(p)},a=K.isExpanded(n),i=!1;if(!a){var[s,o]=y.node(e,n);if(s&&r(s,o)){var[l]=y.parent(e,o);i=l&&e.markableVoid(l)}}if(a||i)J.unsetNodes(e,t,{match:r,split:!0,voids:!0});else{var u=x0({},y.marks(e)||{});delete u[t],e.marks=u,xr.get(e)||e.onChange()}}},E0=(e,t)=>{Ud.set(e,t)},_0=(e,t)=>y.point(e,t,{edge:"start"}),k0=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{voids:a=!1}=r,i=y.range(t,n),[s,o]=K.edges(i),l="";for(var[u,c]of y.nodes(t,{at:i,match:fe.isText,voids:a})){var h=u.text;P.equals(c,o.path)&&(h=h.slice(0,o.offset)),P.equals(c,s.path)&&(h=h.slice(s.offset)),l+=h}return l},F0=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{voids:a=!1}=r,[i,s]=K.edges(n);if(i.offset!==0||s.offset!==0||K.isCollapsed(n)||P.hasPrevious(s.path))return n;var o=y.above(t,{at:s,match:g=>de.isElement(g)&&y.isBlock(t,g),voids:a}),l=o?o[1]:[],u=y.start(t,i),c={anchor:u,focus:s},h=!0;for(var[p,m]of y.nodes(t,{at:c,match:fe.isText,reverse:!0,voids:a})){if(h){h=!1;continue}if(p.text!==""||P.isBefore(m,l)){s={path:m,offset:p.text.length};break}}return{anchor:i,focus:s}},B0=(e,t)=>{var n=y.isNormalizing(e);y.setNormalizing(e,!1);try{t()}finally{y.setNormalizing(e,n)}y.normalize(e)},A0=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};y.withoutNormalizing(t,()=>{var r,a,{reverse:i=!1,unit:s="character",distance:o=1,voids:l=!1}=n,{at:u=t.selection,hanging:c=!1}=n;if(u){var h=!1;if(K.isRange(u)&&K.isCollapsed(u)&&(h=!0,u=u.anchor),Ee.isPoint(u)){var p=y.void(t,{at:u,mode:"highest"});if(!l&&p){var[,m]=p;u=m}else{var g={unit:s,distance:o},f=i?y.before(t,u,g)||y.start(t,[]):y.after(t,u,g)||y.end(t,[]);u={anchor:u,focus:f},c=!0}}if(P.isPath(u)){J.removeNodes(t,{at:u,voids:l});return}if(!K.isCollapsed(u)){if(!c){var[,b]=K.edges(u),v=y.end(t,[]);Ee.equals(b,v)||(u=y.unhangRange(t,u,{voids:l}))}var[E,k]=K.edges(u),x=y.above(t,{match:me=>de.isElement(me)&&y.isBlock(t,me),at:E,voids:l}),w=y.above(t,{match:me=>de.isElement(me)&&y.isBlock(t,me),at:k,voids:l}),A=x&&w&&!P.equals(x[1],w[1]),S=P.equals(E.path,k.path),q=l?null:(r=y.void(t,{at:E,mode:"highest"}))!==null&&r!==void 0?r:y.elementReadOnly(t,{at:E,mode:"highest"}),$=l?null:(a=y.void(t,{at:k,mode:"highest"}))!==null&&a!==void 0?a:y.elementReadOnly(t,{at:k,mode:"highest"});if(q){var N=y.before(t,E);N&&x&&P.isAncestor(x[1],N.path)&&(E=N)}if($){var L=y.after(t,k);L&&w&&P.isAncestor(w[1],L.path)&&(k=L)}var _=[],B;for(var j of y.nodes(t,{at:u,voids:l})){var[I,G]=j;B&&P.compare(G,B)===0||(!l&&de.isElement(I)&&(y.isVoid(t,I)||y.isElementReadOnly(t,I))||!P.isCommon(G,E.path)&&!P.isCommon(G,k.path))&&(_.push(j),B=G)}var V=Array.from(_,me=>{var[,ye]=me;return y.pathRef(t,ye)}),Q=y.pointRef(t,E),ae=y.pointRef(t,k),D="";if(!S&&!q){var M=Q.current,[W]=y.leaf(t,M),{path:F}=M,{offset:T}=E,z=W.text.slice(T);z.length>0&&(t.apply({type:"remove_text",path:F,offset:T,text:z}),D=z)}if(V.reverse().map(me=>me.unref()).filter(me=>me!==null).forEach(me=>J.removeNodes(t,{at:me,voids:l})),!$){var R=ae.current,[H]=y.leaf(t,R),{path:re}=R,X=S?E.offset:0,ne=H.text.slice(X,k.offset);ne.length>0&&(t.apply({type:"remove_text",path:re,offset:X,text:ne}),D=ne)}!S&&A&&ae.current&&Q.current&&J.mergeNodes(t,{at:ae.current,hanging:!0,voids:l}),h&&i&&s==="character"&&D.length>1&&D.match(/[\u0E00-\u0E7F]+/)&&J.insertText(t,D.slice(0,D.length-o));var le=Q.unref(),ee=ae.unref(),he=i?le||ee:ee||le;n.at==null&&he&&J.select(t,he)}}})},T0=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};y.withoutNormalizing(t,()=>{var{hanging:a=!1,voids:i=!1}=r,{at:s=fo(t),batchDirty:o=!0}=r;if(n.length){if(K.isRange(s))if(a||(s=y.unhangRange(t,s,{voids:i})),K.isCollapsed(s))s=s.anchor;else{var[,l]=K.edges(s);if(!i&&y.void(t,{at:l}))return;var u=y.pointRef(t,l);J.delete(t,{at:s}),s=u.unref()}else P.isPath(s)&&(s=y.start(t,s));if(!(!i&&y.void(t,{at:s}))){var c=y.above(t,{at:s,match:z=>de.isElement(z)&&y.isInline(t,z),mode:"highest",voids:i});if(c){var[,h]=c;if(y.isEnd(t,s,h)){var p=y.after(t,h);s=p}else if(y.isStart(t,s,h)){var m=y.before(t,h);s=m}}var g=y.above(t,{match:z=>de.isElement(z)&&y.isBlock(t,z),at:s,voids:i}),[,f]=g,b=y.isStart(t,s,f),v=y.isEnd(t,s,f),E=b&&v,k=!b||b&&v,x=!v,[,w]=ue.first({children:n},[]),[,A]=ue.last({children:n},[]),S=[],q=z=>{var[R,H]=z,re=H.length===0;return re?!1:E?!0:!(k&&P.isAncestor(H,w)&&de.isElement(R)&&!t.isVoid(R)&&!t.isInline(R)||x&&P.isAncestor(H,A)&&de.isElement(R)&&!t.isVoid(R)&&!t.isInline(R))};for(var $ of ue.nodes({children:n},{pass:q}))q($)&&S.push($);var N=[],L=[],_=[],B=!0,j=!1;for(var[I]of S)de.isElement(I)&&!t.isInline(I)?(B=!1,j=!0,L.push(I)):B?N.push(I):_.push(I);var[G]=y.nodes(t,{at:s,match:z=>fe.isText(z)||y.isInline(t,z),mode:"highest",voids:i}),[,V]=G,Q=y.isStart(t,s,V),ae=y.isEnd(t,s,V),D=y.pathRef(t,v&&!_.length?P.next(f):f),M=y.pathRef(t,ae?P.next(V):V);J.splitNodes(t,{at:s,match:z=>j?de.isElement(z)&&y.isBlock(t,z):fe.isText(z)||y.isInline(t,z),mode:j?"lowest":"highest",always:j&&(!b||N.length>0)&&(!v||_.length>0),voids:i});var W=y.pathRef(t,!Q||Q&&ae?P.next(V):V);if(J.insertNodes(t,N,{at:W.current,match:z=>fe.isText(z)||y.isInline(t,z),mode:"highest",voids:i,batchDirty:o}),E&&!N.length&&L.length&&!_.length&&J.delete(t,{at:f,voids:i}),J.insertNodes(t,L,{at:D.current,match:z=>de.isElement(z)&&y.isBlock(t,z),mode:"lowest",voids:i,batchDirty:o}),J.insertNodes(t,_,{at:M.current,match:z=>fe.isText(z)||y.isInline(t,z),mode:"highest",voids:i,batchDirty:o}),!r.at){var F;if(_.length>0&&M.current?F=P.previous(M.current):L.length>0&&D.current?F=P.previous(D.current):W.current&&(F=P.previous(W.current)),F){var T=y.end(t,F);J.select(t,T)}}W.unref(),D.unref(),M.unref()}}})},S0=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{edge:r="anchor"}=n,{selection:a}=t;if(a){if(r==="anchor")J.select(t,a.anchor);else if(r==="focus")J.select(t,a.focus);else if(r==="start"){var[i]=K.edges(a);J.select(t,i)}else if(r==="end"){var[,s]=K.edges(a);J.select(t,s)}}else return},j0=e=>{var{selection:t}=e;t&&e.apply({type:"set_selection",properties:t,newProperties:null})},O0=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{selection:r}=t,{distance:a=1,unit:i="character",reverse:s=!1}=n,{edge:o=null}=n;if(r){o==="start"&&(o=K.isBackward(r)?"focus":"anchor"),o==="end"&&(o=K.isBackward(r)?"anchor":"focus");var{anchor:l,focus:u}=r,c={distance:a,unit:i,ignoreNonSelectable:!0},h={};if(o==null||o==="anchor"){var p=s?y.before(t,l,c):y.after(t,l,c);p&&(h.anchor=p)}if(o==null||o==="focus"){var m=s?y.before(t,u,c):y.after(t,u,c);m&&(h.focus=m)}J.setSelection(t,h)}},P0=(e,t)=>{var{selection:n}=e;if(t=y.range(e,t),n){J.setSelection(e,t);return}if(!K.isRange(t))throw new Error("When setting the selection and the current selection is `null` you must provide at least an `anchor` and `focus`, but you passed: ".concat(Xe.stringify(t)));e.apply({type:"set_selection",properties:n,newProperties:t})};function nl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function rl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nl(Object(n),!0).forEach(function(r){ut(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nl(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var N0=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{selection:a}=t,{edge:i="both"}=r;if(a){i==="start"&&(i=K.isBackward(a)?"focus":"anchor"),i==="end"&&(i=K.isBackward(a)?"anchor":"focus");var{anchor:s,focus:o}=a,l=i==="anchor"?s:o;J.setSelection(t,{[i==="anchor"?"anchor":"focus"]:rl(rl({},l),n)})}},R0=(e,t)=>{var{selection:n}=e,r={},a={};if(n){for(var i in t)(i==="anchor"&&t.anchor!=null&&!Ee.equals(t.anchor,n.anchor)||i==="focus"&&t.focus!=null&&!Ee.equals(t.focus,n.focus)||i!=="anchor"&&i!=="focus"&&t[i]!==n[i])&&(r[i]=n[i],a[i]=t[i]);Object.keys(r).length>0&&e.apply({type:"set_selection",properties:r,newProperties:a})}},M0=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};y.withoutNormalizing(t,()=>{var{hanging:a=!1,voids:i=!1,mode:s="lowest",batchDirty:o=!0}=r,{at:l,match:u,select:c}=r;if(ue.isNode(n)&&(n=[n]),n.length!==0){var[h]=n;if(l||(l=fo(t),c!==!1&&(c=!0)),c==null&&(c=!1),K.isRange(l))if(a||(l=y.unhangRange(t,l,{voids:i})),K.isCollapsed(l))l=l.anchor;else{var[,p]=K.edges(l),m=y.pointRef(t,p);J.delete(t,{at:l}),l=m.unref()}if(Ee.isPoint(l)){u==null&&(fe.isText(h)?u=N=>fe.isText(N):t.isInline(h)?u=N=>fe.isText(N)||y.isInline(t,N):u=N=>de.isElement(N)&&y.isBlock(t,N));var[g]=y.nodes(t,{at:l.path,match:u,mode:s,voids:i});if(g){var[,f]=g,b=y.pathRef(t,f),v=y.isEnd(t,l,f);J.splitNodes(t,{at:l,match:u,mode:s,voids:i});var E=b.unref();l=v?P.next(E):E}else return}var k=P.parent(l),x=l[l.length-1];if(!(!i&&y.void(t,{at:k}))){if(o){var w=[],A=P.levels(k);Cv(t,()=>{var N=function(){var B=k.concat(x);x++;var j={type:"insert_node",path:B,node:L};t.apply(j),l=P.next(l),w.push(j),fe.isText?A.push(...Array.from(ue.nodes(L),I=>{var[,G]=I;return B.concat(G)})):A.push(B)};for(var L of n)N()},()=>{Vd(t,A,N=>{var L=N;for(var _ of w)if(P.operationCanTransformPath(_)&&(L=P.transform(L,_),!L))return null;return L})})}else for(var S of n){var q=k.concat(x);x++,t.apply({type:"insert_node",path:q,node:S}),l=P.next(l)}if(l=P.previous(l),c){var $=y.end(t,l);$&&J.select(t,$)}}}})},I0=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};y.withoutNormalizing(t,()=>{var{at:r=t.selection,mode:a="lowest",voids:i=!1}=n,{match:s}=n;if(s==null&&(s=P.isPath(r)?or(t,r):x=>de.isElement(x)&&y.isBlock(t,x)),!!r){var o=y.nodes(t,{at:r,match:s,mode:a,voids:i}),l=Array.from(o,x=>{var[,w]=x;return y.pathRef(t,w)});for(var u of l){var c=u.unref();if(c.length<2)throw new Error("Cannot lift node at a path [".concat(c,"] because it has a depth of less than `2`."));var h=y.node(t,P.parent(c)),[p,m]=h,g=c[c.length-1],{length:f}=p.children;if(f===1){var b=P.next(m);J.moveNodes(t,{at:c,to:b,voids:i}),J.removeNodes(t,{at:m,voids:i})}else if(g===0)J.moveNodes(t,{at:c,to:m,voids:i});else if(g===f-1){var v=P.next(m);J.moveNodes(t,{at:c,to:v,voids:i})}else{var E=P.next(c),k=P.next(m);J.splitNodes(t,{at:E,voids:i}),J.moveNodes(t,{at:c,to:k,voids:i})}}}})},$0=["text"],L0=["children"],Kd=(e,t)=>{if(de.isElement(t)){var n=t;return y.isVoid(e,t)?!0:n.children.length===1?Kd(e,n.children[0]):!1}else return!y.isEditor(t)},z0=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};y.withoutNormalizing(t,()=>{var{match:r,at:a=t.selection}=n,{hanging:i=!1,voids:s=!1,mode:o="lowest"}=n;if(a){if(r==null)if(P.isPath(a)){var[l]=y.parent(t,a);r=N=>l.children.includes(N)}else r=N=>de.isElement(N)&&y.isBlock(t,N);if(!i&&K.isRange(a)&&(a=y.unhangRange(t,a,{voids:s})),K.isRange(a))if(K.isCollapsed(a))a=a.anchor;else{var[,u]=K.edges(a),c=y.pointRef(t,u);J.delete(t,{at:a}),a=c.unref(),n.at==null&&J.select(t,a)}var[h]=y.nodes(t,{at:a,match:r,voids:s,mode:o}),p=y.previous(t,{at:a,match:r,voids:s,mode:o});if(!(!h||!p)){var[m,g]=h,[f,b]=p;if(!(g.length===0||b.length===0)){var v=P.next(b),E=P.common(g,b),k=P.isSibling(g,b),x=Array.from(y.levels(t,{at:g}),N=>{var[L]=N;return L}).slice(E.length).slice(0,-1),w=y.above(t,{at:g,mode:"highest",match:N=>x.includes(N)&&Kd(t,N)}),A=w&&y.pathRef(t,w[1]),S,q;if(fe.isText(m)&&fe.isText(f)){var $=Zt(m,$0);q=f.text.length,S=$}else if(de.isElement(m)&&de.isElement(f)){var $=Zt(m,L0);q=f.children.length,S=$}else throw new Error("Cannot merge the node at path [".concat(g,"] with the previous sibling because it is not the same kind: ").concat(Xe.stringify(m)," ").concat(Xe.stringify(f)));k||J.moveNodes(t,{at:g,to:v,voids:s}),A&&J.removeNodes(t,{at:A.current,voids:s}),de.isElement(f)&&y.isEmpty(t,f)||fe.isText(f)&&f.text===""&&b[b.length-1]!==0?J.removeNodes(t,{at:b,voids:s}):t.apply({type:"merge_node",path:v,position:q,properties:S}),A&&A.unref()}}}})},q0=(e,t)=>{y.withoutNormalizing(e,()=>{var{to:n,at:r=e.selection,mode:a="lowest",voids:i=!1}=t,{match:s}=t;if(r){s==null&&(s=P.isPath(r)?or(e,r):m=>de.isElement(m)&&y.isBlock(e,m));var o=y.pathRef(e,n),l=y.nodes(e,{at:r,match:s,mode:a,voids:i}),u=Array.from(l,m=>{var[,g]=m;return y.pathRef(e,g)});for(var c of u){var h=c.unref(),p=o.current;h.length!==0&&e.apply({type:"move_node",path:h,newPath:p}),o.current&&P.isSibling(p,h)&&P.isAfter(p,h)&&(o.current=P.next(o.current))}o.unref()}})},W0=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};y.withoutNormalizing(t,()=>{var{hanging:r=!1,voids:a=!1,mode:i="lowest"}=n,{at:s=t.selection,match:o}=n;if(s){o==null&&(o=P.isPath(s)?or(t,s):m=>de.isElement(m)&&y.isBlock(t,m)),!r&&K.isRange(s)&&(s=y.unhangRange(t,s,{voids:a}));var l=y.nodes(t,{at:s,match:o,mode:i,voids:a}),u=Array.from(l,m=>{var[,g]=m;return y.pathRef(t,g)});for(var c of u){var h=c.unref();if(h){var[p]=y.node(t,h);t.apply({type:"remove_node",path:h,node:p})}}}})},U0=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};y.withoutNormalizing(t,()=>{var{match:a,at:i=t.selection,compare:s,merge:o}=r,{hanging:l=!1,mode:u="lowest",split:c=!1,voids:h=!1}=r;if(i){if(a==null&&(a=P.isPath(i)?or(t,i):q=>de.isElement(q)&&y.isBlock(t,q)),!l&&K.isRange(i)&&(i=y.unhangRange(t,i,{voids:h})),c&&K.isRange(i)){if(K.isCollapsed(i)&&y.leaf(t,i.anchor)[0].text.length>0)return;var p=y.rangeRef(t,i,{affinity:"inward"}),[m,g]=K.edges(i),f=u==="lowest"?"lowest":"highest",b=y.isEnd(t,g,g.path);J.splitNodes(t,{at:g,match:a,mode:f,voids:h,always:!b});var v=y.isStart(t,m,m.path);J.splitNodes(t,{at:m,match:a,mode:f,voids:h,always:!v}),i=p.unref(),r.at==null&&J.select(t,i)}s||(s=(q,$)=>q!==$);for(var[E,k]of y.nodes(t,{at:i,match:a,mode:u,voids:h})){var x={},w={};if(k.length!==0){var A=!1;for(var S in n)S==="children"||S==="text"||s(n[S],E[S])&&(A=!0,E.hasOwnProperty(S)&&(x[S]=E[S]),o?n[S]!=null&&(w[S]=o(E[S],n[S])):n[S]!=null&&(w[S]=n[S]));A&&t.apply({type:"set_node",path:k,properties:x,newProperties:w})}}}})},H0=(e,t)=>{if(K.isCollapsed(t))return t.anchor;var[,n]=K.edges(t),r=y.pointRef(e,n);return J.delete(e,{at:t}),r.unref()},V0=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};y.withoutNormalizing(t,()=>{var{mode:r="lowest",voids:a=!1}=n,{match:i,at:s=t.selection,height:o=0,always:l=!1}=n;if(i==null&&(i=ae=>de.isElement(ae)&&y.isBlock(t,ae)),K.isRange(s)&&(s=H0(t,s)),P.isPath(s)){var u=s,c=y.point(t,u),[h]=y.parent(t,u);i=ae=>ae===h,o=c.path.length-u.length+1,s=c,l=!0}if(s){var p=y.pointRef(t,s,{affinity:"backward"}),m;try{var[g]=y.nodes(t,{at:s,match:i,mode:r,voids:a});if(!g)return;var f=y.void(t,{at:s,mode:"highest"}),b=0;if(!a&&f){var[v,E]=f;if(de.isElement(v)&&t.isInline(v)){var k=y.after(t,E);if(!k){var x={text:""},w=P.next(E);J.insertNodes(t,x,{at:w,voids:a}),k=y.point(t,w)}s=k,l=!0}var A=s.path.length-E.length;o=A+1,l=!0}m=y.pointRef(t,s);var S=s.path.length-o,[,q]=g,$=s.path.slice(0,S),N=o===0?s.offset:s.path[S]+b;for(var[L,_]of y.levels(t,{at:$,reverse:!0,voids:a})){var B=!1;if(_.length<q.length||_.length===0||!a&&de.isElement(L)&&y.isVoid(t,L))break;var j=p.current,I=y.isEnd(t,j,_);if(l||!p||!y.isEdge(t,j,_)){B=!0;var G=ue.extractProps(L);t.apply({type:"split_node",path:_,position:N,properties:G})}N=_[_.length-1]+(B||I?1:0)}if(n.at==null){var V=m.current||y.end(t,[]);J.select(t,V)}}finally{var Q;p.unref(),(Q=m)===null||Q===void 0||Q.unref()}}})},K0=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Array.isArray(n)||(n=[n]);var a={};for(var i of n)a[i]=null;J.setNodes(t,a,r)},Z0=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};y.withoutNormalizing(t,()=>{var{mode:r="lowest",split:a=!1,voids:i=!1}=n,{at:s=t.selection,match:o}=n;if(s){o==null&&(o=P.isPath(s)?or(t,s):m=>de.isElement(m)&&y.isBlock(t,m)),P.isPath(s)&&(s=y.range(t,s));var l=K.isRange(s)?y.rangeRef(t,s):null,u=y.nodes(t,{at:s,match:o,mode:r,voids:i}),c=Array.from(u,m=>{var[,g]=m;return y.pathRef(t,g)}).reverse(),h=function(){var g=p.unref(),[f]=y.node(t,g),b=y.range(t,g);a&&l&&(b=K.intersection(l.current,b)),J.liftNodes(t,{at:b,match:v=>de.isAncestor(f)&&f.children.includes(v),voids:i})};for(var p of c)h();l&&l.unref()}})};function al(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function il(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?al(Object(n),!0).forEach(function(r){ut(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):al(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Y0=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};y.withoutNormalizing(t,()=>{var{mode:a="lowest",split:i=!1,voids:s=!1}=r,{match:o,at:l=t.selection}=r;if(l){if(o==null&&(P.isPath(l)?o=or(t,l):t.isInline(n)?o=b=>de.isElement(b)&&y.isInline(t,b)||fe.isText(b):o=b=>de.isElement(b)&&y.isBlock(t,b)),i&&K.isRange(l)){var[u,c]=K.edges(l),h=y.rangeRef(t,l,{affinity:"inward"});J.splitNodes(t,{at:c,match:o,voids:s}),J.splitNodes(t,{at:u,match:o,voids:s}),l=h.unref(),r.at==null&&J.select(t,l)}var p=Array.from(y.nodes(t,{at:l,match:t.isInline(n)?b=>de.isElement(b)&&y.isBlock(t,b):b=>y.isEditor(b),mode:"lowest",voids:s})),m=function(){var v=K.isRange(l)?K.intersection(l,y.range(t,f)):l;if(!v)return 0;var E=Array.from(y.nodes(t,{at:v,match:o,mode:a,voids:s}));if(E.length>0){var[k]=E,x=E[E.length-1],[,w]=k,[,A]=x;if(w.length===0&&A.length===0)return 0;var S=P.equals(w,A)?P.parent(w):P.common(w,A),q=y.range(t,w,A),$=y.node(t,S),[N]=$,L=S.length+1,_=P.next(A.slice(0,L)),B=il(il({},n),{},{children:[]});J.insertNodes(t,B,{at:_,voids:s}),J.moveNodes(t,{at:q,match:j=>de.isAncestor(N)&&N.children.includes(j),to:_.concat(0),voids:s})}},g;for(var[,f]of p)g=m()}})},G0=()=>{var e={children:[],operations:[],selection:null,marks:null,isElementReadOnly:()=>!1,isInline:()=>!1,isSelectable:()=>!0,isVoid:()=>!1,markableVoid:()=>!1,onChange:()=>{},apply:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Dv(e,...r)},addMark:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Fv(e,...r)},deleteBackward:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Tv(e,...r)},deleteForward:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Sv(e,...r)},deleteFragment:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return jv(e,...r)},getFragment:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return wv(e,...r)},insertBreak:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Wv(e,...r)},insertSoftBreak:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Hv(e,...r)},insertFragment:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return T0(e,...r)},insertNode:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Uv(e,...r)},insertText:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Kv(e,...r)},normalizeNode:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Ev(e,...r)},removeMark:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return w0(e,...r)},getDirtyPaths:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return xv(e,...r)},shouldNormalize:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return _v(e,...r)},above:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return kv(e,...r)},after:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Bv(e,...r)},before:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Av(e,...r)},collapse:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return S0(e,...r)},delete:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return A0(e,...r)},deselect:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return j0(e,...r)},edges:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Ov(e,...r)},elementReadOnly:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Pv(e,...r)},end:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Nv(e,...r)},first:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Rv(e,...r)},fragment:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Mv(e,...r)},getMarks:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return i0(e,...r)},hasBlocks:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return $v(e,...r)},hasInlines:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Lv(e,...r)},hasPath:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return zv(e,...r)},hasTexts:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return qv(e,...r)},insertNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return M0(e,...r)},isBlock:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Zv(e,...r)},isEdge:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Yv(e,...r)},isEmpty:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Gv(e,...r)},isEnd:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Qv(e,...r)},isNormalizing:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Jv(e,...r)},isStart:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Xv(e,...r)},last:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return e0(e,...r)},leaf:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return t0(e,...r)},levels:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return n0(e,...r)},liftNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return I0(e,...r)},mergeNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return z0(e,...r)},move:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return O0(e,...r)},moveNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return q0(e,...r)},next:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return s0(e,...r)},node:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return o0(e,...r)},nodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return u0(e,...r)},normalize:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return l0(e,...r)},parent:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return c0(e,...r)},path:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return h0(e,...r)},pathRef:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return d0(e,...r)},pathRefs:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return f0(e,...r)},point:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return g0(e,...r)},pointRef:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return m0(e,...r)},pointRefs:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return p0(e,...r)},positions:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return v0(e,...r)},previous:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return b0(e,...r)},range:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return D0(e,...r)},rangeRef:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return y0(e,...r)},rangeRefs:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return C0(e,...r)},removeNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return W0(e,...r)},select:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return P0(e,...r)},setNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return U0(e,...r)},setNormalizing:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return E0(e,...r)},setPoint:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return N0(e,...r)},setSelection:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return R0(e,...r)},splitNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return V0(e,...r)},start:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return _0(e,...r)},string:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return k0(e,...r)},unhangRange:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return F0(e,...r)},unsetNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return K0(e,...r)},unwrapNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Z0(e,...r)},void:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Iv(e,...r)},withoutNormalizing:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return B0(e,...r)},wrapNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Y0(e,...r)}};return e},Q0={isHistory(e){return tt(e)&&Array.isArray(e.redos)&&Array.isArray(e.undos)&&(e.redos.length===0||sn.isOperationList(e.redos[0].operations))&&(e.undos.length===0||sn.isOperationList(e.undos[0].operations))}},Ai=new WeakMap,Ti=new WeakMap,Un={isHistoryEditor(e){return Q0.isHistory(e.history)&&y.isEditor(e)},isMerging(e){return Ti.get(e)},isSaving(e){return Ai.get(e)},redo(e){e.redo()},undo(e){e.undo()},withoutMerging(e,t){var n=Un.isMerging(e);Ti.set(e,!1),t(),Ti.set(e,n)},withoutSaving(e,t){var n=Un.isSaving(e);Ai.set(e,!1),t(),Ai.set(e,n)}},J0=e=>{var t=e,{apply:n}=t;return t.history={undos:[],redos:[]},t.redo=()=>{var{history:r}=t,{redos:a}=r;if(a.length>0){var i=a[a.length-1];i.selectionBefore&&J.setSelection(t,i.selectionBefore),Un.withoutSaving(t,()=>{y.withoutNormalizing(t,()=>{for(var s of i.operations)t.apply(s)})}),r.redos.pop(),t.writeHistory("undos",i)}},t.undo=()=>{var{history:r}=t,{undos:a}=r;if(a.length>0){var i=a[a.length-1];Un.withoutSaving(t,()=>{y.withoutNormalizing(t,()=>{var s=i.operations.map(sn.inverse).reverse();for(var o of s)t.apply(o);i.selectionBefore&&J.setSelection(t,i.selectionBefore)})}),t.writeHistory("redos",i),r.undos.pop()}},t.apply=r=>{var{operations:a,history:i}=t,{undos:s}=i,o=s[s.length-1],l=o&&o.operations[o.operations.length-1],u=Un.isSaving(t),c=Un.isMerging(t);if(u==null&&(u=eb(r)),u){if(c==null&&(o==null?c=!1:a.length!==0?c=!0:c=X0(r,l)),o&&c)o.operations.push(r);else{var h={operations:[r],selectionBefore:t.selection};t.writeHistory("undos",h)}for(;s.length>100;)s.shift();i.redos=[]}n(r)},t.writeHistory=(r,a)=>{t.history[r].push(a)},t},X0=(e,t)=>!!(t&&e.type==="insert_text"&&t.type==="insert_text"&&e.offset===t.offset+t.text.length&&P.equals(e.path,t.path)||t&&e.type==="remove_text"&&t.type==="remove_text"&&e.offset+e.text.length===t.offset&&P.equals(e.path,t.path)),eb=(e,t)=>e.type!=="set_selection",tb=ab,Zd="֑-߿יִ-﷽ﹰ-ﻼ",Yd="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",nb=new RegExp("^[^"+Yd+"]*["+Zd+"]"),rb=new RegExp("^[^"+Zd+"]*["+Yd+"]");function ab(e){return e=String(e||""),nb.test(e)?"rtl":rb.test(e)?"ltr":"neutral"}const Gd=Tn(tb);function ib(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var po=ib,sb=typeof Vr=="object"&&Vr&&Vr.Object===Object&&Vr,ob=sb,ub=ob,lb=typeof self=="object"&&self&&self.Object===Object&&self,cb=ub||lb||Function("return this")(),Qd=cb,db=Qd,fb=function(){return db.Date.now()},hb=fb,mb=/\s/;function pb(e){for(var t=e.length;t--&&mb.test(e.charAt(t)););return t}var gb=pb,vb=gb,bb=/^\s+/;function yb(e){return e&&e.slice(0,vb(e)+1).replace(bb,"")}var Cb=yb,Db=Qd,xb=Db.Symbol,Jd=xb,sl=Jd,Xd=Object.prototype,wb=Xd.hasOwnProperty,Eb=Xd.toString,gr=sl?sl.toStringTag:void 0;function _b(e){var t=wb.call(e,gr),n=e[gr];try{e[gr]=void 0;var r=!0}catch{}var a=Eb.call(e);return r&&(t?e[gr]=n:delete e[gr]),a}var kb=_b,Fb=Object.prototype,Bb=Fb.toString;function Ab(e){return Bb.call(e)}var Tb=Ab,ol=Jd,Sb=kb,jb=Tb,Ob="[object Null]",Pb="[object Undefined]",ul=ol?ol.toStringTag:void 0;function Nb(e){return e==null?e===void 0?Pb:Ob:ul&&ul in Object(e)?Sb(e):jb(e)}var Rb=Nb;function Mb(e){return e!=null&&typeof e=="object"}var Ib=Mb,$b=Rb,Lb=Ib,zb="[object Symbol]";function qb(e){return typeof e=="symbol"||Lb(e)&&$b(e)==zb}var Wb=qb,Ub=Cb,ll=po,Hb=Wb,cl=0/0,Vb=/^[-+]0x[0-9a-f]+$/i,Kb=/^0b[01]+$/i,Zb=/^0o[0-7]+$/i,Yb=parseInt;function Gb(e){if(typeof e=="number")return e;if(Hb(e))return cl;if(ll(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=ll(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Ub(e);var n=Kb.test(e);return n||Zb.test(e)?Yb(e.slice(2),n?2:8):Vb.test(e)?cl:+e}var Qb=Gb,Jb=po,Si=hb,dl=Qb,Xb="Expected a function",ey=Math.max,ty=Math.min;function ny(e,t,n){var r,a,i,s,o,l,u=0,c=!1,h=!1,p=!0;if(typeof e!="function")throw new TypeError(Xb);t=dl(t)||0,Jb(n)&&(c=!!n.leading,h="maxWait"in n,i=h?ey(dl(n.maxWait)||0,t):i,p="trailing"in n?!!n.trailing:p);function m(A){var S=r,q=a;return r=a=void 0,u=A,s=e.apply(q,S),s}function g(A){return u=A,o=setTimeout(v,t),c?m(A):s}function f(A){var S=A-l,q=A-u,$=t-S;return h?ty($,i-q):$}function b(A){var S=A-l,q=A-u;return l===void 0||S>=t||S<0||h&&q>=i}function v(){var A=Si();if(b(A))return E(A);o=setTimeout(v,f(A))}function E(A){return o=void 0,p&&r?m(A):(r=a=void 0,s)}function k(){o!==void 0&&clearTimeout(o),u=0,r=l=a=o=void 0}function x(){return o===void 0?s:E(Si())}function w(){var A=Si(),S=b(A);if(r=arguments,a=this,l=A,S){if(o===void 0)return g(l);if(h)return clearTimeout(o),o=setTimeout(v,t),m(l)}return o===void 0&&(o=setTimeout(v,t)),s}return w.cancel=k,w.flush=x,w}var ef=ny;const ry=Tn(ef);var ay=ef,iy=po,sy="Expected a function";function oy(e,t,n){var r=!0,a=!0;if(typeof e!="function")throw new TypeError(sy);return iy(n)&&(r="leading"in n?!!n.leading:r,a="trailing"in n?!!n.trailing:a),ay(e,t,{leading:r,maxWait:t,trailing:a})}var uy=oy;const ly=Tn(uy),fl=e=>typeof e=="object"&&e!=null&&e.nodeType===1,hl=(e,t)=>(!t||e!=="hidden")&&e!=="visible"&&e!=="clip",ji=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const n=getComputedStyle(e,null);return hl(n.overflowY,t)||hl(n.overflowX,t)||(r=>{const a=(i=>{if(!i.ownerDocument||!i.ownerDocument.defaultView)return null;try{return i.ownerDocument.defaultView.frameElement}catch{return null}})(r);return!!a&&(a.clientHeight<r.scrollHeight||a.clientWidth<r.scrollWidth)})(e)}return!1},ra=(e,t,n,r,a,i,s,o)=>i<e&&s>t||i>e&&s<t?0:i<=e&&o<=n||s>=t&&o>=n?i-e-r:s>t&&o<n||i<e&&o>n?s-t+a:0,cy=e=>{const t=e.parentElement;return t??(e.getRootNode().host||null)},ml=(e,t)=>{var n,r,a,i;if(typeof document>"u")return[];const{scrollMode:s,block:o,inline:l,boundary:u,skipOverflowHiddenElements:c}=t,h=typeof u=="function"?u:G=>G!==u;if(!fl(e))throw new TypeError("Invalid target");const p=document.scrollingElement||document.documentElement,m=[];let g=e;for(;fl(g)&&h(g);){if(g=cy(g),g===p){m.push(g);break}g!=null&&g===document.body&&ji(g)&&!ji(document.documentElement)||g!=null&&ji(g,c)&&m.push(g)}const f=(r=(n=window.visualViewport)==null?void 0:n.width)!=null?r:innerWidth,b=(i=(a=window.visualViewport)==null?void 0:a.height)!=null?i:innerHeight,{scrollX:v,scrollY:E}=window,{height:k,width:x,top:w,right:A,bottom:S,left:q}=e.getBoundingClientRect(),{top:$,right:N,bottom:L,left:_}=(G=>{const V=window.getComputedStyle(G);return{top:parseFloat(V.scrollMarginTop)||0,right:parseFloat(V.scrollMarginRight)||0,bottom:parseFloat(V.scrollMarginBottom)||0,left:parseFloat(V.scrollMarginLeft)||0}})(e);let B=o==="start"||o==="nearest"?w-$:o==="end"?S+L:w+k/2-$+L,j=l==="center"?q+x/2-_+N:l==="end"?A+N:q-_;const I=[];for(let G=0;G<m.length;G++){const V=m[G],{height:Q,width:ae,top:D,right:M,bottom:W,left:F}=V.getBoundingClientRect();if(s==="if-needed"&&w>=0&&q>=0&&S<=b&&A<=f&&w>=D&&S<=W&&q>=F&&A<=M)return I;const T=getComputedStyle(V),z=parseInt(T.borderLeftWidth,10),R=parseInt(T.borderTopWidth,10),H=parseInt(T.borderRightWidth,10),re=parseInt(T.borderBottomWidth,10);let X=0,ne=0;const le="offsetWidth"in V?V.offsetWidth-V.clientWidth-z-H:0,ee="offsetHeight"in V?V.offsetHeight-V.clientHeight-R-re:0,he="offsetWidth"in V?V.offsetWidth===0?0:ae/V.offsetWidth:0,me="offsetHeight"in V?V.offsetHeight===0?0:Q/V.offsetHeight:0;if(p===V)X=o==="start"?B:o==="end"?B-b:o==="nearest"?ra(E,E+b,b,R,re,E+B,E+B+k,k):B-b/2,ne=l==="start"?j:l==="center"?j-f/2:l==="end"?j-f:ra(v,v+f,f,z,H,v+j,v+j+x,x),X=Math.max(0,X+E),ne=Math.max(0,ne+v);else{X=o==="start"?B-D-R:o==="end"?B-W+re+ee:o==="nearest"?ra(D,W,Q,R,re+ee,B,B+k,k):B-(D+Q/2)+ee/2,ne=l==="start"?j-F-z:l==="center"?j-(F+ae/2)+le/2:l==="end"?j-M+H+le:ra(F,M,ae,z,H+le,j,j+x,x);const{scrollLeft:ye,scrollTop:Be}=V;X=me===0?0:Math.max(0,Math.min(Be+X/me,V.scrollHeight-Q/me+ee)),ne=he===0?0:Math.max(0,Math.min(ye+ne/he,V.scrollWidth-ae/he+le)),B+=Be-X,j+=ye-ne}I.push({el:V,top:X,left:ne})}return I},dy=e=>e===!1?{block:"end",inline:"nearest"}:(t=>t===Object(t)&&Object.keys(t).length!==0)(e)?e:{block:"start",inline:"nearest"};function fy(e,t){if(!e.isConnected||!(a=>{let i=a;for(;i&&i.parentNode;){if(i.parentNode===document)return!0;i=i.parentNode instanceof ShadowRoot?i.parentNode.host:i.parentNode}return!1})(e))return;const n=(a=>{const i=window.getComputedStyle(a);return{top:parseFloat(i.scrollMarginTop)||0,right:parseFloat(i.scrollMarginRight)||0,bottom:parseFloat(i.scrollMarginBottom)||0,left:parseFloat(i.scrollMarginLeft)||0}})(e);if((a=>typeof a=="object"&&typeof a.behavior=="function")(t))return t.behavior(ml(e,t));const r=typeof t=="boolean"||t==null?void 0:t.behavior;for(const{el:a,top:i,left:s}of ml(e,dy(t))){const o=i-n.top+n.bottom,l=s-n.left+n.right;a.scroll({top:o,left:l,behavior:r})}}var Dn=[],hy=function(){return Dn.some(function(e){return e.activeTargets.length>0})},my=function(){return Dn.some(function(e){return e.skippedTargets.length>0})},pl="ResizeObserver loop completed with undelivered notifications.",py=function(){var e;typeof ErrorEvent=="function"?e=new ErrorEvent("error",{message:pl}):(e=document.createEvent("Event"),e.initEvent("error",!1,!1),e.message=pl),window.dispatchEvent(e)},Nr;(function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(Nr||(Nr={}));var xn=function(e){return Object.freeze(e)},gy=function(){function e(t,n){this.inlineSize=t,this.blockSize=n,xn(this)}return e}(),tf=function(){function e(t,n,r,a){return this.x=t,this.y=n,this.width=r,this.height=a,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,xn(this)}return e.prototype.toJSON=function(){var t=this,n=t.x,r=t.y,a=t.top,i=t.right,s=t.bottom,o=t.left,l=t.width,u=t.height;return{x:n,y:r,top:a,right:i,bottom:s,left:o,width:l,height:u}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),go=function(e){return e instanceof SVGElement&&"getBBox"in e},nf=function(e){if(go(e)){var t=e.getBBox(),n=t.width,r=t.height;return!n&&!r}var a=e,i=a.offsetWidth,s=a.offsetHeight;return!(i||s||e.getClientRects().length)},gl=function(e){var t;if(e instanceof Element)return!0;var n=(t=e==null?void 0:e.ownerDocument)===null||t===void 0?void 0:t.defaultView;return!!(n&&e instanceof n.Element)},vy=function(e){switch(e.tagName){case"INPUT":if(e.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},wr=typeof window<"u"?window:{},aa=new WeakMap,vl=/auto|scroll/,by=/^tb|vertical/,yy=/msie|trident/i.test(wr.navigator&&wr.navigator.userAgent),jt=function(e){return parseFloat(e||"0")},Zn=function(e,t,n){return e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=!1),new gy((n?t:e)||0,(n?e:t)||0)},bl=xn({devicePixelContentBoxSize:Zn(),borderBoxSize:Zn(),contentBoxSize:Zn(),contentRect:new tf(0,0,0,0)}),rf=function(e,t){if(t===void 0&&(t=!1),aa.has(e)&&!t)return aa.get(e);if(nf(e))return aa.set(e,bl),bl;var n=getComputedStyle(e),r=go(e)&&e.ownerSVGElement&&e.getBBox(),a=!yy&&n.boxSizing==="border-box",i=by.test(n.writingMode||""),s=!r&&vl.test(n.overflowY||""),o=!r&&vl.test(n.overflowX||""),l=r?0:jt(n.paddingTop),u=r?0:jt(n.paddingRight),c=r?0:jt(n.paddingBottom),h=r?0:jt(n.paddingLeft),p=r?0:jt(n.borderTopWidth),m=r?0:jt(n.borderRightWidth),g=r?0:jt(n.borderBottomWidth),f=r?0:jt(n.borderLeftWidth),b=h+u,v=l+c,E=f+m,k=p+g,x=o?e.offsetHeight-k-e.clientHeight:0,w=s?e.offsetWidth-E-e.clientWidth:0,A=a?b+E:0,S=a?v+k:0,q=r?r.width:jt(n.width)-A-w,$=r?r.height:jt(n.height)-S-x,N=q+b+w+E,L=$+v+x+k,_=xn({devicePixelContentBoxSize:Zn(Math.round(q*devicePixelRatio),Math.round($*devicePixelRatio),i),borderBoxSize:Zn(N,L,i),contentBoxSize:Zn(q,$,i),contentRect:new tf(h,l,q,$)});return aa.set(e,_),_},af=function(e,t,n){var r=rf(e,n),a=r.borderBoxSize,i=r.contentBoxSize,s=r.devicePixelContentBoxSize;switch(t){case Nr.DEVICE_PIXEL_CONTENT_BOX:return s;case Nr.BORDER_BOX:return a;default:return i}},Cy=function(){function e(t){var n=rf(t);this.target=t,this.contentRect=n.contentRect,this.borderBoxSize=xn([n.borderBoxSize]),this.contentBoxSize=xn([n.contentBoxSize]),this.devicePixelContentBoxSize=xn([n.devicePixelContentBoxSize])}return e}(),sf=function(e){if(nf(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},Dy=function(){var e=1/0,t=[];Dn.forEach(function(s){if(s.activeTargets.length!==0){var o=[];s.activeTargets.forEach(function(u){var c=new Cy(u.target),h=sf(u.target);o.push(c),u.lastReportedSize=af(u.target,u.observedBox),h<e&&(e=h)}),t.push(function(){s.callback.call(s.observer,o,s.observer)}),s.activeTargets.splice(0,s.activeTargets.length)}});for(var n=0,r=t;n<r.length;n++){var a=r[n];a()}return e},yl=function(e){Dn.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(a){a.isActive()&&(sf(a.target)>e?n.activeTargets.push(a):n.skippedTargets.push(a))})})},xy=function(){var e=0;for(yl(e);hy();)e=Dy(),yl(e);return my()&&py(),e>0},Oi,of=[],wy=function(){return of.splice(0).forEach(function(e){return e()})},Ey=function(e){if(!Oi){var t=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return wy()}).observe(n,r),Oi=function(){n.textContent="".concat(t?t--:t++)}}of.push(e),Oi()},_y=function(e){Ey(function(){requestAnimationFrame(e)})},Ca=0,ky=function(){return!!Ca},Fy=250,By={attributes:!0,characterData:!0,childList:!0,subtree:!0},Cl=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Dl=function(e){return e===void 0&&(e=0),Date.now()+e},Pi=!1,Ay=function(){function e(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return e.prototype.run=function(t){var n=this;if(t===void 0&&(t=Fy),!Pi){Pi=!0;var r=Dl(t);_y(function(){var a=!1;try{a=xy()}finally{if(Pi=!1,t=r-Dl(),!ky())return;a?n.run(1e3):t>0?n.run(t):n.start()}})}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var t=this,n=function(){return t.observer&&t.observer.observe(document.body,By)};document.body?n():wr.addEventListener("DOMContentLoaded",n)},e.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Cl.forEach(function(n){return wr.addEventListener(n,t.listener,!0)}))},e.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),Cl.forEach(function(n){return wr.removeEventListener(n,t.listener,!0)}),this.stopped=!0)},e}(),Fs=new Ay,xl=function(e){!Ca&&e>0&&Fs.start(),Ca+=e,!Ca&&Fs.stop()},Ty=function(e){return!go(e)&&!vy(e)&&getComputedStyle(e).display==="inline"},Sy=function(){function e(t,n){this.target=t,this.observedBox=n||Nr.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var t=af(this.target,this.observedBox,!0);return Ty(this.target)&&(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),jy=function(){function e(t,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=n}return e}(),ia=new WeakMap,wl=function(e,t){for(var n=0;n<e.length;n+=1)if(e[n].target===t)return n;return-1},sa=function(){function e(){}return e.connect=function(t,n){var r=new jy(t,n);ia.set(t,r)},e.observe=function(t,n,r){var a=ia.get(t),i=a.observationTargets.length===0;wl(a.observationTargets,n)<0&&(i&&Dn.push(a),a.observationTargets.push(new Sy(n,r&&r.box)),xl(1),Fs.schedule())},e.unobserve=function(t,n){var r=ia.get(t),a=wl(r.observationTargets,n),i=r.observationTargets.length===1;a>=0&&(i&&Dn.splice(Dn.indexOf(r),1),r.observationTargets.splice(a,1),xl(-1))},e.disconnect=function(t){var n=this,r=ia.get(t);r.observationTargets.slice().forEach(function(a){return n.unobserve(t,a.target)}),r.activeTargets.splice(0,r.activeTargets.length)},e}(),Oy=function(){function e(t){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof t!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");sa.connect(this,t)}return e.prototype.observe=function(t,n){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!gl(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");sa.observe(this,t,n)},e.prototype.unobserve=function(t){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!gl(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");sa.unobserve(this,t)},e.prototype.disconnect=function(){sa.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}(),Jt={};Object.defineProperty(Jt,"__esModule",{value:!0});var Py=typeof window<"u"&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),Ni={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},uf={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:Py?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},vo={backspace:8,tab:9,enter:13,shift:16,control:17,alt:18,pause:19,capslock:20,escape:27," ":32,pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,insert:45,delete:46,meta:91,numlock:144,scrolllock:145,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222};for(var oa=1;oa<20;oa++)vo["f"+oa]=111+oa;function ai(e,t,n){t&&!("byKey"in t)&&(n=t,t=null),Array.isArray(e)||(e=[e]);var r=e.map(function(s){return lf(s,t)}),a=function(o){return r.some(function(l){return cf(l,o)})},i=n==null?a:a(n);return i}function Ny(e,t){return ai(e,t)}function Ry(e,t){return ai(e,{byKey:!0},t)}function lf(e,t){var n=t&&t.byKey,r={};e=e.replace("++","+add");var a=e.split("+"),i=a.length;for(var s in Ni)r[Ni[s]]=!1;var o=!0,l=!1,u=void 0;try{for(var c=a[Symbol.iterator](),h;!(o=(h=c.next()).done);o=!0){var p=h.value,m=p.endsWith("?")&&p.length>1;m&&(p=p.slice(0,-1));var g=bo(p),f=Ni[g];if(p.length>1&&!f&&!uf[p]&&!vo[g])throw new TypeError('Unknown modifier: "'+p+'"');(i===1||!f)&&(n?r.key=g:r.which=df(p)),f&&(r[f]=m?null:!0)}}catch(b){l=!0,u=b}finally{try{!o&&c.return&&c.return()}finally{if(l)throw u}}return r}function cf(e,t){for(var n in e){var r=e[n],a=void 0;if(r!=null&&(n==="key"&&t.key!=null?a=t.key.toLowerCase():n==="which"?a=r===91&&t.which===93?91:t.which:a=t[n],!(a==null&&r===!1)&&a!==r))return!1}return!0}function df(e){e=bo(e);var t=vo[e]||e.toUpperCase().charCodeAt(0);return t}function bo(e){return e=e.toLowerCase(),e=uf[e]||e,e}var My=Jt.default=ai,Ri=Jt.isHotkey=ai;Jt.isCodeHotkey=Ny;Jt.isKeyHotkey=Ry;Jt.parseHotkey=lf;Jt.compareHotkey=cf;Jt.toKeyCode=df;Jt.toKeyName=bo;function Iy(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,i;for(i=0;i<r.length;i++)a=r[i],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function er(e,t){if(e==null)return{};var n=Iy(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Rr(e){"@babel/helpers - typeof";return Rr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rr(e)}function $y(e,t){if(Rr(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Rr(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ly(e){var t=$y(e,"string");return Rr(t)==="symbol"?t:String(t)}function Et(e,t,n){return t=Ly(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var yo=C.createContext(null),fn=()=>{var e=C.useContext(yo);if(!e)throw new Error("The `useSlateStatic` hook must be used inside the <Slate> component's context.");return e},ff=parseInt(C.version.split(".")[0],10),zy=typeof navigator<"u"&&typeof window<"u"&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,El=typeof navigator<"u"&&/Mac OS X/.test(navigator.userAgent),ot=typeof navigator<"u"&&/Android/.test(navigator.userAgent),Hn=typeof navigator<"u"&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Cr=typeof navigator<"u"&&/AppleWebKit(?!.*Chrome)/i.test(navigator.userAgent),qy=typeof navigator<"u"&&/Edge?\/(?:[0-6][0-9]|[0-7][0-8])(?:\.)/i.test(navigator.userAgent),hf=typeof navigator<"u"&&/Chrome/i.test(navigator.userAgent),Wy=typeof navigator<"u"&&/Chrome?\/(?:[0-7][0-5]|[0-6][0-9])(?:\.)/i.test(navigator.userAgent),Uy=ot&&typeof navigator<"u"&&/Chrome?\/(?:[0-5]?\d)(?:\.)/i.test(navigator.userAgent),Hy=typeof navigator<"u"&&/^(?!.*Seamonkey)(?=.*Firefox\/(?:[0-7][0-9]|[0-8][0-6])(?:\.)).*/i.test(navigator.userAgent),Vy=typeof navigator<"u"&&/.*UCBrowser/.test(navigator.userAgent),Ky=typeof navigator<"u"&&/.*Wechat/.test(navigator.userAgent)&&!/.*MacWechat/.test(navigator.userAgent),Da=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",en=(!Wy||!Uy)&&!qy&&typeof globalThis<"u"&&globalThis.InputEvent&&typeof globalThis.InputEvent.prototype.getTargetRanges=="function",Co=new WeakMap,Do=new WeakMap,mf=new WeakMap,xa=new WeakMap,Bs=new WeakMap,Mr=new WeakMap,wn=new WeakMap,Ia=new WeakMap,ii=new WeakMap,As=new WeakMap,on=new WeakMap,bn=new WeakMap,Er=new WeakMap,Ts=new WeakMap,xo=new WeakMap,Bt=new WeakMap,Kt=new WeakMap,ct=new WeakMap,nn=new WeakMap,rn=new WeakMap,pf=new WeakMap,tr=Symbol("placeholder"),gf=Symbol("mark-placeholder"),Zy=globalThis.Text,wo=e=>e&&e.ownerDocument&&e.ownerDocument.defaultView||null,Yy=e=>un(e)&&e.nodeType===8,wt=e=>un(e)&&e.nodeType===1,un=e=>{var t=wo(e);return!!t&&e instanceof t.Node},Ss=e=>{var t=e&&e.anchorNode&&wo(e.anchorNode);return!!t&&e instanceof t.Selection},vf=e=>un(e)&&e.nodeType===3,Gy=e=>e.clipboardData&&e.clipboardData.getData("text/plain")!==""&&e.clipboardData.types.length===1,Qy=e=>{var[t,n]=e;if(wt(t)&&t.childNodes.length){var r=n===t.childNodes.length,a=r?n-1:n;for([t,a]=bf(t,a,r?"backward":"forward"),r=a<n;wt(t)&&t.childNodes.length;){var i=r?t.childNodes.length-1:0;t=Xy(t,i,r?"backward":"forward")}n=r&&t.textContent!=null?t.textContent.length:0}return[t,n]},Jy=e=>{for(var t=e&&e.parentNode;t;){if(t.toString()==="[object ShadowRoot]")return!0;t=t.parentNode}return!1},bf=(e,t,n)=>{for(var{childNodes:r}=e,a=r[t],i=t,s=!1,o=!1;(Yy(a)||wt(a)&&a.childNodes.length===0||wt(a)&&a.getAttribute("contenteditable")==="false")&&!(s&&o);){if(i>=r.length){s=!0,i=t-1,n="backward";continue}if(i<0){o=!0,i=t+1,n="forward";continue}a=r[i],t=i,i+=n==="forward"?1:-1}return[a,t]},Xy=(e,t,n)=>{var[r]=bf(e,t,n);return r},yf=e=>{var t="";if(vf(e)&&e.nodeValue)return e.nodeValue;if(wt(e)){for(var n of Array.from(e.childNodes))t+=yf(n);var r=getComputedStyle(e).getPropertyValue("display");(r==="block"||r==="list"||e.tagName==="BR")&&(t+=`
130
+ `)}return t},e1=/data-slate-fragment="(.+?)"/m,t1=e=>{var t=e.getData("text/html"),[,n]=t.match(e1)||[];return n},Eo=(e,t,n)=>{var{target:r}=t;if(wt(r)&&r.matches('[contentEditable="false"]'))return!1;var{document:a}=te.getWindow(e);if(a.contains(r))return te.hasDOMNode(e,r,{editable:!0});var i=n.find(s=>{var{addedNodes:o,removedNodes:l}=s;for(var u of o)if(u===r||u.contains(r))return!0;for(var c of l)if(c===r||c.contains(r))return!0});return!i||i===t?!1:Eo(e,i,n)},n1=0;class r1{constructor(){Et(this,"id",void 0),this.id="".concat(n1++)}}var te={androidPendingDiffs:e=>ct.get(e),androidScheduleFlush:e=>{var t;(t=xo.get(e))===null||t===void 0||t()},blur:e=>{var t=te.toDOMNode(e,e),n=te.findDocumentOrShadowRoot(e);on.set(e,!1),n.activeElement===t&&t.blur()},deselect:e=>{var{selection:t}=e,n=te.findDocumentOrShadowRoot(e),r=n.getSelection();r&&r.rangeCount>0&&r.removeAllRanges(),t&&J.deselect(e)},findDocumentOrShadowRoot:e=>{var t=te.toDOMNode(e,e),n=t.getRootNode();return(n instanceof Document||n instanceof ShadowRoot)&&n.getSelection!=null?n:t.ownerDocument},findEventRange:(e,t)=>{"nativeEvent"in t&&(t=t.nativeEvent);var{clientX:n,clientY:r,target:a}=t;if(n==null||r==null)throw new Error("Cannot resolve a Slate range from a DOM event: ".concat(t));var i=te.toSlateNode(e,t.target),s=te.findPath(e,i);if(de.isElement(i)&&y.isVoid(e,i)){var o=a.getBoundingClientRect(),l=e.isInline(i)?n-o.left<o.left+o.width-n:r-o.top<o.top+o.height-r,u=y.point(e,s,{edge:l?"start":"end"}),c=l?y.before(e,u):y.after(e,u);if(c){var h=y.range(e,c);return h}}var p,{document:m}=te.getWindow(e);if(m.caretRangeFromPoint)p=m.caretRangeFromPoint(n,r);else{var g=m.caretPositionFromPoint(n,r);g&&(p=m.createRange(),p.setStart(g.offsetNode,g.offset),p.setEnd(g.offsetNode,g.offset))}if(!p)throw new Error("Cannot resolve a Slate range from a DOM event: ".concat(t));var f=te.toSlateRange(e,p,{exactMatch:!1,suppressThrow:!1});return f},findKey:(e,t)=>{var n=Ia.get(t);return n||(n=new r1,Ia.set(t,n)),n},findPath:(e,t)=>{for(var n=[],r=t;;){var a=Do.get(r);if(a==null){if(y.isEditor(r))return n;break}var i=Co.get(r);if(i==null)break;n.unshift(i),r=a}throw new Error("Unable to find the path for Slate node: ".concat(Xe.stringify(t)))},focus:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{retries:5};if(!on.get(t)){if(n.retries<=0)throw new Error("Could not set focus, editor seems stuck with pending operations");if(t.operations.length>0){setTimeout(()=>{te.focus(t,{retries:n.retries-1})},10);return}var r=te.toDOMNode(t,t),a=te.findDocumentOrShadowRoot(t);if(a.activeElement!==r){if(t.selection&&a instanceof Document){var i=a.getSelection(),s=te.toDOMRange(t,t.selection);i==null||i.removeAllRanges(),i==null||i.addRange(s)}t.selection||(J.select(t,y.start(t,[])),t.onChange()),on.set(t,!0),r.focus({preventScroll:!0})}}},getWindow:e=>{var t=mf.get(e);if(!t)throw new Error("Unable to find a host window element for this editor");return t},hasDOMNode:function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{editable:a=!1}=r,i=te.toDOMNode(t,t),s;try{s=wt(n)?n:n.parentElement}catch(o){if(o instanceof Error&&!o.message.includes('Permission denied to access property "nodeType"'))throw o}return s?s.closest("[data-slate-editor]")===i&&(!a||s.isContentEditable?!0:typeof s.isContentEditable=="boolean"&&s.closest('[contenteditable="false"]')===i||!!s.getAttribute("data-slate-zero-width")):!1},hasEditableTarget:(e,t)=>un(t)&&te.hasDOMNode(e,t,{editable:!0}),hasRange:(e,t)=>{var{anchor:n,focus:r}=t;return y.hasPath(e,n.path)&&y.hasPath(e,r.path)},hasSelectableTarget:(e,t)=>te.hasEditableTarget(e,t)||te.isTargetInsideNonReadonlyVoid(e,t),hasTarget:(e,t)=>un(t)&&te.hasDOMNode(e,t),insertData:(e,t)=>{e.insertData(t)},insertFragmentData:(e,t)=>e.insertFragmentData(t),insertTextData:(e,t)=>e.insertTextData(t),isComposing:e=>!!bn.get(e),isFocused:e=>!!on.get(e),isReadOnly:e=>!!As.get(e),isTargetInsideNonReadonlyVoid:(e,t)=>{if(As.get(e))return!1;var n=te.hasTarget(e,t)&&te.toSlateNode(e,t);return de.isElement(n)&&y.isVoid(e,n)},setFragmentData:(e,t,n)=>e.setFragmentData(t,n),toDOMNode:(e,t)=>{var n=ii.get(e),r=y.isEditor(t)?xa.get(e):n==null?void 0:n.get(te.findKey(e,t));if(!r)throw new Error("Cannot resolve a DOM node from Slate node: ".concat(Xe.stringify(t)));return r},toDOMPoint:(e,t)=>{var[n]=y.node(e,t.path),r=te.toDOMNode(e,n),a;y.void(e,{at:t})&&(t={path:t.path,offset:0});for(var i="[data-slate-string], [data-slate-zero-width]",s=Array.from(r.querySelectorAll(i)),o=0,l=0;l<s.length;l++){var u=s[l],c=u.childNodes[0];if(!(c==null||c.textContent==null)){var{length:h}=c.textContent,p=u.getAttribute("data-slate-length"),m=p==null?h:parseInt(p,10),g=o+m,f=s[l+1];if(t.offset===g&&f!==null&&f!==void 0&&f.hasAttribute("data-slate-mark-placeholder")){var b,v=f.childNodes[0];a=[v instanceof Zy?v:f,(b=f.textContent)!==null&&b!==void 0&&b.startsWith("\uFEFF")?1:0];break}if(t.offset<=g){var E=Math.min(h,Math.max(0,t.offset-o));a=[c,E];break}o=g}}if(!a)throw new Error("Cannot resolve a DOM point from Slate point: ".concat(Xe.stringify(t)));return a},toDOMRange:(e,t)=>{var{anchor:n,focus:r}=t,a=K.isBackward(t),i=te.toDOMPoint(e,n),s=K.isCollapsed(t)?i:te.toDOMPoint(e,r),o=te.getWindow(e),l=o.document.createRange(),[u,c]=a?s:i,[h,p]=a?i:s,m=wt(u)?u:u.parentElement,g=!!m.getAttribute("data-slate-zero-width"),f=wt(h)?h:h.parentElement,b=!!f.getAttribute("data-slate-zero-width");return l.setStart(u,g?1:c),l.setEnd(h,b?1:p),l},toSlateNode:(e,t)=>{var n=wt(t)?t:t.parentElement;n&&!n.hasAttribute("data-slate-node")&&(n=n.closest("[data-slate-node]"));var r=n?Mr.get(n):null;if(!r)throw new Error("Cannot resolve a Slate node from DOM node: ".concat(n));return r},toSlatePoint:(e,t,n)=>{var{exactMatch:r,suppressThrow:a}=n,[i,s]=r?t:Qy(t),o=i.parentNode,l=null,u=0;if(o){var c,h,p=te.toDOMNode(e,e),m=o.closest('[data-slate-void="true"]'),g=m&&p.contains(m)?m:null,f=o.closest("[data-slate-leaf]"),b=null;if(f){if(l=f.closest('[data-slate-node="text"]'),l){var v=te.getWindow(e),E=v.document.createRange();E.setStart(l,0),E.setEnd(i,s);var k=E.cloneContents(),x=[...Array.prototype.slice.call(k.querySelectorAll("[data-slate-zero-width]")),...Array.prototype.slice.call(k.querySelectorAll("[contenteditable=false]"))];x.forEach(j=>{if(ot&&!r&&j.hasAttribute("data-slate-zero-width")&&j.textContent.length>0&&j.textContext!=="\uFEFF"){j.textContent.startsWith("\uFEFF")&&(j.textContent=j.textContent.slice(1));return}j.parentNode.removeChild(j)}),u=k.textContent.length,b=l}}else if(g){for(var w=g.querySelectorAll("[data-slate-leaf]"),A=0;A<w.length;A++){var S=w[A];if(te.hasDOMNode(e,S)){f=S;break}}f?(l=f.closest('[data-slate-node="text"]'),b=f,u=b.textContent.length,b.querySelectorAll("[data-slate-zero-width]").forEach(j=>{u-=j.textContent.length})):u=1}b&&u===b.textContent.length&&ot&&b.getAttribute("data-slate-zero-width")==="z"&&(c=b.textContent)!==null&&c!==void 0&&c.startsWith("\uFEFF")&&(o.hasAttribute("data-slate-zero-width")||Hn&&(h=b.textContent)!==null&&h!==void 0&&h.endsWith(`
131
131
 
132
- `))&&u--}if(ut&&!l&&!r){var W=o.hasAttribute("data-slate-node")?o:o.closest("[data-slate-node]");if(W&&te.hasDOMNode(e,W,{editable:!0})){var R=te.toSlateNode(e,W),{path:I,offset:N}=C.start(e,te.findPath(e,R));return W.querySelector("[data-slate-leaf]")||(N=s),{path:I,offset:N}}}if(!l){if(a)return null;throw new Error("Cannot resolve a Slate point from DOM point: ".concat(t))}var _=te.toSlateNode(e,l),F=te.findPath(e,_);return{path:F,offset:u}},toSlateRange:(e,t,n)=>{var r,{exactMatch:a,suppressThrow:i}=n,s=Ss(t)?t.anchorNode:t.startContainer,o,l,u,c,h;if(s)if(Ss(t)){if(Hn&&t.rangeCount>1){u=t.focusNode;var p=t.getRangeAt(0),m=t.getRangeAt(t.rangeCount-1);if(u instanceof HTMLTableRowElement&&p.startContainer instanceof HTMLTableRowElement&&m.startContainer instanceof HTMLTableRowElement){let A=function(S){return S.childElementCount>0?A(S.children[0]):S};var g=p.startContainer,f=m.startContainer,b=A(g.children[p.startOffset]),v=A(f.children[m.startOffset]);c=0,v.childNodes.length>0?o=v.childNodes[0]:o=v,b.childNodes.length>0?u=b.childNodes[0]:u=b,v instanceof HTMLElement?l=v.innerHTML.length:l=0}else p.startContainer===u?(o=m.endContainer,l=m.endOffset,c=p.startOffset):(o=p.startContainer,l=p.endOffset,c=m.startOffset)}else o=t.anchorNode,l=t.anchorOffset,u=t.focusNode,c=t.focusOffset;mf&&t1(o)||Hn?h=t.anchorNode===t.focusNode&&t.anchorOffset===t.focusOffset:h=t.isCollapsed}else o=t.startContainer,l=t.startOffset,u=t.endContainer,c=t.endOffset,h=t.collapsed;if(o==null||u==null||l==null||c==null)throw new Error("Cannot resolve a Slate range from DOM range: ".concat(t));if(Hn&&(r=u.textContent)!==null&&r!==void 0&&r.endsWith(`
132
+ `))&&u--}if(ot&&!l&&!r){var q=o.hasAttribute("data-slate-node")?o:o.closest("[data-slate-node]");if(q&&te.hasDOMNode(e,q,{editable:!0})){var $=te.toSlateNode(e,q),{path:N,offset:L}=y.start(e,te.findPath(e,$));return q.querySelector("[data-slate-leaf]")||(L=s),{path:N,offset:L}}}if(!l){if(a)return null;throw new Error("Cannot resolve a Slate point from DOM point: ".concat(t))}var _=te.toSlateNode(e,l),B=te.findPath(e,_);return{path:B,offset:u}},toSlateRange:(e,t,n)=>{var r,{exactMatch:a,suppressThrow:i}=n,s=Ss(t)?t.anchorNode:t.startContainer,o,l,u,c,h;if(s)if(Ss(t)){if(Hn&&t.rangeCount>1){u=t.focusNode;var p=t.getRangeAt(0),m=t.getRangeAt(t.rangeCount-1);if(u instanceof HTMLTableRowElement&&p.startContainer instanceof HTMLTableRowElement&&m.startContainer instanceof HTMLTableRowElement){let A=function(S){return S.childElementCount>0?A(S.children[0]):S};var g=p.startContainer,f=m.startContainer,b=A(g.children[p.startOffset]),v=A(f.children[m.startOffset]);c=0,v.childNodes.length>0?o=v.childNodes[0]:o=v,b.childNodes.length>0?u=b.childNodes[0]:u=b,v instanceof HTMLElement?l=v.innerHTML.length:l=0}else p.startContainer===u?(o=m.endContainer,l=m.endOffset,c=p.startOffset):(o=p.startContainer,l=p.endOffset,c=m.startOffset)}else o=t.anchorNode,l=t.anchorOffset,u=t.focusNode,c=t.focusOffset;hf&&Jy(o)||Hn?h=t.anchorNode===t.focusNode&&t.anchorOffset===t.focusOffset:h=t.isCollapsed}else o=t.startContainer,l=t.startOffset,u=t.endContainer,c=t.endOffset,h=t.collapsed;if(o==null||u==null||l==null||c==null)throw new Error("Cannot resolve a Slate range from DOM range: ".concat(t));if(Hn&&(r=u.textContent)!==null&&r!==void 0&&r.endsWith(`
133
133
 
134
- `)&&c===u.textContent.length&&c--,"getAttribute"in u&&u.getAttribute("contenteditable")==="false"&&u.getAttribute("data-slate-void")!=="true"){var E;u=o,c=((E=o.textContent)===null||E===void 0?void 0:E.length)||0}var k=te.toSlatePoint(e,[o,l],{exactMatch:a,suppressThrow:i});if(!k)return null;var x=h?k:te.toSlatePoint(e,[u,c],{exactMatch:a,suppressThrow:i});if(!x)return null;var w={anchor:k,focus:x};return Z.isExpanded(w)&&Z.isForward(w)&&Et(u)&&C.void(e,{at:w.focus,mode:"highest"})&&(w=C.unhangRange(e,w,{voids:!0})),w}};function o1(e,t){var{path:n,diff:r}=t;if(!C.hasPath(e,n))return!1;var a=ue.get(e,n);if(!fe.isText(a))return!1;if(r.start!==a.text.length||r.text.length===0)return a.text.slice(r.start,r.start+r.text.length)===r.text;var i=P.next(n);if(!C.hasPath(e,i))return!1;var s=ue.get(e,i);return fe.isText(s)&&s.text.startsWith(r.text)}function Df(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.reduce((a,i)=>a.slice(0,i.start)+i.text+a.slice(i.end),e)}function u1(e,t){for(var n=Math.min(e.length,t.length),r=0;r<n;r++)if(e.charAt(r)!==t.charAt(r))return r;return n}function l1(e,t,n){for(var r=Math.min(e.length,t.length,n),a=0;a<r;a++)if(e.charAt(e.length-a-1)!==t.charAt(t.length-a-1))return a;return r}function xf(e,t){var{start:n,end:r,text:a}=t,i=e.slice(n,r),s=u1(i,a),o=Math.min(i.length-s,a.length-s),l=l1(i,a,o),u={start:n+s,end:r-l,text:a.slice(s,a.length-l)};return u.start===u.end&&u.text.length===0?null:u}function c1(e,t,n){var r=Math.min(t.start,n.start),a=Math.max(0,Math.min(t.start+t.text.length,n.end)-n.start),i=Df(e,t,n),s=Math.max(n.start+n.text.length,t.start+t.text.length+(t.start+t.text.length>n.start?n.text.length:0)-a),o=i.slice(r,s),l=Math.max(t.end,n.end-t.text.length+(t.end-t.start));return xf(e,{start:r,end:l,text:o})}function d1(e){var{path:t,diff:n}=e;return{anchor:{path:t,offset:n.start},focus:{path:t,offset:n.end}}}function js(e,t){var{path:n,offset:r}=t;if(!C.hasPath(e,n))return null;var a=ue.get(e,n);if(!fe.isText(a))return null;var i=C.above(e,{match:o=>de.isElement(o)&&C.isBlock(e,o),at:n});if(!i)return null;for(;r>a.text.length;){var s=C.next(e,{at:n,match:fe.isText});if(!s||!P.isDescendant(s[1],i[1]))return null;r-=a.text.length,a=s[0],n=s[1]}return{path:n,offset:r}}function kl(e,t){var n=js(e,t.anchor);if(!n)return null;if(Z.isCollapsed(t))return{anchor:n,focus:n};var r=js(e,t.focus);return r?{anchor:n,focus:r}:null}function Os(e,t,n){var r=dt.get(e),a=r==null?void 0:r.find(c=>{var{path:h}=c;return P.equals(h,t.path)});if(!a||t.offset<=a.diff.start)return _e.transform(t,n,{affinity:"backward"});var{diff:i}=a;if(t.offset<=i.start+i.text.length){var s={path:t.path,offset:i.start},o=_e.transform(s,n,{affinity:"backward"});return o?{path:o.path,offset:o.offset+t.offset-i.start}:null}var l={path:t.path,offset:t.offset-i.text.length+i.end-i.start},u=_e.transform(l,n,{affinity:"backward"});return u?n.type==="split_node"&&P.equals(n.path,t.path)&&l.offset<n.position&&i.start<n.position?u:{path:u.path,offset:u.offset+i.text.length-i.end+i.start}:null}function Bl(e,t,n){var r=Os(e,t.anchor,n);if(!r)return null;if(Z.isCollapsed(t))return{anchor:r,focus:r};var a=Os(e,t.focus,n);return a?{anchor:r,focus:a}:null}function f1(e,t){var{path:n,diff:r,id:a}=e;switch(t.type){case"insert_text":return!P.equals(t.path,n)||t.offset>=r.end?e:t.offset<=r.start?{diff:{start:t.text.length+r.start,end:t.text.length+r.end,text:r.text},id:a,path:n}:{diff:{start:r.start,end:r.end+t.text.length,text:r.text},id:a,path:n};case"remove_text":return!P.equals(t.path,n)||t.offset>=r.end?e:t.offset+t.text.length<=r.start?{diff:{start:r.start-t.text.length,end:r.end-t.text.length,text:r.text},id:a,path:n}:{diff:{start:r.start,end:r.end-t.text.length,text:r.text},id:a,path:n};case"split_node":return!P.equals(t.path,n)||t.position>=r.end?{diff:r,id:a,path:P.transform(n,t,{affinity:"backward"})}:t.position>r.start?{diff:{start:r.start,end:Math.min(t.position,r.end),text:r.text},id:a,path:n}:{diff:{start:r.start-t.position,end:r.end-t.position,text:r.text},id:a,path:P.transform(n,t,{affinity:"forward"})};case"merge_node":return P.equals(t.path,n)?{diff:{start:r.start+t.position,end:r.end+t.position,text:r.text},id:a,path:P.transform(n,t)}:{diff:r,id:a,path:P.transform(n,t)}}var i=P.transform(n,t);return i?{diff:r,path:i,id:a}:null}function Fl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function ua(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Fl(Object(n),!0).forEach(function(r){_t(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fl(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var h1=25,m1=200,p1=function(){},g1=e=>(e==null?void 0:e.constructor.name)==="DataTransfer";function v1(e){var{editor:t,scheduleOnDOMSelectionChange:n,onDOMSelectionChange:r}=e,a=!1,i=null,s=null,o=null,l=0,u=!1,c=()=>{var _=rn.get(t);if(rn.delete(t),_){var{selection:F}=t,j=kl(t,_);j&&(!F||!Z.equals(j,F))&&X.select(t,j)}},h=()=>{var _=nn.get(t);if(nn.delete(t),!!_){if(_.at){var F=_e.isPoint(_.at)?js(t,_.at):kl(t,_.at);if(!F)return;var j=C.range(t,F);(!t.selection||!Z.equals(t.selection,j))&&X.select(t,F)}_.run()}},p=()=>{if(s&&(clearTimeout(s),s=null),o&&(clearTimeout(o),o=null),!x()&&!k()){c();return}a||(a=!0,setTimeout(()=>a=!1)),k()&&(a="action");var _=t.selection&&C.rangeRef(t,t.selection,{affinity:"forward"});Kt.set(t,t.marks),p1("flush",nn.get(t),dt.get(t));for(var F=x(),j;j=($=dt.get(t))===null||$===void 0?void 0:$[0];){var $,V,K=Tt.get(t);K!==void 0&&(Tt.delete(t),t.marks=K),K&&u===!1&&(u=null);var Q=d1(j);(!t.selection||!Z.equals(t.selection,Q))&&X.select(t,Q),j.diff.text?C.insertText(t,j.diff.text):C.deleteFragment(t),dt.set(t,(V=dt.get(t))===null||V===void 0?void 0:V.filter(L=>{var{id:q}=L;return q!==j.id})),o1(t,j)||(F=!1,nn.delete(t),Kt.delete(t),a="action",rn.delete(t),n.cancel(),r.cancel(),_==null||_.unref())}var ae=_==null?void 0:_.unref();if(ae&&!rn.get(t)&&(!t.selection||!Z.equals(ae,t.selection))&&X.select(t,ae),k()){h();return}F&&n(),n.flush(),r.flush(),c();var D=Kt.get(t);Kt.delete(t),D!==void 0&&(t.marks=D,t.onChange())},m=_=>{i&&clearTimeout(i),i=setTimeout(()=>{bn.set(t,!1),p()},h1)},g=_=>{bn.set(t,!0),i&&(clearTimeout(i),i=null)},f=function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,j=Fs.get(t);if(j){if(x()||F){j.style.display="none";return}j.style.removeProperty("display")}},b=(_,F)=>{var j,$=(j=dt.get(t))!==null&&j!==void 0?j:[];dt.set(t,$);var V=ue.leaf(t,_),K=$.findIndex(D=>P.equals(D.path,_));if(K<0){var Q=xf(V.text,F);Q&&$.push({path:_,diff:F,id:l++}),f();return}var ae=c1(V.text,$[K].diff,F);if(!ae){$.splice(K,1),f();return}$[K]=ua(ua({},$[K]),{},{diff:ae})},v=function(F){var{at:j}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};u=!1,rn.delete(t),n.cancel(),r.cancel(),k()&&p(),nn.set(t,{at:j,run:F}),o=setTimeout(p)},E=_=>{var F;s&&(clearTimeout(s),s=null);var{inputType:j}=_,$=null,V=_.dataTransfer||_.data||void 0;u!==!1&&j!=="insertText"&&j!=="insertCompositionText"&&(u=!1);var[K]=_.getTargetRanges();K&&($=te.toSlateRange(t,K,{exactMatch:!1,suppressThrow:!0}));var Q=te.getWindow(t),ae=Q.getSelection();if(!$&&ae&&(K=ae,$=te.toSlateRange(t,ae,{exactMatch:!1,suppressThrow:!0})),$=(F=$)!==null&&F!==void 0?F:t.selection,!!$){var D=!0;if(j.startsWith("delete")){if(Z.isExpanded($)){var[L,q]=Z.edges($),B=ue.leaf(t,L.path);if(B.text.length===L.offset&&q.offset===0){var T=C.next(t,{at:L.path,match:fe.isText});T&&P.equals(T[1],q.path)&&($={anchor:q,focus:q})}}var z=j.endsWith("Backward")?"backward":"forward",[M,H]=Z.edges($),[ne,ee]=C.leaf(t,M.path),re={text:"",start:M.offset,end:H.offset},le=dt.get(t),J=le==null?void 0:le.find(be=>P.equals(be.path,ee)),he=J?[J.diff,re]:[re],me=Df(ne.text,...he);if(me.length===0&&(D=!1),Z.isExpanded($)){if(D&&P.equals($.anchor.path,$.focus.path)){var ve={path:$.anchor.path,offset:M.offset},Ee=C.range(t,ve,ve);return S(Ee),b($.anchor.path,{text:"",end:H.offset,start:M.offset})}return v(()=>C.deleteFragment(t,{direction:z}),{at:$})}}switch(j){case"deleteByComposition":case"deleteByCut":case"deleteByDrag":return v(()=>C.deleteFragment(t),{at:$});case"deleteContent":case"deleteContentForward":{var{anchor:Ae}=$;if(D&&Z.isCollapsed($)){var ze=ue.leaf(t,Ae.path);if(Ae.offset<ze.text.length)return b(Ae.path,{text:"",start:Ae.offset,end:Ae.offset+1})}return v(()=>C.deleteForward(t),{at:$})}case"deleteContentBackward":{var Se,{anchor:Te}=$,Ne=Ss(K)?K.isCollapsed:!!((Se=K)!==null&&Se!==void 0&&Se.collapsed);return D&&Ne&&Z.isCollapsed($)&&Te.offset>0?b(Te.path,{text:"",start:Te.offset-1,end:Te.offset}):v(()=>C.deleteBackward(t),{at:$})}case"deleteEntireSoftLine":return v(()=>{C.deleteBackward(t,{unit:"line"}),C.deleteForward(t,{unit:"line"})},{at:$});case"deleteHardLineBackward":return v(()=>C.deleteBackward(t,{unit:"block"}),{at:$});case"deleteSoftLineBackward":return v(()=>C.deleteBackward(t,{unit:"line"}),{at:$});case"deleteHardLineForward":return v(()=>C.deleteForward(t,{unit:"block"}),{at:$});case"deleteSoftLineForward":return v(()=>C.deleteForward(t,{unit:"line"}),{at:$});case"deleteWordBackward":return v(()=>C.deleteBackward(t,{unit:"word"}),{at:$});case"deleteWordForward":return v(()=>C.deleteForward(t,{unit:"word"}),{at:$});case"insertLineBreak":return v(()=>C.insertSoftBreak(t),{at:$});case"insertParagraph":return v(()=>C.insertBreak(t),{at:$});case"insertCompositionText":case"deleteCompositionText":case"insertFromComposition":case"insertFromDrop":case"insertFromPaste":case"insertFromYank":case"insertReplacementText":case"insertText":{if(g1(V))return v(()=>te.insertData(t,V),{at:$});var ke=V??"";if(Tt.get(t)&&(ke=ke.replace("\uFEFF","")),j==="insertText"&&/.*\n.*\n$/.test(ke)&&(ke=ke.slice(0,-1)),ke.includes(`
135
- `))return v(()=>{var be=ke.split(`
136
- `);be.forEach((we,Ke)=>{we&&C.insertText(t,we),Ke!==be.length-1&&C.insertSoftBreak(t)})},{at:$});if(P.equals($.anchor.path,$.focus.path)){var[He,ge]=Z.edges($),U={start:He.offset,end:ge.offset,text:ke};if(ke&&u&&j==="insertCompositionText"){var ie=u.start+u.text.search(/\S|$/),pe=U.start+U.text.search(/\S|$/);pe===ie+1&&U.end===u.start+u.text.length?(U.start-=1,u=null,I()):u=!1}else j==="insertText"?u===null?u=U:u&&Z.isCollapsed($)&&u.end+u.text.length===He.offset?u=ua(ua({},u),{},{text:u.text+ke}):u=!1:u=!1;if(D){b(He.path,U);return}}return v(()=>C.insertText(t,ke),{at:$})}}}},k=()=>!!nn.get(t),x=()=>{var _;return!!((_=dt.get(t))!==null&&_!==void 0&&_.length)},w=()=>k()||x(),A=()=>a,S=_=>{rn.set(t,_),s&&(clearTimeout(s),s=null);var{selection:F}=t;if(_){var j=!F||!P.equals(F.anchor.path,_.anchor.path),$=!F||!P.equals(F.anchor.path.slice(0,-1),_.anchor.path.slice(0,-1));(j&&u||$)&&(u=!1),(j||x())&&(s=setTimeout(p,m1))}},W=()=>{(k()||!x())&&p()},R=_=>{x()||(f(!0),setTimeout(f))},I=()=>{k()||(o=setTimeout(p))},N=_=>{if(!(x()||k())&&_.some(j=>Eo(t,j,_))){var F;(F=gf.get(t))===null||F===void 0||F()}};return{flush:p,scheduleFlush:I,hasPendingDiffs:x,hasPendingAction:k,hasPendingChanges:w,isFlushing:A,handleUserSelect:S,handleCompositionEnd:m,handleCompositionStart:g,handleDOMBeforeInput:E,handleKeyDown:R,handleDomMutations:N,handleInput:W}}function b1(){var e=y.useRef(!1);return y.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),e.current}var Ir=Da?y.useLayoutEffect:y.useEffect;function y1(e,t,n){var[r]=y.useState(()=>new MutationObserver(t));Ir(()=>{r.takeRecords()}),y.useEffect(()=>{if(!e.current)throw new Error("Failed to attach MutationObserver, `node` is undefined");return r.observe(e.current,n),()=>r.disconnect()},[r,e,n])}var C1=["node"];function Al(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function D1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Al(Object(n),!0).forEach(function(r){_t(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Al(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var x1={subtree:!0,childList:!0,characterData:!0},w1=ut?e=>{var{node:t}=e,n=er(e,C1);if(!ut)return null;var r=fn(),a=b1(),[i]=y.useState(()=>v1(D1({editor:r},n)));return y1(t,i.handleDomMutations,x1),xo.set(r,i.scheduleFlush),a&&i.flush(),i}:()=>null,E1=["anchor","focus"],_1=["anchor","focus"],k1=(e,t)=>Object.keys(e).length===Object.keys(t).length&&Object.keys(e).every(n=>t.hasOwnProperty(n)&&e[n]===t[n]),wf=(e,t)=>{var n=er(e,E1),r=er(t,_1);return e[tr]===t[tr]&&k1(n,r)},B1=(e,t)=>{if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++){var r=e[n],a=t[n];if(!Z.equals(r,a)||!wf(r,a))return!1}return!0},F1=(e,t)=>{if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++){var r=e[n],a=t[n];if(r.anchor.offset!==a.anchor.offset||r.focus.offset!==a.focus.offset||!wf(r,a))return!1}return!0};function Tl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function A1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Tl(Object(n),!0).forEach(function(r){_t(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tl(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var T1=e=>{var{isLast:t,leaf:n,parent:r,text:a}=e,i=fn(),s=te.findPath(i,a),o=P.parent(s),l=!!n[vf];return i.isVoid(r)?y.createElement(Ri,{length:ue.string(r).length}):n.text===""&&r.children[r.children.length-1]===a&&!i.isInline(r)&&C.string(i,o)===""?y.createElement(Ri,{isLineBreak:!0,isMarkPlaceholder:l}):n.text===""?y.createElement(Ri,{isMarkPlaceholder:l}):t&&n.text.slice(-1)===`
137
- `?y.createElement(Sl,{isTrailing:!0,text:n.text}):y.createElement(Sl,{text:n.text})},Sl=e=>{var{text:t,isTrailing:n=!1}=e,r=y.useRef(null),a=()=>"".concat(t??"").concat(n?`
138
- `:""),[i]=y.useState(a);return Ir(()=>{var s=a();r.current&&r.current.textContent!==s&&(r.current.textContent=s)}),y.createElement(S1,{ref:r},i)},S1=y.memo(y.forwardRef((e,t)=>y.createElement("span",{"data-slate-string":!0,ref:t},e.children))),Ri=e=>{var{length:t=0,isLineBreak:n=!1,isMarkPlaceholder:r=!1}=e,a={"data-slate-zero-width":n?"n":"z","data-slate-length":t};return r&&(a["data-slate-mark-placeholder"]=!0),y.createElement("span",A1({},a),!ut||!n?"\uFEFF":null,n?y.createElement("br",null):null)};function jl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Ef(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jl(Object(n),!0).forEach(function(r){_t(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jl(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var j1=ut?300:0;function O1(e,t){e.current&&(e.current.disconnect(),t&&(e.current=null))}function Ol(e){e.current&&(clearTimeout(e.current),e.current=null)}var P1=e=>{var{leaf:t,isLast:n,text:r,parent:a,renderPlaceholder:i,renderLeaf:s=E=>y.createElement(M1,Ef({},E))}=e,o=fn(),l=y.useRef(null),u=y.useRef(null),[c,h]=y.useState(!1),p=y.useRef(null),m=y.useCallback(E=>{if(O1(l,E==null),E==null){var k;Fs.delete(o),(k=t.onPlaceholderResize)===null||k===void 0||k.call(t,null)}else{if(Fs.set(o,E),!l.current){var x=window.ResizeObserver||My;l.current=new x(()=>{var w;(w=t.onPlaceholderResize)===null||w===void 0||w.call(t,E)})}l.current.observe(E),u.current=E}},[u,t,o]),g=y.createElement(T1,{isLast:n,leaf:t,parent:a,text:r}),f=!!t[tr];if(y.useEffect(()=>(f?p.current||(p.current=setTimeout(()=>{h(!0),p.current=null},j1)):(Ol(p),h(!1)),()=>Ol(p)),[f,h]),f&&c){var b={children:t.placeholder,attributes:{"data-slate-placeholder":!0,style:{position:"absolute",top:0,pointerEvents:"none",width:"100%",maxWidth:"100%",display:"block",opacity:"0.333",userSelect:"none",textDecoration:"none",WebkitUserModify:Cr?"inherit":void 0},contentEditable:!1,ref:m}};g=y.createElement(y.Fragment,null,i(b),g)}var v={"data-slate-leaf":!0};return s({attributes:v,children:g,leaf:t,text:r})},N1=y.memo(P1,(e,t)=>t.parent===e.parent&&t.isLast===e.isLast&&t.renderLeaf===e.renderLeaf&&t.renderPlaceholder===e.renderPlaceholder&&t.text===e.text&&fe.equals(t.leaf,e.leaf)&&t.leaf[tr]===e.leaf[tr]),M1=e=>{var{attributes:t,children:n}=e;return y.createElement("span",Ef({},t),n)},R1=e=>{for(var{decorations:t,isLast:n,parent:r,renderPlaceholder:a,renderLeaf:i,text:s}=e,o=fn(),l=y.useRef(null),u=fe.decorations(s,t),c=te.findKey(o,s),h=[],p=0;p<u.length;p++){var m=u[p];h.push(y.createElement(N1,{isLast:n&&p===u.length-1,key:"".concat(c.id,"-").concat(p),renderPlaceholder:a,leaf:m,text:s,parent:r,renderLeaf:i}))}var g=y.useCallback(f=>{var b=ii.get(o);f?(b==null||b.set(c,f),wn.set(s,f),Rr.set(f,s)):(b==null||b.delete(c),wn.delete(s),l.current&&Rr.delete(l.current)),l.current=f},[l,o,c,s]);return y.createElement("span",{"data-slate-node":"text",ref:g},h)},_f=y.memo(R1,(e,t)=>t.parent===e.parent&&t.isLast===e.isLast&&t.renderLeaf===e.renderLeaf&&t.renderPlaceholder===e.renderPlaceholder&&t.text===e.text&&F1(t.decorations,e.decorations));function Pl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Ps(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Pl(Object(n),!0).forEach(function(r){_t(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pl(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var I1=e=>{var{decorations:t,element:n,renderElement:r=E=>y.createElement(L1,Ps({},E)),renderPlaceholder:a,renderLeaf:i,selection:s}=e,o=fn(),l=W1(),u=o.isInline(n),c=te.findKey(o,n),h=y.useCallback(E=>{var k=ii.get(o);E?(k==null||k.set(c,E),wn.set(n,E),Rr.set(E,n)):(k==null||k.delete(c),wn.delete(n))},[o,c,n]),p=Bf({decorations:t,node:n,renderElement:r,renderPlaceholder:a,renderLeaf:i,selection:s}),m={"data-slate-node":"element",ref:h};if(u&&(m["data-slate-inline"]=!0),!u&&C.hasInlines(o,n)){var g=ue.string(n),f=Qd(g);f==="rtl"&&(m.dir=f)}if(C.isVoid(o,n)){m["data-slate-void"]=!0,!l&&u&&(m.contentEditable=!1);var b=u?"span":"div",[[v]]=ue.texts(n);p=y.createElement(b,{"data-slate-spacer":!0,style:{height:"0",color:"transparent",outline:"none",position:"absolute"}},y.createElement(_f,{renderPlaceholder:a,decorations:[],isLast:!1,parent:n,text:v})),Co.set(v,0),Do.set(v,n)}return r({attributes:m,children:p,element:n})},$1=y.memo(I1,(e,t)=>e.element===t.element&&e.renderElement===t.renderElement&&e.renderLeaf===t.renderLeaf&&e.renderPlaceholder===t.renderPlaceholder&&B1(e.decorations,t.decorations)&&(e.selection===t.selection||!!e.selection&&!!t.selection&&Z.equals(e.selection,t.selection))),L1=e=>{var{attributes:t,children:n,element:r}=e,a=fn(),i=a.isInline(r)?"span":"div";return y.createElement(i,Ps(Ps({},t),{},{style:{position:"relative"}}),n)},kf=y.createContext(()=>[]),z1=()=>y.useContext(kf),q1=y.createContext(!1),Bf=e=>{for(var{decorations:t,node:n,renderElement:r,renderPlaceholder:a,renderLeaf:i,selection:s}=e,o=z1(),l=fn(),u=te.findPath(l,n),c=[],h=de.isElement(n)&&!l.isInline(n)&&C.hasInlines(l,n),p=0;p<n.children.length;p++){var m=u.concat(p),g=n.children[p],f=te.findKey(l,g),b=C.range(l,m),v=s&&Z.intersection(b,s),E=o([g,m]);for(var k of t){var x=Z.intersection(k,b);x&&E.push(x)}de.isElement(g)?c.push(y.createElement(q1.Provider,{key:"provider-".concat(f.id),value:!!v},y.createElement($1,{decorations:E,element:g,key:f.id,renderElement:r,renderPlaceholder:a,renderLeaf:i,selection:v}))):c.push(y.createElement(_f,{decorations:E,key:f.id,isLast:h&&p===n.children.length-1,parent:n,renderPlaceholder:a,renderLeaf:i,text:g})),Co.set(g,p),Do.set(g,n)}return c},Ff=y.createContext(!1),W1=()=>y.useContext(Ff),Af=y.createContext(null),On=()=>{var e=y.useContext(Af);if(!e)throw new Error("The `useSlate` hook must be used inside the <Slate> component's context.");var{editor:t}=e;return t};function U1(){var e=fn(),t=y.useRef(!1),n=y.useRef(0),r=y.useCallback(()=>{if(!t.current){t.current=!0;var a=te.getWindow(e);a.cancelAnimationFrame(n.current),n.current=a.requestAnimationFrame(()=>{t.current=!1})}},[e]);return y.useEffect(()=>()=>cancelAnimationFrame(n.current),[]),{receivedUserInput:t,onUserInput:r}}var H1=3,V1={bold:"mod+b",compose:["down","left","right","up","backspace","enter"],moveBackward:"left",moveForward:"right",moveWordBackward:"ctrl+left",moveWordForward:"ctrl+right",deleteBackward:"shift?+backspace",deleteForward:"shift?+delete",extendBackward:"shift+left",extendForward:"shift+right",italic:"mod+i",insertSoftBreak:"shift+enter",splitBlock:"enter",undo:"mod+z"},K1={moveLineBackward:"opt+up",moveLineForward:"opt+down",moveWordBackward:"opt+left",moveWordForward:"opt+right",deleteBackward:["ctrl+backspace","ctrl+h"],deleteForward:["ctrl+delete","ctrl+d"],deleteLineBackward:"cmd+shift?+backspace",deleteLineForward:["cmd+shift?+delete","ctrl+k"],deleteWordBackward:"opt+shift?+backspace",deleteWordForward:"opt+shift?+delete",extendLineBackward:"opt+shift+up",extendLineForward:"opt+shift+down",redo:"cmd+shift+z",transposeCharacter:"ctrl+t"},Z1={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},Ue=e=>{var t=V1[e],n=K1[e],r=Z1[e],a=t&&Mi(t),i=n&&Mi(n),s=r&&Mi(r);return o=>!!(a&&a(o)||_l&&i&&i(o)||!_l&&s&&s(o))},Ve={isBold:Ue("bold"),isCompose:Ue("compose"),isMoveBackward:Ue("moveBackward"),isMoveForward:Ue("moveForward"),isDeleteBackward:Ue("deleteBackward"),isDeleteForward:Ue("deleteForward"),isDeleteLineBackward:Ue("deleteLineBackward"),isDeleteLineForward:Ue("deleteLineForward"),isDeleteWordBackward:Ue("deleteWordBackward"),isDeleteWordForward:Ue("deleteWordForward"),isExtendBackward:Ue("extendBackward"),isExtendForward:Ue("extendForward"),isExtendLineBackward:Ue("extendLineBackward"),isExtendLineForward:Ue("extendLineForward"),isItalic:Ue("italic"),isMoveLineBackward:Ue("moveLineBackward"),isMoveLineForward:Ue("moveLineForward"),isMoveWordBackward:Ue("moveWordBackward"),isMoveWordForward:Ue("moveWordForward"),isRedo:Ue("redo"),isSoftBreak:Ue("insertSoftBreak"),isSplitBlock:Ue("splitBlock"),isTransposeCharacter:Ue("transposeCharacter"),isUndo:Ue("undo")},Y1=(e,t)=>{var n=[],r=()=>{n=[]},a=s=>{if(t.current){var o=s.filter(l=>Eo(e,l,s));n.push(...o)}};function i(){n.length>0&&(n.reverse().forEach(s=>{s.type!=="characterData"&&(s.removedNodes.forEach(o=>{s.target.insertBefore(o,s.nextSibling)}),s.addedNodes.forEach(o=>{s.target.removeChild(o)}))}),r())}return{registerMutations:a,restoreDOM:i,clear:r}},G1={subtree:!0,childList:!0,characterData:!0,characterDataOldValue:!0};class Tf extends y.Component{constructor(){super(...arguments),_t(this,"context",null),_t(this,"manager",null),_t(this,"mutationObserver",null)}observe(){var t,{node:n}=this.props;if(!n.current)throw new Error("Failed to attach MutationObserver, `node` is undefined");(t=this.mutationObserver)===null||t===void 0||t.observe(n.current,G1)}componentDidMount(){var{receivedUserInput:t}=this.props,n=this.context;this.manager=Y1(n,t),this.mutationObserver=new MutationObserver(this.manager.registerMutations),this.observe()}getSnapshotBeforeUpdate(){var t,n,r,a=(t=this.mutationObserver)===null||t===void 0?void 0:t.takeRecords();if(a!=null&&a.length){var i;(i=this.manager)===null||i===void 0||i.registerMutations(a)}return(n=this.mutationObserver)===null||n===void 0||n.disconnect(),(r=this.manager)===null||r===void 0||r.restoreDOM(),null}componentDidUpdate(){var t;(t=this.manager)===null||t===void 0||t.clear(),this.observe()}componentWillUnmount(){var t;(t=this.mutationObserver)===null||t===void 0||t.disconnect()}render(){return this.props.children}}_t(Tf,"contextType",yo);var Q1=ut?Tf:e=>{var{children:t}=e;return y.createElement(y.Fragment,null,t)},J1=["autoFocus","decorate","onDOMBeforeInput","placeholder","readOnly","renderElement","renderLeaf","renderPlaceholder","scrollSelectionIntoView","style","as","disableDefaultStyles"],X1=["text"];function Nl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Pt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Nl(Object(n),!0).forEach(function(r){_t(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Nl(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var eC=e=>y.createElement(y.Fragment,null,Bf(e)),tC=e=>{var t=y.useCallback(T=>y.createElement(nC,Pt({},T)),[]),{autoFocus:n,decorate:r=rC,onDOMBeforeInput:a,placeholder:i,readOnly:s=!1,renderElement:o,renderLeaf:l,renderPlaceholder:u=t,scrollSelectionIntoView:c=aC,style:h={},as:p="div",disableDefaultStyles:m=!1}=e,g=er(e,J1),f=On(),[b,v]=y.useState(!1),E=y.useRef(null),k=y.useRef([]),[x,w]=y.useState(),{onUserInput:A,receivedUserInput:S}=U1(),[,W]=y.useReducer(T=>T+1,0);gf.set(f,W),As.set(f,s);var R=y.useMemo(()=>({isDraggingInternally:!1,isUpdatingSelection:!1,latestElement:null,hasMarkPlaceholder:!1}),[]);y.useEffect(()=>{E.current&&n&&E.current.focus()},[n]);var I=y.useRef(),N=y.useMemo(()=>fy(()=>{var T=I.current;if((ut||!te.isComposing(f))&&(!R.isUpdatingSelection||T!=null&&T.isFlushing())&&!R.isDraggingInternally){var z=te.findDocumentOrShadowRoot(f),{activeElement:M}=z,H=te.toDOMNode(f,f),ne=z.getSelection();if(M===H?(R.latestElement=M,on.set(f,!0)):on.delete(f),!ne)return X.deselect(f);var{anchorNode:ee,focusNode:re}=ne,le=te.hasEditableTarget(f,ee)||te.isTargetInsideNonReadonlyVoid(f,ee),J=te.hasEditableTarget(f,re)||te.isTargetInsideNonReadonlyVoid(f,re);if(le&&J){var he=te.toSlateRange(f,ne,{exactMatch:!1,suppressThrow:!0});he&&(!te.isComposing(f)&&!(T!=null&&T.hasPendingChanges())&&!(T!=null&&T.isFlushing())?X.select(f,he):T==null||T.handleUserSelect(he))}s&&(!le||!J)&&X.deselect(f)}},100),[f,s,R]),_=y.useMemo(()=>sy(N,0),[N]);I.current=w1({node:E,onDOMSelectionChange:N,scheduleOnDOMSelectionChange:_}),Ir(()=>{var T,z,M;E.current&&(M=wo(E.current))?(pf.set(f,M),xa.set(f,E.current),wn.set(f,E.current),Rr.set(E.current,f)):wn.delete(f);var{selection:H}=f,ne=te.findDocumentOrShadowRoot(f),ee=ne.getSelection();if(!(!ee||!te.isFocused(f)||(T=I.current)!==null&&T!==void 0&&T.hasPendingAction())){var re=me=>{var ve=ee.type!=="None";if(!(!H&&!ve)){var Ee=ee.focusNode,Ae;if(Hn&&ee.rangeCount>1){var ze=ee.getRangeAt(0),Se=ee.getRangeAt(ee.rangeCount-1);ze.startContainer===Ee?Ae=Se.endContainer:Ae=ze.startContainer}else Ae=ee.anchorNode;var Te=xa.get(f),Ne=!1;if(Te.contains(Ae)&&Te.contains(Ee)&&(Ne=!0),ve&&Ne&&H&&!me){var ke=te.toSlateRange(f,ee,{exactMatch:!0,suppressThrow:!0});if(ke&&Z.equals(ke,H)){var He;if(!R.hasMarkPlaceholder||(He=Ae)!==null&&He!==void 0&&(He=He.parentElement)!==null&&He!==void 0&&He.hasAttribute("data-slate-mark-placeholder"))return}}if(H&&!te.hasRange(f,H)){f.selection=te.toSlateRange(f,ee,{exactMatch:!1,suppressThrow:!0});return}R.isUpdatingSelection=!0;var ge=H&&te.toDOMRange(f,H);return ge?(te.isComposing(f)&&!ut?ee.collapseToEnd():Z.isBackward(H)?ee.setBaseAndExtent(ge.endContainer,ge.endOffset,ge.startContainer,ge.startOffset):ee.setBaseAndExtent(ge.startContainer,ge.startOffset,ge.endContainer,ge.endOffset),c(f,ge)):ee.removeAllRanges(),ge}};ee.rangeCount<=1&&re();var le=((z=I.current)===null||z===void 0?void 0:z.isFlushing())==="action";if(!ut||!le){setTimeout(()=>{R.isUpdatingSelection=!1});return}var J=null,he=requestAnimationFrame(()=>{if(le){var me=ve=>{try{var Ee=te.toDOMNode(f,f);Ee.focus(),re(ve)}catch{}};me(),J=setTimeout(()=>{me(!0),R.isUpdatingSelection=!1})}});return()=>{cancelAnimationFrame(he),J&&clearTimeout(J)}}});var F=y.useCallback(T=>{if(A(),!s&&te.hasEditableTarget(f,T.target)&&!iC(T,a)){var z;if(I.current)return I.current.handleDOMBeforeInput(T);_.flush(),N.flush();var{selection:M}=f,{inputType:H}=T,ne=T.dataTransfer||T.data||void 0,ee=H==="insertCompositionText"||H==="deleteCompositionText";if(ee&&te.isComposing(f))return;var re=!1;if(H==="insertText"&&M&&Z.isCollapsed(M)&&T.data&&T.data.length===1&&/[a-z ]/i.test(T.data)&&M.anchor.offset!==0){var le,J;re=!0,f.marks&&(re=!1);var{anchor:he}=M,[me,ve]=te.toDOMPoint(f,he),Ee=(le=me.parentElement)===null||le===void 0?void 0:le.closest("a"),Ae=te.getWindow(f);if(re&&Ee&&te.hasDOMNode(f,Ee)){var ze,Se=Ae==null?void 0:Ae.document.createTreeWalker(Ee,NodeFilter.SHOW_TEXT).lastChild();Se===me&&((ze=Se.textContent)===null||ze===void 0?void 0:ze.length)===ve&&(re=!1)}if(re&&me.parentElement&&(Ae==null||(J=Ae.getComputedStyle(me.parentElement))===null||J===void 0?void 0:J.whiteSpace)==="pre"){var Te=C.above(f,{at:he.path,match:ie=>de.isElement(ie)&&C.isBlock(f,ie)});Te&&ue.string(Te[0]).includes(" ")&&(re=!1)}}if(!H.startsWith("delete")||H.startsWith("deleteBy")){var[Ne]=T.getTargetRanges();if(Ne){var ke=te.toSlateRange(f,Ne,{exactMatch:!1,suppressThrow:!1});if(!M||!Z.equals(M,ke)){re=!1;var He=!ee&&f.selection&&C.rangeRef(f,f.selection);X.select(f,ke),He&&Er.set(f,He)}}}if(ee)return;if(re||T.preventDefault(),M&&Z.isExpanded(M)&&H.startsWith("delete")){var ge=H.endsWith("Backward")?"backward":"forward";C.deleteFragment(f,{direction:ge});return}switch(H){case"deleteByComposition":case"deleteByCut":case"deleteByDrag":{C.deleteFragment(f);break}case"deleteContent":case"deleteContentForward":{C.deleteForward(f);break}case"deleteContentBackward":{C.deleteBackward(f);break}case"deleteEntireSoftLine":{C.deleteBackward(f,{unit:"line"}),C.deleteForward(f,{unit:"line"});break}case"deleteHardLineBackward":{C.deleteBackward(f,{unit:"block"});break}case"deleteSoftLineBackward":{C.deleteBackward(f,{unit:"line"});break}case"deleteHardLineForward":{C.deleteForward(f,{unit:"block"});break}case"deleteSoftLineForward":{C.deleteForward(f,{unit:"line"});break}case"deleteWordBackward":{C.deleteBackward(f,{unit:"word"});break}case"deleteWordForward":{C.deleteForward(f,{unit:"word"});break}case"insertLineBreak":C.insertSoftBreak(f);break;case"insertParagraph":{C.insertBreak(f);break}case"insertFromComposition":case"insertFromDrop":case"insertFromPaste":case"insertFromYank":case"insertReplacementText":case"insertText":{H==="insertFromComposition"&&te.isComposing(f)&&(v(!1),bn.set(f,!1)),(ne==null?void 0:ne.constructor.name)==="DataTransfer"?te.insertData(f,ne):typeof ne=="string"&&(re?k.current.push(()=>C.insertText(f,ne)):C.insertText(f,ne));break}}var U=(z=Er.get(f))===null||z===void 0?void 0:z.unref();Er.delete(f),U&&(!f.selection||!Z.equals(f.selection,U))&&X.select(f,U)}},[f,N,A,a,s,_]),j=y.useCallback(T=>{T==null?(N.cancel(),_.cancel(),xa.delete(f),wn.delete(f),E.current&&en&&E.current.removeEventListener("beforeinput",F)):en&&T.addEventListener("beforeinput",F),E.current=T},[N,_,f,F]);Ir(()=>{var T=te.getWindow(f);return T.document.addEventListener("selectionchange",_),()=>{T.document.removeEventListener("selectionchange",_)}},[_]);var $=r([f,[]]),V=i&&f.children.length===1&&Array.from(ue.texts(f)).length===1&&ue.string(f)===""&&!b,K=y.useCallback(T=>{if(T&&V){var z;w((z=T.getBoundingClientRect())===null||z===void 0?void 0:z.height)}else w(void 0)},[V]);if(V){var Q=C.start(f,[]);$.push({[tr]:!0,placeholder:i,onPlaceholderResize:K,anchor:Q,focus:Q})}var{marks:ae}=f;if(R.hasMarkPlaceholder=!1,f.selection&&Z.isCollapsed(f.selection)&&ae){var{anchor:D}=f.selection,L=ue.leaf(f,D.path),q=er(L,X1);if(!fe.equals(L,ae,{loose:!0})){R.hasMarkPlaceholder=!0;var B=Object.fromEntries(Object.keys(q).map(T=>[T,null]));$.push(Pt(Pt(Pt({[vf]:!0},B),ae),{},{anchor:D,focus:D}))}}return y.useEffect(()=>{setTimeout(()=>{var{selection:T}=f;if(T){var{anchor:z}=T,M=ue.leaf(f,z.path);if(ae&&!fe.equals(M,ae,{loose:!0})){Tt.set(f,ae);return}}Tt.delete(f)})}),y.createElement(Ff.Provider,{value:s},y.createElement(kf.Provider,{value:r},y.createElement(Q1,{node:E,receivedUserInput:S},y.createElement(p,Pt(Pt({role:s?void 0:"textbox","aria-multiline":s?void 0:!0},g),{},{spellCheck:en||!Da?g.spellCheck:!1,autoCorrect:en||!Da?g.autoCorrect:"false",autoCapitalize:en||!Da?g.autoCapitalize:"false","data-slate-editor":!0,"data-slate-node":"value",contentEditable:!s,zindex:-1,suppressContentEditableWarning:!0,ref:j,style:Pt(Pt({},m?{}:Pt({position:"relative",whiteSpace:"pre-wrap",wordWrap:"break-word"},x?{minHeight:x}:{})),h),onBeforeInput:y.useCallback(T=>{if(!en&&!s&&!st(T,g.onBeforeInput)&&te.hasSelectableTarget(f,T.target)&&(T.preventDefault(),!te.isComposing(f))){var z=T.data;C.insertText(f,z)}},[g.onBeforeInput,f,s]),onInput:y.useCallback(T=>{if(!st(T,g.onInput)){if(I.current){I.current.handleInput();return}for(var z of k.current)z();k.current=[]}},[g.onInput]),onBlur:y.useCallback(T=>{if(!(s||R.isUpdatingSelection||!te.hasSelectableTarget(f,T.target)||st(T,g.onBlur))){var z=te.findDocumentOrShadowRoot(f);if(R.latestElement!==z.activeElement){var{relatedTarget:M}=T,H=te.toDOMNode(f,f);if(M!==H&&!(Et(M)&&M.hasAttribute("data-slate-spacer"))){if(M!=null&&un(M)&&te.hasDOMNode(f,M)){var ne=te.toSlateNode(f,M);if(de.isElement(ne)&&!f.isVoid(ne))return}if(Cr){var ee=z.getSelection();ee==null||ee.removeAllRanges()}on.delete(f)}}}},[s,R.isUpdatingSelection,R.latestElement,f,g.onBlur]),onClick:y.useCallback(T=>{if(te.hasTarget(f,T.target)&&!st(T,g.onClick)&&un(T.target)){var z=te.toSlateNode(f,T.target),M=te.findPath(f,z);if(!C.hasPath(f,M)||ue.get(f,M)!==z)return;if(T.detail===H1&&M.length>=1){var H=M;if(!(de.isElement(z)&&C.isBlock(f,z))){var ne,ee=C.above(f,{match:Ee=>de.isElement(Ee)&&C.isBlock(f,Ee),at:M});H=(ne=ee==null?void 0:ee[1])!==null&&ne!==void 0?ne:M.slice(0,1)}var re=C.range(f,H);X.select(f,re);return}if(s)return;var le=C.start(f,M),J=C.end(f,M),he=C.void(f,{at:le}),me=C.void(f,{at:J});if(he&&me&&P.equals(he[1],me[1])){var ve=C.range(f,le);X.select(f,ve)}}},[f,g.onClick,s]),onCompositionEnd:y.useCallback(T=>{if(te.hasSelectableTarget(f,T.target)){var z;if(te.isComposing(f)&&Promise.resolve().then(()=>{v(!1),bn.set(f,!1)}),(z=I.current)===null||z===void 0||z.handleCompositionEnd(T),st(T,g.onCompositionEnd)||ut)return;if(!Cr&&!Zy&&!Uy&&!Gy&&!Yy&&T.data){var M=Tt.get(f);Tt.delete(f),M!==void 0&&(Kt.set(f,f.marks),f.marks=M),C.insertText(f,T.data);var H=Kt.get(f);Kt.delete(f),H!==void 0&&(f.marks=H)}}},[g.onCompositionEnd,f]),onCompositionUpdate:y.useCallback(T=>{te.hasSelectableTarget(f,T.target)&&!st(T,g.onCompositionUpdate)&&(te.isComposing(f)||(v(!0),bn.set(f,!0)))},[g.onCompositionUpdate,f]),onCompositionStart:y.useCallback(T=>{if(te.hasSelectableTarget(f,T.target)){var z;if((z=I.current)===null||z===void 0||z.handleCompositionStart(T),st(T,g.onCompositionStart)||ut)return;v(!0);var{selection:M}=f;if(M&&Z.isExpanded(M)){C.deleteFragment(f);return}}},[g.onCompositionStart,f]),onCopy:y.useCallback(T=>{te.hasSelectableTarget(f,T.target)&&!st(T,g.onCopy)&&!Ml(T)&&(T.preventDefault(),te.setFragmentData(f,T.clipboardData,"copy"))},[g.onCopy,f]),onCut:y.useCallback(T=>{if(!s&&te.hasSelectableTarget(f,T.target)&&!st(T,g.onCut)&&!Ml(T)){T.preventDefault(),te.setFragmentData(f,T.clipboardData,"cut");var{selection:z}=f;if(z)if(Z.isExpanded(z))C.deleteFragment(f);else{var M=ue.parent(f,z.anchor.path);C.isVoid(f,M)&&X.delete(f)}}},[s,f,g.onCut]),onDragOver:y.useCallback(T=>{if(te.hasTarget(f,T.target)&&!st(T,g.onDragOver)){var z=te.toSlateNode(f,T.target);de.isElement(z)&&C.isVoid(f,z)&&T.preventDefault()}},[g.onDragOver,f]),onDragStart:y.useCallback(T=>{if(!s&&te.hasTarget(f,T.target)&&!st(T,g.onDragStart)){var z=te.toSlateNode(f,T.target),M=te.findPath(f,z),H=de.isElement(z)&&C.isVoid(f,z)||C.void(f,{at:M,voids:!0});if(H){var ne=C.range(f,M);X.select(f,ne)}R.isDraggingInternally=!0,te.setFragmentData(f,T.dataTransfer,"drag")}},[s,f,g.onDragStart,R]),onDrop:y.useCallback(T=>{if(!s&&te.hasTarget(f,T.target)&&!st(T,g.onDrop)){T.preventDefault();var z=f.selection,M=te.findEventRange(f,T),H=T.dataTransfer;X.select(f,M),R.isDraggingInternally&&z&&!Z.equals(z,M)&&!C.void(f,{at:M,voids:!0})&&X.delete(f,{at:z}),te.insertData(f,H),te.isFocused(f)||te.focus(f)}R.isDraggingInternally=!1},[s,f,g.onDrop,R]),onDragEnd:y.useCallback(T=>{!s&&R.isDraggingInternally&&g.onDragEnd&&te.hasTarget(f,T.target)&&g.onDragEnd(T),R.isDraggingInternally=!1},[s,R,g,f]),onFocus:y.useCallback(T=>{if(!s&&!R.isUpdatingSelection&&te.hasEditableTarget(f,T.target)&&!st(T,g.onFocus)){var z=te.toDOMNode(f,f),M=te.findDocumentOrShadowRoot(f);if(R.latestElement=M.activeElement,Hn&&T.target!==z){z.focus();return}on.set(f,!0)}},[s,R,f,g.onFocus]),onKeyDown:y.useCallback(T=>{if(!s&&te.hasEditableTarget(f,T.target)){var z;(z=I.current)===null||z===void 0||z.handleKeyDown(T);var{nativeEvent:M}=T;if(te.isComposing(f)&&M.isComposing===!1&&(bn.set(f,!1),v(!1)),st(T,g.onKeyDown)||te.isComposing(f))return;var{selection:H}=f,ne=f.children[H!==null?H.focus.path[0]:0],ee=Qd(ue.string(ne))==="rtl";if(Ve.isRedo(M)){T.preventDefault();var re=f;typeof re.redo=="function"&&re.redo();return}if(Ve.isUndo(M)){T.preventDefault();var le=f;typeof le.undo=="function"&&le.undo();return}if(Ve.isMoveLineBackward(M)){T.preventDefault(),X.move(f,{unit:"line",reverse:!0});return}if(Ve.isMoveLineForward(M)){T.preventDefault(),X.move(f,{unit:"line"});return}if(Ve.isExtendLineBackward(M)){T.preventDefault(),X.move(f,{unit:"line",edge:"focus",reverse:!0});return}if(Ve.isExtendLineForward(M)){T.preventDefault(),X.move(f,{unit:"line",edge:"focus"});return}if(Ve.isMoveBackward(M)){T.preventDefault(),H&&Z.isCollapsed(H)?X.move(f,{reverse:!ee}):X.collapse(f,{edge:ee?"end":"start"});return}if(Ve.isMoveForward(M)){T.preventDefault(),H&&Z.isCollapsed(H)?X.move(f,{reverse:ee}):X.collapse(f,{edge:ee?"start":"end"});return}if(Ve.isMoveWordBackward(M)){T.preventDefault(),H&&Z.isExpanded(H)&&X.collapse(f,{edge:"focus"}),X.move(f,{unit:"word",reverse:!ee});return}if(Ve.isMoveWordForward(M)){T.preventDefault(),H&&Z.isExpanded(H)&&X.collapse(f,{edge:"focus"}),X.move(f,{unit:"word",reverse:ee});return}if(en){if((mf||Cr)&&H&&(Ve.isDeleteBackward(M)||Ve.isDeleteForward(M))&&Z.isCollapsed(H)){var J=ue.parent(f,H.anchor.path);if(de.isElement(J)&&C.isVoid(f,J)&&(C.isInline(f,J)||C.isBlock(f,J))){T.preventDefault(),C.deleteBackward(f,{unit:"block"});return}}}else{if(Ve.isBold(M)||Ve.isItalic(M)||Ve.isTransposeCharacter(M)){T.preventDefault();return}if(Ve.isSoftBreak(M)){T.preventDefault(),C.insertSoftBreak(f);return}if(Ve.isSplitBlock(M)){T.preventDefault(),C.insertBreak(f);return}if(Ve.isDeleteBackward(M)){T.preventDefault(),H&&Z.isExpanded(H)?C.deleteFragment(f,{direction:"backward"}):C.deleteBackward(f);return}if(Ve.isDeleteForward(M)){T.preventDefault(),H&&Z.isExpanded(H)?C.deleteFragment(f,{direction:"forward"}):C.deleteForward(f);return}if(Ve.isDeleteLineBackward(M)){T.preventDefault(),H&&Z.isExpanded(H)?C.deleteFragment(f,{direction:"backward"}):C.deleteBackward(f,{unit:"line"});return}if(Ve.isDeleteLineForward(M)){T.preventDefault(),H&&Z.isExpanded(H)?C.deleteFragment(f,{direction:"forward"}):C.deleteForward(f,{unit:"line"});return}if(Ve.isDeleteWordBackward(M)){T.preventDefault(),H&&Z.isExpanded(H)?C.deleteFragment(f,{direction:"backward"}):C.deleteBackward(f,{unit:"word"});return}if(Ve.isDeleteWordForward(M)){T.preventDefault(),H&&Z.isExpanded(H)?C.deleteFragment(f,{direction:"forward"}):C.deleteForward(f,{unit:"word"});return}}}},[s,f,g.onKeyDown]),onPaste:y.useCallback(T=>{!s&&te.hasEditableTarget(f,T.target)&&!st(T,g.onPaste)&&(!en||Xy(T.nativeEvent)||Cr)&&(T.preventDefault(),te.insertData(f,T.clipboardData))},[s,f,g.onPaste])}),y.createElement(eC,{decorations:$,node:f,renderElement:o,renderPlaceholder:u,renderLeaf:l,selection:f.selection})))))},nC=e=>{var{attributes:t,children:n}=e;return y.createElement("span",Pt({},t),n,ut&&y.createElement("br",null))},rC=()=>[],aC=(e,t)=>{if(t.getBoundingClientRect&&(!e.selection||e.selection&&Z.isCollapsed(e.selection))){var n=t.startContainer.parentElement;n.getBoundingClientRect=t.getBoundingClientRect.bind(t),py(n,{scrollMode:"if-needed"}),delete n.getBoundingClientRect}},st=(e,t)=>{if(!t)return!1;var n=t(e);return n??(e.isDefaultPrevented()||e.isPropagationStopped())},Ml=e=>un(e.target)&&(e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement),iC=(e,t)=>{if(!t)return!1;var n=t(e);return n??e.defaultPrevented},sC=y.createContext(!1),oC=y.createContext({});function uC(e){var t=y.useRef([]).current,n=y.useRef({editor:e}).current,r=y.useCallback(i=>{n.editor=i,t.forEach(s=>s(i))},[t,n]),a=y.useMemo(()=>({getSlate:()=>n.editor,addEventListener:i=>(t.push(i),()=>{t.splice(t.indexOf(i),1)})}),[t,n]);return{selectorContext:a,onChange:r}}var lC=["editor","children","onChange","onSelectionChange","onValueChange","initialValue"],cC=e=>{var{editor:t,children:n,onChange:r,onSelectionChange:a,onValueChange:i,initialValue:s}=e,o=er(e,lC),[l,u]=y.useState(()=>{if(!ue.isNodeList(s))throw new Error("[Slate] initialValue is invalid! Expected a list of elements but got: ".concat(Xe.stringify(s)));if(!C.isEditor(t))throw new Error("[Slate] editor is invalid! You passed: ".concat(Xe.stringify(t)));return t.children=s,Object.assign(t,o),{v:0,editor:t}}),{selectorContext:c,onChange:h}=uC(t),p=y.useCallback(f=>{var b;switch(r&&r(t.children),f==null||(b=f.operation)===null||b===void 0?void 0:b.type){case"set_selection":a==null||a(t.selection);break;default:i==null||i(t.children)}u(v=>({v:v.v+1,editor:t})),h(t)},[t,h,r,a,i]);y.useEffect(()=>(Ts.set(t,p),()=>{Ts.set(t,()=>{})}),[t,p]);var[m,g]=y.useState(te.isFocused(t));return y.useEffect(()=>{g(te.isFocused(t))},[t]),Ir(()=>{var f=()=>g(te.isFocused(t));return hf>=17?(document.addEventListener("focusin",f),document.addEventListener("focusout",f),()=>{document.removeEventListener("focusin",f),document.removeEventListener("focusout",f)}):(document.addEventListener("focus",f,!0),document.addEventListener("blur",f,!0),()=>{document.removeEventListener("focus",f,!0),document.removeEventListener("blur",f,!0)})},[]),y.createElement(oC.Provider,{value:c},y.createElement(Af.Provider,{value:l},y.createElement(yo.Provider,{value:l.editor},y.createElement(sC.Provider,{value:m},n))))},Rl=(e,t)=>{var n=(t.top+t.bottom)/2;return e.top<=n&&e.bottom>=n},Il=(e,t,n)=>{var r=te.toDOMRange(e,t).getBoundingClientRect(),a=te.toDOMRange(e,n).getBoundingClientRect();return Rl(r,a)&&Rl(a,r)},dC=(e,t)=>{var n=C.range(e,Z.end(t)),r=Array.from(C.positions(e,{at:t})),a=0,i=r.length,s=Math.floor(i/2);if(Il(e,C.range(e,r[a]),n))return C.range(e,r[a],n);if(r.length<2)return C.range(e,r[r.length-1],n);for(;s!==r.length&&s!==a;)Il(e,C.range(e,r[s]),n)?i=s:a=s,s=Math.floor((a+i)/2);return C.range(e,r[i],n)};function $l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Ll(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$l(Object(n),!0).forEach(function(r){_t(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$l(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var fC=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"x-slate-fragment",r=t,{apply:a,onChange:i,deleteBackward:s,addMark:o,removeMark:l}=r;return ii.set(r,new WeakMap),r.addMark=(u,c)=>{var h,p;(h=xo.get(r))===null||h===void 0||h(),!Tt.get(r)&&(p=dt.get(r))!==null&&p!==void 0&&p.length&&Tt.set(r,null),Kt.delete(r),o(u,c)},r.removeMark=u=>{var c;!Tt.get(r)&&(c=dt.get(r))!==null&&c!==void 0&&c.length&&Tt.set(r,null),Kt.delete(r),l(u)},r.deleteBackward=u=>{if(u!=="line")return s(u);if(r.selection&&Z.isCollapsed(r.selection)){var c=C.above(r,{match:g=>de.isElement(g)&&C.isBlock(r,g),at:r.selection});if(c){var[,h]=c,p=C.range(r,h,r.selection.anchor),m=dC(r,p);Z.isCollapsed(m)||X.delete(r,{at:m})}}},r.apply=u=>{var c=[],h=[],p=dt.get(r);if(p!=null&&p.length){var m=p.map(j=>f1(j,u)).filter(Boolean);dt.set(r,m)}var g=rn.get(r);g&&rn.set(r,Bl(r,g,u));var f=nn.get(r);if(f!=null&&f.at){var b=_e.isPoint(f==null?void 0:f.at)?Os(r,f.at,u):Bl(r,f.at,u);nn.set(r,b?Ll(Ll({},f),{},{at:b}):null)}switch(u.type){case"insert_text":case"remove_text":case"set_node":case"split_node":{c.push(...In(r,u.path));break}case"set_selection":{var v;(v=Er.get(r))===null||v===void 0||v.unref(),Er.delete(r);break}case"insert_node":case"remove_node":{c.push(...In(r,P.parent(u.path)));break}case"merge_node":{var E=P.previous(u.path);c.push(...In(r,E));break}case"move_node":{var k=P.common(P.parent(u.path),P.parent(u.newPath));c.push(...In(r,k));var x;P.isBefore(u.path,u.newPath)?(c.push(...In(r,P.parent(u.path))),x=u.newPath):(c.push(...In(r,P.parent(u.newPath))),x=u.path);var w=ue.get(t,P.parent(x)),A=te.findKey(r,w),S=C.pathRef(r,P.parent(x));h.push([S,A]);break}}a(u);for(var[W,R]of c){var[I]=C.node(r,W);Ia.set(I,R)}for(var[N,_]of h)if(N.current){var[F]=C.node(r,N.current);Ia.set(F,_)}},r.setFragmentData=u=>{var{selection:c}=r;if(c){var[h,p]=Z.edges(c),m=C.void(r,{at:h.path}),g=C.void(r,{at:p.path});if(!(Z.isCollapsed(c)&&!m)){var f=te.toDOMRange(r,c),b=f.cloneContents(),v=b.childNodes[0];if(b.childNodes.forEach(I=>{I.textContent&&I.textContent.trim()!==""&&(v=I)}),g){var[E]=g,k=f.cloneRange(),x=te.toDOMNode(r,E);k.setEndAfter(x),b=k.cloneContents()}if(m&&(v=b.querySelector("[data-slate-spacer]")),Array.from(b.querySelectorAll("[data-slate-zero-width]")).forEach(I=>{var N=I.getAttribute("data-slate-zero-width")==="n";I.textContent=N?`
139
- `:""}),bf(v)){var w=v.ownerDocument.createElement("span");w.style.whiteSpace="pre",w.appendChild(v),b.appendChild(w),v=w}var A=r.getFragment(),S=JSON.stringify(A),W=window.btoa(encodeURIComponent(S));v.setAttribute("data-slate-fragment",W),u.setData("application/".concat(n),W);var R=b.ownerDocument.createElement("div");return R.appendChild(b),R.setAttribute("hidden","true"),b.ownerDocument.body.appendChild(R),u.setData("text/html",R.innerHTML),u.setData("text/plain",Cf(R)),b.ownerDocument.body.removeChild(R),u}}},r.insertData=u=>{r.insertFragmentData(u)||r.insertTextData(u)},r.insertFragmentData=u=>{var c=u.getData("application/".concat(n))||a1(u);if(c){var h=decodeURIComponent(window.atob(c)),p=JSON.parse(h);return r.insertFragment(p),!0}return!1},r.insertTextData=u=>{var c=u.getData("text/plain");if(c){var h=c.split(/\r\n|\r|\n/),p=!1;for(var m of h)p&&X.splitNodes(r,{always:!0}),r.insertText(m),p=!0;return!0}return!1},r.onChange=u=>{var c=hf<18?Fc.unstable_batchedUpdates:h=>h();c(()=>{var h=Ts.get(r);h&&h(u),i(u)})},r},In=(e,t)=>{var n=[];for(var[r,a]of C.levels(e,{at:t})){var i=te.findKey(e,r);n.push([a,i])}return n};const hC={id:"",tabbableOption:"",setFocus:()=>{},openTooltip:null,showLinkEditor:!1,mentionPopover:{show:!1,selectedUser:0,possibleUsers:[],position:null,numberOfUsers:null},lastAnchor:null,isInOverlay:!1,dispatch:()=>{},onMention:()=>{},reportError:e=>{console.error(e)}},Xt=y.createContext(hC);var Y=(e=>(e.blockquote="block_quote",e.bold="bold",e.code="code",e.codeblock="code_block",e.heading="heading",e.hr="thematic_break",e.image="image",e.italic="italic",e.li="list_item",e.link="link",e.mention="mention",e.ol="ol_list",e.paragraph="paragraph",e.ul="ul_list",e.strikethrough="strikeThrough",e.span="span",e))(Y||{}),Rt=(e=>(e.delete="delete_mark",e.emphasis="emphasis_mark",e.code="inline_code_mark",e.strong="strong_mark",e))(Rt||{});const mC=({attributes:e,children:t,element:n})=>{const r=n;switch(r.type){case Y.blockquote:return d.jsx("blockquote",{className:"subtle",...e,children:t});case Y.link:return d.jsx("a",{...e,children:t});case Y.li:return d.jsx("li",{...e,children:t});case Y.mention:const a=r;return d.jsxs("a",{...e,className:"mention",children:["@",(a==null?void 0:a.name)||"",t]});case Y.ol:return d.jsx("ol",{...e,children:t});case Y.ul:return d.jsx("ul",{...e,children:t});case Y.span:return d.jsx("span",{...e,children:t});case Y.paragraph:return d.jsx("p",{...e,children:t});default:return d.jsx("span",{...e,children:t})}},pC=({attributes:e,children:t,leaf:n})=>{const r=n;return r[Y.bold]&&(t=d.jsx("strong",{children:t})),r[Y.italic]&&(t=d.jsx("em",{children:t})),r[Y.strikethrough]&&(t=d.jsx("s",{children:t})),d.jsx("span",{...e,children:t})},Ns="MENTION: ",Sf={anchor:{offset:0,path:[0,0]},focus:{offset:0,path:[0,0]}},zl={"mention-popover":35,default:-52},Ii=16,jf=(e,t,n)=>{const r=y.useRef(null),{showLinkEditor:a,mentionPopover:i}=y.useContext(Xt),s=t==="link-editor"?a:i.show,o=[s];return e&&t==="link-editor"&&o.push(e.selection),y.useEffect(()=>{var m,g;if(!(r!=null&&r.current)||!s)return;const l=r==null?void 0:r.current;if(!l)return;let u,c=0;if(t==="mention-popover"){const{position:f}=i,b=k=>{if(!C.hasPath(e,k.path))return!1;const x=ue.get(e,k.path);return C.isEditor(x)||de.isElement(x)?k.offset<=x.children.length:fe.isText(x)?k.offset<=x.text.length:!1};if(f&&(!b(f==null?void 0:f.anchor)||!b(f==null?void 0:f.focus)))return;u=te.toDOMRange(e,f||Sf).getBoundingClientRect();const E=(m=document.getElementById(n))==null?void 0:m.getBoundingClientRect();l.style.setProperty("--width",`${((E==null?void 0:E.width)||0)/Ii}rem`),c=(E==null?void 0:E.left)||0}else{const f=document.getSelection();f!=null&&f.toString().trim().length&&(u=f==null?void 0:f.getRangeAt(0).getBoundingClientRect())}u||(u=(g=document.getElementById(n))==null?void 0:g.getBoundingClientRect());const h=zl[t]||zl.default,p=((u==null?void 0:u.top)||0)+window.scrollY+h;c===0&&(c=Math.max(((u==null?void 0:u.left)||0)-(l.offsetWidth-((u==null?void 0:u.width)||0)),0)),l.style.top=`${p/Ii}rem`,l.style.left=`${c/Ii}rem`},o),r},gC=e=>{const[t,n]=y.useState(null);return y.useEffect(()=>{const{selection:r}=e;if(!r){n(null);return}const[a]=C.nodes(e,{at:r,match:i=>i.type===Y.link});if(a){const i=a[0],s=Kc(i.link),o=i.children[0],l=(o==null?void 0:o.text)||"";n({...s,text:l})}else n(null)},[e,e.selection]),t};var ot=(e=>(e.paragraph="paragraph",e.heading="heading",e.list="list",e.listItem="listItem",e.link="link",e.mention="mention",e.image="image",e.blockquote="blockquote",e.code="code",e.html="html",e.emphasis="emphasis",e.strong="strong",e.delete="delete",e.inlineCode="inlineCode",e.thematicBreak="thematicBreak",e.text="text",e))(ot||{});const Vn={[Y.paragraph]:Y.paragraph,[Y.blockquote]:Y.blockquote,[Y.codeblock]:Y.codeblock,[Y.link]:Y.link,[Y.ul]:Y.ul,[Y.ol]:Y.ol,[Y.li]:Y.li,[Y.mention]:Y.mention,[Y.heading]:{1:"heading_one",2:"heading_two",3:"heading_three",4:"heading_four",5:"heading_five",6:"heading_six"},[Rt.emphasis]:Y.italic,[Rt.strong]:Y.bold,[Rt.delete]:Y.strikethrough,[Rt.code]:Y.code,[Y.hr]:Y.hr,[Y.image]:Y.image};function ql(e){if(e)throw e}var wa=Object.prototype.hasOwnProperty,Of=Object.prototype.toString,Wl=Object.defineProperty,Ul=Object.getOwnPropertyDescriptor,Hl=function(t){return typeof Array.isArray=="function"?Array.isArray(t):Of.call(t)==="[object Array]"},Vl=function(t){if(!t||Of.call(t)!=="[object Object]")return!1;var n=wa.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&wa.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var a;for(a in t);return typeof a>"u"||wa.call(t,a)},Kl=function(t,n){Wl&&n.name==="__proto__"?Wl(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Zl=function(t,n){if(n==="__proto__")if(wa.call(t,n)){if(Ul)return Ul(t,n).value}else return;return t[n]},vC=function e(){var t,n,r,a,i,s,o=arguments[0],l=1,u=arguments.length,c=!1;for(typeof o=="boolean"&&(c=o,o=arguments[1]||{},l=2),(o==null||typeof o!="object"&&typeof o!="function")&&(o={});l<u;++l)if(t=arguments[l],t!=null)for(n in t)r=Zl(o,n),a=Zl(t,n),o!==a&&(c&&a&&(Vl(a)||(i=Hl(a)))?(i?(i=!1,s=r&&Hl(r)?r:[]):s=r&&Vl(r)?r:{},Kl(o,{name:n,newValue:e(c,s,a)})):typeof a<"u"&&Kl(o,{name:n,newValue:a}));return o};const $i=Tn(vC);function Ms(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function bC(){const e=[],t={run:n,use:r};return t;function n(...a){let i=-1;const s=a.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);o(null,...a);function o(l,...u){const c=e[++i];let h=-1;if(l){s(l);return}for(;++h<a.length;)(u[h]===null||u[h]===void 0)&&(u[h]=a[h]);a=u,c?yC(c,o)(...u):s(null,...u)}}function r(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),t}}function yC(e,t){let n;return r;function r(...s){const o=e.length>s.length;let l;o&&s.push(a);try{l=e.apply(this,s)}catch(u){const c=u;if(o&&n)throw c;return a(c)}o||(l&&l.then&&typeof l.then=="function"?l.then(i,a):l instanceof Error?a(l):i(l))}function a(s,...o){n||(n=!0,t(s,...o))}function i(s){a(null,s)}}function _r(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Yl(e.position):"start"in e||"end"in e?Yl(e):"line"in e||"column"in e?Rs(e):""}function Rs(e){return Gl(e&&e.line)+":"+Gl(e&&e.column)}function Yl(e){return Rs(e&&e.start)+"-"+Rs(e&&e.end)}function Gl(e){return e&&typeof e=="number"?e:1}class mt extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let a="",i={},s=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?a=t:!i.cause&&t&&(s=!0,a=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?i.ruleId=r:(i.source=r.slice(0,l),i.ruleId=r.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const o=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file,this.message=a,this.line=o?o.line:void 0,this.name=_r(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=s&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual,this.expected,this.note,this.url}}mt.prototype.file="";mt.prototype.name="";mt.prototype.reason="";mt.prototype.message="";mt.prototype.stack="";mt.prototype.column=void 0;mt.prototype.line=void 0;mt.prototype.ancestors=void 0;mt.prototype.cause=void 0;mt.prototype.fatal=void 0;mt.prototype.place=void 0;mt.prototype.ruleId=void 0;mt.prototype.source=void 0;const Nt={basename:CC,dirname:DC,extname:xC,join:wC,sep:"/"};function CC(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');qr(e);let n=0,r=-1,a=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(i){n=a+1;break}}else r<0&&(i=!0,r=a+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,o=t.length-1;for(;a--;)if(e.codePointAt(a)===47){if(i){n=a+1;break}}else s<0&&(i=!0,s=a+1),o>-1&&(e.codePointAt(a)===t.codePointAt(o--)?o<0&&(r=a):(o=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function DC(e){if(qr(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function xC(e){qr(e);let t=e.length,n=-1,r=0,a=-1,i=0,s;for(;t--;){const o=e.codePointAt(t);if(o===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),o===46?a<0?a=t:i!==1&&(i=1):a>-1&&(i=-1)}return a<0||n<0||i===0||i===1&&a===n-1&&a===r+1?"":e.slice(a,n)}function wC(...e){let t=-1,n;for(;++t<e.length;)qr(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":EC(n)}function EC(e){qr(e);const t=e.codePointAt(0)===47;let n=_C(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function _C(e,t){let n="",r=0,a=-1,i=0,s=-1,o,l;for(;++s<=e.length;){if(s<e.length)o=e.codePointAt(s);else{if(o===47)break;o=47}if(o===47){if(!(a===s-1||i===1))if(a!==s-1&&i===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),a=s,i=0;continue}}else if(n.length>0){n="",r=0,a=s,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(a+1,s):n=e.slice(a+1,s),r=s-a-1;a=s,i=0}else o===46&&i>-1?i++:i=-1}return n}function qr(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const kC={cwd:BC};function BC(){return"/"}function Is(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function FC(e){if(typeof e=="string")e=new URL(e);else if(!Is(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return AC(e)}function AC(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const a=new TypeError("File URL path must not include encoded / characters");throw a.code="ERR_INVALID_FILE_URL_PATH",a}}return decodeURIComponent(t)}const Li=["history","path","basename","stem","extname","dirname"];class TC{constructor(t){let n;t?Is(t)?n={path:t}:typeof t=="string"||SC(t)?n={value:t}:n=t:n={},this.cwd=kC.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Li.length;){const i=Li[r];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let a;for(a in n)Li.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?Nt.basename(this.path):void 0}set basename(t){qi(t,"basename"),zi(t,"basename"),this.path=Nt.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Nt.dirname(this.path):void 0}set dirname(t){Ql(this.basename,"dirname"),this.path=Nt.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Nt.extname(this.path):void 0}set extname(t){if(zi(t,"extname"),Ql(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Nt.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Is(t)&&(t=FC(t)),qi(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Nt.basename(this.path,this.extname):void 0}set stem(t){qi(t,"stem"),zi(t,"stem"),this.path=Nt.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const a=this.message(t,n,r);throw a.fatal=!0,a}info(t,n,r){const a=this.message(t,n,r);return a.fatal=void 0,a}message(t,n,r){const a=new mt(t,n,r);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function zi(e,t){if(e&&e.includes(Nt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Nt.sep+"`")}function qi(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Ql(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function SC(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const jC=function(e){const r=this.constructor.prototype,a=r[e],i=function(){return a.apply(i,arguments)};Object.setPrototypeOf(i,r);const s=Object.getOwnPropertyNames(a);for(const o of s){const l=Object.getOwnPropertyDescriptor(a,o);l&&Object.defineProperty(i,o,l)}return i},OC={}.hasOwnProperty;class _o extends jC{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=bC()}copy(){const t=new _o;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data($i(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Hi("data",this.frozen),this.namespace[t]=n,this):OC.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Hi("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const a=n.call(t,...r);typeof a=="function"&&this.transformers.use(a)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=la(t),r=this.parser||this.Parser;return Wi("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Wi("process",this.parser||this.Parser),Ui("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(i,s){const o=la(t),l=r.parse(o);r.run(l,o,function(c,h,p){if(c||!h||!p)return u(c);const m=h,g=r.stringify(m,p);MC(g)?p.value=g:p.result=g,u(c,p)});function u(c,h){c||!h?s(c):i?i(h):n(void 0,h)}}}processSync(t){let n=!1,r;return this.freeze(),Wi("processSync",this.parser||this.Parser),Ui("processSync",this.compiler||this.Compiler),this.process(t,a),Xl("processSync","process",n),r;function a(i,s){n=!0,ql(i),r=s}}run(t,n,r){Jl(t),this.freeze();const a=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?i(void 0,r):new Promise(i);function i(s,o){const l=la(n);a.run(t,l,u);function u(c,h,p){const m=h||t;c?o(c):s?s(m):r(void 0,m,p)}}}runSync(t,n){let r=!1,a;return this.run(t,n,i),Xl("runSync","run",r),a;function i(s,o){ql(s),a=o,r=!0}}stringify(t,n){this.freeze();const r=la(n),a=this.compiler||this.Compiler;return Ui("stringify",a),Jl(t),a(t,r)}use(t,...n){const r=this.attachers,a=this.namespace;if(Hi("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?o(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(u){if(typeof u=="function")l(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[c,...h]=u;l(c,h)}else s(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function s(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(u.plugins),u.settings&&(a.settings=$i(!0,a.settings,u.settings))}function o(u){let c=-1;if(u!=null)if(Array.isArray(u))for(;++c<u.length;){const h=u[c];i(h)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function l(u,c){let h=-1,p=-1;for(;++h<r.length;)if(r[h][0]===u){p=h;break}if(p===-1)r.push([u,...c]);else if(c.length>0){let[m,...g]=c;const f=r[p][1];Ms(f)&&Ms(m)&&(m=$i(!0,f,m)),r[p]=[u,m,...g]}}}}const PC=new _o().freeze();function Wi(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Ui(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Hi(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Jl(e){if(!Ms(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Xl(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function la(e){return NC(e)?e:new TC(e)}function NC(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function MC(e){return typeof e=="string"||RC(e)}function RC(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const IC={};function $C(e,t){const n=t||IC,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Pf(e,r,a)}function Pf(e,t,n){if(LC(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return ec(e.children,t,n)}return Array.isArray(e)?ec(e,t,n):""}function ec(e,t,n){const r=[];let a=-1;for(;++a<e.length;)r[a]=Pf(e[a],t,n);return r.join("")}function LC(e){return!!(e&&typeof e=="object")}const tc=document.createElement("i");function ko(e){const t="&"+e+";";tc.innerHTML=t;const n=tc.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Yt(e,t,n,r){const a=e.length;let i=0,s;if(t<0?t=-t>a?0:a+t:t=t>a?a:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);i<r.length;)s=r.slice(i,i+1e4),s.unshift(t,0),e.splice(...s),i+=1e4,t+=1e4}function wt(e,t){return e.length>0?(Yt(e,e.length,0,t),e):t}const nc={}.hasOwnProperty;function zC(e){const t={};let n=-1;for(;++n<e.length;)qC(t,e[n]);return t}function qC(e,t){let n;for(n in t){const a=(nc.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let s;if(i)for(s in i){nc.call(a,s)||(a[s]=[]);const o=i[s];WC(a[s],Array.isArray(o)?o:o?[o]:[])}}}function WC(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Yt(e,0,0,r)}function Nf(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Yn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Mt=hn(/[A-Za-z]/),St=hn(/[\dA-Za-z]/),UC=hn(/[#-'*+\--9=?A-Z^-~]/);function $s(e){return e!==null&&(e<32||e===127)}const Ls=hn(/\d/),HC=hn(/[\dA-Fa-f]/),VC=hn(/[!-/:-@[-`{-~]/);function Ce(e){return e!==null&&e<-2}function ht(e){return e!==null&&(e<0||e===32)}function Pe(e){return e===-2||e===-1||e===32}const KC=hn(/\p{P}|\p{S}/u),ZC=hn(/\s/);function hn(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function qe(e,t,n,r){const a=r?r-1:Number.POSITIVE_INFINITY;let i=0;return s;function s(l){return Pe(l)?(e.enter(n),o(l)):t(l)}function o(l){return Pe(l)&&i++<a?(e.consume(l),o):(e.exit(n),t(l))}}const YC={tokenize:GC};function GC(e){const t=e.attempt(this.parser.constructs.contentInitial,r,a);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),qe(e,t,"linePrefix")}function a(o){return e.enter("paragraph"),i(o)}function i(o){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,s(o)}function s(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return Ce(o)?(e.consume(o),e.exit("chunkText"),i):(e.consume(o),s)}}const QC={tokenize:JC},rc={tokenize:XC};function JC(e){const t=this,n=[];let r=0,a,i,s;return o;function o(k){if(r<n.length){const x=n[r];return t.containerState=x[1],e.attempt(x[0].continuation,l,u)(k)}return u(k)}function l(k){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&E();const x=t.events.length;let w=x,A;for(;w--;)if(t.events[w][0]==="exit"&&t.events[w][1].type==="chunkFlow"){A=t.events[w][1].end;break}v(r);let S=x;for(;S<t.events.length;)t.events[S][1].end=Object.assign({},A),S++;return Yt(t.events,w+1,0,t.events.slice(x)),t.events.length=S,u(k)}return o(k)}function u(k){if(r===n.length){if(!a)return p(k);if(a.currentConstruct&&a.currentConstruct.concrete)return g(k);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(rc,c,h)(k)}function c(k){return a&&E(),v(r),p(k)}function h(k){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,g(k)}function p(k){return t.containerState={},e.attempt(rc,m,g)(k)}function m(k){return r++,n.push([t.currentConstruct,t.containerState]),p(k)}function g(k){if(k===null){a&&E(),v(0),e.consume(k);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{contentType:"flow",previous:i,_tokenizer:a}),f(k)}function f(k){if(k===null){b(e.exit("chunkFlow"),!0),v(0),e.consume(k);return}return Ce(k)?(e.consume(k),b(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(k),f)}function b(k,x){const w=t.sliceStream(k);if(x&&w.push(null),k.previous=i,i&&(i.next=k),i=k,a.defineSkip(k.start),a.write(w),t.parser.lazy[k.start.line]){let A=a.events.length;for(;A--;)if(a.events[A][1].start.offset<s&&(!a.events[A][1].end||a.events[A][1].end.offset>s))return;const S=t.events.length;let W=S,R,I;for(;W--;)if(t.events[W][0]==="exit"&&t.events[W][1].type==="chunkFlow"){if(R){I=t.events[W][1].end;break}R=!0}for(v(r),A=S;A<t.events.length;)t.events[A][1].end=Object.assign({},I),A++;Yt(t.events,W+1,0,t.events.slice(S)),t.events.length=A}}function v(k){let x=n.length;for(;x-- >k;){const w=n[x];t.containerState=w[1],w[0].exit.call(t,e)}n.length=k}function E(){a.write([null]),i=void 0,a=void 0,t.containerState._closeFlow=void 0}}function XC(e,t,n){return qe(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ac(e){if(e===null||ht(e)||ZC(e))return 1;if(KC(e))return 2}function Bo(e,t,n){const r=[];let a=-1;for(;++a<e.length;){const i=e[a].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const zs={name:"attention",tokenize:tD,resolveAll:eD};function eD(e,t){let n=-1,r,a,i,s,o,l,u,c;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const h=Object.assign({},e[r][1].end),p=Object.assign({},e[n][1].start);ic(h,-l),ic(p,l),s={type:l>1?"strongSequence":"emphasisSequence",start:h,end:Object.assign({},e[r][1].end)},o={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:p},i={type:l>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},a={type:l>1?"strong":"emphasis",start:Object.assign({},s.start),end:Object.assign({},o.end)},e[r][1].end=Object.assign({},s.start),e[n][1].start=Object.assign({},o.end),u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=wt(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=wt(u,[["enter",a,t],["enter",s,t],["exit",s,t],["enter",i,t]]),u=wt(u,Bo(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=wt(u,[["exit",i,t],["enter",o,t],["exit",o,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,u=wt(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,Yt(e,r-1,n-r+3,u),n=r+u.length-c-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function tD(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,a=ac(r);let i;return s;function s(l){return i=l,e.enter("attentionSequence"),o(l)}function o(l){if(l===i)return e.consume(l),o;const u=e.exit("attentionSequence"),c=ac(l),h=!c||c===2&&a||n.includes(l),p=!a||a===2&&c||n.includes(r);return u._open=!!(i===42?h:h&&(a||!p)),u._close=!!(i===42?p:p&&(c||!h)),t(l)}}function ic(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const nD={name:"autolink",tokenize:rD};function rD(e,t,n){let r=0;return a;function a(m){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(m){return Mt(m)?(e.consume(m),s):m===64?n(m):u(m)}function s(m){return m===43||m===45||m===46||St(m)?(r=1,o(m)):u(m)}function o(m){return m===58?(e.consume(m),r=0,l):(m===43||m===45||m===46||St(m))&&r++<32?(e.consume(m),o):(r=0,u(m))}function l(m){return m===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):m===null||m===32||m===60||$s(m)?n(m):(e.consume(m),l)}function u(m){return m===64?(e.consume(m),c):UC(m)?(e.consume(m),u):n(m)}function c(m){return St(m)?h(m):n(m)}function h(m){return m===46?(e.consume(m),r=0,c):m===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):p(m)}function p(m){if((m===45||St(m))&&r++<63){const g=m===45?p:h;return e.consume(m),g}return n(m)}}const si={tokenize:aD,partial:!0};function aD(e,t,n){return r;function r(i){return Pe(i)?qe(e,a,"linePrefix")(i):a(i)}function a(i){return i===null||Ce(i)?t(i):n(i)}}const Mf={name:"blockQuote",tokenize:iD,continuation:{tokenize:sD},exit:oD};function iD(e,t,n){const r=this;return a;function a(s){if(s===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),i}return n(s)}function i(s){return Pe(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function sD(e,t,n){const r=this;return a;function a(s){return Pe(s)?qe(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):i(s)}function i(s){return e.attempt(Mf,t,n)(s)}}function oD(e){e.exit("blockQuote")}const Rf={name:"characterEscape",tokenize:uD};function uD(e,t,n){return r;function r(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),a}function a(i){return VC(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const If={name:"characterReference",tokenize:lD};function lD(e,t,n){const r=this;let a=0,i,s;return o;function o(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),l}function l(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),i=31,s=St,c(h))}function u(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,s=HC,c):(e.enter("characterReferenceValue"),i=7,s=Ls,c(h))}function c(h){if(h===59&&a){const p=e.exit("characterReferenceValue");return s===St&&!ko(r.sliceSerialize(p))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(h)&&a++<i?(e.consume(h),c):n(h)}}const sc={tokenize:dD,partial:!0},oc={name:"codeFenced",tokenize:cD,concrete:!0};function cD(e,t,n){const r=this,a={tokenize:w,partial:!0};let i=0,s=0,o;return l;function l(A){return u(A)}function u(A){const S=r.events[r.events.length-1];return i=S&&S[1].type==="linePrefix"?S[2].sliceSerialize(S[1],!0).length:0,o=A,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(A)}function c(A){return A===o?(s++,e.consume(A),c):s<3?n(A):(e.exit("codeFencedFenceSequence"),Pe(A)?qe(e,h,"whitespace")(A):h(A))}function h(A){return A===null||Ce(A)?(e.exit("codeFencedFence"),r.interrupt?t(A):e.check(sc,f,x)(A)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(A))}function p(A){return A===null||Ce(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(A)):Pe(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),qe(e,m,"whitespace")(A)):A===96&&A===o?n(A):(e.consume(A),p)}function m(A){return A===null||Ce(A)?h(A):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(A))}function g(A){return A===null||Ce(A)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(A)):A===96&&A===o?n(A):(e.consume(A),g)}function f(A){return e.attempt(a,x,b)(A)}function b(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),v}function v(A){return i>0&&Pe(A)?qe(e,E,"linePrefix",i+1)(A):E(A)}function E(A){return A===null||Ce(A)?e.check(sc,f,x)(A):(e.enter("codeFlowValue"),k(A))}function k(A){return A===null||Ce(A)?(e.exit("codeFlowValue"),E(A)):(e.consume(A),k)}function x(A){return e.exit("codeFenced"),t(A)}function w(A,S,W){let R=0;return I;function I($){return A.enter("lineEnding"),A.consume($),A.exit("lineEnding"),N}function N($){return A.enter("codeFencedFence"),Pe($)?qe(A,_,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):_($)}function _($){return $===o?(A.enter("codeFencedFenceSequence"),F($)):W($)}function F($){return $===o?(R++,A.consume($),F):R>=s?(A.exit("codeFencedFenceSequence"),Pe($)?qe(A,j,"whitespace")($):j($)):W($)}function j($){return $===null||Ce($)?(A.exit("codeFencedFence"),S($)):W($)}}}function dD(e,t,n){const r=this;return a;function a(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i)}function i(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const Vi={name:"codeIndented",tokenize:hD},fD={tokenize:mD,partial:!0};function hD(e,t,n){const r=this;return a;function a(u){return e.enter("codeIndented"),qe(e,i,"linePrefix",4+1)(u)}function i(u){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?s(u):n(u)}function s(u){return u===null?l(u):Ce(u)?e.attempt(fD,s,l)(u):(e.enter("codeFlowValue"),o(u))}function o(u){return u===null||Ce(u)?(e.exit("codeFlowValue"),s(u)):(e.consume(u),o)}function l(u){return e.exit("codeIndented"),t(u)}}function mD(e,t,n){const r=this;return a;function a(s){return r.parser.lazy[r.now().line]?n(s):Ce(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a):qe(e,i,"linePrefix",4+1)(s)}function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(s):Ce(s)?a(s):n(s)}}const pD={name:"codeText",tokenize:bD,resolve:gD,previous:vD};function gD(e){let t=e.length-4,n=3,r,a;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)a===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(a=r):(r===t||e[r][1].type==="lineEnding")&&(e[a][1].type="codeTextData",r!==a+2&&(e[a][1].end=e[r-1][1].end,e.splice(a+2,r-a-2),t-=r-a-2,r=a+2),a=void 0);return e}function vD(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function bD(e,t,n){let r=0,a,i;return s;function s(h){return e.enter("codeText"),e.enter("codeTextSequence"),o(h)}function o(h){return h===96?(e.consume(h),r++,o):(e.exit("codeTextSequence"),l(h))}function l(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),l):h===96?(i=e.enter("codeTextSequence"),a=0,c(h)):Ce(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),l):(e.enter("codeTextData"),u(h))}function u(h){return h===null||h===32||h===96||Ce(h)?(e.exit("codeTextData"),l(h)):(e.consume(h),u)}function c(h){return h===96?(e.consume(h),a++,c):a===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(i.type="codeTextData",u(h))}}class yD{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const a=n||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return r&&vr(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),vr(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),vr(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);vr(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);vr(this.left,n.reverse())}}}function vr(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function $f(e){const t={};let n=-1,r,a,i,s,o,l,u;const c=new yD(e);for(;++n<c.length;){for(;n in t;)n=t[n];if(r=c.get(n),n&&r[1].type==="chunkFlow"&&c.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,i=0,i<l.length&&l[i][1].type==="lineEndingBlank"&&(i+=2),i<l.length&&l[i][1].type==="content"))for(;++i<l.length&&l[i][1].type!=="content";)l[i][1].type==="chunkText"&&(l[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,CD(c,n)),n=t[n],u=!0);else if(r[1]._container){for(i=n,a=void 0;i--&&(s=c.get(i),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank");)s[0]==="enter"&&(a&&(c.get(a)[1].type="lineEndingBlank"),s[1].type="lineEnding",a=i);a&&(r[1].end=Object.assign({},c.get(a)[1].start),o=c.slice(a,n),o.unshift(r),c.splice(a,n-a+1,o))}}return Yt(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!u}function CD(e,t){const n=e.get(t)[1],r=e.get(t)[2];let a=t-1;const i=[],s=n._tokenizer||r.parser[n.contentType](n.start),o=s.events,l=[],u={};let c,h,p=-1,m=n,g=0,f=0;const b=[f];for(;m;){for(;e.get(++a)[1]!==m;);i.push(a),m._tokenizer||(c=r.sliceStream(m),m.next||c.push(null),h&&s.defineSkip(m.start),m._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(c),m._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),h=m,m=m.next}for(m=n;++p<o.length;)o[p][0]==="exit"&&o[p-1][0]==="enter"&&o[p][1].type===o[p-1][1].type&&o[p][1].start.line!==o[p][1].end.line&&(f=p+1,b.push(f),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(s.events=[],m?(m._tokenizer=void 0,m.previous=void 0):b.pop(),p=b.length;p--;){const v=o.slice(b[p],b[p+1]),E=i.pop();l.push([E,E+v.length-1]),e.splice(E,2,v)}for(l.reverse(),p=-1;++p<l.length;)u[g+l[p][0]]=g+l[p][1],g+=l[p][1]-l[p][0]-1;return u}const DD={tokenize:ED,resolve:wD},xD={tokenize:_D,partial:!0};function wD(e){return $f(e),e}function ED(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),a(o)}function a(o){return o===null?i(o):Ce(o)?e.check(xD,s,i)(o):(e.consume(o),a)}function i(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function s(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,a}}function _D(e,t,n){const r=this;return a;function a(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),qe(e,i,"linePrefix")}function i(s){if(s===null||Ce(s))return n(s);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function Lf(e,t,n,r,a,i,s,o,l){const u=l||Number.POSITIVE_INFINITY;let c=0;return h;function h(v){return v===60?(e.enter(r),e.enter(a),e.enter(i),e.consume(v),e.exit(i),p):v===null||v===32||v===41||$s(v)?n(v):(e.enter(r),e.enter(s),e.enter(o),e.enter("chunkString",{contentType:"string"}),f(v))}function p(v){return v===62?(e.enter(i),e.consume(v),e.exit(i),e.exit(a),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),m(v))}function m(v){return v===62?(e.exit("chunkString"),e.exit(o),p(v)):v===null||v===60||Ce(v)?n(v):(e.consume(v),v===92?g:m)}function g(v){return v===60||v===62||v===92?(e.consume(v),m):m(v)}function f(v){return!c&&(v===null||v===41||ht(v))?(e.exit("chunkString"),e.exit(o),e.exit(s),e.exit(r),t(v)):c<u&&v===40?(e.consume(v),c++,f):v===41?(e.consume(v),c--,f):v===null||v===32||v===40||$s(v)?n(v):(e.consume(v),v===92?b:f)}function b(v){return v===40||v===41||v===92?(e.consume(v),f):f(v)}}function zf(e,t,n,r,a,i){const s=this;let o=0,l;return u;function u(m){return e.enter(r),e.enter(a),e.consume(m),e.exit(a),e.enter(i),c}function c(m){return o>999||m===null||m===91||m===93&&!l||m===94&&!o&&"_hiddenFootnoteSupport"in s.parser.constructs?n(m):m===93?(e.exit(i),e.enter(a),e.consume(m),e.exit(a),e.exit(r),t):Ce(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),h(m))}function h(m){return m===null||m===91||m===93||Ce(m)||o++>999?(e.exit("chunkString"),c(m)):(e.consume(m),l||(l=!Pe(m)),m===92?p:h)}function p(m){return m===91||m===92||m===93?(e.consume(m),o++,h):h(m)}}function qf(e,t,n,r,a,i){let s;return o;function o(p){return p===34||p===39||p===40?(e.enter(r),e.enter(a),e.consume(p),e.exit(a),s=p===40?41:p,l):n(p)}function l(p){return p===s?(e.enter(a),e.consume(p),e.exit(a),e.exit(r),t):(e.enter(i),u(p))}function u(p){return p===s?(e.exit(i),l(s)):p===null?n(p):Ce(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),qe(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(p))}function c(p){return p===s||p===null||Ce(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?h:c)}function h(p){return p===s||p===92?(e.consume(p),c):c(p)}}function kr(e,t){let n;return r;function r(a){return Ce(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,r):Pe(a)?qe(e,r,n?"linePrefix":"lineSuffix")(a):t(a)}}const kD={name:"definition",tokenize:FD},BD={tokenize:AD,partial:!0};function FD(e,t,n){const r=this;let a;return i;function i(m){return e.enter("definition"),s(m)}function s(m){return zf.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function o(m){return a=Yn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),l):n(m)}function l(m){return ht(m)?kr(e,u)(m):u(m)}function u(m){return Lf(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function c(m){return e.attempt(BD,h,h)(m)}function h(m){return Pe(m)?qe(e,p,"whitespace")(m):p(m)}function p(m){return m===null||Ce(m)?(e.exit("definition"),r.parser.defined.push(a),t(m)):n(m)}}function AD(e,t,n){return r;function r(o){return ht(o)?kr(e,a)(o):n(o)}function a(o){return qf(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function i(o){return Pe(o)?qe(e,s,"whitespace")(o):s(o)}function s(o){return o===null||Ce(o)?t(o):n(o)}}const TD={name:"hardBreakEscape",tokenize:SD};function SD(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),a}function a(i){return Ce(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const jD={name:"headingAtx",tokenize:PD,resolve:OD};function OD(e,t){let n=e.length-2,r=3,a,i;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(a={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Yt(e,r,n-r+1,[["enter",a,t],["enter",i,t],["exit",i,t],["exit",a,t]])),e}function PD(e,t,n){let r=0;return a;function a(c){return e.enter("atxHeading"),i(c)}function i(c){return e.enter("atxHeadingSequence"),s(c)}function s(c){return c===35&&r++<6?(e.consume(c),s):c===null||ht(c)?(e.exit("atxHeadingSequence"),o(c)):n(c)}function o(c){return c===35?(e.enter("atxHeadingSequence"),l(c)):c===null||Ce(c)?(e.exit("atxHeading"),t(c)):Pe(c)?qe(e,o,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function l(c){return c===35?(e.consume(c),l):(e.exit("atxHeadingSequence"),o(c))}function u(c){return c===null||c===35||ht(c)?(e.exit("atxHeadingText"),o(c)):(e.consume(c),u)}}const ND=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],uc=["pre","script","style","textarea"],MD={name:"htmlFlow",tokenize:LD,resolveTo:$D,concrete:!0},RD={tokenize:qD,partial:!0},ID={tokenize:zD,partial:!0};function $D(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function LD(e,t,n){const r=this;let a,i,s,o,l;return u;function u(B){return c(B)}function c(B){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(B),h}function h(B){return B===33?(e.consume(B),p):B===47?(e.consume(B),i=!0,f):B===63?(e.consume(B),a=3,r.interrupt?t:D):Mt(B)?(e.consume(B),s=String.fromCharCode(B),b):n(B)}function p(B){return B===45?(e.consume(B),a=2,m):B===91?(e.consume(B),a=5,o=0,g):Mt(B)?(e.consume(B),a=4,r.interrupt?t:D):n(B)}function m(B){return B===45?(e.consume(B),r.interrupt?t:D):n(B)}function g(B){const T="CDATA[";return B===T.charCodeAt(o++)?(e.consume(B),o===T.length?r.interrupt?t:_:g):n(B)}function f(B){return Mt(B)?(e.consume(B),s=String.fromCharCode(B),b):n(B)}function b(B){if(B===null||B===47||B===62||ht(B)){const T=B===47,z=s.toLowerCase();return!T&&!i&&uc.includes(z)?(a=1,r.interrupt?t(B):_(B)):ND.includes(s.toLowerCase())?(a=6,T?(e.consume(B),v):r.interrupt?t(B):_(B)):(a=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(B):i?E(B):k(B))}return B===45||St(B)?(e.consume(B),s+=String.fromCharCode(B),b):n(B)}function v(B){return B===62?(e.consume(B),r.interrupt?t:_):n(B)}function E(B){return Pe(B)?(e.consume(B),E):I(B)}function k(B){return B===47?(e.consume(B),I):B===58||B===95||Mt(B)?(e.consume(B),x):Pe(B)?(e.consume(B),k):I(B)}function x(B){return B===45||B===46||B===58||B===95||St(B)?(e.consume(B),x):w(B)}function w(B){return B===61?(e.consume(B),A):Pe(B)?(e.consume(B),w):k(B)}function A(B){return B===null||B===60||B===61||B===62||B===96?n(B):B===34||B===39?(e.consume(B),l=B,S):Pe(B)?(e.consume(B),A):W(B)}function S(B){return B===l?(e.consume(B),l=null,R):B===null||Ce(B)?n(B):(e.consume(B),S)}function W(B){return B===null||B===34||B===39||B===47||B===60||B===61||B===62||B===96||ht(B)?w(B):(e.consume(B),W)}function R(B){return B===47||B===62||Pe(B)?k(B):n(B)}function I(B){return B===62?(e.consume(B),N):n(B)}function N(B){return B===null||Ce(B)?_(B):Pe(B)?(e.consume(B),N):n(B)}function _(B){return B===45&&a===2?(e.consume(B),V):B===60&&a===1?(e.consume(B),K):B===62&&a===4?(e.consume(B),L):B===63&&a===3?(e.consume(B),D):B===93&&a===5?(e.consume(B),ae):Ce(B)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(RD,q,F)(B)):B===null||Ce(B)?(e.exit("htmlFlowData"),F(B)):(e.consume(B),_)}function F(B){return e.check(ID,j,q)(B)}function j(B){return e.enter("lineEnding"),e.consume(B),e.exit("lineEnding"),$}function $(B){return B===null||Ce(B)?F(B):(e.enter("htmlFlowData"),_(B))}function V(B){return B===45?(e.consume(B),D):_(B)}function K(B){return B===47?(e.consume(B),s="",Q):_(B)}function Q(B){if(B===62){const T=s.toLowerCase();return uc.includes(T)?(e.consume(B),L):_(B)}return Mt(B)&&s.length<8?(e.consume(B),s+=String.fromCharCode(B),Q):_(B)}function ae(B){return B===93?(e.consume(B),D):_(B)}function D(B){return B===62?(e.consume(B),L):B===45&&a===2?(e.consume(B),D):_(B)}function L(B){return B===null||Ce(B)?(e.exit("htmlFlowData"),q(B)):(e.consume(B),L)}function q(B){return e.exit("htmlFlow"),t(B)}}function zD(e,t,n){const r=this;return a;function a(s){return Ce(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):n(s)}function i(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function qD(e,t,n){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(si,t,n)}}const WD={name:"htmlText",tokenize:UD};function UD(e,t,n){const r=this;let a,i,s;return o;function o(D){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(D),l}function l(D){return D===33?(e.consume(D),u):D===47?(e.consume(D),w):D===63?(e.consume(D),k):Mt(D)?(e.consume(D),W):n(D)}function u(D){return D===45?(e.consume(D),c):D===91?(e.consume(D),i=0,g):Mt(D)?(e.consume(D),E):n(D)}function c(D){return D===45?(e.consume(D),m):n(D)}function h(D){return D===null?n(D):D===45?(e.consume(D),p):Ce(D)?(s=h,K(D)):(e.consume(D),h)}function p(D){return D===45?(e.consume(D),m):h(D)}function m(D){return D===62?V(D):D===45?p(D):h(D)}function g(D){const L="CDATA[";return D===L.charCodeAt(i++)?(e.consume(D),i===L.length?f:g):n(D)}function f(D){return D===null?n(D):D===93?(e.consume(D),b):Ce(D)?(s=f,K(D)):(e.consume(D),f)}function b(D){return D===93?(e.consume(D),v):f(D)}function v(D){return D===62?V(D):D===93?(e.consume(D),v):f(D)}function E(D){return D===null||D===62?V(D):Ce(D)?(s=E,K(D)):(e.consume(D),E)}function k(D){return D===null?n(D):D===63?(e.consume(D),x):Ce(D)?(s=k,K(D)):(e.consume(D),k)}function x(D){return D===62?V(D):k(D)}function w(D){return Mt(D)?(e.consume(D),A):n(D)}function A(D){return D===45||St(D)?(e.consume(D),A):S(D)}function S(D){return Ce(D)?(s=S,K(D)):Pe(D)?(e.consume(D),S):V(D)}function W(D){return D===45||St(D)?(e.consume(D),W):D===47||D===62||ht(D)?R(D):n(D)}function R(D){return D===47?(e.consume(D),V):D===58||D===95||Mt(D)?(e.consume(D),I):Ce(D)?(s=R,K(D)):Pe(D)?(e.consume(D),R):V(D)}function I(D){return D===45||D===46||D===58||D===95||St(D)?(e.consume(D),I):N(D)}function N(D){return D===61?(e.consume(D),_):Ce(D)?(s=N,K(D)):Pe(D)?(e.consume(D),N):R(D)}function _(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),a=D,F):Ce(D)?(s=_,K(D)):Pe(D)?(e.consume(D),_):(e.consume(D),j)}function F(D){return D===a?(e.consume(D),a=void 0,$):D===null?n(D):Ce(D)?(s=F,K(D)):(e.consume(D),F)}function j(D){return D===null||D===34||D===39||D===60||D===61||D===96?n(D):D===47||D===62||ht(D)?R(D):(e.consume(D),j)}function $(D){return D===47||D===62||ht(D)?R(D):n(D)}function V(D){return D===62?(e.consume(D),e.exit("htmlTextData"),e.exit("htmlText"),t):n(D)}function K(D){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),Q}function Q(D){return Pe(D)?qe(e,ae,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):ae(D)}function ae(D){return e.enter("htmlTextData"),s(D)}}const Fo={name:"labelEnd",tokenize:GD,resolveTo:YD,resolveAll:ZD},HD={tokenize:QD},VD={tokenize:JD},KD={tokenize:XD};function ZD(e){let t=-1;for(;++t<e.length;){const n=e[t][1];(n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd")&&(e.splice(t+1,n.type==="labelImage"?4:2),n.type="data",t++)}return e}function YD(e,t){let n=e.length,r=0,a,i,s,o;for(;n--;)if(a=e[n][1],i){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[n][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(i=n,a.type!=="labelLink")){r=2;break}}else a.type==="labelEnd"&&(s=n);const l={type:e[i][1].type==="labelLink"?"link":"image",start:Object.assign({},e[i][1].start),end:Object.assign({},e[e.length-1][1].end)},u={type:"label",start:Object.assign({},e[i][1].start),end:Object.assign({},e[s][1].end)},c={type:"labelText",start:Object.assign({},e[i+r+2][1].end),end:Object.assign({},e[s-2][1].start)};return o=[["enter",l,t],["enter",u,t]],o=wt(o,e.slice(i+1,i+r+3)),o=wt(o,[["enter",c,t]]),o=wt(o,Bo(t.parser.constructs.insideSpan.null,e.slice(i+r+4,s-3),t)),o=wt(o,[["exit",c,t],e[s-2],e[s-1],["exit",u,t]]),o=wt(o,e.slice(s+1)),o=wt(o,[["exit",l,t]]),Yt(e,i,e.length,o),e}function GD(e,t,n){const r=this;let a=r.events.length,i,s;for(;a--;)if((r.events[a][1].type==="labelImage"||r.events[a][1].type==="labelLink")&&!r.events[a][1]._balanced){i=r.events[a][1];break}return o;function o(p){return i?i._inactive?h(p):(s=r.parser.defined.includes(Yn(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),l):n(p)}function l(p){return p===40?e.attempt(HD,c,s?c:h)(p):p===91?e.attempt(VD,c,s?u:h)(p):s?c(p):h(p)}function u(p){return e.attempt(KD,c,h)(p)}function c(p){return t(p)}function h(p){return i._balanced=!0,n(p)}}function QD(e,t,n){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),a}function a(h){return ht(h)?kr(e,i)(h):i(h)}function i(h){return h===41?c(h):Lf(e,s,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function s(h){return ht(h)?kr(e,l)(h):c(h)}function o(h){return n(h)}function l(h){return h===34||h===39||h===40?qf(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):c(h)}function u(h){return ht(h)?kr(e,c)(h):c(h)}function c(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function JD(e,t,n){const r=this;return a;function a(o){return zf.call(r,e,i,s,"reference","referenceMarker","referenceString")(o)}function i(o){return r.parser.defined.includes(Yn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function s(o){return n(o)}}function XD(e,t,n){return r;function r(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),a}function a(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):n(i)}}const ex={name:"labelStartImage",tokenize:tx,resolveAll:Fo.resolveAll};function tx(e,t,n){const r=this;return a;function a(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),i}function i(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelImage"),s):n(o)}function s(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const nx={name:"labelStartLink",tokenize:rx,resolveAll:Fo.resolveAll};function rx(e,t,n){const r=this;return a;function a(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),i}function i(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const Ki={name:"lineEnding",tokenize:ax};function ax(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),qe(e,t,"linePrefix")}}const Ea={name:"thematicBreak",tokenize:ix};function ix(e,t,n){let r=0,a;return i;function i(u){return e.enter("thematicBreak"),s(u)}function s(u){return a=u,o(u)}function o(u){return u===a?(e.enter("thematicBreakSequence"),l(u)):r>=3&&(u===null||Ce(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===a?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),Pe(u)?qe(e,o,"whitespace")(u):o(u))}}const ct={name:"list",tokenize:ux,continuation:{tokenize:lx},exit:dx},sx={tokenize:fx,partial:!0},ox={tokenize:cx,partial:!0};function ux(e,t,n){const r=this,a=r.events[r.events.length-1];let i=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,s=0;return o;function o(m){const g=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:Ls(m)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(Ea,n,u)(m):u(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(m)}return n(m)}function l(m){return Ls(m)&&++s<10?(e.consume(m),l):(!r.interrupt||s<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),u(m)):n(m)}function u(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(si,r.interrupt?n:c,e.attempt(sx,p,h))}function c(m){return r.containerState.initialBlankLine=!0,i++,p(m)}function h(m){return Pe(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),p):n(m)}function p(m){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function lx(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(si,a,i);function a(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,qe(e,t,"listItemIndent",r.containerState.size+1)(o)}function i(o){return r.containerState.furtherBlankLines||!Pe(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(ox,t,s)(o))}function s(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,qe(e,e.attempt(ct,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function cx(e,t,n){const r=this;return qe(e,a,"listItemIndent",r.containerState.size+1);function a(i){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(i):n(i)}}function dx(e){e.exit(this.containerState.type)}function fx(e,t,n){const r=this;return qe(e,a,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4+1);function a(i){const s=r.events[r.events.length-1];return!Pe(i)&&s&&s[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const lc={name:"setextUnderline",tokenize:mx,resolveTo:hx};function hx(e,t){let n=e.length,r,a,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(a=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const s={type:"setextHeading",start:Object.assign({},e[a][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[a][1].type="setextHeadingText",i?(e.splice(a,0,["enter",s,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end=Object.assign({},e[i][1].end)):e[r][1]=s,e.push(["exit",s,t]),e}function mx(e,t,n){const r=this;let a;return i;function i(u){let c=r.events.length,h;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){h=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),a=u,s(u)):n(u)}function s(u){return e.enter("setextHeadingLineSequence"),o(u)}function o(u){return u===a?(e.consume(u),o):(e.exit("setextHeadingLineSequence"),Pe(u)?qe(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||Ce(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const px={tokenize:gx};function gx(e){const t=this,n=e.attempt(si,r,e.attempt(this.parser.constructs.flowInitial,a,qe(e,e.attempt(this.parser.constructs.flow,a,e.attempt(DD,a)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function a(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const vx={resolveAll:Uf()},bx=Wf("string"),yx=Wf("text");function Wf(e){return{tokenize:t,resolveAll:Uf(e==="text"?Cx:void 0)};function t(n){const r=this,a=this.parser.constructs[e],i=n.attempt(a,s,o);return s;function s(c){return u(c)?i(c):o(c)}function o(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),l}function l(c){return u(c)?(n.exit("data"),i(c)):(n.consume(c),l)}function u(c){if(c===null)return!0;const h=a[c];let p=-1;if(h)for(;++p<h.length;){const m=h[p];if(!m.previous||m.previous.call(r,r.previous))return!0}return!1}}}function Uf(e){return t;function t(n,r){let a=-1,i;for(;++a<=n.length;)i===void 0?n[a]&&n[a][1].type==="data"&&(i=a,a++):(!n[a]||n[a][1].type!=="data")&&(a!==i+2&&(n[i][1].end=n[a-1][1].end,n.splice(i+2,a-i-2),a=i+2),i=void 0);return e?e(n,r):n}}function Cx(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],a=t.sliceStream(r);let i=a.length,s=-1,o=0,l;for(;i--;){const u=a[i];if(typeof u=="string"){for(s=u.length;u.charCodeAt(s-1)===32;)o++,s--;if(s)break;s=-1}else if(u===-2)l=!0,o++;else if(u!==-1){i++;break}}if(o){const u={type:n===e.length||l||o<2?"lineSuffix":"hardBreakTrailing",start:{line:r.end.line,column:r.end.column-o,offset:r.end.offset-o,_index:r.start._index+i,_bufferIndex:i?s:r.start._bufferIndex+s},end:Object.assign({},r.end)};r.end=Object.assign({},u.start),r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}function Dx(e,t,n){let r=Object.assign(n?Object.assign({},n):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1});const a={},i=[];let s=[],o=[];const l={consume:E,enter:k,exit:x,attempt:S(w),check:S(A),interrupt:S(A,{interrupt:!0})},u={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:m,sliceSerialize:p,now:g,defineSkip:f,write:h};let c=t.tokenize.call(u,l);return t.resolveAll&&i.push(t),u;function h(N){return s=wt(s,N),b(),s[s.length-1]!==null?[]:(W(t,0),u.events=Bo(i,u.events,u),u.events)}function p(N,_){return wx(m(N),_)}function m(N){return xx(s,N)}function g(){const{line:N,column:_,offset:F,_index:j,_bufferIndex:$}=r;return{line:N,column:_,offset:F,_index:j,_bufferIndex:$}}function f(N){a[N.line]=N.column,I()}function b(){let N;for(;r._index<s.length;){const _=s[r._index];if(typeof _=="string")for(N=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===N&&r._bufferIndex<_.length;)v(_.charCodeAt(r._bufferIndex));else v(_)}}function v(N){c=c(N)}function E(N){Ce(N)?(r.line++,r.column=1,r.offset+=N===-3?2:1,I()):N!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=N}function k(N,_){const F=_||{};return F.type=N,F.start=g(),u.events.push(["enter",F,u]),o.push(F),F}function x(N){const _=o.pop();return _.end=g(),u.events.push(["exit",_,u]),_}function w(N,_){W(N,_.from)}function A(N,_){_.restore()}function S(N,_){return F;function F(j,$,V){let K,Q,ae,D;return Array.isArray(j)?q(j):"tokenize"in j?q([j]):L(j);function L(M){return H;function H(ne){const ee=ne!==null&&M[ne],re=ne!==null&&M.null,le=[...Array.isArray(ee)?ee:ee?[ee]:[],...Array.isArray(re)?re:re?[re]:[]];return q(le)(ne)}}function q(M){return K=M,Q=0,M.length===0?V:B(M[Q])}function B(M){return H;function H(ne){return D=R(),ae=M,M.partial||(u.currentConstruct=M),M.name&&u.parser.constructs.disable.null.includes(M.name)?z():M.tokenize.call(_?Object.assign(Object.create(u),_):u,l,T,z)(ne)}}function T(M){return N(ae,D),$}function z(M){return D.restore(),++Q<K.length?B(K[Q]):V}}}function W(N,_){N.resolveAll&&!i.includes(N)&&i.push(N),N.resolve&&Yt(u.events,_,u.events.length-_,N.resolve(u.events.slice(_),u)),N.resolveTo&&(u.events=N.resolveTo(u.events,u))}function R(){const N=g(),_=u.previous,F=u.currentConstruct,j=u.events.length,$=Array.from(o);return{restore:V,from:j};function V(){r=N,u.previous=_,u.currentConstruct=F,u.events.length=j,o=$,I()}}function I(){r.line in a&&r.column<2&&(r.column=a[r.line],r.offset+=a[r.line]-1)}}function xx(e,t){const n=t.start._index,r=t.start._bufferIndex,a=t.end._index,i=t.end._bufferIndex;let s;if(n===a)s=[e[n].slice(r,i)];else{if(s=e.slice(n,a),r>-1){const o=s[0];typeof o=="string"?s[0]=o.slice(r):s.shift()}i>0&&s.push(e[a].slice(0,i))}return s}function wx(e,t){let n=-1;const r=[];let a;for(;++n<e.length;){const i=e[n];let s;if(typeof i=="string")s=i;else switch(i){case-5:{s="\r";break}case-4:{s=`
134
+ `)&&c===u.textContent.length&&c--,"getAttribute"in u&&u.getAttribute("contenteditable")==="false"&&u.getAttribute("data-slate-void")!=="true"){var E;u=o,c=((E=o.textContent)===null||E===void 0?void 0:E.length)||0}var k=te.toSlatePoint(e,[o,l],{exactMatch:a,suppressThrow:i});if(!k)return null;var x=h?k:te.toSlatePoint(e,[u,c],{exactMatch:a,suppressThrow:i});if(!x)return null;var w={anchor:k,focus:x};return K.isExpanded(w)&&K.isForward(w)&&wt(u)&&y.void(e,{at:w.focus,mode:"highest"})&&(w=y.unhangRange(e,w,{voids:!0})),w}};function a1(e,t){var{path:n,diff:r}=t;if(!y.hasPath(e,n))return!1;var a=ue.get(e,n);if(!fe.isText(a))return!1;if(r.start!==a.text.length||r.text.length===0)return a.text.slice(r.start,r.start+r.text.length)===r.text;var i=P.next(n);if(!y.hasPath(e,i))return!1;var s=ue.get(e,i);return fe.isText(s)&&s.text.startsWith(r.text)}function Cf(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.reduce((a,i)=>a.slice(0,i.start)+i.text+a.slice(i.end),e)}function i1(e,t){for(var n=Math.min(e.length,t.length),r=0;r<n;r++)if(e.charAt(r)!==t.charAt(r))return r;return n}function s1(e,t,n){for(var r=Math.min(e.length,t.length,n),a=0;a<r;a++)if(e.charAt(e.length-a-1)!==t.charAt(t.length-a-1))return a;return r}function Df(e,t){var{start:n,end:r,text:a}=t,i=e.slice(n,r),s=i1(i,a),o=Math.min(i.length-s,a.length-s),l=s1(i,a,o),u={start:n+s,end:r-l,text:a.slice(s,a.length-l)};return u.start===u.end&&u.text.length===0?null:u}function o1(e,t,n){var r=Math.min(t.start,n.start),a=Math.max(0,Math.min(t.start+t.text.length,n.end)-n.start),i=Cf(e,t,n),s=Math.max(n.start+n.text.length,t.start+t.text.length+(t.start+t.text.length>n.start?n.text.length:0)-a),o=i.slice(r,s),l=Math.max(t.end,n.end-t.text.length+(t.end-t.start));return Df(e,{start:r,end:l,text:o})}function u1(e){var{path:t,diff:n}=e;return{anchor:{path:t,offset:n.start},focus:{path:t,offset:n.end}}}function js(e,t){var{path:n,offset:r}=t;if(!y.hasPath(e,n))return null;var a=ue.get(e,n);if(!fe.isText(a))return null;var i=y.above(e,{match:o=>de.isElement(o)&&y.isBlock(e,o),at:n});if(!i)return null;for(;r>a.text.length;){var s=y.next(e,{at:n,match:fe.isText});if(!s||!P.isDescendant(s[1],i[1]))return null;r-=a.text.length,a=s[0],n=s[1]}return{path:n,offset:r}}function _l(e,t){var n=js(e,t.anchor);if(!n)return null;if(K.isCollapsed(t))return{anchor:n,focus:n};var r=js(e,t.focus);return r?{anchor:n,focus:r}:null}function Os(e,t,n){var r=ct.get(e),a=r==null?void 0:r.find(c=>{var{path:h}=c;return P.equals(h,t.path)});if(!a||t.offset<=a.diff.start)return Ee.transform(t,n,{affinity:"backward"});var{diff:i}=a;if(t.offset<=i.start+i.text.length){var s={path:t.path,offset:i.start},o=Ee.transform(s,n,{affinity:"backward"});return o?{path:o.path,offset:o.offset+t.offset-i.start}:null}var l={path:t.path,offset:t.offset-i.text.length+i.end-i.start},u=Ee.transform(l,n,{affinity:"backward"});return u?n.type==="split_node"&&P.equals(n.path,t.path)&&l.offset<n.position&&i.start<n.position?u:{path:u.path,offset:u.offset+i.text.length-i.end+i.start}:null}function kl(e,t,n){var r=Os(e,t.anchor,n);if(!r)return null;if(K.isCollapsed(t))return{anchor:r,focus:r};var a=Os(e,t.focus,n);return a?{anchor:r,focus:a}:null}function l1(e,t){var{path:n,diff:r,id:a}=e;switch(t.type){case"insert_text":return!P.equals(t.path,n)||t.offset>=r.end?e:t.offset<=r.start?{diff:{start:t.text.length+r.start,end:t.text.length+r.end,text:r.text},id:a,path:n}:{diff:{start:r.start,end:r.end+t.text.length,text:r.text},id:a,path:n};case"remove_text":return!P.equals(t.path,n)||t.offset>=r.end?e:t.offset+t.text.length<=r.start?{diff:{start:r.start-t.text.length,end:r.end-t.text.length,text:r.text},id:a,path:n}:{diff:{start:r.start,end:r.end-t.text.length,text:r.text},id:a,path:n};case"split_node":return!P.equals(t.path,n)||t.position>=r.end?{diff:r,id:a,path:P.transform(n,t,{affinity:"backward"})}:t.position>r.start?{diff:{start:r.start,end:Math.min(t.position,r.end),text:r.text},id:a,path:n}:{diff:{start:r.start-t.position,end:r.end-t.position,text:r.text},id:a,path:P.transform(n,t,{affinity:"forward"})};case"merge_node":return P.equals(t.path,n)?{diff:{start:r.start+t.position,end:r.end+t.position,text:r.text},id:a,path:P.transform(n,t)}:{diff:r,id:a,path:P.transform(n,t)}}var i=P.transform(n,t);return i?{diff:r,path:i,id:a}:null}function Fl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function ua(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Fl(Object(n),!0).forEach(function(r){Et(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fl(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var c1=25,d1=200,f1=function(){},h1=e=>(e==null?void 0:e.constructor.name)==="DataTransfer";function m1(e){var{editor:t,scheduleOnDOMSelectionChange:n,onDOMSelectionChange:r}=e,a=!1,i=null,s=null,o=null,l=0,u=!1,c=()=>{var _=rn.get(t);if(rn.delete(t),_){var{selection:B}=t,j=_l(t,_);j&&(!B||!K.equals(j,B))&&J.select(t,j)}},h=()=>{var _=nn.get(t);if(nn.delete(t),!!_){if(_.at){var B=Ee.isPoint(_.at)?js(t,_.at):_l(t,_.at);if(!B)return;var j=y.range(t,B);(!t.selection||!K.equals(t.selection,j))&&J.select(t,B)}_.run()}},p=()=>{if(s&&(clearTimeout(s),s=null),o&&(clearTimeout(o),o=null),!x()&&!k()){c();return}a||(a=!0,setTimeout(()=>a=!1)),k()&&(a="action");var _=t.selection&&y.rangeRef(t,t.selection,{affinity:"forward"});Kt.set(t,t.marks),f1("flush",nn.get(t),ct.get(t));for(var B=x(),j;j=(I=ct.get(t))===null||I===void 0?void 0:I[0];){var I,G,V=Bt.get(t);V!==void 0&&(Bt.delete(t),t.marks=V),V&&u===!1&&(u=null);var Q=u1(j);(!t.selection||!K.equals(t.selection,Q))&&J.select(t,Q),j.diff.text?y.insertText(t,j.diff.text):y.deleteFragment(t),ct.set(t,(G=ct.get(t))===null||G===void 0?void 0:G.filter(M=>{var{id:W}=M;return W!==j.id})),a1(t,j)||(B=!1,nn.delete(t),Kt.delete(t),a="action",rn.delete(t),n.cancel(),r.cancel(),_==null||_.unref())}var ae=_==null?void 0:_.unref();if(ae&&!rn.get(t)&&(!t.selection||!K.equals(ae,t.selection))&&J.select(t,ae),k()){h();return}B&&n(),n.flush(),r.flush(),c();var D=Kt.get(t);Kt.delete(t),D!==void 0&&(t.marks=D,t.onChange())},m=_=>{i&&clearTimeout(i),i=setTimeout(()=>{bn.set(t,!1),p()},c1)},g=_=>{bn.set(t,!0),i&&(clearTimeout(i),i=null)},f=function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,j=Bs.get(t);if(j){if(x()||B){j.style.display="none";return}j.style.removeProperty("display")}},b=(_,B)=>{var j,I=(j=ct.get(t))!==null&&j!==void 0?j:[];ct.set(t,I);var G=ue.leaf(t,_),V=I.findIndex(D=>P.equals(D.path,_));if(V<0){var Q=Df(G.text,B);Q&&I.push({path:_,diff:B,id:l++}),f();return}var ae=o1(G.text,I[V].diff,B);if(!ae){I.splice(V,1),f();return}I[V]=ua(ua({},I[V]),{},{diff:ae})},v=function(B){var{at:j}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};u=!1,rn.delete(t),n.cancel(),r.cancel(),k()&&p(),nn.set(t,{at:j,run:B}),o=setTimeout(p)},E=_=>{var B;s&&(clearTimeout(s),s=null);var{inputType:j}=_,I=null,G=_.dataTransfer||_.data||void 0;u!==!1&&j!=="insertText"&&j!=="insertCompositionText"&&(u=!1);var[V]=_.getTargetRanges();V&&(I=te.toSlateRange(t,V,{exactMatch:!1,suppressThrow:!0}));var Q=te.getWindow(t),ae=Q.getSelection();if(!I&&ae&&(V=ae,I=te.toSlateRange(t,ae,{exactMatch:!1,suppressThrow:!0})),I=(B=I)!==null&&B!==void 0?B:t.selection,!!I){var D=!0;if(j.startsWith("delete")){if(K.isExpanded(I)){var[M,W]=K.edges(I),F=ue.leaf(t,M.path);if(F.text.length===M.offset&&W.offset===0){var T=y.next(t,{at:M.path,match:fe.isText});T&&P.equals(T[1],W.path)&&(I={anchor:W,focus:W})}}var z=j.endsWith("Backward")?"backward":"forward",[R,H]=K.edges(I),[re,X]=y.leaf(t,R.path),ne={text:"",start:R.offset,end:H.offset},le=ct.get(t),ee=le==null?void 0:le.find(ve=>P.equals(ve.path,X)),he=ee?[ee.diff,ne]:[ne],me=Cf(re.text,...he);if(me.length===0&&(D=!1),K.isExpanded(I)){if(D&&P.equals(I.anchor.path,I.focus.path)){var ye={path:I.anchor.path,offset:R.offset},Be=y.range(t,ye,ye);return S(Be),b(I.anchor.path,{text:"",end:H.offset,start:R.offset})}return v(()=>y.deleteFragment(t,{direction:z}),{at:I})}}switch(j){case"deleteByComposition":case"deleteByCut":case"deleteByDrag":return v(()=>y.deleteFragment(t),{at:I});case"deleteContent":case"deleteContentForward":{var{anchor:Ae}=I;if(D&&K.isCollapsed(I)){var Ue=ue.leaf(t,Ae.path);if(Ae.offset<Ue.text.length)return b(Ae.path,{text:"",start:Ae.offset,end:Ae.offset+1})}return v(()=>y.deleteForward(t),{at:I})}case"deleteContentBackward":{var Se,{anchor:Te}=I,Ne=Ss(V)?V.isCollapsed:!!((Se=V)!==null&&Se!==void 0&&Se.collapsed);return D&&Ne&&K.isCollapsed(I)&&Te.offset>0?b(Te.path,{text:"",start:Te.offset-1,end:Te.offset}):v(()=>y.deleteBackward(t),{at:I})}case"deleteEntireSoftLine":return v(()=>{y.deleteBackward(t,{unit:"line"}),y.deleteForward(t,{unit:"line"})},{at:I});case"deleteHardLineBackward":return v(()=>y.deleteBackward(t,{unit:"block"}),{at:I});case"deleteSoftLineBackward":return v(()=>y.deleteBackward(t,{unit:"line"}),{at:I});case"deleteHardLineForward":return v(()=>y.deleteForward(t,{unit:"block"}),{at:I});case"deleteSoftLineForward":return v(()=>y.deleteForward(t,{unit:"line"}),{at:I});case"deleteWordBackward":return v(()=>y.deleteBackward(t,{unit:"word"}),{at:I});case"deleteWordForward":return v(()=>y.deleteForward(t,{unit:"word"}),{at:I});case"insertLineBreak":return v(()=>y.insertSoftBreak(t),{at:I});case"insertParagraph":return v(()=>y.insertBreak(t),{at:I});case"insertCompositionText":case"deleteCompositionText":case"insertFromComposition":case"insertFromDrop":case"insertFromPaste":case"insertFromYank":case"insertReplacementText":case"insertText":{if(h1(G))return v(()=>te.insertData(t,G),{at:I});var _e=G??"";if(Bt.get(t)&&(_e=_e.replace("\uFEFF","")),j==="insertText"&&/.*\n.*\n$/.test(_e)&&(_e=_e.slice(0,-1)),_e.includes(`
135
+ `))return v(()=>{var ve=_e.split(`
136
+ `);ve.forEach((we,Ke)=>{we&&y.insertText(t,we),Ke!==ve.length-1&&y.insertSoftBreak(t)})},{at:I});if(P.equals(I.anchor.path,I.focus.path)){var[He,ge]=K.edges(I),U={start:He.offset,end:ge.offset,text:_e};if(_e&&u&&j==="insertCompositionText"){var ie=u.start+u.text.search(/\S|$/),pe=U.start+U.text.search(/\S|$/);pe===ie+1&&U.end===u.start+u.text.length?(U.start-=1,u=null,N()):u=!1}else j==="insertText"?u===null?u=U:u&&K.isCollapsed(I)&&u.end+u.text.length===He.offset?u=ua(ua({},u),{},{text:u.text+_e}):u=!1:u=!1;if(D){b(He.path,U);return}}return v(()=>y.insertText(t,_e),{at:I})}}}},k=()=>!!nn.get(t),x=()=>{var _;return!!((_=ct.get(t))!==null&&_!==void 0&&_.length)},w=()=>k()||x(),A=()=>a,S=_=>{rn.set(t,_),s&&(clearTimeout(s),s=null);var{selection:B}=t;if(_){var j=!B||!P.equals(B.anchor.path,_.anchor.path),I=!B||!P.equals(B.anchor.path.slice(0,-1),_.anchor.path.slice(0,-1));(j&&u||I)&&(u=!1),(j||x())&&(s=setTimeout(p,d1))}},q=()=>{(k()||!x())&&p()},$=_=>{x()||(f(!0),setTimeout(f))},N=()=>{k()||(o=setTimeout(p))},L=_=>{if(!(x()||k())&&_.some(j=>Eo(t,j,_))){var B;(B=pf.get(t))===null||B===void 0||B()}};return{flush:p,scheduleFlush:N,hasPendingDiffs:x,hasPendingAction:k,hasPendingChanges:w,isFlushing:A,handleUserSelect:S,handleCompositionEnd:m,handleCompositionStart:g,handleDOMBeforeInput:E,handleKeyDown:$,handleDomMutations:L,handleInput:q}}function p1(){var e=C.useRef(!1);return C.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),e.current}var Ir=Da?C.useLayoutEffect:C.useEffect;function g1(e,t,n){var[r]=C.useState(()=>new MutationObserver(t));Ir(()=>{r.takeRecords()}),C.useEffect(()=>{if(!e.current)throw new Error("Failed to attach MutationObserver, `node` is undefined");return r.observe(e.current,n),()=>r.disconnect()},[r,e,n])}var v1=["node"];function Bl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function b1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Bl(Object(n),!0).forEach(function(r){Et(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bl(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var y1={subtree:!0,childList:!0,characterData:!0},C1=ot?e=>{var{node:t}=e,n=er(e,v1);if(!ot)return null;var r=fn(),a=p1(),[i]=C.useState(()=>m1(b1({editor:r},n)));return g1(t,i.handleDomMutations,y1),xo.set(r,i.scheduleFlush),a&&i.flush(),i}:()=>null,D1=["anchor","focus"],x1=["anchor","focus"],w1=(e,t)=>Object.keys(e).length===Object.keys(t).length&&Object.keys(e).every(n=>t.hasOwnProperty(n)&&e[n]===t[n]),xf=(e,t)=>{var n=er(e,D1),r=er(t,x1);return e[tr]===t[tr]&&w1(n,r)},E1=(e,t)=>{if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++){var r=e[n],a=t[n];if(!K.equals(r,a)||!xf(r,a))return!1}return!0},_1=(e,t)=>{if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++){var r=e[n],a=t[n];if(r.anchor.offset!==a.anchor.offset||r.focus.offset!==a.focus.offset||!xf(r,a))return!1}return!0};function Al(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function k1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Al(Object(n),!0).forEach(function(r){Et(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Al(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var F1=e=>{var{isLast:t,leaf:n,parent:r,text:a}=e,i=fn(),s=te.findPath(i,a),o=P.parent(s),l=!!n[gf];return i.isVoid(r)?C.createElement(Mi,{length:ue.string(r).length}):n.text===""&&r.children[r.children.length-1]===a&&!i.isInline(r)&&y.string(i,o)===""?C.createElement(Mi,{isLineBreak:!0,isMarkPlaceholder:l}):n.text===""?C.createElement(Mi,{isMarkPlaceholder:l}):t&&n.text.slice(-1)===`
137
+ `?C.createElement(Tl,{isTrailing:!0,text:n.text}):C.createElement(Tl,{text:n.text})},Tl=e=>{var{text:t,isTrailing:n=!1}=e,r=C.useRef(null),a=()=>"".concat(t??"").concat(n?`
138
+ `:""),[i]=C.useState(a);return Ir(()=>{var s=a();r.current&&r.current.textContent!==s&&(r.current.textContent=s)}),C.createElement(B1,{ref:r},i)},B1=C.memo(C.forwardRef((e,t)=>C.createElement("span",{"data-slate-string":!0,ref:t},e.children))),Mi=e=>{var{length:t=0,isLineBreak:n=!1,isMarkPlaceholder:r=!1}=e,a={"data-slate-zero-width":n?"n":"z","data-slate-length":t};return r&&(a["data-slate-mark-placeholder"]=!0),C.createElement("span",k1({},a),!ot||!n?"\uFEFF":null,n?C.createElement("br",null):null)};function Sl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function wf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Sl(Object(n),!0).forEach(function(r){Et(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sl(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var A1=ot?300:0;function T1(e,t){e.current&&(e.current.disconnect(),t&&(e.current=null))}function jl(e){e.current&&(clearTimeout(e.current),e.current=null)}var S1=e=>{var{leaf:t,isLast:n,text:r,parent:a,renderPlaceholder:i,renderLeaf:s=E=>C.createElement(O1,wf({},E))}=e,o=fn(),l=C.useRef(null),u=C.useRef(null),[c,h]=C.useState(!1),p=C.useRef(null),m=C.useCallback(E=>{if(T1(l,E==null),E==null){var k;Bs.delete(o),(k=t.onPlaceholderResize)===null||k===void 0||k.call(t,null)}else{if(Bs.set(o,E),!l.current){var x=window.ResizeObserver||Oy;l.current=new x(()=>{var w;(w=t.onPlaceholderResize)===null||w===void 0||w.call(t,E)})}l.current.observe(E),u.current=E}},[u,t,o]),g=C.createElement(F1,{isLast:n,leaf:t,parent:a,text:r}),f=!!t[tr];if(C.useEffect(()=>(f?p.current||(p.current=setTimeout(()=>{h(!0),p.current=null},A1)):(jl(p),h(!1)),()=>jl(p)),[f,h]),f&&c){var b={children:t.placeholder,attributes:{"data-slate-placeholder":!0,style:{position:"absolute",top:0,pointerEvents:"none",width:"100%",maxWidth:"100%",display:"block",opacity:"0.333",userSelect:"none",textDecoration:"none",WebkitUserModify:Cr?"inherit":void 0},contentEditable:!1,ref:m}};g=C.createElement(C.Fragment,null,i(b),g)}var v={"data-slate-leaf":!0};return s({attributes:v,children:g,leaf:t,text:r})},j1=C.memo(S1,(e,t)=>t.parent===e.parent&&t.isLast===e.isLast&&t.renderLeaf===e.renderLeaf&&t.renderPlaceholder===e.renderPlaceholder&&t.text===e.text&&fe.equals(t.leaf,e.leaf)&&t.leaf[tr]===e.leaf[tr]),O1=e=>{var{attributes:t,children:n}=e;return C.createElement("span",wf({},t),n)},P1=e=>{for(var{decorations:t,isLast:n,parent:r,renderPlaceholder:a,renderLeaf:i,text:s}=e,o=fn(),l=C.useRef(null),u=fe.decorations(s,t),c=te.findKey(o,s),h=[],p=0;p<u.length;p++){var m=u[p];h.push(C.createElement(j1,{isLast:n&&p===u.length-1,key:"".concat(c.id,"-").concat(p),renderPlaceholder:a,leaf:m,text:s,parent:r,renderLeaf:i}))}var g=C.useCallback(f=>{var b=ii.get(o);f?(b==null||b.set(c,f),wn.set(s,f),Mr.set(f,s)):(b==null||b.delete(c),wn.delete(s),l.current&&Mr.delete(l.current)),l.current=f},[l,o,c,s]);return C.createElement("span",{"data-slate-node":"text",ref:g},h)},Ef=C.memo(P1,(e,t)=>t.parent===e.parent&&t.isLast===e.isLast&&t.renderLeaf===e.renderLeaf&&t.renderPlaceholder===e.renderPlaceholder&&t.text===e.text&&_1(t.decorations,e.decorations));function Ol(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Ps(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ol(Object(n),!0).forEach(function(r){Et(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ol(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var N1=e=>{var{decorations:t,element:n,renderElement:r=E=>C.createElement(M1,Ps({},E)),renderPlaceholder:a,renderLeaf:i,selection:s}=e,o=fn(),l=L1(),u=o.isInline(n),c=te.findKey(o,n),h=C.useCallback(E=>{var k=ii.get(o);E?(k==null||k.set(c,E),wn.set(n,E),Mr.set(E,n)):(k==null||k.delete(c),wn.delete(n))},[o,c,n]),p=kf({decorations:t,node:n,renderElement:r,renderPlaceholder:a,renderLeaf:i,selection:s}),m={"data-slate-node":"element",ref:h};if(u&&(m["data-slate-inline"]=!0),!u&&y.hasInlines(o,n)){var g=ue.string(n),f=Gd(g);f==="rtl"&&(m.dir=f)}if(y.isVoid(o,n)){m["data-slate-void"]=!0,!l&&u&&(m.contentEditable=!1);var b=u?"span":"div",[[v]]=ue.texts(n);p=C.createElement(b,{"data-slate-spacer":!0,style:{height:"0",color:"transparent",outline:"none",position:"absolute"}},C.createElement(Ef,{renderPlaceholder:a,decorations:[],isLast:!1,parent:n,text:v})),Co.set(v,0),Do.set(v,n)}return r({attributes:m,children:p,element:n})},R1=C.memo(N1,(e,t)=>e.element===t.element&&e.renderElement===t.renderElement&&e.renderLeaf===t.renderLeaf&&e.renderPlaceholder===t.renderPlaceholder&&E1(e.decorations,t.decorations)&&(e.selection===t.selection||!!e.selection&&!!t.selection&&K.equals(e.selection,t.selection))),M1=e=>{var{attributes:t,children:n,element:r}=e,a=fn(),i=a.isInline(r)?"span":"div";return C.createElement(i,Ps(Ps({},t),{},{style:{position:"relative"}}),n)},_f=C.createContext(()=>[]),I1=()=>C.useContext(_f),$1=C.createContext(!1),kf=e=>{for(var{decorations:t,node:n,renderElement:r,renderPlaceholder:a,renderLeaf:i,selection:s}=e,o=I1(),l=fn(),u=te.findPath(l,n),c=[],h=de.isElement(n)&&!l.isInline(n)&&y.hasInlines(l,n),p=0;p<n.children.length;p++){var m=u.concat(p),g=n.children[p],f=te.findKey(l,g),b=y.range(l,m),v=s&&K.intersection(b,s),E=o([g,m]);for(var k of t){var x=K.intersection(k,b);x&&E.push(x)}de.isElement(g)?c.push(C.createElement($1.Provider,{key:"provider-".concat(f.id),value:!!v},C.createElement(R1,{decorations:E,element:g,key:f.id,renderElement:r,renderPlaceholder:a,renderLeaf:i,selection:v}))):c.push(C.createElement(Ef,{decorations:E,key:f.id,isLast:h&&p===n.children.length-1,parent:n,renderPlaceholder:a,renderLeaf:i,text:g})),Co.set(g,p),Do.set(g,n)}return c},Ff=C.createContext(!1),L1=()=>C.useContext(Ff),Bf=C.createContext(null),On=()=>{var e=C.useContext(Bf);if(!e)throw new Error("The `useSlate` hook must be used inside the <Slate> component's context.");var{editor:t}=e;return t};function z1(){var e=fn(),t=C.useRef(!1),n=C.useRef(0),r=C.useCallback(()=>{if(!t.current){t.current=!0;var a=te.getWindow(e);a.cancelAnimationFrame(n.current),n.current=a.requestAnimationFrame(()=>{t.current=!1})}},[e]);return C.useEffect(()=>()=>cancelAnimationFrame(n.current),[]),{receivedUserInput:t,onUserInput:r}}var q1=3,W1={bold:"mod+b",compose:["down","left","right","up","backspace","enter"],moveBackward:"left",moveForward:"right",moveWordBackward:"ctrl+left",moveWordForward:"ctrl+right",deleteBackward:"shift?+backspace",deleteForward:"shift?+delete",extendBackward:"shift+left",extendForward:"shift+right",italic:"mod+i",insertSoftBreak:"shift+enter",splitBlock:"enter",undo:"mod+z"},U1={moveLineBackward:"opt+up",moveLineForward:"opt+down",moveWordBackward:"opt+left",moveWordForward:"opt+right",deleteBackward:["ctrl+backspace","ctrl+h"],deleteForward:["ctrl+delete","ctrl+d"],deleteLineBackward:"cmd+shift?+backspace",deleteLineForward:["cmd+shift?+delete","ctrl+k"],deleteWordBackward:"opt+shift?+backspace",deleteWordForward:"opt+shift?+delete",extendLineBackward:"opt+shift+up",extendLineForward:"opt+shift+down",redo:"cmd+shift+z",transposeCharacter:"ctrl+t"},H1={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},We=e=>{var t=W1[e],n=U1[e],r=H1[e],a=t&&Ri(t),i=n&&Ri(n),s=r&&Ri(r);return o=>!!(a&&a(o)||El&&i&&i(o)||!El&&s&&s(o))},Ve={isBold:We("bold"),isCompose:We("compose"),isMoveBackward:We("moveBackward"),isMoveForward:We("moveForward"),isDeleteBackward:We("deleteBackward"),isDeleteForward:We("deleteForward"),isDeleteLineBackward:We("deleteLineBackward"),isDeleteLineForward:We("deleteLineForward"),isDeleteWordBackward:We("deleteWordBackward"),isDeleteWordForward:We("deleteWordForward"),isExtendBackward:We("extendBackward"),isExtendForward:We("extendForward"),isExtendLineBackward:We("extendLineBackward"),isExtendLineForward:We("extendLineForward"),isItalic:We("italic"),isMoveLineBackward:We("moveLineBackward"),isMoveLineForward:We("moveLineForward"),isMoveWordBackward:We("moveWordBackward"),isMoveWordForward:We("moveWordForward"),isRedo:We("redo"),isSoftBreak:We("insertSoftBreak"),isSplitBlock:We("splitBlock"),isTransposeCharacter:We("transposeCharacter"),isUndo:We("undo")},V1=(e,t)=>{var n=[],r=()=>{n=[]},a=s=>{if(t.current){var o=s.filter(l=>Eo(e,l,s));n.push(...o)}};function i(){n.length>0&&(n.reverse().forEach(s=>{s.type!=="characterData"&&(s.removedNodes.forEach(o=>{s.target.insertBefore(o,s.nextSibling)}),s.addedNodes.forEach(o=>{s.target.removeChild(o)}))}),r())}return{registerMutations:a,restoreDOM:i,clear:r}},K1={subtree:!0,childList:!0,characterData:!0,characterDataOldValue:!0};class Af extends C.Component{constructor(){super(...arguments),Et(this,"context",null),Et(this,"manager",null),Et(this,"mutationObserver",null)}observe(){var t,{node:n}=this.props;if(!n.current)throw new Error("Failed to attach MutationObserver, `node` is undefined");(t=this.mutationObserver)===null||t===void 0||t.observe(n.current,K1)}componentDidMount(){var{receivedUserInput:t}=this.props,n=this.context;this.manager=V1(n,t),this.mutationObserver=new MutationObserver(this.manager.registerMutations),this.observe()}getSnapshotBeforeUpdate(){var t,n,r,a=(t=this.mutationObserver)===null||t===void 0?void 0:t.takeRecords();if(a!=null&&a.length){var i;(i=this.manager)===null||i===void 0||i.registerMutations(a)}return(n=this.mutationObserver)===null||n===void 0||n.disconnect(),(r=this.manager)===null||r===void 0||r.restoreDOM(),null}componentDidUpdate(){var t;(t=this.manager)===null||t===void 0||t.clear(),this.observe()}componentWillUnmount(){var t;(t=this.mutationObserver)===null||t===void 0||t.disconnect()}render(){return this.props.children}}Et(Af,"contextType",yo);var Z1=ot?Af:e=>{var{children:t}=e;return C.createElement(C.Fragment,null,t)},Y1=["autoFocus","decorate","onDOMBeforeInput","placeholder","readOnly","renderElement","renderLeaf","renderPlaceholder","scrollSelectionIntoView","style","as","disableDefaultStyles"],G1=["text"];function Pl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Ot(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Pl(Object(n),!0).forEach(function(r){Et(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pl(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Q1=e=>C.createElement(C.Fragment,null,kf(e)),J1=e=>{var t=C.useCallback(T=>C.createElement(X1,Ot({},T)),[]),{autoFocus:n,decorate:r=eC,onDOMBeforeInput:a,placeholder:i,readOnly:s=!1,renderElement:o,renderLeaf:l,renderPlaceholder:u=t,scrollSelectionIntoView:c=tC,style:h={},as:p="div",disableDefaultStyles:m=!1}=e,g=er(e,Y1),f=On(),[b,v]=C.useState(!1),E=C.useRef(null),k=C.useRef([]),[x,w]=C.useState(),{onUserInput:A,receivedUserInput:S}=z1(),[,q]=C.useReducer(T=>T+1,0);pf.set(f,q),As.set(f,s);var $=C.useMemo(()=>({isDraggingInternally:!1,isUpdatingSelection:!1,latestElement:null,hasMarkPlaceholder:!1}),[]);C.useEffect(()=>{E.current&&n&&E.current.focus()},[n]);var N=C.useRef(),L=C.useMemo(()=>ly(()=>{var T=N.current;if((ot||!te.isComposing(f))&&(!$.isUpdatingSelection||T!=null&&T.isFlushing())&&!$.isDraggingInternally){var z=te.findDocumentOrShadowRoot(f),{activeElement:R}=z,H=te.toDOMNode(f,f),re=z.getSelection();if(R===H?($.latestElement=R,on.set(f,!0)):on.delete(f),!re)return J.deselect(f);var{anchorNode:X,focusNode:ne}=re,le=te.hasEditableTarget(f,X)||te.isTargetInsideNonReadonlyVoid(f,X),ee=te.hasEditableTarget(f,ne)||te.isTargetInsideNonReadonlyVoid(f,ne);if(le&&ee){var he=te.toSlateRange(f,re,{exactMatch:!1,suppressThrow:!0});he&&(!te.isComposing(f)&&!(T!=null&&T.hasPendingChanges())&&!(T!=null&&T.isFlushing())?J.select(f,he):T==null||T.handleUserSelect(he))}s&&(!le||!ee)&&J.deselect(f)}},100),[f,s,$]),_=C.useMemo(()=>ry(L,0),[L]);N.current=C1({node:E,onDOMSelectionChange:L,scheduleOnDOMSelectionChange:_}),Ir(()=>{var T,z,R;E.current&&(R=wo(E.current))?(mf.set(f,R),xa.set(f,E.current),wn.set(f,E.current),Mr.set(E.current,f)):wn.delete(f);var{selection:H}=f,re=te.findDocumentOrShadowRoot(f),X=re.getSelection();if(!(!X||!te.isFocused(f)||(T=N.current)!==null&&T!==void 0&&T.hasPendingAction())){var ne=me=>{var ye=X.type!=="None";if(!(!H&&!ye)){var Be=X.focusNode,Ae;if(Hn&&X.rangeCount>1){var Ue=X.getRangeAt(0),Se=X.getRangeAt(X.rangeCount-1);Ue.startContainer===Be?Ae=Se.endContainer:Ae=Ue.startContainer}else Ae=X.anchorNode;var Te=xa.get(f),Ne=!1;if(Te.contains(Ae)&&Te.contains(Be)&&(Ne=!0),ye&&Ne&&H&&!me){var _e=te.toSlateRange(f,X,{exactMatch:!0,suppressThrow:!0});if(_e&&K.equals(_e,H)){var He;if(!$.hasMarkPlaceholder||(He=Ae)!==null&&He!==void 0&&(He=He.parentElement)!==null&&He!==void 0&&He.hasAttribute("data-slate-mark-placeholder"))return}}if(H&&!te.hasRange(f,H)){f.selection=te.toSlateRange(f,X,{exactMatch:!1,suppressThrow:!0});return}$.isUpdatingSelection=!0;var ge=H&&te.toDOMRange(f,H);return ge?(te.isComposing(f)&&!ot?X.collapseToEnd():K.isBackward(H)?X.setBaseAndExtent(ge.endContainer,ge.endOffset,ge.startContainer,ge.startOffset):X.setBaseAndExtent(ge.startContainer,ge.startOffset,ge.endContainer,ge.endOffset),c(f,ge)):X.removeAllRanges(),ge}};X.rangeCount<=1&&ne();var le=((z=N.current)===null||z===void 0?void 0:z.isFlushing())==="action";if(!ot||!le){setTimeout(()=>{$.isUpdatingSelection=!1});return}var ee=null,he=requestAnimationFrame(()=>{if(le){var me=ye=>{try{var Be=te.toDOMNode(f,f);Be.focus(),ne(ye)}catch{}};me(),ee=setTimeout(()=>{me(!0),$.isUpdatingSelection=!1})}});return()=>{cancelAnimationFrame(he),ee&&clearTimeout(ee)}}});var B=C.useCallback(T=>{if(A(),!s&&te.hasEditableTarget(f,T.target)&&!nC(T,a)){var z;if(N.current)return N.current.handleDOMBeforeInput(T);_.flush(),L.flush();var{selection:R}=f,{inputType:H}=T,re=T.dataTransfer||T.data||void 0,X=H==="insertCompositionText"||H==="deleteCompositionText";if(X&&te.isComposing(f))return;var ne=!1;if(H==="insertText"&&R&&K.isCollapsed(R)&&T.data&&T.data.length===1&&/[a-z ]/i.test(T.data)&&R.anchor.offset!==0){var le,ee;ne=!0,f.marks&&(ne=!1);var{anchor:he}=R,[me,ye]=te.toDOMPoint(f,he),Be=(le=me.parentElement)===null||le===void 0?void 0:le.closest("a"),Ae=te.getWindow(f);if(ne&&Be&&te.hasDOMNode(f,Be)){var Ue,Se=Ae==null?void 0:Ae.document.createTreeWalker(Be,NodeFilter.SHOW_TEXT).lastChild();Se===me&&((Ue=Se.textContent)===null||Ue===void 0?void 0:Ue.length)===ye&&(ne=!1)}if(ne&&me.parentElement&&(Ae==null||(ee=Ae.getComputedStyle(me.parentElement))===null||ee===void 0?void 0:ee.whiteSpace)==="pre"){var Te=y.above(f,{at:he.path,match:ie=>de.isElement(ie)&&y.isBlock(f,ie)});Te&&ue.string(Te[0]).includes(" ")&&(ne=!1)}}if(!H.startsWith("delete")||H.startsWith("deleteBy")){var[Ne]=T.getTargetRanges();if(Ne){var _e=te.toSlateRange(f,Ne,{exactMatch:!1,suppressThrow:!1});if(!R||!K.equals(R,_e)){ne=!1;var He=!X&&f.selection&&y.rangeRef(f,f.selection);J.select(f,_e),He&&Er.set(f,He)}}}if(X)return;if(ne||T.preventDefault(),R&&K.isExpanded(R)&&H.startsWith("delete")){var ge=H.endsWith("Backward")?"backward":"forward";y.deleteFragment(f,{direction:ge});return}switch(H){case"deleteByComposition":case"deleteByCut":case"deleteByDrag":{y.deleteFragment(f);break}case"deleteContent":case"deleteContentForward":{y.deleteForward(f);break}case"deleteContentBackward":{y.deleteBackward(f);break}case"deleteEntireSoftLine":{y.deleteBackward(f,{unit:"line"}),y.deleteForward(f,{unit:"line"});break}case"deleteHardLineBackward":{y.deleteBackward(f,{unit:"block"});break}case"deleteSoftLineBackward":{y.deleteBackward(f,{unit:"line"});break}case"deleteHardLineForward":{y.deleteForward(f,{unit:"block"});break}case"deleteSoftLineForward":{y.deleteForward(f,{unit:"line"});break}case"deleteWordBackward":{y.deleteBackward(f,{unit:"word"});break}case"deleteWordForward":{y.deleteForward(f,{unit:"word"});break}case"insertLineBreak":y.insertSoftBreak(f);break;case"insertParagraph":{y.insertBreak(f);break}case"insertFromComposition":case"insertFromDrop":case"insertFromPaste":case"insertFromYank":case"insertReplacementText":case"insertText":{H==="insertFromComposition"&&te.isComposing(f)&&(v(!1),bn.set(f,!1)),(re==null?void 0:re.constructor.name)==="DataTransfer"?te.insertData(f,re):typeof re=="string"&&(ne?k.current.push(()=>y.insertText(f,re)):y.insertText(f,re));break}}var U=(z=Er.get(f))===null||z===void 0?void 0:z.unref();Er.delete(f),U&&(!f.selection||!K.equals(f.selection,U))&&J.select(f,U)}},[f,L,A,a,s,_]),j=C.useCallback(T=>{T==null?(L.cancel(),_.cancel(),xa.delete(f),wn.delete(f),E.current&&en&&E.current.removeEventListener("beforeinput",B)):en&&T.addEventListener("beforeinput",B),E.current=T},[L,_,f,B]);Ir(()=>{var T=te.getWindow(f);return T.document.addEventListener("selectionchange",_),()=>{T.document.removeEventListener("selectionchange",_)}},[_]);var I=r([f,[]]),G=i&&f.children.length===1&&Array.from(ue.texts(f)).length===1&&ue.string(f)===""&&!b,V=C.useCallback(T=>{if(T&&G){var z;w((z=T.getBoundingClientRect())===null||z===void 0?void 0:z.height)}else w(void 0)},[G]);if(G){var Q=y.start(f,[]);I.push({[tr]:!0,placeholder:i,onPlaceholderResize:V,anchor:Q,focus:Q})}var{marks:ae}=f;if($.hasMarkPlaceholder=!1,f.selection&&K.isCollapsed(f.selection)&&ae){var{anchor:D}=f.selection,M=ue.leaf(f,D.path),W=er(M,G1);if(!fe.equals(M,ae,{loose:!0})){$.hasMarkPlaceholder=!0;var F=Object.fromEntries(Object.keys(W).map(T=>[T,null]));I.push(Ot(Ot(Ot({[gf]:!0},F),ae),{},{anchor:D,focus:D}))}}return C.useEffect(()=>{setTimeout(()=>{var{selection:T}=f;if(T){var{anchor:z}=T,R=ue.leaf(f,z.path);if(ae&&!fe.equals(R,ae,{loose:!0})){Bt.set(f,ae);return}}Bt.delete(f)})}),C.createElement(Ff.Provider,{value:s},C.createElement(_f.Provider,{value:r},C.createElement(Z1,{node:E,receivedUserInput:S},C.createElement(p,Ot(Ot({role:s?void 0:"textbox","aria-multiline":s?void 0:!0},g),{},{spellCheck:en||!Da?g.spellCheck:!1,autoCorrect:en||!Da?g.autoCorrect:"false",autoCapitalize:en||!Da?g.autoCapitalize:"false","data-slate-editor":!0,"data-slate-node":"value",contentEditable:!s,zindex:-1,suppressContentEditableWarning:!0,ref:j,style:Ot(Ot({},m?{}:Ot({position:"relative",whiteSpace:"pre-wrap",wordWrap:"break-word"},x?{minHeight:x}:{})),h),onBeforeInput:C.useCallback(T=>{if(!en&&!s&&!it(T,g.onBeforeInput)&&te.hasSelectableTarget(f,T.target)&&(T.preventDefault(),!te.isComposing(f))){var z=T.data;y.insertText(f,z)}},[g.onBeforeInput,f,s]),onInput:C.useCallback(T=>{if(!it(T,g.onInput)){if(N.current){N.current.handleInput();return}for(var z of k.current)z();k.current=[]}},[g.onInput]),onBlur:C.useCallback(T=>{if(!(s||$.isUpdatingSelection||!te.hasSelectableTarget(f,T.target)||it(T,g.onBlur))){var z=te.findDocumentOrShadowRoot(f);if($.latestElement!==z.activeElement){var{relatedTarget:R}=T,H=te.toDOMNode(f,f);if(R!==H&&!(wt(R)&&R.hasAttribute("data-slate-spacer"))){if(R!=null&&un(R)&&te.hasDOMNode(f,R)){var re=te.toSlateNode(f,R);if(de.isElement(re)&&!f.isVoid(re))return}if(Cr){var X=z.getSelection();X==null||X.removeAllRanges()}on.delete(f)}}}},[s,$.isUpdatingSelection,$.latestElement,f,g.onBlur]),onClick:C.useCallback(T=>{if(te.hasTarget(f,T.target)&&!it(T,g.onClick)&&un(T.target)){var z=te.toSlateNode(f,T.target),R=te.findPath(f,z);if(!y.hasPath(f,R)||ue.get(f,R)!==z)return;if(T.detail===q1&&R.length>=1){var H=R;if(!(de.isElement(z)&&y.isBlock(f,z))){var re,X=y.above(f,{match:Be=>de.isElement(Be)&&y.isBlock(f,Be),at:R});H=(re=X==null?void 0:X[1])!==null&&re!==void 0?re:R.slice(0,1)}var ne=y.range(f,H);J.select(f,ne);return}if(s)return;var le=y.start(f,R),ee=y.end(f,R),he=y.void(f,{at:le}),me=y.void(f,{at:ee});if(he&&me&&P.equals(he[1],me[1])){var ye=y.range(f,le);J.select(f,ye)}}},[f,g.onClick,s]),onCompositionEnd:C.useCallback(T=>{if(te.hasSelectableTarget(f,T.target)){var z;if(te.isComposing(f)&&Promise.resolve().then(()=>{v(!1),bn.set(f,!1)}),(z=N.current)===null||z===void 0||z.handleCompositionEnd(T),it(T,g.onCompositionEnd)||ot)return;if(!Cr&&!Hy&&!zy&&!Ky&&!Vy&&T.data){var R=Bt.get(f);Bt.delete(f),R!==void 0&&(Kt.set(f,f.marks),f.marks=R),y.insertText(f,T.data);var H=Kt.get(f);Kt.delete(f),H!==void 0&&(f.marks=H)}}},[g.onCompositionEnd,f]),onCompositionUpdate:C.useCallback(T=>{te.hasSelectableTarget(f,T.target)&&!it(T,g.onCompositionUpdate)&&(te.isComposing(f)||(v(!0),bn.set(f,!0)))},[g.onCompositionUpdate,f]),onCompositionStart:C.useCallback(T=>{if(te.hasSelectableTarget(f,T.target)){var z;if((z=N.current)===null||z===void 0||z.handleCompositionStart(T),it(T,g.onCompositionStart)||ot)return;v(!0);var{selection:R}=f;if(R&&K.isExpanded(R)){y.deleteFragment(f);return}}},[g.onCompositionStart,f]),onCopy:C.useCallback(T=>{te.hasSelectableTarget(f,T.target)&&!it(T,g.onCopy)&&!Nl(T)&&(T.preventDefault(),te.setFragmentData(f,T.clipboardData,"copy"))},[g.onCopy,f]),onCut:C.useCallback(T=>{if(!s&&te.hasSelectableTarget(f,T.target)&&!it(T,g.onCut)&&!Nl(T)){T.preventDefault(),te.setFragmentData(f,T.clipboardData,"cut");var{selection:z}=f;if(z)if(K.isExpanded(z))y.deleteFragment(f);else{var R=ue.parent(f,z.anchor.path);y.isVoid(f,R)&&J.delete(f)}}},[s,f,g.onCut]),onDragOver:C.useCallback(T=>{if(te.hasTarget(f,T.target)&&!it(T,g.onDragOver)){var z=te.toSlateNode(f,T.target);de.isElement(z)&&y.isVoid(f,z)&&T.preventDefault()}},[g.onDragOver,f]),onDragStart:C.useCallback(T=>{if(!s&&te.hasTarget(f,T.target)&&!it(T,g.onDragStart)){var z=te.toSlateNode(f,T.target),R=te.findPath(f,z),H=de.isElement(z)&&y.isVoid(f,z)||y.void(f,{at:R,voids:!0});if(H){var re=y.range(f,R);J.select(f,re)}$.isDraggingInternally=!0,te.setFragmentData(f,T.dataTransfer,"drag")}},[s,f,g.onDragStart,$]),onDrop:C.useCallback(T=>{if(!s&&te.hasTarget(f,T.target)&&!it(T,g.onDrop)){T.preventDefault();var z=f.selection,R=te.findEventRange(f,T),H=T.dataTransfer;J.select(f,R),$.isDraggingInternally&&z&&!K.equals(z,R)&&!y.void(f,{at:R,voids:!0})&&J.delete(f,{at:z}),te.insertData(f,H),te.isFocused(f)||te.focus(f)}$.isDraggingInternally=!1},[s,f,g.onDrop,$]),onDragEnd:C.useCallback(T=>{!s&&$.isDraggingInternally&&g.onDragEnd&&te.hasTarget(f,T.target)&&g.onDragEnd(T),$.isDraggingInternally=!1},[s,$,g,f]),onFocus:C.useCallback(T=>{if(!s&&!$.isUpdatingSelection&&te.hasEditableTarget(f,T.target)&&!it(T,g.onFocus)){var z=te.toDOMNode(f,f),R=te.findDocumentOrShadowRoot(f);if($.latestElement=R.activeElement,Hn&&T.target!==z){z.focus();return}on.set(f,!0)}},[s,$,f,g.onFocus]),onKeyDown:C.useCallback(T=>{if(!s&&te.hasEditableTarget(f,T.target)){var z;(z=N.current)===null||z===void 0||z.handleKeyDown(T);var{nativeEvent:R}=T;if(te.isComposing(f)&&R.isComposing===!1&&(bn.set(f,!1),v(!1)),it(T,g.onKeyDown)||te.isComposing(f))return;var{selection:H}=f,re=f.children[H!==null?H.focus.path[0]:0],X=Gd(ue.string(re))==="rtl";if(Ve.isRedo(R)){T.preventDefault();var ne=f;typeof ne.redo=="function"&&ne.redo();return}if(Ve.isUndo(R)){T.preventDefault();var le=f;typeof le.undo=="function"&&le.undo();return}if(Ve.isMoveLineBackward(R)){T.preventDefault(),J.move(f,{unit:"line",reverse:!0});return}if(Ve.isMoveLineForward(R)){T.preventDefault(),J.move(f,{unit:"line"});return}if(Ve.isExtendLineBackward(R)){T.preventDefault(),J.move(f,{unit:"line",edge:"focus",reverse:!0});return}if(Ve.isExtendLineForward(R)){T.preventDefault(),J.move(f,{unit:"line",edge:"focus"});return}if(Ve.isMoveBackward(R)){T.preventDefault(),H&&K.isCollapsed(H)?J.move(f,{reverse:!X}):J.collapse(f,{edge:X?"end":"start"});return}if(Ve.isMoveForward(R)){T.preventDefault(),H&&K.isCollapsed(H)?J.move(f,{reverse:X}):J.collapse(f,{edge:X?"start":"end"});return}if(Ve.isMoveWordBackward(R)){T.preventDefault(),H&&K.isExpanded(H)&&J.collapse(f,{edge:"focus"}),J.move(f,{unit:"word",reverse:!X});return}if(Ve.isMoveWordForward(R)){T.preventDefault(),H&&K.isExpanded(H)&&J.collapse(f,{edge:"focus"}),J.move(f,{unit:"word",reverse:X});return}if(en){if((hf||Cr)&&H&&(Ve.isDeleteBackward(R)||Ve.isDeleteForward(R))&&K.isCollapsed(H)){var ee=ue.parent(f,H.anchor.path);if(de.isElement(ee)&&y.isVoid(f,ee)&&(y.isInline(f,ee)||y.isBlock(f,ee))){T.preventDefault(),y.deleteBackward(f,{unit:"block"});return}}}else{if(Ve.isBold(R)||Ve.isItalic(R)||Ve.isTransposeCharacter(R)){T.preventDefault();return}if(Ve.isSoftBreak(R)){T.preventDefault(),y.insertSoftBreak(f);return}if(Ve.isSplitBlock(R)){T.preventDefault(),y.insertBreak(f);return}if(Ve.isDeleteBackward(R)){T.preventDefault(),H&&K.isExpanded(H)?y.deleteFragment(f,{direction:"backward"}):y.deleteBackward(f);return}if(Ve.isDeleteForward(R)){T.preventDefault(),H&&K.isExpanded(H)?y.deleteFragment(f,{direction:"forward"}):y.deleteForward(f);return}if(Ve.isDeleteLineBackward(R)){T.preventDefault(),H&&K.isExpanded(H)?y.deleteFragment(f,{direction:"backward"}):y.deleteBackward(f,{unit:"line"});return}if(Ve.isDeleteLineForward(R)){T.preventDefault(),H&&K.isExpanded(H)?y.deleteFragment(f,{direction:"forward"}):y.deleteForward(f,{unit:"line"});return}if(Ve.isDeleteWordBackward(R)){T.preventDefault(),H&&K.isExpanded(H)?y.deleteFragment(f,{direction:"backward"}):y.deleteBackward(f,{unit:"word"});return}if(Ve.isDeleteWordForward(R)){T.preventDefault(),H&&K.isExpanded(H)?y.deleteFragment(f,{direction:"forward"}):y.deleteForward(f,{unit:"word"});return}}}},[s,f,g.onKeyDown]),onPaste:C.useCallback(T=>{!s&&te.hasEditableTarget(f,T.target)&&!it(T,g.onPaste)&&(!en||Gy(T.nativeEvent)||Cr)&&(T.preventDefault(),te.insertData(f,T.clipboardData))},[s,f,g.onPaste])}),C.createElement(Q1,{decorations:I,node:f,renderElement:o,renderPlaceholder:u,renderLeaf:l,selection:f.selection})))))},X1=e=>{var{attributes:t,children:n}=e;return C.createElement("span",Ot({},t),n,ot&&C.createElement("br",null))},eC=()=>[],tC=(e,t)=>{if(t.getBoundingClientRect&&(!e.selection||e.selection&&K.isCollapsed(e.selection))){var n=t.startContainer.parentElement;n.getBoundingClientRect=t.getBoundingClientRect.bind(t),fy(n,{scrollMode:"if-needed"}),delete n.getBoundingClientRect}},it=(e,t)=>{if(!t)return!1;var n=t(e);return n??(e.isDefaultPrevented()||e.isPropagationStopped())},Nl=e=>un(e.target)&&(e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement),nC=(e,t)=>{if(!t)return!1;var n=t(e);return n??e.defaultPrevented},rC=C.createContext(!1),aC=C.createContext({});function iC(e){var t=C.useRef([]).current,n=C.useRef({editor:e}).current,r=C.useCallback(i=>{n.editor=i,t.forEach(s=>s(i))},[t,n]),a=C.useMemo(()=>({getSlate:()=>n.editor,addEventListener:i=>(t.push(i),()=>{t.splice(t.indexOf(i),1)})}),[t,n]);return{selectorContext:a,onChange:r}}var sC=["editor","children","onChange","onSelectionChange","onValueChange","initialValue"],oC=e=>{var{editor:t,children:n,onChange:r,onSelectionChange:a,onValueChange:i,initialValue:s}=e,o=er(e,sC),[l,u]=C.useState(()=>{if(!ue.isNodeList(s))throw new Error("[Slate] initialValue is invalid! Expected a list of elements but got: ".concat(Xe.stringify(s)));if(!y.isEditor(t))throw new Error("[Slate] editor is invalid! You passed: ".concat(Xe.stringify(t)));return t.children=s,Object.assign(t,o),{v:0,editor:t}}),{selectorContext:c,onChange:h}=iC(t),p=C.useCallback(f=>{var b;switch(r&&r(t.children),f==null||(b=f.operation)===null||b===void 0?void 0:b.type){case"set_selection":a==null||a(t.selection);break;default:i==null||i(t.children)}u(v=>({v:v.v+1,editor:t})),h(t)},[t,h,r,a,i]);C.useEffect(()=>(Ts.set(t,p),()=>{Ts.set(t,()=>{})}),[t,p]);var[m,g]=C.useState(te.isFocused(t));return C.useEffect(()=>{g(te.isFocused(t))},[t]),Ir(()=>{var f=()=>g(te.isFocused(t));return ff>=17?(document.addEventListener("focusin",f),document.addEventListener("focusout",f),()=>{document.removeEventListener("focusin",f),document.removeEventListener("focusout",f)}):(document.addEventListener("focus",f,!0),document.addEventListener("blur",f,!0),()=>{document.removeEventListener("focus",f,!0),document.removeEventListener("blur",f,!0)})},[]),C.createElement(aC.Provider,{value:c},C.createElement(Bf.Provider,{value:l},C.createElement(yo.Provider,{value:l.editor},C.createElement(rC.Provider,{value:m},n))))},Rl=(e,t)=>{var n=(t.top+t.bottom)/2;return e.top<=n&&e.bottom>=n},Ml=(e,t,n)=>{var r=te.toDOMRange(e,t).getBoundingClientRect(),a=te.toDOMRange(e,n).getBoundingClientRect();return Rl(r,a)&&Rl(a,r)},uC=(e,t)=>{var n=y.range(e,K.end(t)),r=Array.from(y.positions(e,{at:t})),a=0,i=r.length,s=Math.floor(i/2);if(Ml(e,y.range(e,r[a]),n))return y.range(e,r[a],n);if(r.length<2)return y.range(e,r[r.length-1],n);for(;s!==r.length&&s!==a;)Ml(e,y.range(e,r[s]),n)?i=s:a=s,s=Math.floor((a+i)/2);return y.range(e,r[i],n)};function Il(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function $l(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Il(Object(n),!0).forEach(function(r){Et(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Il(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var lC=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"x-slate-fragment",r=t,{apply:a,onChange:i,deleteBackward:s,addMark:o,removeMark:l}=r;return ii.set(r,new WeakMap),r.addMark=(u,c)=>{var h,p;(h=xo.get(r))===null||h===void 0||h(),!Bt.get(r)&&(p=ct.get(r))!==null&&p!==void 0&&p.length&&Bt.set(r,null),Kt.delete(r),o(u,c)},r.removeMark=u=>{var c;!Bt.get(r)&&(c=ct.get(r))!==null&&c!==void 0&&c.length&&Bt.set(r,null),Kt.delete(r),l(u)},r.deleteBackward=u=>{if(u!=="line")return s(u);if(r.selection&&K.isCollapsed(r.selection)){var c=y.above(r,{match:g=>de.isElement(g)&&y.isBlock(r,g),at:r.selection});if(c){var[,h]=c,p=y.range(r,h,r.selection.anchor),m=uC(r,p);K.isCollapsed(m)||J.delete(r,{at:m})}}},r.apply=u=>{var c=[],h=[],p=ct.get(r);if(p!=null&&p.length){var m=p.map(j=>l1(j,u)).filter(Boolean);ct.set(r,m)}var g=rn.get(r);g&&rn.set(r,kl(r,g,u));var f=nn.get(r);if(f!=null&&f.at){var b=Ee.isPoint(f==null?void 0:f.at)?Os(r,f.at,u):kl(r,f.at,u);nn.set(r,b?$l($l({},f),{},{at:b}):null)}switch(u.type){case"insert_text":case"remove_text":case"set_node":case"split_node":{c.push(...In(r,u.path));break}case"set_selection":{var v;(v=Er.get(r))===null||v===void 0||v.unref(),Er.delete(r);break}case"insert_node":case"remove_node":{c.push(...In(r,P.parent(u.path)));break}case"merge_node":{var E=P.previous(u.path);c.push(...In(r,E));break}case"move_node":{var k=P.common(P.parent(u.path),P.parent(u.newPath));c.push(...In(r,k));var x;P.isBefore(u.path,u.newPath)?(c.push(...In(r,P.parent(u.path))),x=u.newPath):(c.push(...In(r,P.parent(u.newPath))),x=u.path);var w=ue.get(t,P.parent(x)),A=te.findKey(r,w),S=y.pathRef(r,P.parent(x));h.push([S,A]);break}}a(u);for(var[q,$]of c){var[N]=y.node(r,q);Ia.set(N,$)}for(var[L,_]of h)if(L.current){var[B]=y.node(r,L.current);Ia.set(B,_)}},r.setFragmentData=u=>{var{selection:c}=r;if(c){var[h,p]=K.edges(c),m=y.void(r,{at:h.path}),g=y.void(r,{at:p.path});if(!(K.isCollapsed(c)&&!m)){var f=te.toDOMRange(r,c),b=f.cloneContents(),v=b.childNodes[0];if(b.childNodes.forEach(N=>{N.textContent&&N.textContent.trim()!==""&&(v=N)}),g){var[E]=g,k=f.cloneRange(),x=te.toDOMNode(r,E);k.setEndAfter(x),b=k.cloneContents()}if(m&&(v=b.querySelector("[data-slate-spacer]")),Array.from(b.querySelectorAll("[data-slate-zero-width]")).forEach(N=>{var L=N.getAttribute("data-slate-zero-width")==="n";N.textContent=L?`
139
+ `:""}),vf(v)){var w=v.ownerDocument.createElement("span");w.style.whiteSpace="pre",w.appendChild(v),b.appendChild(w),v=w}var A=r.getFragment(),S=JSON.stringify(A),q=window.btoa(encodeURIComponent(S));v.setAttribute("data-slate-fragment",q),u.setData("application/".concat(n),q);var $=b.ownerDocument.createElement("div");return $.appendChild(b),$.setAttribute("hidden","true"),b.ownerDocument.body.appendChild($),u.setData("text/html",$.innerHTML),u.setData("text/plain",yf($)),b.ownerDocument.body.removeChild($),u}}},r.insertData=u=>{r.insertFragmentData(u)||r.insertTextData(u)},r.insertFragmentData=u=>{var c=u.getData("application/".concat(n))||t1(u);if(c){var h=decodeURIComponent(window.atob(c)),p=JSON.parse(h);return r.insertFragment(p),!0}return!1},r.insertTextData=u=>{var c=u.getData("text/plain");if(c){var h=c.split(/\r\n|\r|\n/),p=!1;for(var m of h)p&&J.splitNodes(r,{always:!0}),r.insertText(m),p=!0;return!0}return!1},r.onChange=u=>{var c=ff<18?Fc.unstable_batchedUpdates:h=>h();c(()=>{var h=Ts.get(r);h&&h(u),i(u)})},r},In=(e,t)=>{var n=[];for(var[r,a]of y.levels(e,{at:t})){var i=te.findKey(e,r);n.push([a,i])}return n};const cC={id:"",tabbableOption:"",setFocus:()=>{},openTooltip:null,showLinkEditor:!1,mentionPopover:{show:!1,selectedUser:0,possibleUsers:[],position:null,numberOfUsers:null},lastAnchor:null,isInOverlay:!1,dispatch:()=>{},onMention:()=>{},reportError:e=>{console.error(e)}},Xt=C.createContext(cC);var Z=(e=>(e.blockquote="block_quote",e.bold="bold",e.code="code",e.codeblock="code_block",e.heading="heading",e.hr="thematic_break",e.image="image",e.italic="italic",e.li="list_item",e.link="link",e.mention="mention",e.ol="ol_list",e.paragraph="paragraph",e.ul="ul_list",e.strikethrough="strikeThrough",e.span="span",e))(Z||{}),Mt=(e=>(e.delete="delete_mark",e.emphasis="emphasis_mark",e.code="inline_code_mark",e.strong="strong_mark",e))(Mt||{});const dC=({attributes:e,children:t,element:n})=>{const r=n;switch(r.type){case Z.blockquote:return d.jsx("blockquote",{className:"subtle",...e,children:t});case Z.link:return d.jsx("a",{...e,children:t});case Z.li:return d.jsx("li",{...e,children:t});case Z.mention:const a=r;return d.jsxs("a",{...e,className:"mention",children:["@",(a==null?void 0:a.name)||"",t]});case Z.ol:return d.jsx("ol",{...e,children:t});case Z.ul:return d.jsx("ul",{...e,children:t});case Z.span:return d.jsx("span",{...e,children:t});case Z.paragraph:return d.jsx("p",{...e,children:t});default:return d.jsx("span",{...e,children:t})}},fC=({attributes:e,children:t,leaf:n})=>{const r=n;return r[Z.bold]&&(t=d.jsx("strong",{children:t})),r[Z.italic]&&(t=d.jsx("em",{children:t})),r[Z.strikethrough]&&(t=d.jsx("s",{children:t})),d.jsx("span",{...e,children:t})},Ns="MENTION: ",Tf={anchor:{offset:0,path:[0,0]},focus:{offset:0,path:[0,0]}},Ll={"mention-popover":35,default:-52},Ii=16,Sf=(e,t,n)=>{const r=C.useRef(null),{showLinkEditor:a,mentionPopover:i}=C.useContext(Xt),s=t==="link-editor"?a:i.show,o=[s];return e&&t==="link-editor"&&o.push(e.selection),C.useEffect(()=>{var m,g;if(!(r!=null&&r.current)||!s)return;const l=r==null?void 0:r.current;if(!l)return;let u,c=0;if(t==="mention-popover"){const{position:f}=i,b=k=>{if(!y.hasPath(e,k.path))return!1;const x=ue.get(e,k.path);return y.isEditor(x)||de.isElement(x)?k.offset<=x.children.length:fe.isText(x)?k.offset<=x.text.length:!1};if(f&&(!b(f==null?void 0:f.anchor)||!b(f==null?void 0:f.focus)))return;u=te.toDOMRange(e,f||Tf).getBoundingClientRect();const E=(m=document.getElementById(n))==null?void 0:m.getBoundingClientRect();l.style.setProperty("--width",`${((E==null?void 0:E.width)||0)/Ii}rem`),c=(E==null?void 0:E.left)||0}else{const f=document.getSelection();f!=null&&f.toString().trim().length&&(u=f==null?void 0:f.getRangeAt(0).getBoundingClientRect())}u||(u=(g=document.getElementById(n))==null?void 0:g.getBoundingClientRect());const h=Ll[t]||Ll.default,p=((u==null?void 0:u.top)||0)+window.scrollY+h;c===0&&(c=Math.max(((u==null?void 0:u.left)||0)-(l.offsetWidth-((u==null?void 0:u.width)||0)),0)),l.style.top=`${p/Ii}rem`,l.style.left=`${c/Ii}rem`},o),r},hC=e=>{const[t,n]=C.useState(null);return C.useEffect(()=>{const{selection:r}=e;if(!r){n(null);return}const[a]=y.nodes(e,{at:r,match:i=>i.type===Z.link});if(a){const i=a[0],s=Vc(i.link),o=i.children[0],l=(o==null?void 0:o.text)||"";n({...s,text:l})}else n(null)},[e,e.selection]),t};var st=(e=>(e.paragraph="paragraph",e.heading="heading",e.list="list",e.listItem="listItem",e.link="link",e.mention="mention",e.image="image",e.blockquote="blockquote",e.code="code",e.html="html",e.emphasis="emphasis",e.strong="strong",e.delete="delete",e.inlineCode="inlineCode",e.thematicBreak="thematicBreak",e.text="text",e))(st||{});const Vn={[Z.paragraph]:Z.paragraph,[Z.blockquote]:Z.blockquote,[Z.codeblock]:Z.codeblock,[Z.link]:Z.link,[Z.ul]:Z.ul,[Z.ol]:Z.ol,[Z.li]:Z.li,[Z.mention]:Z.mention,[Z.heading]:{1:"heading_one",2:"heading_two",3:"heading_three",4:"heading_four",5:"heading_five",6:"heading_six"},[Mt.emphasis]:Z.italic,[Mt.strong]:Z.bold,[Mt.delete]:Z.strikethrough,[Mt.code]:Z.code,[Z.hr]:Z.hr,[Z.image]:Z.image};function zl(e){if(e)throw e}var wa=Object.prototype.hasOwnProperty,jf=Object.prototype.toString,ql=Object.defineProperty,Wl=Object.getOwnPropertyDescriptor,Ul=function(t){return typeof Array.isArray=="function"?Array.isArray(t):jf.call(t)==="[object Array]"},Hl=function(t){if(!t||jf.call(t)!=="[object Object]")return!1;var n=wa.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&wa.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var a;for(a in t);return typeof a>"u"||wa.call(t,a)},Vl=function(t,n){ql&&n.name==="__proto__"?ql(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Kl=function(t,n){if(n==="__proto__")if(wa.call(t,n)){if(Wl)return Wl(t,n).value}else return;return t[n]},mC=function e(){var t,n,r,a,i,s,o=arguments[0],l=1,u=arguments.length,c=!1;for(typeof o=="boolean"&&(c=o,o=arguments[1]||{},l=2),(o==null||typeof o!="object"&&typeof o!="function")&&(o={});l<u;++l)if(t=arguments[l],t!=null)for(n in t)r=Kl(o,n),a=Kl(t,n),o!==a&&(c&&a&&(Hl(a)||(i=Ul(a)))?(i?(i=!1,s=r&&Ul(r)?r:[]):s=r&&Hl(r)?r:{},Vl(o,{name:n,newValue:e(c,s,a)})):typeof a<"u"&&Vl(o,{name:n,newValue:a}));return o};const $i=Tn(mC);function Rs(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function pC(){const e=[],t={run:n,use:r};return t;function n(...a){let i=-1;const s=a.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);o(null,...a);function o(l,...u){const c=e[++i];let h=-1;if(l){s(l);return}for(;++h<a.length;)(u[h]===null||u[h]===void 0)&&(u[h]=a[h]);a=u,c?gC(c,o)(...u):s(null,...u)}}function r(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),t}}function gC(e,t){let n;return r;function r(...s){const o=e.length>s.length;let l;o&&s.push(a);try{l=e.apply(this,s)}catch(u){const c=u;if(o&&n)throw c;return a(c)}o||(l&&l.then&&typeof l.then=="function"?l.then(i,a):l instanceof Error?a(l):i(l))}function a(s,...o){n||(n=!0,t(s,...o))}function i(s){a(null,s)}}function _r(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Zl(e.position):"start"in e||"end"in e?Zl(e):"line"in e||"column"in e?Ms(e):""}function Ms(e){return Yl(e&&e.line)+":"+Yl(e&&e.column)}function Zl(e){return Ms(e&&e.start)+"-"+Ms(e&&e.end)}function Yl(e){return e&&typeof e=="number"?e:1}class ht extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let a="",i={},s=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?a=t:!i.cause&&t&&(s=!0,a=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?i.ruleId=r:(i.source=r.slice(0,l),i.ruleId=r.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const o=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file,this.message=a,this.line=o?o.line:void 0,this.name=_r(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=s&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual,this.expected,this.note,this.url}}ht.prototype.file="";ht.prototype.name="";ht.prototype.reason="";ht.prototype.message="";ht.prototype.stack="";ht.prototype.column=void 0;ht.prototype.line=void 0;ht.prototype.ancestors=void 0;ht.prototype.cause=void 0;ht.prototype.fatal=void 0;ht.prototype.place=void 0;ht.prototype.ruleId=void 0;ht.prototype.source=void 0;const Pt={basename:vC,dirname:bC,extname:yC,join:CC,sep:"/"};function vC(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');qr(e);let n=0,r=-1,a=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(i){n=a+1;break}}else r<0&&(i=!0,r=a+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,o=t.length-1;for(;a--;)if(e.codePointAt(a)===47){if(i){n=a+1;break}}else s<0&&(i=!0,s=a+1),o>-1&&(e.codePointAt(a)===t.codePointAt(o--)?o<0&&(r=a):(o=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function bC(e){if(qr(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function yC(e){qr(e);let t=e.length,n=-1,r=0,a=-1,i=0,s;for(;t--;){const o=e.codePointAt(t);if(o===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),o===46?a<0?a=t:i!==1&&(i=1):a>-1&&(i=-1)}return a<0||n<0||i===0||i===1&&a===n-1&&a===r+1?"":e.slice(a,n)}function CC(...e){let t=-1,n;for(;++t<e.length;)qr(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":DC(n)}function DC(e){qr(e);const t=e.codePointAt(0)===47;let n=xC(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function xC(e,t){let n="",r=0,a=-1,i=0,s=-1,o,l;for(;++s<=e.length;){if(s<e.length)o=e.codePointAt(s);else{if(o===47)break;o=47}if(o===47){if(!(a===s-1||i===1))if(a!==s-1&&i===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),a=s,i=0;continue}}else if(n.length>0){n="",r=0,a=s,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(a+1,s):n=e.slice(a+1,s),r=s-a-1;a=s,i=0}else o===46&&i>-1?i++:i=-1}return n}function qr(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const wC={cwd:EC};function EC(){return"/"}function Is(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function _C(e){if(typeof e=="string")e=new URL(e);else if(!Is(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return kC(e)}function kC(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const a=new TypeError("File URL path must not include encoded / characters");throw a.code="ERR_INVALID_FILE_URL_PATH",a}}return decodeURIComponent(t)}const Li=["history","path","basename","stem","extname","dirname"];class FC{constructor(t){let n;t?Is(t)?n={path:t}:typeof t=="string"||BC(t)?n={value:t}:n=t:n={},this.cwd=wC.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Li.length;){const i=Li[r];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let a;for(a in n)Li.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?Pt.basename(this.path):void 0}set basename(t){qi(t,"basename"),zi(t,"basename"),this.path=Pt.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Pt.dirname(this.path):void 0}set dirname(t){Gl(this.basename,"dirname"),this.path=Pt.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Pt.extname(this.path):void 0}set extname(t){if(zi(t,"extname"),Gl(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Pt.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Is(t)&&(t=_C(t)),qi(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Pt.basename(this.path,this.extname):void 0}set stem(t){qi(t,"stem"),zi(t,"stem"),this.path=Pt.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const a=this.message(t,n,r);throw a.fatal=!0,a}info(t,n,r){const a=this.message(t,n,r);return a.fatal=void 0,a}message(t,n,r){const a=new ht(t,n,r);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function zi(e,t){if(e&&e.includes(Pt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Pt.sep+"`")}function qi(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Gl(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function BC(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const AC=function(e){const r=this.constructor.prototype,a=r[e],i=function(){return a.apply(i,arguments)};Object.setPrototypeOf(i,r);const s=Object.getOwnPropertyNames(a);for(const o of s){const l=Object.getOwnPropertyDescriptor(a,o);l&&Object.defineProperty(i,o,l)}return i},TC={}.hasOwnProperty;class _o extends AC{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=pC()}copy(){const t=new _o;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data($i(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Hi("data",this.frozen),this.namespace[t]=n,this):TC.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Hi("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const a=n.call(t,...r);typeof a=="function"&&this.transformers.use(a)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=la(t),r=this.parser||this.Parser;return Wi("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Wi("process",this.parser||this.Parser),Ui("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(i,s){const o=la(t),l=r.parse(o);r.run(l,o,function(c,h,p){if(c||!h||!p)return u(c);const m=h,g=r.stringify(m,p);OC(g)?p.value=g:p.result=g,u(c,p)});function u(c,h){c||!h?s(c):i?i(h):n(void 0,h)}}}processSync(t){let n=!1,r;return this.freeze(),Wi("processSync",this.parser||this.Parser),Ui("processSync",this.compiler||this.Compiler),this.process(t,a),Jl("processSync","process",n),r;function a(i,s){n=!0,zl(i),r=s}}run(t,n,r){Ql(t),this.freeze();const a=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?i(void 0,r):new Promise(i);function i(s,o){const l=la(n);a.run(t,l,u);function u(c,h,p){const m=h||t;c?o(c):s?s(m):r(void 0,m,p)}}}runSync(t,n){let r=!1,a;return this.run(t,n,i),Jl("runSync","run",r),a;function i(s,o){zl(s),a=o,r=!0}}stringify(t,n){this.freeze();const r=la(n),a=this.compiler||this.Compiler;return Ui("stringify",a),Ql(t),a(t,r)}use(t,...n){const r=this.attachers,a=this.namespace;if(Hi("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?o(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(u){if(typeof u=="function")l(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[c,...h]=u;l(c,h)}else s(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function s(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(u.plugins),u.settings&&(a.settings=$i(!0,a.settings,u.settings))}function o(u){let c=-1;if(u!=null)if(Array.isArray(u))for(;++c<u.length;){const h=u[c];i(h)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function l(u,c){let h=-1,p=-1;for(;++h<r.length;)if(r[h][0]===u){p=h;break}if(p===-1)r.push([u,...c]);else if(c.length>0){let[m,...g]=c;const f=r[p][1];Rs(f)&&Rs(m)&&(m=$i(!0,f,m)),r[p]=[u,m,...g]}}}}const SC=new _o().freeze();function Wi(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Ui(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Hi(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Ql(e){if(!Rs(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Jl(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function la(e){return jC(e)?e:new FC(e)}function jC(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function OC(e){return typeof e=="string"||PC(e)}function PC(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const NC={};function RC(e,t){const n=t||NC,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Of(e,r,a)}function Of(e,t,n){if(MC(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Xl(e.children,t,n)}return Array.isArray(e)?Xl(e,t,n):""}function Xl(e,t,n){const r=[];let a=-1;for(;++a<e.length;)r[a]=Of(e[a],t,n);return r.join("")}function MC(e){return!!(e&&typeof e=="object")}const ec=document.createElement("i");function ko(e){const t="&"+e+";";ec.innerHTML=t;const n=ec.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Yt(e,t,n,r){const a=e.length;let i=0,s;if(t<0?t=-t>a?0:a+t:t=t>a?a:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);i<r.length;)s=r.slice(i,i+1e4),s.unshift(t,0),e.splice(...s),i+=1e4,t+=1e4}function xt(e,t){return e.length>0?(Yt(e,e.length,0,t),e):t}const tc={}.hasOwnProperty;function IC(e){const t={};let n=-1;for(;++n<e.length;)$C(t,e[n]);return t}function $C(e,t){let n;for(n in t){const a=(tc.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let s;if(i)for(s in i){tc.call(a,s)||(a[s]=[]);const o=i[s];LC(a[s],Array.isArray(o)?o:o?[o]:[])}}}function LC(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Yt(e,0,0,r)}function Pf(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Yn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Rt=hn(/[A-Za-z]/),At=hn(/[\dA-Za-z]/),zC=hn(/[#-'*+\--9=?A-Z^-~]/);function $s(e){return e!==null&&(e<32||e===127)}const Ls=hn(/\d/),qC=hn(/[\dA-Fa-f]/),WC=hn(/[!-/:-@[-`{-~]/);function Ce(e){return e!==null&&e<-2}function ft(e){return e!==null&&(e<0||e===32)}function Pe(e){return e===-2||e===-1||e===32}const UC=hn(/\p{P}|\p{S}/u),HC=hn(/\s/);function hn(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function ze(e,t,n,r){const a=r?r-1:Number.POSITIVE_INFINITY;let i=0;return s;function s(l){return Pe(l)?(e.enter(n),o(l)):t(l)}function o(l){return Pe(l)&&i++<a?(e.consume(l),o):(e.exit(n),t(l))}}const VC={tokenize:KC};function KC(e){const t=e.attempt(this.parser.constructs.contentInitial,r,a);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),ze(e,t,"linePrefix")}function a(o){return e.enter("paragraph"),i(o)}function i(o){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,s(o)}function s(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return Ce(o)?(e.consume(o),e.exit("chunkText"),i):(e.consume(o),s)}}const ZC={tokenize:YC},nc={tokenize:GC};function YC(e){const t=this,n=[];let r=0,a,i,s;return o;function o(k){if(r<n.length){const x=n[r];return t.containerState=x[1],e.attempt(x[0].continuation,l,u)(k)}return u(k)}function l(k){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&E();const x=t.events.length;let w=x,A;for(;w--;)if(t.events[w][0]==="exit"&&t.events[w][1].type==="chunkFlow"){A=t.events[w][1].end;break}v(r);let S=x;for(;S<t.events.length;)t.events[S][1].end=Object.assign({},A),S++;return Yt(t.events,w+1,0,t.events.slice(x)),t.events.length=S,u(k)}return o(k)}function u(k){if(r===n.length){if(!a)return p(k);if(a.currentConstruct&&a.currentConstruct.concrete)return g(k);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(nc,c,h)(k)}function c(k){return a&&E(),v(r),p(k)}function h(k){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,g(k)}function p(k){return t.containerState={},e.attempt(nc,m,g)(k)}function m(k){return r++,n.push([t.currentConstruct,t.containerState]),p(k)}function g(k){if(k===null){a&&E(),v(0),e.consume(k);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{contentType:"flow",previous:i,_tokenizer:a}),f(k)}function f(k){if(k===null){b(e.exit("chunkFlow"),!0),v(0),e.consume(k);return}return Ce(k)?(e.consume(k),b(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(k),f)}function b(k,x){const w=t.sliceStream(k);if(x&&w.push(null),k.previous=i,i&&(i.next=k),i=k,a.defineSkip(k.start),a.write(w),t.parser.lazy[k.start.line]){let A=a.events.length;for(;A--;)if(a.events[A][1].start.offset<s&&(!a.events[A][1].end||a.events[A][1].end.offset>s))return;const S=t.events.length;let q=S,$,N;for(;q--;)if(t.events[q][0]==="exit"&&t.events[q][1].type==="chunkFlow"){if($){N=t.events[q][1].end;break}$=!0}for(v(r),A=S;A<t.events.length;)t.events[A][1].end=Object.assign({},N),A++;Yt(t.events,q+1,0,t.events.slice(S)),t.events.length=A}}function v(k){let x=n.length;for(;x-- >k;){const w=n[x];t.containerState=w[1],w[0].exit.call(t,e)}n.length=k}function E(){a.write([null]),i=void 0,a=void 0,t.containerState._closeFlow=void 0}}function GC(e,t,n){return ze(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function rc(e){if(e===null||ft(e)||HC(e))return 1;if(UC(e))return 2}function Fo(e,t,n){const r=[];let a=-1;for(;++a<e.length;){const i=e[a].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const zs={name:"attention",tokenize:JC,resolveAll:QC};function QC(e,t){let n=-1,r,a,i,s,o,l,u,c;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const h=Object.assign({},e[r][1].end),p=Object.assign({},e[n][1].start);ac(h,-l),ac(p,l),s={type:l>1?"strongSequence":"emphasisSequence",start:h,end:Object.assign({},e[r][1].end)},o={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:p},i={type:l>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},a={type:l>1?"strong":"emphasis",start:Object.assign({},s.start),end:Object.assign({},o.end)},e[r][1].end=Object.assign({},s.start),e[n][1].start=Object.assign({},o.end),u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=xt(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=xt(u,[["enter",a,t],["enter",s,t],["exit",s,t],["enter",i,t]]),u=xt(u,Fo(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=xt(u,[["exit",i,t],["enter",o,t],["exit",o,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,u=xt(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,Yt(e,r-1,n-r+3,u),n=r+u.length-c-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function JC(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,a=rc(r);let i;return s;function s(l){return i=l,e.enter("attentionSequence"),o(l)}function o(l){if(l===i)return e.consume(l),o;const u=e.exit("attentionSequence"),c=rc(l),h=!c||c===2&&a||n.includes(l),p=!a||a===2&&c||n.includes(r);return u._open=!!(i===42?h:h&&(a||!p)),u._close=!!(i===42?p:p&&(c||!h)),t(l)}}function ac(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const XC={name:"autolink",tokenize:eD};function eD(e,t,n){let r=0;return a;function a(m){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(m){return Rt(m)?(e.consume(m),s):m===64?n(m):u(m)}function s(m){return m===43||m===45||m===46||At(m)?(r=1,o(m)):u(m)}function o(m){return m===58?(e.consume(m),r=0,l):(m===43||m===45||m===46||At(m))&&r++<32?(e.consume(m),o):(r=0,u(m))}function l(m){return m===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):m===null||m===32||m===60||$s(m)?n(m):(e.consume(m),l)}function u(m){return m===64?(e.consume(m),c):zC(m)?(e.consume(m),u):n(m)}function c(m){return At(m)?h(m):n(m)}function h(m){return m===46?(e.consume(m),r=0,c):m===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):p(m)}function p(m){if((m===45||At(m))&&r++<63){const g=m===45?p:h;return e.consume(m),g}return n(m)}}const si={tokenize:tD,partial:!0};function tD(e,t,n){return r;function r(i){return Pe(i)?ze(e,a,"linePrefix")(i):a(i)}function a(i){return i===null||Ce(i)?t(i):n(i)}}const Nf={name:"blockQuote",tokenize:nD,continuation:{tokenize:rD},exit:aD};function nD(e,t,n){const r=this;return a;function a(s){if(s===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),i}return n(s)}function i(s){return Pe(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function rD(e,t,n){const r=this;return a;function a(s){return Pe(s)?ze(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):i(s)}function i(s){return e.attempt(Nf,t,n)(s)}}function aD(e){e.exit("blockQuote")}const Rf={name:"characterEscape",tokenize:iD};function iD(e,t,n){return r;function r(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),a}function a(i){return WC(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const Mf={name:"characterReference",tokenize:sD};function sD(e,t,n){const r=this;let a=0,i,s;return o;function o(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),l}function l(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),i=31,s=At,c(h))}function u(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,s=qC,c):(e.enter("characterReferenceValue"),i=7,s=Ls,c(h))}function c(h){if(h===59&&a){const p=e.exit("characterReferenceValue");return s===At&&!ko(r.sliceSerialize(p))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(h)&&a++<i?(e.consume(h),c):n(h)}}const ic={tokenize:uD,partial:!0},sc={name:"codeFenced",tokenize:oD,concrete:!0};function oD(e,t,n){const r=this,a={tokenize:w,partial:!0};let i=0,s=0,o;return l;function l(A){return u(A)}function u(A){const S=r.events[r.events.length-1];return i=S&&S[1].type==="linePrefix"?S[2].sliceSerialize(S[1],!0).length:0,o=A,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(A)}function c(A){return A===o?(s++,e.consume(A),c):s<3?n(A):(e.exit("codeFencedFenceSequence"),Pe(A)?ze(e,h,"whitespace")(A):h(A))}function h(A){return A===null||Ce(A)?(e.exit("codeFencedFence"),r.interrupt?t(A):e.check(ic,f,x)(A)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(A))}function p(A){return A===null||Ce(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(A)):Pe(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ze(e,m,"whitespace")(A)):A===96&&A===o?n(A):(e.consume(A),p)}function m(A){return A===null||Ce(A)?h(A):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(A))}function g(A){return A===null||Ce(A)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(A)):A===96&&A===o?n(A):(e.consume(A),g)}function f(A){return e.attempt(a,x,b)(A)}function b(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),v}function v(A){return i>0&&Pe(A)?ze(e,E,"linePrefix",i+1)(A):E(A)}function E(A){return A===null||Ce(A)?e.check(ic,f,x)(A):(e.enter("codeFlowValue"),k(A))}function k(A){return A===null||Ce(A)?(e.exit("codeFlowValue"),E(A)):(e.consume(A),k)}function x(A){return e.exit("codeFenced"),t(A)}function w(A,S,q){let $=0;return N;function N(I){return A.enter("lineEnding"),A.consume(I),A.exit("lineEnding"),L}function L(I){return A.enter("codeFencedFence"),Pe(I)?ze(A,_,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):_(I)}function _(I){return I===o?(A.enter("codeFencedFenceSequence"),B(I)):q(I)}function B(I){return I===o?($++,A.consume(I),B):$>=s?(A.exit("codeFencedFenceSequence"),Pe(I)?ze(A,j,"whitespace")(I):j(I)):q(I)}function j(I){return I===null||Ce(I)?(A.exit("codeFencedFence"),S(I)):q(I)}}}function uD(e,t,n){const r=this;return a;function a(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i)}function i(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const Vi={name:"codeIndented",tokenize:cD},lD={tokenize:dD,partial:!0};function cD(e,t,n){const r=this;return a;function a(u){return e.enter("codeIndented"),ze(e,i,"linePrefix",4+1)(u)}function i(u){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?s(u):n(u)}function s(u){return u===null?l(u):Ce(u)?e.attempt(lD,s,l)(u):(e.enter("codeFlowValue"),o(u))}function o(u){return u===null||Ce(u)?(e.exit("codeFlowValue"),s(u)):(e.consume(u),o)}function l(u){return e.exit("codeIndented"),t(u)}}function dD(e,t,n){const r=this;return a;function a(s){return r.parser.lazy[r.now().line]?n(s):Ce(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a):ze(e,i,"linePrefix",4+1)(s)}function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(s):Ce(s)?a(s):n(s)}}const fD={name:"codeText",tokenize:pD,resolve:hD,previous:mD};function hD(e){let t=e.length-4,n=3,r,a;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)a===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(a=r):(r===t||e[r][1].type==="lineEnding")&&(e[a][1].type="codeTextData",r!==a+2&&(e[a][1].end=e[r-1][1].end,e.splice(a+2,r-a-2),t-=r-a-2,r=a+2),a=void 0);return e}function mD(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function pD(e,t,n){let r=0,a,i;return s;function s(h){return e.enter("codeText"),e.enter("codeTextSequence"),o(h)}function o(h){return h===96?(e.consume(h),r++,o):(e.exit("codeTextSequence"),l(h))}function l(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),l):h===96?(i=e.enter("codeTextSequence"),a=0,c(h)):Ce(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),l):(e.enter("codeTextData"),u(h))}function u(h){return h===null||h===32||h===96||Ce(h)?(e.exit("codeTextData"),l(h)):(e.consume(h),u)}function c(h){return h===96?(e.consume(h),a++,c):a===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(i.type="codeTextData",u(h))}}class gD{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const a=n||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return r&&vr(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),vr(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),vr(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);vr(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);vr(this.left,n.reverse())}}}function vr(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function If(e){const t={};let n=-1,r,a,i,s,o,l,u;const c=new gD(e);for(;++n<c.length;){for(;n in t;)n=t[n];if(r=c.get(n),n&&r[1].type==="chunkFlow"&&c.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,i=0,i<l.length&&l[i][1].type==="lineEndingBlank"&&(i+=2),i<l.length&&l[i][1].type==="content"))for(;++i<l.length&&l[i][1].type!=="content";)l[i][1].type==="chunkText"&&(l[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,vD(c,n)),n=t[n],u=!0);else if(r[1]._container){for(i=n,a=void 0;i--&&(s=c.get(i),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank");)s[0]==="enter"&&(a&&(c.get(a)[1].type="lineEndingBlank"),s[1].type="lineEnding",a=i);a&&(r[1].end=Object.assign({},c.get(a)[1].start),o=c.slice(a,n),o.unshift(r),c.splice(a,n-a+1,o))}}return Yt(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!u}function vD(e,t){const n=e.get(t)[1],r=e.get(t)[2];let a=t-1;const i=[],s=n._tokenizer||r.parser[n.contentType](n.start),o=s.events,l=[],u={};let c,h,p=-1,m=n,g=0,f=0;const b=[f];for(;m;){for(;e.get(++a)[1]!==m;);i.push(a),m._tokenizer||(c=r.sliceStream(m),m.next||c.push(null),h&&s.defineSkip(m.start),m._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(c),m._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),h=m,m=m.next}for(m=n;++p<o.length;)o[p][0]==="exit"&&o[p-1][0]==="enter"&&o[p][1].type===o[p-1][1].type&&o[p][1].start.line!==o[p][1].end.line&&(f=p+1,b.push(f),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(s.events=[],m?(m._tokenizer=void 0,m.previous=void 0):b.pop(),p=b.length;p--;){const v=o.slice(b[p],b[p+1]),E=i.pop();l.push([E,E+v.length-1]),e.splice(E,2,v)}for(l.reverse(),p=-1;++p<l.length;)u[g+l[p][0]]=g+l[p][1],g+=l[p][1]-l[p][0]-1;return u}const bD={tokenize:DD,resolve:CD},yD={tokenize:xD,partial:!0};function CD(e){return If(e),e}function DD(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),a(o)}function a(o){return o===null?i(o):Ce(o)?e.check(yD,s,i)(o):(e.consume(o),a)}function i(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function s(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,a}}function xD(e,t,n){const r=this;return a;function a(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),ze(e,i,"linePrefix")}function i(s){if(s===null||Ce(s))return n(s);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function $f(e,t,n,r,a,i,s,o,l){const u=l||Number.POSITIVE_INFINITY;let c=0;return h;function h(v){return v===60?(e.enter(r),e.enter(a),e.enter(i),e.consume(v),e.exit(i),p):v===null||v===32||v===41||$s(v)?n(v):(e.enter(r),e.enter(s),e.enter(o),e.enter("chunkString",{contentType:"string"}),f(v))}function p(v){return v===62?(e.enter(i),e.consume(v),e.exit(i),e.exit(a),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),m(v))}function m(v){return v===62?(e.exit("chunkString"),e.exit(o),p(v)):v===null||v===60||Ce(v)?n(v):(e.consume(v),v===92?g:m)}function g(v){return v===60||v===62||v===92?(e.consume(v),m):m(v)}function f(v){return!c&&(v===null||v===41||ft(v))?(e.exit("chunkString"),e.exit(o),e.exit(s),e.exit(r),t(v)):c<u&&v===40?(e.consume(v),c++,f):v===41?(e.consume(v),c--,f):v===null||v===32||v===40||$s(v)?n(v):(e.consume(v),v===92?b:f)}function b(v){return v===40||v===41||v===92?(e.consume(v),f):f(v)}}function Lf(e,t,n,r,a,i){const s=this;let o=0,l;return u;function u(m){return e.enter(r),e.enter(a),e.consume(m),e.exit(a),e.enter(i),c}function c(m){return o>999||m===null||m===91||m===93&&!l||m===94&&!o&&"_hiddenFootnoteSupport"in s.parser.constructs?n(m):m===93?(e.exit(i),e.enter(a),e.consume(m),e.exit(a),e.exit(r),t):Ce(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),h(m))}function h(m){return m===null||m===91||m===93||Ce(m)||o++>999?(e.exit("chunkString"),c(m)):(e.consume(m),l||(l=!Pe(m)),m===92?p:h)}function p(m){return m===91||m===92||m===93?(e.consume(m),o++,h):h(m)}}function zf(e,t,n,r,a,i){let s;return o;function o(p){return p===34||p===39||p===40?(e.enter(r),e.enter(a),e.consume(p),e.exit(a),s=p===40?41:p,l):n(p)}function l(p){return p===s?(e.enter(a),e.consume(p),e.exit(a),e.exit(r),t):(e.enter(i),u(p))}function u(p){return p===s?(e.exit(i),l(s)):p===null?n(p):Ce(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),ze(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(p))}function c(p){return p===s||p===null||Ce(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?h:c)}function h(p){return p===s||p===92?(e.consume(p),c):c(p)}}function kr(e,t){let n;return r;function r(a){return Ce(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,r):Pe(a)?ze(e,r,n?"linePrefix":"lineSuffix")(a):t(a)}}const wD={name:"definition",tokenize:_D},ED={tokenize:kD,partial:!0};function _D(e,t,n){const r=this;let a;return i;function i(m){return e.enter("definition"),s(m)}function s(m){return Lf.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function o(m){return a=Yn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),l):n(m)}function l(m){return ft(m)?kr(e,u)(m):u(m)}function u(m){return $f(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function c(m){return e.attempt(ED,h,h)(m)}function h(m){return Pe(m)?ze(e,p,"whitespace")(m):p(m)}function p(m){return m===null||Ce(m)?(e.exit("definition"),r.parser.defined.push(a),t(m)):n(m)}}function kD(e,t,n){return r;function r(o){return ft(o)?kr(e,a)(o):n(o)}function a(o){return zf(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function i(o){return Pe(o)?ze(e,s,"whitespace")(o):s(o)}function s(o){return o===null||Ce(o)?t(o):n(o)}}const FD={name:"hardBreakEscape",tokenize:BD};function BD(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),a}function a(i){return Ce(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const AD={name:"headingAtx",tokenize:SD,resolve:TD};function TD(e,t){let n=e.length-2,r=3,a,i;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(a={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Yt(e,r,n-r+1,[["enter",a,t],["enter",i,t],["exit",i,t],["exit",a,t]])),e}function SD(e,t,n){let r=0;return a;function a(c){return e.enter("atxHeading"),i(c)}function i(c){return e.enter("atxHeadingSequence"),s(c)}function s(c){return c===35&&r++<6?(e.consume(c),s):c===null||ft(c)?(e.exit("atxHeadingSequence"),o(c)):n(c)}function o(c){return c===35?(e.enter("atxHeadingSequence"),l(c)):c===null||Ce(c)?(e.exit("atxHeading"),t(c)):Pe(c)?ze(e,o,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function l(c){return c===35?(e.consume(c),l):(e.exit("atxHeadingSequence"),o(c))}function u(c){return c===null||c===35||ft(c)?(e.exit("atxHeadingText"),o(c)):(e.consume(c),u)}}const jD=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],oc=["pre","script","style","textarea"],OD={name:"htmlFlow",tokenize:MD,resolveTo:RD,concrete:!0},PD={tokenize:$D,partial:!0},ND={tokenize:ID,partial:!0};function RD(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function MD(e,t,n){const r=this;let a,i,s,o,l;return u;function u(F){return c(F)}function c(F){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(F),h}function h(F){return F===33?(e.consume(F),p):F===47?(e.consume(F),i=!0,f):F===63?(e.consume(F),a=3,r.interrupt?t:D):Rt(F)?(e.consume(F),s=String.fromCharCode(F),b):n(F)}function p(F){return F===45?(e.consume(F),a=2,m):F===91?(e.consume(F),a=5,o=0,g):Rt(F)?(e.consume(F),a=4,r.interrupt?t:D):n(F)}function m(F){return F===45?(e.consume(F),r.interrupt?t:D):n(F)}function g(F){const T="CDATA[";return F===T.charCodeAt(o++)?(e.consume(F),o===T.length?r.interrupt?t:_:g):n(F)}function f(F){return Rt(F)?(e.consume(F),s=String.fromCharCode(F),b):n(F)}function b(F){if(F===null||F===47||F===62||ft(F)){const T=F===47,z=s.toLowerCase();return!T&&!i&&oc.includes(z)?(a=1,r.interrupt?t(F):_(F)):jD.includes(s.toLowerCase())?(a=6,T?(e.consume(F),v):r.interrupt?t(F):_(F)):(a=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(F):i?E(F):k(F))}return F===45||At(F)?(e.consume(F),s+=String.fromCharCode(F),b):n(F)}function v(F){return F===62?(e.consume(F),r.interrupt?t:_):n(F)}function E(F){return Pe(F)?(e.consume(F),E):N(F)}function k(F){return F===47?(e.consume(F),N):F===58||F===95||Rt(F)?(e.consume(F),x):Pe(F)?(e.consume(F),k):N(F)}function x(F){return F===45||F===46||F===58||F===95||At(F)?(e.consume(F),x):w(F)}function w(F){return F===61?(e.consume(F),A):Pe(F)?(e.consume(F),w):k(F)}function A(F){return F===null||F===60||F===61||F===62||F===96?n(F):F===34||F===39?(e.consume(F),l=F,S):Pe(F)?(e.consume(F),A):q(F)}function S(F){return F===l?(e.consume(F),l=null,$):F===null||Ce(F)?n(F):(e.consume(F),S)}function q(F){return F===null||F===34||F===39||F===47||F===60||F===61||F===62||F===96||ft(F)?w(F):(e.consume(F),q)}function $(F){return F===47||F===62||Pe(F)?k(F):n(F)}function N(F){return F===62?(e.consume(F),L):n(F)}function L(F){return F===null||Ce(F)?_(F):Pe(F)?(e.consume(F),L):n(F)}function _(F){return F===45&&a===2?(e.consume(F),G):F===60&&a===1?(e.consume(F),V):F===62&&a===4?(e.consume(F),M):F===63&&a===3?(e.consume(F),D):F===93&&a===5?(e.consume(F),ae):Ce(F)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(PD,W,B)(F)):F===null||Ce(F)?(e.exit("htmlFlowData"),B(F)):(e.consume(F),_)}function B(F){return e.check(ND,j,W)(F)}function j(F){return e.enter("lineEnding"),e.consume(F),e.exit("lineEnding"),I}function I(F){return F===null||Ce(F)?B(F):(e.enter("htmlFlowData"),_(F))}function G(F){return F===45?(e.consume(F),D):_(F)}function V(F){return F===47?(e.consume(F),s="",Q):_(F)}function Q(F){if(F===62){const T=s.toLowerCase();return oc.includes(T)?(e.consume(F),M):_(F)}return Rt(F)&&s.length<8?(e.consume(F),s+=String.fromCharCode(F),Q):_(F)}function ae(F){return F===93?(e.consume(F),D):_(F)}function D(F){return F===62?(e.consume(F),M):F===45&&a===2?(e.consume(F),D):_(F)}function M(F){return F===null||Ce(F)?(e.exit("htmlFlowData"),W(F)):(e.consume(F),M)}function W(F){return e.exit("htmlFlow"),t(F)}}function ID(e,t,n){const r=this;return a;function a(s){return Ce(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):n(s)}function i(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function $D(e,t,n){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(si,t,n)}}const LD={name:"htmlText",tokenize:zD};function zD(e,t,n){const r=this;let a,i,s;return o;function o(D){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(D),l}function l(D){return D===33?(e.consume(D),u):D===47?(e.consume(D),w):D===63?(e.consume(D),k):Rt(D)?(e.consume(D),q):n(D)}function u(D){return D===45?(e.consume(D),c):D===91?(e.consume(D),i=0,g):Rt(D)?(e.consume(D),E):n(D)}function c(D){return D===45?(e.consume(D),m):n(D)}function h(D){return D===null?n(D):D===45?(e.consume(D),p):Ce(D)?(s=h,V(D)):(e.consume(D),h)}function p(D){return D===45?(e.consume(D),m):h(D)}function m(D){return D===62?G(D):D===45?p(D):h(D)}function g(D){const M="CDATA[";return D===M.charCodeAt(i++)?(e.consume(D),i===M.length?f:g):n(D)}function f(D){return D===null?n(D):D===93?(e.consume(D),b):Ce(D)?(s=f,V(D)):(e.consume(D),f)}function b(D){return D===93?(e.consume(D),v):f(D)}function v(D){return D===62?G(D):D===93?(e.consume(D),v):f(D)}function E(D){return D===null||D===62?G(D):Ce(D)?(s=E,V(D)):(e.consume(D),E)}function k(D){return D===null?n(D):D===63?(e.consume(D),x):Ce(D)?(s=k,V(D)):(e.consume(D),k)}function x(D){return D===62?G(D):k(D)}function w(D){return Rt(D)?(e.consume(D),A):n(D)}function A(D){return D===45||At(D)?(e.consume(D),A):S(D)}function S(D){return Ce(D)?(s=S,V(D)):Pe(D)?(e.consume(D),S):G(D)}function q(D){return D===45||At(D)?(e.consume(D),q):D===47||D===62||ft(D)?$(D):n(D)}function $(D){return D===47?(e.consume(D),G):D===58||D===95||Rt(D)?(e.consume(D),N):Ce(D)?(s=$,V(D)):Pe(D)?(e.consume(D),$):G(D)}function N(D){return D===45||D===46||D===58||D===95||At(D)?(e.consume(D),N):L(D)}function L(D){return D===61?(e.consume(D),_):Ce(D)?(s=L,V(D)):Pe(D)?(e.consume(D),L):$(D)}function _(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),a=D,B):Ce(D)?(s=_,V(D)):Pe(D)?(e.consume(D),_):(e.consume(D),j)}function B(D){return D===a?(e.consume(D),a=void 0,I):D===null?n(D):Ce(D)?(s=B,V(D)):(e.consume(D),B)}function j(D){return D===null||D===34||D===39||D===60||D===61||D===96?n(D):D===47||D===62||ft(D)?$(D):(e.consume(D),j)}function I(D){return D===47||D===62||ft(D)?$(D):n(D)}function G(D){return D===62?(e.consume(D),e.exit("htmlTextData"),e.exit("htmlText"),t):n(D)}function V(D){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),Q}function Q(D){return Pe(D)?ze(e,ae,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):ae(D)}function ae(D){return e.enter("htmlTextData"),s(D)}}const Bo={name:"labelEnd",tokenize:KD,resolveTo:VD,resolveAll:HD},qD={tokenize:ZD},WD={tokenize:YD},UD={tokenize:GD};function HD(e){let t=-1;for(;++t<e.length;){const n=e[t][1];(n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd")&&(e.splice(t+1,n.type==="labelImage"?4:2),n.type="data",t++)}return e}function VD(e,t){let n=e.length,r=0,a,i,s,o;for(;n--;)if(a=e[n][1],i){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[n][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(i=n,a.type!=="labelLink")){r=2;break}}else a.type==="labelEnd"&&(s=n);const l={type:e[i][1].type==="labelLink"?"link":"image",start:Object.assign({},e[i][1].start),end:Object.assign({},e[e.length-1][1].end)},u={type:"label",start:Object.assign({},e[i][1].start),end:Object.assign({},e[s][1].end)},c={type:"labelText",start:Object.assign({},e[i+r+2][1].end),end:Object.assign({},e[s-2][1].start)};return o=[["enter",l,t],["enter",u,t]],o=xt(o,e.slice(i+1,i+r+3)),o=xt(o,[["enter",c,t]]),o=xt(o,Fo(t.parser.constructs.insideSpan.null,e.slice(i+r+4,s-3),t)),o=xt(o,[["exit",c,t],e[s-2],e[s-1],["exit",u,t]]),o=xt(o,e.slice(s+1)),o=xt(o,[["exit",l,t]]),Yt(e,i,e.length,o),e}function KD(e,t,n){const r=this;let a=r.events.length,i,s;for(;a--;)if((r.events[a][1].type==="labelImage"||r.events[a][1].type==="labelLink")&&!r.events[a][1]._balanced){i=r.events[a][1];break}return o;function o(p){return i?i._inactive?h(p):(s=r.parser.defined.includes(Yn(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),l):n(p)}function l(p){return p===40?e.attempt(qD,c,s?c:h)(p):p===91?e.attempt(WD,c,s?u:h)(p):s?c(p):h(p)}function u(p){return e.attempt(UD,c,h)(p)}function c(p){return t(p)}function h(p){return i._balanced=!0,n(p)}}function ZD(e,t,n){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),a}function a(h){return ft(h)?kr(e,i)(h):i(h)}function i(h){return h===41?c(h):$f(e,s,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function s(h){return ft(h)?kr(e,l)(h):c(h)}function o(h){return n(h)}function l(h){return h===34||h===39||h===40?zf(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):c(h)}function u(h){return ft(h)?kr(e,c)(h):c(h)}function c(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function YD(e,t,n){const r=this;return a;function a(o){return Lf.call(r,e,i,s,"reference","referenceMarker","referenceString")(o)}function i(o){return r.parser.defined.includes(Yn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function s(o){return n(o)}}function GD(e,t,n){return r;function r(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),a}function a(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):n(i)}}const QD={name:"labelStartImage",tokenize:JD,resolveAll:Bo.resolveAll};function JD(e,t,n){const r=this;return a;function a(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),i}function i(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelImage"),s):n(o)}function s(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const XD={name:"labelStartLink",tokenize:ex,resolveAll:Bo.resolveAll};function ex(e,t,n){const r=this;return a;function a(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),i}function i(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const Ki={name:"lineEnding",tokenize:tx};function tx(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ze(e,t,"linePrefix")}}const Ea={name:"thematicBreak",tokenize:nx};function nx(e,t,n){let r=0,a;return i;function i(u){return e.enter("thematicBreak"),s(u)}function s(u){return a=u,o(u)}function o(u){return u===a?(e.enter("thematicBreakSequence"),l(u)):r>=3&&(u===null||Ce(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===a?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),Pe(u)?ze(e,o,"whitespace")(u):o(u))}}const lt={name:"list",tokenize:ix,continuation:{tokenize:sx},exit:ux},rx={tokenize:lx,partial:!0},ax={tokenize:ox,partial:!0};function ix(e,t,n){const r=this,a=r.events[r.events.length-1];let i=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,s=0;return o;function o(m){const g=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:Ls(m)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(Ea,n,u)(m):u(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(m)}return n(m)}function l(m){return Ls(m)&&++s<10?(e.consume(m),l):(!r.interrupt||s<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),u(m)):n(m)}function u(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(si,r.interrupt?n:c,e.attempt(rx,p,h))}function c(m){return r.containerState.initialBlankLine=!0,i++,p(m)}function h(m){return Pe(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),p):n(m)}function p(m){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function sx(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(si,a,i);function a(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ze(e,t,"listItemIndent",r.containerState.size+1)(o)}function i(o){return r.containerState.furtherBlankLines||!Pe(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(ax,t,s)(o))}function s(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,ze(e,e.attempt(lt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function ox(e,t,n){const r=this;return ze(e,a,"listItemIndent",r.containerState.size+1);function a(i){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(i):n(i)}}function ux(e){e.exit(this.containerState.type)}function lx(e,t,n){const r=this;return ze(e,a,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4+1);function a(i){const s=r.events[r.events.length-1];return!Pe(i)&&s&&s[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const uc={name:"setextUnderline",tokenize:dx,resolveTo:cx};function cx(e,t){let n=e.length,r,a,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(a=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const s={type:"setextHeading",start:Object.assign({},e[a][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[a][1].type="setextHeadingText",i?(e.splice(a,0,["enter",s,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end=Object.assign({},e[i][1].end)):e[r][1]=s,e.push(["exit",s,t]),e}function dx(e,t,n){const r=this;let a;return i;function i(u){let c=r.events.length,h;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){h=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),a=u,s(u)):n(u)}function s(u){return e.enter("setextHeadingLineSequence"),o(u)}function o(u){return u===a?(e.consume(u),o):(e.exit("setextHeadingLineSequence"),Pe(u)?ze(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||Ce(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const fx={tokenize:hx};function hx(e){const t=this,n=e.attempt(si,r,e.attempt(this.parser.constructs.flowInitial,a,ze(e,e.attempt(this.parser.constructs.flow,a,e.attempt(bD,a)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function a(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const mx={resolveAll:Wf()},px=qf("string"),gx=qf("text");function qf(e){return{tokenize:t,resolveAll:Wf(e==="text"?vx:void 0)};function t(n){const r=this,a=this.parser.constructs[e],i=n.attempt(a,s,o);return s;function s(c){return u(c)?i(c):o(c)}function o(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),l}function l(c){return u(c)?(n.exit("data"),i(c)):(n.consume(c),l)}function u(c){if(c===null)return!0;const h=a[c];let p=-1;if(h)for(;++p<h.length;){const m=h[p];if(!m.previous||m.previous.call(r,r.previous))return!0}return!1}}}function Wf(e){return t;function t(n,r){let a=-1,i;for(;++a<=n.length;)i===void 0?n[a]&&n[a][1].type==="data"&&(i=a,a++):(!n[a]||n[a][1].type!=="data")&&(a!==i+2&&(n[i][1].end=n[a-1][1].end,n.splice(i+2,a-i-2),a=i+2),i=void 0);return e?e(n,r):n}}function vx(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],a=t.sliceStream(r);let i=a.length,s=-1,o=0,l;for(;i--;){const u=a[i];if(typeof u=="string"){for(s=u.length;u.charCodeAt(s-1)===32;)o++,s--;if(s)break;s=-1}else if(u===-2)l=!0,o++;else if(u!==-1){i++;break}}if(o){const u={type:n===e.length||l||o<2?"lineSuffix":"hardBreakTrailing",start:{line:r.end.line,column:r.end.column-o,offset:r.end.offset-o,_index:r.start._index+i,_bufferIndex:i?s:r.start._bufferIndex+s},end:Object.assign({},r.end)};r.end=Object.assign({},u.start),r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}function bx(e,t,n){let r=Object.assign(n?Object.assign({},n):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1});const a={},i=[];let s=[],o=[];const l={consume:E,enter:k,exit:x,attempt:S(w),check:S(A),interrupt:S(A,{interrupt:!0})},u={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:m,sliceSerialize:p,now:g,defineSkip:f,write:h};let c=t.tokenize.call(u,l);return t.resolveAll&&i.push(t),u;function h(L){return s=xt(s,L),b(),s[s.length-1]!==null?[]:(q(t,0),u.events=Fo(i,u.events,u),u.events)}function p(L,_){return Cx(m(L),_)}function m(L){return yx(s,L)}function g(){const{line:L,column:_,offset:B,_index:j,_bufferIndex:I}=r;return{line:L,column:_,offset:B,_index:j,_bufferIndex:I}}function f(L){a[L.line]=L.column,N()}function b(){let L;for(;r._index<s.length;){const _=s[r._index];if(typeof _=="string")for(L=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===L&&r._bufferIndex<_.length;)v(_.charCodeAt(r._bufferIndex));else v(_)}}function v(L){c=c(L)}function E(L){Ce(L)?(r.line++,r.column=1,r.offset+=L===-3?2:1,N()):L!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=L}function k(L,_){const B=_||{};return B.type=L,B.start=g(),u.events.push(["enter",B,u]),o.push(B),B}function x(L){const _=o.pop();return _.end=g(),u.events.push(["exit",_,u]),_}function w(L,_){q(L,_.from)}function A(L,_){_.restore()}function S(L,_){return B;function B(j,I,G){let V,Q,ae,D;return Array.isArray(j)?W(j):"tokenize"in j?W([j]):M(j);function M(R){return H;function H(re){const X=re!==null&&R[re],ne=re!==null&&R.null,le=[...Array.isArray(X)?X:X?[X]:[],...Array.isArray(ne)?ne:ne?[ne]:[]];return W(le)(re)}}function W(R){return V=R,Q=0,R.length===0?G:F(R[Q])}function F(R){return H;function H(re){return D=$(),ae=R,R.partial||(u.currentConstruct=R),R.name&&u.parser.constructs.disable.null.includes(R.name)?z():R.tokenize.call(_?Object.assign(Object.create(u),_):u,l,T,z)(re)}}function T(R){return L(ae,D),I}function z(R){return D.restore(),++Q<V.length?F(V[Q]):G}}}function q(L,_){L.resolveAll&&!i.includes(L)&&i.push(L),L.resolve&&Yt(u.events,_,u.events.length-_,L.resolve(u.events.slice(_),u)),L.resolveTo&&(u.events=L.resolveTo(u.events,u))}function $(){const L=g(),_=u.previous,B=u.currentConstruct,j=u.events.length,I=Array.from(o);return{restore:G,from:j};function G(){r=L,u.previous=_,u.currentConstruct=B,u.events.length=j,o=I,N()}}function N(){r.line in a&&r.column<2&&(r.column=a[r.line],r.offset+=a[r.line]-1)}}function yx(e,t){const n=t.start._index,r=t.start._bufferIndex,a=t.end._index,i=t.end._bufferIndex;let s;if(n===a)s=[e[n].slice(r,i)];else{if(s=e.slice(n,a),r>-1){const o=s[0];typeof o=="string"?s[0]=o.slice(r):s.shift()}i>0&&s.push(e[a].slice(0,i))}return s}function Cx(e,t){let n=-1;const r=[];let a;for(;++n<e.length;){const i=e[n];let s;if(typeof i=="string")s=i;else switch(i){case-5:{s="\r";break}case-4:{s=`
140
140
  `;break}case-3:{s=`\r
141
- `;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&a)continue;s=" ";break}default:s=String.fromCharCode(i)}a=i===-2,r.push(s)}return r.join("")}const Ex={42:ct,43:ct,45:ct,48:ct,49:ct,50:ct,51:ct,52:ct,53:ct,54:ct,55:ct,56:ct,57:ct,62:Mf},_x={91:kD},kx={[-2]:Vi,[-1]:Vi,32:Vi},Bx={35:jD,42:Ea,45:[lc,Ea],60:MD,61:lc,95:Ea,96:oc,126:oc},Fx={38:If,92:Rf},Ax={[-5]:Ki,[-4]:Ki,[-3]:Ki,33:ex,38:If,42:zs,60:[nD,WD],91:nx,92:[TD,Rf],93:Fo,95:zs,96:pD},Tx={null:[zs,vx]},Sx={null:[42,95]},jx={null:[]},Ox=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Sx,contentInitial:_x,disable:jx,document:Ex,flow:Bx,flowInitial:kx,insideSpan:Tx,string:Fx,text:Ax},Symbol.toStringTag,{value:"Module"}));function Px(e){const n=zC([Ox,...(e||{}).extensions||[]]),r={defined:[],lazy:{},constructs:n,content:a(YC),document:a(QC),flow:a(px),string:a(bx),text:a(yx)};return r;function a(i){return s;function s(o){return Dx(r,i,o)}}}function Nx(e){for(;!$f(e););return e}const cc=/[\0\t\n\r]/g;function Mx(){let e=1,t="",n=!0,r;return a;function a(i,s,o){const l=[];let u,c,h,p,m;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(s||void 0).decode(i)),h=0,t="",n&&(i.charCodeAt(0)===65279&&h++,n=void 0);h<i.length;){if(cc.lastIndex=h,u=cc.exec(i),p=u&&u.index!==void 0?u.index:i.length,m=i.charCodeAt(p),!u){t=i.slice(h);break}if(m===10&&h===p&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),h<p&&(l.push(i.slice(h,p)),e+=p-h),m){case 0:{l.push(65533),e++;break}case 9:{for(c=Math.ceil(e/4)*4,l.push(-2);e++<c;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}h=p+1}return o&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const Rx=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Ix(e){return e.replace(Rx,$x)}function $x(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),i=a===120||a===88;return Nf(n.slice(i?2:1),i?16:10)}return ko(n)||e}const Hf={}.hasOwnProperty;function Lx(e,t,n){return typeof t!="string"&&(n=t,t=void 0),zx(n)(Nx(Px(n).document().write(Mx()(e,t,!0))))}function zx(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(ze),autolinkProtocol:R,autolinkEmail:R,atxHeading:i(me),blockQuote:i(ee),characterEscape:R,characterReference:R,codeFenced:i(re),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:i(re,s),codeText:i(le,s),codeTextData:R,data:R,codeFlowValue:R,definition:i(J),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:i(he),hardBreakEscape:i(ve),hardBreakTrailing:i(ve),htmlFlow:i(Ee,s),htmlFlowData:R,htmlText:i(Ee,s),htmlTextData:R,image:i(Ae),label:s,link:i(ze),listItem:i(Te),listItemValue:p,listOrdered:i(Se,h),listUnordered:i(Se),paragraph:i(Ne),reference:B,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:i(me),strong:i(ke),thematicBreak:i(ge)},exit:{atxHeading:l(),atxHeadingSequence:w,autolink:l(),autolinkEmail:ne,autolinkProtocol:H,blockQuote:l(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:z,characterReferenceMarkerNumeric:z,characterReferenceValue:M,codeFenced:l(b),codeFencedFence:f,codeFencedFenceInfo:m,codeFencedFenceMeta:g,codeFlowValue:I,codeIndented:l(v),codeText:l($),codeTextData:I,data:I,definition:l(),definitionDestinationString:x,definitionLabelString:E,definitionTitleString:k,emphasis:l(),hardBreakEscape:l(_),hardBreakTrailing:l(_),htmlFlow:l(F),htmlFlowData:I,htmlText:l(j),htmlTextData:I,image:l(K),label:ae,labelText:Q,lineEnding:N,link:l(V),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:T,resourceDestinationString:D,resourceTitleString:L,resource:q,setextHeading:l(W),setextHeadingLineSequence:S,setextHeadingText:A,strong:l(),thematicBreak:l()}};Vf(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(U){let ie={type:"root",children:[]};const pe={stack:[ie],tokenStack:[],config:t,enter:o,exit:u,buffer:s,resume:c,data:n},be=[];let we=-1;for(;++we<U.length;)if(U[we][1].type==="listOrdered"||U[we][1].type==="listUnordered")if(U[we][0]==="enter")be.push(we);else{const Ke=be.pop();we=a(U,Ke,we)}for(we=-1;++we<U.length;){const Ke=t[U[we][0]];Hf.call(Ke,U[we][1].type)&&Ke[U[we][1].type].call(Object.assign({sliceSerialize:U[we][2].sliceSerialize},pe),U[we][1])}if(pe.tokenStack.length>0){const Ke=pe.tokenStack[pe.tokenStack.length-1];(Ke[1]||dc).call(pe,void 0,Ke[0])}for(ie.position={start:tn(U.length>0?U[0][1].start:{line:1,column:1,offset:0}),end:tn(U.length>0?U[U.length-2][1].end:{line:1,column:1,offset:0})},we=-1;++we<t.transforms.length;)ie=t.transforms[we](ie)||ie;return ie}function a(U,ie,pe){let be=ie-1,we=-1,Ke=!1,Qe,pt,qt,Ft;for(;++be<=pe;){const et=U[be];switch(et[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{et[0]==="enter"?we++:we--,Ft=void 0;break}case"lineEndingBlank":{et[0]==="enter"&&(Qe&&!Ft&&!we&&!qt&&(qt=be),Ft=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ft=void 0}if(!we&&et[0]==="enter"&&et[1].type==="listItemPrefix"||we===-1&&et[0]==="exit"&&(et[1].type==="listUnordered"||et[1].type==="listOrdered")){if(Qe){let jt=be;for(pt=void 0;jt--;){const gt=U[jt];if(gt[1].type==="lineEnding"||gt[1].type==="lineEndingBlank"){if(gt[0]==="exit")continue;pt&&(U[pt][1].type="lineEndingBlank",Ke=!0),gt[1].type="lineEnding",pt=jt}else if(!(gt[1].type==="linePrefix"||gt[1].type==="blockQuotePrefix"||gt[1].type==="blockQuotePrefixWhitespace"||gt[1].type==="blockQuoteMarker"||gt[1].type==="listItemIndent"))break}qt&&(!pt||qt<pt)&&(Qe._spread=!0),Qe.end=Object.assign({},pt?U[pt][1].start:et[1].end),U.splice(pt||be,0,["exit",Qe,et[2]]),be++,pe++}if(et[1].type==="listItemPrefix"){const jt={type:"listItem",_spread:!1,start:Object.assign({},et[1].start),end:void 0};Qe=jt,U.splice(be,0,["enter",jt,et[2]]),be++,pe++,qt=void 0,Ft=!0}}}return U[ie][1]._spread=Ke,pe}function i(U,ie){return pe;function pe(be){o.call(this,U(be),be),ie&&ie.call(this,be)}}function s(){this.stack.push({type:"fragment",children:[]})}function o(U,ie,pe){this.stack[this.stack.length-1].children.push(U),this.stack.push(U),this.tokenStack.push([ie,pe]),U.position={start:tn(ie.start),end:void 0}}function l(U){return ie;function ie(pe){U&&U.call(this,pe),u.call(this,pe)}}function u(U,ie){const pe=this.stack.pop(),be=this.tokenStack.pop();if(be)be[0].type!==U.type&&(ie?ie.call(this,U,be[0]):(be[1]||dc).call(this,U,be[0]));else throw new Error("Cannot close `"+U.type+"` ("+_r({start:U.start,end:U.end})+"): it’s not open");pe.position.end=tn(U.end)}function c(){return $C(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function p(U){if(this.data.expectingFirstListItemValue){const ie=this.stack[this.stack.length-2];ie.start=Number.parseInt(this.sliceSerialize(U),10),this.data.expectingFirstListItemValue=void 0}}function m(){const U=this.resume(),ie=this.stack[this.stack.length-1];ie.lang=U}function g(){const U=this.resume(),ie=this.stack[this.stack.length-1];ie.meta=U}function f(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const U=this.resume(),ie=this.stack[this.stack.length-1];ie.value=U.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const U=this.resume(),ie=this.stack[this.stack.length-1];ie.value=U.replace(/(\r?\n|\r)$/g,"")}function E(U){const ie=this.resume(),pe=this.stack[this.stack.length-1];pe.label=ie,pe.identifier=Yn(this.sliceSerialize(U)).toLowerCase()}function k(){const U=this.resume(),ie=this.stack[this.stack.length-1];ie.title=U}function x(){const U=this.resume(),ie=this.stack[this.stack.length-1];ie.url=U}function w(U){const ie=this.stack[this.stack.length-1];if(!ie.depth){const pe=this.sliceSerialize(U).length;ie.depth=pe}}function A(){this.data.setextHeadingSlurpLineEnding=!0}function S(U){const ie=this.stack[this.stack.length-1];ie.depth=this.sliceSerialize(U).codePointAt(0)===61?1:2}function W(){this.data.setextHeadingSlurpLineEnding=void 0}function R(U){const pe=this.stack[this.stack.length-1].children;let be=pe[pe.length-1];(!be||be.type!=="text")&&(be=He(),be.position={start:tn(U.start),end:void 0},pe.push(be)),this.stack.push(be)}function I(U){const ie=this.stack.pop();ie.value+=this.sliceSerialize(U),ie.position.end=tn(U.end)}function N(U){const ie=this.stack[this.stack.length-1];if(this.data.atHardBreak){const pe=ie.children[ie.children.length-1];pe.position.end=tn(U.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ie.type)&&(R.call(this,U),I.call(this,U))}function _(){this.data.atHardBreak=!0}function F(){const U=this.resume(),ie=this.stack[this.stack.length-1];ie.value=U}function j(){const U=this.resume(),ie=this.stack[this.stack.length-1];ie.value=U}function $(){const U=this.resume(),ie=this.stack[this.stack.length-1];ie.value=U}function V(){const U=this.stack[this.stack.length-1];if(this.data.inReference){const ie=this.data.referenceType||"shortcut";U.type+="Reference",U.referenceType=ie,delete U.url,delete U.title}else delete U.identifier,delete U.label;this.data.referenceType=void 0}function K(){const U=this.stack[this.stack.length-1];if(this.data.inReference){const ie=this.data.referenceType||"shortcut";U.type+="Reference",U.referenceType=ie,delete U.url,delete U.title}else delete U.identifier,delete U.label;this.data.referenceType=void 0}function Q(U){const ie=this.sliceSerialize(U),pe=this.stack[this.stack.length-2];pe.label=Ix(ie),pe.identifier=Yn(ie).toLowerCase()}function ae(){const U=this.stack[this.stack.length-1],ie=this.resume(),pe=this.stack[this.stack.length-1];if(this.data.inReference=!0,pe.type==="link"){const be=U.children;pe.children=be}else pe.alt=ie}function D(){const U=this.resume(),ie=this.stack[this.stack.length-1];ie.url=U}function L(){const U=this.resume(),ie=this.stack[this.stack.length-1];ie.title=U}function q(){this.data.inReference=void 0}function B(){this.data.referenceType="collapsed"}function T(U){const ie=this.resume(),pe=this.stack[this.stack.length-1];pe.label=ie,pe.identifier=Yn(this.sliceSerialize(U)).toLowerCase(),this.data.referenceType="full"}function z(U){this.data.characterReferenceType=U.type}function M(U){const ie=this.sliceSerialize(U),pe=this.data.characterReferenceType;let be;pe?(be=Nf(ie,pe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):be=ko(ie);const we=this.stack.pop();we.value+=be,we.position.end=tn(U.end)}function H(U){I.call(this,U);const ie=this.stack[this.stack.length-1];ie.url=this.sliceSerialize(U)}function ne(U){I.call(this,U);const ie=this.stack[this.stack.length-1];ie.url="mailto:"+this.sliceSerialize(U)}function ee(){return{type:"blockquote",children:[]}}function re(){return{type:"code",lang:null,meta:null,value:""}}function le(){return{type:"inlineCode",value:""}}function J(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function he(){return{type:"emphasis",children:[]}}function me(){return{type:"heading",depth:0,children:[]}}function ve(){return{type:"break"}}function Ee(){return{type:"html",value:""}}function Ae(){return{type:"image",title:null,url:"",alt:null}}function ze(){return{type:"link",title:null,url:"",children:[]}}function Se(U){return{type:"list",ordered:U.type==="listOrdered",start:null,spread:U._spread,children:[]}}function Te(U){return{type:"listItem",spread:U._spread,checked:null,children:[]}}function Ne(){return{type:"paragraph",children:[]}}function ke(){return{type:"strong",children:[]}}function He(){return{type:"text",value:""}}function ge(){return{type:"thematicBreak"}}}function tn(e){return{line:e.line,column:e.column,offset:e.offset}}function Vf(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Vf(e,r):qx(e,r)}}function qx(e,t){let n;for(n in t)if(Hf.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function dc(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+_r({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+_r({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+_r({start:t.start,end:t.end})+") is still open")}function Wx(e){const t=this;t.parser=n;function n(r){return Lx(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Kf(e,t){var l,u,c;const n={...Vn,...t==null?void 0:t.nodeTypes,[Y.heading]:{...Vn[Y.heading],...(l=t==null?void 0:t.nodeTypes)==null?void 0:l[Y.heading]}},r=(t==null?void 0:t.linkDestinationKey)??"link",a=(t==null?void 0:t.imageSourceKey)??"link",i=(t==null?void 0:t.imageCaptionKey)??"caption";let s=[{text:""}];const o=e.children;switch(o&&Array.isArray(o)&&o.length>0&&(s=o.flatMap(h=>Kf({...h,ordered:e.ordered||!1},t))),e.type){case ot.heading:return{type:n[Y.heading][e.depth||1],children:s};case ot.list:return{type:e.ordered?n[Y.ol]:n[Y.ul],children:s};case ot.listItem:return{type:n[Y.li],children:s};case ot.paragraph:return{type:n[Y.paragraph],children:s};case ot.link:return{type:n[Y.link],[r]:e.url,children:s};case ot.image:return{type:n[Y.image],children:[{text:""}],[a]:e.url,[i]:e.alt};case ot.blockquote:return{type:n[Y.blockquote],children:s};case ot.code:return{type:n[Y.codeblock],language:e.lang,children:[{text:e.value}]};case ot.html:return(u=e.value)!=null&&u.includes("<br>")?{break:!0,type:n[Y.paragraph],children:[{text:((c=e.value)==null?void 0:c.replace(/<br>/g,""))||""}]}:{type:Y.paragraph,children:[{text:e.value||""}]};case ot.emphasis:return{[n[Rt.emphasis]]:!0,...Zi(s),...ca(s)};case ot.strong:return{[n[Rt.strong]]:!0,...Zi(s),...ca(s)};case ot.delete:return{[n[Rt.delete]]:!0,...Zi(s),...ca(s)};case ot.inlineCode:return{[n[Rt.code]]:!0,text:e.value,...ca(s)};case ot.thematicBreak:return{type:n[Y.hr],children:[{text:""}]};case"text":default:return{text:e.value||""}}}const Zi=e=>({text:e.map(t=>t==null?void 0:t.text).join("")});function ca(e){return e.reduce((t,n)=>(Object.keys(n).forEach(function(r){r==="children"||r==="type"||r==="text"||(t[r]=n[r])}),t),{})}const Ux=function(t){const n=r=>r.children.map(a=>Kf(a,t));this.Compiler=n},Hx=(e,t=n=>{})=>{PC().use(Wx).use(Ux).process(e).then(n=>{const r=yn(n.result),a=s=>{const o=s;[Y.li,Y.blockquote].includes(o.type)&&o.children.map((l,u)=>{const c=l;c.type===Y.paragraph&&o.children.splice(u,1,...c.children)}),"children"in s&&s.children&&s.children.forEach(l=>a(l))};r.forEach(a);const i=s=>{for(let o=0;o<s.length;o++){const l=s[o],u=l;if(u.type===Y.link){const c=u.children&&u.children[0];if(c&&"text"in c&&c.text.includes(Ns)){const h=u,p=c.text.replace(Ns,""),m="link"in h&&h.link?h.link:"";h.type=Y.mention,h.id=m,h.name=p,h.children=[{text:""}],s[o+1]||s.splice(o+1,0,{text:" "}),o++}}"children"in l&&l.children&&i(l.children)}};i(r),r.map(s=>{"children"in s&&s.children&&s.children.map((o,l)=>{if("text"in o&&o.text){const u=o.text.match(/~~(.*?)~~/g);u&&u.map(c=>{const h=c.replace(/~~/g,""),p=o.text.indexOf(c),m=o.text.substring(0,p),g=o.text.substring(p+c.length),f=[{text:m},{text:h,[Y.strikethrough]:!0},{text:g}];s.children.splice(l,1,...f)})}})}),t(r)})},Ao=e=>{const t=document.getElementById(e);if(t){const n=t.querySelector(".input");n&&(n==null||n.focus())}},Vx=(e,t)=>{const{selection:n}=e;if(!n)return[null,null];let[r,a]=C.parent(e,n,{edge:"end"}),i=r;for(;i.type!==t&&a.length>0&&a.length!==1;)a=P.parent(a),r=ue.get(e,a),i=r;return i.type===t?[r,a]:[null,null]},Kx=e=>{const{selection:t}=e;return t?C.string(e,t):null},fc=e=>{let t="";for(const n of ue.descendants(e)){const[r]=n,a=r;a.text&&(t+=a.text)}return t},hc={"mod+b":Y.bold,"mod+i":Y.italic,"mod+shift+x":Y.strikethrough,"mod+k":Y.link,"mod+shift+7":Y.ol,"mod+shift+8":Y.ul,"mod+shift+9":Y.blockquote},Zx=(e,t,n,r)=>{for(const a in hc)if(Ly(a,e)){e.stopPropagation(),e.preventDefault();const i=hc[a];if(i===Y.link){n([{type:"showLinkEditor",value:!0}]);return}if(iw(i)){th(t,i,r);return}Jf(t,i,r)}},Zf=(e,t,n,r)=>{var c;const{selectedUser:a,possibleUsers:i}=t,s=i[a];if(!s)return;const o=s.userId||"",l=(c=s.user)==null?void 0:c.name;n([{type:"mentionPopover",value:{...t,show:!1}}]);const u={type:Y.mention,id:o,name:l,children:[{text:""}]};X.select(e,(t==null?void 0:t.position)||Sf),X.insertNodes(e,[u,{text:" "}]),X.move(e,{distance:1,unit:"offset"}),Ao(r)},Yx=async({editor:e,isShowing:t,numberOfUsers:n,listMembers:r,dispatch:a})=>{const{selection:i}=e;if(i&&Z.isCollapsed(i)){const[s]=Z.edges(i),o=C.start(e,s.path),l=C.range(e,o,s),c=C.string(e,l).match(qc);if(c){const h=c.index||0,p={path:s.path,offset:h},m={path:s.path,offset:h+c[0].length},g=C.range(e,p,m),f=C.after(e,s),b=C.range(e,s,f);if(C.string(e,b).match(/^(\s|\.|,|\?|!|:|;|'|"|`|$)/)){const k=c[1];let x=[];r&&(x=await r({name:k})),a([{type:"mentionPopover",value:{show:x.length>0?!0:n!==null,selectedUser:0,possibleUsers:x,position:x.length>0?g:null,numberOfUsers:x.length>0?x.length:null}}]);return}}}t&&a([{type:"mentionPopover",value:{show:!1,selectedUser:0,possibleUsers:[],position:null,numberOfUsers:null}}])},Yf=e=>{let t=document.body;if(e!==!1){const n=document.getElementById(e);n&&(t=n)}return t},$n=e=>typeof e.text=="string",Gx=[Y.hr,Y.image,Y.mention],mc="<br>";function Gf(e,t={nodeTypes:Vn}){const{nodeTypes:n=Vn,ignoreParagraphNewline:r=!1,listDepth:a=0}=t,i=e.text||"";let s=e.type||"";const o={...Vn,...n,heading:{...Vn[Y.heading],...n[Y.heading]}},l=[o[Y.ul],o[Y.ol]];let u=i;if(!$n(e)&&s!==Y.mention&&(u=e.children.map(c=>{const h=$n(c)?!1:l.includes(c.type||""),p=l.includes(e.type||"");let m=!1;return!$n(e)&&Array.isArray(e.children)&&(m=e.children.some(g=>!$n(g)&&g.type===o.link)),Gf({...c,parentType:s},{nodeTypes:o,ignoreParagraphNewline:(r||h||p||m)&&!c.break,listDepth:l.includes(c.type||"")?a+1:a,inBlockquote:s===o[Y.blockquote]||e.parentType===o[Y.blockquote]})}).join("")),!r&&(i===""||i===`
142
- `)&&e.parentType===o[Y.paragraph]&&s!==o[Y.mention]&&(s=o[Y.paragraph],u=mc),!(u===""&&!Gx.find(c=>o[c]===s)))switch(u!==mc&&$n(e)&&(e[Y.strikethrough]&&e[Y.bold]&&e[Y.italic]?u=Ln(u,"~~***"):e[Y.bold]&&e[Y.italic]?u=Ln(u,"***"):(e[Y.bold]&&(u=Ln(u,"**")),e[Y.italic]&&(u=Ln(u,"_")),e[Y.strikethrough]&&(u=Ln(u,"~~")),e[Y.code]&&(u=Ln(u,"`")))),s){case o[Y.heading][1]:return`# ${u}
143
- `;case o[Y.heading][2]:return`## ${u}
144
- `;case o[Y.heading][3]:return`### ${u}
145
- `;case o[Y.heading][4]:return`#### ${u}
146
- `;case o[Y.heading][5]:return`##### ${u}
147
- `;case o[Y.heading][6]:return`###### ${u}
148
- `;case o[Y.blockquote]:return`> ${u}
149
-
150
- `;case o[Y.codeblock]:return`\`\`\`${e.language||""}
141
+ `;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&a)continue;s=" ";break}default:s=String.fromCharCode(i)}a=i===-2,r.push(s)}return r.join("")}const Dx={42:lt,43:lt,45:lt,48:lt,49:lt,50:lt,51:lt,52:lt,53:lt,54:lt,55:lt,56:lt,57:lt,62:Nf},xx={91:wD},wx={[-2]:Vi,[-1]:Vi,32:Vi},Ex={35:AD,42:Ea,45:[uc,Ea],60:OD,61:uc,95:Ea,96:sc,126:sc},_x={38:Mf,92:Rf},kx={[-5]:Ki,[-4]:Ki,[-3]:Ki,33:QD,38:Mf,42:zs,60:[XC,LD],91:XD,92:[FD,Rf],93:Bo,95:zs,96:fD},Fx={null:[zs,mx]},Bx={null:[42,95]},Ax={null:[]},Tx=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Bx,contentInitial:xx,disable:Ax,document:Dx,flow:Ex,flowInitial:wx,insideSpan:Fx,string:_x,text:kx},Symbol.toStringTag,{value:"Module"}));function Sx(e){const n=IC([Tx,...(e||{}).extensions||[]]),r={defined:[],lazy:{},constructs:n,content:a(VC),document:a(ZC),flow:a(fx),string:a(px),text:a(gx)};return r;function a(i){return s;function s(o){return bx(r,i,o)}}}function jx(e){for(;!If(e););return e}const lc=/[\0\t\n\r]/g;function Ox(){let e=1,t="",n=!0,r;return a;function a(i,s,o){const l=[];let u,c,h,p,m;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(s||void 0).decode(i)),h=0,t="",n&&(i.charCodeAt(0)===65279&&h++,n=void 0);h<i.length;){if(lc.lastIndex=h,u=lc.exec(i),p=u&&u.index!==void 0?u.index:i.length,m=i.charCodeAt(p),!u){t=i.slice(h);break}if(m===10&&h===p&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),h<p&&(l.push(i.slice(h,p)),e+=p-h),m){case 0:{l.push(65533),e++;break}case 9:{for(c=Math.ceil(e/4)*4,l.push(-2);e++<c;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}h=p+1}return o&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const Px=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Nx(e){return e.replace(Px,Rx)}function Rx(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),i=a===120||a===88;return Pf(n.slice(i?2:1),i?16:10)}return ko(n)||e}const Uf={}.hasOwnProperty;function Mx(e,t,n){return typeof t!="string"&&(n=t,t=void 0),Ix(n)(jx(Sx(n).document().write(Ox()(e,t,!0))))}function Ix(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Ue),autolinkProtocol:$,autolinkEmail:$,atxHeading:i(me),blockQuote:i(X),characterEscape:$,characterReference:$,codeFenced:i(ne),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:i(ne,s),codeText:i(le,s),codeTextData:$,data:$,codeFlowValue:$,definition:i(ee),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:i(he),hardBreakEscape:i(ye),hardBreakTrailing:i(ye),htmlFlow:i(Be,s),htmlFlowData:$,htmlText:i(Be,s),htmlTextData:$,image:i(Ae),label:s,link:i(Ue),listItem:i(Te),listItemValue:p,listOrdered:i(Se,h),listUnordered:i(Se),paragraph:i(Ne),reference:F,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:i(me),strong:i(_e),thematicBreak:i(ge)},exit:{atxHeading:l(),atxHeadingSequence:w,autolink:l(),autolinkEmail:re,autolinkProtocol:H,blockQuote:l(),characterEscapeValue:N,characterReferenceMarkerHexadecimal:z,characterReferenceMarkerNumeric:z,characterReferenceValue:R,codeFenced:l(b),codeFencedFence:f,codeFencedFenceInfo:m,codeFencedFenceMeta:g,codeFlowValue:N,codeIndented:l(v),codeText:l(I),codeTextData:N,data:N,definition:l(),definitionDestinationString:x,definitionLabelString:E,definitionTitleString:k,emphasis:l(),hardBreakEscape:l(_),hardBreakTrailing:l(_),htmlFlow:l(B),htmlFlowData:N,htmlText:l(j),htmlTextData:N,image:l(V),label:ae,labelText:Q,lineEnding:L,link:l(G),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:T,resourceDestinationString:D,resourceTitleString:M,resource:W,setextHeading:l(q),setextHeadingLineSequence:S,setextHeadingText:A,strong:l(),thematicBreak:l()}};Hf(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(U){let ie={type:"root",children:[]};const pe={stack:[ie],tokenStack:[],config:t,enter:o,exit:u,buffer:s,resume:c,data:n},ve=[];let we=-1;for(;++we<U.length;)if(U[we][1].type==="listOrdered"||U[we][1].type==="listUnordered")if(U[we][0]==="enter")ve.push(we);else{const Ke=ve.pop();we=a(U,Ke,we)}for(we=-1;++we<U.length;){const Ke=t[U[we][0]];Uf.call(Ke,U[we][1].type)&&Ke[U[we][1].type].call(Object.assign({sliceSerialize:U[we][2].sliceSerialize},pe),U[we][1])}if(pe.tokenStack.length>0){const Ke=pe.tokenStack[pe.tokenStack.length-1];(Ke[1]||cc).call(pe,void 0,Ke[0])}for(ie.position={start:tn(U.length>0?U[0][1].start:{line:1,column:1,offset:0}),end:tn(U.length>0?U[U.length-2][1].end:{line:1,column:1,offset:0})},we=-1;++we<t.transforms.length;)ie=t.transforms[we](ie)||ie;return ie}function a(U,ie,pe){let ve=ie-1,we=-1,Ke=!1,Qe,mt,qt,kt;for(;++ve<=pe;){const et=U[ve];switch(et[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{et[0]==="enter"?we++:we--,kt=void 0;break}case"lineEndingBlank":{et[0]==="enter"&&(Qe&&!kt&&!we&&!qt&&(qt=ve),kt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:kt=void 0}if(!we&&et[0]==="enter"&&et[1].type==="listItemPrefix"||we===-1&&et[0]==="exit"&&(et[1].type==="listUnordered"||et[1].type==="listOrdered")){if(Qe){let St=ve;for(mt=void 0;St--;){const pt=U[St];if(pt[1].type==="lineEnding"||pt[1].type==="lineEndingBlank"){if(pt[0]==="exit")continue;mt&&(U[mt][1].type="lineEndingBlank",Ke=!0),pt[1].type="lineEnding",mt=St}else if(!(pt[1].type==="linePrefix"||pt[1].type==="blockQuotePrefix"||pt[1].type==="blockQuotePrefixWhitespace"||pt[1].type==="blockQuoteMarker"||pt[1].type==="listItemIndent"))break}qt&&(!mt||qt<mt)&&(Qe._spread=!0),Qe.end=Object.assign({},mt?U[mt][1].start:et[1].end),U.splice(mt||ve,0,["exit",Qe,et[2]]),ve++,pe++}if(et[1].type==="listItemPrefix"){const St={type:"listItem",_spread:!1,start:Object.assign({},et[1].start),end:void 0};Qe=St,U.splice(ve,0,["enter",St,et[2]]),ve++,pe++,qt=void 0,kt=!0}}}return U[ie][1]._spread=Ke,pe}function i(U,ie){return pe;function pe(ve){o.call(this,U(ve),ve),ie&&ie.call(this,ve)}}function s(){this.stack.push({type:"fragment",children:[]})}function o(U,ie,pe){this.stack[this.stack.length-1].children.push(U),this.stack.push(U),this.tokenStack.push([ie,pe]),U.position={start:tn(ie.start),end:void 0}}function l(U){return ie;function ie(pe){U&&U.call(this,pe),u.call(this,pe)}}function u(U,ie){const pe=this.stack.pop(),ve=this.tokenStack.pop();if(ve)ve[0].type!==U.type&&(ie?ie.call(this,U,ve[0]):(ve[1]||cc).call(this,U,ve[0]));else throw new Error("Cannot close `"+U.type+"` ("+_r({start:U.start,end:U.end})+"): it’s not open");pe.position.end=tn(U.end)}function c(){return RC(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function p(U){if(this.data.expectingFirstListItemValue){const ie=this.stack[this.stack.length-2];ie.start=Number.parseInt(this.sliceSerialize(U),10),this.data.expectingFirstListItemValue=void 0}}function m(){const U=this.resume(),ie=this.stack[this.stack.length-1];ie.lang=U}function g(){const U=this.resume(),ie=this.stack[this.stack.length-1];ie.meta=U}function f(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const U=this.resume(),ie=this.stack[this.stack.length-1];ie.value=U.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const U=this.resume(),ie=this.stack[this.stack.length-1];ie.value=U.replace(/(\r?\n|\r)$/g,"")}function E(U){const ie=this.resume(),pe=this.stack[this.stack.length-1];pe.label=ie,pe.identifier=Yn(this.sliceSerialize(U)).toLowerCase()}function k(){const U=this.resume(),ie=this.stack[this.stack.length-1];ie.title=U}function x(){const U=this.resume(),ie=this.stack[this.stack.length-1];ie.url=U}function w(U){const ie=this.stack[this.stack.length-1];if(!ie.depth){const pe=this.sliceSerialize(U).length;ie.depth=pe}}function A(){this.data.setextHeadingSlurpLineEnding=!0}function S(U){const ie=this.stack[this.stack.length-1];ie.depth=this.sliceSerialize(U).codePointAt(0)===61?1:2}function q(){this.data.setextHeadingSlurpLineEnding=void 0}function $(U){const pe=this.stack[this.stack.length-1].children;let ve=pe[pe.length-1];(!ve||ve.type!=="text")&&(ve=He(),ve.position={start:tn(U.start),end:void 0},pe.push(ve)),this.stack.push(ve)}function N(U){const ie=this.stack.pop();ie.value+=this.sliceSerialize(U),ie.position.end=tn(U.end)}function L(U){const ie=this.stack[this.stack.length-1];if(this.data.atHardBreak){const pe=ie.children[ie.children.length-1];pe.position.end=tn(U.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ie.type)&&($.call(this,U),N.call(this,U))}function _(){this.data.atHardBreak=!0}function B(){const U=this.resume(),ie=this.stack[this.stack.length-1];ie.value=U}function j(){const U=this.resume(),ie=this.stack[this.stack.length-1];ie.value=U}function I(){const U=this.resume(),ie=this.stack[this.stack.length-1];ie.value=U}function G(){const U=this.stack[this.stack.length-1];if(this.data.inReference){const ie=this.data.referenceType||"shortcut";U.type+="Reference",U.referenceType=ie,delete U.url,delete U.title}else delete U.identifier,delete U.label;this.data.referenceType=void 0}function V(){const U=this.stack[this.stack.length-1];if(this.data.inReference){const ie=this.data.referenceType||"shortcut";U.type+="Reference",U.referenceType=ie,delete U.url,delete U.title}else delete U.identifier,delete U.label;this.data.referenceType=void 0}function Q(U){const ie=this.sliceSerialize(U),pe=this.stack[this.stack.length-2];pe.label=Nx(ie),pe.identifier=Yn(ie).toLowerCase()}function ae(){const U=this.stack[this.stack.length-1],ie=this.resume(),pe=this.stack[this.stack.length-1];if(this.data.inReference=!0,pe.type==="link"){const ve=U.children;pe.children=ve}else pe.alt=ie}function D(){const U=this.resume(),ie=this.stack[this.stack.length-1];ie.url=U}function M(){const U=this.resume(),ie=this.stack[this.stack.length-1];ie.title=U}function W(){this.data.inReference=void 0}function F(){this.data.referenceType="collapsed"}function T(U){const ie=this.resume(),pe=this.stack[this.stack.length-1];pe.label=ie,pe.identifier=Yn(this.sliceSerialize(U)).toLowerCase(),this.data.referenceType="full"}function z(U){this.data.characterReferenceType=U.type}function R(U){const ie=this.sliceSerialize(U),pe=this.data.characterReferenceType;let ve;pe?(ve=Pf(ie,pe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ve=ko(ie);const we=this.stack.pop();we.value+=ve,we.position.end=tn(U.end)}function H(U){N.call(this,U);const ie=this.stack[this.stack.length-1];ie.url=this.sliceSerialize(U)}function re(U){N.call(this,U);const ie=this.stack[this.stack.length-1];ie.url="mailto:"+this.sliceSerialize(U)}function X(){return{type:"blockquote",children:[]}}function ne(){return{type:"code",lang:null,meta:null,value:""}}function le(){return{type:"inlineCode",value:""}}function ee(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function he(){return{type:"emphasis",children:[]}}function me(){return{type:"heading",depth:0,children:[]}}function ye(){return{type:"break"}}function Be(){return{type:"html",value:""}}function Ae(){return{type:"image",title:null,url:"",alt:null}}function Ue(){return{type:"link",title:null,url:"",children:[]}}function Se(U){return{type:"list",ordered:U.type==="listOrdered",start:null,spread:U._spread,children:[]}}function Te(U){return{type:"listItem",spread:U._spread,checked:null,children:[]}}function Ne(){return{type:"paragraph",children:[]}}function _e(){return{type:"strong",children:[]}}function He(){return{type:"text",value:""}}function ge(){return{type:"thematicBreak"}}}function tn(e){return{line:e.line,column:e.column,offset:e.offset}}function Hf(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Hf(e,r):$x(e,r)}}function $x(e,t){let n;for(n in t)if(Uf.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function cc(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+_r({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+_r({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+_r({start:t.start,end:t.end})+") is still open")}function Lx(e){const t=this;t.parser=n;function n(r){return Mx(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Vf(e,t){var l,u,c;const n={...Vn,...t==null?void 0:t.nodeTypes,[Z.heading]:{...Vn[Z.heading],...(l=t==null?void 0:t.nodeTypes)==null?void 0:l[Z.heading]}},r=(t==null?void 0:t.linkDestinationKey)??"link",a=(t==null?void 0:t.imageSourceKey)??"link",i=(t==null?void 0:t.imageCaptionKey)??"caption";let s=[{text:""}];const o=e.children;switch(o&&Array.isArray(o)&&o.length>0&&(s=o.flatMap(h=>Vf({...h,ordered:e.ordered||!1},t))),e.type){case st.heading:return{type:n[Z.heading][e.depth||1],children:s};case st.list:return{type:e.ordered?n[Z.ol]:n[Z.ul],children:s};case st.listItem:return{type:n[Z.li],children:s};case st.paragraph:return{type:n[Z.paragraph],children:s};case st.link:return{type:n[Z.link],[r]:e.url,children:s};case st.image:return{type:n[Z.image],children:[{text:""}],[a]:e.url,[i]:e.alt};case st.blockquote:return{type:n[Z.blockquote],children:s};case st.code:return{type:n[Z.codeblock],language:e.lang,children:[{text:e.value}]};case st.html:return(u=e.value)!=null&&u.includes("<br>")?{break:!0,type:n[Z.paragraph],children:[{text:((c=e.value)==null?void 0:c.replace(/<br>/g,""))||""}]}:{type:Z.paragraph,children:[{text:e.value||""}]};case st.emphasis:return{[n[Mt.emphasis]]:!0,...Zi(s),...ca(s)};case st.strong:return{[n[Mt.strong]]:!0,...Zi(s),...ca(s)};case st.delete:return{[n[Mt.delete]]:!0,...Zi(s),...ca(s)};case st.inlineCode:return{[n[Mt.code]]:!0,text:e.value,...ca(s)};case st.thematicBreak:return{type:n[Z.hr],children:[{text:""}]};case"text":default:return{text:e.value||""}}}const Zi=e=>({text:e.map(t=>t==null?void 0:t.text).join("")});function ca(e){return e.reduce((t,n)=>(Object.keys(n).forEach(function(r){r==="children"||r==="type"||r==="text"||(t[r]=n[r])}),t),{})}const zx=function(t){const n=r=>r.children.map(a=>Vf(a,t));this.Compiler=n},qx=(e,t=n=>{})=>{SC().use(Lx).use(zx).process(e).then(n=>{const r=yn(n.result),a=s=>{const o=s;[Z.li,Z.blockquote].includes(o.type)&&o.children.map((l,u)=>{const c=l;c.type===Z.paragraph&&o.children.splice(u,1,...c.children)}),"children"in s&&s.children&&s.children.forEach(l=>a(l))};r.forEach(a);const i=s=>{for(let o=0;o<s.length;o++){const l=s[o],u=l;if(u.type===Z.link){const c=u.children&&u.children[0];if(c&&"text"in c&&c.text.includes(Ns)){const h=u,p=c.text.replace(Ns,""),m="link"in h&&h.link?h.link:"";h.type=Z.mention,h.id=m,h.name=p,h.children=[{text:""}],s[o+1]||s.splice(o+1,0,{text:" "}),o++}}"children"in l&&l.children&&i(l.children)}};i(r),r.map(s=>{"children"in s&&s.children&&s.children.map((o,l)=>{if("text"in o&&o.text){const u=o.text.match(/~~(.*?)~~/g);u&&u.map(c=>{const h=c.replace(/~~/g,""),p=o.text.indexOf(c),m=o.text.substring(0,p),g=o.text.substring(p+c.length),f=[{text:m},{text:h,[Z.strikethrough]:!0},{text:g}];s.children.splice(l,1,...f)})}})}),t(r)})},Ao=e=>{const t=document.getElementById(e);if(t){const n=t.querySelector(".input");n&&(n==null||n.focus())}},Wx=(e,t)=>{const{selection:n}=e;if(!n)return[null,null];let[r,a]=y.parent(e,n,{edge:"end"}),i=r;for(;i.type!==t&&a.length>0&&a.length!==1;)a=P.parent(a),r=ue.get(e,a),i=r;return i.type===t?[r,a]:[null,null]},Ux=e=>{const{selection:t}=e;return t?y.string(e,t):null},dc=e=>{let t="";for(const n of ue.descendants(e)){const[r]=n,a=r;a.text&&(t+=a.text)}return t},fc={"mod+b":Z.bold,"mod+i":Z.italic,"mod+shift+x":Z.strikethrough,"mod+k":Z.link,"mod+shift+7":Z.ol,"mod+shift+8":Z.ul,"mod+shift+9":Z.blockquote},Hx=(e,t,n,r)=>{for(const a in fc)if(My(a,e)){e.stopPropagation(),e.preventDefault();const i=fc[a];if(i===Z.link){n([{type:"showLinkEditor",value:!0}]);return}if(nw(i)){eh(t,i,r);return}Qf(t,i,r)}},Kf=(e,t,n,r)=>{var c;const{selectedUser:a,possibleUsers:i}=t,s=i[a];if(!s)return;const o=s.userId||"",l=(c=s.user)==null?void 0:c.name;n([{type:"mentionPopover",value:{...t,show:!1}}]);const u={type:Z.mention,id:o,name:l,children:[{text:""}]};J.select(e,(t==null?void 0:t.position)||Tf),J.insertNodes(e,[u,{text:" "}]),J.move(e,{distance:1,unit:"offset"}),Ao(r)},Vx=async({editor:e,isShowing:t,numberOfUsers:n,listMembers:r,dispatch:a})=>{const{selection:i}=e;if(i&&K.isCollapsed(i)){const[s]=K.edges(i),o=y.start(e,s.path),l=y.range(e,o,s),c=y.string(e,l).match(zc);if(c){const h=c.index||0,p={path:s.path,offset:h},m={path:s.path,offset:h+c[0].length},g=y.range(e,p,m),f=y.after(e,s),b=y.range(e,s,f);if(y.string(e,b).match(/^(\s|\.|,|\?|!|:|;|'|"|`|$)/)){const k=c[1];let x=[];r&&(x=await r({name:k})),a([{type:"mentionPopover",value:{show:x.length>0?!0:n!==null,selectedUser:0,possibleUsers:x,position:x.length>0?g:null,numberOfUsers:x.length>0?x.length:null}}]);return}}}t&&a([{type:"mentionPopover",value:{show:!1,selectedUser:0,possibleUsers:[],position:null,numberOfUsers:null}}])},Zf=e=>{let t=document.body;if(e!==!1){const n=document.getElementById(e);n&&(t=n)}return t},$n=e=>typeof e.text=="string",Kx=[Z.hr,Z.image,Z.mention],hc="<br>";function Yf(e,t={nodeTypes:Vn}){const{nodeTypes:n=Vn,ignoreParagraphNewline:r=!1,listDepth:a=0}=t,i=e.text||"";let s=e.type||"";const o={...Vn,...n,heading:{...Vn[Z.heading],...n[Z.heading]}},l=[o[Z.ul],o[Z.ol]];let u=i;if(!$n(e)&&s!==Z.mention&&(u=e.children.map(c=>{const h=$n(c)?!1:l.includes(c.type||""),p=l.includes(e.type||"");let m=!1;return!$n(e)&&Array.isArray(e.children)&&(m=e.children.some(g=>!$n(g)&&g.type===o.link)),Yf({...c,parentType:s},{nodeTypes:o,ignoreParagraphNewline:(r||h||p||m)&&!c.break,listDepth:l.includes(c.type||"")?a+1:a,inBlockquote:s===o[Z.blockquote]||e.parentType===o[Z.blockquote]})}).join("")),!r&&(i===""||i===`
142
+ `)&&e.parentType===o[Z.paragraph]&&s!==o[Z.mention]&&(s=o[Z.paragraph],u=hc),!(u===""&&!Kx.find(c=>o[c]===s)))switch(u!==hc&&$n(e)&&(e[Z.strikethrough]&&e[Z.bold]&&e[Z.italic]?u=Ln(u,"~~***"):e[Z.bold]&&e[Z.italic]?u=Ln(u,"***"):(e[Z.bold]&&(u=Ln(u,"**")),e[Z.italic]&&(u=Ln(u,"_")),e[Z.strikethrough]&&(u=Ln(u,"~~")),e[Z.code]&&(u=Ln(u,"`")))),s){case o[Z.heading][1]:return`# ${u}
143
+ `;case o[Z.heading][2]:return`## ${u}
144
+ `;case o[Z.heading][3]:return`### ${u}
145
+ `;case o[Z.heading][4]:return`#### ${u}
146
+ `;case o[Z.heading][5]:return`##### ${u}
147
+ `;case o[Z.heading][6]:return`###### ${u}
148
+ `;case o[Z.blockquote]:return`> ${u}
149
+
150
+ `;case o[Z.codeblock]:return`\`\`\`${e.language||""}
151
151
  ${u}
152
152
  \`\`\`
153
- `;case o[Y.link]:return`[${u}](${e.link||""})`;case o.image:return`![${e.caption}](${e.link||""})`;case o[Y.mention]:const{id:c}=e;return e?`@{{${c}}}`:u;case o[Y.ul]:case o[Y.ol]:return`
153
+ `;case o[Z.link]:return`[${u}](${e.link||""})`;case o.image:return`![${e.caption}](${e.link||""})`;case o[Z.mention]:const{id:c}=e;return e?`@{{${c}}}`:u;case o[Z.ul]:case o[Z.ol]:return`
154
154
  ${u}
155
155
 
156
- `;case o[Y.li]:const h=e&&e.parentType===o[Y.ol],p=e.children.length===1&&$n(e.children[0]);let m="";for(let g=0;a>g;g++)h?m+=" ":m+=" ";return t.inBlockquote&&(m="> "+m),`
156
+ `;case o[Z.li]:const h=e&&e.parentType===o[Z.ol],p=e.children.length===1&&$n(e.children[0]);let m="";for(let g=0;a>g;g++)h?m+=" ":m+=" ";return t.inBlockquote&&(m="> "+m),`
157
157
  ${m}${h?"1.":"-"} ${u}${p?`
158
- `:""}`;case o[Y.paragraph]:return`${u}
158
+ `:""}`;case o[Z.paragraph]:return`${u}
159
159
 
160
- `;case o[Y.hr]:return`---
161
- `;default:return u}}function Ln(e,t){const n=e.trim(),r=n,a=`${t}${r}${pc(t)}`;if(r.length===e.length)return a;const i=t+r+pc(t);return e.replace(n,i)}const pc=e=>e.split("").reverse().join(""),Qx=e=>e.map(t=>Gf(t)).join("").trim();const Jx=({onFallbackClick:e=()=>{}})=>{const t=se.useIntl(),n=On(),{dispatch:r,isInOverlay:a,mentionPopover:i,id:s,onMention:o}=y.useContext(Xt),{show:l,selectedUser:u,possibleUsers:c}=i,h=jf(n,"mention-popover",`toolbar-${s}`);if(!l)return d.jsx(d.Fragment,{});const p=Yf(a);return d.jsx(Ya,{parent:p,children:d.jsx(Yc,{ref:h,className:"mention-popover",onKeyDown:m=>{m.key==="Escape"&&(m.preventDefault(),m.stopPropagation(),r([{type:"showMentionPopover",value:!1}]))},children:d.jsxs("ul",{children:[c.map(({userId:m,user:g},f)=>d.jsx(_n,{element:"li",className:G({selected:f===u}),member:{id:m,...g,link:!1},functions:{onClick:b=>{b.preventDefault(),b.stopPropagation();const v={...i,selectedUser:f};r([{type:"mentionPopover",value:v}]),Zf(n,v,r,s),o&&o({id:m||"",name:g.name||""})}}},m)),d.jsx(_n,{element:"li",className:G("fallback",{selected:c.length===u}),member:{id:"0",name:t.formatMessage({id:"richTextEditor_mention_fallback"}),image:{thumbnail:`${Lt}icons/invite-user.svg`},link:!1},functions:{onClick:m=>{m.preventDefault(),m.stopPropagation(),e(),r([{type:"mentionPopover",value:{show:!1,selectedUser:0,possibleUsers:[],position:null}}])}}})]})})})},To=({id:e,active:t,hasDivider:n=!1,callback:r,className:a="",children:i,...s})=>{const o=se.useIntl(),l=On(),{id:u,tabbableOption:c,setFocus:h,openTooltip:p,dispatch:m}=y.useContext(Xt),g={};return e!==c&&(g.tabIndex=-1),d.jsxs("li",{id:`${u}-${e}`,className:G(e,{"has-divider":n}),onMouseEnter:()=>{m([{type:"openTooltip",value:e}])},onMouseLeave:()=>{m([{type:"openTooltip",value:null}])},onFocus:()=>{m([{type:"openTooltip",value:e}])},onBlur:f=>{f.stopPropagation();const b=[{type:"openTooltip",value:null}];l.selection&&b.push({type:"lastAnchor",value:l.selection.anchor}),m(b)},contentEditable:!1,children:[d.jsxs("button",{...s,...g,className:G(e,a,{active:t}),onClick:f=>{f.stopPropagation(),f.preventDefault()},onMouseDown:f=>{f.stopPropagation(),f.preventDefault(),r()},onKeyDown:f=>{var b,v,E,k;if(f.key!=="Tab")switch(f.key){case"Enter":f.stopPropagation(),f.preventDefault(),r();break;case"ArrowLeft":case"ArrowRight":f.stopPropagation(),f.preventDefault();const x=f.currentTarget.closest("li");let w=x==null?void 0:x.nextElementSibling;if(f.key==="ArrowLeft"){const W=x==null?void 0:x.previousElementSibling;W?w=W:w=(b=x==null?void 0:x.parentElement)==null?void 0:b.lastElementChild}else w||(w=(v=x==null?void 0:x.parentElement)==null?void 0:v.firstElementChild);const A=w==null?void 0:w.className.split(" ")[0];A&&(h(A),(E=w==null?void 0:w.querySelector("button"))==null||E.focus());break;default:const S=f.currentTarget.closest("fieldset");if(S){(k=S==null?void 0:S.previousElementSibling)==null||k.focus();break}}},children:[d.jsx(Ie,{showOnFocus:!1,children:o.formatMessage({id:`richTextEditor_${e}`})}),d.jsx(Sn,{id:`tooltip-${e}`,styling:{extraPadding:!1,hasPointer:"bottom"},isOpen:p===e,"aria-hidden":!0,children:o.formatMessage({id:`richTextEditor_${e}`})})]}),i]})},gc=[Y.ol,Y.ul],Qf=(e,t)=>{const{selection:n}=e;if(!n)return!1;const[r]=Array.from(C.nodes(e,{at:C.unhangRange(e,n),match:a=>{const i=a;return!C.isEditor(a)&&de.isElement(a)&&i.type===t}}));return!!r},Xx=e=>{const[t]=C.nodes(e,{match:n=>n.type===Y.blockquote});return!!t},Jf=(e,t,n)=>{try{const r=Xx(e),a=Qf(e,t),i=gc.includes(t);X.unwrapNodes(e,{match:l=>{const u=l;return!C.isEditor(u)&&de.isElement(u)&&gc.includes(u.type)},split:!0});const o={type:a?Y.paragraph:i?Y.li:t};if(X.setNodes(e,o),i)if(a){const{selection:l}=e;if(!l)return;const[u,c]=C.parent(e,l,{edge:"end"});Array.from(C.nodes(e,{at:c,match:p=>{const m=p;return!C.isEditor(p)&&de.isElement(p)&&m.type===Y.li}})).forEach(([p,m])=>{ue.string(p).trim()===""&&X.removeNodes(e,{at:m})})}else{if(r){const u={type:Y.blockquote,children:[]};X.wrapNodes(e,u)}const l={type:t,children:[]};X.wrapNodes(e,l)}}catch(r){const a=r.message;n(`Error toggling block: ${a}`)}},ew=({format:e,hasDivider:t=!1})=>{const{setFocus:n,reportError:r}=y.useContext(Xt),a=On(),i=Qf(a,e);return d.jsx(To,{id:e,active:i,hasDivider:t,callback:()=>{Jf(a,e,r),n(i?null:e)}})},Br=e=>{const[t]=C.nodes(e,{match:n=>{const r=n;return!C.isEditor(n)&&de.isElement(n)&&r.type===Y.link}});return!!t},tw=(e,t,n,r)=>{e.selection&&So(e,t,n,r)},nw=(e,t,n,r)=>{const{selection:a}=e;if(a&&Z.isCollapsed(a)){const[s]=C.nodes(e,{match:o=>{const l=o;return!C.isEditor(o)&&de.isElement(o)&&l.type===Y.link}});if(s){const[o,l]=s,u={link:t};X.setNodes(e,u,{at:l}),Ao(n)}}else So(e,t,n,r)},So=(e,t,n,r=a=>{console.error(a)})=>{try{Br(e)&&Xf(e);const{selection:a}=e,i=a&&Z.isCollapsed(a),s={type:Y.link,link:t,children:i?[{text:t}]:[]};i?(X.insertNodes(e,s),X.move(e,{distance:1,unit:"offset"})):(X.wrapNodes(e,s,{split:!0}),X.collapse(e,{edge:"end"}),X.insertNodes(e,{text:""}),X.move(e,{distance:1,unit:"offset"})),Ao(n)}catch(a){const i=a.message;r(`Error in wrapLink: ${i}`)}},Xf=e=>{X.unwrapNodes(e,{match:t=>{const n=t;return!C.isEditor(t)&&de.isElement(t)&&n.type===Y.link}})};let Yi=null;const rw=()=>{const e=se.useIntl(),t="richTextEditor_link_",{id:n,showLinkEditor:r,isInOverlay:a,dispatch:i,reportError:s}=y.useContext(Xt),o=On(),l=gC(o),u=(l==null?void 0:l.text)||Kx(o),[c,h]=y.useState(Br(o)),p=jf(o,"link-editor",`${n}-link`),m=y.useRef(null);y.useEffect(()=>{var E;!c&&r&&((E=m.current)==null||E.focus())},[c]),y.useEffect(()=>{Yi&&clearTimeout(Yi),Yi=setTimeout(()=>{h(Br(o))},500)},[o.selection]);const g=[],f=["open","edit","remove"].map(E=>{const k={variant:"tertiary",size:"small",children:e.formatMessage({id:`${t}${E}`},{link:l==null?void 0:l.pretty})};switch(g.push({className:E}),E){case"open":k.href=(l==null?void 0:l.full)||"",k.onClick=x=>{x.preventDefault(),x.stopPropagation(),window.open((l==null?void 0:l.full)||"","_blank"),i([{type:"showLinkEditor",value:!1}])},k.children=d.jsxs(d.Fragment,{children:[k.children,d.jsx(Ie,{children:e.formatMessage({id:`${t}${E}_text`})})]});break;case"edit":k.onClick=()=>{h(!1)};break;case"remove":k.onClick=()=>{const x=[{type:"showLinkEditor",value:!1}];Br(o)&&(Xf(o),x.push({type:"lastAnchor",value:null})),i(x)};break}return k}),b=[{id:"url",type:"url",inputRef:m,label:e.formatMessage({id:`${t}url`}),placeholder:e.formatMessage({id:`${t}placeholder`}),value:(l==null?void 0:l.full)||"",validation:[{condition:"required",error:e.formatMessage({id:`${t}error_required`})},{condition:"valid-url"}],submitOnEnter:!0,autoFocus:!0}];u&&b.unshift({component:()=>d.jsxs("p",{children:[d.jsx("strong",{"aria-label":e.formatMessage({id:`${t}text_aria`}),children:e.formatMessage({id:`${t}text`})})," ",u]})});const v=Yf(a);return d.jsx(Ya,{parent:v,children:d.jsx(Sn,{ref:p,id:`${n}-link-editor`,className:"link-editor",isOpen:r,styling:{extraPadding:!1,hasForm:!c},functions:{onBlur:()=>{i([{type:"showLinkEditor",value:!1}])}},callbacks:{onOpen:()=>{setTimeout(()=>{var E;return(E=m.current)==null?void 0:E.focus()})}},children:c?d.jsx(ir,{wrappers:g,buttons:f}):d.jsx(Qt,{element:"fieldset",id:`${n}-link-editor`,className:G({"show-labels":u}),meta:{shouldReset:!0,showRequiredLabels:!1},functions:{onSuccess:async E=>{setTimeout(()=>{const k=[{type:"showLinkEditor",value:!1}];if(E.url){const{full:x}=Kc(E.url);l!=null&&l.full?nw(o,x,n,s):tw(o,x,n,s),k.push({type:"lastAnchor",value:null})}i(k)})}},fields:b,button:{text:e.formatMessage({id:`${t}button`}),variant:"tertiary",size:"small"}})})})},aw=()=>{const e=On(),{setFocus:t,dispatch:n}=y.useContext(Xt),[r,a]=y.useState(!1);return y.useEffect(()=>{a(Br(e))},[e.selection]),d.jsx(To,{id:"link",active:r,hasDivider:!0,callback:()=>{n([{type:"showLinkEditor",value:!0}]),t(r?null:"link"),a(!0)}})},iw=e=>[Y.bold,Y.italic,Y.strikethrough].includes(e),eh=(e,t)=>{const n=C.marks(e);return n?n[t]===!0:!1},th=(e,t,n)=>{try{eh(e,t)?C.removeMark(e,t):C.addMark(e,t,!0)}catch(r){const a=r.message;n(`Error toggling mark: ${a}`)}},sw=({format:e,hasDivider:t=!1})=>{const{setFocus:n,reportError:r}=y.useContext(Xt),a=On(),i=eh(a,e);return d.jsx(To,{id:e,active:i,hasDivider:t,callback:()=>{th(a,e,r),n(i?null:e)}})},$a=[Y.bold,Y.italic,Y.strikethrough],ow=[Y.ol,Y.ul,Y.blockquote];const uw=({...e})=>{const t=se.useIntl(),{id:n}=y.useContext(Xt);return d.jsxs(d.Fragment,{children:[d.jsxs("fieldset",{id:`toolbar-${n}`,className:"toolbar",...e,children:[d.jsx(Ie,{element:"legend",showOnFocus:!1,children:t.formatMessage({id:"richTextEditor_toolbar"})}),d.jsxs("ul",{children:[$a.map((r,a)=>d.jsx(sw,{format:r,hasDivider:a===$a.length-1},r)),d.jsx(aw,{}),ow.map((r,a)=>d.jsx(ew,{format:r,hasDivider:a===1},r))]})]}),d.jsx(rw,{})]})};var lw=hw,cw=/^(?:\w+:)?\/\/(\S+)$/,dw=/^localhost[\:?\d]*(?:[^\:?\d]\S*)?$/,fw=/^[^\s\.]+\.\S{2,}$/;function hw(e){if(typeof e!="string")return!1;var t=e.match(cw);if(!t)return!1;var n=t[1];return n?!!(dw.test(n)||fw.test(n)):!1}const mw=Tn(lw),pw=(e,t,n)=>{const{insertText:r,isInline:a}=e;try{e.isInline=i=>{const s=i;return[Y.link].includes(s.type)||a(i)},e.insertText=i=>{i&&mw(i)?So(e,i,t):r(i)}}catch(i){const s=i.message;n(`Error in withInlines: ${s}`)}return e},gw=(e,t)=>{const{isInline:n,isVoid:r,markableVoid:a}=e;try{e.isInline=i=>i.type===Y.mention?!0:n(i),e.isVoid=i=>i.type===Y.mention?!0:r(i),e.markableVoid=i=>i.type===Y.mention||a(i)}catch(i){const s=i.message;t(`Error in withMentions: ${s}`)}return e},vw=(e,t)=>{const{normalizeNode:n}=e;try{e.normalizeNode=([r,a])=>{if(r.type===Y.link&&ue.string(r).trim()===""){X.removeNodes(e,{at:a});return}n([r,a])}}catch(r){const a=r.message;t(`Error in withoutEmptyLinks: ${a}`)}return e};const nh=({id:e="rich-text-editor",value:t,placeholder:n,maxLength:r=0,meta:a,functions:i,autoFocus:s,data:o,...l})=>{const u=se.useIntl(),c=Jh();typeof s>"u"&&(s=!0);const{isInOverlay:h=!1}=a||{},{listMembers:p,clickMentionFallback:m,onChange:g=()=>{},onMention:f=()=>{},reportError:b=L=>{console.error(L)}}=i||{},v=[{type:Y.paragraph,children:[{text:""}]}];t==="<br>"&&(t="");const E={editorKey:null,originalValue:t||"",initialValue:t?null:v,tabbableOption:$a[0],openTooltip:null,showLinkEditor:!1,mentionPopover:{show:!1,selectedUser:0,possibleUsers:[],position:null,numberOfUsers:null},lastAnchor:null,stringValue:"",lastKey:null,hasInteracted:!1,hasLoaded:!1},[k,x]=y.useReducer(Lr,E),{editorKey:w,originalValue:A,initialValue:S,stringValue:W,lastAnchor:R,lastKey:I,hasInteracted:N,hasLoaded:_,mentionPopover:F}=k,j=L=>{const q=L||$a[0];L&&x([{type:"tabbableOption",value:q}])},$=`rte-${e}`,V=y.useCallback(L=>d.jsx(mC,{...L}),[]),K=y.useCallback(L=>d.jsx(pC,{...L}),[]),Q=y.useMemo(()=>pw(gw(vw(tb(fC(X0())),b),b),$,b),[]);y.useEffect(()=>{if(!t)return;Ar.lastIndex=0;const L=t.match(Ar);!L||L.length>1||L[0].length!==t.length||N||x([{type:"originalValue",value:t}])},[t]);const ae=L=>{if(!Q||L!==$)return;const q=C.end(Q,[]);X.select(Q,q),te.focus(Q)};y.useEffect(()=>{const L=q=>{var z;const B=q,T=((z=B==null?void 0:B.detail)==null?void 0:z.id)||null;T&&ae(T)};return window.addEventListener("focusEditor",L),()=>{window.removeEventListener("focusEditor",L)}},[]),y.useEffect(()=>{if(Q.children.length>0&&!_){if(x([{type:"hasLoaded",value:!0}]),!s)return;ae($)}},[Q.children.length,S]),y.useEffect(()=>{A&&(async()=>{let q=yn(A);if(q.includes("<")){Sr.prototype.escape=T=>T;const B=new Sr;B.addRule("br",{filter:["br"],replacement:T=>T+`
160
+ `;case o[Z.hr]:return`---
161
+ `;default:return u}}function Ln(e,t){const n=e.trim(),r=n,a=`${t}${r}${mc(t)}`;if(r.length===e.length)return a;const i=t+r+mc(t);return e.replace(n,i)}const mc=e=>e.split("").reverse().join(""),Zx=e=>e.map(t=>Yf(t)).join("").trim();const Yx=({onFallbackClick:e=()=>{}})=>{const t=oe.useIntl(),n=On(),{dispatch:r,isInOverlay:a,mentionPopover:i,id:s,onMention:o}=C.useContext(Xt),{show:l,selectedUser:u,possibleUsers:c}=i,h=Sf(n,"mention-popover",`toolbar-${s}`);if(!l)return d.jsx(d.Fragment,{});const p=Zf(a);return d.jsx(Ya,{parent:p,children:d.jsx(Zc,{ref:h,className:"mention-popover",onKeyDown:m=>{m.key==="Escape"&&(m.preventDefault(),m.stopPropagation(),r([{type:"showMentionPopover",value:!1}]))},children:d.jsxs("ul",{children:[c.map(({userId:m,user:g},f)=>d.jsx(_n,{element:"li",className:Y({selected:f===u}),member:{id:m,...g,link:!1},functions:{onClick:b=>{b.preventDefault(),b.stopPropagation();const v={...i,selectedUser:f};r([{type:"mentionPopover",value:v}]),Kf(n,v,r,s),o&&o({id:m||"",name:g.name||""})}}},m)),d.jsx(_n,{element:"li",className:Y("fallback",{selected:c.length===u}),member:{id:"0",name:t.formatMessage({id:"richTextEditor_mention_fallback"}),image:{thumbnail:`${Lt}icons/invite-user.svg`},link:!1},functions:{onClick:m=>{m.preventDefault(),m.stopPropagation(),e(),r([{type:"mentionPopover",value:{show:!1,selectedUser:0,possibleUsers:[],position:null}}])}}})]})})})},To=({id:e,active:t,hasDivider:n=!1,callback:r,className:a="",children:i,...s})=>{const o=oe.useIntl(),l=On(),{id:u,tabbableOption:c,setFocus:h,openTooltip:p,dispatch:m}=C.useContext(Xt),g={};return e!==c&&(g.tabIndex=-1),d.jsxs("li",{id:`${u}-${e}`,className:Y(e,{"has-divider":n}),onMouseEnter:()=>{m([{type:"openTooltip",value:e}])},onMouseLeave:()=>{m([{type:"openTooltip",value:null}])},onFocus:()=>{m([{type:"openTooltip",value:e}])},onBlur:f=>{f.stopPropagation();const b=[{type:"openTooltip",value:null}];l.selection&&b.push({type:"lastAnchor",value:l.selection.anchor}),m(b)},contentEditable:!1,children:[d.jsxs("button",{...s,...g,className:Y(e,a,{active:t}),onClick:f=>{f.stopPropagation(),f.preventDefault()},onMouseDown:f=>{f.stopPropagation(),f.preventDefault(),r()},onKeyDown:f=>{var b,v,E,k;if(f.key!=="Tab")switch(f.key){case"Enter":f.stopPropagation(),f.preventDefault(),r();break;case"ArrowLeft":case"ArrowRight":f.stopPropagation(),f.preventDefault();const x=f.currentTarget.closest("li");let w=x==null?void 0:x.nextElementSibling;if(f.key==="ArrowLeft"){const q=x==null?void 0:x.previousElementSibling;q?w=q:w=(b=x==null?void 0:x.parentElement)==null?void 0:b.lastElementChild}else w||(w=(v=x==null?void 0:x.parentElement)==null?void 0:v.firstElementChild);const A=w==null?void 0:w.className.split(" ")[0];A&&(h(A),(E=w==null?void 0:w.querySelector("button"))==null||E.focus());break;default:const S=f.currentTarget.closest("fieldset");if(S){(k=S==null?void 0:S.previousElementSibling)==null||k.focus();break}}},children:[d.jsx(Ie,{showOnFocus:!1,children:o.formatMessage({id:`richTextEditor_${e}`})}),d.jsx(Sn,{id:`tooltip-${e}`,styling:{extraPadding:!1,hasPointer:"bottom"},isOpen:p===e,"aria-hidden":!0,children:o.formatMessage({id:`richTextEditor_${e}`})})]}),i]})},pc=[Z.ol,Z.ul],Gf=(e,t)=>{const{selection:n}=e;if(!n)return!1;const[r]=Array.from(y.nodes(e,{at:y.unhangRange(e,n),match:a=>{const i=a;return!y.isEditor(a)&&de.isElement(a)&&i.type===t}}));return!!r},Gx=e=>{const[t]=y.nodes(e,{match:n=>n.type===Z.blockquote});return!!t},Qf=(e,t,n)=>{try{const r=Gx(e),a=Gf(e,t),i=pc.includes(t);J.unwrapNodes(e,{match:l=>{const u=l;return!y.isEditor(u)&&de.isElement(u)&&pc.includes(u.type)},split:!0});const o={type:a?Z.paragraph:i?Z.li:t};if(J.setNodes(e,o),i)if(a){const{selection:l}=e;if(!l)return;const[u,c]=y.parent(e,l,{edge:"end"});Array.from(y.nodes(e,{at:c,match:p=>{const m=p;return!y.isEditor(p)&&de.isElement(p)&&m.type===Z.li}})).forEach(([p,m])=>{ue.string(p).trim()===""&&J.removeNodes(e,{at:m})})}else{if(r){const u={type:Z.blockquote,children:[]};J.wrapNodes(e,u)}const l={type:t,children:[]};J.wrapNodes(e,l)}}catch(r){const a=r.message;n(`Error toggling block: ${a}`)}},Qx=({format:e,hasDivider:t=!1})=>{const{setFocus:n,reportError:r}=C.useContext(Xt),a=On(),i=Gf(a,e);return d.jsx(To,{id:e,active:i,hasDivider:t,callback:()=>{Qf(a,e,r),n(i?null:e)}})},Fr=e=>{const[t]=y.nodes(e,{match:n=>{const r=n;return!y.isEditor(n)&&de.isElement(n)&&r.type===Z.link}});return!!t},Jx=(e,t,n,r)=>{e.selection&&So(e,t,n,r)},Xx=(e,t,n,r)=>{const{selection:a}=e;if(a&&K.isCollapsed(a)){const[s]=y.nodes(e,{match:o=>{const l=o;return!y.isEditor(o)&&de.isElement(o)&&l.type===Z.link}});if(s){const[o,l]=s,u={link:t};J.setNodes(e,u,{at:l}),Ao(n)}}else So(e,t,n,r)},So=(e,t,n,r=a=>{console.error(a)})=>{try{Fr(e)&&Jf(e);const{selection:a}=e,i=a&&K.isCollapsed(a),s={type:Z.link,link:t,children:i?[{text:t}]:[]};i?(J.insertNodes(e,s),J.move(e,{distance:1,unit:"offset"})):(J.wrapNodes(e,s,{split:!0}),J.collapse(e,{edge:"end"}),J.insertNodes(e,{text:""}),J.move(e,{distance:1,unit:"offset"})),Ao(n)}catch(a){const i=a.message;r(`Error in wrapLink: ${i}`)}},Jf=e=>{J.unwrapNodes(e,{match:t=>{const n=t;return!y.isEditor(t)&&de.isElement(t)&&n.type===Z.link}})};let Yi=null;const ew=()=>{const e=oe.useIntl(),t="richTextEditor_link_",{id:n,showLinkEditor:r,isInOverlay:a,dispatch:i,reportError:s}=C.useContext(Xt),o=On(),l=hC(o),u=(l==null?void 0:l.text)||Ux(o),[c,h]=C.useState(Fr(o)),p=Sf(o,"link-editor",`${n}-link`),m=C.useRef(null);C.useEffect(()=>{var E;!c&&r&&((E=m.current)==null||E.focus())},[c]),C.useEffect(()=>{Yi&&clearTimeout(Yi),Yi=setTimeout(()=>{h(Fr(o))},500)},[o.selection]);const g=[],f=["open","edit","remove"].map(E=>{const k={variant:"tertiary",size:"small",children:e.formatMessage({id:`${t}${E}`},{link:l==null?void 0:l.pretty})};switch(g.push({className:E}),E){case"open":k.href=(l==null?void 0:l.full)||"",k.onClick=x=>{x.preventDefault(),x.stopPropagation(),window.open((l==null?void 0:l.full)||"","_blank"),i([{type:"showLinkEditor",value:!1}])},k.children=d.jsxs(d.Fragment,{children:[k.children,d.jsx(Ie,{children:e.formatMessage({id:`${t}${E}_text`})})]});break;case"edit":k.onClick=()=>{h(!1)};break;case"remove":k.onClick=()=>{const x=[{type:"showLinkEditor",value:!1}];Fr(o)&&(Jf(o),x.push({type:"lastAnchor",value:null})),i(x)};break}return k}),b=[{id:"url",type:"url",inputRef:m,label:e.formatMessage({id:`${t}url`}),placeholder:e.formatMessage({id:`${t}placeholder`}),value:(l==null?void 0:l.full)||"",validation:[{condition:"required",error:e.formatMessage({id:`${t}error_required`})},{condition:"valid-url"}],submitOnEnter:!0,autoFocus:!0}];u&&b.unshift({component:()=>d.jsxs("p",{children:[d.jsx("strong",{"aria-label":e.formatMessage({id:`${t}text_aria`}),children:e.formatMessage({id:`${t}text`})})," ",u]})});const v=Zf(a);return d.jsx(Ya,{parent:v,children:d.jsx(Sn,{ref:p,id:`${n}-link-editor`,className:"link-editor",isOpen:r,styling:{extraPadding:!1,hasForm:!c},functions:{onBlur:()=>{i([{type:"showLinkEditor",value:!1}])}},callbacks:{onOpen:()=>{setTimeout(()=>{var E;return(E=m.current)==null?void 0:E.focus()})}},children:c?d.jsx(ir,{wrappers:g,buttons:f}):d.jsx(Qt,{element:"fieldset",id:`${n}-link-editor`,className:Y({"show-labels":u}),meta:{shouldReset:!0,showRequiredLabels:!1},functions:{onSuccess:async E=>{setTimeout(()=>{const k=[{type:"showLinkEditor",value:!1}];if(E.url){const{full:x}=Vc(E.url);l!=null&&l.full?Xx(o,x,n,s):Jx(o,x,n,s),k.push({type:"lastAnchor",value:null})}i(k)})}},fields:b,button:{text:e.formatMessage({id:`${t}button`}),variant:"tertiary",size:"small"}})})})},tw=()=>{const e=On(),{setFocus:t,dispatch:n}=C.useContext(Xt),[r,a]=C.useState(!1);return C.useEffect(()=>{a(Fr(e))},[e.selection]),d.jsx(To,{id:"link",active:r,hasDivider:!0,callback:()=>{n([{type:"showLinkEditor",value:!0}]),t(r?null:"link"),a(!0)}})},nw=e=>[Z.bold,Z.italic,Z.strikethrough].includes(e),Xf=(e,t)=>{const n=y.marks(e);return n?n[t]===!0:!1},eh=(e,t,n)=>{try{Xf(e,t)?y.removeMark(e,t):y.addMark(e,t,!0)}catch(r){const a=r.message;n(`Error toggling mark: ${a}`)}},rw=({format:e,hasDivider:t=!1})=>{const{setFocus:n,reportError:r}=C.useContext(Xt),a=On(),i=Xf(a,e);return d.jsx(To,{id:e,active:i,hasDivider:t,callback:()=>{eh(a,e,r),n(i?null:e)}})},$a=[Z.bold,Z.italic,Z.strikethrough],aw=[Z.ol,Z.ul,Z.blockquote];const iw=({...e})=>{const t=oe.useIntl(),{id:n}=C.useContext(Xt);return d.jsxs(d.Fragment,{children:[d.jsxs("fieldset",{id:`toolbar-${n}`,className:"toolbar",...e,children:[d.jsx(Ie,{element:"legend",showOnFocus:!1,children:t.formatMessage({id:"richTextEditor_toolbar"})}),d.jsxs("ul",{children:[$a.map((r,a)=>d.jsx(rw,{format:r,hasDivider:a===$a.length-1},r)),d.jsx(tw,{}),aw.map((r,a)=>d.jsx(Qx,{format:r,hasDivider:a===1},r))]})]}),d.jsx(ew,{})]})};var sw=cw,ow=/^(?:\w+:)?\/\/(\S+)$/,uw=/^localhost[\:?\d]*(?:[^\:?\d]\S*)?$/,lw=/^[^\s\.]+\.\S{2,}$/;function cw(e){if(typeof e!="string")return!1;var t=e.match(ow);if(!t)return!1;var n=t[1];return n?!!(uw.test(n)||lw.test(n)):!1}const dw=Tn(sw),fw=(e,t,n)=>{const{insertText:r,isInline:a}=e;try{e.isInline=i=>{const s=i;return[Z.link].includes(s.type)||a(i)},e.insertText=i=>{i&&dw(i)?So(e,i,t):r(i)}}catch(i){const s=i.message;n(`Error in withInlines: ${s}`)}return e},hw=(e,t)=>{const{isInline:n,isVoid:r,markableVoid:a}=e;try{e.isInline=i=>i.type===Z.mention?!0:n(i),e.isVoid=i=>i.type===Z.mention?!0:r(i),e.markableVoid=i=>i.type===Z.mention||a(i)}catch(i){const s=i.message;t(`Error in withMentions: ${s}`)}return e},mw=(e,t)=>{const{normalizeNode:n}=e;try{e.normalizeNode=([r,a])=>{if(r.type===Z.link&&ue.string(r).trim()===""){J.removeNodes(e,{at:a});return}n([r,a])}}catch(r){const a=r.message;t(`Error in withoutEmptyLinks: ${a}`)}return e};const th=({id:e="rich-text-editor",value:t,placeholder:n,maxLength:r=0,meta:a,functions:i,autoFocus:s,data:o,...l})=>{const u=oe.useIntl(),c=Gh();typeof s>"u"&&(s=!0);const{isInOverlay:h=!1}=a||{},{listMembers:p,clickMentionFallback:m,onChange:g=()=>{},onMention:f=()=>{},reportError:b=M=>{console.error(M)}}=i||{},v=[{type:Z.paragraph,children:[{text:""}]}];t==="<br>"&&(t="");const E={editorKey:null,originalValue:t||"",initialValue:t?null:v,tabbableOption:$a[0],openTooltip:null,showLinkEditor:!1,mentionPopover:{show:!1,selectedUser:0,possibleUsers:[],position:null,numberOfUsers:null},lastAnchor:null,stringValue:"",lastKey:null,hasInteracted:!1,hasLoaded:!1},[k,x]=C.useReducer(Lr,E),{editorKey:w,originalValue:A,initialValue:S,stringValue:q,lastAnchor:$,lastKey:N,hasInteracted:L,hasLoaded:_,mentionPopover:B}=k,j=M=>{const W=M||$a[0];M&&x([{type:"tabbableOption",value:W}])},I=`rte-${e}`,G=C.useCallback(M=>d.jsx(dC,{...M}),[]),V=C.useCallback(M=>d.jsx(fC,{...M}),[]),Q=C.useMemo(()=>fw(hw(mw(J0(lC(G0())),b),b),I,b),[]);C.useEffect(()=>{if(!t)return;Ar.lastIndex=0;const M=t.match(Ar);!M||M.length>1||M[0].length!==t.length||L||x([{type:"originalValue",value:t}])},[t]);const ae=M=>{if(!Q||M!==I)return;const W=y.end(Q,[]);J.select(Q,W),te.focus(Q)};C.useEffect(()=>{const M=W=>{var z;const F=W,T=((z=F==null?void 0:F.detail)==null?void 0:z.id)||null;T&&ae(T)};return window.addEventListener("focusEditor",M),()=>{window.removeEventListener("focusEditor",M)}},[]),C.useEffect(()=>{if(Q.children.length>0&&!_){if(x([{type:"hasLoaded",value:!0}]),!s)return;ae(I)}},[Q.children.length,S]),C.useEffect(()=>{A&&(async()=>{let W=yn(A);if(W.includes("<")){Sr.prototype.escape=T=>T;const F=new Sr;F.addRule("br",{filter:["br"],replacement:T=>T+`
162
162
 
163
- `}),q=B.turndown(q)}o&&o.mentions&&(q=await Vc({text:q,template:`[${Ns}{{name}}]({{id}})`,mentions:o.mentions,listMembers:p||(()=>Promise.resolve([]))})),Hx(q,B=>{x([{type:"initialValue",value:B},{type:"editorKey",value:A.toString()}]),setTimeout(()=>{x([{type:"stringValue",value:fc(Q)}])},150)})})()},[A]),y.useEffect(()=>{t!==""||!Q||ls(A,t)&&!N||(C.withoutNormalizing(Q,()=>{X.delete(Q,{at:{anchor:C.start(Q,[]),focus:C.end(Q,[])}}),X.deselect(Q),Q.children.length!==0&&X.unwrapNodes(Q,{at:[0]}),X.insertNodes(Q,v,{at:[0]})}),x([{type:"initialValue",value:v},{type:"lastAnchor",value:null}]))},[t]);const D=Oc(()=>{Yx({editor:Q,isShowing:F.show,numberOfUsers:F.numberOfUsers,listMembers:p,dispatch:x})},100);return S?d.jsx("div",{id:$,className:"rich-text-editor",children:d.jsxs(Xt.Provider,{value:{...k,id:$,isInOverlay:h,setFocus:j,dispatch:x,onMention:f,reportError:b},children:[d.jsxs(cC,{editor:Q,initialValue:S,onChange:L=>{if(Q.operations.some(B=>B.type!=="set_selection")){const B=Qx(L);g(B),x([{type:"stringValue",value:fc(Q)}]),N||x([{type:"hasInteracted",value:!0}]),D(),c&&console.log({serialized:B,json:L})}},...l,children:[d.jsx(tC,{className:"input",renderElement:V,renderLeaf:K,placeholder:n||u.formatMessage({id:"richTextEditor_placeholder"}),autoFocus:s,tabIndex:0,onKeyDown:L=>{if(L.key==="Enter"){F.show&&(L.preventDefault(),L.stopPropagation(),Zf(Q,F,x,$));const{selection:q}=Q;if(q){const B=Z.isCollapsed(q),[T,z]=C.node(Q,q,{depth:1});let M=T,H=M.type;const ne=M.children[0];if(ne&&[Y.ol,Y.ul].includes(ne.type)&&(M=ne,H=ne.type),M&&de.isElement(M)&&H!==Y.paragraph){if(H===Y.blockquote&&!L.shiftKey){L.stopPropagation(),L.preventDefault(),X.insertNodes(Q,v);return}if(B){const[ee,re]=C.parent(Q,q,{edge:"end"}),J=ee.type;if([Y.ul,Y.ol].includes(H))if(L.stopPropagation(),L.preventDefault(),J===Y.li&&I==="Enter"){ee.children.length===1&&"text"in ee.children[0]&&ee.children[0].text===""&&X.removeNodes(Q,{at:re}),X.insertNodes(Q,v,{at:P.next(z)}),X.select(Q,C.end(Q,P.next(z)));return}else{const[he,me]=Vx(Q,Y.li),ve={type:Y.li,children:[{text:""}]};X.insertNodes(Q,ve,{at:P.next(me)}),X.select(Q,C.end(Q,P.next(me)))}}}}}else if(L.key==="Escape"){if(F.show){L.preventDefault(),L.stopPropagation(),x([{type:"mentionPopover",value:{...F,show:!1}}]);return}}else if(["ArrowUp","ArrowDown"].includes(L.key)&&F.show){L.preventDefault(),L.stopPropagation();const{selectedUser:q,possibleUsers:B}=F;let T=L.key==="ArrowUp"?q-1:q+1;T<0&&(T=B.length-1),T>=B.length+1&&(T=0),x([{type:"mentionPopover",value:{...F,selectedUser:T}}])}x([{type:"lastKey",value:L.key}]),Zx(L,Q,x,b)},onBlur:()=>{Q.selection&&x([{type:"lastAnchor",value:Q.selection.anchor}])},onFocus:()=>{if(R){if(!P.isPath(R.path)||!ue.has(Q,R.path))return;const L=ue.get(Q,R.path);let q=0;if(fe.isText(L)?q=L.text.length:L.children&&(q=L.children.length),R.offset>q)return;try{X.select(Q,{anchor:R,focus:R})}catch(B){const T=B.message;b(`Error focusing editor: ${T}`)}}}}),d.jsx(uw,{}),p?d.jsx(Jx,{onFallbackClick:m}):null]},w),d.jsx(ao,{id:`character-limit-${e}`,limit:r,valueLength:Xa(W)})]})}):d.jsx(d.Fragment,{})};const bw=({id:e="form-toggle",label:t,options:n,initialValue:r,functions:{onChange:a=()=>{}},isDisabled:i=!1,className:s=""})=>{const[o,l]=y.useState(typeof r=="boolean"||typeof r=="string"?r:n[0].value);y.useEffect(()=>{r&&l(r)},[r]);const u=c=>{i||(l(c),a(c))};return d.jsxs("div",{className:G("toggle",s),onClick:c=>{c.preventDefault(),c.stopPropagation(),u(o===n[0].value?n[1].value:n[0].value)},children:[d.jsx("p",{children:t}),d.jsx("ul",{className:G("toggle-options",{disabled:i,on:o===n[1].value}),children:n.map(c=>{const h=`${e}-${c.value}`;return d.jsxs("li",{className:"hidden",children:[d.jsx("input",{type:"radio",id:h,name:e,value:c.value,checked:o===c.value,onChange:()=>u(c.value),disabled:i}),d.jsx("label",{htmlFor:h,children:c.label})]},h)})})]})};function rh({className:e="",userId:t,userName:n,src:r,uploadImage:a,button:i,callback:s}){const o=se.useIntl(),l="profileImageChange_",[u,c]=y.useState(r),[h,p]=y.useState(!1),[m,g]=y.useState(!1),f=y.useRef(null),b=async x=>{p(!0),g(!1);try{const w=x.target.files&&x.target.files[0];if(!w||!t)throw p(!1),new Error("Image file or userID is missing");const A=await a({fileObject:w,userId:t}),S={thumbnail:A.thumbnailURL,full:A.originalURL};c(S),s(S)}catch{g(!0)}finally{p(!1)}p(!1)},{upload:v=o.formatMessage({id:`${l}cta_upload`}),change:E=o.formatMessage({id:`${l}cta_change`}),uploading:k=o.formatMessage({id:`${l}cta_uploading`})}=(i==null?void 0:i.text)||{};return d.jsxs("div",{className:G("profile-image-change-figure",e),children:[d.jsx(Gt,{className:"profile-image-change-picture",name:n,src:u==null?void 0:u.thumbnail,showInitials:!1,alt:"","data-testid":"profile-picture"}),m&&d.jsx("p",{className:"error text-small",children:o.formatMessage({id:`${l}error`})}),d.jsx("input",{id:"file",type:"file",accept:"image/*",ref:f,onChange:b,hidden:!0,"data-testid":"file-input"}),d.jsx(Be,{onClick:()=>f.current&&f.current.click(),variant:"secondary","data-gtm-event-context":"ImageField","data-gtm-event-type":`${u?"change-photo":"add-photo"}-click`,className:"gtm-trackable",disabled:h,children:h?k:u?E:v})]})}const ah=({gtm:e,functions:{onSuccess:t=async()=>{},onFailure:n=()=>{}}})=>{const{context:r="FooterContactUsForm",event:a="contact-form-submit-click"}=e||{};return d.jsx(Qt,{id:"contact-us-form",fields:[{id:"name",type:"text",className:"short",validation:[{condition:"required"}],autoComplete:"name"},{id:"email",type:"email",className:"short",validation:[{condition:"required"},{condition:"valid-email"}]},{id:"organisation",type:"text"},{id:"interests",type:"checkboxes",options:[{id:"publishingCourse",label:"Publishing or creating a course"},{id:"buyingCourse",label:"Buying courses for my team"},{id:"learningExperience",label:"Customised learning experiences"},{id:"somethingElse",label:"Something else"}]},{id:"message",type:"textarea",limit:1e3,validation:[{condition:"required"}]}],intlPath:"contactForm",gtm:{context:r,event:a},functions:{onSuccess:t,onFailure:n}})};const ih=({title:e,label:t,ctaMessage:n,titleColor:r,labelColor:a,backgroundColor:i,onClose:s,reportError:o,sendInvites:l,initialFormStatus:u="NOT_SUBMITTED"})=>{const[c,h]=y.useState([]),[p,m]=y.useState(!0),[g,f]=y.useState(u),{formatMessage:b}=se.useIntl(),v=async x=>{x.preventDefault();try{await l(c),h([]),f("SUCCESS")}catch(w){f("ERROR"),o(w)}},E=x=>{x.preventDefault(),f("NOT_SUBMITTED"),m(!0),h([])},k=x=>{x.preventDefault(),s(),f("CLOSED")};return g==="CLOSED"?null:g==="ERROR"||g==="SUCCESS"?d.jsxs("div",{className:"invite-form-wrapper",children:[d.jsx("div",{className:"content centred",children:g==="SUCCESS"?d.jsx("h2",{className:"success-title",children:b({id:"inviteForm_success"})}):d.jsxs("h2",{className:"error-title",children:[" ",b({id:"inviteForm_error"})]})}),d.jsx(zt,{}),d.jsx("div",{className:"footer",children:g==="SUCCESS"?d.jsxs(d.Fragment,{children:[d.jsx(Be,{variant:"secondary",onClick:E,children:b({id:"inviteForm_ctaSendMoreInvites"})}),d.jsx(Be,{onClick:k,children:b({id:"inviteForm_ctaDone"})})]}):d.jsx(Be,{onClick:E,children:b({id:"inviteForm_ctaTryAgain"})})})]}):d.jsx("div",{className:"invite-form-wrapper",children:d.jsxs("form",{style:{backgroundColor:i},onSubmit:v,className:G("invite-form gtm-trackable"),children:[d.jsxs("fieldset",{className:"content",children:[d.jsx("h2",{className:"title",style:{color:r},children:e}),d.jsx("label",{htmlFor:"email-input",className:"label",style:{color:a},children:t}),d.jsx($h.ReactMultiEmail,{id:"email-input",inputClassName:"email-input input",placeholder:b({id:"inviteForm_email_placeholder"}),emails:c,onChange:x=>{h(x),m(!x.length)},autoFocus:!1,getLabel:(x,w,A)=>d.jsxs("div",{className:"email text-medium",children:[d.jsx("div",{"data-tag-item":!0,children:x}),d.jsx(Be,{variant:"tertiary",size:"small",icon:{icon:"close"},onClick:()=>{A(w),m(!c.length)},className:"remove-email-button",screenreaderText:b({id:"overlay_close"})})]},w)})]}),d.jsx(zt,{}),d.jsx("fieldset",{className:"footer",children:d.jsx(Be,{className:"sendEmailsButton",disabled:p,children:n})})]})})},_a=e=>e.map(t=>({condition:t})),Dt={FORM_ID:"manage-account-password-change",NEW_PASSWORD:"newPassword",CONFIRMED_PASSWORD:"confirmedPassword",CURRENT_PASSWORD:"oldPassword"},yw=({functions:e,...t})=>{const{formatMessage:n}=se.useIntl(),[r,a]=y.useState(null),[i,s]=y.useState(!1),[o,l]=y.useState({isMoreThanEightCharacters:!1,includesNumberAndSymbol:!1,includesLowerAndUppercase:!1}),u=m=>m[Dt.NEW_PASSWORD]!==m[Dt.CONFIRMED_PASSWORD]?n({id:"passwordRules_unmatched_text"}):null,c=m=>!hs(m[Dt.NEW_PASSWORD]).isValid,h=[{"data-testid":Dt.NEW_PASSWORD,id:Dt.NEW_PASSWORD,type:"password",autoComplete:"new-password",placeholder:"",label:n({id:"passwordRules_newPassword_label"}),validation:_a(["required",c]),functions:{onChange:m=>l(hs(m).matchingRules),onFocus:()=>s(!0),onBlur:()=>s(!1)}},{"data-testid":Dt.CONFIRMED_PASSWORD,id:Dt.CONFIRMED_PASSWORD,type:"password",autoComplete:"new-password",placeholder:"",label:n({id:"passwordRules_confirmPassword_label"}),validation:_a(["required",u])}];t.isPasswordChange&&h.unshift({"data-testid":Dt.CURRENT_PASSWORD,id:Dt.CURRENT_PASSWORD,type:"password",autoComplete:"current-password",placeholder:"",label:n({id:"passwordRules_currentPassword_label"}),validation:_a(["required"])}),i&&h.push({component:Sd,props:{matchingRules:o}});const p={id:Dt.FORM_ID,fields:h,functions:{...e,onSuccess:async m=>(e.createPassword(m),e.onSuccess&&e.onSuccess(m)),onCatch:m=>a(m==null?void 0:m.statusCode),onFailure:(m,g)=>{(g.includes(Dt.NEW_PASSWORD)||g.includes(Dt.CONFIRMED_PASSWORD))&&s(!0)}},meta:{shouldReset:!0},...t};return d.jsxs(d.Fragment,{children:[d.jsx(Qt,{...p}),r&&d.jsx(cn,{variant:"error",text:r})]})};const sh=({hooks:e,functions:t,meta:n={},gtm:r})=>{var x,w;const a=se.useIntl(),i="profileForm_",s=y.useContext(Bt),[o,l]=y.useState(s.image),[u,c]=y.useState(!1),{uploadImage:h,onSuccess:p=async A=>{},onCancel:m=()=>{},onFailure:g=()=>{}}=t,{buildLocation:f,isValidPlace:b,predictPlaces:v}=e.useMaps(),{context:E="ProfileForm",event:k="profile-form-submit-click"}=r||{};return d.jsx(Qt,{id:"profile-details-form",fields:[{component:rh,props:{userName:s.name,userId:s.id,src:o,uploadImage:h,callback:l,button:{text:{upload:a.formatMessage({id:`${i}image`})}}}},{id:"name",type:"text",label:a.formatMessage({id:`${i}name`}),placeholder:a.formatMessage({id:`${i}name_placeholder`}),value:s.name,autoComplete:"name",validation:[{condition:"required"}]},{id:"jobTitle",type:"text",label:a.formatMessage({id:`${i}jobTitle`}),placeholder:a.formatMessage({id:`${i}jobTitle_placeholder`}),value:s.jobTitle,validation:[{condition:"required"}]},{id:"organization",type:"text",label:a.formatMessage({id:`${i}organization`}),placeholder:a.formatMessage({id:`${i}organization_placeholder`}),value:s.organization,validation:[{condition:"required"}]},{id:"location",type:"autocomplete",label:a.formatMessage({id:`${i}location`}),placeholder:a.formatMessage({id:`${i}location_placeholder`}),value:((x=s.location)==null?void 0:x.en)||((w=s.location)==null?void 0:w.country),validation:[{condition:"required"},{condition:({location:A})=>A&&!u?!1:!b(A),error:a.formatMessage({id:`${i}location_error`})}],functions:{onChange:()=>{u||c(!0)},onKeyInput:v}},{id:"biography",type:"textarea",label:a.formatMessage({id:`${i}bio`}),placeholder:a.formatMessage({id:`${i}bio_placeholder`}),limit:1e3,value:s.biography,validation:[{condition:"required"}]},{component:zt}],meta:{shouldShowCancelButton:!0,shouldReset:!1,shouldHide:!1,showRequiredLabels:!1,...n},intlPath:i,gtm:{context:E,event:k},functions:{onSuccess:async A=>{try{const S={...A,image:o||null,location:u?await f(A==null?void 0:A.location):s.location};s.updateDetails&&s.updateDetails(W=>({...W,...S})),await p(S)}catch{g()}},onCancel:m,onFailure:g},button:{size:"large",text:a.formatMessage({id:`${i}cta`})}})};const oh=({id:e="search",className:t="",handleToggle:n=!1,defaultValue:r="",gtmContext:a="search-bar",gtmEvent:i="form-submission"})=>{const{searchIsOpen:s=!0,isDesktopVersion:o=!1}=n||{},l=se.useIntl(),u=y.useRef(null);Qn(()=>{!n||o||!s||u.current&&u.current.focus()},[s]);const c=h=>{h.preventDefault(),h.stopPropagation(),!(!u.current||!u.current.value||u.current.value.length<1)&&(window.location.href=`/search?search=${encodeURIComponent(u.current.value)}`)};return d.jsx("form",{onSubmit:c,className:G("search-form gtm-trackable",t),role:"search","data-gtm-event-context":a,"data-gtm-event-type":i,children:d.jsx("fieldset",{id:`${e}-form`,hidden:n?!s:!1,children:d.jsxs("p",{children:[d.jsx(Ie,{element:"label",htmlFor:e,children:l.formatMessage({id:"search_label"})}),d.jsx("input",{ref:u,type:"search",id:e,name:e,defaultValue:r,placeholder:l.formatMessage({id:"search_placeholder"}),onKeyDown:h=>{h.key==="Enter"&&c(h)}}),d.jsx("button",{className:"clear",onClick:h=>{h.preventDefault(),h.stopPropagation(),u.current&&u.current.value&&(u.current.value="")},children:d.jsx(Ie,{children:l.formatMessage({id:"search_clear"})})}),d.jsx("button",{className:"search",onClick:c,children:d.jsx(Ie,{children:l.formatMessage({id:"search_cta"})})})]})})})},vc=async({ref:e,validateEmail:t,dispatch:n})=>{const r=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;if(!e.current.validity.valid||!r.test(e.current.value))return n([{type:"validFields.email",value:!1}]);const a=e.current.value.toString().toLowerCase().trim(),i={valid:!1,autoApproved:!1,exists:{auth:!1,engagement:!1,registration:!1,user:!1}};let s=Object.assign({},i);try{s=await t(a),s===void 0&&(s=i)}catch{return n([{type:"shouldManuallyApprove",value:!0},{type:"emailDetails",value:{email:a,boxType:"nonGov",isEnd2End:!1}},{type:"validFields.email",value:!1}])}const{valid:o=!1,autoApproved:l=!1,exists:u}=s;let c="";return o?c=l?"gov":"nonGov":u.registration?u.engagement&&!u.user?c=u.auth?"verify":"pending":c="exists":u.auth&&(c="exists"),n([{type:"shouldDisableButton",value:!1},{type:"shouldManuallyApprove",value:!l},{type:"emailDetails",value:{email:a,boxType:c,isEnd2End:/testing\+[0-9]+@apolitical.co$/.test(a)}},{type:"validFields.email",value:!0}])},Cw=e=>{const t={};for(const n of e.entries())t[n[0]]=n[1];return{name:t.full_name.toString().trim(),email:t.email_address.toString().toLowerCase().trim(),jobTitle:t.job_title,organization:t.organization,bioLink:t.url,optIn:!0,expectation:t.expectation,page:window.location.pathname,"g-recaptcha-response":t["g-recaptcha-response"]}},Dw=async({refs:e,dataToSubmit:t,createAccount:n,onSuccess:r,dispatch:a,state:i})=>{if(!e.form||!e.form.current)throw new Error("No refs.form");if(!e.form.current.checkValidity()){e.hiddenValidation&&e.hiddenValidation.current&&e.hiddenValidation.current.click();return}const s=Cw(new FormData(e.form.current)),o=Object.assign(s,t);await n(o),localStorage.setItem("email",s.email),r&&r({...s,...i.values}),a([{type:"showSuccessMessage",value:!0}])},xw=({shouldShow:e,placeholders:t,labels:n,functions:{validateEmail:r,resendVerificationCode:a},refs:i,state:s,dispatch:o,dataToSubmit:l,intl:u})=>{const{emailDetails:c}=s,h=(m,g)=>{m.current&&s.validFields[g]!==m.current.validity.valid&&o([{type:`validFields.${g}`,value:m.current.validity.valid}])},p=[{id:"full_name",type:"text",inputRef:i.name,placeholder:u.formatMessage({id:"signup_full_name_placeholder"}),functions:{onChange:()=>h(i.name,"name"),onFocus:()=>o([{type:"loadRecaptcha",value:!0}])},autoComplete:"name",validation:[{condition:"required"},{condition:"no-numbers"}],"data-testid":"signup-name-input"},{id:"email_address",type:"email",inputRef:i.email,placeholder:u.formatMessage({id:"signup_email_address_placeholder"}),"aria-describedby":"email-helper-textbox",functions:{onBlur:()=>{vc({ref:i.email,validateEmail:r,dispatch:o})},onChange:(m,g)=>{o([{type:"shouldDisableButton",value:!0}]),g&&g({type:"updateValue",payload:{key:"terms",value:!1}})},onFocus:()=>o([{type:"loadRecaptcha",value:!0}])},autoComplete:"email",validation:[{condition:"required"},{condition:"valid-email"}],"data-testid":"signup-email-input"},{component:kd,props:{email:c.email,type:c.boxType,resendVerificationCode:a}}];return s.shouldManuallyApprove&&(p.push({id:"job_title",type:"text",inputRef:i.jobTitle,placeholder:u.formatMessage({id:"signup_job_title_placeholder"}),functions:{onChange:()=>h(i.jobTitle,"jobTitle")},validation:[{condition:"required"}],"data-testid":"signup-job-input"},{id:"organization",type:"text",inputRef:i.organisation,placeholder:u.formatMessage({id:"signup_organization_placeholder"}),functions:{onChange:()=>{h(i.organisation,"organisation")}},validation:[{condition:"required"}],autoComplete:"organization","data-testid":"signup-org-input"}),e.url&&p.push({id:"url",type:"text",label:u.formatMessage({id:"signup_url"},{small:m=>d.jsx("small",{children:m})}),placeholder:u.formatMessage({id:"signup_url_placeholder"}),validation:[{condition:"valid-url"}],"data-testid":"signup-url-input"})),e.expectation&&p.push({id:"expectation",className:"expectation",type:"text",label:(n==null?void 0:n.expectation)||u.formatMessage({id:"signup_expectation"},{small:m=>d.jsx("small",{className:"notes text-small",children:m})}),placeholder:(t==null?void 0:t.expectation)||u.formatMessage({id:"signup_expectation_placeholder"}),"data-testid":"signup-events-question"}),p.push({id:"terms",className:"text-small",type:"checkbox",inputRef:i.tc,label:u.formatMessage({id:"signup_terms"},{terms:m=>d.jsx("a",{href:"https://about.apolitical.co/terms-and-conditions","data-gtm-event-context":"SignupForm","data-gtm-event-type":"terms-of-service-click",className:"gtm-trackable",children:m}),privacy:m=>d.jsx("a",{href:"https://about.apolitical.co/privacy-policy","data-gtm-event-context":"SignupForm","data-gtm-event-type":"privacy-policy-click",className:"gtm-trackable",children:m})}),shownValue:"accepted",functions:{onChange:m=>{if(!m)return;const g=[];["name","email"].forEach(f=>{s.validFields[f]!==i[f].current.validity.valid&&(g.push({type:`validFields.${f}`,value:i[f].current.validity.valid}),f==="email"&&vc({ref:i.email,validateEmail:r,dispatch:o}))}),g.length&&o(g)}},validation:[{condition:"required"}],"data-testid":"signup-terms-checkbox"}),p};const ww=({className:e=""})=>d.jsxs("div",{className:G("success-message",e),"data-testid":"success-message",children:[d.jsx("p",{className:"success-title",children:d.jsx(se.FormattedMessage,{id:"signup_success_title"})}),d.jsx(se.FormattedMessage,{id:"signup_success_text",values:{p:t=>d.jsx("p",{children:t})}})]});const Ew={validFields:{name:!1,email:!1,jobTitle:!1,organisation:!1},emailDetails:{email:"",boxType:"",isEnd2End:!1},shouldManuallyApprove:!1,shouldDisableButton:!0,loadRecaptcha:!1,showSuccessMessage:!1,showError:!1},_w=({className:e="",labels:t={},placeholders:n={},functions:r={validateEmail:()=>Promise.resolve(),createAccount:()=>Promise.resolve(),handleError:()=>{},resendVerificationCode:()=>Promise.resolve()},shouldShow:a={},submitButton:i,dataToSubmit:s={ref:"sign-up-form"},...o})=>{const l=se.useIntl(),{title:u=!0,expectation:c=!1,url:h=!0,logInButton:p=!0,successMessage:m=!0}=a,g={title:u,expectation:c,url:h,logInButton:p,successMessage:m},[f,b]=y.useReducer(Lr,Ew),{validFields:v,emailDetails:E,shouldManuallyApprove:k,shouldDisableButton:x,showSuccessMessage:w,showError:A}=f,[S,W]=Ws.useCookies(["signup-this-session","functional-cookie-consent"]),R={form:y.createRef(),name:y.createRef(),email:y.createRef(),jobTitle:y.createRef(),organisation:y.createRef(),tc:y.createRef(),hiddenValidation:y.createRef()};y.useEffect(()=>{k===!0&&R.jobTitle.current&&R.jobTitle.current.focus()},[k]),y.useEffect(()=>{S["signup-this-session"]&&b([{type:"showSuccessMessage",value:!0}])},[S]),y.useEffect(()=>{w&&S["functional-cookie-consent"]&&W("signup-this-session","true",{path:"/",maxAge:3600})},[w]);const I=y.useMemo(()=>xw({placeholders:n,labels:t,shouldShow:g,functions:r,refs:R,state:f,dispatch:b,dataToSubmit:s,intl:l}),[s,r,l,R,g,f]),N=x?!0:k?!Object.values(v).every(_=>_===!0):!v.name||!v.email||["exists","pending","verify"].includes(E.boxType);return g.successMessage&&w?d.jsx(ww,{className:e}):d.jsxs("fieldset",{className:G("signup-form-fieldset",e),"data-testid":"signup-form",children:[g.title&&d.jsx("p",{className:"signup-title",children:d.jsx(se.FormattedMessage,{id:"signup_title"})}),A&&d.jsx(cn,{variant:"error",text:l.formatMessage({id:"signup_error"})}),d.jsx(Qt,{className:"signup-form",formRef:R.form,id:"sign-up-form",fields:I,intlPath:"signup",button:{variant:"primary",size:"medium",text:i||l.formatMessage({id:"signup_button_join"}),disabled:N?{isClickable:!0}:!1,styling:{fullWidth:!0},"data-testid":"signup-button"},secondaryActionButton:{className:"login-button",styling:{fullWidth:!0},variant:"tertiary",size:"medium",href:"/user-onboarding/login","data-gtm-event-context":"SignupForm","data-gtm-event-type":"login-click",text:l.formatMessage({id:"signup_button_login"})},meta:{shouldReset:!1,showRequiredLabels:!1,shouldShowCancelButton:g.logInButton},gtm:{context:"SignupForm",event:"signup-submit-click"},functions:{onSuccess:async()=>{await Dw({refs:R,dataToSubmit:s,createAccount:r.createAccount,onSuccess:r.onSuccess,dispatch:b,state:f})},onCatch:_=>{r.handleError(_),b([{type:"showSuccessMessage",value:!1},{type:"showError",value:!0}])}}}),d.jsx("button",{className:"validation-button",ref:R.hiddenValidation})]})};const mn=({children:e,className:t="",styling:n={},...r})=>{const{background:a="default"}=n;return d.jsx("section",{className:G("full-width-section",t,{[a]:a!=="default"}),...r,children:e})};const kw=({text:e,buttons:t,className:n=""})=>{const r=[];return t.forEach(a=>{r.push({href:a.link,variant:"secondary",size:{mobile:"medium",1024:"large"},className:"gtm-trackable","data-gtm-event-type":"download-click","data-gtm-event-context":a.eventContext||"Download",target:"_blank",children:a.text})}),d.jsx(mn,{className:G("download-section",n),children:d.jsxs("div",{className:"content-default",children:[y.createElement(typeof e=="string"?"h2":e.element,{className:"text"},typeof e=="string"?e:e.text),d.jsx(ir,{buttons:r})]})})};const qs="editSection_";function uh({href:e,setShowModal:t}){typeof e!="string"&&t(!0)}const Bw=({icon:e,description:t,ctaMessage:n,href:r,showEditButton:a,setShowModal:i})=>{const{formatMessage:s}=se.useIntl();return d.jsxs("div",{className:G("edit-section-placeholder",{"has-icon":!!e}),style:Wc(e),children:[d.jsx("p",{children:t||s({id:`${qs}placeholder_description`})}),a&&d.jsx(Be,{href:r,variant:"secondary",size:"small",onClick:()=>uh({href:r,setShowModal:i}),children:n||s({id:`${qs}placeholder_cta`})})]})},Fw=({children:e,className:t="",formProps:n,formComponent:r,href:a,title:i,modalTitle:s,placeholder:o,showDivider:l=!0})=>{const{formatMessage:u}=se.useIntl(),[c,h]=y.useState(!1),p=()=>h(!1),m=!!n||!!r,g=typeof a=="string"||m;let f;return r&&(f=y.cloneElement(r,{functions:{...r.props.functions,onSuccess:async b=>{try{r.props.functions.onSuccess&&await r.props.functions.onSuccess(b)}finally{p()}},onCancel:()=>{r.props.functions.onCancel&&r.props.functions.onCancel(),p()}}})),d.jsxs("section",{className:G("edit-section",t),children:[m&&d.jsx(dn,{title:s||`Edit ${i}`,isOpen:c,showDivider:!1,showIcon:!1,functions:{onClose:p},className:G("edit-section-modal"),children:f||(n?d.jsx(Qt,{...n,fields:n.fields,meta:{...n==null?void 0:n.meta,shouldShowCancelButton:!0,shouldReset:!1,showSuccessMessage:!0},functions:{...n==null?void 0:n.functions,onSuccess:async b=>{var v,E;(v=n==null?void 0:n.functions)!=null&&v.onSuccess&&await((E=n==null?void 0:n.functions)==null?void 0:E.onSuccess(b)),h(!1)},onCancel:p}}):d.jsx(d.Fragment,{}))}),d.jsxs("div",{className:"edit-section-header",children:[d.jsx("h2",{className:"edit-section-header-title",children:i}),g&&d.jsx(Be,{href:a,variant:"tertiary",size:"small",icon:"pencil",onClick:()=>uh({href:a,setShowModal:h}),children:u({id:`${qs}edit`})})]}),e||d.jsx(Bw,{...o,href:a,setShowModal:h,showEditButton:g}),l&&d.jsx(zt,{})]})};const Aw=({title:e=!1,text:t,logos:n=[],styling:r={},className:a=""})=>{const i=n.length;if(i===0)return null;const s={element:typeof e=="object"?e.element:"h2",text:typeof e=="string"?e:typeof e=="object"?e.text:"",className:typeof e=="object"?e.className:""},{wrapLogos:o=!1,align:l="center",display:u="block"}=r;return d.jsxs("div",{className:G("logos",a,`align-${l}`,{[u]:u!=="block","wrap-logos":o}),children:[e&&y.createElement(s.element,{className:G("title",s.className)},s.text),t&&d.jsx("p",{children:t}),d.jsx("ul",{className:G({"two-col":i===2||i===4,"three-col":i===5||i<=10&&i%3===0}),children:n.map(({logo:c,nameOfBusiness:h,link:p=!1,description:m=!1},g)=>{if(!c||!c.url)return null;const f=d.jsx("img",{src:c.url,width:c.width||"auto",height:c.height||"auto",alt:h});return d.jsxs("li",{children:[d.jsx("p",{className:"img-wrapper",children:p?d.jsx("a",{href:p,target:"_blank",rel:"nofollow noreferrer noopener",children:f}):f}),m&&d.jsx("small",{children:m})]},window.btoa(`${c.url}_${g}`))})})]})};let Gi;const Qi="contactFooter_",Tw=({onSuccess:e=async()=>{},onFailure:t=()=>{}})=>{const n=y.useRef(null),[r,a]=y.useState(0),[i,s]=y.useState(!1),o=()=>{n.current&&a(n.current.clientHeight)},l=()=>{i||(s(!0),clearTimeout(Gi),Gi=setTimeout(()=>{o(),s(!1)},500))};return y.useEffect(()=>(o(),window.addEventListener("resize",l),()=>{clearTimeout(Gi),window.removeEventListener("resize",l)}),[]),d.jsx(mn,{id:"contactForm",className:"contact-footer",children:d.jsxs("div",{className:"inner-wrapper",children:[d.jsx("h2",{children:d.jsx(se.FormattedMessage,{id:`${Qi}title`})}),d.jsxs("div",{className:"content-wrapper",ref:n,"data-testid":"content-wrapper",style:i?{}:{minHeight:r},children:[d.jsxs("aside",{children:[d.jsx("p",{children:d.jsx(se.FormattedMessage,{id:`${Qi}text`})}),d.jsx(jn,{className:"mailto-link",href:"mailto:hello@apolitical.co",children:d.jsx(se.FormattedMessage,{id:`${Qi}email`})})]}),d.jsx(ah,{functions:{onSuccess:e,onFailure:t},gtm:{context:"FooterContactUsForm",event:"contact-form-submit-click"}})]})]})})},Sw=({activeLink:e,...t})=>d.jsx(mn,{children:d.jsx(Ed,{layout:"1-3",children:d.jsxs(d.Fragment,{children:[d.jsx(wd,{activeLink:e}),d.jsx(ed,{...t})]})})});const Ji="cookieBanner_",Xi=["apol-cookie-banner","apolitical-performance-cookie-consent","functional-cookie-consent"],es=new Date(Date.now()+12*30*24*60*60*1e3),lh=()=>{const e=se.useIntl(),[t,n,r]=Ws.useCookies(Xi),[a,i]=y.useState(!t["apol-cookie-banner"]),s=()=>{Xi.forEach(c=>{n(c,!0,{path:"/",expires:es,domain:c==="apolitical-performance-cookie-consent"?".apolitical.co":void 0})}),i(!1),window.location.reload()},o=()=>{n("apol-cookie-banner",!0,{path:"/",expires:es}),Xi.forEach(c=>{if(c==="apol-cookie-banner"){n(c,!0,{path:"/",expires:es});return}r(c)}),i(!1)};if(!a)return null;const l=[{id:"settings",href:"/pages/cookie-policy",gtmType:"policy-page"},{id:"reject",onClick:o,gtmType:"reject-all"},{id:"accept",onClick:s,gtmType:"accepted-all"}],u=[];return l.forEach(c=>{u.push({variant:c.href?"tertiary":"primary",href:c.href,onClick:c.onClick,className:"gtm-trackable","data-gtm-event-context":"cookie-banner","data-gtm-event-type":`cookie-${c.gtmType}-click`,children:e.formatMessage({id:`${Ji}buttons_${c.id}`})})}),d.jsxs("aside",{id:"cookie-banner",className:"text-medium",children:[d.jsx("h6",{children:e.formatMessage({id:`${Ji}title`})}),d.jsx("p",{children:e.formatMessage({id:`${Ji}text`})}),d.jsx(ir,{buttons:u})]})},Vt={platform:{order:["events","courses","articles","communities"],events:{href:"/events/",gtmType:"events-click"},courses:{href:"/microcourses/",gtmType:"microcourses-click"},articles:{href:"/solution-articles/",gtmType:"articles-click"},communities:{href:"/communities/",gtmType:"communities-click"}},community:{order:["support","post","join","guidelines"],support:{name:"Support FAQ",href:"/pages/support-faq",gtmType:"support-faq-click"},post:{href:"/pages/post-an-article",gtmType:"post-an-article-click"},join:{href:"/pages/who-can-join-the-community",gtmType:"who-can-join-click"},guidelines:{href:"/pages/values-and-guidelines",gtmType:"guidelines-and-values-click"}},company:{order:["news","insights","story","team","careers","partner","contact"],news:{href:"/learning-hub/updates/",gtmType:"news-click"},insights:{href:"/learning-hub/global-insights/",gtmType:"insights-click"},story:{href:"/pages/our-story",gtmType:"our-story-click"},team:{href:"/pages/meet-our-team",gtmType:"team-click"},careers:{href:"/pages/careers",gtmType:"careers-click"},partner:{href:"/partnerships/",gtmType:"partner-with-us-click"},contact:{href:"/pages/get-in-touch",gtmType:"contact-click"},child:"legal"},legal:{order:["privacy","terms","cookie","accessibility","ai"],privacy:{href:"https://about.apolitical.co/privacy-policy",gtmType:"privacy-policy-link"},terms:{href:"https://about.apolitical.co/terms-and-conditions",gtmType:"terms-conditions-link"},cookie:{href:"/pages/cookie-policy",gtmType:"cookie-policy-link"},ai:{href:"/pages/ai-principles",gtmType:"ai-principles-link"},accessibility:{href:"/pages/accessibility-statement",gtmType:"accessibility-link"},text:{order:["dataProtection","euDataProtection"],dataProtection:{email:zn["data-protection"].default,gtmType:"email-dpo-link"},euDataProtection:{email:zn["data-protection"].eu,gtmType:"email-eu-dpo-link"}}},contact:{text:{order:["correspondence","registered","berlin","support","business"],correspondence:{address:!0},registered:{address:!0},berlin:{address:!0},support:{email:zn.support,gtmType:"concierge-email-click"},business:{email:zn.general,gtmType:"hello-email-click"}}},social:{order:["linkedin","twitter","facebook"],linkedin:{href:"https://www.linkedin.com/company/apolitical"},twitter:{href:"https://twitter.com/apoliticalco"},facebook:{href:"https://www.facebook.com/apoliticalco"}}};const Kn="footer_",La="SiteFooter",bc=({group:e})=>{const t=Vt[e].order||[];let n=!1;return"text"in Vt[e]&&(n=Vt[e].text),d.jsxs(y.Fragment,{children:[d.jsx("p",{className:"pre-title",children:d.jsx(se.FormattedMessage,{id:`${Kn}${e}`})}),Array.isArray(t)&&t.length>0&&d.jsx("ul",{className:"text-medium",children:t.map(r=>{if(["order","child","text"].includes(r))return null;const{href:a,gtmType:i}=Vt[e][r],s={};return["legal"].includes(e)&&(s.target="_blank",s.rel="noopener"),d.jsx("li",{children:d.jsx("a",{href:a,className:"gtm-trackable","data-gtm-event-context":La,"data-gtm-event-type":i,...s,children:d.jsx(se.FormattedMessage,{id:`${Kn}${e}_${r}`})})},`${e}_${r}`)})}),typeof n!="boolean"&&"order"in n&&Array.isArray(n.order)&&d.jsx("dl",{className:"text-medium",children:n.order.map(r=>d.jsxs(y.Fragment,{children:[d.jsx("dt",{children:d.jsx(se.FormattedMessage,{id:`${Kn}${e}_${r}`})}),d.jsxs("dd",{children:[typeof n!="boolean"&&n[r].address&&d.jsx("address",{children:d.jsx(se.FormattedMessage,{id:`${Kn}${e}_${r}_address`,values:{br:d.jsx("br",{})}})}),typeof n!="boolean"&&n[r].email&&d.jsx("a",{href:`mailto:${n[r].email}`,className:"gtm-trackable","data-gtm-event-context":La,"data-gtm-event-type":n[r].gtmType,children:n[r].email})]})]},`dl-${e}-${r}`))})]},e)},jo=()=>d.jsx("div",{id:"footer",children:d.jsxs("div",{className:"wrapper",children:[d.jsx(Ka,{element:"hr"}),d.jsx(ro,{variant:"inverted",version:"full",className:"gtm-trackable","data-gtm-event-context":La,"data-gtm-event-type":"logo-homepage-link"}),d.jsx("footer",{children:["platform","community","company","contact"].map(e=>d.jsxs("div",{className:"group",children:[d.jsx(bc,{group:e}),Object.keys(Vt[e]).includes("child")&&d.jsx(bc,{group:Vt[e].child})]},e))}),d.jsx("hr",{}),d.jsxs("div",{className:"sub-footer",children:[d.jsx("ul",{children:Array.isArray(Vt.social.order)&&Vt.social.order.map(e=>{const t=Vt.social[e];return d.jsx("li",{className:e,children:d.jsx("a",{href:t.href,target:"_blank",rel:"noopener noreferrer",className:"gtm-trackable","data-gtm-event-context":La,"data-gtm-event-type":"social-click",children:d.jsx("span",{className:"hidden",children:d.jsx(se.FormattedMessage,{id:`${Kn}social_${e}`})})})},e)})}),d.jsx("small",{children:d.jsx(se.FormattedMessage,{id:`${Kn}copyright`,values:{currentYear:new Date().getFullYear()}})})]})]})}),$e={timeouts:{},handlerCalled:{},getIsDesktopVersion:(e,t)=>{const n={navigation:{loggedIn:769,loggedOut:881},search:{loggedIn:961,loggedOut:1121}},r=i=>{const s=`logged${e?"In":"Out"}`;return t>=n[i][s]};let a={};return["navigation","search"].forEach(i=>{a[i]=r(i)}),a},shouldChangeHeaderIsVisible:(e,t,n)=>{Object.values(t).filter(a=>a===!0).length||n([{type:"headerIsVisible",value:e}])},handleMenus:({id:e,value:t,menus:n,dispatch:r,forceHandle:a=!1})=>{if(!a&&n[e]===t||!a&&e===vt.ACCOUNT&&t===!1&&n[vt.SITE]===!0)return;const i=Date.now();if(!a&&!t&&$e.handlerCalled[e]&&i-$e.handlerCalled[e]<500)return;$e.handlerCalled[e]=i;let s=[{type:`menus.${e}`,value:t}];if(t===!0)Object.keys(n).forEach(o=>{o===e||n[o]===!1||s.push({type:`menus.${o}`,value:!1})});else{let o=null;switch(e){case vt.SITE:o=document.querySelector("#header .menu-button"),o||(o=document.querySelector("#navigation .navigation-button"));break;case vt.SEARCH:o=document.querySelector("#header .toggle-search-button");break;case vt.ACCOUNT:o=document.querySelector("#header .account-button");break;default:return}o&&o.focus()}r(s)},findFirstChild:(e,t,n=!1)=>{if(!e||!e[0])return!1;for(let r=0;r<=e.length;r++){if(!e[r])continue;if(e[r][t]&&(!n||e[r][t].includes(n)))return e[r];if(!t.includes("."))continue;const a=Ac(e[r],t);if(!(typeof a>"u")&&(!n||a[t]&&a[t].includes(n)||a.value&&a.value.includes(n)||a.toString().includes(n)))return e[r]}return e[0].children?$e.findFirstChild(e[0].children,t,n):!1},autoFocus:({menu:e,navigationRef:t,isDesktopVersion:n,focusElements:r,dispatch:a})=>{var l;if(!t.current||!t.current.children)return;const i=n?"desktop":"default";if(r[e][i]){(l=document.querySelector(`#header ul a[href="${r[e][i]}"]:last-child`))==null||l.focus();return}let s,o;switch(e){case vt.SITE:if(n){const u=$e.findFirstChild(t.current.children,"attributes.aria-controls",vt.SITE);s=$e.findFirstChild(u.children,"href")}else s=$e.findFirstChild(t.current.children,"href");break;case vt.ACCOUNT:if(o=$e.findFirstChild(t.current.children,"className","account"),!o||!o.children)return;s=$e.findFirstChild(o.children,"href");break;default:return}s&&(a([{type:`focusElements.${e}.${i}`,value:s.attributes.href.value}]),s.focus())},events:{onClick:(e,{id:t,callback:n,isOpen:r})=>{e.target&&e.target.attributes&&e.target.attributes.href||(e.preventDefault(),e.stopPropagation(),clearTimeout($e.timeouts[t]),n(t,!r))},onFocus:({id:e})=>{clearTimeout($e.timeouts[e])},onMouseEnter:({id:e,callback:t})=>{clearTimeout($e.timeouts[e]),t(e,!0)},onBlur:({id:e,callback:t})=>{$e.timeouts[e]=setTimeout(()=>{t(e,!1)},250)}}},$r={order:["home","topics","partners","account"],home:{href:"/home/",hasVariantText:!0,gtmType:"homepage-click"},topics:{order:["explore","topics"],menuId:"site-navigation",explore:{order:["events","courses","articles","communities"],events:{href:"/events/",className:"icon events"},courses:{href:"/microcourses/",gtmType:"microcourses-click",className:"icon courses"},articles:{href:"/solution-articles/",gtmType:"articles-click",className:"icon articles"},communities:{href:"/communities/",gtmType:"communities-click",className:"icon communities"}},topics:{order:["climate","cities-and-local-government","digital-and-data","education","equity-justice-and-inclusion","health-and-social-care","innovation","leadership-and-skills","life-in-government","policymaking","transport-and-infrastructure","work-and-the-economy"],className:"columns",climate:{href:"/topics/climate/"},"cities-and-local-government":{href:"/topics/cities-and-local-government/"},"digital-and-data":{href:"/topics/digital-and-data/"},education:{href:"/topics/education/"},"equity-justice-and-inclusion":{href:"/topics/equity-justice-and-inclusion/"},"health-and-social-care":{href:"/topics/health-and-social-care/"},innovation:{href:"/topics/innovation/"},"leadership-and-skills":{href:"/topics/leadership-and-skills/"},"life-in-government":{href:"/topics/life-in-government/"},policymaking:{href:"/topics/policymaking/"},"transport-and-infrastructure":{href:"/topics/transport-and-infrastructure/"},"work-and-the-economy":{href:"/topics/work-and-the-economy/"}}},partners:{href:"/partnerships/",onlyShow:"logged-out"},account:{menuId:"account-navigation",order:["profile","settings","log-out"],className:"account",onlyShow:"logged-in",doTrack:!1,profile:{href:"/profiles/me"},settings:{href:"/profiles/me/manage-account"},"log-out":{href:"/user-onboarding/logout",className:"divider"}},buttons:{order:["login","signup"],login:{href:"/user-onboarding/login"},signup:{href:"/signup?ref=header-banner",props:{variant:"primary"}}}},za=({id:e,isLoggedIn:t=!1,isDesktopVersion:n=!1,menus:r={},callback:a=()=>{},doTrack:i=null})=>{const s=se.useIntl(),o=Ac($r,e);if(!o||o.onlyShow&&(o.onlyShow==="logged-in"&&!t||o.onlyShow==="logged-out"&&t))return null;const l="doTrack"in o,u=i===null?l?o.doTrack:!0:i,c=e.includes("buttons.");let h=`header_${e.replaceAll(".","_")}`;o.hasVariantText&&(h+=`_logged${t?"In":"Out"}`);let p=!1;if(o.href){let k=o.gtmType||`${e}-click`;if(k.includes(".")){const x=k.split("."),w=x[x.length-2];k=`${w==="topics"?`${w}-`:""}${x[x.length-1]}`}p={href:o.href},u&&(p={...p,className:"gtm-trackable","data-gtm-event-type":k,"data-gtm-event-context":"HeaderButtons"}),c&&(p={...p,variant:"secondary",size:{mobile:"small",881:"large"},...o.props||{}})}const m=o.order&&o.order[0]&&o[o.order[0]],g=m&&o[o.order[0]].order,f=p&&window.location.pathname===o.href;let b={},v={},E={};if(f&&(b={...b,"aria-current":"page"}),m){const k=o.menuId||e,x={onClick:w=>$e.events.onClick(w,{id:k,callback:a,isOpen:r[k]}),onFocus:()=>$e.events.onFocus({id:k}),onBlur:()=>$e.events.onBlur({id:k,callback:a}),onMouseLeave:()=>$e.events.onBlur({id:k,callback:a}),onMouseEnter:()=>$e.events.onMouseEnter({id:k,callback:a})};v={...x,id:k===vt.SITE?vt.SITE:vt.ACCOUNT},n&&(g&&(E={...x,className:"navigation-button",onKeyPress:w=>{w.key==="Enter"&&$e.events.onClick(w,{id:k,callback:a,isOpen:r[k]})},"aria-haspopup":!0,"aria-expanded":r[k],"aria-controls":k}),v={...v,hidden:k in r?!r[k]:!0}),g||(v={...v})}return d.jsxs("li",{className:G({[o.className]:o.className,"has-submenu":m,parent:g,active:f}),...b,children:[p?y.createElement(c?Be:"a",p,s.formatMessage({id:h})):n&&o.order&&g?d.jsxs("button",{...E,children:[s.formatMessage({id:h}),d.jsx(Ie,{children:s.formatMessage({id:`header_menu_${r[vt.SITE]?"hide":"show"}`})})]}):s.formatMessage({id:h}),o.order&&d.jsx("ul",{...v,children:o.order.map(k=>{if(!o[k])return null;const x={isLoggedIn:t,isDesktopVersion:n,menus:r,callback:a,doTrack:l?u:null};return o[k].order?d.jsxs("li",{className:G({[o[k].className]:o[k].className}),children:[s.formatMessage({id:`${h}_${k}`}),d.jsx("ul",{children:o[k].order.map(w=>d.jsx(za,{id:`${e}.${k}.${w}`,...x},w))})]},k):d.jsx(za,{id:`${e}.${k}`,...x},k)})})]},e)};const jw={height:67,height_desktop:83};var vt=(e=>(e.NAVIGATION="navigation",e.SEARCH="search",e.ACCOUNT="account-navigation",e.SITE="site-navigation",e))(vt||{});const Oo=({showNavigation:e=!0})=>{const t=se.useIntl(),n=y.useContext(Bt),r=rr(!0,!0),a=n&&typeof n.id=="string",i=y.useMemo(()=>$e.getIsDesktopVersion(a,r),[a,r]),[s,o]=y.useReducer(Lr,{headerIsVisible:!0,menus:{"site-navigation":!1,search:!1,"account-navigation":!1},focusElements:{"site-navigation":{desktop:!1,default:!1},"account-navigation":{desktop:!1,default:!1}}}),{headerIsVisible:l,menus:u,focusElements:c}=s,h=y.useRef(s);y.useEffect(()=>{h.current=s},[s]),Nc({scrollPosition:jw[`height${i.navigation?"_desktop":""}`],callbacks:{scrollUp:()=>{const v=h.current.menus;!i&&v["site-navigation"]||$e.shouldChangeHeaderIsVisible(!0,v,o)},scrollDown:()=>{const v=h.current.menus;!i&&v["site-navigation"]||$e.shouldChangeHeaderIsVisible(!1,v,o)}}});const p=(v,E,k=!1)=>{$e.handleMenus({id:v,value:E,menus:h.current.menus,dispatch:o,forceHandle:k})},m=y.useRef(null),g=v=>{v.key==="Escape"&&["site-navigation","search","account-navigation"].forEach(E=>{h.current.menus[E]&&p(E,!1,!0)})};y.useEffect(()=>{var v;return(v=document.getElementById("header"))==null||v.addEventListener("keydown",g),()=>{var E;(E=document.getElementById("header"))==null||E.removeEventListener("keydown",g)}},[]),Qn(()=>{u["site-navigation"]&&$e.autoFocus({menu:"site-navigation",navigationRef:m,isDesktopVersion:i.navigation,focusElements:c,dispatch:o})},[u["site-navigation"]]),Qn(()=>{u["account-navigation"]&&$e.autoFocus({menu:"account-navigation",navigationRef:m,isDesktopVersion:i.navigation,focusElements:c,dispatch:o})},[u["account-navigation"]]);const f=d.jsxs(d.Fragment,{children:[!i.search&&d.jsx("button",{className:"search toggle-search-button",onClick:v=>{v.preventDefault(),v.stopPropagation(),p("search",!u.search)},"aria-haspopup":"true","aria-expanded":u.search,"aria-controls":"search-form",children:d.jsx(Ie,{children:t.formatMessage({id:`header_search_${u.search?"hide":"show"}`})})}),d.jsx(oh,{id:"global-search",handleToggle:{searchIsOpen:u.search,isDesktopVersion:i.search},gtmContext:"search-bar-header",gtmEvent:"form-submission"})]}),b=d.jsxs(d.Fragment,{children:[!i.navigation&&d.jsx("button",{className:"menu-button gtm-trackable",onClick:v=>{v.preventDefault(),v.stopPropagation(),p("site-navigation",!u["site-navigation"])},"data-gtm-event-type":"open-tab-menu-click","data-gtm-event-context":"HeaderLeft-Chevron","aria-haspopup":"true","aria-expanded":u["site-navigation"],"aria-controls":"site-navigation",children:d.jsx(Ie,{children:t.formatMessage({id:`header_menu_${u["site-navigation"]?"hide":"show"}`})})}),d.jsx("ul",{ref:m,id:"navigation",hidden:i.navigation||u["account-navigation"]?!1:!u["site-navigation"],"data-showing":!i.navigation&&u["account-navigation"]?"account":"default",children:$r.order.map(v=>d.jsx(za,{id:v,isLoggedIn:a,isDesktopVersion:i.navigation,menus:{"site-navigation":u["site-navigation"],"account-navigation":u["account-navigation"]},callback:p},v))})]});return n&&n.isLoading?null:d.jsxs(d.Fragment,{children:[d.jsxs("nav",{id:"header",className:G({"logged-in":a,"logged-out":!a,visible:l}),children:[d.jsx(Ie,{element:"a",href:"#content-of-page",children:t.formatMessage({id:"header_skip"})}),d.jsx(ro,{variant:"monochrome"}),e&&d.jsxs(d.Fragment,{children:[i.navigation?d.jsxs(d.Fragment,{children:[b,f]}):d.jsxs(d.Fragment,{children:[f,b]}),a?d.jsxs("button",{className:"account-button",onClick:v=>$e.events.onClick(v,{id:"account-navigation",callback:p,isOpen:u["account-navigation"]}),onMouseEnter:()=>$e.events.onMouseEnter({id:"account-navigation",callback:p}),onMouseLeave:()=>$e.events.onBlur({id:"account-navigation",callback:p}),"aria-haspopup":"true","aria-expanded":u["account-navigation"],"aria-controls":"account-navigation",children:[d.jsx(Ie,{children:t.formatMessage({id:`header_account_${u["account-navigation"]?"hide":"show"}`})}),d.jsx(Gt,{name:n&&n.name||"",src:n&&n.image&&n.image.thumbnail||""})]}):d.jsx("ul",{className:"sign-in-buttons",children:$r.buttons.order.map(v=>d.jsx(za,{id:`buttons.${v}`},v))})]})]}),d.jsx("hr",{id:"content-of-page"}),d.jsx("div",{className:G("overlay",{open:u["site-navigation"]||u["account-navigation"]||!i.search&&u.search})})]})};const Ow=()=>{const e=se.useIntl();return d.jsxs(d.Fragment,{children:[d.jsx(Oo,{}),d.jsx("div",{id:"content",children:d.jsx(cn,{variant:"error",text:e.formatMessage({id:"pageLayout_error"})})}),d.jsx(jo,{})]})},ch=({children:e,additionalContent:{prepended:t,appended:n}={},reportError:r,forceShow:a={},styling:i={},className:s="",locale:o="en"})=>{const{navigation:l=!0,footer:u=!0}=a,{background:c="default",variant:h="default",circle:p="default",modal:m="default"}=i,g=jc(),[f,b]=y.useState(""),v=A=>{const{detail:{message:S}}=A;b(S)};y.useEffect(()=>(window.scrollTo(0,0),document.addEventListener("ariaLive",v),()=>{document.removeEventListener("ariaLive",v)}),[g]);const E=ga(e,{locale:o}),k=ga(t,{locale:o}),x=ga(n,{locale:o}),w={};return c!=="default"&&(w[c]=!0),h!=="default"&&(w[h]=!0),p!=="default"&&(w[p]=!0),d.jsx(Lh.ErrorBoundary,{onError:r,fallback:d.jsx(Ow,{}),children:d.jsxs(y.Suspense,{fallback:null,children:[d.jsxs("div",{id:"wrapper",className:G(s,w,{"has-footer":u}),children:[d.jsx(Oo,{showNavigation:l}),d.jsxs("main",{id:"content-wrapper",children:[k&&d.jsx("div",{className:G("additional-content prepended",{"large-modal":m==="large"}),children:k}),y.createElement(c==="bold"?Gs:"div",{id:"content",children:E,className:G({"large-modal":m==="large"})})]}),x&&d.jsx("div",{className:"additional-content appended",children:x}),u&&d.jsx(jo,{}),d.jsx(lh,{})]}),f&&d.jsx(Ie,{"aria-live":"polite",showOnFocus:!1,"data-testid":"layout-aria-live",children:f})]})})},yc={default:"tags_",headerTopics:"header_topics_topics_"},ts={topic:{Climate:"climate",CitiesAndLocalGovernment:"cities-and-local-government",DigitalAndData:"digital-and-data",Education:"education",EquityJusticeAndInclusion:"equity-justice-and-inclusion",HealthAndSocialCare:"health-and-social-care",Innovation:"innovation",LeadershipAndSkills:"leadership-and-skills",LifeInGovernment:"life-in-government",Policymaking:"policymaking",TransportAndInfrastructure:"transport-and-infrastructure",WorkAndTheEconomy:"work-and-the-economy"},"from the community":"community"},Pw={getTagDetails:e=>{if(e.includes("topic_")){if(e=ts.topic[e.replace("topic_","")],e){const t=$r.topics.topics[e].href;return t?{id:e,href:t,text:`${yc.headerTopics}${e}`}:null}return null}return ts[e]?(e=ts[e],{id:e,text:`${yc.default}${e}`}):null}};const Nw=({tags:e=[],color:t="default",forceOneLine:n=!1,canHaveLinks:r=!0,className:a="",gtmType:i="tag-click",gtmContext:s="tags"})=>{const o=se.useIntl();if(!e||e.length<1)return null;const l=[];return e.forEach(u=>{if(!u)return;const c=Pw.getTagDetails(u);c&&l.push(c)}),l.length<1?null:d.jsx("ul",{className:G("tags text-small",t,a,{"one-line":n}),children:l.map(u=>{const c=o.formatMessage({id:u.text});return d.jsx("li",{children:u.href&&r?d.jsx("a",{href:u.href,className:"gtm-trackable","data-gtm-event-type":i,"data-gtm-event-context":s,children:c}):c},u.id)})})};const Mw=({members:{data:e=[],total:t=e.length},hasNextPage:n=!1,loadNextPage:r=()=>{},gtmContext:a="member",gtmType:i="member-click",className:s=""})=>{const o=se.useIntl();return e.length===0?null:d.jsxs("div",{className:G("members-list",s),children:[d.jsxs("h1",{children:[o.formatMessage({id:"membersList"}),d.jsx("span",{className:"count",children:t})]}),d.jsx("ul",{children:e.map((l,u)=>d.jsxs("li",{children:[d.jsx(_n,{member:l,gtmContext:a,gtmType:i}),l.isAdmin&&d.jsx(Cn,{children:o.formatMessage({id:"membersList_admin"})})]},u))}),n&&d.jsx(zr,{hasNextPage:n,loadNextPage:r,icon:{icon:"arrow-down",position:"right"},gtmContext:a})]})},Rw={showForm:!1},oi=y.createContext(Rw),dh=({children:e})=>{const[t,n]=y.useState({showForm:!1});return d.jsx(oi.Provider,{value:{...t,updateConversation:n},children:e})},Cc=e=>{const t={};return Object.keys(e).forEach(n=>n.includes("Id")?t[n]=e[n]:t[`${n}Slug`]=e[n]),t},Iw=({intlPath:e,showGuidelines:t,type:n,gtmContext:r})=>{const a=se.useIntl();return t?d.jsx("small",{children:At(a.formatMessage,`${e}explainer`,n,"action",{a:i=>d.jsx("a",{href:"https://about.apolitical.co/q-and-a-community-guidelines",target:"_blank",className:"gtm-trackable","data-gtm-event-context":r,"data-gtm-event-type":"community-guidelines-link",rel:"noreferrer",children:i})})}):d.jsx(d.Fragment,{})},$w=({formID:e,intlPath:t,showLabel:n,type:r})=>{const a=se.useIntl();return n?d.jsx("label",{htmlFor:`${e}-input`,className:"text-small",onClick:i=>{i.preventDefault(),i.stopPropagation();const s=new CustomEvent("focusEditor",{detail:{id:`rte-${e}-input`}});window.dispatchEvent(s)},children:a.formatMessage({id:`${t}label`})}):d.jsx(Ie,{element:"label",showOnFocus:!1,htmlFor:`${e}-input`,children:At(a.formatMessage,`${t}label_action`,r,"action")})};let da=null;const Je="discussion_form_",Wr=({id:e,content:t={type:"response",slugs:{}},userHasPermissions:n=!0,meta:r,placeholder:a,maxLength:i=0,buttons:s,forceShow:o={cancel:!1,error:!1},isCommunity:l=!1,functions:u,data:c={},gtmContext:h="DiscussionForm"})=>{var Ee,Ae,ze;const p=se.useIntl(),m=y.useContext(Bt),[g,f]=y.useState(""),{isLoading:b=!1,isInWrapper:v=!1,isInOverlay:E=!1,isAutoFocused:k=!1,isEditing:x=!1,hasTitleField:w=!1,isPrepopulated:A=!1,showTitle:S=!1,showGuidelines:W=!0,showDivider:R=!1,showSuccessMessage:I=!0}=r||{},{onChange:N=()=>{},create:_=()=>{},handleSaveEdit:F=()=>{},handleCancel:j=()=>{},callback:$=()=>{},onMention:V=()=>{},listMembers:K=()=>Promise.resolve([]),clickMentionFallback:Q=()=>{},props:ae={create:{projectNames:["questions-answers"]}}}=u,[D,L]=y.useState({title:w&&w.text||"",body:x&&x.text||A&&A.text||""}),[q,B]=y.useState(o.error||!1),[T,z]=y.useState(!1);if(y.useEffect(()=>{l&&!x&&A&&A!==D.body&&L({...D,body:A.text||""})},[A]),b)return d.jsx(kt,{className:"discussion-card discussion-form","data-testid":"loading-placeholder"});const M=Se=>{L({...D,body:Se}),N({body:Se});let Te;!m||!m.id?Te=At(p.formatMessage,`${Je}error_loggedOut`,t.type,"action"):n?i>0&&Se.length>=i&&(Te=`${Je}error_tooLong`):Te=At(p.formatMessage,`${Je}error_noPermission`,t.type,"action"),Te?B(Te):q&&B(!1)};let H=`${t.type}-form`;if(t.type==="response"||t.type==="reply"){const Se=((Ee=t.slugs)==null?void 0:Ee.reply)||((Ae=t.slugs)==null?void 0:Ae.answer)||((ze=t.slugs)==null?void 0:ze.question)||"";Se&&(H=`${H}-${Se.slice(-15)}`)}e&&(H=`${e}-${H}`);const ne=async()=>{if(!m||!m.id||!n||J)return;da&&clearTimeout(da),z("submitting");const Se=window.location.pathname;try{let Te;switch(t.type){case"post":Te=await _({title:D.title,content:D.body});break;case"question":Te=await _({title:D.body,authorId:m&&m.id,...ae==null?void 0:ae.create});break;case"response":Te=await _({questionSlug:t.slugs.question},{body:D.body,authorId:m&&m.id,contentPath:Se});break;case"reply":Te=await _({questionSlug:t.slugs.question,answerSlug:t.slugs.answer},{body:D.body,authorId:m&&m.id,contentPath:Se});break;default:break}await Qh(1e3),$&&await $(Te),da=setTimeout(()=>{L({title:"",body:""}),z("submitted"),f(At(p.formatMessage,`${Je}success`,t.type,"action"));const Ne=new Event(rt.DISCUSSION_FORM_SUBMITTED);document.dispatchEvent(Ne),ee()},500)}catch(Te){const Ne=Te;let ke=`${Je}error`;Ne!=null&&Ne.message.includes("entry already exists")&&(ke=At(p.formatMessage,`${Je}error_alreadyExists`,t.type,"action")),Ne!=null&&Ne.message.includes("429")?ke=At(p.formatMessage,`${Je}error_tooMany`,t.type,"action"):Ne!=null&&Ne.message.includes("400")&&(ke=`${Je}error`),B(ke),ee()}},ee=()=>{da=setTimeout(()=>{B(!1),z(!1),f("")},5e3)},re=!D.title||!Yo(D.title),le=!D.body||!Yo(D.body);let J=le;w&&(J=re&&le);const he=T==="submitting",me=[{component:$w,props:{formID:H,intlPath:Je,showLabel:w!==!1,type:t.type}},{component:nh,props:{id:`${H}-input`,value:T==="submitting"&&!q?"":D.body,placeholder:a||At(p.formatMessage,`${Je}placeholder`,t.type,"action"),maxLength:i,meta:{isInOverlay:E},functions:{onChange:M,onMention:V,listMembers:K,clickMentionFallback:Q},data:c,autoFocus:x!==!1||k&&!w,"aria-invalid":!!q,"aria-errormessage":"error-message"}},{component:Iw,props:{intlPath:Je,showGuidelines:W,type:t.type,gtmContext:h}}];R&&me.push({component:zt}),w&&me.unshift({id:"title",type:"text",value:w.text,limit:250,autoFocus:k,label:p.formatMessage({id:`${Je}titleField_label`}),placeholder:p.formatMessage({id:`${Je}titleField_placeholder`}),functions:{onChange:Se=>{L({...D,title:Se}),N({title:Se})}},validation:[{condition:()=>J,error:p.formatMessage({id:`${Je}titleField_error`})}]});let ve=!m||!m.id||!n||J||he;return x&&(w?ve=ve||D.body===x.text&&D.title===w.text:ve=ve||D.body===x.text),d.jsxs(d.Fragment,{children:[d.jsxs(Qt,{id:H,className:G("discussion-card discussion-form",{"no-styling":v&&x}),meta:{shouldReset:!0,shouldHide:!1,showRequiredLabels:!1,shouldShowCancelButton:x&&!he||o.cancel},functions:{onSuccess:async()=>{if(x){z("submitting"),F(D);return}await ne()},onCancel:j},fields:me,intlPath:Je,button:{variant:"primary",size:{mobile:"small",600:"medium"},className:"gtm-trackable","data-gtm-event-context":h,"data-gtm-event-type":`${x?"save":"submit"}-${t.type}-click`,"data-testid":"save-button",disabled:ve,overwriteSubmittingText:!0,text:!he&&!x&&(s!=null&&s.submit)?s==null?void 0:s.submit:p.formatMessage({id:`${Je}${he?x?"saving":"posting":x?"save":"post"}`})},secondaryActionButton:{variant:"secondary",size:{mobile:"small",600:"medium"},className:"gtm-trackable","data-gtm-event-context":h,"data-gtm-event-type":`cancel-${t.type}-click`,disabled:!o.cancel&&(!m||!m.id||!D.body),text:s!=null&&s.cancel?s==null?void 0:s.cancel:p.formatMessage({id:`${Je}cancel`})},gtm:{context:h,event:`${t.type}-form`},"data-testid":`discussion-${t.type}-form`,children:[S&&!x&&["question"].includes(t.type)&&d.jsx("h2",{children:At(p.formatMessage,`${Je}title`,t.type,"action")}),d.jsx(_n,{member:m?{...m,link:!1}:"community",gtmContext:h,gtmType:"profile-click"})]}),T==="submitted"&&I&&d.jsx(Tr,{className:"success","data-testid":"success",children:At(p.formatMessage,`${Je}success`,t.type,"action")}),q&&d.jsx(Tr,{id:"error-message",className:"error","data-testid":"error",children:o.error?o.error:typeof q=="string"?q.includes(" ")?q:p.formatMessage({id:q},{action:p.formatMessage({id:`discussion_action_${t.type}`}),maxLength:i}):q}),g&&d.jsx(Ie,{"aria-live":"polite",showOnFocus:!1,children:g})]})},Lw=Object.freeze(Object.defineProperty({__proto__:null,default:Wr},Symbol.toStringTag,{value:"Module"})),zw=({question:e,answer:t,reply:n})=>({...e&&{questionSlug:e},...t&&{answerSlug:t},...n&&{replySlug:n}}),qw=(e,t=10)=>!e||e.length===0?[]:e.slice(0,t);const qa=({icon:e,className:t="",...n})=>d.jsx(Be,{className:G("discussion-button",t),variant:"tertiary",icon:e,...n});let Fr=!1;const ns=()=>{Fr!==!1&&(clearTimeout(Fr),Fr=!1)},rs=5;let as=null;const fh=({element:e="div",likes:t=0,peopleWhoLiked:n=!1,isShort:r=!0,userLiked:a=!1,content:i={type:"reply",slugs:{}},canLike:s=!0,functions:{createLike:o=()=>{},deleteLike:l=()=>{}}={}})=>{const u=se.useIntl(),c={numberOfLikes:t,userLikedContent:a,ignoreInteractions:!1,showLikers:!1,tabbableLink:0},[h,p]=y.useReducer(Lr,c),{numberOfLikes:m,userLikedContent:g,ignoreInteractions:f,showLikers:b,tabbableLink:v}=h;y.useEffect(()=>{p([{type:"userLikedContent",value:a}])},[a]);const E=y.useMemo(()=>qw(n,rs),[n]),k=S=>{if(S.preventDefault(),S.stopPropagation(),p([{type:"showLikers",value:!1}]),Fr)return ns(),!1;if(ns(),f||!s)return!1;Fr=setTimeout(x,350)},x=async()=>{if(ns(),f||!s)return!1;let S=g?m-1:m+1;S<0&&(S=0),p([{type:"ignoreInteractions",value:!0},{type:"numberOfLikes",value:S},{type:"userLikedContent",value:!g}]);try{if(i&&i.slugs){const W=zw(i.slugs);g?await l(W):await o({...W,payload:{contentPath:window.location.pathname}})}}catch{p([{type:"numberOfLikes",value:t},{type:"userLikedContent",value:a}])}finally{p([{type:"ignoreInteractions",value:!1}])}},w=()=>{as=setTimeout(()=>{p([{type:"showLikers",value:!1}])},500)},A=()=>{as&&clearTimeout(as)};return y.createElement(e,{className:"likes-wrapper",onKeyDown:S=>{S.key==="Escape"&&p([{type:"showLikers",value:!1}])},onMouseEnter:()=>{A(),p([{type:"showLikers",value:!0}])},onMouseLeave:()=>{w()}},d.jsxs(d.Fragment,{children:[d.jsx(qa,{className:G("discussion-button text-medium action-button",{"show-spinner":f,"is-liked":g,disabled:!s}),icon:{icon:g?"heart":"heart_empty",animate:"bounce"},disabled:!s,"data-testid":"like-button","data-gtm-event-context":"Likes","data-gtm-event-type":`like-${i.type}-click`,onClick:k,screenreaderText:s?u.formatMessage({id:`discussion_likes_${g?"unlike":"like"}`},{action:u.formatMessage({id:`discussion_action_${i.type}`})}):!1,"aria-pressed":g,children:d.jsx("span",{"data-testid":"number-of-likes",className:"number-of-likes",children:u.formatMessage({id:`discussion_likes${r?"_short":""}`},{number:m})})}),n&&d.jsxs(d.Fragment,{children:[d.jsx(Ie,{"data-testid":"like-a11y-button",element:"button",className:"tertiary small icon navigation_arrow",onFocus:()=>{A()},onBlur:()=>w,onClick:S=>{var R;S.preventDefault(),S.stopPropagation(),A(),p([{type:"showLikers",value:!0}]);const W=(R=S.currentTarget.nextSibling)==null?void 0:R.childNodes[0];if(W){const I=W.querySelector("li:first-child a");I&&(p([{type:"tabbableLink",value:0}]),setTimeout(()=>{I.focus()},100))}},onKeyDown:S=>{S.key==="Escape"&&(S.preventDefault(),S.stopPropagation(),w())},"aria-expanded":b,"aria-controls":`likes-tooltip-${i.slug}`,children:d.jsx(Ie,{showOnFocus:!1,children:u.formatMessage({id:"discussion_likes_show"},{action:i.type})})}),d.jsx(Sn,{id:`likes-tooltip-${i.slug}`,isOpen:b,isLoading:n.length===0,children:n.length&&d.jsxs("ul",{children:[E.map((S,W)=>{if(typeof S=="string"||!S.name)return null;const R={};return v!==W&&(R.tabIndex=-1),d.jsx("li",{"data-index":W,children:d.jsx(jn,{href:S.id?`/profiles/${S.id}`:void 0,gtmContext:"Likes",gtmType:"liked-name-click",onClick:I=>I==null?void 0:I.stopPropagation(),onFocus:()=>A(),onKeyDown:I=>{var $,V,K,Q;if(!I||!["ArrowUp","ArrowDown"].includes(I.key||""))return;I.stopPropagation(),I.preventDefault();const N=I.key==="ArrowUp"?"up":"down",_=($=I.currentTarget)==null?void 0:$.parentElement;let F=_==null?void 0:_.nextElementSibling;if(N==="up"){const ae=_==null?void 0:_.previousElementSibling;ae?F=ae:(F=(V=_==null?void 0:_.parentElement)==null?void 0:V.lastElementChild,(F==null?void 0:F.getAttribute("data-index"))==="-1"&&(F=F==null?void 0:F.previousElementSibling))}else(!F||(F==null?void 0:F.getAttribute("data-index"))==="-1")&&(F=(K=_==null?void 0:_.parentElement)==null?void 0:K.firstElementChild);if(!F)return;const j=(F==null?void 0:F.getAttribute("data-index"))||"0";p([{type:"tabbableLink",value:j}]),(Q=F==null?void 0:F.querySelector("a"))==null||Q.focus()},...R,children:S.name})},S.id||window.btoa(S.name))}),t>rs&&d.jsx("li",{"data-index":"-1",children:u.formatMessage({id:"discussion_likes_more"},{number:t-rs})})]})})]})]}))},is=({children:e,class:t,...n})=>{const r={...n,class:G("subtle",t)};return d.jsx("blockquote",{...r,children:e})},Ww=280,Po=async(e,t,n,r=()=>Promise.resolve([]))=>{let a=t?Gn(e,typeof t=="number"?t:Ww):e;a=a.trim();const i=`<br>
163
+ `}),W=F.turndown(W)}o&&o.mentions&&(W=await Hc({text:W,template:`[${Ns}{{name}}]({{id}})`,mentions:o.mentions,listMembers:p||(()=>Promise.resolve([]))})),qx(W,F=>{x([{type:"initialValue",value:F},{type:"editorKey",value:A.toString()}]),setTimeout(()=>{x([{type:"stringValue",value:dc(Q)}])},150)})})()},[A]),C.useEffect(()=>{t!==""||!Q||ls(A,t)&&!L||(y.withoutNormalizing(Q,()=>{J.delete(Q,{at:{anchor:y.start(Q,[]),focus:y.end(Q,[])}}),J.deselect(Q),Q.children.length!==0&&J.unwrapNodes(Q,{at:[0]}),J.insertNodes(Q,v,{at:[0]})}),x([{type:"initialValue",value:v},{type:"lastAnchor",value:null}]))},[t]);const D=jc(()=>{Vx({editor:Q,isShowing:B.show,numberOfUsers:B.numberOfUsers,listMembers:p,dispatch:x})},100);return S?d.jsx("div",{id:I,className:"rich-text-editor",children:d.jsxs(Xt.Provider,{value:{...k,id:I,isInOverlay:h,setFocus:j,dispatch:x,onMention:f,reportError:b},children:[d.jsxs(oC,{editor:Q,initialValue:S,onChange:M=>{if(Q.operations.some(F=>F.type!=="set_selection")){const F=Zx(M);g(F),x([{type:"stringValue",value:dc(Q)}]),L||x([{type:"hasInteracted",value:!0}]),D(),c&&console.log({serialized:F,json:M})}},...l,children:[d.jsx(J1,{className:"input",renderElement:G,renderLeaf:V,placeholder:n||u.formatMessage({id:"richTextEditor_placeholder"}),autoFocus:s,tabIndex:0,onKeyDown:M=>{if(M.key==="Enter"){B.show&&(M.preventDefault(),M.stopPropagation(),Kf(Q,B,x,I));const{selection:W}=Q;if(W){const F=K.isCollapsed(W),[T,z]=y.node(Q,W,{depth:1});let R=T,H=R.type;const re=R.children[0];if(re&&[Z.ol,Z.ul].includes(re.type)&&(R=re,H=re.type),R&&de.isElement(R)&&H!==Z.paragraph){if(H===Z.blockquote&&!M.shiftKey){M.stopPropagation(),M.preventDefault(),J.insertNodes(Q,v);return}if(F){const[X,ne]=y.parent(Q,W,{edge:"end"}),ee=X.type;if([Z.ul,Z.ol].includes(H))if(M.stopPropagation(),M.preventDefault(),ee===Z.li&&N==="Enter"){X.children.length===1&&"text"in X.children[0]&&X.children[0].text===""&&J.removeNodes(Q,{at:ne}),J.insertNodes(Q,v,{at:P.next(z)}),J.select(Q,y.end(Q,P.next(z)));return}else{const[he,me]=Wx(Q,Z.li),ye={type:Z.li,children:[{text:""}]};J.insertNodes(Q,ye,{at:P.next(me)}),J.select(Q,y.end(Q,P.next(me)))}}}}}else if(M.key==="Escape"){if(B.show){M.preventDefault(),M.stopPropagation(),x([{type:"mentionPopover",value:{...B,show:!1}}]);return}}else if(["ArrowUp","ArrowDown"].includes(M.key)&&B.show){M.preventDefault(),M.stopPropagation();const{selectedUser:W,possibleUsers:F}=B;let T=M.key==="ArrowUp"?W-1:W+1;T<0&&(T=F.length-1),T>=F.length+1&&(T=0),x([{type:"mentionPopover",value:{...B,selectedUser:T}}])}x([{type:"lastKey",value:M.key}]),Hx(M,Q,x,b)},onBlur:()=>{Q.selection&&x([{type:"lastAnchor",value:Q.selection.anchor}])},onFocus:()=>{if($){if(!P.isPath($.path)||!ue.has(Q,$.path))return;const M=ue.get(Q,$.path);let W=0;if(fe.isText(M)?W=M.text.length:M.children&&(W=M.children.length),$.offset>W)return;try{J.select(Q,{anchor:$,focus:$})}catch(F){const T=F.message;b(`Error focusing editor: ${T}`)}}}}),d.jsx(iw,{}),p?d.jsx(Yx,{onFallbackClick:m}):null]},w),d.jsx(ao,{id:`character-limit-${e}`,limit:r,valueLength:Xa(q)})]})}):d.jsx(d.Fragment,{})};const pw=({id:e="form-toggle",label:t,options:n,initialValue:r,functions:{onChange:a=()=>{}},isDisabled:i=!1,className:s=""})=>{const[o,l]=C.useState(typeof r=="boolean"||typeof r=="string"?r:n[0].value);C.useEffect(()=>{r&&l(r)},[r]);const u=c=>{i||(l(c),a(c))};return d.jsxs("div",{className:Y("toggle",s),onClick:c=>{c.preventDefault(),c.stopPropagation(),u(o===n[0].value?n[1].value:n[0].value)},children:[d.jsx("p",{children:t}),d.jsx("ul",{className:Y("toggle-options",{disabled:i,on:o===n[1].value}),children:n.map(c=>{const h=`${e}-${c.value}`;return d.jsxs("li",{className:"hidden",children:[d.jsx("input",{type:"radio",id:h,name:e,value:c.value,checked:o===c.value,onChange:()=>u(c.value),disabled:i}),d.jsx("label",{htmlFor:h,children:c.label})]},h)})})]})};function nh({className:e="",userId:t,userName:n,src:r,uploadImage:a,button:i,callback:s}){const o=oe.useIntl(),l="profileImageChange_",[u,c]=C.useState(r),[h,p]=C.useState(!1),[m,g]=C.useState(!1),f=C.useRef(null),b=async x=>{p(!0),g(!1);try{const w=x.target.files&&x.target.files[0];if(!w||!t)throw p(!1),new Error("Image file or userID is missing");const A=await a({fileObject:w,userId:t}),S={thumbnail:A.thumbnailURL,full:A.originalURL};c(S),s(S)}catch{g(!0)}finally{p(!1)}p(!1)},{upload:v=o.formatMessage({id:`${l}cta_upload`}),change:E=o.formatMessage({id:`${l}cta_change`}),uploading:k=o.formatMessage({id:`${l}cta_uploading`})}=(i==null?void 0:i.text)||{};return d.jsxs("div",{className:Y("profile-image-change-figure",e),children:[d.jsx(Gt,{className:"profile-image-change-picture",name:n,src:u==null?void 0:u.thumbnail,showInitials:!1,alt:"","data-testid":"profile-picture"}),m&&d.jsx("p",{className:"error text-small",children:o.formatMessage({id:`${l}error`})}),d.jsx("input",{id:"file",type:"file",accept:"image/*",ref:f,onChange:b,hidden:!0,"data-testid":"file-input"}),d.jsx(ke,{onClick:()=>f.current&&f.current.click(),variant:"secondary","data-gtm-event-context":"ImageField","data-gtm-event-type":`${u?"change-photo":"add-photo"}-click`,className:"gtm-trackable",disabled:h,children:h?k:u?E:v})]})}const rh=({gtm:e,functions:{onSuccess:t=async()=>{},onFailure:n=()=>{}}})=>{const{context:r="FooterContactUsForm",event:a="contact-form-submit-click"}=e||{};return d.jsx(Qt,{id:"contact-us-form",fields:[{id:"name",type:"text",className:"short",validation:[{condition:"required"}],autoComplete:"name"},{id:"email",type:"email",className:"short",validation:[{condition:"required"},{condition:"valid-email"}]},{id:"organisation",type:"text"},{id:"interests",type:"checkboxes",options:[{id:"publishingCourse",label:"Publishing or creating a course"},{id:"buyingCourse",label:"Buying courses for my team"},{id:"learningExperience",label:"Customised learning experiences"},{id:"somethingElse",label:"Something else"}]},{id:"message",type:"textarea",limit:1e3,validation:[{condition:"required"}]}],intlPath:"contactForm",gtm:{context:r,event:a},functions:{onSuccess:t,onFailure:n}})};const ah=({title:e,label:t,ctaMessage:n,titleColor:r,labelColor:a,backgroundColor:i,onClose:s,reportError:o,sendInvites:l,initialFormStatus:u="NOT_SUBMITTED"})=>{const[c,h]=C.useState([]),[p,m]=C.useState(!0),[g,f]=C.useState(u),{formatMessage:b}=oe.useIntl(),v=async x=>{x.preventDefault();try{await l(c),h([]),f("SUCCESS")}catch(w){f("ERROR"),o(w)}},E=x=>{x.preventDefault(),f("NOT_SUBMITTED"),m(!0),h([])},k=x=>{x.preventDefault(),s(),f("CLOSED")};return g==="CLOSED"?null:g==="ERROR"||g==="SUCCESS"?d.jsxs("div",{className:"invite-form-wrapper",children:[d.jsx("div",{className:"content centred",children:g==="SUCCESS"?d.jsx("h2",{className:"success-title",children:b({id:"inviteForm_success"})}):d.jsxs("h2",{className:"error-title",children:[" ",b({id:"inviteForm_error"})]})}),d.jsx(zt,{}),d.jsx("div",{className:"footer",children:g==="SUCCESS"?d.jsxs(d.Fragment,{children:[d.jsx(ke,{variant:"secondary",onClick:E,children:b({id:"inviteForm_ctaSendMoreInvites"})}),d.jsx(ke,{onClick:k,children:b({id:"inviteForm_ctaDone"})})]}):d.jsx(ke,{onClick:E,children:b({id:"inviteForm_ctaTryAgain"})})})]}):d.jsx("div",{className:"invite-form-wrapper",children:d.jsxs("form",{style:{backgroundColor:i},onSubmit:v,className:Y("invite-form gtm-trackable"),children:[d.jsxs("fieldset",{className:"content",children:[d.jsx("h2",{className:"title",style:{color:r},children:e}),d.jsx("label",{htmlFor:"email-input",className:"label",style:{color:a},children:t}),d.jsx(Mh.ReactMultiEmail,{id:"email-input",inputClassName:"email-input input",placeholder:b({id:"inviteForm_email_placeholder"}),emails:c,onChange:x=>{h(x),m(!x.length)},autoFocus:!1,getLabel:(x,w,A)=>d.jsxs("div",{className:"email text-medium",children:[d.jsx("div",{"data-tag-item":!0,children:x}),d.jsx(ke,{variant:"tertiary",size:"small",icon:{icon:"close"},onClick:()=>{A(w),m(!c.length)},className:"remove-email-button",screenreaderText:b({id:"overlay_close"})})]},w)})]}),d.jsx(zt,{}),d.jsx("fieldset",{className:"footer",children:d.jsx(ke,{className:"sendEmailsButton",disabled:p,children:n})})]})})},_a=e=>e.map(t=>({condition:t})),Ct={FORM_ID:"manage-account-password-change",NEW_PASSWORD:"newPassword",CONFIRMED_PASSWORD:"confirmedPassword",CURRENT_PASSWORD:"oldPassword"},gw=({functions:e,...t})=>{const{formatMessage:n}=oe.useIntl(),[r,a]=C.useState(null),[i,s]=C.useState(!1),[o,l]=C.useState({isMoreThanEightCharacters:!1,includesNumberAndSymbol:!1,includesLowerAndUppercase:!1}),u=m=>m[Ct.NEW_PASSWORD]!==m[Ct.CONFIRMED_PASSWORD]?n({id:"passwordRules_unmatched_text"}):null,c=m=>!hs(m[Ct.NEW_PASSWORD]).isValid,h=[{"data-testid":Ct.NEW_PASSWORD,id:Ct.NEW_PASSWORD,type:"password",autoComplete:"new-password",placeholder:"",label:n({id:"passwordRules_newPassword_label"}),validation:_a(["required",c]),functions:{onChange:m=>l(hs(m).matchingRules),onFocus:()=>s(!0),onBlur:()=>s(!1)}},{"data-testid":Ct.CONFIRMED_PASSWORD,id:Ct.CONFIRMED_PASSWORD,type:"password",autoComplete:"new-password",placeholder:"",label:n({id:"passwordRules_confirmPassword_label"}),validation:_a(["required",u])}];t.isPasswordChange&&h.unshift({"data-testid":Ct.CURRENT_PASSWORD,id:Ct.CURRENT_PASSWORD,type:"password",autoComplete:"current-password",placeholder:"",label:n({id:"passwordRules_currentPassword_label"}),validation:_a(["required"])}),i&&h.push({component:Td,props:{matchingRules:o}});const p={id:Ct.FORM_ID,fields:h,functions:{...e,onSuccess:async m=>(e.createPassword(m),e.onSuccess&&e.onSuccess(m)),onCatch:m=>a(m==null?void 0:m.statusCode),onFailure:(m,g)=>{(g.includes(Ct.NEW_PASSWORD)||g.includes(Ct.CONFIRMED_PASSWORD))&&s(!0)}},meta:{shouldReset:!0},...t};return d.jsxs(d.Fragment,{children:[d.jsx(Qt,{...p}),r&&d.jsx(cn,{variant:"error",text:r})]})};const ih=({hooks:e,functions:t,meta:n={},gtm:r})=>{var x,w;const a=oe.useIntl(),i="profileForm_",s=C.useContext(Tt),[o,l]=C.useState(s.image),[u,c]=C.useState(!1),{uploadImage:h,onSuccess:p=async A=>{},onCancel:m=()=>{},onFailure:g=()=>{}}=t,{buildLocation:f,isValidPlace:b,predictPlaces:v}=e.useMaps(),{context:E="ProfileForm",event:k="profile-form-submit-click"}=r||{};return d.jsx(Qt,{id:"profile-details-form",fields:[{component:nh,props:{userName:s.name,userId:s.id,src:o,uploadImage:h,callback:l,button:{text:{upload:a.formatMessage({id:`${i}image`})}}}},{id:"name",type:"text",label:a.formatMessage({id:`${i}name`}),placeholder:a.formatMessage({id:`${i}name_placeholder`}),value:s.name,autoComplete:"name",validation:[{condition:"required"}]},{id:"jobTitle",type:"text",label:a.formatMessage({id:`${i}jobTitle`}),placeholder:a.formatMessage({id:`${i}jobTitle_placeholder`}),value:s.jobTitle,validation:[{condition:"required"}]},{id:"organization",type:"text",label:a.formatMessage({id:`${i}organization`}),placeholder:a.formatMessage({id:`${i}organization_placeholder`}),value:s.organization,validation:[{condition:"required"}]},{id:"location",type:"autocomplete",label:a.formatMessage({id:`${i}location`}),placeholder:a.formatMessage({id:`${i}location_placeholder`}),value:((x=s.location)==null?void 0:x.en)||((w=s.location)==null?void 0:w.country),validation:[{condition:"required"},{condition:({location:A})=>A&&!u?!1:!b(A),error:a.formatMessage({id:`${i}location_error`})}],functions:{onChange:()=>{u||c(!0)},onKeyInput:v}},{id:"biography",type:"textarea",label:a.formatMessage({id:`${i}bio`}),placeholder:a.formatMessage({id:`${i}bio_placeholder`}),limit:1e3,value:s.biography},{component:zt}],meta:{shouldShowCancelButton:!0,shouldReset:!1,shouldHide:!1,showRequiredLabels:!1,...n},intlPath:i,gtm:{context:E,event:k},functions:{onSuccess:async A=>{try{const S={...A,image:o||null,location:u?await f(A==null?void 0:A.location):s.location};await p(S)}catch{g()}},onCancel:m,onFailure:g},button:{size:"large",text:a.formatMessage({id:`${i}cta`})}})};const sh=({id:e="search",className:t="",handleToggle:n=!1,defaultValue:r="",gtmContext:a="search-bar",gtmEvent:i="form-submission"})=>{const{searchIsOpen:s=!0,isDesktopVersion:o=!1}=n||{},l=oe.useIntl(),u=C.useRef(null);Qn(()=>{!n||o||!s||u.current&&u.current.focus()},[s]);const c=h=>{h.preventDefault(),h.stopPropagation(),!(!u.current||!u.current.value||u.current.value.length<1)&&(window.location.href=`/search?search=${encodeURIComponent(u.current.value)}`)};return d.jsx("form",{onSubmit:c,className:Y("search-form gtm-trackable",t),role:"search","data-gtm-event-context":a,"data-gtm-event-type":i,children:d.jsx("fieldset",{id:`${e}-form`,hidden:n?!s:!1,children:d.jsxs("p",{children:[d.jsx(Ie,{element:"label",htmlFor:e,children:l.formatMessage({id:"search_label"})}),d.jsx("input",{ref:u,type:"search",id:e,name:e,defaultValue:r,placeholder:l.formatMessage({id:"search_placeholder"}),onKeyDown:h=>{h.key==="Enter"&&c(h)}}),d.jsx("button",{className:"clear",onClick:h=>{h.preventDefault(),h.stopPropagation(),u.current&&u.current.value&&(u.current.value="")},children:d.jsx(Ie,{children:l.formatMessage({id:"search_clear"})})}),d.jsx("button",{className:"search",onClick:c,children:d.jsx(Ie,{children:l.formatMessage({id:"search_cta"})})})]})})})},gc=async({ref:e,validateEmail:t,dispatch:n})=>{const r=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;if(!e.current.validity.valid||!r.test(e.current.value))return n([{type:"validFields.email",value:!1}]);const a=e.current.value.toString().toLowerCase().trim(),i={valid:!1,autoApproved:!1,exists:{auth:!1,engagement:!1,registration:!1,user:!1}};let s=Object.assign({},i);try{s=await t(a),s===void 0&&(s=i)}catch{return n([{type:"shouldManuallyApprove",value:!0},{type:"emailDetails",value:{email:a,boxType:"nonGov",isEnd2End:!1}},{type:"validFields.email",value:!1}])}const{valid:o=!1,autoApproved:l=!1,exists:u}=s;let c="";return o?c=l?"gov":"nonGov":u.registration?u.engagement&&!u.user?c=u.auth?"verify":"pending":c="exists":u.auth&&(c="exists"),n([{type:"shouldDisableButton",value:!1},{type:"shouldManuallyApprove",value:!l},{type:"emailDetails",value:{email:a,boxType:c,isEnd2End:/testing\+[0-9]+@apolitical.co$/.test(a)}},{type:"validFields.email",value:!0}])},vw=e=>{const t={};for(const n of e.entries())t[n[0]]=n[1];return{name:t.full_name.toString().trim(),email:t.email_address.toString().toLowerCase().trim(),jobTitle:t.job_title,organization:t.organization,bioLink:t.url,optIn:!0,expectation:t.expectation,page:window.location.pathname,"g-recaptcha-response":t["g-recaptcha-response"]}},bw=async({refs:e,dataToSubmit:t,createAccount:n,onSuccess:r,dispatch:a,state:i})=>{if(!e.form||!e.form.current)throw new Error("No refs.form");if(!e.form.current.checkValidity()){e.hiddenValidation&&e.hiddenValidation.current&&e.hiddenValidation.current.click();return}const s=vw(new FormData(e.form.current)),o=Object.assign(s,t);await n(o),localStorage.setItem("email",s.email),r&&r({...s,...i.values}),a([{type:"showSuccessMessage",value:!0}])},yw=({shouldShow:e,placeholders:t,labels:n,functions:{validateEmail:r,resendVerificationCode:a},refs:i,state:s,dispatch:o,dataToSubmit:l,intl:u})=>{const{emailDetails:c}=s,h=(m,g)=>{m.current&&s.validFields[g]!==m.current.validity.valid&&o([{type:`validFields.${g}`,value:m.current.validity.valid}])},p=[{id:"full_name",type:"text",inputRef:i.name,placeholder:u.formatMessage({id:"signup_full_name_placeholder"}),functions:{onChange:()=>h(i.name,"name"),onFocus:()=>o([{type:"loadRecaptcha",value:!0}])},autoComplete:"name",validation:[{condition:"required"},{condition:"no-numbers"}],"data-testid":"signup-name-input"},{id:"email_address",type:"email",inputRef:i.email,placeholder:u.formatMessage({id:"signup_email_address_placeholder"}),"aria-describedby":"email-helper-textbox",functions:{onBlur:()=>{gc({ref:i.email,validateEmail:r,dispatch:o})},onChange:(m,g)=>{o([{type:"shouldDisableButton",value:!0}]),g&&g({type:"updateValue",payload:{key:"terms",value:!1}})},onFocus:()=>o([{type:"loadRecaptcha",value:!0}])},autoComplete:"email",validation:[{condition:"required"},{condition:"valid-email"}],"data-testid":"signup-email-input"},{component:_d,props:{email:c.email,type:c.boxType,resendVerificationCode:a}}];return s.shouldManuallyApprove&&(p.push({id:"job_title",type:"text",inputRef:i.jobTitle,placeholder:u.formatMessage({id:"signup_job_title_placeholder"}),functions:{onChange:()=>h(i.jobTitle,"jobTitle")},validation:[{condition:"required"}],"data-testid":"signup-job-input"},{id:"organization",type:"text",inputRef:i.organisation,placeholder:u.formatMessage({id:"signup_organization_placeholder"}),functions:{onChange:()=>{h(i.organisation,"organisation")}},validation:[{condition:"required"}],autoComplete:"organization","data-testid":"signup-org-input"}),e.url&&p.push({id:"url",type:"text",label:u.formatMessage({id:"signup_url"},{small:m=>d.jsx("small",{children:m})}),placeholder:u.formatMessage({id:"signup_url_placeholder"}),validation:[{condition:"valid-url"}],"data-testid":"signup-url-input"})),e.expectation&&p.push({id:"expectation",className:"expectation",type:"text",label:(n==null?void 0:n.expectation)||u.formatMessage({id:"signup_expectation"},{small:m=>d.jsx("small",{className:"notes text-small",children:m})}),placeholder:(t==null?void 0:t.expectation)||u.formatMessage({id:"signup_expectation_placeholder"}),"data-testid":"signup-events-question"}),p.push({id:"terms",className:"text-small",type:"checkbox",inputRef:i.tc,label:u.formatMessage({id:"signup_terms"},{terms:m=>d.jsx("a",{href:"https://about.apolitical.co/terms-and-conditions","data-gtm-event-context":"SignupForm","data-gtm-event-type":"terms-of-service-click",className:"gtm-trackable",children:m}),privacy:m=>d.jsx("a",{href:"https://about.apolitical.co/privacy-policy","data-gtm-event-context":"SignupForm","data-gtm-event-type":"privacy-policy-click",className:"gtm-trackable",children:m})}),shownValue:"accepted",functions:{onChange:m=>{if(!m)return;const g=[];["name","email"].forEach(f=>{s.validFields[f]!==i[f].current.validity.valid&&(g.push({type:`validFields.${f}`,value:i[f].current.validity.valid}),f==="email"&&gc({ref:i.email,validateEmail:r,dispatch:o}))}),g.length&&o(g)}},validation:[{condition:"required"}],"data-testid":"signup-terms-checkbox"}),p};const Cw=({className:e=""})=>d.jsxs("div",{className:Y("success-message",e),"data-testid":"success-message",children:[d.jsx("p",{className:"success-title",children:d.jsx(oe.FormattedMessage,{id:"signup_success_title"})}),d.jsx(oe.FormattedMessage,{id:"signup_success_text",values:{p:t=>d.jsx("p",{children:t})}})]});const Dw={validFields:{name:!1,email:!1,jobTitle:!1,organisation:!1},emailDetails:{email:"",boxType:"",isEnd2End:!1},shouldManuallyApprove:!1,shouldDisableButton:!0,loadRecaptcha:!1,showSuccessMessage:!1,showError:!1},xw=({className:e="",labels:t={},placeholders:n={},functions:r={validateEmail:()=>Promise.resolve(),createAccount:()=>Promise.resolve(),handleError:()=>{},resendVerificationCode:()=>Promise.resolve()},shouldShow:a={},submitButton:i,dataToSubmit:s={ref:"sign-up-form"},...o})=>{const l=oe.useIntl(),{title:u=!0,expectation:c=!1,url:h=!0,logInButton:p=!0,successMessage:m=!0}=a,g={title:u,expectation:c,url:h,logInButton:p,successMessage:m},[f,b]=C.useReducer(Lr,Dw),{validFields:v,emailDetails:E,shouldManuallyApprove:k,shouldDisableButton:x,showSuccessMessage:w,showError:A}=f,[S,q]=Ws.useCookies(["signup-this-session","functional-cookie-consent"]),$={form:C.createRef(),name:C.createRef(),email:C.createRef(),jobTitle:C.createRef(),organisation:C.createRef(),tc:C.createRef(),hiddenValidation:C.createRef()};C.useEffect(()=>{k===!0&&$.jobTitle.current&&$.jobTitle.current.focus()},[k]),C.useEffect(()=>{S["signup-this-session"]&&b([{type:"showSuccessMessage",value:!0}])},[S]),C.useEffect(()=>{w&&S["functional-cookie-consent"]&&q("signup-this-session","true",{path:"/",maxAge:3600})},[w]);const N=C.useMemo(()=>yw({placeholders:n,labels:t,shouldShow:g,functions:r,refs:$,state:f,dispatch:b,dataToSubmit:s,intl:l}),[s,r,l,$,g,f]),L=x?!0:k?!Object.values(v).every(_=>_===!0):!v.name||!v.email||["exists","pending","verify"].includes(E.boxType);return g.successMessage&&w?d.jsx(Cw,{className:e}):d.jsxs("fieldset",{className:Y("signup-form-fieldset",e),"data-testid":"signup-form",children:[g.title&&d.jsx("p",{className:"signup-title",children:d.jsx(oe.FormattedMessage,{id:"signup_title"})}),A&&d.jsx(cn,{variant:"error",text:l.formatMessage({id:"signup_error"})}),d.jsx(Qt,{className:"signup-form",formRef:$.form,id:"sign-up-form",fields:N,intlPath:"signup",button:{variant:"primary",size:"medium",text:i||l.formatMessage({id:"signup_button_join"}),disabled:L?{isClickable:!0}:!1,styling:{fullWidth:!0},"data-testid":"signup-button"},secondaryActionButton:{className:"login-button",styling:{fullWidth:!0},variant:"tertiary",size:"medium",href:"/user-onboarding/login","data-gtm-event-context":"SignupForm","data-gtm-event-type":"login-click",text:l.formatMessage({id:"signup_button_login"})},meta:{shouldReset:!1,showRequiredLabels:!1,shouldShowCancelButton:g.logInButton},gtm:{context:"SignupForm",event:"signup-submit-click"},functions:{onSuccess:async()=>{await bw({refs:$,dataToSubmit:s,createAccount:r.createAccount,onSuccess:r.onSuccess,dispatch:b,state:f})},onCatch:_=>{r.handleError(_),b([{type:"showSuccessMessage",value:!1},{type:"showError",value:!0}])}}}),d.jsx("button",{className:"validation-button",ref:$.hiddenValidation})]})};const mn=({children:e,className:t="",styling:n={},...r})=>{const{background:a="default"}=n;return d.jsx("section",{className:Y("full-width-section",t,{[a]:a!=="default"}),...r,children:e})};const ww=({text:e,buttons:t,className:n=""})=>{const r=[];return t.forEach(a=>{r.push({href:a.link,variant:"secondary",size:{mobile:"medium",1024:"large"},className:"gtm-trackable","data-gtm-event-type":"download-click","data-gtm-event-context":a.eventContext||"Download",target:"_blank",children:a.text})}),d.jsx(mn,{className:Y("download-section",n),children:d.jsxs("div",{className:"content-default",children:[C.createElement(typeof e=="string"?"h2":e.element,{className:"text"},typeof e=="string"?e:e.text),d.jsx(ir,{buttons:r})]})})};const qs="editSection_";function oh({href:e,setShowModal:t}){typeof e!="string"&&t(!0)}const Ew=({icon:e,description:t,ctaMessage:n,href:r,showEditButton:a,setShowModal:i})=>{const{formatMessage:s}=oe.useIntl();return d.jsxs("div",{className:Y("edit-section-placeholder",{"has-icon":!!e}),style:qc(e),children:[d.jsx("p",{children:t||s({id:`${qs}placeholder_description`})}),a&&d.jsx(ke,{href:r,variant:"secondary",size:"small",onClick:()=>oh({href:r,setShowModal:i}),children:n||s({id:`${qs}placeholder_cta`})})]})},_w=({children:e,className:t="",formProps:n,formComponent:r,href:a,title:i,modalTitle:s,placeholder:o,showDivider:l=!0})=>{const{formatMessage:u}=oe.useIntl(),[c,h]=C.useState(!1),p=()=>h(!1),m=!!n||!!r,g=typeof a=="string"||m;let f;return r&&(f=C.cloneElement(r,{functions:{...r.props.functions,onSuccess:async b=>{try{r.props.functions.onSuccess&&await r.props.functions.onSuccess(b)}finally{p()}},onCancel:()=>{r.props.functions.onCancel&&r.props.functions.onCancel(),p()}}})),d.jsxs("section",{className:Y("edit-section",t),children:[m&&d.jsx(dn,{title:s||`Edit ${i}`,isOpen:c,showDivider:!1,showIcon:!1,functions:{onClose:p},className:Y("edit-section-modal"),children:f||(n?d.jsx(Qt,{...n,fields:n.fields,meta:{...n==null?void 0:n.meta,shouldShowCancelButton:!0,shouldReset:!1,showSuccessMessage:!0},functions:{...n==null?void 0:n.functions,onSuccess:async b=>{var v,E;(v=n==null?void 0:n.functions)!=null&&v.onSuccess&&await((E=n==null?void 0:n.functions)==null?void 0:E.onSuccess(b)),h(!1)},onCancel:p}}):d.jsx(d.Fragment,{}))}),d.jsxs("div",{className:"edit-section-header",children:[d.jsx("h2",{className:"edit-section-header-title",children:i}),g&&d.jsx(ke,{href:a,variant:"tertiary",size:"small",icon:"pencil",onClick:()=>oh({href:a,setShowModal:h}),children:u({id:`${qs}edit`})})]}),e||d.jsx(Ew,{...o,href:a,setShowModal:h,showEditButton:g}),l&&d.jsx(zt,{})]})};const kw=({title:e=!1,text:t,logos:n=[],styling:r={},className:a=""})=>{const i=n.length;if(i===0)return null;const s={element:typeof e=="object"?e.element:"h2",text:typeof e=="string"?e:typeof e=="object"?e.text:"",className:typeof e=="object"?e.className:""},{wrapLogos:o=!1,align:l="center",display:u="block"}=r;return d.jsxs("div",{className:Y("logos",a,`align-${l}`,{[u]:u!=="block","wrap-logos":o}),children:[e&&C.createElement(s.element,{className:Y("title",s.className)},s.text),t&&d.jsx("p",{children:t}),d.jsx("ul",{className:Y({"two-col":i===2||i===4,"three-col":i===5||i<=10&&i%3===0}),children:n.map(({logo:c,nameOfBusiness:h,link:p=!1,description:m=!1},g)=>{if(!c||!c.url)return null;const f=d.jsx("img",{src:c.url,width:c.width||"auto",height:c.height||"auto",alt:h});return d.jsxs("li",{children:[d.jsx("p",{className:"img-wrapper",children:p?d.jsx("a",{href:p,target:"_blank",rel:"nofollow noreferrer noopener",children:f}):f}),m&&d.jsx("small",{children:m})]},window.btoa(`${c.url}_${g}`))})})]})};let Gi;const Qi="contactFooter_",Fw=({onSuccess:e=async()=>{},onFailure:t=()=>{}})=>{const n=C.useRef(null),[r,a]=C.useState(0),[i,s]=C.useState(!1),o=()=>{n.current&&a(n.current.clientHeight)},l=()=>{i||(s(!0),clearTimeout(Gi),Gi=setTimeout(()=>{o(),s(!1)},500))};return C.useEffect(()=>(o(),window.addEventListener("resize",l),()=>{clearTimeout(Gi),window.removeEventListener("resize",l)}),[]),d.jsx(mn,{id:"contactForm",className:"contact-footer",children:d.jsxs("div",{className:"inner-wrapper",children:[d.jsx("h2",{children:d.jsx(oe.FormattedMessage,{id:`${Qi}title`})}),d.jsxs("div",{className:"content-wrapper",ref:n,"data-testid":"content-wrapper",style:i?{}:{minHeight:r},children:[d.jsxs("aside",{children:[d.jsx("p",{children:d.jsx(oe.FormattedMessage,{id:`${Qi}text`})}),d.jsx(jn,{className:"mailto-link",href:"mailto:hello@apolitical.co",children:d.jsx(oe.FormattedMessage,{id:`${Qi}email`})})]}),d.jsx(rh,{functions:{onSuccess:e,onFailure:t},gtm:{context:"FooterContactUsForm",event:"contact-form-submit-click"}})]})]})})},Bw=({activeLink:e,...t})=>d.jsx(mn,{children:d.jsx(wd,{layout:"1-3",children:d.jsxs(d.Fragment,{children:[d.jsx(xd,{activeLink:e}),d.jsx(Xc,{...t})]})})});const Ji="cookieBanner_",Xi=["apol-cookie-banner","apolitical-performance-cookie-consent","functional-cookie-consent"],es=new Date(Date.now()+12*30*24*60*60*1e3),uh=()=>{const e=oe.useIntl(),[t,n,r]=Ws.useCookies(Xi),[a,i]=C.useState(!t["apol-cookie-banner"]),s=()=>{Xi.forEach(c=>{n(c,!0,{path:"/",expires:es,domain:c==="apolitical-performance-cookie-consent"?".apolitical.co":void 0})}),i(!1),window.location.reload()},o=()=>{n("apol-cookie-banner",!0,{path:"/",expires:es}),Xi.forEach(c=>{if(c==="apol-cookie-banner"){n(c,!0,{path:"/",expires:es});return}r(c)}),i(!1)};if(!a)return null;const l=[{id:"settings",href:"/pages/cookie-policy",gtmType:"policy-page"},{id:"reject",onClick:o,gtmType:"reject-all"},{id:"accept",onClick:s,gtmType:"accepted-all"}],u=[];return l.forEach(c=>{u.push({variant:c.href?"tertiary":"primary",href:c.href,onClick:c.onClick,className:"gtm-trackable","data-gtm-event-context":"cookie-banner","data-gtm-event-type":`cookie-${c.gtmType}-click`,children:e.formatMessage({id:`${Ji}buttons_${c.id}`})})}),d.jsxs("aside",{id:"cookie-banner",className:"text-medium",children:[d.jsx("h6",{children:e.formatMessage({id:`${Ji}title`})}),d.jsx("p",{children:e.formatMessage({id:`${Ji}text`})}),d.jsx(ir,{buttons:u})]})},Vt={platform:{order:["events","courses","articles","communities"],events:{href:"/events/",gtmType:"events-click"},courses:{href:"/microcourses/",gtmType:"microcourses-click"},articles:{href:"/solution-articles/",gtmType:"articles-click"},communities:{href:"/communities/",gtmType:"communities-click"}},community:{order:["support","post","join","guidelines"],support:{name:"Support FAQ",href:"/pages/support-faq",gtmType:"support-faq-click"},post:{href:"/pages/post-an-article",gtmType:"post-an-article-click"},join:{href:"/pages/who-can-join-the-community",gtmType:"who-can-join-click"},guidelines:{href:"/pages/values-and-guidelines",gtmType:"guidelines-and-values-click"}},company:{order:["news","insights","story","team","careers","partner","contact"],news:{href:"/learning-hub/updates/",gtmType:"news-click"},insights:{href:"/learning-hub/global-insights/",gtmType:"insights-click"},story:{href:"/pages/our-story",gtmType:"our-story-click"},team:{href:"/pages/meet-our-team",gtmType:"team-click"},careers:{href:"/pages/careers",gtmType:"careers-click"},partner:{href:"/partnerships/",gtmType:"partner-with-us-click"},contact:{href:"/pages/get-in-touch",gtmType:"contact-click"},child:"legal"},legal:{order:["privacy","terms","cookie","accessibility","ai"],privacy:{href:"https://about.apolitical.co/privacy-policy",gtmType:"privacy-policy-link"},terms:{href:"https://about.apolitical.co/terms-and-conditions",gtmType:"terms-conditions-link"},cookie:{href:"/pages/cookie-policy",gtmType:"cookie-policy-link"},ai:{href:"/pages/ai-principles",gtmType:"ai-principles-link"},accessibility:{href:"/pages/accessibility-statement",gtmType:"accessibility-link"},text:{order:["dataProtection","euDataProtection"],dataProtection:{email:zn["data-protection"].default,gtmType:"email-dpo-link"},euDataProtection:{email:zn["data-protection"].eu,gtmType:"email-eu-dpo-link"}}},contact:{text:{order:["correspondence","registered","berlin","support","business"],correspondence:{address:!0},registered:{address:!0},berlin:{address:!0},support:{email:zn.support,gtmType:"concierge-email-click"},business:{email:zn.general,gtmType:"hello-email-click"}}},social:{order:["linkedin","twitter","facebook"],linkedin:{href:"https://www.linkedin.com/company/apolitical"},twitter:{href:"https://twitter.com/apoliticalco"},facebook:{href:"https://www.facebook.com/apoliticalco"}}};const Kn="footer_",La="SiteFooter",vc=({group:e})=>{const t=Vt[e].order||[];let n=!1;return"text"in Vt[e]&&(n=Vt[e].text),d.jsxs(C.Fragment,{children:[d.jsx("p",{className:"pre-title",children:d.jsx(oe.FormattedMessage,{id:`${Kn}${e}`})}),Array.isArray(t)&&t.length>0&&d.jsx("ul",{className:"text-medium",children:t.map(r=>{if(["order","child","text"].includes(r))return null;const{href:a,gtmType:i}=Vt[e][r],s={};return["legal"].includes(e)&&(s.target="_blank",s.rel="noopener"),d.jsx("li",{children:d.jsx("a",{href:a,className:"gtm-trackable","data-gtm-event-context":La,"data-gtm-event-type":i,...s,children:d.jsx(oe.FormattedMessage,{id:`${Kn}${e}_${r}`})})},`${e}_${r}`)})}),typeof n!="boolean"&&"order"in n&&Array.isArray(n.order)&&d.jsx("dl",{className:"text-medium",children:n.order.map(r=>d.jsxs(C.Fragment,{children:[d.jsx("dt",{children:d.jsx(oe.FormattedMessage,{id:`${Kn}${e}_${r}`})}),d.jsxs("dd",{children:[typeof n!="boolean"&&n[r].address&&d.jsx("address",{children:d.jsx(oe.FormattedMessage,{id:`${Kn}${e}_${r}_address`,values:{br:d.jsx("br",{})}})}),typeof n!="boolean"&&n[r].email&&d.jsx("a",{href:`mailto:${n[r].email}`,className:"gtm-trackable","data-gtm-event-context":La,"data-gtm-event-type":n[r].gtmType,children:n[r].email})]})]},`dl-${e}-${r}`))})]},e)},jo=()=>d.jsx("div",{id:"footer",children:d.jsxs("div",{className:"wrapper",children:[d.jsx(Ka,{element:"hr"}),d.jsx(ro,{variant:"inverted",version:"full",className:"gtm-trackable","data-gtm-event-context":La,"data-gtm-event-type":"logo-homepage-link"}),d.jsx("footer",{children:["platform","community","company","contact"].map(e=>d.jsxs("div",{className:"group",children:[d.jsx(vc,{group:e}),Object.keys(Vt[e]).includes("child")&&d.jsx(vc,{group:Vt[e].child})]},e))}),d.jsx("hr",{}),d.jsxs("div",{className:"sub-footer",children:[d.jsx("ul",{children:Array.isArray(Vt.social.order)&&Vt.social.order.map(e=>{const t=Vt.social[e];return d.jsx("li",{className:e,children:d.jsx("a",{href:t.href,target:"_blank",rel:"noopener noreferrer",className:"gtm-trackable","data-gtm-event-context":La,"data-gtm-event-type":"social-click",children:d.jsx("span",{className:"hidden",children:d.jsx(oe.FormattedMessage,{id:`${Kn}social_${e}`})})})},e)})}),d.jsx("small",{children:d.jsx(oe.FormattedMessage,{id:`${Kn}copyright`,values:{currentYear:new Date().getFullYear()}})})]})]})}),$e={timeouts:{},handlerCalled:{},getIsDesktopVersion:(e,t)=>{const n={navigation:{loggedIn:769,loggedOut:881},search:{loggedIn:961,loggedOut:1121}},r=i=>{const s=`logged${e?"In":"Out"}`;return t>=n[i][s]};let a={};return["navigation","search"].forEach(i=>{a[i]=r(i)}),a},shouldChangeHeaderIsVisible:(e,t,n)=>{Object.values(t).filter(a=>a===!0).length||n([{type:"headerIsVisible",value:e}])},handleMenus:({id:e,value:t,menus:n,dispatch:r,forceHandle:a=!1})=>{if(!a&&n[e]===t||!a&&e===gt.ACCOUNT&&t===!1&&n[gt.SITE]===!0)return;const i=Date.now();if(!a&&!t&&$e.handlerCalled[e]&&i-$e.handlerCalled[e]<500)return;$e.handlerCalled[e]=i;let s=[{type:`menus.${e}`,value:t}];if(t===!0)Object.keys(n).forEach(o=>{o===e||n[o]===!1||s.push({type:`menus.${o}`,value:!1})});else{let o=null;switch(e){case gt.SITE:o=document.querySelector("#header .menu-button"),o||(o=document.querySelector("#navigation .navigation-button"));break;case gt.SEARCH:o=document.querySelector("#header .toggle-search-button");break;case gt.ACCOUNT:o=document.querySelector("#header .account-button");break;default:return}o&&o.focus()}r(s)},findFirstChild:(e,t,n=!1)=>{if(!e||!e[0])return!1;for(let r=0;r<=e.length;r++){if(!e[r])continue;if(e[r][t]&&(!n||e[r][t].includes(n)))return e[r];if(!t.includes("."))continue;const a=Bc(e[r],t);if(!(typeof a>"u")&&(!n||a[t]&&a[t].includes(n)||a.value&&a.value.includes(n)||a.toString().includes(n)))return e[r]}return e[0].children?$e.findFirstChild(e[0].children,t,n):!1},autoFocus:({menu:e,navigationRef:t,isDesktopVersion:n,focusElements:r,dispatch:a})=>{var l;if(!t.current||!t.current.children)return;const i=n?"desktop":"default";if(r[e][i]){(l=document.querySelector(`#header ul a[href="${r[e][i]}"]:last-child`))==null||l.focus();return}let s,o;switch(e){case gt.SITE:if(n){const u=$e.findFirstChild(t.current.children,"attributes.aria-controls",gt.SITE);s=$e.findFirstChild(u.children,"href")}else s=$e.findFirstChild(t.current.children,"href");break;case gt.ACCOUNT:if(o=$e.findFirstChild(t.current.children,"className","account"),!o||!o.children)return;s=$e.findFirstChild(o.children,"href");break;default:return}s&&(a([{type:`focusElements.${e}.${i}`,value:s.attributes.href.value}]),s.focus())},events:{onClick:(e,{id:t,callback:n,isOpen:r})=>{e.target&&e.target.attributes&&e.target.attributes.href||(e.preventDefault(),e.stopPropagation(),clearTimeout($e.timeouts[t]),n(t,!r))},onFocus:({id:e})=>{clearTimeout($e.timeouts[e])},onMouseEnter:({id:e,callback:t})=>{clearTimeout($e.timeouts[e]),t(e,!0)},onBlur:({id:e,callback:t})=>{$e.timeouts[e]=setTimeout(()=>{t(e,!1)},250)}}},$r={order:["home","topics","partners","account"],home:{href:"/home/",hasVariantText:!0,gtmType:"homepage-click"},topics:{order:["explore","topics"],menuId:"site-navigation",explore:{order:["events","courses","articles","communities"],events:{href:"/events/",className:"icon events"},courses:{href:"/microcourses/",gtmType:"microcourses-click",className:"icon courses"},articles:{href:"/solution-articles/",gtmType:"articles-click",className:"icon articles"},communities:{href:"/communities/",gtmType:"communities-click",className:"icon communities"}},topics:{order:["climate","cities-and-local-government","digital-and-data","education","equity-justice-and-inclusion","health-and-social-care","innovation","leadership-and-skills","life-in-government","policymaking","transport-and-infrastructure","work-and-the-economy"],className:"columns",climate:{href:"/topics/climate/"},"cities-and-local-government":{href:"/topics/cities-and-local-government/"},"digital-and-data":{href:"/topics/digital-and-data/"},education:{href:"/topics/education/"},"equity-justice-and-inclusion":{href:"/topics/equity-justice-and-inclusion/"},"health-and-social-care":{href:"/topics/health-and-social-care/"},innovation:{href:"/topics/innovation/"},"leadership-and-skills":{href:"/topics/leadership-and-skills/"},"life-in-government":{href:"/topics/life-in-government/"},policymaking:{href:"/topics/policymaking/"},"transport-and-infrastructure":{href:"/topics/transport-and-infrastructure/"},"work-and-the-economy":{href:"/topics/work-and-the-economy/"}}},partners:{href:"/partnerships/",onlyShow:"logged-out"},account:{menuId:"account-navigation",order:["profile","settings","log-out"],className:"account",onlyShow:"logged-in",doTrack:!1,profile:{href:"/profiles/me"},settings:{href:"/profiles/me/manage-account"},"log-out":{href:"/user-onboarding/logout",className:"divider"}},buttons:{order:["login","signup"],login:{href:"/user-onboarding/login"},signup:{href:"/signup?ref=header-banner",props:{variant:"primary"}}}},za=({id:e,isLoggedIn:t=!1,isDesktopVersion:n=!1,menus:r={},callback:a=()=>{},doTrack:i=null})=>{const s=oe.useIntl(),o=Bc($r,e);if(!o||o.onlyShow&&(o.onlyShow==="logged-in"&&!t||o.onlyShow==="logged-out"&&t))return null;const l="doTrack"in o,u=i===null?l?o.doTrack:!0:i,c=e.includes("buttons.");let h=`header_${e.replaceAll(".","_")}`;o.hasVariantText&&(h+=`_logged${t?"In":"Out"}`);let p=!1;if(o.href){let k=o.gtmType||`${e}-click`;if(k.includes(".")){const x=k.split("."),w=x[x.length-2];k=`${w==="topics"?`${w}-`:""}${x[x.length-1]}`}p={href:o.href},u&&(p={...p,className:"gtm-trackable","data-gtm-event-type":k,"data-gtm-event-context":"HeaderButtons"}),c&&(p={...p,variant:"secondary",size:{mobile:"small",881:"large"},...o.props||{}})}const m=o.order&&o.order[0]&&o[o.order[0]],g=m&&o[o.order[0]].order,f=p&&window.location.pathname===o.href;let b={},v={},E={};if(f&&(b={...b,"aria-current":"page"}),m){const k=o.menuId||e,x={onClick:w=>$e.events.onClick(w,{id:k,callback:a,isOpen:r[k]}),onFocus:()=>$e.events.onFocus({id:k}),onBlur:()=>$e.events.onBlur({id:k,callback:a}),onMouseLeave:()=>$e.events.onBlur({id:k,callback:a}),onMouseEnter:()=>$e.events.onMouseEnter({id:k,callback:a})};v={...x,id:k===gt.SITE?gt.SITE:gt.ACCOUNT},n&&(g&&(E={...x,className:"navigation-button",onKeyPress:w=>{w.key==="Enter"&&$e.events.onClick(w,{id:k,callback:a,isOpen:r[k]})},"aria-haspopup":!0,"aria-expanded":r[k],"aria-controls":k}),v={...v,hidden:k in r?!r[k]:!0}),g||(v={...v})}return d.jsxs("li",{className:Y({[o.className]:o.className,"has-submenu":m,parent:g,active:f}),...b,children:[p?C.createElement(c?ke:"a",p,s.formatMessage({id:h})):n&&o.order&&g?d.jsxs("button",{...E,children:[s.formatMessage({id:h}),d.jsx(Ie,{children:s.formatMessage({id:`header_menu_${r[gt.SITE]?"hide":"show"}`})})]}):s.formatMessage({id:h}),o.order&&d.jsx("ul",{...v,children:o.order.map(k=>{if(!o[k])return null;const x={isLoggedIn:t,isDesktopVersion:n,menus:r,callback:a,doTrack:l?u:null};return o[k].order?d.jsxs("li",{className:Y({[o[k].className]:o[k].className}),children:[s.formatMessage({id:`${h}_${k}`}),d.jsx("ul",{children:o[k].order.map(w=>d.jsx(za,{id:`${e}.${k}.${w}`,...x},w))})]},k):d.jsx(za,{id:`${e}.${k}`,...x},k)})})]},e)};const Aw={height:67,height_desktop:83};var gt=(e=>(e.NAVIGATION="navigation",e.SEARCH="search",e.ACCOUNT="account-navigation",e.SITE="site-navigation",e))(gt||{});const Oo=({showNavigation:e=!0})=>{const t=oe.useIntl(),n=C.useContext(Tt),r=rr(!0,!0),a=n&&typeof n.id=="string",i=C.useMemo(()=>$e.getIsDesktopVersion(a,r),[a,r]),[s,o]=C.useReducer(Lr,{headerIsVisible:!0,menus:{"site-navigation":!1,search:!1,"account-navigation":!1},focusElements:{"site-navigation":{desktop:!1,default:!1},"account-navigation":{desktop:!1,default:!1}}}),{headerIsVisible:l,menus:u,focusElements:c}=s,h=C.useRef(s);C.useEffect(()=>{h.current=s},[s]),Pc({scrollPosition:Aw[`height${i.navigation?"_desktop":""}`],callbacks:{scrollUp:()=>{const v=h.current.menus;!i&&v["site-navigation"]||$e.shouldChangeHeaderIsVisible(!0,v,o)},scrollDown:()=>{const v=h.current.menus;!i&&v["site-navigation"]||$e.shouldChangeHeaderIsVisible(!1,v,o)}}});const p=(v,E,k=!1)=>{$e.handleMenus({id:v,value:E,menus:h.current.menus,dispatch:o,forceHandle:k})},m=C.useRef(null),g=v=>{v.key==="Escape"&&["site-navigation","search","account-navigation"].forEach(E=>{h.current.menus[E]&&p(E,!1,!0)})};C.useEffect(()=>{var v;return(v=document.getElementById("header"))==null||v.addEventListener("keydown",g),()=>{var E;(E=document.getElementById("header"))==null||E.removeEventListener("keydown",g)}},[]),Qn(()=>{u["site-navigation"]&&$e.autoFocus({menu:"site-navigation",navigationRef:m,isDesktopVersion:i.navigation,focusElements:c,dispatch:o})},[u["site-navigation"]]),Qn(()=>{u["account-navigation"]&&$e.autoFocus({menu:"account-navigation",navigationRef:m,isDesktopVersion:i.navigation,focusElements:c,dispatch:o})},[u["account-navigation"]]);const f=d.jsxs(d.Fragment,{children:[!i.search&&d.jsx("button",{className:"search toggle-search-button",onClick:v=>{v.preventDefault(),v.stopPropagation(),p("search",!u.search)},"aria-haspopup":"true","aria-expanded":u.search,"aria-controls":"search-form",children:d.jsx(Ie,{children:t.formatMessage({id:`header_search_${u.search?"hide":"show"}`})})}),d.jsx(sh,{id:"global-search",handleToggle:{searchIsOpen:u.search,isDesktopVersion:i.search},gtmContext:"search-bar-header",gtmEvent:"form-submission"})]}),b=d.jsxs(d.Fragment,{children:[!i.navigation&&d.jsx("button",{className:"menu-button gtm-trackable",onClick:v=>{v.preventDefault(),v.stopPropagation(),p("site-navigation",!u["site-navigation"])},"data-gtm-event-type":"open-tab-menu-click","data-gtm-event-context":"HeaderLeft-Chevron","aria-haspopup":"true","aria-expanded":u["site-navigation"],"aria-controls":"site-navigation",children:d.jsx(Ie,{children:t.formatMessage({id:`header_menu_${u["site-navigation"]?"hide":"show"}`})})}),d.jsx("ul",{ref:m,id:"navigation",hidden:i.navigation||u["account-navigation"]?!1:!u["site-navigation"],"data-showing":!i.navigation&&u["account-navigation"]?"account":"default",children:$r.order.map(v=>d.jsx(za,{id:v,isLoggedIn:a,isDesktopVersion:i.navigation,menus:{"site-navigation":u["site-navigation"],"account-navigation":u["account-navigation"]},callback:p},v))})]});return n&&n.isLoading?null:d.jsxs(d.Fragment,{children:[d.jsxs("nav",{id:"header",className:Y({"logged-in":a,"logged-out":!a,visible:l}),children:[d.jsx(Ie,{element:"a",href:"#content-of-page",children:t.formatMessage({id:"header_skip"})}),d.jsx(ro,{variant:"monochrome"}),e&&d.jsxs(d.Fragment,{children:[i.navigation?d.jsxs(d.Fragment,{children:[b,f]}):d.jsxs(d.Fragment,{children:[f,b]}),a?d.jsxs("button",{className:"account-button",onClick:v=>$e.events.onClick(v,{id:"account-navigation",callback:p,isOpen:u["account-navigation"]}),onMouseEnter:()=>$e.events.onMouseEnter({id:"account-navigation",callback:p}),onMouseLeave:()=>$e.events.onBlur({id:"account-navigation",callback:p}),"aria-haspopup":"true","aria-expanded":u["account-navigation"],"aria-controls":"account-navigation",children:[d.jsx(Ie,{children:t.formatMessage({id:`header_account_${u["account-navigation"]?"hide":"show"}`})}),d.jsx(Gt,{name:n&&n.name||"",src:n&&n.image&&n.image.thumbnail||""})]}):d.jsx("ul",{className:"sign-in-buttons",children:$r.buttons.order.map(v=>d.jsx(za,{id:`buttons.${v}`},v))})]})]}),d.jsx("hr",{id:"content-of-page"}),d.jsx("div",{className:Y("overlay",{open:u["site-navigation"]||u["account-navigation"]||!i.search&&u.search})})]})};const Tw=()=>{const e=oe.useIntl();return d.jsxs(d.Fragment,{children:[d.jsx(Oo,{}),d.jsx("div",{id:"content",children:d.jsx(cn,{variant:"error",text:e.formatMessage({id:"pageLayout_error"})})}),d.jsx(jo,{})]})},lh=({children:e,additionalContent:{prepended:t,appended:n}={},reportError:r,forceShow:a={},styling:i={},className:s="",locale:o="en"})=>{const{navigation:l=!0,footer:u=!0}=a,{background:c="default",variant:h="default",circle:p="default",modal:m="default"}=i,g=Sc(),[f,b]=C.useState(""),v=A=>{const{detail:{message:S}}=A;b(S)};C.useEffect(()=>(window.scrollTo(0,0),document.addEventListener("ariaLive",v),()=>{document.removeEventListener("ariaLive",v)}),[g]);const E=ga(e,{locale:o}),k=ga(t,{locale:o}),x=ga(n,{locale:o}),w={};return c!=="default"&&(w[c]=!0),h!=="default"&&(w[h]=!0),p!=="default"&&(w[p]=!0),d.jsx(Ih.ErrorBoundary,{onError:r,fallback:d.jsx(Tw,{}),children:d.jsxs(C.Suspense,{fallback:null,children:[d.jsxs("div",{id:"wrapper",className:Y(s,w,{"has-footer":u}),children:[d.jsx(Oo,{showNavigation:l}),d.jsxs("main",{id:"content-wrapper",children:[k&&d.jsx("div",{className:Y("additional-content prepended",{"large-modal":m==="large"}),children:k}),C.createElement(c==="bold"?Gs:"div",{id:"content",children:E,className:Y({"large-modal":m==="large"})})]}),x&&d.jsx("div",{className:"additional-content appended",children:x}),u&&d.jsx(jo,{}),d.jsx(uh,{})]}),f&&d.jsx(Ie,{"aria-live":"polite",showOnFocus:!1,"data-testid":"layout-aria-live",children:f})]})})},bc={default:"tags_",headerTopics:"header_topics_topics_"},ts={topic:{Climate:"climate",CitiesAndLocalGovernment:"cities-and-local-government",DigitalAndData:"digital-and-data",Education:"education",EquityJusticeAndInclusion:"equity-justice-and-inclusion",HealthAndSocialCare:"health-and-social-care",Innovation:"innovation",LeadershipAndSkills:"leadership-and-skills",LifeInGovernment:"life-in-government",Policymaking:"policymaking",TransportAndInfrastructure:"transport-and-infrastructure",WorkAndTheEconomy:"work-and-the-economy"},"from the community":"community"},Sw={getTagDetails:e=>{if(e.includes("topic_")){if(e=ts.topic[e.replace("topic_","")],e){const t=$r.topics.topics[e].href;return t?{id:e,href:t,text:`${bc.headerTopics}${e}`}:null}return null}return ts[e]?(e=ts[e],{id:e,text:`${bc.default}${e}`}):null}};const jw=({tags:e=[],color:t="default",forceOneLine:n=!1,canHaveLinks:r=!0,className:a="",gtmType:i="tag-click",gtmContext:s="tags"})=>{const o=oe.useIntl();if(!e||e.length<1)return null;const l=[];return e.forEach(u=>{if(!u)return;const c=Sw.getTagDetails(u);c&&l.push(c)}),l.length<1?null:d.jsx("ul",{className:Y("tags text-small",t,a,{"one-line":n}),children:l.map(u=>{const c=o.formatMessage({id:u.text});return d.jsx("li",{children:u.href&&r?d.jsx("a",{href:u.href,className:"gtm-trackable","data-gtm-event-type":i,"data-gtm-event-context":s,children:c}):c},u.id)})})};const Ow=({members:{data:e=[],total:t=e.length},hasNextPage:n=!1,loadNextPage:r=()=>{},gtmContext:a="member",gtmType:i="member-click",className:s=""})=>{const o=oe.useIntl();return e.length===0?null:d.jsxs("div",{className:Y("members-list",s),children:[d.jsxs("h1",{children:[o.formatMessage({id:"membersList"}),d.jsx("span",{className:"count",children:t})]}),d.jsx("ul",{children:e.map((l,u)=>d.jsxs("li",{children:[d.jsx(_n,{member:l,gtmContext:a,gtmType:i}),l.isAdmin&&d.jsx(Cn,{children:o.formatMessage({id:"membersList_admin"})})]},u))}),n&&d.jsx(zr,{hasNextPage:n,loadNextPage:r,icon:{icon:"arrow-down",position:"right"},gtmContext:a})]})},Pw={showForm:!1},oi=C.createContext(Pw),ch=({children:e})=>{const[t,n]=C.useState({showForm:!1});return d.jsx(oi.Provider,{value:{...t,updateConversation:n},children:e})},yc=e=>{const t={};return Object.keys(e).forEach(n=>n.includes("Id")?t[n]=e[n]:t[`${n}Slug`]=e[n]),t},Nw=({intlPath:e,showGuidelines:t,type:n,gtmContext:r})=>{const a=oe.useIntl();return t?d.jsx("small",{children:Ft(a.formatMessage,`${e}explainer`,n,"action",{a:i=>d.jsx("a",{href:"https://about.apolitical.co/q-and-a-community-guidelines",target:"_blank",className:"gtm-trackable","data-gtm-event-context":r,"data-gtm-event-type":"community-guidelines-link",rel:"noreferrer",children:i})})}):d.jsx(d.Fragment,{})},Rw=({formID:e,intlPath:t,showLabel:n,type:r})=>{const a=oe.useIntl();return n?d.jsx("label",{htmlFor:`${e}-input`,className:"text-small",onClick:i=>{i.preventDefault(),i.stopPropagation();const s=new CustomEvent("focusEditor",{detail:{id:`rte-${e}-input`}});window.dispatchEvent(s)},children:a.formatMessage({id:`${t}label`})}):d.jsx(Ie,{element:"label",showOnFocus:!1,htmlFor:`${e}-input`,children:Ft(a.formatMessage,`${t}label_action`,r,"action")})};let da=null;const Je="discussion_form_",Wr=({id:e,content:t={type:"response",slugs:{}},userHasPermissions:n=!0,meta:r,placeholder:a,maxLength:i=0,buttons:s,forceShow:o={cancel:!1,error:!1},isCommunity:l=!1,functions:u,data:c={},gtmContext:h="DiscussionForm"})=>{var Be,Ae,Ue;const p=oe.useIntl(),m=C.useContext(Tt),[g,f]=C.useState(""),{isLoading:b=!1,isInWrapper:v=!1,isInOverlay:E=!1,isAutoFocused:k=!1,isEditing:x=!1,hasTitleField:w=!1,isPrepopulated:A=!1,showTitle:S=!1,showGuidelines:q=!0,showDivider:$=!1,showSuccessMessage:N=!0}=r||{},{onChange:L=()=>{},create:_=()=>{},handleSaveEdit:B=()=>{},handleCancel:j=()=>{},callback:I=()=>{},onMention:G=()=>{},listMembers:V=()=>Promise.resolve([]),clickMentionFallback:Q=()=>{},props:ae={create:{projectNames:["questions-answers"]}}}=u,[D,M]=C.useState({title:w&&w.text||"",body:x&&x.text||A&&A.text||""}),[W,F]=C.useState(o.error||!1),[T,z]=C.useState(!1);if(C.useEffect(()=>{l&&!x&&A&&A!==D.body&&M({...D,body:A.text||""})},[A]),b)return d.jsx(_t,{className:"discussion-card discussion-form","data-testid":"loading-placeholder"});const R=Se=>{M({...D,body:Se}),L({body:Se});let Te;!m||!m.id?Te=Ft(p.formatMessage,`${Je}error_loggedOut`,t.type,"action"):n?i>0&&Se.length>=i&&(Te=`${Je}error_tooLong`):Te=Ft(p.formatMessage,`${Je}error_noPermission`,t.type,"action"),Te?F(Te):W&&F(!1)};let H=`${t.type}-form`;if(t.type==="response"||t.type==="reply"){const Se=((Be=t.slugs)==null?void 0:Be.reply)||((Ae=t.slugs)==null?void 0:Ae.answer)||((Ue=t.slugs)==null?void 0:Ue.question)||"";Se&&(H=`${H}-${Se.slice(-15)}`)}e&&(H=`${e}-${H}`);const re=async()=>{if(!m||!m.id||!n||ee)return;da&&clearTimeout(da),z("submitting");const Se=window.location.pathname;try{let Te;switch(t.type){case"post":Te=await _({title:D.title,content:D.body});break;case"question":Te=await _({title:D.body,authorId:m&&m.id,...ae==null?void 0:ae.create});break;case"response":Te=await _({questionSlug:t.slugs.question},{body:D.body,authorId:m&&m.id,contentPath:Se});break;case"reply":Te=await _({questionSlug:t.slugs.question,answerSlug:t.slugs.answer},{body:D.body,authorId:m&&m.id,contentPath:Se});break;default:break}await Yh(1e3),I&&await I(Te),da=setTimeout(()=>{M({title:"",body:""}),z("submitted"),f(Ft(p.formatMessage,`${Je}success`,t.type,"action"));const Ne=new Event("discussionFormSubmitted");document.dispatchEvent(Ne),X()},500)}catch(Te){const Ne=Te;let _e=`${Je}error`;Ne!=null&&Ne.message.includes("entry already exists")&&(_e=Ft(p.formatMessage,`${Je}error_alreadyExists`,t.type,"action")),Ne!=null&&Ne.message.includes("429")?_e=Ft(p.formatMessage,`${Je}error_tooMany`,t.type,"action"):Ne!=null&&Ne.message.includes("400")&&(_e=`${Je}error`),F(_e),X()}},X=()=>{da=setTimeout(()=>{F(!1),z(!1),f("")},5e3)},ne=!D.title||!Zo(D.title),le=!D.body||!Zo(D.body);let ee=le;w&&(ee=ne&&le);const he=T==="submitting",me=[{component:Rw,props:{formID:H,intlPath:Je,showLabel:w!==!1,type:t.type}},{component:th,props:{id:`${H}-input`,value:T==="submitting"&&!W?"":D.body,placeholder:a||Ft(p.formatMessage,`${Je}placeholder`,t.type,"action"),maxLength:i,meta:{isInOverlay:E},functions:{onChange:R,onMention:G,listMembers:V,clickMentionFallback:Q},data:c,autoFocus:x!==!1||k&&!w,"aria-invalid":!!W,"aria-errormessage":"error-message"}},{component:Nw,props:{intlPath:Je,showGuidelines:q,type:t.type,gtmContext:h}}];$&&me.push({component:zt}),w&&me.unshift({id:"title",type:"text",value:w.text,limit:250,autoFocus:k,label:p.formatMessage({id:`${Je}titleField_label`}),placeholder:p.formatMessage({id:`${Je}titleField_placeholder`}),functions:{onChange:Se=>{M({...D,title:Se}),L({title:Se})}},validation:[{condition:()=>ee,error:p.formatMessage({id:`${Je}titleField_error`})}]});let ye=!m||!m.id||!n||ee||he;return x&&(w?ye=ye||D.body===x.text&&D.title===w.text:ye=ye||D.body===x.text),d.jsxs(d.Fragment,{children:[d.jsxs(Qt,{id:H,className:Y("discussion-card discussion-form",{"no-styling":v&&x}),meta:{shouldReset:!0,shouldHide:!1,showRequiredLabels:!1,shouldShowCancelButton:x&&!he||o.cancel},functions:{onSuccess:async()=>{if(x){z("submitting"),B(D);return}await re()},onCancel:j},fields:me,intlPath:Je,button:{variant:"primary",size:{mobile:"small",600:"medium"},className:"gtm-trackable","data-gtm-event-context":h,"data-gtm-event-type":`${x?"save":"submit"}-${t.type}-click`,"data-testid":"save-button",disabled:ye,overwriteSubmittingText:!0,text:!he&&!x&&(s!=null&&s.submit)?s==null?void 0:s.submit:p.formatMessage({id:`${Je}${he?x?"saving":"posting":x?"save":"post"}`})},secondaryActionButton:{variant:"secondary",size:{mobile:"small",600:"medium"},className:"gtm-trackable","data-gtm-event-context":h,"data-gtm-event-type":`cancel-${t.type}-click`,disabled:!o.cancel&&(!m||!m.id||!D.body),text:s!=null&&s.cancel?s==null?void 0:s.cancel:p.formatMessage({id:`${Je}cancel`})},gtm:{context:h,event:`${t.type}-form`},"data-testid":`discussion-${t.type}-form`,children:[S&&!x&&["question"].includes(t.type)&&d.jsx("h2",{children:Ft(p.formatMessage,`${Je}title`,t.type,"action")}),d.jsx(_n,{member:m?{...m,link:!1}:"community",gtmContext:h,gtmType:"profile-click"})]}),T==="submitted"&&N&&d.jsx(Tr,{className:"success","data-testid":"success",children:Ft(p.formatMessage,`${Je}success`,t.type,"action")}),W&&d.jsx(Tr,{id:"error-message",className:"error","data-testid":"error",children:o.error?o.error:typeof W=="string"?W.includes(" ")?W:p.formatMessage({id:W},{action:p.formatMessage({id:`discussion_action_${t.type}`}),maxLength:i}):W}),g&&d.jsx(Ie,{"aria-live":"polite",showOnFocus:!1,children:g})]})},Mw=Object.freeze(Object.defineProperty({__proto__:null,default:Wr},Symbol.toStringTag,{value:"Module"})),Iw=({question:e,answer:t,reply:n})=>({...e&&{questionSlug:e},...t&&{answerSlug:t},...n&&{replySlug:n}}),$w=(e,t=10)=>!e||e.length===0?[]:e.slice(0,t);const qa=({icon:e,className:t="",...n})=>d.jsx(ke,{className:Y("discussion-button",t),variant:"tertiary",icon:e,...n});let Br=!1;const ns=()=>{Br!==!1&&(clearTimeout(Br),Br=!1)},rs=5;let as=null;const dh=({element:e="div",likes:t=0,peopleWhoLiked:n=!1,isShort:r=!0,userLiked:a=!1,content:i={type:"reply",slugs:{}},canLike:s=!0,functions:{createLike:o=()=>{},deleteLike:l=()=>{}}={}})=>{const u=oe.useIntl(),c={numberOfLikes:t,userLikedContent:a,ignoreInteractions:!1,showLikers:!1,tabbableLink:0},[h,p]=C.useReducer(Lr,c),{numberOfLikes:m,userLikedContent:g,ignoreInteractions:f,showLikers:b,tabbableLink:v}=h;C.useEffect(()=>{p([{type:"userLikedContent",value:a}])},[a]);const E=C.useMemo(()=>$w(n,rs),[n]),k=S=>{if(S.preventDefault(),S.stopPropagation(),p([{type:"showLikers",value:!1}]),Br)return ns(),!1;if(ns(),f||!s)return!1;Br=setTimeout(x,350)},x=async()=>{if(ns(),f||!s)return!1;let S=g?m-1:m+1;S<0&&(S=0),p([{type:"ignoreInteractions",value:!0},{type:"numberOfLikes",value:S},{type:"userLikedContent",value:!g}]);try{if(i&&i.slugs){const q=Iw(i.slugs);g?await l(q):await o({...q,payload:{contentPath:window.location.pathname}})}}catch{p([{type:"numberOfLikes",value:t},{type:"userLikedContent",value:a}])}finally{p([{type:"ignoreInteractions",value:!1}])}},w=()=>{as=setTimeout(()=>{p([{type:"showLikers",value:!1}])},500)},A=()=>{as&&clearTimeout(as)};return C.createElement(e,{className:"likes-wrapper",onKeyDown:S=>{S.key==="Escape"&&p([{type:"showLikers",value:!1}])},onMouseEnter:()=>{A(),p([{type:"showLikers",value:!0}])},onMouseLeave:()=>{w()}},d.jsxs(d.Fragment,{children:[d.jsx(qa,{className:Y("discussion-button text-medium action-button",{"show-spinner":f,"is-liked":g,disabled:!s}),icon:{icon:g?"heart":"heart_empty",animate:"bounce"},disabled:!s,"data-testid":"like-button","data-gtm-event-context":"Likes","data-gtm-event-type":`like-${i.type}-click`,onClick:k,screenreaderText:s?u.formatMessage({id:`discussion_likes_${g?"unlike":"like"}`},{action:u.formatMessage({id:`discussion_action_${i.type}`})}):!1,"aria-pressed":g,children:d.jsx("span",{"data-testid":"number-of-likes",className:"number-of-likes",children:u.formatMessage({id:`discussion_likes${r?"_short":""}`},{number:m})})}),n&&d.jsxs(d.Fragment,{children:[d.jsx(Ie,{"data-testid":"like-a11y-button",element:"button",className:"tertiary small icon navigation_arrow",onFocus:()=>{A()},onBlur:()=>w,onClick:S=>{var $;S.preventDefault(),S.stopPropagation(),A(),p([{type:"showLikers",value:!0}]);const q=($=S.currentTarget.nextSibling)==null?void 0:$.childNodes[0];if(q){const N=q.querySelector("li:first-child a");N&&(p([{type:"tabbableLink",value:0}]),setTimeout(()=>{N.focus()},100))}},onKeyDown:S=>{S.key==="Escape"&&(S.preventDefault(),S.stopPropagation(),w())},"aria-expanded":b,"aria-controls":`likes-tooltip-${i.slug}`,children:d.jsx(Ie,{showOnFocus:!1,children:u.formatMessage({id:"discussion_likes_show"},{action:i.type})})}),d.jsx(Sn,{id:`likes-tooltip-${i.slug}`,isOpen:b,isLoading:n.length===0,children:n.length&&d.jsxs("ul",{children:[E.map((S,q)=>{if(typeof S=="string"||!S.name)return null;const $={};return v!==q&&($.tabIndex=-1),d.jsx("li",{"data-index":q,children:d.jsx(jn,{href:S.id?`/profiles/${S.id}`:void 0,gtmContext:"Likes",gtmType:"liked-name-click",onClick:N=>N==null?void 0:N.stopPropagation(),onFocus:()=>A(),onKeyDown:N=>{var I,G,V,Q;if(!N||!["ArrowUp","ArrowDown"].includes(N.key||""))return;N.stopPropagation(),N.preventDefault();const L=N.key==="ArrowUp"?"up":"down",_=(I=N.currentTarget)==null?void 0:I.parentElement;let B=_==null?void 0:_.nextElementSibling;if(L==="up"){const ae=_==null?void 0:_.previousElementSibling;ae?B=ae:(B=(G=_==null?void 0:_.parentElement)==null?void 0:G.lastElementChild,(B==null?void 0:B.getAttribute("data-index"))==="-1"&&(B=B==null?void 0:B.previousElementSibling))}else(!B||(B==null?void 0:B.getAttribute("data-index"))==="-1")&&(B=(V=_==null?void 0:_.parentElement)==null?void 0:V.firstElementChild);if(!B)return;const j=(B==null?void 0:B.getAttribute("data-index"))||"0";p([{type:"tabbableLink",value:j}]),(Q=B==null?void 0:B.querySelector("a"))==null||Q.focus()},...$,children:S.name})},S.id||window.btoa(S.name))}),t>rs&&d.jsx("li",{"data-index":"-1",children:u.formatMessage({id:"discussion_likes_more"},{number:t-rs})})]})})]})]}))},is=({children:e,class:t,...n})=>{const r={...n,class:Y("subtle",t)};return d.jsx("blockquote",{...r,children:e})},Lw=280,Po=async(e,t,n,r=()=>Promise.resolve([]))=>{let a=t?Gn(e,typeof t=="number"?t:Lw):e;a=a.trim();const i=`<br>
164
164
 
165
- `;return a.slice(0,i.length)===i&&(a=a.slice(i.length)),n?await Vc({text:a,template:"[@{{name}}](/profiles/{{id}})",mentions:n,listMembers:r}):a};const Uw=3e3,Hw=({url:e,gtm:t={context:"ShareLink",event:"copy-link-click"}})=>{const n=se.useIntl(),[r,a]=y.useState({isOpen:!1,isCopied:!1});return d.jsxs("li",{children:[d.jsx(Sn,{className:G("tooltip-share-link",{"tooltip-share-link-copied":r.isCopied}),isOpen:r.isOpen,styling:{hasPointer:"bottom",extraPadding:!1},children:r.isCopied?n.formatMessage({id:"discussion_share_copy_link_success"}):n.formatMessage({id:"discussion_share_copy_link"})}),d.jsx(qa,{className:"gtm-trackable",icon:{icon:"link_chain"},onMouseOver:()=>a({...r,isOpen:!0}),onFocus:()=>a({...r,isOpen:!0}),onMouseOut:()=>a({isOpen:!1,isCopied:!1}),onBlur:()=>a({isOpen:!1,isCopied:!1}),onClick:()=>{navigator.clipboard.writeText(e).then(()=>{a({isOpen:!0,isCopied:!0}),setTimeout(()=>{a({isOpen:!1,isCopied:!1})},Uw)})},"data-gtm-event-context":t.context,"data-gtm-event-type":t.event})]})},Ht="discussion_",Vw=195;let fa=null;const Ur=({element:e="div",content:t,userHasPermissions:n=!0,isLoading:r=!1,originalAuthorId:a,forceHide:i={actionBar:!1,comments:!1,likes:!1},functions:s,links:o={},className:l,gtmContext:u="DiscussionAnswer",children:c,isTruncated:h=!1,styling:{showShareLinkButton:p=!1}={},setFocus:m=!1,isCommunity:g=!1})=>{var Ee,Ae,ze,Se,Te,Ne,ke,He;const f=se.useIntl(),b=y.useContext(Bt),v=y.useContext(oi),{createContent:E=async()=>{},deleteContent:k=async()=>{},updateContent:x=async()=>{}}=s.content||{},{createLike:w=()=>{},deleteLike:A=()=>{}}=s.likes||{},{openComments:S=()=>{}}=s.comments||{},{listMembers:W=()=>Promise.resolve([]),clickMentionFallback:R=()=>{}}=s.mentions||{},{author:I,canLike:N,createdAt:_,id:F,likes:j=0,userLiked:$,comments:V=0,mentions:K}=t,Q=b&&b.id&&typeof I!="string"&&I.id&&I.id===b.id||!1,ae=typeof N=="boolean"?N:!0,D=Q&&(!t.createdAt||Yh(t.createdAt,10,"seconds")),L=y.useRef(null),[q,B]=y.useState({title:t&&t.body!==t.title&&t.title||"",body:t&&t.body||"",isEditing:!1,didEdit:t&&t.isEdited||!1,postBody:""}),[T,z]=y.useState(!1),[M,H]=y.useState(D?"highlighted":"default"),[ne,ee]=y.useState("");y.useEffect(()=>{const ge=L.current;if(!(!ge||M==="default"))return document.addEventListener(rt.DISCUSSION_FORM_SUBMITTED,re),ge.addEventListener("transitionend",le),()=>{document.removeEventListener(rt.DISCUSSION_FORM_SUBMITTED,re),ge.removeEventListener("transitionend",le)}},[]),y.useEffect(()=>{B({...q,title:t&&t.title||"",body:t&&t.body||"",didEdit:t&&t.isEdited||!1})},[t.isEdited]),y.useEffect(()=>{(async()=>{const U=await Po(q.body,h,K,W);B({...q,postBody:U})})()},[q.body,K]);const re=()=>{setTimeout(()=>{H("fading")},1e3)},le=({propertyName:ge})=>{ge==="background-color"&&H(U=>(U==="default"&&(document.removeEventListener(rt.DISCUSSION_FORM_SUBMITTED,re),L.current&&L.current.removeEventListener("transitionend",le)),U==="fading"?"default":U))};if(r||!t||t.type==="answer"&&(!t.slugs||!t.slugs.question)||q.postBody===""&&t.title==="")return d.jsx(kt,{className:"discussion-card"});const J=async({title:ge,body:U})=>{ge||(ge=""),U||(U=""),ee("");try{if(!ls(ge,q.title)||!ls(U,q.body)){const ie=t.type==="question"?{title:U}:{title:ge,body:U};await x(Cc(t.slugs),ie)}B({...q,title:ge,body:U,isEditing:!1,didEdit:!0})}catch{ee(`${Ht}form_error`)}},he=()=>{if(v&&v.updateConversation){const ge={showForm:!0},U=t.author;U&&U.id&&(g&&(ge.prepopulateForm=`@{{${U.id}}}`),ge.mentionData={id:U.id,name:U.name}),v.updateConversation(ge)}setTimeout(()=>{var be,we,Ke;const U=`reply-form-${(t.type==="answer"?t.slug:((be=t.slugs)==null?void 0:be.reply)||((we=t.slugs)==null?void 0:we.answer)||((Ke=t.slugs)==null?void 0:Ke.question)||"").toLowerCase().slice(-15)}`,ie=document.getElementById(U),pe=document.getElementById(`${U}-input`);pe&&pe.focus(),ie&&ie.scrollIntoView({behavior:"smooth"})},0)},me=async()=>{z(!1);try{await k(Cc(t.slugs))}catch{ee("delete-error")}},ve=[{text:f.formatMessage({id:`${Ht}moreMenu_report`}),onClick:ge=>{ge.stopPropagation()},href:`mailto:community@apolitical.co?subject=${encodeURI(f.formatMessage({id:`${Ht}report_subject`}))}&body=${encodeURI(f.formatMessage({id:`${Ht}report_body`},{contentType:t.type||"",contentSlug:t.slug||"",contentUrl:`${window.origin}${typeof process<"u"&&process.env.PUBLIC_URL||""}/${t.slugs.question||""}`}))}`,icon:"flag"}];return n&&Q&&ve.push({text:f.formatMessage({id:`${Ht}moreMenu_edit`}),onClick:()=>B({...q,isEditing:!0}),icon:"pencil-paper",className:"gtm-trackable","data-gtm-event-context":u,"data-gtm-event-type":`edit-${t.type}-click`},{text:f.formatMessage({id:`${Ht}moreMenu_delete`}),onClick:ge=>{ge.preventDefault(),ge.stopPropagation(),z(!0)},icon:"trash",className:"gtm-trackable","data-gtm-event-context":u,"data-gtm-event-type":`delete-${t.type}-click`,...Dd(`delete-${t.slug}-modal`,T)}),m&&((Ee=L==null?void 0:L.current)==null||Ee.focus(),(Ae=L==null?void 0:L.current)==null||Ae.scrollIntoView({behavior:"smooth"})),y.createElement(e,{className:G("discussion-post",l,{[M]:!l||!l.includes("highlighted-text-box"),"has-link":o.post&&!q.isEditing}),ref:L,tabIndex:m?0:null,"data-testid":`discussion-${t.type}-thread`,"data-gtm-event-context":`${u}-post-click`,onClick:ge=>{if(!o.post||q.isEditing)return;ge.preventDefault(),ge.stopPropagation(),fa&&clearTimeout(fa),fa=setTimeout(()=>{window.location.href=o.post},150);const U=new CustomEvent(rt.DISCUSSION_POST_CLICKED,{detail:{link:o.post,timeout:fa}});document.dispatchEvent(U)},children:d.jsxs(d.Fragment,{children:[d.jsxs("div",{id:F||t.slug,className:G("discussion-card",t.type,{editing:q.isEditing,"has-link":o.post&&!q.isEditing}),children:[!q.isEditing&&d.jsx(_n,{member:I,additionalContent:{createdAt:_,didEdit:q.didEdit},className:typeof I!="string"&&I.id===a?"highlighted":"",gtmContext:u,gtmType:"profile-click"}),q.isEditing?d.jsx(Wr,{id:`editing-${t.slug}`,content:{type:t.type,slugs:t.slugs},userHasPermissions:n,meta:{isLoading:r,isInWrapper:!0,hasTitleField:q.title!==""?{text:q.title}:!1,isEditing:{text:q.body},isPrepopulated:!1},isCommunity:g,maxLength:t.type==="question"?250:5e4,forceShow:{error:ne!==""&&ne!=="delete-error"?f.formatMessage({id:ne},{action:f.formatMessage({id:`discussion_action_${t.type}`})}):!1},functions:{create:E,handleSaveEdit:J,handleCancel:()=>{ee(""),B({...q,isEditing:!1})},listMembers:W,clickMentionFallback:R},gtmContext:`${u}Form`,data:{mentions:t.mentions}}):o.post?d.jsxs("a",{href:o.post,children:[(q==null?void 0:q.title)&&d.jsx("p",{className:"content-title",children:q==null?void 0:q.title}),q.postBody.length>Vw?d.jsx(Xc,{text:q.postBody,markdownOptions:{overrides:{a:ps,blockquote:{component:is}}}}):d.jsx(En,{options:{overrides:{a:ps,blockquote:{component:is}}},children:q.postBody})]}):d.jsxs(d.Fragment,{children:[(q==null?void 0:q.title)&&d.jsx("p",{className:"content-title",children:q==null?void 0:q.title}),d.jsx(En,{options:{wrapper:t.type==="question"?"h1":y.Fragment,forceWrapper:t.type==="question",forceInline:t.type==="question",forceBlock:t.type!=="question",overrides:{blockquote:{component:is}}},children:q.postBody})]}),!q.isEditing&&!(i!=null&&i.actionBar)&&d.jsxs("ul",{className:G("actions text-medium",t.type),"data-testid":`${t.type}-actions`,children:[!i.likes&&d.jsx(fh,{element:"li",likes:j,isShort:!1,userLiked:$,content:{type:t.type,slugs:t.slugs,slug:t.slug},canLike:ae,peopleWhoLiked:t.peopleWhoLiked,functions:{createLike:w,deleteLike:A}}),!i.comments&&(["question","post"].includes(t.type)||o.comments)&&d.jsx("li",{children:d.jsx(qa,{onClick:ge=>{ge.preventDefault(),ge.stopPropagation(),o.comments&&(window.location.href=o.comments),typeof S=="function"&&S()},icon:{icon:"speech-bubble_square"},"data-gtm-event-context":u,"data-gtm-event-type":`answer-${t.type}-click`,screenreaderText:f.formatMessage({id:`${Ht}comments_screenReader`},{count:V}),children:f.formatMessage({id:`${Ht}comments`},{count:V})})}),(t.type==="answer"||t.type==="reply")&&d.jsx("li",{children:d.jsx(qa,{styling:{muted:!0},onClick:he,icon:{icon:"speech-bubble_square"},children:f.formatMessage({id:`${Ht}reply`})})}),p&&d.jsx(Hw,{url:(ze=t.slugs)!=null&&ze.reply?`${window.location.origin}${(Se=t.slugs)==null?void 0:Se.question}/${(Te=t.slugs)==null?void 0:Te.answer}#${(Ne=t.slugs)==null?void 0:Ne.reply}`:`${window.location.origin}${(ke=t.slugs)==null?void 0:ke.question}/${(He=t.slugs)==null?void 0:He.answer}`,gtm:{context:u,event:`copy-link-${t.type}-click`}}),d.jsx(xd,{element:"li",id:`more-${t.slug}`,options:ve})]})]}),c,d.jsx(dn,{id:`delete-${t.slug}-modal`,isOpen:T,functions:{onOpen:()=>{},onClose:()=>z(!1)},forceShow:{error:ne==="delete-error"?f.formatMessage({id:"discussion_delete_error"},{action:f.formatMessage({id:`discussion_action_${t.type}`})}):!1},title:f.formatMessage({id:"discussion_delete_title"},{action:f.formatMessage({id:`discussion_action_${t.type}`})}),buttons:[{variant:"secondary",onClick:()=>z(!1),children:f.formatMessage({id:"discussion_delete_cancel"})},{variant:"primary",className:"destructive",onClick:me,children:f.formatMessage({id:"discussion_delete_delete"})}],gtmContext:`${t.type.charAt(0).toUpperCase()}${t.type.slice(1)}:${t.slug}`,children:d.jsx(se.FormattedMessage,{id:"discussion_delete_text",values:{p:ge=>d.jsx("p",{children:ge}),action:f.formatMessage({id:`discussion_action_${t.type}`})}})})]})})};const Kw=y.lazy(()=>Promise.resolve().then(()=>NE)),Zw=65,hh=({forceShow:e,form:t,className:n})=>{const r=se.useIntl(),a="discussionFormCard_",i="DiscardDraftModal",o=y.useContext(Bt)||"community",l=Qa(o);l.name||(l.name=r.formatMessage({id:`member_${typeof o=="string"?o:"community"}`}));const{modal:u=!1}=e||{},[c,h]=y.useState({form:u||Zc("showPost")==="true"||!1,warning:!1}),[p,m]=y.useState({showCachedText:!1});y.useEffect(()=>{if(!p.showCachedText)return;(async()=>{const v=await Po(p.title||p.body||"",Zw,p.mentions);m(E=>({...E,prettifiedText:v}))})()},[p.showCachedText,p.title,p.body]);const g=b=>{if(!p.showCachedText||typeof c.warning=="string")return;let v;if("detail"in b&&b.detail.link)b.detail.timeout&&clearTimeout(b.detail.timeout),v=b.detail.link;else{const E=b;E.preventDefault(),E.stopPropagation();const x=E.target.closest("a");v=x&&x.getAttribute("href")}h(E=>({...E,warning:v||!1}))};y.useEffect(()=>{if(!p.showCachedText){document.removeEventListener(rt.DISCUSSION_POST_CLICKED,g),document.removeEventListener(rt.MEMBER_CLICKED,g),document.removeEventListener("click",g);return}return document.addEventListener(rt.DISCUSSION_POST_CLICKED,g),document.addEventListener(rt.MEMBER_CLICKED,g),document.addEventListener("click",g),()=>{document.removeEventListener(rt.DISCUSSION_POST_CLICKED,g),document.removeEventListener(rt.MEMBER_CLICKED,g),document.removeEventListener("click",g)}},[p.showCachedText]),y.useEffect(()=>{const b=v=>{if(!(!p.showCachedText||c.warning!==!1))return v.preventDefault(),v.returnValue=""};return window.addEventListener("beforeunload",b,{capture:!0}),()=>{window.removeEventListener("beforeunload",b,{capture:!0})}},[p.showCachedText,c.warning]);let f=r.formatMessage({id:`${a}placeholder`});return p.showCachedText&&(p.title||p.body)&&(f=p.prettifiedText||f),d.jsxs(d.Fragment,{children:[d.jsxs("button",{className:G("discussion-form-card",n),onClick:b=>{b.preventDefault(),b.stopPropagation(),h(v=>({...v,form:!0}))},"data-testid":"discussion-form-card",children:[d.jsx(Gt,{name:l.name,src:l.image,alt:""}),d.jsx(En,{className:G("input",{placeholder:!p.showCachedText}),element:"span",options:{forceInline:!0,overrides:{a:xt,blockquote:xt,br:xt,em:xt,li:xt,ol:xt,p:xt,s:xt,span:xt,strong:xt,ul:xt}},children:f})]}),d.jsxs(Ya,{children:[d.jsx(Kw,{showModal:c.form,functions:{cacheText:m,onClose:()=>{h(b=>({...b,form:!1}))}},form:t,cachedText:p,className:"in-portal"}),d.jsx(dn,{id:t.id?`${t.id}-warning`:"discussion-form-card-warning",className:"in-portal",isOpen:c.warning!==!1,functions:{onClose:()=>{h(b=>({...b,warning:!1}))}},title:r.formatMessage({id:`${a}overlay_title`}),buttons:[{variant:"secondary",children:r.formatMessage({id:`${a}overlay_cta_discard`}),onClick:b=>{b.preventDefault(),b.stopPropagation(),typeof c.warning=="string"&&(window.location.href=c.warning)},"data-gtm-event-type":"discard-click","data-gtm-event-context":i},{variant:"primary",children:r.formatMessage({id:`${a}overlay_cta_continue`}),onClick:()=>{h({form:!0,warning:!1})},"data-gtm-event-type":"continue-editing-click","data-gtm-event-context":i}],children:d.jsx("p",{children:r.formatMessage({id:`${a}overlay_text`})})})]})]})},Yw=y.lazy(()=>Promise.resolve().then(()=>Lw)),No=({isCard:e=!1,form:t,membershipRequiredToPost:{isMember:n,required:r,join:a,leave:i,notMemberStateText:s}})=>{if(r&&!n)return d.jsx(cn,{text:s,button:{breakpoints:{mobile:!0,901:!1},component:d.jsx(no,{isShort:!0,functions:{join:a,leave:i}})}});const{content:o,functions:l,meta:u,...c}=t,h={content:{type:(o==null?void 0:o.type)||"reply",slugs:(o==null?void 0:o.slugs)||{}},functions:{...l,create:(l==null?void 0:l.create)||(()=>{})},meta:{...u,isEditing:(u==null?void 0:u.isEditing)||!1,isPrepopulated:!1,showSuccessMessage:!1},...c,id:`add-post-${c.id||""}`};return e?d.jsx(hh,{form:h}):d.jsx(Yw,{...h})},Mo=({form:e})=>{const t=y.useContext(Bt),n=se.useIntl(),[r,a]=y.useState(!1),i=()=>{am(t)||a(!0)};y.useEffect(()=>(document.addEventListener(rt.DISCUSSION_FORM_SUBMITTED,i),()=>{document.removeEventListener(rt.DISCUSSION_FORM_SUBMITTED,i)}));const s={};return["successMessage","title","text"].forEach(o=>{s[o]=n.formatMessage({id:`profileModalLauncher_${o}`})}),d.jsx(_h,{form:e,showModal:r,functions:{onClose:()=>{a(!1)}},content:s})};const ss="discussion_responses_",mh=({type:e="answer",responses:t=0,isLoading:n=!1})=>{const r=se.useIntl();return t=parseInt(t),d.jsxs("div",{className:"responses-heading",children:[d.jsx("h4",{children:r.formatMessage({id:`${ss}title`},{action:r.formatMessage({id:`${ss}${e}`}),count:t})}),!n&&t===0&&d.jsx("p",{children:At(r.formatMessage,`${ss}empty`,e,e)})]})};const ph=({loadMore:{isLoading:e,hasNextPage:t,loadNextPage:n}={isLoading:!1,hasNextPage:!1,loadNextPage:()=>{}},form:r,children:a})=>{const i=se.useIntl(),s=y.useContext(oi),o=ga(a,{element:"li"});if(s.prepopulateForm&&(r!=null&&r.meta)&&(r.meta.isPrepopulated={text:s.prepopulateForm},s.mentionData)){const l=r.data||{};l.mentions||(l.mentions={});const u=s.mentionData.id||"1";l.mentions[u]={created_at:"",updated_at:"",id:u,data:s.mentionData},r.data=l,r.meta.isAutoFocused=!0}return d.jsxs("div",{className:G("thread-wrapper",{"empty-thread":!o}),children:[!Object.is(o,null)&&d.jsx("ul",{className:"thread",children:o}),!e&&d.jsx(zr,{hasNextPage:t,loadNextPage:n,size:"small",styling:{muted:!0},icon:{icon:"arrow_corner-down_right",position:"left"},messages:{button:i.formatMessage({id:"discussion_thread_loadMore"}),error:i.formatMessage({id:"loadMore_error"})}}),r&&s.showForm&&d.jsx(Wr,{...r})]})},Gw="post",Qw="reply",gh="00000000-0000-0000-0000-000000000000";function Ro({queryClient:e,queryKey:t}){function n(r,a,i){e.setQueryData(t,i)}return n}function Io({queryClient:e,queryKey:t}){async function n(r){await e.cancelQueries({queryKey:t});const a=e.getQueryData(t);return e.setQueryData(t,r),a}return n}function Jw(){return{latest_reactions:{like:[],reply:[]},reaction_counts:{like:0,reply:0},own_reactions:{like:[],reply:[]}}}function Xw(){return{latest_children:{like:[],reply:[]},children_counts:{like:0,reply:0},own_children:{like:[],reply:[]}}}function vh(e){const{id:t="",name:n="",organization:r="",jobTitle:a="",image:i={}}=e,{thumbnail:s=""}=i;return{id:t,data:{name:n,organization:r,jobTitle:a,thumbnail:s}}}function eE({title:e,content:t}){return{title:e,content:t,id:gh,time:new Date().toISOString(),verb:Gw}}function Dc({activity:e,user:t}){return{...e,actor:vh(t),...Jw()}}function Wa({activity:e,reaction:t}){var n,r,a;t?(e.latest_reactions={...e.latest_reactions||{},like:[...((r=e.latest_reactions)==null?void 0:r.like)||[],t]},e.own_reactions={...e.own_reactions||{},like:[...((a=e.own_reactions)==null?void 0:a.like)||[],t]}):e.reaction_counts={...e.reaction_counts||{},like:(n=e.reaction_counts)!=null&&n.like?e.reaction_counts.like+1:1}}function bh({activity:e,user:t}){var n,r,a;e.reaction_counts={...e.reaction_counts||{},like:(n=e.reaction_counts)!=null&&n.like?e.reaction_counts.like-1:0},t!=null&&t.id&&(e.latest_reactions={...e.latest_reactions||{},like:(((r=e.latest_reactions)==null?void 0:r.like)||[]).filter(({user_id:i})=>i!==t.id)},e.own_reactions={...e.own_reactions||{},like:(((a=e.own_reactions)==null?void 0:a.like)||[]).filter(({user_id:i})=>i!==t.id)})}function tE({activityId:e,replyId:t,content:n}){return{activity_id:e,data:{content:n},id:gh,kind:Qw,parent:t||""}}function xc({reply:e,user:t}){const n=vh(t);return{...e,user_id:n.id,user:n,...Xw()}}function wc({reply:e,reaction:t}){var n,r,a;t?(e.latest_children={...e.latest_children||{},like:[...((r=e.latest_children)==null?void 0:r.like)||[],t]},e.own_children={...e.own_children||{},like:[...((a=e.own_children)==null?void 0:a.like)||[],t]}):e.children_counts={...e.children_counts||{},like:(n=e.children_counts)!=null&&n.like?e.children_counts.like+1:1}}function nE({reply:e,user:t}){var n,r,a;e.children_counts={...e.children_counts||{},like:(n=e.children_counts)!=null&&n.like?e.children_counts.like-1:0},t!=null&&t.id&&(e.latest_children={...e.latest_children||{},like:(((r=e.latest_children)==null?void 0:r.like)||[]).filter(({user_id:i})=>i!==t.id)},e.own_children={...e.own_children||{},like:(((a=e.own_children)==null?void 0:a.like)||[]).filter(({user_id:i})=>i!==t.id)})}const yh=e=>{const t=new CustomEvent("discussionPostAdded",{detail:e});document.dispatchEvent(t)};let Ec,os=0;const Ch=()=>{y.useEffect(()=>(document.addEventListener("discussionPostAdded",e),()=>{document.removeEventListener("discussionPostAdded",e)}),[]);const e=t=>{const n=t.detail;if(!n)return;clearTimeout(Ec);const r=document.getElementById(n);if(r){r.scrollIntoView({behavior:"smooth",block:"start"}),os=0;return}os++,!(os>10)&&(Ec=setTimeout(()=>{e(t)},50))}},nr=Object.freeze({id:"some-user-id-1",name:"some user name 1",organization:"some user organization 1",jobTitle:"some user job title 1",image:{thumbnail:"https://some-user-thumbnail.com/avatar1.png"},isLoading:!1}),ln=Object.freeze({id:"some-user-id-2",name:"some user name 2",organization:"some user organization 2",jobTitle:"some user job title 2",image:{thumbnail:"https://some-user-thumbnail.com/avatar2.png"},isLoading:!1}),Dh=Object.freeze({actor:`SU:${nr.id}`,content:"some content 1",duration:"5.53ms",feed_id:"some-feed-id-1",foreign_id:"post:some-foriegn-id-1",id:"some-activity-id-1",object:"comment",time:"2023-11-24T17:52:36.162000",verb:"post"}),rE=Object.freeze({actor:`SU:${ln.id}`,content:"some content 2",duration:"5.53ms",feed_id:"some-feed-id-2",foreign_id:"post:some-foriegn-id-2",id:"some-activity-id-2",object:"comment",time:"2023-11-24T17:54:36.162000",verb:"post"}),aE=Object.freeze({actor:`SU:${nr.id}`,content:"some content 3",duration:"5.53ms",feed_id:"some-feed-id-3",foreign_id:"post:some-foriegn-id-3",id:"some-activity-id-3",object:"comment",time:"2023-11-24T17:56:36.162000",verb:"post"}),iE=Object.freeze({actor:`SU:${ln.id}`,content:"some content 4",duration:"5.53ms",feed_id:"some-feed-id-4",foreign_id:"post:some-foriegn-id-4",id:"some-activity-id-4",object:"comment",time:"2023-11-24T17:54:36.162000",verb:"post"});Object.freeze({id:"some-reaction-id-1",activity_id:Dh.id,kind:"like",created_at:"2023-11-24T17:58:36.162000",data:{},parent:"",updated_at:"2023-11-24T17:58:36.162000",user_id:ln.id,children_counts:{},latest_children:{},latest_children_extra:{},own_children:{},user:{id:ln.id,data:{},created_at:"2023-11-24T17:58:36.162000",updated_at:"2023-11-24T17:58:36.162000"}});Object.freeze({created_at:"2023-12-03T21:53:45.999851Z",updated_at:"2023-12-03T21:53:45.999851Z",id:"some-reply-id-1",user_id:ln.id,user:{id:ln.id,data:{},created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z"},kind:"reply",activity_id:Dh.id,data:{content:"Some content 1..."},parent:"",latest_children:{},children_counts:{}});Object.freeze({created_at:"2023-12-03T21:53:45.999851Z",updated_at:"2023-12-03T21:53:45.999851Z",id:"some-reply-id-2",user_id:nr.id,user:{id:nr.id,data:{},created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z"},kind:"reply",activity_id:rE.id,data:{content:"Some content 2..."},parent:"",latest_children:{},children_counts:{}});Object.freeze({created_at:"2023-12-03T21:53:45.999851Z",updated_at:"2023-12-03T21:53:45.999851Z",id:"some-reply-id-3",user_id:ln.id,user:{id:ln.id,data:{},created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z"},kind:"reply",activity_id:aE.id,data:{content:"Some content 3..."},parent:"",latest_children:{},children_counts:{}});Object.freeze({created_at:"2023-12-03T21:53:45.999851Z",updated_at:"2023-12-03T21:53:45.999851Z",id:"some-reply-id-3",user_id:nr.id,user:{id:nr.id,data:{},created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z"},kind:"reply",activity_id:iE.id,data:{content:"Some content 4..."},parent:"",latest_children:{},children_counts:{}});function sE({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:a,user:i}){const{mutate:s}=Ye.useMutation({mutationFn:e,onMutate:o=>t(l=>{const u=Dc({activity:eE(o),user:i});return _c(u,l)}),onError:n,onSuccess:(o,l,u)=>{const c=Dc({activity:o,user:i});r.setQueryData(a,_c(c,u,!0)),setTimeout(()=>{yh(c.id)},0)}});return s}function oE({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=Ye.useMutation({mutationFn:e,onMutate:({activityId:a,content:i})=>t(s=>{const o=Ua(a,s);return o&&(o.content=i),s}),onError:n});return r}function uE({queryFns:{create:e,edit:t,like:n,list:r,remove:a,unlike:i},queryKey:s,rankingMethod:o}){const l=Ye.useQueryClient(),u=Ja(),c={queryClient:l,queryKey:s},h={mutationHandlers:{error:Ro(c),mutate:Io(c)},user:u,...c},p=sE({...h,mutationFn:e}),m=oE({...h,mutationFn:t}),g=lE({...h,mutationFn:n}),f=dE({...h,mutationFn:a}),b=fE({...h,mutationFn:i}),{activities:v,...E}=cE({queryKey:s,queryFn:r,rankingMethod:o});return{activities:v,mutations:{create:p,edit:m,remove:f,like:g,unlike:b},user:u,...E}}function lE({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:a}){const{mutate:i}=Ye.useMutation({mutationFn:e,onMutate:({activityId:s})=>t(o=>{const l=Ua(s,o);return l&&Wa({activity:l}),o}),onError:n,onSuccess:(s,{activityId:o},l)=>{const u=Ua(o,l);u&&Wa({activity:u,reaction:s}),r.setQueryData(a,l)}});return i}function cE({queryFn:e,queryKey:t,rankingMethod:n}){const{data:r,error:a,isLoading:i,hasNextPage:s,fetchNextPage:o}=Ye.useInfiniteQuery({queryKey:t,queryFn:e,initialPageParam:`ranking=${n}`,getNextPageParam:l=>l!=null&&l.next?`${l==null?void 0:l.next}&ranking=${n}`:null});return{activities:mE(r),error:a,isLoading:i,hasNextPage:s,fetchNextPage:o}}function dE({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=Ye.useMutation({mutationFn:e,onMutate:({activityId:a})=>t(i=>hE(a,i)),onError:n});return r}function fE({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:a}=Ye.useMutation({mutationFn:e,onMutate:({activityId:i})=>t(s=>{const o=Ua(i,s);return o&&bh({activity:o,user:r}),s}),onError:n});return a}function _c(e,t,n=!1){return t?(n?t.pages[0].results[0]=e:t.pages[0].results=[e,...t.pages[0].results],t):{pages:[{next:"",results:[e]}],pageParams:[""]}}function Ua(e,t){if(t)for(const{results:n}of t.pages){const r=n.find(({id:a})=>a===e);if(r)return r}}function hE(e,t){for(const{results:n}of t.pages){const r=n.findIndex(({id:a})=>a===e);if(r!==-1){n.splice(r,1);break}}return t}function mE(e){var t;return((t=e==null?void 0:e.pages)==null?void 0:t.reduce((n,{results:r})=>[...n,...r],[]))||[]}const pE=({basePath:e,parentId:t,isMember:n,functions:{activities:r,mentions:a,join:i,leave:s},profile:o})=>{const l=Bp(Xs.COMMUNITY_RANKING),u=se.useIntl(),[c,h]=y.useState("recent"),[p,m]=y.useState([{id:"recent",label:"recent"},{id:"community_feed_live",label:"popular"}]),{activities:g,error:f,fetchNextPage:b,hasNextPage:v,isLoading:E,mutations:{create:k,edit:x,remove:w,like:A,unlike:S}}=uE({queryKey:[e,t,"activities",c],queryFns:r,rankingMethod:c});y.useEffect(()=>{l&&m(p.concat(l))},[l]);const[W,R]=y.useState(null),I=()=>{R(g.length),b()};return Ch(),f?d.jsx(cn,{variant:"error",text:f.message}):d.jsxs("section",{children:[d.jsx(No,{isCard:!0,form:{content:{type:"post",slugs:{}},functions:{create:k,...a},meta:{isEditing:!1,isAutoFocused:!1,isPrepopulated:!1,showSuccessMessage:!1}},membershipRequiredToPost:{isMember:n,required:!0,join:i,leave:s,notMemberStateText:u.formatMessage({id:"community_joinToPost"})}}),d.jsx(Qt,{className:"activities-feed-sorting-form",fields:[{id:"feed-sorting",label:u.formatMessage({id:"activitiesFeed_sorting_label"}),type:"select",options:p.map(({id:N,label:_})=>({id:N,label:u.formatMessage({id:`activitiesFeed_rankingMethod_${_}`})})),initialValue:c,functions:{onChange:N=>h(N)},gtm:{context:"Community Sorting",event:"community-sorting-click"}}],button:{hideButton:!0},functions:{onCatch:()=>{},onFailure:()=>{},onSuccess:async()=>{},onCancel:()=>{}},id:"activities-feed-sorting-form"}),g==null?void 0:g.map((N,_)=>{var B,T,z,M,H,ne,ee,re;const{id:F,own_reactions:j,latest_reactions:$,reaction_counts:V,mentioned_users:K}=N,Q=(((B=$==null?void 0:$.like)==null?void 0:B.length)||0)>0,ae=(((T=j==null?void 0:j.like)==null?void 0:T.length)||0)>0,D=ae?j==null?void 0:j.like[0].id:"",L=Q?(z=$==null?void 0:$.like)==null?void 0:z.map(le=>{var J,he,me;return{id:(J=le==null?void 0:le.user)==null?void 0:J.id,name:(me=(he=le==null?void 0:le.user)==null?void 0:he.data)==null?void 0:me.name}}):!1,q=N==null?void 0:N.actor;return d.jsx(y.Fragment,{children:d.jsx(Ur,{content:{type:"post",title:N==null?void 0:N.title,body:N==null?void 0:N.content,canLike:n,createdAt:(N==null?void 0:N.time)||"",slugs:{question:`${e}/${t}`,answer:F},slug:F,author:{id:q==null?void 0:q.id,name:(M=q==null?void 0:q.data)==null?void 0:M.name,organization:(H=q==null?void 0:q.data)==null?void 0:H.organization,jobTitle:(ne=q==null?void 0:q.data)==null?void 0:ne.jobTitle,location:(ee=q==null?void 0:q.data)==null?void 0:ee.location,image:{thumbnail:((re=q==null?void 0:q.data)==null?void 0:re.thumbnail)||void 0}},userLiked:ae,likes:(V==null?void 0:V.like)||0,comments:(V==null?void 0:V.reply)||0,peopleWhoLiked:L,mentions:K},links:{post:`${e}/${t}/${F}`,comments:`${e}/${t}/${F}`},gtmContext:"community",functions:{content:{createContent:()=>null,deleteContent:()=>w({activityId:F}),updateContent:(le,{body:J})=>x({activityId:F,content:J})},likes:{createLike:()=>A({activityId:F}),deleteLike:()=>S({activityId:F,reactionId:D})},comments:{openComments:()=>null},mentions:a},isTruncated:!0,styling:{showShareLinkButton:!0},setFocus:_===W})},F)}),!E&&d.jsx(zr,{hasNextPage:v,loadNextPage:I,icon:{icon:"arrow-down",position:"right"},messages:{button:u.formatMessage({id:"loadMore_button"}),error:u.formatMessage({id:"loadMore_error"})}}),d.jsx(Mo,{form:o})]})},gE={next:"id_lt=67ef0342-6f6e-4807-beea-5a9184ec140c&limit=5",results:[{created_at:"2023-12-03T18:47:44.081716Z",updated_at:"2023-12-03T18:47:44.081716Z",id:"256b921e-ffe6-410d-b754-ac1aaee989ce",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 17..."},parent:"",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:02.517688Z",updated_at:"2023-12-03T18:47:24.852582Z",id:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 16 (edited)..."},parent:"",latest_children:{reply:[{created_at:"2023-12-03T19:28:09.799652Z",updated_at:"2023-12-03T19:28:09.799652Z",id:"bf1ec451-e7c3-4ebe-a60e-248b0ec2a671",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 3..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:59.756761Z",updated_at:"2023-12-03T19:27:59.756761Z",id:"7887d921-e2ba-48ef-8089-db24536dbf70",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 2..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:46.534650Z",updated_at:"2023-12-03T19:27:46.534650Z",id:"73f5bdf3-7080-48ac-a8dc-185f71b38b42",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 1..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}}]},own_children:{reply:[{created_at:"2023-12-03T19:28:09.799652Z",updated_at:"2023-12-03T19:28:09.799652Z",id:"bf1ec451-e7c3-4ebe-a60e-248b0ec2a671",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 3..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:59.756761Z",updated_at:"2023-12-03T19:27:59.756761Z",id:"7887d921-e2ba-48ef-8089-db24536dbf70",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 2..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:46.534650Z",updated_at:"2023-12-03T19:27:46.534650Z",id:"73f5bdf3-7080-48ac-a8dc-185f71b38b42",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 1..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}}]},children_counts:{reply:3}},{created_at:"2023-12-03T17:47:45.107092Z",updated_at:"2023-12-03T17:47:45.107092Z",id:"27a59e8f-f094-442f-88ec-1d5ec2f72790",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 14..."},parent:"",latest_children:{reply:[{created_at:"2023-12-03T18:47:10.603929Z",updated_at:"2023-12-03T18:47:10.603929Z",id:"c32b83d5-c5fc-4253-8531-eb99dcb01f28",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 8..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:47:04.856649Z",updated_at:"2023-12-03T18:47:04.856649Z",id:"5efd80e3-cb11-4748-8c64-f46b71df69c4",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 7..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:22.687552Z",updated_at:"2023-12-03T18:36:22.687552Z",id:"a3a2ebae-6df2-4dc0-beee-2296188b67aa",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 6..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:16.129336Z",updated_at:"2023-12-03T18:36:16.129336Z",id:"72948da5-bf3c-4bd5-9a21-2cee36e0ce8a",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 5..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:40.850756Z",updated_at:"2023-12-03T17:56:40.850756Z",id:"81ebc855-d1f6-4a2c-a788-a251bae406b6",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 4..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:34.103420Z",updated_at:"2023-12-03T17:56:34.103420Z",id:"ddc28de7-4e89-4572-8122-c95dceacc2fd",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 3..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:26.410145Z",updated_at:"2023-12-03T17:56:26.410145Z",id:"916ed4b6-ad87-47bc-9e00-7b0c46180276",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 2..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:19.921740Z",updated_at:"2023-12-03T17:56:19.921740Z",id:"92cddcb2-cbdc-4e69-9c8e-5afe3a607411",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 1..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}}]},own_children:{reply:[{created_at:"2023-12-03T18:47:10.603929Z",updated_at:"2023-12-03T18:47:10.603929Z",id:"c32b83d5-c5fc-4253-8531-eb99dcb01f28",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 8..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:47:04.856649Z",updated_at:"2023-12-03T18:47:04.856649Z",id:"5efd80e3-cb11-4748-8c64-f46b71df69c4",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 7..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:22.687552Z",updated_at:"2023-12-03T18:36:22.687552Z",id:"a3a2ebae-6df2-4dc0-beee-2296188b67aa",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 6..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:16.129336Z",updated_at:"2023-12-03T18:36:16.129336Z",id:"72948da5-bf3c-4bd5-9a21-2cee36e0ce8a",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 5..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:40.850756Z",updated_at:"2023-12-03T17:56:40.850756Z",id:"81ebc855-d1f6-4a2c-a788-a251bae406b6",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 4..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}}]},children_counts:{reply:8}},{created_at:"2023-12-03T17:47:40.066170Z",updated_at:"2023-12-03T17:47:40.066170Z",id:"9ed6a1d0-00b5-4a03-94d7-ac01e188e2e2",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 13..."},parent:"",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:47:33.107894Z",updated_at:"2023-12-03T17:47:33.107894Z",id:"67ef0342-6f6e-4807-beea-5a9184ec140c",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 12..."},parent:"",latest_children:{},children_counts:{}}],duration:"6.48ms"};function vE({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:a,user:i}){const{mutate:s}=Ye.useMutation({mutationFn:e,onMutate:o=>t(l=>{const u=xc({reply:tE(o),user:i});return kc(u,l,{replace:!1,append:(o==null?void 0:o.replyId)!==void 0})}),onError:n,onSuccess:(o,l,u)=>{const c=xc({reply:o,user:i});r.setQueryData(a,kc(c,u,{replace:!0,append:(l==null?void 0:l.replyId)!==void 0})),setTimeout(()=>{yh(c.id)},0)}});return s}function bE({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=Ye.useMutation({mutationFn:e,onMutate:({replyId:a,content:i})=>t(s=>{const o=Ha(a,s);return o&&(o.data.content=i),s}),onError:n});return r}function xh({queryFns:{create:e,edit:t,like:n,list:r,remove:a,unlike:i},queryKey:s}){const o=Ye.useQueryClient(),l=Ja(),u={queryClient:o,queryKey:s},c={mutationHandlers:{error:Ro(u),mutate:Io(u)},user:l,...u},h=vE({...c,mutationFn:e}),p=bE({...c,mutationFn:t}),m=yE({...c,mutationFn:n}),g=DE({...c,mutationFn:a}),f=xE({...c,mutationFn:i}),{replies:b,...v}=CE({queryKey:s,queryFn:r});return{replies:b,mutations:{create:h,edit:p,remove:g,like:m,unlike:f},user:l,...v}}function yE({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:a}){const{mutate:i}=Ye.useMutation({mutationFn:e,onMutate:({replyId:s})=>t(o=>{const l=Ha(s,o);return l&&wc({reply:l}),o}),onError:n,onSuccess:(s,{replyId:o},l)=>{const u=Ha(o,l);u&&wc({reply:u,reaction:s}),r.setQueryData(a,l)}});return i}function CE({queryFn:e,queryKey:t}){const{data:n,error:r,isLoading:a,hasNextPage:i,fetchNextPage:s}=Ye.useInfiniteQuery({queryKey:t,queryFn:e,initialPageParam:{next:""},getNextPageParam:u=>(u==null?void 0:u.next)||null}),o=BE(n),l=`${o.length||0}${i?"+":""}`;return{replies:o,repliesCount:l,error:r,isLoading:a,hasNextPage:i,fetchNextPage:s}}function DE({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=Ye.useMutation({mutationFn:e,onMutate:({replyId:a})=>t(i=>kE(a,i)),onError:n});return r}function xE({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:a}=Ye.useMutation({mutationFn:e,onMutate:({replyId:i})=>t(s=>{const o=Ha(i,s);return o&&nE({reply:o,user:r}),s}),onError:n});return a}function wE(e){return{pages:[{next:"",results:[e]}],pageParams:[""]}}function EE(e,t,n){const r=t.pages.length-1,a=t.pages[r].results.length-1;return n!=null&&n.replace?t.pages[r].results[a]=e:t.pages[r].results.push(e),t}function _E(e,t,n){return n!=null&&n.replace?t.pages[0].results[0]=e:t.pages[0].results=[e,...t.pages[0].results],t}function kc(e,t,n){return t?n!=null&&n.append?EE(e,t,n):_E(e,t,n):wE(e)}function Ha(e,t){if(t)for(const{results:n}of t.pages){const r=n.find(({id:a})=>a===e);if(r)return r}}function kE(e,t){for(const{results:n}of t.pages){const r=n.findIndex(({id:a})=>a===e);if(r!==-1){n.splice(r,1);break}}return t}function BE(e){var t;return((t=e==null?void 0:e.pages)==null?void 0:t.reduce((n,r)=>[...n,...r==null?void 0:r.results],[]))||[]}const FE=({basePath:e,parentId:t,activityId:n,replyId:r,isMember:a,functions:i})=>{const s=se.useIntl(),o=3,{replies:l,fetchNextPage:u,hasNextPage:c,isLoading:h,mutations:{create:p,edit:m,like:g,remove:f,unlike:b},user:v}=xh({queryKey:[e,t,n,r,"replies"],queryFns:{...i,list:x=>i.list({...x,reactionId:r})}});Us([h]);const[E,k]=y.useState(!0);return d.jsxs(d.Fragment,{children:[(l==null?void 0:l.length)>=o&&d.jsx(Be,{className:"nested-replies-show-toggle",variant:"secondary",size:"small",icon:{icon:`arrow_corner-${E?"up_left":"down_right"}`,position:"left"},onClick:()=>k(!E),children:s.formatMessage({id:`discussion_thread_${E?"hide":"show"}`},{count:l==null?void 0:l.length})}),E&&d.jsx(ph,{loadMore:{isLoading:h,hasNextPage:c,loadNextPage:()=>u()},form:{content:{type:"reply",slugs:{question:`${e}/${t}`,answer:n,reply:r}},functions:{create:(x,{body:w})=>p({activityId:n,replyId:r,content:w}),listMembers:i.listMembers,clickMentionFallback:i.clickMentionFallback},meta:{isEditing:!1,isAutoFocused:!0,isPrepopulated:!1,showSuccessMessage:!1}},children:l&&l.length>0?l==null?void 0:l.map(x=>{var Q,ae,D,L,q,B,T,z,M,H,ne,ee;const{id:w,own_children:A,latest_children:S,children_counts:W,data:{mentioned_users:R}}=x,N=(((Q=A==null?void 0:A.like)==null?void 0:Q.length)||0)>0?(ae=A==null?void 0:A.like)==null?void 0:ae.find(re=>{var le;return((le=re==null?void 0:re.user)==null?void 0:le.id)===(v==null?void 0:v.id)}):!1,_=N?N==null?void 0:N.id:"",F=!!N,$=(((D=S==null?void 0:S.like)==null?void 0:D.length)||0)>0?(L=S==null?void 0:S.like)==null?void 0:L.map(re=>{var le,J,he;return{id:(le=re==null?void 0:re.user)==null?void 0:le.id,name:(he=(J=re==null?void 0:re.user)==null?void 0:J.data)==null?void 0:he.name}}):!1,V=x==null?void 0:x.user,K=typeof x.data.content=="string"?(q=x==null?void 0:x.data)==null?void 0:q.content:((T=(B=x==null?void 0:x.data)==null?void 0:B.content)==null?void 0:T.text)||"";return d.jsx(Ur,{isCommunity:!0,content:{id:w,type:"reply",body:K,canLike:a,createdAt:x==null?void 0:x.created_at,slugs:{question:`${e}/${t}`,answer:n,reply:x==null?void 0:x.parent},slug:"",author:{id:V==null?void 0:V.id,name:(z=V.data)==null?void 0:z.name,organization:(M=V.data)==null?void 0:M.organization,jobTitle:(H=V.data)==null?void 0:H.jobTitle,location:(ne=V.data)==null?void 0:ne.location,image:{thumbnail:((ee=V.data)==null?void 0:ee.thumbnail)||void 0}},userLiked:F,likes:(W==null?void 0:W.like)||0,peopleWhoLiked:$,mentions:R},functions:{content:{createContent:()=>null,deleteContent:()=>f({replyId:w}),updateContent:(re,{body:le})=>m({replyId:w,content:le})},likes:{createLike:()=>g({replyId:w}),deleteLike:()=>b({replyId:w,reactionId:_})},comments:{},mentions:{listMembers:i.listMembers,clickMentionFallback:i.clickMentionFallback}},styling:{showShareLinkButton:!0}},w)}):null})]})};const wh=({basePath:e,parentId:t,activityId:n,isMember:r,functions:{reactions:a,mentions:i,join:s,leave:o},profile:l})=>{const u=se.useIntl(),{replies:c,repliesCount:h,fetchNextPage:p,hasNextPage:m,isLoading:g,mutations:{create:f,edit:b,like:v,remove:E,unlike:k},user:x}=xh({queryKey:[e,t,n,"replies"],queryFns:a}),w=()=>{S(c.length),p()},[A,S]=y.useState(null);return Us([g]),Ch(),d.jsxs("section",{className:"replies-feed",children:[d.jsx(mh,{type:"comment",responses:h,isLoading:g}),d.jsx(No,{form:{content:{type:"reply",slugs:{}},functions:{create:(W,{body:R})=>f({activityId:n,content:R}),...i},meta:{isEditing:!1,isAutoFocused:!1,isPrepopulated:!1,showSuccessMessage:!1},placeholder:u.formatMessage({id:"discussion_responses_placeholder"})},membershipRequiredToPost:{isMember:r,required:!0,join:s,leave:o,notMemberStateText:u.formatMessage({id:"community_joinToPost"})}}),c==null?void 0:c.map((W,R)=>{var B,T,z,M,H,ne,ee,re,le,J,he,me;const{id:I,own_children:N,latest_children:_,children_counts:F,data:{mentioned_users:j}}=W,V=(((B=N==null?void 0:N.like)==null?void 0:B.length)||0)>0?(T=N==null?void 0:N.like)==null?void 0:T.find(ve=>{var Ee;return((Ee=ve==null?void 0:ve.user)==null?void 0:Ee.id)===(x==null?void 0:x.id)}):!1,K=V?V==null?void 0:V.id:"",Q=!!V,D=(((z=_==null?void 0:_.like)==null?void 0:z.length)||0)>0?(M=_==null?void 0:_.like)==null?void 0:M.map(ve=>{var Ee,Ae,ze;return{id:(Ee=ve==null?void 0:ve.user)==null?void 0:Ee.id,name:(ze=(Ae=ve==null?void 0:ve.user)==null?void 0:Ae.data)==null?void 0:ze.name}}):!1,L=W==null?void 0:W.user,q=typeof W.data.content=="string"?(H=W==null?void 0:W.data)==null?void 0:H.content:((ee=(ne=W==null?void 0:W.data)==null?void 0:ne.content)==null?void 0:ee.text)||"";return d.jsx(dh,{children:d.jsx(Ur,{isCommunity:!0,content:{id:I,type:"reply",body:q,canLike:r,createdAt:W==null?void 0:W.created_at,slugs:{question:`${e}/${t}`,answer:n,reply:I},slug:I,author:{id:L==null?void 0:L.id,name:(re=L.data)==null?void 0:re.name,organization:(le=L.data)==null?void 0:le.organization,jobTitle:(J=L.data)==null?void 0:J.jobTitle,location:(he=L.data)==null?void 0:he.location,image:{thumbnail:((me=L.data)==null?void 0:me.thumbnail)||void 0}},userLiked:Q,likes:(F==null?void 0:F.like)||0,peopleWhoLiked:D,mentions:j},functions:{content:{createContent:()=>null,deleteContent:()=>E({replyId:I}),updateContent:(ve,{body:Ee})=>b({replyId:I,content:Ee})},likes:{createLike:()=>v({replyId:I}),deleteLike:()=>k({replyId:I,reactionId:K})},comments:{},mentions:i},children:d.jsx(FE,{basePath:e,parentId:t,activityId:n,replyId:I,isMember:r,functions:{...a,...i}}),styling:{showShareLinkButton:!0},setFocus:R===A},I)},I)}),!g&&d.jsx(zr,{hasNextPage:m,loadNextPage:w,icon:{icon:"arrow-down",position:"right"},messages:{button:u.formatMessage({id:"loadMore_button"}),error:u.formatMessage({id:"loadMore_error"})}}),d.jsx(Mo,{form:l})]})};function AE({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=Ye.useMutation({mutationFn:e,onMutate:({content:a,title:i})=>t(s=>(s&&(a!=null&&(s.content=a),i!=null&&(s.title=i)),s)),onError:n});return r}function TE({queryFn:e,queryKey:t}){const{data:n,error:r,isLoading:a,isFetching:i}=Ye.useQuery({queryFn:e,queryKey:t});return{activity:n,error:r,isLoading:a,isFetching:i}}function SE({queryFns:{read:e,edit:t,like:n,unlike:r},queryKey:a}){const i=Ye.useQueryClient(),s=Ja(),o={queryClient:i,queryKey:a},l={mutationHandlers:{error:Ro(o),mutate:Io(o)},user:s,...o},u=AE({...l,mutationFn:t}),c=jE({...l,mutationFn:n}),h=OE({...l,mutationFn:r}),{activity:p,...m}=TE({queryKey:a,queryFn:e});return{activity:p,mutations:{edit:u,like:c,unlike:h},user:s,...m}}function jE({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:a}){const{mutate:i}=Ye.useMutation({mutationFn:e,onMutate:s=>t(o=>(o&&Wa({activity:o}),o)),onError:n,onSuccess:(s,o,l)=>{l&&Wa({activity:l,reaction:s}),r.setQueryData(a,l)}});return i}function OE({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:a}=Ye.useMutation({mutationFn:e,onMutate:i=>t(s=>(s&&bh({activity:s,user:r}),s)),onError:n});return a}const PE=({basePath:e,parentId:t,activityId:n,isMember:r,functions:{activities:{remove:a,...i},reactions:s,mentions:o,join:l,leave:u},profile:c})=>{var I,N,_,F,j,$,V,K,Q,ae;const h=se.useIntl(),{activity:p,error:m,isLoading:g,mutations:{edit:f,like:b,unlike:v}}=SE({queryFns:i,queryKey:[e,t,n]});if(g)return d.jsx(kt,{style:{height:"400px"}});if(m||!p)return d.jsx(cn,{variant:"error",text:h.formatMessage({id:"activitySection_notFoundError"})});const{own_reactions:E,latest_reactions:k,mentioned_users:x}=p,w=(((I=k==null?void 0:k.like)==null?void 0:I.length)||0)>0,A=(((N=E==null?void 0:E.like)==null?void 0:N.length)||0)>0,S=A?E==null?void 0:E.like[0].id:"",W=w?(_=k==null?void 0:k.like)==null?void 0:_.map(D=>{var L,q,B;return{id:(L=D==null?void 0:D.user)==null?void 0:L.id,name:(B=(q=D==null?void 0:D.user)==null?void 0:q.data)==null?void 0:B.name}}):!1,R=p==null?void 0:p.actor;return d.jsxs("section",{className:"activity-section",children:[d.jsx(Ur,{className:"highlighted-text-box subtle",isCommunity:!0,content:{id:n,type:"post",title:p==null?void 0:p.title,body:p==null?void 0:p.content,canLike:r,createdAt:(p==null?void 0:p.time)||"",slugs:{question:`${e}/${t}`,answer:p==null?void 0:p.id},slug:n,author:{id:R.id,name:(F=R.data)==null?void 0:F.name,organization:(j=R.data)==null?void 0:j.organization,jobTitle:($=R.data)==null?void 0:$.jobTitle,location:(V=R.data)==null?void 0:V.location,image:{thumbnail:((K=R.data)==null?void 0:K.thumbnail)||void 0}},userLiked:A,likes:((Q=p==null?void 0:p.reaction_counts)==null?void 0:Q.like)||0,comments:((ae=p==null?void 0:p.reaction_counts)==null?void 0:ae.reply)||0,peopleWhoLiked:W,mentions:x},originalAuthorId:R==null?void 0:R.id,forceHide:{comments:!0},functions:{content:{createContent:()=>null,deleteContent:a,updateContent:(D,{title:L,body:q})=>f({title:L,content:q})},likes:{createLike:()=>b({activityId:n}),deleteLike:()=>v({activityId:n,reactionId:S})},comments:{openComments:()=>{}},mentions:o},styling:{showShareLinkButton:!0}},n),d.jsx(wh,{basePath:e,parentId:t,activityId:n,isMember:r,functions:{reactions:s,mentions:o,join:l,leave:u},profile:c})]})};const Eh=({showModal:e=!0,functions:t,form:n,cachedText:r,className:a})=>{const i=se.useIntl(),s="discussionFormModal_",{onClose:o=()=>{},cacheText:l=()=>{}}=t,{data:u,meta:c,functions:h}=n,{title:p="",body:m="",mentions:g}=r||{},f="discussion-form-modal";return d.jsx(dn,{id:f,title:i.formatMessage({id:`${s}title`}),isOpen:e,functions:{onClose:()=>{(p!==""||m!=="")&&l(b=>({...b,showCachedText:!0})),o()}},className:G("discussion-form-modal",a),children:d.jsx(Wr,{...n,data:{...u,mentions:g||(u==null?void 0:u.mentions)},meta:{...c,isAutoFocused:!0,isInOverlay:`${f}-overlay`,hasTitleField:{text:p},isPrepopulated:{text:m||(c==null?void 0:c.isPrepopulated)!==!1&&(c==null?void 0:c.isPrepopulated.text)||""},showGuidelines:!1,showDivider:!0},buttons:{submit:i.formatMessage({id:`${s}cta`})},functions:{...h,onChange:b=>{l(v=>({...v,...b}))},onMention:({id:b,name:v}={})=>{if(!b||!v)return;const E=g||{};E[b]={created_at:"",updated_at:"",id:b,data:{name:v}},l(k=>({...k,mentions:E}))},create:async b=>{o(),h.create&&await h.create(b),l({showCachedText:!1})},handleSaveEdit:async b=>{o(),h.handleSaveEdit&&await h.handleSaveEdit(b),l({showCachedText:!1})}}})})},NE=Object.freeze(Object.defineProperty({__proto__:null,default:Eh},Symbol.toStringTag,{value:"Module"}));const ME=({className:e,showModal:t=!0,title:n,formTitle:r,formLabel:a,ctaMessage:i,showIcon:s,onClose:o,reportError:l=()=>{},sendInvites:u})=>{const c=se.useIntl();return r||(r=c.formatMessage({id:"inviteModal_formTitle"})),a||(a=c.formatMessage({id:"inviteModal_formLabel"})),i||(i=c.formatMessage({id:"inviteModal_cta"})),d.jsx(dn,{id:"invite-user-modal",title:n,isOpen:t,showDivider:!1,showIcon:s,functions:{onClose:o},className:G("invite-modal",e,{success:!!n}),children:d.jsx(ih,{title:r,label:a,ctaMessage:i,onClose:o,sendInvites:u,reportError:l})})};const _h=({showModal:e=!0,content:{successMessage:t,title:n,text:r}={},functions:a,form:i,className:s})=>{const o=se.useIntl(),[l,u]=y.useState(Zc("showProfile")==="true"||e);y.useEffect(()=>{u(e)},[e]);const{onClose:c=()=>{}}=a;return d.jsx(dn,{id:"profile-form-modal",title:t||n||o.formatMessage({id:"profileModal_title"}),isOpen:l,showDivider:!t,functions:{onClose:c},className:G("profile-modal",s,{success:!!t}),maxWidth:700,children:d.jsxs(d.Fragment,{children:[t&&n||r?d.jsxs("div",{className:"intro",children:[t&&n?d.jsx("h3",{children:n}):"",r?d.jsx("p",{children:r}):""]}):null,d.jsx(sh,{...i,meta:{shouldShowCancelButton:!1},functions:{...(i==null?void 0:i.functions)||{},onSuccess:async h=>{var p;try{(p=i==null?void 0:i.functions)!=null&&p.onSuccess&&await i.functions.onSuccess(h)}finally{c()}}}})]})})};const RE=({members:e})=>{const[t,n]=y.useState(!1),r=a=>{const{fullName:i,jobTitle:s,organisation:o,photo:l}=a||{};return d.jsxs(d.Fragment,{children:[d.jsx(Gt,{name:i,src:l}),d.jsx("p",{children:i}),d.jsx("small",{className:"text-medium",children:o?`${s}, ${o}`:s})]})};return d.jsxs("div",{className:"directory-wrapper",children:[d.jsx("ul",{className:"directory",children:e.map(a=>d.jsx("li",{children:d.jsx("button",{onClick:i=>{i.preventDefault(),i.stopPropagation(),n(a)},children:r(a)})},a.fullName))}),d.jsx(dn,{isOpen:t!==!1,children:t===!1?"":d.jsxs(d.Fragment,{children:[r(t),d.jsx(En,{children:t.text})]}),buttons:[{size:"small",variant:"tertiary",onClick:()=>n(!1),children:"Close"}],functions:{onClose:()=>n(!1)}})]})};const IE=({author:e,authorCite:t,content:n,member:r,className:a=""})=>d.jsxs("blockquote",{className:G("testimonial-block",a),children:[d.jsx(It,{className:"testimonial",children:n}),r?d.jsx(_n,{member:r,styling:{size:"large"}}):d.jsxs(d.Fragment,{children:[e&&d.jsx("p",{className:G("author",{"text-small":!a.includes("new")}),children:e}),t&&d.jsx("p",{className:G("author-cite",{"text-small":!a.includes("new")}),children:d.jsx("cite",{children:t})})]})]}),$E=y.memo(IE);const LE=({items:e=[],selector:t="",className:n=""})=>{const r=se.useIntl(),[a,i]=y.useState(e);return y.useEffect(()=>{if(e.length)return;let s="";Array(6).fill(0).forEach((u,c)=>{s+=`${c>0?", ":""}${t} h${c+1}`});const l=Array.from(document.querySelectorAll(s)).filter(u=>u.id).map(u=>({id:u.id,text:u.textContent||""}));i(l)},[]),a&&a.length>0&&d.jsxs($t,{variant:"subtle",className:G("table-of-contents",n),children:[d.jsx("h2",{children:r.formatMessage({id:"tableOfContents"})}),d.jsx("nav",{children:d.jsx("ul",{children:a.map(({id:s,text:o})=>d.jsx("li",{children:d.jsx("a",{href:`#${s}`,children:o})},s))})})]})};const ui=({time:e,rangeTime:t,prependedText:n,appendedText:r,className:a=""})=>{const i=se.useIntl(),s="timeToComplete_";if(!e||typeof e!="number")return null;const o=c=>{const h=c/60,p=Math.floor(h),m=(h-p)*60,g=Math.round(m),f=`${i.formatMessage({id:`${s}hours`},{time:p})}${p>0&&g>0?", ":""}${i.formatMessage({id:`${s}minutes`},{time:g})}`;return{text:`${p>0?`${i.formatMessage({id:`${s}hours_short`},{time:p})} `:""}${g>0?i.formatMessage({id:`${s}minutes_short`},{time:g}):""}`,ariaText:f}};let{text:l,ariaText:u}=o(e);if(t){const{text:c,ariaText:h}=o(e+t);l=i.formatMessage({id:`${s}range`},{early:l,late:c}),u=i.formatMessage({id:`${s}range_aria`},{early:u,late:h})}return n&&(u=`${n} ${u}`,l=`${n} ${l}`),r&&(u=`${u} ${r}`,l=`${l} ${r}`),d.jsx("span",{className:G("time-to-complete",a),"aria-label":u,children:l})};const zE=({className:e="",image:t,...n})=>t?(typeof t=="string"&&(t={width:1080,height:200,type:"image/png",url:t}),t.range=[{height:124,width:425},{height:200,width:768},{height:200,width:1368}],t.query="fit=thumb&f=center",d.jsx(sr,{...n,className:G("banner",e),image:{...t,aspect:"banner"}})):null;const qE=["small","span","strong","em","p","h1","h2","h3","h4","h5","h6","blockquote","q"],WE=({className:e="",content:t,image:n,variant:r,spacing:a="normal",styling:i,hideElements:s={eyebrow:!1,title:!1,text:!1},cta:o,children:l})=>{var g,f;const u={imageFullWidth:!0,...i};r||(r=u.imageFullWidth?"default":"light");const c=["eyebrow","title","text"],h={eyebrow:"small",title:"h1",text:"p"},p={};c.forEach(b=>{if(!t[b]){p[b]=!1;return}if(!s[b]){if(typeof t[b]=="object"){p[b]=t[b];const{text:v,element:E}=t[b];if(E&&qE.includes(E.toLowerCase()))return;p[b]={text:v,element:h[b]};return}p[b]={text:t[b],element:h[b]}}});const m=o&&o.text&&o.link;return m&&o.link[0]==="#"&&(o.props||(o.props={}),o.props.onClick=b=>{b.preventDefault(),b.stopPropagation();const v=document.getElementById(o.link.substring(1));v&&v.scrollIntoView({behavior:"smooth"})}),d.jsx(mn,{className:G("banner-section",r,a,e,{"has-image":n,"image-full-width":n&&u.imageFullWidth,"image-inline":n&&!u.imageFullWidth,"has-cta":m,"has-extra-spacing":r!=="subtle"&&a==="normal"&&p.eyebrow&&p.title}),children:d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"content-wrapper",children:[c.map(b=>{if(p[b]&&typeof p[b]=="object"){const{text:v,element:E=""}=p[b];return b==="text"?d.jsx(En,{overrideType:"text-only",className:"text",children:v},b):y.createElement(E,{key:b,className:b},v)}return null}),l,m&&d.jsx(Be,{variant:n||["light","subtle"].includes(r)?"primary":"secondary",size:{mobile:"medium",768:"large"},href:o.link,...o.props,className:G({new:r==="subtle",[(g=o.props)==null?void 0:g.className]:(f=o.props)==null?void 0:f.className}),children:o.text})]}),n&&d.jsx(sr,{image:{...n,aspect:u.imageFullWidth?"banner":n.aspect||void 0}})]})})},UE=y.memo(WE);const HE=({image:e,variant:t="default",children:n,className:r=""})=>{const a={};return e&&(a["--image"]=`url(${e})`),d.jsx(mn,{className:G("custom-content-banner",t,r,{"has-image":e}),style:a,children:d.jsx("div",{className:"content-slim",children:n})})};const VE=({alignImage:e="left",className:t,content:n,image:r})=>{const a=typeof n=="string"?d.jsx(En,{children:n}):n;return d.jsxs(mn,{className:G("highlight-section",t),children:[r&&d.jsx("div",{className:G("highlight-container highlight-image",{[`highlight-image-${e}`]:e==="right"}),children:d.jsx(sr,{image:{...r,description:""}})}),d.jsx("div",{className:G("highlight-container highlight-content-wrapper",{"no-image":!r}),children:d.jsx("div",{className:G("highlight-content",{"highlight-content-right":e==="left"}),children:r?a:d.jsx("div",{className:"content-default",children:a})})})]})},KE=y.memo(VE);const ZE=({variant:e="primary",button:t=null,title:n,text:r,gtmContext:a})=>!n&&!r?null:d.jsxs("aside",{className:G("marketing-block",e),children:[n&&d.jsx("p",{className:"title",children:n}),r&&d.jsx("p",{children:r}),t&&d.jsx(Be,{variant:"secondary",size:"medium",href:t.link,className:"gtm-trackable","data-gtm-event-context":a,"data-gtm-event-type":"learn-more-click",children:t.text})]}),YE=({type:e,data:t})=>{const n=se.useIntl(),{answers:r,createdAt:a,dateHasPassed:i,isOngoingEvent:s,pill:o,readingTime:l,publishedDate:u,startDate:c}=t;if(e==="question"){const h=a&&fs(a);return d.jsxs("p",{className:"details answers","data-testid":"question-answers",children:[n.formatMessage({id:"card_answers"},{number:r}),a&&d.jsxs("span",{"data-testid":"question-created-at",children:[" ","·"," ",n.formatMessage({id:"card_time_ago"},{time:h?n.formatMessage({id:`dates_${h.path}`},{number:h.number}):0})]})]})}if(c&&!i||s)return d.jsx("p",{className:"details",children:s?n.formatMessage({id:"card_bootcamp"}):Vs(c)});if(o)return d.jsx(Cn,{variant:o==="free"?"subtle":"highlighted",className:o,"data-testid":"course-type",children:o});if(l||u){const h=u&&fs(u);return d.jsxs("ul",{className:"details",children:[l&&d.jsx("li",{"data-testid":"reading-time",children:n.formatMessage({id:"card_time_read"},{time:l})}),u&&d.jsx("li",{"data-testid":"published-date",children:n.formatMessage({id:"card_time_ago"},{time:h?n.formatMessage({id:`dates_${h.path}`},{number:h.number}):0})})]})}return null},GE={title:66,text:3e3,secondaryText:1e3,partner:25},Va={communityPage:{basePath:"/communities/",className:"communityPage",gtmEvent:"community"},customCard:{className:"custom",gtmEvent:"custom",length:{text:335,secondaryText:150}},event:{basePath:"/events/",className:"event",gtmEvent:"event"},microcourse:{basePath:"/microcourses/en/",className:"course",gtmEvent:"microcourse-overview"},solutionArticle:{basePath:"/solution-articles/en/",className:"article",length:{title:60},gtmEvent:"article"},qaQuestion:{basePath:"/questions-answers/",className:"question",length:{title:190},gtmEvent:"q-and-a-question"},listPage:{basePath:"/list/en/",className:"list",gtmEvent:"list"},people:{basePath:"/profiles/",className:"people",length:{people:1e3},gtmEvent:"person"},learningHub:{basePath:"/learning-hub/",className:"learning-hub",length:{title:190},gtmEvent:"learning-hub"}},QE=({data:e,cta:t,link:n,gtmContext:r})=>{var f,b;const a=se.useIntl(),[i,s]=y.useState({loading:!1,registered:e.registered||!1});y.useEffect(()=>{e.registered&&s(v=>({...v,registered:!0}))},[e.registered]);const{customLinkText:o,startDate:l,dateHasPassed:u,pill:c,slug:h}=e,p=e.contentType;let m="";if((f=Va[p])!=null&&f.gtmEvent&&(m=Va[p].gtmEvent),l&&u)return n?d.jsx("a",{href:n,className:"details additional-link gtm-trackable","data-gtm-event-context":`${r}-CarouselCard`,"data-gtm-event-type":`${m}-click`,children:o||a.formatMessage({id:"card_watch"})}):null;if(p==="people")return n?d.jsx(Be,{variant:"tertiary",size:"small",href:n,className:"gtm-trackable","data-gtm-event-context":`${r}-Card-Button`,"data-gtm-event-type":`${m}-click`,children:o||a.formatMessage({id:"card_cta_people"})}):null;const g=["communityPage","microcourse","event"];if(t&&t.onClick&&g.includes(p)&&c!=="premium"){const v=i.loading||i.registered||((b=e==null?void 0:e.members)==null?void 0:b.isMember),E=async k=>{if(k.preventDefault(),k.stopPropagation(),!(v||!t||!t.onClick)){s(x=>({...x,loading:!0}));try{const x=await t.onClick(e);s(x==="success"?()=>({registered:!0,loading:!1}):w=>({...w,loading:!1}))}catch{s(w=>({...w,loading:!1}))}}};return d.jsx("p",{className:G("cta-wrapper",{"has-member-section":e==null?void 0:e.members}),children:d.jsx(Be,{onClick:E,className:"gtm-trackable",size:"small",styling:{fullWidth:!0},disabled:v,"data-gtm-event-context":`${r}Page-${p}: ${h}`,"data-gtm-event-type":`${r}-${p}-register-click`,"data-testid":"in-card-button",children:o||a.formatMessage({id:`card_cta_${p}${v?`_${i.loading?"loading":"done"}`:""}`})})})}return null};function JE({buildMemberData:e,communitySlug:t}){const n=se.useIntl(),[r,a]=y.useState({count:"...",isMember:!1,memberType:""});return y.useEffect(()=>{e(t).then(i=>{if(!i)return;const{membersCount:s,role:o=""}=i;a({count:s==null?void 0:s.toString(),isMember:!!o,memberType:o})})},[t,e]),d.jsxs("span",{className:"member-information",children:[r.isMember&&d.jsx(Cn,{size:"small",variant:"registered",icon:(r==null?void 0:r.memberType)==="owner"?"user":"tick",children:n.formatMessage({id:`card_member_type_${r.memberType}`})}),d.jsx("span",{className:"label member-count",children:n.formatMessage({id:"card_member_count"},{count:r.count})})]})}const $o=({id:e="",className:t="",buildCardData:n,buildMemberData:r,card:a,cta:i,gtmContext:s="Carousel",handleCardClick:o,setFocus:l=!1})=>{var N,_;const u=se.useIntl(),c=y.useContext(Bt),h=!!(c!=null&&c.id),p=y.useRef(null),[m,g]=y.useState({data:null,isLoading:!0});y.useEffect(()=>{n(a,h).then(F=>{g({data:F,isLoading:!1})}).catch(()=>g(F=>({...F,isLoading:!1})))},[a,h,n]);const{data:f,isLoading:b}=m;if(b||!f)return d.jsx(kt,{element:"li",className:"card-wrapper","data-testid":"card-placeholder"});o&&!i&&(i={text:u.formatMessage({id:`card_cta_${a.contentType}`}),onClick:o});const{contentType:v}=f;if(!v||!Va[v])return d.jsx(kt,{element:"li",className:"card-wrapper"});const{basePath:E="",className:k,length:x,gtmEvent:w}=Va[v];let A=f.slug?`${E}${f.slug}`:!1;f.slug&&(f.slug.slice(0,4)==="http"||f.slug.slice(0,2)==="//"||f.slug.slice(0,6)==="mailto"||f.slug.slice(0,3)==="tel")&&(A=f.slug);const S=F=>{A&&(F.preventDefault(),F.stopPropagation(),window.location.href=A)},W={...GE,...x};let R={className:"card"},I={};return A&&(I={href:A,className:"gtm-trackable","data-gtm-event-context":`${s}-CarouselCard`,"data-gtm-event-type":`${w}-click`,"data-testid":"link"},f.openInNewTab&&(I.target="_blank"),R={onClick:S,className:"card gtm-trackable","data-gtm-event-context":`${s}-CarouselCard`,"data-gtm-event-type":`${w}-click`}),l&&(R={...R,tabIndex:"0"},(N=p==null?void 0:p.current)==null||N.focus(),(_=p==null?void 0:p.current)==null||_.scrollIntoView({behavior:"smooth"})),d.jsx("li",{className:G("card-wrapper text-medium",k,t,{"has-link":A,"no-link":!A,"has-image":f.banner}),"data-testid":`${v}-card`,children:d.jsxs("div",{...R,ref:p,children:[d.jsx(Gc,{className:"card-label",contentType:v,customIcon:f.isPrivate?"lock-locked":f.customIcon,customLabel:f.customLabel}),v==="communityPage"&&(f==null?void 0:f.createdAt)&&Gh(f==null?void 0:f.createdAt,60)&&d.jsx(Cn,{size:"small",variant:"information","data-testid":"new-community",children:u.formatMessage({id:"card_new"})}),f.startDate&&!f.isOngoingEvent&&d.jsx(Cn,{size:"small",variant:f.dateHasPassed?"default":"information","data-testid":"date",children:f.dateHasPassed?u.formatMessage({id:"card_ended"}):Uc(f.startDate)}),f.banner?d.jsxs("p",{className:"img",children:[f.registered&&d.jsx(Cn,{size:"small",variant:"registered",children:u.formatMessage({id:"card_registered"})}),d.jsx(sr,{image:{...f.banner,description:""}})]}):k==="people"?d.jsx(Gt,{name:f.title||"",src:f.profile,"data-testid":"people-profile-picture"}):null,f.contributors&&d.jsx(Ys,{contributors:{data:f.contributors},styling:{size:"small",showGap:k!=="question",showText:!0},multipleText:["event","solutionArticle"].includes(v)?u.formatMessage({id:`card_contributors_${v}`}):void 0,"data-testid":"contributors"}),f.partner&&d.jsx("p",{className:"partners","data-testid":"partners",children:f.partner.length>1?u.formatMessage({id:"card_partner"},{partner:f.partner[0],number:f.partner.length-1}):Gn(f.partner[0],W.partner)}),["title","text","secondaryText"].map(F=>{const j=f[F];if(!j)return null;const $=Ic(F),V={key:F,className:$,"data-testid":$},K={wrapper:"p",forceWrapper:!0,forceInline:!0},Q=Gn(j,W[F]);return["title","text"].includes(F)&&A?(K.wrapper="a",d.jsx("p",{...V,children:d.jsx(It,{options:K,...I,children:Q})})):d.jsx(It,{options:K,...V,children:Q})}),a.contentType==="communityPage"&&a.slug&&r&&d.jsx(JE,{communitySlug:a==null?void 0:a.slug,buildMemberData:r}),d.jsx(YE,{type:k||"",data:f}),d.jsx(QE,{data:f,cta:i,link:A||"",gtmContext:s})]})})};const kh=({cards:e,cardTypes:t,className:n="",...r})=>d.jsx("ul",{className:G("card-block",n),children:e.map((a,i)=>{const s=a.slug?`${a.slug}-${t[i]}`:`${t[i]}-${i}`;return d.jsx($o,{id:s,card:{...a,contentType:t[i]},setFocus:i===(r==null?void 0:r.focusCardIndex),...r},s)})}),XE=(e,t,n,r)=>{const a=t*n<=e,i=e<t*(n+1),s=r.includes(Math.floor(e/t));return a&&i||s},e_=({id:e,title:t})=>{const n=se.useIntl();if(!t||!t.text)return null;const{text:r,element:a="h2",variant:i="default",size:s="medium",link:o}=t;return y.createElement(a,{className:G("title",i,s,{"highlighted-title":i==="highlighted"}),children:d.jsxs(d.Fragment,{children:[r,o&&d.jsx("a",{href:o,className:"text-medium gtm-trackable","data-gtm-event-context":"CarouselViewAll","data-gtm-event-type":`${e||window.btoa(r)}-view-all-click`,children:n.formatMessage({id:"card_carousel_viewAll"})})]})})};const us={fourCards:1024,threeCards:769,twoCards:480};let ha=null;const t_=({id:e,cards:t,cardTypes:n,buildCardData:r,title:a,className:i,gtmContext:s,...o})=>{const l=se.useIntl(),[u,c]=y.useState({cardsPerPage:4,isLoading:!0}),{cardsPerPage:h,isLoading:p}=u,[m,g]=y.useState({currentPage:0,loadedPages:[0]}),{currentPage:f,loadedPages:b}=m,[v,E]=y.useState(""),k=t.length,x=Math.ceil(k/h),w=y.useRef(null),A=rr(!0,!0,w==null?void 0:w.current);y.useEffect(()=>{let _=1;A&&(A>=us.fourCards?_=4:A>=us.threeCards?_=3:A>=us.twoCards&&(_=2),_>k&&(_=k)),c(F=>({...F,cardsPerPage:_,isLoading:!1}))},[A,k]);const S=(_="next")=>{let F=f;if(typeof _=="string")if(_==="next")if(f<x-1)F=f+1;else return;else if(f>0)F=f-1;else return;else F=_;g($=>({...$,currentPage:F,loadedPages:[...new Set([...b,F])]}));const j=()=>{const $=F*u.cardsPerPage,V=$+u.cardsPerPage;return t.slice($,V).length};E(l.formatMessage({id:"carousel_pagination_aria_live"},{direction:_,count:j()}))},W=_=>{ha=_.touches[0].clientX},R=_=>{if(ha===null)return;const F=_.touches[0].clientX,j=ha-F;j>5?S("next"):j<-5&&S("previous"),ha=null},I={"--width":`${A||0}px`,"--total-cards":k,"--cards-per-page":h,"--page":f};if(p)return d.jsx(Zs,{layout:`carousel${a?"-with-title":""}`});const N=(_,F)=>{var $;let j=null;return($=_==null?void 0:_.sys)!=null&&$.id?j=`card-${_.sys.id}`:_!=null&&_.slug?j=`card-${_.slug}`:[n[F],_.contentType].includes("customCard")&&(j=`card-${window.btoa(`${_.title} ${_.createdAt}`)}-${F}`),j};return d.jsxs("section",{ref:w,className:G("carousel-wrapper",i),"data-testid":"carousel",children:[d.jsx(e_,{id:e,title:a}),d.jsx("ul",{className:"carousel",onTouchStart:W,onTouchMove:R,style:I,"data-testid":"carousel-list",children:t.map((_,F)=>{let j=N(_,F);return j&&XE(F,h,f,b)?d.jsx($o,{id:j,card:{..._,contentType:n[F]},buildCardData:r,gtmContext:s,...o},j):(j=j||`${e}-card-${F}`,d.jsx(kt,{element:"li",className:"card-wrapper","data-testid":"card-placeholder"},j))})}),x<=1?null:d.jsxs(d.Fragment,{children:[d.jsxs("ul",{className:"controls","data-testid":"carousel-controls",children:[d.jsx("li",{className:"arrow previous",children:d.jsx(Be,{variant:"secondary",size:"large",icon:{icon:"chevron_left"},onClick:_=>{_.preventDefault(),_.stopPropagation(),S("previous")},screenreaderText:l.formatMessage({id:"carousel_pagination_previous"}),disabled:f<=0})}),[...Array(x)].map((_,F)=>d.jsx("li",{"data-testid":"carousel-controls-button",children:d.jsx("button",{className:G("page-indicator",{selected:F===f}),onClick:j=>{j.preventDefault(),j.stopPropagation(),S(F)},children:d.jsx(Ie,{showOnFocus:!1,children:l.formatMessage({id:"carousel_pagination_page"},{number:F+1,total:x})})})},`page-indicator-${F}`)),d.jsx("li",{className:"arrow next",children:d.jsx(Be,{variant:"secondary",size:"large",icon:{icon:"chevron_right"},onClick:_=>{_.preventDefault(),_.stopPropagation(),S("next")},screenreaderText:l.formatMessage({id:"carousel_pagination_next"}),disabled:f>=x-1})})]}),d.jsx(Ie,{"aria-live":"polite",showOnFocus:!1,children:v})]})]})},n_=({carousels:e=[],isLoading:t,title:n,className:r="",...a})=>!e||!e.length?null:e.map(({title:i,viewAllUrl:s,cards:o,cardsTypes:l},u)=>{const c=i?window.btoa(i):`carousel-${u}`,h=u===e.length-1;return t?d.jsxs(y.Fragment,{children:[d.jsx(Zs,{layout:`carousel${i?"-with-title":""}`,"data-testid":"carousel-placeholder"}),h?null:d.jsx(zt,{})]},`placeholder-${c}`):d.jsxs(y.Fragment,{children:[d.jsx(t_,{cards:o,cardTypes:l,title:n!=null&&n.hidden?{}:{...n,text:i,link:s},...a}),h?null:d.jsx(zt,{})]},`carousel-${c}`)});const r_=({element:e="p",data:{timeLeftToFinish:t,percentageCompleted:{inTime:n=0,inLessons:r=0},shouldShowTimes:a=!0},graph:i,styling:s={},className:o=""})=>{const l=se.useIntl();let u=a?n:r;u>99?u=100:u<1&&(u=0);const{highlightPercentage:c=!1}=s;return y.createElement(e,{className:G("course-progression",o,{"highlight-percentage":c,"has-circle-graph":i==="circle"}),children:d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"percentage",children:l.formatMessage({id:"courseProgression_done"},{percent:h=>d.jsx("strong",{children:h}),number:u})}),u<100&&a&&d.jsx(ui,{time:t,appendedText:l.formatMessage({id:"courseProgression_timeLeft"})}),d.jsx(Ks,{progress:u,styling:{layout:i||"bar",size:i&&i==="circle"?"small":"default"}})]})})};const Bh=({element:e="span",sectionId:t,subsectionId:n,title:r,className:a=""})=>y.createElement(e,{className:G("lesson-name",a),"data-number":`${t}.${n}`,children:r});const Fh=({size:e="default",completionTime:t,icon:n,optional:r,type:a,children:i})=>{const s=se.useIntl(),o=Za(`lessonType_${a}`)?s.formatMessage({id:`lessonType_${a}`}):Lc(a||"");return d.jsxs("small",{className:G("content-type",{[e]:e!=="default"}),children:[d.jsx("span",{className:G("type",n),children:o})," ",t>0&&!r&&d.jsx(ui,{time:t})," ",i?d.jsx("span",{className:"additional",children:i}):null]})};const a_=({course:{articles:e,canAccessCourse:t,description:n,hideTimes:r,isEnrolled:a,sectionId:i,sectionTime:s,slug:o,timeLeft:l,title:u},quizScores:c})=>{const h=se.useIntl(),p="courseStructure_",m=u.toLowerCase().includes("course conclusion");return d.jsxs(Ga,{className:"course-structure",label:d.jsxs(d.Fragment,{children:[d.jsxs("small",{children:[h.formatMessage({id:`${p}section${m?"_end":""}`},{number:i})," ",!r&&s>=0&&d.jsx("span",{className:"time",children:a&&l===0?h.formatMessage({id:`${p}time_completed`}):d.jsx(ui,{time:s,appendedText:a?h.formatMessage({id:`${p}time_left`}):""})})]}),d.jsx("h3",{children:u})]}),shouldAnimate:!0,children:[d.jsx("p",{children:n}),d.jsx("ol",{children:e&&e.length>0&&e.map(({completed:g,completionTime:f,contentType:b,icon:v,image:E,isIntroduction:k,optional:x,slug:w,subsectionId:A,title:S,type:W})=>{const R=a&&t||k,I={};return E&&(I.style={"--image":`url(${E})`}),d.jsx("li",{className:G({article:b===br.ARTICLE,discussion:b===br.DISCUSSION,quiz:b===br.QUIZ,completed:g&&b===br.ARTICLE,locked:!R}),...I,children:d.jsx(jn,{href:R?`/microcourses/en/${o}/${w}`:void 0,fallbackElement:"span",className:"inner",gtmContext:`MicrocourseOutline${$c(S)}`,gtmType:"article-click",children:d.jsxs(d.Fragment,{children:[d.jsx(Bh,{sectionId:i,subsectionId:A,title:S,className:"course-title"})," ",d.jsx(Fh,{completionTime:f,icon:v,optional:x,type:W,children:c&&c[w]&&d.jsx("span",{className:"quiz-score",children:`${c[w]}%`})})]})})},w)})})]})};const i_=({isComplete:e=!1,onClick:t,...n})=>{const r=se.useIntl();return n["data-gtm-event-context"]||(n["data-gtm-event-context"]="LessonIntroduction"),d.jsx(Be,{...n,variant:"tertiary",icon:e?{icon:"check-inside-circle_no-overlap_inverted"}:{icon:"check-inside-circle_no-overlap",hover:"check-inside-circle_no-overlap_inverted"},onClick:t,className:G("mark-complete-button center gtm-trackable",{completed:e}),"data-gtm-event-type":"mark-as-complete",disabled:e,children:r.formatMessage({id:`markCompleteButton${e?"_completed":""}`})})},s_=({id:e,data:{jobTitle:t,name:n,organization:r,thumbnail:a}})=>({id:e,name:n,jobTitle:t,organization:r,image:{thumbnail:a}}),Bc=[{contentType:"solutionArticle",banner:{description:"",url:"//images.ctfassets.net/txbhe1wabmyx/kCcBdXurt3uOKu6NdTPm0/1b6d19179b21f98dbdadf2477c03d267/devin-avery-7gwqj0yyrhm-unsplash.jpg",width:295,height:180,type:"image/jpeg",aspect:"responsiveCard",query:"w=295&h=180&fit=thumb&f=center"},slug:"why-public-servants-must-learn-to-fail",contributors:["community"]},{contentType:"solutionArticle",banner:{description:"",url:"//images.ctfassets.net/txbhe1wabmyx/12Y0W1K0zVcDKzgLZlbfyC/6eb0757a02cbeea19b1b42d7da04d553/ashkan-forouzani-m0l9nbcivuk-unsplash.jpg",width:295,height:180,type:"image/jpeg",aspect:"responsiveCard",query:"w=295&h=180&fit=thumb&f=center"},slug:"organisational-culture-change-and-failure",contributors:[{name:"Mari-Liis",id:"bdb7509c-89ed-4633-8bc0-dbf11f5d9be1"}]},{contentType:"solutionArticle",banner:{description:"",url:"//images.ctfassets.net/txbhe1wabmyx/26TEwu0xVkbQDguuW89fY6/d54ce406cdd652d68979770d526398ab/nik-shuliahin-bunwp1bl0nc-unsplash.jpg",width:295,height:180,type:"image/jpeg",aspect:"responsiveCard",query:"w=295&h=180&fit=thumb&f=center"},slug:"how-to-learn-from-failure-without-causing-a-scandal",contributors:["community"]}];const ma="notFoundError_",o_=()=>{const e=se.useIntl(),t=[];return Bc.forEach((n,r)=>{n.title=e.formatMessage({id:`${ma}post_${r+1}`}),t.push("solutionArticle")}),d.jsxs(ch,{styling:{background:"bold",circle:"small",variant:"alt-2"},additionalContent:{appended:d.jsxs(mn,{children:[d.jsx(kh,{cards:Bc,cardTypes:t,buildCardData:n=>new Promise((r,a)=>{r(n)})}),d.jsx(Be,{href:"/solution-articles/",children:e.formatMessage({id:`${ma}cta`})})]})},reportError:()=>{},className:"not-found-error",children:[d.jsx("h1",{children:e.formatMessage({id:`${ma}title`})}),d.jsx("p",{children:e.formatMessage({id:`${ma}text`})})]})};exports.ASSETS_BUCKET=Lt;exports.ActivitiesFeed=pE;exports.ActivitySection=PE;exports.AddPost=No;exports.Banner=zE;exports.BannerSection=UE;exports.Breadcrumbs=Tp;exports.Buckets=dm;exports.Button=Be;exports.ButtonWrapper=ir;exports.COURSE_CONTENT_TYPES=br;exports.CacheProvider=md;exports.Card=$o;exports.CardBlock=kh;exports.Carousel=n_;exports.CharacterLimit=ao;exports.CollapsibleSection=Ga;exports.Columns=Ed;exports.CommunityDetails=Ap;exports.ContactFooter=Tw;exports.ContactForm=ah;exports.ContentTypeLabel=Gc;exports.Contributors=Ys;exports.ConversationContext=oi;exports.CookieBanner=lh;exports.CourseProgression=r_;exports.CourseStructure=a_;exports.CustomContentBanner=HE;exports.CustomEvents=rt;exports.Directory=RE;exports.DiscussionConversation=dh;exports.DiscussionForm=Wr;exports.DiscussionFormCard=hh;exports.DiscussionFormModal=Eh;exports.DiscussionLikes=fh;exports.DiscussionPost=Ur;exports.DiscussionThread=ph;exports.Divider=zt;exports.DownloadSection=kw;exports.EMAILS=zn;exports.EditSection=Fw;exports.EmailHelperTextBox=kd;exports.EmptyStateBox=cn;exports.FeatureFlags=Xs;exports.Filters=Sp;exports.FlagsProvider=gd;exports.Footer=jo;exports.Form=Qt;exports.Formatting=Y;exports.Fragment=xt;exports.FullWidthSection=mn;exports.GET_STREAM_USER_PREFIX=ds;exports.GlobalProviders=Fp;exports.Header=Oo;exports.HelperTextBox=Jc;exports.HiddenFromScreenReaders=Ka;exports.HideShowTextBox=Xc;exports.HighlightSection=KE;exports.HighlightedTextBox=$t;exports.INVALID_TOKEN=zc;exports.IconBulletedList=mm;exports.ImageContainer=um;exports.IntlProvider=vd;exports.InviteForm=ih;exports.InviteModal=ME;exports.JoinButton=no;exports.LanguageContext=eo;exports.LanguageSwitcher=Op;exports.LessonName=Bh;exports.LessonType=Fh;exports.Link=jn;exports.LoadMore=zr;exports.LoadingBlock=_m;exports.LoadingPlaceholder=kt;exports.LoadingState=Zs;exports.Logo=ro;exports.LogoSection=Aw;exports.MENTION_REGEX=qc;exports.MarkCompleteButton=i_;exports.MarkdownText=En;exports.MarketingBlock=ZE;exports.Marks=Rt;exports.Member=_n;exports.MembersList=Mw;exports.Modal=Gs;exports.MoreMenu=xd;exports.NUMBER_OF_COUNTRIES=Zh;exports.NUMBER_OF_USERS=Kh;exports.NavigationMenu=wd;exports.NotFoundError=o_;exports.Overlay=dn;exports.OverlayContext=to;exports.OverlayProvider=Cd;exports.PageHeading=ed;exports.PageLayout=ch;exports.PasswordForm=yw;exports.PasswordRules=Sd;exports.Pill=Cn;exports.Popover=Yc;exports.Portal=Ya;exports.ProfileForm=sh;exports.ProfileImageChange=rh;exports.ProfileModal=_h;exports.ProfileModalLauncher=Mo;exports.ProfilePicture=Gt;exports.ProgressBar=Ks;exports.ProgressTracker=lm;exports.Rating=Qp;exports.RepliesFeed=wh;exports.ResponsesHeading=mh;exports.ResponsiveImage=sr;exports.ReturnToNavButton=cm;exports.RichTextEditor=nh;exports.SearchForm=oh;exports.ShareLinks=Ip;exports.SignupForm=_w;exports.Span=ps;exports.StatusBanner=Tr;exports.TableOfContents=LE;exports.Tabs=$p;exports.Tags=Nw;exports.TestimonialBlock=$E;exports.TimeToComplete=ui;exports.Toggle=bw;exports.Tooltip=Sn;exports.TopLevelPage=Sw;exports.UUID_V4_REGEX=Ar;exports.UserContext=Bt;exports.UserProvider=bd;exports.VisuallyHidden=Ie;exports.addAriaProps=Dd;exports.basicReducer=Lr;exports.camelCaseToDashCase=Ic;exports.checkIntlPathExists=Za;exports.generateConditions=_a;exports.generateCssIcon=Wc;exports.getCharacterLimitProps=_d;exports.getLongDate=Vs;exports.getMember=Qa;exports.getPostBody=Po;exports.getShortDate=Uc;exports.getValueLength=Xa;exports.headerData=$r;exports.mapGetStreamData=s_;exports.pageReady=Hc;exports.passwordValidator=hs;exports.repliesFeedMock=gE;exports.supportedLanguages=ba;exports.toCamelCase=$c;exports.toCapitalisedCase=Vh;exports.toSentenceCase=Lc;exports.useCurrentPath=jc;exports.useEffectAfterMount=Qn;exports.useElementWidth=rr;exports.useOverlay=yd;exports.useScrollListener=Nc;exports.useScrollToHash=Us;exports.useTooltips=Hs;exports.useUser=Ja;
165
+ `;return a.slice(0,i.length)===i&&(a=a.slice(i.length)),n?await Hc({text:a,template:"[@{{name}}](/profiles/{{id}})",mentions:n,listMembers:r}):a};const zw=3e3,qw=({url:e,gtm:t={context:"ShareLink",event:"copy-link-click"}})=>{const n=oe.useIntl(),[r,a]=C.useState({isOpen:!1,isCopied:!1});return d.jsxs("li",{children:[d.jsx(Sn,{className:Y("tooltip-share-link",{"tooltip-share-link-copied":r.isCopied}),isOpen:r.isOpen,styling:{hasPointer:"bottom",extraPadding:!1},children:r.isCopied?n.formatMessage({id:"discussion_share_copy_link_success"}):n.formatMessage({id:"discussion_share_copy_link"})}),d.jsx(qa,{className:"gtm-trackable",icon:{icon:"link_chain"},onMouseOver:()=>a({...r,isOpen:!0}),onFocus:()=>a({...r,isOpen:!0}),onMouseOut:()=>a({isOpen:!1,isCopied:!1}),onBlur:()=>a({isOpen:!1,isCopied:!1}),onClick:()=>{navigator.clipboard.writeText(e).then(()=>{a({isOpen:!0,isCopied:!0}),setTimeout(()=>{a({isOpen:!1,isCopied:!1})},zw)})},"data-gtm-event-context":t.context,"data-gtm-event-type":t.event})]})},Ht="discussion_",Ww=195;let fa=null;const Ur=({element:e="div",content:t,userHasPermissions:n=!0,isLoading:r=!1,originalAuthorId:a,forceHide:i={actionBar:!1,comments:!1,likes:!1},functions:s,links:o={},className:l,gtmContext:u="DiscussionAnswer",children:c,isTruncated:h=!1,styling:{showShareLinkButton:p=!1}={},setFocus:m=!1,isCommunity:g=!1})=>{var Be,Ae,Ue,Se,Te,Ne,_e,He;const f=oe.useIntl(),b=C.useContext(Tt),v=C.useContext(oi),{createContent:E=async()=>{},deleteContent:k=async()=>{},updateContent:x=async()=>{}}=s.content||{},{createLike:w=()=>{},deleteLike:A=()=>{}}=s.likes||{},{openComments:S=()=>{}}=s.comments||{},{listMembers:q=()=>Promise.resolve([]),clickMentionFallback:$=()=>{}}=s.mentions||{},{author:N,canLike:L,createdAt:_,id:B,likes:j=0,userLiked:I,comments:G=0,mentions:V}=t,Q=b&&b.id&&typeof N!="string"&&N.id&&N.id===b.id||!1,ae=typeof L=="boolean"?L:!0,D=Q&&(!t.createdAt||Kh(t.createdAt,10,"seconds")),M=C.useRef(null),[W,F]=C.useState({title:t&&t.body!==t.title&&t.title||"",body:t&&t.body||"",isEditing:!1,didEdit:t&&t.isEdited||!1,postBody:""}),[T,z]=C.useState(!1),[R,H]=C.useState(D?"highlighted":"default"),[re,X]=C.useState("");C.useEffect(()=>{const ge=M.current;if(!(!ge||R==="default"))return document.addEventListener("discussionFormSubmitted",ne),ge.addEventListener("transitionend",le),()=>{document.removeEventListener("discussionFormSubmitted",ne),ge.removeEventListener("transitionend",le)}},[]),C.useEffect(()=>{F({...W,title:t&&t.title||"",body:t&&t.body||"",didEdit:t&&t.isEdited||!1})},[t.isEdited]),C.useEffect(()=>{(async()=>{const U=await Po(W.body,h,V,q);F({...W,postBody:U})})()},[W.body,V]);const ne=()=>{setTimeout(()=>{H("fading")},1e3)},le=({propertyName:ge})=>{ge==="background-color"&&H(U=>(U==="default"&&(document.removeEventListener("discussionFormSubmitted",ne),M.current&&M.current.removeEventListener("transitionend",le)),U==="fading"?"default":U))};if(r||!t||t.type==="answer"&&(!t.slugs||!t.slugs.question)||W.postBody===""&&t.title==="")return d.jsx(_t,{className:"discussion-card"});const ee=async({title:ge,body:U})=>{ge||(ge=""),U||(U=""),X("");try{if(!ls(ge,W.title)||!ls(U,W.body)){const ie=t.type==="question"?{title:U}:{title:ge,body:U};await x(yc(t.slugs),ie)}F({...W,title:ge,body:U,isEditing:!1,didEdit:!0})}catch{X(`${Ht}form_error`)}},he=()=>{if(v&&v.updateConversation){const ge={showForm:!0},U=t.author;U&&U.id&&(g&&(ge.prepopulateForm=`@{{${U.id}}}`),ge.mentionData={id:U.id,name:U.name}),v.updateConversation(ge)}setTimeout(()=>{var ve,we,Ke;const U=`reply-form-${(t.type==="answer"?t.slug:((ve=t.slugs)==null?void 0:ve.reply)||((we=t.slugs)==null?void 0:we.answer)||((Ke=t.slugs)==null?void 0:Ke.question)||"").toLowerCase().slice(-15)}`,ie=document.getElementById(U),pe=document.getElementById(`${U}-input`);pe&&pe.focus(),ie&&ie.scrollIntoView({behavior:"smooth"})},0)},me=async()=>{z(!1);try{await k(yc(t.slugs))}catch{X("delete-error")}},ye=[{text:f.formatMessage({id:`${Ht}moreMenu_report`}),onClick:ge=>{ge.stopPropagation()},href:`mailto:community@apolitical.co?subject=${encodeURI(f.formatMessage({id:`${Ht}report_subject`}))}&body=${encodeURI(f.formatMessage({id:`${Ht}report_body`},{contentType:t.type||"",contentSlug:t.slug||"",contentUrl:`${window.origin}${typeof process<"u"&&process.env.PUBLIC_URL||""}/${t.slugs.question||""}`}))}`,icon:"flag"}];return n&&Q&&ye.push({text:f.formatMessage({id:`${Ht}moreMenu_edit`}),onClick:()=>F({...W,isEditing:!0}),icon:"pencil-paper",className:"gtm-trackable","data-gtm-event-context":u,"data-gtm-event-type":`edit-${t.type}-click`},{text:f.formatMessage({id:`${Ht}moreMenu_delete`}),onClick:ge=>{ge.preventDefault(),ge.stopPropagation(),z(!0)},icon:"trash",className:"gtm-trackable","data-gtm-event-context":u,"data-gtm-event-type":`delete-${t.type}-click`,...Cd(`delete-${t.slug}-modal`,T)}),m&&((Be=M==null?void 0:M.current)==null||Be.focus(),(Ae=M==null?void 0:M.current)==null||Ae.scrollIntoView({behavior:"smooth"})),C.createElement(e,{className:Y("discussion-post",l,{[R]:!l||!l.includes("highlighted-text-box"),"has-link":o.post&&!W.isEditing}),ref:M,tabIndex:m?0:null,"data-testid":`discussion-${t.type}-thread`,"data-gtm-event-context":`${u}-post-click`,onClick:ge=>{if(!o.post||W.isEditing)return;ge.preventDefault(),ge.stopPropagation(),fa&&clearTimeout(fa),fa=setTimeout(()=>{window.location.href=o.post},150);const U=new CustomEvent(Nt.DISCUSSION_POST_CLICKED,{detail:{link:o.post,timeout:fa}});document.dispatchEvent(U)},children:d.jsxs(d.Fragment,{children:[d.jsxs("div",{id:B||t.slug,className:Y("discussion-card",t.type,{editing:W.isEditing,"has-link":o.post&&!W.isEditing}),children:[!W.isEditing&&d.jsx(_n,{member:N,additionalContent:{createdAt:_,didEdit:W.didEdit},className:typeof N!="string"&&N.id===a?"highlighted":"",gtmContext:u,gtmType:"profile-click"}),W.isEditing?d.jsx(Wr,{id:`editing-${t.slug}`,content:{type:t.type,slugs:t.slugs},userHasPermissions:n,meta:{isLoading:r,isInWrapper:!0,hasTitleField:W.title!==""?{text:W.title}:!1,isEditing:{text:W.body},isPrepopulated:!1},isCommunity:g,maxLength:t.type==="question"?250:5e4,forceShow:{error:re!==""&&re!=="delete-error"?f.formatMessage({id:re},{action:f.formatMessage({id:`discussion_action_${t.type}`})}):!1},functions:{create:E,handleSaveEdit:ee,handleCancel:()=>{X(""),F({...W,isEditing:!1})},listMembers:q,clickMentionFallback:$},gtmContext:`${u}Form`,data:{mentions:t.mentions}}):o.post?d.jsxs("a",{href:o.post,children:[(W==null?void 0:W.title)&&d.jsx("p",{className:"content-title",children:W==null?void 0:W.title}),W.postBody.length>Ww?d.jsx(Jc,{text:W.postBody,markdownOptions:{overrides:{a:ps,blockquote:{component:is}}}}):d.jsx(En,{options:{overrides:{a:ps,blockquote:{component:is}}},children:W.postBody})]}):d.jsxs(d.Fragment,{children:[(W==null?void 0:W.title)&&d.jsx("p",{className:"content-title",children:W==null?void 0:W.title}),d.jsx(En,{options:{wrapper:t.type==="question"?"h1":C.Fragment,forceWrapper:t.type==="question",forceInline:t.type==="question",forceBlock:t.type!=="question",overrides:{blockquote:{component:is}}},children:W.postBody})]}),!W.isEditing&&!(i!=null&&i.actionBar)&&d.jsxs("ul",{className:Y("actions text-medium",t.type),"data-testid":`${t.type}-actions`,children:[!i.likes&&d.jsx(dh,{element:"li",likes:j,isShort:!1,userLiked:I,content:{type:t.type,slugs:t.slugs,slug:t.slug},canLike:ae,peopleWhoLiked:t.peopleWhoLiked,functions:{createLike:w,deleteLike:A}}),!i.comments&&(["question","post"].includes(t.type)||o.comments)&&d.jsx("li",{children:d.jsx(qa,{onClick:ge=>{ge.preventDefault(),ge.stopPropagation(),o.comments&&(window.location.href=o.comments),typeof S=="function"&&S()},icon:{icon:"speech-bubble_square"},"data-gtm-event-context":u,"data-gtm-event-type":`answer-${t.type}-click`,screenreaderText:f.formatMessage({id:`${Ht}comments_screenReader`},{count:G}),children:f.formatMessage({id:`${Ht}comments`},{count:G})})}),(t.type==="answer"||t.type==="reply")&&d.jsx("li",{children:d.jsx(qa,{styling:{muted:!0},onClick:he,icon:{icon:"speech-bubble_square"},children:f.formatMessage({id:`${Ht}reply`})})}),p&&d.jsx(qw,{url:(Ue=t.slugs)!=null&&Ue.reply?`${window.location.origin}${(Se=t.slugs)==null?void 0:Se.question}/${(Te=t.slugs)==null?void 0:Te.answer}#${(Ne=t.slugs)==null?void 0:Ne.reply}`:`${window.location.origin}${(_e=t.slugs)==null?void 0:_e.question}/${(He=t.slugs)==null?void 0:He.answer}`,gtm:{context:u,event:`copy-link-${t.type}-click`}}),d.jsx(Dd,{element:"li",id:`more-${t.slug}`,options:ye})]})]}),c,d.jsx(dn,{id:`delete-${t.slug}-modal`,isOpen:T,functions:{onOpen:()=>{},onClose:()=>z(!1)},forceShow:{error:re==="delete-error"?f.formatMessage({id:"discussion_delete_error"},{action:f.formatMessage({id:`discussion_action_${t.type}`})}):!1},title:f.formatMessage({id:"discussion_delete_title"},{action:f.formatMessage({id:`discussion_action_${t.type}`})}),buttons:[{variant:"secondary",onClick:()=>z(!1),children:f.formatMessage({id:"discussion_delete_cancel"})},{variant:"primary",className:"destructive",onClick:me,children:f.formatMessage({id:"discussion_delete_delete"})}],gtmContext:`${t.type.charAt(0).toUpperCase()}${t.type.slice(1)}:${t.slug}`,children:d.jsx(oe.FormattedMessage,{id:"discussion_delete_text",values:{p:ge=>d.jsx("p",{children:ge}),action:f.formatMessage({id:`discussion_action_${t.type}`})}})})]})})};const Uw=C.lazy(()=>Promise.resolve().then(()=>jE)),Hw=65,fh=({forceShow:e,form:t,className:n})=>{const r=oe.useIntl(),a="discussionFormCard_",i="DiscardDraftModal",o=C.useContext(Tt)||"community",l=Qa(o);l.name||(l.name=r.formatMessage({id:`member_${typeof o=="string"?o:"community"}`}));const{modal:u=!1}=e||{},[c,h]=C.useState({form:u||Kc("showPost")==="true"||!1,warning:!1}),[p,m]=C.useState({showCachedText:!1});C.useEffect(()=>{if(!p.showCachedText)return;(async()=>{const v=await Po(p.title||p.body||"",Hw,p.mentions);m(E=>({...E,prettifiedText:v}))})()},[p.showCachedText,p.title,p.body]);const g=b=>{if(!p.showCachedText||typeof c.warning=="string")return;let v;if("detail"in b&&b.detail.link)b.detail.timeout&&clearTimeout(b.detail.timeout),v=b.detail.link;else{const E=b;E.preventDefault(),E.stopPropagation();const x=E.target.closest("a");v=x&&x.getAttribute("href")}h(E=>({...E,warning:v||!1}))};C.useEffect(()=>{if(!p.showCachedText){document.removeEventListener(Nt.DISCUSSION_POST_CLICKED,g),document.removeEventListener(Nt.MEMBER_CLICKED,g),document.removeEventListener("click",g);return}return document.addEventListener(Nt.DISCUSSION_POST_CLICKED,g),document.addEventListener(Nt.MEMBER_CLICKED,g),document.addEventListener("click",g),()=>{document.removeEventListener(Nt.DISCUSSION_POST_CLICKED,g),document.removeEventListener(Nt.MEMBER_CLICKED,g),document.removeEventListener("click",g)}},[p.showCachedText]),C.useEffect(()=>{const b=v=>{if(!(!p.showCachedText||c.warning!==!1))return v.preventDefault(),v.returnValue=""};return window.addEventListener("beforeunload",b,{capture:!0}),()=>{window.removeEventListener("beforeunload",b,{capture:!0})}},[p.showCachedText,c.warning]);let f=r.formatMessage({id:`${a}placeholder`});return p.showCachedText&&(p.title||p.body)&&(f=p.prettifiedText||f),d.jsxs(d.Fragment,{children:[d.jsxs("button",{className:Y("discussion-form-card",n),onClick:b=>{b.preventDefault(),b.stopPropagation(),h(v=>({...v,form:!0}))},"data-testid":"discussion-form-card",children:[d.jsx(Gt,{name:l.name,src:l.image,alt:""}),d.jsx(En,{className:Y("input",{placeholder:!p.showCachedText}),element:"span",options:{forceInline:!0,overrides:{a:Dt,blockquote:Dt,br:Dt,em:Dt,li:Dt,ol:Dt,p:Dt,s:Dt,span:Dt,strong:Dt,ul:Dt}},children:f})]}),d.jsxs(Ya,{children:[d.jsx(Uw,{showModal:c.form,functions:{cacheText:m,onClose:()=>{h(b=>({...b,form:!1}))}},form:t,cachedText:p,className:"in-portal"}),d.jsx(dn,{id:t.id?`${t.id}-warning`:"discussion-form-card-warning",className:"in-portal",isOpen:c.warning!==!1,functions:{onClose:()=>{h(b=>({...b,warning:!1}))}},title:r.formatMessage({id:`${a}overlay_title`}),buttons:[{variant:"secondary",children:r.formatMessage({id:`${a}overlay_cta_discard`}),onClick:b=>{b.preventDefault(),b.stopPropagation(),typeof c.warning=="string"&&(window.location.href=c.warning)},"data-gtm-event-type":"discard-click","data-gtm-event-context":i},{variant:"primary",children:r.formatMessage({id:`${a}overlay_cta_continue`}),onClick:()=>{h({form:!0,warning:!1})},"data-gtm-event-type":"continue-editing-click","data-gtm-event-context":i}],children:d.jsx("p",{children:r.formatMessage({id:`${a}overlay_text`})})})]})]})},Vw=C.lazy(()=>Promise.resolve().then(()=>Mw)),No=({isCard:e=!1,form:t,membershipRequiredToPost:{isMember:n,required:r,join:a,leave:i,notMemberStateText:s}})=>{if(r&&!n)return d.jsx(cn,{text:s,button:{breakpoints:{mobile:!0,901:!1},component:d.jsx(no,{isShort:!0,functions:{join:a,leave:i}})}});const{content:o,functions:l,meta:u,...c}=t,h={content:{type:(o==null?void 0:o.type)||"reply",slugs:(o==null?void 0:o.slugs)||{}},functions:{...l,create:(l==null?void 0:l.create)||(()=>{})},meta:{...u,isEditing:(u==null?void 0:u.isEditing)||!1,isPrepopulated:!1,showSuccessMessage:!1},...c,id:`add-post-${c.id||""}`};return e?d.jsx(fh,{form:h}):d.jsx(Vw,{...h})};const ss="discussion_responses_",hh=({type:e="answer",responses:t=0,isLoading:n=!1})=>{const r=oe.useIntl();return t=parseInt(t),d.jsxs("div",{className:"responses-heading",children:[d.jsx("h4",{children:r.formatMessage({id:`${ss}title`},{action:r.formatMessage({id:`${ss}${e}`}),count:t})}),!n&&t===0&&d.jsx("p",{children:Ft(r.formatMessage,`${ss}empty`,e,e)})]})};const mh=({loadMore:{isLoading:e,hasNextPage:t,loadNextPage:n}={isLoading:!1,hasNextPage:!1,loadNextPage:()=>{}},form:r,children:a})=>{const i=oe.useIntl(),s=C.useContext(oi),o=ga(a,{element:"li"});if(s.prepopulateForm&&(r!=null&&r.meta)&&(r.meta.isPrepopulated={text:s.prepopulateForm},s.mentionData)){const l=r.data||{};l.mentions||(l.mentions={});const u=s.mentionData.id||"1";l.mentions[u]={created_at:"",updated_at:"",id:u,data:s.mentionData},r.data=l,r.meta.isAutoFocused=!0}return d.jsxs("div",{className:Y("thread-wrapper",{"empty-thread":!o}),children:[!Object.is(o,null)&&d.jsx("ul",{className:"thread",children:o}),!e&&d.jsx(zr,{hasNextPage:t,loadNextPage:n,size:"small",styling:{muted:!0},icon:{icon:"arrow_corner-down_right",position:"left"},messages:{button:i.formatMessage({id:"discussion_thread_loadMore"}),error:i.formatMessage({id:"loadMore_error"})}}),r&&s.showForm&&d.jsx(Wr,{...r})]})},Kw="post",Zw="reply",ph="00000000-0000-0000-0000-000000000000";function Ro({queryClient:e,queryKey:t}){function n(r,a,i){e.setQueryData(t,i)}return n}function Mo({queryClient:e,queryKey:t}){async function n(r){await e.cancelQueries({queryKey:t});const a=e.getQueryData(t);return e.setQueryData(t,r),a}return n}function Yw(){return{latest_reactions:{like:[],reply:[]},reaction_counts:{like:0,reply:0},own_reactions:{like:[],reply:[]}}}function Gw(){return{latest_children:{like:[],reply:[]},children_counts:{like:0,reply:0},own_children:{like:[],reply:[]}}}function gh(e){const{id:t="",name:n="",organization:r="",jobTitle:a="",image:i={}}=e,{thumbnail:s=""}=i;return{id:t,data:{name:n,organization:r,jobTitle:a,thumbnail:s}}}function Qw({title:e,content:t}){return{title:e,content:t,id:ph,time:new Date().toISOString(),verb:Kw}}function Cc({activity:e,user:t}){return{...e,actor:gh(t),...Yw()}}function Wa({activity:e,reaction:t}){var n,r,a;t?(e.latest_reactions={...e.latest_reactions||{},like:[...((r=e.latest_reactions)==null?void 0:r.like)||[],t]},e.own_reactions={...e.own_reactions||{},like:[...((a=e.own_reactions)==null?void 0:a.like)||[],t]}):e.reaction_counts={...e.reaction_counts||{},like:(n=e.reaction_counts)!=null&&n.like?e.reaction_counts.like+1:1}}function vh({activity:e,user:t}){var n,r,a;e.reaction_counts={...e.reaction_counts||{},like:(n=e.reaction_counts)!=null&&n.like?e.reaction_counts.like-1:0},t!=null&&t.id&&(e.latest_reactions={...e.latest_reactions||{},like:(((r=e.latest_reactions)==null?void 0:r.like)||[]).filter(({user_id:i})=>i!==t.id)},e.own_reactions={...e.own_reactions||{},like:(((a=e.own_reactions)==null?void 0:a.like)||[]).filter(({user_id:i})=>i!==t.id)})}function Jw({activityId:e,replyId:t,content:n}){return{activity_id:e,data:{content:n},id:ph,kind:Zw,parent:t||""}}function Dc({reply:e,user:t}){const n=gh(t);return{...e,user_id:n.id,user:n,...Gw()}}function xc({reply:e,reaction:t}){var n,r,a;t?(e.latest_children={...e.latest_children||{},like:[...((r=e.latest_children)==null?void 0:r.like)||[],t]},e.own_children={...e.own_children||{},like:[...((a=e.own_children)==null?void 0:a.like)||[],t]}):e.children_counts={...e.children_counts||{},like:(n=e.children_counts)!=null&&n.like?e.children_counts.like+1:1}}function Xw({reply:e,user:t}){var n,r,a;e.children_counts={...e.children_counts||{},like:(n=e.children_counts)!=null&&n.like?e.children_counts.like-1:0},t!=null&&t.id&&(e.latest_children={...e.latest_children||{},like:(((r=e.latest_children)==null?void 0:r.like)||[]).filter(({user_id:i})=>i!==t.id)},e.own_children={...e.own_children||{},like:(((a=e.own_children)==null?void 0:a.like)||[]).filter(({user_id:i})=>i!==t.id)})}const bh=e=>{const t=new CustomEvent("discussionPostAdded",{detail:e});document.dispatchEvent(t)};let wc,os=0;const yh=()=>{C.useEffect(()=>(document.addEventListener("discussionPostAdded",e),()=>{document.removeEventListener("discussionPostAdded",e)}),[]);const e=t=>{const n=t.detail;if(!n)return;clearTimeout(wc);const r=document.getElementById(n);if(r){r.scrollIntoView({behavior:"smooth",block:"start"}),os=0;return}os++,!(os>10)&&(wc=setTimeout(()=>{e(t)},50))}},nr=Object.freeze({id:"some-user-id-1",name:"some user name 1",organization:"some user organization 1",jobTitle:"some user job title 1",image:{thumbnail:"https://some-user-thumbnail.com/avatar1.png"},isLoading:!1}),ln=Object.freeze({id:"some-user-id-2",name:"some user name 2",organization:"some user organization 2",jobTitle:"some user job title 2",image:{thumbnail:"https://some-user-thumbnail.com/avatar2.png"},isLoading:!1}),Ch=Object.freeze({actor:`SU:${nr.id}`,content:"some content 1",duration:"5.53ms",feed_id:"some-feed-id-1",foreign_id:"post:some-foriegn-id-1",id:"some-activity-id-1",object:"comment",time:"2023-11-24T17:52:36.162000",verb:"post"}),eE=Object.freeze({actor:`SU:${ln.id}`,content:"some content 2",duration:"5.53ms",feed_id:"some-feed-id-2",foreign_id:"post:some-foriegn-id-2",id:"some-activity-id-2",object:"comment",time:"2023-11-24T17:54:36.162000",verb:"post"}),tE=Object.freeze({actor:`SU:${nr.id}`,content:"some content 3",duration:"5.53ms",feed_id:"some-feed-id-3",foreign_id:"post:some-foriegn-id-3",id:"some-activity-id-3",object:"comment",time:"2023-11-24T17:56:36.162000",verb:"post"}),nE=Object.freeze({actor:`SU:${ln.id}`,content:"some content 4",duration:"5.53ms",feed_id:"some-feed-id-4",foreign_id:"post:some-foriegn-id-4",id:"some-activity-id-4",object:"comment",time:"2023-11-24T17:54:36.162000",verb:"post"});Object.freeze({id:"some-reaction-id-1",activity_id:Ch.id,kind:"like",created_at:"2023-11-24T17:58:36.162000",data:{},parent:"",updated_at:"2023-11-24T17:58:36.162000",user_id:ln.id,children_counts:{},latest_children:{},latest_children_extra:{},own_children:{},user:{id:ln.id,data:{},created_at:"2023-11-24T17:58:36.162000",updated_at:"2023-11-24T17:58:36.162000"}});Object.freeze({created_at:"2023-12-03T21:53:45.999851Z",updated_at:"2023-12-03T21:53:45.999851Z",id:"some-reply-id-1",user_id:ln.id,user:{id:ln.id,data:{},created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z"},kind:"reply",activity_id:Ch.id,data:{content:"Some content 1..."},parent:"",latest_children:{},children_counts:{}});Object.freeze({created_at:"2023-12-03T21:53:45.999851Z",updated_at:"2023-12-03T21:53:45.999851Z",id:"some-reply-id-2",user_id:nr.id,user:{id:nr.id,data:{},created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z"},kind:"reply",activity_id:eE.id,data:{content:"Some content 2..."},parent:"",latest_children:{},children_counts:{}});Object.freeze({created_at:"2023-12-03T21:53:45.999851Z",updated_at:"2023-12-03T21:53:45.999851Z",id:"some-reply-id-3",user_id:ln.id,user:{id:ln.id,data:{},created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z"},kind:"reply",activity_id:tE.id,data:{content:"Some content 3..."},parent:"",latest_children:{},children_counts:{}});Object.freeze({created_at:"2023-12-03T21:53:45.999851Z",updated_at:"2023-12-03T21:53:45.999851Z",id:"some-reply-id-3",user_id:nr.id,user:{id:nr.id,data:{},created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z"},kind:"reply",activity_id:nE.id,data:{content:"Some content 4..."},parent:"",latest_children:{},children_counts:{}});function rE({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:a,user:i}){const{mutate:s}=Ye.useMutation({mutationFn:e,onMutate:o=>t(l=>{const u=Cc({activity:Qw(o),user:i});return Ec(u,l)}),onError:n,onSuccess:(o,l,u)=>{const c=Cc({activity:o,user:i});r.setQueryData(a,Ec(c,u,!0)),setTimeout(()=>{bh(c.id)},0)}});return s}function aE({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=Ye.useMutation({mutationFn:e,onMutate:({activityId:a,content:i})=>t(s=>{const o=Ua(a,s);return o&&(o.content=i),s}),onError:n});return r}function iE({queryFns:{create:e,edit:t,like:n,list:r,remove:a,unlike:i},queryKey:s,rankingMethod:o}){const l=Ye.useQueryClient(),u=Ja(),c={queryClient:l,queryKey:s},h={mutationHandlers:{error:Ro(c),mutate:Mo(c)},user:u,...c},p=rE({...h,mutationFn:e}),m=aE({...h,mutationFn:t}),g=sE({...h,mutationFn:n}),f=uE({...h,mutationFn:a}),b=lE({...h,mutationFn:i}),{activities:v,...E}=oE({queryKey:s,queryFn:r,rankingMethod:o});return{activities:v,mutations:{create:p,edit:m,remove:f,like:g,unlike:b},user:u,...E}}function sE({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:a}){const{mutate:i}=Ye.useMutation({mutationFn:e,onMutate:({activityId:s})=>t(o=>{const l=Ua(s,o);return l&&Wa({activity:l}),o}),onError:n,onSuccess:(s,{activityId:o},l)=>{const u=Ua(o,l);u&&Wa({activity:u,reaction:s}),r.setQueryData(a,l)}});return i}function oE({queryFn:e,queryKey:t,rankingMethod:n}){const{data:r,error:a,isLoading:i,hasNextPage:s,fetchNextPage:o}=Ye.useInfiniteQuery({queryKey:t,queryFn:e,initialPageParam:`ranking=${n}`,getNextPageParam:l=>l!=null&&l.next?`${l==null?void 0:l.next}&ranking=${n}`:null});return{activities:dE(r),error:a,isLoading:i,hasNextPage:s,fetchNextPage:o}}function uE({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=Ye.useMutation({mutationFn:e,onMutate:({activityId:a})=>t(i=>cE(a,i)),onError:n});return r}function lE({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:a}=Ye.useMutation({mutationFn:e,onMutate:({activityId:i})=>t(s=>{const o=Ua(i,s);return o&&vh({activity:o,user:r}),s}),onError:n});return a}function Ec(e,t,n=!1){return t?(n?t.pages[0].results[0]=e:t.pages[0].results=[e,...t.pages[0].results],t):{pages:[{next:"",results:[e]}],pageParams:[""]}}function Ua(e,t){if(t)for(const{results:n}of t.pages){const r=n.find(({id:a})=>a===e);if(r)return r}}function cE(e,t){for(const{results:n}of t.pages){const r=n.findIndex(({id:a})=>a===e);if(r!==-1){n.splice(r,1);break}}return t}function dE(e){var t;return((t=e==null?void 0:e.pages)==null?void 0:t.reduce((n,{results:r})=>[...n,...r],[]))||[]}const fE=({basePath:e,parentId:t,isMember:n,functions:{activities:r,mentions:a,join:i,leave:s}})=>{const o=Ep(Xs.COMMUNITY_RANKING),l=oe.useIntl(),[u,c]=C.useState("recent"),[h,p]=C.useState([{id:"recent",label:"recent"},{id:"community_feed_live",label:"popular"}]),{activities:m,error:g,fetchNextPage:f,hasNextPage:b,isLoading:v,mutations:{create:E,edit:k,remove:x,like:w,unlike:A}}=iE({queryKey:[e,t,"activities",u],queryFns:r,rankingMethod:u});C.useEffect(()=>{o&&p(h.concat(o))},[o]);const[S,q]=C.useState(null),$=()=>{q(m.length),f()};return yh(),g?d.jsx(cn,{variant:"error",text:g.message}):d.jsxs("section",{children:[d.jsx(No,{isCard:!0,form:{content:{type:"post",slugs:{}},functions:{create:E,...a},meta:{isEditing:!1,isAutoFocused:!1,isPrepopulated:!1,showSuccessMessage:!1}},membershipRequiredToPost:{isMember:n,required:!0,join:i,leave:s,notMemberStateText:l.formatMessage({id:"community_joinToPost"})}}),d.jsx(Qt,{className:"activities-feed-sorting-form",fields:[{id:"feed-sorting",label:l.formatMessage({id:"activitiesFeed_sorting_label"}),type:"select",options:h.map(({id:N,label:L})=>({id:N,label:l.formatMessage({id:`activitiesFeed_rankingMethod_${L}`})})),initialValue:u,functions:{onChange:N=>c(N)},gtm:{context:"Community Sorting",event:"community-sorting-click"}}],button:{hideButton:!0},functions:{onCatch:()=>{},onFailure:()=>{},onSuccess:async()=>{},onCancel:()=>{}},id:"activities-feed-sorting-form"}),m==null?void 0:m.map((N,L)=>{var W,F,T,z,R,H,re,X;const{id:_,own_reactions:B,latest_reactions:j,reaction_counts:I,mentioned_users:G}=N,V=(((W=j==null?void 0:j.like)==null?void 0:W.length)||0)>0,Q=(((F=B==null?void 0:B.like)==null?void 0:F.length)||0)>0,ae=Q?B==null?void 0:B.like[0].id:"",D=V?(T=j==null?void 0:j.like)==null?void 0:T.map(ne=>{var le,ee,he;return{id:(le=ne==null?void 0:ne.user)==null?void 0:le.id,name:(he=(ee=ne==null?void 0:ne.user)==null?void 0:ee.data)==null?void 0:he.name}}):!1,M=N==null?void 0:N.actor;return d.jsx(C.Fragment,{children:d.jsx(Ur,{content:{type:"post",title:N==null?void 0:N.title,body:N==null?void 0:N.content,canLike:n,createdAt:(N==null?void 0:N.time)||"",slugs:{question:`${e}/${t}`,answer:_},slug:_,author:{id:M==null?void 0:M.id,name:(z=M==null?void 0:M.data)==null?void 0:z.name,organization:(R=M==null?void 0:M.data)==null?void 0:R.organization,jobTitle:(H=M==null?void 0:M.data)==null?void 0:H.jobTitle,location:(re=M==null?void 0:M.data)==null?void 0:re.location,image:{thumbnail:((X=M==null?void 0:M.data)==null?void 0:X.thumbnail)||void 0}},userLiked:Q,likes:(I==null?void 0:I.like)||0,comments:(I==null?void 0:I.reply)||0,peopleWhoLiked:D,mentions:G},links:{post:`${e}/${t}/${_}`,comments:`${e}/${t}/${_}`},gtmContext:"community",functions:{content:{createContent:()=>null,deleteContent:()=>x({activityId:_}),updateContent:(ne,{body:le})=>k({activityId:_,content:le})},likes:{createLike:()=>w({activityId:_}),deleteLike:()=>A({activityId:_,reactionId:ae})},comments:{openComments:()=>null},mentions:a},isTruncated:!0,styling:{showShareLinkButton:!0},setFocus:L===S})},_)}),!v&&d.jsx(zr,{hasNextPage:b,loadNextPage:$,icon:{icon:"arrow-down",position:"right"},messages:{button:l.formatMessage({id:"loadMore_button"}),error:l.formatMessage({id:"loadMore_error"})}})]})},hE={next:"id_lt=67ef0342-6f6e-4807-beea-5a9184ec140c&limit=5",results:[{created_at:"2023-12-03T18:47:44.081716Z",updated_at:"2023-12-03T18:47:44.081716Z",id:"256b921e-ffe6-410d-b754-ac1aaee989ce",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 17..."},parent:"",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:02.517688Z",updated_at:"2023-12-03T18:47:24.852582Z",id:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 16 (edited)..."},parent:"",latest_children:{reply:[{created_at:"2023-12-03T19:28:09.799652Z",updated_at:"2023-12-03T19:28:09.799652Z",id:"bf1ec451-e7c3-4ebe-a60e-248b0ec2a671",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 3..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:59.756761Z",updated_at:"2023-12-03T19:27:59.756761Z",id:"7887d921-e2ba-48ef-8089-db24536dbf70",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 2..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:46.534650Z",updated_at:"2023-12-03T19:27:46.534650Z",id:"73f5bdf3-7080-48ac-a8dc-185f71b38b42",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 1..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}}]},own_children:{reply:[{created_at:"2023-12-03T19:28:09.799652Z",updated_at:"2023-12-03T19:28:09.799652Z",id:"bf1ec451-e7c3-4ebe-a60e-248b0ec2a671",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 3..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:59.756761Z",updated_at:"2023-12-03T19:27:59.756761Z",id:"7887d921-e2ba-48ef-8089-db24536dbf70",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 2..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:46.534650Z",updated_at:"2023-12-03T19:27:46.534650Z",id:"73f5bdf3-7080-48ac-a8dc-185f71b38b42",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 1..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}}]},children_counts:{reply:3}},{created_at:"2023-12-03T17:47:45.107092Z",updated_at:"2023-12-03T17:47:45.107092Z",id:"27a59e8f-f094-442f-88ec-1d5ec2f72790",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 14..."},parent:"",latest_children:{reply:[{created_at:"2023-12-03T18:47:10.603929Z",updated_at:"2023-12-03T18:47:10.603929Z",id:"c32b83d5-c5fc-4253-8531-eb99dcb01f28",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 8..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:47:04.856649Z",updated_at:"2023-12-03T18:47:04.856649Z",id:"5efd80e3-cb11-4748-8c64-f46b71df69c4",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 7..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:22.687552Z",updated_at:"2023-12-03T18:36:22.687552Z",id:"a3a2ebae-6df2-4dc0-beee-2296188b67aa",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 6..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:16.129336Z",updated_at:"2023-12-03T18:36:16.129336Z",id:"72948da5-bf3c-4bd5-9a21-2cee36e0ce8a",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 5..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:40.850756Z",updated_at:"2023-12-03T17:56:40.850756Z",id:"81ebc855-d1f6-4a2c-a788-a251bae406b6",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 4..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:34.103420Z",updated_at:"2023-12-03T17:56:34.103420Z",id:"ddc28de7-4e89-4572-8122-c95dceacc2fd",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 3..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:26.410145Z",updated_at:"2023-12-03T17:56:26.410145Z",id:"916ed4b6-ad87-47bc-9e00-7b0c46180276",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 2..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:19.921740Z",updated_at:"2023-12-03T17:56:19.921740Z",id:"92cddcb2-cbdc-4e69-9c8e-5afe3a607411",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 1..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}}]},own_children:{reply:[{created_at:"2023-12-03T18:47:10.603929Z",updated_at:"2023-12-03T18:47:10.603929Z",id:"c32b83d5-c5fc-4253-8531-eb99dcb01f28",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 8..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:47:04.856649Z",updated_at:"2023-12-03T18:47:04.856649Z",id:"5efd80e3-cb11-4748-8c64-f46b71df69c4",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 7..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:22.687552Z",updated_at:"2023-12-03T18:36:22.687552Z",id:"a3a2ebae-6df2-4dc0-beee-2296188b67aa",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 6..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:16.129336Z",updated_at:"2023-12-03T18:36:16.129336Z",id:"72948da5-bf3c-4bd5-9a21-2cee36e0ce8a",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 5..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:40.850756Z",updated_at:"2023-12-03T17:56:40.850756Z",id:"81ebc855-d1f6-4a2c-a788-a251bae406b6",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 4..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}}]},children_counts:{reply:8}},{created_at:"2023-12-03T17:47:40.066170Z",updated_at:"2023-12-03T17:47:40.066170Z",id:"9ed6a1d0-00b5-4a03-94d7-ac01e188e2e2",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 13..."},parent:"",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:47:33.107894Z",updated_at:"2023-12-03T17:47:33.107894Z",id:"67ef0342-6f6e-4807-beea-5a9184ec140c",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 12..."},parent:"",latest_children:{},children_counts:{}}],duration:"6.48ms"};function mE({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:a,user:i}){const{mutate:s}=Ye.useMutation({mutationFn:e,onMutate:o=>t(l=>{const u=Dc({reply:Jw(o),user:i});return _c(u,l,{replace:!1,append:(o==null?void 0:o.replyId)!==void 0})}),onError:n,onSuccess:(o,l,u)=>{const c=Dc({reply:o,user:i});r.setQueryData(a,_c(c,u,{replace:!0,append:(l==null?void 0:l.replyId)!==void 0})),setTimeout(()=>{bh(c.id)},0)}});return s}function pE({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=Ye.useMutation({mutationFn:e,onMutate:({replyId:a,content:i})=>t(s=>{const o=Ha(a,s);return o&&(o.data.content=i),s}),onError:n});return r}function Dh({queryFns:{create:e,edit:t,like:n,list:r,remove:a,unlike:i},queryKey:s}){const o=Ye.useQueryClient(),l=Ja(),u={queryClient:o,queryKey:s},c={mutationHandlers:{error:Ro(u),mutate:Mo(u)},user:l,...u},h=mE({...c,mutationFn:e}),p=pE({...c,mutationFn:t}),m=gE({...c,mutationFn:n}),g=bE({...c,mutationFn:a}),f=yE({...c,mutationFn:i}),{replies:b,...v}=vE({queryKey:s,queryFn:r});return{replies:b,mutations:{create:h,edit:p,remove:g,like:m,unlike:f},user:l,...v}}function gE({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:a}){const{mutate:i}=Ye.useMutation({mutationFn:e,onMutate:({replyId:s})=>t(o=>{const l=Ha(s,o);return l&&xc({reply:l}),o}),onError:n,onSuccess:(s,{replyId:o},l)=>{const u=Ha(o,l);u&&xc({reply:u,reaction:s}),r.setQueryData(a,l)}});return i}function vE({queryFn:e,queryKey:t}){const{data:n,error:r,isLoading:a,hasNextPage:i,fetchNextPage:s}=Ye.useInfiniteQuery({queryKey:t,queryFn:e,initialPageParam:{next:""},getNextPageParam:u=>(u==null?void 0:u.next)||null}),o=EE(n),l=`${o.length||0}${i?"+":""}`;return{replies:o,repliesCount:l,error:r,isLoading:a,hasNextPage:i,fetchNextPage:s}}function bE({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=Ye.useMutation({mutationFn:e,onMutate:({replyId:a})=>t(i=>wE(a,i)),onError:n});return r}function yE({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:a}=Ye.useMutation({mutationFn:e,onMutate:({replyId:i})=>t(s=>{const o=Ha(i,s);return o&&Xw({reply:o,user:r}),s}),onError:n});return a}function CE(e){return{pages:[{next:"",results:[e]}],pageParams:[""]}}function DE(e,t,n){const r=t.pages.length-1,a=t.pages[r].results.length-1;return n!=null&&n.replace?t.pages[r].results[a]=e:t.pages[r].results.push(e),t}function xE(e,t,n){return n!=null&&n.replace?t.pages[0].results[0]=e:t.pages[0].results=[e,...t.pages[0].results],t}function _c(e,t,n){return t?n!=null&&n.append?DE(e,t,n):xE(e,t,n):CE(e)}function Ha(e,t){if(t)for(const{results:n}of t.pages){const r=n.find(({id:a})=>a===e);if(r)return r}}function wE(e,t){for(const{results:n}of t.pages){const r=n.findIndex(({id:a})=>a===e);if(r!==-1){n.splice(r,1);break}}return t}function EE(e){var t;return((t=e==null?void 0:e.pages)==null?void 0:t.reduce((n,r)=>[...n,...r==null?void 0:r.results],[]))||[]}const _E=({basePath:e,parentId:t,activityId:n,replyId:r,isMember:a,functions:i})=>{const s=oe.useIntl(),o=3,{replies:l,fetchNextPage:u,hasNextPage:c,isLoading:h,mutations:{create:p,edit:m,like:g,remove:f,unlike:b},user:v}=Dh({queryKey:[e,t,n,r,"replies"],queryFns:{...i,list:x=>i.list({...x,reactionId:r})}});Us([h]);const[E,k]=C.useState(!0);return d.jsxs(d.Fragment,{children:[(l==null?void 0:l.length)>=o&&d.jsx(ke,{className:"nested-replies-show-toggle",variant:"secondary",size:"small",icon:{icon:`arrow_corner-${E?"up_left":"down_right"}`,position:"left"},onClick:()=>k(!E),children:s.formatMessage({id:`discussion_thread_${E?"hide":"show"}`},{count:l==null?void 0:l.length})}),E&&d.jsx(mh,{loadMore:{isLoading:h,hasNextPage:c,loadNextPage:()=>u()},form:{content:{type:"reply",slugs:{question:`${e}/${t}`,answer:n,reply:r}},functions:{create:(x,{body:w})=>p({activityId:n,replyId:r,content:w}),listMembers:i.listMembers,clickMentionFallback:i.clickMentionFallback},meta:{isEditing:!1,isAutoFocused:!0,isPrepopulated:!1,showSuccessMessage:!1}},children:l&&l.length>0?l==null?void 0:l.map(x=>{var Q,ae,D,M,W,F,T,z,R,H,re,X;const{id:w,own_children:A,latest_children:S,children_counts:q,data:{mentioned_users:$}}=x,L=(((Q=A==null?void 0:A.like)==null?void 0:Q.length)||0)>0?(ae=A==null?void 0:A.like)==null?void 0:ae.find(ne=>{var le;return((le=ne==null?void 0:ne.user)==null?void 0:le.id)===(v==null?void 0:v.id)}):!1,_=L?L==null?void 0:L.id:"",B=!!L,I=(((D=S==null?void 0:S.like)==null?void 0:D.length)||0)>0?(M=S==null?void 0:S.like)==null?void 0:M.map(ne=>{var le,ee,he;return{id:(le=ne==null?void 0:ne.user)==null?void 0:le.id,name:(he=(ee=ne==null?void 0:ne.user)==null?void 0:ee.data)==null?void 0:he.name}}):!1,G=x==null?void 0:x.user,V=typeof x.data.content=="string"?(W=x==null?void 0:x.data)==null?void 0:W.content:((T=(F=x==null?void 0:x.data)==null?void 0:F.content)==null?void 0:T.text)||"";return d.jsx(Ur,{isCommunity:!0,content:{id:w,type:"reply",body:V,canLike:a,createdAt:x==null?void 0:x.created_at,slugs:{question:`${e}/${t}`,answer:n,reply:x==null?void 0:x.parent},slug:"",author:{id:G==null?void 0:G.id,name:(z=G.data)==null?void 0:z.name,organization:(R=G.data)==null?void 0:R.organization,jobTitle:(H=G.data)==null?void 0:H.jobTitle,location:(re=G.data)==null?void 0:re.location,image:{thumbnail:((X=G.data)==null?void 0:X.thumbnail)||void 0}},userLiked:B,likes:(q==null?void 0:q.like)||0,peopleWhoLiked:I,mentions:$},functions:{content:{createContent:()=>null,deleteContent:()=>f({replyId:w}),updateContent:(ne,{body:le})=>m({replyId:w,content:le})},likes:{createLike:()=>g({replyId:w}),deleteLike:()=>b({replyId:w,reactionId:_})},comments:{},mentions:{listMembers:i.listMembers,clickMentionFallback:i.clickMentionFallback}},styling:{showShareLinkButton:!0}},w)}):null})]})};const xh=({basePath:e,parentId:t,activityId:n,isMember:r,functions:{reactions:a,mentions:i,join:s,leave:o}})=>{const l=oe.useIntl(),{replies:u,repliesCount:c,fetchNextPage:h,hasNextPage:p,isLoading:m,mutations:{create:g,edit:f,like:b,remove:v,unlike:E},user:k}=Dh({queryKey:[e,t,n,"replies"],queryFns:a}),x=()=>{A(u.length),h()},[w,A]=C.useState(null);return Us([m]),yh(),d.jsxs("section",{className:"replies-feed",children:[d.jsx(hh,{type:"comment",responses:c,isLoading:m}),d.jsx(No,{form:{content:{type:"reply",slugs:{}},functions:{create:(S,{body:q})=>g({activityId:n,content:q}),...i},meta:{isEditing:!1,isAutoFocused:!1,isPrepopulated:!1,showSuccessMessage:!1},placeholder:l.formatMessage({id:"discussion_responses_placeholder"})},membershipRequiredToPost:{isMember:r,required:!0,join:s,leave:o,notMemberStateText:l.formatMessage({id:"community_joinToPost"})}}),u==null?void 0:u.map((S,q)=>{var W,F,T,z,R,H,re,X,ne,le,ee,he;const{id:$,own_children:N,latest_children:L,children_counts:_,data:{mentioned_users:B}}=S,I=(((W=N==null?void 0:N.like)==null?void 0:W.length)||0)>0?(F=N==null?void 0:N.like)==null?void 0:F.find(me=>{var ye;return((ye=me==null?void 0:me.user)==null?void 0:ye.id)===(k==null?void 0:k.id)}):!1,G=I?I==null?void 0:I.id:"",V=!!I,ae=(((T=L==null?void 0:L.like)==null?void 0:T.length)||0)>0?(z=L==null?void 0:L.like)==null?void 0:z.map(me=>{var ye,Be,Ae;return{id:(ye=me==null?void 0:me.user)==null?void 0:ye.id,name:(Ae=(Be=me==null?void 0:me.user)==null?void 0:Be.data)==null?void 0:Ae.name}}):!1,D=S==null?void 0:S.user,M=typeof S.data.content=="string"?(R=S==null?void 0:S.data)==null?void 0:R.content:((re=(H=S==null?void 0:S.data)==null?void 0:H.content)==null?void 0:re.text)||"";return d.jsx(ch,{children:d.jsx(Ur,{isCommunity:!0,content:{id:$,type:"reply",body:M,canLike:r,createdAt:S==null?void 0:S.created_at,slugs:{question:`${e}/${t}`,answer:n,reply:$},slug:$,author:{id:D==null?void 0:D.id,name:(X=D.data)==null?void 0:X.name,organization:(ne=D.data)==null?void 0:ne.organization,jobTitle:(le=D.data)==null?void 0:le.jobTitle,location:(ee=D.data)==null?void 0:ee.location,image:{thumbnail:((he=D.data)==null?void 0:he.thumbnail)||void 0}},userLiked:V,likes:(_==null?void 0:_.like)||0,peopleWhoLiked:ae,mentions:B},functions:{content:{createContent:()=>null,deleteContent:()=>v({replyId:$}),updateContent:(me,{body:ye})=>f({replyId:$,content:ye})},likes:{createLike:()=>b({replyId:$}),deleteLike:()=>E({replyId:$,reactionId:G})},comments:{},mentions:i},children:d.jsx(_E,{basePath:e,parentId:t,activityId:n,replyId:$,isMember:r,functions:{...a,...i}}),styling:{showShareLinkButton:!0},setFocus:q===w},$)},$)}),!m&&d.jsx(zr,{hasNextPage:p,loadNextPage:x,icon:{icon:"arrow-down",position:"right"},messages:{button:l.formatMessage({id:"loadMore_button"}),error:l.formatMessage({id:"loadMore_error"})}})]})};function kE({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=Ye.useMutation({mutationFn:e,onMutate:({content:a,title:i})=>t(s=>(s&&(a!=null&&(s.content=a),i!=null&&(s.title=i)),s)),onError:n});return r}function FE({queryFn:e,queryKey:t}){const{data:n,error:r,isLoading:a,isFetching:i}=Ye.useQuery({queryFn:e,queryKey:t});return{activity:n,error:r,isLoading:a,isFetching:i}}function BE({queryFns:{read:e,edit:t,like:n,unlike:r},queryKey:a}){const i=Ye.useQueryClient(),s=Ja(),o={queryClient:i,queryKey:a},l={mutationHandlers:{error:Ro(o),mutate:Mo(o)},user:s,...o},u=kE({...l,mutationFn:t}),c=AE({...l,mutationFn:n}),h=TE({...l,mutationFn:r}),{activity:p,...m}=FE({queryKey:a,queryFn:e});return{activity:p,mutations:{edit:u,like:c,unlike:h},user:s,...m}}function AE({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:a}){const{mutate:i}=Ye.useMutation({mutationFn:e,onMutate:s=>t(o=>(o&&Wa({activity:o}),o)),onError:n,onSuccess:(s,o,l)=>{l&&Wa({activity:l,reaction:s}),r.setQueryData(a,l)}});return i}function TE({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:a}=Ye.useMutation({mutationFn:e,onMutate:i=>t(s=>(s&&vh({activity:s,user:r}),s)),onError:n});return a}const SE=({basePath:e,parentId:t,activityId:n,isMember:r,functions:{activities:{remove:a,...i},reactions:s,mentions:o,join:l,leave:u}})=>{var $,N,L,_,B,j,I,G,V,Q;const c=oe.useIntl(),{activity:h,error:p,isLoading:m,mutations:{edit:g,like:f,unlike:b}}=BE({queryFns:i,queryKey:[e,t,n]});if(m)return d.jsx(_t,{style:{height:"400px"}});if(p||!h)return d.jsx(cn,{variant:"error",text:c.formatMessage({id:"activitySection_notFoundError"})});const{own_reactions:v,latest_reactions:E,mentioned_users:k}=h,x=((($=E==null?void 0:E.like)==null?void 0:$.length)||0)>0,w=(((N=v==null?void 0:v.like)==null?void 0:N.length)||0)>0,A=w?v==null?void 0:v.like[0].id:"",S=x?(L=E==null?void 0:E.like)==null?void 0:L.map(ae=>{var D,M,W;return{id:(D=ae==null?void 0:ae.user)==null?void 0:D.id,name:(W=(M=ae==null?void 0:ae.user)==null?void 0:M.data)==null?void 0:W.name}}):!1,q=h==null?void 0:h.actor;return d.jsxs("section",{className:"activity-section",children:[d.jsx(Ur,{className:"highlighted-text-box subtle",isCommunity:!0,content:{id:n,type:"post",title:h==null?void 0:h.title,body:h==null?void 0:h.content,canLike:r,createdAt:(h==null?void 0:h.time)||"",slugs:{question:`${e}/${t}`,answer:h==null?void 0:h.id},slug:n,author:{id:q.id,name:(_=q.data)==null?void 0:_.name,organization:(B=q.data)==null?void 0:B.organization,jobTitle:(j=q.data)==null?void 0:j.jobTitle,location:(I=q.data)==null?void 0:I.location,image:{thumbnail:((G=q.data)==null?void 0:G.thumbnail)||void 0}},userLiked:w,likes:((V=h==null?void 0:h.reaction_counts)==null?void 0:V.like)||0,comments:((Q=h==null?void 0:h.reaction_counts)==null?void 0:Q.reply)||0,peopleWhoLiked:S,mentions:k},originalAuthorId:q==null?void 0:q.id,forceHide:{comments:!0},functions:{content:{createContent:()=>null,deleteContent:a,updateContent:(ae,{title:D,body:M})=>g({title:D,content:M})},likes:{createLike:()=>f({activityId:n}),deleteLike:()=>b({activityId:n,reactionId:A})},comments:{openComments:()=>{}},mentions:o},styling:{showShareLinkButton:!0}},n),d.jsx(xh,{basePath:e,parentId:t,activityId:n,isMember:r,functions:{reactions:s,mentions:o,join:l,leave:u}})]})};const wh=({showModal:e=!0,functions:t,form:n,cachedText:r,className:a})=>{const i=oe.useIntl(),s="discussionFormModal_",{onClose:o=()=>{},cacheText:l=()=>{}}=t,{data:u,meta:c,functions:h}=n,{title:p="",body:m="",mentions:g}=r||{},f="discussion-form-modal";return d.jsx(dn,{id:f,title:i.formatMessage({id:`${s}title`}),isOpen:e,functions:{onClose:()=>{(p!==""||m!=="")&&l(b=>({...b,showCachedText:!0})),o()}},className:Y("discussion-form-modal",a),children:d.jsx(Wr,{...n,data:{...u,mentions:g||(u==null?void 0:u.mentions)},meta:{...c,isAutoFocused:!0,isInOverlay:`${f}-overlay`,hasTitleField:{text:p},isPrepopulated:{text:m||(c==null?void 0:c.isPrepopulated)!==!1&&(c==null?void 0:c.isPrepopulated.text)||""},showGuidelines:!1,showDivider:!0},buttons:{submit:i.formatMessage({id:`${s}cta`})},functions:{...h,onChange:b=>{l(v=>({...v,...b}))},onMention:({id:b,name:v}={})=>{if(!b||!v)return;const E=g||{};E[b]={created_at:"",updated_at:"",id:b,data:{name:v}},l(k=>({...k,mentions:E}))},create:async b=>{o(),h.create&&await h.create(b),l({showCachedText:!1})},handleSaveEdit:async b=>{o(),h.handleSaveEdit&&await h.handleSaveEdit(b),l({showCachedText:!1})}}})})},jE=Object.freeze(Object.defineProperty({__proto__:null,default:wh},Symbol.toStringTag,{value:"Module"}));const OE=({className:e,showModal:t=!0,title:n,formTitle:r,formLabel:a,ctaMessage:i,showIcon:s,onClose:o,reportError:l=()=>{},sendInvites:u})=>{const c=oe.useIntl();return r||(r=c.formatMessage({id:"inviteModal_formTitle"})),a||(a=c.formatMessage({id:"inviteModal_formLabel"})),i||(i=c.formatMessage({id:"inviteModal_cta"})),d.jsx(dn,{id:"invite-user-modal",title:n,isOpen:t,showDivider:!1,showIcon:s,functions:{onClose:o},className:Y("invite-modal",e,{success:!!n}),children:d.jsx(ah,{title:r,label:a,ctaMessage:i,onClose:o,sendInvites:u,reportError:l})})};const PE=({showModal:e=!0,content:{successMessage:t,title:n,text:r}={},functions:a,form:i,className:s})=>{const o=oe.useIntl(),[l,u]=C.useState(Kc("showProfile")==="true"||e);C.useEffect(()=>{u(e)},[e]);const{onClose:c=()=>{}}=a;return d.jsx(dn,{id:"profile-form-modal",title:t||n||o.formatMessage({id:"profileModal_title"}),isOpen:l,showDivider:!t,functions:{onClose:c},className:Y("profile-modal",s,{success:!!t}),maxWidth:700,children:d.jsxs(d.Fragment,{children:[t&&n||r?d.jsxs("div",{className:"intro",children:[t&&n?d.jsx("h3",{children:n}):"",r?d.jsx("p",{children:r}):""]}):null,d.jsx(ih,{...i,meta:{shouldShowCancelButton:!1}})]})})};const NE=({members:e})=>{const[t,n]=C.useState(!1),r=a=>{const{fullName:i,jobTitle:s,organisation:o,photo:l}=a||{};return d.jsxs(d.Fragment,{children:[d.jsx(Gt,{name:i,src:l}),d.jsx("p",{children:i}),d.jsx("small",{className:"text-medium",children:o?`${s}, ${o}`:s})]})};return d.jsxs("div",{className:"directory-wrapper",children:[d.jsx("ul",{className:"directory",children:e.map(a=>d.jsx("li",{children:d.jsx("button",{onClick:i=>{i.preventDefault(),i.stopPropagation(),n(a)},children:r(a)})},a.fullName))}),d.jsx(dn,{isOpen:t!==!1,children:t===!1?"":d.jsxs(d.Fragment,{children:[r(t),d.jsx(En,{children:t.text})]}),buttons:[{size:"small",variant:"tertiary",onClick:()=>n(!1),children:"Close"}],functions:{onClose:()=>n(!1)}})]})};const RE=({author:e,authorCite:t,content:n,member:r,className:a=""})=>d.jsxs("blockquote",{className:Y("testimonial-block",a),children:[d.jsx(It,{className:"testimonial",children:n}),r?d.jsx(_n,{member:r,styling:{size:"large"}}):d.jsxs(d.Fragment,{children:[e&&d.jsx("p",{className:Y("author",{"text-small":!a.includes("new")}),children:e}),t&&d.jsx("p",{className:Y("author-cite",{"text-small":!a.includes("new")}),children:d.jsx("cite",{children:t})})]})]}),ME=C.memo(RE);const IE=({items:e=[],selector:t="",className:n=""})=>{const r=oe.useIntl(),[a,i]=C.useState(e);return C.useEffect(()=>{if(e.length)return;let s="";Array(6).fill(0).forEach((u,c)=>{s+=`${c>0?", ":""}${t} h${c+1}`});const l=Array.from(document.querySelectorAll(s)).filter(u=>u.id).map(u=>({id:u.id,text:u.textContent||""}));i(l)},[]),a&&a.length>0&&d.jsxs($t,{variant:"subtle",className:Y("table-of-contents",n),children:[d.jsx("h2",{children:r.formatMessage({id:"tableOfContents"})}),d.jsx("nav",{children:d.jsx("ul",{children:a.map(({id:s,text:o})=>d.jsx("li",{children:d.jsx("a",{href:`#${s}`,children:o})},s))})})]})};const ui=({time:e,rangeTime:t,prependedText:n,appendedText:r,className:a=""})=>{const i=oe.useIntl(),s="timeToComplete_";if(!e||typeof e!="number")return null;const o=c=>{const h=c/60,p=Math.floor(h),m=(h-p)*60,g=Math.round(m),f=`${i.formatMessage({id:`${s}hours`},{time:p})}${p>0&&g>0?", ":""}${i.formatMessage({id:`${s}minutes`},{time:g})}`;return{text:`${p>0?`${i.formatMessage({id:`${s}hours_short`},{time:p})} `:""}${g>0?i.formatMessage({id:`${s}minutes_short`},{time:g}):""}`,ariaText:f}};let{text:l,ariaText:u}=o(e);if(t){const{text:c,ariaText:h}=o(e+t);l=i.formatMessage({id:`${s}range`},{early:l,late:c}),u=i.formatMessage({id:`${s}range_aria`},{early:u,late:h})}return n&&(u=`${n} ${u}`,l=`${n} ${l}`),r&&(u=`${u} ${r}`,l=`${l} ${r}`),d.jsx("span",{className:Y("time-to-complete",a),"aria-label":u,children:l})};const $E=({className:e="",image:t,...n})=>t?(typeof t=="string"&&(t={width:1080,height:200,type:"image/png",url:t}),t.range=[{height:124,width:425},{height:200,width:768},{height:200,width:1368}],t.query="fit=thumb&f=center",d.jsx(sr,{...n,className:Y("banner",e),image:{...t,aspect:"banner"}})):null;const LE=["small","span","strong","em","p","h1","h2","h3","h4","h5","h6","blockquote","q"],zE=({className:e="",content:t,image:n,variant:r,spacing:a="normal",styling:i,hideElements:s={eyebrow:!1,title:!1,text:!1},cta:o,children:l})=>{var g,f;const u={imageFullWidth:!0,...i};r||(r=u.imageFullWidth?"default":"light");const c=["eyebrow","title","text"],h={eyebrow:"small",title:"h1",text:"p"},p={};c.forEach(b=>{if(!t[b]){p[b]=!1;return}if(!s[b]){if(typeof t[b]=="object"){p[b]=t[b];const{text:v,element:E}=t[b];if(E&&LE.includes(E.toLowerCase()))return;p[b]={text:v,element:h[b]};return}p[b]={text:t[b],element:h[b]}}});const m=o&&o.text&&o.link;return m&&o.link[0]==="#"&&(o.props||(o.props={}),o.props.onClick=b=>{b.preventDefault(),b.stopPropagation();const v=document.getElementById(o.link.substring(1));v&&v.scrollIntoView({behavior:"smooth"})}),d.jsx(mn,{className:Y("banner-section",r,a,e,{"has-image":n,"image-full-width":n&&u.imageFullWidth,"image-inline":n&&!u.imageFullWidth,"has-cta":m,"has-extra-spacing":r!=="subtle"&&a==="normal"&&p.eyebrow&&p.title}),children:d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"content-wrapper",children:[c.map(b=>{if(p[b]&&typeof p[b]=="object"){const{text:v,element:E=""}=p[b];return b==="text"?d.jsx(En,{overrideType:"text-only",className:"text",children:v},b):C.createElement(E,{key:b,className:b},v)}return null}),l,m&&d.jsx(ke,{variant:n||["light","subtle"].includes(r)?"primary":"secondary",size:{mobile:"medium",768:"large"},href:o.link,...o.props,className:Y({new:r==="subtle",[(g=o.props)==null?void 0:g.className]:(f=o.props)==null?void 0:f.className}),children:o.text})]}),n&&d.jsx(sr,{image:{...n,aspect:u.imageFullWidth?"banner":n.aspect||void 0}})]})})},qE=C.memo(zE);const WE=({image:e,variant:t="default",children:n,className:r=""})=>{const a={};return e&&(a["--image"]=`url(${e})`),d.jsx(mn,{className:Y("custom-content-banner",t,r,{"has-image":e}),style:a,children:d.jsx("div",{className:"content-slim",children:n})})};const UE=({alignImage:e="left",className:t,content:n,image:r})=>{const a=typeof n=="string"?d.jsx(En,{children:n}):n;return d.jsxs(mn,{className:Y("highlight-section",t),children:[r&&d.jsx("div",{className:Y("highlight-container highlight-image",{[`highlight-image-${e}`]:e==="right"}),children:d.jsx(sr,{image:{...r,description:""}})}),d.jsx("div",{className:Y("highlight-container highlight-content-wrapper",{"no-image":!r}),children:d.jsx("div",{className:Y("highlight-content",{"highlight-content-right":e==="left"}),children:r?a:d.jsx("div",{className:"content-default",children:a})})})]})},HE=C.memo(UE);const VE=({variant:e="primary",button:t=null,title:n,text:r,gtmContext:a})=>!n&&!r?null:d.jsxs("aside",{className:Y("marketing-block",e),children:[n&&d.jsx("p",{className:"title",children:n}),r&&d.jsx("p",{children:r}),t&&d.jsx(ke,{variant:"secondary",size:"medium",href:t.link,className:"gtm-trackable","data-gtm-event-context":a,"data-gtm-event-type":"learn-more-click",children:t.text})]}),KE=({type:e,data:t})=>{const n=oe.useIntl(),{answers:r,createdAt:a,dateHasPassed:i,isOngoingEvent:s,pill:o,readingTime:l,publishedDate:u,startDate:c}=t;if(e==="question"){const h=a&&fs(a);return d.jsxs("p",{className:"details answers","data-testid":"question-answers",children:[n.formatMessage({id:"card_answers"},{number:r}),a&&d.jsxs("span",{"data-testid":"question-created-at",children:[" ","·"," ",n.formatMessage({id:"card_time_ago"},{time:h?n.formatMessage({id:`dates_${h.path}`},{number:h.number}):0})]})]})}if(c&&!i||s)return d.jsx("p",{className:"details",children:s?n.formatMessage({id:"card_bootcamp"}):Vs(c)});if(o)return d.jsx(Cn,{variant:o==="free"?"subtle":"highlighted",className:o,"data-testid":"course-type",children:o});if(l||u){const h=u&&fs(u);return d.jsxs("ul",{className:"details",children:[l&&d.jsx("li",{"data-testid":"reading-time",children:n.formatMessage({id:"card_time_read"},{time:l})}),u&&d.jsx("li",{"data-testid":"published-date",children:n.formatMessage({id:"card_time_ago"},{time:h?n.formatMessage({id:`dates_${h.path}`},{number:h.number}):0})})]})}return null},ZE={title:66,text:3e3,secondaryText:1e3,partner:25},Va={communityPage:{basePath:"/communities/",className:"communityPage",gtmEvent:"community"},customCard:{className:"custom",gtmEvent:"custom",length:{text:335,secondaryText:150}},event:{basePath:"/events/",className:"event",gtmEvent:"event"},microcourse:{basePath:"/microcourses/en/",className:"course",gtmEvent:"microcourse-overview"},solutionArticle:{basePath:"/solution-articles/en/",className:"article",length:{title:60},gtmEvent:"article"},qaQuestion:{basePath:"/questions-answers/",className:"question",length:{title:190},gtmEvent:"q-and-a-question"},listPage:{basePath:"/list/en/",className:"list",gtmEvent:"list"},people:{basePath:"/profiles/",className:"people",length:{people:1e3},gtmEvent:"person"},learningHub:{basePath:"/learning-hub/",className:"learning-hub",length:{title:190},gtmEvent:"learning-hub"}},YE=({data:e,cta:t,link:n,gtmContext:r})=>{var f,b;const a=oe.useIntl(),[i,s]=C.useState({loading:!1,registered:e.registered||!1});C.useEffect(()=>{e.registered&&s(v=>({...v,registered:!0}))},[e.registered]);const{customLinkText:o,startDate:l,dateHasPassed:u,pill:c,slug:h}=e,p=e.contentType;let m="";if((f=Va[p])!=null&&f.gtmEvent&&(m=Va[p].gtmEvent),l&&u)return n?d.jsx("a",{href:n,className:"details additional-link gtm-trackable","data-gtm-event-context":`${r}-CarouselCard`,"data-gtm-event-type":`${m}-click`,children:o||a.formatMessage({id:"card_watch"})}):null;if(p==="people")return n?d.jsx(ke,{variant:"tertiary",size:"small",href:n,className:"gtm-trackable","data-gtm-event-context":`${r}-Card-Button`,"data-gtm-event-type":`${m}-click`,children:o||a.formatMessage({id:"card_cta_people"})}):null;const g=["communityPage","microcourse","event"];if(t&&t.onClick&&g.includes(p)&&c!=="premium"){const v=i.loading||i.registered||((b=e==null?void 0:e.members)==null?void 0:b.isMember),E=async k=>{if(k.preventDefault(),k.stopPropagation(),!(v||!t||!t.onClick)){s(x=>({...x,loading:!0}));try{const x=await t.onClick(e);s(x==="success"?()=>({registered:!0,loading:!1}):w=>({...w,loading:!1}))}catch{s(w=>({...w,loading:!1}))}}};return d.jsx("p",{className:Y("cta-wrapper",{"has-member-section":e==null?void 0:e.members}),children:d.jsx(ke,{onClick:E,className:"gtm-trackable",size:"small",styling:{fullWidth:!0},disabled:v,"data-gtm-event-context":`${r}Page-${p}: ${h}`,"data-gtm-event-type":`${r}-${p}-register-click`,"data-testid":"in-card-button",children:o||a.formatMessage({id:`card_cta_${p}${v?`_${i.loading?"loading":"done"}`:""}`})})})}return null};function GE({buildMemberData:e,communitySlug:t}){const n=oe.useIntl(),[r,a]=C.useState({count:"...",isMember:!1,memberType:""});return C.useEffect(()=>{e(t).then(i=>{if(!i)return;const{membersCount:s,role:o=""}=i;a({count:s==null?void 0:s.toString(),isMember:!!o,memberType:o})})},[t,e]),d.jsxs("span",{className:"member-information",children:[r.isMember&&d.jsx(Cn,{size:"small",variant:"registered",icon:(r==null?void 0:r.memberType)==="owner"?"user":"tick",children:n.formatMessage({id:`card_member_type_${r.memberType}`})}),d.jsx("span",{className:"label member-count",children:n.formatMessage({id:"card_member_count"},{count:r.count})})]})}const Io=({id:e="",className:t="",buildCardData:n,buildMemberData:r,card:a,cta:i,gtmContext:s="Carousel",handleCardClick:o,setFocus:l=!1})=>{var L,_;const u=oe.useIntl(),c=C.useContext(Tt),h=!!(c!=null&&c.id),p=C.useRef(null),[m,g]=C.useState({data:null,isLoading:!0});C.useEffect(()=>{n(a,h).then(B=>{g({data:B,isLoading:!1})}).catch(()=>g(B=>({...B,isLoading:!1})))},[a,h,n]);const{data:f,isLoading:b}=m;if(b||!f)return d.jsx(_t,{element:"li",className:"card-wrapper","data-testid":"card-placeholder"});o&&!i&&(i={text:u.formatMessage({id:`card_cta_${a.contentType}`}),onClick:o});const{contentType:v}=f;if(!v||!Va[v])return d.jsx(_t,{element:"li",className:"card-wrapper"});const{basePath:E="",className:k,length:x,gtmEvent:w}=Va[v];let A=f.slug?`${E}${f.slug}`:!1;f.slug&&(f.slug.slice(0,4)==="http"||f.slug.slice(0,2)==="//"||f.slug.slice(0,6)==="mailto"||f.slug.slice(0,3)==="tel")&&(A=f.slug);const S=B=>{A&&(B.preventDefault(),B.stopPropagation(),window.location.href=A)},q={...ZE,...x};let $={className:"card"},N={};return A&&(N={href:A,className:"gtm-trackable","data-gtm-event-context":`${s}-CarouselCard`,"data-gtm-event-type":`${w}-click`,"data-testid":"link"},f.openInNewTab&&(N.target="_blank"),$={onClick:S,className:"card gtm-trackable","data-gtm-event-context":`${s}-CarouselCard`,"data-gtm-event-type":`${w}-click`}),l&&($={...$,tabIndex:"0"},(L=p==null?void 0:p.current)==null||L.focus(),(_=p==null?void 0:p.current)==null||_.scrollIntoView({behavior:"smooth"})),d.jsx("li",{className:Y("card-wrapper text-medium",k,t,{"has-link":A,"no-link":!A,"has-image":f.banner}),"data-testid":`${v}-card`,children:d.jsxs("div",{...$,ref:p,children:[d.jsx(Yc,{className:"card-label",contentType:v,customIcon:f.isPrivate?"lock-locked":f.customIcon,customLabel:f.customLabel}),v==="communityPage"&&(f==null?void 0:f.createdAt)&&Zh(f==null?void 0:f.createdAt,60)&&d.jsx(Cn,{size:"small",variant:"information","data-testid":"new-community",children:u.formatMessage({id:"card_new"})}),f.startDate&&!f.isOngoingEvent&&d.jsx(Cn,{size:"small",variant:f.dateHasPassed?"default":"information","data-testid":"date",children:f.dateHasPassed?u.formatMessage({id:"card_ended"}):Wc(f.startDate)}),f.banner?d.jsxs("p",{className:"img",children:[f.registered&&d.jsx(Cn,{size:"small",variant:"registered",children:u.formatMessage({id:"card_registered"})}),d.jsx(sr,{image:{...f.banner,description:""}})]}):k==="people"?d.jsx(Gt,{name:f.title||"",src:f.profile,"data-testid":"people-profile-picture"}):null,f.contributors&&d.jsx(Ys,{contributors:{data:f.contributors},styling:{size:"small",showGap:k!=="question",showText:!0},multipleText:["event","solutionArticle"].includes(v)?u.formatMessage({id:`card_contributors_${v}`}):void 0,"data-testid":"contributors"}),f.partner&&d.jsx("p",{className:"partners","data-testid":"partners",children:f.partner.length>1?u.formatMessage({id:"card_partner"},{partner:f.partner[0],number:f.partner.length-1}):Gn(f.partner[0],q.partner)}),["title","text","secondaryText"].map(B=>{const j=f[B];if(!j)return null;const I=Mc(B),G={key:B,className:I,"data-testid":I},V={wrapper:"p",forceWrapper:!0,forceInline:!0},Q=Gn(j,q[B]);return["title","text"].includes(B)&&A?(V.wrapper="a",d.jsx("p",{...G,children:d.jsx(It,{options:V,...N,children:Q})})):d.jsx(It,{options:V,...G,children:Q})}),a.contentType==="communityPage"&&a.slug&&r&&d.jsx(GE,{communitySlug:a==null?void 0:a.slug,buildMemberData:r}),d.jsx(KE,{type:k||"",data:f}),d.jsx(YE,{data:f,cta:i,link:A||"",gtmContext:s})]})})};const Eh=({cards:e,cardTypes:t,className:n="",...r})=>d.jsx("ul",{className:Y("card-block",n),children:e.map((a,i)=>{const s=a.slug?`${a.slug}-${t[i]}`:`${t[i]}-${i}`;return d.jsx(Io,{id:s,card:{...a,contentType:t[i]},setFocus:i===(r==null?void 0:r.focusCardIndex),...r},s)})}),QE=(e,t,n,r)=>{const a=t*n<=e,i=e<t*(n+1),s=r.includes(Math.floor(e/t));return a&&i||s},JE=({id:e,title:t})=>{const n=oe.useIntl();if(!t||!t.text)return null;const{text:r,element:a="h2",variant:i="default",size:s="medium",link:o}=t;return C.createElement(a,{className:Y("title",i,s,{"highlighted-title":i==="highlighted"}),children:d.jsxs(d.Fragment,{children:[r,o&&d.jsx("a",{href:o,className:"text-medium gtm-trackable","data-gtm-event-context":"CarouselViewAll","data-gtm-event-type":`${e||window.btoa(r)}-view-all-click`,children:n.formatMessage({id:"card_carousel_viewAll"})})]})})};const us={fourCards:1024,threeCards:769,twoCards:480};let ha=null;const XE=({id:e,cards:t,cardTypes:n,buildCardData:r,title:a,className:i,gtmContext:s,...o})=>{const l=oe.useIntl(),[u,c]=C.useState({cardsPerPage:4,isLoading:!0}),{cardsPerPage:h,isLoading:p}=u,[m,g]=C.useState({currentPage:0,loadedPages:[0]}),{currentPage:f,loadedPages:b}=m,[v,E]=C.useState(""),k=t.length,x=Math.ceil(k/h),w=C.useRef(null),A=rr(!0,!0,w==null?void 0:w.current);C.useEffect(()=>{let _=1;A&&(A>=us.fourCards?_=4:A>=us.threeCards?_=3:A>=us.twoCards&&(_=2),_>k&&(_=k)),c(B=>({...B,cardsPerPage:_,isLoading:!1}))},[A,k]);const S=(_="next")=>{let B=f;if(typeof _=="string")if(_==="next")if(f<x-1)B=f+1;else return;else if(f>0)B=f-1;else return;else B=_;g(I=>({...I,currentPage:B,loadedPages:[...new Set([...b,B])]}));const j=()=>{const I=B*u.cardsPerPage,G=I+u.cardsPerPage;return t.slice(I,G).length};E(l.formatMessage({id:"carousel_pagination_aria_live"},{direction:_,count:j()}))},q=_=>{ha=_.touches[0].clientX},$=_=>{if(ha===null)return;const B=_.touches[0].clientX,j=ha-B;j>5?S("next"):j<-5&&S("previous"),ha=null},N={"--width":`${A||0}px`,"--total-cards":k,"--cards-per-page":h,"--page":f};if(p)return d.jsx(Zs,{layout:`carousel${a?"-with-title":""}`});const L=(_,B)=>{var I;let j=null;return(I=_==null?void 0:_.sys)!=null&&I.id?j=`card-${_.sys.id}`:_!=null&&_.slug?j=`card-${_.slug}`:[n[B],_.contentType].includes("customCard")&&(j=`card-${window.btoa(`${_.title} ${_.createdAt}`)}-${B}`),j};return d.jsxs("section",{ref:w,className:Y("carousel-wrapper",i),"data-testid":"carousel",children:[d.jsx(JE,{id:e,title:a}),d.jsx("ul",{className:"carousel",onTouchStart:q,onTouchMove:$,style:N,"data-testid":"carousel-list",children:t.map((_,B)=>{let j=L(_,B);return j&&QE(B,h,f,b)?d.jsx(Io,{id:j,card:{..._,contentType:n[B]},buildCardData:r,gtmContext:s,...o},j):(j=j||`${e}-card-${B}`,d.jsx(_t,{element:"li",className:"card-wrapper","data-testid":"card-placeholder"},j))})}),x<=1?null:d.jsxs(d.Fragment,{children:[d.jsxs("ul",{className:"controls","data-testid":"carousel-controls",children:[d.jsx("li",{className:"arrow previous",children:d.jsx(ke,{variant:"secondary",size:"large",icon:{icon:"chevron_left"},onClick:_=>{_.preventDefault(),_.stopPropagation(),S("previous")},screenreaderText:l.formatMessage({id:"carousel_pagination_previous"}),disabled:f<=0})}),[...Array(x)].map((_,B)=>d.jsx("li",{"data-testid":"carousel-controls-button",children:d.jsx("button",{className:Y("page-indicator",{selected:B===f}),onClick:j=>{j.preventDefault(),j.stopPropagation(),S(B)},children:d.jsx(Ie,{showOnFocus:!1,children:l.formatMessage({id:"carousel_pagination_page"},{number:B+1,total:x})})})},`page-indicator-${B}`)),d.jsx("li",{className:"arrow next",children:d.jsx(ke,{variant:"secondary",size:"large",icon:{icon:"chevron_right"},onClick:_=>{_.preventDefault(),_.stopPropagation(),S("next")},screenreaderText:l.formatMessage({id:"carousel_pagination_next"}),disabled:f>=x-1})})]}),d.jsx(Ie,{"aria-live":"polite",showOnFocus:!1,children:v})]})]})},e_=({carousels:e=[],isLoading:t,title:n,className:r="",...a})=>!e||!e.length?null:e.map(({title:i,viewAllUrl:s,cards:o,cardsTypes:l},u)=>{const c=i?window.btoa(i):`carousel-${u}`,h=u===e.length-1;return t?d.jsxs(C.Fragment,{children:[d.jsx(Zs,{layout:`carousel${i?"-with-title":""}`,"data-testid":"carousel-placeholder"}),h?null:d.jsx(zt,{})]},`placeholder-${c}`):d.jsxs(C.Fragment,{children:[d.jsx(XE,{cards:o,cardTypes:l,title:n!=null&&n.hidden?{}:{...n,text:i,link:s},...a}),h?null:d.jsx(zt,{})]},`carousel-${c}`)});const t_=({element:e="p",data:{timeLeftToFinish:t,percentageCompleted:{inTime:n=0,inLessons:r=0},shouldShowTimes:a=!0},graph:i,styling:s={},className:o=""})=>{const l=oe.useIntl();let u=a?n:r;u>99?u=100:u<1&&(u=0);const{highlightPercentage:c=!1}=s;return C.createElement(e,{className:Y("course-progression",o,{"highlight-percentage":c,"has-circle-graph":i==="circle"}),children:d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"percentage",children:l.formatMessage({id:"courseProgression_done"},{percent:h=>d.jsx("strong",{children:h}),number:u})}),u<100&&a&&d.jsx(ui,{time:t,appendedText:l.formatMessage({id:"courseProgression_timeLeft"})}),d.jsx(Ks,{progress:u,styling:{layout:i||"bar",size:i&&i==="circle"?"small":"default"}})]})})};const _h=({element:e="span",sectionId:t,subsectionId:n,title:r,className:a=""})=>C.createElement(e,{className:Y("lesson-name",a),"data-number":`${t}.${n}`,children:r});const kh=({size:e="default",completionTime:t,icon:n,optional:r,type:a,children:i})=>{const s=oe.useIntl(),o=Za(`lessonType_${a}`)?s.formatMessage({id:`lessonType_${a}`}):$c(a||"");return d.jsxs("small",{className:Y("content-type",{[e]:e!=="default"}),children:[d.jsx("span",{className:Y("type",n),children:o})," ",t>0&&!r&&d.jsx(ui,{time:t})," ",i?d.jsx("span",{className:"additional",children:i}):null]})};const n_=({course:{articles:e,canAccessCourse:t,description:n,hideTimes:r,isEnrolled:a,sectionId:i,sectionTime:s,slug:o,timeLeft:l,title:u},quizScores:c})=>{const h=oe.useIntl(),p="courseStructure_",m=u.toLowerCase().includes("course conclusion");return d.jsxs(Ga,{className:"course-structure",label:d.jsxs(d.Fragment,{children:[d.jsxs("small",{children:[h.formatMessage({id:`${p}section${m?"_end":""}`},{number:i})," ",!r&&s>=0&&d.jsx("span",{className:"time",children:a&&l===0?h.formatMessage({id:`${p}time_completed`}):d.jsx(ui,{time:s,appendedText:a?h.formatMessage({id:`${p}time_left`}):""})})]}),d.jsx("h3",{children:u})]}),shouldAnimate:!0,children:[d.jsx("p",{children:n}),d.jsx("ol",{children:e&&e.length>0&&e.map(({completed:g,completionTime:f,contentType:b,icon:v,image:E,isIntroduction:k,optional:x,slug:w,subsectionId:A,title:S,type:q})=>{const $=a&&t||k,N={};return E&&(N.style={"--image":`url(${E})`}),d.jsx("li",{className:Y({article:b===br.ARTICLE,discussion:b===br.DISCUSSION,quiz:b===br.QUIZ,completed:g&&b===br.ARTICLE,locked:!$}),...N,children:d.jsx(jn,{href:$?`/microcourses/en/${o}/${w}`:void 0,fallbackElement:"span",className:"inner",gtmContext:`MicrocourseOutline${Ic(S)}`,gtmType:"article-click",children:d.jsxs(d.Fragment,{children:[d.jsx(_h,{sectionId:i,subsectionId:A,title:S,className:"course-title"})," ",d.jsx(kh,{completionTime:f,icon:v,optional:x,type:q,children:c&&c[w]&&d.jsx("span",{className:"quiz-score",children:`${c[w]}%`})})]})})},w)})})]})};const r_=({isComplete:e=!1,onClick:t,...n})=>{const r=oe.useIntl();return n["data-gtm-event-context"]||(n["data-gtm-event-context"]="LessonIntroduction"),d.jsx(ke,{...n,variant:"tertiary",icon:e?{icon:"check-inside-circle_no-overlap_inverted"}:{icon:"check-inside-circle_no-overlap",hover:"check-inside-circle_no-overlap_inverted"},onClick:t,className:Y("mark-complete-button center gtm-trackable",{completed:e}),"data-gtm-event-type":"mark-as-complete",disabled:e,children:r.formatMessage({id:`markCompleteButton${e?"_completed":""}`})})},a_=({id:e,data:{jobTitle:t,name:n,organization:r,thumbnail:a}})=>({id:e,name:n,jobTitle:t,organization:r,image:{thumbnail:a}}),kc=[{contentType:"solutionArticle",banner:{description:"",url:"//images.ctfassets.net/txbhe1wabmyx/kCcBdXurt3uOKu6NdTPm0/1b6d19179b21f98dbdadf2477c03d267/devin-avery-7gwqj0yyrhm-unsplash.jpg",width:295,height:180,type:"image/jpeg",aspect:"responsiveCard",query:"w=295&h=180&fit=thumb&f=center"},slug:"why-public-servants-must-learn-to-fail",contributors:["community"]},{contentType:"solutionArticle",banner:{description:"",url:"//images.ctfassets.net/txbhe1wabmyx/12Y0W1K0zVcDKzgLZlbfyC/6eb0757a02cbeea19b1b42d7da04d553/ashkan-forouzani-m0l9nbcivuk-unsplash.jpg",width:295,height:180,type:"image/jpeg",aspect:"responsiveCard",query:"w=295&h=180&fit=thumb&f=center"},slug:"organisational-culture-change-and-failure",contributors:[{name:"Mari-Liis",id:"bdb7509c-89ed-4633-8bc0-dbf11f5d9be1"}]},{contentType:"solutionArticle",banner:{description:"",url:"//images.ctfassets.net/txbhe1wabmyx/26TEwu0xVkbQDguuW89fY6/d54ce406cdd652d68979770d526398ab/nik-shuliahin-bunwp1bl0nc-unsplash.jpg",width:295,height:180,type:"image/jpeg",aspect:"responsiveCard",query:"w=295&h=180&fit=thumb&f=center"},slug:"how-to-learn-from-failure-without-causing-a-scandal",contributors:["community"]}];const ma="notFoundError_",i_=()=>{const e=oe.useIntl(),t=[];return kc.forEach((n,r)=>{n.title=e.formatMessage({id:`${ma}post_${r+1}`}),t.push("solutionArticle")}),d.jsxs(lh,{styling:{background:"bold",circle:"small",variant:"alt-2"},additionalContent:{appended:d.jsxs(mn,{children:[d.jsx(Eh,{cards:kc,cardTypes:t,buildCardData:n=>new Promise((r,a)=>{r(n)})}),d.jsx(ke,{href:"/solution-articles/",children:e.formatMessage({id:`${ma}cta`})})]})},reportError:()=>{},className:"not-found-error",children:[d.jsx("h1",{children:e.formatMessage({id:`${ma}title`})}),d.jsx("p",{children:e.formatMessage({id:`${ma}text`})})]})};exports.ASSETS_BUCKET=Lt;exports.ActivitiesFeed=fE;exports.ActivitySection=SE;exports.AddPost=No;exports.Banner=$E;exports.BannerSection=qE;exports.Breadcrumbs=Fp;exports.Buckets=um;exports.Button=ke;exports.ButtonWrapper=ir;exports.COURSE_CONTENT_TYPES=br;exports.CacheProvider=hd;exports.Card=Io;exports.CardBlock=Eh;exports.Carousel=e_;exports.CharacterLimit=ao;exports.CollapsibleSection=Ga;exports.Columns=wd;exports.CommunityDetails=kp;exports.ContactFooter=Fw;exports.ContactForm=rh;exports.ContentTypeLabel=Yc;exports.Contributors=Ys;exports.ConversationContext=oi;exports.CookieBanner=uh;exports.CourseProgression=t_;exports.CourseStructure=n_;exports.CustomContentBanner=WE;exports.CustomEvents=Nt;exports.Directory=NE;exports.DiscussionConversation=ch;exports.DiscussionForm=Wr;exports.DiscussionFormCard=fh;exports.DiscussionFormModal=wh;exports.DiscussionLikes=dh;exports.DiscussionPost=Ur;exports.DiscussionThread=mh;exports.Divider=zt;exports.DownloadSection=ww;exports.EMAILS=zn;exports.EditSection=_w;exports.EmailHelperTextBox=_d;exports.EmptyStateBox=cn;exports.FeatureFlags=Xs;exports.Filters=Bp;exports.FlagsProvider=pd;exports.Footer=jo;exports.Form=Qt;exports.Formatting=Z;exports.Fragment=Dt;exports.FullWidthSection=mn;exports.GET_STREAM_USER_PREFIX=ds;exports.GlobalProviders=_p;exports.Header=Oo;exports.HelperTextBox=Qc;exports.HiddenFromScreenReaders=Ka;exports.HideShowTextBox=Jc;exports.HighlightSection=HE;exports.HighlightedTextBox=$t;exports.INVALID_TOKEN=Lc;exports.IconBulletedList=dm;exports.ImageContainer=im;exports.IntlProvider=gd;exports.InviteForm=ah;exports.InviteModal=OE;exports.JoinButton=no;exports.LanguageContext=eo;exports.LanguageSwitcher=Tp;exports.LessonName=_h;exports.LessonType=kh;exports.Link=jn;exports.LoadMore=zr;exports.LoadingBlock=xm;exports.LoadingPlaceholder=_t;exports.LoadingState=Zs;exports.Logo=ro;exports.LogoSection=kw;exports.MENTION_REGEX=zc;exports.MarkCompleteButton=r_;exports.MarkdownText=En;exports.MarketingBlock=VE;exports.Marks=Mt;exports.Member=_n;exports.MembersList=Ow;exports.Modal=Gs;exports.MoreMenu=Dd;exports.NUMBER_OF_COUNTRIES=Vh;exports.NUMBER_OF_USERS=Hh;exports.NavigationMenu=xd;exports.NotFoundError=i_;exports.Overlay=dn;exports.OverlayContext=to;exports.OverlayProvider=yd;exports.PageHeading=Xc;exports.PageLayout=lh;exports.PasswordForm=gw;exports.PasswordRules=Td;exports.Pill=Cn;exports.Popover=Zc;exports.Portal=Ya;exports.ProfileForm=ih;exports.ProfileImageChange=nh;exports.ProfileModal=PE;exports.ProfilePicture=Gt;exports.ProgressBar=Ks;exports.ProgressTracker=sm;exports.Rating=Zp;exports.RepliesFeed=xh;exports.ResponsesHeading=hh;exports.ResponsiveImage=sr;exports.ReturnToNavButton=om;exports.RichTextEditor=th;exports.SearchForm=sh;exports.ShareLinks=Np;exports.SignupForm=xw;exports.Span=ps;exports.StatusBanner=Tr;exports.TableOfContents=IE;exports.Tabs=Rp;exports.Tags=jw;exports.TestimonialBlock=ME;exports.TimeToComplete=ui;exports.Toggle=pw;exports.Tooltip=Sn;exports.TopLevelPage=Bw;exports.UUID_V4_REGEX=Ar;exports.UserContext=Tt;exports.UserProvider=vd;exports.VisuallyHidden=Ie;exports.addAriaProps=Cd;exports.basicReducer=Lr;exports.camelCaseToDashCase=Mc;exports.checkIntlPathExists=Za;exports.generateConditions=_a;exports.generateCssIcon=qc;exports.getCharacterLimitProps=Ed;exports.getLongDate=Vs;exports.getMember=Qa;exports.getPostBody=Po;exports.getShortDate=Wc;exports.getValueLength=Xa;exports.headerData=$r;exports.mapGetStreamData=a_;exports.pageReady=Uc;exports.passwordValidator=hs;exports.repliesFeedMock=hE;exports.supportedLanguages=ba;exports.toCamelCase=Ic;exports.toCapitalisedCase=Uh;exports.toSentenceCase=$c;exports.useCurrentPath=Sc;exports.useEffectAfterMount=Qn;exports.useElementWidth=rr;exports.useOverlay=bd;exports.useScrollListener=Pc;exports.useScrollToHash=Us;exports.useTooltips=Hs;exports.useUser=Ja;