@apolitical/component-library 5.2.1 → 5.2.2

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
@@ -18,11 +18,11 @@
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 nu;function am(){return nu||(nu=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"),d=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),g=Symbol.iterator,f="@@iterator";function b(M){if(M===null||typeof M!="object")return null;var se=g&&M[g]||M[f];return typeof se=="function"?se:null}var v=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function C(M){{for(var se=arguments.length,ce=new Array(se>1?se-1:0),xe=1;xe<se;xe++)ce[xe-1]=arguments[xe];F("error",M,ce)}}function F(M,se,ce){{var xe=v.ReactDebugCurrentFrame,Pe=xe.getStackAddendum();Pe!==""&&(se+="%s",ce=ce.concat([Pe]));var ze=ce.map(function(Te){return String(Te)});ze.unshift("Warning: "+se),Function.prototype.apply.call(console[M],console,ze)}}var _=!1,w=!1,k=!1,j=!1,q=!1,P;P=Symbol.for("react.module.reference");function z(M){return!!(typeof M=="string"||typeof M=="function"||M===r||M===i||q||M===a||M===u||M===d||j||M===p||_||w||k||typeof M=="object"&&M!==null&&(M.$$typeof===m||M.$$typeof===h||M.$$typeof===s||M.$$typeof===o||M.$$typeof===l||M.$$typeof===P||M.getModuleId!==void 0))}function R(M,se,ce){var xe=M.displayName;if(xe)return xe;var Pe=se.displayName||se.name||"";return Pe!==""?ce+"("+Pe+")":ce}function A(M){return M.displayName||"Context"}function E(M){if(M==null)return null;if(typeof M.tag=="number"&&C("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof M=="function")return M.displayName||M.name||null;if(typeof M=="string")return M;switch(M){case r:return"Fragment";case n:return"Portal";case i:return"Profiler";case a:return"StrictMode";case u:return"Suspense";case d:return"SuspenseList"}if(typeof M=="object")switch(M.$$typeof){case o:var se=M;return A(se)+".Consumer";case s:var ce=M;return A(ce._context)+".Provider";case l:return R(M,M.render,"ForwardRef");case h:var xe=M.displayName||null;return xe!==null?xe:E(M.type)||"Memo";case m:{var Pe=M,ze=Pe._payload,Te=Pe._init;try{return E(Te(ze))}catch{return null}}}return null}var S=Object.assign,O=0,V,H,Q,ae,D,$,ee;function B(){}B.__reactDisabledLog=!0;function T(){{if(O===0){V=console.log,H=console.info,Q=console.warn,ae=console.error,D=console.group,$=console.groupCollapsed,ee=console.groupEnd;var M={configurable:!0,enumerable:!0,value:B,writable:!0};Object.defineProperties(console,{info:M,log:M,warn:M,error:M,group:M,groupCollapsed:M,groupEnd:M})}O++}}function L(){{if(O--,O===0){var M={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:S({},M,{value:V}),info:S({},M,{value:H}),warn:S({},M,{value:Q}),error:S({},M,{value:ae}),group:S({},M,{value:D}),groupCollapsed:S({},M,{value:$}),groupEnd:S({},M,{value:ee})})}O<0&&C("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var I=v.ReactCurrentDispatcher,W;function U(M,se,ce){{if(W===void 0)try{throw Error()}catch(Pe){var xe=Pe.stack.trim().match(/\n( *(at )?)/);W=xe&&xe[1]||""}return`
22
- `+W+M}}var ne=!1,re;{var le=typeof WeakMap=="function"?WeakMap:Map;re=new le}function X(M,se){if(!M||ne)return"";{var ce=re.get(M);if(ce!==void 0)return ce}var xe;ne=!0;var Pe=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var ze;ze=I.current,I.current=null,T();try{if(se){var Te=function(){throw Error()};if(Object.defineProperty(Te.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Te,[])}catch(Kt){xe=Kt}Reflect.construct(M,[],Te)}else{try{Te.call()}catch(Kt){xe=Kt}M.call(Te.prototype)}}else{try{throw Error()}catch(Kt){xe=Kt}M()}}catch(Kt){if(Kt&&xe&&typeof Kt.stack=="string"){for(var Ae=Kt.stack.split(`
21
+ */var nu;function am(){return nu||(nu=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"),d=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),g=Symbol.iterator,f="@@iterator";function b(M){if(M===null||typeof M!="object")return null;var se=g&&M[g]||M[f];return typeof se=="function"?se:null}var v=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function C(M){{for(var se=arguments.length,ce=new Array(se>1?se-1:0),xe=1;xe<se;xe++)ce[xe-1]=arguments[xe];F("error",M,ce)}}function F(M,se,ce){{var xe=v.ReactDebugCurrentFrame,Pe=xe.getStackAddendum();Pe!==""&&(se+="%s",ce=ce.concat([Pe]));var ze=ce.map(function(Te){return String(Te)});ze.unshift("Warning: "+se),Function.prototype.apply.call(console[M],console,ze)}}var _=!1,w=!1,k=!1,j=!1,q=!1,P;P=Symbol.for("react.module.reference");function z(M){return!!(typeof M=="string"||typeof M=="function"||M===r||M===i||q||M===a||M===u||M===d||j||M===p||_||w||k||typeof M=="object"&&M!==null&&(M.$$typeof===m||M.$$typeof===h||M.$$typeof===s||M.$$typeof===o||M.$$typeof===l||M.$$typeof===P||M.getModuleId!==void 0))}function R(M,se,ce){var xe=M.displayName;if(xe)return xe;var Pe=se.displayName||se.name||"";return Pe!==""?ce+"("+Pe+")":ce}function A(M){return M.displayName||"Context"}function E(M){if(M==null)return null;if(typeof M.tag=="number"&&C("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof M=="function")return M.displayName||M.name||null;if(typeof M=="string")return M;switch(M){case r:return"Fragment";case n:return"Portal";case i:return"Profiler";case a:return"StrictMode";case u:return"Suspense";case d:return"SuspenseList"}if(typeof M=="object")switch(M.$$typeof){case o:var se=M;return A(se)+".Consumer";case s:var ce=M;return A(ce._context)+".Provider";case l:return R(M,M.render,"ForwardRef");case h:var xe=M.displayName||null;return xe!==null?xe:E(M.type)||"Memo";case m:{var Pe=M,ze=Pe._payload,Te=Pe._init;try{return E(Te(ze))}catch{return null}}}return null}var S=Object.assign,O=0,V,H,Q,ae,D,$,X;function B(){}B.__reactDisabledLog=!0;function T(){{if(O===0){V=console.log,H=console.info,Q=console.warn,ae=console.error,D=console.group,$=console.groupCollapsed,X=console.groupEnd;var M={configurable:!0,enumerable:!0,value:B,writable:!0};Object.defineProperties(console,{info:M,log:M,warn:M,error:M,group:M,groupCollapsed:M,groupEnd:M})}O++}}function L(){{if(O--,O===0){var M={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:S({},M,{value:V}),info:S({},M,{value:H}),warn:S({},M,{value:Q}),error:S({},M,{value:ae}),group:S({},M,{value:D}),groupCollapsed:S({},M,{value:$}),groupEnd:S({},M,{value:X})})}O<0&&C("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var I=v.ReactCurrentDispatcher,W;function U(M,se,ce){{if(W===void 0)try{throw Error()}catch(Pe){var xe=Pe.stack.trim().match(/\n( *(at )?)/);W=xe&&xe[1]||""}return`
22
+ `+W+M}}var ne=!1,re;{var le=typeof WeakMap=="function"?WeakMap:Map;re=new le}function ee(M,se){if(!M||ne)return"";{var ce=re.get(M);if(ce!==void 0)return ce}var xe;ne=!0;var Pe=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var ze;ze=I.current,I.current=null,T();try{if(se){var Te=function(){throw Error()};if(Object.defineProperty(Te.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Te,[])}catch(Kt){xe=Kt}Reflect.construct(M,[],Te)}else{try{Te.call()}catch(Kt){xe=Kt}M.call(Te.prototype)}}else{try{throw Error()}catch(Kt){xe=Kt}M()}}catch(Kt){if(Kt&&xe&&typeof Kt.stack=="string"){for(var Ae=Kt.stack.split(`
23
23
  `),ut=xe.stack.split(`
24
24
  `),Ge=Ae.length-1,Je=ut.length-1;Ge>=1&&Je>=0&&Ae[Ge]!==ut[Je];)Je--;for(;Ge>=1&&Je>=0;Ge--,Je--)if(Ae[Ge]!==ut[Je]){if(Ge!==1||Je!==1)do if(Ge--,Je--,Je<0||Ae[Ge]!==ut[Je]){var _t=`
25
- `+Ae[Ge].replace(" at new "," at ");return M.displayName&&_t.includes("<anonymous>")&&(_t=_t.replace("<anonymous>",M.displayName)),typeof M=="function"&&re.set(M,_t),_t}while(Ge>=1&&Je>=0);break}}}finally{ne=!1,I.current=ze,L(),Error.prepareStackTrace=Pe}var In=M?M.displayName||M.name:"",eu=In?U(In):"";return typeof M=="function"&&re.set(M,eu),eu}function pe(M,se,ce){return X(M,!1)}function me(M){var se=M.prototype;return!!(se&&se.isReactComponent)}function _e(M,se,ce){if(M==null)return"";if(typeof M=="function")return X(M,me(M));if(typeof M=="string")return U(M);switch(M){case u:return U("Suspense");case d:return U("SuspenseList")}if(typeof M=="object")switch(M.$$typeof){case l:return pe(M.render);case h:return _e(M.type,se,ce);case m:{var xe=M,Pe=xe._payload,ze=xe._init;try{return _e(ze(Pe),se,ce)}catch{}}}return""}var Be=Object.prototype.hasOwnProperty,Se={},Ye=v.ReactDebugCurrentFrame;function Ke(M){if(M){var se=M._owner,ce=_e(M.type,M._source,se?se.type:null);Ye.setExtraStackFrame(ce)}else Ye.setExtraStackFrame(null)}function je(M,se,ce,xe,Pe){{var ze=Function.call.bind(Be);for(var Te in M)if(ze(M,Te)){var Ae=void 0;try{if(typeof M[Te]!="function"){var ut=Error((xe||"React class")+": "+ce+" type `"+Te+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof M[Te]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw ut.name="Invariant Violation",ut}Ae=M[Te](se,Te,xe,ce,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Ge){Ae=Ge}Ae&&!(Ae instanceof Error)&&(Ke(Pe),C("%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).",xe||"React class",ce,Te,typeof Ae),Ke(null)),Ae instanceof Error&&!(Ae.message in Se)&&(Se[Ae.message]=!0,Ke(Pe),C("Failed %s type: %s",ce,Ae.message),Ke(null))}}}var Oe=Array.isArray;function De(M){return Oe(M)}function Le(M){{var se=typeof Symbol=="function"&&Symbol.toStringTag,ce=se&&M[Symbol.toStringTag]||M.constructor.name||"Object";return ce}}function Ue(M){try{return G(M),!1}catch{return!0}}function G(M){return""+M}function oe(M){if(Ue(M))return C("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Le(M)),G(M)}var he=v.ReactCurrentOwner,ge={key:!0,ref:!0,__self:!0,__source:!0},Ee,be,we;we={};function et(M){if(Be.call(M,"ref")){var se=Object.getOwnPropertyDescriptor(M,"ref").get;if(se&&se.isReactWarning)return!1}return M.ref!==void 0}function Et(M){if(Be.call(M,"key")){var se=Object.getOwnPropertyDescriptor(M,"key").get;if(se&&se.isReactWarning)return!1}return M.key!==void 0}function ht(M,se){if(typeof M.ref=="string"&&he.current&&se&&he.current.stateNode!==se){var ce=E(he.current.type);we[ce]||(C('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',E(he.current.type),M.ref),we[ce]=!0)}}function Qe(M,se){{var ce=function(){Ee||(Ee=!0,C("%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(M,"key",{get:ce,configurable:!0})}}function yt(M,se){{var ce=function(){be||(be=!0,C("%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(M,"ref",{get:ce,configurable:!0})}}var xt=function(M,se,ce,xe,Pe,ze,Te){var Ae={$$typeof:t,type:M,key:se,ref:ce,props:Te,_owner:ze};return Ae._store={},Object.defineProperty(Ae._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Ae,"_self",{configurable:!1,enumerable:!1,writable:!1,value:xe}),Object.defineProperty(Ae,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Pe}),Object.freeze&&(Object.freeze(Ae.props),Object.freeze(Ae)),Ae};function pi(M,se,ce,xe,Pe){{var ze,Te={},Ae=null,ut=null;ce!==void 0&&(oe(ce),Ae=""+ce),Et(se)&&(oe(se.key),Ae=""+se.key),et(se)&&(ut=se.ref,ht(se,Pe));for(ze in se)Be.call(se,ze)&&!ge.hasOwnProperty(ze)&&(Te[ze]=se[ze]);if(M&&M.defaultProps){var Ge=M.defaultProps;for(ze in Ge)Te[ze]===void 0&&(Te[ze]=Ge[ze])}if(Ae||ut){var Je=typeof M=="function"?M.displayName||M.name||"Unknown":M;Ae&&Qe(Te,Je),ut&&yt(Te,Je)}return xt(M,Ae,ut,Pe,xe,he.current,Te)}}var fr=v.ReactCurrentOwner,Gr=v.ReactDebugCurrentFrame;function Rn(M){if(M){var se=M._owner,ce=_e(M.type,M._source,se?se.type:null);Gr.setExtraStackFrame(ce)}else Gr.setExtraStackFrame(null)}var gi;gi=!1;function vi(M){return typeof M=="object"&&M!==null&&M.$$typeof===t}function Yo(){{if(fr.current){var M=E(fr.current.type);if(M)return`
25
+ `+Ae[Ge].replace(" at new "," at ");return M.displayName&&_t.includes("<anonymous>")&&(_t=_t.replace("<anonymous>",M.displayName)),typeof M=="function"&&re.set(M,_t),_t}while(Ge>=1&&Je>=0);break}}}finally{ne=!1,I.current=ze,L(),Error.prepareStackTrace=Pe}var In=M?M.displayName||M.name:"",eu=In?U(In):"";return typeof M=="function"&&re.set(M,eu),eu}function pe(M,se,ce){return ee(M,!1)}function me(M){var se=M.prototype;return!!(se&&se.isReactComponent)}function _e(M,se,ce){if(M==null)return"";if(typeof M=="function")return ee(M,me(M));if(typeof M=="string")return U(M);switch(M){case u:return U("Suspense");case d:return U("SuspenseList")}if(typeof M=="object")switch(M.$$typeof){case l:return pe(M.render);case h:return _e(M.type,se,ce);case m:{var xe=M,Pe=xe._payload,ze=xe._init;try{return _e(ze(Pe),se,ce)}catch{}}}return""}var Be=Object.prototype.hasOwnProperty,Se={},Ye=v.ReactDebugCurrentFrame;function Ke(M){if(M){var se=M._owner,ce=_e(M.type,M._source,se?se.type:null);Ye.setExtraStackFrame(ce)}else Ye.setExtraStackFrame(null)}function je(M,se,ce,xe,Pe){{var ze=Function.call.bind(Be);for(var Te in M)if(ze(M,Te)){var Ae=void 0;try{if(typeof M[Te]!="function"){var ut=Error((xe||"React class")+": "+ce+" type `"+Te+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof M[Te]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw ut.name="Invariant Violation",ut}Ae=M[Te](se,Te,xe,ce,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Ge){Ae=Ge}Ae&&!(Ae instanceof Error)&&(Ke(Pe),C("%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).",xe||"React class",ce,Te,typeof Ae),Ke(null)),Ae instanceof Error&&!(Ae.message in Se)&&(Se[Ae.message]=!0,Ke(Pe),C("Failed %s type: %s",ce,Ae.message),Ke(null))}}}var Oe=Array.isArray;function De(M){return Oe(M)}function Le(M){{var se=typeof Symbol=="function"&&Symbol.toStringTag,ce=se&&M[Symbol.toStringTag]||M.constructor.name||"Object";return ce}}function Ue(M){try{return G(M),!1}catch{return!0}}function G(M){return""+M}function oe(M){if(Ue(M))return C("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Le(M)),G(M)}var he=v.ReactCurrentOwner,ge={key:!0,ref:!0,__self:!0,__source:!0},Ee,be,we;we={};function et(M){if(Be.call(M,"ref")){var se=Object.getOwnPropertyDescriptor(M,"ref").get;if(se&&se.isReactWarning)return!1}return M.ref!==void 0}function Et(M){if(Be.call(M,"key")){var se=Object.getOwnPropertyDescriptor(M,"key").get;if(se&&se.isReactWarning)return!1}return M.key!==void 0}function ht(M,se){if(typeof M.ref=="string"&&he.current&&se&&he.current.stateNode!==se){var ce=E(he.current.type);we[ce]||(C('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',E(he.current.type),M.ref),we[ce]=!0)}}function Qe(M,se){{var ce=function(){Ee||(Ee=!0,C("%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(M,"key",{get:ce,configurable:!0})}}function yt(M,se){{var ce=function(){be||(be=!0,C("%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(M,"ref",{get:ce,configurable:!0})}}var xt=function(M,se,ce,xe,Pe,ze,Te){var Ae={$$typeof:t,type:M,key:se,ref:ce,props:Te,_owner:ze};return Ae._store={},Object.defineProperty(Ae._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Ae,"_self",{configurable:!1,enumerable:!1,writable:!1,value:xe}),Object.defineProperty(Ae,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Pe}),Object.freeze&&(Object.freeze(Ae.props),Object.freeze(Ae)),Ae};function pi(M,se,ce,xe,Pe){{var ze,Te={},Ae=null,ut=null;ce!==void 0&&(oe(ce),Ae=""+ce),Et(se)&&(oe(se.key),Ae=""+se.key),et(se)&&(ut=se.ref,ht(se,Pe));for(ze in se)Be.call(se,ze)&&!ge.hasOwnProperty(ze)&&(Te[ze]=se[ze]);if(M&&M.defaultProps){var Ge=M.defaultProps;for(ze in Ge)Te[ze]===void 0&&(Te[ze]=Ge[ze])}if(Ae||ut){var Je=typeof M=="function"?M.displayName||M.name||"Unknown":M;Ae&&Qe(Te,Je),ut&&yt(Te,Je)}return xt(M,Ae,ut,Pe,xe,he.current,Te)}}var fr=v.ReactCurrentOwner,Gr=v.ReactDebugCurrentFrame;function Rn(M){if(M){var se=M._owner,ce=_e(M.type,M._source,se?se.type:null);Gr.setExtraStackFrame(ce)}else Gr.setExtraStackFrame(null)}var gi;gi=!1;function vi(M){return typeof M=="object"&&M!==null&&M.$$typeof===t}function Yo(){{if(fr.current){var M=E(fr.current.type);if(M)return`
26
26
 
27
27
  Check the render method of \``+M+"`."}return""}}function qh(M){{if(M!==void 0){var se=M.fileName.replace(/^.*[\\\/]/,""),ce=M.lineNumber;return`
28
28
 
@@ -32,7 +32,7 @@ Check the top-level render call using <`+ce+">.")}return se}}function Qo(M,se){{
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_showAll:"Show all...",discussion_likes_like:"Like this {action}",discussion_likes_unlike:"Unlike {action}",discussion_likes_show:"Show who liked this {action}",discussion_moreMenu_edit:"Edit",discussion_moreMenu_delete:"Delete",discussion_moreMenu_pin:"Pin post",discussion_moreMenu_unpin:"Unpin post",discussion_moreMenu_report:"Report",discussion_comments_screenReader:"See {count, plural, =0 {0 comments} one {# comment} other {# comments}}",discussion_comments:"{count, plural, =0 {0 comments} one {# comment} other {# comments}}",discussion_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",profileForm_cta_submitting:"Saving...",profileForm_cta_submitted:"Saved",profileImageChange_cta_uploading:"Uploading image...",profileImageChange_cta_change:"Change photo",profileImageChange_cta_upload:"+ Add profile photo",profileImageChange_error:"There was an error uploading the image. Please try a different file format or reduce the file size to less than 5MB. Contact us if problem persists.",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, data and AI",header_topics_topics_education:"Education","header_topics_topics_equity-justice-and-inclusion":"Equity, justice and inclusion","header_topics_topics_health-and-social-care":"Health and social care",header_topics_topics_innovation:"Innovation","header_topics_topics_leadership-and-skills":"Leadership and skills","header_topics_topics_life-in-government":"Life in government",header_topics_topics_policymaking:"Policymaking","header_topics_topics_transport-and-infrastructure":"Transport and infrastructure","header_topics_topics_work-and-the-economy":"Work and the economy",header_partners:"For partners",header_account:"My account",header_account_show:"Show account menu",header_account_hide:"Close account menu",header_account_profile:"My profile",header_account_settings:"Settings & privacy","header_account_log-out":"Log out",header_buttons_login:"Log in",header_buttons_signup:"Sign up",pageLayout_error:"An error occurred while rendering this page. Please refresh the page or try again later.",loadingBlock_loading:"Loading...",loadingBlock_almostDone:"Almost done...",loadingBlock_complete:"Complete!",progressBar:"{number}% loaded",discussionFormModal_title:"Create a post",discussionFormModal_cta:"Create post",inviteModal_title:"You’re registered",inviteModal_formTitle:"Know someone who might like to join this workshop?",inviteModal_formLabel:"Invite your colleagues by typing or pasting their email addresses below.",inviteModal_cta:"Send",overlay_close:"Close",profileModal_title:"Update your profile",breadcrumbs_label:"Go back to:",breadcrumbs_currentPage:"Current page:",filters_all:"Show all",filters_disabled:"{name} - no results",languageSwitcher_label:"I would like to read this article in...",languageSwitcher_translation_original:"original language",languageSwitcher_translation_human:"translated by person",languageSwitcher_translation_machine:"translated by machine",languageSwitcher_selected:"{language} - currently selected",languageSwitcher_disclaimer:"This content is machine translated and will occasionally get gendered language or other direct translations wrong. We’re trying to resolve this but in the meantime, if you notice something very wrong, let us know at <link>{email}</link>",loadMore_button:"Load more",loadMore_endOfFeed:"You're all caught up",loadMore_error:"We're having trouble loading more content. Please refresh the page or try again later.",moreMenu:"See more options",navigationMenu_links_homepage:"Home",navigationMenu_links_events:"Events",navigationMenu_links_microcourses:"Courses","navigationMenu_links_q-and-a":"Q&A",navigationMenu_links_articles:"Articles",navigationMenu_links_communities:"Communities",shareLinks_label:"Share",shareLinks_link_linkedin:"Share on LinkedIn",shareLinks_link_twitter:"Share on Twitter",shareLinks_link_facebook:"Share on Facebook",shareLinks_link_email:"Share by email","shareLinks_link_clipboard-copy":"Copy the link",tags_community:"From the community",editSection_placeholder_description:"Add some details",editSection_placeholder_cta:"add",editSection_edit:"Edit",notFoundError_title:"We can't find that page",notFoundError_text:"Sorry about that. We all mess up sometimes - read some ‘fail’ stories below.",notFoundError_post_1:"Why public servants must learn to fail — and 3 tips for how to do it",notFoundError_post_2:"What failure has taught me",notFoundError_post_3:"How to learn from failure without causing a scandal",notFoundError_cta:"View more articles",collapsibleSection_summary:"Find out more",contentTypeLabel_event:"Event",contentTypeLabel_learningHub:"Programme",contentTypeLabel_listPage:"List",contentTypeLabel_microcourse:"Course",contentTypeLabel_qaQuestion:"Q&A",contentTypeLabel_solutionArticle:"Article",contentTypeLabel_communityPage:"Community",hideShowTextBox_hide:"View less",hideShowTextBox_show:"View more",markdown_collapsibleSection_summary:"Resources",markdown_skip_video:"Skip past video",markdown_skip_padlet:"Skip past interactive board",markdown_skip_poll:"Skip past poll",markdown_skip:"Skip to next section",markdown_iframe_title:"Course information",markdown_iframe_video:"Video",markdown_iframe_padlet:"Interactive board",markdown_iframe_poll:"Poll"},hm={...sr,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>"},mm={...sr,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"},pm={...sr,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>"},gm=Object.freeze(Object.defineProperty({__proto__:null,en:sr,es:hm,fr:mm,pt:pm},Symbol.toStringTag,{value:"Module"})),Xa=(e,t=sr)=>e in t,jt=(e,t,n,r,a={})=>{let i="";return Xa(`${t}_${n}`)?i=e({id:`${t}_${n}`},a):i=e({id:t},{[r]:n,...a}),i},vm=(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},Da=(e,t)=>y.Children.map(e,n=>Object.is(n,null)?n:y.cloneElement(n,{...t})),Gc=(e=0)=>{setTimeout(()=>{const t=document.querySelector(".splash-screen");t&&t.remove(),window.prerenderReady=!0},e)},bm=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},ym=(e,t,n)=>!t.id||!t.name?"":t.error?n.replace(/{{name}}/g,Or).replace(/{{id}}/g,Or):n.replace(/{{name}}/g,t.name).replace(/{{id}}/g,t.id),Qc=async({text:e,template:t,mentions:n,listMembers:r=()=>Promise.resolve([])})=>{var i;if(!n)return e;const a=e.match(Pr);if(!a)return e;for(const s of a){const o=s.replace(Pr,(d,h)=>h),l=n[o];if(!l)continue;const u={};if(typeof l=="object")u.name=l.error?l.error:((i=l==null?void 0:l.data)==null?void 0:i.name)||"",u.id=l.id||"",u.error=l.error;else{const d=l;if(d.startsWith(vs))try{const h=d.replace(vs,"");u.id=h,await r({id:h}).then(m=>{const{name:p,error:g}=m;u.name=g||p||"",u.error=g})}catch{e.replace(s,"@");continue}else continue}e=e.replace(s,u.name?ym(e,u,t):s)}return e},Jc=e=>{const t=e.startsWith("http")?e:`https://${e}`,r=new URL(t).hostname;return{full:t,pretty:r}},Xc=e=>new URLSearchParams(window.location.search).get(e),au=(e="")=>e.replace(/\s+/g,"").length>0,ys=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 Fe=({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:d=!1,children:h=!1,...m})=>{const g=Pn(typeof t=="object"),{showTooltip:f,tooltipProps:b}=Js(!!u);if(typeof t=="object"&&typeof g=="number"){const _=Object.assign({},t),w=qc(Object.keys(_));t=Wc(g,w,_)}!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 C={...m,className:K(e,o,v,{"no-text":!h,disabled:l,button:a}),onClick:_=>{(!a||a[0]==="#")&&s&&(_.preventDefault(),_.stopPropagation()),s&&s(_)},disabled:typeof l=="object"&&"isClickable"in l?!l.isClickable:l};a&&(i="a",C.href=a);const F=y.createElement(i,C,h||(d?c.jsx(Ie,{showOnFocus:!1,children:d}):null));return l&&u?c.jsxs("span",{className:"button-container",...b,children:[c.jsx(Mn,{isOpen:f,accessibility:{readToScreenreadersWhenClosed:!0},children:u}),F]}):F},or=({buttons:e,wrappers:t=[],className:n="",...r})=>{const a=e.length>1?"ul":"p",i=e.map((s,o)=>{var l;return a==="p"?c.jsx(Fe,{...s},o):c.jsx("li",{className:((l=t[o])==null?void 0:l.className)||"",children:c.jsx(Fe,{...s})},o)});return y.createElement(a,{className:K("button-wrapper",n),...r,children:i})};const Ht=({className:e="",maxWidth:t=!1})=>{const n=t?{"--max-width":`${t/16}rem`}:{};return c.jsx("hr",{className:K(e,{"has-max-width":t}),style:n})},iu={card:{range:[{height:320,width:320},{height:425,width:687},{height:510,width:768}],sizes:"(min-width: 1024px) 720px, 30vw"},responsiveCard:{range:[{height:125,width:200},{height:188,width:300},{height:313,width:500}],sizes:"(min-width: 1024px) 720px, 30vw"},banner:{range:[{height:124,width:425},{height:320,width:768},{height:510,width:1368}],sizes:"(min-width: 1024px) 975px, 50vw"},feed:{range:[{height:270,width:124},{height:320,width:425},{height:425,width:687}],sizes:"(min-width: 1024px) 510px, 20vw"},highlightSection:{range:[{height:200,width:674},{height:400,width:1348},{height:1e3,width:1e3},{height:2e3,width:2e3}],sizes:"(max-width: 500px) 674px, (max-width: 1024px) 1348px, (max-width: 1200px) 1000px, 2000px"},thumbnail:{range:[{height:124,width:124},{height:320,width:320},{height:510,width:510}],sizes:"(min-width: 1024px) 453px, 20vw"},fallback:{range:[{height:124,width:375},{height:320,width:687},{height:510,width:990}],sizes:"(min-width: 1024px) 885px, 35vw"}},xm=({aspect:e,range:t,sizes:n})=>{const{range:r,sizes:a}=e?iu[e]:iu.fallback;return{range:t&&t.length>0?t:r,sizes:n||a}},Dm=({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},yi=({format:e,range:t,url:n,query:r})=>t.map(({height:a,width:i})=>`${n}?${Dm({format:e,height:a,query:r,width:i})} ${i}w`).join(", ");const ur=({image:e,className:t,testId:n})=>{const{description:r,height:a,type:i,query:s,url:o,width:l,loading:u,decoding:d,fetchPriority:h}=e,{range:m,sizes:p}=xm(e),g=yi({format:"avif",query:s,range:m,url:o}),f=yi({format:"webp",query:s,range:m,url:o}),b=yi({format:"",query:s,range:m,url:o});return i&&i.includes("svg")?c.jsx("picture",{className:t,children:c.jsx("img",{src:o,alt:r,loading:u||"lazy",decoding:d||"async",fetchpriority:h||"auto",width:l,height:a,"data-testid":n||"image"})}):c.jsxs("picture",{className:t,children:[i!=="image/gif"&&c.jsx("source",{type:"image/avif",srcSet:g,sizes:p,"data-testid":"source"}),c.jsx("source",{type:"image/webp",srcSet:f,sizes:p,"data-testid":"source"}),c.jsx("img",{srcSet:b,sizes:p,src:o,alt:r,loading:u||"lazy",decoding:d||"async",fetchpriority:h||"auto",width:l,height:a,"data-testid":n||"image"})]})};const Cm=({image:e,className:t="",testId:n})=>c.jsx("div",{className:`image-container ${t}`,"data-testid":n||"image-container",children:e&&c.jsx(ur,{image:{...e},className:"image"})}),mn=({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),c.jsx("a",{href:e,className:K("gtm-trackable",r),...l,children:t})}return n?y.createElement(n,{children:t,className:r,...o}):c.jsx(c.Fragment,{children:t})};const ed=y.forwardRef(({className:e="",children:t},n)=>{const r=y.useRef(null),a=n||r;return c.jsx("aside",{ref:a,className:K("popover",e),"aria-live":"polite",children:t})}),lr=({parent:e=document.body,children:t})=>typeof document=="object"?Pc.createPortal(t,e):null,wm=Object.freeze(Object.defineProperty({__proto__:null,default:lr},Symbol.toStringTag,{value:"Module"}));const Em=({currentStep:e=1,steps:t=1})=>c.jsxs(c.Fragment,{children:[c.jsx(Ie,{children:c.jsx(ie.FormattedMessage,{id:"progressTracker",values:{current:e,total:t}})}),c.jsx("div",{className:"progress-tracker",children:c.jsx("div",{className:"dots-wrapper",children:new Array(t).fill("").map((n,r)=>{const a=r+1;return c.jsxs("div",{className:"dot-wrapper",children:[c.jsx("div",{className:K("dot",{active:a===e,completed:a<e}),"data-testid":"progress-dot"}),c.jsx("div",{className:K("line",{active:a<e})})]},r)})})})]});const _m=({elementId:e,offset:t=20})=>{const n=ie.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 c.jsx(Fe,{variant:"secondary",className:"return-to-nav",onClick:r,"data-gtm-event-context":"ListPageMobile","data-gtm-event-type":"back-to-nav-button-click",screenreaderText:n.formatMessage({id:"return_to_nav_button"})})};const km=({items:e,className:t="",...n})=>c.jsx("ul",{className:K("buckets",t),...n,children:e.map(({title:r,text:a,link:i,...s},o)=>c.jsx("li",{className:"bucket text-medium",children:c.jsxs("a",{href:i,...s,children:[c.jsx("p",{className:"title",children:r}),c.jsx("p",{children:a})]})},o))}),su=300,ou="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:su,easing:ou}),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:su,easing:ou}),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 ei=({label:e=!1,className:t="",children:n,shouldAnimate:r=!1})=>{const a=ie.useIntl(),i=y.useRef(null);return y.useEffect(()=>{let s;return r&&(s=new Fm(i.current)),()=>{r&&s&&s.cleanUp()}},[]),c.jsxs("details",{ref:i,className:K("collapsible-section",t,{"should-animate":r}),children:[c.jsx("summary",{children:e||a.formatMessage({id:"collapsibleSection_summary"})}),c.jsx("div",{className:"content",children:n})]})},uu={cube:"box",graduationCap:"graduation-cap",person:"user",speech:"speech-bubble_round",star:"star_empty_thin"},Bm=e=>{let t=e;return Object.keys(uu).includes(e)&&(t=uu[e]),`url(${Ut}icons/${t}.svg)`};const lu={customCard:"custom",microcourse:"course",solutionArticle:"article",qaQuestion:"question",listPage:"list",learningHub:"learning-hub",communityPage:"communityPage"},td=({contentType:e,customIcon:t,customLabel:n,className:r=""})=>{const a=ie.useIntl(),i=t?{"--custom-icon":Bm(t)}:{},s=Xa(`contentTypeLabel_${e}`)?a.formatMessage({id:`contentTypeLabel_${e}`}):!1;return!n&&!s?null:c.jsx("small",{className:K("content-type-label text-small",e in lu?lu[e]:e,r,{"has-custom-icon":t}),style:i,"data-testid":"content-type-label",children:n||s})};const Mt=({variant:e="primary",icon:t,styling:n={},className:r="",children:a,...i})=>{const{showHighlight:s=!1,background:o="default"}=n,l=t?{"--icon":`url(${Ut}icons/${t}.svg)`}:{};return c.jsx("div",{className:K("highlighted-text-box",e,r,{"has-icon":t,"show-highlight":s,[o]:o!=="default"}),style:l,...i,children:a})};const pn=({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=Pn(i);if(i&&typeof n=="object"&&typeof s=="number"){const h=Object.assign({},n.breakpoints),m=qc(Object.keys(h));a=Wc(s,m,h)}const{breakpoints:o,text:l="",component:u,...d}=n;return c.jsx(Mt,{variant:"subtle",className:K("empty-state-box",e,r),children:c.jsxs(c.Fragment,{children:[t&&typeof t=="string"?c.jsx(Wt,{options:{forceBlock:!0},children:t}):t,a&&typeof n=="object"&&(u||c.jsx(Fe,{...d,variant:n.variant?n.variant:"secondary",children:l}))]})})};const xs=({children:e,...t})=>c.jsx("p",{...t,children:e}),nd={q:xs,blockquote:xs};for(let e=1;e<=6;e++)nd[`h${e}`]={component:xs,props:{className:"title"}};const rd=({type:e="default",className:t="",heading:n=!1,children:r,...a})=>c.jsxs("div",{...a,className:K("helper-text-box text-small",e,t),children:[n&&c.jsx("p",{className:"title",children:n}),typeof r=="string"?c.jsx(Wt,{options:{wrapper:y.Fragment,forceBlock:!0,overrides:nd},children:r}):c.jsx("p",{children:r})]});const ad=({id:e,className:t="",show:n=!1,hide:r=!1,text:a,markdownOptions:i,fadeStyle:s="default",children:o})=>{const l=ie.useIntl(),u=y.useRef(null);e||(e=Date.now().toString());const[d,h]=y.useState(""),[m,p]=y.useState("closed");y.useEffect(()=>{const b=u.current;if(b)return b.addEventListener("transitionend",g),()=>{b.removeEventListener("transitionend",g)}},[]),y.useEffect(()=>{if(!a||typeof a!="string")return;const b=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_showAll:"Show all...",discussion_likes_like:"Like this {action}",discussion_likes_unlike:"Unlike {action}",discussion_likes_show:"Show who liked this {action}",discussion_moreMenu_edit:"Edit",discussion_moreMenu_delete:"Delete",discussion_moreMenu_pin:"Pin post",discussion_moreMenu_unpin:"Unpin post",discussion_moreMenu_report:"Report",discussion_comments_screenReader:"See {count, plural, =0 {0 comments} one {# comment} other {# comments}}",discussion_comments:"{count, plural, =0 {0 comments} one {# comment} other {# comments}}",discussion_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",profileForm_cta_submitting:"Saving...",profileForm_cta_submitted:"Saved",profileImageChange_cta_uploading:"Uploading image...",profileImageChange_cta_change:"Change photo",profileImageChange_cta_upload:"+ Add profile photo",profileImageChange_error:"There was an error uploading the image. Please try a different file format or reduce the file size to less than 5MB. Contact us if problem persists.",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, data and AI",header_topics_topics_education:"Education","header_topics_topics_equity-justice-and-inclusion":"Equity, justice and inclusion","header_topics_topics_health-and-social-care":"Health and social care",header_topics_topics_innovation:"Innovation","header_topics_topics_leadership-and-skills":"Leadership and skills","header_topics_topics_life-in-government":"Life in government",header_topics_topics_policymaking:"Policymaking","header_topics_topics_transport-and-infrastructure":"Transport and infrastructure","header_topics_topics_work-and-the-economy":"Work and the economy",header_partners:"For partners",header_account:"My account",header_account_show:"Show account menu",header_account_hide:"Close account menu",header_account_profile:"My profile",header_account_settings:"Settings & privacy","header_account_log-out":"Log out",header_buttons_login:"Log in",header_buttons_signup:"Sign up",pageLayout_error:"An error occurred while rendering this page. Please refresh the page or try again later.",loadingBlock_loading:"Loading...",loadingBlock_almostDone:"Almost done...",loadingBlock_complete:"Complete!",progressBar:"{number}% loaded",discussionFormModal_title:"Create a post",discussionFormModal_cta:"Create post",inviteModal_title:"You’re registered",inviteModal_formTitle:"Know someone who might like to join this workshop?",inviteModal_formLabel:"Invite your colleagues by typing or pasting their email addresses below.",inviteModal_cta:"Send",overlay_close:"Close",profileModal_title:"Update your profile",breadcrumbs_label:"Go back to:",breadcrumbs_currentPage:"Current page:",filters_all:"Show all",filters_disabled:"{name} - no results",languageSwitcher_label:"I would like to read this article in...",languageSwitcher_translation_original:"original language",languageSwitcher_translation_human:"translated by person",languageSwitcher_translation_machine:"translated by machine",languageSwitcher_selected:"{language} - currently selected",languageSwitcher_disclaimer:"This content is machine translated and will occasionally get gendered language or other direct translations wrong. We’re trying to resolve this but in the meantime, if you notice something very wrong, let us know at <link>{email}</link>",loadMore_button:"Load more",loadMore_endOfFeed:"You're all caught up",loadMore_error:"We're having trouble loading more content. Please refresh the page or try again later.",moreMenu:"See more options",navigationMenu_links_homepage:"Home",navigationMenu_links_events:"Events",navigationMenu_links_microcourses:"Courses","navigationMenu_links_q-and-a":"Q&A",navigationMenu_links_articles:"Articles",navigationMenu_links_communities:"Communities",shareLinks_label:"Share",shareLinks_link_linkedin:"Share on LinkedIn",shareLinks_link_twitter:"Share on Twitter",shareLinks_link_facebook:"Share on Facebook",shareLinks_link_email:"Share by email","shareLinks_link_clipboard-copy":"Copy the link",tags_community:"From the community",editSection_placeholder_description:"Add some details",editSection_placeholder_cta:"add",editSection_edit:"Edit",notFoundError_title:"We can't find that page",notFoundError_text:"Sorry about that. We all mess up sometimes - read some ‘fail’ stories below.",notFoundError_post_1:"Why public servants must learn to fail — and 3 tips for how to do it",notFoundError_post_2:"What failure has taught me",notFoundError_post_3:"How to learn from failure without causing a scandal",notFoundError_cta:"View more articles",collapsibleSection_summary:"Find out more",contentTypeLabel_event:"Event",contentTypeLabel_learningHub:"Programme",contentTypeLabel_listPage:"List",contentTypeLabel_microcourse:"Course",contentTypeLabel_qaQuestion:"Q&A",contentTypeLabel_solutionArticle:"Article",contentTypeLabel_communityPage:"Community",hideShowTextBox_hide:"View less",hideShowTextBox_show:"View more",markdown_collapsibleSection_summary:"Resources",markdown_skip_video:"Skip past video",markdown_skip_padlet:"Skip past interactive board",markdown_skip_poll:"Skip past poll",markdown_skip:"Skip to next section",markdown_iframe_title:"Course information",markdown_iframe_video:"Video",markdown_iframe_padlet:"Interactive board",markdown_iframe_poll:"Poll"},hm={...sr,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>"},mm={...sr,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"},pm={...sr,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>"},gm=Object.freeze(Object.defineProperty({__proto__:null,en:sr,es:hm,fr:mm,pt:pm},Symbol.toStringTag,{value:"Module"})),Xa=(e,t=sr)=>e in t,jt=(e,t,n,r,a={})=>{let i="";return Xa(`${t}_${n}`)?i=e({id:`${t}_${n}`},a):i=e({id:t},{[r]:n,...a}),i},vm=(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},Da=(e,t)=>y.Children.map(e,n=>Object.is(n,null)?n:y.cloneElement(n,{...t})),Gc=(e=0)=>{setTimeout(()=>{const t=document.querySelector(".splash-screen");t&&t.remove(),window.prerenderReady=!0},e)},bm=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},ym=(e,t,n)=>!t.id||!t.name?"":t.error?n.replace(/{{name}}/g,Or).replace(/{{id}}/g,Or):n.replace(/{{name}}/g,t.name).replace(/{{id}}/g,t.id),Qc=async({text:e,template:t,mentions:n,listMembers:r=()=>Promise.resolve([])})=>{var i;if(!n)return e;const a=e.match(Pr);if(!a)return e;for(const s of a){const o=s.replace(Pr,(d,h)=>h),l=n[o];if(!l)continue;const u={};if(typeof l=="object")u.name=l.error?l.error:((i=l==null?void 0:l.data)==null?void 0:i.name)||"",u.id=l.id||"",u.error=l.error;else{const d=l;if(d.startsWith(vs))try{const h=d.replace(vs,"");u.id=h,await r({id:h}).then(m=>{const{name:p,error:g}=m;u.name=g||p||"",u.error=g})}catch{e.replace(s,"@");continue}else continue}e=e.replace(s,u.name?ym(e,u,t):s)}return e},Jc=e=>{const t=e.startsWith("http")?e:`https://${e}`,r=new URL(t).hostname;return{full:t,pretty:r}},Xc=e=>new URLSearchParams(window.location.search).get(e),au=(e="")=>e.replace(/\s+/g,"").length>0,ys=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 Fe=({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:d=!1,children:h=!1,...m})=>{const g=Pn(typeof t=="object"),{showTooltip:f,tooltipProps:b}=Js(!!u);if(typeof t=="object"&&typeof g=="number"){const _=Object.assign({},t),w=qc(Object.keys(_));t=Wc(g,w,_)}!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")));const C={...m,className:K(e,o,v,{"no-text":!h,disabled:l,button:a,muted:n.muted,"full-width":n.fullWidth}),onClick:_=>{(!a||a[0]==="#")&&s&&(_.preventDefault(),_.stopPropagation()),s&&s(_)},disabled:typeof l=="object"&&"isClickable"in l?!l.isClickable:l};a&&(i="a",C.href=a);const F=y.createElement(i,C,h||(d?c.jsx(Ie,{showOnFocus:!1,children:d}):null));return l&&u?c.jsxs("span",{className:"button-container",...b,children:[c.jsx(Mn,{isOpen:f,accessibility:{readToScreenreadersWhenClosed:!0},children:u}),F]}):F},or=({buttons:e,wrappers:t=[],className:n="",...r})=>{const a=e.length>1?"ul":"p",i=e.map((s,o)=>{var l;return a==="p"?c.jsx(Fe,{...s},o):c.jsx("li",{className:((l=t[o])==null?void 0:l.className)||"",children:c.jsx(Fe,{...s})},o)});return y.createElement(a,{className:K("button-wrapper",n),...r,children:i})};const Ht=({className:e="",maxWidth:t=!1})=>{const n=t?{"--max-width":`${t/16}rem`}:{};return c.jsx("hr",{className:K(e,{"has-max-width":t}),style:n})},iu={card:{range:[{height:320,width:320},{height:425,width:687},{height:510,width:768}],sizes:"(min-width: 1024px) 720px, 30vw"},responsiveCard:{range:[{height:125,width:200},{height:188,width:300},{height:313,width:500}],sizes:"(min-width: 1024px) 720px, 30vw"},banner:{range:[{height:124,width:425},{height:320,width:768},{height:510,width:1368}],sizes:"(min-width: 1024px) 975px, 50vw"},feed:{range:[{height:270,width:124},{height:320,width:425},{height:425,width:687}],sizes:"(min-width: 1024px) 510px, 20vw"},highlightSection:{range:[{height:200,width:674},{height:400,width:1348},{height:1e3,width:1e3},{height:2e3,width:2e3}],sizes:"(max-width: 500px) 674px, (max-width: 1024px) 1348px, (max-width: 1200px) 1000px, 2000px"},thumbnail:{range:[{height:124,width:124},{height:320,width:320},{height:510,width:510}],sizes:"(min-width: 1024px) 453px, 20vw"},fallback:{range:[{height:124,width:375},{height:320,width:687},{height:510,width:990}],sizes:"(min-width: 1024px) 885px, 35vw"}},xm=({aspect:e,range:t,sizes:n})=>{const{range:r,sizes:a}=e?iu[e]:iu.fallback;return{range:t&&t.length>0?t:r,sizes:n||a}},Dm=({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},yi=({format:e,range:t,url:n,query:r})=>t.map(({height:a,width:i})=>`${n}?${Dm({format:e,height:a,query:r,width:i})} ${i}w`).join(", ");const ur=({image:e,className:t,testId:n})=>{const{description:r,height:a,type:i,query:s,url:o,width:l,loading:u,decoding:d,fetchPriority:h}=e,{range:m,sizes:p}=xm(e),g=yi({format:"avif",query:s,range:m,url:o}),f=yi({format:"webp",query:s,range:m,url:o}),b=yi({format:"",query:s,range:m,url:o});return i&&i.includes("svg")?c.jsx("picture",{className:t,children:c.jsx("img",{src:o,alt:r,loading:u||"lazy",decoding:d||"async",fetchpriority:h||"auto",width:l,height:a,"data-testid":n||"image"})}):c.jsxs("picture",{className:t,children:[i!=="image/gif"&&c.jsx("source",{type:"image/avif",srcSet:g,sizes:p,"data-testid":"source"}),c.jsx("source",{type:"image/webp",srcSet:f,sizes:p,"data-testid":"source"}),c.jsx("img",{srcSet:b,sizes:p,src:o,alt:r,loading:u||"lazy",decoding:d||"async",fetchpriority:h||"auto",width:l,height:a,"data-testid":n||"image"})]})};const Cm=({image:e,className:t="",testId:n})=>c.jsx("div",{className:`image-container ${t}`,"data-testid":n||"image-container",children:e&&c.jsx(ur,{image:{...e},className:"image"})}),mn=({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),c.jsx("a",{href:e,className:K("gtm-trackable",r),...l,children:t})}return n?y.createElement(n,{children:t,className:r,...o}):c.jsx(c.Fragment,{children:t})};const ed=y.forwardRef(({className:e="",children:t},n)=>{const r=y.useRef(null),a=n||r;return c.jsx("aside",{ref:a,className:K("popover",e),"aria-live":"polite",children:t})}),lr=({parent:e=document.body,children:t})=>typeof document=="object"?Pc.createPortal(t,e):null,wm=Object.freeze(Object.defineProperty({__proto__:null,default:lr},Symbol.toStringTag,{value:"Module"}));const Em=({currentStep:e=1,steps:t=1})=>c.jsxs(c.Fragment,{children:[c.jsx(Ie,{children:c.jsx(ie.FormattedMessage,{id:"progressTracker",values:{current:e,total:t}})}),c.jsx("div",{className:"progress-tracker",children:c.jsx("div",{className:"dots-wrapper",children:new Array(t).fill("").map((n,r)=>{const a=r+1;return c.jsxs("div",{className:"dot-wrapper",children:[c.jsx("div",{className:K("dot",{active:a===e,completed:a<e}),"data-testid":"progress-dot"}),c.jsx("div",{className:K("line",{active:a<e})})]},r)})})})]});const _m=({elementId:e,offset:t=20})=>{const n=ie.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 c.jsx(Fe,{variant:"secondary",className:"return-to-nav",onClick:r,"data-gtm-event-context":"ListPageMobile","data-gtm-event-type":"back-to-nav-button-click",screenreaderText:n.formatMessage({id:"return_to_nav_button"})})};const km=({items:e,className:t="",...n})=>c.jsx("ul",{className:K("buckets",t),...n,children:e.map(({title:r,text:a,link:i,...s},o)=>c.jsx("li",{className:"bucket text-medium",children:c.jsxs("a",{href:i,...s,children:[c.jsx("p",{className:"title",children:r}),c.jsx("p",{children:a})]})},o))}),su=300,ou="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:su,easing:ou}),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:su,easing:ou}),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 ei=({label:e=!1,className:t="",children:n,shouldAnimate:r=!1})=>{const a=ie.useIntl(),i=y.useRef(null);return y.useEffect(()=>{let s;return r&&(s=new Fm(i.current)),()=>{r&&s&&s.cleanUp()}},[]),c.jsxs("details",{ref:i,className:K("collapsible-section",t,{"should-animate":r}),children:[c.jsx("summary",{children:e||a.formatMessage({id:"collapsibleSection_summary"})}),c.jsx("div",{className:"content",children:n})]})},uu={cube:"box",graduationCap:"graduation-cap",person:"user",speech:"speech-bubble_round",star:"star_empty_thin"},Bm=e=>{let t=e;return Object.keys(uu).includes(e)&&(t=uu[e]),`url(${Ut}icons/${t}.svg)`};const lu={customCard:"custom",microcourse:"course",solutionArticle:"article",qaQuestion:"question",listPage:"list",learningHub:"learning-hub",communityPage:"communityPage"},td=({contentType:e,customIcon:t,customLabel:n,className:r=""})=>{const a=ie.useIntl(),i=t?{"--custom-icon":Bm(t)}:{},s=Xa(`contentTypeLabel_${e}`)?a.formatMessage({id:`contentTypeLabel_${e}`}):!1;return!n&&!s?null:c.jsx("small",{className:K("content-type-label text-small",e in lu?lu[e]:e,r,{"has-custom-icon":t}),style:i,"data-testid":"content-type-label",children:n||s})};const Mt=({variant:e="primary",icon:t,styling:n={},className:r="",children:a,...i})=>{const{showHighlight:s=!1,background:o="default"}=n,l=t?{"--icon":`url(${Ut}icons/${t}.svg)`}:{};return c.jsx("div",{className:K("highlighted-text-box",e,r,{"has-icon":t,"show-highlight":s,[o]:o!=="default"}),style:l,...i,children:a})};const pn=({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=Pn(i);if(i&&typeof n=="object"&&typeof s=="number"){const h=Object.assign({},n.breakpoints),m=qc(Object.keys(h));a=Wc(s,m,h)}const{breakpoints:o,text:l="",component:u,...d}=n;return c.jsx(Mt,{variant:"subtle",className:K("empty-state-box",e,r),children:c.jsxs(c.Fragment,{children:[t&&typeof t=="string"?c.jsx(Wt,{options:{forceBlock:!0},children:t}):t,a&&typeof n=="object"&&(u||c.jsx(Fe,{...d,variant:n.variant?n.variant:"secondary",children:l}))]})})};const xs=({children:e,...t})=>c.jsx("p",{...t,children:e}),nd={q:xs,blockquote:xs};for(let e=1;e<=6;e++)nd[`h${e}`]={component:xs,props:{className:"title"}};const rd=({type:e="default",className:t="",heading:n=!1,children:r,...a})=>c.jsxs("div",{...a,className:K("helper-text-box text-small",e,t),children:[n&&c.jsx("p",{className:"title",children:n}),typeof r=="string"?c.jsx(Wt,{options:{wrapper:y.Fragment,forceBlock:!0,overrides:nd},children:r}):c.jsx("p",{children:r})]});const ad=({id:e,className:t="",show:n=!1,hide:r=!1,text:a,markdownOptions:i,fadeStyle:s="default",children:o})=>{const l=ie.useIntl(),u=y.useRef(null);e||(e=Date.now().toString());const[d,h]=y.useState(""),[m,p]=y.useState("closed");y.useEffect(()=>{const b=u.current;if(b)return b.addEventListener("transitionend",g),()=>{b.removeEventListener("transitionend",g)}},[]),y.useEffect(()=>{if(!a||typeof a!="string")return;const b=a.split(`
36
36
  `);h(b.length<3?`${a.substring(0,400)}...`:b.slice(0,3).join(`
37
37
  `))},[a]),y.useEffect(()=>{m==="ready-to-close"&&p("closing")},[m]);const g=({propertyName:b})=>{b==="max-height"&&p(v=>v==="opening"?"open":v==="closing"?"closed":v)},f=["opening","open"].includes(m);return c.jsxs(Mt,{variant:"subtle",className:K("hide-show-text-box",t),children:[c.jsx("div",{ref:u,id:e,className:K("content",m,s),children:a?c.jsxs(c.Fragment,{children:[c.jsx(Wt,{options:{forceBlock:!0,...i},children:m==="closed"?d:a}),m!=="closed"&&o]}):o}),c.jsx("p",{className:"cta",children:c.jsx(Fe,{variant:"tertiary",icon:{icon:"navigation_arrow",position:"left",animate:!0},styling:{muted:!0},className:K({"rotate-180":f}),onClick:()=>{p(f?"ready-to-close":"opening")},"aria-expanded":f,"aria-controls":e,children:f?r||l.formatMessage({id:"hideShowTextBox_hide"}):n||l.formatMessage({id:"hideShowTextBox_show"})})})]})};const Am=({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:K("icon-bulleted-list text-medium",n,i,{"has-border":s,"has-zebra-stripes":o,[t]:e!=="dl"}),children:r.map((l,u)=>{const d={wrapper:y.Fragment,forceInline:!0},h={"--icon":`url(${Ut}icons/${l.icon}.svg)`};return e==="dl"?c.jsxs(y.Fragment,{children:[c.jsx("dt",{style:h,children:c.jsx(Wt,{options:d,children:l.dt||""})},`dt-${u}`),c.jsx("dd",{children:typeof l.text=="string"?c.jsx(Wt,{options:d,children:l.text}):l.text},`dd-${u}`)]},`dl-${u}`):c.jsx("li",{style:h,children:typeof l.text=="string"?c.jsx(Wt,{options:d,children:l.text}):l.text},u)})})},at=()=>y.Fragment,Tm=({children:e})=>c.jsx(Mt,{variant:"secondary",children:e}),Sm=({children:e})=>typeof e=="object"&&Object.keys(e||{}).length===1?c.jsx("p",{className:"center",children:e}):c.jsx("div",{className:"center",children:e}),jm=["span","strong","h1","h2","h3","h4","h5","h6","p"],Om=({children:e})=>{const t=ie.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(jm.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 c.jsx(ei,{label:a,className:["Sources","Resources"].includes(a)?"discrete-links":"",children:r.map(i=>i)})},Pm=({children:e,...t})=>{if(t.class)switch(t.class){case"casestudy":return c.jsx(Mt,{variant:"secondary",children:e});case"general-textbox":case"highlight-box":return c.jsx(Mt,{variant:"primary",children:e});case"pink-textbox":return c.jsx(Mt,{variant:"tertiary",children:e});case"content":return typeof e=="object"&&Object.keys(e||{}).length===1?c.jsx("p",{children:e}):e;default:return c.jsx("div",{...t,children:e})}return c.jsx("div",{...t,children:e})},Ft=({children:e})=>c.jsx(c.Fragment,{children:e}),Mm=e=>{const t=ie.useIntl(),n=Date.now().toString();let r="default";const a=e.src;a.includes("youtube")||a.includes("vimeo")?r="video":a.includes("riddle")||a.includes("sli.do")?r="poll":a.includes("padlet")&&(r="padlet");const i=`content-after-iframe-${n}`;return c.jsxs(c.Fragment,{children:[c.jsx(Ie,{element:"a",href:`#${i}`,onClick:s=>{s.preventDefault(),s.stopPropagation();const o=document.getElementById(i);o==null||o.scrollIntoView({behavior:"smooth"}),o==null||o.focus()},children:t.formatMessage({id:`markdown_skip${r==="default"?"":`_${r}`}`})}),c.jsx("iframe",{...e,title:t.formatMessage({id:`markdown_iframe${r==="default"?"":`_${r}`}`})}),c.jsx("span",{id:i,tabIndex:0})]})},cu=e=>{let t="";return e&&typeof e!="string"&&typeof e!="number"&&typeof e!="boolean"&&"type"in e&&(t=e.type),t},Nm=({children:e,...t})=>{const n=ie.useIntl();let r={...t};t.href&&(t.href.includes("http:")||t.href.includes("https:"))&&!t.target&&(r.target="_blank");let a=e,i=!1;for(const o of y.Children.toArray(e))if(!(!o||typeof o=="string"||typeof o=="number")&&y.isValidElement(o)){const l=o.type;if(["button","center","span","strong"].includes(l)&&o.props&&o.props.children&&o.props.children[0])for((l==="button"||cu(o.props.children[0])==="button")&&(i=!0),a=o.props.children[0];a&&typeof a!="string"&&!(typeof a=="boolean"||typeof a=="number"||!y.isValidElement(a));)if(a.props&&a.props.children&&a.props.children[0])a=a.props.children[0],a&&cu(a)==="button"&&(i=!0);else break}const s=`@${Or}`;return a===s||Array.isArray(a)&&a[0]===s?(delete r.href,delete r.target,c.jsxs("span",{...r,className:"mention deleted-user",children:["@",n.formatMessage({id:"member_deleted"})]})):i?(r={...r,className:"button primary medium"},c.jsx("p",{className:"center",children:c.jsx(Fe,{variant:"primary",size:"medium",...r,children:a})})):c.jsx("a",{...r,children:a})},Ds=({children:e,...t})=>c.jsx("span",{className:K({url:t==null?void 0:t.href}),children:e});const Rm={default:{a:Nm,CollapsibleSection:ei,TextBox:Mt,CaseStudy:Tm,style:at,details:Om,div:Pm,iframe:Mm,center:Sm},"text-only":{h1:at,h2:at,h3:at,h4:at,h5:at,h6:at,style:at,details:at,div:at,TextBox:at,CollapsibleSection:at,CaseStudy:at,blockquote:at,iframe:at,button:at}},Bn=({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=Rm[a];return n.overrides&&(l={...l,...n.overrides}),y.createElement(e,{className:K("markdown-text",t,{"highlight-titles":s}),children:c.jsx(Wt,{options:{...o,...n,overrides:l},children:r})})};const id=({maxWidth:e=!1,title:t,subtitle:n,children:r,className:a=""})=>{const i=e?{"--max-width":`${e/16}rem`}:{};return c.jsxs("section",{className:K("page-heading",a),children:[c.jsxs("div",{className:K("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 Qt=({size:e="medium",variant:t="default",className:n="",icon:r,tooltip:a="",children:i,element:s="span",...o})=>{const l={"--icon":`url(${Ut}icons/${r}.svg)`},{showTooltip:u,tooltipProps:d}=Js(!!a),h=y.createElement(s,{className:K("pill",e,t,n,{"has-icon":r}),style:l,children:i,...d,...o});return a?c.jsxs("span",{className:"pill-wrapper",children:[h,c.jsx(Mn,{isOpen:u,accessibility:{readToScreenreadersWhenClosed:!0},children:a})]}):h};const Mr=({element:e="p",children:t=null,className:n="",...r})=>y.createElement(e,{...r,className:K("status-banner text-small",n),"aria-live":"assertive"},t),eo=y.createContext({badges:[],isLoading:!0});function sd(){return y.useContext(eo)}const od=({children:e,badges:t})=>c.jsx(eo.Provider,{value:t,children:e}),ud=({showDevTools:e=!0,children:t})=>{const n=new We.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!1,staleTime:6e4}}});return c.jsxs(We.QueryClientProvider,{client:n,children:[t,e&&c.jsx(Qh.ReactQueryDevtools,{initialIsOpen:!1})]})};var ld=y.createContext({client:xa});function Im(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&&(xa.__loaded&&console.warn("[PostHog.js] was already loaded elsewhere. This may cause issues."),xa.init(r,a)),xa)},[n,r]);return y.createElement(ld.Provider,{value:{client:i}},t)}var $m=function(){var e=y.useContext(ld).client;return e};function Lm(e){var t=$m(),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 cd=({children:e,user:t})=>t.isLoading?null:process.env.REACT_APP_PUBLIC_POSTHOG_KEY?c.jsx(Im,{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}):c.jsx(c.Fragment,{children:e});var to=(e=>(e.COMMUNITY_RANKING="community-ranking",e))(to||{});const dd=({children:e,locale:t,messages:n})=>{const r=t||"en",a={...gm[r],...n||{}};return c.jsx(ie.IntlProvider,{locale:r,messages:a,children:e})},no=y.createContext({}),Ca={en:"English",es:"Español",fr:"Français",pt:"Português"},st=y.createContext({isLoading:!0});function ti(){return y.useContext(st)}const fd=({children:e,user:t,updateDetails:n})=>c.jsx(st.Provider,{value:{...t,updateDetails:n},children:e}),ro=y.createContext({registerOverlay:()=>{},unregisterOverlay:()=>{}}),hd=()=>y.useContext(ro),md=({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 c.jsx(ro.Provider,{value:{registerOverlay:r,unregisterOverlay:a},children:e})},zm=({bootstrap:e,children:t,intl:n,showDevTools:r})=>{const[a,i]=y.useState({isLoading:!0}),[s,o]=y.useState({badges:[],isLoading:!0}),l=(n==null?void 0:n.locale)||localStorage.getItem("language")||"en",[u,d]=y.useState(l),h=m=>{localStorage.setItem("language",m),d(m)};return y.useEffect(()=>{e().then(m=>{Array.isArray(m)?(i({...m[0],isLoading:!1}),o({badges:m[1],isLoading:!1})):i({...m,isLoading:!1}),Gc(5e3)}).catch(m=>{m.message===Kc&&window.location.pathname!=="/user-onboarding/logout"&&(window.location.href="/user-onboarding/logout"),i({isLoading:!1}),o({badges:[],isLoading:!1})})},[]),c.jsx(no.Provider,{value:{language:u,updateLanguage:h},children:c.jsx(dd,{locale:u,messages:n==null?void 0:n.messages,children:c.jsx(Gs.CookiesProvider,{children:c.jsx(fd,{user:a,updateDetails:i,children:c.jsx(od,{badges:s,children:c.jsx(md,{children:c.jsx(ud,{showDevTools:r,children:c.jsx(cd,{user:a,children:t})})})})})})})})},qm={globe:"globe",heart:"heart_empty_thick",pencil:"pencil",star:"star_empty","speech-bubble":"speech-bubble_round"};const pd=({slug:e})=>{const{badges:t}=sd(),n=t==null?void 0:t.find(o=>o.slug===e);if(!n)return null;const{name:r,icon:a,colour:i,description:s}=n;return c.jsx(Qt,{className:K("user-badge",i==null?void 0:i.toLowerCase()),icon:a&&qm[a],element:"li",tooltip:s,children:r})};var it=(e=>(e.COMMUNITIES="communities",e.PLATFORM="platform",e))(it||{});const gd=({element:e="ul",userBadges:t,badgeOptions:n})=>{if(Object.keys(t).length!==0)return y.createElement(e,{className:"badges-list",children:(n==null?void 0:n.scopes)&&(n==null?void 0:n.scopes.map(r=>{var a,i;return(i=(a=t==null?void 0:t[r.scope])==null?void 0:a[r.area])==null?void 0:i.map((s,o)=>c.jsx(pd,{slug:s},o))}))})};const Wm=({styling:e={},progress:t=0,text:n=!1,className:r=""})=>{const a=ie.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,d={"--progress":`${t}%`};return c.jsx("span",{className:K(`progress-bar section-${u}`,s,r,{[o]:o!=="default",[l!=="default"?l:""]:l!=="default"}),style:d,children:y.createElement(i?"span":Ie,{className:i?"text":"",children:n||a.formatMessage({id:"progressBar"},{number:t})})})},ao=y.memo(Wm);const xi="loadingBlock_",Um=({progress:e=0,steps:t=!1,className:n=""})=>{const r=ie.useIntl();t||(t={0:{text:r.formatMessage({id:`${xi}loading`})},75:{text:r.formatMessage({id:`${xi}almostDone`})},100:{text:r.formatMessage({id:`${xi}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(${Ut}icons/${t[a].icon}.svg)`}:{};return c.jsxs(Mt,{className:K("loading-block",n,{"has-icon":a&&t[a].icon}),variant:"subtle",style:s,children:[a&&c.jsx("span",{className:"step",children:t[a].text}),c.jsx(ao,{progress:e})]})},Hm=y.memo(Um);const St=({element:e="div",className:t="",...n})=>c.jsx(Ja,{element:e,className:K("loading-placeholder",t),...n});const Cs={header:["logo","link","link","search"],sidebar:["text","text","text","text","text"],"cards-section":["subtitle","cards"],heading:["title"],cards:["card","card","card","card"],carousel:["cards","controls"],"carousel-with-title":["title","cards","controls"],answers:["text","text","text"],"text-page":["title","text","text","text","text","subtitle","text","text","text","text","subtitle","text","text","text","text"],"form-with-answers":["question","subtitle","form","answers","answers","answers","answers","answers"],"general-website-page":["banner","text-page"],"overview-page":["header","sidebar","title","text","cards-section","cards-section","footer"],member:["profile-picture","text","text"],"course-navigation":["button","button"],"course-lesson-page":["breadcrumb","course-navigation","text-page"],"course-lesson-quiz":["text-page","quiz-box"]},vd=(e,t)=>e in Cs?c.jsx("div",{className:e,children:Cs[e].map((n,r)=>vd(n,r))},t):c.jsx(St,{className:e},t),ni=({layout:e="overview-page",...t})=>c.jsx("div",{className:K("loading-state",e),...t,children:Cs[e].map((n,r)=>vd(n,r))}),bd=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):""},Jr=["#5AB6A3","#A2D7AF","#806056","#3962B3"],Vm=e=>{const t=Math.ceil(26/Jr.length),n=bd(e).toLowerCase();if(n==="")return Jr[0];const r=n.charCodeAt(0)-96;for(let a=0;a<Jr.length;a++)if(r<=t*(a+1))return Jr[a]};const du=256,gn=({className:e="",src:t="",name:n,alt:r,width:a=du,height:i=du,showInitials:s=!0,...o})=>{const[l,u]=y.useState(!1),d=y.useRef(null),h=r??n;y.useEffect(()=>{const p=d.current;if(!p)return;const g=p.getContext("2d");if(!g)return;const f=a,b=i;typeof window<"u"&&window.devicePixelRatio&&(p.width=f*window.devicePixelRatio,p.height=b*window.devicePixelRatio,g.scale(window.devicePixelRatio,window.devicePixelRatio)),g.fillStyle=Vm(n),g.fillRect(0,0,f,b),g.font=`${f/3}px Arial`,g.textAlign="center",g.fillStyle="white",g.fillText(bd(n),f/2,b/1.6)},[n]);let m=!1;return t&&t!==""&&!l&&(t.includes("http")||t.includes("//"))&&(m=!0),c.jsx("figure",{className:K("profile-picture",e,{error:l}),...o,children:m?c.jsx("img",{src:t,alt:h,onError:()=>{u(!0)},width:a,height:i}):s?c.jsx("canvas",{ref:d}):c.jsx("span",{className:"fallback"})})};var tt=(e=>(e.DISCUSSION_FORM_SUBMITTED="discussionFormSubmitted",e.DISCUSSION_POST_ADDED="discussionPostAdded",e.DISCUSSION_POST_CLICKED="discussionPostClicked",e.MEMBER_CLICKED="memberClicked",e))(tt||{});const ri=e=>e==="apolitical"?{image:`${Ut}logos/member_apolitical.svg`}:e==="community"||e==="deleted"||typeof e=="object"&&!e.name?{image:`${Ut}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,badges:e.badges},Km=({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=Xn(l,r)),l};const Zm=y.lazy(()=>Promise.resolve().then(()=>wm)),Ym=y.lazy(()=>Promise.resolve().then(()=>l_));let Xr=null;const Jt=({element:e="div",member:t="community",alt:n="",additionalContent:r=!1,styling:a={},functions:i={},gtmContext:s="member",gtmType:o="member-click",className:l="",badges:u,...d})=>{const h=ie.useIntl(),{profile:m,...p}=i,{size:g="medium",variant:f="inline",isCondensed:b=!0,additionalContentNewLine:v=!1}=a,C=y.useContext(st),F=m&&C&&typeof C.id=="string",[_,w]=y.useState(!1),k=ri(t);k.name||(k.name=h.formatMessage({id:`member_${typeof t=="string"?t:"community"}`}));const{name:j,image:q}=k;let{url:P}=k;typeof t=="object"&&t.link!==void 0&&(t.link===!1?P=void 0:P=t.link);const z=Km(k),R=r&&r.createdAt?bs(r.createdAt):!1,A=r&&r.createdAt?Xs(r.createdAt):"";return y.createElement(e,{...d,className:K("member text-medium",g,f,l,{"has-profile-link":F}),...p,children:c.jsxs(c.Fragment,{children:[c.jsxs(mn,{href:P,gtmType:o,gtmContext:s,onClick:E=>{if(E==null||E.preventDefault(),E==null||E.stopPropagation(),!P)return;Xr&&clearTimeout(Xr),Xr=setTimeout(()=>{window.location.href=P},150);const S=new CustomEvent(tt.MEMBER_CLICKED,{detail:{link:P,timeout:Xr}});document.dispatchEvent(S)},children:[c.jsx(gn,{name:j,src:q,alt:n}),c.jsxs("div",{className:"details",children:[c.jsxs("div",{className:K("name",{"new-line":v}),"data-testid":"member-name",children:[c.jsx("span",{children:j}),(u==null?void 0:u.showBadges)&&(k==null?void 0:k.badges)&&c.jsx(gd,{userBadges:k.badges,badgeOptions:u}),r&&c.jsxs("span",{className:K("additional-content",{"new-line":v}),children:[r.createdAt&&R&&c.jsx("span",{className:"date",title:A,"aria-label":A,"data-testid":"date",children:h.formatMessage({id:`dates_${R.path}`},{number:R.number})}),r.customMessage&&c.jsx("span",{children:r.customMessage}),r.didEdit&&c.jsx("em",{children:h.formatMessage({id:"discussion_edited"})})]})]}),z&&!v&&c.jsx("small",{className:K({"text-medium":g==="large"}),"data-testid":"member-details",children:b?z:c.jsxs(c.Fragment,{children:[k.role,k.organisation?` — ${k.organisation}`:c.jsx(c.Fragment,{}),c.jsx("span",{className:"location",children:k.country})]})})]})]}),z&&m&&F?c.jsxs(c.Fragment,{children:[c.jsx(Fe,{variant:"tertiary",size:"small",onClick:E=>{E.preventDefault(),E.stopPropagation(),w(!0)},"data-testid":"profile-button",children:h.formatMessage({id:"member_profile"})}),c.jsx(Zm,{children:c.jsx(Ym,{form:m,showModal:_,content:{title:h.formatMessage({id:"member_profile"})},functions:{onClose:()=>{w(!1)}},className:"in-portal"})})]}):c.jsx(c.Fragment,{})]})})},Gm=Object.freeze(Object.defineProperty({__proto__:null,default:Jt},Symbol.toStringTag,{value:"Module"}));const fu={small:24,medium:48},io=({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="",...d})=>{const h=ie.useIntl();return!n||n.length===0?null:y.createElement(e,{...d,className:K("contributors",u,a,{"has-gap":i}),children:c.jsxs(c.Fragment,{children:[c.jsx("ul",{children:n.map((m,p)=>{let g,f="";if(p<o){const{name:b="",image:v=""}=ri(m);if(s)return c.jsx(St,{element:"li",className:"contributor"},p);g=c.jsx(gn,{name:b,src:v,width:fu[a||"medium"],height:fu[a||"medium"]})}else if(p===o){const b=(t||n.length)-o;g=c.jsxs("small",{className:K({"large-number":b>99}),children:["+",vm(b,0)]}),f="number-left"}return g?c.jsx("li",{className:K("contributor",f),children:g},p):null})}),r&&c.jsx("span",{className:"label",children:typeof r=="string"?r:n.length===1?typeof n[0]=="string"?h.formatMessage({id:`member_${n[0]}`}):Xn(n[0].name||"",20):l||null})]})})};const so=({element:e="section",children:t,className:n,...r})=>y.createElement(e,{className:K("modal",n),children:typeof t=="string"?c.jsx("p",{children:t}):t,...r});var ws={exports:{}},ea={exports:{}},Ne={};/** @license React v16.13.1
38
38
  * react-is.production.min.js
@@ -48,20 +48,20 @@ Thank you for helping to protect the Apolitical community from abusive content.`
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 mu;function Jm(){return mu||(mu=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,d=e?Symbol.for("react.forward_ref"):60112,h=e?Symbol.for("react.suspense"):60113,m=e?Symbol.for("react.suspense_list"):60120,p=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,C=e?Symbol.for("react.scope"):60119;function F(X){return typeof X=="string"||typeof X=="function"||X===r||X===u||X===i||X===a||X===h||X===m||typeof X=="object"&&X!==null&&(X.$$typeof===g||X.$$typeof===p||X.$$typeof===s||X.$$typeof===o||X.$$typeof===d||X.$$typeof===b||X.$$typeof===v||X.$$typeof===C||X.$$typeof===f)}function _(X){if(typeof X=="object"&&X!==null){var pe=X.$$typeof;switch(pe){case t:var me=X.type;switch(me){case l:case u:case r:case i:case a:case h:return me;default:var _e=me&&me.$$typeof;switch(_e){case o:case d:case g:case p:case s:return _e;default:return pe}}case n:return pe}}}var w=l,k=u,j=o,q=s,P=t,z=d,R=r,A=g,E=p,S=n,O=i,V=a,H=h,Q=!1;function ae(X){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(X)||_(X)===l}function D(X){return _(X)===u}function $(X){return _(X)===o}function ee(X){return _(X)===s}function B(X){return typeof X=="object"&&X!==null&&X.$$typeof===t}function T(X){return _(X)===d}function L(X){return _(X)===r}function I(X){return _(X)===g}function W(X){return _(X)===p}function U(X){return _(X)===n}function ne(X){return _(X)===i}function re(X){return _(X)===a}function le(X){return _(X)===h}Re.AsyncMode=w,Re.ConcurrentMode=k,Re.ContextConsumer=j,Re.ContextProvider=q,Re.Element=P,Re.ForwardRef=z,Re.Fragment=R,Re.Lazy=A,Re.Memo=E,Re.Portal=S,Re.Profiler=O,Re.StrictMode=V,Re.Suspense=H,Re.isAsyncMode=ae,Re.isConcurrentMode=D,Re.isContextConsumer=$,Re.isContextProvider=ee,Re.isElement=B,Re.isForwardRef=T,Re.isFragment=L,Re.isLazy=I,Re.isMemo=W,Re.isPortal=U,Re.isProfiler=ne,Re.isStrictMode=re,Re.isSuspense=le,Re.isValidElementType=F,Re.typeOf=_}()),Re}var pu;function yd(){return pu||(pu=1,process.env.NODE_ENV==="production"?ea.exports=Qm():ea.exports=Jm()),ea.exports}/*
51
+ */var mu;function Jm(){return mu||(mu=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,d=e?Symbol.for("react.forward_ref"):60112,h=e?Symbol.for("react.suspense"):60113,m=e?Symbol.for("react.suspense_list"):60120,p=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,C=e?Symbol.for("react.scope"):60119;function F(ee){return typeof ee=="string"||typeof ee=="function"||ee===r||ee===u||ee===i||ee===a||ee===h||ee===m||typeof ee=="object"&&ee!==null&&(ee.$$typeof===g||ee.$$typeof===p||ee.$$typeof===s||ee.$$typeof===o||ee.$$typeof===d||ee.$$typeof===b||ee.$$typeof===v||ee.$$typeof===C||ee.$$typeof===f)}function _(ee){if(typeof ee=="object"&&ee!==null){var pe=ee.$$typeof;switch(pe){case t:var me=ee.type;switch(me){case l:case u:case r:case i:case a:case h:return me;default:var _e=me&&me.$$typeof;switch(_e){case o:case d:case g:case p:case s:return _e;default:return pe}}case n:return pe}}}var w=l,k=u,j=o,q=s,P=t,z=d,R=r,A=g,E=p,S=n,O=i,V=a,H=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)||_(ee)===l}function D(ee){return _(ee)===u}function $(ee){return _(ee)===o}function X(ee){return _(ee)===s}function B(ee){return typeof ee=="object"&&ee!==null&&ee.$$typeof===t}function T(ee){return _(ee)===d}function L(ee){return _(ee)===r}function I(ee){return _(ee)===g}function W(ee){return _(ee)===p}function U(ee){return _(ee)===n}function ne(ee){return _(ee)===i}function re(ee){return _(ee)===a}function le(ee){return _(ee)===h}Re.AsyncMode=w,Re.ConcurrentMode=k,Re.ContextConsumer=j,Re.ContextProvider=q,Re.Element=P,Re.ForwardRef=z,Re.Fragment=R,Re.Lazy=A,Re.Memo=E,Re.Portal=S,Re.Profiler=O,Re.StrictMode=V,Re.Suspense=H,Re.isAsyncMode=ae,Re.isConcurrentMode=D,Re.isContextConsumer=$,Re.isContextProvider=X,Re.isElement=B,Re.isForwardRef=T,Re.isFragment=L,Re.isLazy=I,Re.isMemo=W,Re.isPortal=U,Re.isProfiler=ne,Re.isStrictMode=re,Re.isSuspense=le,Re.isValidElementType=F,Re.typeOf=_}()),Re}var pu;function yd(){return pu||(pu=1,process.env.NODE_ENV==="production"?ea.exports=Qm():ea.exports=Jm()),ea.exports}/*
52
52
  object-assign
53
53
  (c) Sindre Sorhus
54
54
  @license MIT
55
- */var Di,gu;function Xm(){if(gu)return Di;gu=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(d){return s[d]});if(l.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(d){u[d]=d}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Di=a()?Object.assign:function(i,s){for(var o,l=r(i),u,d=1;d<arguments.length;d++){o=Object(arguments[d]);for(var h in o)t.call(o,h)&&(l[h]=o[h]);if(e){u=e(o);for(var m=0;m<u.length;m++)n.call(o,u[m])&&(l[u[m]]=o[u[m]])}}return l},Di}var Ci,vu;function oo(){if(vu)return Ci;vu=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Ci=e,Ci}var wi,bu;function xd(){return bu||(bu=1,wi=Function.call.bind(Object.prototype.hasOwnProperty)),wi}var Ei,yu;function ep(){if(yu)return Ei;yu=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=oo(),n={},r=xd();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 d in i)if(r(i,d)){var h;try{if(typeof i[d]!="function"){var m=Error((l||"React class")+": "+o+" type `"+d+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[d]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw m.name="Invariant Violation",m}h=i[d](s,d,l,o,null,t)}catch(g){h=g}if(h&&!(h instanceof Error)&&e((l||"React class")+": type specification of "+o+" `"+d+"` 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 p=u?u():"";e("Failed "+o+" type: "+h.message+(p??""))}}}}return a.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},Ei=a,Ei}var _i,xu;function tp(){if(xu)return _i;xu=1;var e=yd(),t=Xm(),n=oo(),r=xd(),a=ep(),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 _i=function(o,l){var u=typeof Symbol=="function"&&Symbol.iterator,d="@@iterator";function h(D){var $=D&&(u&&D[u]||D[d]);if(typeof $=="function")return $}var m="<<anonymous>>",p={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:C(),arrayOf:F,element:_(),elementType:w(),instanceOf:k,node:z(),objectOf:q,oneOf:j,oneOfType:P,shape:A,exact:E};function g(D,$){return D===$?D!==0||1/D===1/$:D!==D&&$!==$}function f(D,$){this.message=D,this.data=$&&typeof $=="object"?$:{},this.stack=""}f.prototype=Error.prototype;function b(D){if(process.env.NODE_ENV!=="production")var $={},ee=0;function B(L,I,W,U,ne,re,le){if(U=U||m,re=re||W,le!==n){if(l){var X=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 X.name="Invariant Violation",X}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var pe=U+":"+W;!$[pe]&&ee<3&&(i("You are manually calling a React.PropTypes validation function for the `"+re+"` prop on `"+U+"`. 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."),$[pe]=!0,ee++)}}return I[W]==null?L?I[W]===null?new f("The "+ne+" `"+re+"` is marked as required "+("in `"+U+"`, but its value is `null`.")):new f("The "+ne+" `"+re+"` is marked as required in "+("`"+U+"`, but its value is `undefined`.")):null:D(I,W,U,ne,re)}var T=B.bind(null,!1);return T.isRequired=B.bind(null,!0),T}function v(D){function $(ee,B,T,L,I,W){var U=ee[B],ne=V(U);if(ne!==D){var re=H(U);return new f("Invalid "+L+" `"+I+"` of type "+("`"+re+"` supplied to `"+T+"`, expected ")+("`"+D+"`."),{expectedType:D})}return null}return b($)}function C(){return b(s)}function F(D){function $(ee,B,T,L,I){if(typeof D!="function")return new f("Property `"+I+"` of component `"+T+"` has invalid PropType notation inside arrayOf.");var W=ee[B];if(!Array.isArray(W)){var U=V(W);return new f("Invalid "+L+" `"+I+"` of type "+("`"+U+"` supplied to `"+T+"`, expected an array."))}for(var ne=0;ne<W.length;ne++){var re=D(W,ne,T,L,I+"["+ne+"]",n);if(re instanceof Error)return re}return null}return b($)}function _(){function D($,ee,B,T,L){var I=$[ee];if(!o(I)){var W=V(I);return new f("Invalid "+T+" `"+L+"` of type "+("`"+W+"` supplied to `"+B+"`, expected a single ReactElement."))}return null}return b(D)}function w(){function D($,ee,B,T,L){var I=$[ee];if(!e.isValidElementType(I)){var W=V(I);return new f("Invalid "+T+" `"+L+"` of type "+("`"+W+"` supplied to `"+B+"`, expected a single ReactElement type."))}return null}return b(D)}function k(D){function $(ee,B,T,L,I){if(!(ee[B]instanceof D)){var W=D.name||m,U=ae(ee[B]);return new f("Invalid "+L+" `"+I+"` of type "+("`"+U+"` supplied to `"+T+"`, expected ")+("instance of `"+W+"`."))}return null}return b($)}function j(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 $(ee,B,T,L,I){for(var W=ee[B],U=0;U<D.length;U++)if(g(W,D[U]))return null;var ne=JSON.stringify(D,function(le,X){var pe=H(X);return pe==="symbol"?String(X):X});return new f("Invalid "+L+" `"+I+"` of value `"+String(W)+"` "+("supplied to `"+T+"`, expected one of "+ne+"."))}return b($)}function q(D){function $(ee,B,T,L,I){if(typeof D!="function")return new f("Property `"+I+"` of component `"+T+"` has invalid PropType notation inside objectOf.");var W=ee[B],U=V(W);if(U!=="object")return new f("Invalid "+L+" `"+I+"` of type "+("`"+U+"` supplied to `"+T+"`, expected an object."));for(var ne in W)if(r(W,ne)){var re=D(W,ne,T,L,I+"."+ne,n);if(re instanceof Error)return re}return null}return b($)}function P(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 $=0;$<D.length;$++){var ee=D[$];if(typeof ee!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+Q(ee)+" at index "+$+"."),s}function B(T,L,I,W,U){for(var ne=[],re=0;re<D.length;re++){var le=D[re],X=le(T,L,I,W,U,n);if(X==null)return null;X.data&&r(X.data,"expectedType")&&ne.push(X.data.expectedType)}var pe=ne.length>0?", expected one of type ["+ne.join(", ")+"]":"";return new f("Invalid "+W+" `"+U+"` supplied to "+("`"+I+"`"+pe+"."))}return b(B)}function z(){function D($,ee,B,T,L){return S($[ee])?null:new f("Invalid "+T+" `"+L+"` supplied to "+("`"+B+"`, expected a ReactNode."))}return b(D)}function R(D,$,ee,B,T){return new f((D||"React class")+": "+$+" type `"+ee+"."+B+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+T+"`.")}function A(D){function $(ee,B,T,L,I){var W=ee[B],U=V(W);if(U!=="object")return new f("Invalid "+L+" `"+I+"` of type `"+U+"` "+("supplied to `"+T+"`, expected `object`."));for(var ne in D){var re=D[ne];if(typeof re!="function")return R(T,L,I,ne,H(re));var le=re(W,ne,T,L,I+"."+ne,n);if(le)return le}return null}return b($)}function E(D){function $(ee,B,T,L,I){var W=ee[B],U=V(W);if(U!=="object")return new f("Invalid "+L+" `"+I+"` of type `"+U+"` "+("supplied to `"+T+"`, expected `object`."));var ne=t({},ee[B],D);for(var re in ne){var le=D[re];if(r(D,re)&&typeof le!="function")return R(T,L,I,re,H(le));if(!le)return new f("Invalid "+L+" `"+I+"` key `"+re+"` supplied to `"+T+"`.\nBad object: "+JSON.stringify(ee[B],null," ")+`
56
- Valid keys: `+JSON.stringify(Object.keys(D),null," "));var X=le(W,re,T,L,I+"."+re,n);if(X)return X}return null}return b($)}function S(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(S);if(D===null||o(D))return!0;var $=h(D);if($){var ee=$.call(D),B;if($!==D.entries){for(;!(B=ee.next()).done;)if(!S(B.value))return!1}else for(;!(B=ee.next()).done;){var T=B.value;if(T&&!S(T[1]))return!1}}else return!1;return!0;default:return!1}}function O(D,$){return D==="symbol"?!0:$?$["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&$ instanceof Symbol:!1}function V(D){var $=typeof D;return Array.isArray(D)?"array":D instanceof RegExp?"object":O($,D)?"symbol":$}function H(D){if(typeof D>"u"||D===null)return""+D;var $=V(D);if($==="object"){if(D instanceof Date)return"date";if(D instanceof RegExp)return"regexp"}return $}function Q(D){var $=H(D);switch($){case"array":case"object":return"an "+$;case"boolean":case"date":case"regexp":return"a "+$;default:return $}}function ae(D){return!D.constructor||!D.constructor.name?m:D.constructor.name}return p.checkPropTypes=a,p.resetWarningCache=a.resetWarningCache,p.PropTypes=p,p},_i}var ki,Du;function np(){if(Du)return ki;Du=1;var e=oo();function t(){}function n(){}return n.resetWarningCache=t,ki=function(){function r(s,o,l,u,d,h){if(h!==e){var m=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 m.name="Invariant Violation",m}}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},ki}if(process.env.NODE_ENV!=="production"){var rp=yd(),ap=!0;ws.exports=tp()(rp.isElement,ap)}else ws.exports=np()();var ip=ws.exports;/*!
55
+ */var Di,gu;function Xm(){if(gu)return Di;gu=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(d){return s[d]});if(l.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(d){u[d]=d}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Di=a()?Object.assign:function(i,s){for(var o,l=r(i),u,d=1;d<arguments.length;d++){o=Object(arguments[d]);for(var h in o)t.call(o,h)&&(l[h]=o[h]);if(e){u=e(o);for(var m=0;m<u.length;m++)n.call(o,u[m])&&(l[u[m]]=o[u[m]])}}return l},Di}var Ci,vu;function oo(){if(vu)return Ci;vu=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Ci=e,Ci}var wi,bu;function xd(){return bu||(bu=1,wi=Function.call.bind(Object.prototype.hasOwnProperty)),wi}var Ei,yu;function ep(){if(yu)return Ei;yu=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=oo(),n={},r=xd();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 d in i)if(r(i,d)){var h;try{if(typeof i[d]!="function"){var m=Error((l||"React class")+": "+o+" type `"+d+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[d]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw m.name="Invariant Violation",m}h=i[d](s,d,l,o,null,t)}catch(g){h=g}if(h&&!(h instanceof Error)&&e((l||"React class")+": type specification of "+o+" `"+d+"` 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 p=u?u():"";e("Failed "+o+" type: "+h.message+(p??""))}}}}return a.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},Ei=a,Ei}var _i,xu;function tp(){if(xu)return _i;xu=1;var e=yd(),t=Xm(),n=oo(),r=xd(),a=ep(),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 _i=function(o,l){var u=typeof Symbol=="function"&&Symbol.iterator,d="@@iterator";function h(D){var $=D&&(u&&D[u]||D[d]);if(typeof $=="function")return $}var m="<<anonymous>>",p={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:C(),arrayOf:F,element:_(),elementType:w(),instanceOf:k,node:z(),objectOf:q,oneOf:j,oneOfType:P,shape:A,exact:E};function g(D,$){return D===$?D!==0||1/D===1/$:D!==D&&$!==$}function f(D,$){this.message=D,this.data=$&&typeof $=="object"?$:{},this.stack=""}f.prototype=Error.prototype;function b(D){if(process.env.NODE_ENV!=="production")var $={},X=0;function B(L,I,W,U,ne,re,le){if(U=U||m,re=re||W,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 pe=U+":"+W;!$[pe]&&X<3&&(i("You are manually calling a React.PropTypes validation function for the `"+re+"` prop on `"+U+"`. 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."),$[pe]=!0,X++)}}return I[W]==null?L?I[W]===null?new f("The "+ne+" `"+re+"` is marked as required "+("in `"+U+"`, but its value is `null`.")):new f("The "+ne+" `"+re+"` is marked as required in "+("`"+U+"`, but its value is `undefined`.")):null:D(I,W,U,ne,re)}var T=B.bind(null,!1);return T.isRequired=B.bind(null,!0),T}function v(D){function $(X,B,T,L,I,W){var U=X[B],ne=V(U);if(ne!==D){var re=H(U);return new f("Invalid "+L+" `"+I+"` of type "+("`"+re+"` supplied to `"+T+"`, expected ")+("`"+D+"`."),{expectedType:D})}return null}return b($)}function C(){return b(s)}function F(D){function $(X,B,T,L,I){if(typeof D!="function")return new f("Property `"+I+"` of component `"+T+"` has invalid PropType notation inside arrayOf.");var W=X[B];if(!Array.isArray(W)){var U=V(W);return new f("Invalid "+L+" `"+I+"` of type "+("`"+U+"` supplied to `"+T+"`, expected an array."))}for(var ne=0;ne<W.length;ne++){var re=D(W,ne,T,L,I+"["+ne+"]",n);if(re instanceof Error)return re}return null}return b($)}function _(){function D($,X,B,T,L){var I=$[X];if(!o(I)){var W=V(I);return new f("Invalid "+T+" `"+L+"` of type "+("`"+W+"` supplied to `"+B+"`, expected a single ReactElement."))}return null}return b(D)}function w(){function D($,X,B,T,L){var I=$[X];if(!e.isValidElementType(I)){var W=V(I);return new f("Invalid "+T+" `"+L+"` of type "+("`"+W+"` supplied to `"+B+"`, expected a single ReactElement type."))}return null}return b(D)}function k(D){function $(X,B,T,L,I){if(!(X[B]instanceof D)){var W=D.name||m,U=ae(X[B]);return new f("Invalid "+L+" `"+I+"` of type "+("`"+U+"` supplied to `"+T+"`, expected ")+("instance of `"+W+"`."))}return null}return b($)}function j(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 $(X,B,T,L,I){for(var W=X[B],U=0;U<D.length;U++)if(g(W,D[U]))return null;var ne=JSON.stringify(D,function(le,ee){var pe=H(ee);return pe==="symbol"?String(ee):ee});return new f("Invalid "+L+" `"+I+"` of value `"+String(W)+"` "+("supplied to `"+T+"`, expected one of "+ne+"."))}return b($)}function q(D){function $(X,B,T,L,I){if(typeof D!="function")return new f("Property `"+I+"` of component `"+T+"` has invalid PropType notation inside objectOf.");var W=X[B],U=V(W);if(U!=="object")return new f("Invalid "+L+" `"+I+"` of type "+("`"+U+"` supplied to `"+T+"`, expected an object."));for(var ne in W)if(r(W,ne)){var re=D(W,ne,T,L,I+"."+ne,n);if(re instanceof Error)return re}return null}return b($)}function P(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 $=0;$<D.length;$++){var X=D[$];if(typeof X!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+Q(X)+" at index "+$+"."),s}function B(T,L,I,W,U){for(var ne=[],re=0;re<D.length;re++){var le=D[re],ee=le(T,L,I,W,U,n);if(ee==null)return null;ee.data&&r(ee.data,"expectedType")&&ne.push(ee.data.expectedType)}var pe=ne.length>0?", expected one of type ["+ne.join(", ")+"]":"";return new f("Invalid "+W+" `"+U+"` supplied to "+("`"+I+"`"+pe+"."))}return b(B)}function z(){function D($,X,B,T,L){return S($[X])?null:new f("Invalid "+T+" `"+L+"` supplied to "+("`"+B+"`, expected a ReactNode."))}return b(D)}function R(D,$,X,B,T){return new f((D||"React class")+": "+$+" type `"+X+"."+B+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+T+"`.")}function A(D){function $(X,B,T,L,I){var W=X[B],U=V(W);if(U!=="object")return new f("Invalid "+L+" `"+I+"` of type `"+U+"` "+("supplied to `"+T+"`, expected `object`."));for(var ne in D){var re=D[ne];if(typeof re!="function")return R(T,L,I,ne,H(re));var le=re(W,ne,T,L,I+"."+ne,n);if(le)return le}return null}return b($)}function E(D){function $(X,B,T,L,I){var W=X[B],U=V(W);if(U!=="object")return new f("Invalid "+L+" `"+I+"` of type `"+U+"` "+("supplied to `"+T+"`, expected `object`."));var ne=t({},X[B],D);for(var re in ne){var le=D[re];if(r(D,re)&&typeof le!="function")return R(T,L,I,re,H(le));if(!le)return new f("Invalid "+L+" `"+I+"` key `"+re+"` supplied to `"+T+"`.\nBad object: "+JSON.stringify(X[B],null," ")+`
56
+ Valid keys: `+JSON.stringify(Object.keys(D),null," "));var ee=le(W,re,T,L,I+"."+re,n);if(ee)return ee}return null}return b($)}function S(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(S);if(D===null||o(D))return!0;var $=h(D);if($){var X=$.call(D),B;if($!==D.entries){for(;!(B=X.next()).done;)if(!S(B.value))return!1}else for(;!(B=X.next()).done;){var T=B.value;if(T&&!S(T[1]))return!1}}else return!1;return!0;default:return!1}}function O(D,$){return D==="symbol"?!0:$?$["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&$ instanceof Symbol:!1}function V(D){var $=typeof D;return Array.isArray(D)?"array":D instanceof RegExp?"object":O($,D)?"symbol":$}function H(D){if(typeof D>"u"||D===null)return""+D;var $=V(D);if($==="object"){if(D instanceof Date)return"date";if(D instanceof RegExp)return"regexp"}return $}function Q(D){var $=H(D);switch($){case"array":case"object":return"an "+$;case"boolean":case"date":case"regexp":return"a "+$;default:return $}}function ae(D){return!D.constructor||!D.constructor.name?m:D.constructor.name}return p.checkPropTypes=a,p.resetWarningCache=a.resetWarningCache,p.PropTypes=p,p},_i}var ki,Du;function np(){if(Du)return ki;Du=1;var e=oo();function t(){}function n(){}return n.resetWarningCache=t,ki=function(){function r(s,o,l,u,d,h){if(h!==e){var m=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 m.name="Invariant Violation",m}}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},ki}if(process.env.NODE_ENV!=="production"){var rp=yd(),ap=!0;ws.exports=tp()(rp.isElement,ap)}else ws.exports=np()();var ip=ws.exports;/*!
57
57
  * tabbable 6.2.0
58
58
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
59
59
  */var Dd=["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])"],ja=Dd.join(","),Cd=typeof Element>"u",An=Cd?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Oa=!Cd&&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},Pa=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},sp=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},wd=function(t,n,r){if(Pa(t))return[];var a=Array.prototype.slice.apply(t.querySelectorAll(ja));return n&&An.call(t,ja)&&a.unshift(t),a=a.filter(r),a},Ed=function e(t,n,r){for(var a=[],i=Array.from(t);i.length;){var s=i.shift();if(!Pa(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 d=An.call(s,ja);d&&r.filter(s)&&(n||!t.includes(s))&&a.push(s);var h=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),m=!Pa(h,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(h&&m){var p=e(h===!0?s.children:h.children,!0,r);r.flatten?a.push.apply(a,p):a.push({scopeParent:s,candidates:p})}else i.unshift.apply(i,s.children)}}return a},_d=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},cn=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||sp(t))&&!_d(t)?0:t.tabIndex},op=function(t,n){var r=cn(t);return r<0&&n&&!_d(t)?0:r},up=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},kd=function(t){return t.tagName==="INPUT"},lp=function(t){return kd(t)&&t.type==="hidden"},cp=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},dp=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},fp=function(t){if(!t.name)return!0;var n=t.form||Oa(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=dp(a,t.form);return!i||i===t},hp=function(t){return kd(t)&&t.type==="radio"},mp=function(t){return hp(t)&&!fp(t)},pp=function(t){var n,r=t&&Oa(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,d,h;r=Oa(a),a=(u=r)===null||u===void 0?void 0:u.host,i=!!((d=a)!==null&&d!==void 0&&(h=d.ownerDocument)!==null&&h!==void 0&&h.contains(a))}}return i},Cu=function(t){var n=t.getBoundingClientRect(),r=n.width,a=n.height;return r===0&&a===0},gp=function(t,n){var r=n.displayCheck,a=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var i=An.call(t,"details>summary:first-of-type"),s=i?t.parentElement:t;if(An.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=Oa(t);if(l&&!l.shadowRoot&&a(l)===!0)return Cu(t);t.assignedSlot?t=t.assignedSlot:!l&&u!==t.ownerDocument?t=u.host:t=l}t=o}if(pp(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Cu(t);return!1},vp=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 An.call(n,"fieldset[disabled] *")?!0:!a.contains(t)}return!0}n=n.parentElement}return!1},Ma=function(t,n){return!(n.disabled||Pa(n)||lp(n)||gp(n,t)||cp(n)||vp(n))},Es=function(t,n){return!(mp(n)||cn(n)<0||!Ma(t,n))},bp=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},yp=function e(t){var n=[],r=[];return t.forEach(function(a,i){var s=!!a.scopeParent,o=s?a.scopeParent:a,l=op(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(up).reduce(function(a,i){return i.isScope?a.push.apply(a,i.content):a.push(i.content),a},[]).concat(n)},Fd=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Ed([t],n.includeContainer,{filter:Es.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:bp}):r=wd(t,n.includeContainer,Es.bind(null,n)),yp(r)},Bd=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Ed([t],n.includeContainer,{filter:Ma.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=wd(t,n.includeContainer,Ma.bind(null,n)),r},xn=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return An.call(t,ja)===!1?!1:Es(n,t)},xp=Dd.concat("iframe").join(","),wa=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return An.call(t,xp)===!1?!1:Ma(n,t)};const Dp=Object.freeze(Object.defineProperty({__proto__:null,focusable:Bd,getTabIndex:cn,isFocusable:wa,isTabbable:xn,tabbable:Fd},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 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 Eu(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){Cp(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}function Cp(e,t,n){return t=Ep(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wp(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 Ep(e){var t=wp(e,"string");return typeof t=="symbol"?t:String(t)}var _u={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()}},_p=function(t){return t.tagName&&t.tagName.toLowerCase()==="input"&&typeof t.select=="function"},kp=function(t){return(t==null?void 0:t.key)==="Escape"||(t==null?void 0:t.key)==="Esc"||(t==null?void 0:t.keyCode)===27},_r=function(t){return(t==null?void 0:t.key)==="Tab"||(t==null?void 0:t.keyCode)===9},Fp=function(t){return _r(t)&&!t.shiftKey},Bp=function(t){return _r(t)&&t.shiftKey},ku=function(t){return setTimeout(t,0)},Fu=function(t,n){var r=-1;return t.every(function(a,i){return n(a)?(r=i,!1):!0}),r},pr=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},ta=function(t){return t.target.shadowRoot&&typeof t.composedPath=="function"?t.composedPath()[0]:t.target},Ap=[],Tp=function(t,n){var r=(n==null?void 0:n.document)||document,a=(n==null?void 0:n.trapStack)||Ap,i=Eu({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:Fp,isKeyBackward:Bp},n),s={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},o,l=function(A,E,S){return A&&A[E]!==void 0?A[E]:i[S||E]},u=function(A,E){var S=typeof(E==null?void 0:E.composedPath)=="function"?E.composedPath():void 0;return s.containerGroups.findIndex(function(O){var V=O.container,H=O.tabbableNodes;return V.contains(A)||(S==null?void 0:S.includes(V))||H.find(function(Q){return Q===A})})},d=function(A){var E=i[A];if(typeof E=="function"){for(var S=arguments.length,O=new Array(S>1?S-1:0),V=1;V<S;V++)O[V-1]=arguments[V];E=E.apply(void 0,O)}if(E===!0&&(E=void 0),!E){if(E===void 0||E===!1)return E;throw new Error("`".concat(A,"` was specified but was not a node, or did not return a node"))}var H=E;if(typeof E=="string"&&(H=r.querySelector(E),!H))throw new Error("`".concat(A,"` as selector refers to no known node"));return H},h=function(){var A=d("initialFocus");if(A===!1)return!1;if(A===void 0||!wa(A,i.tabbableOptions))if(u(r.activeElement)>=0)A=r.activeElement;else{var E=s.tabbableGroups[0],S=E&&E.firstTabbableNode;A=S||d("fallbackFocus")}if(!A)throw new Error("Your focus-trap needs to have at least one focusable element");return A},m=function(){if(s.containerGroups=s.containers.map(function(A){var E=Fd(A,i.tabbableOptions),S=Bd(A,i.tabbableOptions),O=E.length>0?E[0]:void 0,V=E.length>0?E[E.length-1]:void 0,H=S.find(function(D){return xn(D)}),Q=S.slice().reverse().find(function(D){return xn(D)}),ae=!!E.find(function(D){return cn(D)>0});return{container:A,tabbableNodes:E,focusableNodes:S,posTabIndexesFound:ae,firstTabbableNode:O,lastTabbableNode:V,firstDomTabbableNode:H,lastDomTabbableNode:Q,nextTabbableNode:function($){var ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,B=E.indexOf($);return B<0?ee?S.slice(S.indexOf($)+1).find(function(T){return xn(T)}):S.slice(0,S.indexOf($)).reverse().find(function(T){return xn(T)}):E[B+(ee?1:-1)]}}}),s.tabbableGroups=s.containerGroups.filter(function(A){return A.tabbableNodes.length>0}),s.tabbableGroups.length<=0&&!d("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(A){return A.posTabIndexesFound})&&s.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},p=function R(A){var E=A.activeElement;if(E)return E.shadowRoot&&E.shadowRoot.activeElement!==null?R(E.shadowRoot):E},g=function R(A){if(A!==!1&&A!==p(document)){if(!A||!A.focus){R(h());return}A.focus({preventScroll:!!i.preventScroll}),s.mostRecentlyFocusedNode=A,_p(A)&&A.select()}},f=function(A){var E=d("setReturnFocus",A);return E||(E===!1?!1:A)},b=function(A){var E=A.target,S=A.event,O=A.isBackward,V=O===void 0?!1:O;E=E||ta(S),m();var H=null;if(s.tabbableGroups.length>0){var Q=u(E,S),ae=Q>=0?s.containerGroups[Q]:void 0;if(Q<0)V?H=s.tabbableGroups[s.tabbableGroups.length-1].lastTabbableNode:H=s.tabbableGroups[0].firstTabbableNode;else if(V){var D=Fu(s.tabbableGroups,function(I){var W=I.firstTabbableNode;return E===W});if(D<0&&(ae.container===E||wa(E,i.tabbableOptions)&&!xn(E,i.tabbableOptions)&&!ae.nextTabbableNode(E,!1))&&(D=Q),D>=0){var $=D===0?s.tabbableGroups.length-1:D-1,ee=s.tabbableGroups[$];H=cn(E)>=0?ee.lastTabbableNode:ee.lastDomTabbableNode}else _r(S)||(H=ae.nextTabbableNode(E,!1))}else{var B=Fu(s.tabbableGroups,function(I){var W=I.lastTabbableNode;return E===W});if(B<0&&(ae.container===E||wa(E,i.tabbableOptions)&&!xn(E,i.tabbableOptions)&&!ae.nextTabbableNode(E))&&(B=Q),B>=0){var T=B===s.tabbableGroups.length-1?0:B+1,L=s.tabbableGroups[T];H=cn(E)>=0?L.firstTabbableNode:L.firstDomTabbableNode}else _r(S)||(H=ae.nextTabbableNode(E))}}else H=d("fallbackFocus");return H},v=function(A){var E=ta(A);if(!(u(E,A)>=0)){if(pr(i.clickOutsideDeactivates,A)){o.deactivate({returnFocus:i.returnFocusOnDeactivate});return}pr(i.allowOutsideClick,A)||A.preventDefault()}},C=function(A){var E=ta(A),S=u(E,A)>=0;if(S||E instanceof Document)S&&(s.mostRecentlyFocusedNode=E);else{A.stopImmediatePropagation();var O,V=!0;if(s.mostRecentlyFocusedNode)if(cn(s.mostRecentlyFocusedNode)>0){var H=u(s.mostRecentlyFocusedNode),Q=s.containerGroups[H].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&&(O=Q[ae+1],V=!1):ae-1>=0&&(O=Q[ae-1],V=!1))}}else s.containerGroups.some(function(D){return D.tabbableNodes.some(function($){return cn($)>0})})||(V=!1);else V=!1;V&&(O=b({target:s.mostRecentlyFocusedNode,isBackward:i.isKeyBackward(s.recentNavEvent)})),g(O||s.mostRecentlyFocusedNode||h())}s.recentNavEvent=void 0},F=function(A){var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;s.recentNavEvent=A;var S=b({event:A,isBackward:E});S&&(_r(A)&&A.preventDefault(),g(S))},_=function(A){if(kp(A)&&pr(i.escapeDeactivates,A)!==!1){A.preventDefault(),o.deactivate();return}(i.isKeyForward(A)||i.isKeyBackward(A))&&F(A,i.isKeyBackward(A))},w=function(A){var E=ta(A);u(E,A)>=0||pr(i.clickOutsideDeactivates,A)||pr(i.allowOutsideClick,A)||(A.preventDefault(),A.stopImmediatePropagation())},k=function(){if(s.active)return _u.activateTrap(a,o),s.delayInitialFocusTimer=i.delayInitialFocus?ku(function(){g(h())}):g(h()),r.addEventListener("focusin",C,!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",_,{capture:!0,passive:!1}),o},j=function(){if(s.active)return r.removeEventListener("focusin",C,!0),r.removeEventListener("mousedown",v,!0),r.removeEventListener("touchstart",v,!0),r.removeEventListener("click",w,!0),r.removeEventListener("keydown",_,!0),o},q=function(A){var E=A.some(function(S){var O=Array.from(S.removedNodes);return O.some(function(V){return V===s.mostRecentlyFocusedNode})});E&&g(h())},P=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(q):void 0,z=function(){P&&(P.disconnect(),s.active&&!s.paused&&s.containers.map(function(A){P.observe(A,{subtree:!0,childList:!0})}))};return o={get active(){return s.active},get paused(){return s.paused},activate:function(A){if(s.active)return this;var E=l(A,"onActivate"),S=l(A,"onPostActivate"),O=l(A,"checkCanFocusTrap");O||m(),s.active=!0,s.paused=!1,s.nodeFocusedBeforeActivation=r.activeElement,E==null||E();var V=function(){O&&m(),k(),z(),S==null||S()};return O?(O(s.containers.concat()).then(V,V),this):(V(),this)},deactivate:function(A){if(!s.active)return this;var E=Eu({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},A);clearTimeout(s.delayInitialFocusTimer),s.delayInitialFocusTimer=void 0,j(),s.active=!1,s.paused=!1,z(),_u.deactivateTrap(a,o);var S=l(E,"onDeactivate"),O=l(E,"onPostDeactivate"),V=l(E,"checkCanReturnFocus"),H=l(E,"returnFocus","returnFocusOnDeactivate");S==null||S();var Q=function(){ku(function(){H&&g(f(s.nodeFocusedBeforeActivation)),O==null||O()})};return H&&V?(V(f(s.nodeFocusedBeforeActivation)).then(Q,Q),this):(Q(),this)},pause:function(A){if(s.paused||!s.active)return this;var E=l(A,"onPause"),S=l(A,"onPostPause");return s.paused=!0,E==null||E(),j(),z(),S==null||S(),this},unpause:function(A){if(!s.paused||!s.active)return this;var E=l(A,"onUnpause"),S=l(A,"onPostUnpause");return s.paused=!1,E==null||E(),m(),k(),z(),S==null||S(),this},updateContainerElements:function(A){var E=[].concat(A).filter(Boolean);return s.containers=E.map(function(S){return typeof S=="string"?r.querySelector(S):S}),s.active&&m(),z(),this}},o.updateContainerElements(t),o};const Sp=Object.freeze(Object.defineProperty({__proto__:null,createFocusTrap:Tp},Symbol.toStringTag,{value:"Module"})),jp=Nc(Sp),Op=Nc(Dp);function tr(e){"@babel/helpers - typeof";return tr=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},tr(e)}function Pp(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,Ad(r.key),r)}}function Mp(e,t,n){return t&&Bu(e.prototype,t),n&&Bu(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Np(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&&_s(e,t)}function _s(e,t){return _s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},_s(e,t)}function Rp(e){var t=$p();return function(){var r=Na(e),a;if(t){var i=Na(this).constructor;a=Reflect.construct(r,arguments,i)}else a=r.apply(this,arguments);return Ip(this,a)}}function Ip(e,t){if(t&&(tr(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return wr(e)}function wr(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $p(){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 Na(e){return Na=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Na(e)}function Lp(e,t,n){return t=Ad(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ad(e){var t=zp(e,"string");return tr(t)==="symbol"?t:String(t)}function zp(e,t){if(tr(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(tr(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var na=y,ve=ip,qp=jp,Wp=qp.createFocusTrap,Up=Op,Hp=Up.isFocusable,uo=function(e){Np(n,e);var t=Rp(n);function n(r){var a;Pp(this,n),a=t.call(this,r),Lp(wr(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 d=arguments.length,h=new Array(d>1?d-1:0),m=1;m<d;m++)h[m-1]=arguments[m];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 p=u;if(typeof u=="string"){var g;if(p=(g=this.getDocument())===null||g===void 0?void 0:g.querySelector(u),!p)throw new Error("`".concat(o,"` as selector refers to no known node"))}return p}),a.handleDeactivate=a.handleDeactivate.bind(wr(a)),a.handlePostDeactivate=a.handlePostDeactivate.bind(wr(a)),a.handleClickOutsideDeactivates=a.handleClickOutsideDeactivates.bind(wr(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 Mp(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&&!Hp(a.outsideClick.target,a.internalOptions.tabbableOptions))),u=a.internalOptions.preventScroll,d=u===void 0?!1:u;l&&o.focus({preventScroll:d}),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?na.Children.only(this.props.children):void 0;if(i){if(i.type&&i.type===na.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 d=a.props.containerElements;i&&(typeof i.ref=="function"?i.ref(u):i.ref&&(i.ref.current=u)),a.focusTrapElements=d||[u]},o=na.cloneElement(i,{ref:s});return o}return null}}]),n}(na.Component),gr=typeof Element>"u"?Function:Element;uo.propTypes={active:ve.bool,paused:ve.bool,focusTrapOptions:ve.shape({document:ve.object,onActivate:ve.func,onPostActivate:ve.func,checkCanFocusTrap:ve.func,onPause:ve.func,onPostPause:ve.func,onUnpause:ve.func,onPostUnpause:ve.func,onDeactivate:ve.func,onPostDeactivate:ve.func,checkCanReturnFocus:ve.func,initialFocus:ve.oneOfType([ve.instanceOf(gr),ve.string,ve.bool,ve.func]),fallbackFocus:ve.oneOfType([ve.instanceOf(gr),ve.string,ve.func]),escapeDeactivates:ve.oneOfType([ve.bool,ve.func]),clickOutsideDeactivates:ve.oneOfType([ve.bool,ve.func]),returnFocusOnDeactivate:ve.bool,setReturnFocus:ve.oneOfType([ve.instanceOf(gr),ve.string,ve.bool,ve.func]),allowOutsideClick:ve.oneOfType([ve.bool,ve.func]),preventScroll:ve.bool,tabbableOptions:ve.shape({displayCheck:ve.oneOf(["full","legacy-full","non-zero-area","none"]),getShadowRoot:ve.oneOfType([ve.bool,ve.func])}),trapStack:ve.array,isKeyForward:ve.func,isKeyBackward:ve.func}),containerElements:ve.arrayOf(ve.instanceOf(gr)),children:ve.oneOfType([ve.element,ve.instanceOf(gr)])};uo.defaultProps={active:!0,paused:!1,focusTrapOptions:{},_createFocusTrap:Wp};var Vp=uo;const Kp=On(Vp);const tn=({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:d="",gtmContext:h="Modal"})=>{const m=ie.useIntl(),{registerOverlay:p,unregisterOverlay:g}=hd(),[f,b]=y.useState(t),[v,C]=y.useState(null),F=y.useRef(null),_=P=>{f&&P.key==="Escape"&&j(!1)},w=P=>{C(P.target)},k=P=>{v===F.current&&P.target===F.current&&j(!1),C(null)};y.useEffect(()=>{if(f)return window.addEventListener("keyup",_),()=>{window.removeEventListener("keyup",_)}},[f]),y.useEffect(()=>{const P=F.current;return P&&(P.addEventListener("mousedown",w),P.addEventListener("mouseup",k)),()=>{P&&(P.removeEventListener("mousedown",w),P.removeEventListener("mouseup",k))}},[v]);const j=P=>{if(b(P),P)a(),p(e);else{if(f===P)return;i(),g(e)}};y.useEffect(()=>(j(t),()=>{f&&g(e)}),[t]);const q=r?{"--max-width":`${r/16}rem`}:{};return c.jsx("div",{id:`${e}-overlay`,ref:F,className:K("overlay",{open:f,"in-portal":d.includes("in-portal")}),role:"dialog",children:c.jsx(so,{id:e,className:K("overlay-modal",d,{"has-max-width":r}),hidden:!f,style:q,children:t&&c.jsx(Kp,{containerElements:[F.current],children:c.jsxs("div",{className:"overlay-content",children:[c.jsxs("div",{className:"top",children:[o&&c.jsx("h2",{className:"modal-title",children:o}),c.jsx(Fe,{variant:"tertiary",size:"medium",icon:{icon:"close"},onClick:()=>j(!1),className:"gtm-trackable","data-gtm-event-type":"close-modal-click","data-gtm-event-context":h,screenreaderText:m.formatMessage({id:"overlay_close"})})]}),n&&c.jsx(Ht,{}),l,u&&c.jsxs("div",{className:"bottom",children:[c.jsx(Ht,{}),c.jsx(or,{buttons:u})]}),s&&c.jsx(Mr,{className:"error",children:s})]})})})})},Td=(e,t)=>({"aria-haspopup":!0,"aria-expanded":t,"aria-controls":e});const vr="joinCommunityButton",lo=({isMember:e=!1,isOpen:t=!1,isShort:n=!1,disabled:r=!1,functions:{join:a,leave:i}={join:()=>{},leave:()=>{}}})=>{const s=ie.useIntl(),o=y.useContext(st),l=o&&typeof o.id=="string",u=r||!l,[d,h]=y.useState(e),[m,p]=y.useState(e?"joined":"notJoined");y.useEffect(()=>{m==="joining"?p("joined"):m==="leaving"&&p("notJoined")},[d]);const g={},f={};return d&&m!=="leaving"&&(g["data-hover-text"]=s.formatMessage({id:`${vr}_leave`}),g["aria-label"]=s.formatMessage({id:`${vr}_member_aria`}),f["aria-hidden"]="true"),c.jsx(Fe,{variant:d?"secondary":"primary",size:"medium",styling:{fullWidth:!0},icon:d&&m!=="leaving"?{icon:"tick",position:"left"}:!1,tooltip:!t&&!d?s.formatMessage({id:`${vr}_closed_tooltip`}):"",onClick:async b=>{if(u)return;b.currentTarget.blur(),p(d?"leaving":"joining");const v=new CustomEvent("ariaLive",{detail:{message:s.formatMessage({id:`${vr}_aria_live`},{action:d?"leaving":"joining"})}});document.dispatchEvent(v);const C=d?i:a;typeof C=="function"&&setTimeout(async()=>{await C()},500),h(!d)},className:K("join-community-button",m,{active:m==="joining"}),disabled:u,"data-testid":"join-button",...g,children:c.jsx("span",{className:"text",...f,children:s.formatMessage({id:`${vr}${["joining","leaving"].includes(m)?`_${m}`:d?"_member":n?"_short":""}`})})})};const Fi="communityDetails_",Zp=({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=ie.useIntl(),{id:u}=y.useContext(st),d=u,h=5,m=a||i.length,p=i.length?i:Array(h).fill({}),g=`/communities/${r}/members`===window.location.pathname,f=t||n,b=!n&&!t;return c.jsxs("div",{className:K("community-details",e),children:[f?c.jsxs("div",{className:"member-details",children:[c.jsxs("div",{className:"top",children:[c.jsxs("h4",{children:[l.formatMessage({id:`${Fi}members`}),c.jsx("span",{className:"count",children:m})]}),g?c.jsx(c.Fragment,{}):c.jsx("p",{className:"text-small",children:c.jsx("a",{href:`/communities/${r}/members`,children:l.formatMessage({id:`${Fi}viewAll`})})})]}),d&&c.jsx(io,{contributors:{total:a,data:p},styling:{size:"medium",showGap:!0,showPlaceholders:m===0},cutoff:h})]}):c.jsx(c.Fragment,{}),d?c.jsxs(c.Fragment,{children:[c.jsx(lo,{isMember:t,isOpen:n,disabled:b,functions:{...o}}),t&&c.jsx(Fe,{variant:"primary",onClick:s,icon:{icon:"plus"},styling:{fullWidth:!0},children:l.formatMessage({id:`${Fi}invite`})})]}):c.jsx(c.Fragment,{})]})};const Yp=({breadcrumbs:e,cutoff:t=20,className:n=""})=>{const r=ie.useIntl();return c.jsxs(c.Fragment,{children:[c.jsx(Ie,{element:"p",children:r.formatMessage({id:"breadcrumbs_label"})}),c.jsx("ul",{className:K("breadcrumbs text-small",n),children:e.map(({text:a,href:i,current:s=!1},o)=>{const l={};return s&&(l["aria-current"]="location"),c.jsxs("li",{children:[s&&c.jsx(Ie,{element:"span",children:r.formatMessage({id:"breadcrumbs_currentPage"})}),c.jsx(mn,{href:s?void 0:i,...l,children:Xn(a,t)})]},`${window.btoa(a)}_${o}`)})})]})};const Gp=({variant:e="default",data:{image:t,url:n,title:r,description:a},gtm:i})=>{const s=n.split("//")[1].split("/")[0],{context:o="EnrichedLink",event:l="enriched-link-click"}=i??{};return c.jsxs("aside",{className:K("enriched-url gtm-trackable",{"has-image":t,[e]:e!=="default"}),onClick:u=>{u.preventDefault(),u.stopPropagation(),window.location.href=n},"data-gtm-event-context":o,"data-gtm-event-type":l,children:[c.jsx("small",{children:s}),c.jsx("p",{className:"title text-medium",children:c.jsx("a",{href:n,target:"_blank",rel:"noreferrer",children:r})}),a&&e!=="condensed"?c.jsx("p",{className:"text-small",children:a}):c.jsx(c.Fragment,{}),t&&t.src?c.jsx("p",{className:"img",children:c.jsx("img",{src:t.src,alt:t.alt||"",loading:"lazy",fetchpriority:"low",width:t.width||"auto",height:t.height||"100%"})}):c.jsx(c.Fragment,{})]})};const Qp=({options:e,allOption:t=!1,allowMultiple:n=!0,onChange:r=()=>{},className:a=""})=>{const i=ie.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=(d,h)=>{let m=[];o.includes(d)?m=o.filter(p=>p!==d):d==="all"?m=["all"]:n?m=[...o.filter(p=>p!=="all"),d]:m=[d],l(p=>(r&&typeof r=="function"&&r({current:m,previous:p}),m)),h&&typeof h=="function"&&h()};return c.jsx("ul",{className:K("filters",a),children:s.map(({id:d,text:h,disabled:m=!1,callback:p=()=>{}})=>{let g={};return m&&(g={disabled:!0,"aria-label":i.formatMessage({id:"filters_disabled"},{name:h})}),c.jsx("li",{children:c.jsx("button",{className:K(d,{selected:o.includes(d)}),onClick:f=>{f.preventDefault(),f.stopPropagation(),u(d,p)},...g,children:h})},d)})})},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 ra="languageSwitcher_",Xp=({currentLanguage:e,isOriginalLanguage:t=!1,isHumanTranslation:n=!1,translations:r,onChange:a,urlParts:i,variant:s="default",label:o,className:l=""})=>{const u=ie.useIntl(),{updateLanguage:d=()=>{}}=y.useContext(no),[h,m]=y.useState(e);if(y.useEffect(()=>{e!==h&&m(e)},[e]),!r||!Object.values(r).some(b=>b&&b.post_name))return null;const g=Object.keys(r),f=h!==e;return c.jsxs("div",{className:K("language-switcher text-small",s,l),children:[c.jsxs("nav",{children:[s!=="short"&&c.jsx("p",{children:o||u.formatMessage({id:`${ra}label`})}),c.jsx("ul",{children:g.map(b=>{var F;if(!Ca[b])return null;const v=(F=r[b])==null?void 0:F.post_name;let C={className:b};if(h===b)C["aria-label"]=u.formatMessage({id:`${ra}selected`},{language:Ca[b]});else{const _=Jp(b,v,i);C={...C,href:typeof _=="string"?_:_.url,onClick:w=>{m(b),d(b),typeof a<"u"&&(w.preventDefault(),w.stopPropagation(),a(b,typeof _=="string"?_:_.urlForRouter))}}}return c.jsx("li",{children:c.jsx(mn,{...C,fallbackElement:"span",children:Ca[b]})},b)})}),s!=="short"&&!f&&c.jsx("p",{children:u.formatMessage({id:`${ra}translation_${t?"original":n?"human":"machine"}`})})]}),s!=="short"&&!f&&!t&&!n&&c.jsx("small",{children:u.formatMessage({id:`${ra}disclaimer`},{email:Un.support,link:b=>{const v=`mailto:${b}`;return c.jsx("a",{href:v,children:b})}})})]})};const Bi=ie.createIntl({locale:"en",messages:sr}),Vr=({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:Bi.formatMessage({id:"loadMore_button"}),endOfFeed:Bi.formatMessage({id:"loadMore_endOfFeed"}),error:Bi.formatMessage({id:"loadMore_error"})},className:l="",gtmContext:u="LoadMore"})=>{const[d,h]=y.useState(""),m=async p=>{if(!n)try{await t(p)}catch(g){g instanceof Error?h(g.message):h("Unknown error")}};return!d&&!e&&!o.endOfFeed?null:c.jsx("footer",{className:K("load-more",l),children:!d&&e?c.jsx(Fe,{variant:r,size:a,styling:i,icon:s,onClick:m,"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&&(!d||d!=null&&d.includes("Cannot read items"))?c.jsx("p",{children:o.endOfFeed}):d&&c.jsx("p",{className:"error",children:o.error})})};const co=({variant:e="default",version:t="default",className:n="",...r})=>c.jsx("p",{className:"logo-wrapper",children:c.jsx("a",{href:"/home/",className:K("logo",e,t,n),...r,children:c.jsx(Ie,{children:c.jsx(ie.FormattedMessage,{id:"apolitical"})})})});let aa=!1;const Sd=({element:e="div",id:t="more-menu",options:n,className:r=""})=>{const a=ie.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:K("more-menu text-medium",r),children:c.jsxs(c.Fragment,{children:[c.jsx(Fe,{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"}),c.jsx("ul",{id:t,hidden:!s,children:n.map(({href:u,onClick:d,text:h,icon:m,...p},g)=>{const f={...p,onClick:b=>{o(!1),typeof d=="function"&&d(b)},onFocus:()=>{aa&&(clearTimeout(aa),aa=!1)},onBlur:()=>{aa=setTimeout(()=>{o(!1)},100)}};return u&&(f.href=u),c.jsx("li",{className:"more-menu-list-item",children:c.jsx(Fe,{variant:"tertiary",size:"medium",icon:m?{icon:m,position:"left"}:!1,...f,children:h})},`${window.btoa(h)}_${g}`)})})]})})},eg=(e,t=!1)=>t?e.replaceAll("/","")===t:typeof window<"u"&&window.location&&window.location.pathname===e;const tg=y.lazy(()=>Promise.resolve().then(()=>Gm)),ng=[{key:"homepage",href:"/home/"},{key:"events",href:"/events/"},{key:"microcourses",href:"/microcourses/"},{key:"articles",href:"/solution-articles/"},{key:"communities",href:"/communities/"}],jd=({activeLink:e,profile:t})=>{const n=ie.useIntl(),r=y.useContext(st),a=r&&typeof r.id=="string";return c.jsxs("ul",{id:"navigation-menu",className:"text-medium",children:[ng.map(({key:i,href:s})=>{const o=eg(s,e),l={};return o&&(l["aria-current"]="page"),c.jsx("li",{className:K(i,{active:o}),children:c.jsx("a",{href:s,"data-gtm-event-type":`${i}-click`,"data-gtm-event-context":"NavigationMenu",className:"gtm-trackable",...l,children:n.formatMessage({id:`navigationMenu_links_${i}`})})},i)}),a&&t&&c.jsx(tg,{element:"li",member:r,styling:{variant:"card",isCondensed:!1},functions:{profile:t},className:"profile gtm-trackable","data-testid":"profile-link",alt:"",gtmContext:"NavigationMenu",gtmType:"profile-click"})]})},br=(e,t,n)=>`${e}?share=${t}${n?`&uuid=${n}`:""}`,rg=({title:e,link:t,referrer:n})=>[{key:"linkedin",icon:"social_linkedin",url:`https://www.linkedin.com/shareArticle?mini=true&url=${encodeURIComponent(`${br(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(`${br(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(`${br(t,"facebook",n)}`)}&t=${e}`},{key:"email",icon:"share_email",url:`mailto:?subject=${encodeURIComponent(e)}&body=${encodeURIComponent(`${e}
62
+ */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 Eu(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){Cp(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}function Cp(e,t,n){return t=Ep(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wp(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 Ep(e){var t=wp(e,"string");return typeof t=="symbol"?t:String(t)}var _u={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()}},_p=function(t){return t.tagName&&t.tagName.toLowerCase()==="input"&&typeof t.select=="function"},kp=function(t){return(t==null?void 0:t.key)==="Escape"||(t==null?void 0:t.key)==="Esc"||(t==null?void 0:t.keyCode)===27},_r=function(t){return(t==null?void 0:t.key)==="Tab"||(t==null?void 0:t.keyCode)===9},Fp=function(t){return _r(t)&&!t.shiftKey},Bp=function(t){return _r(t)&&t.shiftKey},ku=function(t){return setTimeout(t,0)},Fu=function(t,n){var r=-1;return t.every(function(a,i){return n(a)?(r=i,!1):!0}),r},pr=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},ta=function(t){return t.target.shadowRoot&&typeof t.composedPath=="function"?t.composedPath()[0]:t.target},Ap=[],Tp=function(t,n){var r=(n==null?void 0:n.document)||document,a=(n==null?void 0:n.trapStack)||Ap,i=Eu({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:Fp,isKeyBackward:Bp},n),s={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},o,l=function(A,E,S){return A&&A[E]!==void 0?A[E]:i[S||E]},u=function(A,E){var S=typeof(E==null?void 0:E.composedPath)=="function"?E.composedPath():void 0;return s.containerGroups.findIndex(function(O){var V=O.container,H=O.tabbableNodes;return V.contains(A)||(S==null?void 0:S.includes(V))||H.find(function(Q){return Q===A})})},d=function(A){var E=i[A];if(typeof E=="function"){for(var S=arguments.length,O=new Array(S>1?S-1:0),V=1;V<S;V++)O[V-1]=arguments[V];E=E.apply(void 0,O)}if(E===!0&&(E=void 0),!E){if(E===void 0||E===!1)return E;throw new Error("`".concat(A,"` was specified but was not a node, or did not return a node"))}var H=E;if(typeof E=="string"&&(H=r.querySelector(E),!H))throw new Error("`".concat(A,"` as selector refers to no known node"));return H},h=function(){var A=d("initialFocus");if(A===!1)return!1;if(A===void 0||!wa(A,i.tabbableOptions))if(u(r.activeElement)>=0)A=r.activeElement;else{var E=s.tabbableGroups[0],S=E&&E.firstTabbableNode;A=S||d("fallbackFocus")}if(!A)throw new Error("Your focus-trap needs to have at least one focusable element");return A},m=function(){if(s.containerGroups=s.containers.map(function(A){var E=Fd(A,i.tabbableOptions),S=Bd(A,i.tabbableOptions),O=E.length>0?E[0]:void 0,V=E.length>0?E[E.length-1]:void 0,H=S.find(function(D){return xn(D)}),Q=S.slice().reverse().find(function(D){return xn(D)}),ae=!!E.find(function(D){return cn(D)>0});return{container:A,tabbableNodes:E,focusableNodes:S,posTabIndexesFound:ae,firstTabbableNode:O,lastTabbableNode:V,firstDomTabbableNode:H,lastDomTabbableNode:Q,nextTabbableNode:function($){var X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,B=E.indexOf($);return B<0?X?S.slice(S.indexOf($)+1).find(function(T){return xn(T)}):S.slice(0,S.indexOf($)).reverse().find(function(T){return xn(T)}):E[B+(X?1:-1)]}}}),s.tabbableGroups=s.containerGroups.filter(function(A){return A.tabbableNodes.length>0}),s.tabbableGroups.length<=0&&!d("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(A){return A.posTabIndexesFound})&&s.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},p=function R(A){var E=A.activeElement;if(E)return E.shadowRoot&&E.shadowRoot.activeElement!==null?R(E.shadowRoot):E},g=function R(A){if(A!==!1&&A!==p(document)){if(!A||!A.focus){R(h());return}A.focus({preventScroll:!!i.preventScroll}),s.mostRecentlyFocusedNode=A,_p(A)&&A.select()}},f=function(A){var E=d("setReturnFocus",A);return E||(E===!1?!1:A)},b=function(A){var E=A.target,S=A.event,O=A.isBackward,V=O===void 0?!1:O;E=E||ta(S),m();var H=null;if(s.tabbableGroups.length>0){var Q=u(E,S),ae=Q>=0?s.containerGroups[Q]:void 0;if(Q<0)V?H=s.tabbableGroups[s.tabbableGroups.length-1].lastTabbableNode:H=s.tabbableGroups[0].firstTabbableNode;else if(V){var D=Fu(s.tabbableGroups,function(I){var W=I.firstTabbableNode;return E===W});if(D<0&&(ae.container===E||wa(E,i.tabbableOptions)&&!xn(E,i.tabbableOptions)&&!ae.nextTabbableNode(E,!1))&&(D=Q),D>=0){var $=D===0?s.tabbableGroups.length-1:D-1,X=s.tabbableGroups[$];H=cn(E)>=0?X.lastTabbableNode:X.lastDomTabbableNode}else _r(S)||(H=ae.nextTabbableNode(E,!1))}else{var B=Fu(s.tabbableGroups,function(I){var W=I.lastTabbableNode;return E===W});if(B<0&&(ae.container===E||wa(E,i.tabbableOptions)&&!xn(E,i.tabbableOptions)&&!ae.nextTabbableNode(E))&&(B=Q),B>=0){var T=B===s.tabbableGroups.length-1?0:B+1,L=s.tabbableGroups[T];H=cn(E)>=0?L.firstTabbableNode:L.firstDomTabbableNode}else _r(S)||(H=ae.nextTabbableNode(E))}}else H=d("fallbackFocus");return H},v=function(A){var E=ta(A);if(!(u(E,A)>=0)){if(pr(i.clickOutsideDeactivates,A)){o.deactivate({returnFocus:i.returnFocusOnDeactivate});return}pr(i.allowOutsideClick,A)||A.preventDefault()}},C=function(A){var E=ta(A),S=u(E,A)>=0;if(S||E instanceof Document)S&&(s.mostRecentlyFocusedNode=E);else{A.stopImmediatePropagation();var O,V=!0;if(s.mostRecentlyFocusedNode)if(cn(s.mostRecentlyFocusedNode)>0){var H=u(s.mostRecentlyFocusedNode),Q=s.containerGroups[H].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&&(O=Q[ae+1],V=!1):ae-1>=0&&(O=Q[ae-1],V=!1))}}else s.containerGroups.some(function(D){return D.tabbableNodes.some(function($){return cn($)>0})})||(V=!1);else V=!1;V&&(O=b({target:s.mostRecentlyFocusedNode,isBackward:i.isKeyBackward(s.recentNavEvent)})),g(O||s.mostRecentlyFocusedNode||h())}s.recentNavEvent=void 0},F=function(A){var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;s.recentNavEvent=A;var S=b({event:A,isBackward:E});S&&(_r(A)&&A.preventDefault(),g(S))},_=function(A){if(kp(A)&&pr(i.escapeDeactivates,A)!==!1){A.preventDefault(),o.deactivate();return}(i.isKeyForward(A)||i.isKeyBackward(A))&&F(A,i.isKeyBackward(A))},w=function(A){var E=ta(A);u(E,A)>=0||pr(i.clickOutsideDeactivates,A)||pr(i.allowOutsideClick,A)||(A.preventDefault(),A.stopImmediatePropagation())},k=function(){if(s.active)return _u.activateTrap(a,o),s.delayInitialFocusTimer=i.delayInitialFocus?ku(function(){g(h())}):g(h()),r.addEventListener("focusin",C,!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",_,{capture:!0,passive:!1}),o},j=function(){if(s.active)return r.removeEventListener("focusin",C,!0),r.removeEventListener("mousedown",v,!0),r.removeEventListener("touchstart",v,!0),r.removeEventListener("click",w,!0),r.removeEventListener("keydown",_,!0),o},q=function(A){var E=A.some(function(S){var O=Array.from(S.removedNodes);return O.some(function(V){return V===s.mostRecentlyFocusedNode})});E&&g(h())},P=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(q):void 0,z=function(){P&&(P.disconnect(),s.active&&!s.paused&&s.containers.map(function(A){P.observe(A,{subtree:!0,childList:!0})}))};return o={get active(){return s.active},get paused(){return s.paused},activate:function(A){if(s.active)return this;var E=l(A,"onActivate"),S=l(A,"onPostActivate"),O=l(A,"checkCanFocusTrap");O||m(),s.active=!0,s.paused=!1,s.nodeFocusedBeforeActivation=r.activeElement,E==null||E();var V=function(){O&&m(),k(),z(),S==null||S()};return O?(O(s.containers.concat()).then(V,V),this):(V(),this)},deactivate:function(A){if(!s.active)return this;var E=Eu({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},A);clearTimeout(s.delayInitialFocusTimer),s.delayInitialFocusTimer=void 0,j(),s.active=!1,s.paused=!1,z(),_u.deactivateTrap(a,o);var S=l(E,"onDeactivate"),O=l(E,"onPostDeactivate"),V=l(E,"checkCanReturnFocus"),H=l(E,"returnFocus","returnFocusOnDeactivate");S==null||S();var Q=function(){ku(function(){H&&g(f(s.nodeFocusedBeforeActivation)),O==null||O()})};return H&&V?(V(f(s.nodeFocusedBeforeActivation)).then(Q,Q),this):(Q(),this)},pause:function(A){if(s.paused||!s.active)return this;var E=l(A,"onPause"),S=l(A,"onPostPause");return s.paused=!0,E==null||E(),j(),z(),S==null||S(),this},unpause:function(A){if(!s.paused||!s.active)return this;var E=l(A,"onUnpause"),S=l(A,"onPostUnpause");return s.paused=!1,E==null||E(),m(),k(),z(),S==null||S(),this},updateContainerElements:function(A){var E=[].concat(A).filter(Boolean);return s.containers=E.map(function(S){return typeof S=="string"?r.querySelector(S):S}),s.active&&m(),z(),this}},o.updateContainerElements(t),o};const Sp=Object.freeze(Object.defineProperty({__proto__:null,createFocusTrap:Tp},Symbol.toStringTag,{value:"Module"})),jp=Nc(Sp),Op=Nc(Dp);function tr(e){"@babel/helpers - typeof";return tr=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},tr(e)}function Pp(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,Ad(r.key),r)}}function Mp(e,t,n){return t&&Bu(e.prototype,t),n&&Bu(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Np(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&&_s(e,t)}function _s(e,t){return _s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},_s(e,t)}function Rp(e){var t=$p();return function(){var r=Na(e),a;if(t){var i=Na(this).constructor;a=Reflect.construct(r,arguments,i)}else a=r.apply(this,arguments);return Ip(this,a)}}function Ip(e,t){if(t&&(tr(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return wr(e)}function wr(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $p(){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 Na(e){return Na=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Na(e)}function Lp(e,t,n){return t=Ad(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ad(e){var t=zp(e,"string");return tr(t)==="symbol"?t:String(t)}function zp(e,t){if(tr(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(tr(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var na=y,ve=ip,qp=jp,Wp=qp.createFocusTrap,Up=Op,Hp=Up.isFocusable,uo=function(e){Np(n,e);var t=Rp(n);function n(r){var a;Pp(this,n),a=t.call(this,r),Lp(wr(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 d=arguments.length,h=new Array(d>1?d-1:0),m=1;m<d;m++)h[m-1]=arguments[m];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 p=u;if(typeof u=="string"){var g;if(p=(g=this.getDocument())===null||g===void 0?void 0:g.querySelector(u),!p)throw new Error("`".concat(o,"` as selector refers to no known node"))}return p}),a.handleDeactivate=a.handleDeactivate.bind(wr(a)),a.handlePostDeactivate=a.handlePostDeactivate.bind(wr(a)),a.handleClickOutsideDeactivates=a.handleClickOutsideDeactivates.bind(wr(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 Mp(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&&!Hp(a.outsideClick.target,a.internalOptions.tabbableOptions))),u=a.internalOptions.preventScroll,d=u===void 0?!1:u;l&&o.focus({preventScroll:d}),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?na.Children.only(this.props.children):void 0;if(i){if(i.type&&i.type===na.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 d=a.props.containerElements;i&&(typeof i.ref=="function"?i.ref(u):i.ref&&(i.ref.current=u)),a.focusTrapElements=d||[u]},o=na.cloneElement(i,{ref:s});return o}return null}}]),n}(na.Component),gr=typeof Element>"u"?Function:Element;uo.propTypes={active:ve.bool,paused:ve.bool,focusTrapOptions:ve.shape({document:ve.object,onActivate:ve.func,onPostActivate:ve.func,checkCanFocusTrap:ve.func,onPause:ve.func,onPostPause:ve.func,onUnpause:ve.func,onPostUnpause:ve.func,onDeactivate:ve.func,onPostDeactivate:ve.func,checkCanReturnFocus:ve.func,initialFocus:ve.oneOfType([ve.instanceOf(gr),ve.string,ve.bool,ve.func]),fallbackFocus:ve.oneOfType([ve.instanceOf(gr),ve.string,ve.func]),escapeDeactivates:ve.oneOfType([ve.bool,ve.func]),clickOutsideDeactivates:ve.oneOfType([ve.bool,ve.func]),returnFocusOnDeactivate:ve.bool,setReturnFocus:ve.oneOfType([ve.instanceOf(gr),ve.string,ve.bool,ve.func]),allowOutsideClick:ve.oneOfType([ve.bool,ve.func]),preventScroll:ve.bool,tabbableOptions:ve.shape({displayCheck:ve.oneOf(["full","legacy-full","non-zero-area","none"]),getShadowRoot:ve.oneOfType([ve.bool,ve.func])}),trapStack:ve.array,isKeyForward:ve.func,isKeyBackward:ve.func}),containerElements:ve.arrayOf(ve.instanceOf(gr)),children:ve.oneOfType([ve.element,ve.instanceOf(gr)])};uo.defaultProps={active:!0,paused:!1,focusTrapOptions:{},_createFocusTrap:Wp};var Vp=uo;const Kp=On(Vp);const tn=({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:d="",gtmContext:h="Modal"})=>{const m=ie.useIntl(),{registerOverlay:p,unregisterOverlay:g}=hd(),[f,b]=y.useState(t),[v,C]=y.useState(null),F=y.useRef(null),_=P=>{f&&P.key==="Escape"&&j(!1)},w=P=>{C(P.target)},k=P=>{v===F.current&&P.target===F.current&&j(!1),C(null)};y.useEffect(()=>{if(f)return window.addEventListener("keyup",_),()=>{window.removeEventListener("keyup",_)}},[f]),y.useEffect(()=>{const P=F.current;return P&&(P.addEventListener("mousedown",w),P.addEventListener("mouseup",k)),()=>{P&&(P.removeEventListener("mousedown",w),P.removeEventListener("mouseup",k))}},[v]);const j=P=>{if(b(P),P)a(),p(e);else{if(f===P)return;i(),g(e)}};y.useEffect(()=>(j(t),()=>{f&&g(e)}),[t]);const q=r?{"--max-width":`${r/16}rem`}:{};return c.jsx("div",{id:`${e}-overlay`,ref:F,className:K("overlay",{open:f,"in-portal":d.includes("in-portal")}),role:"dialog",children:c.jsx(so,{id:e,className:K("overlay-modal",d,{"has-max-width":r}),hidden:!f,style:q,children:t&&c.jsx(Kp,{containerElements:[F.current],children:c.jsxs("div",{className:"overlay-content",children:[c.jsxs("div",{className:"top",children:[o&&c.jsx("h2",{className:"modal-title",children:o}),c.jsx(Fe,{variant:"tertiary",size:"medium",icon:{icon:"close"},onClick:()=>j(!1),className:"gtm-trackable","data-gtm-event-type":"close-modal-click","data-gtm-event-context":h,screenreaderText:m.formatMessage({id:"overlay_close"})})]}),n&&c.jsx(Ht,{}),l,u&&c.jsxs("div",{className:"bottom",children:[c.jsx(Ht,{}),c.jsx(or,{buttons:u})]}),s&&c.jsx(Mr,{className:"error",children:s})]})})})})},Td=(e,t)=>({"aria-haspopup":!0,"aria-expanded":t,"aria-controls":e});const vr="joinCommunityButton",lo=({isMember:e=!1,isOpen:t=!1,isShort:n=!1,disabled:r=!1,functions:{join:a,leave:i}={join:()=>{},leave:()=>{}}})=>{const s=ie.useIntl(),o=y.useContext(st),l=o&&typeof o.id=="string",u=r||!l,[d,h]=y.useState(e),[m,p]=y.useState(e?"joined":"notJoined");y.useEffect(()=>{m==="joining"?p("joined"):m==="leaving"&&p("notJoined")},[d]);const g={},f={};return d&&m!=="leaving"&&(g["data-hover-text"]=s.formatMessage({id:`${vr}_leave`}),g["aria-label"]=s.formatMessage({id:`${vr}_member_aria`}),f["aria-hidden"]="true"),c.jsx(Fe,{variant:d?"secondary":"primary",size:"medium",styling:{fullWidth:!0},icon:d&&m!=="leaving"?{icon:"tick",position:"left"}:!1,tooltip:!t&&!d?s.formatMessage({id:`${vr}_closed_tooltip`}):"",onClick:async b=>{if(u)return;b.currentTarget.blur(),p(d?"leaving":"joining");const v=new CustomEvent("ariaLive",{detail:{message:s.formatMessage({id:`${vr}_aria_live`},{action:d?"leaving":"joining"})}});document.dispatchEvent(v);const C=d?i:a;typeof C=="function"&&setTimeout(async()=>{await C()},500),h(!d)},className:K("join-community-button",m,{active:m==="joining"}),disabled:u,"data-testid":"join-button",...g,children:c.jsx("span",{className:"text",...f,children:s.formatMessage({id:`${vr}${["joining","leaving"].includes(m)?`_${m}`:d?"_member":n?"_short":""}`})})})};const Fi="communityDetails_",Zp=({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=ie.useIntl(),{id:u}=y.useContext(st),d=u,h=5,m=a||i.length,p=i.length?i:Array(h).fill({}),g=`/communities/${r}/members`===window.location.pathname,f=t||n,b=!n&&!t;return c.jsxs("div",{className:K("community-details",e),children:[f?c.jsxs("div",{className:"member-details",children:[c.jsxs("div",{className:"top",children:[c.jsxs("h4",{children:[l.formatMessage({id:`${Fi}members`}),c.jsx("span",{className:"count",children:m})]}),g?c.jsx(c.Fragment,{}):c.jsx("p",{className:"text-small",children:c.jsx("a",{href:`/communities/${r}/members`,children:l.formatMessage({id:`${Fi}viewAll`})})})]}),d&&c.jsx(io,{contributors:{total:a,data:p},styling:{size:"medium",showGap:!0,showPlaceholders:m===0},cutoff:h})]}):c.jsx(c.Fragment,{}),d?c.jsxs(c.Fragment,{children:[c.jsx(lo,{isMember:t,isOpen:n,disabled:b,functions:{...o}}),t&&c.jsx(Fe,{variant:"primary",onClick:s,icon:{icon:"plus"},styling:{fullWidth:!0},children:l.formatMessage({id:`${Fi}invite`})})]}):c.jsx(c.Fragment,{})]})};const Yp=({breadcrumbs:e,cutoff:t=20,className:n=""})=>{const r=ie.useIntl();return c.jsxs(c.Fragment,{children:[c.jsx(Ie,{element:"p",children:r.formatMessage({id:"breadcrumbs_label"})}),c.jsx("ul",{className:K("breadcrumbs text-small",n),children:e.map(({text:a,href:i,current:s=!1},o)=>{const l={};return s&&(l["aria-current"]="location"),c.jsxs("li",{children:[s&&c.jsx(Ie,{element:"span",children:r.formatMessage({id:"breadcrumbs_currentPage"})}),c.jsx(mn,{href:s?void 0:i,...l,children:Xn(a,t)})]},`${window.btoa(a)}_${o}`)})})]})};const Gp=({variant:e="default",data:{image:t,url:n,title:r,description:a},gtm:i})=>{const s=n.split("//")[1].split("/")[0],{context:o="EnrichedLink",event:l="enriched-link-click"}=i??{};return c.jsxs("aside",{className:K("enriched-url gtm-trackable",{"has-image":t,[e]:e!=="default"}),onClick:u=>{u.preventDefault(),u.stopPropagation(),window.location.href=n},"data-gtm-event-context":o,"data-gtm-event-type":l,children:[c.jsx("small",{children:s}),c.jsx("p",{className:"title text-medium",children:c.jsx("a",{href:n,target:"_blank",rel:"noreferrer",children:r})}),a&&e!=="condensed"?c.jsx("p",{className:"text-small",children:a}):c.jsx(c.Fragment,{}),t&&t.src?c.jsx("p",{className:"img",children:c.jsx("img",{src:t.src,alt:t.alt||"",loading:"lazy",fetchpriority:"low",width:t.width||"auto",height:t.height||"100%"})}):c.jsx(c.Fragment,{})]})};const Qp=({options:e,allOption:t=!1,allowMultiple:n=!0,onChange:r=()=>{},className:a=""})=>{const i=ie.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=(d,h)=>{let m=[];o.includes(d)?m=o.filter(p=>p!==d):d==="all"?m=["all"]:n?m=[...o.filter(p=>p!=="all"),d]:m=[d],l(p=>(r&&typeof r=="function"&&r({current:m,previous:p}),m)),h&&typeof h=="function"&&h()};return c.jsx("ul",{className:K("filters",a),children:s.map(({id:d,text:h,disabled:m=!1,callback:p=()=>{}})=>{let g={};return m&&(g={disabled:!0,"aria-label":i.formatMessage({id:"filters_disabled"},{name:h})}),c.jsx("li",{children:c.jsx("button",{className:K(d,{selected:o.includes(d)}),onClick:f=>{f.preventDefault(),f.stopPropagation(),u(d,p)},...g,children:h})},d)})})},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 ra="languageSwitcher_",Xp=({currentLanguage:e,isOriginalLanguage:t=!1,isHumanTranslation:n=!1,translations:r,onChange:a,urlParts:i,variant:s="default",label:o,className:l=""})=>{const u=ie.useIntl(),{updateLanguage:d=()=>{}}=y.useContext(no),[h,m]=y.useState(e);if(y.useEffect(()=>{e!==h&&m(e)},[e]),!r||!Object.values(r).some(b=>b&&b.post_name))return null;const g=Object.keys(r),f=h!==e;return c.jsxs("div",{className:K("language-switcher text-small",s,l),children:[c.jsxs("nav",{children:[s!=="short"&&c.jsx("p",{children:o||u.formatMessage({id:`${ra}label`})}),c.jsx("ul",{children:g.map(b=>{var F;if(!Ca[b])return null;const v=(F=r[b])==null?void 0:F.post_name;let C={className:b};if(h===b)C["aria-label"]=u.formatMessage({id:`${ra}selected`},{language:Ca[b]});else{const _=Jp(b,v,i);C={...C,href:typeof _=="string"?_:_.url,onClick:w=>{m(b),d(b),typeof a<"u"&&(w.preventDefault(),w.stopPropagation(),a(b,typeof _=="string"?_:_.urlForRouter))}}}return c.jsx("li",{children:c.jsx(mn,{...C,fallbackElement:"span",children:Ca[b]})},b)})}),s!=="short"&&!f&&c.jsx("p",{children:u.formatMessage({id:`${ra}translation_${t?"original":n?"human":"machine"}`})})]}),s!=="short"&&!f&&!t&&!n&&c.jsx("small",{children:u.formatMessage({id:`${ra}disclaimer`},{email:Un.support,link:b=>{const v=`mailto:${b}`;return c.jsx("a",{href:v,children:b})}})})]})};const Bi=ie.createIntl({locale:"en",messages:sr}),Vr=({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:Bi.formatMessage({id:"loadMore_button"}),endOfFeed:Bi.formatMessage({id:"loadMore_endOfFeed"}),error:Bi.formatMessage({id:"loadMore_error"})},className:l="",gtmContext:u="LoadMore"})=>{const[d,h]=y.useState(""),m=async p=>{if(!n)try{await t(p)}catch(g){g instanceof Error?h(g.message):h("Unknown error")}};return!d&&!e&&!o.endOfFeed?null:c.jsx("footer",{className:K("load-more",l),children:!d&&e?c.jsx(Fe,{variant:r,size:a,styling:i,icon:s,onClick:m,"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&&(!d||d!=null&&d.includes("Cannot read items"))?c.jsx("p",{children:o.endOfFeed}):d&&c.jsx("p",{className:"error",children:o.error})})};const co=({variant:e="default",version:t="default",className:n="",...r})=>c.jsx("p",{className:"logo-wrapper",children:c.jsx("a",{href:"/home/",className:K("logo",e,t,n),...r,children:c.jsx(Ie,{children:c.jsx(ie.FormattedMessage,{id:"apolitical"})})})});let aa=!1;const Sd=({element:e="div",id:t="more-menu",options:n,className:r=""})=>{const a=ie.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:K("more-menu text-medium",r),children:c.jsxs(c.Fragment,{children:[c.jsx(Fe,{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"}),c.jsx("ul",{id:t,hidden:!s,children:n.map(({href:u,onClick:d,text:h,icon:m,...p},g)=>{const f={...p,onClick:b=>{o(!1),typeof d=="function"&&d(b)},onFocus:()=>{aa&&(clearTimeout(aa),aa=!1)},onBlur:()=>{aa=setTimeout(()=>{o(!1)},100)}};return u&&(f.href=u),c.jsx("li",{className:"more-menu-list-item",children:c.jsx(Fe,{variant:"tertiary",size:"medium",icon:m?{icon:m,position:"left"}:!1,...f,children:h})},`${window.btoa(h)}_${g}`)})})]})})},eg=(e,t=!1)=>t?e.replaceAll("/","")===t:typeof window<"u"&&window.location&&window.location.pathname===e;const tg=y.lazy(()=>Promise.resolve().then(()=>Gm)),ng=[{key:"homepage",href:"/home/"},{key:"events",href:"/events/"},{key:"microcourses",href:"/microcourses/"},{key:"articles",href:"/solution-articles/"},{key:"communities",href:"/communities/"}],jd=({activeLink:e,profile:t})=>{const n=ie.useIntl(),r=y.useContext(st),a=r&&typeof r.id=="string";return c.jsxs("ul",{id:"navigation-menu",className:"text-medium",children:[ng.map(({key:i,href:s})=>{const o=eg(s,e),l={};return o&&(l["aria-current"]="page"),c.jsx("li",{className:K(i,{active:o}),children:c.jsx("a",{href:s,"data-gtm-event-type":`${i}-click`,"data-gtm-event-context":"NavigationMenu",className:"gtm-trackable",...l,children:n.formatMessage({id:`navigationMenu_links_${i}`})})},i)}),a&&t&&c.jsx(tg,{element:"li",member:r,styling:{variant:"card",isCondensed:!1},functions:{profile:t},className:"profile gtm-trackable","data-testid":"profile-link",alt:"",gtmContext:"NavigationMenu",gtmType:"profile-click"})]})},br=(e,t,n)=>`${e}?share=${t}${n?`&uuid=${n}`:""}`,rg=({title:e,link:t,referrer:n})=>[{key:"linkedin",icon:"social_linkedin",url:`https://www.linkedin.com/shareArticle?mini=true&url=${encodeURIComponent(`${br(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(`${br(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(`${br(t,"facebook",n)}`)}&t=${e}`},{key:"email",icon:"share_email",url:`mailto:?subject=${encodeURIComponent(e)}&body=${encodeURIComponent(`${e}
63
63
 
64
- ${br(t,"mailto",n)}&src=email`)}`},{key:"clipboard-copy",icon:"share_copy-link",url:br(t,"copy",n),shouldRender:()=>navigator&&navigator.clipboard&&navigator.clipboard.writeText,onClick:(r,a)=>(r.preventDefault(),r.stopPropagation(),navigator.clipboard.writeText(a))}];const ag="shareLinks_",ig=({title:e,link:t,referrer:n,gtmContext:r="ShareLinks",size:a="large",variant:i="default",className:s=""})=>{const o=ie.useIntl(),l=rg({title:e,link:t,referrer:n});return c.jsxs("aside",{className:K("share-links",a,i,s),children:[c.jsx("p",{className:"text-small",children:o.formatMessage({id:"shareLinks_label"})}),c.jsx("ul",{children:l.map(({key:u,icon:d,url:h,shouldRender:m=!0,onClick:p})=>{if(typeof m=="function"&&!m())return null;const g={};return p&&(g.onClick=f=>p(f,h)),c.jsx("li",{children:c.jsx(Fe,{size:a,variant:"tertiary",icon:{icon:d||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:`${ag}link_${u}`}),...g})},u)})})]})};const sg=({tabs:e,className:t="",preventLocationChange:n})=>{var g;const r=(f,b,v)=>(f||(f=`panel-${window.btoa(b)}-${v}`),f),a=Pn(!0)||0;let i=e.findIndex(f=>f.current===!0);if(i<0&&(i=0),window.location.hash){const f=window.location.hash.replace("#","");if(e.find(v=>v.id===f)){for(let v=0;v<e.length;v++)if(r(e[v].id,e[v].text,v)===f){i=v;break}}}const[s,o]=y.useState((g=e[i])!=null&&g.id?e[i].id:r(e[i].id,e[i].text,i)),[l,u]=y.useState(""),d=(f,b)=>{switch(f.key){case"ArrowLeft":case"ArrowRight":{f.preventDefault();let v=b;f.key==="ArrowLeft"?b>0?v=b-1:v=e.length-1:f.key==="ArrowRight"&&(b<e.length-1?v=b+1:v=0);const C=r(e[v].id,e[v].text,v),F=document.getElementById(`tab-${C}`);F==null||F.focus(),u(C);break}case"Enter":o(l),window.location.hash=`#${l}`;break}},h=f=>{let b=!1;return f.target==="min-width"&&a>=f.value&&(b=!0),f.target==="max-width"&&a<=f.value&&(b=!0),b};y.useEffect(()=>{if(e[i].hasCarousel){const f=new CustomEvent("hiddenSectionVisible",{detail:{id:s}});window.dispatchEvent(f)}},[s]);const m=[],p=[];return e.forEach(({id:f,text:b,content:v,href:C,hasCarousel:F,breakpoint:_},w)=>{if(_&&!h(_))return;f=r(f,b,w);const k=s===f,j={};C||(j["aria-controls"]=f,j.onClick=q=>{q.preventDefault(),q.stopPropagation(),o(f),!n&&(window.location.hash=`#${f}`)},p.push(c.jsx("section",{id:f,hidden:!k,role:"tabpanel","aria-labelledby":`tab-${f}`,"aria-live":k?"assertive":"off",children:typeof v=="string"?c.jsx("p",{children:v}):v},`section-${f}`))),m.push(c.jsx("li",{"data-testid":"navigation-tab",children:c.jsx("a",{href:C||`#${f}`,id:`tab-${f}`,"aria-controls":f,className:K({selected:k}),role:"tab",tabIndex:k?0:-1,"aria-selected":k,onKeyDown:q=>d(q,w),...j,children:b})},`tab-${f}`))}),c.jsxs("div",{className:K("tabs-wrapper",t),children:[c.jsx("ul",{className:"tabs",role:"tablist",children:m}),c.jsx("div",{className:"tab-content",children:p})]})};const og={"2-1":901,"1-3":769,"1-1":769},Od=({layout:e="2-1",hideOnMobile:t=!1,hasCSSContainers:n=!1,className:r="",children:a})=>{const i=Pn(!0);let s=a;return y.Children.count(a)===1&&(s=y.Children.toArray(a)[0],s.props&&(s=s.props.children)),c.jsx("section",{className:K("columns",`layout-${e}`,r,{"has-containers":n}),children:y.Children.map(s,(o,l)=>t!==!1&&l===t&&i&&i<og[e]?null:o)})};const fo=({id:e="character-limit",limit:t,valueLength:n,...r})=>{const a=ie.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,d=n>t;return c.jsxs(c.Fragment,{children:[c.jsx("small",{id:e,className:K("character-limit",{"near-limit":l,"approaching-limit":u}),"aria-live":"polite","aria-label":d?"":a.formatMessage({id:`${i}_aria_${s<0?"over":"default"}`},{remaining:s,over:o,limit:t}),children:d?a.formatMessage({id:`${i}_aria_${s<0?"over":"default"}`},{remaining:s,over:o,limit:t}):c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"hidden",children:a.formatMessage({id:i})}),n," / ",t]})}),c.jsx(Ie,{showOnFocus:!1,id:`${e}-info`,children:a.formatMessage({id:`${i}_info`},{limit:t})})]})},ai=e=>(e==null?void 0:e.toString().length)||0,Pd=(e,t=null)=>{const n={};return e===0||(n["data-character-limit"]=e,t&&(n.functions={onChange:r=>{ai(r)>e&&(r=r==null?void 0:r.toString().slice(0,e)),t(r)}})),n};const ia="emailHelperTextBox_",Md=({id:e="email-helper-textbox",type:t,email:n,redirectPath:r,resendVerificationCode:a})=>{const i=ie.useIntl(),[s,o]=y.useState({path:`${ia}default`,type:"default",link:{},mail:{},error:""}),[l,u]=y.useState(!1),d=y.useCallback(g=>{g.preventDefault(),g.stopPropagation();const f=b=>{o({path:`${ia}error_verificationFailedToSend`,type:"error",link:{"data-gtm-event-context":"VerifyEmailBox","data-gtm-event-type":"SendEmailClick",className:"gtm-trackable",onClick:v=>d(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:`${ia}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=ia,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:C=>d(C),"data-testid":"send-verify-email-click"};break;case"exists":g+="emailAlreadyExists",f="error",b={href:"/api/next-ui/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=>c.jsx("a",{...s[g],children:f}):f=>f}),c.jsx(rd,{id:e,type:s.type,heading:l?!1:i.formatMessage({id:`${s.path}_title`}),"aria-live":"assertive",children:l?c.jsxs(c.Fragment,{children:[c.jsx(St,{element:"span"}),c.jsx(St,{element:"span"})]}):i.formatMessage({id:`${s.path}_text`},{...h,strong:g=>c.jsx("strong",{children:g}),em:g=>c.jsx("em",{children:g}),br:c.jsxs(c.Fragment,{children:[c.jsx("br",{}),c.jsx("br",{})]}),error:s.error})})},Hn=({className:e="",element:t="input",id:n,inputRef:r,functions:a={onChange:()=>{}},name:i=n,placeholder:s,type:o="text",value:l,autoFocus:u,...d})=>{const h=y.useRef(),m=r||h;return y.useEffect(()=>{var p;u&&((p=m.current)==null||p.focus())},[]),!(d!=null&&d.autoComplete)&&["email"].includes(o)&&(d.autoComplete="email"),y.createElement(t,{ref:m,...d,type:o,id:n,name:i,className:K(e,t,{"has-scrollbar":o==="textarea"&&m.current&&m.current.clientHeight<m.current.scrollHeight}),value:l,placeholder:s,autoFocus:u,...a,onChange:p=>{const g=p.target;a.onChange(g.value)}})};const $n={UP:"ArrowUp",DOWN:"ArrowDown",ENTER:"Enter"},ug=500,lg=({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:d},h]=y.useState({input:n,displayInput:n,debouncedInput:n}),[{predictions:m,activePredictionIndex:p,isPredictionSelected:g},f]=y.useState({predictions:[],activePredictionIndex:-1,isPredictionSelected:!!n}),{formatMessage:b}=ie.useIntl();r||(r=b({id:"inputAutocomplete_placeholder"})),y.useEffect(()=>{const _=setTimeout(()=>{g||h(w=>({...w,debouncedInput:l}))},ug);return()=>{clearTimeout(_)}},[l,g]),y.useEffect(()=>{d&&!g?(async()=>{try{const w=await o(d)||[];f(k=>({...k,predictions:w}))}catch(w){console.error("Error fetching predictions:",w),f(k=>({...k,predictions:[]}))}})():f(_=>({..._,predictions:[]}))},[d,g]),y.useEffect(()=>{p>=0&&m[p]&&h(_=>({..._,displayInput:m[p].description}))},[p,m]);const v=_=>{[$n.DOWN,$n.UP,$n.ENTER].includes(_.key)&&(_.preventDefault(),_.key===$n.DOWN&&p<m.length-1?f(w=>({...w,activePredictionIndex:p+1})):_.key===$n.UP&&p>0?f(w=>({...w,activePredictionIndex:p-1})):_.key===$n.ENTER&&p>-1&&(s(m[p].description),h(w=>({...w,input:m[p].description})),f(w=>({...w,predictions:[],isPredictionSelected:!0}))))},C=_=>{s(_.target.value),h(w=>({...w,input:_.target.value,displayInput:_.target.value})),f(w=>({...w,activePredictionIndex:-1,isPredictionSelected:!1}))},F=_=>{s(_.description),h(w=>({...w,input:_.description,displayInput:_.description})),f(w=>({...w,isPredictionSelected:!0,predictions:[]}))};return c.jsxs(c.Fragment,{children:[c.jsx("input",{type:"text",value:u,onChange:C,onKeyDown:v,placeholder:r,name:t,id:e,...i}),c.jsx("ul",{className:"predictions-list",children:m.map((_,w)=>c.jsx("li",{onClick:()=>F(_),onMouseEnter:()=>f(k=>({...k,activePredictionIndex:w})),className:K("predictions-list-item",{active:w===p}),children:_.description},w))})]})};const Nd=({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:d,...h})=>{const m=ie.useIntl(),{onChange:p,...g}=r,f=()=>{t||p(d?null:l)},b=c.jsxs(c.Fragment,{children:[c.jsx("input",{ref:i,id:a,name:a,type:u,value:l,checked:d,onKeyDown:v=>{(v.key==="Enter"||v.code==="Space")&&(v.preventDefault(),v.stopPropagation(),f())},readOnly:!0,disabled:t}),c.jsx("span",{className:"pretty-checkbox","data-testid":"pretty-checkbox"}),c.jsx("label",{htmlFor:a,children:o||m.formatMessage({id:s?`${s}_${a}`:a})})]});return y.createElement(n,{onClick:v=>{const C=v.target;C.nodeName.toLowerCase()==="a"||C.parentNode&&C.parentNode.nodeName.toLowerCase()==="a"||(v.preventDefault(),v.stopPropagation(),f())},className:K("checkbox-wrapper",e),...h,...g},b)};const cg=y.memo(function({direction:t="down"}){return c.jsx(Ja,{className:K("rotating-chevron",`direction-${t}`)})});const dg=({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 d=ie.useIntl(),[h,m]=y.useState(!1),p=r||n,g=Array.isArray(p)?[...p]:p?[p]:[],[f,b]=y.useState(g);let v;Array.isArray(f)&&f.length===1&&typeof f[0]=="string"?v=t&&f?t.find(j=>j.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:C,onMultiSelectSubmit:F,..._}=a,w=j=>{if(o){let q=[];f!=null&&f.includes(j.id)?q=f.filter(P=>P!==j.id):q=[...f,j.id],b([...q]),C&&C([...q])}else b([j]),C&&C(j.id),m(!1)},k=j=>{if(j==="all"){const q=(t==null?void 0:t.map(P=>P.id))||[];b(q),C&&C(q)}else b([]),C&&C([])};return c.jsxs("div",{className:K("dropdown-wrapper",e),children:[c.jsxs("button",{className:"input","aria-expanded":h,"aria-haspopup":"listbox","aria-controls":"dropdown-list",onClick:j=>{j.preventDefault(),j.stopPropagation(),m(!h)},"data-testid":"dropdown-selector",..._,children:[o?`${s} · ${f.length}`:v.label,c.jsx(cg,{direction:h?"up":"down"})]}),c.jsx("select",{defaultValue:v.id,onChange:j=>{j.preventDefault(),j.stopPropagation();const q=t&&t.find(P=>P.id===j.target.value);w(q)},hidden:!h,..._,children:t==null?void 0:t.map(j=>c.jsx("option",{value:j.id,className:"gtm-trackable","data-gtm-event-type":`${j.id}-click`,"data-gtm-event-context":i,children:j.label},j.id))}),c.jsxs("div",{className:"menu-options input dropdown-menu",role:"menu",hidden:!h,children:[c.jsxs("div",{className:"dropdown-menu-list",children:[(l==null?void 0:l.topbar)&&c.jsxs("div",{className:"action-bar",children:[c.jsx("p",{children:`${f==null?void 0:f.length} selected`}),c.jsxs("ul",{children:[c.jsx("li",{children:c.jsx(Fe,{variant:"tertiary",size:"small",onClick:()=>k("all"),className:"gtm-trackable","data-gtm-event-type":"all-click","data-gtm-event-context":i,children:d.formatMessage({id:"dropdown_menu_multiselect_all"})})}),c.jsx("li",{children:c.jsx(Fe,{variant:"tertiary",size:"small",onClick:()=>k("none"),className:"gtm-trackable","data-gtm-event-type":"none-click","data-gtm-event-context":i,children:d.formatMessage({id:"dropdown_menu_multiselect_none"})})})]})]}),c.jsx("ul",{children:t==null?void 0:t.map(j=>{const q=j.id===v.id||(f==null?void 0:f.includes(j))||(f==null?void 0:f.includes(j.id));return c.jsx("li",{"data-testid":"dropdown-options",children:c.jsxs("button",{className:K("gtm-trackable",{selected:q,"selected-single":q&&!o}),"data-gtm-event-type":`${j.id}-click`,"data-gtm-event-context":i,onClick:P=>{P.preventDefault(),P.stopPropagation(),w(j)},role:"menuitem","aria-current":q,"data-testid":q?"current-selection":"",children:[o&&c.jsx("span",{className:"pretty-checkbox","data-testid":"pretty-checkbox"}),c.jsx("span",{className:K({"menu-option-label":o}),children:j.label})]})},j.id)})})]}),(l==null?void 0:l.submitSection)&&c.jsx("p",{className:"submit",children:c.jsx(Fe,{variant:"secondary",onClick:()=>{F&&F(f),document.dispatchEvent(new CustomEvent("dropdownMultiSelectSubmit",{detail:{id:u||"dropdown-multi-select",value:f}})),m(!1)},children:d.formatMessage({id:"form_submit"})})})]})]})};const fg=({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:d,...h})=>{const m=ie.useIntl(),p=i?d:[],g=d;return c.jsx("ul",{...h,className:K("options-wrapper",e),"data-testid":`ul-${r}`,children:o==null?void 0:o.map(({id:f,label:b=!1,value:v=f,disabled:C=!1})=>{const F=`${r}_${f}`,_=()=>{if(C)return;let w;if(i){const k=p==null?void 0:p.indexOf(v);Array.isArray(p)&&k>=0?(w=p,w.splice(k,1)):(!p||p.length===0?w=[]:w=p,w.push(v))}else w=g===v?void 0:v;t.onChange(w)};return c.jsx(Nd,{element:"li",id:F,type:u==="checkboxes"?"checkbox":"radio",shownValue:v,value:i?p==null?void 0:p.includes(v):g===v,functions:{...t,onChange:_},intlPath:n,label:b||m.formatMessage({id:n?`${n}_${f}`:f}),disabled:C},F)})})};const hg=({inputRef:e,type:t="password",gtm:{context:n}={context:void 0},autoComplete:r="on",...a})=>{const i=ie.useIntl(),s=y.useRef(),o=e||s,[l,u]=y.useState(!1),[d,h]=y.useState(t),m=()=>{var p;u(!l),h(l?"password":"text"),(p=o.current)==null||p.focus()};return c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",className:K("show-password gtm-trackable",{"password-visible":l}),"data-gtm-event-context":n,"data-gtm-event-type":`${l?"hide":"show"}-password-click`,onClick:m,"aria-label":i.formatMessage({id:`showpassword_aria_${l?"hide":"show"}`}),children:i.formatMessage({id:`showpassword_${l?"hide":"show"}`})}),c.jsx(Hn,{inputRef:o,type:d,autoComplete:r,...a})]})};const Ln={text:{component:Hn},email:{component:Hn},url:{component:Hn},textarea:{component:Hn,props:{element:"textarea",rows:4,cols:10}},checkbox:{component:Nd},checkboxes:{component:fg,props:{multiSelect:!0}},select:{component:dg},password:{component:hg},autocomplete:{component:lg}},mg=({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:d,...h})=>{const m=ie.useIntl(),p=l&&l.some(({condition:R})=>R==="required"),g=ai(u),f=o&&Ln[o]&&Ln[o].component?Ln[o].component:Hn,b=o&&["checkboxes"].includes(o),v=o&&["autocomplete"].includes(o),C=r&&`error-${e}`,F=`character-limit-${e}`,_={};b?_.element="legend":_.htmlFor=e;let w={...h,id:e,name:e,className:r?"error":"",type:o,required:p,"aria-required":p,functions:En(a),value:u};const k=R=>{w["aria-describedby"]?w["aria-describedby"]+=` ${R}`:w["aria-describedby"]=R};if(i>0){const R=Pd(i,a.onChange);k(`${F}-info`),w={...w,...R},R.functions&&typeof R.functions=="object"&&(w.functions={...w.functions,...R.functions})}o&&Ln[o]&&Ln[o].props&&(w={...w,...Ln[o].props}),b&&(w.intlPath=`${t}_${e}`),r&&(w["aria-invalid"]=!0,w["aria-errormessage"]=C,k(C));const j=h.label||m.formatMessage({id:t?`${t}_${e}`:e}),q=({...R})=>r?y.createElement(R.as||"p",{id:C,className:"error text-small",...R},r):null;if(o&&["checkbox"].includes(o))return c.jsxs(c.Fragment,{children:[c.jsx(f,{...w,label:j,className:K("field-wrapper",n)}),c.jsx(q,{as:"p"})]});const P={};b||(P.className="field-label");const z=R=>y.createElement(R.element||"label",{...R,className:"checkboxes-label text-small","data-testid":`label-${e}`});return c.jsx(c.Fragment,{children:y.createElement(b?"fieldset":"div",{className:K("field-wrapper text-medium",n)},c.jsxs(c.Fragment,{children:[y.createElement(b?y.Fragment:"p",P,c.jsxs(z,{..._,children:[j,p&&s&&c.jsxs(c.Fragment,{children:[" ",c.jsxs("small",{children:["(",m.formatMessage({id:"form_fieldWrapper_required"}),")"]})]})]})),y.createElement(b||v?"div":"p",{className:"field-component"},c.jsxs(c.Fragment,{children:[c.jsx(f,{...w}),c.jsx(fo,{id:F,limit:i,valueLength:g})]})),c.jsx(q,{})]}))})},pg=(e,t)=>{const{type:n,payload:r}=t,a=e.errors?En(e.errors):{},i=e.values?En(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:d}=r,h=En(Object.keys(a));for(const m of s)if(m.validation)for(let p=0;p<m.validation.length;p++){const{condition:g="required",error:f=!1}=m.validation[p];let b=!1;if(typeof g=="function"){const v=g(i);v&&(b=f||v)}else{const v=i[m.id];switch(g){case"required":(!v||typeof v=="string"&&v.trim().length===0)&&(b=f||(d==null?void 0:d.formatMessage({id:"form_error_required"})));break;case"no-numbers":{v&&!/^([^0-9]*)$/.test(v)&&(b=f||(d==null?void 0:d.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||(d==null?void 0:d.formatMessage({id:"form_error_email"})));break}case"valid-url":{v&&!/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-._~:/?#[\]@!$&'()*+,;=%]+$/i.test(v)&&(b=f||(d==null?void 0:d.formatMessage({id:"form_error_url"})));break}default:console.warn("WARNING! No field validation condition has been set")}}if(b){o({type:"addError",payload:{key:m.id,value:b}}),h.push(m.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 Ai=null;const nn=({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:d={context:"Form",event:"form-submit-click"},functions:h,...m})=>{const{customOnSubmit:p,hideButton:g,...f}=s,b=40,{shouldShowCancelButton:v=!1,shouldReset:C=!0,shouldHide:F=!0,showRequiredLabels:_=!0,showSuccessMessage:w=!1}=l||{},{onSuccess:k=async()=>{},onCancel:j=()=>{},onCatch:q=()=>{},onFailure:P=()=>{}}=h||{},z=ie.useIntl(),R={};t.length&&t.forEach(T=>{const L=T.id||T.name;L&&(R[L]=T.value||"")});const[A,E]=y.useReducer(pg,{isSubmitting:!1,formSubmitted:!1,errors:{},values:R}),{errors:S,isSubmitting:O,formSubmitted:V,values:H}=A;y.useEffect(()=>{C&&V&&(Ai=setTimeout(()=>{E({type:"updateValue",payload:{key:"formSubmitted",value:!1}})},3e3))},[V]),y.useEffect(()=>()=>{Ai&&clearTimeout(Ai)},[]),y.useEffect(()=>{const T=L=>{E({type:"updateValue",payload:{key:L.detail.id,value:L.detail.value}})};return document.addEventListener("dropdownMultiSelectSubmit",T),()=>{document.removeEventListener("dropdownMultiSelectSubmit",T)}},[]);const Q=y.useRef(null),ae=a||Q;if(!t.length)return null;const D={};s.children&&(D.default=s.children),f.text&&typeof f.text=="string"&&(D.default=f.text),["default","submitting","submitted"].forEach(T=>{f.text&&typeof f.text!="string"&&T in f.text?D[T]=f.text[T]:D[T]||(D[T]=z.formatMessage({id:`form_${T==="default"?"submit":T}`}))}),delete f.text;const $=()=>{if(!O){if(E({type:"updateValue",payload:{key:"isSubmitting",value:!0}}),s.disabled){typeof s.disabled=="object"&&s.disabled.isClickable&&E({type:"submitForm",payload:{fields:t,dispatch:E,intl:z}});return}E({type:"submitForm",payload:{fields:t,dispatch:E,onSuccess:async T=>{try{await k(T),E({type:C?"formSubmittedAndReset":"formSubmitted"})}catch(L){q(L),E({type:"updateValue",payload:{key:"isSubmitting",value:!1}})}},onFailure:(T,L)=>{P(T,L),E({type:"updateValue",payload:{key:"isSubmitting",value:!1}})},intl:z}})}},B=[{...f,icon:V?{icon:"tick",position:"left"}:!1,className:"gtm-trackable",onClick:T=>{var W;if(T.preventDefault(),T.stopPropagation(),O)return;let L=0;if((W=ae==null?void 0:ae.current)!=null&&W.id){const U=document.getElementById(ae.current.id);U&&(L=U.getBoundingClientRect().top+window.scrollY)}const I=document.getElementById("header");I&&(L=L-I.offsetHeight-b),L<0&&(L=0),window.scrollTo({top:L,behavior:"smooth"}),$()},disabled:O||V||s.disabled,"data-gtm-event-context":d.context,"data-gtm-event-type":d.event,children:D[O?"submitting":V?"submitted":"default"]}];return v&&B.unshift({...o,className:"gtm-trackable","data-gtm-event-context":d.context,"data-gtm-event-type":d.event,disabled:O||V,onClick:j,children:o.text||z.formatMessage({id:"form_cancel"})}),c.jsxs(c.Fragment,{children:[y.createElement(e,{...m,id:r,className:K("form",n),ref:ae},c.jsxs(c.Fragment,{children:[S!=null&&S.general?c.jsx(pn,{variant:"error",text:z.formatMessage({id:"form_error_generalError"})}):null,u,(!F||!O&&!V||p)&&t.map((T,L)=>{const{id:I=T.name||L,component:W,functions:U={onChange:()=>{}},submitOnEnter:ne=!1}=T;if(W)return c.jsx(W,{...T.props||{}},`component-${I}-${L}`);const re=(H==null?void 0:H[I])||"",le={...U,onChange:X=>{E({type:"updateValue",payload:{key:I,value:X}}),U.onChange(X&&X.toString(),E)}};return ne&&(le.onKeyDown=X=>{X.key==="Enter"&&(X.stopPropagation(),X.preventDefault(),$()),U.onKeyDown&&U.onKeyDown(X)}),c.jsx(mg,{intlPath:i,...T,showRequiredLabels:_,value:re,error:S==null?void 0:S[I],functions:le},I)}),g?null:(O||V)&&p?p:c.jsx(or,{className:K("cta",{center:O||V,submitted:V}),buttons:B})]})),w&&V&&c.jsx(Mr,{className:"success",children:typeof w=="string"?w:z.formatMessage({id:"form_success"})})]})};const sa="passwordRules_",Rd="isMoreThanEightCharacters",Id="includesNumberAndSymbol",$d="includesLowerAndUppercase",gg={[Rd]:"8Characters",[Id]:"numberSymbol",[$d]:"lowercaseUppercase"},vg=({matchingRules:e={isMoreThanEightCharacters:!1,includesNumberAndSymbol:!1,includesLowerAndUppercase:!1},className:t=""})=>{const n=ie.useIntl();return c.jsxs("aside",{className:K("password-rules",t),children:[c.jsx("small",{children:n.formatMessage({id:`${sa}intro`})}),c.jsx("ul",{children:[Rd,Id,$d].map(r=>c.jsxs("li",{className:K({matches:e[r]}),children:[c.jsxs(Ie,{children:[n.formatMessage({id:`${sa}rule_label`})," "]}),c.jsx("span",{children:n.formatMessage({id:`${sa}rule_${gg[r]}`})}),!e[r]&&c.jsxs(Ie,{element:"strong",children:[" ",n.formatMessage({id:`${sa}notMet`})]})]},`rule-${r}`))})]})},Ld=y.memo(vg);const bg=({text:e={},topRating:t=5,functions:{createRating:n=()=>null,updateRating:r=()=>{},reportError:a=()=>{}},className:i="",hasLoaded:s=!1})=>{const o=ie.useIntl(),[l,u]=y.useState({setUp:!1,id:null,rating:null,disabled:!0}),d=async()=>{try{const v=await n();u(C=>({...C,setUp:!0,id:v&&v.id,disabled:!1}))}catch(v){u(C=>({...C,setUp:!0,disabled:!0})),a(v)}};if(y.useEffect(()=>{s&&!l.setUp&&d()},[s]),!s)return c.jsx(St,{className:"rating-placeholder"});const{id:h,rating:m,disabled:p}=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||p))try{u(C=>({...C,rating:v,disabled:!0})),await r({id:h,value:v})}catch(C){u(F=>({...F,rating:null})),a(C)}finally{u(C=>({...C,disabled:!1}))}};return c.jsxs("div",{className:K("rating",i),children:[c.jsx("span",{className:"label",children:f[m?"success":"text"]}),c.jsx("ol",{children:Array.from(new Array(t).keys()).map(v=>{const C=v+1;return c.jsx("li",{className:K({selected:m&&C<=m}),children:c.jsx(Fe,{variant:"tertiary",size:"small",icon:{icon:`star${!m||C>m?"_empty":""}`,position:"left",hover:"star"},screenreaderText:`${o.formatMessage({id:`${g}stars`},{number:C,total:t})}${C===1||C===t?` - ${f[C===1?"low":"high"]}`:""}`,onClick:F=>{F.preventDefault(),F.stopPropagation(),b(C)},disabled:p})},`rating-${C}`)})})]})};function yg(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 ks(e,t){return Array(t+1).join(e)}function xg(e){return e.replace(/^\n*/,"")}function Dg(e){for(var t=e.length;t>0&&e[t-1]===`
64
+ ${br(t,"mailto",n)}&src=email`)}`},{key:"clipboard-copy",icon:"share_copy-link",url:br(t,"copy",n),shouldRender:()=>navigator&&navigator.clipboard&&navigator.clipboard.writeText,onClick:(r,a)=>(r.preventDefault(),r.stopPropagation(),navigator.clipboard.writeText(a))}];const ag="shareLinks_",ig=({title:e,link:t,referrer:n,gtmContext:r="ShareLinks",size:a="large",variant:i="default",className:s=""})=>{const o=ie.useIntl(),l=rg({title:e,link:t,referrer:n});return c.jsxs("aside",{className:K("share-links",a,i,s),children:[c.jsx("p",{className:"text-small",children:o.formatMessage({id:"shareLinks_label"})}),c.jsx("ul",{children:l.map(({key:u,icon:d,url:h,shouldRender:m=!0,onClick:p})=>{if(typeof m=="function"&&!m())return null;const g={};return p&&(g.onClick=f=>p(f,h)),c.jsx("li",{children:c.jsx(Fe,{size:a,variant:"tertiary",icon:{icon:d||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:`${ag}link_${u}`}),...g})},u)})})]})};const sg=({tabs:e,className:t="",preventLocationChange:n})=>{var g;const r=(f,b,v)=>(f||(f=`panel-${window.btoa(b)}-${v}`),f),a=Pn(!0)||0;let i=e.findIndex(f=>f.current===!0);if(i<0&&(i=0),window.location.hash){const f=window.location.hash.replace("#","");if(e.find(v=>v.id===f)){for(let v=0;v<e.length;v++)if(r(e[v].id,e[v].text,v)===f){i=v;break}}}const[s,o]=y.useState((g=e[i])!=null&&g.id?e[i].id:r(e[i].id,e[i].text,i)),[l,u]=y.useState(""),d=(f,b)=>{switch(f.key){case"ArrowLeft":case"ArrowRight":{f.preventDefault();let v=b;f.key==="ArrowLeft"?b>0?v=b-1:v=e.length-1:f.key==="ArrowRight"&&(b<e.length-1?v=b+1:v=0);const C=r(e[v].id,e[v].text,v),F=document.getElementById(`tab-${C}`);F==null||F.focus(),u(C);break}case"Enter":o(l),window.location.hash=`#${l}`;break}},h=f=>{let b=!1;return f.target==="min-width"&&a>=f.value&&(b=!0),f.target==="max-width"&&a<=f.value&&(b=!0),b};y.useEffect(()=>{if(e[i].hasCarousel){const f=new CustomEvent("hiddenSectionVisible",{detail:{id:s}});window.dispatchEvent(f)}},[s]);const m=[],p=[];return e.forEach(({id:f,text:b,content:v,href:C,hasCarousel:F,breakpoint:_},w)=>{if(_&&!h(_))return;f=r(f,b,w);const k=s===f,j={};C||(j["aria-controls"]=f,j.onClick=q=>{q.preventDefault(),q.stopPropagation(),o(f),!n&&(window.location.hash=`#${f}`)},p.push(c.jsx("section",{id:f,hidden:!k,role:"tabpanel","aria-labelledby":`tab-${f}`,"aria-live":k?"assertive":"off",children:typeof v=="string"?c.jsx("p",{children:v}):v},`section-${f}`))),m.push(c.jsx("li",{"data-testid":"navigation-tab",children:c.jsx("a",{href:C||`#${f}`,id:`tab-${f}`,"aria-controls":f,className:K({selected:k}),role:"tab",tabIndex:k?0:-1,"aria-selected":k,onKeyDown:q=>d(q,w),...j,children:b})},`tab-${f}`))}),c.jsxs("div",{className:K("tabs-wrapper",t),children:[c.jsx("ul",{className:"tabs",role:"tablist",children:m}),c.jsx("div",{className:"tab-content",children:p})]})};const og={"2-1":901,"1-3":769,"1-1":769},Od=({layout:e="2-1",hideOnMobile:t=!1,hasCSSContainers:n=!1,className:r="",children:a})=>{const i=Pn(!0);let s=a;return y.Children.count(a)===1&&(s=y.Children.toArray(a)[0],s.props&&(s=s.props.children)),c.jsx("section",{className:K("columns",`layout-${e}`,r,{"has-containers":n}),children:y.Children.map(s,(o,l)=>t!==!1&&l===t&&i&&i<og[e]?null:o)})};const fo=({id:e="character-limit",limit:t,valueLength:n,...r})=>{const a=ie.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,d=n>t;return c.jsxs(c.Fragment,{children:[c.jsx("small",{id:e,className:K("character-limit",{"near-limit":l,"approaching-limit":u}),"aria-live":"polite","aria-label":d?"":a.formatMessage({id:`${i}_aria_${s<0?"over":"default"}`},{remaining:s,over:o,limit:t}),children:d?a.formatMessage({id:`${i}_aria_${s<0?"over":"default"}`},{remaining:s,over:o,limit:t}):c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"hidden",children:a.formatMessage({id:i})}),n," / ",t]})}),c.jsx(Ie,{showOnFocus:!1,id:`${e}-info`,children:a.formatMessage({id:`${i}_info`},{limit:t})})]})},ai=e=>(e==null?void 0:e.toString().length)||0,Pd=(e,t=null)=>{const n={};return e===0||(n["data-character-limit"]=e,t&&(n.functions={onChange:r=>{ai(r)>e&&(r=r==null?void 0:r.toString().slice(0,e)),t(r)}})),n};const ia="emailHelperTextBox_",Md=({id:e="email-helper-textbox",type:t,email:n,redirectPath:r,resendVerificationCode:a})=>{const i=ie.useIntl(),[s,o]=y.useState({path:`${ia}default`,type:"default",link:{},mail:{},error:""}),[l,u]=y.useState(!1),d=y.useCallback(g=>{g.preventDefault(),g.stopPropagation();const f=b=>{o({path:`${ia}error_verificationFailedToSend`,type:"error",link:{"data-gtm-event-context":"VerifyEmailBox","data-gtm-event-type":"SendEmailClick",className:"gtm-trackable",onClick:v=>d(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:`${ia}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=ia,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:C=>d(C),"data-testid":"send-verify-email-click"};break;case"exists":g+="emailAlreadyExists",f="error",b={href:"/api/next-ui/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=>c.jsx("a",{...s[g],children:f}):f=>f}),c.jsx(rd,{id:e,type:s.type,heading:l?!1:i.formatMessage({id:`${s.path}_title`}),"aria-live":"assertive",children:l?c.jsxs(c.Fragment,{children:[c.jsx(St,{element:"span"}),c.jsx(St,{element:"span"})]}):i.formatMessage({id:`${s.path}_text`},{...h,strong:g=>c.jsx("strong",{children:g}),em:g=>c.jsx("em",{children:g}),br:c.jsxs(c.Fragment,{children:[c.jsx("br",{}),c.jsx("br",{})]}),error:s.error})})},Hn=({className:e="",element:t="input",id:n,inputRef:r,functions:a={onChange:()=>{}},name:i=n,placeholder:s,type:o="text",value:l,autoFocus:u,...d})=>{const h=y.useRef(),m=r||h;return y.useEffect(()=>{var p;u&&((p=m.current)==null||p.focus())},[]),!(d!=null&&d.autoComplete)&&["email"].includes(o)&&(d.autoComplete="email"),y.createElement(t,{ref:m,...d,type:o,id:n,name:i,className:K(e,t,{"has-scrollbar":o==="textarea"&&m.current&&m.current.clientHeight<m.current.scrollHeight}),value:l,placeholder:s,autoFocus:u,...a,onChange:p=>{const g=p.target;a.onChange(g.value)}})};const $n={UP:"ArrowUp",DOWN:"ArrowDown",ENTER:"Enter"},ug=500,lg=({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:d},h]=y.useState({input:n,displayInput:n,debouncedInput:n}),[{predictions:m,activePredictionIndex:p,isPredictionSelected:g},f]=y.useState({predictions:[],activePredictionIndex:-1,isPredictionSelected:!!n}),{formatMessage:b}=ie.useIntl();r||(r=b({id:"inputAutocomplete_placeholder"})),y.useEffect(()=>{const _=setTimeout(()=>{g||h(w=>({...w,debouncedInput:l}))},ug);return()=>{clearTimeout(_)}},[l,g]),y.useEffect(()=>{d&&!g?(async()=>{try{const w=await o(d)||[];f(k=>({...k,predictions:w}))}catch(w){console.error("Error fetching predictions:",w),f(k=>({...k,predictions:[]}))}})():f(_=>({..._,predictions:[]}))},[d,g]),y.useEffect(()=>{p>=0&&m[p]&&h(_=>({..._,displayInput:m[p].description}))},[p,m]);const v=_=>{[$n.DOWN,$n.UP,$n.ENTER].includes(_.key)&&(_.preventDefault(),_.key===$n.DOWN&&p<m.length-1?f(w=>({...w,activePredictionIndex:p+1})):_.key===$n.UP&&p>0?f(w=>({...w,activePredictionIndex:p-1})):_.key===$n.ENTER&&p>-1&&(s(m[p].description),h(w=>({...w,input:m[p].description})),f(w=>({...w,predictions:[],isPredictionSelected:!0}))))},C=_=>{s(_.target.value),h(w=>({...w,input:_.target.value,displayInput:_.target.value})),f(w=>({...w,activePredictionIndex:-1,isPredictionSelected:!1}))},F=_=>{s(_.description),h(w=>({...w,input:_.description,displayInput:_.description})),f(w=>({...w,isPredictionSelected:!0,predictions:[]}))};return c.jsxs(c.Fragment,{children:[c.jsx("input",{type:"text",value:u,onChange:C,onKeyDown:v,placeholder:r,name:t,id:e,...i}),c.jsx("ul",{className:"predictions-list",children:m.map((_,w)=>c.jsx("li",{onClick:()=>F(_),onMouseEnter:()=>f(k=>({...k,activePredictionIndex:w})),className:K("predictions-list-item",{active:w===p}),children:_.description},w))})]})};const Nd=({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:d,...h})=>{const m=ie.useIntl(),{onChange:p,...g}=r,f=()=>{t||p(d?null:l)},b=c.jsxs(c.Fragment,{children:[c.jsx("input",{ref:i,id:a,name:a,type:u,value:l,checked:d,onKeyDown:v=>{(v.key==="Enter"||v.code==="Space")&&(v.preventDefault(),v.stopPropagation(),f())},readOnly:!0,disabled:t}),c.jsx("span",{className:"pretty-checkbox","data-testid":"pretty-checkbox"}),c.jsx("label",{htmlFor:a,children:o||m.formatMessage({id:s?`${s}_${a}`:a})})]});return y.createElement(n,{onClick:v=>{const C=v.target;C.nodeName.toLowerCase()==="a"||C.parentNode&&C.parentNode.nodeName.toLowerCase()==="a"||(v.preventDefault(),v.stopPropagation(),f())},className:K("checkbox-wrapper",e),...h,...g},b)};const cg=y.memo(function({direction:t="down"}){return c.jsx(Ja,{className:K("rotating-chevron",`direction-${t}`)})});const dg=({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 d=ie.useIntl(),[h,m]=y.useState(!1),p=r||n,g=Array.isArray(p)?[...p]:p?[p]:[],[f,b]=y.useState(g);let v;Array.isArray(f)&&f.length===1&&typeof f[0]=="string"?v=t&&f?t.find(j=>j.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:C,onMultiSelectSubmit:F,..._}=a,w=j=>{if(o){let q=[];f!=null&&f.includes(j.id)?q=f.filter(P=>P!==j.id):q=[...f,j.id],b([...q]),C&&C([...q])}else b([j]),C&&C(j.id),m(!1)},k=j=>{if(j==="all"){const q=(t==null?void 0:t.map(P=>P.id))||[];b(q),C&&C(q)}else b([]),C&&C([])};return c.jsxs("div",{className:K("dropdown-wrapper",e),children:[c.jsxs("button",{className:"input","aria-expanded":h,"aria-haspopup":"listbox","aria-controls":"dropdown-list",onClick:j=>{j.preventDefault(),j.stopPropagation(),m(!h)},"data-testid":"dropdown-selector",..._,children:[o?`${s} · ${f.length}`:v.label,c.jsx(cg,{direction:h?"up":"down"})]}),c.jsx("select",{defaultValue:v.id,onChange:j=>{j.preventDefault(),j.stopPropagation();const q=t&&t.find(P=>P.id===j.target.value);w(q)},hidden:!h,..._,children:t==null?void 0:t.map(j=>c.jsx("option",{value:j.id,className:"gtm-trackable","data-gtm-event-type":`${j.id}-click`,"data-gtm-event-context":i,children:j.label},j.id))}),c.jsxs("div",{className:"menu-options input dropdown-menu",role:"menu",hidden:!h,children:[c.jsxs("div",{className:"dropdown-menu-list",children:[(l==null?void 0:l.topbar)&&c.jsxs("div",{className:"action-bar",children:[c.jsx("p",{children:`${f==null?void 0:f.length} selected`}),c.jsxs("ul",{children:[c.jsx("li",{children:c.jsx(Fe,{variant:"tertiary",size:"small",onClick:()=>k("all"),className:"gtm-trackable","data-gtm-event-type":"all-click","data-gtm-event-context":i,children:d.formatMessage({id:"dropdown_menu_multiselect_all"})})}),c.jsx("li",{children:c.jsx(Fe,{variant:"tertiary",size:"small",onClick:()=>k("none"),className:"gtm-trackable","data-gtm-event-type":"none-click","data-gtm-event-context":i,children:d.formatMessage({id:"dropdown_menu_multiselect_none"})})})]})]}),c.jsx("ul",{children:t==null?void 0:t.map(j=>{const q=j.id===v.id||(f==null?void 0:f.includes(j))||(f==null?void 0:f.includes(j.id));return c.jsx("li",{"data-testid":"dropdown-options",children:c.jsxs("button",{className:K("gtm-trackable",{selected:q,"selected-single":q&&!o}),"data-gtm-event-type":`${j.id}-click`,"data-gtm-event-context":i,onClick:P=>{P.preventDefault(),P.stopPropagation(),w(j)},role:"menuitem","aria-current":q,"data-testid":q?"current-selection":"",children:[o&&c.jsx("span",{className:"pretty-checkbox","data-testid":"pretty-checkbox"}),c.jsx("span",{className:K({"menu-option-label":o}),children:j.label})]})},j.id)})})]}),(l==null?void 0:l.submitSection)&&c.jsx("p",{className:"submit",children:c.jsx(Fe,{variant:"secondary",onClick:()=>{F&&F(f),document.dispatchEvent(new CustomEvent("dropdownMultiSelectSubmit",{detail:{id:u||"dropdown-multi-select",value:f}})),m(!1)},children:d.formatMessage({id:"form_submit"})})})]})]})};const fg=({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:d,...h})=>{const m=ie.useIntl(),p=i?d:[],g=d;return c.jsx("ul",{...h,className:K("options-wrapper",e),"data-testid":`ul-${r}`,children:o==null?void 0:o.map(({id:f,label:b=!1,value:v=f,disabled:C=!1})=>{const F=`${r}_${f}`,_=()=>{if(C)return;let w;if(i){const k=p==null?void 0:p.indexOf(v);Array.isArray(p)&&k>=0?(w=p,w.splice(k,1)):(!p||p.length===0?w=[]:w=p,w.push(v))}else w=g===v?void 0:v;t.onChange(w)};return c.jsx(Nd,{element:"li",id:F,type:u==="checkboxes"?"checkbox":"radio",shownValue:v,value:i?p==null?void 0:p.includes(v):g===v,functions:{...t,onChange:_},intlPath:n,label:b||m.formatMessage({id:n?`${n}_${f}`:f}),disabled:C},F)})})};const hg=({inputRef:e,type:t="password",gtm:{context:n}={context:void 0},autoComplete:r="on",...a})=>{const i=ie.useIntl(),s=y.useRef(),o=e||s,[l,u]=y.useState(!1),[d,h]=y.useState(t),m=()=>{var p;u(!l),h(l?"password":"text"),(p=o.current)==null||p.focus()};return c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",className:K("show-password gtm-trackable",{"password-visible":l}),"data-gtm-event-context":n,"data-gtm-event-type":`${l?"hide":"show"}-password-click`,onClick:m,"aria-label":i.formatMessage({id:`showpassword_aria_${l?"hide":"show"}`}),children:i.formatMessage({id:`showpassword_${l?"hide":"show"}`})}),c.jsx(Hn,{inputRef:o,type:d,autoComplete:r,...a})]})};const Ln={text:{component:Hn},email:{component:Hn},url:{component:Hn},textarea:{component:Hn,props:{element:"textarea",rows:4,cols:10}},checkbox:{component:Nd},checkboxes:{component:fg,props:{multiSelect:!0}},select:{component:dg},password:{component:hg},autocomplete:{component:lg}},mg=({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:d,...h})=>{const m=ie.useIntl(),p=l&&l.some(({condition:R})=>R==="required"),g=ai(u),f=o&&Ln[o]&&Ln[o].component?Ln[o].component:Hn,b=o&&["checkboxes"].includes(o),v=o&&["autocomplete"].includes(o),C=r&&`error-${e}`,F=`character-limit-${e}`,_={};b?_.element="legend":_.htmlFor=e;let w={...h,id:e,name:e,className:r?"error":"",type:o,required:p,"aria-required":p,functions:En(a),value:u};const k=R=>{w["aria-describedby"]?w["aria-describedby"]+=` ${R}`:w["aria-describedby"]=R};if(i>0){const R=Pd(i,a.onChange);k(`${F}-info`),w={...w,...R},R.functions&&typeof R.functions=="object"&&(w.functions={...w.functions,...R.functions})}o&&Ln[o]&&Ln[o].props&&(w={...w,...Ln[o].props}),b&&(w.intlPath=`${t}_${e}`),r&&(w["aria-invalid"]=!0,w["aria-errormessage"]=C,k(C));const j=h.label||m.formatMessage({id:t?`${t}_${e}`:e}),q=({...R})=>r?y.createElement(R.as||"p",{id:C,className:"error text-small",...R},r):null;if(o&&["checkbox"].includes(o))return c.jsxs(c.Fragment,{children:[c.jsx(f,{...w,label:j,className:K("field-wrapper",n)}),c.jsx(q,{as:"p"})]});const P={};b||(P.className="field-label");const z=R=>y.createElement(R.element||"label",{...R,className:"checkboxes-label text-small","data-testid":`label-${e}`});return c.jsx(c.Fragment,{children:y.createElement(b?"fieldset":"div",{className:K("field-wrapper text-medium",n)},c.jsxs(c.Fragment,{children:[y.createElement(b?y.Fragment:"p",P,c.jsxs(z,{..._,children:[j,p&&s&&c.jsxs(c.Fragment,{children:[" ",c.jsxs("small",{children:["(",m.formatMessage({id:"form_fieldWrapper_required"}),")"]})]})]})),y.createElement(b||v?"div":"p",{className:"field-component"},c.jsxs(c.Fragment,{children:[c.jsx(f,{...w}),c.jsx(fo,{id:F,limit:i,valueLength:g})]})),c.jsx(q,{})]}))})},pg=(e,t)=>{const{type:n,payload:r}=t,a=e.errors?En(e.errors):{},i=e.values?En(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:d}=r,h=En(Object.keys(a));for(const m of s)if(m.validation)for(let p=0;p<m.validation.length;p++){const{condition:g="required",error:f=!1}=m.validation[p];let b=!1;if(typeof g=="function"){const v=g(i);v&&(b=f||v)}else{const v=i[m.id];switch(g){case"required":(!v||typeof v=="string"&&v.trim().length===0)&&(b=f||(d==null?void 0:d.formatMessage({id:"form_error_required"})));break;case"no-numbers":{v&&!/^([^0-9]*)$/.test(v)&&(b=f||(d==null?void 0:d.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||(d==null?void 0:d.formatMessage({id:"form_error_email"})));break}case"valid-url":{v&&!/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-._~:/?#[\]@!$&'()*+,;=%]+$/i.test(v)&&(b=f||(d==null?void 0:d.formatMessage({id:"form_error_url"})));break}default:console.warn("WARNING! No field validation condition has been set")}}if(b){o({type:"addError",payload:{key:m.id,value:b}}),h.push(m.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 Ai=null;const nn=({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:d={context:"Form",event:"form-submit-click"},functions:h,...m})=>{const{customOnSubmit:p,hideButton:g,...f}=s,b=40,{shouldShowCancelButton:v=!1,shouldReset:C=!0,shouldHide:F=!0,showRequiredLabels:_=!0,showSuccessMessage:w=!1}=l||{},{onSuccess:k=async()=>{},onCancel:j=()=>{},onCatch:q=()=>{},onFailure:P=()=>{}}=h||{},z=ie.useIntl(),R={};t.length&&t.forEach(T=>{const L=T.id||T.name;L&&(R[L]=T.value||"")});const[A,E]=y.useReducer(pg,{isSubmitting:!1,formSubmitted:!1,errors:{},values:R}),{errors:S,isSubmitting:O,formSubmitted:V,values:H}=A;y.useEffect(()=>{C&&V&&(Ai=setTimeout(()=>{E({type:"updateValue",payload:{key:"formSubmitted",value:!1}})},3e3))},[V]),y.useEffect(()=>()=>{Ai&&clearTimeout(Ai)},[]),y.useEffect(()=>{const T=L=>{E({type:"updateValue",payload:{key:L.detail.id,value:L.detail.value}})};return document.addEventListener("dropdownMultiSelectSubmit",T),()=>{document.removeEventListener("dropdownMultiSelectSubmit",T)}},[]);const Q=y.useRef(null),ae=a||Q;if(!t.length)return null;const D={};s.children&&(D.default=s.children),f.text&&typeof f.text=="string"&&(D.default=f.text),["default","submitting","submitted"].forEach(T=>{f.text&&typeof f.text!="string"&&T in f.text?D[T]=f.text[T]:D[T]||(D[T]=z.formatMessage({id:`form_${T==="default"?"submit":T}`}))}),delete f.text;const $=()=>{if(!O){if(E({type:"updateValue",payload:{key:"isSubmitting",value:!0}}),s.disabled){typeof s.disabled=="object"&&s.disabled.isClickable&&E({type:"submitForm",payload:{fields:t,dispatch:E,intl:z}});return}E({type:"submitForm",payload:{fields:t,dispatch:E,onSuccess:async T=>{try{await k(T),E({type:C?"formSubmittedAndReset":"formSubmitted"})}catch(L){q(L),E({type:"updateValue",payload:{key:"isSubmitting",value:!1}})}},onFailure:(T,L)=>{P(T,L),E({type:"updateValue",payload:{key:"isSubmitting",value:!1}})},intl:z}})}},X=T=>{var W;if(T.preventDefault(),T.stopPropagation(),O)return;let L=0;if((W=ae==null?void 0:ae.current)!=null&&W.id){const U=document.getElementById(ae.current.id);U&&(L=U.getBoundingClientRect().top+window.scrollY)}const I=document.getElementById("header");I&&(L=L-I.offsetHeight-b),L<0&&(L=0),window.scrollTo({top:L,behavior:"smooth"}),$()},B=[{...f,icon:V?{icon:"tick",position:"left"}:!1,className:K("gtm-trackable",f.className),onClick:X,disabled:O||V||s.disabled,"data-gtm-event-context":d.context,"data-gtm-event-type":d.event,children:D[O?"submitting":V?"submitted":"default"]}];return v&&B.unshift({...o,className:K("gtm-trackable",o.className),"data-gtm-event-context":d.context,"data-gtm-event-type":d.event,disabled:O||V,onClick:j,children:o.text||z.formatMessage({id:"form_cancel"})}),c.jsxs(c.Fragment,{children:[y.createElement(e,{...m,id:r,className:K("form",n),ref:ae},c.jsxs(c.Fragment,{children:[S!=null&&S.general?c.jsx(pn,{variant:"error",text:z.formatMessage({id:"form_error_generalError"})}):null,u,(!F||!O&&!V||p)&&t.map((T,L)=>{const{id:I=T.name||L,component:W,functions:U={onChange:()=>{}},submitOnEnter:ne=!1}=T;if(W)return c.jsx(W,{...T.props||{}},`component-${I}-${L}`);const re=(H==null?void 0:H[I])||"",le={...U,onChange:ee=>{E({type:"updateValue",payload:{key:I,value:ee}}),U.onChange(ee&&ee.toString(),E)}};return ne&&(le.onKeyDown=ee=>{ee.key==="Enter"&&(ee.stopPropagation(),ee.preventDefault(),$()),U.onKeyDown&&U.onKeyDown(ee)}),c.jsx(mg,{intlPath:i,...T,showRequiredLabels:_,value:re,error:S==null?void 0:S[I],functions:le},I)}),g?null:(O||V)&&p?p:c.jsx(or,{className:K("cta",{center:O||V,submitted:V}),buttons:B})]})),w&&V&&c.jsx(Mr,{className:"success",children:typeof w=="string"?w:z.formatMessage({id:"form_success"})})]})};const sa="passwordRules_",Rd="isMoreThanEightCharacters",Id="includesNumberAndSymbol",$d="includesLowerAndUppercase",gg={[Rd]:"8Characters",[Id]:"numberSymbol",[$d]:"lowercaseUppercase"},vg=({matchingRules:e={isMoreThanEightCharacters:!1,includesNumberAndSymbol:!1,includesLowerAndUppercase:!1},className:t=""})=>{const n=ie.useIntl();return c.jsxs("aside",{className:K("password-rules",t),children:[c.jsx("small",{children:n.formatMessage({id:`${sa}intro`})}),c.jsx("ul",{children:[Rd,Id,$d].map(r=>c.jsxs("li",{className:K({matches:e[r]}),children:[c.jsxs(Ie,{children:[n.formatMessage({id:`${sa}rule_label`})," "]}),c.jsx("span",{children:n.formatMessage({id:`${sa}rule_${gg[r]}`})}),!e[r]&&c.jsxs(Ie,{element:"strong",children:[" ",n.formatMessage({id:`${sa}notMet`})]})]},`rule-${r}`))})]})},Ld=y.memo(vg);const bg=({text:e={},topRating:t=5,functions:{createRating:n=()=>null,updateRating:r=()=>{},reportError:a=()=>{}},className:i="",hasLoaded:s=!1})=>{const o=ie.useIntl(),[l,u]=y.useState({setUp:!1,id:null,rating:null,disabled:!0}),d=async()=>{try{const v=await n();u(C=>({...C,setUp:!0,id:v&&v.id,disabled:!1}))}catch(v){u(C=>({...C,setUp:!0,disabled:!0})),a(v)}};if(y.useEffect(()=>{s&&!l.setUp&&d()},[s]),!s)return c.jsx(St,{className:"rating-placeholder"});const{id:h,rating:m,disabled:p}=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||p))try{u(C=>({...C,rating:v,disabled:!0})),await r({id:h,value:v})}catch(C){u(F=>({...F,rating:null})),a(C)}finally{u(C=>({...C,disabled:!1}))}};return c.jsxs("div",{className:K("rating",i),children:[c.jsx("span",{className:"label",children:f[m?"success":"text"]}),c.jsx("ol",{children:Array.from(new Array(t).keys()).map(v=>{const C=v+1;return c.jsx("li",{className:K({selected:m&&C<=m}),children:c.jsx(Fe,{variant:"tertiary",size:"small",icon:{icon:`star${!m||C>m?"_empty":""}`,position:"left",hover:"star"},screenreaderText:`${o.formatMessage({id:`${g}stars`},{number:C,total:t})}${C===1||C===t?` - ${f[C===1?"low":"high"]}`:""}`,onClick:F=>{F.preventDefault(),F.stopPropagation(),b(C)},disabled:p})},`rating-${C}`)})})]})};function yg(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 ks(e,t){return Array(t+1).join(e)}function xg(e){return e.replace(/^\n*/,"")}function Dg(e){for(var t=e.length;t>0&&e[t-1]===`
65
65
  `;)t--;return e.substring(0,t)}var Cg=["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 ho(e){return mo(e,Cg)}var zd=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];function qd(e){return mo(e,zd)}function wg(e){return Ud(e,zd)}var Wd=["A","TABLE","THEAD","TBODY","TFOOT","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"];function Eg(e){return mo(e,Wd)}function _g(e){return Ud(e,Wd)}function mo(e,t){return t.indexOf(e.nodeName)>=0}function Ud(e,t){return e.getElementsByTagName&&t.some(function(n){return e.getElementsByTagName(n).length})}var ot={};ot.paragraph={filter:"p",replacement:function(e){return`
66
66
 
67
67
  `+e+`
@@ -126,19 +126,19 @@ ${br(t,"mailto",n)}&src=email`)}`},{key:"clipboard-copy",icon:"share_copy-link",
126
126
  *
127
127
  * Copyright (c) 2014-2017, Jon Schlinkert.
128
128
  * Released under the MIT License.
129
- */function Su(e){return Object.prototype.toString.call(e)==="[object Object]"}function rt(e){var t,n;return Su(e)===!1?!1:(t=e.constructor,t===void 0?!0:(n=t.prototype,!(Su(n)===!1||n.hasOwnProperty("isPrototypeOf")===!1)))}var Zd=Symbol.for("immer-nothing"),ju=Symbol.for("immer-draftable"),Ct=Symbol.for("immer-state"),Ug=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 gt(e,...t){if(process.env.NODE_ENV!=="production"){const n=Ug[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 nr=Object.getPrototypeOf;function Tn(e){return!!e&&!!e[Ct]}function Sn(e){var t;return e?Yd(e)||Array.isArray(e)||!!e[ju]||!!((t=e.constructor)!=null&&t[ju])||si(e)||oi(e):!1}var Hg=Object.prototype.constructor.toString();function Yd(e){if(!e||typeof e!="object")return!1;const t=nr(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)===Hg}function Ia(e,t){ii(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function ii(e){const t=e[Ct];return t?t.type_:Array.isArray(e)?1:si(e)?2:oi(e)?3:0}function Fs(e,t){return ii(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Gd(e,t,n){const r=ii(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function Vg(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function si(e){return e instanceof Map}function oi(e){return e instanceof Set}function Dn(e){return e.copy_||e.base_}function Bs(e,t){if(si(e))return new Map(e);if(oi(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=Yd(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[Ct];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(nr(e),r)}else{const r=nr(e);if(r!==null&&n)return{...e};const a=Object.create(r);return Object.assign(a,e)}}function go(e,t=!1){return ui(e)||Tn(e)||!Sn(e)||(ii(e)>1&&(e.set=e.add=e.clear=e.delete=Kg),Object.freeze(e),t&&Object.entries(e).forEach(([n,r])=>go(r,!0))),e}function Kg(){gt(2)}function ui(e){return Object.isFrozen(e)}var Zg={};function jn(e){const t=Zg[e];return t||gt(0,e),t}var Rr;function Qd(){return Rr}function Yg(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Ou(e,t){t&&(jn("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function As(e){Ts(e),e.drafts_.forEach(Gg),e.drafts_=null}function Ts(e){e===Rr&&(Rr=e.parent_)}function Pu(e){return Rr=Yg(Rr,e)}function Gg(e){const t=e[Ct];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Mu(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Ct].modified_&&(As(t),gt(4)),Sn(e)&&(e=$a(t,e),t.parent_||La(t,e)),t.patches_&&jn("Patches").generateReplacementPatches_(n[Ct].base_,e,t.patches_,t.inversePatches_)):e=$a(t,n,[]),As(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Zd?e:void 0}function $a(e,t,n){if(ui(t))return t;const r=t[Ct];if(!r)return Ia(t,(a,i)=>Nu(e,r,t,a,i,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return La(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),Ia(i,(o,l)=>Nu(e,r,a,o,l,n,s)),La(e,a,!1),n&&e.patches_&&jn("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function Nu(e,t,n,r,a,i,s){if(process.env.NODE_ENV!=="production"&&a===n&&gt(5),Tn(a)){const o=i&&t&&t.type_!==3&&!Fs(t.assigned_,r)?i.concat(r):void 0,l=$a(e,a,o);if(Gd(n,r,l),Tn(l))e.canAutoFreeze_=!1;else return}else s&&n.add(a);if(Sn(a)&&!ui(a)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;$a(e,a),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,r)&&La(e,a)}}function La(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&go(t,n)}function Qg(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=vo;n&&(a=[r],i=Ir);const{revoke:s,proxy:o}=Proxy.revocable(a,i);return r.draft_=o,r.revoke_=s,o}var vo={get(e,t){if(t===Ct)return e;const n=Dn(e);if(!Fs(n,t))return Jg(e,n,t);const r=n[t];return e.finalized_||!Sn(r)?r:r===Oi(e.base_,t)?(Pi(e),e.copy_[t]=js(r,e)):r},has(e,t){return t in Dn(e)},ownKeys(e){return Reflect.ownKeys(Dn(e))},set(e,t,n){const r=Jd(Dn(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const a=Oi(Dn(e),t),i=a==null?void 0:a[Ct];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(Vg(n,a)&&(n!==void 0||Fs(e.base_,t)))return!0;Pi(e),Ss(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 Oi(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Pi(e),Ss(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Dn(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){gt(11)},getPrototypeOf(e){return nr(e.base_)},setPrototypeOf(){gt(12)}},Ir={};Ia(vo,(e,t)=>{Ir[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Ir.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&gt(13),Ir.set.call(this,e,t,void 0)};Ir.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&gt(14),vo.set.call(this,e[0],t,n,e[0])};function Oi(e,t){const n=e[Ct];return(n?Dn(n):e)[t]}function Jg(e,t,n){var a;const r=Jd(t,n);return r?"value"in r?r.value:(a=r.get)==null?void 0:a.call(e.draft_):void 0}function Jd(e,t){if(!(t in e))return;let n=nr(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=nr(n)}}function Ss(e){e.modified_||(e.modified_=!0,e.parent_&&Ss(e.parent_))}function Pi(e){e.copy_||(e.copy_=Bs(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Xg=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,d=>n.call(this,d,...u))}}typeof n!="function"&&gt(6),r!==void 0&&typeof r!="function"&&gt(7);let a;if(Sn(t)){const i=Pu(this),s=js(t,void 0);let o=!0;try{a=n(s),o=!1}finally{o?As(i):Ts(i)}return Ou(i,r),Mu(a,i)}else if(!t||typeof t!="object"){if(a=n(t),a===void 0&&(a=t),a===Zd&&(a=void 0),this.autoFreeze_&&go(a,!0),r){const i=[],s=[];jn("Patches").generateReplacementPatches_(t,a,i,s),r(i,s)}return a}else gt(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){Sn(e)||gt(8),Tn(e)&&(e=ev(e));const t=Pu(this),n=js(e,void 0);return n[Ct].isManual_=!0,Ts(t),n}finishDraft(e,t){const n=e&&e[Ct];(!n||!n.isManual_)&&gt(9);const{scope_:r}=n;return Ou(r,t),Mu(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=jn("Patches").applyPatches_;return Tn(e)?r(e,t):this.produce(e,a=>r(a,t))}};function js(e,t){const n=si(e)?jn("MapSet").proxyMap_(e,t):oi(e)?jn("MapSet").proxySet_(e,t):Qg(e,t);return(t?t.scope_:Qd()).drafts_.push(n),n}function ev(e){return Tn(e)||gt(10,e),Xd(e)}function Xd(e){if(!Sn(e)||ui(e))return e;const t=e[Ct];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Bs(e,t.scope_.immer_.useStrictShallowCopy_)}else n=Bs(e,!0);return Ia(n,(r,a)=>{Gd(n,r,Xd(a))}),t&&(t.finalized_=!1),n}var wt=new Xg,bo=wt.produce;wt.produceWithPatches.bind(wt);wt.setAutoFreeze.bind(wt);wt.setUseStrictShallowCopy.bind(wt);wt.applyPatches.bind(wt);var Ru=wt.createDraft.bind(wt),Iu=wt.finishDraft.bind(wt),tv={transform(e,t){var{current:n,affinity:r}=e;if(n!=null){var a=N.transform(n,t,{affinity:r});e.current=a,a==null&&e.unref()}}},nv={transform(e,t){var{current:n,affinity:r}=e;if(n!=null){var a=ke.transform(n,t,{affinity:r});e.current=a,a==null&&e.unref()}}},rv={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()}}},za=new WeakMap,qa=new WeakMap,kr=new WeakMap,ef=new WeakMap,$u=new WeakMap,Lu=new WeakMap,zu=new WeakMap,N={ancestors(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{reverse:n=!1}=t,r=N.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 N.equals(r,a)&&i>s},endsAt(e,t){var n=e.length,r=e.slice(0,n),a=t.slice(0,n);return N.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 N.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 N.compare(e,t)===1},isAncestor(e,t){return e.length<t.length&&N.compare(e,t)===0},isBefore(e,t){return N.compare(e,t)===-1},isChild(e,t){return e.length===t.length+1&&N.compare(e,t)===0},isCommon(e,t){return e.length<=t.length&&N.compare(e,t)===0},isDescendant(e,t){return e.length>t.length&&N.compare(e,t)===0},isParent(e,t){return e.length+1===t.length&&N.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&&N.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(!N.isAncestor(t,e)&&!N.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;(N.equals(i,r)||N.endsBefore(i,r)||N.isAncestor(i,r))&&(r[i.length-1]+=1);break}case"remove_node":{var{path:s}=t;if(N.equals(s,r)||N.isAncestor(s,r))return null;N.endsBefore(s,r)&&(r[s.length-1]-=1);break}case"merge_node":{var{path:o,position:l}=t;N.equals(o,r)||N.endsBefore(o,r)?r[o.length-1]-=1:N.isAncestor(o,r)&&(r[o.length-1]-=1,r[o.length]+=l);break}case"split_node":{var{path:u,position:d}=t;if(N.equals(u,r)){if(a==="forward")r[r.length-1]+=1;else if(a!=="backward")return null}else N.endsBefore(u,r)?r[u.length-1]+=1:N.isAncestor(u,r)&&e[u.length]>=d&&(r[u.length-1]+=1,r[u.length]-=d);break}case"move_node":{var{path:h,newPath:m}=t;if(N.equals(h,m))return r;if(N.isAncestor(h,r)||N.equals(h,r)){var p=m.slice();return N.endsBefore(h,m)&&h.length<m.length&&(p[h.length-1]-=1),p.concat(r.slice(h.length))}else N.isSibling(h,m)&&(N.isAncestor(m,r)||N.equals(m,r))?N.endsBefore(h,r)?r[h.length-1]-=1:r[h.length-1]+=1:N.endsBefore(m,r)||N.equals(m,r)||N.isAncestor(m,r)?(N.endsBefore(h,r)&&(r[h.length-1]-=1),r[m.length-1]+=1):N.endsBefore(h,r)&&(N.equals(m,r)&&(r[m.length-1]+=1),r[h.length-1]-=1);break}}return r}};function $r(e){"@babel/helpers - typeof";return $r=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},$r(e)}function av(e,t){if($r(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if($r(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function iv(e){var t=av(e,"string");return $r(t)==="symbol"?t:String(t)}function ft(e,t,n){return t=iv(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}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 yr(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){ft(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 sv=(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]=ke.transform(o,n);break}case"insert_text":{var{path:u,offset:d,text:h}=n;if(h.length===0)break;var m=ue.leaf(e,u),p=m.text.slice(0,d),g=m.text.slice(d);if(m.text=p+h+g,t)for(var[f,b]of Z.points(t))t[b]=ke.transform(f,n);break}case"merge_node":{var{path:v}=n,C=ue.get(e,v),F=N.previous(v),_=ue.get(e,F),w=ue.parent(e,v),k=v[v.length-1];if(fe.isText(C)&&fe.isText(_))_.text+=C.text;else if(!fe.isText(C)&&!fe.isText(_))_.children.push(...C.children);else throw new Error('Cannot apply a "merge_node" operation at path ['.concat(v,"] to nodes of different interfaces: ").concat(nt.stringify(C)," ").concat(nt.stringify(_)));if(w.children.splice(k,1),t)for(var[j,q]of Z.points(t))t[q]=ke.transform(j,n);break}case"move_node":{var{path:P,newPath:z}=n;if(N.isAncestor(P,z))throw new Error("Cannot move a path [".concat(P,"] to new path [").concat(z,"] because the destination is inside itself."));var R=ue.get(e,P),A=ue.parent(e,P),E=P[P.length-1];A.children.splice(E,1);var S=N.transform(P,n),O=ue.get(e,N.parent(S)),V=S[S.length-1];if(O.children.splice(V,0,R),t)for(var[H,Q]of Z.points(t))t[Q]=ke.transform(H,n);break}case"remove_node":{var{path:ae}=n,D=ae[ae.length-1],$=ue.parent(e,ae);if($.children.splice(D,1),t)for(var[ee,B]of Z.points(t)){var T=ke.transform(ee,n);if(t!=null&&T!=null)t[B]=T;else{var L=void 0,I=void 0;for(var[W,U]of ue.texts(e))if(N.compare(U,ae)===-1)L=[W,U];else{I=[W,U];break}var ne=!1;L&&I&&(N.equals(I[1],ae)?ne=!N.hasPrevious(I[1]):ne=N.common(L[1],ae).length<N.common(I[1],ae).length),L&&!ne?(ee.path=L[1],ee.offset=L[0].text.length):I?(ee.path=I[1],ee.offset=0):t=null}}break}case"remove_text":{var{path:re,offset:le,text:X}=n;if(X.length===0)break;var pe=ue.leaf(e,re),me=pe.text.slice(0,le),_e=pe.text.slice(le+X.length);if(pe.text=me+_e,t)for(var[Be,Se]of Z.points(t))t[Se]=ke.transform(Be,n);break}case"set_node":{var{path:Ye,properties:Ke,newProperties:je}=n;if(Ye.length===0)throw new Error("Cannot set properties on the root node!");var Oe=ue.get(e,Ye);for(var De in je){if(De==="children"||De==="text")throw new Error('Cannot set the "'.concat(De,'" property of nodes!'));var Le=je[De];Le==null?delete Oe[De]:Oe[De]=Le}for(var Ue in Ke)je.hasOwnProperty(Ue)||delete Oe[Ue];break}case"set_selection":{var{newProperties:G}=n;if(G==null)t=G;else{if(t==null){if(!Z.isRange(G))throw new Error('Cannot apply an incomplete "set_selection" operation properties '.concat(nt.stringify(G)," when there is no current selection."));t=yr({},G)}for(var oe in G){var he=G[oe];if(he==null){if(oe==="anchor"||oe==="focus")throw new Error('Cannot remove the "'.concat(oe,'" selection property'));delete t[oe]}else t[oe]=he}}break}case"split_node":{var{path:ge,position:Ee,properties:be}=n;if(ge.length===0)throw new Error('Cannot apply a "split_node" operation at path ['.concat(ge,"] because the root node cannot be split."));var we=ue.get(e,ge),et=ue.parent(e,ge),Et=ge[ge.length-1],ht;if(fe.isText(we)){var Qe=we.text.slice(0,Ee),yt=we.text.slice(Ee);we.text=Qe,ht=yr(yr({},be),{},{text:yt})}else{var xt=we.children.slice(0,Ee),pi=we.children.slice(Ee);we.children=xt,ht=yr(yr({},be),{},{children:pi})}if(et.children.splice(Et+1,0,ht),t)for(var[fr,Gr]of Z.points(t))t[Gr]=ke.transform(fr,n);break}}return t},ov={transform(e,t){e.children=Ru(e.children);var n=e.selection&&Ru(e.selection);try{n=sv(e,n,t)}finally{e.children=Iu(e.children),n?e.selection=Tn(n)?Iu(n):n:e.selection=null}}},uv={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)}},lv={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)}},tf=(e,t)=>{for(var n in e){var r=e[n],a=t[n];if(rt(r)&&rt(a)){if(!tf(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 cv(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 Xt(e,t){if(e==null)return{};var n=cv(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 dv=["anchor","focus"];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 fv(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){ft(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 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 ke.equals(e.anchor,t.anchor)&&ke.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 ke.isBefore(n,a)&&ke.isAfter(r,i)}var[s,o]=Z.edges(e),l=!1,u=!1;return ke.isPoint(t)?(l=ke.compare(t,s)>=0,u=ke.compare(t,o)<=0):(l=N.compare(t,s.path)>=0,u=N.compare(t,o.path)<=0),l&&u},intersection(e,t){var n=Xt(e,dv),[r,a]=Z.edges(e),[i,s]=Z.edges(t),o=ke.isBefore(r,i)?i:r,l=ke.isBefore(a,s)?a:s;return ke.isBefore(l,o)?null:fv({anchor:o,focus:l},n)},isBackward(e){var{anchor:t,focus:n}=e;return ke.isAfter(t,n)},isCollapsed(e){var{anchor:t,focus:n}=e;return ke.equals(t,n)},isExpanded(e){return!Z.isCollapsed(e)},isForward(e){return!Z.isBackward(e)},isRange(e){return rt(e)&&ke.isPoint(e.anchor)&&ke.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 bo(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=ke.transform(r.anchor,t,{affinity:i}),u=ke.transform(r.focus,t,{affinity:s});if(!l||!u)return null;r.anchor=l,r.focus=u})}},Uu=e=>rt(e)&&ue.isNodeList(e.children)&&!x.isEditor(e),de={isAncestor(e){return rt(e)&&ue.isNodeList(e.children)},isElement:Uu,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 Uu(t)&&t[r]===n},matches(e,t){for(var n in t)if(n!=="children"&&e[n]!==t[n])return!1;return!0}},hv=["children"],mv=["text"],Hu=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(nt.stringify(n)));return n},ancestors(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return function*(){for(var r of N.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(nt.stringify(e)));var n=e.children[t];if(n==null)throw new Error("Cannot get child at index `".concat(t,"` in node: ").concat(nt.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=N.common(t,n),a=ue.get(e,r);return[a,r]},descendant(e,t){var n=ue.get(e,t);if(x.isEditor(n))throw new Error("Cannot get the descendant node at path [".concat(t,"] because it refers to the root editor node instead: ").concat(nt.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=Xt(e,hv);return t}else{var t=Xt(e,mv);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(nt.stringify(e)));var n=bo({children:e.children},r=>{var[a,i]=Z.edges(t),s=ue.nodes(r,{reverse:!0,pass:m=>{var[,p]=m;return!Z.includes(t,p)}});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(N.equals(o,i.path)){var d=ue.leaf(r,o);d.text=d.text.slice(0,i.offset)}if(N.equals(o,a.path)){var h=ue.leaf(r,o);h.text=h.text.slice(a.offset)}}x.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(nt.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)||x.isEditor(e)},isNodeList(e){if(!Array.isArray(e))return!1;var t=Hu.get(e);if(t!==void 0)return t;var n=e.every(r=>ue.isNode(r));return Hu.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(nt.stringify(n)));return n},levels(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return function*(){for(var r of N.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?N.isBefore(o,i):N.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;N.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 d=N.next(o);if(ue.has(e,d)){o=d,l=ue.get(e,o);continue}}if(r&&o[o.length-1]!==0){var h=N.previous(o);o=h,l=ue.get(e,o);continue}o=N.parent(o),l=ue.get(e,o),s.add(l)}}()},parent(e,t){var n=N.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 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 He(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){ft(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 dn={isNodeOperation(e){return dn.isOperation(e)&&e.type.endsWith("_node")},isOperation(e){if(!rt(e))return!1;switch(e.type){case"insert_node":return N.isPath(e.path)&&ue.isNode(e.node);case"insert_text":return typeof e.offset=="number"&&typeof e.text=="string"&&N.isPath(e.path);case"merge_node":return typeof e.position=="number"&&N.isPath(e.path)&&rt(e.properties);case"move_node":return N.isPath(e.path)&&N.isPath(e.newPath);case"remove_node":return N.isPath(e.path)&&ue.isNode(e.node);case"remove_text":return typeof e.offset=="number"&&typeof e.text=="string"&&N.isPath(e.path);case"set_node":return N.isPath(e.path)&&rt(e.properties)&&rt(e.newProperties);case"set_selection":return e.properties===null&&Z.isRange(e.newProperties)||e.newProperties===null&&Z.isRange(e.properties)||rt(e.properties)&&rt(e.newProperties);case"split_node":return N.isPath(e.path)&&typeof e.position=="number"&&rt(e.properties);default:return!1}},isOperationList(e){return Array.isArray(e)&&e.every(t=>dn.isOperation(t))},isSelectionOperation(e){return dn.isOperation(e)&&e.type.endsWith("_selection")},isTextOperation(e){return dn.isOperation(e)&&e.type.endsWith("_text")},inverse(e){switch(e.type){case"insert_node":return He(He({},e),{},{type:"remove_node"});case"insert_text":return He(He({},e),{},{type:"remove_text"});case"merge_node":return He(He({},e),{},{type:"split_node",path:N.previous(e.path)});case"move_node":{var{newPath:t,path:n}=e;if(N.equals(t,n))return e;if(N.isSibling(n,t))return He(He({},e),{},{path:t,newPath:n});var r=N.transform(n,e),a=N.transform(N.next(n),e);return He(He({},e),{},{path:r,newPath:a})}case"remove_node":return He(He({},e),{},{type:"insert_node"});case"remove_text":return He(He({},e),{},{type:"insert_text"});case"set_node":{var{properties:i,newProperties:s}=e;return He(He({},e),{},{properties:s,newProperties:i})}case"set_selection":{var{properties:o,newProperties:l}=e;return o==null?He(He({},e),{},{properties:l,newProperties:null}):l==null?He(He({},e),{},{properties:null,newProperties:o}):He(He({},e),{},{properties:l,newProperties:o})}case"split_node":return He(He({},e),{},{type:"merge_node",path:N.next(e.path)})}}},Ku=new WeakMap,pv=e=>{var t=Ku.get(e);if(t!==void 0)return t;if(!rt(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||rt(e.marks))&&(e.selection===null||Z.isRange(e.selection))&&ue.isNodeList(e.children)&&dn.isOperationList(e.operations);return Ku.set(e,n),n},x={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 pv(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)}},gv={isSpan(e){return Array.isArray(e)&&e.length===2&&e.every(N.isPath)}};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){ft(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 ke={compare(e,t){var n=N.compare(e.path,t.path);return n===0?e.offset<t.offset?-1:e.offset>t.offset?1:0:n},isAfter(e,t){return ke.compare(e,t)===1},isBefore(e,t){return ke.compare(e,t)===-1},equals(e,t){return e.offset===t.offset&&N.equals(e.path,t.path)},isPoint(e){return rt(e)&&typeof e.offset=="number"&&N.isPath(e.path)},transform(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return bo(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=N.transform(i,t,n);break}case"insert_text":{N.equals(t.path,i)&&(t.offset<s||t.offset===s&&a==="forward")&&(r.offset+=t.text.length);break}case"merge_node":{N.equals(t.path,i)&&(r.offset+=t.position),r.path=N.transform(i,t,n);break}case"remove_text":{N.equals(t.path,i)&&t.offset<=s&&(r.offset-=Math.min(s-t.offset,t.text.length));break}case"remove_node":{if(N.equals(t.path,i)||N.isAncestor(t.path,i))return null;r.path=N.transform(i,t,n);break}case"split_node":{if(N.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=N.transform(i,t,Yu(Yu({},n),{},{affinity:"forward"})))}else r.path=N.transform(i,t,n);break}}})}},Gu=void 0,nt={setScrubber(e){Gu=e},stringify(e){return JSON.stringify(e,Gu)}},vv=["text"],bv=["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 Zt(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){ft(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=Xt(i,vv);return s}return tf(r?a(e):e,r?a(t):t)},isText(e){return rt(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=[Zt({},e)];for(var r of t){var a=Xt(r,bv),[i,s]=Z.edges(r),o=[],l=0,u=i.offset,d=s.offset;for(var h of n){var{length:m}=h.text,p=l;if(l+=m,u<=p&&l<=d){Object.assign(h,a),o.push(h);continue}if(u!==d&&(u===l||d===p)||u>l||d<p||d===p&&p!==0){o.push(h);continue}var g=h,f=void 0,b=void 0;if(d<l){var v=d-p;b=Zt(Zt({},g),{},{text:g.text.slice(v)}),g=Zt(Zt({},g),{},{text:g.text.slice(0,v)})}if(u>p){var C=u-p;f=Zt(Zt({},g),{},{text:g.text.slice(0,C)}),g=Zt(Zt({},g),{},{text:g.text.slice(C)})}Object.assign(g,a),f&&o.push(f),o.push(g),b&&o.push(b)}n=o}return n}},yo=e=>e.selection?e.selection:e.children.length>0?x.end(e,[]):[0],cr=(e,t)=>{var[n]=x.node(e,t);return r=>r===n},xo=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=!n,a=n?Ev(t):t,i=Ce.None,s=Ce.None,o=0,l=null,u=null;for(var d of a){var h=d.codePointAt(0);if(!h)break;var m=Nv(d,h);if([i,s]=r?[s,m]:[m,i],Vn(i,Ce.ZWJ)&&Vn(s,Ce.ExtPict)&&(r?l=Ju(t.substring(0,o)):l=Ju(t.substring(0,t.length-o)),!l)||Vn(i,Ce.RI)&&Vn(s,Ce.RI)&&(u!==null?u=!u:r?u=!0:u=zv(t.substring(0,t.length-o)),!u)||i!==Ce.None&&s!==Ce.None&&Iv(i,s))break;o+=d.length}return o||1},yv=/\s/,xv=/[\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]/,Dv=/['\u2018\u2019]/,Cv=function(t){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=0,a=!1;t.length>0;){var i=xo(t,n),[s,o]=Do(t,i,n);if(wv(s,o,n))a=!0,r+=i;else if(!a)r+=i;else break;t=o}return r},Do=(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)]},wv=function e(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(yv.test(t))return!1;if(Dv.test(t)){var a=xo(n,r),[i,s]=Do(n,a,r);if(e(i,s,r))return!0}return!xv.test(t)},Ev=function*(t){for(var n=t.length-1,r=0;r<t.length;r++){var a=t.charAt(n-r);if(kv(a.charCodeAt(0))){var i=t.charAt(n-r-1);if(_v(i.charCodeAt(0))){yield i+a,r++;continue}}yield a}},_v=e=>e>=55296&&e<=56319,kv=e=>e>=56320&&e<=57343,Ce;(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"})(Ce||(Ce={}));var Fv=/^(?:[\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])$/,Bv=/^(?:[\u0600-\u0605\u06DD\u070F\u0890\u0891\u08E2\u0D4E]|\uD804[\uDCBD\uDCCD\uDDC2\uDDC3]|\uD806[\uDD3F\uDD41\uDE3A\uDE84-\uDE89]|\uD807\uDD46)$/,Av=/^(?:[\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])$/,Tv=/^[\u1100-\u115F\uA960-\uA97C]$/,Sv=/^[\u1160-\u11A7\uD7B0-\uD7C6]$/,jv=/^[\u11A8-\u11FF\uD7CB-\uD7FB]$/,Ov=/^[\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]$/,Pv=/^[\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])$/,Nv=(e,t)=>{var n=Ce.Any;return e.search(Fv)!==-1&&(n|=Ce.Extend),t===8205&&(n|=Ce.ZWJ),t>=127462&&t<=127487&&(n|=Ce.RI),e.search(Bv)!==-1&&(n|=Ce.Prepend),e.search(Av)!==-1&&(n|=Ce.SpacingMark),e.search(Tv)!==-1&&(n|=Ce.L),e.search(Sv)!==-1&&(n|=Ce.V),e.search(jv)!==-1&&(n|=Ce.T),e.search(Ov)!==-1&&(n|=Ce.LV),e.search(Pv)!==-1&&(n|=Ce.LVT),e.search(Mv)!==-1&&(n|=Ce.ExtPict),n};function Vn(e,t){return(e&t)!==0}var Rv=[[Ce.L,Ce.L|Ce.V|Ce.LV|Ce.LVT],[Ce.LV|Ce.V,Ce.V|Ce.T],[Ce.LVT|Ce.T,Ce.T],[Ce.Any,Ce.Extend|Ce.ZWJ],[Ce.Any,Ce.SpacingMark],[Ce.Prepend,Ce.Any],[Ce.ZWJ,Ce.ExtPict],[Ce.RI,Ce.RI]];function Iv(e,t){return Rv.findIndex(n=>Vn(e,n[0])&&Vn(t,n[1]))===-1}var $v=/(?:[\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$/,Ju=e=>e.search($v)!==-1,Lv=/(?:\uD83C[\uDDE6-\uDDFF])+$/g,zv=e=>{var t=e.match(Lv);if(t===null)return!1;var n=t[0].length/2;return n%2===1},qv={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]:{};x.withoutNormalizing(e,()=>{var{voids:r=!1}=n,{at:a=yo(e)}=n;if(N.isPath(a)&&(a=x.range(e,a)),Z.isRange(a))if(Z.isCollapsed(a))a=a.anchor;else{var i=Z.end(a);if(!r&&x.void(e,{at:i}))return;var s=Z.start(a),o=x.pointRef(e,s),l=x.pointRef(e,i);J.delete(e,{at:a,voids:r});var u=o.unref(),d=l.unref();a=u||d,J.setSelection(e,{anchor:a,focus:a})}if(!(!r&&x.void(e,{at:a})||x.elementReadOnly(e,{at:a}))){var{path:h,offset:m}=a;t.length>0&&e.apply({type:"insert_text",path:h,offset:m,text:t})}})}};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 oa(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){ft(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 J=oa(oa(oa(oa({},ov),uv),lv),qv),Ea=new WeakMap,Wv=e=>Ea.get(e)||!1,Uv=(e,t,n)=>{var r=Ea.get(e)||!1;Ea.set(e,!0);try{t(),n()}finally{Ea.set(e,r)}};function nf(e,t,n){var r=za.get(e)||[],a=qa.get(e)||new Set,i,s,o=h=>{if(h){var m=h.join(",");s.has(m)||(s.add(m),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 d of t)o(d);za.set(e,i),qa.set(e,s)}var Hv=(e,t)=>{for(var n of x.pathRefs(e))tv.transform(n,t);for(var r of x.pointRefs(e))nv.transform(r,t);for(var a of x.rangeRefs(e))rv.transform(a,t);if(!Wv(e)){var i=N.operationCanTransformPath(t)?s=>N.transform(s,t):void 0;nf(e,e.getDirtyPaths(t),i)}J.transform(e,t),e.operations.push(t),x.normalize(e,{operation:t}),t.type==="set_selection"&&(e.marks=null),kr.get(e)||(kr.set(e,!0),Promise.resolve().then(()=>{kr.set(e,!1),e.onChange({operation:t}),e.operations=[]}))},Vv=(e,t)=>{switch(t.type){case"insert_text":case"remove_text":case"set_node":{var{path:n}=t;return N.levels(n)}case"insert_node":{var{node:r,path:a}=t,i=N.levels(a),s=fe.isText(r)?[]:Array.from(ue.nodes(r),z=>{var[,R]=z;return a.concat(R)});return[...i,...s]}case"merge_node":{var{path:o}=t,l=N.ancestors(o),u=N.previous(o);return[...l,u]}case"move_node":{var{path:d,newPath:h}=t;if(N.equals(d,h))return[];var m=[],p=[];for(var g of N.ancestors(d)){var f=N.transform(g,t);m.push(f)}for(var b of N.ancestors(h)){var v=N.transform(b,t);p.push(v)}var C=p[p.length-1],F=h[h.length-1],_=C.concat(F);return[...m,...p,_]}case"remove_node":{var{path:w}=t,k=N.ancestors(w);return[...k]}case"split_node":{var{path:j}=t,q=N.levels(j),P=N.next(j);return[...q,P]}default:return[]}},Kv=e=>{var{selection:t}=e;return t?ue.fragment(e,t):[]},Zv=(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=x.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],d=l.children[s-1],h=o===n.children.length-1,m=fe.isText(u)||de.isElement(u)&&e.isInline(u);if(m!==i)J.removeNodes(e,{at:r.concat(s),voids:!0}),s--;else if(de.isElement(u)){if(e.isInline(u)){if(d==null||!fe.isText(d)){var p={text:""};J.insertNodes(e,p,{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 d!=null&&fe.isText(d)&&(fe.equals(u,d,{loose:!0})?(J.mergeNodes(e,{at:r.concat(s),voids:!0}),s--):d.text===""?(J.removeNodes(e,{at:r.concat(s-1),voids:!0}),s--):u.text===""&&(J.removeNodes(e,{at:r.concat(s),voids:!0}),s--))}}}},Yv=(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},Gv=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=x.path(t,i),l=a==="lowest";for(var[u,d]of x.levels(t,{at:o,voids:r,match:s,reverse:l}))if(!fe.isText(u)){if(Z.isRange(i)){if(N.isAncestor(d,i.anchor.path)&&N.isAncestor(d,i.focus.path))return[u,d]}else if(!N.equals(o,d))return[u,d]}}};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 tl(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){ft(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 Qv=(e,t,n)=>{var{selection:r}=e;if(r){var a=(h,m)=>{if(!fe.isText(h))return!1;var[p,g]=x.parent(e,m);return!e.isVoid(p)||e.markableVoid(p)},i=Z.isExpanded(r),s=!1;if(!i){var[o,l]=x.node(e,r);if(o&&a(o,l)){var[u]=x.parent(e,l);s=u&&e.markableVoid(u)}}if(i||s)J.setNodes(e,{[t]:n},{match:a,split:!0,voids:!0});else{var d=tl(tl({},x.marks(e)||{}),{},{[t]:n});e.marks=d,kr.get(e)||e.onChange()}}};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){ft(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 Jv=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=x.point(t,n,{edge:"end"}),i=x.end(t,[]),s={anchor:a,focus:i},{distance:o=1}=r,l=0,u;for(var d of x.positions(t,rl(rl({},r),{},{at:s}))){if(l>o)break;l!==0&&(u=d),l++}return u};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){ft(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 Xv=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=x.start(t,[]),i=x.point(t,n,{edge:"start"}),s={anchor:a,focus:i},{distance:o=1}=r,l=0,u;for(var d of x.positions(t,il(il({},r),{},{at:s,reverse:!0}))){if(l>o)break;l!==0&&(u=d),l++}return u},e0=(e,t)=>{var{selection:n}=e;n&&Z.isCollapsed(n)&&J.delete(e,{unit:t,reverse:!0})},t0=(e,t)=>{var{selection:n}=e;n&&Z.isCollapsed(n)&&J.delete(e,{unit:t})},n0=function(t){var{direction:n="forward"}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{selection:r}=t;r&&Z.isExpanded(r)&&J.delete(t,{reverse:n==="backward"})},r0=(e,t)=>[x.start(e,t),x.end(e,t)];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 ol(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){ft(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 a0=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return x.above(t,ol(ol({},n),{},{match:r=>de.isElement(r)&&x.isElementReadOnly(t,r)}))},i0=(e,t)=>x.point(e,t,{edge:"end"}),s0=(e,t)=>{var n=x.path(e,t,{edge:"start"});return x.node(e,n)},o0=(e,t)=>{var n=x.range(e,t);return ue.fragment(e,n)};function ul(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?ul(Object(n),!0).forEach(function(r){ft(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ul(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var u0=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return x.above(t,ll(ll({},n),{},{match:r=>de.isElement(r)&&x.isVoid(t,r)}))},l0=(e,t)=>t.children.some(n=>de.isElement(n)&&x.isBlock(e,n)),c0=(e,t)=>t.children.some(n=>fe.isText(n)||x.isInline(e,n)),d0=(e,t)=>ue.has(e,t),f0=(e,t)=>t.children.every(n=>fe.isText(n)),h0=e=>{J.splitNodes(e,{always:!0})},m0=(e,t,n)=>{J.insertNodes(e,t,n)},p0=e=>{J.splitNodes(e,{always:!0})};function cl(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 g0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?cl(Object(n),!0).forEach(function(r){ft(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cl(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var v0=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=g0({text:n},i);J.insertNodes(t,s,{at:r.at,voids:r.voids})}else J.insertText(t,n,r);t.marks=null}},b0=(e,t)=>!e.isInline(t),y0=(e,t,n)=>x.isStart(e,t,n)||x.isEnd(e,t,n),x0=(e,t)=>{var{children:n}=t,[r]=n;return n.length===0||n.length===1&&fe.isText(r)&&r.text===""&&!e.isVoid(t)},D0=(e,t,n)=>{var r=x.end(e,n);return ke.equals(t,r)},C0=e=>{var t=ef.get(e);return t===void 0?!0:t},w0=(e,t,n)=>{if(t.offset!==0)return!1;var r=x.start(e,n);return ke.equals(t,r)},E0=(e,t)=>{var n=x.path(e,t,{edge:"end"});return x.node(e,n)},_0=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=x.path(t,n,r),i=ue.leaf(t,a);return[i,a]};function k0(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=x.path(e,n);for(var[l,u]of ue.levels(e,o))if(i(l,u)&&(s.push([l,u]),!a&&de.isElement(l)&&x.isVoid(e,l)))break;r&&s.reverse(),yield*s}}()}var F0=["text"],B0=["text"],A0=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=x.isEnd(t,a,a.path);if(s){var o=x.after(t,a);o&&(a=o)}var[l]=x.nodes(t,{match:fe.isText,at:{anchor:a,focus:i}});if(l){var[u]=l,d=Xt(u,F0);return d}else return{}}var{path:h}=a,[m]=x.leaf(t,h);if(a.offset===0){var p=x.previous(t,{at:h,match:fe.isText}),g=x.above(t,{match:_=>de.isElement(_)&&x.isVoid(t,_)&&t.markableVoid(_)});if(!g){var f=x.above(t,{match:_=>de.isElement(_)&&x.isBlock(t,_)});if(p&&f){var[b,v]=p,[,C]=f;N.isAncestor(C,v)&&(m=b)}}}var F=Xt(m,B0);return F},T0=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=x.after(t,s,{voids:a});if(o){var[,l]=x.last(t,[]),u=[o.path,l];if(N.isPath(s)&&s.length===0)throw new Error("Cannot get the next node from the root node!");if(i==null)if(N.isPath(s)){var[d]=x.parent(t,s);i=m=>d.children.includes(m)}else i=()=>!0;var[h]=x.nodes(t,{at:u,match:i,mode:r,voids:a});return h}}},S0=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=x.path(t,n,r),i=ue.get(t,a);return[i,a]};function j0(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,d;if(gv.isSpan(n))u=n[0],d=n[1];else{var h=x.path(e,n,{edge:"start"}),m=x.path(e,n,{edge:"end"});u=i?m:h,d=i?h:m}var p=ue.nodes(e,{reverse:i,from:u,to:d,pass:_=>{var[w]=_;return de.isElement(w)?!!(!s&&(x.isVoid(e,w)||x.isElementReadOnly(e,w))||o&&!x.isSelectable(e,w)):!1}}),g=[],f;for(var[b,v]of p)if(!(o&&de.isElement(b)&&!x.isSelectable(e,b))){var C=f&&N.compare(v,f[1])===0;if(!(r==="highest"&&C)){if(!l(b,v)){if(a&&!C&&fe.isText(b))return;continue}if(r==="lowest"&&C){f=[b,v];continue}var F=r==="lowest"?f:[b,v];F&&(a?g.push(F):yield F),f=[b,v]}}r==="lowest"&&f&&(a?g.push(f):yield f),a&&(yield*g)}}()}var O0=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{force:r=!1,operation:a}=n,i=d=>za.get(d)||[],s=d=>qa.get(d)||new Set,o=d=>{var h=i(d).pop(),m=h.join(",");return s(d).delete(m),h};if(x.isNormalizing(t)){if(r){var l=Array.from(ue.nodes(t),d=>{var[,h]=d;return h}),u=new Set(l.map(d=>d.join(",")));za.set(t,l),qa.set(t,u)}i(t).length!==0&&x.withoutNormalizing(t,()=>{for(var d of i(t))if(ue.has(t,d)){var h=x.node(t,d),[m,p]=h;de.isElement(m)&&m.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 C=x.node(t,v);t.normalizeNode(C,{operation:a})}b++,g=i(t)}})}},P0=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=x.path(t,n,r),i=N.parent(a),s=x.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=x.pathRefs(t);return l.delete(i),i.current=null,o}},s=x.pathRefs(t);return s.add(i),i},N0=e=>{var t=$u.get(e);return t||(t=new Set,$u.set(e,t)),t},R0=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{depth:a,edge:i}=r;if(N.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=N.common(n.anchor.path,n.focus.path)),ke.isPoint(n)&&(n=n.path),a!=null&&(n=n.slice(0,a)),n},I0=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=x.pointRefs(t);return l.delete(i),i.current=null,o}},s=x.pointRefs(t);return s.add(i),i},$0=e=>{var t=Lu.get(e);return t||(t=new Set,Lu.set(e,t)),t},L0=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{edge:a="start"}=r;if(N.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,d]=Z.edges(n);return a==="start"?u:d}return n};function z0(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=x.range(e,n),[l,u]=Z.edges(o),d=a?u:l,h=!1,m="",p=0,g=0,f=0;for(var[b,v]of x.nodes(e,{at:n,reverse:a,voids:i,ignoreNonSelectable:s})){if(de.isElement(b)){if(!i&&(e.isVoid(b)||e.isElementReadOnly(b))){yield x.start(e,v);continue}if(e.isInline(b))continue;if(x.hasInlines(e,b)){var C=N.isAncestor(v,u.path)?u:x.end(e,v),F=N.isAncestor(v,l.path)?l:x.start(e,v);m=x.string(e,{anchor:F,focus:C},{voids:i}),h=!0}}if(fe.isText(b)){var _=N.equals(v,d.path);for(_?(g=a?d.offset:b.text.length-d.offset,f=d.offset):(g=b.text.length,f=a?g:0),(_||h||r==="offset")&&(yield{path:v,offset:f},h=!1);;){if(p===0){if(m==="")break;p=w(m,r,a),m=Do(m,p,a)[1]}if(f=a?f-p:f+p,g=g-p,g<0){p=-g;break}p=0,yield{path:v,offset:f}}}}function w(k,j,q){return j==="character"?xo(k,q):j==="word"?Cv(k,q):j==="line"||j==="block"?k.length:1}}()}var q0=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=x.before(t,s,{voids:a});if(o){var[,l]=x.first(t,[]),u=[o.path,l];if(N.isPath(s)&&s.length===0)throw new Error("Cannot get the previous node from the root node!");if(i==null)if(N.isPath(s)){var[d]=x.parent(t,s);i=m=>d.children.includes(m)}else i=()=>!0;var[h]=x.nodes(t,{reverse:!0,at:u,match:i,mode:r,voids:a});return h}}},W0=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=x.rangeRefs(t);return l.delete(i),i.current=null,o}},s=x.rangeRefs(t);return s.add(i),i},U0=e=>{var t=zu.get(e);return t||(t=new Set,zu.set(e,t)),t},H0=(e,t,n)=>{if(Z.isRange(t)&&!n)return t;var r=x.start(e,t),a=x.end(e,n||t);return{anchor:r,focus:a}};function dl(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 V0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dl(Object(n),!0).forEach(function(r){ft(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dl(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=(d,h)=>{if(!fe.isText(d))return!1;var[m,p]=x.parent(e,h);return!e.isVoid(m)||e.markableVoid(m)},a=Z.isExpanded(n),i=!1;if(!a){var[s,o]=x.node(e,n);if(s&&r(s,o)){var[l]=x.parent(e,o);i=l&&e.markableVoid(l)}}if(a||i)J.unsetNodes(e,t,{match:r,split:!0,voids:!0});else{var u=V0({},x.marks(e)||{});delete u[t],e.marks=u,kr.get(e)||e.onChange()}}},Z0=(e,t)=>{ef.set(e,t)},Y0=(e,t)=>x.point(e,t,{edge:"start"}),G0=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{voids:a=!1}=r,i=x.range(t,n),[s,o]=Z.edges(i),l="";for(var[u,d]of x.nodes(t,{at:i,match:fe.isText,voids:a})){var h=u.text;N.equals(d,o.path)&&(h=h.slice(0,o.offset)),N.equals(d,s.path)&&(h=h.slice(s.offset)),l+=h}return l},Q0=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)||N.hasPrevious(s.path))return n;var o=x.above(t,{at:s,match:g=>de.isElement(g)&&x.isBlock(t,g),voids:a}),l=o?o[1]:[],u=x.start(t,i),d={anchor:u,focus:s},h=!0;for(var[m,p]of x.nodes(t,{at:d,match:fe.isText,reverse:!0,voids:a})){if(h){h=!1;continue}if(m.text!==""||N.isBefore(p,l)){s={path:p,offset:m.text.length};break}}return{anchor:i,focus:s}},J0=(e,t)=>{var n=x.isNormalizing(e);x.setNormalizing(e,!1);try{t()}finally{x.setNormalizing(e,n)}x.normalize(e)},X0=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};x.withoutNormalizing(t,()=>{var r,a,{reverse:i=!1,unit:s="character",distance:o=1,voids:l=!1}=n,{at:u=t.selection,hanging:d=!1}=n;if(u){var h=!1;if(Z.isRange(u)&&Z.isCollapsed(u)&&(h=!0,u=u.anchor),ke.isPoint(u)){var m=x.void(t,{at:u,mode:"highest"});if(!l&&m){var[,p]=m;u=p}else{var g={unit:s,distance:o},f=i?x.before(t,u,g)||x.start(t,[]):x.after(t,u,g)||x.end(t,[]);u={anchor:u,focus:f},d=!0}}if(N.isPath(u)){J.removeNodes(t,{at:u,voids:l});return}if(!Z.isCollapsed(u)){if(!d){var[,b]=Z.edges(u),v=x.end(t,[]);ke.equals(b,v)||(u=x.unhangRange(t,u,{voids:l}))}var[C,F]=Z.edges(u),_=x.above(t,{match:me=>de.isElement(me)&&x.isBlock(t,me),at:C,voids:l}),w=x.above(t,{match:me=>de.isElement(me)&&x.isBlock(t,me),at:F,voids:l}),k=_&&w&&!N.equals(_[1],w[1]),j=N.equals(C.path,F.path),q=l?null:(r=x.void(t,{at:C,mode:"highest"}))!==null&&r!==void 0?r:x.elementReadOnly(t,{at:C,mode:"highest"}),P=l?null:(a=x.void(t,{at:F,mode:"highest"}))!==null&&a!==void 0?a:x.elementReadOnly(t,{at:F,mode:"highest"});if(q){var z=x.before(t,C);z&&_&&N.isAncestor(_[1],z.path)&&(C=z)}if(P){var R=x.after(t,F);R&&w&&N.isAncestor(w[1],R.path)&&(F=R)}var A=[],E;for(var S of x.nodes(t,{at:u,voids:l})){var[O,V]=S;E&&N.compare(V,E)===0||(!l&&de.isElement(O)&&(x.isVoid(t,O)||x.isElementReadOnly(t,O))||!N.isCommon(V,C.path)&&!N.isCommon(V,F.path))&&(A.push(S),E=V)}var H=Array.from(A,me=>{var[,_e]=me;return x.pathRef(t,_e)}),Q=x.pointRef(t,C),ae=x.pointRef(t,F),D="";if(!j&&!q){var $=Q.current,[ee]=x.leaf(t,$),{path:B}=$,{offset:T}=C,L=ee.text.slice(T);L.length>0&&(t.apply({type:"remove_text",path:B,offset:T,text:L}),D=L)}if(H.reverse().map(me=>me.unref()).filter(me=>me!==null).forEach(me=>J.removeNodes(t,{at:me,voids:l})),!P){var I=ae.current,[W]=x.leaf(t,I),{path:U}=I,ne=j?C.offset:0,re=W.text.slice(ne,F.offset);re.length>0&&(t.apply({type:"remove_text",path:U,offset:ne,text:re}),D=re)}!j&&k&&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(),X=ae.unref(),pe=i?le||X:X||le;n.at==null&&pe&&J.select(t,pe)}}})},eb=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};x.withoutNormalizing(t,()=>{var{hanging:a=!1,voids:i=!1}=r,{at:s=yo(t),batchDirty:o=!0}=r;if(n.length){if(Z.isRange(s))if(a||(s=x.unhangRange(t,s,{voids:i})),Z.isCollapsed(s))s=s.anchor;else{var[,l]=Z.edges(s);if(!i&&x.void(t,{at:l}))return;var u=x.pointRef(t,l);J.delete(t,{at:s}),s=u.unref()}else N.isPath(s)&&(s=x.start(t,s));if(!(!i&&x.void(t,{at:s}))){var d=x.above(t,{at:s,match:L=>de.isElement(L)&&x.isInline(t,L),mode:"highest",voids:i});if(d){var[,h]=d;if(x.isEnd(t,s,h)){var m=x.after(t,h);s=m}else if(x.isStart(t,s,h)){var p=x.before(t,h);s=p}}var g=x.above(t,{match:L=>de.isElement(L)&&x.isBlock(t,L),at:s,voids:i}),[,f]=g,b=x.isStart(t,s,f),v=x.isEnd(t,s,f),C=b&&v,F=!b||b&&v,_=!v,[,w]=ue.first({children:n},[]),[,k]=ue.last({children:n},[]),j=[],q=L=>{var[I,W]=L,U=W.length===0;return U?!1:C?!0:!(F&&N.isAncestor(W,w)&&de.isElement(I)&&!t.isVoid(I)&&!t.isInline(I)||_&&N.isAncestor(W,k)&&de.isElement(I)&&!t.isVoid(I)&&!t.isInline(I))};for(var P of ue.nodes({children:n},{pass:q}))q(P)&&j.push(P);var z=[],R=[],A=[],E=!0,S=!1;for(var[O]of j)de.isElement(O)&&!t.isInline(O)?(E=!1,S=!0,R.push(O)):E?z.push(O):A.push(O);var[V]=x.nodes(t,{at:s,match:L=>fe.isText(L)||x.isInline(t,L),mode:"highest",voids:i}),[,H]=V,Q=x.isStart(t,s,H),ae=x.isEnd(t,s,H),D=x.pathRef(t,v&&!A.length?N.next(f):f),$=x.pathRef(t,ae?N.next(H):H);J.splitNodes(t,{at:s,match:L=>S?de.isElement(L)&&x.isBlock(t,L):fe.isText(L)||x.isInline(t,L),mode:S?"lowest":"highest",always:S&&(!b||z.length>0)&&(!v||A.length>0),voids:i});var ee=x.pathRef(t,!Q||Q&&ae?N.next(H):H);if(J.insertNodes(t,z,{at:ee.current,match:L=>fe.isText(L)||x.isInline(t,L),mode:"highest",voids:i,batchDirty:o}),C&&!z.length&&R.length&&!A.length&&J.delete(t,{at:f,voids:i}),J.insertNodes(t,R,{at:D.current,match:L=>de.isElement(L)&&x.isBlock(t,L),mode:"lowest",voids:i,batchDirty:o}),J.insertNodes(t,A,{at:$.current,match:L=>fe.isText(L)||x.isInline(t,L),mode:"highest",voids:i,batchDirty:o}),!r.at){var B;if(A.length>0&&$.current?B=N.previous($.current):R.length>0&&D.current?B=N.previous(D.current):ee.current&&(B=N.previous(ee.current)),B){var T=x.end(t,B);J.select(t,T)}}ee.unref(),D.unref(),$.unref()}}})},tb=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]=Z.edges(a);J.select(t,i)}else if(r==="end"){var[,s]=Z.edges(a);J.select(t,s)}}else return},nb=e=>{var{selection:t}=e;t&&e.apply({type:"set_selection",properties:t,newProperties:null})},rb=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,d={distance:a,unit:i,ignoreNonSelectable:!0},h={};if(o==null||o==="anchor"){var m=s?x.before(t,l,d):x.after(t,l,d);m&&(h.anchor=m)}if(o==null||o==="focus"){var p=s?x.before(t,u,d):x.after(t,u,d);p&&(h.focus=p)}J.setSelection(t,h)}},ab=(e,t)=>{var{selection:n}=e;if(t=x.range(e,t),n){J.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(nt.stringify(t)));e.apply({type:"set_selection",properties:n,newProperties:t})};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 hl(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){ft(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 ib=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;J.setSelection(t,{[i==="anchor"?"anchor":"focus"]:hl(hl({},l),n)})}},sb=(e,t)=>{var{selection:n}=e,r={},a={};if(n){for(var i in t)(i==="anchor"&&t.anchor!=null&&!ke.equals(t.anchor,n.anchor)||i==="focus"&&t.focus!=null&&!ke.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})}},ob=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};x.withoutNormalizing(t,()=>{var{hanging:a=!1,voids:i=!1,mode:s="lowest",batchDirty:o=!0}=r,{at:l,match:u,select:d}=r;if(ue.isNode(n)&&(n=[n]),n.length!==0){var[h]=n;if(l||(l=yo(t),d!==!1&&(d=!0)),d==null&&(d=!1),Z.isRange(l))if(a||(l=x.unhangRange(t,l,{voids:i})),Z.isCollapsed(l))l=l.anchor;else{var[,m]=Z.edges(l),p=x.pointRef(t,m);J.delete(t,{at:l}),l=p.unref()}if(ke.isPoint(l)){u==null&&(fe.isText(h)?u=z=>fe.isText(z):t.isInline(h)?u=z=>fe.isText(z)||x.isInline(t,z):u=z=>de.isElement(z)&&x.isBlock(t,z));var[g]=x.nodes(t,{at:l.path,match:u,mode:s,voids:i});if(g){var[,f]=g,b=x.pathRef(t,f),v=x.isEnd(t,l,f);J.splitNodes(t,{at:l,match:u,mode:s,voids:i});var C=b.unref();l=v?N.next(C):C}else return}var F=N.parent(l),_=l[l.length-1];if(!(!i&&x.void(t,{at:F}))){if(o){var w=[],k=N.levels(F);Uv(t,()=>{var z=function(){var E=F.concat(_);_++;var S={type:"insert_node",path:E,node:R};t.apply(S),l=N.next(l),w.push(S),fe.isText?k.push(...Array.from(ue.nodes(R),O=>{var[,V]=O;return E.concat(V)})):k.push(E)};for(var R of n)z()},()=>{nf(t,k,z=>{var R=z;for(var A of w)if(N.operationCanTransformPath(A)&&(R=N.transform(R,A),!R))return null;return R})})}else for(var j of n){var q=F.concat(_);_++,t.apply({type:"insert_node",path:q,node:j}),l=N.next(l)}if(l=N.previous(l),d){var P=x.end(t,l);P&&J.select(t,P)}}}})},ub=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};x.withoutNormalizing(t,()=>{var{at:r=t.selection,mode:a="lowest",voids:i=!1}=n,{match:s}=n;if(s==null&&(s=N.isPath(r)?cr(t,r):_=>de.isElement(_)&&x.isBlock(t,_)),!!r){var o=x.nodes(t,{at:r,match:s,mode:a,voids:i}),l=Array.from(o,_=>{var[,w]=_;return x.pathRef(t,w)});for(var u of l){var d=u.unref();if(d.length<2)throw new Error("Cannot lift node at a path [".concat(d,"] because it has a depth of less than `2`."));var h=x.node(t,N.parent(d)),[m,p]=h,g=d[d.length-1],{length:f}=m.children;if(f===1){var b=N.next(p);J.moveNodes(t,{at:d,to:b,voids:i}),J.removeNodes(t,{at:p,voids:i})}else if(g===0)J.moveNodes(t,{at:d,to:p,voids:i});else if(g===f-1){var v=N.next(p);J.moveNodes(t,{at:d,to:v,voids:i})}else{var C=N.next(d),F=N.next(p);J.splitNodes(t,{at:C,voids:i}),J.moveNodes(t,{at:d,to:F,voids:i})}}}})},lb=["text"],cb=["children"],rf=(e,t)=>{if(de.isElement(t)){var n=t;return x.isVoid(e,t)?!0:n.children.length===1?rf(e,n.children[0]):!1}else return!x.isEditor(t)},db=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};x.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(N.isPath(a)){var[l]=x.parent(t,a);r=z=>l.children.includes(z)}else r=z=>de.isElement(z)&&x.isBlock(t,z);if(!i&&Z.isRange(a)&&(a=x.unhangRange(t,a,{voids:s})),Z.isRange(a))if(Z.isCollapsed(a))a=a.anchor;else{var[,u]=Z.edges(a),d=x.pointRef(t,u);J.delete(t,{at:a}),a=d.unref(),n.at==null&&J.select(t,a)}var[h]=x.nodes(t,{at:a,match:r,voids:s,mode:o}),m=x.previous(t,{at:a,match:r,voids:s,mode:o});if(!(!h||!m)){var[p,g]=h,[f,b]=m;if(!(g.length===0||b.length===0)){var v=N.next(b),C=N.common(g,b),F=N.isSibling(g,b),_=Array.from(x.levels(t,{at:g}),z=>{var[R]=z;return R}).slice(C.length).slice(0,-1),w=x.above(t,{at:g,mode:"highest",match:z=>_.includes(z)&&rf(t,z)}),k=w&&x.pathRef(t,w[1]),j,q;if(fe.isText(p)&&fe.isText(f)){var P=Xt(p,lb);q=f.text.length,j=P}else if(de.isElement(p)&&de.isElement(f)){var P=Xt(p,cb);q=f.children.length,j=P}else throw new Error("Cannot merge the node at path [".concat(g,"] with the previous sibling because it is not the same kind: ").concat(nt.stringify(p)," ").concat(nt.stringify(f)));F||J.moveNodes(t,{at:g,to:v,voids:s}),k&&J.removeNodes(t,{at:k.current,voids:s}),de.isElement(f)&&x.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:j}),k&&k.unref()}}}})},fb=(e,t)=>{x.withoutNormalizing(e,()=>{var{to:n,at:r=e.selection,mode:a="lowest",voids:i=!1}=t,{match:s}=t;if(r){s==null&&(s=N.isPath(r)?cr(e,r):p=>de.isElement(p)&&x.isBlock(e,p));var o=x.pathRef(e,n),l=x.nodes(e,{at:r,match:s,mode:a,voids:i}),u=Array.from(l,p=>{var[,g]=p;return x.pathRef(e,g)});for(var d of u){var h=d.unref(),m=o.current;h.length!==0&&e.apply({type:"move_node",path:h,newPath:m}),o.current&&N.isSibling(m,h)&&N.isAfter(m,h)&&(o.current=N.next(o.current))}o.unref()}})},hb=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};x.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=N.isPath(s)?cr(t,s):p=>de.isElement(p)&&x.isBlock(t,p)),!r&&Z.isRange(s)&&(s=x.unhangRange(t,s,{voids:a}));var l=x.nodes(t,{at:s,match:o,mode:i,voids:a}),u=Array.from(l,p=>{var[,g]=p;return x.pathRef(t,g)});for(var d of u){var h=d.unref();if(h){var[m]=x.node(t,h);t.apply({type:"remove_node",path:h,node:m})}}}})},mb=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};x.withoutNormalizing(t,()=>{var{match:a,at:i=t.selection,compare:s,merge:o}=r,{hanging:l=!1,mode:u="lowest",split:d=!1,voids:h=!1}=r;if(i){if(a==null&&(a=N.isPath(i)?cr(t,i):q=>de.isElement(q)&&x.isBlock(t,q)),!l&&Z.isRange(i)&&(i=x.unhangRange(t,i,{voids:h})),d&&Z.isRange(i)){if(Z.isCollapsed(i)&&x.leaf(t,i.anchor)[0].text.length>0)return;var m=x.rangeRef(t,i,{affinity:"inward"}),[p,g]=Z.edges(i),f=u==="lowest"?"lowest":"highest",b=x.isEnd(t,g,g.path);J.splitNodes(t,{at:g,match:a,mode:f,voids:h,always:!b});var v=x.isStart(t,p,p.path);J.splitNodes(t,{at:p,match:a,mode:f,voids:h,always:!v}),i=m.unref(),r.at==null&&J.select(t,i)}s||(s=(q,P)=>q!==P);for(var[C,F]of x.nodes(t,{at:i,match:a,mode:u,voids:h})){var _={},w={};if(F.length!==0){var k=!1;for(var j in n)j==="children"||j==="text"||s(n[j],C[j])&&(k=!0,C.hasOwnProperty(j)&&(_[j]=C[j]),o?n[j]!=null&&(w[j]=o(C[j],n[j])):n[j]!=null&&(w[j]=n[j]));k&&t.apply({type:"set_node",path:F,properties:_,newProperties:w})}}}})},pb=(e,t)=>{if(Z.isCollapsed(t))return t.anchor;var[,n]=Z.edges(t),r=x.pointRef(e,n);return J.delete(e,{at:t}),r.unref()},gb=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};x.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)&&x.isBlock(t,ae)),Z.isRange(s)&&(s=pb(t,s)),N.isPath(s)){var u=s,d=x.point(t,u),[h]=x.parent(t,u);i=ae=>ae===h,o=d.path.length-u.length+1,s=d,l=!0}if(s){var m=x.pointRef(t,s,{affinity:"backward"}),p;try{var[g]=x.nodes(t,{at:s,match:i,mode:r,voids:a});if(!g)return;var f=x.void(t,{at:s,mode:"highest"}),b=0;if(!a&&f){var[v,C]=f;if(de.isElement(v)&&t.isInline(v)){var F=x.after(t,C);if(!F){var _={text:""},w=N.next(C);J.insertNodes(t,_,{at:w,voids:a}),F=x.point(t,w)}s=F,l=!0}var k=s.path.length-C.length;o=k+1,l=!0}p=x.pointRef(t,s);var j=s.path.length-o,[,q]=g,P=s.path.slice(0,j),z=o===0?s.offset:s.path[j]+b;for(var[R,A]of x.levels(t,{at:P,reverse:!0,voids:a})){var E=!1;if(A.length<q.length||A.length===0||!a&&de.isElement(R)&&x.isVoid(t,R))break;var S=m.current,O=x.isEnd(t,S,A);if(l||!m||!x.isEdge(t,S,A)){E=!0;var V=ue.extractProps(R);t.apply({type:"split_node",path:A,position:z,properties:V})}z=A[A.length-1]+(E||O?1:0)}if(n.at==null){var H=p.current||x.end(t,[]);J.select(t,H)}}finally{var Q;m.unref(),(Q=p)===null||Q===void 0||Q.unref()}}})},vb=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)},bb=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};x.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=N.isPath(s)?cr(t,s):p=>de.isElement(p)&&x.isBlock(t,p)),N.isPath(s)&&(s=x.range(t,s));var l=Z.isRange(s)?x.rangeRef(t,s):null,u=x.nodes(t,{at:s,match:o,mode:r,voids:i}),d=Array.from(u,p=>{var[,g]=p;return x.pathRef(t,g)}).reverse(),h=function(){var g=m.unref(),[f]=x.node(t,g),b=x.range(t,g);a&&l&&(b=Z.intersection(l.current,b)),J.liftNodes(t,{at:b,match:v=>de.isAncestor(f)&&f.children.includes(v),voids:i})};for(var m of d)h();l&&l.unref()}})};function ml(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 pl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ml(Object(n),!0).forEach(function(r){ft(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ml(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var yb=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};x.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&&(N.isPath(l)?o=cr(t,l):t.isInline(n)?o=b=>de.isElement(b)&&x.isInline(t,b)||fe.isText(b):o=b=>de.isElement(b)&&x.isBlock(t,b)),i&&Z.isRange(l)){var[u,d]=Z.edges(l),h=x.rangeRef(t,l,{affinity:"inward"});J.splitNodes(t,{at:d,match:o,voids:s}),J.splitNodes(t,{at:u,match:o,voids:s}),l=h.unref(),r.at==null&&J.select(t,l)}var m=Array.from(x.nodes(t,{at:l,match:t.isInline(n)?b=>de.isElement(b)&&x.isBlock(t,b):b=>x.isEditor(b),mode:"lowest",voids:s})),p=function(){var v=Z.isRange(l)?Z.intersection(l,x.range(t,f)):l;if(!v)return 0;var C=Array.from(x.nodes(t,{at:v,match:o,mode:a,voids:s}));if(C.length>0){var[F]=C,_=C[C.length-1],[,w]=F,[,k]=_;if(w.length===0&&k.length===0)return 0;var j=N.equals(w,k)?N.parent(w):N.common(w,k),q=x.range(t,w,k),P=x.node(t,j),[z]=P,R=j.length+1,A=N.next(k.slice(0,R)),E=pl(pl({},n),{},{children:[]});J.insertNodes(t,E,{at:A,voids:s}),J.moveNodes(t,{at:q,match:S=>de.isAncestor(z)&&z.children.includes(S),to:A.concat(0),voids:s})}},g;for(var[,f]of m)g=p()}})},xb=()=>{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 Hv(e,...r)},addMark:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Qv(e,...r)},deleteBackward:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return e0(e,...r)},deleteForward:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return t0(e,...r)},deleteFragment:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return n0(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 h0(e,...r)},insertSoftBreak:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return p0(e,...r)},insertFragment:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return eb(e,...r)},insertNode:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return m0(e,...r)},insertText:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return v0(e,...r)},normalizeNode:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Zv(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 Vv(e,...r)},shouldNormalize:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Yv(e,...r)},above:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Gv(e,...r)},after:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Jv(e,...r)},before:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Xv(e,...r)},collapse:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return tb(e,...r)},delete:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return X0(e,...r)},deselect:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return nb(e,...r)},edges:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return r0(e,...r)},elementReadOnly:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return a0(e,...r)},end:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return i0(e,...r)},first:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return s0(e,...r)},fragment:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return o0(e,...r)},getMarks:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return A0(e,...r)},hasBlocks:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return l0(e,...r)},hasInlines:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return c0(e,...r)},hasPath:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return d0(e,...r)},hasTexts:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return f0(e,...r)},insertNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return ob(e,...r)},isBlock:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return b0(e,...r)},isEdge:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return y0(e,...r)},isEmpty:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return x0(e,...r)},isEnd:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return D0(e,...r)},isNormalizing:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return C0(e,...r)},isStart:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return w0(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 _0(e,...r)},levels:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return k0(e,...r)},liftNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return ub(e,...r)},mergeNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return db(e,...r)},move:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return rb(e,...r)},moveNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return fb(e,...r)},next:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return T0(e,...r)},node:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return S0(e,...r)},nodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return j0(e,...r)},normalize:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return O0(e,...r)},parent:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return P0(e,...r)},path:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return R0(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 N0(e,...r)},point:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return L0(e,...r)},pointRef:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return I0(e,...r)},pointRefs:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return $0(e,...r)},positions:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return z0(e,...r)},previous:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return q0(e,...r)},range:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return H0(e,...r)},rangeRef:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return W0(e,...r)},rangeRefs:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return U0(e,...r)},removeNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return hb(e,...r)},select:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return ab(e,...r)},setNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return mb(e,...r)},setNormalizing:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Z0(e,...r)},setPoint:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return ib(e,...r)},setSelection:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return sb(e,...r)},splitNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return gb(e,...r)},start:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Y0(e,...r)},string:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return G0(e,...r)},unhangRange:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Q0(e,...r)},unsetNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return vb(e,...r)},unwrapNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return bb(e,...r)},void:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return u0(e,...r)},withoutNormalizing:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return J0(e,...r)},wrapNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return yb(e,...r)}};return e},Db={isHistory(e){return rt(e)&&Array.isArray(e.redos)&&Array.isArray(e.undos)&&(e.redos.length===0||dn.isOperationList(e.redos[0].operations))&&(e.undos.length===0||dn.isOperationList(e.undos[0].operations))}},Mi=new WeakMap,Ni=new WeakMap,Kn={isHistoryEditor(e){return Db.isHistory(e.history)&&x.isEditor(e)},isMerging(e){return Ni.get(e)},isSaving(e){return Mi.get(e)},redo(e){e.redo()},undo(e){e.undo()},withoutMerging(e,t){var n=Kn.isMerging(e);Ni.set(e,!1),t(),Ni.set(e,n)},withoutSaving(e,t){var n=Kn.isSaving(e);Mi.set(e,!1),t(),Mi.set(e,n)}},Cb=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),Kn.withoutSaving(t,()=>{x.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];Kn.withoutSaving(t,()=>{x.withoutNormalizing(t,()=>{var s=i.operations.map(dn.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=Kn.isSaving(t),d=Kn.isMerging(t);if(u==null&&(u=Eb(r)),u){if(d==null&&(o==null?d=!1:a.length!==0?d=!0:d=wb(r,l)),o&&d)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},wb=(e,t)=>!!(t&&e.type==="insert_text"&&t.type==="insert_text"&&e.offset===t.offset+t.text.length&&N.equals(e.path,t.path)||t&&e.type==="remove_text"&&t.type==="remove_text"&&e.offset+e.text.length===t.offset&&N.equals(e.path,t.path)),Eb=(e,t)=>e.type!=="set_selection",_b=Bb,af="֑-߿יִ-﷽ﹰ-ﻼ",sf="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",kb=new RegExp("^[^"+sf+"]*["+af+"]"),Fb=new RegExp("^[^"+af+"]*["+sf+"]");function Bb(e){return e=String(e||""),kb.test(e)?"rtl":Fb.test(e)?"ltr":"neutral"}const of=On(_b);function Ab(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Co=Ab,Tb=typeof Qr=="object"&&Qr&&Qr.Object===Object&&Qr,Sb=Tb,jb=Sb,Ob=typeof self=="object"&&self&&self.Object===Object&&self,Pb=jb||Ob||Function("return this")(),uf=Pb,Mb=uf,Nb=function(){return Mb.Date.now()},Rb=Nb,Ib=/\s/;function $b(e){for(var t=e.length;t--&&Ib.test(e.charAt(t)););return t}var Lb=$b,zb=Lb,qb=/^\s+/;function Wb(e){return e&&e.slice(0,zb(e)+1).replace(qb,"")}var Ub=Wb,Hb=uf,Vb=Hb.Symbol,lf=Vb,gl=lf,cf=Object.prototype,Kb=cf.hasOwnProperty,Zb=cf.toString,xr=gl?gl.toStringTag:void 0;function Yb(e){var t=Kb.call(e,xr),n=e[xr];try{e[xr]=void 0;var r=!0}catch{}var a=Zb.call(e);return r&&(t?e[xr]=n:delete e[xr]),a}var Gb=Yb,Qb=Object.prototype,Jb=Qb.toString;function Xb(e){return Jb.call(e)}var ey=Xb,vl=lf,ty=Gb,ny=ey,ry="[object Null]",ay="[object Undefined]",bl=vl?vl.toStringTag:void 0;function iy(e){return e==null?e===void 0?ay:ry:bl&&bl in Object(e)?ty(e):ny(e)}var sy=iy;function oy(e){return e!=null&&typeof e=="object"}var uy=oy,ly=sy,cy=uy,dy="[object Symbol]";function fy(e){return typeof e=="symbol"||cy(e)&&ly(e)==dy}var hy=fy,my=Ub,yl=Co,py=hy,xl=0/0,gy=/^[-+]0x[0-9a-f]+$/i,vy=/^0b[01]+$/i,by=/^0o[0-7]+$/i,yy=parseInt;function xy(e){if(typeof e=="number")return e;if(py(e))return xl;if(yl(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=yl(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=my(e);var n=vy.test(e);return n||by.test(e)?yy(e.slice(2),n?2:8):gy.test(e)?xl:+e}var Dy=xy,Cy=Co,Ri=Rb,Dl=Dy,wy="Expected a function",Ey=Math.max,_y=Math.min;function ky(e,t,n){var r,a,i,s,o,l,u=0,d=!1,h=!1,m=!0;if(typeof e!="function")throw new TypeError(wy);t=Dl(t)||0,Cy(n)&&(d=!!n.leading,h="maxWait"in n,i=h?Ey(Dl(n.maxWait)||0,t):i,m="trailing"in n?!!n.trailing:m);function p(k){var j=r,q=a;return r=a=void 0,u=k,s=e.apply(q,j),s}function g(k){return u=k,o=setTimeout(v,t),d?p(k):s}function f(k){var j=k-l,q=k-u,P=t-j;return h?_y(P,i-q):P}function b(k){var j=k-l,q=k-u;return l===void 0||j>=t||j<0||h&&q>=i}function v(){var k=Ri();if(b(k))return C(k);o=setTimeout(v,f(k))}function C(k){return o=void 0,m&&r?p(k):(r=a=void 0,s)}function F(){o!==void 0&&clearTimeout(o),u=0,r=l=a=o=void 0}function _(){return o===void 0?s:C(Ri())}function w(){var k=Ri(),j=b(k);if(r=arguments,a=this,l=k,j){if(o===void 0)return g(l);if(h)return clearTimeout(o),o=setTimeout(v,t),p(l)}return o===void 0&&(o=setTimeout(v,t)),s}return w.cancel=F,w.flush=_,w}var df=ky;const Fy=On(df);var By=df,Ay=Co,Ty="Expected a function";function Sy(e,t,n){var r=!0,a=!0;if(typeof e!="function")throw new TypeError(Ty);return Ay(n)&&(r="leading"in n?!!n.leading:r,a="trailing"in n?!!n.trailing:a),By(e,t,{leading:r,maxWait:t,trailing:a})}var jy=Sy;const Oy=On(jy),Cl=e=>typeof e=="object"&&e!=null&&e.nodeType===1,wl=(e,t)=>(!t||e!=="hidden")&&e!=="visible"&&e!=="clip",Ii=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const n=getComputedStyle(e,null);return wl(n.overflowY,t)||wl(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},ua=(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,Py=e=>{const t=e.parentElement;return t??(e.getRootNode().host||null)},El=(e,t)=>{var n,r,a,i;if(typeof document>"u")return[];const{scrollMode:s,block:o,inline:l,boundary:u,skipOverflowHiddenElements:d}=t,h=typeof u=="function"?u:V=>V!==u;if(!Cl(e))throw new TypeError("Invalid target");const m=document.scrollingElement||document.documentElement,p=[];let g=e;for(;Cl(g)&&h(g);){if(g=Py(g),g===m){p.push(g);break}g!=null&&g===document.body&&Ii(g)&&!Ii(document.documentElement)||g!=null&&Ii(g,d)&&p.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:C}=window,{height:F,width:_,top:w,right:k,bottom:j,left:q}=e.getBoundingClientRect(),{top:P,right:z,bottom:R,left:A}=(V=>{const H=window.getComputedStyle(V);return{top:parseFloat(H.scrollMarginTop)||0,right:parseFloat(H.scrollMarginRight)||0,bottom:parseFloat(H.scrollMarginBottom)||0,left:parseFloat(H.scrollMarginLeft)||0}})(e);let E=o==="start"||o==="nearest"?w-P:o==="end"?j+R:w+F/2-P+R,S=l==="center"?q+_/2-A+z:l==="end"?k+z:q-A;const O=[];for(let V=0;V<p.length;V++){const H=p[V],{height:Q,width:ae,top:D,right:$,bottom:ee,left:B}=H.getBoundingClientRect();if(s==="if-needed"&&w>=0&&q>=0&&j<=b&&k<=f&&w>=D&&j<=ee&&q>=B&&k<=$)return O;const T=getComputedStyle(H),L=parseInt(T.borderLeftWidth,10),I=parseInt(T.borderTopWidth,10),W=parseInt(T.borderRightWidth,10),U=parseInt(T.borderBottomWidth,10);let ne=0,re=0;const le="offsetWidth"in H?H.offsetWidth-H.clientWidth-L-W:0,X="offsetHeight"in H?H.offsetHeight-H.clientHeight-I-U:0,pe="offsetWidth"in H?H.offsetWidth===0?0:ae/H.offsetWidth:0,me="offsetHeight"in H?H.offsetHeight===0?0:Q/H.offsetHeight:0;if(m===H)ne=o==="start"?E:o==="end"?E-b:o==="nearest"?ua(C,C+b,b,I,U,C+E,C+E+F,F):E-b/2,re=l==="start"?S:l==="center"?S-f/2:l==="end"?S-f:ua(v,v+f,f,L,W,v+S,v+S+_,_),ne=Math.max(0,ne+C),re=Math.max(0,re+v);else{ne=o==="start"?E-D-I:o==="end"?E-ee+U+X:o==="nearest"?ua(D,ee,Q,I,U+X,E,E+F,F):E-(D+Q/2)+X/2,re=l==="start"?S-B-L:l==="center"?S-(B+ae/2)+le/2:l==="end"?S-$+W+le:ua(B,$,ae,L,W+le,S,S+_,_);const{scrollLeft:_e,scrollTop:Be}=H;ne=me===0?0:Math.max(0,Math.min(Be+ne/me,H.scrollHeight-Q/me+X)),re=pe===0?0:Math.max(0,Math.min(_e+re/pe,H.scrollWidth-ae/pe+le)),E+=Be-ne,S+=_e-re}O.push({el:H,top:ne,left:re})}return O},My=e=>e===!1?{block:"end",inline:"nearest"}:(t=>t===Object(t)&&Object.keys(t).length!==0)(e)?e:{block:"start",inline:"nearest"};function Ny(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(El(e,t));const r=typeof t=="boolean"||t==null?void 0:t.behavior;for(const{el:a,top:i,left:s}of El(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 _n=[],Ry=function(){return _n.some(function(e){return e.activeTargets.length>0})},Iy=function(){return _n.some(function(e){return e.skippedTargets.length>0})},_l="ResizeObserver loop completed with undelivered notifications.",$y=function(){var e;typeof ErrorEvent=="function"?e=new ErrorEvent("error",{message:_l}):(e=document.createEvent("Event"),e.initEvent("error",!1,!1),e.message=_l),window.dispatchEvent(e)},Lr;(function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(Lr||(Lr={}));var kn=function(e){return Object.freeze(e)},Ly=function(){function e(t,n){this.inlineSize=t,this.blockSize=n,kn(this)}return e}(),ff=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,kn(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}(),wo=function(e){return e instanceof SVGElement&&"getBBox"in e},hf=function(e){if(wo(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)},kl=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)},zy=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},Fr=typeof window<"u"?window:{},la=new WeakMap,Fl=/auto|scroll/,qy=/^tb|vertical/,Wy=/msie|trident/i.test(Fr.navigator&&Fr.navigator.userAgent),Rt=function(e){return parseFloat(e||"0")},Qn=function(e,t,n){return e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=!1),new Ly((n?t:e)||0,(n?e:t)||0)},Bl=kn({devicePixelContentBoxSize:Qn(),borderBoxSize:Qn(),contentBoxSize:Qn(),contentRect:new ff(0,0,0,0)}),mf=function(e,t){if(t===void 0&&(t=!1),la.has(e)&&!t)return la.get(e);if(hf(e))return la.set(e,Bl),Bl;var n=getComputedStyle(e),r=wo(e)&&e.ownerSVGElement&&e.getBBox(),a=!Wy&&n.boxSizing==="border-box",i=qy.test(n.writingMode||""),s=!r&&Fl.test(n.overflowY||""),o=!r&&Fl.test(n.overflowX||""),l=r?0:Rt(n.paddingTop),u=r?0:Rt(n.paddingRight),d=r?0:Rt(n.paddingBottom),h=r?0:Rt(n.paddingLeft),m=r?0:Rt(n.borderTopWidth),p=r?0:Rt(n.borderRightWidth),g=r?0:Rt(n.borderBottomWidth),f=r?0:Rt(n.borderLeftWidth),b=h+u,v=l+d,C=f+p,F=m+g,_=o?e.offsetHeight-F-e.clientHeight:0,w=s?e.offsetWidth-C-e.clientWidth:0,k=a?b+C:0,j=a?v+F:0,q=r?r.width:Rt(n.width)-k-w,P=r?r.height:Rt(n.height)-j-_,z=q+b+w+C,R=P+v+_+F,A=kn({devicePixelContentBoxSize:Qn(Math.round(q*devicePixelRatio),Math.round(P*devicePixelRatio),i),borderBoxSize:Qn(z,R,i),contentBoxSize:Qn(q,P,i),contentRect:new ff(h,l,q,P)});return la.set(e,A),A},pf=function(e,t,n){var r=mf(e,n),a=r.borderBoxSize,i=r.contentBoxSize,s=r.devicePixelContentBoxSize;switch(t){case Lr.DEVICE_PIXEL_CONTENT_BOX:return s;case Lr.BORDER_BOX:return a;default:return i}},Uy=function(){function e(t){var n=mf(t);this.target=t,this.contentRect=n.contentRect,this.borderBoxSize=kn([n.borderBoxSize]),this.contentBoxSize=kn([n.contentBoxSize]),this.devicePixelContentBoxSize=kn([n.devicePixelContentBoxSize])}return e}(),gf=function(e){if(hf(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},Hy=function(){var e=1/0,t=[];_n.forEach(function(s){if(s.activeTargets.length!==0){var o=[];s.activeTargets.forEach(function(u){var d=new Uy(u.target),h=gf(u.target);o.push(d),u.lastReportedSize=pf(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},Al=function(e){_n.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(a){a.isActive()&&(gf(a.target)>e?n.activeTargets.push(a):n.skippedTargets.push(a))})})},Vy=function(){var e=0;for(Al(e);Ry();)e=Hy(),Al(e);return Iy()&&$y(),e>0},$i,vf=[],Ky=function(){return vf.splice(0).forEach(function(e){return e()})},Zy=function(e){if(!$i){var t=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return Ky()}).observe(n,r),$i=function(){n.textContent="".concat(t?t--:t++)}}vf.push(e),$i()},Yy=function(e){Zy(function(){requestAnimationFrame(e)})},_a=0,Gy=function(){return!!_a},Qy=250,Jy={attributes:!0,characterData:!0,childList:!0,subtree:!0},Tl=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Sl=function(e){return e===void 0&&(e=0),Date.now()+e},Li=!1,Xy=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=Qy),!Li){Li=!0;var r=Sl(t);Yy(function(){var a=!1;try{a=Vy()}finally{if(Li=!1,t=r-Sl(),!Gy())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,Jy)};document.body?n():Fr.addEventListener("DOMContentLoaded",n)},e.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Tl.forEach(function(n){return Fr.addEventListener(n,t.listener,!0)}))},e.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),Tl.forEach(function(n){return Fr.removeEventListener(n,t.listener,!0)}),this.stopped=!0)},e}(),Os=new Xy,jl=function(e){!_a&&e>0&&Os.start(),_a+=e,!_a&&Os.stop()},e1=function(e){return!wo(e)&&!zy(e)&&getComputedStyle(e).display==="inline"},t1=function(){function e(t,n){this.target=t,this.observedBox=n||Lr.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var t=pf(this.target,this.observedBox,!0);return e1(this.target)&&(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),n1=function(){function e(t,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=n}return e}(),ca=new WeakMap,Ol=function(e,t){for(var n=0;n<e.length;n+=1)if(e[n].target===t)return n;return-1},da=function(){function e(){}return e.connect=function(t,n){var r=new n1(t,n);ca.set(t,r)},e.observe=function(t,n,r){var a=ca.get(t),i=a.observationTargets.length===0;Ol(a.observationTargets,n)<0&&(i&&_n.push(a),a.observationTargets.push(new t1(n,r&&r.box)),jl(1),Os.schedule())},e.unobserve=function(t,n){var r=ca.get(t),a=Ol(r.observationTargets,n),i=r.observationTargets.length===1;a>=0&&(i&&_n.splice(_n.indexOf(r),1),r.observationTargets.splice(a,1),jl(-1))},e.disconnect=function(t){var n=this,r=ca.get(t);r.observationTargets.slice().forEach(function(a){return n.unobserve(t,a.target)}),r.activeTargets.splice(0,r.activeTargets.length)},e}(),r1=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.");da.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(!kl(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");da.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(!kl(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");da.unobserve(this,t)},e.prototype.disconnect=function(){da.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}(),rn={};Object.defineProperty(rn,"__esModule",{value:!0});var a1=typeof window<"u"&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),zi={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},bf={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:a1?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},Eo={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 fa=1;fa<20;fa++)Eo["f"+fa]=111+fa;function li(e,t,n){t&&!("byKey"in t)&&(n=t,t=null),Array.isArray(e)||(e=[e]);var r=e.map(function(s){return yf(s,t)}),a=function(o){return r.some(function(l){return xf(l,o)})},i=n==null?a:a(n);return i}function i1(e,t){return li(e,t)}function s1(e,t){return li(e,{byKey:!0},t)}function yf(e,t){var n=t&&t.byKey,r={};e=e.replace("++","+add");var a=e.split("+"),i=a.length;for(var s in zi)r[zi[s]]=!1;var o=!0,l=!1,u=void 0;try{for(var d=a[Symbol.iterator](),h;!(o=(h=d.next()).done);o=!0){var m=h.value,p=m.endsWith("?")&&m.length>1;p&&(m=m.slice(0,-1));var g=_o(m),f=zi[g];if(m.length>1&&!f&&!bf[m]&&!Eo[g])throw new TypeError('Unknown modifier: "'+m+'"');(i===1||!f)&&(n?r.key=g:r.which=Df(m)),f&&(r[f]=p?null:!0)}}catch(b){l=!0,u=b}finally{try{!o&&d.return&&d.return()}finally{if(l)throw u}}return r}function xf(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=_o(e);var t=Eo[e]||e.toUpperCase().charCodeAt(0);return t}function _o(e){return e=e.toLowerCase(),e=bf[e]||e,e}var o1=rn.default=li,qi=rn.isHotkey=li;rn.isCodeHotkey=i1;rn.isKeyHotkey=s1;rn.parseHotkey=yf;rn.compareHotkey=xf;rn.toKeyCode=Df;rn.toKeyName=_o;function u1(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 rr(e,t){if(e==null)return{};var n=u1(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 zr(e){"@babel/helpers - typeof";return zr=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},zr(e)}function l1(e,t){if(zr(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(zr(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function c1(e){var t=l1(e,"string");return zr(t)==="symbol"?t:String(t)}function Tt(e,t,n){return t=c1(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ko=y.createContext(null),vn=()=>{var e=y.useContext(ko);if(!e)throw new Error("The `useSlateStatic` hook must be used inside the <Slate> component's context.");return e},Cf=parseInt(y.version.split(".")[0],10),d1=typeof navigator<"u"&&typeof window<"u"&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Pl=typeof navigator<"u"&&/Mac OS X/.test(navigator.userAgent),dt=typeof navigator<"u"&&/Android/.test(navigator.userAgent),Zn=typeof navigator<"u"&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Er=typeof navigator<"u"&&/AppleWebKit(?!.*Chrome)/i.test(navigator.userAgent),f1=typeof navigator<"u"&&/Edge?\/(?:[0-6][0-9]|[0-7][0-8])(?:\.)/i.test(navigator.userAgent),wf=typeof navigator<"u"&&/Chrome/i.test(navigator.userAgent),h1=typeof navigator<"u"&&/Chrome?\/(?:[0-7][0-5]|[0-6][0-9])(?:\.)/i.test(navigator.userAgent),m1=dt&&typeof navigator<"u"&&/Chrome?\/(?:[0-5]?\d)(?:\.)/i.test(navigator.userAgent),p1=typeof navigator<"u"&&/^(?!.*Seamonkey)(?=.*Firefox\/(?:[0-7][0-9]|[0-8][0-6])(?:\.)).*/i.test(navigator.userAgent),g1=typeof navigator<"u"&&/.*UCBrowser/.test(navigator.userAgent),v1=typeof navigator<"u"&&/.*Wechat/.test(navigator.userAgent)&&!/.*MacWechat/.test(navigator.userAgent),ka=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",sn=(!h1||!m1)&&!f1&&typeof globalThis<"u"&&globalThis.InputEvent&&typeof globalThis.InputEvent.prototype.getTargetRanges=="function",Fo=new WeakMap,Bo=new WeakMap,Ef=new WeakMap,Fa=new WeakMap,Ps=new WeakMap,qr=new WeakMap,Fn=new WeakMap,Wa=new WeakMap,ci=new WeakMap,Ms=new WeakMap,fn=new WeakMap,wn=new WeakMap,Br=new WeakMap,Ns=new WeakMap,Ao=new WeakMap,Ot=new WeakMap,Gt=new WeakMap,pt=new WeakMap,un=new WeakMap,ln=new WeakMap,_f=new WeakMap,ar=Symbol("placeholder"),kf=Symbol("mark-placeholder"),b1=globalThis.Text,To=e=>e&&e.ownerDocument&&e.ownerDocument.defaultView||null,y1=e=>hn(e)&&e.nodeType===8,At=e=>hn(e)&&e.nodeType===1,hn=e=>{var t=To(e);return!!t&&e instanceof t.Node},Rs=e=>{var t=e&&e.anchorNode&&To(e.anchorNode);return!!t&&e instanceof t.Selection},Ff=e=>hn(e)&&e.nodeType===3,x1=e=>e.clipboardData&&e.clipboardData.getData("text/plain")!==""&&e.clipboardData.types.length===1,D1=e=>{var[t,n]=e;if(At(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;At(t)&&t.childNodes.length;){var i=r?t.childNodes.length-1:0;t=w1(t,i,r?"backward":"forward")}n=r&&t.textContent!=null?t.textContent.length:0}return[t,n]},C1=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;(y1(a)||At(a)&&a.childNodes.length===0||At(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]},w1=(e,t,n)=>{var[r]=Bf(e,t,n);return r},Af=e=>{var t="";if(Ff(e)&&e.nodeValue)return e.nodeValue;if(At(e)){for(var n of Array.from(e.childNodes))t+=Af(n);var r=getComputedStyle(e).getPropertyValue("display");(r==="block"||r==="list"||e.tagName==="BR")&&(t+=`
129
+ */function Su(e){return Object.prototype.toString.call(e)==="[object Object]"}function rt(e){var t,n;return Su(e)===!1?!1:(t=e.constructor,t===void 0?!0:(n=t.prototype,!(Su(n)===!1||n.hasOwnProperty("isPrototypeOf")===!1)))}var Zd=Symbol.for("immer-nothing"),ju=Symbol.for("immer-draftable"),Ct=Symbol.for("immer-state"),Ug=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 gt(e,...t){if(process.env.NODE_ENV!=="production"){const n=Ug[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 nr=Object.getPrototypeOf;function Tn(e){return!!e&&!!e[Ct]}function Sn(e){var t;return e?Yd(e)||Array.isArray(e)||!!e[ju]||!!((t=e.constructor)!=null&&t[ju])||si(e)||oi(e):!1}var Hg=Object.prototype.constructor.toString();function Yd(e){if(!e||typeof e!="object")return!1;const t=nr(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)===Hg}function Ia(e,t){ii(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function ii(e){const t=e[Ct];return t?t.type_:Array.isArray(e)?1:si(e)?2:oi(e)?3:0}function Fs(e,t){return ii(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Gd(e,t,n){const r=ii(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function Vg(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function si(e){return e instanceof Map}function oi(e){return e instanceof Set}function Dn(e){return e.copy_||e.base_}function Bs(e,t){if(si(e))return new Map(e);if(oi(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=Yd(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[Ct];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(nr(e),r)}else{const r=nr(e);if(r!==null&&n)return{...e};const a=Object.create(r);return Object.assign(a,e)}}function go(e,t=!1){return ui(e)||Tn(e)||!Sn(e)||(ii(e)>1&&(e.set=e.add=e.clear=e.delete=Kg),Object.freeze(e),t&&Object.entries(e).forEach(([n,r])=>go(r,!0))),e}function Kg(){gt(2)}function ui(e){return Object.isFrozen(e)}var Zg={};function jn(e){const t=Zg[e];return t||gt(0,e),t}var Rr;function Qd(){return Rr}function Yg(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Ou(e,t){t&&(jn("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function As(e){Ts(e),e.drafts_.forEach(Gg),e.drafts_=null}function Ts(e){e===Rr&&(Rr=e.parent_)}function Pu(e){return Rr=Yg(Rr,e)}function Gg(e){const t=e[Ct];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Mu(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Ct].modified_&&(As(t),gt(4)),Sn(e)&&(e=$a(t,e),t.parent_||La(t,e)),t.patches_&&jn("Patches").generateReplacementPatches_(n[Ct].base_,e,t.patches_,t.inversePatches_)):e=$a(t,n,[]),As(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Zd?e:void 0}function $a(e,t,n){if(ui(t))return t;const r=t[Ct];if(!r)return Ia(t,(a,i)=>Nu(e,r,t,a,i,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return La(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),Ia(i,(o,l)=>Nu(e,r,a,o,l,n,s)),La(e,a,!1),n&&e.patches_&&jn("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function Nu(e,t,n,r,a,i,s){if(process.env.NODE_ENV!=="production"&&a===n&&gt(5),Tn(a)){const o=i&&t&&t.type_!==3&&!Fs(t.assigned_,r)?i.concat(r):void 0,l=$a(e,a,o);if(Gd(n,r,l),Tn(l))e.canAutoFreeze_=!1;else return}else s&&n.add(a);if(Sn(a)&&!ui(a)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;$a(e,a),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,r)&&La(e,a)}}function La(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&go(t,n)}function Qg(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=vo;n&&(a=[r],i=Ir);const{revoke:s,proxy:o}=Proxy.revocable(a,i);return r.draft_=o,r.revoke_=s,o}var vo={get(e,t){if(t===Ct)return e;const n=Dn(e);if(!Fs(n,t))return Jg(e,n,t);const r=n[t];return e.finalized_||!Sn(r)?r:r===Oi(e.base_,t)?(Pi(e),e.copy_[t]=js(r,e)):r},has(e,t){return t in Dn(e)},ownKeys(e){return Reflect.ownKeys(Dn(e))},set(e,t,n){const r=Jd(Dn(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const a=Oi(Dn(e),t),i=a==null?void 0:a[Ct];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(Vg(n,a)&&(n!==void 0||Fs(e.base_,t)))return!0;Pi(e),Ss(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 Oi(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Pi(e),Ss(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Dn(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){gt(11)},getPrototypeOf(e){return nr(e.base_)},setPrototypeOf(){gt(12)}},Ir={};Ia(vo,(e,t)=>{Ir[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Ir.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&gt(13),Ir.set.call(this,e,t,void 0)};Ir.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&gt(14),vo.set.call(this,e[0],t,n,e[0])};function Oi(e,t){const n=e[Ct];return(n?Dn(n):e)[t]}function Jg(e,t,n){var a;const r=Jd(t,n);return r?"value"in r?r.value:(a=r.get)==null?void 0:a.call(e.draft_):void 0}function Jd(e,t){if(!(t in e))return;let n=nr(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=nr(n)}}function Ss(e){e.modified_||(e.modified_=!0,e.parent_&&Ss(e.parent_))}function Pi(e){e.copy_||(e.copy_=Bs(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Xg=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,d=>n.call(this,d,...u))}}typeof n!="function"&&gt(6),r!==void 0&&typeof r!="function"&&gt(7);let a;if(Sn(t)){const i=Pu(this),s=js(t,void 0);let o=!0;try{a=n(s),o=!1}finally{o?As(i):Ts(i)}return Ou(i,r),Mu(a,i)}else if(!t||typeof t!="object"){if(a=n(t),a===void 0&&(a=t),a===Zd&&(a=void 0),this.autoFreeze_&&go(a,!0),r){const i=[],s=[];jn("Patches").generateReplacementPatches_(t,a,i,s),r(i,s)}return a}else gt(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){Sn(e)||gt(8),Tn(e)&&(e=ev(e));const t=Pu(this),n=js(e,void 0);return n[Ct].isManual_=!0,Ts(t),n}finishDraft(e,t){const n=e&&e[Ct];(!n||!n.isManual_)&&gt(9);const{scope_:r}=n;return Ou(r,t),Mu(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=jn("Patches").applyPatches_;return Tn(e)?r(e,t):this.produce(e,a=>r(a,t))}};function js(e,t){const n=si(e)?jn("MapSet").proxyMap_(e,t):oi(e)?jn("MapSet").proxySet_(e,t):Qg(e,t);return(t?t.scope_:Qd()).drafts_.push(n),n}function ev(e){return Tn(e)||gt(10,e),Xd(e)}function Xd(e){if(!Sn(e)||ui(e))return e;const t=e[Ct];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Bs(e,t.scope_.immer_.useStrictShallowCopy_)}else n=Bs(e,!0);return Ia(n,(r,a)=>{Gd(n,r,Xd(a))}),t&&(t.finalized_=!1),n}var wt=new Xg,bo=wt.produce;wt.produceWithPatches.bind(wt);wt.setAutoFreeze.bind(wt);wt.setUseStrictShallowCopy.bind(wt);wt.applyPatches.bind(wt);var Ru=wt.createDraft.bind(wt),Iu=wt.finishDraft.bind(wt),tv={transform(e,t){var{current:n,affinity:r}=e;if(n!=null){var a=N.transform(n,t,{affinity:r});e.current=a,a==null&&e.unref()}}},nv={transform(e,t){var{current:n,affinity:r}=e;if(n!=null){var a=ke.transform(n,t,{affinity:r});e.current=a,a==null&&e.unref()}}},rv={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()}}},za=new WeakMap,qa=new WeakMap,kr=new WeakMap,ef=new WeakMap,$u=new WeakMap,Lu=new WeakMap,zu=new WeakMap,N={ancestors(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{reverse:n=!1}=t,r=N.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 N.equals(r,a)&&i>s},endsAt(e,t){var n=e.length,r=e.slice(0,n),a=t.slice(0,n);return N.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 N.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 N.compare(e,t)===1},isAncestor(e,t){return e.length<t.length&&N.compare(e,t)===0},isBefore(e,t){return N.compare(e,t)===-1},isChild(e,t){return e.length===t.length+1&&N.compare(e,t)===0},isCommon(e,t){return e.length<=t.length&&N.compare(e,t)===0},isDescendant(e,t){return e.length>t.length&&N.compare(e,t)===0},isParent(e,t){return e.length+1===t.length&&N.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&&N.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(!N.isAncestor(t,e)&&!N.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;(N.equals(i,r)||N.endsBefore(i,r)||N.isAncestor(i,r))&&(r[i.length-1]+=1);break}case"remove_node":{var{path:s}=t;if(N.equals(s,r)||N.isAncestor(s,r))return null;N.endsBefore(s,r)&&(r[s.length-1]-=1);break}case"merge_node":{var{path:o,position:l}=t;N.equals(o,r)||N.endsBefore(o,r)?r[o.length-1]-=1:N.isAncestor(o,r)&&(r[o.length-1]-=1,r[o.length]+=l);break}case"split_node":{var{path:u,position:d}=t;if(N.equals(u,r)){if(a==="forward")r[r.length-1]+=1;else if(a!=="backward")return null}else N.endsBefore(u,r)?r[u.length-1]+=1:N.isAncestor(u,r)&&e[u.length]>=d&&(r[u.length-1]+=1,r[u.length]-=d);break}case"move_node":{var{path:h,newPath:m}=t;if(N.equals(h,m))return r;if(N.isAncestor(h,r)||N.equals(h,r)){var p=m.slice();return N.endsBefore(h,m)&&h.length<m.length&&(p[h.length-1]-=1),p.concat(r.slice(h.length))}else N.isSibling(h,m)&&(N.isAncestor(m,r)||N.equals(m,r))?N.endsBefore(h,r)?r[h.length-1]-=1:r[h.length-1]+=1:N.endsBefore(m,r)||N.equals(m,r)||N.isAncestor(m,r)?(N.endsBefore(h,r)&&(r[h.length-1]-=1),r[m.length-1]+=1):N.endsBefore(h,r)&&(N.equals(m,r)&&(r[m.length-1]+=1),r[h.length-1]-=1);break}}return r}};function $r(e){"@babel/helpers - typeof";return $r=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},$r(e)}function av(e,t){if($r(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if($r(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function iv(e){var t=av(e,"string");return $r(t)==="symbol"?t:String(t)}function ft(e,t,n){return t=iv(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}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 yr(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){ft(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 sv=(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]=ke.transform(o,n);break}case"insert_text":{var{path:u,offset:d,text:h}=n;if(h.length===0)break;var m=ue.leaf(e,u),p=m.text.slice(0,d),g=m.text.slice(d);if(m.text=p+h+g,t)for(var[f,b]of Z.points(t))t[b]=ke.transform(f,n);break}case"merge_node":{var{path:v}=n,C=ue.get(e,v),F=N.previous(v),_=ue.get(e,F),w=ue.parent(e,v),k=v[v.length-1];if(fe.isText(C)&&fe.isText(_))_.text+=C.text;else if(!fe.isText(C)&&!fe.isText(_))_.children.push(...C.children);else throw new Error('Cannot apply a "merge_node" operation at path ['.concat(v,"] to nodes of different interfaces: ").concat(nt.stringify(C)," ").concat(nt.stringify(_)));if(w.children.splice(k,1),t)for(var[j,q]of Z.points(t))t[q]=ke.transform(j,n);break}case"move_node":{var{path:P,newPath:z}=n;if(N.isAncestor(P,z))throw new Error("Cannot move a path [".concat(P,"] to new path [").concat(z,"] because the destination is inside itself."));var R=ue.get(e,P),A=ue.parent(e,P),E=P[P.length-1];A.children.splice(E,1);var S=N.transform(P,n),O=ue.get(e,N.parent(S)),V=S[S.length-1];if(O.children.splice(V,0,R),t)for(var[H,Q]of Z.points(t))t[Q]=ke.transform(H,n);break}case"remove_node":{var{path:ae}=n,D=ae[ae.length-1],$=ue.parent(e,ae);if($.children.splice(D,1),t)for(var[X,B]of Z.points(t)){var T=ke.transform(X,n);if(t!=null&&T!=null)t[B]=T;else{var L=void 0,I=void 0;for(var[W,U]of ue.texts(e))if(N.compare(U,ae)===-1)L=[W,U];else{I=[W,U];break}var ne=!1;L&&I&&(N.equals(I[1],ae)?ne=!N.hasPrevious(I[1]):ne=N.common(L[1],ae).length<N.common(I[1],ae).length),L&&!ne?(X.path=L[1],X.offset=L[0].text.length):I?(X.path=I[1],X.offset=0):t=null}}break}case"remove_text":{var{path:re,offset:le,text:ee}=n;if(ee.length===0)break;var pe=ue.leaf(e,re),me=pe.text.slice(0,le),_e=pe.text.slice(le+ee.length);if(pe.text=me+_e,t)for(var[Be,Se]of Z.points(t))t[Se]=ke.transform(Be,n);break}case"set_node":{var{path:Ye,properties:Ke,newProperties:je}=n;if(Ye.length===0)throw new Error("Cannot set properties on the root node!");var Oe=ue.get(e,Ye);for(var De in je){if(De==="children"||De==="text")throw new Error('Cannot set the "'.concat(De,'" property of nodes!'));var Le=je[De];Le==null?delete Oe[De]:Oe[De]=Le}for(var Ue in Ke)je.hasOwnProperty(Ue)||delete Oe[Ue];break}case"set_selection":{var{newProperties:G}=n;if(G==null)t=G;else{if(t==null){if(!Z.isRange(G))throw new Error('Cannot apply an incomplete "set_selection" operation properties '.concat(nt.stringify(G)," when there is no current selection."));t=yr({},G)}for(var oe in G){var he=G[oe];if(he==null){if(oe==="anchor"||oe==="focus")throw new Error('Cannot remove the "'.concat(oe,'" selection property'));delete t[oe]}else t[oe]=he}}break}case"split_node":{var{path:ge,position:Ee,properties:be}=n;if(ge.length===0)throw new Error('Cannot apply a "split_node" operation at path ['.concat(ge,"] because the root node cannot be split."));var we=ue.get(e,ge),et=ue.parent(e,ge),Et=ge[ge.length-1],ht;if(fe.isText(we)){var Qe=we.text.slice(0,Ee),yt=we.text.slice(Ee);we.text=Qe,ht=yr(yr({},be),{},{text:yt})}else{var xt=we.children.slice(0,Ee),pi=we.children.slice(Ee);we.children=xt,ht=yr(yr({},be),{},{children:pi})}if(et.children.splice(Et+1,0,ht),t)for(var[fr,Gr]of Z.points(t))t[Gr]=ke.transform(fr,n);break}}return t},ov={transform(e,t){e.children=Ru(e.children);var n=e.selection&&Ru(e.selection);try{n=sv(e,n,t)}finally{e.children=Iu(e.children),n?e.selection=Tn(n)?Iu(n):n:e.selection=null}}},uv={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)}},lv={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)}},tf=(e,t)=>{for(var n in e){var r=e[n],a=t[n];if(rt(r)&&rt(a)){if(!tf(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 cv(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 Xt(e,t){if(e==null)return{};var n=cv(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 dv=["anchor","focus"];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 fv(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){ft(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 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 ke.equals(e.anchor,t.anchor)&&ke.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 ke.isBefore(n,a)&&ke.isAfter(r,i)}var[s,o]=Z.edges(e),l=!1,u=!1;return ke.isPoint(t)?(l=ke.compare(t,s)>=0,u=ke.compare(t,o)<=0):(l=N.compare(t,s.path)>=0,u=N.compare(t,o.path)<=0),l&&u},intersection(e,t){var n=Xt(e,dv),[r,a]=Z.edges(e),[i,s]=Z.edges(t),o=ke.isBefore(r,i)?i:r,l=ke.isBefore(a,s)?a:s;return ke.isBefore(l,o)?null:fv({anchor:o,focus:l},n)},isBackward(e){var{anchor:t,focus:n}=e;return ke.isAfter(t,n)},isCollapsed(e){var{anchor:t,focus:n}=e;return ke.equals(t,n)},isExpanded(e){return!Z.isCollapsed(e)},isForward(e){return!Z.isBackward(e)},isRange(e){return rt(e)&&ke.isPoint(e.anchor)&&ke.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 bo(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=ke.transform(r.anchor,t,{affinity:i}),u=ke.transform(r.focus,t,{affinity:s});if(!l||!u)return null;r.anchor=l,r.focus=u})}},Uu=e=>rt(e)&&ue.isNodeList(e.children)&&!x.isEditor(e),de={isAncestor(e){return rt(e)&&ue.isNodeList(e.children)},isElement:Uu,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 Uu(t)&&t[r]===n},matches(e,t){for(var n in t)if(n!=="children"&&e[n]!==t[n])return!1;return!0}},hv=["children"],mv=["text"],Hu=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(nt.stringify(n)));return n},ancestors(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return function*(){for(var r of N.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(nt.stringify(e)));var n=e.children[t];if(n==null)throw new Error("Cannot get child at index `".concat(t,"` in node: ").concat(nt.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=N.common(t,n),a=ue.get(e,r);return[a,r]},descendant(e,t){var n=ue.get(e,t);if(x.isEditor(n))throw new Error("Cannot get the descendant node at path [".concat(t,"] because it refers to the root editor node instead: ").concat(nt.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=Xt(e,hv);return t}else{var t=Xt(e,mv);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(nt.stringify(e)));var n=bo({children:e.children},r=>{var[a,i]=Z.edges(t),s=ue.nodes(r,{reverse:!0,pass:m=>{var[,p]=m;return!Z.includes(t,p)}});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(N.equals(o,i.path)){var d=ue.leaf(r,o);d.text=d.text.slice(0,i.offset)}if(N.equals(o,a.path)){var h=ue.leaf(r,o);h.text=h.text.slice(a.offset)}}x.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(nt.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)||x.isEditor(e)},isNodeList(e){if(!Array.isArray(e))return!1;var t=Hu.get(e);if(t!==void 0)return t;var n=e.every(r=>ue.isNode(r));return Hu.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(nt.stringify(n)));return n},levels(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return function*(){for(var r of N.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?N.isBefore(o,i):N.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;N.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 d=N.next(o);if(ue.has(e,d)){o=d,l=ue.get(e,o);continue}}if(r&&o[o.length-1]!==0){var h=N.previous(o);o=h,l=ue.get(e,o);continue}o=N.parent(o),l=ue.get(e,o),s.add(l)}}()},parent(e,t){var n=N.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 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 He(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){ft(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 dn={isNodeOperation(e){return dn.isOperation(e)&&e.type.endsWith("_node")},isOperation(e){if(!rt(e))return!1;switch(e.type){case"insert_node":return N.isPath(e.path)&&ue.isNode(e.node);case"insert_text":return typeof e.offset=="number"&&typeof e.text=="string"&&N.isPath(e.path);case"merge_node":return typeof e.position=="number"&&N.isPath(e.path)&&rt(e.properties);case"move_node":return N.isPath(e.path)&&N.isPath(e.newPath);case"remove_node":return N.isPath(e.path)&&ue.isNode(e.node);case"remove_text":return typeof e.offset=="number"&&typeof e.text=="string"&&N.isPath(e.path);case"set_node":return N.isPath(e.path)&&rt(e.properties)&&rt(e.newProperties);case"set_selection":return e.properties===null&&Z.isRange(e.newProperties)||e.newProperties===null&&Z.isRange(e.properties)||rt(e.properties)&&rt(e.newProperties);case"split_node":return N.isPath(e.path)&&typeof e.position=="number"&&rt(e.properties);default:return!1}},isOperationList(e){return Array.isArray(e)&&e.every(t=>dn.isOperation(t))},isSelectionOperation(e){return dn.isOperation(e)&&e.type.endsWith("_selection")},isTextOperation(e){return dn.isOperation(e)&&e.type.endsWith("_text")},inverse(e){switch(e.type){case"insert_node":return He(He({},e),{},{type:"remove_node"});case"insert_text":return He(He({},e),{},{type:"remove_text"});case"merge_node":return He(He({},e),{},{type:"split_node",path:N.previous(e.path)});case"move_node":{var{newPath:t,path:n}=e;if(N.equals(t,n))return e;if(N.isSibling(n,t))return He(He({},e),{},{path:t,newPath:n});var r=N.transform(n,e),a=N.transform(N.next(n),e);return He(He({},e),{},{path:r,newPath:a})}case"remove_node":return He(He({},e),{},{type:"insert_node"});case"remove_text":return He(He({},e),{},{type:"insert_text"});case"set_node":{var{properties:i,newProperties:s}=e;return He(He({},e),{},{properties:s,newProperties:i})}case"set_selection":{var{properties:o,newProperties:l}=e;return o==null?He(He({},e),{},{properties:l,newProperties:null}):l==null?He(He({},e),{},{properties:null,newProperties:o}):He(He({},e),{},{properties:l,newProperties:o})}case"split_node":return He(He({},e),{},{type:"merge_node",path:N.next(e.path)})}}},Ku=new WeakMap,pv=e=>{var t=Ku.get(e);if(t!==void 0)return t;if(!rt(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||rt(e.marks))&&(e.selection===null||Z.isRange(e.selection))&&ue.isNodeList(e.children)&&dn.isOperationList(e.operations);return Ku.set(e,n),n},x={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 pv(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)}},gv={isSpan(e){return Array.isArray(e)&&e.length===2&&e.every(N.isPath)}};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){ft(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 ke={compare(e,t){var n=N.compare(e.path,t.path);return n===0?e.offset<t.offset?-1:e.offset>t.offset?1:0:n},isAfter(e,t){return ke.compare(e,t)===1},isBefore(e,t){return ke.compare(e,t)===-1},equals(e,t){return e.offset===t.offset&&N.equals(e.path,t.path)},isPoint(e){return rt(e)&&typeof e.offset=="number"&&N.isPath(e.path)},transform(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return bo(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=N.transform(i,t,n);break}case"insert_text":{N.equals(t.path,i)&&(t.offset<s||t.offset===s&&a==="forward")&&(r.offset+=t.text.length);break}case"merge_node":{N.equals(t.path,i)&&(r.offset+=t.position),r.path=N.transform(i,t,n);break}case"remove_text":{N.equals(t.path,i)&&t.offset<=s&&(r.offset-=Math.min(s-t.offset,t.text.length));break}case"remove_node":{if(N.equals(t.path,i)||N.isAncestor(t.path,i))return null;r.path=N.transform(i,t,n);break}case"split_node":{if(N.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=N.transform(i,t,Yu(Yu({},n),{},{affinity:"forward"})))}else r.path=N.transform(i,t,n);break}}})}},Gu=void 0,nt={setScrubber(e){Gu=e},stringify(e){return JSON.stringify(e,Gu)}},vv=["text"],bv=["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 Zt(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){ft(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=Xt(i,vv);return s}return tf(r?a(e):e,r?a(t):t)},isText(e){return rt(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=[Zt({},e)];for(var r of t){var a=Xt(r,bv),[i,s]=Z.edges(r),o=[],l=0,u=i.offset,d=s.offset;for(var h of n){var{length:m}=h.text,p=l;if(l+=m,u<=p&&l<=d){Object.assign(h,a),o.push(h);continue}if(u!==d&&(u===l||d===p)||u>l||d<p||d===p&&p!==0){o.push(h);continue}var g=h,f=void 0,b=void 0;if(d<l){var v=d-p;b=Zt(Zt({},g),{},{text:g.text.slice(v)}),g=Zt(Zt({},g),{},{text:g.text.slice(0,v)})}if(u>p){var C=u-p;f=Zt(Zt({},g),{},{text:g.text.slice(0,C)}),g=Zt(Zt({},g),{},{text:g.text.slice(C)})}Object.assign(g,a),f&&o.push(f),o.push(g),b&&o.push(b)}n=o}return n}},yo=e=>e.selection?e.selection:e.children.length>0?x.end(e,[]):[0],cr=(e,t)=>{var[n]=x.node(e,t);return r=>r===n},xo=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=!n,a=n?Ev(t):t,i=Ce.None,s=Ce.None,o=0,l=null,u=null;for(var d of a){var h=d.codePointAt(0);if(!h)break;var m=Nv(d,h);if([i,s]=r?[s,m]:[m,i],Vn(i,Ce.ZWJ)&&Vn(s,Ce.ExtPict)&&(r?l=Ju(t.substring(0,o)):l=Ju(t.substring(0,t.length-o)),!l)||Vn(i,Ce.RI)&&Vn(s,Ce.RI)&&(u!==null?u=!u:r?u=!0:u=zv(t.substring(0,t.length-o)),!u)||i!==Ce.None&&s!==Ce.None&&Iv(i,s))break;o+=d.length}return o||1},yv=/\s/,xv=/[\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]/,Dv=/['\u2018\u2019]/,Cv=function(t){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=0,a=!1;t.length>0;){var i=xo(t,n),[s,o]=Do(t,i,n);if(wv(s,o,n))a=!0,r+=i;else if(!a)r+=i;else break;t=o}return r},Do=(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)]},wv=function e(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(yv.test(t))return!1;if(Dv.test(t)){var a=xo(n,r),[i,s]=Do(n,a,r);if(e(i,s,r))return!0}return!xv.test(t)},Ev=function*(t){for(var n=t.length-1,r=0;r<t.length;r++){var a=t.charAt(n-r);if(kv(a.charCodeAt(0))){var i=t.charAt(n-r-1);if(_v(i.charCodeAt(0))){yield i+a,r++;continue}}yield a}},_v=e=>e>=55296&&e<=56319,kv=e=>e>=56320&&e<=57343,Ce;(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"})(Ce||(Ce={}));var Fv=/^(?:[\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])$/,Bv=/^(?:[\u0600-\u0605\u06DD\u070F\u0890\u0891\u08E2\u0D4E]|\uD804[\uDCBD\uDCCD\uDDC2\uDDC3]|\uD806[\uDD3F\uDD41\uDE3A\uDE84-\uDE89]|\uD807\uDD46)$/,Av=/^(?:[\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])$/,Tv=/^[\u1100-\u115F\uA960-\uA97C]$/,Sv=/^[\u1160-\u11A7\uD7B0-\uD7C6]$/,jv=/^[\u11A8-\u11FF\uD7CB-\uD7FB]$/,Ov=/^[\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]$/,Pv=/^[\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])$/,Nv=(e,t)=>{var n=Ce.Any;return e.search(Fv)!==-1&&(n|=Ce.Extend),t===8205&&(n|=Ce.ZWJ),t>=127462&&t<=127487&&(n|=Ce.RI),e.search(Bv)!==-1&&(n|=Ce.Prepend),e.search(Av)!==-1&&(n|=Ce.SpacingMark),e.search(Tv)!==-1&&(n|=Ce.L),e.search(Sv)!==-1&&(n|=Ce.V),e.search(jv)!==-1&&(n|=Ce.T),e.search(Ov)!==-1&&(n|=Ce.LV),e.search(Pv)!==-1&&(n|=Ce.LVT),e.search(Mv)!==-1&&(n|=Ce.ExtPict),n};function Vn(e,t){return(e&t)!==0}var Rv=[[Ce.L,Ce.L|Ce.V|Ce.LV|Ce.LVT],[Ce.LV|Ce.V,Ce.V|Ce.T],[Ce.LVT|Ce.T,Ce.T],[Ce.Any,Ce.Extend|Ce.ZWJ],[Ce.Any,Ce.SpacingMark],[Ce.Prepend,Ce.Any],[Ce.ZWJ,Ce.ExtPict],[Ce.RI,Ce.RI]];function Iv(e,t){return Rv.findIndex(n=>Vn(e,n[0])&&Vn(t,n[1]))===-1}var $v=/(?:[\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$/,Ju=e=>e.search($v)!==-1,Lv=/(?:\uD83C[\uDDE6-\uDDFF])+$/g,zv=e=>{var t=e.match(Lv);if(t===null)return!1;var n=t[0].length/2;return n%2===1},qv={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]:{};x.withoutNormalizing(e,()=>{var{voids:r=!1}=n,{at:a=yo(e)}=n;if(N.isPath(a)&&(a=x.range(e,a)),Z.isRange(a))if(Z.isCollapsed(a))a=a.anchor;else{var i=Z.end(a);if(!r&&x.void(e,{at:i}))return;var s=Z.start(a),o=x.pointRef(e,s),l=x.pointRef(e,i);J.delete(e,{at:a,voids:r});var u=o.unref(),d=l.unref();a=u||d,J.setSelection(e,{anchor:a,focus:a})}if(!(!r&&x.void(e,{at:a})||x.elementReadOnly(e,{at:a}))){var{path:h,offset:m}=a;t.length>0&&e.apply({type:"insert_text",path:h,offset:m,text:t})}})}};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 oa(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){ft(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 J=oa(oa(oa(oa({},ov),uv),lv),qv),Ea=new WeakMap,Wv=e=>Ea.get(e)||!1,Uv=(e,t,n)=>{var r=Ea.get(e)||!1;Ea.set(e,!0);try{t(),n()}finally{Ea.set(e,r)}};function nf(e,t,n){var r=za.get(e)||[],a=qa.get(e)||new Set,i,s,o=h=>{if(h){var m=h.join(",");s.has(m)||(s.add(m),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 d of t)o(d);za.set(e,i),qa.set(e,s)}var Hv=(e,t)=>{for(var n of x.pathRefs(e))tv.transform(n,t);for(var r of x.pointRefs(e))nv.transform(r,t);for(var a of x.rangeRefs(e))rv.transform(a,t);if(!Wv(e)){var i=N.operationCanTransformPath(t)?s=>N.transform(s,t):void 0;nf(e,e.getDirtyPaths(t),i)}J.transform(e,t),e.operations.push(t),x.normalize(e,{operation:t}),t.type==="set_selection"&&(e.marks=null),kr.get(e)||(kr.set(e,!0),Promise.resolve().then(()=>{kr.set(e,!1),e.onChange({operation:t}),e.operations=[]}))},Vv=(e,t)=>{switch(t.type){case"insert_text":case"remove_text":case"set_node":{var{path:n}=t;return N.levels(n)}case"insert_node":{var{node:r,path:a}=t,i=N.levels(a),s=fe.isText(r)?[]:Array.from(ue.nodes(r),z=>{var[,R]=z;return a.concat(R)});return[...i,...s]}case"merge_node":{var{path:o}=t,l=N.ancestors(o),u=N.previous(o);return[...l,u]}case"move_node":{var{path:d,newPath:h}=t;if(N.equals(d,h))return[];var m=[],p=[];for(var g of N.ancestors(d)){var f=N.transform(g,t);m.push(f)}for(var b of N.ancestors(h)){var v=N.transform(b,t);p.push(v)}var C=p[p.length-1],F=h[h.length-1],_=C.concat(F);return[...m,...p,_]}case"remove_node":{var{path:w}=t,k=N.ancestors(w);return[...k]}case"split_node":{var{path:j}=t,q=N.levels(j),P=N.next(j);return[...q,P]}default:return[]}},Kv=e=>{var{selection:t}=e;return t?ue.fragment(e,t):[]},Zv=(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=x.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],d=l.children[s-1],h=o===n.children.length-1,m=fe.isText(u)||de.isElement(u)&&e.isInline(u);if(m!==i)J.removeNodes(e,{at:r.concat(s),voids:!0}),s--;else if(de.isElement(u)){if(e.isInline(u)){if(d==null||!fe.isText(d)){var p={text:""};J.insertNodes(e,p,{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 d!=null&&fe.isText(d)&&(fe.equals(u,d,{loose:!0})?(J.mergeNodes(e,{at:r.concat(s),voids:!0}),s--):d.text===""?(J.removeNodes(e,{at:r.concat(s-1),voids:!0}),s--):u.text===""&&(J.removeNodes(e,{at:r.concat(s),voids:!0}),s--))}}}},Yv=(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},Gv=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=x.path(t,i),l=a==="lowest";for(var[u,d]of x.levels(t,{at:o,voids:r,match:s,reverse:l}))if(!fe.isText(u)){if(Z.isRange(i)){if(N.isAncestor(d,i.anchor.path)&&N.isAncestor(d,i.focus.path))return[u,d]}else if(!N.equals(o,d))return[u,d]}}};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 tl(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){ft(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 Qv=(e,t,n)=>{var{selection:r}=e;if(r){var a=(h,m)=>{if(!fe.isText(h))return!1;var[p,g]=x.parent(e,m);return!e.isVoid(p)||e.markableVoid(p)},i=Z.isExpanded(r),s=!1;if(!i){var[o,l]=x.node(e,r);if(o&&a(o,l)){var[u]=x.parent(e,l);s=u&&e.markableVoid(u)}}if(i||s)J.setNodes(e,{[t]:n},{match:a,split:!0,voids:!0});else{var d=tl(tl({},x.marks(e)||{}),{},{[t]:n});e.marks=d,kr.get(e)||e.onChange()}}};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){ft(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 Jv=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=x.point(t,n,{edge:"end"}),i=x.end(t,[]),s={anchor:a,focus:i},{distance:o=1}=r,l=0,u;for(var d of x.positions(t,rl(rl({},r),{},{at:s}))){if(l>o)break;l!==0&&(u=d),l++}return u};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){ft(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 Xv=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=x.start(t,[]),i=x.point(t,n,{edge:"start"}),s={anchor:a,focus:i},{distance:o=1}=r,l=0,u;for(var d of x.positions(t,il(il({},r),{},{at:s,reverse:!0}))){if(l>o)break;l!==0&&(u=d),l++}return u},e0=(e,t)=>{var{selection:n}=e;n&&Z.isCollapsed(n)&&J.delete(e,{unit:t,reverse:!0})},t0=(e,t)=>{var{selection:n}=e;n&&Z.isCollapsed(n)&&J.delete(e,{unit:t})},n0=function(t){var{direction:n="forward"}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{selection:r}=t;r&&Z.isExpanded(r)&&J.delete(t,{reverse:n==="backward"})},r0=(e,t)=>[x.start(e,t),x.end(e,t)];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 ol(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){ft(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 a0=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return x.above(t,ol(ol({},n),{},{match:r=>de.isElement(r)&&x.isElementReadOnly(t,r)}))},i0=(e,t)=>x.point(e,t,{edge:"end"}),s0=(e,t)=>{var n=x.path(e,t,{edge:"start"});return x.node(e,n)},o0=(e,t)=>{var n=x.range(e,t);return ue.fragment(e,n)};function ul(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?ul(Object(n),!0).forEach(function(r){ft(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ul(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var u0=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return x.above(t,ll(ll({},n),{},{match:r=>de.isElement(r)&&x.isVoid(t,r)}))},l0=(e,t)=>t.children.some(n=>de.isElement(n)&&x.isBlock(e,n)),c0=(e,t)=>t.children.some(n=>fe.isText(n)||x.isInline(e,n)),d0=(e,t)=>ue.has(e,t),f0=(e,t)=>t.children.every(n=>fe.isText(n)),h0=e=>{J.splitNodes(e,{always:!0})},m0=(e,t,n)=>{J.insertNodes(e,t,n)},p0=e=>{J.splitNodes(e,{always:!0})};function cl(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 g0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?cl(Object(n),!0).forEach(function(r){ft(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cl(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var v0=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=g0({text:n},i);J.insertNodes(t,s,{at:r.at,voids:r.voids})}else J.insertText(t,n,r);t.marks=null}},b0=(e,t)=>!e.isInline(t),y0=(e,t,n)=>x.isStart(e,t,n)||x.isEnd(e,t,n),x0=(e,t)=>{var{children:n}=t,[r]=n;return n.length===0||n.length===1&&fe.isText(r)&&r.text===""&&!e.isVoid(t)},D0=(e,t,n)=>{var r=x.end(e,n);return ke.equals(t,r)},C0=e=>{var t=ef.get(e);return t===void 0?!0:t},w0=(e,t,n)=>{if(t.offset!==0)return!1;var r=x.start(e,n);return ke.equals(t,r)},E0=(e,t)=>{var n=x.path(e,t,{edge:"end"});return x.node(e,n)},_0=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=x.path(t,n,r),i=ue.leaf(t,a);return[i,a]};function k0(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=x.path(e,n);for(var[l,u]of ue.levels(e,o))if(i(l,u)&&(s.push([l,u]),!a&&de.isElement(l)&&x.isVoid(e,l)))break;r&&s.reverse(),yield*s}}()}var F0=["text"],B0=["text"],A0=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=x.isEnd(t,a,a.path);if(s){var o=x.after(t,a);o&&(a=o)}var[l]=x.nodes(t,{match:fe.isText,at:{anchor:a,focus:i}});if(l){var[u]=l,d=Xt(u,F0);return d}else return{}}var{path:h}=a,[m]=x.leaf(t,h);if(a.offset===0){var p=x.previous(t,{at:h,match:fe.isText}),g=x.above(t,{match:_=>de.isElement(_)&&x.isVoid(t,_)&&t.markableVoid(_)});if(!g){var f=x.above(t,{match:_=>de.isElement(_)&&x.isBlock(t,_)});if(p&&f){var[b,v]=p,[,C]=f;N.isAncestor(C,v)&&(m=b)}}}var F=Xt(m,B0);return F},T0=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=x.after(t,s,{voids:a});if(o){var[,l]=x.last(t,[]),u=[o.path,l];if(N.isPath(s)&&s.length===0)throw new Error("Cannot get the next node from the root node!");if(i==null)if(N.isPath(s)){var[d]=x.parent(t,s);i=m=>d.children.includes(m)}else i=()=>!0;var[h]=x.nodes(t,{at:u,match:i,mode:r,voids:a});return h}}},S0=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=x.path(t,n,r),i=ue.get(t,a);return[i,a]};function j0(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,d;if(gv.isSpan(n))u=n[0],d=n[1];else{var h=x.path(e,n,{edge:"start"}),m=x.path(e,n,{edge:"end"});u=i?m:h,d=i?h:m}var p=ue.nodes(e,{reverse:i,from:u,to:d,pass:_=>{var[w]=_;return de.isElement(w)?!!(!s&&(x.isVoid(e,w)||x.isElementReadOnly(e,w))||o&&!x.isSelectable(e,w)):!1}}),g=[],f;for(var[b,v]of p)if(!(o&&de.isElement(b)&&!x.isSelectable(e,b))){var C=f&&N.compare(v,f[1])===0;if(!(r==="highest"&&C)){if(!l(b,v)){if(a&&!C&&fe.isText(b))return;continue}if(r==="lowest"&&C){f=[b,v];continue}var F=r==="lowest"?f:[b,v];F&&(a?g.push(F):yield F),f=[b,v]}}r==="lowest"&&f&&(a?g.push(f):yield f),a&&(yield*g)}}()}var O0=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{force:r=!1,operation:a}=n,i=d=>za.get(d)||[],s=d=>qa.get(d)||new Set,o=d=>{var h=i(d).pop(),m=h.join(",");return s(d).delete(m),h};if(x.isNormalizing(t)){if(r){var l=Array.from(ue.nodes(t),d=>{var[,h]=d;return h}),u=new Set(l.map(d=>d.join(",")));za.set(t,l),qa.set(t,u)}i(t).length!==0&&x.withoutNormalizing(t,()=>{for(var d of i(t))if(ue.has(t,d)){var h=x.node(t,d),[m,p]=h;de.isElement(m)&&m.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 C=x.node(t,v);t.normalizeNode(C,{operation:a})}b++,g=i(t)}})}},P0=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=x.path(t,n,r),i=N.parent(a),s=x.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=x.pathRefs(t);return l.delete(i),i.current=null,o}},s=x.pathRefs(t);return s.add(i),i},N0=e=>{var t=$u.get(e);return t||(t=new Set,$u.set(e,t)),t},R0=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{depth:a,edge:i}=r;if(N.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=N.common(n.anchor.path,n.focus.path)),ke.isPoint(n)&&(n=n.path),a!=null&&(n=n.slice(0,a)),n},I0=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=x.pointRefs(t);return l.delete(i),i.current=null,o}},s=x.pointRefs(t);return s.add(i),i},$0=e=>{var t=Lu.get(e);return t||(t=new Set,Lu.set(e,t)),t},L0=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{edge:a="start"}=r;if(N.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,d]=Z.edges(n);return a==="start"?u:d}return n};function z0(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=x.range(e,n),[l,u]=Z.edges(o),d=a?u:l,h=!1,m="",p=0,g=0,f=0;for(var[b,v]of x.nodes(e,{at:n,reverse:a,voids:i,ignoreNonSelectable:s})){if(de.isElement(b)){if(!i&&(e.isVoid(b)||e.isElementReadOnly(b))){yield x.start(e,v);continue}if(e.isInline(b))continue;if(x.hasInlines(e,b)){var C=N.isAncestor(v,u.path)?u:x.end(e,v),F=N.isAncestor(v,l.path)?l:x.start(e,v);m=x.string(e,{anchor:F,focus:C},{voids:i}),h=!0}}if(fe.isText(b)){var _=N.equals(v,d.path);for(_?(g=a?d.offset:b.text.length-d.offset,f=d.offset):(g=b.text.length,f=a?g:0),(_||h||r==="offset")&&(yield{path:v,offset:f},h=!1);;){if(p===0){if(m==="")break;p=w(m,r,a),m=Do(m,p,a)[1]}if(f=a?f-p:f+p,g=g-p,g<0){p=-g;break}p=0,yield{path:v,offset:f}}}}function w(k,j,q){return j==="character"?xo(k,q):j==="word"?Cv(k,q):j==="line"||j==="block"?k.length:1}}()}var q0=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=x.before(t,s,{voids:a});if(o){var[,l]=x.first(t,[]),u=[o.path,l];if(N.isPath(s)&&s.length===0)throw new Error("Cannot get the previous node from the root node!");if(i==null)if(N.isPath(s)){var[d]=x.parent(t,s);i=m=>d.children.includes(m)}else i=()=>!0;var[h]=x.nodes(t,{reverse:!0,at:u,match:i,mode:r,voids:a});return h}}},W0=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=x.rangeRefs(t);return l.delete(i),i.current=null,o}},s=x.rangeRefs(t);return s.add(i),i},U0=e=>{var t=zu.get(e);return t||(t=new Set,zu.set(e,t)),t},H0=(e,t,n)=>{if(Z.isRange(t)&&!n)return t;var r=x.start(e,t),a=x.end(e,n||t);return{anchor:r,focus:a}};function dl(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 V0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dl(Object(n),!0).forEach(function(r){ft(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dl(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=(d,h)=>{if(!fe.isText(d))return!1;var[m,p]=x.parent(e,h);return!e.isVoid(m)||e.markableVoid(m)},a=Z.isExpanded(n),i=!1;if(!a){var[s,o]=x.node(e,n);if(s&&r(s,o)){var[l]=x.parent(e,o);i=l&&e.markableVoid(l)}}if(a||i)J.unsetNodes(e,t,{match:r,split:!0,voids:!0});else{var u=V0({},x.marks(e)||{});delete u[t],e.marks=u,kr.get(e)||e.onChange()}}},Z0=(e,t)=>{ef.set(e,t)},Y0=(e,t)=>x.point(e,t,{edge:"start"}),G0=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{voids:a=!1}=r,i=x.range(t,n),[s,o]=Z.edges(i),l="";for(var[u,d]of x.nodes(t,{at:i,match:fe.isText,voids:a})){var h=u.text;N.equals(d,o.path)&&(h=h.slice(0,o.offset)),N.equals(d,s.path)&&(h=h.slice(s.offset)),l+=h}return l},Q0=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)||N.hasPrevious(s.path))return n;var o=x.above(t,{at:s,match:g=>de.isElement(g)&&x.isBlock(t,g),voids:a}),l=o?o[1]:[],u=x.start(t,i),d={anchor:u,focus:s},h=!0;for(var[m,p]of x.nodes(t,{at:d,match:fe.isText,reverse:!0,voids:a})){if(h){h=!1;continue}if(m.text!==""||N.isBefore(p,l)){s={path:p,offset:m.text.length};break}}return{anchor:i,focus:s}},J0=(e,t)=>{var n=x.isNormalizing(e);x.setNormalizing(e,!1);try{t()}finally{x.setNormalizing(e,n)}x.normalize(e)},X0=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};x.withoutNormalizing(t,()=>{var r,a,{reverse:i=!1,unit:s="character",distance:o=1,voids:l=!1}=n,{at:u=t.selection,hanging:d=!1}=n;if(u){var h=!1;if(Z.isRange(u)&&Z.isCollapsed(u)&&(h=!0,u=u.anchor),ke.isPoint(u)){var m=x.void(t,{at:u,mode:"highest"});if(!l&&m){var[,p]=m;u=p}else{var g={unit:s,distance:o},f=i?x.before(t,u,g)||x.start(t,[]):x.after(t,u,g)||x.end(t,[]);u={anchor:u,focus:f},d=!0}}if(N.isPath(u)){J.removeNodes(t,{at:u,voids:l});return}if(!Z.isCollapsed(u)){if(!d){var[,b]=Z.edges(u),v=x.end(t,[]);ke.equals(b,v)||(u=x.unhangRange(t,u,{voids:l}))}var[C,F]=Z.edges(u),_=x.above(t,{match:me=>de.isElement(me)&&x.isBlock(t,me),at:C,voids:l}),w=x.above(t,{match:me=>de.isElement(me)&&x.isBlock(t,me),at:F,voids:l}),k=_&&w&&!N.equals(_[1],w[1]),j=N.equals(C.path,F.path),q=l?null:(r=x.void(t,{at:C,mode:"highest"}))!==null&&r!==void 0?r:x.elementReadOnly(t,{at:C,mode:"highest"}),P=l?null:(a=x.void(t,{at:F,mode:"highest"}))!==null&&a!==void 0?a:x.elementReadOnly(t,{at:F,mode:"highest"});if(q){var z=x.before(t,C);z&&_&&N.isAncestor(_[1],z.path)&&(C=z)}if(P){var R=x.after(t,F);R&&w&&N.isAncestor(w[1],R.path)&&(F=R)}var A=[],E;for(var S of x.nodes(t,{at:u,voids:l})){var[O,V]=S;E&&N.compare(V,E)===0||(!l&&de.isElement(O)&&(x.isVoid(t,O)||x.isElementReadOnly(t,O))||!N.isCommon(V,C.path)&&!N.isCommon(V,F.path))&&(A.push(S),E=V)}var H=Array.from(A,me=>{var[,_e]=me;return x.pathRef(t,_e)}),Q=x.pointRef(t,C),ae=x.pointRef(t,F),D="";if(!j&&!q){var $=Q.current,[X]=x.leaf(t,$),{path:B}=$,{offset:T}=C,L=X.text.slice(T);L.length>0&&(t.apply({type:"remove_text",path:B,offset:T,text:L}),D=L)}if(H.reverse().map(me=>me.unref()).filter(me=>me!==null).forEach(me=>J.removeNodes(t,{at:me,voids:l})),!P){var I=ae.current,[W]=x.leaf(t,I),{path:U}=I,ne=j?C.offset:0,re=W.text.slice(ne,F.offset);re.length>0&&(t.apply({type:"remove_text",path:U,offset:ne,text:re}),D=re)}!j&&k&&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(),pe=i?le||ee:ee||le;n.at==null&&pe&&J.select(t,pe)}}})},eb=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};x.withoutNormalizing(t,()=>{var{hanging:a=!1,voids:i=!1}=r,{at:s=yo(t),batchDirty:o=!0}=r;if(n.length){if(Z.isRange(s))if(a||(s=x.unhangRange(t,s,{voids:i})),Z.isCollapsed(s))s=s.anchor;else{var[,l]=Z.edges(s);if(!i&&x.void(t,{at:l}))return;var u=x.pointRef(t,l);J.delete(t,{at:s}),s=u.unref()}else N.isPath(s)&&(s=x.start(t,s));if(!(!i&&x.void(t,{at:s}))){var d=x.above(t,{at:s,match:L=>de.isElement(L)&&x.isInline(t,L),mode:"highest",voids:i});if(d){var[,h]=d;if(x.isEnd(t,s,h)){var m=x.after(t,h);s=m}else if(x.isStart(t,s,h)){var p=x.before(t,h);s=p}}var g=x.above(t,{match:L=>de.isElement(L)&&x.isBlock(t,L),at:s,voids:i}),[,f]=g,b=x.isStart(t,s,f),v=x.isEnd(t,s,f),C=b&&v,F=!b||b&&v,_=!v,[,w]=ue.first({children:n},[]),[,k]=ue.last({children:n},[]),j=[],q=L=>{var[I,W]=L,U=W.length===0;return U?!1:C?!0:!(F&&N.isAncestor(W,w)&&de.isElement(I)&&!t.isVoid(I)&&!t.isInline(I)||_&&N.isAncestor(W,k)&&de.isElement(I)&&!t.isVoid(I)&&!t.isInline(I))};for(var P of ue.nodes({children:n},{pass:q}))q(P)&&j.push(P);var z=[],R=[],A=[],E=!0,S=!1;for(var[O]of j)de.isElement(O)&&!t.isInline(O)?(E=!1,S=!0,R.push(O)):E?z.push(O):A.push(O);var[V]=x.nodes(t,{at:s,match:L=>fe.isText(L)||x.isInline(t,L),mode:"highest",voids:i}),[,H]=V,Q=x.isStart(t,s,H),ae=x.isEnd(t,s,H),D=x.pathRef(t,v&&!A.length?N.next(f):f),$=x.pathRef(t,ae?N.next(H):H);J.splitNodes(t,{at:s,match:L=>S?de.isElement(L)&&x.isBlock(t,L):fe.isText(L)||x.isInline(t,L),mode:S?"lowest":"highest",always:S&&(!b||z.length>0)&&(!v||A.length>0),voids:i});var X=x.pathRef(t,!Q||Q&&ae?N.next(H):H);if(J.insertNodes(t,z,{at:X.current,match:L=>fe.isText(L)||x.isInline(t,L),mode:"highest",voids:i,batchDirty:o}),C&&!z.length&&R.length&&!A.length&&J.delete(t,{at:f,voids:i}),J.insertNodes(t,R,{at:D.current,match:L=>de.isElement(L)&&x.isBlock(t,L),mode:"lowest",voids:i,batchDirty:o}),J.insertNodes(t,A,{at:$.current,match:L=>fe.isText(L)||x.isInline(t,L),mode:"highest",voids:i,batchDirty:o}),!r.at){var B;if(A.length>0&&$.current?B=N.previous($.current):R.length>0&&D.current?B=N.previous(D.current):X.current&&(B=N.previous(X.current)),B){var T=x.end(t,B);J.select(t,T)}}X.unref(),D.unref(),$.unref()}}})},tb=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]=Z.edges(a);J.select(t,i)}else if(r==="end"){var[,s]=Z.edges(a);J.select(t,s)}}else return},nb=e=>{var{selection:t}=e;t&&e.apply({type:"set_selection",properties:t,newProperties:null})},rb=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,d={distance:a,unit:i,ignoreNonSelectable:!0},h={};if(o==null||o==="anchor"){var m=s?x.before(t,l,d):x.after(t,l,d);m&&(h.anchor=m)}if(o==null||o==="focus"){var p=s?x.before(t,u,d):x.after(t,u,d);p&&(h.focus=p)}J.setSelection(t,h)}},ab=(e,t)=>{var{selection:n}=e;if(t=x.range(e,t),n){J.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(nt.stringify(t)));e.apply({type:"set_selection",properties:n,newProperties:t})};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 hl(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){ft(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 ib=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;J.setSelection(t,{[i==="anchor"?"anchor":"focus"]:hl(hl({},l),n)})}},sb=(e,t)=>{var{selection:n}=e,r={},a={};if(n){for(var i in t)(i==="anchor"&&t.anchor!=null&&!ke.equals(t.anchor,n.anchor)||i==="focus"&&t.focus!=null&&!ke.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})}},ob=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};x.withoutNormalizing(t,()=>{var{hanging:a=!1,voids:i=!1,mode:s="lowest",batchDirty:o=!0}=r,{at:l,match:u,select:d}=r;if(ue.isNode(n)&&(n=[n]),n.length!==0){var[h]=n;if(l||(l=yo(t),d!==!1&&(d=!0)),d==null&&(d=!1),Z.isRange(l))if(a||(l=x.unhangRange(t,l,{voids:i})),Z.isCollapsed(l))l=l.anchor;else{var[,m]=Z.edges(l),p=x.pointRef(t,m);J.delete(t,{at:l}),l=p.unref()}if(ke.isPoint(l)){u==null&&(fe.isText(h)?u=z=>fe.isText(z):t.isInline(h)?u=z=>fe.isText(z)||x.isInline(t,z):u=z=>de.isElement(z)&&x.isBlock(t,z));var[g]=x.nodes(t,{at:l.path,match:u,mode:s,voids:i});if(g){var[,f]=g,b=x.pathRef(t,f),v=x.isEnd(t,l,f);J.splitNodes(t,{at:l,match:u,mode:s,voids:i});var C=b.unref();l=v?N.next(C):C}else return}var F=N.parent(l),_=l[l.length-1];if(!(!i&&x.void(t,{at:F}))){if(o){var w=[],k=N.levels(F);Uv(t,()=>{var z=function(){var E=F.concat(_);_++;var S={type:"insert_node",path:E,node:R};t.apply(S),l=N.next(l),w.push(S),fe.isText?k.push(...Array.from(ue.nodes(R),O=>{var[,V]=O;return E.concat(V)})):k.push(E)};for(var R of n)z()},()=>{nf(t,k,z=>{var R=z;for(var A of w)if(N.operationCanTransformPath(A)&&(R=N.transform(R,A),!R))return null;return R})})}else for(var j of n){var q=F.concat(_);_++,t.apply({type:"insert_node",path:q,node:j}),l=N.next(l)}if(l=N.previous(l),d){var P=x.end(t,l);P&&J.select(t,P)}}}})},ub=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};x.withoutNormalizing(t,()=>{var{at:r=t.selection,mode:a="lowest",voids:i=!1}=n,{match:s}=n;if(s==null&&(s=N.isPath(r)?cr(t,r):_=>de.isElement(_)&&x.isBlock(t,_)),!!r){var o=x.nodes(t,{at:r,match:s,mode:a,voids:i}),l=Array.from(o,_=>{var[,w]=_;return x.pathRef(t,w)});for(var u of l){var d=u.unref();if(d.length<2)throw new Error("Cannot lift node at a path [".concat(d,"] because it has a depth of less than `2`."));var h=x.node(t,N.parent(d)),[m,p]=h,g=d[d.length-1],{length:f}=m.children;if(f===1){var b=N.next(p);J.moveNodes(t,{at:d,to:b,voids:i}),J.removeNodes(t,{at:p,voids:i})}else if(g===0)J.moveNodes(t,{at:d,to:p,voids:i});else if(g===f-1){var v=N.next(p);J.moveNodes(t,{at:d,to:v,voids:i})}else{var C=N.next(d),F=N.next(p);J.splitNodes(t,{at:C,voids:i}),J.moveNodes(t,{at:d,to:F,voids:i})}}}})},lb=["text"],cb=["children"],rf=(e,t)=>{if(de.isElement(t)){var n=t;return x.isVoid(e,t)?!0:n.children.length===1?rf(e,n.children[0]):!1}else return!x.isEditor(t)},db=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};x.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(N.isPath(a)){var[l]=x.parent(t,a);r=z=>l.children.includes(z)}else r=z=>de.isElement(z)&&x.isBlock(t,z);if(!i&&Z.isRange(a)&&(a=x.unhangRange(t,a,{voids:s})),Z.isRange(a))if(Z.isCollapsed(a))a=a.anchor;else{var[,u]=Z.edges(a),d=x.pointRef(t,u);J.delete(t,{at:a}),a=d.unref(),n.at==null&&J.select(t,a)}var[h]=x.nodes(t,{at:a,match:r,voids:s,mode:o}),m=x.previous(t,{at:a,match:r,voids:s,mode:o});if(!(!h||!m)){var[p,g]=h,[f,b]=m;if(!(g.length===0||b.length===0)){var v=N.next(b),C=N.common(g,b),F=N.isSibling(g,b),_=Array.from(x.levels(t,{at:g}),z=>{var[R]=z;return R}).slice(C.length).slice(0,-1),w=x.above(t,{at:g,mode:"highest",match:z=>_.includes(z)&&rf(t,z)}),k=w&&x.pathRef(t,w[1]),j,q;if(fe.isText(p)&&fe.isText(f)){var P=Xt(p,lb);q=f.text.length,j=P}else if(de.isElement(p)&&de.isElement(f)){var P=Xt(p,cb);q=f.children.length,j=P}else throw new Error("Cannot merge the node at path [".concat(g,"] with the previous sibling because it is not the same kind: ").concat(nt.stringify(p)," ").concat(nt.stringify(f)));F||J.moveNodes(t,{at:g,to:v,voids:s}),k&&J.removeNodes(t,{at:k.current,voids:s}),de.isElement(f)&&x.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:j}),k&&k.unref()}}}})},fb=(e,t)=>{x.withoutNormalizing(e,()=>{var{to:n,at:r=e.selection,mode:a="lowest",voids:i=!1}=t,{match:s}=t;if(r){s==null&&(s=N.isPath(r)?cr(e,r):p=>de.isElement(p)&&x.isBlock(e,p));var o=x.pathRef(e,n),l=x.nodes(e,{at:r,match:s,mode:a,voids:i}),u=Array.from(l,p=>{var[,g]=p;return x.pathRef(e,g)});for(var d of u){var h=d.unref(),m=o.current;h.length!==0&&e.apply({type:"move_node",path:h,newPath:m}),o.current&&N.isSibling(m,h)&&N.isAfter(m,h)&&(o.current=N.next(o.current))}o.unref()}})},hb=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};x.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=N.isPath(s)?cr(t,s):p=>de.isElement(p)&&x.isBlock(t,p)),!r&&Z.isRange(s)&&(s=x.unhangRange(t,s,{voids:a}));var l=x.nodes(t,{at:s,match:o,mode:i,voids:a}),u=Array.from(l,p=>{var[,g]=p;return x.pathRef(t,g)});for(var d of u){var h=d.unref();if(h){var[m]=x.node(t,h);t.apply({type:"remove_node",path:h,node:m})}}}})},mb=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};x.withoutNormalizing(t,()=>{var{match:a,at:i=t.selection,compare:s,merge:o}=r,{hanging:l=!1,mode:u="lowest",split:d=!1,voids:h=!1}=r;if(i){if(a==null&&(a=N.isPath(i)?cr(t,i):q=>de.isElement(q)&&x.isBlock(t,q)),!l&&Z.isRange(i)&&(i=x.unhangRange(t,i,{voids:h})),d&&Z.isRange(i)){if(Z.isCollapsed(i)&&x.leaf(t,i.anchor)[0].text.length>0)return;var m=x.rangeRef(t,i,{affinity:"inward"}),[p,g]=Z.edges(i),f=u==="lowest"?"lowest":"highest",b=x.isEnd(t,g,g.path);J.splitNodes(t,{at:g,match:a,mode:f,voids:h,always:!b});var v=x.isStart(t,p,p.path);J.splitNodes(t,{at:p,match:a,mode:f,voids:h,always:!v}),i=m.unref(),r.at==null&&J.select(t,i)}s||(s=(q,P)=>q!==P);for(var[C,F]of x.nodes(t,{at:i,match:a,mode:u,voids:h})){var _={},w={};if(F.length!==0){var k=!1;for(var j in n)j==="children"||j==="text"||s(n[j],C[j])&&(k=!0,C.hasOwnProperty(j)&&(_[j]=C[j]),o?n[j]!=null&&(w[j]=o(C[j],n[j])):n[j]!=null&&(w[j]=n[j]));k&&t.apply({type:"set_node",path:F,properties:_,newProperties:w})}}}})},pb=(e,t)=>{if(Z.isCollapsed(t))return t.anchor;var[,n]=Z.edges(t),r=x.pointRef(e,n);return J.delete(e,{at:t}),r.unref()},gb=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};x.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)&&x.isBlock(t,ae)),Z.isRange(s)&&(s=pb(t,s)),N.isPath(s)){var u=s,d=x.point(t,u),[h]=x.parent(t,u);i=ae=>ae===h,o=d.path.length-u.length+1,s=d,l=!0}if(s){var m=x.pointRef(t,s,{affinity:"backward"}),p;try{var[g]=x.nodes(t,{at:s,match:i,mode:r,voids:a});if(!g)return;var f=x.void(t,{at:s,mode:"highest"}),b=0;if(!a&&f){var[v,C]=f;if(de.isElement(v)&&t.isInline(v)){var F=x.after(t,C);if(!F){var _={text:""},w=N.next(C);J.insertNodes(t,_,{at:w,voids:a}),F=x.point(t,w)}s=F,l=!0}var k=s.path.length-C.length;o=k+1,l=!0}p=x.pointRef(t,s);var j=s.path.length-o,[,q]=g,P=s.path.slice(0,j),z=o===0?s.offset:s.path[j]+b;for(var[R,A]of x.levels(t,{at:P,reverse:!0,voids:a})){var E=!1;if(A.length<q.length||A.length===0||!a&&de.isElement(R)&&x.isVoid(t,R))break;var S=m.current,O=x.isEnd(t,S,A);if(l||!m||!x.isEdge(t,S,A)){E=!0;var V=ue.extractProps(R);t.apply({type:"split_node",path:A,position:z,properties:V})}z=A[A.length-1]+(E||O?1:0)}if(n.at==null){var H=p.current||x.end(t,[]);J.select(t,H)}}finally{var Q;m.unref(),(Q=p)===null||Q===void 0||Q.unref()}}})},vb=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)},bb=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};x.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=N.isPath(s)?cr(t,s):p=>de.isElement(p)&&x.isBlock(t,p)),N.isPath(s)&&(s=x.range(t,s));var l=Z.isRange(s)?x.rangeRef(t,s):null,u=x.nodes(t,{at:s,match:o,mode:r,voids:i}),d=Array.from(u,p=>{var[,g]=p;return x.pathRef(t,g)}).reverse(),h=function(){var g=m.unref(),[f]=x.node(t,g),b=x.range(t,g);a&&l&&(b=Z.intersection(l.current,b)),J.liftNodes(t,{at:b,match:v=>de.isAncestor(f)&&f.children.includes(v),voids:i})};for(var m of d)h();l&&l.unref()}})};function ml(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 pl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ml(Object(n),!0).forEach(function(r){ft(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ml(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var yb=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};x.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&&(N.isPath(l)?o=cr(t,l):t.isInline(n)?o=b=>de.isElement(b)&&x.isInline(t,b)||fe.isText(b):o=b=>de.isElement(b)&&x.isBlock(t,b)),i&&Z.isRange(l)){var[u,d]=Z.edges(l),h=x.rangeRef(t,l,{affinity:"inward"});J.splitNodes(t,{at:d,match:o,voids:s}),J.splitNodes(t,{at:u,match:o,voids:s}),l=h.unref(),r.at==null&&J.select(t,l)}var m=Array.from(x.nodes(t,{at:l,match:t.isInline(n)?b=>de.isElement(b)&&x.isBlock(t,b):b=>x.isEditor(b),mode:"lowest",voids:s})),p=function(){var v=Z.isRange(l)?Z.intersection(l,x.range(t,f)):l;if(!v)return 0;var C=Array.from(x.nodes(t,{at:v,match:o,mode:a,voids:s}));if(C.length>0){var[F]=C,_=C[C.length-1],[,w]=F,[,k]=_;if(w.length===0&&k.length===0)return 0;var j=N.equals(w,k)?N.parent(w):N.common(w,k),q=x.range(t,w,k),P=x.node(t,j),[z]=P,R=j.length+1,A=N.next(k.slice(0,R)),E=pl(pl({},n),{},{children:[]});J.insertNodes(t,E,{at:A,voids:s}),J.moveNodes(t,{at:q,match:S=>de.isAncestor(z)&&z.children.includes(S),to:A.concat(0),voids:s})}},g;for(var[,f]of m)g=p()}})},xb=()=>{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 Hv(e,...r)},addMark:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Qv(e,...r)},deleteBackward:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return e0(e,...r)},deleteForward:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return t0(e,...r)},deleteFragment:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return n0(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 h0(e,...r)},insertSoftBreak:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return p0(e,...r)},insertFragment:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return eb(e,...r)},insertNode:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return m0(e,...r)},insertText:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return v0(e,...r)},normalizeNode:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Zv(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 Vv(e,...r)},shouldNormalize:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Yv(e,...r)},above:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Gv(e,...r)},after:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Jv(e,...r)},before:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Xv(e,...r)},collapse:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return tb(e,...r)},delete:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return X0(e,...r)},deselect:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return nb(e,...r)},edges:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return r0(e,...r)},elementReadOnly:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return a0(e,...r)},end:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return i0(e,...r)},first:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return s0(e,...r)},fragment:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return o0(e,...r)},getMarks:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return A0(e,...r)},hasBlocks:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return l0(e,...r)},hasInlines:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return c0(e,...r)},hasPath:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return d0(e,...r)},hasTexts:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return f0(e,...r)},insertNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return ob(e,...r)},isBlock:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return b0(e,...r)},isEdge:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return y0(e,...r)},isEmpty:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return x0(e,...r)},isEnd:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return D0(e,...r)},isNormalizing:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return C0(e,...r)},isStart:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return w0(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 _0(e,...r)},levels:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return k0(e,...r)},liftNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return ub(e,...r)},mergeNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return db(e,...r)},move:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return rb(e,...r)},moveNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return fb(e,...r)},next:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return T0(e,...r)},node:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return S0(e,...r)},nodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return j0(e,...r)},normalize:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return O0(e,...r)},parent:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return P0(e,...r)},path:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return R0(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 N0(e,...r)},point:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return L0(e,...r)},pointRef:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return I0(e,...r)},pointRefs:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return $0(e,...r)},positions:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return z0(e,...r)},previous:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return q0(e,...r)},range:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return H0(e,...r)},rangeRef:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return W0(e,...r)},rangeRefs:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return U0(e,...r)},removeNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return hb(e,...r)},select:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return ab(e,...r)},setNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return mb(e,...r)},setNormalizing:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Z0(e,...r)},setPoint:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return ib(e,...r)},setSelection:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return sb(e,...r)},splitNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return gb(e,...r)},start:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Y0(e,...r)},string:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return G0(e,...r)},unhangRange:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Q0(e,...r)},unsetNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return vb(e,...r)},unwrapNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return bb(e,...r)},void:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return u0(e,...r)},withoutNormalizing:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return J0(e,...r)},wrapNodes:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return yb(e,...r)}};return e},Db={isHistory(e){return rt(e)&&Array.isArray(e.redos)&&Array.isArray(e.undos)&&(e.redos.length===0||dn.isOperationList(e.redos[0].operations))&&(e.undos.length===0||dn.isOperationList(e.undos[0].operations))}},Mi=new WeakMap,Ni=new WeakMap,Kn={isHistoryEditor(e){return Db.isHistory(e.history)&&x.isEditor(e)},isMerging(e){return Ni.get(e)},isSaving(e){return Mi.get(e)},redo(e){e.redo()},undo(e){e.undo()},withoutMerging(e,t){var n=Kn.isMerging(e);Ni.set(e,!1),t(),Ni.set(e,n)},withoutSaving(e,t){var n=Kn.isSaving(e);Mi.set(e,!1),t(),Mi.set(e,n)}},Cb=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),Kn.withoutSaving(t,()=>{x.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];Kn.withoutSaving(t,()=>{x.withoutNormalizing(t,()=>{var s=i.operations.map(dn.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=Kn.isSaving(t),d=Kn.isMerging(t);if(u==null&&(u=Eb(r)),u){if(d==null&&(o==null?d=!1:a.length!==0?d=!0:d=wb(r,l)),o&&d)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},wb=(e,t)=>!!(t&&e.type==="insert_text"&&t.type==="insert_text"&&e.offset===t.offset+t.text.length&&N.equals(e.path,t.path)||t&&e.type==="remove_text"&&t.type==="remove_text"&&e.offset+e.text.length===t.offset&&N.equals(e.path,t.path)),Eb=(e,t)=>e.type!=="set_selection",_b=Bb,af="֑-߿יִ-﷽ﹰ-ﻼ",sf="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",kb=new RegExp("^[^"+sf+"]*["+af+"]"),Fb=new RegExp("^[^"+af+"]*["+sf+"]");function Bb(e){return e=String(e||""),kb.test(e)?"rtl":Fb.test(e)?"ltr":"neutral"}const of=On(_b);function Ab(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Co=Ab,Tb=typeof Qr=="object"&&Qr&&Qr.Object===Object&&Qr,Sb=Tb,jb=Sb,Ob=typeof self=="object"&&self&&self.Object===Object&&self,Pb=jb||Ob||Function("return this")(),uf=Pb,Mb=uf,Nb=function(){return Mb.Date.now()},Rb=Nb,Ib=/\s/;function $b(e){for(var t=e.length;t--&&Ib.test(e.charAt(t)););return t}var Lb=$b,zb=Lb,qb=/^\s+/;function Wb(e){return e&&e.slice(0,zb(e)+1).replace(qb,"")}var Ub=Wb,Hb=uf,Vb=Hb.Symbol,lf=Vb,gl=lf,cf=Object.prototype,Kb=cf.hasOwnProperty,Zb=cf.toString,xr=gl?gl.toStringTag:void 0;function Yb(e){var t=Kb.call(e,xr),n=e[xr];try{e[xr]=void 0;var r=!0}catch{}var a=Zb.call(e);return r&&(t?e[xr]=n:delete e[xr]),a}var Gb=Yb,Qb=Object.prototype,Jb=Qb.toString;function Xb(e){return Jb.call(e)}var ey=Xb,vl=lf,ty=Gb,ny=ey,ry="[object Null]",ay="[object Undefined]",bl=vl?vl.toStringTag:void 0;function iy(e){return e==null?e===void 0?ay:ry:bl&&bl in Object(e)?ty(e):ny(e)}var sy=iy;function oy(e){return e!=null&&typeof e=="object"}var uy=oy,ly=sy,cy=uy,dy="[object Symbol]";function fy(e){return typeof e=="symbol"||cy(e)&&ly(e)==dy}var hy=fy,my=Ub,yl=Co,py=hy,xl=0/0,gy=/^[-+]0x[0-9a-f]+$/i,vy=/^0b[01]+$/i,by=/^0o[0-7]+$/i,yy=parseInt;function xy(e){if(typeof e=="number")return e;if(py(e))return xl;if(yl(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=yl(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=my(e);var n=vy.test(e);return n||by.test(e)?yy(e.slice(2),n?2:8):gy.test(e)?xl:+e}var Dy=xy,Cy=Co,Ri=Rb,Dl=Dy,wy="Expected a function",Ey=Math.max,_y=Math.min;function ky(e,t,n){var r,a,i,s,o,l,u=0,d=!1,h=!1,m=!0;if(typeof e!="function")throw new TypeError(wy);t=Dl(t)||0,Cy(n)&&(d=!!n.leading,h="maxWait"in n,i=h?Ey(Dl(n.maxWait)||0,t):i,m="trailing"in n?!!n.trailing:m);function p(k){var j=r,q=a;return r=a=void 0,u=k,s=e.apply(q,j),s}function g(k){return u=k,o=setTimeout(v,t),d?p(k):s}function f(k){var j=k-l,q=k-u,P=t-j;return h?_y(P,i-q):P}function b(k){var j=k-l,q=k-u;return l===void 0||j>=t||j<0||h&&q>=i}function v(){var k=Ri();if(b(k))return C(k);o=setTimeout(v,f(k))}function C(k){return o=void 0,m&&r?p(k):(r=a=void 0,s)}function F(){o!==void 0&&clearTimeout(o),u=0,r=l=a=o=void 0}function _(){return o===void 0?s:C(Ri())}function w(){var k=Ri(),j=b(k);if(r=arguments,a=this,l=k,j){if(o===void 0)return g(l);if(h)return clearTimeout(o),o=setTimeout(v,t),p(l)}return o===void 0&&(o=setTimeout(v,t)),s}return w.cancel=F,w.flush=_,w}var df=ky;const Fy=On(df);var By=df,Ay=Co,Ty="Expected a function";function Sy(e,t,n){var r=!0,a=!0;if(typeof e!="function")throw new TypeError(Ty);return Ay(n)&&(r="leading"in n?!!n.leading:r,a="trailing"in n?!!n.trailing:a),By(e,t,{leading:r,maxWait:t,trailing:a})}var jy=Sy;const Oy=On(jy),Cl=e=>typeof e=="object"&&e!=null&&e.nodeType===1,wl=(e,t)=>(!t||e!=="hidden")&&e!=="visible"&&e!=="clip",Ii=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const n=getComputedStyle(e,null);return wl(n.overflowY,t)||wl(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},ua=(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,Py=e=>{const t=e.parentElement;return t??(e.getRootNode().host||null)},El=(e,t)=>{var n,r,a,i;if(typeof document>"u")return[];const{scrollMode:s,block:o,inline:l,boundary:u,skipOverflowHiddenElements:d}=t,h=typeof u=="function"?u:V=>V!==u;if(!Cl(e))throw new TypeError("Invalid target");const m=document.scrollingElement||document.documentElement,p=[];let g=e;for(;Cl(g)&&h(g);){if(g=Py(g),g===m){p.push(g);break}g!=null&&g===document.body&&Ii(g)&&!Ii(document.documentElement)||g!=null&&Ii(g,d)&&p.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:C}=window,{height:F,width:_,top:w,right:k,bottom:j,left:q}=e.getBoundingClientRect(),{top:P,right:z,bottom:R,left:A}=(V=>{const H=window.getComputedStyle(V);return{top:parseFloat(H.scrollMarginTop)||0,right:parseFloat(H.scrollMarginRight)||0,bottom:parseFloat(H.scrollMarginBottom)||0,left:parseFloat(H.scrollMarginLeft)||0}})(e);let E=o==="start"||o==="nearest"?w-P:o==="end"?j+R:w+F/2-P+R,S=l==="center"?q+_/2-A+z:l==="end"?k+z:q-A;const O=[];for(let V=0;V<p.length;V++){const H=p[V],{height:Q,width:ae,top:D,right:$,bottom:X,left:B}=H.getBoundingClientRect();if(s==="if-needed"&&w>=0&&q>=0&&j<=b&&k<=f&&w>=D&&j<=X&&q>=B&&k<=$)return O;const T=getComputedStyle(H),L=parseInt(T.borderLeftWidth,10),I=parseInt(T.borderTopWidth,10),W=parseInt(T.borderRightWidth,10),U=parseInt(T.borderBottomWidth,10);let ne=0,re=0;const le="offsetWidth"in H?H.offsetWidth-H.clientWidth-L-W:0,ee="offsetHeight"in H?H.offsetHeight-H.clientHeight-I-U:0,pe="offsetWidth"in H?H.offsetWidth===0?0:ae/H.offsetWidth:0,me="offsetHeight"in H?H.offsetHeight===0?0:Q/H.offsetHeight:0;if(m===H)ne=o==="start"?E:o==="end"?E-b:o==="nearest"?ua(C,C+b,b,I,U,C+E,C+E+F,F):E-b/2,re=l==="start"?S:l==="center"?S-f/2:l==="end"?S-f:ua(v,v+f,f,L,W,v+S,v+S+_,_),ne=Math.max(0,ne+C),re=Math.max(0,re+v);else{ne=o==="start"?E-D-I:o==="end"?E-X+U+ee:o==="nearest"?ua(D,X,Q,I,U+ee,E,E+F,F):E-(D+Q/2)+ee/2,re=l==="start"?S-B-L:l==="center"?S-(B+ae/2)+le/2:l==="end"?S-$+W+le:ua(B,$,ae,L,W+le,S,S+_,_);const{scrollLeft:_e,scrollTop:Be}=H;ne=me===0?0:Math.max(0,Math.min(Be+ne/me,H.scrollHeight-Q/me+ee)),re=pe===0?0:Math.max(0,Math.min(_e+re/pe,H.scrollWidth-ae/pe+le)),E+=Be-ne,S+=_e-re}O.push({el:H,top:ne,left:re})}return O},My=e=>e===!1?{block:"end",inline:"nearest"}:(t=>t===Object(t)&&Object.keys(t).length!==0)(e)?e:{block:"start",inline:"nearest"};function Ny(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(El(e,t));const r=typeof t=="boolean"||t==null?void 0:t.behavior;for(const{el:a,top:i,left:s}of El(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 _n=[],Ry=function(){return _n.some(function(e){return e.activeTargets.length>0})},Iy=function(){return _n.some(function(e){return e.skippedTargets.length>0})},_l="ResizeObserver loop completed with undelivered notifications.",$y=function(){var e;typeof ErrorEvent=="function"?e=new ErrorEvent("error",{message:_l}):(e=document.createEvent("Event"),e.initEvent("error",!1,!1),e.message=_l),window.dispatchEvent(e)},Lr;(function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(Lr||(Lr={}));var kn=function(e){return Object.freeze(e)},Ly=function(){function e(t,n){this.inlineSize=t,this.blockSize=n,kn(this)}return e}(),ff=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,kn(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}(),wo=function(e){return e instanceof SVGElement&&"getBBox"in e},hf=function(e){if(wo(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)},kl=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)},zy=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},Fr=typeof window<"u"?window:{},la=new WeakMap,Fl=/auto|scroll/,qy=/^tb|vertical/,Wy=/msie|trident/i.test(Fr.navigator&&Fr.navigator.userAgent),Rt=function(e){return parseFloat(e||"0")},Qn=function(e,t,n){return e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=!1),new Ly((n?t:e)||0,(n?e:t)||0)},Bl=kn({devicePixelContentBoxSize:Qn(),borderBoxSize:Qn(),contentBoxSize:Qn(),contentRect:new ff(0,0,0,0)}),mf=function(e,t){if(t===void 0&&(t=!1),la.has(e)&&!t)return la.get(e);if(hf(e))return la.set(e,Bl),Bl;var n=getComputedStyle(e),r=wo(e)&&e.ownerSVGElement&&e.getBBox(),a=!Wy&&n.boxSizing==="border-box",i=qy.test(n.writingMode||""),s=!r&&Fl.test(n.overflowY||""),o=!r&&Fl.test(n.overflowX||""),l=r?0:Rt(n.paddingTop),u=r?0:Rt(n.paddingRight),d=r?0:Rt(n.paddingBottom),h=r?0:Rt(n.paddingLeft),m=r?0:Rt(n.borderTopWidth),p=r?0:Rt(n.borderRightWidth),g=r?0:Rt(n.borderBottomWidth),f=r?0:Rt(n.borderLeftWidth),b=h+u,v=l+d,C=f+p,F=m+g,_=o?e.offsetHeight-F-e.clientHeight:0,w=s?e.offsetWidth-C-e.clientWidth:0,k=a?b+C:0,j=a?v+F:0,q=r?r.width:Rt(n.width)-k-w,P=r?r.height:Rt(n.height)-j-_,z=q+b+w+C,R=P+v+_+F,A=kn({devicePixelContentBoxSize:Qn(Math.round(q*devicePixelRatio),Math.round(P*devicePixelRatio),i),borderBoxSize:Qn(z,R,i),contentBoxSize:Qn(q,P,i),contentRect:new ff(h,l,q,P)});return la.set(e,A),A},pf=function(e,t,n){var r=mf(e,n),a=r.borderBoxSize,i=r.contentBoxSize,s=r.devicePixelContentBoxSize;switch(t){case Lr.DEVICE_PIXEL_CONTENT_BOX:return s;case Lr.BORDER_BOX:return a;default:return i}},Uy=function(){function e(t){var n=mf(t);this.target=t,this.contentRect=n.contentRect,this.borderBoxSize=kn([n.borderBoxSize]),this.contentBoxSize=kn([n.contentBoxSize]),this.devicePixelContentBoxSize=kn([n.devicePixelContentBoxSize])}return e}(),gf=function(e){if(hf(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},Hy=function(){var e=1/0,t=[];_n.forEach(function(s){if(s.activeTargets.length!==0){var o=[];s.activeTargets.forEach(function(u){var d=new Uy(u.target),h=gf(u.target);o.push(d),u.lastReportedSize=pf(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},Al=function(e){_n.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(a){a.isActive()&&(gf(a.target)>e?n.activeTargets.push(a):n.skippedTargets.push(a))})})},Vy=function(){var e=0;for(Al(e);Ry();)e=Hy(),Al(e);return Iy()&&$y(),e>0},$i,vf=[],Ky=function(){return vf.splice(0).forEach(function(e){return e()})},Zy=function(e){if(!$i){var t=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return Ky()}).observe(n,r),$i=function(){n.textContent="".concat(t?t--:t++)}}vf.push(e),$i()},Yy=function(e){Zy(function(){requestAnimationFrame(e)})},_a=0,Gy=function(){return!!_a},Qy=250,Jy={attributes:!0,characterData:!0,childList:!0,subtree:!0},Tl=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Sl=function(e){return e===void 0&&(e=0),Date.now()+e},Li=!1,Xy=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=Qy),!Li){Li=!0;var r=Sl(t);Yy(function(){var a=!1;try{a=Vy()}finally{if(Li=!1,t=r-Sl(),!Gy())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,Jy)};document.body?n():Fr.addEventListener("DOMContentLoaded",n)},e.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Tl.forEach(function(n){return Fr.addEventListener(n,t.listener,!0)}))},e.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),Tl.forEach(function(n){return Fr.removeEventListener(n,t.listener,!0)}),this.stopped=!0)},e}(),Os=new Xy,jl=function(e){!_a&&e>0&&Os.start(),_a+=e,!_a&&Os.stop()},e1=function(e){return!wo(e)&&!zy(e)&&getComputedStyle(e).display==="inline"},t1=function(){function e(t,n){this.target=t,this.observedBox=n||Lr.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var t=pf(this.target,this.observedBox,!0);return e1(this.target)&&(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),n1=function(){function e(t,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=n}return e}(),ca=new WeakMap,Ol=function(e,t){for(var n=0;n<e.length;n+=1)if(e[n].target===t)return n;return-1},da=function(){function e(){}return e.connect=function(t,n){var r=new n1(t,n);ca.set(t,r)},e.observe=function(t,n,r){var a=ca.get(t),i=a.observationTargets.length===0;Ol(a.observationTargets,n)<0&&(i&&_n.push(a),a.observationTargets.push(new t1(n,r&&r.box)),jl(1),Os.schedule())},e.unobserve=function(t,n){var r=ca.get(t),a=Ol(r.observationTargets,n),i=r.observationTargets.length===1;a>=0&&(i&&_n.splice(_n.indexOf(r),1),r.observationTargets.splice(a,1),jl(-1))},e.disconnect=function(t){var n=this,r=ca.get(t);r.observationTargets.slice().forEach(function(a){return n.unobserve(t,a.target)}),r.activeTargets.splice(0,r.activeTargets.length)},e}(),r1=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.");da.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(!kl(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");da.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(!kl(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");da.unobserve(this,t)},e.prototype.disconnect=function(){da.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}(),rn={};Object.defineProperty(rn,"__esModule",{value:!0});var a1=typeof window<"u"&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),zi={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},bf={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:a1?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},Eo={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 fa=1;fa<20;fa++)Eo["f"+fa]=111+fa;function li(e,t,n){t&&!("byKey"in t)&&(n=t,t=null),Array.isArray(e)||(e=[e]);var r=e.map(function(s){return yf(s,t)}),a=function(o){return r.some(function(l){return xf(l,o)})},i=n==null?a:a(n);return i}function i1(e,t){return li(e,t)}function s1(e,t){return li(e,{byKey:!0},t)}function yf(e,t){var n=t&&t.byKey,r={};e=e.replace("++","+add");var a=e.split("+"),i=a.length;for(var s in zi)r[zi[s]]=!1;var o=!0,l=!1,u=void 0;try{for(var d=a[Symbol.iterator](),h;!(o=(h=d.next()).done);o=!0){var m=h.value,p=m.endsWith("?")&&m.length>1;p&&(m=m.slice(0,-1));var g=_o(m),f=zi[g];if(m.length>1&&!f&&!bf[m]&&!Eo[g])throw new TypeError('Unknown modifier: "'+m+'"');(i===1||!f)&&(n?r.key=g:r.which=Df(m)),f&&(r[f]=p?null:!0)}}catch(b){l=!0,u=b}finally{try{!o&&d.return&&d.return()}finally{if(l)throw u}}return r}function xf(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=_o(e);var t=Eo[e]||e.toUpperCase().charCodeAt(0);return t}function _o(e){return e=e.toLowerCase(),e=bf[e]||e,e}var o1=rn.default=li,qi=rn.isHotkey=li;rn.isCodeHotkey=i1;rn.isKeyHotkey=s1;rn.parseHotkey=yf;rn.compareHotkey=xf;rn.toKeyCode=Df;rn.toKeyName=_o;function u1(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 rr(e,t){if(e==null)return{};var n=u1(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 zr(e){"@babel/helpers - typeof";return zr=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},zr(e)}function l1(e,t){if(zr(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(zr(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function c1(e){var t=l1(e,"string");return zr(t)==="symbol"?t:String(t)}function Tt(e,t,n){return t=c1(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ko=y.createContext(null),vn=()=>{var e=y.useContext(ko);if(!e)throw new Error("The `useSlateStatic` hook must be used inside the <Slate> component's context.");return e},Cf=parseInt(y.version.split(".")[0],10),d1=typeof navigator<"u"&&typeof window<"u"&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Pl=typeof navigator<"u"&&/Mac OS X/.test(navigator.userAgent),dt=typeof navigator<"u"&&/Android/.test(navigator.userAgent),Zn=typeof navigator<"u"&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Er=typeof navigator<"u"&&/AppleWebKit(?!.*Chrome)/i.test(navigator.userAgent),f1=typeof navigator<"u"&&/Edge?\/(?:[0-6][0-9]|[0-7][0-8])(?:\.)/i.test(navigator.userAgent),wf=typeof navigator<"u"&&/Chrome/i.test(navigator.userAgent),h1=typeof navigator<"u"&&/Chrome?\/(?:[0-7][0-5]|[0-6][0-9])(?:\.)/i.test(navigator.userAgent),m1=dt&&typeof navigator<"u"&&/Chrome?\/(?:[0-5]?\d)(?:\.)/i.test(navigator.userAgent),p1=typeof navigator<"u"&&/^(?!.*Seamonkey)(?=.*Firefox\/(?:[0-7][0-9]|[0-8][0-6])(?:\.)).*/i.test(navigator.userAgent),g1=typeof navigator<"u"&&/.*UCBrowser/.test(navigator.userAgent),v1=typeof navigator<"u"&&/.*Wechat/.test(navigator.userAgent)&&!/.*MacWechat/.test(navigator.userAgent),ka=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",sn=(!h1||!m1)&&!f1&&typeof globalThis<"u"&&globalThis.InputEvent&&typeof globalThis.InputEvent.prototype.getTargetRanges=="function",Fo=new WeakMap,Bo=new WeakMap,Ef=new WeakMap,Fa=new WeakMap,Ps=new WeakMap,qr=new WeakMap,Fn=new WeakMap,Wa=new WeakMap,ci=new WeakMap,Ms=new WeakMap,fn=new WeakMap,wn=new WeakMap,Br=new WeakMap,Ns=new WeakMap,Ao=new WeakMap,Ot=new WeakMap,Gt=new WeakMap,pt=new WeakMap,un=new WeakMap,ln=new WeakMap,_f=new WeakMap,ar=Symbol("placeholder"),kf=Symbol("mark-placeholder"),b1=globalThis.Text,To=e=>e&&e.ownerDocument&&e.ownerDocument.defaultView||null,y1=e=>hn(e)&&e.nodeType===8,At=e=>hn(e)&&e.nodeType===1,hn=e=>{var t=To(e);return!!t&&e instanceof t.Node},Rs=e=>{var t=e&&e.anchorNode&&To(e.anchorNode);return!!t&&e instanceof t.Selection},Ff=e=>hn(e)&&e.nodeType===3,x1=e=>e.clipboardData&&e.clipboardData.getData("text/plain")!==""&&e.clipboardData.types.length===1,D1=e=>{var[t,n]=e;if(At(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;At(t)&&t.childNodes.length;){var i=r?t.childNodes.length-1:0;t=w1(t,i,r?"backward":"forward")}n=r&&t.textContent!=null?t.textContent.length:0}return[t,n]},C1=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;(y1(a)||At(a)&&a.childNodes.length===0||At(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]},w1=(e,t,n)=>{var[r]=Bf(e,t,n);return r},Af=e=>{var t="";if(Ff(e)&&e.nodeValue)return e.nodeValue;if(At(e)){for(var n of Array.from(e.childNodes))t+=Af(n);var r=getComputedStyle(e).getPropertyValue("display");(r==="block"||r==="list"||e.tagName==="BR")&&(t+=`
130
130
  `)}return t},E1=/data-slate-fragment="(.+?)"/m,_1=e=>{var t=e.getData("text/html"),[,n]=t.match(E1)||[];return n},So=(e,t,n)=>{var{target:r}=t;if(At(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 d of l)if(d===r||d.contains(r))return!0});return!i||i===t?!1:So(e,i,n)},k1=0;class F1{constructor(){Tt(this,"id",void 0),this.id="".concat(k1++)}}var te={androidPendingDiffs:e=>pt.get(e),androidScheduleFlush:e=>{var t;(t=Ao.get(e))===null||t===void 0||t()},blur:e=>{var t=te.toDOMNode(e,e),n=te.findDocumentOrShadowRoot(e);fn.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)&&x.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=x.point(e,s,{edge:l?"start":"end"}),d=l?x.before(e,u):x.after(e,u);if(d){var h=x.range(e,d);return h}}var m,{document:p}=te.getWindow(e);if(p.caretRangeFromPoint)m=p.caretRangeFromPoint(n,r);else{var g=p.caretPositionFromPoint(n,r);g&&(m=p.createRange(),m.setStart(g.offsetNode,g.offset),m.setEnd(g.offsetNode,g.offset))}if(!m)throw new Error("Cannot resolve a Slate range from a DOM event: ".concat(t));var f=te.toSlateRange(e,m,{exactMatch:!1,suppressThrow:!1});return f},findKey:(e,t)=>{var n=Wa.get(t);return n||(n=new F1,Wa.set(t,n)),n},findPath:(e,t)=>{for(var n=[],r=t;;){var a=Bo.get(r);if(a==null){if(x.isEditor(r))return n;break}var i=Fo.get(r);if(i==null)break;n.unshift(i),r=a}throw new Error("Unable to find the path for Slate node: ".concat(nt.stringify(t)))},focus:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{retries:5};if(!fn.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,x.start(t,[])),t.onChange()),fn.set(t,!0),r.focus({preventScroll:!0})}}},getWindow:e=>{var t=Ef.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=At(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)=>hn(t)&&te.hasDOMNode(e,t,{editable:!0}),hasRange:(e,t)=>{var{anchor:n,focus:r}=t;return x.hasPath(e,n.path)&&x.hasPath(e,r.path)},hasSelectableTarget:(e,t)=>te.hasEditableTarget(e,t)||te.isTargetInsideNonReadonlyVoid(e,t),hasTarget:(e,t)=>hn(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=>!!wn.get(e),isFocused:e=>!!fn.get(e),isReadOnly:e=>!!Ms.get(e),isTargetInsideNonReadonlyVoid:(e,t)=>{if(Ms.get(e))return!1;var n=te.hasTarget(e,t)&&te.toSlateNode(e,t);return de.isElement(n)&&x.isVoid(e,n)},setFragmentData:(e,t,n)=>e.setFragmentData(t,n),toDOMNode:(e,t)=>{var n=ci.get(e),r=x.isEditor(t)?Fa.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(nt.stringify(t)));return r},toDOMPoint:(e,t)=>{var[n]=x.node(e,t.path),r=te.toDOMNode(e,n),a;x.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],d=u.childNodes[0];if(!(d==null||d.textContent==null)){var{length:h}=d.textContent,m=u.getAttribute("data-slate-length"),p=m==null?h:parseInt(m,10),g=o+p,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 b1?v:f,(b=f.textContent)!==null&&b!==void 0&&b.startsWith("\uFEFF")?1:0];break}if(t.offset<=g){var C=Math.min(h,Math.max(0,t.offset-o));a=[d,C];break}o=g}}if(!a)throw new Error("Cannot resolve a DOM point from Slate point: ".concat(nt.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,d]=a?s:i,[h,m]=a?i:s,p=At(u)?u:u.parentElement,g=!!p.getAttribute("data-slate-zero-width"),f=At(h)?h:h.parentElement,b=!!f.getAttribute("data-slate-zero-width");return l.setStart(u,g?1:d),l.setEnd(h,b?1:m),l},toSlateNode:(e,t)=>{var n=At(t)?t:t.parentElement;n&&!n.hasAttribute("data-slate-node")&&(n=n.closest("[data-slate-node]"));var r=n?qr.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:D1(t),o=i.parentNode,l=null,u=0;if(o){var d,h,m=te.toDOMNode(e,e),p=o.closest('[data-slate-void="true"]'),g=p&&m.contains(p)?p: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),C=v.document.createRange();C.setStart(l,0),C.setEnd(i,s);var F=C.cloneContents(),_=[...Array.prototype.slice.call(F.querySelectorAll("[data-slate-zero-width]")),...Array.prototype.slice.call(F.querySelectorAll("[contenteditable=false]"))];_.forEach(S=>{if(dt&&!r&&S.hasAttribute("data-slate-zero-width")&&S.textContent.length>0&&S.textContext!=="\uFEFF"){S.textContent.startsWith("\uFEFF")&&(S.textContent=S.textContent.slice(1));return}S.parentNode.removeChild(S)}),u=F.textContent.length,b=l}}else if(g){for(var w=g.querySelectorAll("[data-slate-leaf]"),k=0;k<w.length;k++){var j=w[k];if(te.hasDOMNode(e,j)){f=j;break}}f?(l=f.closest('[data-slate-node="text"]'),b=f,u=b.textContent.length,b.querySelectorAll("[data-slate-zero-width]").forEach(S=>{u-=S.textContent.length})):u=1}b&&u===b.textContent.length&&dt&&b.getAttribute("data-slate-zero-width")==="z"&&(d=b.textContent)!==null&&d!==void 0&&d.startsWith("\uFEFF")&&(o.hasAttribute("data-slate-zero-width")||Zn&&(h=b.textContent)!==null&&h!==void 0&&h.endsWith(`
131
131
 
132
132
  `))&&u--}if(dt&&!l&&!r){var q=o.hasAttribute("data-slate-node")?o:o.closest("[data-slate-node]");if(q&&te.hasDOMNode(e,q,{editable:!0})){var P=te.toSlateNode(e,q),{path:z,offset:R}=x.start(e,te.findPath(e,P));return q.querySelector("[data-slate-leaf]")||(R=s),{path:z,offset:R}}}if(!l){if(a)return null;throw new Error("Cannot resolve a Slate point from DOM point: ".concat(t))}var A=te.toSlateNode(e,l),E=te.findPath(e,A);return{path:E,offset:u}},toSlateRange:(e,t,n)=>{var r,{exactMatch:a,suppressThrow:i}=n,s=Rs(t)?t.anchorNode:t.startContainer,o,l,u,d,h;if(s)if(Rs(t)){if(Zn&&t.rangeCount>1){u=t.focusNode;var m=t.getRangeAt(0),p=t.getRangeAt(t.rangeCount-1);if(u instanceof HTMLTableRowElement&&m.startContainer instanceof HTMLTableRowElement&&p.startContainer instanceof HTMLTableRowElement){let k=function(j){return j.childElementCount>0?k(j.children[0]):j};var g=m.startContainer,f=p.startContainer,b=k(g.children[m.startOffset]),v=k(f.children[p.startOffset]);d=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 m.startContainer===u?(o=p.endContainer,l=p.endOffset,d=m.startOffset):(o=m.startContainer,l=m.endOffset,d=p.startOffset)}else o=t.anchorNode,l=t.anchorOffset,u=t.focusNode,d=t.focusOffset;wf&&C1(o)||Zn?h=t.anchorNode===t.focusNode&&t.anchorOffset===t.focusOffset:h=t.isCollapsed}else o=t.startContainer,l=t.startOffset,u=t.endContainer,d=t.endOffset,h=t.collapsed;if(o==null||u==null||l==null||d==null)throw new Error("Cannot resolve a Slate range from DOM range: ".concat(t));if(Zn&&(r=u.textContent)!==null&&r!==void 0&&r.endsWith(`
133
133
 
134
- `)&&d===u.textContent.length&&d--,"getAttribute"in u&&u.getAttribute("contenteditable")==="false"&&u.getAttribute("data-slate-void")!=="true"){var C;u=o,d=((C=o.textContent)===null||C===void 0?void 0:C.length)||0}var F=te.toSlatePoint(e,[o,l],{exactMatch:a,suppressThrow:i});if(!F)return null;var _=h?F:te.toSlatePoint(e,[u,d],{exactMatch:a,suppressThrow:i});if(!_)return null;var w={anchor:F,focus:_};return Z.isExpanded(w)&&Z.isForward(w)&&At(u)&&x.void(e,{at:w.focus,mode:"highest"})&&(w=x.unhangRange(e,w,{voids:!0})),w}};function B1(e,t){var{path:n,diff:r}=t;if(!x.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=N.next(n);if(!x.hasPath(e,i))return!1;var s=ue.get(e,i);return fe.isText(s)&&s.text.startsWith(r.text)}function Tf(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 A1(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 T1(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 Sf(e,t){var{start:n,end:r,text:a}=t,i=e.slice(n,r),s=A1(i,a),o=Math.min(i.length-s,a.length-s),l=T1(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 S1(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=Tf(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 Sf(e,{start:r,end:l,text:o})}function j1(e){var{path:t,diff:n}=e;return{anchor:{path:t,offset:n.start},focus:{path:t,offset:n.end}}}function Is(e,t){var{path:n,offset:r}=t;if(!x.hasPath(e,n))return null;var a=ue.get(e,n);if(!fe.isText(a))return null;var i=x.above(e,{match:o=>de.isElement(o)&&x.isBlock(e,o),at:n});if(!i)return null;for(;r>a.text.length;){var s=x.next(e,{at:n,match:fe.isText});if(!s||!N.isDescendant(s[1],i[1]))return null;r-=a.text.length,a=s[0],n=s[1]}return{path:n,offset:r}}function Ml(e,t){var n=Is(e,t.anchor);if(!n)return null;if(Z.isCollapsed(t))return{anchor:n,focus:n};var r=Is(e,t.focus);return r?{anchor:n,focus:r}:null}function $s(e,t,n){var r=pt.get(e),a=r==null?void 0:r.find(d=>{var{path:h}=d;return N.equals(h,t.path)});if(!a||t.offset<=a.diff.start)return ke.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=ke.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=ke.transform(l,n,{affinity:"backward"});return u?n.type==="split_node"&&N.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 Nl(e,t,n){var r=$s(e,t.anchor,n);if(!r)return null;if(Z.isCollapsed(t))return{anchor:r,focus:r};var a=$s(e,t.focus,n);return a?{anchor:r,focus:a}:null}function O1(e,t){var{path:n,diff:r,id:a}=e;switch(t.type){case"insert_text":return!N.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!N.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!N.equals(t.path,n)||t.position>=r.end?{diff:r,id:a,path:N.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:N.transform(n,t,{affinity:"forward"})};case"merge_node":return N.equals(t.path,n)?{diff:{start:r.start+t.position,end:r.end+t.position,text:r.text},id:a,path:N.transform(n,t)}:{diff:r,id:a,path:N.transform(n,t)}}var i=N.transform(n,t);return i?{diff:r,path:i,id:a}:null}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 ha(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){Tt(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 P1=25,M1=200,N1=function(){},R1=e=>(e==null?void 0:e.constructor.name)==="DataTransfer";function I1(e){var{editor:t,scheduleOnDOMSelectionChange:n,onDOMSelectionChange:r}=e,a=!1,i=null,s=null,o=null,l=0,u=!1,d=()=>{var A=ln.get(t);if(ln.delete(t),A){var{selection:E}=t,S=Ml(t,A);S&&(!E||!Z.equals(S,E))&&J.select(t,S)}},h=()=>{var A=un.get(t);if(un.delete(t),!!A){if(A.at){var E=ke.isPoint(A.at)?Is(t,A.at):Ml(t,A.at);if(!E)return;var S=x.range(t,E);(!t.selection||!Z.equals(t.selection,S))&&J.select(t,E)}A.run()}},m=()=>{if(s&&(clearTimeout(s),s=null),o&&(clearTimeout(o),o=null),!_()&&!F()){d();return}a||(a=!0,setTimeout(()=>a=!1)),F()&&(a="action");var A=t.selection&&x.rangeRef(t,t.selection,{affinity:"forward"});Gt.set(t,t.marks),N1("flush",un.get(t),pt.get(t));for(var E=_(),S;S=(O=pt.get(t))===null||O===void 0?void 0:O[0];){var O,V,H=Ot.get(t);H!==void 0&&(Ot.delete(t),t.marks=H),H&&u===!1&&(u=null);var Q=j1(S);(!t.selection||!Z.equals(t.selection,Q))&&J.select(t,Q),S.diff.text?x.insertText(t,S.diff.text):x.deleteFragment(t),pt.set(t,(V=pt.get(t))===null||V===void 0?void 0:V.filter($=>{var{id:ee}=$;return ee!==S.id})),B1(t,S)||(E=!1,un.delete(t),Gt.delete(t),a="action",ln.delete(t),n.cancel(),r.cancel(),A==null||A.unref())}var ae=A==null?void 0:A.unref();if(ae&&!ln.get(t)&&(!t.selection||!Z.equals(ae,t.selection))&&J.select(t,ae),F()){h();return}E&&n(),n.flush(),r.flush(),d();var D=Gt.get(t);Gt.delete(t),D!==void 0&&(t.marks=D,t.onChange())},p=A=>{i&&clearTimeout(i),i=setTimeout(()=>{wn.set(t,!1),m()},P1)},g=A=>{wn.set(t,!0),i&&(clearTimeout(i),i=null)},f=function(){var E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,S=Ps.get(t);if(S){if(_()||E){S.style.display="none";return}S.style.removeProperty("display")}},b=(A,E)=>{var S,O=(S=pt.get(t))!==null&&S!==void 0?S:[];pt.set(t,O);var V=ue.leaf(t,A),H=O.findIndex(D=>N.equals(D.path,A));if(H<0){var Q=Sf(V.text,E);Q&&O.push({path:A,diff:E,id:l++}),f();return}var ae=S1(V.text,O[H].diff,E);if(!ae){O.splice(H,1),f();return}O[H]=ha(ha({},O[H]),{},{diff:ae})},v=function(E){var{at:S}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};u=!1,ln.delete(t),n.cancel(),r.cancel(),F()&&m(),un.set(t,{at:S,run:E}),o=setTimeout(m)},C=A=>{var E;s&&(clearTimeout(s),s=null);var{inputType:S}=A,O=null,V=A.dataTransfer||A.data||void 0;u!==!1&&S!=="insertText"&&S!=="insertCompositionText"&&(u=!1);var[H]=A.getTargetRanges();H&&(O=te.toSlateRange(t,H,{exactMatch:!1,suppressThrow:!0}));var Q=te.getWindow(t),ae=Q.getSelection();if(!O&&ae&&(H=ae,O=te.toSlateRange(t,ae,{exactMatch:!1,suppressThrow:!0})),O=(E=O)!==null&&E!==void 0?E:t.selection,!!O){var D=!0;if(S.startsWith("delete")){if(Z.isExpanded(O)){var[$,ee]=Z.edges(O),B=ue.leaf(t,$.path);if(B.text.length===$.offset&&ee.offset===0){var T=x.next(t,{at:$.path,match:fe.isText});T&&N.equals(T[1],ee.path)&&(O={anchor:ee,focus:ee})}}var L=S.endsWith("Backward")?"backward":"forward",[I,W]=Z.edges(O),[U,ne]=x.leaf(t,I.path),re={text:"",start:I.offset,end:W.offset},le=pt.get(t),X=le==null?void 0:le.find(ge=>N.equals(ge.path,ne)),pe=X?[X.diff,re]:[re],me=Tf(U.text,...pe);if(me.length===0&&(D=!1),Z.isExpanded(O)){if(D&&N.equals(O.anchor.path,O.focus.path)){var _e={path:O.anchor.path,offset:I.offset},Be=x.range(t,_e,_e);return j(Be),b(O.anchor.path,{text:"",end:W.offset,start:I.offset})}return v(()=>x.deleteFragment(t,{direction:L}),{at:O})}}switch(S){case"deleteByComposition":case"deleteByCut":case"deleteByDrag":return v(()=>x.deleteFragment(t),{at:O});case"deleteContent":case"deleteContentForward":{var{anchor:Se}=O;if(D&&Z.isCollapsed(O)){var Ye=ue.leaf(t,Se.path);if(Se.offset<Ye.text.length)return b(Se.path,{text:"",start:Se.offset,end:Se.offset+1})}return v(()=>x.deleteForward(t),{at:O})}case"deleteContentBackward":{var Ke,{anchor:je}=O,Oe=Rs(H)?H.isCollapsed:!!((Ke=H)!==null&&Ke!==void 0&&Ke.collapsed);return D&&Oe&&Z.isCollapsed(O)&&je.offset>0?b(je.path,{text:"",start:je.offset-1,end:je.offset}):v(()=>x.deleteBackward(t),{at:O})}case"deleteEntireSoftLine":return v(()=>{x.deleteBackward(t,{unit:"line"}),x.deleteForward(t,{unit:"line"})},{at:O});case"deleteHardLineBackward":return v(()=>x.deleteBackward(t,{unit:"block"}),{at:O});case"deleteSoftLineBackward":return v(()=>x.deleteBackward(t,{unit:"line"}),{at:O});case"deleteHardLineForward":return v(()=>x.deleteForward(t,{unit:"block"}),{at:O});case"deleteSoftLineForward":return v(()=>x.deleteForward(t,{unit:"line"}),{at:O});case"deleteWordBackward":return v(()=>x.deleteBackward(t,{unit:"word"}),{at:O});case"deleteWordForward":return v(()=>x.deleteForward(t,{unit:"word"}),{at:O});case"insertLineBreak":return v(()=>x.insertSoftBreak(t),{at:O});case"insertParagraph":return v(()=>x.insertBreak(t),{at:O});case"insertCompositionText":case"deleteCompositionText":case"insertFromComposition":case"insertFromDrop":case"insertFromPaste":case"insertFromYank":case"insertReplacementText":case"insertText":{if(R1(V))return v(()=>te.insertData(t,V),{at:O});var De=V??"";if(Ot.get(t)&&(De=De.replace("\uFEFF","")),S==="insertText"&&/.*\n.*\n$/.test(De)&&(De=De.slice(0,-1)),De.includes(`
134
+ `)&&d===u.textContent.length&&d--,"getAttribute"in u&&u.getAttribute("contenteditable")==="false"&&u.getAttribute("data-slate-void")!=="true"){var C;u=o,d=((C=o.textContent)===null||C===void 0?void 0:C.length)||0}var F=te.toSlatePoint(e,[o,l],{exactMatch:a,suppressThrow:i});if(!F)return null;var _=h?F:te.toSlatePoint(e,[u,d],{exactMatch:a,suppressThrow:i});if(!_)return null;var w={anchor:F,focus:_};return Z.isExpanded(w)&&Z.isForward(w)&&At(u)&&x.void(e,{at:w.focus,mode:"highest"})&&(w=x.unhangRange(e,w,{voids:!0})),w}};function B1(e,t){var{path:n,diff:r}=t;if(!x.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=N.next(n);if(!x.hasPath(e,i))return!1;var s=ue.get(e,i);return fe.isText(s)&&s.text.startsWith(r.text)}function Tf(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 A1(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 T1(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 Sf(e,t){var{start:n,end:r,text:a}=t,i=e.slice(n,r),s=A1(i,a),o=Math.min(i.length-s,a.length-s),l=T1(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 S1(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=Tf(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 Sf(e,{start:r,end:l,text:o})}function j1(e){var{path:t,diff:n}=e;return{anchor:{path:t,offset:n.start},focus:{path:t,offset:n.end}}}function Is(e,t){var{path:n,offset:r}=t;if(!x.hasPath(e,n))return null;var a=ue.get(e,n);if(!fe.isText(a))return null;var i=x.above(e,{match:o=>de.isElement(o)&&x.isBlock(e,o),at:n});if(!i)return null;for(;r>a.text.length;){var s=x.next(e,{at:n,match:fe.isText});if(!s||!N.isDescendant(s[1],i[1]))return null;r-=a.text.length,a=s[0],n=s[1]}return{path:n,offset:r}}function Ml(e,t){var n=Is(e,t.anchor);if(!n)return null;if(Z.isCollapsed(t))return{anchor:n,focus:n};var r=Is(e,t.focus);return r?{anchor:n,focus:r}:null}function $s(e,t,n){var r=pt.get(e),a=r==null?void 0:r.find(d=>{var{path:h}=d;return N.equals(h,t.path)});if(!a||t.offset<=a.diff.start)return ke.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=ke.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=ke.transform(l,n,{affinity:"backward"});return u?n.type==="split_node"&&N.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 Nl(e,t,n){var r=$s(e,t.anchor,n);if(!r)return null;if(Z.isCollapsed(t))return{anchor:r,focus:r};var a=$s(e,t.focus,n);return a?{anchor:r,focus:a}:null}function O1(e,t){var{path:n,diff:r,id:a}=e;switch(t.type){case"insert_text":return!N.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!N.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!N.equals(t.path,n)||t.position>=r.end?{diff:r,id:a,path:N.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:N.transform(n,t,{affinity:"forward"})};case"merge_node":return N.equals(t.path,n)?{diff:{start:r.start+t.position,end:r.end+t.position,text:r.text},id:a,path:N.transform(n,t)}:{diff:r,id:a,path:N.transform(n,t)}}var i=N.transform(n,t);return i?{diff:r,path:i,id:a}:null}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 ha(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){Tt(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 P1=25,M1=200,N1=function(){},R1=e=>(e==null?void 0:e.constructor.name)==="DataTransfer";function I1(e){var{editor:t,scheduleOnDOMSelectionChange:n,onDOMSelectionChange:r}=e,a=!1,i=null,s=null,o=null,l=0,u=!1,d=()=>{var A=ln.get(t);if(ln.delete(t),A){var{selection:E}=t,S=Ml(t,A);S&&(!E||!Z.equals(S,E))&&J.select(t,S)}},h=()=>{var A=un.get(t);if(un.delete(t),!!A){if(A.at){var E=ke.isPoint(A.at)?Is(t,A.at):Ml(t,A.at);if(!E)return;var S=x.range(t,E);(!t.selection||!Z.equals(t.selection,S))&&J.select(t,E)}A.run()}},m=()=>{if(s&&(clearTimeout(s),s=null),o&&(clearTimeout(o),o=null),!_()&&!F()){d();return}a||(a=!0,setTimeout(()=>a=!1)),F()&&(a="action");var A=t.selection&&x.rangeRef(t,t.selection,{affinity:"forward"});Gt.set(t,t.marks),N1("flush",un.get(t),pt.get(t));for(var E=_(),S;S=(O=pt.get(t))===null||O===void 0?void 0:O[0];){var O,V,H=Ot.get(t);H!==void 0&&(Ot.delete(t),t.marks=H),H&&u===!1&&(u=null);var Q=j1(S);(!t.selection||!Z.equals(t.selection,Q))&&J.select(t,Q),S.diff.text?x.insertText(t,S.diff.text):x.deleteFragment(t),pt.set(t,(V=pt.get(t))===null||V===void 0?void 0:V.filter($=>{var{id:X}=$;return X!==S.id})),B1(t,S)||(E=!1,un.delete(t),Gt.delete(t),a="action",ln.delete(t),n.cancel(),r.cancel(),A==null||A.unref())}var ae=A==null?void 0:A.unref();if(ae&&!ln.get(t)&&(!t.selection||!Z.equals(ae,t.selection))&&J.select(t,ae),F()){h();return}E&&n(),n.flush(),r.flush(),d();var D=Gt.get(t);Gt.delete(t),D!==void 0&&(t.marks=D,t.onChange())},p=A=>{i&&clearTimeout(i),i=setTimeout(()=>{wn.set(t,!1),m()},P1)},g=A=>{wn.set(t,!0),i&&(clearTimeout(i),i=null)},f=function(){var E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,S=Ps.get(t);if(S){if(_()||E){S.style.display="none";return}S.style.removeProperty("display")}},b=(A,E)=>{var S,O=(S=pt.get(t))!==null&&S!==void 0?S:[];pt.set(t,O);var V=ue.leaf(t,A),H=O.findIndex(D=>N.equals(D.path,A));if(H<0){var Q=Sf(V.text,E);Q&&O.push({path:A,diff:E,id:l++}),f();return}var ae=S1(V.text,O[H].diff,E);if(!ae){O.splice(H,1),f();return}O[H]=ha(ha({},O[H]),{},{diff:ae})},v=function(E){var{at:S}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};u=!1,ln.delete(t),n.cancel(),r.cancel(),F()&&m(),un.set(t,{at:S,run:E}),o=setTimeout(m)},C=A=>{var E;s&&(clearTimeout(s),s=null);var{inputType:S}=A,O=null,V=A.dataTransfer||A.data||void 0;u!==!1&&S!=="insertText"&&S!=="insertCompositionText"&&(u=!1);var[H]=A.getTargetRanges();H&&(O=te.toSlateRange(t,H,{exactMatch:!1,suppressThrow:!0}));var Q=te.getWindow(t),ae=Q.getSelection();if(!O&&ae&&(H=ae,O=te.toSlateRange(t,ae,{exactMatch:!1,suppressThrow:!0})),O=(E=O)!==null&&E!==void 0?E:t.selection,!!O){var D=!0;if(S.startsWith("delete")){if(Z.isExpanded(O)){var[$,X]=Z.edges(O),B=ue.leaf(t,$.path);if(B.text.length===$.offset&&X.offset===0){var T=x.next(t,{at:$.path,match:fe.isText});T&&N.equals(T[1],X.path)&&(O={anchor:X,focus:X})}}var L=S.endsWith("Backward")?"backward":"forward",[I,W]=Z.edges(O),[U,ne]=x.leaf(t,I.path),re={text:"",start:I.offset,end:W.offset},le=pt.get(t),ee=le==null?void 0:le.find(ge=>N.equals(ge.path,ne)),pe=ee?[ee.diff,re]:[re],me=Tf(U.text,...pe);if(me.length===0&&(D=!1),Z.isExpanded(O)){if(D&&N.equals(O.anchor.path,O.focus.path)){var _e={path:O.anchor.path,offset:I.offset},Be=x.range(t,_e,_e);return j(Be),b(O.anchor.path,{text:"",end:W.offset,start:I.offset})}return v(()=>x.deleteFragment(t,{direction:L}),{at:O})}}switch(S){case"deleteByComposition":case"deleteByCut":case"deleteByDrag":return v(()=>x.deleteFragment(t),{at:O});case"deleteContent":case"deleteContentForward":{var{anchor:Se}=O;if(D&&Z.isCollapsed(O)){var Ye=ue.leaf(t,Se.path);if(Se.offset<Ye.text.length)return b(Se.path,{text:"",start:Se.offset,end:Se.offset+1})}return v(()=>x.deleteForward(t),{at:O})}case"deleteContentBackward":{var Ke,{anchor:je}=O,Oe=Rs(H)?H.isCollapsed:!!((Ke=H)!==null&&Ke!==void 0&&Ke.collapsed);return D&&Oe&&Z.isCollapsed(O)&&je.offset>0?b(je.path,{text:"",start:je.offset-1,end:je.offset}):v(()=>x.deleteBackward(t),{at:O})}case"deleteEntireSoftLine":return v(()=>{x.deleteBackward(t,{unit:"line"}),x.deleteForward(t,{unit:"line"})},{at:O});case"deleteHardLineBackward":return v(()=>x.deleteBackward(t,{unit:"block"}),{at:O});case"deleteSoftLineBackward":return v(()=>x.deleteBackward(t,{unit:"line"}),{at:O});case"deleteHardLineForward":return v(()=>x.deleteForward(t,{unit:"block"}),{at:O});case"deleteSoftLineForward":return v(()=>x.deleteForward(t,{unit:"line"}),{at:O});case"deleteWordBackward":return v(()=>x.deleteBackward(t,{unit:"word"}),{at:O});case"deleteWordForward":return v(()=>x.deleteForward(t,{unit:"word"}),{at:O});case"insertLineBreak":return v(()=>x.insertSoftBreak(t),{at:O});case"insertParagraph":return v(()=>x.insertBreak(t),{at:O});case"insertCompositionText":case"deleteCompositionText":case"insertFromComposition":case"insertFromDrop":case"insertFromPaste":case"insertFromYank":case"insertReplacementText":case"insertText":{if(R1(V))return v(()=>te.insertData(t,V),{at:O});var De=V??"";if(Ot.get(t)&&(De=De.replace("\uFEFF","")),S==="insertText"&&/.*\n.*\n$/.test(De)&&(De=De.slice(0,-1)),De.includes(`
135
135
  `))return v(()=>{var ge=De.split(`
136
136
  `);ge.forEach((Ee,be)=>{Ee&&x.insertText(t,Ee),be!==ge.length-1&&x.insertSoftBreak(t)})},{at:O});if(N.equals(O.anchor.path,O.focus.path)){var[Le,Ue]=Z.edges(O),G={start:Le.offset,end:Ue.offset,text:De};if(De&&u&&S==="insertCompositionText"){var oe=u.start+u.text.search(/\S|$/),he=G.start+G.text.search(/\S|$/);he===oe+1&&G.end===u.start+u.text.length?(G.start-=1,u=null,z()):u=!1}else S==="insertText"?u===null?u=G:u&&Z.isCollapsed(O)&&u.end+u.text.length===Le.offset?u=ha(ha({},u),{},{text:u.text+De}):u=!1:u=!1;if(D){b(Le.path,G);return}}return v(()=>x.insertText(t,De),{at:O})}}}},F=()=>!!un.get(t),_=()=>{var A;return!!((A=pt.get(t))!==null&&A!==void 0&&A.length)},w=()=>F()||_(),k=()=>a,j=A=>{ln.set(t,A),s&&(clearTimeout(s),s=null);var{selection:E}=t;if(A){var S=!E||!N.equals(E.anchor.path,A.anchor.path),O=!E||!N.equals(E.anchor.path.slice(0,-1),A.anchor.path.slice(0,-1));(S&&u||O)&&(u=!1),(S||_())&&(s=setTimeout(m,M1))}},q=()=>{(F()||!_())&&m()},P=A=>{_()||(f(!0),setTimeout(f))},z=()=>{F()||(o=setTimeout(m))},R=A=>{if(!(_()||F())&&A.some(S=>So(t,S,A))){var E;(E=_f.get(t))===null||E===void 0||E()}};return{flush:m,scheduleFlush:z,hasPendingDiffs:_,hasPendingAction:F,hasPendingChanges:w,isFlushing:k,handleUserSelect:j,handleCompositionEnd:p,handleCompositionStart:g,handleDOMBeforeInput:C,handleKeyDown:P,handleDomMutations:R,handleInput:q}}function $1(){var e=y.useRef(!1);return y.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),e.current}var Wr=ka?y.useLayoutEffect:y.useEffect;function L1(e,t,n){var[r]=y.useState(()=>new MutationObserver(t));Wr(()=>{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 z1=["node"];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 q1(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){Tt(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 W1={subtree:!0,childList:!0,characterData:!0},U1=dt?e=>{var{node:t}=e,n=rr(e,z1);if(!dt)return null;var r=vn(),a=$1(),[i]=y.useState(()=>I1(q1({editor:r},n)));return L1(t,i.handleDomMutations,W1),Ao.set(r,i.scheduleFlush),a&&i.flush(),i}:()=>null,H1=["anchor","focus"],V1=["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]),jf=(e,t)=>{var n=rr(e,H1),r=rr(t,V1);return e[ar]===t[ar]&&K1(n,r)},Z1=(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)||!jf(r,a))return!1}return!0},Y1=(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||!jf(r,a))return!1}return!0};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 G1(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){Tt(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 Q1=e=>{var{isLast:t,leaf:n,parent:r,text:a}=e,i=vn(),s=te.findPath(i,a),o=N.parent(s),l=!!n[kf];return i.isVoid(r)?y.createElement(Wi,{length:ue.string(r).length}):n.text===""&&r.children[r.children.length-1]===a&&!i.isInline(r)&&x.string(i,o)===""?y.createElement(Wi,{isLineBreak:!0,isMarkPlaceholder:l}):n.text===""?y.createElement(Wi,{isMarkPlaceholder:l}):t&&n.text.slice(-1)===`
137
137
  `?y.createElement(Ll,{isTrailing:!0,text:n.text}):y.createElement(Ll,{text:n.text})},Ll=e=>{var{text:t,isTrailing:n=!1}=e,r=y.useRef(null),a=()=>"".concat(t??"").concat(n?`
138
- `:""),[i]=y.useState(a);return Wr(()=>{var s=a();r.current&&r.current.textContent!==s&&(r.current.textContent=s)}),y.createElement(J1,{ref:r},i)},J1=y.memo(y.forwardRef((e,t)=>y.createElement("span",{"data-slate-string":!0,ref:t},e.children))),Wi=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",G1({},a),!dt||!n?"\uFEFF":null,n?y.createElement("br",null):null)};function zl(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 Of(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zl(Object(n),!0).forEach(function(r){Tt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zl(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var X1=dt?300:0;function ex(e,t){e.current&&(e.current.disconnect(),t&&(e.current=null))}function ql(e){e.current&&(clearTimeout(e.current),e.current=null)}var tx=e=>{var{leaf:t,isLast:n,text:r,parent:a,renderPlaceholder:i,renderLeaf:s=C=>y.createElement(rx,Of({},C))}=e,o=vn(),l=y.useRef(null),u=y.useRef(null),[d,h]=y.useState(!1),m=y.useRef(null),p=y.useCallback(C=>{if(ex(l,C==null),C==null){var F;Ps.delete(o),(F=t.onPlaceholderResize)===null||F===void 0||F.call(t,null)}else{if(Ps.set(o,C),!l.current){var _=window.ResizeObserver||r1;l.current=new _(()=>{var w;(w=t.onPlaceholderResize)===null||w===void 0||w.call(t,C)})}l.current.observe(C),u.current=C}},[u,t,o]),g=y.createElement(Q1,{isLast:n,leaf:t,parent:a,text:r}),f=!!t[ar];if(y.useEffect(()=>(f?m.current||(m.current=setTimeout(()=>{h(!0),m.current=null},X1)):(ql(m),h(!1)),()=>ql(m)),[f,h]),f&&d){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:Er?"inherit":void 0},contentEditable:!1,ref:p}};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})},nx=y.memo(tx,(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[ar]===e.leaf[ar]),rx=e=>{var{attributes:t,children:n}=e;return y.createElement("span",Of({},t),n)},ax=e=>{for(var{decorations:t,isLast:n,parent:r,renderPlaceholder:a,renderLeaf:i,text:s}=e,o=vn(),l=y.useRef(null),u=fe.decorations(s,t),d=te.findKey(o,s),h=[],m=0;m<u.length;m++){var p=u[m];h.push(y.createElement(nx,{isLast:n&&m===u.length-1,key:"".concat(d.id,"-").concat(m),renderPlaceholder:a,leaf:p,text:s,parent:r,renderLeaf:i}))}var g=y.useCallback(f=>{var b=ci.get(o);f?(b==null||b.set(d,f),Fn.set(s,f),qr.set(f,s)):(b==null||b.delete(d),Fn.delete(s),l.current&&qr.delete(l.current)),l.current=f},[l,o,d,s]);return y.createElement("span",{"data-slate-node":"text",ref:g},h)},Pf=y.memo(ax,(e,t)=>t.parent===e.parent&&t.isLast===e.isLast&&t.renderLeaf===e.renderLeaf&&t.renderPlaceholder===e.renderPlaceholder&&t.text===e.text&&Y1(t.decorations,e.decorations));function Wl(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 Ls(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Wl(Object(n),!0).forEach(function(r){Tt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wl(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var ix=e=>{var{decorations:t,element:n,renderElement:r=C=>y.createElement(ox,Ls({},C)),renderPlaceholder:a,renderLeaf:i,selection:s}=e,o=vn(),l=cx(),u=o.isInline(n),d=te.findKey(o,n),h=y.useCallback(C=>{var F=ci.get(o);C?(F==null||F.set(d,C),Fn.set(n,C),qr.set(C,n)):(F==null||F.delete(d),Fn.delete(n))},[o,d,n]),m=Nf({decorations:t,node:n,renderElement:r,renderPlaceholder:a,renderLeaf:i,selection:s}),p={"data-slate-node":"element",ref:h};if(u&&(p["data-slate-inline"]=!0),!u&&x.hasInlines(o,n)){var g=ue.string(n),f=of(g);f==="rtl"&&(p.dir=f)}if(x.isVoid(o,n)){p["data-slate-void"]=!0,!l&&u&&(p.contentEditable=!1);var b=u?"span":"div",[[v]]=ue.texts(n);m=y.createElement(b,{"data-slate-spacer":!0,style:{height:"0",color:"transparent",outline:"none",position:"absolute"}},y.createElement(Pf,{renderPlaceholder:a,decorations:[],isLast:!1,parent:n,text:v})),Fo.set(v,0),Bo.set(v,n)}return r({attributes:p,children:m,element:n})},sx=y.memo(ix,(e,t)=>e.element===t.element&&e.renderElement===t.renderElement&&e.renderLeaf===t.renderLeaf&&e.renderPlaceholder===t.renderPlaceholder&&Z1(e.decorations,t.decorations)&&(e.selection===t.selection||!!e.selection&&!!t.selection&&Z.equals(e.selection,t.selection))),ox=e=>{var{attributes:t,children:n,element:r}=e,a=vn(),i=a.isInline(r)?"span":"div";return y.createElement(i,Ls(Ls({},t),{},{style:{position:"relative"}}),n)},Mf=y.createContext(()=>[]),ux=()=>y.useContext(Mf),lx=y.createContext(!1),Nf=e=>{for(var{decorations:t,node:n,renderElement:r,renderPlaceholder:a,renderLeaf:i,selection:s}=e,o=ux(),l=vn(),u=te.findPath(l,n),d=[],h=de.isElement(n)&&!l.isInline(n)&&x.hasInlines(l,n),m=0;m<n.children.length;m++){var p=u.concat(m),g=n.children[m],f=te.findKey(l,g),b=x.range(l,p),v=s&&Z.intersection(b,s),C=o([g,p]);for(var F of t){var _=Z.intersection(F,b);_&&C.push(_)}de.isElement(g)?d.push(y.createElement(lx.Provider,{key:"provider-".concat(f.id),value:!!v},y.createElement(sx,{decorations:C,element:g,key:f.id,renderElement:r,renderPlaceholder:a,renderLeaf:i,selection:v}))):d.push(y.createElement(Pf,{decorations:C,key:f.id,isLast:h&&m===n.children.length-1,parent:n,renderPlaceholder:a,renderLeaf:i,text:g})),Fo.set(g,m),Bo.set(g,n)}return d},Rf=y.createContext(!1),cx=()=>y.useContext(Rf),If=y.createContext(null),Nn=()=>{var e=y.useContext(If);if(!e)throw new Error("The `useSlate` hook must be used inside the <Slate> component's context.");var{editor:t}=e;return t};function dx(){var e=vn(),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 fx=3,hx={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"},mx={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"},px={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},Ve=e=>{var t=hx[e],n=mx[e],r=px[e],a=t&&qi(t),i=n&&qi(n),s=r&&qi(r);return o=>!!(a&&a(o)||Pl&&i&&i(o)||!Pl&&s&&s(o))},Ze={isBold:Ve("bold"),isCompose:Ve("compose"),isMoveBackward:Ve("moveBackward"),isMoveForward:Ve("moveForward"),isDeleteBackward:Ve("deleteBackward"),isDeleteForward:Ve("deleteForward"),isDeleteLineBackward:Ve("deleteLineBackward"),isDeleteLineForward:Ve("deleteLineForward"),isDeleteWordBackward:Ve("deleteWordBackward"),isDeleteWordForward:Ve("deleteWordForward"),isExtendBackward:Ve("extendBackward"),isExtendForward:Ve("extendForward"),isExtendLineBackward:Ve("extendLineBackward"),isExtendLineForward:Ve("extendLineForward"),isItalic:Ve("italic"),isMoveLineBackward:Ve("moveLineBackward"),isMoveLineForward:Ve("moveLineForward"),isMoveWordBackward:Ve("moveWordBackward"),isMoveWordForward:Ve("moveWordForward"),isRedo:Ve("redo"),isSoftBreak:Ve("insertSoftBreak"),isSplitBlock:Ve("splitBlock"),isTransposeCharacter:Ve("transposeCharacter"),isUndo:Ve("undo")},gx=(e,t)=>{var n=[],r=()=>{n=[]},a=s=>{if(t.current){var o=s.filter(l=>So(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}},vx={subtree:!0,childList:!0,characterData:!0,characterDataOldValue:!0};class $f extends y.Component{constructor(){super(...arguments),Tt(this,"context",null),Tt(this,"manager",null),Tt(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,vx)}componentDidMount(){var{receivedUserInput:t}=this.props,n=this.context;this.manager=gx(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}}Tt($f,"contextType",ko);var bx=dt?$f:e=>{var{children:t}=e;return y.createElement(y.Fragment,null,t)},yx=["autoFocus","decorate","onDOMBeforeInput","placeholder","readOnly","renderElement","renderLeaf","renderPlaceholder","scrollSelectionIntoView","style","as","disableDefaultStyles"],xx=["text"];function Ul(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 $t(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ul(Object(n),!0).forEach(function(r){Tt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ul(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Dx=e=>y.createElement(y.Fragment,null,Nf(e)),Cx=e=>{var t=y.useCallback(T=>y.createElement(wx,$t({},T)),[]),{autoFocus:n,decorate:r=Ex,onDOMBeforeInput:a,placeholder:i,readOnly:s=!1,renderElement:o,renderLeaf:l,renderPlaceholder:u=t,scrollSelectionIntoView:d=_x,style:h={},as:m="div",disableDefaultStyles:p=!1}=e,g=rr(e,yx),f=Nn(),[b,v]=y.useState(!1),C=y.useRef(null),F=y.useRef([]),[_,w]=y.useState(),{onUserInput:k,receivedUserInput:j}=dx(),[,q]=y.useReducer(T=>T+1,0);_f.set(f,q),Ms.set(f,s);var P=y.useMemo(()=>({isDraggingInternally:!1,isUpdatingSelection:!1,latestElement:null,hasMarkPlaceholder:!1}),[]);y.useEffect(()=>{C.current&&n&&C.current.focus()},[n]);var z=y.useRef(),R=y.useMemo(()=>Oy(()=>{var T=z.current;if((dt||!te.isComposing(f))&&(!P.isUpdatingSelection||T!=null&&T.isFlushing())&&!P.isDraggingInternally){var L=te.findDocumentOrShadowRoot(f),{activeElement:I}=L,W=te.toDOMNode(f,f),U=L.getSelection();if(I===W?(P.latestElement=I,fn.set(f,!0)):fn.delete(f),!U)return J.deselect(f);var{anchorNode:ne,focusNode:re}=U,le=te.hasEditableTarget(f,ne)||te.isTargetInsideNonReadonlyVoid(f,ne),X=te.hasEditableTarget(f,re)||te.isTargetInsideNonReadonlyVoid(f,re);if(le&&X){var pe=te.toSlateRange(f,U,{exactMatch:!1,suppressThrow:!0});pe&&(!te.isComposing(f)&&!(T!=null&&T.hasPendingChanges())&&!(T!=null&&T.isFlushing())?J.select(f,pe):T==null||T.handleUserSelect(pe))}s&&(!le||!X)&&J.deselect(f)}},100),[f,s,P]),A=y.useMemo(()=>Fy(R,0),[R]);z.current=U1({node:C,onDOMSelectionChange:R,scheduleOnDOMSelectionChange:A}),Wr(()=>{var T,L,I;C.current&&(I=To(C.current))?(Ef.set(f,I),Fa.set(f,C.current),Fn.set(f,C.current),qr.set(C.current,f)):Fn.delete(f);var{selection:W}=f,U=te.findDocumentOrShadowRoot(f),ne=U.getSelection();if(!(!ne||!te.isFocused(f)||(T=z.current)!==null&&T!==void 0&&T.hasPendingAction())){var re=me=>{var _e=ne.type!=="None";if(!(!W&&!_e)){var Be=ne.focusNode,Se;if(Zn&&ne.rangeCount>1){var Ye=ne.getRangeAt(0),Ke=ne.getRangeAt(ne.rangeCount-1);Ye.startContainer===Be?Se=Ke.endContainer:Se=Ye.startContainer}else Se=ne.anchorNode;var je=Fa.get(f),Oe=!1;if(je.contains(Se)&&je.contains(Be)&&(Oe=!0),_e&&Oe&&W&&!me){var De=te.toSlateRange(f,ne,{exactMatch:!0,suppressThrow:!0});if(De&&Z.equals(De,W)){var Le;if(!P.hasMarkPlaceholder||(Le=Se)!==null&&Le!==void 0&&(Le=Le.parentElement)!==null&&Le!==void 0&&Le.hasAttribute("data-slate-mark-placeholder"))return}}if(W&&!te.hasRange(f,W)){f.selection=te.toSlateRange(f,ne,{exactMatch:!1,suppressThrow:!0});return}P.isUpdatingSelection=!0;var Ue=W&&te.toDOMRange(f,W);return Ue?(te.isComposing(f)&&!dt?ne.collapseToEnd():Z.isBackward(W)?ne.setBaseAndExtent(Ue.endContainer,Ue.endOffset,Ue.startContainer,Ue.startOffset):ne.setBaseAndExtent(Ue.startContainer,Ue.startOffset,Ue.endContainer,Ue.endOffset),d(f,Ue)):ne.removeAllRanges(),Ue}};ne.rangeCount<=1&&re();var le=((L=z.current)===null||L===void 0?void 0:L.isFlushing())==="action";if(!dt||!le){setTimeout(()=>{P.isUpdatingSelection=!1});return}var X=null,pe=requestAnimationFrame(()=>{if(le){var me=_e=>{try{var Be=te.toDOMNode(f,f);Be.focus(),re(_e)}catch{}};me(),X=setTimeout(()=>{me(!0),P.isUpdatingSelection=!1})}});return()=>{cancelAnimationFrame(pe),X&&clearTimeout(X)}}});var E=y.useCallback(T=>{if(k(),!s&&te.hasEditableTarget(f,T.target)&&!kx(T,a)){var L;if(z.current)return z.current.handleDOMBeforeInput(T);A.flush(),R.flush();var{selection:I}=f,{inputType:W}=T,U=T.dataTransfer||T.data||void 0,ne=W==="insertCompositionText"||W==="deleteCompositionText";if(ne&&te.isComposing(f))return;var re=!1;if(W==="insertText"&&I&&Z.isCollapsed(I)&&T.data&&T.data.length===1&&/[a-z ]/i.test(T.data)&&I.anchor.offset!==0){var le,X;re=!0,f.marks&&(re=!1);var{anchor:pe}=I,[me,_e]=te.toDOMPoint(f,pe),Be=(le=me.parentElement)===null||le===void 0?void 0:le.closest("a"),Se=te.getWindow(f);if(re&&Be&&te.hasDOMNode(f,Be)){var Ye,Ke=Se==null?void 0:Se.document.createTreeWalker(Be,NodeFilter.SHOW_TEXT).lastChild();Ke===me&&((Ye=Ke.textContent)===null||Ye===void 0?void 0:Ye.length)===_e&&(re=!1)}if(re&&me.parentElement&&(Se==null||(X=Se.getComputedStyle(me.parentElement))===null||X===void 0?void 0:X.whiteSpace)==="pre"){var je=x.above(f,{at:pe.path,match:oe=>de.isElement(oe)&&x.isBlock(f,oe)});je&&ue.string(je[0]).includes(" ")&&(re=!1)}}if(!W.startsWith("delete")||W.startsWith("deleteBy")){var[Oe]=T.getTargetRanges();if(Oe){var De=te.toSlateRange(f,Oe,{exactMatch:!1,suppressThrow:!1});if(!I||!Z.equals(I,De)){re=!1;var Le=!ne&&f.selection&&x.rangeRef(f,f.selection);J.select(f,De),Le&&Br.set(f,Le)}}}if(ne)return;if(re||T.preventDefault(),I&&Z.isExpanded(I)&&W.startsWith("delete")){var Ue=W.endsWith("Backward")?"backward":"forward";x.deleteFragment(f,{direction:Ue});return}switch(W){case"deleteByComposition":case"deleteByCut":case"deleteByDrag":{x.deleteFragment(f);break}case"deleteContent":case"deleteContentForward":{x.deleteForward(f);break}case"deleteContentBackward":{x.deleteBackward(f);break}case"deleteEntireSoftLine":{x.deleteBackward(f,{unit:"line"}),x.deleteForward(f,{unit:"line"});break}case"deleteHardLineBackward":{x.deleteBackward(f,{unit:"block"});break}case"deleteSoftLineBackward":{x.deleteBackward(f,{unit:"line"});break}case"deleteHardLineForward":{x.deleteForward(f,{unit:"block"});break}case"deleteSoftLineForward":{x.deleteForward(f,{unit:"line"});break}case"deleteWordBackward":{x.deleteBackward(f,{unit:"word"});break}case"deleteWordForward":{x.deleteForward(f,{unit:"word"});break}case"insertLineBreak":x.insertSoftBreak(f);break;case"insertParagraph":{x.insertBreak(f);break}case"insertFromComposition":case"insertFromDrop":case"insertFromPaste":case"insertFromYank":case"insertReplacementText":case"insertText":{W==="insertFromComposition"&&te.isComposing(f)&&(v(!1),wn.set(f,!1)),(U==null?void 0:U.constructor.name)==="DataTransfer"?te.insertData(f,U):typeof U=="string"&&(re?F.current.push(()=>x.insertText(f,U)):x.insertText(f,U));break}}var G=(L=Br.get(f))===null||L===void 0?void 0:L.unref();Br.delete(f),G&&(!f.selection||!Z.equals(f.selection,G))&&J.select(f,G)}},[f,R,k,a,s,A]),S=y.useCallback(T=>{T==null?(R.cancel(),A.cancel(),Fa.delete(f),Fn.delete(f),C.current&&sn&&C.current.removeEventListener("beforeinput",E)):sn&&T.addEventListener("beforeinput",E),C.current=T},[R,A,f,E]);Wr(()=>{var T=te.getWindow(f);return T.document.addEventListener("selectionchange",A),()=>{T.document.removeEventListener("selectionchange",A)}},[A]);var O=r([f,[]]),V=i&&f.children.length===1&&Array.from(ue.texts(f)).length===1&&ue.string(f)===""&&!b,H=y.useCallback(T=>{if(T&&V){var L;w((L=T.getBoundingClientRect())===null||L===void 0?void 0:L.height)}else w(void 0)},[V]);if(V){var Q=x.start(f,[]);O.push({[ar]:!0,placeholder:i,onPlaceholderResize:H,anchor:Q,focus:Q})}var{marks:ae}=f;if(P.hasMarkPlaceholder=!1,f.selection&&Z.isCollapsed(f.selection)&&ae){var{anchor:D}=f.selection,$=ue.leaf(f,D.path),ee=rr($,xx);if(!fe.equals($,ae,{loose:!0})){P.hasMarkPlaceholder=!0;var B=Object.fromEntries(Object.keys(ee).map(T=>[T,null]));O.push($t($t($t({[kf]:!0},B),ae),{},{anchor:D,focus:D}))}}return y.useEffect(()=>{setTimeout(()=>{var{selection:T}=f;if(T){var{anchor:L}=T,I=ue.leaf(f,L.path);if(ae&&!fe.equals(I,ae,{loose:!0})){Ot.set(f,ae);return}}Ot.delete(f)})}),y.createElement(Rf.Provider,{value:s},y.createElement(Mf.Provider,{value:r},y.createElement(bx,{node:C,receivedUserInput:j},y.createElement(m,$t($t({role:s?void 0:"textbox","aria-multiline":s?void 0:!0},g),{},{spellCheck:sn||!ka?g.spellCheck:!1,autoCorrect:sn||!ka?g.autoCorrect:"false",autoCapitalize:sn||!ka?g.autoCapitalize:"false","data-slate-editor":!0,"data-slate-node":"value",contentEditable:!s,zindex:-1,suppressContentEditableWarning:!0,ref:S,style:$t($t({},p?{}:$t({position:"relative",whiteSpace:"pre-wrap",wordWrap:"break-word"},_?{minHeight:_}:{})),h),onBeforeInput:y.useCallback(T=>{if(!sn&&!s&&!lt(T,g.onBeforeInput)&&te.hasSelectableTarget(f,T.target)&&(T.preventDefault(),!te.isComposing(f))){var L=T.data;x.insertText(f,L)}},[g.onBeforeInput,f,s]),onInput:y.useCallback(T=>{if(!lt(T,g.onInput)){if(z.current){z.current.handleInput();return}for(var L of F.current)L();F.current=[]}},[g.onInput]),onBlur:y.useCallback(T=>{if(!(s||P.isUpdatingSelection||!te.hasSelectableTarget(f,T.target)||lt(T,g.onBlur))){var L=te.findDocumentOrShadowRoot(f);if(P.latestElement!==L.activeElement){var{relatedTarget:I}=T,W=te.toDOMNode(f,f);if(I!==W&&!(At(I)&&I.hasAttribute("data-slate-spacer"))){if(I!=null&&hn(I)&&te.hasDOMNode(f,I)){var U=te.toSlateNode(f,I);if(de.isElement(U)&&!f.isVoid(U))return}if(Er){var ne=L.getSelection();ne==null||ne.removeAllRanges()}fn.delete(f)}}}},[s,P.isUpdatingSelection,P.latestElement,f,g.onBlur]),onClick:y.useCallback(T=>{if(te.hasTarget(f,T.target)&&!lt(T,g.onClick)&&hn(T.target)){var L=te.toSlateNode(f,T.target),I=te.findPath(f,L);if(!x.hasPath(f,I)||ue.get(f,I)!==L)return;if(T.detail===fx&&I.length>=1){var W=I;if(!(de.isElement(L)&&x.isBlock(f,L))){var U,ne=x.above(f,{match:Be=>de.isElement(Be)&&x.isBlock(f,Be),at:I});W=(U=ne==null?void 0:ne[1])!==null&&U!==void 0?U:I.slice(0,1)}var re=x.range(f,W);J.select(f,re);return}if(s)return;var le=x.start(f,I),X=x.end(f,I),pe=x.void(f,{at:le}),me=x.void(f,{at:X});if(pe&&me&&N.equals(pe[1],me[1])){var _e=x.range(f,le);J.select(f,_e)}}},[f,g.onClick,s]),onCompositionEnd:y.useCallback(T=>{if(te.hasSelectableTarget(f,T.target)){var L;if(te.isComposing(f)&&Promise.resolve().then(()=>{v(!1),wn.set(f,!1)}),(L=z.current)===null||L===void 0||L.handleCompositionEnd(T),lt(T,g.onCompositionEnd)||dt)return;if(!Er&&!p1&&!d1&&!v1&&!g1&&T.data){var I=Ot.get(f);Ot.delete(f),I!==void 0&&(Gt.set(f,f.marks),f.marks=I),x.insertText(f,T.data);var W=Gt.get(f);Gt.delete(f),W!==void 0&&(f.marks=W)}}},[g.onCompositionEnd,f]),onCompositionUpdate:y.useCallback(T=>{te.hasSelectableTarget(f,T.target)&&!lt(T,g.onCompositionUpdate)&&(te.isComposing(f)||(v(!0),wn.set(f,!0)))},[g.onCompositionUpdate,f]),onCompositionStart:y.useCallback(T=>{if(te.hasSelectableTarget(f,T.target)){var L;if((L=z.current)===null||L===void 0||L.handleCompositionStart(T),lt(T,g.onCompositionStart)||dt)return;v(!0);var{selection:I}=f;if(I&&Z.isExpanded(I)){x.deleteFragment(f);return}}},[g.onCompositionStart,f]),onCopy:y.useCallback(T=>{te.hasSelectableTarget(f,T.target)&&!lt(T,g.onCopy)&&!Hl(T)&&(T.preventDefault(),te.setFragmentData(f,T.clipboardData,"copy"))},[g.onCopy,f]),onCut:y.useCallback(T=>{if(!s&&te.hasSelectableTarget(f,T.target)&&!lt(T,g.onCut)&&!Hl(T)){T.preventDefault(),te.setFragmentData(f,T.clipboardData,"cut");var{selection:L}=f;if(L)if(Z.isExpanded(L))x.deleteFragment(f);else{var I=ue.parent(f,L.anchor.path);x.isVoid(f,I)&&J.delete(f)}}},[s,f,g.onCut]),onDragOver:y.useCallback(T=>{if(te.hasTarget(f,T.target)&&!lt(T,g.onDragOver)){var L=te.toSlateNode(f,T.target);de.isElement(L)&&x.isVoid(f,L)&&T.preventDefault()}},[g.onDragOver,f]),onDragStart:y.useCallback(T=>{if(!s&&te.hasTarget(f,T.target)&&!lt(T,g.onDragStart)){var L=te.toSlateNode(f,T.target),I=te.findPath(f,L),W=de.isElement(L)&&x.isVoid(f,L)||x.void(f,{at:I,voids:!0});if(W){var U=x.range(f,I);J.select(f,U)}P.isDraggingInternally=!0,te.setFragmentData(f,T.dataTransfer,"drag")}},[s,f,g.onDragStart,P]),onDrop:y.useCallback(T=>{if(!s&&te.hasTarget(f,T.target)&&!lt(T,g.onDrop)){T.preventDefault();var L=f.selection,I=te.findEventRange(f,T),W=T.dataTransfer;J.select(f,I),P.isDraggingInternally&&L&&!Z.equals(L,I)&&!x.void(f,{at:I,voids:!0})&&J.delete(f,{at:L}),te.insertData(f,W),te.isFocused(f)||te.focus(f)}P.isDraggingInternally=!1},[s,f,g.onDrop,P]),onDragEnd:y.useCallback(T=>{!s&&P.isDraggingInternally&&g.onDragEnd&&te.hasTarget(f,T.target)&&g.onDragEnd(T),P.isDraggingInternally=!1},[s,P,g,f]),onFocus:y.useCallback(T=>{if(!s&&!P.isUpdatingSelection&&te.hasEditableTarget(f,T.target)&&!lt(T,g.onFocus)){var L=te.toDOMNode(f,f),I=te.findDocumentOrShadowRoot(f);if(P.latestElement=I.activeElement,Zn&&T.target!==L){L.focus();return}fn.set(f,!0)}},[s,P,f,g.onFocus]),onKeyDown:y.useCallback(T=>{if(!s&&te.hasEditableTarget(f,T.target)){var L;(L=z.current)===null||L===void 0||L.handleKeyDown(T);var{nativeEvent:I}=T;if(te.isComposing(f)&&I.isComposing===!1&&(wn.set(f,!1),v(!1)),lt(T,g.onKeyDown)||te.isComposing(f))return;var{selection:W}=f,U=f.children[W!==null?W.focus.path[0]:0],ne=of(ue.string(U))==="rtl";if(Ze.isRedo(I)){T.preventDefault();var re=f;typeof re.redo=="function"&&re.redo();return}if(Ze.isUndo(I)){T.preventDefault();var le=f;typeof le.undo=="function"&&le.undo();return}if(Ze.isMoveLineBackward(I)){T.preventDefault(),J.move(f,{unit:"line",reverse:!0});return}if(Ze.isMoveLineForward(I)){T.preventDefault(),J.move(f,{unit:"line"});return}if(Ze.isExtendLineBackward(I)){T.preventDefault(),J.move(f,{unit:"line",edge:"focus",reverse:!0});return}if(Ze.isExtendLineForward(I)){T.preventDefault(),J.move(f,{unit:"line",edge:"focus"});return}if(Ze.isMoveBackward(I)){T.preventDefault(),W&&Z.isCollapsed(W)?J.move(f,{reverse:!ne}):J.collapse(f,{edge:ne?"end":"start"});return}if(Ze.isMoveForward(I)){T.preventDefault(),W&&Z.isCollapsed(W)?J.move(f,{reverse:ne}):J.collapse(f,{edge:ne?"start":"end"});return}if(Ze.isMoveWordBackward(I)){T.preventDefault(),W&&Z.isExpanded(W)&&J.collapse(f,{edge:"focus"}),J.move(f,{unit:"word",reverse:!ne});return}if(Ze.isMoveWordForward(I)){T.preventDefault(),W&&Z.isExpanded(W)&&J.collapse(f,{edge:"focus"}),J.move(f,{unit:"word",reverse:ne});return}if(sn){if((wf||Er)&&W&&(Ze.isDeleteBackward(I)||Ze.isDeleteForward(I))&&Z.isCollapsed(W)){var X=ue.parent(f,W.anchor.path);if(de.isElement(X)&&x.isVoid(f,X)&&(x.isInline(f,X)||x.isBlock(f,X))){T.preventDefault(),x.deleteBackward(f,{unit:"block"});return}}}else{if(Ze.isBold(I)||Ze.isItalic(I)||Ze.isTransposeCharacter(I)){T.preventDefault();return}if(Ze.isSoftBreak(I)){T.preventDefault(),x.insertSoftBreak(f);return}if(Ze.isSplitBlock(I)){T.preventDefault(),x.insertBreak(f);return}if(Ze.isDeleteBackward(I)){T.preventDefault(),W&&Z.isExpanded(W)?x.deleteFragment(f,{direction:"backward"}):x.deleteBackward(f);return}if(Ze.isDeleteForward(I)){T.preventDefault(),W&&Z.isExpanded(W)?x.deleteFragment(f,{direction:"forward"}):x.deleteForward(f);return}if(Ze.isDeleteLineBackward(I)){T.preventDefault(),W&&Z.isExpanded(W)?x.deleteFragment(f,{direction:"backward"}):x.deleteBackward(f,{unit:"line"});return}if(Ze.isDeleteLineForward(I)){T.preventDefault(),W&&Z.isExpanded(W)?x.deleteFragment(f,{direction:"forward"}):x.deleteForward(f,{unit:"line"});return}if(Ze.isDeleteWordBackward(I)){T.preventDefault(),W&&Z.isExpanded(W)?x.deleteFragment(f,{direction:"backward"}):x.deleteBackward(f,{unit:"word"});return}if(Ze.isDeleteWordForward(I)){T.preventDefault(),W&&Z.isExpanded(W)?x.deleteFragment(f,{direction:"forward"}):x.deleteForward(f,{unit:"word"});return}}}},[s,f,g.onKeyDown]),onPaste:y.useCallback(T=>{!s&&te.hasEditableTarget(f,T.target)&&!lt(T,g.onPaste)&&(!sn||x1(T.nativeEvent)||Er)&&(T.preventDefault(),te.insertData(f,T.clipboardData))},[s,f,g.onPaste])}),y.createElement(Dx,{decorations:O,node:f,renderElement:o,renderPlaceholder:u,renderLeaf:l,selection:f.selection})))))},wx=e=>{var{attributes:t,children:n}=e;return y.createElement("span",$t({},t),n,dt&&y.createElement("br",null))},Ex=()=>[],_x=(e,t)=>{if(t.getBoundingClientRect&&(!e.selection||e.selection&&Z.isCollapsed(e.selection))){var n=t.startContainer.parentElement;n.getBoundingClientRect=t.getBoundingClientRect.bind(t),Ny(n,{scrollMode:"if-needed"}),delete n.getBoundingClientRect}},lt=(e,t)=>{if(!t)return!1;var n=t(e);return n??(e.isDefaultPrevented()||e.isPropagationStopped())},Hl=e=>hn(e.target)&&(e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement),kx=(e,t)=>{if(!t)return!1;var n=t(e);return n??e.defaultPrevented},Fx=y.createContext(!1),Bx=y.createContext({});function Ax(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 Tx=["editor","children","onChange","onSelectionChange","onValueChange","initialValue"],Sx=e=>{var{editor:t,children:n,onChange:r,onSelectionChange:a,onValueChange:i,initialValue:s}=e,o=rr(e,Tx),[l,u]=y.useState(()=>{if(!ue.isNodeList(s))throw new Error("[Slate] initialValue is invalid! Expected a list of elements but got: ".concat(nt.stringify(s)));if(!x.isEditor(t))throw new Error("[Slate] editor is invalid! You passed: ".concat(nt.stringify(t)));return t.children=s,Object.assign(t,o),{v:0,editor:t}}),{selectorContext:d,onChange:h}=Ax(t),m=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(()=>(Ns.set(t,m),()=>{Ns.set(t,()=>{})}),[t,m]);var[p,g]=y.useState(te.isFocused(t));return y.useEffect(()=>{g(te.isFocused(t))},[t]),Wr(()=>{var f=()=>g(te.isFocused(t));return Cf>=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(Bx.Provider,{value:d},y.createElement(If.Provider,{value:l},y.createElement(ko.Provider,{value:l.editor},y.createElement(Fx.Provider,{value:p},n))))},Vl=(e,t)=>{var n=(t.top+t.bottom)/2;return e.top<=n&&e.bottom>=n},Kl=(e,t,n)=>{var r=te.toDOMRange(e,t).getBoundingClientRect(),a=te.toDOMRange(e,n).getBoundingClientRect();return Vl(r,a)&&Vl(a,r)},jx=(e,t)=>{var n=x.range(e,Z.end(t)),r=Array.from(x.positions(e,{at:t})),a=0,i=r.length,s=Math.floor(i/2);if(Kl(e,x.range(e,r[a]),n))return x.range(e,r[a],n);if(r.length<2)return x.range(e,r[r.length-1],n);for(;s!==r.length&&s!==a;)Kl(e,x.range(e,r[s]),n)?i=s:a=s,s=Math.floor((a+i)/2);return x.range(e,r[i],n)};function Zl(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 Yl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Zl(Object(n),!0).forEach(function(r){Tt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zl(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Ox=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 ci.set(r,new WeakMap),r.addMark=(u,d)=>{var h,m;(h=Ao.get(r))===null||h===void 0||h(),!Ot.get(r)&&(m=pt.get(r))!==null&&m!==void 0&&m.length&&Ot.set(r,null),Gt.delete(r),o(u,d)},r.removeMark=u=>{var d;!Ot.get(r)&&(d=pt.get(r))!==null&&d!==void 0&&d.length&&Ot.set(r,null),Gt.delete(r),l(u)},r.deleteBackward=u=>{if(u!=="line")return s(u);if(r.selection&&Z.isCollapsed(r.selection)){var d=x.above(r,{match:g=>de.isElement(g)&&x.isBlock(r,g),at:r.selection});if(d){var[,h]=d,m=x.range(r,h,r.selection.anchor),p=jx(r,m);Z.isCollapsed(p)||J.delete(r,{at:p})}}},r.apply=u=>{var d=[],h=[],m=pt.get(r);if(m!=null&&m.length){var p=m.map(S=>O1(S,u)).filter(Boolean);pt.set(r,p)}var g=ln.get(r);g&&ln.set(r,Nl(r,g,u));var f=un.get(r);if(f!=null&&f.at){var b=ke.isPoint(f==null?void 0:f.at)?$s(r,f.at,u):Nl(r,f.at,u);un.set(r,b?Yl(Yl({},f),{},{at:b}):null)}switch(u.type){case"insert_text":case"remove_text":case"set_node":case"split_node":{d.push(...zn(r,u.path));break}case"set_selection":{var v;(v=Br.get(r))===null||v===void 0||v.unref(),Br.delete(r);break}case"insert_node":case"remove_node":{d.push(...zn(r,N.parent(u.path)));break}case"merge_node":{var C=N.previous(u.path);d.push(...zn(r,C));break}case"move_node":{var F=N.common(N.parent(u.path),N.parent(u.newPath));d.push(...zn(r,F));var _;N.isBefore(u.path,u.newPath)?(d.push(...zn(r,N.parent(u.path))),_=u.newPath):(d.push(...zn(r,N.parent(u.newPath))),_=u.path);var w=ue.get(t,N.parent(_)),k=te.findKey(r,w),j=x.pathRef(r,N.parent(_));h.push([j,k]);break}}a(u);for(var[q,P]of d){var[z]=x.node(r,q);Wa.set(z,P)}for(var[R,A]of h)if(R.current){var[E]=x.node(r,R.current);Wa.set(E,A)}},r.setFragmentData=u=>{var{selection:d}=r;if(d){var[h,m]=Z.edges(d),p=x.void(r,{at:h.path}),g=x.void(r,{at:m.path});if(!(Z.isCollapsed(d)&&!p)){var f=te.toDOMRange(r,d),b=f.cloneContents(),v=b.childNodes[0];if(b.childNodes.forEach(z=>{z.textContent&&z.textContent.trim()!==""&&(v=z)}),g){var[C]=g,F=f.cloneRange(),_=te.toDOMNode(r,C);F.setEndAfter(_),b=F.cloneContents()}if(p&&(v=b.querySelector("[data-slate-spacer]")),Array.from(b.querySelectorAll("[data-slate-zero-width]")).forEach(z=>{var R=z.getAttribute("data-slate-zero-width")==="n";z.textContent=R?`
139
- `:""}),Ff(v)){var w=v.ownerDocument.createElement("span");w.style.whiteSpace="pre",w.appendChild(v),b.appendChild(w),v=w}var k=r.getFragment(),j=JSON.stringify(k),q=window.btoa(encodeURIComponent(j));v.setAttribute("data-slate-fragment",q),u.setData("application/".concat(n),q);var P=b.ownerDocument.createElement("div");return P.appendChild(b),P.setAttribute("hidden","true"),b.ownerDocument.body.appendChild(P),u.setData("text/html",P.innerHTML),u.setData("text/plain",Af(P)),b.ownerDocument.body.removeChild(P),u}}},r.insertData=u=>{r.insertFragmentData(u)||r.insertTextData(u)},r.insertFragmentData=u=>{var d=u.getData("application/".concat(n))||_1(u);if(d){var h=decodeURIComponent(window.atob(d)),m=JSON.parse(h);return r.insertFragment(m),!0}return!1},r.insertTextData=u=>{var d=u.getData("text/plain");if(d){var h=d.split(/\r\n|\r|\n/),m=!1;for(var p of h)m&&J.splitNodes(r,{always:!0}),r.insertText(p),m=!0;return!0}return!1},r.onChange=u=>{var d=Cf<18?Pc.unstable_batchedUpdates:h=>h();d(()=>{var h=Ns.get(r);h&&h(u),i(u)})},r},zn=(e,t)=>{var n=[];for(var[r,a]of x.levels(e,{at:t})){var i=te.findKey(e,r);n.push([a,i])}return n};const Px={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)}},an=y.createContext(Px);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||{}),qt=(e=>(e.delete="delete_mark",e.emphasis="emphasis_mark",e.code="inline_code_mark",e.strong="strong_mark",e))(qt||{});const Mx=({attributes:e,children:t,element:n})=>{const r=n;switch(r.type){case Y.blockquote:return c.jsx("blockquote",{className:"subtle",...e,children:t});case Y.link:return c.jsx("a",{...e,children:t});case Y.li:return c.jsx("li",{...e,children:t});case Y.mention:const a=r;return a!=null&&a.name&&a.name===Or?c.jsxs("span",{...e,className:"mention deleted-user",children:["@",c.jsx(ie.FormattedMessage,{id:"member_deleted"}),t]}):c.jsxs("a",{...e,className:"mention",children:["@",(a==null?void 0:a.name)||"",t]});case Y.ol:return c.jsx("ol",{...e,children:t});case Y.ul:return c.jsx("ul",{...e,children:t});case Y.span:return c.jsx("span",{...e,children:t});case Y.paragraph:return c.jsx("p",{...e,children:t});default:return c.jsx("span",{...e,children:t})}},Nx=({attributes:e,children:t,leaf:n})=>{const r=n;return r[Y.bold]&&(t=c.jsx("strong",{children:t})),r[Y.italic]&&(t=c.jsx("em",{children:t})),r[Y.strikethrough]&&(t=c.jsx("s",{children:t})),c.jsx("span",{...e,children:t})},zs="MENTION: ",Lf={anchor:{offset:0,path:[0,0]},focus:{offset:0,path:[0,0]}},Gl={"mention-popover":35,default:-52},Ui=16,zf=(e,t,n)=>{const r=y.useRef(null),{showLinkEditor:a,mentionPopover:i}=y.useContext(an),s=t==="link-editor"?a:i.show,o=[s];return e&&t==="link-editor"&&o.push(e.selection),y.useEffect(()=>{var p,g;if(!(r!=null&&r.current)||!s)return;const l=r==null?void 0:r.current;if(!l)return;let u,d=0;if(t==="mention-popover"){const{position:f}=i,b=F=>{if(!x.hasPath(e,F.path))return!1;const _=ue.get(e,F.path);return x.isEditor(_)||de.isElement(_)?F.offset<=_.children.length:fe.isText(_)?F.offset<=_.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||Lf).getBoundingClientRect();const C=(p=document.getElementById(n))==null?void 0:p.getBoundingClientRect();l.style.setProperty("--width",`${((C==null?void 0:C.width)||0)/Ui}rem`),d=(C==null?void 0:C.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=Gl[t]||Gl.default,m=((u==null?void 0:u.top)||0)+window.scrollY+h;d===0&&(d=Math.max(((u==null?void 0:u.left)||0)-(l.offsetWidth-((u==null?void 0:u.width)||0)),0)),l.style.top=`${m/Ui}rem`,l.style.left=`${d/Ui}rem`},o),r},Rx=e=>{const[t,n]=y.useState(null);return y.useEffect(()=>{const{selection:r}=e;if(!r){n(null);return}const[a]=x.nodes(e,{at:r,match:i=>i.type===Y.link});if(a){const i=a[0],s=Jc(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 ct=(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))(ct||{});const Yn={[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"},[qt.emphasis]:Y.italic,[qt.strong]:Y.bold,[qt.delete]:Y.strikethrough,[qt.code]:Y.code,[Y.hr]:Y.hr,[Y.image]:Y.image};function Ql(e){if(e)throw e}var Ba=Object.prototype.hasOwnProperty,qf=Object.prototype.toString,Jl=Object.defineProperty,Xl=Object.getOwnPropertyDescriptor,ec=function(t){return typeof Array.isArray=="function"?Array.isArray(t):qf.call(t)==="[object Array]"},tc=function(t){if(!t||qf.call(t)!=="[object Object]")return!1;var n=Ba.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Ba.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var a;for(a in t);return typeof a>"u"||Ba.call(t,a)},nc=function(t,n){Jl&&n.name==="__proto__"?Jl(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},rc=function(t,n){if(n==="__proto__")if(Ba.call(t,n)){if(Xl)return Xl(t,n).value}else return;return t[n]},Ix=function e(){var t,n,r,a,i,s,o=arguments[0],l=1,u=arguments.length,d=!1;for(typeof o=="boolean"&&(d=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=rc(o,n),a=rc(t,n),o!==a&&(d&&a&&(tc(a)||(i=ec(a)))?(i?(i=!1,s=r&&ec(r)?r:[]):s=r&&tc(r)?r:{},nc(o,{name:n,newValue:e(d,s,a)})):typeof a<"u"&&nc(o,{name:n,newValue:a}));return o};const Hi=On(Ix);function qs(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 $x(){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 d=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,d?Lx(d,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 Lx(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 d=u;if(o&&n)throw d;return a(d)}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 Ar(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ac(e.position):"start"in e||"end"in e?ac(e):"line"in e||"column"in e?Ws(e):""}function Ws(e){return ic(e&&e.line)+":"+ic(e&&e.column)}function ac(e){return Ws(e&&e.start)+"-"+Ws(e&&e.end)}function ic(e){return e&&typeof e=="number"?e:1}class bt 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=Ar(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}}bt.prototype.file="";bt.prototype.name="";bt.prototype.reason="";bt.prototype.message="";bt.prototype.stack="";bt.prototype.column=void 0;bt.prototype.line=void 0;bt.prototype.ancestors=void 0;bt.prototype.cause=void 0;bt.prototype.fatal=void 0;bt.prototype.place=void 0;bt.prototype.ruleId=void 0;bt.prototype.source=void 0;const Lt={basename:zx,dirname:qx,extname:Wx,join:Ux,sep:"/"};function zx(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Kr(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 qx(e){if(Kr(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 Wx(e){Kr(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 Ux(...e){let t=-1,n;for(;++t<e.length;)Kr(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Hx(n)}function Hx(e){Kr(e);const t=e.codePointAt(0)===47;let n=Vx(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Vx(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 Kr(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Kx={cwd:Zx};function Zx(){return"/"}function Us(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Yx(e){if(typeof e=="string")e=new URL(e);else if(!Us(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 Gx(e)}function Gx(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 Vi=["history","path","basename","stem","extname","dirname"];class Qx{constructor(t){let n;t?Us(t)?n={path:t}:typeof t=="string"||Jx(t)?n={value:t}:n=t:n={},this.cwd=Kx.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Vi.length;){const i=Vi[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)Vi.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?Lt.basename(this.path):void 0}set basename(t){Zi(t,"basename"),Ki(t,"basename"),this.path=Lt.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Lt.dirname(this.path):void 0}set dirname(t){sc(this.basename,"dirname"),this.path=Lt.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Lt.extname(this.path):void 0}set extname(t){if(Ki(t,"extname"),sc(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=Lt.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Us(t)&&(t=Yx(t)),Zi(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Lt.basename(this.path,this.extname):void 0}set stem(t){Zi(t,"stem"),Ki(t,"stem"),this.path=Lt.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 bt(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 Ki(e,t){if(e&&e.includes(Lt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Lt.sep+"`")}function Zi(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function sc(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Jx(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Xx=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},eD={}.hasOwnProperty;class jo extends Xx{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=$x()}copy(){const t=new jo;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Hi(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Qi("data",this.frozen),this.namespace[t]=n,this):eD.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Qi("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=ma(t),r=this.parser||this.Parser;return Yi("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Yi("process",this.parser||this.Parser),Gi("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(i,s){const o=ma(t),l=r.parse(o);r.run(l,o,function(d,h,m){if(d||!h||!m)return u(d);const p=h,g=r.stringify(p,m);rD(g)?m.value=g:m.result=g,u(d,m)});function u(d,h){d||!h?s(d):i?i(h):n(void 0,h)}}}processSync(t){let n=!1,r;return this.freeze(),Yi("processSync",this.parser||this.Parser),Gi("processSync",this.compiler||this.Compiler),this.process(t,a),uc("processSync","process",n),r;function a(i,s){n=!0,Ql(i),r=s}}run(t,n,r){oc(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=ma(n);a.run(t,l,u);function u(d,h,m){const p=h||t;d?o(d):s?s(p):r(void 0,p,m)}}}runSync(t,n){let r=!1,a;return this.run(t,n,i),uc("runSync","run",r),a;function i(s,o){Ql(s),a=o,r=!0}}stringify(t,n){this.freeze();const r=ma(n),a=this.compiler||this.Compiler;return Gi("stringify",a),oc(t),a(t,r)}use(t,...n){const r=this.attachers,a=this.namespace;if(Qi("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[d,...h]=u;l(d,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=Hi(!0,a.settings,u.settings))}function o(u){let d=-1;if(u!=null)if(Array.isArray(u))for(;++d<u.length;){const h=u[d];i(h)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function l(u,d){let h=-1,m=-1;for(;++h<r.length;)if(r[h][0]===u){m=h;break}if(m===-1)r.push([u,...d]);else if(d.length>0){let[p,...g]=d;const f=r[m][1];qs(f)&&qs(p)&&(p=Hi(!0,f,p)),r[m]=[u,p,...g]}}}}const tD=new jo().freeze();function Yi(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Gi(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Qi(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 oc(e){if(!qs(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function uc(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function ma(e){return nD(e)?e:new Qx(e)}function nD(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function rD(e){return typeof e=="string"||aD(e)}function aD(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const iD={};function sD(e,t){const n=t||iD,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Wf(e,r,a)}function Wf(e,t,n){if(oD(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 lc(e.children,t,n)}return Array.isArray(e)?lc(e,t,n):""}function lc(e,t,n){const r=[];let a=-1;for(;++a<e.length;)r[a]=Wf(e[a],t,n);return r.join("")}function oD(e){return!!(e&&typeof e=="object")}const cc=document.createElement("i");function Oo(e){const t="&"+e+";";cc.innerHTML=t;const n=cc.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function en(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 Bt(e,t){return e.length>0?(en(e,e.length,0,t),e):t}const dc={}.hasOwnProperty;function uD(e){const t={};let n=-1;for(;++n<e.length;)lD(t,e[n]);return t}function lD(e,t){let n;for(n in t){const a=(dc.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let s;if(i)for(s in i){dc.call(a,s)||(a[s]=[]);const o=i[s];cD(a[s],Array.isArray(o)?o:o?[o]:[])}}}function cD(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);en(e,0,0,r)}function Uf(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 Jn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const zt=bn(/[A-Za-z]/),Pt=bn(/[\dA-Za-z]/),dD=bn(/[#-'*+\--9=?A-Z^-~]/);function Hs(e){return e!==null&&(e<32||e===127)}const Vs=bn(/\d/),fD=bn(/[\dA-Fa-f]/),hD=bn(/[!-/:-@[-`{-~]/);function ye(e){return e!==null&&e<-2}function vt(e){return e!==null&&(e<0||e===32)}function Me(e){return e===-2||e===-1||e===32}const mD=bn(/\p{P}|\p{S}/u),pD=bn(/\s/);function bn(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 Me(l)?(e.enter(n),o(l)):t(l)}function o(l){return Me(l)&&i++<a?(e.consume(l),o):(e.exit(n),t(l))}}const gD={tokenize:vD};function vD(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 ye(o)?(e.consume(o),e.exit("chunkText"),i):(e.consume(o),s)}}const bD={tokenize:yD},fc={tokenize:xD};function yD(e){const t=this,n=[];let r=0,a,i,s;return o;function o(F){if(r<n.length){const _=n[r];return t.containerState=_[1],e.attempt(_[0].continuation,l,u)(F)}return u(F)}function l(F){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&C();const _=t.events.length;let w=_,k;for(;w--;)if(t.events[w][0]==="exit"&&t.events[w][1].type==="chunkFlow"){k=t.events[w][1].end;break}v(r);let j=_;for(;j<t.events.length;)t.events[j][1].end=Object.assign({},k),j++;return en(t.events,w+1,0,t.events.slice(_)),t.events.length=j,u(F)}return o(F)}function u(F){if(r===n.length){if(!a)return m(F);if(a.currentConstruct&&a.currentConstruct.concrete)return g(F);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(fc,d,h)(F)}function d(F){return a&&C(),v(r),m(F)}function h(F){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,g(F)}function m(F){return t.containerState={},e.attempt(fc,p,g)(F)}function p(F){return r++,n.push([t.currentConstruct,t.containerState]),m(F)}function g(F){if(F===null){a&&C(),v(0),e.consume(F);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{contentType:"flow",previous:i,_tokenizer:a}),f(F)}function f(F){if(F===null){b(e.exit("chunkFlow"),!0),v(0),e.consume(F);return}return ye(F)?(e.consume(F),b(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(F),f)}function b(F,_){const w=t.sliceStream(F);if(_&&w.push(null),F.previous=i,i&&(i.next=F),i=F,a.defineSkip(F.start),a.write(w),t.parser.lazy[F.start.line]){let k=a.events.length;for(;k--;)if(a.events[k][1].start.offset<s&&(!a.events[k][1].end||a.events[k][1].end.offset>s))return;const j=t.events.length;let q=j,P,z;for(;q--;)if(t.events[q][0]==="exit"&&t.events[q][1].type==="chunkFlow"){if(P){z=t.events[q][1].end;break}P=!0}for(v(r),k=j;k<t.events.length;)t.events[k][1].end=Object.assign({},z),k++;en(t.events,q+1,0,t.events.slice(j)),t.events.length=k}}function v(F){let _=n.length;for(;_-- >F;){const w=n[_];t.containerState=w[1],w[0].exit.call(t,e)}n.length=F}function C(){a.write([null]),i=void 0,a=void 0,t.containerState._closeFlow=void 0}}function xD(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 hc(e){if(e===null||vt(e)||pD(e))return 1;if(mD(e))return 2}function Po(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 Ks={name:"attention",tokenize:CD,resolveAll:DD};function DD(e,t){let n=-1,r,a,i,s,o,l,u,d;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),m=Object.assign({},e[n][1].start);mc(h,-l),mc(m,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:m},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=Bt(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Bt(u,[["enter",a,t],["enter",s,t],["exit",s,t],["enter",i,t]]),u=Bt(u,Po(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Bt(u,[["exit",i,t],["enter",o,t],["exit",o,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=Bt(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,en(e,r-1,n-r+3,u),n=r+u.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function CD(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,a=hc(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"),d=hc(l),h=!d||d===2&&a||n.includes(l),m=!a||a===2&&d||n.includes(r);return u._open=!!(i===42?h:h&&(a||!m)),u._close=!!(i===42?m:m&&(d||!h)),t(l)}}function mc(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const wD={name:"autolink",tokenize:ED};function ED(e,t,n){let r=0;return a;function a(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(p){return zt(p)?(e.consume(p),s):p===64?n(p):u(p)}function s(p){return p===43||p===45||p===46||Pt(p)?(r=1,o(p)):u(p)}function o(p){return p===58?(e.consume(p),r=0,l):(p===43||p===45||p===46||Pt(p))&&r++<32?(e.consume(p),o):(r=0,u(p))}function l(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||Hs(p)?n(p):(e.consume(p),l)}function u(p){return p===64?(e.consume(p),d):dD(p)?(e.consume(p),u):n(p)}function d(p){return Pt(p)?h(p):n(p)}function h(p){return p===46?(e.consume(p),r=0,d):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):m(p)}function m(p){if((p===45||Pt(p))&&r++<63){const g=p===45?m:h;return e.consume(p),g}return n(p)}}const di={tokenize:_D,partial:!0};function _D(e,t,n){return r;function r(i){return Me(i)?qe(e,a,"linePrefix")(i):a(i)}function a(i){return i===null||ye(i)?t(i):n(i)}}const Hf={name:"blockQuote",tokenize:kD,continuation:{tokenize:FD},exit:BD};function kD(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 Me(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function FD(e,t,n){const r=this;return a;function a(s){return Me(s)?qe(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):i(s)}function i(s){return e.attempt(Hf,t,n)(s)}}function BD(e){e.exit("blockQuote")}const Vf={name:"characterEscape",tokenize:AD};function AD(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 hD(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const Kf={name:"characterReference",tokenize:TD};function TD(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=Pt,d(h))}function u(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,s=fD,d):(e.enter("characterReferenceValue"),i=7,s=Vs,d(h))}function d(h){if(h===59&&a){const m=e.exit("characterReferenceValue");return s===Pt&&!Oo(r.sliceSerialize(m))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(h)&&a++<i?(e.consume(h),d):n(h)}}const pc={tokenize:jD,partial:!0},gc={name:"codeFenced",tokenize:SD,concrete:!0};function SD(e,t,n){const r=this,a={tokenize:w,partial:!0};let i=0,s=0,o;return l;function l(k){return u(k)}function u(k){const j=r.events[r.events.length-1];return i=j&&j[1].type==="linePrefix"?j[2].sliceSerialize(j[1],!0).length:0,o=k,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(k)}function d(k){return k===o?(s++,e.consume(k),d):s<3?n(k):(e.exit("codeFencedFenceSequence"),Me(k)?qe(e,h,"whitespace")(k):h(k))}function h(k){return k===null||ye(k)?(e.exit("codeFencedFence"),r.interrupt?t(k):e.check(pc,f,_)(k)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),m(k))}function m(k){return k===null||ye(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(k)):Me(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),qe(e,p,"whitespace")(k)):k===96&&k===o?n(k):(e.consume(k),m)}function p(k){return k===null||ye(k)?h(k):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(k))}function g(k){return k===null||ye(k)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(k)):k===96&&k===o?n(k):(e.consume(k),g)}function f(k){return e.attempt(a,_,b)(k)}function b(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),v}function v(k){return i>0&&Me(k)?qe(e,C,"linePrefix",i+1)(k):C(k)}function C(k){return k===null||ye(k)?e.check(pc,f,_)(k):(e.enter("codeFlowValue"),F(k))}function F(k){return k===null||ye(k)?(e.exit("codeFlowValue"),C(k)):(e.consume(k),F)}function _(k){return e.exit("codeFenced"),t(k)}function w(k,j,q){let P=0;return z;function z(O){return k.enter("lineEnding"),k.consume(O),k.exit("lineEnding"),R}function R(O){return k.enter("codeFencedFence"),Me(O)?qe(k,A,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):A(O)}function A(O){return O===o?(k.enter("codeFencedFenceSequence"),E(O)):q(O)}function E(O){return O===o?(P++,k.consume(O),E):P>=s?(k.exit("codeFencedFenceSequence"),Me(O)?qe(k,S,"whitespace")(O):S(O)):q(O)}function S(O){return O===null||ye(O)?(k.exit("codeFencedFence"),j(O)):q(O)}}}function jD(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 Ji={name:"codeIndented",tokenize:PD},OD={tokenize:MD,partial:!0};function PD(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 d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?s(u):n(u)}function s(u){return u===null?l(u):ye(u)?e.attempt(OD,s,l)(u):(e.enter("codeFlowValue"),o(u))}function o(u){return u===null||ye(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):ye(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):ye(s)?a(s):n(s)}}const ND={name:"codeText",tokenize:$D,resolve:RD,previous:ID};function RD(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 ID(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function $D(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,d(h)):ye(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||ye(h)?(e.exit("codeTextData"),l(h)):(e.consume(h),u)}function d(h){return h===96?(e.consume(h),a++,d):a===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(i.type="codeTextData",u(h))}}class LD{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&&Dr(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),Dr(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Dr(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);Dr(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Dr(this.left,n.reverse())}}}function Dr(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 Zf(e){const t={};let n=-1,r,a,i,s,o,l,u;const d=new LD(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.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,zD(d,n)),n=t[n],u=!0);else if(r[1]._container){for(i=n,a=void 0;i--&&(s=d.get(i),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank");)s[0]==="enter"&&(a&&(d.get(a)[1].type="lineEndingBlank"),s[1].type="lineEnding",a=i);a&&(r[1].end=Object.assign({},d.get(a)[1].start),o=d.slice(a,n),o.unshift(r),d.splice(a,n-a+1,o))}}return en(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!u}function zD(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 d,h,m=-1,p=n,g=0,f=0;const b=[f];for(;p;){for(;e.get(++a)[1]!==p;);i.push(a),p._tokenizer||(d=r.sliceStream(p),p.next||d.push(null),h&&s.defineSkip(p.start),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(d),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),h=p,p=p.next}for(p=n;++m<o.length;)o[m][0]==="exit"&&o[m-1][0]==="enter"&&o[m][1].type===o[m-1][1].type&&o[m][1].start.line!==o[m][1].end.line&&(f=m+1,b.push(f),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(s.events=[],p?(p._tokenizer=void 0,p.previous=void 0):b.pop(),m=b.length;m--;){const v=o.slice(b[m],b[m+1]),C=i.pop();l.push([C,C+v.length-1]),e.splice(C,2,v)}for(l.reverse(),m=-1;++m<l.length;)u[g+l[m][0]]=g+l[m][1],g+=l[m][1]-l[m][0]-1;return u}const qD={tokenize:HD,resolve:UD},WD={tokenize:VD,partial:!0};function UD(e){return Zf(e),e}function HD(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):ye(o)?e.check(WD,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 VD(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||ye(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 Yf(e,t,n,r,a,i,s,o,l){const u=l||Number.POSITIVE_INFINITY;let d=0;return h;function h(v){return v===60?(e.enter(r),e.enter(a),e.enter(i),e.consume(v),e.exit(i),m):v===null||v===32||v===41||Hs(v)?n(v):(e.enter(r),e.enter(s),e.enter(o),e.enter("chunkString",{contentType:"string"}),f(v))}function m(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"}),p(v))}function p(v){return v===62?(e.exit("chunkString"),e.exit(o),m(v)):v===null||v===60||ye(v)?n(v):(e.consume(v),v===92?g:p)}function g(v){return v===60||v===62||v===92?(e.consume(v),p):p(v)}function f(v){return!d&&(v===null||v===41||vt(v))?(e.exit("chunkString"),e.exit(o),e.exit(s),e.exit(r),t(v)):d<u&&v===40?(e.consume(v),d++,f):v===41?(e.consume(v),d--,f):v===null||v===32||v===40||Hs(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 Gf(e,t,n,r,a,i){const s=this;let o=0,l;return u;function u(p){return e.enter(r),e.enter(a),e.consume(p),e.exit(a),e.enter(i),d}function d(p){return o>999||p===null||p===91||p===93&&!l||p===94&&!o&&"_hiddenFootnoteSupport"in s.parser.constructs?n(p):p===93?(e.exit(i),e.enter(a),e.consume(p),e.exit(a),e.exit(r),t):ye(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),h(p))}function h(p){return p===null||p===91||p===93||ye(p)||o++>999?(e.exit("chunkString"),d(p)):(e.consume(p),l||(l=!Me(p)),p===92?m:h)}function m(p){return p===91||p===92||p===93?(e.consume(p),o++,h):h(p)}}function Qf(e,t,n,r,a,i){let s;return o;function o(m){return m===34||m===39||m===40?(e.enter(r),e.enter(a),e.consume(m),e.exit(a),s=m===40?41:m,l):n(m)}function l(m){return m===s?(e.enter(a),e.consume(m),e.exit(a),e.exit(r),t):(e.enter(i),u(m))}function u(m){return m===s?(e.exit(i),l(s)):m===null?n(m):ye(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),qe(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===s||m===null||ye(m)?(e.exit("chunkString"),u(m)):(e.consume(m),m===92?h:d)}function h(m){return m===s||m===92?(e.consume(m),d):d(m)}}function Tr(e,t){let n;return r;function r(a){return ye(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,r):Me(a)?qe(e,r,n?"linePrefix":"lineSuffix")(a):t(a)}}const KD={name:"definition",tokenize:YD},ZD={tokenize:GD,partial:!0};function YD(e,t,n){const r=this;let a;return i;function i(p){return e.enter("definition"),s(p)}function s(p){return Gf.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function o(p){return a=Jn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l):n(p)}function l(p){return vt(p)?Tr(e,u)(p):u(p)}function u(p){return Yf(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(ZD,h,h)(p)}function h(p){return Me(p)?qe(e,m,"whitespace")(p):m(p)}function m(p){return p===null||ye(p)?(e.exit("definition"),r.parser.defined.push(a),t(p)):n(p)}}function GD(e,t,n){return r;function r(o){return vt(o)?Tr(e,a)(o):n(o)}function a(o){return Qf(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function i(o){return Me(o)?qe(e,s,"whitespace")(o):s(o)}function s(o){return o===null||ye(o)?t(o):n(o)}}const QD={name:"hardBreakEscape",tokenize:JD};function JD(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),a}function a(i){return ye(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const XD={name:"headingAtx",tokenize:tC,resolve:eC};function eC(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"},en(e,r,n-r+1,[["enter",a,t],["enter",i,t],["exit",i,t],["exit",a,t]])),e}function tC(e,t,n){let r=0;return a;function a(d){return e.enter("atxHeading"),i(d)}function i(d){return e.enter("atxHeadingSequence"),s(d)}function s(d){return d===35&&r++<6?(e.consume(d),s):d===null||vt(d)?(e.exit("atxHeadingSequence"),o(d)):n(d)}function o(d){return d===35?(e.enter("atxHeadingSequence"),l(d)):d===null||ye(d)?(e.exit("atxHeading"),t(d)):Me(d)?qe(e,o,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function l(d){return d===35?(e.consume(d),l):(e.exit("atxHeadingSequence"),o(d))}function u(d){return d===null||d===35||vt(d)?(e.exit("atxHeadingText"),o(d)):(e.consume(d),u)}}const nC=["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"],vc=["pre","script","style","textarea"],rC={name:"htmlFlow",tokenize:oC,resolveTo:sC,concrete:!0},aC={tokenize:lC,partial:!0},iC={tokenize:uC,partial:!0};function sC(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 oC(e,t,n){const r=this;let a,i,s,o,l;return u;function u(B){return d(B)}function d(B){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(B),h}function h(B){return B===33?(e.consume(B),m):B===47?(e.consume(B),i=!0,f):B===63?(e.consume(B),a=3,r.interrupt?t:D):zt(B)?(e.consume(B),s=String.fromCharCode(B),b):n(B)}function m(B){return B===45?(e.consume(B),a=2,p):B===91?(e.consume(B),a=5,o=0,g):zt(B)?(e.consume(B),a=4,r.interrupt?t:D):n(B)}function p(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:A:g):n(B)}function f(B){return zt(B)?(e.consume(B),s=String.fromCharCode(B),b):n(B)}function b(B){if(B===null||B===47||B===62||vt(B)){const T=B===47,L=s.toLowerCase();return!T&&!i&&vc.includes(L)?(a=1,r.interrupt?t(B):A(B)):nC.includes(s.toLowerCase())?(a=6,T?(e.consume(B),v):r.interrupt?t(B):A(B)):(a=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(B):i?C(B):F(B))}return B===45||Pt(B)?(e.consume(B),s+=String.fromCharCode(B),b):n(B)}function v(B){return B===62?(e.consume(B),r.interrupt?t:A):n(B)}function C(B){return Me(B)?(e.consume(B),C):z(B)}function F(B){return B===47?(e.consume(B),z):B===58||B===95||zt(B)?(e.consume(B),_):Me(B)?(e.consume(B),F):z(B)}function _(B){return B===45||B===46||B===58||B===95||Pt(B)?(e.consume(B),_):w(B)}function w(B){return B===61?(e.consume(B),k):Me(B)?(e.consume(B),w):F(B)}function k(B){return B===null||B===60||B===61||B===62||B===96?n(B):B===34||B===39?(e.consume(B),l=B,j):Me(B)?(e.consume(B),k):q(B)}function j(B){return B===l?(e.consume(B),l=null,P):B===null||ye(B)?n(B):(e.consume(B),j)}function q(B){return B===null||B===34||B===39||B===47||B===60||B===61||B===62||B===96||vt(B)?w(B):(e.consume(B),q)}function P(B){return B===47||B===62||Me(B)?F(B):n(B)}function z(B){return B===62?(e.consume(B),R):n(B)}function R(B){return B===null||ye(B)?A(B):Me(B)?(e.consume(B),R):n(B)}function A(B){return B===45&&a===2?(e.consume(B),V):B===60&&a===1?(e.consume(B),H):B===62&&a===4?(e.consume(B),$):B===63&&a===3?(e.consume(B),D):B===93&&a===5?(e.consume(B),ae):ye(B)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(aC,ee,E)(B)):B===null||ye(B)?(e.exit("htmlFlowData"),E(B)):(e.consume(B),A)}function E(B){return e.check(iC,S,ee)(B)}function S(B){return e.enter("lineEnding"),e.consume(B),e.exit("lineEnding"),O}function O(B){return B===null||ye(B)?E(B):(e.enter("htmlFlowData"),A(B))}function V(B){return B===45?(e.consume(B),D):A(B)}function H(B){return B===47?(e.consume(B),s="",Q):A(B)}function Q(B){if(B===62){const T=s.toLowerCase();return vc.includes(T)?(e.consume(B),$):A(B)}return zt(B)&&s.length<8?(e.consume(B),s+=String.fromCharCode(B),Q):A(B)}function ae(B){return B===93?(e.consume(B),D):A(B)}function D(B){return B===62?(e.consume(B),$):B===45&&a===2?(e.consume(B),D):A(B)}function $(B){return B===null||ye(B)?(e.exit("htmlFlowData"),ee(B)):(e.consume(B),$)}function ee(B){return e.exit("htmlFlow"),t(B)}}function uC(e,t,n){const r=this;return a;function a(s){return ye(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 lC(e,t,n){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(di,t,n)}}const cC={name:"htmlText",tokenize:dC};function dC(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),F):zt(D)?(e.consume(D),q):n(D)}function u(D){return D===45?(e.consume(D),d):D===91?(e.consume(D),i=0,g):zt(D)?(e.consume(D),C):n(D)}function d(D){return D===45?(e.consume(D),p):n(D)}function h(D){return D===null?n(D):D===45?(e.consume(D),m):ye(D)?(s=h,H(D)):(e.consume(D),h)}function m(D){return D===45?(e.consume(D),p):h(D)}function p(D){return D===62?V(D):D===45?m(D):h(D)}function g(D){const $="CDATA[";return D===$.charCodeAt(i++)?(e.consume(D),i===$.length?f:g):n(D)}function f(D){return D===null?n(D):D===93?(e.consume(D),b):ye(D)?(s=f,H(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 C(D){return D===null||D===62?V(D):ye(D)?(s=C,H(D)):(e.consume(D),C)}function F(D){return D===null?n(D):D===63?(e.consume(D),_):ye(D)?(s=F,H(D)):(e.consume(D),F)}function _(D){return D===62?V(D):F(D)}function w(D){return zt(D)?(e.consume(D),k):n(D)}function k(D){return D===45||Pt(D)?(e.consume(D),k):j(D)}function j(D){return ye(D)?(s=j,H(D)):Me(D)?(e.consume(D),j):V(D)}function q(D){return D===45||Pt(D)?(e.consume(D),q):D===47||D===62||vt(D)?P(D):n(D)}function P(D){return D===47?(e.consume(D),V):D===58||D===95||zt(D)?(e.consume(D),z):ye(D)?(s=P,H(D)):Me(D)?(e.consume(D),P):V(D)}function z(D){return D===45||D===46||D===58||D===95||Pt(D)?(e.consume(D),z):R(D)}function R(D){return D===61?(e.consume(D),A):ye(D)?(s=R,H(D)):Me(D)?(e.consume(D),R):P(D)}function A(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),a=D,E):ye(D)?(s=A,H(D)):Me(D)?(e.consume(D),A):(e.consume(D),S)}function E(D){return D===a?(e.consume(D),a=void 0,O):D===null?n(D):ye(D)?(s=E,H(D)):(e.consume(D),E)}function S(D){return D===null||D===34||D===39||D===60||D===61||D===96?n(D):D===47||D===62||vt(D)?P(D):(e.consume(D),S)}function O(D){return D===47||D===62||vt(D)?P(D):n(D)}function V(D){return D===62?(e.consume(D),e.exit("htmlTextData"),e.exit("htmlText"),t):n(D)}function H(D){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),Q}function Q(D){return Me(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 Mo={name:"labelEnd",tokenize:vC,resolveTo:gC,resolveAll:pC},fC={tokenize:bC},hC={tokenize:yC},mC={tokenize:xC};function pC(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 gC(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)},d={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=Bt(o,e.slice(i+1,i+r+3)),o=Bt(o,[["enter",d,t]]),o=Bt(o,Po(t.parser.constructs.insideSpan.null,e.slice(i+r+4,s-3),t)),o=Bt(o,[["exit",d,t],e[s-2],e[s-1],["exit",u,t]]),o=Bt(o,e.slice(s+1)),o=Bt(o,[["exit",l,t]]),en(e,i,e.length,o),e}function vC(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(m){return i?i._inactive?h(m):(s=r.parser.defined.includes(Jn(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(m),e.exit("labelMarker"),e.exit("labelEnd"),l):n(m)}function l(m){return m===40?e.attempt(fC,d,s?d:h)(m):m===91?e.attempt(hC,d,s?u:h)(m):s?d(m):h(m)}function u(m){return e.attempt(mC,d,h)(m)}function d(m){return t(m)}function h(m){return i._balanced=!0,n(m)}}function bC(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 vt(h)?Tr(e,i)(h):i(h)}function i(h){return h===41?d(h):Yf(e,s,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function s(h){return vt(h)?Tr(e,l)(h):d(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):d(h)}function u(h){return vt(h)?Tr(e,d)(h):d(h)}function d(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function yC(e,t,n){const r=this;return a;function a(o){return Gf.call(r,e,i,s,"reference","referenceMarker","referenceString")(o)}function i(o){return r.parser.defined.includes(Jn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function s(o){return n(o)}}function xC(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 DC={name:"labelStartImage",tokenize:CC,resolveAll:Mo.resolveAll};function CC(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 wC={name:"labelStartLink",tokenize:EC,resolveAll:Mo.resolveAll};function EC(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 Xi={name:"lineEnding",tokenize:_C};function _C(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),qe(e,t,"linePrefix")}}const Aa={name:"thematicBreak",tokenize:kC};function kC(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||ye(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===a?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),Me(u)?qe(e,o,"whitespace")(u):o(u))}}const mt={name:"list",tokenize:AC,continuation:{tokenize:TC},exit:jC},FC={tokenize:OC,partial:!0},BC={tokenize:SC,partial:!0};function AC(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(p){const g=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:Vs(p)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(Aa,n,u)(p):u(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(p)}return n(p)}function l(p){return Vs(p)&&++s<10?(e.consume(p),l):(!r.interrupt||s<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),u(p)):n(p)}function u(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(di,r.interrupt?n:d,e.attempt(FC,m,h))}function d(p){return r.containerState.initialBlankLine=!0,i++,m(p)}function h(p){return Me(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),m):n(p)}function m(p){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function TC(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(di,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||!Me(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(BC,t,s)(o))}function s(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,qe(e,e.attempt(mt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function SC(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 jC(e){e.exit(this.containerState.type)}function OC(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!Me(i)&&s&&s[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const bc={name:"setextUnderline",tokenize:MC,resolveTo:PC};function PC(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 MC(e,t,n){const r=this;let a;return i;function i(u){let d=r.events.length,h;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){h=r.events[d][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"),Me(u)?qe(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||ye(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const NC={tokenize:RC};function RC(e){const t=this,n=e.attempt(di,r,e.attempt(this.parser.constructs.flowInitial,a,qe(e,e.attempt(this.parser.constructs.flow,a,e.attempt(qD,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 IC={resolveAll:Xf()},$C=Jf("string"),LC=Jf("text");function Jf(e){return{tokenize:t,resolveAll:Xf(e==="text"?zC:void 0)};function t(n){const r=this,a=this.parser.constructs[e],i=n.attempt(a,s,o);return s;function s(d){return u(d)?i(d):o(d)}function o(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),l}function l(d){return u(d)?(n.exit("data"),i(d)):(n.consume(d),l)}function u(d){if(d===null)return!0;const h=a[d];let m=-1;if(h)for(;++m<h.length;){const p=h[m];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function Xf(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 zC(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 qC(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:C,enter:F,exit:_,attempt:j(w),check:j(k),interrupt:j(k,{interrupt:!0})},u={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:p,sliceSerialize:m,now:g,defineSkip:f,write:h};let d=t.tokenize.call(u,l);return t.resolveAll&&i.push(t),u;function h(R){return s=Bt(s,R),b(),s[s.length-1]!==null?[]:(q(t,0),u.events=Po(i,u.events,u),u.events)}function m(R,A){return UC(p(R),A)}function p(R){return WC(s,R)}function g(){const{line:R,column:A,offset:E,_index:S,_bufferIndex:O}=r;return{line:R,column:A,offset:E,_index:S,_bufferIndex:O}}function f(R){a[R.line]=R.column,z()}function b(){let R;for(;r._index<s.length;){const A=s[r._index];if(typeof A=="string")for(R=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===R&&r._bufferIndex<A.length;)v(A.charCodeAt(r._bufferIndex));else v(A)}}function v(R){d=d(R)}function C(R){ye(R)?(r.line++,r.column=1,r.offset+=R===-3?2:1,z()):R!==-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=R}function F(R,A){const E=A||{};return E.type=R,E.start=g(),u.events.push(["enter",E,u]),o.push(E),E}function _(R){const A=o.pop();return A.end=g(),u.events.push(["exit",A,u]),A}function w(R,A){q(R,A.from)}function k(R,A){A.restore()}function j(R,A){return E;function E(S,O,V){let H,Q,ae,D;return Array.isArray(S)?ee(S):"tokenize"in S?ee([S]):$(S);function $(I){return W;function W(U){const ne=U!==null&&I[U],re=U!==null&&I.null,le=[...Array.isArray(ne)?ne:ne?[ne]:[],...Array.isArray(re)?re:re?[re]:[]];return ee(le)(U)}}function ee(I){return H=I,Q=0,I.length===0?V:B(I[Q])}function B(I){return W;function W(U){return D=P(),ae=I,I.partial||(u.currentConstruct=I),I.name&&u.parser.constructs.disable.null.includes(I.name)?L():I.tokenize.call(A?Object.assign(Object.create(u),A):u,l,T,L)(U)}}function T(I){return R(ae,D),O}function L(I){return D.restore(),++Q<H.length?B(H[Q]):V}}}function q(R,A){R.resolveAll&&!i.includes(R)&&i.push(R),R.resolve&&en(u.events,A,u.events.length-A,R.resolve(u.events.slice(A),u)),R.resolveTo&&(u.events=R.resolveTo(u.events,u))}function P(){const R=g(),A=u.previous,E=u.currentConstruct,S=u.events.length,O=Array.from(o);return{restore:V,from:S};function V(){r=R,u.previous=A,u.currentConstruct=E,u.events.length=S,o=O,z()}}function z(){r.line in a&&r.column<2&&(r.column=a[r.line],r.offset+=a[r.line]-1)}}function WC(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 UC(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=`
138
+ `:""),[i]=y.useState(a);return Wr(()=>{var s=a();r.current&&r.current.textContent!==s&&(r.current.textContent=s)}),y.createElement(J1,{ref:r},i)},J1=y.memo(y.forwardRef((e,t)=>y.createElement("span",{"data-slate-string":!0,ref:t},e.children))),Wi=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",G1({},a),!dt||!n?"\uFEFF":null,n?y.createElement("br",null):null)};function zl(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 Of(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zl(Object(n),!0).forEach(function(r){Tt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zl(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var X1=dt?300:0;function ex(e,t){e.current&&(e.current.disconnect(),t&&(e.current=null))}function ql(e){e.current&&(clearTimeout(e.current),e.current=null)}var tx=e=>{var{leaf:t,isLast:n,text:r,parent:a,renderPlaceholder:i,renderLeaf:s=C=>y.createElement(rx,Of({},C))}=e,o=vn(),l=y.useRef(null),u=y.useRef(null),[d,h]=y.useState(!1),m=y.useRef(null),p=y.useCallback(C=>{if(ex(l,C==null),C==null){var F;Ps.delete(o),(F=t.onPlaceholderResize)===null||F===void 0||F.call(t,null)}else{if(Ps.set(o,C),!l.current){var _=window.ResizeObserver||r1;l.current=new _(()=>{var w;(w=t.onPlaceholderResize)===null||w===void 0||w.call(t,C)})}l.current.observe(C),u.current=C}},[u,t,o]),g=y.createElement(Q1,{isLast:n,leaf:t,parent:a,text:r}),f=!!t[ar];if(y.useEffect(()=>(f?m.current||(m.current=setTimeout(()=>{h(!0),m.current=null},X1)):(ql(m),h(!1)),()=>ql(m)),[f,h]),f&&d){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:Er?"inherit":void 0},contentEditable:!1,ref:p}};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})},nx=y.memo(tx,(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[ar]===e.leaf[ar]),rx=e=>{var{attributes:t,children:n}=e;return y.createElement("span",Of({},t),n)},ax=e=>{for(var{decorations:t,isLast:n,parent:r,renderPlaceholder:a,renderLeaf:i,text:s}=e,o=vn(),l=y.useRef(null),u=fe.decorations(s,t),d=te.findKey(o,s),h=[],m=0;m<u.length;m++){var p=u[m];h.push(y.createElement(nx,{isLast:n&&m===u.length-1,key:"".concat(d.id,"-").concat(m),renderPlaceholder:a,leaf:p,text:s,parent:r,renderLeaf:i}))}var g=y.useCallback(f=>{var b=ci.get(o);f?(b==null||b.set(d,f),Fn.set(s,f),qr.set(f,s)):(b==null||b.delete(d),Fn.delete(s),l.current&&qr.delete(l.current)),l.current=f},[l,o,d,s]);return y.createElement("span",{"data-slate-node":"text",ref:g},h)},Pf=y.memo(ax,(e,t)=>t.parent===e.parent&&t.isLast===e.isLast&&t.renderLeaf===e.renderLeaf&&t.renderPlaceholder===e.renderPlaceholder&&t.text===e.text&&Y1(t.decorations,e.decorations));function Wl(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 Ls(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Wl(Object(n),!0).forEach(function(r){Tt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wl(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var ix=e=>{var{decorations:t,element:n,renderElement:r=C=>y.createElement(ox,Ls({},C)),renderPlaceholder:a,renderLeaf:i,selection:s}=e,o=vn(),l=cx(),u=o.isInline(n),d=te.findKey(o,n),h=y.useCallback(C=>{var F=ci.get(o);C?(F==null||F.set(d,C),Fn.set(n,C),qr.set(C,n)):(F==null||F.delete(d),Fn.delete(n))},[o,d,n]),m=Nf({decorations:t,node:n,renderElement:r,renderPlaceholder:a,renderLeaf:i,selection:s}),p={"data-slate-node":"element",ref:h};if(u&&(p["data-slate-inline"]=!0),!u&&x.hasInlines(o,n)){var g=ue.string(n),f=of(g);f==="rtl"&&(p.dir=f)}if(x.isVoid(o,n)){p["data-slate-void"]=!0,!l&&u&&(p.contentEditable=!1);var b=u?"span":"div",[[v]]=ue.texts(n);m=y.createElement(b,{"data-slate-spacer":!0,style:{height:"0",color:"transparent",outline:"none",position:"absolute"}},y.createElement(Pf,{renderPlaceholder:a,decorations:[],isLast:!1,parent:n,text:v})),Fo.set(v,0),Bo.set(v,n)}return r({attributes:p,children:m,element:n})},sx=y.memo(ix,(e,t)=>e.element===t.element&&e.renderElement===t.renderElement&&e.renderLeaf===t.renderLeaf&&e.renderPlaceholder===t.renderPlaceholder&&Z1(e.decorations,t.decorations)&&(e.selection===t.selection||!!e.selection&&!!t.selection&&Z.equals(e.selection,t.selection))),ox=e=>{var{attributes:t,children:n,element:r}=e,a=vn(),i=a.isInline(r)?"span":"div";return y.createElement(i,Ls(Ls({},t),{},{style:{position:"relative"}}),n)},Mf=y.createContext(()=>[]),ux=()=>y.useContext(Mf),lx=y.createContext(!1),Nf=e=>{for(var{decorations:t,node:n,renderElement:r,renderPlaceholder:a,renderLeaf:i,selection:s}=e,o=ux(),l=vn(),u=te.findPath(l,n),d=[],h=de.isElement(n)&&!l.isInline(n)&&x.hasInlines(l,n),m=0;m<n.children.length;m++){var p=u.concat(m),g=n.children[m],f=te.findKey(l,g),b=x.range(l,p),v=s&&Z.intersection(b,s),C=o([g,p]);for(var F of t){var _=Z.intersection(F,b);_&&C.push(_)}de.isElement(g)?d.push(y.createElement(lx.Provider,{key:"provider-".concat(f.id),value:!!v},y.createElement(sx,{decorations:C,element:g,key:f.id,renderElement:r,renderPlaceholder:a,renderLeaf:i,selection:v}))):d.push(y.createElement(Pf,{decorations:C,key:f.id,isLast:h&&m===n.children.length-1,parent:n,renderPlaceholder:a,renderLeaf:i,text:g})),Fo.set(g,m),Bo.set(g,n)}return d},Rf=y.createContext(!1),cx=()=>y.useContext(Rf),If=y.createContext(null),Nn=()=>{var e=y.useContext(If);if(!e)throw new Error("The `useSlate` hook must be used inside the <Slate> component's context.");var{editor:t}=e;return t};function dx(){var e=vn(),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 fx=3,hx={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"},mx={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"},px={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},Ve=e=>{var t=hx[e],n=mx[e],r=px[e],a=t&&qi(t),i=n&&qi(n),s=r&&qi(r);return o=>!!(a&&a(o)||Pl&&i&&i(o)||!Pl&&s&&s(o))},Ze={isBold:Ve("bold"),isCompose:Ve("compose"),isMoveBackward:Ve("moveBackward"),isMoveForward:Ve("moveForward"),isDeleteBackward:Ve("deleteBackward"),isDeleteForward:Ve("deleteForward"),isDeleteLineBackward:Ve("deleteLineBackward"),isDeleteLineForward:Ve("deleteLineForward"),isDeleteWordBackward:Ve("deleteWordBackward"),isDeleteWordForward:Ve("deleteWordForward"),isExtendBackward:Ve("extendBackward"),isExtendForward:Ve("extendForward"),isExtendLineBackward:Ve("extendLineBackward"),isExtendLineForward:Ve("extendLineForward"),isItalic:Ve("italic"),isMoveLineBackward:Ve("moveLineBackward"),isMoveLineForward:Ve("moveLineForward"),isMoveWordBackward:Ve("moveWordBackward"),isMoveWordForward:Ve("moveWordForward"),isRedo:Ve("redo"),isSoftBreak:Ve("insertSoftBreak"),isSplitBlock:Ve("splitBlock"),isTransposeCharacter:Ve("transposeCharacter"),isUndo:Ve("undo")},gx=(e,t)=>{var n=[],r=()=>{n=[]},a=s=>{if(t.current){var o=s.filter(l=>So(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}},vx={subtree:!0,childList:!0,characterData:!0,characterDataOldValue:!0};class $f extends y.Component{constructor(){super(...arguments),Tt(this,"context",null),Tt(this,"manager",null),Tt(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,vx)}componentDidMount(){var{receivedUserInput:t}=this.props,n=this.context;this.manager=gx(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}}Tt($f,"contextType",ko);var bx=dt?$f:e=>{var{children:t}=e;return y.createElement(y.Fragment,null,t)},yx=["autoFocus","decorate","onDOMBeforeInput","placeholder","readOnly","renderElement","renderLeaf","renderPlaceholder","scrollSelectionIntoView","style","as","disableDefaultStyles"],xx=["text"];function Ul(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 $t(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ul(Object(n),!0).forEach(function(r){Tt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ul(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Dx=e=>y.createElement(y.Fragment,null,Nf(e)),Cx=e=>{var t=y.useCallback(T=>y.createElement(wx,$t({},T)),[]),{autoFocus:n,decorate:r=Ex,onDOMBeforeInput:a,placeholder:i,readOnly:s=!1,renderElement:o,renderLeaf:l,renderPlaceholder:u=t,scrollSelectionIntoView:d=_x,style:h={},as:m="div",disableDefaultStyles:p=!1}=e,g=rr(e,yx),f=Nn(),[b,v]=y.useState(!1),C=y.useRef(null),F=y.useRef([]),[_,w]=y.useState(),{onUserInput:k,receivedUserInput:j}=dx(),[,q]=y.useReducer(T=>T+1,0);_f.set(f,q),Ms.set(f,s);var P=y.useMemo(()=>({isDraggingInternally:!1,isUpdatingSelection:!1,latestElement:null,hasMarkPlaceholder:!1}),[]);y.useEffect(()=>{C.current&&n&&C.current.focus()},[n]);var z=y.useRef(),R=y.useMemo(()=>Oy(()=>{var T=z.current;if((dt||!te.isComposing(f))&&(!P.isUpdatingSelection||T!=null&&T.isFlushing())&&!P.isDraggingInternally){var L=te.findDocumentOrShadowRoot(f),{activeElement:I}=L,W=te.toDOMNode(f,f),U=L.getSelection();if(I===W?(P.latestElement=I,fn.set(f,!0)):fn.delete(f),!U)return J.deselect(f);var{anchorNode:ne,focusNode:re}=U,le=te.hasEditableTarget(f,ne)||te.isTargetInsideNonReadonlyVoid(f,ne),ee=te.hasEditableTarget(f,re)||te.isTargetInsideNonReadonlyVoid(f,re);if(le&&ee){var pe=te.toSlateRange(f,U,{exactMatch:!1,suppressThrow:!0});pe&&(!te.isComposing(f)&&!(T!=null&&T.hasPendingChanges())&&!(T!=null&&T.isFlushing())?J.select(f,pe):T==null||T.handleUserSelect(pe))}s&&(!le||!ee)&&J.deselect(f)}},100),[f,s,P]),A=y.useMemo(()=>Fy(R,0),[R]);z.current=U1({node:C,onDOMSelectionChange:R,scheduleOnDOMSelectionChange:A}),Wr(()=>{var T,L,I;C.current&&(I=To(C.current))?(Ef.set(f,I),Fa.set(f,C.current),Fn.set(f,C.current),qr.set(C.current,f)):Fn.delete(f);var{selection:W}=f,U=te.findDocumentOrShadowRoot(f),ne=U.getSelection();if(!(!ne||!te.isFocused(f)||(T=z.current)!==null&&T!==void 0&&T.hasPendingAction())){var re=me=>{var _e=ne.type!=="None";if(!(!W&&!_e)){var Be=ne.focusNode,Se;if(Zn&&ne.rangeCount>1){var Ye=ne.getRangeAt(0),Ke=ne.getRangeAt(ne.rangeCount-1);Ye.startContainer===Be?Se=Ke.endContainer:Se=Ye.startContainer}else Se=ne.anchorNode;var je=Fa.get(f),Oe=!1;if(je.contains(Se)&&je.contains(Be)&&(Oe=!0),_e&&Oe&&W&&!me){var De=te.toSlateRange(f,ne,{exactMatch:!0,suppressThrow:!0});if(De&&Z.equals(De,W)){var Le;if(!P.hasMarkPlaceholder||(Le=Se)!==null&&Le!==void 0&&(Le=Le.parentElement)!==null&&Le!==void 0&&Le.hasAttribute("data-slate-mark-placeholder"))return}}if(W&&!te.hasRange(f,W)){f.selection=te.toSlateRange(f,ne,{exactMatch:!1,suppressThrow:!0});return}P.isUpdatingSelection=!0;var Ue=W&&te.toDOMRange(f,W);return Ue?(te.isComposing(f)&&!dt?ne.collapseToEnd():Z.isBackward(W)?ne.setBaseAndExtent(Ue.endContainer,Ue.endOffset,Ue.startContainer,Ue.startOffset):ne.setBaseAndExtent(Ue.startContainer,Ue.startOffset,Ue.endContainer,Ue.endOffset),d(f,Ue)):ne.removeAllRanges(),Ue}};ne.rangeCount<=1&&re();var le=((L=z.current)===null||L===void 0?void 0:L.isFlushing())==="action";if(!dt||!le){setTimeout(()=>{P.isUpdatingSelection=!1});return}var ee=null,pe=requestAnimationFrame(()=>{if(le){var me=_e=>{try{var Be=te.toDOMNode(f,f);Be.focus(),re(_e)}catch{}};me(),ee=setTimeout(()=>{me(!0),P.isUpdatingSelection=!1})}});return()=>{cancelAnimationFrame(pe),ee&&clearTimeout(ee)}}});var E=y.useCallback(T=>{if(k(),!s&&te.hasEditableTarget(f,T.target)&&!kx(T,a)){var L;if(z.current)return z.current.handleDOMBeforeInput(T);A.flush(),R.flush();var{selection:I}=f,{inputType:W}=T,U=T.dataTransfer||T.data||void 0,ne=W==="insertCompositionText"||W==="deleteCompositionText";if(ne&&te.isComposing(f))return;var re=!1;if(W==="insertText"&&I&&Z.isCollapsed(I)&&T.data&&T.data.length===1&&/[a-z ]/i.test(T.data)&&I.anchor.offset!==0){var le,ee;re=!0,f.marks&&(re=!1);var{anchor:pe}=I,[me,_e]=te.toDOMPoint(f,pe),Be=(le=me.parentElement)===null||le===void 0?void 0:le.closest("a"),Se=te.getWindow(f);if(re&&Be&&te.hasDOMNode(f,Be)){var Ye,Ke=Se==null?void 0:Se.document.createTreeWalker(Be,NodeFilter.SHOW_TEXT).lastChild();Ke===me&&((Ye=Ke.textContent)===null||Ye===void 0?void 0:Ye.length)===_e&&(re=!1)}if(re&&me.parentElement&&(Se==null||(ee=Se.getComputedStyle(me.parentElement))===null||ee===void 0?void 0:ee.whiteSpace)==="pre"){var je=x.above(f,{at:pe.path,match:oe=>de.isElement(oe)&&x.isBlock(f,oe)});je&&ue.string(je[0]).includes(" ")&&(re=!1)}}if(!W.startsWith("delete")||W.startsWith("deleteBy")){var[Oe]=T.getTargetRanges();if(Oe){var De=te.toSlateRange(f,Oe,{exactMatch:!1,suppressThrow:!1});if(!I||!Z.equals(I,De)){re=!1;var Le=!ne&&f.selection&&x.rangeRef(f,f.selection);J.select(f,De),Le&&Br.set(f,Le)}}}if(ne)return;if(re||T.preventDefault(),I&&Z.isExpanded(I)&&W.startsWith("delete")){var Ue=W.endsWith("Backward")?"backward":"forward";x.deleteFragment(f,{direction:Ue});return}switch(W){case"deleteByComposition":case"deleteByCut":case"deleteByDrag":{x.deleteFragment(f);break}case"deleteContent":case"deleteContentForward":{x.deleteForward(f);break}case"deleteContentBackward":{x.deleteBackward(f);break}case"deleteEntireSoftLine":{x.deleteBackward(f,{unit:"line"}),x.deleteForward(f,{unit:"line"});break}case"deleteHardLineBackward":{x.deleteBackward(f,{unit:"block"});break}case"deleteSoftLineBackward":{x.deleteBackward(f,{unit:"line"});break}case"deleteHardLineForward":{x.deleteForward(f,{unit:"block"});break}case"deleteSoftLineForward":{x.deleteForward(f,{unit:"line"});break}case"deleteWordBackward":{x.deleteBackward(f,{unit:"word"});break}case"deleteWordForward":{x.deleteForward(f,{unit:"word"});break}case"insertLineBreak":x.insertSoftBreak(f);break;case"insertParagraph":{x.insertBreak(f);break}case"insertFromComposition":case"insertFromDrop":case"insertFromPaste":case"insertFromYank":case"insertReplacementText":case"insertText":{W==="insertFromComposition"&&te.isComposing(f)&&(v(!1),wn.set(f,!1)),(U==null?void 0:U.constructor.name)==="DataTransfer"?te.insertData(f,U):typeof U=="string"&&(re?F.current.push(()=>x.insertText(f,U)):x.insertText(f,U));break}}var G=(L=Br.get(f))===null||L===void 0?void 0:L.unref();Br.delete(f),G&&(!f.selection||!Z.equals(f.selection,G))&&J.select(f,G)}},[f,R,k,a,s,A]),S=y.useCallback(T=>{T==null?(R.cancel(),A.cancel(),Fa.delete(f),Fn.delete(f),C.current&&sn&&C.current.removeEventListener("beforeinput",E)):sn&&T.addEventListener("beforeinput",E),C.current=T},[R,A,f,E]);Wr(()=>{var T=te.getWindow(f);return T.document.addEventListener("selectionchange",A),()=>{T.document.removeEventListener("selectionchange",A)}},[A]);var O=r([f,[]]),V=i&&f.children.length===1&&Array.from(ue.texts(f)).length===1&&ue.string(f)===""&&!b,H=y.useCallback(T=>{if(T&&V){var L;w((L=T.getBoundingClientRect())===null||L===void 0?void 0:L.height)}else w(void 0)},[V]);if(V){var Q=x.start(f,[]);O.push({[ar]:!0,placeholder:i,onPlaceholderResize:H,anchor:Q,focus:Q})}var{marks:ae}=f;if(P.hasMarkPlaceholder=!1,f.selection&&Z.isCollapsed(f.selection)&&ae){var{anchor:D}=f.selection,$=ue.leaf(f,D.path),X=rr($,xx);if(!fe.equals($,ae,{loose:!0})){P.hasMarkPlaceholder=!0;var B=Object.fromEntries(Object.keys(X).map(T=>[T,null]));O.push($t($t($t({[kf]:!0},B),ae),{},{anchor:D,focus:D}))}}return y.useEffect(()=>{setTimeout(()=>{var{selection:T}=f;if(T){var{anchor:L}=T,I=ue.leaf(f,L.path);if(ae&&!fe.equals(I,ae,{loose:!0})){Ot.set(f,ae);return}}Ot.delete(f)})}),y.createElement(Rf.Provider,{value:s},y.createElement(Mf.Provider,{value:r},y.createElement(bx,{node:C,receivedUserInput:j},y.createElement(m,$t($t({role:s?void 0:"textbox","aria-multiline":s?void 0:!0},g),{},{spellCheck:sn||!ka?g.spellCheck:!1,autoCorrect:sn||!ka?g.autoCorrect:"false",autoCapitalize:sn||!ka?g.autoCapitalize:"false","data-slate-editor":!0,"data-slate-node":"value",contentEditable:!s,zindex:-1,suppressContentEditableWarning:!0,ref:S,style:$t($t({},p?{}:$t({position:"relative",whiteSpace:"pre-wrap",wordWrap:"break-word"},_?{minHeight:_}:{})),h),onBeforeInput:y.useCallback(T=>{if(!sn&&!s&&!lt(T,g.onBeforeInput)&&te.hasSelectableTarget(f,T.target)&&(T.preventDefault(),!te.isComposing(f))){var L=T.data;x.insertText(f,L)}},[g.onBeforeInput,f,s]),onInput:y.useCallback(T=>{if(!lt(T,g.onInput)){if(z.current){z.current.handleInput();return}for(var L of F.current)L();F.current=[]}},[g.onInput]),onBlur:y.useCallback(T=>{if(!(s||P.isUpdatingSelection||!te.hasSelectableTarget(f,T.target)||lt(T,g.onBlur))){var L=te.findDocumentOrShadowRoot(f);if(P.latestElement!==L.activeElement){var{relatedTarget:I}=T,W=te.toDOMNode(f,f);if(I!==W&&!(At(I)&&I.hasAttribute("data-slate-spacer"))){if(I!=null&&hn(I)&&te.hasDOMNode(f,I)){var U=te.toSlateNode(f,I);if(de.isElement(U)&&!f.isVoid(U))return}if(Er){var ne=L.getSelection();ne==null||ne.removeAllRanges()}fn.delete(f)}}}},[s,P.isUpdatingSelection,P.latestElement,f,g.onBlur]),onClick:y.useCallback(T=>{if(te.hasTarget(f,T.target)&&!lt(T,g.onClick)&&hn(T.target)){var L=te.toSlateNode(f,T.target),I=te.findPath(f,L);if(!x.hasPath(f,I)||ue.get(f,I)!==L)return;if(T.detail===fx&&I.length>=1){var W=I;if(!(de.isElement(L)&&x.isBlock(f,L))){var U,ne=x.above(f,{match:Be=>de.isElement(Be)&&x.isBlock(f,Be),at:I});W=(U=ne==null?void 0:ne[1])!==null&&U!==void 0?U:I.slice(0,1)}var re=x.range(f,W);J.select(f,re);return}if(s)return;var le=x.start(f,I),ee=x.end(f,I),pe=x.void(f,{at:le}),me=x.void(f,{at:ee});if(pe&&me&&N.equals(pe[1],me[1])){var _e=x.range(f,le);J.select(f,_e)}}},[f,g.onClick,s]),onCompositionEnd:y.useCallback(T=>{if(te.hasSelectableTarget(f,T.target)){var L;if(te.isComposing(f)&&Promise.resolve().then(()=>{v(!1),wn.set(f,!1)}),(L=z.current)===null||L===void 0||L.handleCompositionEnd(T),lt(T,g.onCompositionEnd)||dt)return;if(!Er&&!p1&&!d1&&!v1&&!g1&&T.data){var I=Ot.get(f);Ot.delete(f),I!==void 0&&(Gt.set(f,f.marks),f.marks=I),x.insertText(f,T.data);var W=Gt.get(f);Gt.delete(f),W!==void 0&&(f.marks=W)}}},[g.onCompositionEnd,f]),onCompositionUpdate:y.useCallback(T=>{te.hasSelectableTarget(f,T.target)&&!lt(T,g.onCompositionUpdate)&&(te.isComposing(f)||(v(!0),wn.set(f,!0)))},[g.onCompositionUpdate,f]),onCompositionStart:y.useCallback(T=>{if(te.hasSelectableTarget(f,T.target)){var L;if((L=z.current)===null||L===void 0||L.handleCompositionStart(T),lt(T,g.onCompositionStart)||dt)return;v(!0);var{selection:I}=f;if(I&&Z.isExpanded(I)){x.deleteFragment(f);return}}},[g.onCompositionStart,f]),onCopy:y.useCallback(T=>{te.hasSelectableTarget(f,T.target)&&!lt(T,g.onCopy)&&!Hl(T)&&(T.preventDefault(),te.setFragmentData(f,T.clipboardData,"copy"))},[g.onCopy,f]),onCut:y.useCallback(T=>{if(!s&&te.hasSelectableTarget(f,T.target)&&!lt(T,g.onCut)&&!Hl(T)){T.preventDefault(),te.setFragmentData(f,T.clipboardData,"cut");var{selection:L}=f;if(L)if(Z.isExpanded(L))x.deleteFragment(f);else{var I=ue.parent(f,L.anchor.path);x.isVoid(f,I)&&J.delete(f)}}},[s,f,g.onCut]),onDragOver:y.useCallback(T=>{if(te.hasTarget(f,T.target)&&!lt(T,g.onDragOver)){var L=te.toSlateNode(f,T.target);de.isElement(L)&&x.isVoid(f,L)&&T.preventDefault()}},[g.onDragOver,f]),onDragStart:y.useCallback(T=>{if(!s&&te.hasTarget(f,T.target)&&!lt(T,g.onDragStart)){var L=te.toSlateNode(f,T.target),I=te.findPath(f,L),W=de.isElement(L)&&x.isVoid(f,L)||x.void(f,{at:I,voids:!0});if(W){var U=x.range(f,I);J.select(f,U)}P.isDraggingInternally=!0,te.setFragmentData(f,T.dataTransfer,"drag")}},[s,f,g.onDragStart,P]),onDrop:y.useCallback(T=>{if(!s&&te.hasTarget(f,T.target)&&!lt(T,g.onDrop)){T.preventDefault();var L=f.selection,I=te.findEventRange(f,T),W=T.dataTransfer;J.select(f,I),P.isDraggingInternally&&L&&!Z.equals(L,I)&&!x.void(f,{at:I,voids:!0})&&J.delete(f,{at:L}),te.insertData(f,W),te.isFocused(f)||te.focus(f)}P.isDraggingInternally=!1},[s,f,g.onDrop,P]),onDragEnd:y.useCallback(T=>{!s&&P.isDraggingInternally&&g.onDragEnd&&te.hasTarget(f,T.target)&&g.onDragEnd(T),P.isDraggingInternally=!1},[s,P,g,f]),onFocus:y.useCallback(T=>{if(!s&&!P.isUpdatingSelection&&te.hasEditableTarget(f,T.target)&&!lt(T,g.onFocus)){var L=te.toDOMNode(f,f),I=te.findDocumentOrShadowRoot(f);if(P.latestElement=I.activeElement,Zn&&T.target!==L){L.focus();return}fn.set(f,!0)}},[s,P,f,g.onFocus]),onKeyDown:y.useCallback(T=>{if(!s&&te.hasEditableTarget(f,T.target)){var L;(L=z.current)===null||L===void 0||L.handleKeyDown(T);var{nativeEvent:I}=T;if(te.isComposing(f)&&I.isComposing===!1&&(wn.set(f,!1),v(!1)),lt(T,g.onKeyDown)||te.isComposing(f))return;var{selection:W}=f,U=f.children[W!==null?W.focus.path[0]:0],ne=of(ue.string(U))==="rtl";if(Ze.isRedo(I)){T.preventDefault();var re=f;typeof re.redo=="function"&&re.redo();return}if(Ze.isUndo(I)){T.preventDefault();var le=f;typeof le.undo=="function"&&le.undo();return}if(Ze.isMoveLineBackward(I)){T.preventDefault(),J.move(f,{unit:"line",reverse:!0});return}if(Ze.isMoveLineForward(I)){T.preventDefault(),J.move(f,{unit:"line"});return}if(Ze.isExtendLineBackward(I)){T.preventDefault(),J.move(f,{unit:"line",edge:"focus",reverse:!0});return}if(Ze.isExtendLineForward(I)){T.preventDefault(),J.move(f,{unit:"line",edge:"focus"});return}if(Ze.isMoveBackward(I)){T.preventDefault(),W&&Z.isCollapsed(W)?J.move(f,{reverse:!ne}):J.collapse(f,{edge:ne?"end":"start"});return}if(Ze.isMoveForward(I)){T.preventDefault(),W&&Z.isCollapsed(W)?J.move(f,{reverse:ne}):J.collapse(f,{edge:ne?"start":"end"});return}if(Ze.isMoveWordBackward(I)){T.preventDefault(),W&&Z.isExpanded(W)&&J.collapse(f,{edge:"focus"}),J.move(f,{unit:"word",reverse:!ne});return}if(Ze.isMoveWordForward(I)){T.preventDefault(),W&&Z.isExpanded(W)&&J.collapse(f,{edge:"focus"}),J.move(f,{unit:"word",reverse:ne});return}if(sn){if((wf||Er)&&W&&(Ze.isDeleteBackward(I)||Ze.isDeleteForward(I))&&Z.isCollapsed(W)){var ee=ue.parent(f,W.anchor.path);if(de.isElement(ee)&&x.isVoid(f,ee)&&(x.isInline(f,ee)||x.isBlock(f,ee))){T.preventDefault(),x.deleteBackward(f,{unit:"block"});return}}}else{if(Ze.isBold(I)||Ze.isItalic(I)||Ze.isTransposeCharacter(I)){T.preventDefault();return}if(Ze.isSoftBreak(I)){T.preventDefault(),x.insertSoftBreak(f);return}if(Ze.isSplitBlock(I)){T.preventDefault(),x.insertBreak(f);return}if(Ze.isDeleteBackward(I)){T.preventDefault(),W&&Z.isExpanded(W)?x.deleteFragment(f,{direction:"backward"}):x.deleteBackward(f);return}if(Ze.isDeleteForward(I)){T.preventDefault(),W&&Z.isExpanded(W)?x.deleteFragment(f,{direction:"forward"}):x.deleteForward(f);return}if(Ze.isDeleteLineBackward(I)){T.preventDefault(),W&&Z.isExpanded(W)?x.deleteFragment(f,{direction:"backward"}):x.deleteBackward(f,{unit:"line"});return}if(Ze.isDeleteLineForward(I)){T.preventDefault(),W&&Z.isExpanded(W)?x.deleteFragment(f,{direction:"forward"}):x.deleteForward(f,{unit:"line"});return}if(Ze.isDeleteWordBackward(I)){T.preventDefault(),W&&Z.isExpanded(W)?x.deleteFragment(f,{direction:"backward"}):x.deleteBackward(f,{unit:"word"});return}if(Ze.isDeleteWordForward(I)){T.preventDefault(),W&&Z.isExpanded(W)?x.deleteFragment(f,{direction:"forward"}):x.deleteForward(f,{unit:"word"});return}}}},[s,f,g.onKeyDown]),onPaste:y.useCallback(T=>{!s&&te.hasEditableTarget(f,T.target)&&!lt(T,g.onPaste)&&(!sn||x1(T.nativeEvent)||Er)&&(T.preventDefault(),te.insertData(f,T.clipboardData))},[s,f,g.onPaste])}),y.createElement(Dx,{decorations:O,node:f,renderElement:o,renderPlaceholder:u,renderLeaf:l,selection:f.selection})))))},wx=e=>{var{attributes:t,children:n}=e;return y.createElement("span",$t({},t),n,dt&&y.createElement("br",null))},Ex=()=>[],_x=(e,t)=>{if(t.getBoundingClientRect&&(!e.selection||e.selection&&Z.isCollapsed(e.selection))){var n=t.startContainer.parentElement;n.getBoundingClientRect=t.getBoundingClientRect.bind(t),Ny(n,{scrollMode:"if-needed"}),delete n.getBoundingClientRect}},lt=(e,t)=>{if(!t)return!1;var n=t(e);return n??(e.isDefaultPrevented()||e.isPropagationStopped())},Hl=e=>hn(e.target)&&(e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement),kx=(e,t)=>{if(!t)return!1;var n=t(e);return n??e.defaultPrevented},Fx=y.createContext(!1),Bx=y.createContext({});function Ax(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 Tx=["editor","children","onChange","onSelectionChange","onValueChange","initialValue"],Sx=e=>{var{editor:t,children:n,onChange:r,onSelectionChange:a,onValueChange:i,initialValue:s}=e,o=rr(e,Tx),[l,u]=y.useState(()=>{if(!ue.isNodeList(s))throw new Error("[Slate] initialValue is invalid! Expected a list of elements but got: ".concat(nt.stringify(s)));if(!x.isEditor(t))throw new Error("[Slate] editor is invalid! You passed: ".concat(nt.stringify(t)));return t.children=s,Object.assign(t,o),{v:0,editor:t}}),{selectorContext:d,onChange:h}=Ax(t),m=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(()=>(Ns.set(t,m),()=>{Ns.set(t,()=>{})}),[t,m]);var[p,g]=y.useState(te.isFocused(t));return y.useEffect(()=>{g(te.isFocused(t))},[t]),Wr(()=>{var f=()=>g(te.isFocused(t));return Cf>=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(Bx.Provider,{value:d},y.createElement(If.Provider,{value:l},y.createElement(ko.Provider,{value:l.editor},y.createElement(Fx.Provider,{value:p},n))))},Vl=(e,t)=>{var n=(t.top+t.bottom)/2;return e.top<=n&&e.bottom>=n},Kl=(e,t,n)=>{var r=te.toDOMRange(e,t).getBoundingClientRect(),a=te.toDOMRange(e,n).getBoundingClientRect();return Vl(r,a)&&Vl(a,r)},jx=(e,t)=>{var n=x.range(e,Z.end(t)),r=Array.from(x.positions(e,{at:t})),a=0,i=r.length,s=Math.floor(i/2);if(Kl(e,x.range(e,r[a]),n))return x.range(e,r[a],n);if(r.length<2)return x.range(e,r[r.length-1],n);for(;s!==r.length&&s!==a;)Kl(e,x.range(e,r[s]),n)?i=s:a=s,s=Math.floor((a+i)/2);return x.range(e,r[i],n)};function Zl(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 Yl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Zl(Object(n),!0).forEach(function(r){Tt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zl(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Ox=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 ci.set(r,new WeakMap),r.addMark=(u,d)=>{var h,m;(h=Ao.get(r))===null||h===void 0||h(),!Ot.get(r)&&(m=pt.get(r))!==null&&m!==void 0&&m.length&&Ot.set(r,null),Gt.delete(r),o(u,d)},r.removeMark=u=>{var d;!Ot.get(r)&&(d=pt.get(r))!==null&&d!==void 0&&d.length&&Ot.set(r,null),Gt.delete(r),l(u)},r.deleteBackward=u=>{if(u!=="line")return s(u);if(r.selection&&Z.isCollapsed(r.selection)){var d=x.above(r,{match:g=>de.isElement(g)&&x.isBlock(r,g),at:r.selection});if(d){var[,h]=d,m=x.range(r,h,r.selection.anchor),p=jx(r,m);Z.isCollapsed(p)||J.delete(r,{at:p})}}},r.apply=u=>{var d=[],h=[],m=pt.get(r);if(m!=null&&m.length){var p=m.map(S=>O1(S,u)).filter(Boolean);pt.set(r,p)}var g=ln.get(r);g&&ln.set(r,Nl(r,g,u));var f=un.get(r);if(f!=null&&f.at){var b=ke.isPoint(f==null?void 0:f.at)?$s(r,f.at,u):Nl(r,f.at,u);un.set(r,b?Yl(Yl({},f),{},{at:b}):null)}switch(u.type){case"insert_text":case"remove_text":case"set_node":case"split_node":{d.push(...zn(r,u.path));break}case"set_selection":{var v;(v=Br.get(r))===null||v===void 0||v.unref(),Br.delete(r);break}case"insert_node":case"remove_node":{d.push(...zn(r,N.parent(u.path)));break}case"merge_node":{var C=N.previous(u.path);d.push(...zn(r,C));break}case"move_node":{var F=N.common(N.parent(u.path),N.parent(u.newPath));d.push(...zn(r,F));var _;N.isBefore(u.path,u.newPath)?(d.push(...zn(r,N.parent(u.path))),_=u.newPath):(d.push(...zn(r,N.parent(u.newPath))),_=u.path);var w=ue.get(t,N.parent(_)),k=te.findKey(r,w),j=x.pathRef(r,N.parent(_));h.push([j,k]);break}}a(u);for(var[q,P]of d){var[z]=x.node(r,q);Wa.set(z,P)}for(var[R,A]of h)if(R.current){var[E]=x.node(r,R.current);Wa.set(E,A)}},r.setFragmentData=u=>{var{selection:d}=r;if(d){var[h,m]=Z.edges(d),p=x.void(r,{at:h.path}),g=x.void(r,{at:m.path});if(!(Z.isCollapsed(d)&&!p)){var f=te.toDOMRange(r,d),b=f.cloneContents(),v=b.childNodes[0];if(b.childNodes.forEach(z=>{z.textContent&&z.textContent.trim()!==""&&(v=z)}),g){var[C]=g,F=f.cloneRange(),_=te.toDOMNode(r,C);F.setEndAfter(_),b=F.cloneContents()}if(p&&(v=b.querySelector("[data-slate-spacer]")),Array.from(b.querySelectorAll("[data-slate-zero-width]")).forEach(z=>{var R=z.getAttribute("data-slate-zero-width")==="n";z.textContent=R?`
139
+ `:""}),Ff(v)){var w=v.ownerDocument.createElement("span");w.style.whiteSpace="pre",w.appendChild(v),b.appendChild(w),v=w}var k=r.getFragment(),j=JSON.stringify(k),q=window.btoa(encodeURIComponent(j));v.setAttribute("data-slate-fragment",q),u.setData("application/".concat(n),q);var P=b.ownerDocument.createElement("div");return P.appendChild(b),P.setAttribute("hidden","true"),b.ownerDocument.body.appendChild(P),u.setData("text/html",P.innerHTML),u.setData("text/plain",Af(P)),b.ownerDocument.body.removeChild(P),u}}},r.insertData=u=>{r.insertFragmentData(u)||r.insertTextData(u)},r.insertFragmentData=u=>{var d=u.getData("application/".concat(n))||_1(u);if(d){var h=decodeURIComponent(window.atob(d)),m=JSON.parse(h);return r.insertFragment(m),!0}return!1},r.insertTextData=u=>{var d=u.getData("text/plain");if(d){var h=d.split(/\r\n|\r|\n/),m=!1;for(var p of h)m&&J.splitNodes(r,{always:!0}),r.insertText(p),m=!0;return!0}return!1},r.onChange=u=>{var d=Cf<18?Pc.unstable_batchedUpdates:h=>h();d(()=>{var h=Ns.get(r);h&&h(u),i(u)})},r},zn=(e,t)=>{var n=[];for(var[r,a]of x.levels(e,{at:t})){var i=te.findKey(e,r);n.push([a,i])}return n};const Px={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)}},an=y.createContext(Px);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||{}),qt=(e=>(e.delete="delete_mark",e.emphasis="emphasis_mark",e.code="inline_code_mark",e.strong="strong_mark",e))(qt||{});const Mx=({attributes:e,children:t,element:n})=>{const r=n;switch(r.type){case Y.blockquote:return c.jsx("blockquote",{className:"subtle",...e,children:t});case Y.link:return c.jsx("a",{...e,children:t});case Y.li:return c.jsx("li",{...e,children:t});case Y.mention:const a=r;return a!=null&&a.name&&a.name===Or?c.jsxs("span",{...e,className:"mention deleted-user",children:["@",c.jsx(ie.FormattedMessage,{id:"member_deleted"}),t]}):c.jsxs("a",{...e,className:"mention",children:["@",(a==null?void 0:a.name)||"",t]});case Y.ol:return c.jsx("ol",{...e,children:t});case Y.ul:return c.jsx("ul",{...e,children:t});case Y.span:return c.jsx("span",{...e,children:t});case Y.paragraph:return c.jsx("p",{...e,children:t});default:return c.jsx("span",{...e,children:t})}},Nx=({attributes:e,children:t,leaf:n})=>{const r=n;return r[Y.bold]&&(t=c.jsx("strong",{children:t})),r[Y.italic]&&(t=c.jsx("em",{children:t})),r[Y.strikethrough]&&(t=c.jsx("s",{children:t})),c.jsx("span",{...e,children:t})},zs="MENTION: ",Lf={anchor:{offset:0,path:[0,0]},focus:{offset:0,path:[0,0]}},Gl={"mention-popover":35,default:-52},Ui=16,zf=(e,t,n)=>{const r=y.useRef(null),{showLinkEditor:a,mentionPopover:i}=y.useContext(an),s=t==="link-editor"?a:i.show,o=[s];return e&&t==="link-editor"&&o.push(e.selection),y.useEffect(()=>{var p,g;if(!(r!=null&&r.current)||!s)return;const l=r==null?void 0:r.current;if(!l)return;let u,d=0;if(t==="mention-popover"){const{position:f}=i,b=F=>{if(!x.hasPath(e,F.path))return!1;const _=ue.get(e,F.path);return x.isEditor(_)||de.isElement(_)?F.offset<=_.children.length:fe.isText(_)?F.offset<=_.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||Lf).getBoundingClientRect();const C=(p=document.getElementById(n))==null?void 0:p.getBoundingClientRect();l.style.setProperty("--width",`${((C==null?void 0:C.width)||0)/Ui}rem`),d=(C==null?void 0:C.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=Gl[t]||Gl.default,m=((u==null?void 0:u.top)||0)+window.scrollY+h;d===0&&(d=Math.max(((u==null?void 0:u.left)||0)-(l.offsetWidth-((u==null?void 0:u.width)||0)),0)),l.style.top=`${m/Ui}rem`,l.style.left=`${d/Ui}rem`},o),r},Rx=e=>{const[t,n]=y.useState(null);return y.useEffect(()=>{const{selection:r}=e;if(!r){n(null);return}const[a]=x.nodes(e,{at:r,match:i=>i.type===Y.link});if(a){const i=a[0],s=Jc(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 ct=(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))(ct||{});const Yn={[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"},[qt.emphasis]:Y.italic,[qt.strong]:Y.bold,[qt.delete]:Y.strikethrough,[qt.code]:Y.code,[Y.hr]:Y.hr,[Y.image]:Y.image};function Ql(e){if(e)throw e}var Ba=Object.prototype.hasOwnProperty,qf=Object.prototype.toString,Jl=Object.defineProperty,Xl=Object.getOwnPropertyDescriptor,ec=function(t){return typeof Array.isArray=="function"?Array.isArray(t):qf.call(t)==="[object Array]"},tc=function(t){if(!t||qf.call(t)!=="[object Object]")return!1;var n=Ba.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Ba.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var a;for(a in t);return typeof a>"u"||Ba.call(t,a)},nc=function(t,n){Jl&&n.name==="__proto__"?Jl(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},rc=function(t,n){if(n==="__proto__")if(Ba.call(t,n)){if(Xl)return Xl(t,n).value}else return;return t[n]},Ix=function e(){var t,n,r,a,i,s,o=arguments[0],l=1,u=arguments.length,d=!1;for(typeof o=="boolean"&&(d=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=rc(o,n),a=rc(t,n),o!==a&&(d&&a&&(tc(a)||(i=ec(a)))?(i?(i=!1,s=r&&ec(r)?r:[]):s=r&&tc(r)?r:{},nc(o,{name:n,newValue:e(d,s,a)})):typeof a<"u"&&nc(o,{name:n,newValue:a}));return o};const Hi=On(Ix);function qs(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 $x(){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 d=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,d?Lx(d,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 Lx(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 d=u;if(o&&n)throw d;return a(d)}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 Ar(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ac(e.position):"start"in e||"end"in e?ac(e):"line"in e||"column"in e?Ws(e):""}function Ws(e){return ic(e&&e.line)+":"+ic(e&&e.column)}function ac(e){return Ws(e&&e.start)+"-"+Ws(e&&e.end)}function ic(e){return e&&typeof e=="number"?e:1}class bt 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=Ar(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}}bt.prototype.file="";bt.prototype.name="";bt.prototype.reason="";bt.prototype.message="";bt.prototype.stack="";bt.prototype.column=void 0;bt.prototype.line=void 0;bt.prototype.ancestors=void 0;bt.prototype.cause=void 0;bt.prototype.fatal=void 0;bt.prototype.place=void 0;bt.prototype.ruleId=void 0;bt.prototype.source=void 0;const Lt={basename:zx,dirname:qx,extname:Wx,join:Ux,sep:"/"};function zx(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Kr(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 qx(e){if(Kr(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 Wx(e){Kr(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 Ux(...e){let t=-1,n;for(;++t<e.length;)Kr(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Hx(n)}function Hx(e){Kr(e);const t=e.codePointAt(0)===47;let n=Vx(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Vx(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 Kr(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Kx={cwd:Zx};function Zx(){return"/"}function Us(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Yx(e){if(typeof e=="string")e=new URL(e);else if(!Us(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 Gx(e)}function Gx(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 Vi=["history","path","basename","stem","extname","dirname"];class Qx{constructor(t){let n;t?Us(t)?n={path:t}:typeof t=="string"||Jx(t)?n={value:t}:n=t:n={},this.cwd=Kx.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Vi.length;){const i=Vi[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)Vi.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?Lt.basename(this.path):void 0}set basename(t){Zi(t,"basename"),Ki(t,"basename"),this.path=Lt.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Lt.dirname(this.path):void 0}set dirname(t){sc(this.basename,"dirname"),this.path=Lt.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Lt.extname(this.path):void 0}set extname(t){if(Ki(t,"extname"),sc(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=Lt.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Us(t)&&(t=Yx(t)),Zi(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Lt.basename(this.path,this.extname):void 0}set stem(t){Zi(t,"stem"),Ki(t,"stem"),this.path=Lt.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 bt(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 Ki(e,t){if(e&&e.includes(Lt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Lt.sep+"`")}function Zi(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function sc(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Jx(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Xx=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},eD={}.hasOwnProperty;class jo extends Xx{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=$x()}copy(){const t=new jo;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Hi(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Qi("data",this.frozen),this.namespace[t]=n,this):eD.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Qi("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=ma(t),r=this.parser||this.Parser;return Yi("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Yi("process",this.parser||this.Parser),Gi("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(i,s){const o=ma(t),l=r.parse(o);r.run(l,o,function(d,h,m){if(d||!h||!m)return u(d);const p=h,g=r.stringify(p,m);rD(g)?m.value=g:m.result=g,u(d,m)});function u(d,h){d||!h?s(d):i?i(h):n(void 0,h)}}}processSync(t){let n=!1,r;return this.freeze(),Yi("processSync",this.parser||this.Parser),Gi("processSync",this.compiler||this.Compiler),this.process(t,a),uc("processSync","process",n),r;function a(i,s){n=!0,Ql(i),r=s}}run(t,n,r){oc(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=ma(n);a.run(t,l,u);function u(d,h,m){const p=h||t;d?o(d):s?s(p):r(void 0,p,m)}}}runSync(t,n){let r=!1,a;return this.run(t,n,i),uc("runSync","run",r),a;function i(s,o){Ql(s),a=o,r=!0}}stringify(t,n){this.freeze();const r=ma(n),a=this.compiler||this.Compiler;return Gi("stringify",a),oc(t),a(t,r)}use(t,...n){const r=this.attachers,a=this.namespace;if(Qi("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[d,...h]=u;l(d,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=Hi(!0,a.settings,u.settings))}function o(u){let d=-1;if(u!=null)if(Array.isArray(u))for(;++d<u.length;){const h=u[d];i(h)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function l(u,d){let h=-1,m=-1;for(;++h<r.length;)if(r[h][0]===u){m=h;break}if(m===-1)r.push([u,...d]);else if(d.length>0){let[p,...g]=d;const f=r[m][1];qs(f)&&qs(p)&&(p=Hi(!0,f,p)),r[m]=[u,p,...g]}}}}const tD=new jo().freeze();function Yi(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Gi(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Qi(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 oc(e){if(!qs(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function uc(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function ma(e){return nD(e)?e:new Qx(e)}function nD(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function rD(e){return typeof e=="string"||aD(e)}function aD(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const iD={};function sD(e,t){const n=t||iD,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Wf(e,r,a)}function Wf(e,t,n){if(oD(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 lc(e.children,t,n)}return Array.isArray(e)?lc(e,t,n):""}function lc(e,t,n){const r=[];let a=-1;for(;++a<e.length;)r[a]=Wf(e[a],t,n);return r.join("")}function oD(e){return!!(e&&typeof e=="object")}const cc=document.createElement("i");function Oo(e){const t="&"+e+";";cc.innerHTML=t;const n=cc.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function en(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 Bt(e,t){return e.length>0?(en(e,e.length,0,t),e):t}const dc={}.hasOwnProperty;function uD(e){const t={};let n=-1;for(;++n<e.length;)lD(t,e[n]);return t}function lD(e,t){let n;for(n in t){const a=(dc.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let s;if(i)for(s in i){dc.call(a,s)||(a[s]=[]);const o=i[s];cD(a[s],Array.isArray(o)?o:o?[o]:[])}}}function cD(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);en(e,0,0,r)}function Uf(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 Jn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const zt=bn(/[A-Za-z]/),Pt=bn(/[\dA-Za-z]/),dD=bn(/[#-'*+\--9=?A-Z^-~]/);function Hs(e){return e!==null&&(e<32||e===127)}const Vs=bn(/\d/),fD=bn(/[\dA-Fa-f]/),hD=bn(/[!-/:-@[-`{-~]/);function ye(e){return e!==null&&e<-2}function vt(e){return e!==null&&(e<0||e===32)}function Me(e){return e===-2||e===-1||e===32}const mD=bn(/\p{P}|\p{S}/u),pD=bn(/\s/);function bn(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 Me(l)?(e.enter(n),o(l)):t(l)}function o(l){return Me(l)&&i++<a?(e.consume(l),o):(e.exit(n),t(l))}}const gD={tokenize:vD};function vD(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 ye(o)?(e.consume(o),e.exit("chunkText"),i):(e.consume(o),s)}}const bD={tokenize:yD},fc={tokenize:xD};function yD(e){const t=this,n=[];let r=0,a,i,s;return o;function o(F){if(r<n.length){const _=n[r];return t.containerState=_[1],e.attempt(_[0].continuation,l,u)(F)}return u(F)}function l(F){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&C();const _=t.events.length;let w=_,k;for(;w--;)if(t.events[w][0]==="exit"&&t.events[w][1].type==="chunkFlow"){k=t.events[w][1].end;break}v(r);let j=_;for(;j<t.events.length;)t.events[j][1].end=Object.assign({},k),j++;return en(t.events,w+1,0,t.events.slice(_)),t.events.length=j,u(F)}return o(F)}function u(F){if(r===n.length){if(!a)return m(F);if(a.currentConstruct&&a.currentConstruct.concrete)return g(F);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(fc,d,h)(F)}function d(F){return a&&C(),v(r),m(F)}function h(F){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,g(F)}function m(F){return t.containerState={},e.attempt(fc,p,g)(F)}function p(F){return r++,n.push([t.currentConstruct,t.containerState]),m(F)}function g(F){if(F===null){a&&C(),v(0),e.consume(F);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{contentType:"flow",previous:i,_tokenizer:a}),f(F)}function f(F){if(F===null){b(e.exit("chunkFlow"),!0),v(0),e.consume(F);return}return ye(F)?(e.consume(F),b(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(F),f)}function b(F,_){const w=t.sliceStream(F);if(_&&w.push(null),F.previous=i,i&&(i.next=F),i=F,a.defineSkip(F.start),a.write(w),t.parser.lazy[F.start.line]){let k=a.events.length;for(;k--;)if(a.events[k][1].start.offset<s&&(!a.events[k][1].end||a.events[k][1].end.offset>s))return;const j=t.events.length;let q=j,P,z;for(;q--;)if(t.events[q][0]==="exit"&&t.events[q][1].type==="chunkFlow"){if(P){z=t.events[q][1].end;break}P=!0}for(v(r),k=j;k<t.events.length;)t.events[k][1].end=Object.assign({},z),k++;en(t.events,q+1,0,t.events.slice(j)),t.events.length=k}}function v(F){let _=n.length;for(;_-- >F;){const w=n[_];t.containerState=w[1],w[0].exit.call(t,e)}n.length=F}function C(){a.write([null]),i=void 0,a=void 0,t.containerState._closeFlow=void 0}}function xD(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 hc(e){if(e===null||vt(e)||pD(e))return 1;if(mD(e))return 2}function Po(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 Ks={name:"attention",tokenize:CD,resolveAll:DD};function DD(e,t){let n=-1,r,a,i,s,o,l,u,d;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),m=Object.assign({},e[n][1].start);mc(h,-l),mc(m,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:m},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=Bt(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Bt(u,[["enter",a,t],["enter",s,t],["exit",s,t],["enter",i,t]]),u=Bt(u,Po(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Bt(u,[["exit",i,t],["enter",o,t],["exit",o,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=Bt(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,en(e,r-1,n-r+3,u),n=r+u.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function CD(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,a=hc(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"),d=hc(l),h=!d||d===2&&a||n.includes(l),m=!a||a===2&&d||n.includes(r);return u._open=!!(i===42?h:h&&(a||!m)),u._close=!!(i===42?m:m&&(d||!h)),t(l)}}function mc(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const wD={name:"autolink",tokenize:ED};function ED(e,t,n){let r=0;return a;function a(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(p){return zt(p)?(e.consume(p),s):p===64?n(p):u(p)}function s(p){return p===43||p===45||p===46||Pt(p)?(r=1,o(p)):u(p)}function o(p){return p===58?(e.consume(p),r=0,l):(p===43||p===45||p===46||Pt(p))&&r++<32?(e.consume(p),o):(r=0,u(p))}function l(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||Hs(p)?n(p):(e.consume(p),l)}function u(p){return p===64?(e.consume(p),d):dD(p)?(e.consume(p),u):n(p)}function d(p){return Pt(p)?h(p):n(p)}function h(p){return p===46?(e.consume(p),r=0,d):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):m(p)}function m(p){if((p===45||Pt(p))&&r++<63){const g=p===45?m:h;return e.consume(p),g}return n(p)}}const di={tokenize:_D,partial:!0};function _D(e,t,n){return r;function r(i){return Me(i)?qe(e,a,"linePrefix")(i):a(i)}function a(i){return i===null||ye(i)?t(i):n(i)}}const Hf={name:"blockQuote",tokenize:kD,continuation:{tokenize:FD},exit:BD};function kD(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 Me(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function FD(e,t,n){const r=this;return a;function a(s){return Me(s)?qe(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):i(s)}function i(s){return e.attempt(Hf,t,n)(s)}}function BD(e){e.exit("blockQuote")}const Vf={name:"characterEscape",tokenize:AD};function AD(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 hD(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const Kf={name:"characterReference",tokenize:TD};function TD(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=Pt,d(h))}function u(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,s=fD,d):(e.enter("characterReferenceValue"),i=7,s=Vs,d(h))}function d(h){if(h===59&&a){const m=e.exit("characterReferenceValue");return s===Pt&&!Oo(r.sliceSerialize(m))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(h)&&a++<i?(e.consume(h),d):n(h)}}const pc={tokenize:jD,partial:!0},gc={name:"codeFenced",tokenize:SD,concrete:!0};function SD(e,t,n){const r=this,a={tokenize:w,partial:!0};let i=0,s=0,o;return l;function l(k){return u(k)}function u(k){const j=r.events[r.events.length-1];return i=j&&j[1].type==="linePrefix"?j[2].sliceSerialize(j[1],!0).length:0,o=k,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(k)}function d(k){return k===o?(s++,e.consume(k),d):s<3?n(k):(e.exit("codeFencedFenceSequence"),Me(k)?qe(e,h,"whitespace")(k):h(k))}function h(k){return k===null||ye(k)?(e.exit("codeFencedFence"),r.interrupt?t(k):e.check(pc,f,_)(k)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),m(k))}function m(k){return k===null||ye(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(k)):Me(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),qe(e,p,"whitespace")(k)):k===96&&k===o?n(k):(e.consume(k),m)}function p(k){return k===null||ye(k)?h(k):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(k))}function g(k){return k===null||ye(k)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(k)):k===96&&k===o?n(k):(e.consume(k),g)}function f(k){return e.attempt(a,_,b)(k)}function b(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),v}function v(k){return i>0&&Me(k)?qe(e,C,"linePrefix",i+1)(k):C(k)}function C(k){return k===null||ye(k)?e.check(pc,f,_)(k):(e.enter("codeFlowValue"),F(k))}function F(k){return k===null||ye(k)?(e.exit("codeFlowValue"),C(k)):(e.consume(k),F)}function _(k){return e.exit("codeFenced"),t(k)}function w(k,j,q){let P=0;return z;function z(O){return k.enter("lineEnding"),k.consume(O),k.exit("lineEnding"),R}function R(O){return k.enter("codeFencedFence"),Me(O)?qe(k,A,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):A(O)}function A(O){return O===o?(k.enter("codeFencedFenceSequence"),E(O)):q(O)}function E(O){return O===o?(P++,k.consume(O),E):P>=s?(k.exit("codeFencedFenceSequence"),Me(O)?qe(k,S,"whitespace")(O):S(O)):q(O)}function S(O){return O===null||ye(O)?(k.exit("codeFencedFence"),j(O)):q(O)}}}function jD(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 Ji={name:"codeIndented",tokenize:PD},OD={tokenize:MD,partial:!0};function PD(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 d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?s(u):n(u)}function s(u){return u===null?l(u):ye(u)?e.attempt(OD,s,l)(u):(e.enter("codeFlowValue"),o(u))}function o(u){return u===null||ye(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):ye(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):ye(s)?a(s):n(s)}}const ND={name:"codeText",tokenize:$D,resolve:RD,previous:ID};function RD(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 ID(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function $D(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,d(h)):ye(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||ye(h)?(e.exit("codeTextData"),l(h)):(e.consume(h),u)}function d(h){return h===96?(e.consume(h),a++,d):a===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(i.type="codeTextData",u(h))}}class LD{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&&Dr(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),Dr(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Dr(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);Dr(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Dr(this.left,n.reverse())}}}function Dr(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 Zf(e){const t={};let n=-1,r,a,i,s,o,l,u;const d=new LD(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.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,zD(d,n)),n=t[n],u=!0);else if(r[1]._container){for(i=n,a=void 0;i--&&(s=d.get(i),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank");)s[0]==="enter"&&(a&&(d.get(a)[1].type="lineEndingBlank"),s[1].type="lineEnding",a=i);a&&(r[1].end=Object.assign({},d.get(a)[1].start),o=d.slice(a,n),o.unshift(r),d.splice(a,n-a+1,o))}}return en(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!u}function zD(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 d,h,m=-1,p=n,g=0,f=0;const b=[f];for(;p;){for(;e.get(++a)[1]!==p;);i.push(a),p._tokenizer||(d=r.sliceStream(p),p.next||d.push(null),h&&s.defineSkip(p.start),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(d),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),h=p,p=p.next}for(p=n;++m<o.length;)o[m][0]==="exit"&&o[m-1][0]==="enter"&&o[m][1].type===o[m-1][1].type&&o[m][1].start.line!==o[m][1].end.line&&(f=m+1,b.push(f),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(s.events=[],p?(p._tokenizer=void 0,p.previous=void 0):b.pop(),m=b.length;m--;){const v=o.slice(b[m],b[m+1]),C=i.pop();l.push([C,C+v.length-1]),e.splice(C,2,v)}for(l.reverse(),m=-1;++m<l.length;)u[g+l[m][0]]=g+l[m][1],g+=l[m][1]-l[m][0]-1;return u}const qD={tokenize:HD,resolve:UD},WD={tokenize:VD,partial:!0};function UD(e){return Zf(e),e}function HD(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):ye(o)?e.check(WD,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 VD(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||ye(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 Yf(e,t,n,r,a,i,s,o,l){const u=l||Number.POSITIVE_INFINITY;let d=0;return h;function h(v){return v===60?(e.enter(r),e.enter(a),e.enter(i),e.consume(v),e.exit(i),m):v===null||v===32||v===41||Hs(v)?n(v):(e.enter(r),e.enter(s),e.enter(o),e.enter("chunkString",{contentType:"string"}),f(v))}function m(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"}),p(v))}function p(v){return v===62?(e.exit("chunkString"),e.exit(o),m(v)):v===null||v===60||ye(v)?n(v):(e.consume(v),v===92?g:p)}function g(v){return v===60||v===62||v===92?(e.consume(v),p):p(v)}function f(v){return!d&&(v===null||v===41||vt(v))?(e.exit("chunkString"),e.exit(o),e.exit(s),e.exit(r),t(v)):d<u&&v===40?(e.consume(v),d++,f):v===41?(e.consume(v),d--,f):v===null||v===32||v===40||Hs(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 Gf(e,t,n,r,a,i){const s=this;let o=0,l;return u;function u(p){return e.enter(r),e.enter(a),e.consume(p),e.exit(a),e.enter(i),d}function d(p){return o>999||p===null||p===91||p===93&&!l||p===94&&!o&&"_hiddenFootnoteSupport"in s.parser.constructs?n(p):p===93?(e.exit(i),e.enter(a),e.consume(p),e.exit(a),e.exit(r),t):ye(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),h(p))}function h(p){return p===null||p===91||p===93||ye(p)||o++>999?(e.exit("chunkString"),d(p)):(e.consume(p),l||(l=!Me(p)),p===92?m:h)}function m(p){return p===91||p===92||p===93?(e.consume(p),o++,h):h(p)}}function Qf(e,t,n,r,a,i){let s;return o;function o(m){return m===34||m===39||m===40?(e.enter(r),e.enter(a),e.consume(m),e.exit(a),s=m===40?41:m,l):n(m)}function l(m){return m===s?(e.enter(a),e.consume(m),e.exit(a),e.exit(r),t):(e.enter(i),u(m))}function u(m){return m===s?(e.exit(i),l(s)):m===null?n(m):ye(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),qe(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===s||m===null||ye(m)?(e.exit("chunkString"),u(m)):(e.consume(m),m===92?h:d)}function h(m){return m===s||m===92?(e.consume(m),d):d(m)}}function Tr(e,t){let n;return r;function r(a){return ye(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,r):Me(a)?qe(e,r,n?"linePrefix":"lineSuffix")(a):t(a)}}const KD={name:"definition",tokenize:YD},ZD={tokenize:GD,partial:!0};function YD(e,t,n){const r=this;let a;return i;function i(p){return e.enter("definition"),s(p)}function s(p){return Gf.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function o(p){return a=Jn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l):n(p)}function l(p){return vt(p)?Tr(e,u)(p):u(p)}function u(p){return Yf(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(ZD,h,h)(p)}function h(p){return Me(p)?qe(e,m,"whitespace")(p):m(p)}function m(p){return p===null||ye(p)?(e.exit("definition"),r.parser.defined.push(a),t(p)):n(p)}}function GD(e,t,n){return r;function r(o){return vt(o)?Tr(e,a)(o):n(o)}function a(o){return Qf(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function i(o){return Me(o)?qe(e,s,"whitespace")(o):s(o)}function s(o){return o===null||ye(o)?t(o):n(o)}}const QD={name:"hardBreakEscape",tokenize:JD};function JD(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),a}function a(i){return ye(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const XD={name:"headingAtx",tokenize:tC,resolve:eC};function eC(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"},en(e,r,n-r+1,[["enter",a,t],["enter",i,t],["exit",i,t],["exit",a,t]])),e}function tC(e,t,n){let r=0;return a;function a(d){return e.enter("atxHeading"),i(d)}function i(d){return e.enter("atxHeadingSequence"),s(d)}function s(d){return d===35&&r++<6?(e.consume(d),s):d===null||vt(d)?(e.exit("atxHeadingSequence"),o(d)):n(d)}function o(d){return d===35?(e.enter("atxHeadingSequence"),l(d)):d===null||ye(d)?(e.exit("atxHeading"),t(d)):Me(d)?qe(e,o,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function l(d){return d===35?(e.consume(d),l):(e.exit("atxHeadingSequence"),o(d))}function u(d){return d===null||d===35||vt(d)?(e.exit("atxHeadingText"),o(d)):(e.consume(d),u)}}const nC=["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"],vc=["pre","script","style","textarea"],rC={name:"htmlFlow",tokenize:oC,resolveTo:sC,concrete:!0},aC={tokenize:lC,partial:!0},iC={tokenize:uC,partial:!0};function sC(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 oC(e,t,n){const r=this;let a,i,s,o,l;return u;function u(B){return d(B)}function d(B){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(B),h}function h(B){return B===33?(e.consume(B),m):B===47?(e.consume(B),i=!0,f):B===63?(e.consume(B),a=3,r.interrupt?t:D):zt(B)?(e.consume(B),s=String.fromCharCode(B),b):n(B)}function m(B){return B===45?(e.consume(B),a=2,p):B===91?(e.consume(B),a=5,o=0,g):zt(B)?(e.consume(B),a=4,r.interrupt?t:D):n(B)}function p(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:A:g):n(B)}function f(B){return zt(B)?(e.consume(B),s=String.fromCharCode(B),b):n(B)}function b(B){if(B===null||B===47||B===62||vt(B)){const T=B===47,L=s.toLowerCase();return!T&&!i&&vc.includes(L)?(a=1,r.interrupt?t(B):A(B)):nC.includes(s.toLowerCase())?(a=6,T?(e.consume(B),v):r.interrupt?t(B):A(B)):(a=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(B):i?C(B):F(B))}return B===45||Pt(B)?(e.consume(B),s+=String.fromCharCode(B),b):n(B)}function v(B){return B===62?(e.consume(B),r.interrupt?t:A):n(B)}function C(B){return Me(B)?(e.consume(B),C):z(B)}function F(B){return B===47?(e.consume(B),z):B===58||B===95||zt(B)?(e.consume(B),_):Me(B)?(e.consume(B),F):z(B)}function _(B){return B===45||B===46||B===58||B===95||Pt(B)?(e.consume(B),_):w(B)}function w(B){return B===61?(e.consume(B),k):Me(B)?(e.consume(B),w):F(B)}function k(B){return B===null||B===60||B===61||B===62||B===96?n(B):B===34||B===39?(e.consume(B),l=B,j):Me(B)?(e.consume(B),k):q(B)}function j(B){return B===l?(e.consume(B),l=null,P):B===null||ye(B)?n(B):(e.consume(B),j)}function q(B){return B===null||B===34||B===39||B===47||B===60||B===61||B===62||B===96||vt(B)?w(B):(e.consume(B),q)}function P(B){return B===47||B===62||Me(B)?F(B):n(B)}function z(B){return B===62?(e.consume(B),R):n(B)}function R(B){return B===null||ye(B)?A(B):Me(B)?(e.consume(B),R):n(B)}function A(B){return B===45&&a===2?(e.consume(B),V):B===60&&a===1?(e.consume(B),H):B===62&&a===4?(e.consume(B),$):B===63&&a===3?(e.consume(B),D):B===93&&a===5?(e.consume(B),ae):ye(B)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(aC,X,E)(B)):B===null||ye(B)?(e.exit("htmlFlowData"),E(B)):(e.consume(B),A)}function E(B){return e.check(iC,S,X)(B)}function S(B){return e.enter("lineEnding"),e.consume(B),e.exit("lineEnding"),O}function O(B){return B===null||ye(B)?E(B):(e.enter("htmlFlowData"),A(B))}function V(B){return B===45?(e.consume(B),D):A(B)}function H(B){return B===47?(e.consume(B),s="",Q):A(B)}function Q(B){if(B===62){const T=s.toLowerCase();return vc.includes(T)?(e.consume(B),$):A(B)}return zt(B)&&s.length<8?(e.consume(B),s+=String.fromCharCode(B),Q):A(B)}function ae(B){return B===93?(e.consume(B),D):A(B)}function D(B){return B===62?(e.consume(B),$):B===45&&a===2?(e.consume(B),D):A(B)}function $(B){return B===null||ye(B)?(e.exit("htmlFlowData"),X(B)):(e.consume(B),$)}function X(B){return e.exit("htmlFlow"),t(B)}}function uC(e,t,n){const r=this;return a;function a(s){return ye(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 lC(e,t,n){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(di,t,n)}}const cC={name:"htmlText",tokenize:dC};function dC(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),F):zt(D)?(e.consume(D),q):n(D)}function u(D){return D===45?(e.consume(D),d):D===91?(e.consume(D),i=0,g):zt(D)?(e.consume(D),C):n(D)}function d(D){return D===45?(e.consume(D),p):n(D)}function h(D){return D===null?n(D):D===45?(e.consume(D),m):ye(D)?(s=h,H(D)):(e.consume(D),h)}function m(D){return D===45?(e.consume(D),p):h(D)}function p(D){return D===62?V(D):D===45?m(D):h(D)}function g(D){const $="CDATA[";return D===$.charCodeAt(i++)?(e.consume(D),i===$.length?f:g):n(D)}function f(D){return D===null?n(D):D===93?(e.consume(D),b):ye(D)?(s=f,H(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 C(D){return D===null||D===62?V(D):ye(D)?(s=C,H(D)):(e.consume(D),C)}function F(D){return D===null?n(D):D===63?(e.consume(D),_):ye(D)?(s=F,H(D)):(e.consume(D),F)}function _(D){return D===62?V(D):F(D)}function w(D){return zt(D)?(e.consume(D),k):n(D)}function k(D){return D===45||Pt(D)?(e.consume(D),k):j(D)}function j(D){return ye(D)?(s=j,H(D)):Me(D)?(e.consume(D),j):V(D)}function q(D){return D===45||Pt(D)?(e.consume(D),q):D===47||D===62||vt(D)?P(D):n(D)}function P(D){return D===47?(e.consume(D),V):D===58||D===95||zt(D)?(e.consume(D),z):ye(D)?(s=P,H(D)):Me(D)?(e.consume(D),P):V(D)}function z(D){return D===45||D===46||D===58||D===95||Pt(D)?(e.consume(D),z):R(D)}function R(D){return D===61?(e.consume(D),A):ye(D)?(s=R,H(D)):Me(D)?(e.consume(D),R):P(D)}function A(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),a=D,E):ye(D)?(s=A,H(D)):Me(D)?(e.consume(D),A):(e.consume(D),S)}function E(D){return D===a?(e.consume(D),a=void 0,O):D===null?n(D):ye(D)?(s=E,H(D)):(e.consume(D),E)}function S(D){return D===null||D===34||D===39||D===60||D===61||D===96?n(D):D===47||D===62||vt(D)?P(D):(e.consume(D),S)}function O(D){return D===47||D===62||vt(D)?P(D):n(D)}function V(D){return D===62?(e.consume(D),e.exit("htmlTextData"),e.exit("htmlText"),t):n(D)}function H(D){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),Q}function Q(D){return Me(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 Mo={name:"labelEnd",tokenize:vC,resolveTo:gC,resolveAll:pC},fC={tokenize:bC},hC={tokenize:yC},mC={tokenize:xC};function pC(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 gC(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)},d={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=Bt(o,e.slice(i+1,i+r+3)),o=Bt(o,[["enter",d,t]]),o=Bt(o,Po(t.parser.constructs.insideSpan.null,e.slice(i+r+4,s-3),t)),o=Bt(o,[["exit",d,t],e[s-2],e[s-1],["exit",u,t]]),o=Bt(o,e.slice(s+1)),o=Bt(o,[["exit",l,t]]),en(e,i,e.length,o),e}function vC(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(m){return i?i._inactive?h(m):(s=r.parser.defined.includes(Jn(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(m),e.exit("labelMarker"),e.exit("labelEnd"),l):n(m)}function l(m){return m===40?e.attempt(fC,d,s?d:h)(m):m===91?e.attempt(hC,d,s?u:h)(m):s?d(m):h(m)}function u(m){return e.attempt(mC,d,h)(m)}function d(m){return t(m)}function h(m){return i._balanced=!0,n(m)}}function bC(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 vt(h)?Tr(e,i)(h):i(h)}function i(h){return h===41?d(h):Yf(e,s,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function s(h){return vt(h)?Tr(e,l)(h):d(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):d(h)}function u(h){return vt(h)?Tr(e,d)(h):d(h)}function d(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function yC(e,t,n){const r=this;return a;function a(o){return Gf.call(r,e,i,s,"reference","referenceMarker","referenceString")(o)}function i(o){return r.parser.defined.includes(Jn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function s(o){return n(o)}}function xC(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 DC={name:"labelStartImage",tokenize:CC,resolveAll:Mo.resolveAll};function CC(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 wC={name:"labelStartLink",tokenize:EC,resolveAll:Mo.resolveAll};function EC(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 Xi={name:"lineEnding",tokenize:_C};function _C(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),qe(e,t,"linePrefix")}}const Aa={name:"thematicBreak",tokenize:kC};function kC(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||ye(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===a?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),Me(u)?qe(e,o,"whitespace")(u):o(u))}}const mt={name:"list",tokenize:AC,continuation:{tokenize:TC},exit:jC},FC={tokenize:OC,partial:!0},BC={tokenize:SC,partial:!0};function AC(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(p){const g=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:Vs(p)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(Aa,n,u)(p):u(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(p)}return n(p)}function l(p){return Vs(p)&&++s<10?(e.consume(p),l):(!r.interrupt||s<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),u(p)):n(p)}function u(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(di,r.interrupt?n:d,e.attempt(FC,m,h))}function d(p){return r.containerState.initialBlankLine=!0,i++,m(p)}function h(p){return Me(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),m):n(p)}function m(p){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function TC(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(di,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||!Me(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(BC,t,s)(o))}function s(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,qe(e,e.attempt(mt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function SC(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 jC(e){e.exit(this.containerState.type)}function OC(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!Me(i)&&s&&s[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const bc={name:"setextUnderline",tokenize:MC,resolveTo:PC};function PC(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 MC(e,t,n){const r=this;let a;return i;function i(u){let d=r.events.length,h;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){h=r.events[d][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"),Me(u)?qe(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||ye(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const NC={tokenize:RC};function RC(e){const t=this,n=e.attempt(di,r,e.attempt(this.parser.constructs.flowInitial,a,qe(e,e.attempt(this.parser.constructs.flow,a,e.attempt(qD,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 IC={resolveAll:Xf()},$C=Jf("string"),LC=Jf("text");function Jf(e){return{tokenize:t,resolveAll:Xf(e==="text"?zC:void 0)};function t(n){const r=this,a=this.parser.constructs[e],i=n.attempt(a,s,o);return s;function s(d){return u(d)?i(d):o(d)}function o(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),l}function l(d){return u(d)?(n.exit("data"),i(d)):(n.consume(d),l)}function u(d){if(d===null)return!0;const h=a[d];let m=-1;if(h)for(;++m<h.length;){const p=h[m];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function Xf(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 zC(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 qC(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:C,enter:F,exit:_,attempt:j(w),check:j(k),interrupt:j(k,{interrupt:!0})},u={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:p,sliceSerialize:m,now:g,defineSkip:f,write:h};let d=t.tokenize.call(u,l);return t.resolveAll&&i.push(t),u;function h(R){return s=Bt(s,R),b(),s[s.length-1]!==null?[]:(q(t,0),u.events=Po(i,u.events,u),u.events)}function m(R,A){return UC(p(R),A)}function p(R){return WC(s,R)}function g(){const{line:R,column:A,offset:E,_index:S,_bufferIndex:O}=r;return{line:R,column:A,offset:E,_index:S,_bufferIndex:O}}function f(R){a[R.line]=R.column,z()}function b(){let R;for(;r._index<s.length;){const A=s[r._index];if(typeof A=="string")for(R=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===R&&r._bufferIndex<A.length;)v(A.charCodeAt(r._bufferIndex));else v(A)}}function v(R){d=d(R)}function C(R){ye(R)?(r.line++,r.column=1,r.offset+=R===-3?2:1,z()):R!==-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=R}function F(R,A){const E=A||{};return E.type=R,E.start=g(),u.events.push(["enter",E,u]),o.push(E),E}function _(R){const A=o.pop();return A.end=g(),u.events.push(["exit",A,u]),A}function w(R,A){q(R,A.from)}function k(R,A){A.restore()}function j(R,A){return E;function E(S,O,V){let H,Q,ae,D;return Array.isArray(S)?X(S):"tokenize"in S?X([S]):$(S);function $(I){return W;function W(U){const ne=U!==null&&I[U],re=U!==null&&I.null,le=[...Array.isArray(ne)?ne:ne?[ne]:[],...Array.isArray(re)?re:re?[re]:[]];return X(le)(U)}}function X(I){return H=I,Q=0,I.length===0?V:B(I[Q])}function B(I){return W;function W(U){return D=P(),ae=I,I.partial||(u.currentConstruct=I),I.name&&u.parser.constructs.disable.null.includes(I.name)?L():I.tokenize.call(A?Object.assign(Object.create(u),A):u,l,T,L)(U)}}function T(I){return R(ae,D),O}function L(I){return D.restore(),++Q<H.length?B(H[Q]):V}}}function q(R,A){R.resolveAll&&!i.includes(R)&&i.push(R),R.resolve&&en(u.events,A,u.events.length-A,R.resolve(u.events.slice(A),u)),R.resolveTo&&(u.events=R.resolveTo(u.events,u))}function P(){const R=g(),A=u.previous,E=u.currentConstruct,S=u.events.length,O=Array.from(o);return{restore:V,from:S};function V(){r=R,u.previous=A,u.currentConstruct=E,u.events.length=S,o=O,z()}}function z(){r.line in a&&r.column<2&&(r.column=a[r.line],r.offset+=a[r.line]-1)}}function WC(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 UC(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 HC={42:mt,43:mt,45:mt,48:mt,49:mt,50:mt,51:mt,52:mt,53:mt,54:mt,55:mt,56:mt,57:mt,62:Hf},VC={91:KD},KC={[-2]:Ji,[-1]:Ji,32:Ji},ZC={35:XD,42:Aa,45:[bc,Aa],60:rC,61:bc,95:Aa,96:gc,126:gc},YC={38:Kf,92:Vf},GC={[-5]:Xi,[-4]:Xi,[-3]:Xi,33:DC,38:Kf,42:Ks,60:[wD,cC],91:wC,92:[QD,Vf],93:Mo,95:Ks,96:ND},QC={null:[Ks,IC]},JC={null:[42,95]},XC={null:[]},ew=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:JC,contentInitial:VC,disable:XC,document:HC,flow:ZC,flowInitial:KC,insideSpan:QC,string:YC,text:GC},Symbol.toStringTag,{value:"Module"}));function tw(e){const n=uD([ew,...(e||{}).extensions||[]]),r={defined:[],lazy:{},constructs:n,content:a(gD),document:a(bD),flow:a(NC),string:a($C),text:a(LC)};return r;function a(i){return s;function s(o){return qC(r,i,o)}}}function nw(e){for(;!Zf(e););return e}const yc=/[\0\t\n\r]/g;function rw(){let e=1,t="",n=!0,r;return a;function a(i,s,o){const l=[];let u,d,h,m,p;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(yc.lastIndex=h,u=yc.exec(i),m=u&&u.index!==void 0?u.index:i.length,p=i.charCodeAt(m),!u){t=i.slice(h);break}if(p===10&&h===m&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),h<m&&(l.push(i.slice(h,m)),e+=m-h),p){case 0:{l.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,l.push(-2);e++<d;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}h=m+1}return o&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const aw=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function iw(e){return e.replace(aw,sw)}function sw(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),i=a===120||a===88;return Uf(n.slice(i?2:1),i?16:10)}return Oo(n)||e}const eh={}.hasOwnProperty;function ow(e,t,n){return typeof t!="string"&&(n=t,t=void 0),uw(n)(nw(tw(n).document().write(rw()(e,t,!0))))}function uw(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Ye),autolinkProtocol:P,autolinkEmail:P,atxHeading:i(me),blockQuote:i(ne),characterEscape:P,characterReference:P,codeFenced:i(re),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:i(re,s),codeText:i(le,s),codeTextData:P,data:P,codeFlowValue:P,definition:i(X),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:i(pe),hardBreakEscape:i(_e),hardBreakTrailing:i(_e),htmlFlow:i(Be,s),htmlFlowData:P,htmlText:i(Be,s),htmlTextData:P,image:i(Se),label:s,link:i(Ye),listItem:i(je),listItemValue:m,listOrdered:i(Ke,h),listUnordered:i(Ke),paragraph:i(Oe),reference:B,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:i(me),strong:i(De),thematicBreak:i(Ue)},exit:{atxHeading:l(),atxHeadingSequence:w,autolink:l(),autolinkEmail:U,autolinkProtocol:W,blockQuote:l(),characterEscapeValue:z,characterReferenceMarkerHexadecimal:L,characterReferenceMarkerNumeric:L,characterReferenceValue:I,codeFenced:l(b),codeFencedFence:f,codeFencedFenceInfo:p,codeFencedFenceMeta:g,codeFlowValue:z,codeIndented:l(v),codeText:l(O),codeTextData:z,data:z,definition:l(),definitionDestinationString:_,definitionLabelString:C,definitionTitleString:F,emphasis:l(),hardBreakEscape:l(A),hardBreakTrailing:l(A),htmlFlow:l(E),htmlFlowData:z,htmlText:l(S),htmlTextData:z,image:l(H),label:ae,labelText:Q,lineEnding:R,link:l(V),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:T,resourceDestinationString:D,resourceTitleString:$,resource:ee,setextHeading:l(q),setextHeadingLineSequence:j,setextHeadingText:k,strong:l(),thematicBreak:l()}};th(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(G){let oe={type:"root",children:[]};const he={stack:[oe],tokenStack:[],config:t,enter:o,exit:u,buffer:s,resume:d,data:n},ge=[];let Ee=-1;for(;++Ee<G.length;)if(G[Ee][1].type==="listOrdered"||G[Ee][1].type==="listUnordered")if(G[Ee][0]==="enter")ge.push(Ee);else{const be=ge.pop();Ee=a(G,be,Ee)}for(Ee=-1;++Ee<G.length;){const be=t[G[Ee][0]];eh.call(be,G[Ee][1].type)&&be[G[Ee][1].type].call(Object.assign({sliceSerialize:G[Ee][2].sliceSerialize},he),G[Ee][1])}if(he.tokenStack.length>0){const be=he.tokenStack[he.tokenStack.length-1];(be[1]||xc).call(he,void 0,be[0])}for(oe.position={start:on(G.length>0?G[0][1].start:{line:1,column:1,offset:0}),end:on(G.length>0?G[G.length-2][1].end:{line:1,column:1,offset:0})},Ee=-1;++Ee<t.transforms.length;)oe=t.transforms[Ee](oe)||oe;return oe}function a(G,oe,he){let ge=oe-1,Ee=-1,be=!1,we,et,Et,ht;for(;++ge<=he;){const Qe=G[ge];switch(Qe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Qe[0]==="enter"?Ee++:Ee--,ht=void 0;break}case"lineEndingBlank":{Qe[0]==="enter"&&(we&&!ht&&!Ee&&!Et&&(Et=ge),ht=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ht=void 0}if(!Ee&&Qe[0]==="enter"&&Qe[1].type==="listItemPrefix"||Ee===-1&&Qe[0]==="exit"&&(Qe[1].type==="listUnordered"||Qe[1].type==="listOrdered")){if(we){let yt=ge;for(et=void 0;yt--;){const xt=G[yt];if(xt[1].type==="lineEnding"||xt[1].type==="lineEndingBlank"){if(xt[0]==="exit")continue;et&&(G[et][1].type="lineEndingBlank",be=!0),xt[1].type="lineEnding",et=yt}else if(!(xt[1].type==="linePrefix"||xt[1].type==="blockQuotePrefix"||xt[1].type==="blockQuotePrefixWhitespace"||xt[1].type==="blockQuoteMarker"||xt[1].type==="listItemIndent"))break}Et&&(!et||Et<et)&&(we._spread=!0),we.end=Object.assign({},et?G[et][1].start:Qe[1].end),G.splice(et||ge,0,["exit",we,Qe[2]]),ge++,he++}if(Qe[1].type==="listItemPrefix"){const yt={type:"listItem",_spread:!1,start:Object.assign({},Qe[1].start),end:void 0};we=yt,G.splice(ge,0,["enter",yt,Qe[2]]),ge++,he++,Et=void 0,ht=!0}}}return G[oe][1]._spread=be,he}function i(G,oe){return he;function he(ge){o.call(this,G(ge),ge),oe&&oe.call(this,ge)}}function s(){this.stack.push({type:"fragment",children:[]})}function o(G,oe,he){this.stack[this.stack.length-1].children.push(G),this.stack.push(G),this.tokenStack.push([oe,he]),G.position={start:on(oe.start),end:void 0}}function l(G){return oe;function oe(he){G&&G.call(this,he),u.call(this,he)}}function u(G,oe){const he=this.stack.pop(),ge=this.tokenStack.pop();if(ge)ge[0].type!==G.type&&(oe?oe.call(this,G,ge[0]):(ge[1]||xc).call(this,G,ge[0]));else throw new Error("Cannot close `"+G.type+"` ("+Ar({start:G.start,end:G.end})+"): it’s not open");he.position.end=on(G.end)}function d(){return sD(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function m(G){if(this.data.expectingFirstListItemValue){const oe=this.stack[this.stack.length-2];oe.start=Number.parseInt(this.sliceSerialize(G),10),this.data.expectingFirstListItemValue=void 0}}function p(){const G=this.resume(),oe=this.stack[this.stack.length-1];oe.lang=G}function g(){const G=this.resume(),oe=this.stack[this.stack.length-1];oe.meta=G}function f(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const G=this.resume(),oe=this.stack[this.stack.length-1];oe.value=G.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const G=this.resume(),oe=this.stack[this.stack.length-1];oe.value=G.replace(/(\r?\n|\r)$/g,"")}function C(G){const oe=this.resume(),he=this.stack[this.stack.length-1];he.label=oe,he.identifier=Jn(this.sliceSerialize(G)).toLowerCase()}function F(){const G=this.resume(),oe=this.stack[this.stack.length-1];oe.title=G}function _(){const G=this.resume(),oe=this.stack[this.stack.length-1];oe.url=G}function w(G){const oe=this.stack[this.stack.length-1];if(!oe.depth){const he=this.sliceSerialize(G).length;oe.depth=he}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function j(G){const oe=this.stack[this.stack.length-1];oe.depth=this.sliceSerialize(G).codePointAt(0)===61?1:2}function q(){this.data.setextHeadingSlurpLineEnding=void 0}function P(G){const he=this.stack[this.stack.length-1].children;let ge=he[he.length-1];(!ge||ge.type!=="text")&&(ge=Le(),ge.position={start:on(G.start),end:void 0},he.push(ge)),this.stack.push(ge)}function z(G){const oe=this.stack.pop();oe.value+=this.sliceSerialize(G),oe.position.end=on(G.end)}function R(G){const oe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const he=oe.children[oe.children.length-1];he.position.end=on(G.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(oe.type)&&(P.call(this,G),z.call(this,G))}function A(){this.data.atHardBreak=!0}function E(){const G=this.resume(),oe=this.stack[this.stack.length-1];oe.value=G}function S(){const G=this.resume(),oe=this.stack[this.stack.length-1];oe.value=G}function O(){const G=this.resume(),oe=this.stack[this.stack.length-1];oe.value=G}function V(){const G=this.stack[this.stack.length-1];if(this.data.inReference){const oe=this.data.referenceType||"shortcut";G.type+="Reference",G.referenceType=oe,delete G.url,delete G.title}else delete G.identifier,delete G.label;this.data.referenceType=void 0}function H(){const G=this.stack[this.stack.length-1];if(this.data.inReference){const oe=this.data.referenceType||"shortcut";G.type+="Reference",G.referenceType=oe,delete G.url,delete G.title}else delete G.identifier,delete G.label;this.data.referenceType=void 0}function Q(G){const oe=this.sliceSerialize(G),he=this.stack[this.stack.length-2];he.label=iw(oe),he.identifier=Jn(oe).toLowerCase()}function ae(){const G=this.stack[this.stack.length-1],oe=this.resume(),he=this.stack[this.stack.length-1];if(this.data.inReference=!0,he.type==="link"){const ge=G.children;he.children=ge}else he.alt=oe}function D(){const G=this.resume(),oe=this.stack[this.stack.length-1];oe.url=G}function $(){const G=this.resume(),oe=this.stack[this.stack.length-1];oe.title=G}function ee(){this.data.inReference=void 0}function B(){this.data.referenceType="collapsed"}function T(G){const oe=this.resume(),he=this.stack[this.stack.length-1];he.label=oe,he.identifier=Jn(this.sliceSerialize(G)).toLowerCase(),this.data.referenceType="full"}function L(G){this.data.characterReferenceType=G.type}function I(G){const oe=this.sliceSerialize(G),he=this.data.characterReferenceType;let ge;he?(ge=Uf(oe,he==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ge=Oo(oe);const Ee=this.stack.pop();Ee.value+=ge,Ee.position.end=on(G.end)}function W(G){z.call(this,G);const oe=this.stack[this.stack.length-1];oe.url=this.sliceSerialize(G)}function U(G){z.call(this,G);const oe=this.stack[this.stack.length-1];oe.url="mailto:"+this.sliceSerialize(G)}function ne(){return{type:"blockquote",children:[]}}function re(){return{type:"code",lang:null,meta:null,value:""}}function le(){return{type:"inlineCode",value:""}}function X(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function pe(){return{type:"emphasis",children:[]}}function me(){return{type:"heading",depth:0,children:[]}}function _e(){return{type:"break"}}function Be(){return{type:"html",value:""}}function Se(){return{type:"image",title:null,url:"",alt:null}}function Ye(){return{type:"link",title:null,url:"",children:[]}}function Ke(G){return{type:"list",ordered:G.type==="listOrdered",start:null,spread:G._spread,children:[]}}function je(G){return{type:"listItem",spread:G._spread,checked:null,children:[]}}function Oe(){return{type:"paragraph",children:[]}}function De(){return{type:"strong",children:[]}}function Le(){return{type:"text",value:""}}function Ue(){return{type:"thematicBreak"}}}function on(e){return{line:e.line,column:e.column,offset:e.offset}}function th(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?th(e,r):lw(e,r)}}function lw(e,t){let n;for(n in t)if(eh.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 xc(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Ar({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ar({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Ar({start:t.start,end:t.end})+") is still open")}function cw(e){const t=this;t.parser=n;function n(r){return ow(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function nh(e,t){var l,u,d;const n={...Yn,...t==null?void 0:t.nodeTypes,[Y.heading]:{...Yn[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=>nh({...h,ordered:e.ordered||!1},t))),e.type){case ct.heading:return{type:n[Y.heading][e.depth||1],children:s};case ct.list:return{type:e.ordered?n[Y.ol]:n[Y.ul],children:s};case ct.listItem:return{type:n[Y.li],children:s};case ct.paragraph:return{type:n[Y.paragraph],children:s};case ct.link:return{type:n[Y.link],[r]:e.url,children:s};case ct.image:return{type:n[Y.image],children:[{text:""}],[a]:e.url,[i]:e.alt};case ct.blockquote:return{type:n[Y.blockquote],children:s};case ct.code:return{type:n[Y.codeblock],language:e.lang,children:[{text:e.value}]};case ct.html:return(u=e.value)!=null&&u.includes("<br>")?{break:!0,type:n[Y.paragraph],children:[{text:((d=e.value)==null?void 0:d.replace(/<br>/g,""))||""}]}:{type:Y.paragraph,children:[{text:e.value||""}]};case ct.emphasis:return{[n[qt.emphasis]]:!0,...es(s),...pa(s)};case ct.strong:return{[n[qt.strong]]:!0,...es(s),...pa(s)};case ct.delete:return{[n[qt.delete]]:!0,...es(s),...pa(s)};case ct.inlineCode:return{[n[qt.code]]:!0,text:e.value,...pa(s)};case ct.thematicBreak:return{type:n[Y.hr],children:[{text:""}]};case"text":default:return{text:e.value||""}}}const es=e=>({text:e.map(t=>t==null?void 0:t.text).join("")});function pa(e){return e.reduce((t,n)=>(Object.keys(n).forEach(function(r){r==="children"||r==="type"||r==="text"||(t[r]=n[r])}),t),{})}const dw=function(t){const n=r=>r.children.map(a=>nh(a,t));this.Compiler=n},fw=(e,t=n=>{})=>{tD().use(cw).use(dw).process(e).then(n=>{const r=En(n.result),a=s=>{const o=s;[Y.li,Y.blockquote].includes(o.type)&&o.children.map((l,u)=>{const d=l;d.type===Y.paragraph&&o.children.splice(u,1,...d.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 d=u.children&&u.children[0];if(d&&"text"in d&&d.text.includes(zs)){const h=u,m=d.text.replace(zs,""),p="link"in h&&h.link?h.link:"";h.type=Y.mention,h.id=p,h.name=m,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(d=>{const h=d.replace(/~~/g,""),m=o.text.indexOf(d),p=o.text.substring(0,m),g=o.text.substring(m+d.length),f=[{text:p},{text:h,[Y.strikethrough]:!0},{text:g}];s.children.splice(l,1,...f)})}})}),t(r)})},No=e=>{const t=document.getElementById(e);if(t){const n=t.querySelector(".input");n&&(n==null||n.focus())}},hw=(e,t)=>{const{selection:n}=e;if(!n)return[null,null];let[r,a]=x.parent(e,n,{edge:"end"}),i=r;for(;i.type!==t&&a.length>0&&a.length!==1;)a=N.parent(a),r=ue.get(e,a),i=r;return i.type===t?[r,a]:[null,null]},mw=e=>{const{selection:t}=e;return t?x.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},Cc={"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},pw=(e,t,n,r)=>{for(const a in Cc)if(o1(a,e)){e.stopPropagation(),e.preventDefault();const i=Cc[a];if(i===Y.link){n([{type:"showLinkEditor",value:!0}]);return}if(kw(i)){ch(t,i,r);return}oh(t,i,r)}},rh=(e,t,n,r)=>{var d;const{selectedUser:a,possibleUsers:i}=t,s=i[a];if(!s)return;const o=s.userId||"",l=(d=s.user)==null?void 0:d.name;n([{type:"mentionPopover",value:{...t,show:!1}}]);const u={type:Y.mention,id:o,name:l,children:[{text:""}]};J.select(e,(t==null?void 0:t.position)||Lf),J.insertNodes(e,[u,{text:" "}]),J.move(e,{distance:1,unit:"offset"}),No(r)},gw=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=x.start(e,s.path),l=x.range(e,o,s),d=x.string(e,l).match(Zc);if(d){const h=d.index||0,m={path:s.path,offset:h},p={path:s.path,offset:h+d[0].length},g=x.range(e,m,p),f=x.after(e,s),b=x.range(e,s,f);if(x.string(e,b).match(/^(\s|\.|,|\?|!|:|;|'|"|`|$)/)){const F=d[1];let _=[];r&&(_=await r({name:F})),a([{type:"mentionPopover",value:{show:_.length>0?!0:n!==null,selectedUser:0,possibleUsers:_,position:_.length>0?g:null,numberOfUsers:_.length>0?_.length:null}}]);return}}}t&&a([{type:"mentionPopover",value:{show:!1,selectedUser:0,possibleUsers:[],position:null,numberOfUsers:null}}])},ah=e=>{let t=document.body;if(e!==!1){const n=document.getElementById(e);n&&(t=n)}return t},qn=e=>typeof e.text=="string",vw=[Y.hr,Y.image,Y.mention],wc="<br>";function ih(e,t={nodeTypes:Yn}){const{nodeTypes:n=Yn,ignoreParagraphNewline:r=!1,listDepth:a=0}=t,i=e.text||"";let s=e.type||"";const o={...Yn,...n,heading:{...Yn[Y.heading],...n[Y.heading]}},l=[o[Y.ul],o[Y.ol]];let u=i;if(!qn(e)&&s!==Y.mention&&(u=e.children.map(d=>{const h=qn(d)?!1:l.includes(d.type||""),m=l.includes(e.type||"");let p=!1;return!qn(e)&&Array.isArray(e.children)&&(p=e.children.some(g=>!qn(g)&&g.type===o.link)),ih({...d,parentType:s},{nodeTypes:o,ignoreParagraphNewline:(r||h||m||p)&&!d.break,listDepth:l.includes(d.type||"")?a+1:a,inBlockquote:s===o[Y.blockquote]||e.parentType===o[Y.blockquote]})}).join("")),!r&&(i===""||i===`
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 HC={42:mt,43:mt,45:mt,48:mt,49:mt,50:mt,51:mt,52:mt,53:mt,54:mt,55:mt,56:mt,57:mt,62:Hf},VC={91:KD},KC={[-2]:Ji,[-1]:Ji,32:Ji},ZC={35:XD,42:Aa,45:[bc,Aa],60:rC,61:bc,95:Aa,96:gc,126:gc},YC={38:Kf,92:Vf},GC={[-5]:Xi,[-4]:Xi,[-3]:Xi,33:DC,38:Kf,42:Ks,60:[wD,cC],91:wC,92:[QD,Vf],93:Mo,95:Ks,96:ND},QC={null:[Ks,IC]},JC={null:[42,95]},XC={null:[]},ew=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:JC,contentInitial:VC,disable:XC,document:HC,flow:ZC,flowInitial:KC,insideSpan:QC,string:YC,text:GC},Symbol.toStringTag,{value:"Module"}));function tw(e){const n=uD([ew,...(e||{}).extensions||[]]),r={defined:[],lazy:{},constructs:n,content:a(gD),document:a(bD),flow:a(NC),string:a($C),text:a(LC)};return r;function a(i){return s;function s(o){return qC(r,i,o)}}}function nw(e){for(;!Zf(e););return e}const yc=/[\0\t\n\r]/g;function rw(){let e=1,t="",n=!0,r;return a;function a(i,s,o){const l=[];let u,d,h,m,p;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(yc.lastIndex=h,u=yc.exec(i),m=u&&u.index!==void 0?u.index:i.length,p=i.charCodeAt(m),!u){t=i.slice(h);break}if(p===10&&h===m&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),h<m&&(l.push(i.slice(h,m)),e+=m-h),p){case 0:{l.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,l.push(-2);e++<d;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}h=m+1}return o&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const aw=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function iw(e){return e.replace(aw,sw)}function sw(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),i=a===120||a===88;return Uf(n.slice(i?2:1),i?16:10)}return Oo(n)||e}const eh={}.hasOwnProperty;function ow(e,t,n){return typeof t!="string"&&(n=t,t=void 0),uw(n)(nw(tw(n).document().write(rw()(e,t,!0))))}function uw(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Ye),autolinkProtocol:P,autolinkEmail:P,atxHeading:i(me),blockQuote:i(ne),characterEscape:P,characterReference:P,codeFenced:i(re),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:i(re,s),codeText:i(le,s),codeTextData:P,data:P,codeFlowValue:P,definition:i(ee),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:i(pe),hardBreakEscape:i(_e),hardBreakTrailing:i(_e),htmlFlow:i(Be,s),htmlFlowData:P,htmlText:i(Be,s),htmlTextData:P,image:i(Se),label:s,link:i(Ye),listItem:i(je),listItemValue:m,listOrdered:i(Ke,h),listUnordered:i(Ke),paragraph:i(Oe),reference:B,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:i(me),strong:i(De),thematicBreak:i(Ue)},exit:{atxHeading:l(),atxHeadingSequence:w,autolink:l(),autolinkEmail:U,autolinkProtocol:W,blockQuote:l(),characterEscapeValue:z,characterReferenceMarkerHexadecimal:L,characterReferenceMarkerNumeric:L,characterReferenceValue:I,codeFenced:l(b),codeFencedFence:f,codeFencedFenceInfo:p,codeFencedFenceMeta:g,codeFlowValue:z,codeIndented:l(v),codeText:l(O),codeTextData:z,data:z,definition:l(),definitionDestinationString:_,definitionLabelString:C,definitionTitleString:F,emphasis:l(),hardBreakEscape:l(A),hardBreakTrailing:l(A),htmlFlow:l(E),htmlFlowData:z,htmlText:l(S),htmlTextData:z,image:l(H),label:ae,labelText:Q,lineEnding:R,link:l(V),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:T,resourceDestinationString:D,resourceTitleString:$,resource:X,setextHeading:l(q),setextHeadingLineSequence:j,setextHeadingText:k,strong:l(),thematicBreak:l()}};th(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(G){let oe={type:"root",children:[]};const he={stack:[oe],tokenStack:[],config:t,enter:o,exit:u,buffer:s,resume:d,data:n},ge=[];let Ee=-1;for(;++Ee<G.length;)if(G[Ee][1].type==="listOrdered"||G[Ee][1].type==="listUnordered")if(G[Ee][0]==="enter")ge.push(Ee);else{const be=ge.pop();Ee=a(G,be,Ee)}for(Ee=-1;++Ee<G.length;){const be=t[G[Ee][0]];eh.call(be,G[Ee][1].type)&&be[G[Ee][1].type].call(Object.assign({sliceSerialize:G[Ee][2].sliceSerialize},he),G[Ee][1])}if(he.tokenStack.length>0){const be=he.tokenStack[he.tokenStack.length-1];(be[1]||xc).call(he,void 0,be[0])}for(oe.position={start:on(G.length>0?G[0][1].start:{line:1,column:1,offset:0}),end:on(G.length>0?G[G.length-2][1].end:{line:1,column:1,offset:0})},Ee=-1;++Ee<t.transforms.length;)oe=t.transforms[Ee](oe)||oe;return oe}function a(G,oe,he){let ge=oe-1,Ee=-1,be=!1,we,et,Et,ht;for(;++ge<=he;){const Qe=G[ge];switch(Qe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Qe[0]==="enter"?Ee++:Ee--,ht=void 0;break}case"lineEndingBlank":{Qe[0]==="enter"&&(we&&!ht&&!Ee&&!Et&&(Et=ge),ht=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ht=void 0}if(!Ee&&Qe[0]==="enter"&&Qe[1].type==="listItemPrefix"||Ee===-1&&Qe[0]==="exit"&&(Qe[1].type==="listUnordered"||Qe[1].type==="listOrdered")){if(we){let yt=ge;for(et=void 0;yt--;){const xt=G[yt];if(xt[1].type==="lineEnding"||xt[1].type==="lineEndingBlank"){if(xt[0]==="exit")continue;et&&(G[et][1].type="lineEndingBlank",be=!0),xt[1].type="lineEnding",et=yt}else if(!(xt[1].type==="linePrefix"||xt[1].type==="blockQuotePrefix"||xt[1].type==="blockQuotePrefixWhitespace"||xt[1].type==="blockQuoteMarker"||xt[1].type==="listItemIndent"))break}Et&&(!et||Et<et)&&(we._spread=!0),we.end=Object.assign({},et?G[et][1].start:Qe[1].end),G.splice(et||ge,0,["exit",we,Qe[2]]),ge++,he++}if(Qe[1].type==="listItemPrefix"){const yt={type:"listItem",_spread:!1,start:Object.assign({},Qe[1].start),end:void 0};we=yt,G.splice(ge,0,["enter",yt,Qe[2]]),ge++,he++,Et=void 0,ht=!0}}}return G[oe][1]._spread=be,he}function i(G,oe){return he;function he(ge){o.call(this,G(ge),ge),oe&&oe.call(this,ge)}}function s(){this.stack.push({type:"fragment",children:[]})}function o(G,oe,he){this.stack[this.stack.length-1].children.push(G),this.stack.push(G),this.tokenStack.push([oe,he]),G.position={start:on(oe.start),end:void 0}}function l(G){return oe;function oe(he){G&&G.call(this,he),u.call(this,he)}}function u(G,oe){const he=this.stack.pop(),ge=this.tokenStack.pop();if(ge)ge[0].type!==G.type&&(oe?oe.call(this,G,ge[0]):(ge[1]||xc).call(this,G,ge[0]));else throw new Error("Cannot close `"+G.type+"` ("+Ar({start:G.start,end:G.end})+"): it’s not open");he.position.end=on(G.end)}function d(){return sD(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function m(G){if(this.data.expectingFirstListItemValue){const oe=this.stack[this.stack.length-2];oe.start=Number.parseInt(this.sliceSerialize(G),10),this.data.expectingFirstListItemValue=void 0}}function p(){const G=this.resume(),oe=this.stack[this.stack.length-1];oe.lang=G}function g(){const G=this.resume(),oe=this.stack[this.stack.length-1];oe.meta=G}function f(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const G=this.resume(),oe=this.stack[this.stack.length-1];oe.value=G.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const G=this.resume(),oe=this.stack[this.stack.length-1];oe.value=G.replace(/(\r?\n|\r)$/g,"")}function C(G){const oe=this.resume(),he=this.stack[this.stack.length-1];he.label=oe,he.identifier=Jn(this.sliceSerialize(G)).toLowerCase()}function F(){const G=this.resume(),oe=this.stack[this.stack.length-1];oe.title=G}function _(){const G=this.resume(),oe=this.stack[this.stack.length-1];oe.url=G}function w(G){const oe=this.stack[this.stack.length-1];if(!oe.depth){const he=this.sliceSerialize(G).length;oe.depth=he}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function j(G){const oe=this.stack[this.stack.length-1];oe.depth=this.sliceSerialize(G).codePointAt(0)===61?1:2}function q(){this.data.setextHeadingSlurpLineEnding=void 0}function P(G){const he=this.stack[this.stack.length-1].children;let ge=he[he.length-1];(!ge||ge.type!=="text")&&(ge=Le(),ge.position={start:on(G.start),end:void 0},he.push(ge)),this.stack.push(ge)}function z(G){const oe=this.stack.pop();oe.value+=this.sliceSerialize(G),oe.position.end=on(G.end)}function R(G){const oe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const he=oe.children[oe.children.length-1];he.position.end=on(G.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(oe.type)&&(P.call(this,G),z.call(this,G))}function A(){this.data.atHardBreak=!0}function E(){const G=this.resume(),oe=this.stack[this.stack.length-1];oe.value=G}function S(){const G=this.resume(),oe=this.stack[this.stack.length-1];oe.value=G}function O(){const G=this.resume(),oe=this.stack[this.stack.length-1];oe.value=G}function V(){const G=this.stack[this.stack.length-1];if(this.data.inReference){const oe=this.data.referenceType||"shortcut";G.type+="Reference",G.referenceType=oe,delete G.url,delete G.title}else delete G.identifier,delete G.label;this.data.referenceType=void 0}function H(){const G=this.stack[this.stack.length-1];if(this.data.inReference){const oe=this.data.referenceType||"shortcut";G.type+="Reference",G.referenceType=oe,delete G.url,delete G.title}else delete G.identifier,delete G.label;this.data.referenceType=void 0}function Q(G){const oe=this.sliceSerialize(G),he=this.stack[this.stack.length-2];he.label=iw(oe),he.identifier=Jn(oe).toLowerCase()}function ae(){const G=this.stack[this.stack.length-1],oe=this.resume(),he=this.stack[this.stack.length-1];if(this.data.inReference=!0,he.type==="link"){const ge=G.children;he.children=ge}else he.alt=oe}function D(){const G=this.resume(),oe=this.stack[this.stack.length-1];oe.url=G}function $(){const G=this.resume(),oe=this.stack[this.stack.length-1];oe.title=G}function X(){this.data.inReference=void 0}function B(){this.data.referenceType="collapsed"}function T(G){const oe=this.resume(),he=this.stack[this.stack.length-1];he.label=oe,he.identifier=Jn(this.sliceSerialize(G)).toLowerCase(),this.data.referenceType="full"}function L(G){this.data.characterReferenceType=G.type}function I(G){const oe=this.sliceSerialize(G),he=this.data.characterReferenceType;let ge;he?(ge=Uf(oe,he==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ge=Oo(oe);const Ee=this.stack.pop();Ee.value+=ge,Ee.position.end=on(G.end)}function W(G){z.call(this,G);const oe=this.stack[this.stack.length-1];oe.url=this.sliceSerialize(G)}function U(G){z.call(this,G);const oe=this.stack[this.stack.length-1];oe.url="mailto:"+this.sliceSerialize(G)}function ne(){return{type:"blockquote",children:[]}}function re(){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 pe(){return{type:"emphasis",children:[]}}function me(){return{type:"heading",depth:0,children:[]}}function _e(){return{type:"break"}}function Be(){return{type:"html",value:""}}function Se(){return{type:"image",title:null,url:"",alt:null}}function Ye(){return{type:"link",title:null,url:"",children:[]}}function Ke(G){return{type:"list",ordered:G.type==="listOrdered",start:null,spread:G._spread,children:[]}}function je(G){return{type:"listItem",spread:G._spread,checked:null,children:[]}}function Oe(){return{type:"paragraph",children:[]}}function De(){return{type:"strong",children:[]}}function Le(){return{type:"text",value:""}}function Ue(){return{type:"thematicBreak"}}}function on(e){return{line:e.line,column:e.column,offset:e.offset}}function th(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?th(e,r):lw(e,r)}}function lw(e,t){let n;for(n in t)if(eh.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 xc(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Ar({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ar({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Ar({start:t.start,end:t.end})+") is still open")}function cw(e){const t=this;t.parser=n;function n(r){return ow(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function nh(e,t){var l,u,d;const n={...Yn,...t==null?void 0:t.nodeTypes,[Y.heading]:{...Yn[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=>nh({...h,ordered:e.ordered||!1},t))),e.type){case ct.heading:return{type:n[Y.heading][e.depth||1],children:s};case ct.list:return{type:e.ordered?n[Y.ol]:n[Y.ul],children:s};case ct.listItem:return{type:n[Y.li],children:s};case ct.paragraph:return{type:n[Y.paragraph],children:s};case ct.link:return{type:n[Y.link],[r]:e.url,children:s};case ct.image:return{type:n[Y.image],children:[{text:""}],[a]:e.url,[i]:e.alt};case ct.blockquote:return{type:n[Y.blockquote],children:s};case ct.code:return{type:n[Y.codeblock],language:e.lang,children:[{text:e.value}]};case ct.html:return(u=e.value)!=null&&u.includes("<br>")?{break:!0,type:n[Y.paragraph],children:[{text:((d=e.value)==null?void 0:d.replace(/<br>/g,""))||""}]}:{type:Y.paragraph,children:[{text:e.value||""}]};case ct.emphasis:return{[n[qt.emphasis]]:!0,...es(s),...pa(s)};case ct.strong:return{[n[qt.strong]]:!0,...es(s),...pa(s)};case ct.delete:return{[n[qt.delete]]:!0,...es(s),...pa(s)};case ct.inlineCode:return{[n[qt.code]]:!0,text:e.value,...pa(s)};case ct.thematicBreak:return{type:n[Y.hr],children:[{text:""}]};case"text":default:return{text:e.value||""}}}const es=e=>({text:e.map(t=>t==null?void 0:t.text).join("")});function pa(e){return e.reduce((t,n)=>(Object.keys(n).forEach(function(r){r==="children"||r==="type"||r==="text"||(t[r]=n[r])}),t),{})}const dw=function(t){const n=r=>r.children.map(a=>nh(a,t));this.Compiler=n},fw=(e,t=n=>{})=>{tD().use(cw).use(dw).process(e).then(n=>{const r=En(n.result),a=s=>{const o=s;[Y.li,Y.blockquote].includes(o.type)&&o.children.map((l,u)=>{const d=l;d.type===Y.paragraph&&o.children.splice(u,1,...d.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 d=u.children&&u.children[0];if(d&&"text"in d&&d.text.includes(zs)){const h=u,m=d.text.replace(zs,""),p="link"in h&&h.link?h.link:"";h.type=Y.mention,h.id=p,h.name=m,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(d=>{const h=d.replace(/~~/g,""),m=o.text.indexOf(d),p=o.text.substring(0,m),g=o.text.substring(m+d.length),f=[{text:p},{text:h,[Y.strikethrough]:!0},{text:g}];s.children.splice(l,1,...f)})}})}),t(r)})},No=e=>{const t=document.getElementById(e);if(t){const n=t.querySelector(".input");n&&(n==null||n.focus())}},hw=(e,t)=>{const{selection:n}=e;if(!n)return[null,null];let[r,a]=x.parent(e,n,{edge:"end"}),i=r;for(;i.type!==t&&a.length>0&&a.length!==1;)a=N.parent(a),r=ue.get(e,a),i=r;return i.type===t?[r,a]:[null,null]},mw=e=>{const{selection:t}=e;return t?x.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},Cc={"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},pw=(e,t,n,r)=>{for(const a in Cc)if(o1(a,e)){e.stopPropagation(),e.preventDefault();const i=Cc[a];if(i===Y.link){n([{type:"showLinkEditor",value:!0}]);return}if(kw(i)){ch(t,i,r);return}oh(t,i,r)}},rh=(e,t,n,r)=>{var d;const{selectedUser:a,possibleUsers:i}=t,s=i[a];if(!s)return;const o=s.userId||"",l=(d=s.user)==null?void 0:d.name;n([{type:"mentionPopover",value:{...t,show:!1}}]);const u={type:Y.mention,id:o,name:l,children:[{text:""}]};J.select(e,(t==null?void 0:t.position)||Lf),J.insertNodes(e,[u,{text:" "}]),J.move(e,{distance:1,unit:"offset"}),No(r)},gw=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=x.start(e,s.path),l=x.range(e,o,s),d=x.string(e,l).match(Zc);if(d){const h=d.index||0,m={path:s.path,offset:h},p={path:s.path,offset:h+d[0].length},g=x.range(e,m,p),f=x.after(e,s),b=x.range(e,s,f);if(x.string(e,b).match(/^(\s|\.|,|\?|!|:|;|'|"|`|$)/)){const F=d[1];let _=[];r&&(_=await r({name:F})),a([{type:"mentionPopover",value:{show:_.length>0?!0:n!==null,selectedUser:0,possibleUsers:_,position:_.length>0?g:null,numberOfUsers:_.length>0?_.length:null}}]);return}}}t&&a([{type:"mentionPopover",value:{show:!1,selectedUser:0,possibleUsers:[],position:null,numberOfUsers:null}}])},ah=e=>{let t=document.body;if(e!==!1){const n=document.getElementById(e);n&&(t=n)}return t},qn=e=>typeof e.text=="string",vw=[Y.hr,Y.image,Y.mention],wc="<br>";function ih(e,t={nodeTypes:Yn}){const{nodeTypes:n=Yn,ignoreParagraphNewline:r=!1,listDepth:a=0}=t,i=e.text||"";let s=e.type||"";const o={...Yn,...n,heading:{...Yn[Y.heading],...n[Y.heading]}},l=[o[Y.ul],o[Y.ol]];let u=i;if(!qn(e)&&s!==Y.mention&&(u=e.children.map(d=>{const h=qn(d)?!1:l.includes(d.type||""),m=l.includes(e.type||"");let p=!1;return!qn(e)&&Array.isArray(e.children)&&(p=e.children.some(g=>!qn(g)&&g.type===o.link)),ih({...d,parentType:s},{nodeTypes:o,ignoreParagraphNewline:(r||h||m||p)&&!d.break,listDepth:l.includes(d.type||"")?a+1:a,inBlockquote:s===o[Y.blockquote]||e.parentType===o[Y.blockquote]})}).join("")),!r&&(i===""||i===`
142
142
  `)&&e.parentType===o[Y.paragraph]&&s!==o[Y.mention]&&(s=o[Y.paragraph],u=wc),!(u===""&&!vw.find(d=>o[d]===s)))switch(u!==wc&&qn(e)&&(e[Y.strikethrough]&&e[Y.bold]&&e[Y.italic]?u=Wn(u,"~~***"):e[Y.bold]&&e[Y.italic]?u=Wn(u,"***"):(e[Y.bold]&&(u=Wn(u,"**")),e[Y.italic]&&(u=Wn(u,"_")),e[Y.strikethrough]&&(u=Wn(u,"~~")),e[Y.code]&&(u=Wn(u,"`")))),s){case o[Y.heading][1]:return`# ${u}
143
143
  `;case o[Y.heading][2]:return`## ${u}
144
144
  `;case o[Y.heading][3]:return`### ${u}
@@ -158,8 +158,8 @@ ${p}${h?"1.":"-"} ${u}${m?`
158
158
  `:""}`;case o[Y.paragraph]:return`${u}
159
159
 
160
160
  `;case o[Y.hr]:return`---
161
- `;default:return u}}function Wn(e,t){const n=e.trim(),r=n,a=`${t}${r}${Ec(t)}`;if(r.length===e.length)return a;const i=t+r+Ec(t);return e.replace(n,i)}const Ec=e=>e.split("").reverse().join(""),bw=e=>e.map(t=>ih(t)).join("").trim();const yw=({onFallbackClick:e=()=>{}})=>{const t=ie.useIntl(),n=Nn(),{dispatch:r,isInOverlay:a,mentionPopover:i,id:s,onMention:o}=y.useContext(an),{show:l,selectedUser:u,possibleUsers:d}=i,h=zf(n,"mention-popover",`toolbar-${s}`);if(!l)return c.jsx(c.Fragment,{});const m=ah(a);return c.jsx(lr,{parent:m,children:c.jsx(ed,{ref:h,className:"mention-popover",onKeyDown:p=>{p.key==="Escape"&&(p.preventDefault(),p.stopPropagation(),r([{type:"showMentionPopover",value:!1}]))},children:c.jsxs("ul",{children:[d.map(({userId:p,user:g},f)=>c.jsx(Jt,{element:"li",className:K({selected:f===u}),member:{id:p,...g,link:!1},functions:{onClick:b=>{b.preventDefault(),b.stopPropagation();const v={...i,selectedUser:f};r([{type:"mentionPopover",value:v}]),rh(n,v,r,s),o&&o({id:p||"",name:g.name||""})}}},p)),c.jsx(Jt,{element:"li",className:K("fallback",{selected:d.length===u}),member:{id:"0",name:t.formatMessage({id:"richTextEditor_mention_fallback"}),image:{thumbnail:`${Ut}icons/invite-user.svg`},link:!1},functions:{onClick:p=>{p.preventDefault(),p.stopPropagation(),e(),r([{type:"mentionPopover",value:{show:!1,selectedUser:0,possibleUsers:[],position:null}}])}}})]})})})},Ro=({id:e,active:t,hasDivider:n=!1,callback:r,className:a="",children:i,"aria-pressed":s,...o})=>{const l=ie.useIntl(),u=Nn(),{id:d,tabbableOption:h,setFocus:m,openTooltip:p,dispatch:g}=y.useContext(an),f={};return e!==h&&(f.tabIndex=-1),s!==null&&(f["aria-pressed"]=typeof s=="boolean"?s:t),c.jsxs("li",{id:`${d}-${e}`,className:K(e,{"has-divider":n}),onMouseEnter:()=>{g([{type:"openTooltip",value:e}])},onMouseLeave:()=>{g([{type:"openTooltip",value:null}])},onFocus:()=>{g([{type:"openTooltip",value:e}])},onBlur:b=>{b.stopPropagation();const v=[{type:"openTooltip",value:null}];u.selection&&v.push({type:"lastAnchor",value:u.selection.anchor}),g(v)},contentEditable:!1,children:[c.jsxs("button",{...o,...f,className:K(e,a,{active:t}),onClick:b=>{b.stopPropagation(),b.preventDefault()},onMouseDown:b=>{b.stopPropagation(),b.preventDefault(),r()},onKeyDown:b=>{var v,C,F,_;if(b.key!=="Tab")switch(b.key){case"Enter":b.stopPropagation(),b.preventDefault(),r();break;case"ArrowLeft":case"ArrowRight":b.stopPropagation(),b.preventDefault();const w=b.currentTarget.closest("li");let k=w==null?void 0:w.nextElementSibling;if(b.key==="ArrowLeft"){const P=w==null?void 0:w.previousElementSibling;P?k=P:k=(v=w==null?void 0:w.parentElement)==null?void 0:v.lastElementChild}else k||(k=(C=w==null?void 0:w.parentElement)==null?void 0:C.firstElementChild);const j=k==null?void 0:k.className.split(" ")[0];j&&(m(j),(F=k==null?void 0:k.querySelector("button"))==null||F.focus());break;default:const q=b.currentTarget.closest("fieldset");if(q){(_=q==null?void 0:q.previousElementSibling)==null||_.focus();break}}},children:[c.jsx(Ie,{showOnFocus:!1,children:l.formatMessage({id:`richTextEditor_${e}`})}),c.jsx(Mn,{id:`tooltip-${e}`,styling:{extraPadding:!1,hasPointer:"bottom"},isOpen:p===e,accessibility:{"aria-hidden":!0},children:l.formatMessage({id:`richTextEditor_${e}`})})]}),i]})},_c=[Y.ol,Y.ul],sh=(e,t)=>{const{selection:n}=e;if(!n)return!1;const[r]=Array.from(x.nodes(e,{at:x.unhangRange(e,n),match:a=>{const i=a;return!x.isEditor(a)&&de.isElement(a)&&i.type===t}}));return!!r},xw=e=>{const[t]=x.nodes(e,{match:n=>n.type===Y.blockquote});return!!t},oh=(e,t,n)=>{try{const r=xw(e),a=sh(e,t),i=_c.includes(t);J.unwrapNodes(e,{match:l=>{const u=l;return!x.isEditor(u)&&de.isElement(u)&&_c.includes(u.type)},split:!0});const o={type:a?Y.paragraph:i?Y.li:t};if(J.setNodes(e,o),i)if(a){const{selection:l}=e;if(!l)return;const[u,d]=x.parent(e,l,{edge:"end"});Array.from(x.nodes(e,{at:d,match:m=>{const p=m;return!x.isEditor(m)&&de.isElement(m)&&p.type===Y.li}})).forEach(([m,p])=>{ue.string(m).trim()===""&&J.removeNodes(e,{at:p})})}else{if(r){const u={type:Y.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}`)}},Dw=({format:e,hasDivider:t=!1})=>{const{setFocus:n,reportError:r}=y.useContext(an),a=Nn(),i=sh(a,e);return c.jsx(Ro,{id:e,active:i,hasDivider:t,callback:()=>{oh(a,e,r),n(i?null:e)}})},Sr=e=>{const[t]=x.nodes(e,{match:n=>{const r=n;return!x.isEditor(n)&&de.isElement(n)&&r.type===Y.link}});return!!t},Cw=(e,t,n,r)=>{e.selection&&Io(e,t,n,r)},ww=(e,t,n,r)=>{const{selection:a}=e;if(a&&Z.isCollapsed(a)){const[s]=x.nodes(e,{match:o=>{const l=o;return!x.isEditor(o)&&de.isElement(o)&&l.type===Y.link}});if(s){const[o,l]=s,u={link:t};J.setNodes(e,u,{at:l}),No(n)}}else Io(e,t,n,r)},Io=(e,t,n,r=a=>{console.error(a)})=>{try{Sr(e)&&uh(e);const{selection:a}=e,i=a&&Z.isCollapsed(a),s={type:Y.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"})),No(n)}catch(a){const i=a.message;r(`Error in wrapLink: ${i}`)}},uh=e=>{J.unwrapNodes(e,{match:t=>{const n=t;return!x.isEditor(t)&&de.isElement(t)&&n.type===Y.link}})};let ts=null;const Ew=()=>{const e=ie.useIntl(),t="richTextEditor_link_",{id:n,showLinkEditor:r,isInOverlay:a,dispatch:i,reportError:s}=y.useContext(an),o=Nn(),l=Rx(o),u=(l==null?void 0:l.text)||mw(o),[d,h]=y.useState(Sr(o)),m=zf(o,"link-editor",`${n}-link`),p=y.useRef(null);y.useEffect(()=>{var C;!d&&r&&((C=p.current)==null||C.focus())},[d]),y.useEffect(()=>{ts&&clearTimeout(ts),ts=setTimeout(()=>{h(Sr(o))},500)},[o.selection]);const g=[],f=["open","edit","remove"].map(C=>{const F={variant:"tertiary",size:"small",children:e.formatMessage({id:`${t}${C}`},{link:l==null?void 0:l.pretty})};switch(g.push({className:C}),C){case"open":F.href=(l==null?void 0:l.full)||"",F.onClick=_=>{_.preventDefault(),_.stopPropagation(),window.open((l==null?void 0:l.full)||"","_blank"),i([{type:"showLinkEditor",value:!1}])},F.children=c.jsxs(c.Fragment,{children:[F.children,c.jsx(Ie,{children:e.formatMessage({id:`${t}${C}_text`})})]});break;case"edit":F.onClick=()=>{h(!1)};break;case"remove":F.onClick=()=>{const _=[{type:"showLinkEditor",value:!1}];Sr(o)&&(uh(o),_.push({type:"lastAnchor",value:null})),i(_)};break}return F}),b=[{id:"url",type:"url",inputRef:p,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,functions:{onChange:()=>{},onKeyDown:C=>{if(C.key==="Tab"){if(!o)return;C.preventDefault(),C.stopPropagation();const F=x.end(o,[]);J.select(o,F),te.focus(o)}}}}];u&&b.unshift({component:()=>c.jsxs("p",{children:[c.jsx("strong",{"aria-label":e.formatMessage({id:`${t}text_aria`}),children:e.formatMessage({id:`${t}text`})})," ",u]})});const v=ah(a);return c.jsx(lr,{parent:v,children:c.jsx(Mn,{ref:m,id:`${n}-link-editor`,className:"link-editor",isOpen:r,styling:{extraPadding:!1,hasForm:!d},functions:{onBlur:()=>{i([{type:"showLinkEditor",value:!1}])}},callbacks:{onOpen:()=>{setTimeout(()=>{var C;return(C=p.current)==null?void 0:C.focus()})}},children:d?c.jsx(or,{wrappers:g,buttons:f}):c.jsx(nn,{element:"fieldset",id:`${n}-link-editor`,className:K({"show-labels":u}),meta:{shouldReset:!0,showRequiredLabels:!1},functions:{onSuccess:async C=>{setTimeout(()=>{const F=[{type:"showLinkEditor",value:!1}];if(C.url){const{full:_}=Jc(C.url);l!=null&&l.full?ww(o,_,n,s):Cw(o,_,n,s),F.push({type:"lastAnchor",value:null})}i(F)})}},fields:b,button:{text:e.formatMessage({id:`${t}button`}),variant:"tertiary",size:"small"}})})})},_w=()=>{const e=Nn(),{setFocus:t,dispatch:n}=y.useContext(an),[r,a]=y.useState(!1);return y.useEffect(()=>{a(Sr(e))},[e.selection]),c.jsx(Ro,{id:"link",active:r,hasDivider:!0,callback:()=>{n([{type:"showLinkEditor",value:!0}]),t(r?null:"link"),a(!0)},"aria-pressed":null})},kw=e=>[Y.bold,Y.italic,Y.strikethrough].includes(e),lh=(e,t)=>{const n=x.marks(e);return n?n[t]===!0:!1},ch=(e,t,n)=>{try{lh(e,t)?x.removeMark(e,t):x.addMark(e,t,!0)}catch(r){const a=r.message;n(`Error toggling mark: ${a}`)}},Fw=({format:e,hasDivider:t=!1})=>{const{setFocus:n,reportError:r}=y.useContext(an),a=Nn(),i=lh(a,e);return c.jsx(Ro,{id:e,active:i,hasDivider:t,callback:()=>{ch(a,e,r),n(i?null:e)}})},Ua=[Y.bold,Y.italic,Y.strikethrough],Bw=[Y.ol,Y.ul,Y.blockquote];const Aw=({...e})=>{const t=ie.useIntl(),{id:n}=y.useContext(an);return c.jsxs(c.Fragment,{children:[c.jsxs("fieldset",{id:`toolbar-${n}`,className:"toolbar",...e,children:[c.jsx(Ie,{element:"legend",showOnFocus:!1,children:t.formatMessage({id:"richTextEditor_toolbar"})}),c.jsxs("ul",{children:[Ua.map((r,a)=>c.jsx(Fw,{format:r,hasDivider:a===Ua.length-1},r)),c.jsx(_w,{}),Bw.map((r,a)=>c.jsx(Dw,{format:r,hasDivider:a===1},r))]})]}),c.jsx(Ew,{})]})};var Tw=Pw,Sw=/^(?:\w+:)?\/\/(\S+)$/,jw=/^localhost[\:?\d]*(?:[^\:?\d]\S*)?$/,Ow=/^[^\s\.]+\.\S{2,}$/;function Pw(e){if(typeof e!="string")return!1;var t=e.match(Sw);if(!t)return!1;var n=t[1];return n?!!(jw.test(n)||Ow.test(n)):!1}const Mw=On(Tw),Nw=(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)?Io(e,i,t):r(i)}}catch(i){const s=i.message;n(`Error in withInlines: ${s}`)}return e},Rw=(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},Iw=(e,t)=>{const{normalizeNode:n}=e;try{e.normalizeNode=([r,a])=>{if(r.type===Y.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 dh=({id:e="rich-text-editor",value:t,placeholder:n,maxLength:r=0,meta:a,functions:i,autoFocus:s,data:o,...l})=>{const u=ie.useIntl(),d=fm();typeof s>"u"&&(s=!0);const{isInOverlay:h=!1}=a||{},{listMembers:m,clickMentionFallback:p,onChange:g=()=>{},onMention:f=()=>{},reportError:b=$=>{console.error($)}}=i||{},v=[{type:Y.paragraph,children:[{text:""}]}];t==="<br>"&&(t="");const C={editorKey:null,originalValue:t||"",initialValue:t?null:v,tabbableOption:Ua[0],openTooltip:null,showLinkEditor:!1,mentionPopover:{show:!1,selectedUser:0,possibleUsers:[],position:null,numberOfUsers:null},lastAnchor:null,stringValue:"",lastKey:null,hasInteracted:!1,hasLoaded:!1},[F,_]=y.useReducer(Hr,C),{editorKey:w,originalValue:k,initialValue:j,stringValue:q,lastAnchor:P,lastKey:z,hasInteracted:R,hasLoaded:A,mentionPopover:E}=F,S=$=>{const ee=$||Ua[0];$&&_([{type:"tabbableOption",value:ee}])},O=`rte-${e}`,V=y.useCallback($=>c.jsx(Mx,{...$}),[]),H=y.useCallback($=>c.jsx(Nx,{...$}),[]),Q=y.useMemo(()=>Nw(Rw(Iw(Cb(Ox(xb())),b),b),O,b),[]);y.useEffect(()=>{if(!t)return;Pr.lastIndex=0;const $=t.match(Pr);!$||$.length>1||$[0].length!==t.length||R||_([{type:"originalValue",value:t}])},[t]);const ae=$=>{if(!Q||$!==O)return;const ee=x.end(Q,[]);J.select(Q,ee),te.focus(Q)};y.useEffect(()=>{const $=ee=>{var L;const B=ee,T=((L=B==null?void 0:B.detail)==null?void 0:L.id)||null;T&&ae(T)};return window.addEventListener("focusEditor",$),()=>{window.removeEventListener("focusEditor",$)}},[]),y.useEffect(()=>{if(Q.children.length>0&&!A){if(_([{type:"hasLoaded",value:!0}]),!s)return;ae(O)}},[Q.children.length,j]),y.useEffect(()=>{k&&(async()=>{let ee=En(k);if(ee.includes("<")){Nr.prototype.escape=T=>T;const B=new Nr;B.addRule("br",{filter:["br"],replacement:T=>T+`
161
+ `;default:return u}}function Wn(e,t){const n=e.trim(),r=n,a=`${t}${r}${Ec(t)}`;if(r.length===e.length)return a;const i=t+r+Ec(t);return e.replace(n,i)}const Ec=e=>e.split("").reverse().join(""),bw=e=>e.map(t=>ih(t)).join("").trim();const yw=({onFallbackClick:e=()=>{}})=>{const t=ie.useIntl(),n=Nn(),{dispatch:r,isInOverlay:a,mentionPopover:i,id:s,onMention:o}=y.useContext(an),{show:l,selectedUser:u,possibleUsers:d}=i,h=zf(n,"mention-popover",`toolbar-${s}`);if(!l)return c.jsx(c.Fragment,{});const m=ah(a);return c.jsx(lr,{parent:m,children:c.jsx(ed,{ref:h,className:"mention-popover",onKeyDown:p=>{p.key==="Escape"&&(p.preventDefault(),p.stopPropagation(),r([{type:"showMentionPopover",value:!1}]))},children:c.jsxs("ul",{children:[d.map(({userId:p,user:g},f)=>c.jsx(Jt,{element:"li",className:K({selected:f===u}),member:{id:p,...g,link:!1},functions:{onClick:b=>{b.preventDefault(),b.stopPropagation();const v={...i,selectedUser:f};r([{type:"mentionPopover",value:v}]),rh(n,v,r,s),o&&o({id:p||"",name:g.name||""})}}},p)),c.jsx(Jt,{element:"li",className:K("fallback",{selected:d.length===u}),member:{id:"0",name:t.formatMessage({id:"richTextEditor_mention_fallback"}),image:{thumbnail:`${Ut}icons/invite-user.svg`},link:!1},functions:{onClick:p=>{p.preventDefault(),p.stopPropagation(),e(),r([{type:"mentionPopover",value:{show:!1,selectedUser:0,possibleUsers:[],position:null}}])}}})]})})})},Ro=({id:e,active:t,hasDivider:n=!1,callback:r,className:a="",children:i,"aria-pressed":s,...o})=>{const l=ie.useIntl(),u=Nn(),{id:d,tabbableOption:h,setFocus:m,openTooltip:p,dispatch:g}=y.useContext(an),f={};return e!==h&&(f.tabIndex=-1),s!==null&&(f["aria-pressed"]=typeof s=="boolean"?s:t),c.jsxs("li",{id:`${d}-${e}`,className:K(e,{"has-divider":n}),onMouseEnter:()=>{g([{type:"openTooltip",value:e}])},onMouseLeave:()=>{g([{type:"openTooltip",value:null}])},onFocus:()=>{g([{type:"openTooltip",value:e}])},onBlur:b=>{b.stopPropagation();const v=[{type:"openTooltip",value:null}];u.selection&&v.push({type:"lastAnchor",value:u.selection.anchor}),g(v)},contentEditable:!1,children:[c.jsxs("button",{...o,...f,className:K(e,a,{active:t}),onClick:b=>{b.stopPropagation(),b.preventDefault()},onMouseDown:b=>{b.stopPropagation(),b.preventDefault(),r()},onKeyDown:b=>{var v,C,F,_;if(b.key!=="Tab")switch(b.key){case"Enter":b.stopPropagation(),b.preventDefault(),r();break;case"ArrowLeft":case"ArrowRight":b.stopPropagation(),b.preventDefault();const w=b.currentTarget.closest("li");let k=w==null?void 0:w.nextElementSibling;if(b.key==="ArrowLeft"){const P=w==null?void 0:w.previousElementSibling;P?k=P:k=(v=w==null?void 0:w.parentElement)==null?void 0:v.lastElementChild}else k||(k=(C=w==null?void 0:w.parentElement)==null?void 0:C.firstElementChild);const j=k==null?void 0:k.className.split(" ")[0];j&&(m(j),(F=k==null?void 0:k.querySelector("button"))==null||F.focus());break;default:const q=b.currentTarget.closest("fieldset");if(q){(_=q==null?void 0:q.previousElementSibling)==null||_.focus();break}}},children:[c.jsx(Ie,{showOnFocus:!1,children:l.formatMessage({id:`richTextEditor_${e}`})}),c.jsx(Mn,{id:`tooltip-${e}`,styling:{extraPadding:!1,hasPointer:"bottom"},isOpen:p===e,accessibility:{"aria-hidden":!0},children:l.formatMessage({id:`richTextEditor_${e}`})})]}),i]})},_c=[Y.ol,Y.ul],sh=(e,t)=>{const{selection:n}=e;if(!n)return!1;const[r]=Array.from(x.nodes(e,{at:x.unhangRange(e,n),match:a=>{const i=a;return!x.isEditor(a)&&de.isElement(a)&&i.type===t}}));return!!r},xw=e=>{const[t]=x.nodes(e,{match:n=>n.type===Y.blockquote});return!!t},oh=(e,t,n)=>{try{const r=xw(e),a=sh(e,t),i=_c.includes(t);J.unwrapNodes(e,{match:l=>{const u=l;return!x.isEditor(u)&&de.isElement(u)&&_c.includes(u.type)},split:!0});const o={type:a?Y.paragraph:i?Y.li:t};if(J.setNodes(e,o),i)if(a){const{selection:l}=e;if(!l)return;const[u,d]=x.parent(e,l,{edge:"end"});Array.from(x.nodes(e,{at:d,match:m=>{const p=m;return!x.isEditor(m)&&de.isElement(m)&&p.type===Y.li}})).forEach(([m,p])=>{ue.string(m).trim()===""&&J.removeNodes(e,{at:p})})}else{if(r){const u={type:Y.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}`)}},Dw=({format:e,hasDivider:t=!1})=>{const{setFocus:n,reportError:r}=y.useContext(an),a=Nn(),i=sh(a,e);return c.jsx(Ro,{id:e,active:i,hasDivider:t,callback:()=>{oh(a,e,r),n(i?null:e)}})},Sr=e=>{const[t]=x.nodes(e,{match:n=>{const r=n;return!x.isEditor(n)&&de.isElement(n)&&r.type===Y.link}});return!!t},Cw=(e,t,n,r)=>{e.selection&&Io(e,t,n,r)},ww=(e,t,n,r)=>{const{selection:a}=e;if(a&&Z.isCollapsed(a)){const[s]=x.nodes(e,{match:o=>{const l=o;return!x.isEditor(o)&&de.isElement(o)&&l.type===Y.link}});if(s){const[o,l]=s,u={link:t};J.setNodes(e,u,{at:l}),No(n)}}else Io(e,t,n,r)},Io=(e,t,n,r=a=>{console.error(a)})=>{try{Sr(e)&&uh(e);const{selection:a}=e,i=a&&Z.isCollapsed(a),s={type:Y.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"})),No(n)}catch(a){const i=a.message;r(`Error in wrapLink: ${i}`)}},uh=e=>{J.unwrapNodes(e,{match:t=>{const n=t;return!x.isEditor(t)&&de.isElement(t)&&n.type===Y.link}})};let ts=null;const Ew=()=>{const e=ie.useIntl(),t="richTextEditor_link_",{id:n,showLinkEditor:r,isInOverlay:a,dispatch:i,reportError:s}=y.useContext(an),o=Nn(),l=Rx(o),u=(l==null?void 0:l.text)||mw(o),[d,h]=y.useState(Sr(o)),m=zf(o,"link-editor",`${n}-link`),p=y.useRef(null);y.useEffect(()=>{var C;!d&&r&&((C=p.current)==null||C.focus())},[d]),y.useEffect(()=>{ts&&clearTimeout(ts),ts=setTimeout(()=>{h(Sr(o))},500)},[o.selection]);const g=[],f=["open","edit","remove"].map(C=>{const F={variant:"tertiary",size:"small",children:e.formatMessage({id:`${t}${C}`},{link:l==null?void 0:l.pretty})};switch(g.push({className:C}),C){case"open":F.href=(l==null?void 0:l.full)||"",F.onClick=_=>{_.preventDefault(),_.stopPropagation(),window.open((l==null?void 0:l.full)||"","_blank"),i([{type:"showLinkEditor",value:!1}])},F.children=c.jsxs(c.Fragment,{children:[F.children,c.jsx(Ie,{children:e.formatMessage({id:`${t}${C}_text`})})]});break;case"edit":F.onClick=()=>{h(!1)};break;case"remove":F.onClick=()=>{const _=[{type:"showLinkEditor",value:!1}];Sr(o)&&(uh(o),_.push({type:"lastAnchor",value:null})),i(_)};break}return F}),b=[{id:"url",type:"url",inputRef:p,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,functions:{onChange:()=>{},onKeyDown:C=>{if(C.key==="Tab"){if(!o)return;C.preventDefault(),C.stopPropagation();const F=x.end(o,[]);J.select(o,F),te.focus(o)}}}}];u&&b.unshift({component:()=>c.jsxs("p",{children:[c.jsx("strong",{"aria-label":e.formatMessage({id:`${t}text_aria`}),children:e.formatMessage({id:`${t}text`})})," ",u]})});const v=ah(a);return c.jsx(lr,{parent:v,children:c.jsx(Mn,{ref:m,id:`${n}-link-editor`,className:"link-editor",isOpen:r,styling:{extraPadding:!1,hasForm:!d},functions:{onBlur:()=>{i([{type:"showLinkEditor",value:!1}])}},callbacks:{onOpen:()=>{setTimeout(()=>{var C;return(C=p.current)==null?void 0:C.focus()})}},children:d?c.jsx(or,{wrappers:g,buttons:f}):c.jsx(nn,{element:"fieldset",id:`${n}-link-editor`,className:K({"show-labels":u}),meta:{shouldReset:!0,showRequiredLabels:!1},functions:{onSuccess:async C=>{setTimeout(()=>{const F=[{type:"showLinkEditor",value:!1}];if(C.url){const{full:_}=Jc(C.url);l!=null&&l.full?ww(o,_,n,s):Cw(o,_,n,s),F.push({type:"lastAnchor",value:null})}i(F)})}},fields:b,button:{text:e.formatMessage({id:`${t}button`}),variant:"tertiary",size:"small"}})})})},_w=()=>{const e=Nn(),{setFocus:t,dispatch:n}=y.useContext(an),[r,a]=y.useState(!1);return y.useEffect(()=>{a(Sr(e))},[e.selection]),c.jsx(Ro,{id:"link",active:r,hasDivider:!0,callback:()=>{n([{type:"showLinkEditor",value:!0}]),t(r?null:"link"),a(!0)},"aria-pressed":null})},kw=e=>[Y.bold,Y.italic,Y.strikethrough].includes(e),lh=(e,t)=>{const n=x.marks(e);return n?n[t]===!0:!1},ch=(e,t,n)=>{try{lh(e,t)?x.removeMark(e,t):x.addMark(e,t,!0)}catch(r){const a=r.message;n(`Error toggling mark: ${a}`)}},Fw=({format:e,hasDivider:t=!1})=>{const{setFocus:n,reportError:r}=y.useContext(an),a=Nn(),i=lh(a,e);return c.jsx(Ro,{id:e,active:i,hasDivider:t,callback:()=>{ch(a,e,r),n(i?null:e)}})},Ua=[Y.bold,Y.italic,Y.strikethrough],Bw=[Y.ol,Y.ul,Y.blockquote];const Aw=({...e})=>{const t=ie.useIntl(),{id:n}=y.useContext(an);return c.jsxs(c.Fragment,{children:[c.jsxs("fieldset",{id:`toolbar-${n}`,className:"toolbar",...e,children:[c.jsx(Ie,{element:"legend",showOnFocus:!1,children:t.formatMessage({id:"richTextEditor_toolbar"})}),c.jsxs("ul",{children:[Ua.map((r,a)=>c.jsx(Fw,{format:r,hasDivider:a===Ua.length-1},r)),c.jsx(_w,{}),Bw.map((r,a)=>c.jsx(Dw,{format:r,hasDivider:a===1},r))]})]}),c.jsx(Ew,{})]})};var Tw=Pw,Sw=/^(?:\w+:)?\/\/(\S+)$/,jw=/^localhost[\:?\d]*(?:[^\:?\d]\S*)?$/,Ow=/^[^\s\.]+\.\S{2,}$/;function Pw(e){if(typeof e!="string")return!1;var t=e.match(Sw);if(!t)return!1;var n=t[1];return n?!!(jw.test(n)||Ow.test(n)):!1}const Mw=On(Tw),Nw=(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)?Io(e,i,t):r(i)}}catch(i){const s=i.message;n(`Error in withInlines: ${s}`)}return e},Rw=(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},Iw=(e,t)=>{const{normalizeNode:n}=e;try{e.normalizeNode=([r,a])=>{if(r.type===Y.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 dh=({id:e="rich-text-editor",value:t,placeholder:n,maxLength:r=0,meta:a,functions:i,autoFocus:s,data:o,...l})=>{const u=ie.useIntl(),d=fm();typeof s>"u"&&(s=!0);const{isInOverlay:h=!1}=a||{},{listMembers:m,clickMentionFallback:p,onChange:g=()=>{},onMention:f=()=>{},reportError:b=$=>{console.error($)}}=i||{},v=[{type:Y.paragraph,children:[{text:""}]}];t==="<br>"&&(t="");const C={editorKey:null,originalValue:t||"",initialValue:t?null:v,tabbableOption:Ua[0],openTooltip:null,showLinkEditor:!1,mentionPopover:{show:!1,selectedUser:0,possibleUsers:[],position:null,numberOfUsers:null},lastAnchor:null,stringValue:"",lastKey:null,hasInteracted:!1,hasLoaded:!1},[F,_]=y.useReducer(Hr,C),{editorKey:w,originalValue:k,initialValue:j,stringValue:q,lastAnchor:P,lastKey:z,hasInteracted:R,hasLoaded:A,mentionPopover:E}=F,S=$=>{const X=$||Ua[0];$&&_([{type:"tabbableOption",value:X}])},O=`rte-${e}`,V=y.useCallback($=>c.jsx(Mx,{...$}),[]),H=y.useCallback($=>c.jsx(Nx,{...$}),[]),Q=y.useMemo(()=>Nw(Rw(Iw(Cb(Ox(xb())),b),b),O,b),[]);y.useEffect(()=>{if(!t)return;Pr.lastIndex=0;const $=t.match(Pr);!$||$.length>1||$[0].length!==t.length||R||_([{type:"originalValue",value:t}])},[t]);const ae=$=>{if(!Q||$!==O)return;const X=x.end(Q,[]);J.select(Q,X),te.focus(Q)};y.useEffect(()=>{const $=X=>{var L;const B=X,T=((L=B==null?void 0:B.detail)==null?void 0:L.id)||null;T&&ae(T)};return window.addEventListener("focusEditor",$),()=>{window.removeEventListener("focusEditor",$)}},[]),y.useEffect(()=>{if(Q.children.length>0&&!A){if(_([{type:"hasLoaded",value:!0}]),!s)return;ae(O)}},[Q.children.length,j]),y.useEffect(()=>{k&&(async()=>{let X=En(k);if(X.includes("<")){Nr.prototype.escape=T=>T;const B=new Nr;B.addRule("br",{filter:["br"],replacement:T=>T+`
162
162
 
163
- `}),ee=B.turndown(ee)}o&&o.mentions&&(ee=await Qc({text:ee,template:`[${zs}{{name}}]({{id}})`,mentions:o.mentions,listMembers:m||(()=>Promise.resolve([]))})),fw(ee,B=>{_([{type:"initialValue",value:B},{type:"editorKey",value:k.toString()}]),setTimeout(()=>{_([{type:"stringValue",value:Dc(Q)}])},150)})})()},[k]),y.useEffect(()=>{t!==""||!Q||ps(k,t)&&!R||(x.withoutNormalizing(Q,()=>{J.delete(Q,{at:{anchor:x.start(Q,[]),focus:x.end(Q,[])}}),J.deselect(Q),Q.children.length!==0&&J.unwrapNodes(Q,{at:[0]}),J.insertNodes(Q,v,{at:[0]})}),_([{type:"initialValue",value:v},{type:"lastAnchor",value:null}]))},[t]);const D=$c(()=>{gw({editor:Q,isShowing:E.show,numberOfUsers:E.numberOfUsers,listMembers:m,dispatch:_})},100);return j?c.jsx("div",{id:O,className:"rich-text-editor",children:c.jsxs(an.Provider,{value:{...F,id:O,isInOverlay:h,setFocus:S,dispatch:_,onMention:f,reportError:b},children:[c.jsxs(Sx,{editor:Q,initialValue:j,onChange:$=>{if(Q.operations.some(B=>B.type!=="set_selection")){const B=bw($);g(B),_([{type:"stringValue",value:Dc(Q)}]),R||_([{type:"hasInteracted",value:!0}]),D(),d&&console.log({serialized:B,json:$})}},...l,children:[c.jsx(Cx,{className:"input",renderElement:V,renderLeaf:H,placeholder:n||u.formatMessage({id:"richTextEditor_placeholder"}),autoFocus:s,tabIndex:0,onKeyDown:$=>{if($.key==="Enter"){E.show&&($.preventDefault(),$.stopPropagation(),rh(Q,E,_,O));const{selection:ee}=Q;if(ee){const B=Z.isCollapsed(ee),[T,L]=x.node(Q,ee,{depth:1});let I=T,W=I.type;const U=I.children[0];if(U&&[Y.ol,Y.ul].includes(U.type)&&(I=U,W=U.type),I&&de.isElement(I)&&W!==Y.paragraph){if(W===Y.blockquote&&!$.shiftKey){$.stopPropagation(),$.preventDefault(),J.insertNodes(Q,v);return}if(B){const[ne,re]=x.parent(Q,ee,{edge:"end"}),X=ne.type;if([Y.ul,Y.ol].includes(W))if($.stopPropagation(),$.preventDefault(),X===Y.li&&z==="Enter"){ne.children.length===1&&"text"in ne.children[0]&&ne.children[0].text===""&&J.removeNodes(Q,{at:re}),J.insertNodes(Q,v,{at:N.next(L)}),J.select(Q,x.end(Q,N.next(L)));return}else{const[pe,me]=hw(Q,Y.li),_e={type:Y.li,children:[{text:""}]};J.insertNodes(Q,_e,{at:N.next(me)}),J.select(Q,x.end(Q,N.next(me)))}}}}}else if($.key==="Escape"){if(E.show){$.preventDefault(),$.stopPropagation(),_([{type:"mentionPopover",value:{...E,show:!1}}]);return}}else if(["ArrowUp","ArrowDown"].includes($.key)&&E.show){$.preventDefault(),$.stopPropagation();const{selectedUser:ee,possibleUsers:B}=E;let T=$.key==="ArrowUp"?ee-1:ee+1;T<0&&(T=B.length-1),T>=B.length+1&&(T=0),_([{type:"mentionPopover",value:{...E,selectedUser:T}}])}_([{type:"lastKey",value:$.key}]),pw($,Q,_,b)},onBlur:()=>{Q.selection&&_([{type:"lastAnchor",value:Q.selection.anchor}])},onFocus:()=>{if(P){if(!N.isPath(P.path)||!ue.has(Q,P.path))return;const $=ue.get(Q,P.path);let ee=0;if(fe.isText($)?ee=$.text.length:$.children&&(ee=$.children.length),P.offset>ee)return;try{J.select(Q,{anchor:P,focus:P})}catch(B){const T=B.message;b(`Error focusing editor: ${T}`)}}}}),c.jsx(Aw,{}),m?c.jsx(yw,{onFallbackClick:p}):null]},w),c.jsx(fo,{id:`character-limit-${e}`,limit:r,valueLength:ai(q)})]})}):c.jsx(c.Fragment,{})};const $w=({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=d=>{i||(l(d),a(d))};return c.jsxs("div",{className:K("toggle",s),onClick:d=>{d.preventDefault(),d.stopPropagation(),u(o===n[0].value?n[1].value:n[0].value)},children:[c.jsx("p",{children:t}),c.jsx("ul",{className:K("toggle-options",{disabled:i,on:o===n[1].value}),children:n.map(d=>{const h=`${e}-${d.value}`;return c.jsxs("li",{className:"hidden",children:[c.jsx("input",{type:"radio",id:h,name:e,value:d.value,checked:o===d.value,onChange:()=>u(d.value),disabled:i}),c.jsx("label",{htmlFor:h,children:d.label})]},h)})})]})};function fh({className:e="",userId:t,userName:n,src:r,uploadImage:a,button:i,callback:s}){const o=ie.useIntl(),l="profileImageChange_",[u,d]=y.useState(r),[h,m]=y.useState(!1),[p,g]=y.useState(!1),f=y.useRef(null),b=async _=>{m(!0),g(!1);try{const w=_.target.files&&_.target.files[0];if(!w||!t)throw m(!1),new Error("Image file or userID is missing");const k=await a({fileObject:w,userId:t}),j={thumbnail:k.thumbnailURL,full:k.originalURL};d(j),s(j)}catch{g(!0)}finally{m(!1)}m(!1)},{upload:v=o.formatMessage({id:`${l}cta_upload`}),change:C=o.formatMessage({id:`${l}cta_change`}),uploading:F=o.formatMessage({id:`${l}cta_uploading`})}=(i==null?void 0:i.text)||{};return c.jsxs("div",{className:K("profile-image-change-figure",e),children:[c.jsx(gn,{className:"profile-image-change-picture",name:n,src:u==null?void 0:u.thumbnail,showInitials:!1,alt:"","data-testid":"profile-picture"}),p&&c.jsx("p",{className:"error text-small",children:o.formatMessage({id:`${l}error`})}),c.jsx("input",{id:"file",type:"file",accept:"image/*",ref:f,onChange:b,hidden:!0,"data-testid":"file-input"}),c.jsx(Fe,{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?F:u?C:v})]})}const hh=({gtm:e,functions:{onSuccess:t=async()=>{},onFailure:n=()=>{}}})=>{const{context:r="FooterContactUsForm",event:a="contact-form-submit-click"}=e||{};return c.jsx(nn,{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 mh=({title:e,label:t,ctaMessage:n,titleColor:r,labelColor:a,backgroundColor:i,onClose:s,reportError:o,sendInvites:l,initialFormStatus:u="NOT_SUBMITTED"})=>{const[d,h]=y.useState([]),[m,p]=y.useState(!0),[g,f]=y.useState(u),{formatMessage:b}=ie.useIntl(),v=async _=>{_.preventDefault();try{await l(d),h([]),f("SUCCESS")}catch(w){f("ERROR"),o(w)}},C=_=>{_.preventDefault(),f("NOT_SUBMITTED"),p(!0),h([])},F=_=>{_.preventDefault(),s(),f("CLOSED")};return g==="CLOSED"?null:g==="ERROR"||g==="SUCCESS"?c.jsxs("div",{className:"invite-form-wrapper",children:[c.jsx("div",{className:"content centred",children:g==="SUCCESS"?c.jsx("h2",{className:"success-title",children:b({id:"inviteForm_success"})}):c.jsxs("h2",{className:"error-title",children:[" ",b({id:"inviteForm_error"})]})}),c.jsx(Ht,{}),c.jsx("div",{className:"footer",children:g==="SUCCESS"?c.jsxs(c.Fragment,{children:[c.jsx(Fe,{variant:"secondary",onClick:C,children:b({id:"inviteForm_ctaSendMoreInvites"})}),c.jsx(Fe,{onClick:F,children:b({id:"inviteForm_ctaDone"})})]}):c.jsx(Fe,{onClick:C,children:b({id:"inviteForm_ctaTryAgain"})})})]}):c.jsx("div",{className:"invite-form-wrapper",children:c.jsxs("form",{style:{backgroundColor:i},onSubmit:v,className:K("invite-form gtm-trackable"),children:[c.jsxs("fieldset",{className:"content",children:[c.jsx("h2",{className:"title",style:{color:r},children:e}),c.jsx("label",{htmlFor:"email-input",className:"label",style:{color:a},children:t}),c.jsx(Jh.ReactMultiEmail,{id:"email-input",inputClassName:"email-input input",placeholder:b({id:"inviteForm_email_placeholder"}),emails:d,onChange:_=>{h(_),p(!_.length)},autoFocus:!1,getLabel:(_,w,k)=>c.jsxs("div",{className:"email text-medium",children:[c.jsx("div",{"data-tag-item":!0,children:_}),c.jsx(Fe,{variant:"tertiary",size:"small",icon:{icon:"close"},onClick:()=>{k(w),p(!d.length)},className:"remove-email-button",screenreaderText:b({id:"overlay_close"})})]},w)})]}),c.jsx(Ht,{}),c.jsx("fieldset",{className:"footer",children:c.jsx(Fe,{className:"sendEmailsButton",disabled:m,children:n})})]})})},Ta=e=>e.map(t=>({condition:t})),kt={FORM_ID:"manage-account-password-change",NEW_PASSWORD:"newPassword",CONFIRMED_PASSWORD:"confirmedPassword",CURRENT_PASSWORD:"oldPassword"},Lw=({functions:e,...t})=>{const{formatMessage:n}=ie.useIntl(),[r,a]=y.useState(null),[i,s]=y.useState(!1),[o,l]=y.useState({isMoreThanEightCharacters:!1,includesNumberAndSymbol:!1,includesLowerAndUppercase:!1}),u=p=>p[kt.NEW_PASSWORD]!==p[kt.CONFIRMED_PASSWORD]?n({id:"passwordRules_unmatched_text"}):null,d=p=>!ys(p[kt.NEW_PASSWORD]).isValid,h=[{"data-testid":kt.NEW_PASSWORD,id:kt.NEW_PASSWORD,type:"password",autoComplete:"new-password",placeholder:"",label:n({id:"passwordRules_newPassword_label"}),validation:Ta(["required",d]),functions:{onChange:p=>l(ys(p).matchingRules),onFocus:()=>s(!0),onBlur:()=>s(!1)}},{"data-testid":kt.CONFIRMED_PASSWORD,id:kt.CONFIRMED_PASSWORD,type:"password",autoComplete:"new-password",placeholder:"",label:n({id:"passwordRules_confirmPassword_label"}),validation:Ta(["required",u])}];t.isPasswordChange&&h.unshift({"data-testid":kt.CURRENT_PASSWORD,id:kt.CURRENT_PASSWORD,type:"password",autoComplete:"current-password",placeholder:"",label:n({id:"passwordRules_currentPassword_label"}),validation:Ta(["required"])}),i&&h.push({component:Ld,props:{matchingRules:o}});const m={id:kt.FORM_ID,fields:h,functions:{...e,onSuccess:async p=>(e.createPassword(p),e.onSuccess&&e.onSuccess(p)),onCatch:p=>a(p==null?void 0:p.statusCode),onFailure:(p,g)=>{(g.includes(kt.NEW_PASSWORD)||g.includes(kt.CONFIRMED_PASSWORD))&&s(!0)}},meta:{shouldReset:!0},...t};return c.jsxs(c.Fragment,{children:[c.jsx(nn,{...m}),r&&c.jsx(pn,{variant:"error",text:r})]})};const ph=({hooks:e,functions:t,meta:n={},gtm:r})=>{var _,w;const a=ie.useIntl(),i="profileForm_",s=y.useContext(st),[o,l]=y.useState(s.image),[u,d]=y.useState(!1),{uploadImage:h,onSuccess:m=async k=>{},onCancel:p=()=>{},onFailure:g=()=>{}}=t,{buildLocation:f,isValidPlace:b,predictPlaces:v}=e.useMaps(),{context:C="ProfileForm",event:F="profile-form-submit-click"}=r||{};return c.jsx(nn,{id:"profile-details-form",fields:[{component:fh,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:((_=s.location)==null?void 0:_.en)||((w=s.location)==null?void 0:w.country),validation:[{condition:"required"},{condition:({location:k})=>k&&!u?!1:!b(k),error:a.formatMessage({id:`${i}location_error`})}],functions:{onChange:()=>{u||d(!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:Ht}],meta:{shouldShowCancelButton:!0,shouldReset:!1,shouldHide:!1,showRequiredLabels:!1,...n},intlPath:i,gtm:{context:C,event:F},functions:{onSuccess:async k=>{try{const j={...k,image:o||null,location:u?await f(k==null?void 0:k.location):s.location};s.updateDetails&&s.updateDetails(q=>({...q,...j})),await m(j)}catch{g()}},onCancel:p,onFailure:g},button:{size:"large",text:{default:a.formatMessage({id:`${i}cta`}),submitting:a.formatMessage({id:`${i}cta_submitting`}),submitted:a.formatMessage({id:`${i}cta_submitted`})}}})};const gh=({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=ie.useIntl(),u=y.useRef(null);er(()=>{!n||o||!s||u.current&&u.current.focus()},[s]);const d=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 c.jsx("form",{onSubmit:d,className:K("search-form gtm-trackable",t),role:"search","data-gtm-event-context":a,"data-gtm-event-type":i,children:c.jsx("fieldset",{id:`${e}-form`,hidden:n?!s:!1,children:c.jsxs("p",{children:[c.jsx(Ie,{element:"label",htmlFor:e,children:l.formatMessage({id:"search_label"})}),c.jsx("input",{ref:u,type:"search",id:e,name:e,defaultValue:r,placeholder:l.formatMessage({id:"search_placeholder"}),onKeyDown:h=>{h.key==="Enter"&&d(h)}}),c.jsx("button",{className:"clear",onClick:h=>{h.preventDefault(),h.stopPropagation(),u.current&&u.current.value&&(u.current.value="")},children:c.jsx(Ie,{children:l.formatMessage({id:"search_clear"})})}),c.jsx("button",{className:"search",onClick:d,children:c.jsx(Ie,{children:l.formatMessage({id:"search_cta"})})})]})})})},kc=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 d="";return o?d=l?"gov":"nonGov":u.registration?u.engagement&&!u.user?d=u.auth?"verify":"pending":d="exists":u.auth&&(d="exists"),n([{type:"shouldDisableButton",value:!1},{type:"shouldManuallyApprove",value:!l},{type:"emailDetails",value:{email:a,boxType:d,isEnd2End:/testing\+[0-9]+@apolitical.co$/.test(a)}},{type:"validFields.email",value:!0}])},zw=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"]}},qw=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=zw(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}])},Ww=({shouldShow:e,placeholders:t,labels:n,functions:{validateEmail:r,resendVerificationCode:a},refs:i,state:s,dispatch:o,dataToSubmit:l,intl:u})=>{const{emailDetails:d}=s,h=(p,g)=>{p.current&&s.validFields[g]!==p.current.validity.valid&&o([{type:`validFields.${g}`,value:p.current.validity.valid}])},m=[{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:()=>{kc({ref:i.email,validateEmail:r,dispatch:o})},onChange:(p,g)=>{o([{type:"shouldDisableButton",value:!0}]),g&&g({type:"updateValue",payload:{key:"terms",value:!1}})},onFocus:()=>o([{type:"loadRecaptcha",value:!0}])},autoComplete:"email",validation:[{condition:"required"},{condition:"valid-email"}],"data-testid":"signup-email-input"},{component:Md,props:{email:d.email,type:d.boxType,resendVerificationCode:a}}];return s.shouldManuallyApprove&&(m.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&&m.push({id:"url",type:"text",label:u.formatMessage({id:"signup_url"},{small:p=>c.jsx("small",{children:p})}),placeholder:u.formatMessage({id:"signup_url_placeholder"}),validation:[{condition:"valid-url"}],"data-testid":"signup-url-input"})),e.expectation&&m.push({id:"expectation",className:"expectation",type:"text",label:(n==null?void 0:n.expectation)||u.formatMessage({id:"signup_expectation"},{small:p=>c.jsx("small",{className:"notes text-small",children:p})}),placeholder:(t==null?void 0:t.expectation)||u.formatMessage({id:"signup_expectation_placeholder"}),"data-testid":"signup-events-question"}),m.push({id:"terms",className:"text-small",type:"checkbox",inputRef:i.tc,label:u.formatMessage({id:"signup_terms"},{terms:p=>c.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:p}),privacy:p=>c.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:p})}),shownValue:"accepted",functions:{onChange:p=>{if(!p)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"&&kc({ref:i.email,validateEmail:r,dispatch:o}))}),g.length&&o(g)}},validation:[{condition:"required"}],"data-testid":"signup-terms-checkbox"}),m};const Uw=({className:e=""})=>c.jsxs("div",{className:K("success-message",e),"data-testid":"success-message",children:[c.jsx("p",{className:"success-title",children:c.jsx(ie.FormattedMessage,{id:"signup_success_title"})}),c.jsx(ie.FormattedMessage,{id:"signup_success_text",values:{p:t=>c.jsx("p",{children:t})}})]});const Hw={validFields:{name:!1,email:!1,jobTitle:!1,organisation:!1},emailDetails:{email:"",boxType:"",isEnd2End:!1},shouldManuallyApprove:!1,shouldDisableButton:!0,loadRecaptcha:!1,showSuccessMessage:!1,showError:!1},Vw=({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=ie.useIntl(),{title:u=!0,expectation:d=!1,url:h=!0,logInButton:m=!0,successMessage:p=!0}=a,g={title:u,expectation:d,url:h,logInButton:m,successMessage:p},[f,b]=y.useReducer(Hr,Hw),{validFields:v,emailDetails:C,shouldManuallyApprove:F,shouldDisableButton:_,showSuccessMessage:w,showError:k}=f,[j,q]=Gs.useCookies(["signup-this-session","functional-cookie-consent"]),P={form:y.createRef(),name:y.createRef(),email:y.createRef(),jobTitle:y.createRef(),organisation:y.createRef(),tc:y.createRef(),hiddenValidation:y.createRef()};y.useEffect(()=>{F===!0&&P.jobTitle.current&&P.jobTitle.current.focus()},[F]),y.useEffect(()=>{j["signup-this-session"]&&b([{type:"showSuccessMessage",value:!0}])},[j]),y.useEffect(()=>{w&&j["functional-cookie-consent"]&&q("signup-this-session","true",{path:"/",maxAge:3600})},[w]);const z=y.useMemo(()=>Ww({placeholders:n,labels:t,shouldShow:g,functions:r,refs:P,state:f,dispatch:b,dataToSubmit:s,intl:l}),[s,r,l,P,g,f]),R=_?!0:F?!Object.values(v).every(A=>A===!0):!v.name||!v.email||["exists","pending","verify"].includes(C.boxType);return g.successMessage&&w?c.jsx(Uw,{className:e}):c.jsxs("fieldset",{className:K("signup-form-fieldset",e),"data-testid":"signup-form",children:[g.title&&c.jsx("p",{className:"signup-title",children:c.jsx(ie.FormattedMessage,{id:"signup_title"})}),k&&c.jsx(pn,{variant:"error",text:l.formatMessage({id:"signup_error"})}),c.jsx(nn,{className:"signup-form",formRef:P.form,id:"sign-up-form",fields:z,intlPath:"signup",button:{variant:"primary",size:"medium",text:i||l.formatMessage({id:"signup_button_join"}),disabled:R?{isClickable:!0}:!1,styling:{fullWidth:!0},"data-testid":"signup-button"},secondaryActionButton:{className:"login-button",styling:{fullWidth:!0},variant:"tertiary",size:"medium",href:"/api/next-ui/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 qw({refs:P,dataToSubmit:s,createAccount:r.createAccount,onSuccess:r.onSuccess,dispatch:b,state:f})},onCatch:A=>{r.handleError(A),b([{type:"showSuccessMessage",value:!1},{type:"showError",value:!0}])}}}),c.jsx("button",{className:"validation-button",ref:P.hiddenValidation})]})};const yn=({children:e,className:t="",styling:n={},...r})=>{const{background:a="default"}=n;return c.jsx("section",{className:K("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})}),c.jsx(yn,{className:K("download-section",n),children:c.jsxs("div",{className:"content-default",children:[y.createElement(typeof e=="string"?"h2":e.element,{className:"text"},typeof e=="string"?e:e.text),c.jsx(or,{buttons:r})]})})};const Zs="editSection_";function vh({href:e,setShowModal:t}){typeof e!="string"&&t(!0)}const Zw=({icon:e,description:t,ctaMessage:n,href:r,showEditButton:a,setShowModal:i})=>{const{formatMessage:s}=ie.useIntl();return c.jsxs(Mt,{variant:"muted",icon:e,children:[c.jsx("p",{children:t||s({id:`${Zs}placeholder_description`})}),a&&c.jsx("p",{children:c.jsx(Fe,{href:r,variant:"secondary",size:"small",onClick:()=>vh({href:r,setShowModal:i}),children:n||s({id:`${Zs}placeholder_cta`})})})]})},Yw=({children:e,className:t="",formProps:n,formComponent:r,href:a,title:i,showTitle:s=!0,modalTitle:o,placeholder:l,showDivider:u=!0})=>{const{formatMessage:d}=ie.useIntl(),[h,m]=y.useState(!1),p=()=>m(!1),g=!!n||!!r,f=typeof a=="string"||g;let b;return r&&(b=y.cloneElement(r,{functions:{...r.props.functions,onSuccess:async v=>{try{r.props.functions.onSuccess&&await r.props.functions.onSuccess(v)}finally{p()}},onCancel:()=>{r.props.functions.onCancel&&r.props.functions.onCancel(),p()}}})),c.jsxs("section",{className:K("edit-section",t),children:[g&&c.jsx(tn,{title:o||`Edit ${i}`,isOpen:h,showDivider:!1,showIcon:!1,functions:{onClose:p},className:K("edit-section-modal"),children:b||(n?c.jsx(nn,{...n,fields:n.fields,meta:{...n==null?void 0:n.meta,shouldShowCancelButton:!0,shouldReset:!1,showSuccessMessage:!0},functions:{...n==null?void 0:n.functions,onSuccess:async v=>{var C,F;(C=n==null?void 0:n.functions)!=null&&C.onSuccess&&await((F=n==null?void 0:n.functions)==null?void 0:F.onSuccess(v)),m(!1)},onCancel:p}}):c.jsx(c.Fragment,{}))}),c.jsxs("div",{className:K("edit-section-header",{"no-title":!s}),children:[s&&c.jsx("h2",{className:"edit-section-header-title",children:i}),f&&c.jsx(Fe,{href:a,variant:"tertiary",size:"small",icon:"pencil",onClick:()=>vh({href:a,setShowModal:m}),children:d({id:`${Zs}edit`})})]}),e||c.jsx(Zw,{...l,href:a,setShowModal:m,showEditButton:f}),u&&c.jsx(Ht,{})]})};const Gw=({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 c.jsxs("div",{className:K("logos",a,`align-${l}`,{[u]:u!=="block","wrap-logos":o}),children:[e&&y.createElement(s.element,{className:K("title",s.className)},s.text),t&&c.jsx("p",{children:t}),c.jsx("ul",{className:K({"two-col":i===2||i===4,"three-col":i===5||i<=10&&i%3===0}),children:n.map(({logo:d,nameOfBusiness:h,link:m=!1,description:p=!1},g)=>{if(!d||!d.url)return null;const f=c.jsx("img",{src:d.url,width:d.width||"auto",height:d.height||"auto",alt:h});return c.jsxs("li",{children:[c.jsx("p",{className:"img-wrapper",children:m?c.jsx("a",{href:m,target:"_blank",rel:"nofollow noreferrer noopener",children:f}):f}),p&&c.jsx("small",{children:p})]},window.btoa(`${d.url}_${g}`))})})]})};let ns;const rs="contactFooter_",Qw=({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(ns),ns=setTimeout(()=>{o(),s(!1)},500))};return y.useEffect(()=>(o(),window.addEventListener("resize",l),()=>{clearTimeout(ns),window.removeEventListener("resize",l)}),[]),c.jsx(yn,{id:"contactForm",className:"contact-footer",children:c.jsxs("div",{className:"inner-wrapper",children:[c.jsx("h2",{children:c.jsx(ie.FormattedMessage,{id:`${rs}title`})}),c.jsxs("div",{className:"content-wrapper",ref:n,"data-testid":"content-wrapper",style:i?{}:{minHeight:r},children:[c.jsxs("aside",{children:[c.jsx("p",{children:c.jsx(ie.FormattedMessage,{id:`${rs}text`})}),c.jsx(mn,{className:"mailto-link",href:"mailto:hello@apolitical.co",children:c.jsx(ie.FormattedMessage,{id:`${rs}email`})})]}),c.jsx(hh,{functions:{onSuccess:e,onFailure:t},gtm:{context:"FooterContactUsForm",event:"contact-form-submit-click"}})]})]})})},Jw=({activeLink:e,profile:t,...n})=>c.jsx(yn,{children:c.jsx(Od,{layout:"1-3",children:c.jsxs(c.Fragment,{children:[c.jsx(jd,{activeLink:e,profile:t}),c.jsx(id,{...n})]})})});const as="cookieBanner_",is=["apol-cookie-banner","apolitical-performance-cookie-consent","functional-cookie-consent"],ss=new Date(Date.now()+12*30*24*60*60*1e3),bh=()=>{const e=ie.useIntl(),[t,n,r]=Gs.useCookies(is),[a,i]=y.useState(!t["apol-cookie-banner"]),s=()=>{is.forEach(d=>{n(d,!0,{path:"/",expires:ss,domain:d==="apolitical-performance-cookie-consent"?".apolitical.co":void 0})}),i(!1),window.location.reload()},o=()=>{n("apol-cookie-banner",!0,{path:"/",expires:ss}),is.forEach(d=>{if(d==="apol-cookie-banner"){n(d,!0,{path:"/",expires:ss});return}r(d)}),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(d=>{u.push({variant:d.href?"tertiary":"primary",href:d.href,onClick:d.onClick,className:"gtm-trackable","data-gtm-event-context":"cookie-banner","data-gtm-event-type":`cookie-${d.gtmType}-click`,children:e.formatMessage({id:`${as}buttons_${d.id}`})})}),c.jsxs("aside",{id:"cookie-banner",className:"text-medium",children:[c.jsx("h6",{children:e.formatMessage({id:`${as}title`})}),c.jsx("p",{children:e.formatMessage({id:`${as}text`})}),c.jsx(or,{buttons:u})]})},Yt={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:Un["data-protection"].default,gtmType:"email-dpo-link"},euDataProtection:{email:Un["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:Un.support,gtmType:"concierge-email-click"},business:{email:Un.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 Gn="footer_",Ha="SiteFooter",Fc=({group:e})=>{const t=Yt[e].order||[];let n=!1;return"text"in Yt[e]&&(n=Yt[e].text),c.jsxs(y.Fragment,{children:[c.jsx("p",{className:"pre-title",children:c.jsx(ie.FormattedMessage,{id:`${Gn}${e}`})}),Array.isArray(t)&&t.length>0&&c.jsx("ul",{className:"text-medium",children:t.map(r=>{if(["order","child","text"].includes(r))return null;const{href:a,gtmType:i}=Yt[e][r],s={};return["legal"].includes(e)&&(s.target="_blank",s.rel="noopener"),c.jsx("li",{children:c.jsx("a",{href:a,className:"gtm-trackable","data-gtm-event-context":Ha,"data-gtm-event-type":i,...s,children:c.jsx(ie.FormattedMessage,{id:`${Gn}${e}_${r}`})})},`${e}_${r}`)})}),typeof n!="boolean"&&"order"in n&&Array.isArray(n.order)&&c.jsx("dl",{className:"text-medium",children:n.order.map(r=>c.jsxs(y.Fragment,{children:[c.jsx("dt",{children:c.jsx(ie.FormattedMessage,{id:`${Gn}${e}_${r}`})}),c.jsxs("dd",{children:[typeof n!="boolean"&&n[r].address&&c.jsx("address",{children:c.jsx(ie.FormattedMessage,{id:`${Gn}${e}_${r}_address`,values:{br:c.jsx("br",{})}})}),typeof n!="boolean"&&n[r].email&&c.jsx("a",{href:`mailto:${n[r].email}`,className:"gtm-trackable","data-gtm-event-context":Ha,"data-gtm-event-type":n[r].gtmType,children:n[r].email})]})]},`dl-${e}-${r}`))})]},e)},$o=()=>c.jsx("div",{id:"footer",children:c.jsxs("div",{className:"wrapper",children:[c.jsx(Ja,{element:"hr"}),c.jsx(co,{variant:"inverted",version:"full",className:"gtm-trackable","data-gtm-event-context":Ha,"data-gtm-event-type":"logo-homepage-link"}),c.jsx("footer",{children:["platform","community","company","contact"].map(e=>c.jsxs("div",{className:"group",children:[c.jsx(Fc,{group:e}),Object.keys(Yt[e]).includes("child")&&c.jsx(Fc,{group:Yt[e].child})]},e))}),c.jsx("hr",{}),c.jsxs("div",{className:"sub-footer",children:[c.jsx("ul",{children:Array.isArray(Yt.social.order)&&Yt.social.order.map(e=>{const t=Yt.social[e];return c.jsx("li",{className:e,children:c.jsx("a",{href:t.href,target:"_blank",rel:"noopener noreferrer",className:"gtm-trackable","data-gtm-event-context":Ha,"data-gtm-event-type":"social-click",children:c.jsx("span",{className:"hidden",children:c.jsx(ie.FormattedMessage,{id:`${Gn}social_${e}`})})})},e)})}),c.jsx("small",{children:c.jsx(ie.FormattedMessage,{id:`${Gn}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===Dt.ACCOUNT&&t===!1&&n[Dt.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 Dt.SITE:o=document.querySelector("#header .menu-button"),o||(o=document.querySelector("#navigation .navigation-button"));break;case Dt.SEARCH:o=document.querySelector("#header .toggle-search-button");break;case Dt.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=Mc(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 Dt.SITE:if(n){const u=$e.findFirstChild(t.current.children,"className","has-submenu parent"),d=$e.findFirstChild(u.children,"id",Dt.SITE);s=$e.findFirstChild(d.children,"href")}else s=$e.findFirstChild(t.current.children,"href");break;case Dt.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)}}},Ur={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:"/api/next-ui/login"},signup:{href:"/signup?ref=header-banner",props:{variant:"primary"}}}},Va=({id:e,isLoggedIn:t=!1,isDesktopVersion:n=!1,menus:r={},callback:a=()=>{},doTrack:i=null})=>{const s=ie.useIntl(),o=Mc(Ur,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,d=e.includes("buttons.");let h=`header_${e.replaceAll(".","_")}`;o.hasVariantText&&(h+=`_logged${t?"In":"Out"}`);let m=!1;if(o.href){let F=o.gtmType||`${e}-click`;if(F.includes(".")){const _=F.split("."),w=_[_.length-2];F=`${w==="topics"?`${w}-`:""}${_[_.length-1]}`}m={href:o.href},u&&(m={...m,className:"gtm-trackable","data-gtm-event-type":F,"data-gtm-event-context":"HeaderButtons"}),d&&(m={...m,variant:"secondary",size:{mobile:"small",881:"large"},...o.props||{}})}const p=o.order&&o.order[0]&&o[o.order[0]],g=p&&o[o.order[0]].order,f=m&&window.location.pathname===o.href;let b={},v={},C={};if(f&&(b={...b,"aria-current":"page"}),p){const F=o.menuId||e,_={onClick:w=>$e.events.onClick(w,{id:F,callback:a,isOpen:r[F]}),onFocus:()=>$e.events.onFocus({id:F}),onBlur:()=>$e.events.onBlur({id:F,callback:a}),onMouseLeave:()=>$e.events.onBlur({id:F,callback:a}),onMouseEnter:()=>$e.events.onMouseEnter({id:F,callback:a})};v={..._,id:F===Dt.SITE?Dt.SITE:Dt.ACCOUNT},n&&(g&&(C={..._,className:"navigation-button",onKeyPress:w=>{w.key==="Enter"&&$e.events.onClick(w,{id:F,callback:a,isOpen:r[F]})},"aria-haspopup":!0,"aria-expanded":r[F],"aria-controls":F}),v={...v,hidden:F in r?!r[F]:!0}),g||(v={...v})}return c.jsxs("li",{className:K({[o.className]:o.className,"has-submenu":p,parent:g,active:f}),...b,children:[m?y.createElement(d?Fe:"a",m,s.formatMessage({id:h})):n&&o.order&&g?c.jsxs("button",{...C,children:[s.formatMessage({id:h}),c.jsx(Ie,{children:s.formatMessage({id:`header_menu_${r[Dt.SITE]?"hide":"show"}`})})]}):s.formatMessage({id:h}),o.order&&c.jsx("ul",{...v,children:o.order.map(F=>{if(!o[F])return null;const _={isLoggedIn:t,isDesktopVersion:n,menus:r,callback:a,doTrack:l?u:null};return o[F].order?c.jsxs("li",{className:K({[o[F].className]:o[F].className}),children:[s.formatMessage({id:`${h}_${F}`}),c.jsx("ul",{children:o[F].order.map(w=>c.jsx(Va,{id:`${e}.${F}.${w}`,..._},w))})]},F):c.jsx(Va,{id:`${e}.${F}`,..._},F)})})]},e)};const Xw={height:67,height_desktop:83};var Dt=(e=>(e.NAVIGATION="navigation",e.SEARCH="search",e.ACCOUNT="account-navigation",e.SITE="site-navigation",e))(Dt||{});const Lo=({showNavigation:e=!0})=>{const t=ie.useIntl(),n=y.useContext(st),r=Pn(!0,!0),a=n&&typeof n.id=="string",i=y.useMemo(()=>$e.getIsDesktopVersion(a,r),[a,r]),[s,o]=y.useReducer(Hr,{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:d}=s,h=y.useRef(s);y.useEffect(()=>{h.current=s},[s]),zc({scrollPosition:Xw[`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 m=(v,C,F=!1)=>{$e.handleMenus({id:v,value:C,menus:h.current.menus,dispatch:o,forceHandle:F})},p=y.useRef(null),g=v=>{v.key==="Escape"&&["site-navigation","search","account-navigation"].forEach(C=>{h.current.menus[C]&&m(C,!1,!0)})};y.useEffect(()=>{var v;return(v=document.getElementById("header"))==null||v.addEventListener("keydown",g),()=>{var C;(C=document.getElementById("header"))==null||C.removeEventListener("keydown",g)}},[]),er(()=>{u["site-navigation"]&&$e.autoFocus({menu:"site-navigation",navigationRef:p,isDesktopVersion:i.navigation,focusElements:d,dispatch:o})},[u["site-navigation"]]),er(()=>{u["account-navigation"]&&$e.autoFocus({menu:"account-navigation",navigationRef:p,isDesktopVersion:i.navigation,focusElements:d,dispatch:o})},[u["account-navigation"]]);const f=c.jsxs(c.Fragment,{children:[!i.search&&c.jsx("button",{className:"search toggle-search-button",onClick:v=>{v.preventDefault(),v.stopPropagation(),m("search",!u.search)},"aria-haspopup":"true","aria-expanded":u.search,"aria-controls":"search-form",children:c.jsx(Ie,{children:t.formatMessage({id:`header_search_${u.search?"hide":"show"}`})})}),c.jsx(gh,{id:"global-search",handleToggle:{searchIsOpen:u.search,isDesktopVersion:i.search},gtmContext:"search-bar-header",gtmEvent:"form-submission"})]}),b=c.jsxs(c.Fragment,{children:[!i.navigation&&c.jsx("button",{className:"menu-button gtm-trackable",onClick:v=>{v.preventDefault(),v.stopPropagation(),m("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:c.jsx(Ie,{children:t.formatMessage({id:`header_menu_${u["site-navigation"]?"hide":"show"}`})})}),c.jsx("ul",{ref:p,id:"navigation",hidden:i.navigation||u["account-navigation"]?!1:!u["site-navigation"],"data-showing":!i.navigation&&u["account-navigation"]?"account":"default",children:Ur.order.map(v=>c.jsx(Va,{id:v,isLoggedIn:a,isDesktopVersion:i.navigation,menus:{"site-navigation":u["site-navigation"],"account-navigation":u["account-navigation"]},callback:m},v))})]});return n&&n.isLoading?null:c.jsxs(c.Fragment,{children:[c.jsxs("nav",{id:"header",className:K({"logged-in":a,"logged-out":!a,visible:l}),children:[c.jsx(Ie,{element:"a",href:"#content-of-page",children:t.formatMessage({id:"header_skip"})}),c.jsx(co,{variant:"monochrome"}),e&&c.jsxs(c.Fragment,{children:[i.navigation?c.jsxs(c.Fragment,{children:[b,f]}):c.jsxs(c.Fragment,{children:[f,b]}),a?c.jsxs("button",{className:"account-button",onClick:v=>$e.events.onClick(v,{id:"account-navigation",callback:m,isOpen:u["account-navigation"]}),onMouseEnter:()=>$e.events.onMouseEnter({id:"account-navigation",callback:m}),onMouseLeave:()=>$e.events.onBlur({id:"account-navigation",callback:m}),"aria-haspopup":"true","aria-expanded":u["account-navigation"],"aria-controls":"account-navigation",children:[c.jsx(Ie,{children:t.formatMessage({id:`header_account_${u["account-navigation"]?"hide":"show"}`})}),c.jsx(gn,{name:n&&n.name||"",src:n&&n.image&&n.image.thumbnail||""})]}):c.jsx("ul",{className:"sign-in-buttons",children:Ur.buttons.order.map(v=>c.jsx(Va,{id:`buttons.${v}`},v))})]})]}),c.jsx("hr",{id:"content-of-page"}),c.jsx("div",{className:K("overlay",{open:u["site-navigation"]||u["account-navigation"]||!i.search&&u.search})})]})};const eE=()=>{const e=ie.useIntl();return c.jsxs(c.Fragment,{children:[c.jsx(Lo,{}),c.jsx("div",{id:"content",children:c.jsx(pn,{variant:"error",text:e.formatMessage({id:"pageLayout_error"})})}),c.jsx($o,{})]})},yh=({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:d="default",variant:h="default",circle:m="default",modal:p="default"}=i,g=Ic(),[f,b]=y.useState(""),v=k=>{const{detail:{message:j}}=k;b(j)};y.useEffect(()=>(window.scrollTo(0,0),document.addEventListener("ariaLive",v),()=>{document.removeEventListener("ariaLive",v)}),[g]);const C=Da(e,{locale:o}),F=Da(t,{locale:o}),_=Da(n,{locale:o}),w={};return d!=="default"&&(w[d]=!0),h!=="default"&&(w[h]=!0),m!=="default"&&(w[m]=!0),c.jsx(Xh.ErrorBoundary,{onError:r,fallback:c.jsx(eE,{}),children:c.jsxs(y.Suspense,{fallback:null,children:[c.jsxs("div",{id:"wrapper",className:K(s,w,{"has-footer":u}),children:[c.jsx(Lo,{showNavigation:l}),c.jsxs("main",{id:"content-wrapper",children:[F&&c.jsx("div",{className:K("additional-content prepended",{"large-modal":p==="large"}),children:F}),y.createElement(d==="bold"?so:"div",{id:"content",children:C,className:K({"large-modal":p==="large"})})]}),_&&c.jsx("div",{className:"additional-content appended",children:_}),u&&c.jsx($o,{}),c.jsx(bh,{})]}),f&&c.jsx(Ie,{"aria-live":"polite",showOnFocus:!1,"data-testid":"layout-aria-live",children:f})]})})},Bc={default:"tags_",headerTopics:"header_topics_topics_"},os={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"},tE={getTagDetails:e=>{if(e.includes("topic_")){if(e=os.topic[e.replace("topic_","")],e){const t=Ur.topics.topics[e].href;return t?{id:e,href:t,text:`${Bc.headerTopics}${e}`}:null}return null}return os[e]?(e=os[e],{id:e,text:`${Bc.default}${e}`}):null}};const nE=({tags:e=[],color:t="default",forceOneLine:n=!1,canHaveLinks:r=!0,className:a="",gtmType:i="tag-click",gtmContext:s="tags"})=>{const o=ie.useIntl();if(!e||e.length<1)return null;const l=[];return e.forEach(u=>{if(!u)return;const d=tE.getTagDetails(u);d&&l.push(d)}),l.length<1?null:c.jsx("ul",{className:K("tags text-small",t,a,{"one-line":n}),children:l.map(u=>{const d=o.formatMessage({id:u.text});return c.jsx("li",{children:u.href&&r?c.jsx("a",{href:u.href,className:"gtm-trackable","data-gtm-event-type":i,"data-gtm-event-context":s,children:d}):d},u.id)})})};const xh=25,Dh=({members:{data:e=[],total:t=e.length},communitySlug:n,isMember:r=!1,hasNextPage:a=!1,loadNextPage:i=()=>{},profile:s,gtmContext:o="member",gtmType:l="member-click",showHeader:u=!0,showPlaceholders:d=!1,className:h=""})=>{const m=ie.useIntl(),p="membersList",g=y.useContext(st),[f,b]=y.useState(!1);return e.length===0&&!d?null:c.jsxs("div",{className:K("members-list",h),children:[u?c.jsxs("h1",{children:[m.formatMessage({id:p}),c.jsx("span",{className:"count",children:t})]}):c.jsx(c.Fragment,{}),c.jsxs("ul",{children:[r?c.jsxs("li",{children:[c.jsx(Jt,{member:g,gtmContext:o,gtmType:l,badges:{showBadges:!0,scopes:[{scope:it.COMMUNITIES,area:n||""},{scope:it.PLATFORM,area:"all"}]}}),c.jsx(mn,{href:"/profiles/me",className:"text-small",onClick:v=>{v==null||v.preventDefault(),v==null||v.stopPropagation(),b(!0)},children:m.formatMessage({id:`${p}_profile`})})]}):c.jsx(c.Fragment,{}),e.map((v,C)=>c.jsxs("li",{children:[c.jsx(Jt,{member:v,gtmContext:o,gtmType:l,badges:{showBadges:!0,scopes:[{scope:it.COMMUNITIES,area:n||""},{scope:it.PLATFORM,area:"all"}]}}),v.isAdmin&&c.jsx(Qt,{children:m.formatMessage({id:`${p}_admin`})})]},C)),d&&e.length===0&&t>0?[...new Array(Math.min(t,xh))].map((v,C)=>c.jsx("li",{children:c.jsx(ni,{layout:"member"})},C)):c.jsx(c.Fragment,{})]}),a&&c.jsx(Vr,{hasNextPage:a,loadNextPage:i,icon:{icon:"arrow-down",position:"right"},gtmContext:o}),s?c.jsx(hi,{form:s,showModal:f,content:{title:m.formatMessage({id:`${p}_modal_title`})},functions:{onClose:()=>{b(!1)}}}):c.jsx(c.Fragment,{})]})},Ys=e=>{const t={};return Object.keys(e).forEach(n=>n.includes("Id")?t[n]=e[n]:t[`${n}Slug`]=e[n]),t},dr=e=>{var t,n,r,a,i,s;return e&&!e.error?{id:e==null?void 0:e.id,name:(t=e==null?void 0:e.data)==null?void 0:t.name,organization:(n=e==null?void 0:e.data)==null?void 0:n.organization,jobTitle:(r=e==null?void 0:e.data)==null?void 0:r.jobTitle,location:(a=e==null?void 0:e.data)==null?void 0:a.location,image:{thumbnail:((i=e==null?void 0:e.data)==null?void 0:i.thumbnail)||void 0},badges:(s=e==null?void 0:e.data)==null?void 0:s.badges}:"deleted"};const Ka=({icon:e,className:t="",...n})=>c.jsx(Fe,{className:K("discussion-button",t),variant:"tertiary",icon:e,...n}),rE={showForm:!1},fi=y.createContext(rE),Ch=({children:e})=>{const[t,n]=y.useState({showForm:!1});return c.jsx(fi.Provider,{value:{...t,updateConversation:n},children:e})},aE=({intlPath:e,showGuidelines:t,type:n,gtmContext:r})=>{const a=ie.useIntl();return t?c.jsx("small",{children:jt(a.formatMessage,`${e}explainer`,n,"action",{a:i=>c.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})})}):c.jsx(c.Fragment,{})},iE=({formID:e,intlPath:t,showLabel:n,type:r})=>{const a=ie.useIntl();return n?c.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`})}):c.jsx(Ie,{element:"label",showOnFocus:!1,htmlFor:`${e}-input`,children:jt(a.formatMessage,`${t}label_action`,r,"action")})};let ga=null;const Xe="discussion_form_",Zr=({id:e,parentId:t,content:n={type:"response",slugs:{}},userHasPermissions:r=!0,meta:a,placeholder:i,maxLength:s=0,buttons:o,forceShow:l={cancel:!1,error:!1},isCommunity:u=!1,functions:d,data:h={},gtmContext:m="DiscussionForm"})=>{var Se,Ye,Ke;const p=ie.useIntl(),g=y.useContext(st),[f,b]=y.useState(""),{isLoading:v=!1,isInWrapper:C=!1,isInOverlay:F=!1,isAutoFocused:_=!1,isEditing:w=!1,hasTitleField:k=!1,isPrepopulated:j=!1,showTitle:q=!1,showGuidelines:P=!0,showDivider:z=!1,showSuccessMessage:R=!0}=a||{},{onChange:A=()=>{},create:E=()=>{},handleSaveEdit:S=()=>{},handleCancel:O=()=>{},callback:V=()=>{},onMention:H=()=>{},listMembers:Q=()=>Promise.resolve([]),clickMentionFallback:ae=()=>{},props:D={create:{projectNames:["questions-answers"]}}}=d,[$,ee]=y.useState({title:k&&k.text||"",body:w&&w.text||j&&j.text||""}),[B,T]=y.useState(l.error||!1),[L,I]=y.useState(!1);if(y.useEffect(()=>{u&&!w&&j&&j!==$.body&&ee({...$,body:j.text||""})},[j]),v)return c.jsx(St,{className:"discussion-card discussion-form","data-testid":"loading-placeholder"});const W=je=>{ee({...$,body:je}),A({body:je});let Oe;!g||!g.id?Oe=jt(p.formatMessage,`${Xe}error_loggedOut`,n.type,"action"):r?s>0&&je.length>=s&&(Oe=`${Xe}error_tooLong`):Oe=jt(p.formatMessage,`${Xe}error_noPermission`,n.type,"action"),Oe?T(Oe):B&&T(!1)};let U=`${n.type}-form`;if(n.type==="response"||n.type==="reply"){const je=((Se=n.slugs)==null?void 0:Se.reply)||((Ye=n.slugs)==null?void 0:Ye.answer)||((Ke=n.slugs)==null?void 0:Ke.question)||"";je&&(U=`${U}-${je.slice(-15)}`)}e&&(U=`${e}-${U}`);const ne=async()=>{if(!g||!g.id||!r||pe)return;ga&&clearTimeout(ga),I("submitting");const je=window.location.pathname;try{let Oe;switch(n.type){case"post":Oe=await E({title:$.title,content:$.body});break;case"question":Oe=await E({title:$.body,authorId:g&&g.id,...D==null?void 0:D.create});break;case"response":Oe=await E({questionSlug:n.slugs.question},{body:$.body,authorId:g&&g.id,contentPath:je});break;case"reply":Oe=await E({questionSlug:n.slugs.question,answerSlug:n.slugs.answer},{body:$.body,authorId:g&&g.id,contentPath:je});break;default:break}await dm(1e3),V&&await V(Oe),ga=setTimeout(()=>{ee({title:"",body:""}),I("submitted"),b(jt(p.formatMessage,`${Xe}success`,n.type,"action"));const De=new Event(tt.DISCUSSION_FORM_SUBMITTED);document.dispatchEvent(De),re()},500)}catch(Oe){const De=Oe;let Le=`${Xe}error`;De!=null&&De.message.includes("entry already exists")&&(Le=jt(p.formatMessage,`${Xe}error_alreadyExists`,n.type,"action")),De!=null&&De.message.includes("429")?Le=jt(p.formatMessage,`${Xe}error_tooMany`,n.type,"action"):De!=null&&De.message.includes("400")&&(Le=`${Xe}error`),T(Le),re()}},re=()=>{ga=setTimeout(()=>{T(!1),I(!1),b("")},5e3)},le=!$.title||!au($.title),X=!$.body||!au($.body);let pe=X;k&&(pe=le&&X);const me=L==="submitting",_e=[{component:iE,props:{formID:U,intlPath:Xe,showLabel:k!==!1,type:n.type}},{component:dh,props:{id:`${U}-input`,value:L==="submitting"&&!B?"":$.body,placeholder:i||jt(p.formatMessage,`${Xe}placeholder`,n.type,"action"),maxLength:s,meta:{isInOverlay:F},functions:{onChange:W,onMention:H,listMembers:Q,clickMentionFallback:ae},data:h,autoFocus:w!==!1||_&&!k,"aria-invalid":!!B,"aria-errormessage":"error-message"}},{component:aE,props:{intlPath:Xe,showGuidelines:P,type:n.type,gtmContext:m}}];z&&_e.push({component:Ht}),k&&_e.unshift({id:"title",type:"text",value:k.text,limit:250,autoFocus:_,label:p.formatMessage({id:`${Xe}titleField_label`}),placeholder:p.formatMessage({id:`${Xe}titleField_placeholder`}),functions:{onChange:je=>{ee({...$,title:je}),A({title:je})}},validation:[{condition:()=>pe,error:p.formatMessage({id:`${Xe}titleField_error`})}]});let Be=!g||!g.id||!r||pe||me;return w&&(k?Be=Be||$.body===w.text&&$.title===k.text:Be=Be||$.body===w.text),c.jsxs(c.Fragment,{children:[c.jsxs(nn,{id:U,className:K("discussion-card discussion-form",{"no-styling":C&&w}),meta:{shouldReset:!0,shouldHide:!1,showRequiredLabels:!1,shouldShowCancelButton:w&&!me||l.cancel},functions:{onSuccess:async()=>{if(w){I("submitting"),S($);return}await ne()},onCancel:O},fields:_e,intlPath:Xe,button:{variant:"primary",size:{mobile:"small",600:"medium"},className:"gtm-trackable","data-gtm-event-context":m,"data-gtm-event-type":`${w?"save":"submit"}-${n.type}-click`,"data-testid":"save-button",disabled:Be,text:{default:!w&&(o!=null&&o.submit)?o==null?void 0:o.submit:p.formatMessage({id:`${Xe}${w?"save":"post"}`}),submitting:p.formatMessage({id:`${Xe}${w?"saving":"posting"}`})}},secondaryActionButton:{variant:"secondary",size:{mobile:"small",600:"medium"},className:"gtm-trackable","data-gtm-event-context":m,"data-gtm-event-type":`cancel-${n.type}-click`,disabled:!l.cancel&&(!g||!g.id||!$.body),text:o!=null&&o.cancel?o==null?void 0:o.cancel:p.formatMessage({id:`${Xe}cancel`})},gtm:{context:m,event:`${n.type}-form`},"data-testid":`discussion-${n.type}-form`,children:[q&&!w&&["question"].includes(n.type)&&c.jsx("h2",{children:jt(p.formatMessage,`${Xe}title`,n.type,"action")}),c.jsx(Jt,{member:g?{...g,link:!1}:"community",gtmContext:m,gtmType:"profile-click",badges:{showBadges:!0,scopes:[{scope:it.COMMUNITIES,area:t||""},{scope:it.PLATFORM,area:"all"}]}})]}),L==="submitted"&&R&&c.jsx(Mr,{className:"success","data-testid":"success",children:jt(p.formatMessage,`${Xe}success`,n.type,"action")}),B&&c.jsx(Mr,{id:"error-message",className:"error","data-testid":"error",children:l.error?l.error:typeof B=="string"?B.includes(" ")?B:p.formatMessage({id:B},{action:p.formatMessage({id:`discussion_action_${n.type}`}),maxLength:s}):B}),f&&c.jsx(Ie,{"aria-live":"polite",showOnFocus:!1,children:f})]})},sE=Object.freeze(Object.defineProperty({__proto__:null,default:Zr},Symbol.toStringTag,{value:"Module"})),oE=({question:e,answer:t,reply:n})=>({...e&&{questionSlug:e},...t&&{answerSlug:t},...n&&{replySlug:n}}),uE=(e,t=10)=>!e||e.length===0?[]:e.slice(0,t);function lE(e){return y.useCallback(t=>{var s,o,l,u;if(!t||!["ArrowUp","ArrowDown"].includes(t.key||""))return;t.stopPropagation(),t.preventDefault();const n=t.key==="ArrowUp"?"up":"down",r=(s=t.currentTarget)==null?void 0:s.parentElement;let a=r==null?void 0:r.nextElementSibling;if(n==="up"){const d=r==null?void 0:r.previousElementSibling;d?a=d:(a=(o=r==null?void 0:r.parentElement)==null?void 0:o.lastElementChild,(a==null?void 0:a.getAttribute("data-index"))==="-1"&&(a=a==null?void 0:a.previousElementSibling))}else(!a||(a==null?void 0:a.getAttribute("data-index"))==="-1")&&(a=(l=r==null?void 0:r.parentElement)==null?void 0:l.firstElementChild);if(!a)return;const i=Number((a==null?void 0:a.getAttribute("data-index"))||"0");e([{type:"tabbableLink",value:i}]),(u=a==null?void 0:a.querySelector("a,button"))==null||u.focus()},[e])}const cE=y.lazy(()=>Promise.resolve().then(()=>HE));let jr=!1;const us=()=>{jr!==!1&&(clearTimeout(jr),jr=!1)},dE=5;let ls=null;const wh=({element:e="div",likes:t=0,peopleWhoLiked:n=!1,isShort:r=!0,userLiked:a=!1,content:i={type:"reply",slugs:{}},canLike:s=!0,activityId:o,basePath:l,parentId:u,badges:d,functions:{createLike:h=()=>{},deleteLike:m=()=>{},listLikes:p=async()=>({next:"",results:[]})}})=>{const g=ie.useIntl(),f={numberOfLikes:t,userLikedContent:a,ignoreInteractions:!1,showLikers:!1,tabbableLink:0,showLikesModal:!1},[b,v]=y.useReducer(Hr,f),{numberOfLikes:C,userLikedContent:F,ignoreInteractions:_,showLikers:w,tabbableLink:k,showLikesModal:j}=b,q=lE(v);y.useEffect(()=>{v([{type:"userLikedContent",value:a}])},[a]);const P=y.useMemo(()=>uE(n,dE),[n]),z=S=>{if(S.preventDefault(),S.stopPropagation(),v([{type:"showLikers",value:!1}]),jr)return us(),!1;if(us(),_||!s)return!1;jr=setTimeout(R,350)},R=async()=>{if(us(),_||!s)return!1;let S=F?C-1:C+1;S<0&&(S=0),v([{type:"ignoreInteractions",value:!0},{type:"numberOfLikes",value:S},{type:"userLikedContent",value:!F}]);try{if(i&&i.slugs){const O=oE(i.slugs);F?await m(O):await h({...O,payload:{contentPath:window.location.pathname}})}}catch{v([{type:"numberOfLikes",value:t},{type:"userLikedContent",value:a}])}finally{v([{type:"ignoreInteractions",value:!1}])}},A=()=>{ls=setTimeout(()=>{v([{type:"showLikers",value:!1}])},500)},E=()=>{ls&&clearTimeout(ls)};return y.createElement(e,{className:"likes-wrapper",onKeyDown:S=>{S.key==="Escape"&&v([{type:"showLikers",value:!1}])},onMouseEnter:()=>{E(),v([{type:"showLikers",value:!0}])},onMouseLeave:()=>{A()}},c.jsxs(c.Fragment,{children:[c.jsx(Ka,{className:K("discussion-button text-medium action-button",{"show-spinner":_,"is-liked":F,disabled:!s}),icon:{icon:F?"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:z,screenreaderText:s?g.formatMessage({id:`discussion_likes_${F?"unlike":"like"}`},{action:g.formatMessage({id:`discussion_action_${i.type}`})}):!1,"aria-pressed":F,children:c.jsx("span",{"data-testid":"number-of-likes",className:"number-of-likes",children:g.formatMessage({id:`discussion_likes${r?"_short":""}`},{number:C})})}),n&&c.jsxs(c.Fragment,{children:[c.jsx(Ie,{"data-testid":"like-a11y-button",element:"button",className:"tertiary small icon navigation_arrow",onFocus:()=>{E()},onBlur:()=>A,onClick:S=>{var V;S.preventDefault(),S.stopPropagation(),E(),v([{type:"showLikers",value:!0}]);const O=(V=S.currentTarget.nextSibling)==null?void 0:V.childNodes[0];if(O){const H=O.querySelector("li:first-child a");H&&(v([{type:"tabbableLink",value:0}]),setTimeout(()=>{H.focus()},100))}},onKeyDown:S=>{S.key==="Escape"&&(S.preventDefault(),S.stopPropagation(),A())},"aria-expanded":w,"aria-controls":`likes-tooltip-${i.slug}`,children:c.jsx(Ie,{showOnFocus:!1,children:g.formatMessage({id:"discussion_likes_show"},{action:i.type})})}),c.jsx(Mn,{id:`likes-tooltip-${i.slug}`,isOpen:w,isLoading:n.length===0,children:n.length&&c.jsxs("ul",{children:[P.map((S,O)=>{if(typeof S=="string")return null;const V={};return k!==O&&(V.tabIndex=-1),c.jsx("li",{"data-index":O,children:c.jsx(mn,{href:S.id?`/profiles/${S.id}`:void 0,gtmContext:"Likes",gtmType:"liked-name-click",onFocus:()=>E(),onKeyDown:q,...V,children:S.name?S.name:c.jsx("span",{className:"deleted-user",children:g.formatMessage({id:"member_deleted"})})})},S.id||window.btoa(S.name||""))}),c.jsx("li",{"data-index":P.length,className:"show-all",children:c.jsx(Fe,{variant:"tertiary",onClick:()=>{E(),A(),v([{type:"showLikesModal",value:!0}])},onKeyDown:q,children:g.formatMessage({id:"discussion_likes_showAll"})})})]})}),j&&c.jsx(lr,{children:c.jsx(y.Suspense,{children:c.jsx(cE,{activityId:o,basePath:l,parentId:u,likeCount:t,showModal:j,functions:{onClose:()=>v([{type:"showLikesModal",value:!1}]),likes:{list:p}}})})})]})]}))},fE="post",hE="reply",Eh="00000000-0000-0000-0000-000000000000";function zo({queryClient:e,queryKey:t}){function n(r,a,i){e.setQueryData(t,i)}return n}function qo({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 mE(){return{latest_reactions:{like:[],reply:[]},reaction_counts:{like:0,reply:0},own_reactions:{like:[],reply:[]}}}function pE(){return{latest_children:{like:[],reply:[]},children_counts:{like:0,reply:0},own_children:{like:[],reply:[]}}}function _h(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 gE({title:e,content:t}){return{title:e,content:t,id:Eh,time:new Date().toISOString(),verb:fE}}function Ac({activity:e,user:t}){return{...e,actor:_h(t),...mE()}}function Za({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 kh({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 Ya({activity:e,reaction:t}){var n,r,a;t?(e.latest_reactions={...e.latest_reactions||{},pin:[...((r=e.latest_reactions)==null?void 0:r.pin)||[],t]},e.own_reactions={...e.own_reactions||{},pin:[...((a=e.own_reactions)==null?void 0:a.pin)||[],t]}):e.reaction_counts={...e.reaction_counts||{},pin:(n=e.reaction_counts)!=null&&n.pin?e.reaction_counts.pin+1:1}}function Fh({activity:e}){var t;e.reaction_counts={...e.reaction_counts||{},pin:(t=e.reaction_counts)!=null&&t.pin?e.reaction_counts.pin-1:0},e.latest_reactions={...e.latest_reactions||{},pin:[]},e.own_reactions={...e.own_reactions||{},pin:[]}}function vE({activityId:e,replyId:t,content:n}){return{activity_id:e,data:{content:n},id:Eh,kind:hE,parent:t||""}}function Tc({reply:e,user:t}){const n=_h(t);return{...e,user_id:n.id,user:n,...pE()}}function Sc({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 bE({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)})}function yE(e){return{pages:[{next:"",results:[e]}],pageParams:[""]}}function xE(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 DE(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 Ga(e,t,n){return t?n!=null&&n.append?xE(e,t,n):DE(e,t,n):yE(e)}function Nt(e,t){if(t)for(const{results:n}of t.pages){const r=n.find(({id:a})=>a===e);if(r)return r}}function Bh(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 Wo(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 Ah=(e,t)=>{const n=new CustomEvent(tt.DISCUSSION_POST_ADDED,{detail:{id:e,type:t}});document.dispatchEvent(n)};let jc,cs=0;const Th=()=>{y.useEffect(()=>(document.addEventListener(tt.DISCUSSION_POST_ADDED,e),()=>{document.removeEventListener(tt.DISCUSSION_POST_ADDED,e)}),[]);const e=t=>{const{id:n,type:r}=t.detail;if(!n||!r||r==="activity")return;clearTimeout(jc);const a=document.getElementById(n);if(a){a.scrollIntoView({behavior:"smooth",block:"start"}),cs=0;return}cs++,!(cs>10)&&(jc=setTimeout(()=>{e(t)},50))}},ir=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}),Vt=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}),Uo=Object.freeze({actor:`SU:${ir.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"}),CE=Object.freeze({actor:`SU:${Vt.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"}),wE=Object.freeze({actor:`SU:${ir.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"}),EE=Object.freeze({actor:`SU:${Vt.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:Uo.id,kind:"like",created_at:"2023-11-24T17:58:36.162000",data:{},parent:"",updated_at:"2023-11-24T17:58:36.162000",user_id:Vt.id,children_counts:{},latest_children:{},latest_children_extra:{},own_children:{},user:{id:Vt.id,data:{},created_at:"2023-11-24T17:58:36.162000",updated_at:"2023-11-24T17:58:36.162000"}});Object.freeze({id:"some-reaction-id-1",activity_id:Uo.id,kind:"pin",created_at:"2023-11-24T17:58:36.162000",data:{},parent:"",updated_at:"2023-11-24T17:58:36.162000",user_id:Vt.id,children_counts:{},latest_children:{},latest_children_extra:{},own_children:{},user:{id:Vt.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:Vt.id,user:{id:Vt.id,data:{},created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z"},kind:"reply",activity_id:Uo.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:ir.id,user:{id:ir.id,data:{},created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z"},kind:"reply",activity_id:CE.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:Vt.id,user:{id:Vt.id,data:{},created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z"},kind:"reply",activity_id:wE.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:ir.id,user:{id:ir.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 4..."},parent:"",latest_children:{},children_counts:{}});function _E({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:a,user:i}){const{mutate:s}=We.useMutation({mutationFn:e,onMutate:o=>t(l=>{const u=Ac({activity:gE(o),user:i});return Ga(u,l)}),onError:n,onSuccess:(o,l,u)=>{const d=Ac({activity:o,user:i});r.setQueryData(a,Ga(d,u,{replace:!0})),setTimeout(()=>{Ah(d.id,"activity")},0)}});return s}function kE({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=We.useMutation({mutationFn:e,onMutate:({activityId:a,content:i})=>t(s=>{const o=Nt(a,s);return o&&(o.content=i),s}),onError:n});return r}function FE({queryFns:{create:e,edit:t,like:n,list:r,remove:a,unlike:i,pin:s,unpin:o},queryKey:l,rankingMethod:u}){const d=We.useQueryClient(),h=ti(),m={queryClient:d,queryKey:l},p={mutationHandlers:{error:zo(m),mutate:qo(m)},user:h,...m},g=_E({...p,mutationFn:e}),f=kE({...p,mutationFn:t}),b=BE({...p,mutationFn:n}),v=SE({...p,mutationFn:a}),C=jE({...p,mutationFn:i}),F=TE({...p,mutationFn:s}),_=OE({...p,mutationFn:o}),{activities:w,...k}=AE({queryKey:l,queryFn:r,rankingMethod:u});return{activities:w,mutations:{create:g,edit:f,remove:v,like:b,unlike:C,pin:F,unpin:_},user:h,...k}}function BE({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:a}){const{mutate:i}=We.useMutation({mutationFn:e,onMutate:({activityId:s})=>t(o=>{const l=Nt(s,o);return l&&Za({activity:l}),o}),onError:n,onSuccess:(s,{activityId:o},l)=>{const u=Nt(o,l);u&&Za({activity:u,reaction:s}),r.setQueryData(a,l)}});return i}function AE({queryFn:e,queryKey:t,rankingMethod:n}){const{data:r,error:a,isLoading:i,hasNextPage:s,fetchNextPage:o}=We.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:Wo(r),error:a,isLoading:i,hasNextPage:s,fetchNextPage:o}}function TE({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:a}){const{mutate:i}=We.useMutation({mutationFn:e,onMutate:({activityId:s})=>t(o=>{const l=Nt(s,o);return l&&Ya({activity:l}),o}),onError:n,onSuccess:(s,{activityId:o},l)=>{const u=Nt(o,l);u&&Ya({activity:u,reaction:s}),r.setQueryData(a,l)}});return i}function SE({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=We.useMutation({mutationFn:e,onMutate:({activityId:a})=>t(i=>Bh(a,i)),onError:n});return r}function jE({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:a}=We.useMutation({mutationFn:e,onMutate:({activityId:i})=>t(s=>{const o=Nt(i,s);return o&&kh({activity:o,user:r}),s}),onError:n});return a}function OE({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:a}=We.useMutation({mutationFn:e,onMutate:({activityId:i})=>t(s=>{const o=Nt(i,s);return o&&Fh({activity:o,user:r}),s}),onError:n});return a}const PE=({basePath:e,parentId:t,isMember:n,isOwner:r,functions:{activities:a,mentions:i,join:s,leave:o,likes:l},profile:u})=>{const d=Lm(to.COMMUNITY_RANKING),h=ie.useIntl(),[m,p]=y.useState("community_feed_live"),[g,f]=y.useState([{id:"recent_with_pin",label:"recent"},{id:"community_feed_live",label:"popular"}]),{activities:b,error:v,fetchNextPage:C,hasNextPage:F,isLoading:_,mutations:{create:w,edit:k,remove:j,like:q,unlike:P,pin:z,unpin:R}}=FE({queryKey:[e,t,"activities",m],queryFns:a,rankingMethod:m});y.useEffect(()=>{d&&f(g.concat(d))},[d]);const[A,E]=y.useState(null),S=()=>{E(b.length),C()};return Th(),v?c.jsx(pn,{variant:"error",text:v.message}):c.jsxs("section",{children:[c.jsx(Vo,{isCard:!0,parentId:t,form:{content:{type:"post",slugs:{}},functions:{create:w,...i},meta:{isEditing:!1,isAutoFocused:!1,isPrepopulated:!1,showSuccessMessage:!1}},membershipRequiredToPost:{isMember:n,required:!0,join:s,leave:o,notMemberStateText:h.formatMessage({id:"community_joinToPost"})}}),c.jsx(nn,{className:"activities-feed-sorting-form",fields:[{id:"feed-sorting",label:h.formatMessage({id:"activitiesFeed_sorting_label"}),type:"select",options:g.map(({id:O,label:V})=>({id:O,label:h.formatMessage({id:`activitiesFeed_rankingMethod_${V}`})})),initialValue:m,functions:{onChange:O=>{p(O);const V=g.find(Q=>Q.id===O);if(!V)return;const H=new CustomEvent("ariaLive",{detail:{message:h.formatMessage({id:"community_sortSuccess"},{order:h.formatMessage({id:`activitiesFeed_rankingMethod_${V.label}`})})}});document.dispatchEvent(H)}},gtm:{context:"Community Sorting",event:"community-sorting-click"}}],button:{hideButton:!0},functions:{onCatch:()=>{},onFailure:()=>{},onSuccess:async()=>{},onCancel:()=>{}},id:"activities-feed-sorting-form"}),b==null?void 0:b.map((O,V)=>{var W,U,ne;const{id:H,own_reactions:Q,latest_reactions:ae,reaction_counts:D,mentioned_users:$,total_replies:ee}=O,B=(((W=ae==null?void 0:ae.like)==null?void 0:W.length)||0)>0,T=(((U=Q==null?void 0:Q.like)==null?void 0:U.length)||0)>0,L=T?Q==null?void 0:Q.like[0].id:"",I=B?(ne=ae==null?void 0:ae.like)==null?void 0:ne.map(re=>{var le,X,pe;return{id:(le=re==null?void 0:re.user)==null?void 0:le.id,name:(pe=(X=re==null?void 0:re.user)==null?void 0:X.data)==null?void 0:pe.name}}):!1;return c.jsx(y.Fragment,{children:c.jsx(Yr,{content:{type:"post",title:O==null?void 0:O.title,body:O==null?void 0:O.content,canLike:n,createdAt:(O==null?void 0:O.time)||"",slugs:{question:`${e}/${t}`,answer:H},slug:H,author:dr(O==null?void 0:O.actor),userLiked:T,likes:(D==null?void 0:D.like)||0,comments:ee||0,peopleWhoLiked:I,mentions:$,pinned:(D==null?void 0:D.pin)&&(D==null?void 0:D.pin)>0||!1},links:{post:`${e}/${t}/${H}`,comments:`${e}/${t}/${H}`},gtmContext:"community",functions:{content:{createContent:()=>null,deleteContent:()=>j({activityId:H}),updateContent:(re,{body:le})=>k({activityId:H,content:le})},likes:{createLike:()=>q({activityId:H}),deleteLike:()=>P({activityId:H,reactionId:L}),listLikes:re=>l.list({activityId:H,...re})},comments:{openComments:()=>null},pins:{createPin:()=>z({activityId:H}),deletePin:()=>R({activityId:H,reactionId:ae==null?void 0:ae.pin[0].id})},mentions:i},isTruncated:!0,styling:{showShareLinkButton:!0},setFocus:V===A,userHasOwnerPermissions:r,badges:{showBadges:!0,scopes:[{scope:it.COMMUNITIES,area:t||""},{scope:it.PLATFORM,area:"all"}]},basePath:e,parentId:t})},H)}),!_&&c.jsx(Vr,{hasNextPage:F,loadNextPage:S,icon:{icon:"arrow-down",position:"right"},messages:{button:h.formatMessage({id:"loadMore_button"}),error:h.formatMessage({id:"loadMore_error"})}}),c.jsx(Ko,{form:u})]})},ME={next:"id_lt=67ef0342-6f6e-4807-beea-5a9184ec140c&limit=5",results:[{created_at:"2023-12-03T18:47:44.081716Z",updated_at:"2023-12-03T18:47:44.081716Z",id:"256b921e-ffe6-410d-b754-ac1aaee989ce",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester",badges:{communities:{"community-slug":["orange-badge","badge-with-heart"]}}}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 17..."},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 NE({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:a,user:i}){const{mutate:s}=We.useMutation({mutationFn:e,onMutate:o=>t(l=>{const u=Tc({reply:vE(o),user:i});return Ga(u,l,{replace:!1,append:(o==null?void 0:o.replyId)!==void 0})}),onError:n,onSuccess:(o,l,u)=>{const d=Tc({reply:o,user:i});r.setQueryData(a,Ga(d,u,{replace:!0,append:(l==null?void 0:l.replyId)!==void 0})),setTimeout(()=>{Ah(d.id,"reply")},0)}});return s}function RE({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=We.useMutation({mutationFn:e,onMutate:({replyId:a,content:i})=>t(s=>{const o=Nt(a,s);return o&&(o.data.content=i),s}),onError:n});return r}function Sh({queryFns:{create:e,edit:t,like:n,list:r,remove:a,unlike:i},queryKey:s}){const o=We.useQueryClient(),l=ti(),u={queryClient:o,queryKey:s},d={mutationHandlers:{error:zo(u),mutate:qo(u)},user:l,...u},h=NE({...d,mutationFn:e}),m=RE({...d,mutationFn:t}),p=IE({...d,mutationFn:n}),g=LE({...d,mutationFn:a}),f=zE({...d,mutationFn:i}),{replies:b,...v}=$E({queryKey:s,queryFn:r});return{replies:b,mutations:{create:h,edit:m,remove:g,like:p,unlike:f},user:l,...v}}function IE({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:a}){const{mutate:i}=We.useMutation({mutationFn:e,onMutate:({replyId:s})=>t(o=>{const l=Nt(s,o);return l&&Sc({reply:l}),o}),onError:n,onSuccess:(s,{replyId:o},l)=>{const u=Nt(o,l);u&&Sc({reply:u,reaction:s}),r.setQueryData(a,l)}});return i}function $E({queryFn:e,queryKey:t}){const{data:n,error:r,isLoading:a,hasNextPage:i,fetchNextPage:s}=We.useInfiniteQuery({queryKey:t,queryFn:e,initialPageParam:{next:""},getNextPageParam:o=>(o==null?void 0:o.next)||null});return{replies:Wo(n),error:r,isLoading:a,hasNextPage:i,fetchNextPage:s}}function LE({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=We.useMutation({mutationFn:e,onMutate:({replyId:a})=>t(i=>Bh(a,i)),onError:n});return r}function zE({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:a}=We.useMutation({mutationFn:e,onMutate:({replyId:i})=>t(s=>{const o=Nt(i,s);return o&&bE({reply:o,user:r}),s}),onError:n});return a}const qE=({basePath:e,parentId:t,activityId:n,replyId:r,isMember:a,functions:{reactions:i,mentions:s,likes:o}})=>{const l=ie.useIntl(),u=3,{replies:d,fetchNextPage:h,hasNextPage:m,isLoading:p,mutations:{create:g,edit:f,like:b,remove:v,unlike:C},user:F}=Sh({queryKey:[e,t,n,r,"replies"],queryFns:{...i,list:k=>i.list({...k,reactionId:r})}});Qs([p]);const[_,w]=y.useState(!0);return c.jsxs(c.Fragment,{children:[(d==null?void 0:d.length)>=u&&c.jsx(Fe,{className:"nested-replies-show-toggle",variant:"secondary",size:"small",icon:{icon:`arrow_corner-${_?"up_left":"down_right"}`,position:"left"},onClick:()=>w(!_),children:l.formatMessage({id:`discussion_thread_${_?"hide":"show"}`},{count:d==null?void 0:d.length})}),_&&c.jsx(Rh,{loadMore:{isLoading:p,hasNextPage:m,loadNextPage:()=>h()},form:{parentId:t,content:{type:"reply",slugs:{question:`${e}/${t}`,answer:n,reply:r}},functions:{create:(k,{body:j})=>g({activityId:n,replyId:r,content:j}),listMembers:s.listMembers,clickMentionFallback:s.clickMentionFallback},meta:{isEditing:!1,isAutoFocused:!0,isPrepopulated:!1,showSuccessMessage:!1}},children:d&&d.length>0?d==null?void 0:d.map(k=>{var ae,D,$,ee,B,T,L;const{id:j,own_children:q,latest_children:P,children_counts:z,data:{mentioned_users:R}}=k,E=(((ae=q==null?void 0:q.like)==null?void 0:ae.length)||0)>0?(D=q==null?void 0:q.like)==null?void 0:D.find(I=>{var W;return((W=I==null?void 0:I.user)==null?void 0:W.id)===(F==null?void 0:F.id)}):!1,S=E?E==null?void 0:E.id:"",O=!!E,H=((($=P==null?void 0:P.like)==null?void 0:$.length)||0)>0?(ee=P==null?void 0:P.like)==null?void 0:ee.map(I=>{var W,U,ne;return{id:(W=I==null?void 0:I.user)==null?void 0:W.id,name:(ne=(U=I==null?void 0:I.user)==null?void 0:U.data)==null?void 0:ne.name}}):!1,Q=typeof k.data.content=="string"?(B=k==null?void 0:k.data)==null?void 0:B.content:((L=(T=k==null?void 0:k.data)==null?void 0:T.content)==null?void 0:L.text)||"";return c.jsx(Yr,{isCommunity:!0,content:{id:j,type:"reply",body:Q,canLike:a,createdAt:k==null?void 0:k.created_at,slugs:{question:`${e}/${t}`,answer:n,reply:k==null?void 0:k.parent},slug:"",author:dr(k==null?void 0:k.user),userLiked:O,likes:(z==null?void 0:z.like)||0,peopleWhoLiked:H,mentions:R},functions:{content:{createContent:()=>null,deleteContent:()=>v({replyId:j}),updateContent:(I,{body:W})=>f({replyId:j,content:W})},likes:{createLike:()=>b({replyId:j}),deleteLike:()=>C({replyId:j,reactionId:S}),listLikes:I=>o.list({replyId:j,...I})},comments:{},mentions:{listMembers:s.listMembers,clickMentionFallback:s.clickMentionFallback}},styling:{showShareLinkButton:!0},badges:{showBadges:!0,scopes:[{scope:it.COMMUNITIES,area:t||""},{scope:it.PLATFORM,area:"all"}]},basePath:e,parentId:t},j)}):null})]})};const jh=({basePath:e,parentId:t,activityId:n,activityTotalReplies:r,isMember:a,functions:{mentions:i,join:s,leave:o,likes:l,reactions:u},profile:d})=>{const h=ie.useIntl(),{replies:m,fetchNextPage:p,hasNextPage:g,isLoading:f,mutations:{create:b,edit:v,like:C,remove:F,unlike:_},user:w}=Sh({queryKey:[e,t,n,"replies"],queryFns:u}),k=()=>{q(m.length),p()},[j,q]=y.useState(null);return Qs([f]),Th(),c.jsxs("section",{className:"replies-feed",children:[c.jsx(Nh,{type:"comment",responses:r,isLoading:f}),c.jsx(Vo,{form:{content:{type:"reply",slugs:{}},functions:{create:(P,{body:z})=>b({activityId:n,content:z}),...i},meta:{isEditing:!1,isAutoFocused:!1,isPrepopulated:!1,showSuccessMessage:!1},placeholder:h.formatMessage({id:"discussion_responses_placeholder"})},parentId:t,membershipRequiredToPost:{isMember:a,required:!0,join:s,leave:o,notMemberStateText:h.formatMessage({id:"community_joinToPost"})}}),m==null?void 0:m.map((P,z)=>{var B,T,L,I,W,U,ne;const{id:R,own_children:A,latest_children:E,children_counts:S,data:{mentioned_users:O}}=P,H=(((B=A==null?void 0:A.like)==null?void 0:B.length)||0)>0?(T=A==null?void 0:A.like)==null?void 0:T.find(re=>{var le;return((le=re==null?void 0:re.user)==null?void 0:le.id)===(w==null?void 0:w.id)}):!1,Q=H?H==null?void 0:H.id:"",ae=!!H,$=(((L=E==null?void 0:E.like)==null?void 0:L.length)||0)>0?(I=E==null?void 0:E.like)==null?void 0:I.map(re=>{var le,X,pe;return{id:(le=re==null?void 0:re.user)==null?void 0:le.id,name:(pe=(X=re==null?void 0:re.user)==null?void 0:X.data)==null?void 0:pe.name}}):!1,ee=typeof P.data.content=="string"?(W=P==null?void 0:P.data)==null?void 0:W.content:((ne=(U=P==null?void 0:P.data)==null?void 0:U.content)==null?void 0:ne.text)||"";return c.jsx(Ch,{children:c.jsx(Yr,{isCommunity:!0,content:{id:R,type:"reply",body:ee,canLike:a,createdAt:P==null?void 0:P.created_at,slugs:{question:`${e}/${t}`,answer:n,reply:R},slug:R,author:dr(P==null?void 0:P.user),userLiked:ae,likes:(S==null?void 0:S.like)||0,peopleWhoLiked:$,mentions:O},functions:{content:{createContent:()=>null,deleteContent:()=>F({replyId:R}),updateContent:(re,{body:le})=>v({replyId:R,content:le})},likes:{createLike:()=>C({replyId:R}),deleteLike:()=>_({replyId:R,reactionId:Q}),listLikes:l.list},comments:{},mentions:i},badges:{showBadges:!0,scopes:[{scope:it.COMMUNITIES,area:t||""},{scope:it.PLATFORM,area:"all"}]},children:c.jsx(qE,{basePath:e,parentId:t,activityId:n,replyId:R,isMember:a,functions:{reactions:u,mentions:i,likes:l}}),styling:{showShareLinkButton:!0},setFocus:z===j,basePath:e,parentId:t},R)},R)}),!f&&c.jsx(Vr,{hasNextPage:g,loadNextPage:k,icon:{icon:"arrow-down",position:"right"},messages:{button:h.formatMessage({id:"loadMore_button"}),error:h.formatMessage({id:"loadMore_error"})}}),c.jsx(Ko,{form:d})]})};function WE({queryFn:e,queryKey:t}){const{data:n,error:r,isLoading:a,hasNextPage:i,fetchNextPage:s,refetch:o}=We.useInfiniteQuery({queryKey:t,queryFn:e,initialPageParam:{next:""},getNextPageParam:d=>(d==null?void 0:d.next)||null}),l=Wo(n),u=`${l.length||0}${i?"+":""}`;return{likes:l,likesCount:u,error:r,isLoading:a,hasNextPage:i,fetchNextPage:s,refetch:o}}function UE({queryFns:{list:e},queryKey:t}){const{likes:n,...r}=WE({queryKey:t,queryFn:e});return{likes:n,...r}}function Oh({basePath:e,parentId:t,activityId:n,likeCount:r,functions:a}){const{likes:i,fetchNextPage:s,hasNextPage:o,refetch:l}=UE({queryKey:[e,t,n,"likes"],queryFns:a.likes});y.useEffect(()=>{l()},[l]);const u=i.map(({user:d})=>d).map(d=>d?dr(d):void 0).filter(d=>d&&typeof d!="string");return c.jsx("section",{className:"likes-feed",children:c.jsx(Dh,{members:{data:u,total:r},showHeader:!1,showPlaceholders:!0,communitySlug:t,hasNextPage:o&&u.length<r,loadNextPage:s})})}const Ph=({showModal:e=!0,activityId:t,functions:{onClose:n,likes:r},likeCount:a,className:i,basePath:s,parentId:o})=>{const l=ie.useIntl();return c.jsx(tn,{id:"likes-modal",title:l.formatMessage({id:"discussion_likes"},{number:a}),isOpen:e,functions:{onClose:n},className:K("profile-modal in-portal",i,{open:e}),maxWidth:600,children:c.jsx(Oh,{activityId:t,basePath:s,parentId:o,likeCount:a??0,functions:{likes:r}})})},HE=Object.freeze(Object.defineProperty({__proto__:null,default:Ph},Symbol.toStringTag,{value:"Module"})),ds=({children:e,class:t,...n})=>{const r={...n,class:K("subtle",t)};return c.jsx("blockquote",{...r,children:e})},VE=280,Ho=async(e,t,n,r=()=>Promise.resolve([]))=>{let a=t?Xn(e,typeof t=="number"?t:VE):e;a=a.trim();const i=`<br>
163
+ `}),X=B.turndown(X)}o&&o.mentions&&(X=await Qc({text:X,template:`[${zs}{{name}}]({{id}})`,mentions:o.mentions,listMembers:m||(()=>Promise.resolve([]))})),fw(X,B=>{_([{type:"initialValue",value:B},{type:"editorKey",value:k.toString()}]),setTimeout(()=>{_([{type:"stringValue",value:Dc(Q)}])},150)})})()},[k]),y.useEffect(()=>{t!==""||!Q||ps(k,t)&&!R||(x.withoutNormalizing(Q,()=>{J.delete(Q,{at:{anchor:x.start(Q,[]),focus:x.end(Q,[])}}),J.deselect(Q),Q.children.length!==0&&J.unwrapNodes(Q,{at:[0]}),J.insertNodes(Q,v,{at:[0]})}),_([{type:"initialValue",value:v},{type:"lastAnchor",value:null}]))},[t]);const D=$c(()=>{gw({editor:Q,isShowing:E.show,numberOfUsers:E.numberOfUsers,listMembers:m,dispatch:_})},100);return j?c.jsx("div",{id:O,className:"rich-text-editor",children:c.jsxs(an.Provider,{value:{...F,id:O,isInOverlay:h,setFocus:S,dispatch:_,onMention:f,reportError:b},children:[c.jsxs(Sx,{editor:Q,initialValue:j,onChange:$=>{if(Q.operations.some(B=>B.type!=="set_selection")){const B=bw($);g(B),_([{type:"stringValue",value:Dc(Q)}]),R||_([{type:"hasInteracted",value:!0}]),D(),d&&console.log({serialized:B,json:$})}},...l,children:[c.jsx(Cx,{className:"input",renderElement:V,renderLeaf:H,placeholder:n||u.formatMessage({id:"richTextEditor_placeholder"}),autoFocus:s,tabIndex:0,onKeyDown:$=>{if($.key==="Enter"){E.show&&($.preventDefault(),$.stopPropagation(),rh(Q,E,_,O));const{selection:X}=Q;if(X){const B=Z.isCollapsed(X),[T,L]=x.node(Q,X,{depth:1});let I=T,W=I.type;const U=I.children[0];if(U&&[Y.ol,Y.ul].includes(U.type)&&(I=U,W=U.type),I&&de.isElement(I)&&W!==Y.paragraph){if(W===Y.blockquote&&!$.shiftKey){$.stopPropagation(),$.preventDefault(),J.insertNodes(Q,v);return}if(B){const[ne,re]=x.parent(Q,X,{edge:"end"}),ee=ne.type;if([Y.ul,Y.ol].includes(W))if($.stopPropagation(),$.preventDefault(),ee===Y.li&&z==="Enter"){ne.children.length===1&&"text"in ne.children[0]&&ne.children[0].text===""&&J.removeNodes(Q,{at:re}),J.insertNodes(Q,v,{at:N.next(L)}),J.select(Q,x.end(Q,N.next(L)));return}else{const[pe,me]=hw(Q,Y.li),_e={type:Y.li,children:[{text:""}]};J.insertNodes(Q,_e,{at:N.next(me)}),J.select(Q,x.end(Q,N.next(me)))}}}}}else if($.key==="Escape"){if(E.show){$.preventDefault(),$.stopPropagation(),_([{type:"mentionPopover",value:{...E,show:!1}}]);return}}else if(["ArrowUp","ArrowDown"].includes($.key)&&E.show){$.preventDefault(),$.stopPropagation();const{selectedUser:X,possibleUsers:B}=E;let T=$.key==="ArrowUp"?X-1:X+1;T<0&&(T=B.length-1),T>=B.length+1&&(T=0),_([{type:"mentionPopover",value:{...E,selectedUser:T}}])}_([{type:"lastKey",value:$.key}]),pw($,Q,_,b)},onBlur:()=>{Q.selection&&_([{type:"lastAnchor",value:Q.selection.anchor}])},onFocus:()=>{if(P){if(!N.isPath(P.path)||!ue.has(Q,P.path))return;const $=ue.get(Q,P.path);let X=0;if(fe.isText($)?X=$.text.length:$.children&&(X=$.children.length),P.offset>X)return;try{J.select(Q,{anchor:P,focus:P})}catch(B){const T=B.message;b(`Error focusing editor: ${T}`)}}}}),c.jsx(Aw,{}),m?c.jsx(yw,{onFallbackClick:p}):null]},w),c.jsx(fo,{id:`character-limit-${e}`,limit:r,valueLength:ai(q)})]})}):c.jsx(c.Fragment,{})};const $w=({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=d=>{i||(l(d),a(d))};return c.jsxs("div",{className:K("toggle",s),onClick:d=>{d.preventDefault(),d.stopPropagation(),u(o===n[0].value?n[1].value:n[0].value)},children:[c.jsx("p",{children:t}),c.jsx("ul",{className:K("toggle-options",{disabled:i,on:o===n[1].value}),children:n.map(d=>{const h=`${e}-${d.value}`;return c.jsxs("li",{className:"hidden",children:[c.jsx("input",{type:"radio",id:h,name:e,value:d.value,checked:o===d.value,onChange:()=>u(d.value),disabled:i}),c.jsx("label",{htmlFor:h,children:d.label})]},h)})})]})};function fh({className:e="",userId:t,userName:n,src:r,uploadImage:a,button:i,callback:s}){const o=ie.useIntl(),l="profileImageChange_",[u,d]=y.useState(r),[h,m]=y.useState(!1),[p,g]=y.useState(!1),f=y.useRef(null),b=async _=>{m(!0),g(!1);try{const w=_.target.files&&_.target.files[0];if(!w||!t)throw m(!1),new Error("Image file or userID is missing");const k=await a({fileObject:w,userId:t}),j={thumbnail:k.thumbnailURL,full:k.originalURL};d(j),s(j)}catch{g(!0)}finally{m(!1)}m(!1)},{upload:v=o.formatMessage({id:`${l}cta_upload`}),change:C=o.formatMessage({id:`${l}cta_change`}),uploading:F=o.formatMessage({id:`${l}cta_uploading`})}=(i==null?void 0:i.text)||{};return c.jsxs("div",{className:K("profile-image-change-figure",e),children:[c.jsx(gn,{className:"profile-image-change-picture",name:n,src:u==null?void 0:u.thumbnail,showInitials:!1,alt:"","data-testid":"profile-picture"}),p&&c.jsx("p",{className:"error text-small",children:o.formatMessage({id:`${l}error`})}),c.jsx("input",{id:"file",type:"file",accept:"image/*",ref:f,onChange:b,hidden:!0,"data-testid":"file-input"}),c.jsx(Fe,{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?F:u?C:v})]})}const hh=({gtm:e,functions:{onSuccess:t=async()=>{},onFailure:n=()=>{}}})=>{const{context:r="FooterContactUsForm",event:a="contact-form-submit-click"}=e||{};return c.jsx(nn,{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},button:{className:"new"}})};const mh=({title:e,label:t,ctaMessage:n,titleColor:r,labelColor:a,backgroundColor:i,onClose:s,reportError:o,sendInvites:l,initialFormStatus:u="NOT_SUBMITTED"})=>{const[d,h]=y.useState([]),[m,p]=y.useState(!0),[g,f]=y.useState(u),{formatMessage:b}=ie.useIntl(),v=async _=>{_.preventDefault();try{await l(d),h([]),f("SUCCESS")}catch(w){f("ERROR"),o(w)}},C=_=>{_.preventDefault(),f("NOT_SUBMITTED"),p(!0),h([])},F=_=>{_.preventDefault(),s(),f("CLOSED")};return g==="CLOSED"?null:g==="ERROR"||g==="SUCCESS"?c.jsxs("div",{className:"invite-form-wrapper",children:[c.jsx("div",{className:"content centred",children:g==="SUCCESS"?c.jsx("h2",{className:"success-title",children:b({id:"inviteForm_success"})}):c.jsxs("h2",{className:"error-title",children:[" ",b({id:"inviteForm_error"})]})}),c.jsx(Ht,{}),c.jsx("div",{className:"footer",children:g==="SUCCESS"?c.jsxs(c.Fragment,{children:[c.jsx(Fe,{variant:"secondary",onClick:C,children:b({id:"inviteForm_ctaSendMoreInvites"})}),c.jsx(Fe,{onClick:F,children:b({id:"inviteForm_ctaDone"})})]}):c.jsx(Fe,{onClick:C,children:b({id:"inviteForm_ctaTryAgain"})})})]}):c.jsx("div",{className:"invite-form-wrapper",children:c.jsxs("form",{style:{backgroundColor:i},onSubmit:v,className:K("invite-form gtm-trackable"),children:[c.jsxs("fieldset",{className:"content",children:[c.jsx("h2",{className:"title",style:{color:r},children:e}),c.jsx("label",{htmlFor:"email-input",className:"label",style:{color:a},children:t}),c.jsx(Jh.ReactMultiEmail,{id:"email-input",inputClassName:"email-input input",placeholder:b({id:"inviteForm_email_placeholder"}),emails:d,onChange:_=>{h(_),p(!_.length)},autoFocus:!1,getLabel:(_,w,k)=>c.jsxs("div",{className:"email text-medium",children:[c.jsx("div",{"data-tag-item":!0,children:_}),c.jsx(Fe,{variant:"tertiary",size:"small",icon:{icon:"close"},onClick:()=>{k(w),p(!d.length)},className:"remove-email-button",screenreaderText:b({id:"overlay_close"})})]},w)})]}),c.jsx(Ht,{}),c.jsx("fieldset",{className:"footer",children:c.jsx(Fe,{className:"sendEmailsButton",disabled:m,children:n})})]})})},Ta=e=>e.map(t=>({condition:t})),kt={FORM_ID:"manage-account-password-change",NEW_PASSWORD:"newPassword",CONFIRMED_PASSWORD:"confirmedPassword",CURRENT_PASSWORD:"oldPassword"},Lw=({functions:e,...t})=>{const{formatMessage:n}=ie.useIntl(),[r,a]=y.useState(null),[i,s]=y.useState(!1),[o,l]=y.useState({isMoreThanEightCharacters:!1,includesNumberAndSymbol:!1,includesLowerAndUppercase:!1}),u=p=>p[kt.NEW_PASSWORD]!==p[kt.CONFIRMED_PASSWORD]?n({id:"passwordRules_unmatched_text"}):null,d=p=>!ys(p[kt.NEW_PASSWORD]).isValid,h=[{"data-testid":kt.NEW_PASSWORD,id:kt.NEW_PASSWORD,type:"password",autoComplete:"new-password",placeholder:"",label:n({id:"passwordRules_newPassword_label"}),validation:Ta(["required",d]),functions:{onChange:p=>l(ys(p).matchingRules),onFocus:()=>s(!0),onBlur:()=>s(!1)}},{"data-testid":kt.CONFIRMED_PASSWORD,id:kt.CONFIRMED_PASSWORD,type:"password",autoComplete:"new-password",placeholder:"",label:n({id:"passwordRules_confirmPassword_label"}),validation:Ta(["required",u])}];t.isPasswordChange&&h.unshift({"data-testid":kt.CURRENT_PASSWORD,id:kt.CURRENT_PASSWORD,type:"password",autoComplete:"current-password",placeholder:"",label:n({id:"passwordRules_currentPassword_label"}),validation:Ta(["required"])}),i&&h.push({component:Ld,props:{matchingRules:o}});const m={id:kt.FORM_ID,fields:h,functions:{...e,onSuccess:async p=>(e.createPassword(p),e.onSuccess&&e.onSuccess(p)),onCatch:p=>a(p==null?void 0:p.statusCode),onFailure:(p,g)=>{(g.includes(kt.NEW_PASSWORD)||g.includes(kt.CONFIRMED_PASSWORD))&&s(!0)}},meta:{shouldReset:!0},...t};return c.jsxs(c.Fragment,{children:[c.jsx(nn,{...m}),r&&c.jsx(pn,{variant:"error",text:r})]})};const ph=({hooks:e,functions:t,meta:n={},gtm:r})=>{var _,w;const a=ie.useIntl(),i="profileForm_",s=y.useContext(st),[o,l]=y.useState(s.image),[u,d]=y.useState(!1),{uploadImage:h,onSuccess:m=async k=>{},onCancel:p=()=>{},onFailure:g=()=>{}}=t,{buildLocation:f,isValidPlace:b,predictPlaces:v}=e.useMaps(),{context:C="ProfileForm",event:F="profile-form-submit-click"}=r||{};return c.jsx(nn,{id:"profile-details-form",fields:[{component:fh,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:((_=s.location)==null?void 0:_.en)||((w=s.location)==null?void 0:w.country),validation:[{condition:"required"},{condition:({location:k})=>k&&!u?!1:!b(k),error:a.formatMessage({id:`${i}location_error`})}],functions:{onChange:()=>{u||d(!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:Ht}],meta:{shouldShowCancelButton:!0,shouldReset:!1,shouldHide:!1,showRequiredLabels:!1,...n},intlPath:i,gtm:{context:C,event:F},functions:{onSuccess:async k=>{try{const j={...k,image:o||null,location:u?await f(k==null?void 0:k.location):s.location};s.updateDetails&&s.updateDetails(q=>({...q,...j})),await m(j)}catch{g()}},onCancel:p,onFailure:g},button:{size:"large",text:{default:a.formatMessage({id:`${i}cta`}),submitting:a.formatMessage({id:`${i}cta_submitting`}),submitted:a.formatMessage({id:`${i}cta_submitted`})}}})};const gh=({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=ie.useIntl(),u=y.useRef(null);er(()=>{!n||o||!s||u.current&&u.current.focus()},[s]);const d=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 c.jsx("form",{onSubmit:d,className:K("search-form gtm-trackable",t),role:"search","data-gtm-event-context":a,"data-gtm-event-type":i,children:c.jsx("fieldset",{id:`${e}-form`,hidden:n?!s:!1,children:c.jsxs("p",{children:[c.jsx(Ie,{element:"label",htmlFor:e,children:l.formatMessage({id:"search_label"})}),c.jsx("input",{ref:u,type:"search",id:e,name:e,defaultValue:r,placeholder:l.formatMessage({id:"search_placeholder"}),onKeyDown:h=>{h.key==="Enter"&&d(h)}}),c.jsx("button",{className:"clear",onClick:h=>{h.preventDefault(),h.stopPropagation(),u.current&&u.current.value&&(u.current.value="")},children:c.jsx(Ie,{children:l.formatMessage({id:"search_clear"})})}),c.jsx("button",{className:"search",onClick:d,children:c.jsx(Ie,{children:l.formatMessage({id:"search_cta"})})})]})})})},kc=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 d="";return o?d=l?"gov":"nonGov":u.registration?u.engagement&&!u.user?d=u.auth?"verify":"pending":d="exists":u.auth&&(d="exists"),n([{type:"shouldDisableButton",value:!1},{type:"shouldManuallyApprove",value:!l},{type:"emailDetails",value:{email:a,boxType:d,isEnd2End:/testing\+[0-9]+@apolitical.co$/.test(a)}},{type:"validFields.email",value:!0}])},zw=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"]}},qw=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=zw(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}])},Ww=({shouldShow:e,placeholders:t,labels:n,functions:{validateEmail:r,resendVerificationCode:a},refs:i,state:s,dispatch:o,dataToSubmit:l,intl:u})=>{const{emailDetails:d}=s,h=(p,g)=>{p.current&&s.validFields[g]!==p.current.validity.valid&&o([{type:`validFields.${g}`,value:p.current.validity.valid}])},m=[{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:()=>{kc({ref:i.email,validateEmail:r,dispatch:o})},onChange:(p,g)=>{o([{type:"shouldDisableButton",value:!0}]),g&&g({type:"updateValue",payload:{key:"terms",value:!1}})},onFocus:()=>o([{type:"loadRecaptcha",value:!0}])},autoComplete:"email",validation:[{condition:"required"},{condition:"valid-email"}],"data-testid":"signup-email-input"},{component:Md,props:{email:d.email,type:d.boxType,resendVerificationCode:a}}];return s.shouldManuallyApprove&&(m.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&&m.push({id:"url",type:"text",label:u.formatMessage({id:"signup_url"},{small:p=>c.jsx("small",{children:p})}),placeholder:u.formatMessage({id:"signup_url_placeholder"}),validation:[{condition:"valid-url"}],"data-testid":"signup-url-input"})),e.expectation&&m.push({id:"expectation",className:"expectation",type:"text",label:(n==null?void 0:n.expectation)||u.formatMessage({id:"signup_expectation"},{small:p=>c.jsx("small",{className:"notes text-small",children:p})}),placeholder:(t==null?void 0:t.expectation)||u.formatMessage({id:"signup_expectation_placeholder"}),"data-testid":"signup-events-question"}),m.push({id:"terms",className:"text-small",type:"checkbox",inputRef:i.tc,label:u.formatMessage({id:"signup_terms"},{terms:p=>c.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:p}),privacy:p=>c.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:p})}),shownValue:"accepted",functions:{onChange:p=>{if(!p)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"&&kc({ref:i.email,validateEmail:r,dispatch:o}))}),g.length&&o(g)}},validation:[{condition:"required"}],"data-testid":"signup-terms-checkbox"}),m};const Uw=({className:e=""})=>c.jsxs("div",{className:K("success-message",e),"data-testid":"success-message",children:[c.jsx("p",{className:"success-title",children:c.jsx(ie.FormattedMessage,{id:"signup_success_title"})}),c.jsx(ie.FormattedMessage,{id:"signup_success_text",values:{p:t=>c.jsx("p",{children:t})}})]});const Hw={validFields:{name:!1,email:!1,jobTitle:!1,organisation:!1},emailDetails:{email:"",boxType:"",isEnd2End:!1},shouldManuallyApprove:!1,shouldDisableButton:!0,loadRecaptcha:!1,showSuccessMessage:!1,showError:!1},Vw=({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=ie.useIntl(),{title:u=!0,expectation:d=!1,url:h=!0,logInButton:m=!0,successMessage:p=!0}=a,g={title:u,expectation:d,url:h,logInButton:m,successMessage:p},[f,b]=y.useReducer(Hr,Hw),{validFields:v,emailDetails:C,shouldManuallyApprove:F,shouldDisableButton:_,showSuccessMessage:w,showError:k}=f,[j,q]=Gs.useCookies(["signup-this-session","functional-cookie-consent"]),P={form:y.createRef(),name:y.createRef(),email:y.createRef(),jobTitle:y.createRef(),organisation:y.createRef(),tc:y.createRef(),hiddenValidation:y.createRef()};y.useEffect(()=>{F===!0&&P.jobTitle.current&&P.jobTitle.current.focus()},[F]),y.useEffect(()=>{j["signup-this-session"]&&b([{type:"showSuccessMessage",value:!0}])},[j]),y.useEffect(()=>{w&&j["functional-cookie-consent"]&&q("signup-this-session","true",{path:"/",maxAge:3600})},[w]);const z=y.useMemo(()=>Ww({placeholders:n,labels:t,shouldShow:g,functions:r,refs:P,state:f,dispatch:b,dataToSubmit:s,intl:l}),[s,r,l,P,g,f]),R=_?!0:F?!Object.values(v).every(A=>A===!0):!v.name||!v.email||["exists","pending","verify"].includes(C.boxType);return g.successMessage&&w?c.jsx(Uw,{className:e}):c.jsxs("fieldset",{className:K("signup-form-fieldset",e),"data-testid":"signup-form",children:[g.title&&c.jsx("p",{className:"signup-title",children:c.jsx(ie.FormattedMessage,{id:"signup_title"})}),k&&c.jsx(pn,{variant:"error",text:l.formatMessage({id:"signup_error"})}),c.jsx(nn,{className:"signup-form",formRef:P.form,id:"sign-up-form",fields:z,intlPath:"signup",button:{variant:"primary",size:"medium",text:i||l.formatMessage({id:"signup_button_join"}),disabled:R?{isClickable:!0}:!1,styling:{fullWidth:!0},"data-testid":"signup-button"},secondaryActionButton:{className:"login-button",styling:{fullWidth:!0},variant:"tertiary",size:"medium",href:"/api/next-ui/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 qw({refs:P,dataToSubmit:s,createAccount:r.createAccount,onSuccess:r.onSuccess,dispatch:b,state:f})},onCatch:A=>{r.handleError(A),b([{type:"showSuccessMessage",value:!1},{type:"showError",value:!0}])}}}),c.jsx("button",{className:"validation-button",ref:P.hiddenValidation})]})};const yn=({children:e,className:t="",styling:n={},...r})=>{const{background:a="default",padding:i="none"}=n;return c.jsx("section",{className:K("full-width-section",t,{[a]:a!=="default",[i]:i!=="none"}),...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 new","data-gtm-event-type":"download-click","data-gtm-event-context":a.eventContext||"Download",target:"_blank",children:a.text})}),c.jsx(yn,{className:K("download-section",n),styling:{background:"dark"},children:c.jsxs("div",{className:"content-default",children:[y.createElement(typeof e=="string"?"h2":e.element,{className:"text"},typeof e=="string"?e:e.text),c.jsx(or,{buttons:r})]})})};const Zs="editSection_";function vh({href:e,setShowModal:t}){typeof e!="string"&&t(!0)}const Zw=({icon:e,description:t,ctaMessage:n,href:r,showEditButton:a,setShowModal:i})=>{const{formatMessage:s}=ie.useIntl();return c.jsxs(Mt,{variant:"muted",icon:e,children:[c.jsx("p",{children:t||s({id:`${Zs}placeholder_description`})}),a&&c.jsx("p",{children:c.jsx(Fe,{href:r,variant:"secondary",size:"small",onClick:()=>vh({href:r,setShowModal:i}),children:n||s({id:`${Zs}placeholder_cta`})})})]})},Yw=({children:e,className:t="",formProps:n,formComponent:r,href:a,title:i,showTitle:s=!0,modalTitle:o,placeholder:l,showDivider:u=!0})=>{const{formatMessage:d}=ie.useIntl(),[h,m]=y.useState(!1),p=()=>m(!1),g=!!n||!!r,f=typeof a=="string"||g;let b;return r&&(b=y.cloneElement(r,{functions:{...r.props.functions,onSuccess:async v=>{try{r.props.functions.onSuccess&&await r.props.functions.onSuccess(v)}finally{p()}},onCancel:()=>{r.props.functions.onCancel&&r.props.functions.onCancel(),p()}}})),c.jsxs("section",{className:K("edit-section",t),children:[g&&c.jsx(tn,{title:o||`Edit ${i}`,isOpen:h,showDivider:!1,showIcon:!1,functions:{onClose:p},className:K("edit-section-modal"),children:b||(n?c.jsx(nn,{...n,fields:n.fields,meta:{...n==null?void 0:n.meta,shouldShowCancelButton:!0,shouldReset:!1,showSuccessMessage:!0},functions:{...n==null?void 0:n.functions,onSuccess:async v=>{var C,F;(C=n==null?void 0:n.functions)!=null&&C.onSuccess&&await((F=n==null?void 0:n.functions)==null?void 0:F.onSuccess(v)),m(!1)},onCancel:p}}):c.jsx(c.Fragment,{}))}),c.jsxs("div",{className:K("edit-section-header",{"no-title":!s}),children:[s&&c.jsx("h2",{className:"edit-section-header-title",children:i}),f&&c.jsx(Fe,{href:a,variant:"tertiary",size:"small",icon:"pencil",onClick:()=>vh({href:a,setShowModal:m}),children:d({id:`${Zs}edit`})})]}),e||c.jsx(Zw,{...l,href:a,setShowModal:m,showEditButton:f}),u&&c.jsx(Ht,{})]})};const Gw=({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 c.jsxs("div",{className:K("logos",a,`align-${l}`,{[u]:u!=="block","wrap-logos":o}),children:[e&&y.createElement(s.element,{className:K("title",s.className)},s.text),t&&c.jsx("p",{children:t}),c.jsx("ul",{className:K({"two-col":i===2||i===4,"three-col":i===5||i<=10&&i%3===0}),children:n.map(({logo:d,nameOfBusiness:h,link:m=!1,description:p=!1},g)=>{if(!d||!d.url)return null;const f=c.jsx("img",{src:d.url,width:d.width||"auto",height:d.height||"auto",alt:h});return c.jsxs("li",{children:[c.jsx("p",{className:"img-wrapper",children:m?c.jsx("a",{href:m,target:"_blank",rel:"nofollow noreferrer noopener",children:f}):f}),p&&c.jsx("small",{children:p})]},window.btoa(`${d.url}_${g}`))})})]})};let ns;const rs="contactFooter_",Qw=({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(ns),ns=setTimeout(()=>{o(),s(!1)},500))};return y.useEffect(()=>(o(),window.addEventListener("resize",l),()=>{clearTimeout(ns),window.removeEventListener("resize",l)}),[]),c.jsx(yn,{id:"contactForm",className:"contact-footer",children:c.jsxs("div",{className:"inner-wrapper",children:[c.jsx("h2",{children:c.jsx(ie.FormattedMessage,{id:`${rs}title`})}),c.jsxs("div",{className:"content-wrapper",ref:n,"data-testid":"content-wrapper",style:i?{}:{minHeight:r},children:[c.jsxs("aside",{children:[c.jsx("p",{children:c.jsx(ie.FormattedMessage,{id:`${rs}text`})}),c.jsx(mn,{className:"mailto-link",href:"mailto:hello@apolitical.co",children:c.jsx(ie.FormattedMessage,{id:`${rs}email`})})]}),c.jsx(hh,{functions:{onSuccess:e,onFailure:t},gtm:{context:"FooterContactUsForm",event:"contact-form-submit-click"}})]})]})})},Jw=({activeLink:e,profile:t,...n})=>c.jsx(yn,{children:c.jsx(Od,{layout:"1-3",children:c.jsxs(c.Fragment,{children:[c.jsx(jd,{activeLink:e,profile:t}),c.jsx(id,{...n})]})})});const as="cookieBanner_",is=["apol-cookie-banner","apolitical-performance-cookie-consent","functional-cookie-consent"],ss=new Date(Date.now()+12*30*24*60*60*1e3),bh=()=>{const e=ie.useIntl(),[t,n,r]=Gs.useCookies(is),[a,i]=y.useState(!t["apol-cookie-banner"]),s=()=>{is.forEach(d=>{n(d,!0,{path:"/",expires:ss,domain:d==="apolitical-performance-cookie-consent"?".apolitical.co":void 0})}),i(!1),window.location.reload()},o=()=>{n("apol-cookie-banner",!0,{path:"/",expires:ss}),is.forEach(d=>{if(d==="apol-cookie-banner"){n(d,!0,{path:"/",expires:ss});return}r(d)}),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(d=>{u.push({variant:d.href?"tertiary":"primary",href:d.href,onClick:d.onClick,className:"gtm-trackable","data-gtm-event-context":"cookie-banner","data-gtm-event-type":`cookie-${d.gtmType}-click`,children:e.formatMessage({id:`${as}buttons_${d.id}`})})}),c.jsxs("aside",{id:"cookie-banner",className:"text-medium",children:[c.jsx("h6",{children:e.formatMessage({id:`${as}title`})}),c.jsx("p",{children:e.formatMessage({id:`${as}text`})}),c.jsx(or,{buttons:u})]})},Yt={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:Un["data-protection"].default,gtmType:"email-dpo-link"},euDataProtection:{email:Un["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:Un.support,gtmType:"concierge-email-click"},business:{email:Un.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 Gn="footer_",Ha="SiteFooter",Fc=({group:e})=>{const t=Yt[e].order||[];let n=!1;return"text"in Yt[e]&&(n=Yt[e].text),c.jsxs(y.Fragment,{children:[c.jsx("p",{className:"pre-title",children:c.jsx(ie.FormattedMessage,{id:`${Gn}${e}`})}),Array.isArray(t)&&t.length>0&&c.jsx("ul",{className:"text-medium",children:t.map(r=>{if(["order","child","text"].includes(r))return null;const{href:a,gtmType:i}=Yt[e][r],s={};return["legal"].includes(e)&&(s.target="_blank",s.rel="noopener"),c.jsx("li",{children:c.jsx("a",{href:a,className:"gtm-trackable","data-gtm-event-context":Ha,"data-gtm-event-type":i,...s,children:c.jsx(ie.FormattedMessage,{id:`${Gn}${e}_${r}`})})},`${e}_${r}`)})}),typeof n!="boolean"&&"order"in n&&Array.isArray(n.order)&&c.jsx("dl",{className:"text-medium",children:n.order.map(r=>c.jsxs(y.Fragment,{children:[c.jsx("dt",{children:c.jsx(ie.FormattedMessage,{id:`${Gn}${e}_${r}`})}),c.jsxs("dd",{children:[typeof n!="boolean"&&n[r].address&&c.jsx("address",{children:c.jsx(ie.FormattedMessage,{id:`${Gn}${e}_${r}_address`,values:{br:c.jsx("br",{})}})}),typeof n!="boolean"&&n[r].email&&c.jsx("a",{href:`mailto:${n[r].email}`,className:"gtm-trackable","data-gtm-event-context":Ha,"data-gtm-event-type":n[r].gtmType,children:n[r].email})]})]},`dl-${e}-${r}`))})]},e)},$o=()=>c.jsx("div",{id:"footer",children:c.jsxs("div",{className:"wrapper",children:[c.jsx(Ja,{element:"hr"}),c.jsx(co,{variant:"inverted",version:"full",className:"gtm-trackable","data-gtm-event-context":Ha,"data-gtm-event-type":"logo-homepage-link"}),c.jsx("footer",{children:["platform","community","company","contact"].map(e=>c.jsxs("div",{className:"group",children:[c.jsx(Fc,{group:e}),Object.keys(Yt[e]).includes("child")&&c.jsx(Fc,{group:Yt[e].child})]},e))}),c.jsx("hr",{}),c.jsxs("div",{className:"sub-footer",children:[c.jsx("ul",{children:Array.isArray(Yt.social.order)&&Yt.social.order.map(e=>{const t=Yt.social[e];return c.jsx("li",{className:e,children:c.jsx("a",{href:t.href,target:"_blank",rel:"noopener noreferrer",className:"gtm-trackable","data-gtm-event-context":Ha,"data-gtm-event-type":"social-click",children:c.jsx("span",{className:"hidden",children:c.jsx(ie.FormattedMessage,{id:`${Gn}social_${e}`})})})},e)})}),c.jsx("small",{children:c.jsx(ie.FormattedMessage,{id:`${Gn}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===Dt.ACCOUNT&&t===!1&&n[Dt.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 Dt.SITE:o=document.querySelector("#header .menu-button"),o||(o=document.querySelector("#navigation .navigation-button"));break;case Dt.SEARCH:o=document.querySelector("#header .toggle-search-button");break;case Dt.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=Mc(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 Dt.SITE:if(n){const u=$e.findFirstChild(t.current.children,"className","has-submenu parent"),d=$e.findFirstChild(u.children,"id",Dt.SITE);s=$e.findFirstChild(d.children,"href")}else s=$e.findFirstChild(t.current.children,"href");break;case Dt.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)}}},Ur={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:"/api/next-ui/login"},signup:{href:"/signup?ref=header-banner",props:{variant:"primary"}}}},Va=({id:e,isLoggedIn:t=!1,isDesktopVersion:n=!1,menus:r={},callback:a=()=>{},doTrack:i=null})=>{const s=ie.useIntl(),o=Mc(Ur,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,d=e.includes("buttons.");let h=`header_${e.replaceAll(".","_")}`;o.hasVariantText&&(h+=`_logged${t?"In":"Out"}`);let m=!1;if(o.href){let F=o.gtmType||`${e}-click`;if(F.includes(".")){const _=F.split("."),w=_[_.length-2];F=`${w==="topics"?`${w}-`:""}${_[_.length-1]}`}m={href:o.href},u&&(m={...m,className:"gtm-trackable","data-gtm-event-type":F,"data-gtm-event-context":"HeaderButtons"}),d&&(m={...m,variant:"secondary",size:{mobile:"small",881:"large"},...o.props||{}})}const p=o.order&&o.order[0]&&o[o.order[0]],g=p&&o[o.order[0]].order,f=m&&window.location.pathname===o.href;let b={},v={},C={};if(f&&(b={...b,"aria-current":"page"}),p){const F=o.menuId||e,_={onClick:w=>$e.events.onClick(w,{id:F,callback:a,isOpen:r[F]}),onFocus:()=>$e.events.onFocus({id:F}),onBlur:()=>$e.events.onBlur({id:F,callback:a}),onMouseLeave:()=>$e.events.onBlur({id:F,callback:a}),onMouseEnter:()=>$e.events.onMouseEnter({id:F,callback:a})};v={..._,id:F===Dt.SITE?Dt.SITE:Dt.ACCOUNT},n&&(g&&(C={..._,className:"navigation-button",onKeyPress:w=>{w.key==="Enter"&&$e.events.onClick(w,{id:F,callback:a,isOpen:r[F]})},"aria-haspopup":!0,"aria-expanded":r[F],"aria-controls":F}),v={...v,hidden:F in r?!r[F]:!0}),g||(v={...v})}return c.jsxs("li",{className:K({[o.className]:o.className,"has-submenu":p,parent:g,active:f}),...b,children:[m?y.createElement(d?Fe:"a",m,s.formatMessage({id:h})):n&&o.order&&g?c.jsxs("button",{...C,children:[s.formatMessage({id:h}),c.jsx(Ie,{children:s.formatMessage({id:`header_menu_${r[Dt.SITE]?"hide":"show"}`})})]}):s.formatMessage({id:h}),o.order&&c.jsx("ul",{...v,children:o.order.map(F=>{if(!o[F])return null;const _={isLoggedIn:t,isDesktopVersion:n,menus:r,callback:a,doTrack:l?u:null};return o[F].order?c.jsxs("li",{className:K({[o[F].className]:o[F].className}),children:[s.formatMessage({id:`${h}_${F}`}),c.jsx("ul",{children:o[F].order.map(w=>c.jsx(Va,{id:`${e}.${F}.${w}`,..._},w))})]},F):c.jsx(Va,{id:`${e}.${F}`,..._},F)})})]},e)};const Xw={height:67,height_desktop:83};var Dt=(e=>(e.NAVIGATION="navigation",e.SEARCH="search",e.ACCOUNT="account-navigation",e.SITE="site-navigation",e))(Dt||{});const Lo=({showNavigation:e=!0})=>{const t=ie.useIntl(),n=y.useContext(st),r=Pn(!0,!0),a=n&&typeof n.id=="string",i=y.useMemo(()=>$e.getIsDesktopVersion(a,r),[a,r]),[s,o]=y.useReducer(Hr,{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:d}=s,h=y.useRef(s);y.useEffect(()=>{h.current=s},[s]),zc({scrollPosition:Xw[`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 m=(v,C,F=!1)=>{$e.handleMenus({id:v,value:C,menus:h.current.menus,dispatch:o,forceHandle:F})},p=y.useRef(null),g=v=>{v.key==="Escape"&&["site-navigation","search","account-navigation"].forEach(C=>{h.current.menus[C]&&m(C,!1,!0)})};y.useEffect(()=>{var v;return(v=document.getElementById("header"))==null||v.addEventListener("keydown",g),()=>{var C;(C=document.getElementById("header"))==null||C.removeEventListener("keydown",g)}},[]),er(()=>{u["site-navigation"]&&$e.autoFocus({menu:"site-navigation",navigationRef:p,isDesktopVersion:i.navigation,focusElements:d,dispatch:o})},[u["site-navigation"]]),er(()=>{u["account-navigation"]&&$e.autoFocus({menu:"account-navigation",navigationRef:p,isDesktopVersion:i.navigation,focusElements:d,dispatch:o})},[u["account-navigation"]]);const f=c.jsxs(c.Fragment,{children:[!i.search&&c.jsx("button",{className:"search toggle-search-button",onClick:v=>{v.preventDefault(),v.stopPropagation(),m("search",!u.search)},"aria-haspopup":"true","aria-expanded":u.search,"aria-controls":"search-form",children:c.jsx(Ie,{children:t.formatMessage({id:`header_search_${u.search?"hide":"show"}`})})}),c.jsx(gh,{id:"global-search",handleToggle:{searchIsOpen:u.search,isDesktopVersion:i.search},gtmContext:"search-bar-header",gtmEvent:"form-submission"})]}),b=c.jsxs(c.Fragment,{children:[!i.navigation&&c.jsx("button",{className:"menu-button gtm-trackable",onClick:v=>{v.preventDefault(),v.stopPropagation(),m("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:c.jsx(Ie,{children:t.formatMessage({id:`header_menu_${u["site-navigation"]?"hide":"show"}`})})}),c.jsx("ul",{ref:p,id:"navigation",hidden:i.navigation||u["account-navigation"]?!1:!u["site-navigation"],"data-showing":!i.navigation&&u["account-navigation"]?"account":"default",children:Ur.order.map(v=>c.jsx(Va,{id:v,isLoggedIn:a,isDesktopVersion:i.navigation,menus:{"site-navigation":u["site-navigation"],"account-navigation":u["account-navigation"]},callback:m},v))})]});return n&&n.isLoading?null:c.jsxs(c.Fragment,{children:[c.jsxs("nav",{id:"header",className:K({"logged-in":a,"logged-out":!a,visible:l}),children:[c.jsx(Ie,{element:"a",href:"#content-of-page",children:t.formatMessage({id:"header_skip"})}),c.jsx(co,{variant:"monochrome"}),e&&c.jsxs(c.Fragment,{children:[i.navigation?c.jsxs(c.Fragment,{children:[b,f]}):c.jsxs(c.Fragment,{children:[f,b]}),a?c.jsxs("button",{className:"account-button",onClick:v=>$e.events.onClick(v,{id:"account-navigation",callback:m,isOpen:u["account-navigation"]}),onMouseEnter:()=>$e.events.onMouseEnter({id:"account-navigation",callback:m}),onMouseLeave:()=>$e.events.onBlur({id:"account-navigation",callback:m}),"aria-haspopup":"true","aria-expanded":u["account-navigation"],"aria-controls":"account-navigation",children:[c.jsx(Ie,{children:t.formatMessage({id:`header_account_${u["account-navigation"]?"hide":"show"}`})}),c.jsx(gn,{name:n&&n.name||"",src:n&&n.image&&n.image.thumbnail||""})]}):c.jsx("ul",{className:"sign-in-buttons",children:Ur.buttons.order.map(v=>c.jsx(Va,{id:`buttons.${v}`},v))})]})]}),c.jsx("hr",{id:"content-of-page"}),c.jsx("div",{className:K("overlay",{open:u["site-navigation"]||u["account-navigation"]||!i.search&&u.search})})]})};const eE=()=>{const e=ie.useIntl();return c.jsxs(c.Fragment,{children:[c.jsx(Lo,{}),c.jsx("div",{id:"content",children:c.jsx(pn,{variant:"error",text:e.formatMessage({id:"pageLayout_error"})})}),c.jsx($o,{})]})},yh=({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:d="default",variant:h="default",circle:m="default",modal:p="default"}=i,g=Ic(),[f,b]=y.useState(""),v=k=>{const{detail:{message:j}}=k;b(j)};y.useEffect(()=>(window.scrollTo(0,0),document.addEventListener("ariaLive",v),()=>{document.removeEventListener("ariaLive",v)}),[g]);const C=Da(e,{locale:o}),F=Da(t,{locale:o}),_=Da(n,{locale:o}),w={};return d!=="default"&&(w[d]=!0),h!=="default"&&(w[h]=!0),m!=="default"&&(w[m]=!0),c.jsx(Xh.ErrorBoundary,{onError:r,fallback:c.jsx(eE,{}),children:c.jsxs(y.Suspense,{fallback:null,children:[c.jsxs("div",{id:"wrapper",className:K(s,w,{"has-footer":u}),children:[c.jsx(Lo,{showNavigation:l}),c.jsxs("main",{id:"content-wrapper",children:[F&&c.jsx("div",{className:K("additional-content prepended",{"large-modal":p==="large"}),children:F}),y.createElement(d==="bold"?so:"div",{id:"content",children:C,className:K({"large-modal":p==="large"})})]}),_&&c.jsx("div",{className:"additional-content appended",children:_}),u&&c.jsx($o,{}),c.jsx(bh,{})]}),f&&c.jsx(Ie,{"aria-live":"polite",showOnFocus:!1,"data-testid":"layout-aria-live",children:f})]})})},Bc={default:"tags_",headerTopics:"header_topics_topics_"},os={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"},tE={getTagDetails:e=>{if(e.includes("topic_")){if(e=os.topic[e.replace("topic_","")],e){const t=Ur.topics.topics[e].href;return t?{id:e,href:t,text:`${Bc.headerTopics}${e}`}:null}return null}return os[e]?(e=os[e],{id:e,text:`${Bc.default}${e}`}):null}};const nE=({tags:e=[],color:t="default",forceOneLine:n=!1,canHaveLinks:r=!0,className:a="",gtmType:i="tag-click",gtmContext:s="tags"})=>{const o=ie.useIntl();if(!e||e.length<1)return null;const l=[];return e.forEach(u=>{if(!u)return;const d=tE.getTagDetails(u);d&&l.push(d)}),l.length<1?null:c.jsx("ul",{className:K("tags text-small",t,a,{"one-line":n}),children:l.map(u=>{const d=o.formatMessage({id:u.text});return c.jsx("li",{children:u.href&&r?c.jsx("a",{href:u.href,className:"gtm-trackable","data-gtm-event-type":i,"data-gtm-event-context":s,children:d}):d},u.id)})})};const xh=25,Dh=({members:{data:e=[],total:t=e.length},communitySlug:n,isMember:r=!1,hasNextPage:a=!1,loadNextPage:i=()=>{},profile:s,gtmContext:o="member",gtmType:l="member-click",showHeader:u=!0,showPlaceholders:d=!1,className:h=""})=>{const m=ie.useIntl(),p="membersList",g=y.useContext(st),[f,b]=y.useState(!1);return e.length===0&&!d?null:c.jsxs("div",{className:K("members-list",h),children:[u?c.jsxs("h1",{children:[m.formatMessage({id:p}),c.jsx("span",{className:"count",children:t})]}):c.jsx(c.Fragment,{}),c.jsxs("ul",{children:[r?c.jsxs("li",{children:[c.jsx(Jt,{member:g,gtmContext:o,gtmType:l,badges:{showBadges:!0,scopes:[{scope:it.COMMUNITIES,area:n||""},{scope:it.PLATFORM,area:"all"}]}}),c.jsx(mn,{href:"/profiles/me",className:"text-small",onClick:v=>{v==null||v.preventDefault(),v==null||v.stopPropagation(),b(!0)},children:m.formatMessage({id:`${p}_profile`})})]}):c.jsx(c.Fragment,{}),e.map((v,C)=>c.jsxs("li",{children:[c.jsx(Jt,{member:v,gtmContext:o,gtmType:l,badges:{showBadges:!0,scopes:[{scope:it.COMMUNITIES,area:n||""},{scope:it.PLATFORM,area:"all"}]}}),v.isAdmin&&c.jsx(Qt,{children:m.formatMessage({id:`${p}_admin`})})]},C)),d&&e.length===0&&t>0?[...new Array(Math.min(t,xh))].map((v,C)=>c.jsx("li",{children:c.jsx(ni,{layout:"member"})},C)):c.jsx(c.Fragment,{})]}),a&&c.jsx(Vr,{hasNextPage:a,loadNextPage:i,icon:{icon:"arrow-down",position:"right"},gtmContext:o}),s?c.jsx(hi,{form:s,showModal:f,content:{title:m.formatMessage({id:`${p}_modal_title`})},functions:{onClose:()=>{b(!1)}}}):c.jsx(c.Fragment,{})]})},Ys=e=>{const t={};return Object.keys(e).forEach(n=>n.includes("Id")?t[n]=e[n]:t[`${n}Slug`]=e[n]),t},dr=e=>{var t,n,r,a,i,s;return e&&!e.error?{id:e==null?void 0:e.id,name:(t=e==null?void 0:e.data)==null?void 0:t.name,organization:(n=e==null?void 0:e.data)==null?void 0:n.organization,jobTitle:(r=e==null?void 0:e.data)==null?void 0:r.jobTitle,location:(a=e==null?void 0:e.data)==null?void 0:a.location,image:{thumbnail:((i=e==null?void 0:e.data)==null?void 0:i.thumbnail)||void 0},badges:(s=e==null?void 0:e.data)==null?void 0:s.badges}:"deleted"};const Ka=({icon:e,className:t="",...n})=>c.jsx(Fe,{className:K("discussion-button",t),variant:"tertiary",icon:e,...n}),rE={showForm:!1},fi=y.createContext(rE),Ch=({children:e})=>{const[t,n]=y.useState({showForm:!1});return c.jsx(fi.Provider,{value:{...t,updateConversation:n},children:e})},aE=({intlPath:e,showGuidelines:t,type:n,gtmContext:r})=>{const a=ie.useIntl();return t?c.jsx("small",{children:jt(a.formatMessage,`${e}explainer`,n,"action",{a:i=>c.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})})}):c.jsx(c.Fragment,{})},iE=({formID:e,intlPath:t,showLabel:n,type:r})=>{const a=ie.useIntl();return n?c.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`})}):c.jsx(Ie,{element:"label",showOnFocus:!1,htmlFor:`${e}-input`,children:jt(a.formatMessage,`${t}label_action`,r,"action")})};let ga=null;const Xe="discussion_form_",Zr=({id:e,parentId:t,content:n={type:"response",slugs:{}},userHasPermissions:r=!0,meta:a,placeholder:i,maxLength:s=0,buttons:o,forceShow:l={cancel:!1,error:!1},isCommunity:u=!1,functions:d,data:h={},gtmContext:m="DiscussionForm"})=>{var Se,Ye,Ke;const p=ie.useIntl(),g=y.useContext(st),[f,b]=y.useState(""),{isLoading:v=!1,isInWrapper:C=!1,isInOverlay:F=!1,isAutoFocused:_=!1,isEditing:w=!1,hasTitleField:k=!1,isPrepopulated:j=!1,showTitle:q=!1,showGuidelines:P=!0,showDivider:z=!1,showSuccessMessage:R=!0}=a||{},{onChange:A=()=>{},create:E=()=>{},handleSaveEdit:S=()=>{},handleCancel:O=()=>{},callback:V=()=>{},onMention:H=()=>{},listMembers:Q=()=>Promise.resolve([]),clickMentionFallback:ae=()=>{},props:D={create:{projectNames:["questions-answers"]}}}=d,[$,X]=y.useState({title:k&&k.text||"",body:w&&w.text||j&&j.text||""}),[B,T]=y.useState(l.error||!1),[L,I]=y.useState(!1);if(y.useEffect(()=>{u&&!w&&j&&j!==$.body&&X({...$,body:j.text||""})},[j]),v)return c.jsx(St,{className:"discussion-card discussion-form","data-testid":"loading-placeholder"});const W=je=>{X({...$,body:je}),A({body:je});let Oe;!g||!g.id?Oe=jt(p.formatMessage,`${Xe}error_loggedOut`,n.type,"action"):r?s>0&&je.length>=s&&(Oe=`${Xe}error_tooLong`):Oe=jt(p.formatMessage,`${Xe}error_noPermission`,n.type,"action"),Oe?T(Oe):B&&T(!1)};let U=`${n.type}-form`;if(n.type==="response"||n.type==="reply"){const je=((Se=n.slugs)==null?void 0:Se.reply)||((Ye=n.slugs)==null?void 0:Ye.answer)||((Ke=n.slugs)==null?void 0:Ke.question)||"";je&&(U=`${U}-${je.slice(-15)}`)}e&&(U=`${e}-${U}`);const ne=async()=>{if(!g||!g.id||!r||pe)return;ga&&clearTimeout(ga),I("submitting");const je=window.location.pathname;try{let Oe;switch(n.type){case"post":Oe=await E({title:$.title,content:$.body});break;case"question":Oe=await E({title:$.body,authorId:g&&g.id,...D==null?void 0:D.create});break;case"response":Oe=await E({questionSlug:n.slugs.question},{body:$.body,authorId:g&&g.id,contentPath:je});break;case"reply":Oe=await E({questionSlug:n.slugs.question,answerSlug:n.slugs.answer},{body:$.body,authorId:g&&g.id,contentPath:je});break;default:break}await dm(1e3),V&&await V(Oe),ga=setTimeout(()=>{X({title:"",body:""}),I("submitted"),b(jt(p.formatMessage,`${Xe}success`,n.type,"action"));const De=new Event(tt.DISCUSSION_FORM_SUBMITTED);document.dispatchEvent(De),re()},500)}catch(Oe){const De=Oe;let Le=`${Xe}error`;De!=null&&De.message.includes("entry already exists")&&(Le=jt(p.formatMessage,`${Xe}error_alreadyExists`,n.type,"action")),De!=null&&De.message.includes("429")?Le=jt(p.formatMessage,`${Xe}error_tooMany`,n.type,"action"):De!=null&&De.message.includes("400")&&(Le=`${Xe}error`),T(Le),re()}},re=()=>{ga=setTimeout(()=>{T(!1),I(!1),b("")},5e3)},le=!$.title||!au($.title),ee=!$.body||!au($.body);let pe=ee;k&&(pe=le&&ee);const me=L==="submitting",_e=[{component:iE,props:{formID:U,intlPath:Xe,showLabel:k!==!1,type:n.type}},{component:dh,props:{id:`${U}-input`,value:L==="submitting"&&!B?"":$.body,placeholder:i||jt(p.formatMessage,`${Xe}placeholder`,n.type,"action"),maxLength:s,meta:{isInOverlay:F},functions:{onChange:W,onMention:H,listMembers:Q,clickMentionFallback:ae},data:h,autoFocus:w!==!1||_&&!k,"aria-invalid":!!B,"aria-errormessage":"error-message"}},{component:aE,props:{intlPath:Xe,showGuidelines:P,type:n.type,gtmContext:m}}];z&&_e.push({component:Ht}),k&&_e.unshift({id:"title",type:"text",value:k.text,limit:250,autoFocus:_,label:p.formatMessage({id:`${Xe}titleField_label`}),placeholder:p.formatMessage({id:`${Xe}titleField_placeholder`}),functions:{onChange:je=>{X({...$,title:je}),A({title:je})}},validation:[{condition:()=>pe,error:p.formatMessage({id:`${Xe}titleField_error`})}]});let Be=!g||!g.id||!r||pe||me;return w&&(k?Be=Be||$.body===w.text&&$.title===k.text:Be=Be||$.body===w.text),c.jsxs(c.Fragment,{children:[c.jsxs(nn,{id:U,className:K("discussion-card discussion-form",{"no-styling":C&&w}),meta:{shouldReset:!0,shouldHide:!1,showRequiredLabels:!1,shouldShowCancelButton:w&&!me||l.cancel},functions:{onSuccess:async()=>{if(w){I("submitting"),S($);return}await ne()},onCancel:O},fields:_e,intlPath:Xe,button:{variant:"primary",size:{mobile:"small",600:"medium"},"data-gtm-event-context":m,"data-gtm-event-type":`${w?"save":"submit"}-${n.type}-click`,"data-testid":"save-button",disabled:Be,text:{default:!w&&(o!=null&&o.submit)?o==null?void 0:o.submit:p.formatMessage({id:`${Xe}${w?"save":"post"}`}),submitting:p.formatMessage({id:`${Xe}${w?"saving":"posting"}`})}},secondaryActionButton:{variant:"secondary",size:{mobile:"small",600:"medium"},"data-gtm-event-context":m,"data-gtm-event-type":`cancel-${n.type}-click`,disabled:!l.cancel&&(!g||!g.id||!$.body),text:o!=null&&o.cancel?o==null?void 0:o.cancel:p.formatMessage({id:`${Xe}cancel`})},gtm:{context:m,event:`${n.type}-form`},"data-testid":`discussion-${n.type}-form`,children:[q&&!w&&["question"].includes(n.type)&&c.jsx("h2",{children:jt(p.formatMessage,`${Xe}title`,n.type,"action")}),c.jsx(Jt,{member:g?{...g,link:!1}:"community",gtmContext:m,gtmType:"profile-click",badges:{showBadges:!0,scopes:[{scope:it.COMMUNITIES,area:t||""},{scope:it.PLATFORM,area:"all"}]}})]}),L==="submitted"&&R&&c.jsx(Mr,{className:"success","data-testid":"success",children:jt(p.formatMessage,`${Xe}success`,n.type,"action")}),B&&c.jsx(Mr,{id:"error-message",className:"error","data-testid":"error",children:l.error?l.error:typeof B=="string"?B.includes(" ")?B:p.formatMessage({id:B},{action:p.formatMessage({id:`discussion_action_${n.type}`}),maxLength:s}):B}),f&&c.jsx(Ie,{"aria-live":"polite",showOnFocus:!1,children:f})]})},sE=Object.freeze(Object.defineProperty({__proto__:null,default:Zr},Symbol.toStringTag,{value:"Module"})),oE=({question:e,answer:t,reply:n})=>({...e&&{questionSlug:e},...t&&{answerSlug:t},...n&&{replySlug:n}}),uE=(e,t=10)=>!e||e.length===0?[]:e.slice(0,t);function lE(e){return y.useCallback(t=>{var s,o,l,u;if(!t||!["ArrowUp","ArrowDown"].includes(t.key||""))return;t.stopPropagation(),t.preventDefault();const n=t.key==="ArrowUp"?"up":"down",r=(s=t.currentTarget)==null?void 0:s.parentElement;let a=r==null?void 0:r.nextElementSibling;if(n==="up"){const d=r==null?void 0:r.previousElementSibling;d?a=d:(a=(o=r==null?void 0:r.parentElement)==null?void 0:o.lastElementChild,(a==null?void 0:a.getAttribute("data-index"))==="-1"&&(a=a==null?void 0:a.previousElementSibling))}else(!a||(a==null?void 0:a.getAttribute("data-index"))==="-1")&&(a=(l=r==null?void 0:r.parentElement)==null?void 0:l.firstElementChild);if(!a)return;const i=Number((a==null?void 0:a.getAttribute("data-index"))||"0");e([{type:"tabbableLink",value:i}]),(u=a==null?void 0:a.querySelector("a,button"))==null||u.focus()},[e])}const cE=y.lazy(()=>Promise.resolve().then(()=>HE));let jr=!1;const us=()=>{jr!==!1&&(clearTimeout(jr),jr=!1)},dE=5;let ls=null;const wh=({element:e="div",likes:t=0,peopleWhoLiked:n=!1,isShort:r=!0,userLiked:a=!1,content:i={type:"reply",slugs:{}},canLike:s=!0,activityId:o,basePath:l,parentId:u,badges:d,functions:{createLike:h=()=>{},deleteLike:m=()=>{},listLikes:p=async()=>({next:"",results:[]})}})=>{const g=ie.useIntl(),f={numberOfLikes:t,userLikedContent:a,ignoreInteractions:!1,showLikers:!1,tabbableLink:0,showLikesModal:!1},[b,v]=y.useReducer(Hr,f),{numberOfLikes:C,userLikedContent:F,ignoreInteractions:_,showLikers:w,tabbableLink:k,showLikesModal:j}=b,q=lE(v);y.useEffect(()=>{v([{type:"userLikedContent",value:a}])},[a]);const P=y.useMemo(()=>uE(n,dE),[n]),z=S=>{if(S.preventDefault(),S.stopPropagation(),v([{type:"showLikers",value:!1}]),jr)return us(),!1;if(us(),_||!s)return!1;jr=setTimeout(R,350)},R=async()=>{if(us(),_||!s)return!1;let S=F?C-1:C+1;S<0&&(S=0),v([{type:"ignoreInteractions",value:!0},{type:"numberOfLikes",value:S},{type:"userLikedContent",value:!F}]);try{if(i&&i.slugs){const O=oE(i.slugs);F?await m(O):await h({...O,payload:{contentPath:window.location.pathname}})}}catch{v([{type:"numberOfLikes",value:t},{type:"userLikedContent",value:a}])}finally{v([{type:"ignoreInteractions",value:!1}])}},A=()=>{ls=setTimeout(()=>{v([{type:"showLikers",value:!1}])},500)},E=()=>{ls&&clearTimeout(ls)};return y.createElement(e,{className:"likes-wrapper",onKeyDown:S=>{S.key==="Escape"&&v([{type:"showLikers",value:!1}])},onMouseEnter:()=>{E(),v([{type:"showLikers",value:!0}])},onMouseLeave:()=>{A()}},c.jsxs(c.Fragment,{children:[c.jsx(Ka,{className:K("discussion-button text-medium action-button",{"show-spinner":_,"is-liked":F,disabled:!s}),icon:{icon:F?"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:z,screenreaderText:s?g.formatMessage({id:`discussion_likes_${F?"unlike":"like"}`},{action:g.formatMessage({id:`discussion_action_${i.type}`})}):!1,"aria-pressed":F,children:c.jsx("span",{"data-testid":"number-of-likes",className:"number-of-likes",children:g.formatMessage({id:`discussion_likes${r?"_short":""}`},{number:C})})}),n&&c.jsxs(c.Fragment,{children:[c.jsx(Ie,{"data-testid":"like-a11y-button",element:"button",className:"tertiary small icon navigation_arrow",onFocus:()=>{E()},onBlur:()=>A,onClick:S=>{var V;S.preventDefault(),S.stopPropagation(),E(),v([{type:"showLikers",value:!0}]);const O=(V=S.currentTarget.nextSibling)==null?void 0:V.childNodes[0];if(O){const H=O.querySelector("li:first-child a");H&&(v([{type:"tabbableLink",value:0}]),setTimeout(()=>{H.focus()},100))}},onKeyDown:S=>{S.key==="Escape"&&(S.preventDefault(),S.stopPropagation(),A())},"aria-expanded":w,"aria-controls":`likes-tooltip-${i.slug}`,children:c.jsx(Ie,{showOnFocus:!1,children:g.formatMessage({id:"discussion_likes_show"},{action:i.type})})}),c.jsx(Mn,{id:`likes-tooltip-${i.slug}`,isOpen:w,isLoading:n.length===0,children:n.length&&c.jsxs("ul",{children:[P.map((S,O)=>{if(typeof S=="string")return null;const V={};return k!==O&&(V.tabIndex=-1),c.jsx("li",{"data-index":O,children:c.jsx(mn,{href:S.id?`/profiles/${S.id}`:void 0,gtmContext:"Likes",gtmType:"liked-name-click",onFocus:()=>E(),onKeyDown:q,...V,children:S.name?S.name:c.jsx("span",{className:"deleted-user",children:g.formatMessage({id:"member_deleted"})})})},S.id||window.btoa(S.name||""))}),c.jsx("li",{"data-index":P.length,className:"show-all",children:c.jsx(Fe,{variant:"tertiary",onClick:()=>{E(),A(),v([{type:"showLikesModal",value:!0}])},onKeyDown:q,children:g.formatMessage({id:"discussion_likes_showAll"})})})]})}),j&&c.jsx(lr,{children:c.jsx(y.Suspense,{children:c.jsx(cE,{activityId:o,basePath:l,parentId:u,likeCount:t,showModal:j,functions:{onClose:()=>v([{type:"showLikesModal",value:!1}]),likes:{list:p}}})})})]})]}))},fE="post",hE="reply",Eh="00000000-0000-0000-0000-000000000000";function zo({queryClient:e,queryKey:t}){function n(r,a,i){e.setQueryData(t,i)}return n}function qo({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 mE(){return{latest_reactions:{like:[],reply:[]},reaction_counts:{like:0,reply:0},own_reactions:{like:[],reply:[]}}}function pE(){return{latest_children:{like:[],reply:[]},children_counts:{like:0,reply:0},own_children:{like:[],reply:[]}}}function _h(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 gE({title:e,content:t}){return{title:e,content:t,id:Eh,time:new Date().toISOString(),verb:fE}}function Ac({activity:e,user:t}){return{...e,actor:_h(t),...mE()}}function Za({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 kh({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 Ya({activity:e,reaction:t}){var n,r,a;t?(e.latest_reactions={...e.latest_reactions||{},pin:[...((r=e.latest_reactions)==null?void 0:r.pin)||[],t]},e.own_reactions={...e.own_reactions||{},pin:[...((a=e.own_reactions)==null?void 0:a.pin)||[],t]}):e.reaction_counts={...e.reaction_counts||{},pin:(n=e.reaction_counts)!=null&&n.pin?e.reaction_counts.pin+1:1}}function Fh({activity:e}){var t;e.reaction_counts={...e.reaction_counts||{},pin:(t=e.reaction_counts)!=null&&t.pin?e.reaction_counts.pin-1:0},e.latest_reactions={...e.latest_reactions||{},pin:[]},e.own_reactions={...e.own_reactions||{},pin:[]}}function vE({activityId:e,replyId:t,content:n}){return{activity_id:e,data:{content:n},id:Eh,kind:hE,parent:t||""}}function Tc({reply:e,user:t}){const n=_h(t);return{...e,user_id:n.id,user:n,...pE()}}function Sc({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 bE({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)})}function yE(e){return{pages:[{next:"",results:[e]}],pageParams:[""]}}function xE(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 DE(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 Ga(e,t,n){return t?n!=null&&n.append?xE(e,t,n):DE(e,t,n):yE(e)}function Nt(e,t){if(t)for(const{results:n}of t.pages){const r=n.find(({id:a})=>a===e);if(r)return r}}function Bh(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 Wo(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 Ah=(e,t)=>{const n=new CustomEvent(tt.DISCUSSION_POST_ADDED,{detail:{id:e,type:t}});document.dispatchEvent(n)};let jc,cs=0;const Th=()=>{y.useEffect(()=>(document.addEventListener(tt.DISCUSSION_POST_ADDED,e),()=>{document.removeEventListener(tt.DISCUSSION_POST_ADDED,e)}),[]);const e=t=>{const{id:n,type:r}=t.detail;if(!n||!r||r==="activity")return;clearTimeout(jc);const a=document.getElementById(n);if(a){a.scrollIntoView({behavior:"smooth",block:"start"}),cs=0;return}cs++,!(cs>10)&&(jc=setTimeout(()=>{e(t)},50))}},ir=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}),Vt=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}),Uo=Object.freeze({actor:`SU:${ir.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"}),CE=Object.freeze({actor:`SU:${Vt.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"}),wE=Object.freeze({actor:`SU:${ir.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"}),EE=Object.freeze({actor:`SU:${Vt.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:Uo.id,kind:"like",created_at:"2023-11-24T17:58:36.162000",data:{},parent:"",updated_at:"2023-11-24T17:58:36.162000",user_id:Vt.id,children_counts:{},latest_children:{},latest_children_extra:{},own_children:{},user:{id:Vt.id,data:{},created_at:"2023-11-24T17:58:36.162000",updated_at:"2023-11-24T17:58:36.162000"}});Object.freeze({id:"some-reaction-id-1",activity_id:Uo.id,kind:"pin",created_at:"2023-11-24T17:58:36.162000",data:{},parent:"",updated_at:"2023-11-24T17:58:36.162000",user_id:Vt.id,children_counts:{},latest_children:{},latest_children_extra:{},own_children:{},user:{id:Vt.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:Vt.id,user:{id:Vt.id,data:{},created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z"},kind:"reply",activity_id:Uo.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:ir.id,user:{id:ir.id,data:{},created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z"},kind:"reply",activity_id:CE.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:Vt.id,user:{id:Vt.id,data:{},created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z"},kind:"reply",activity_id:wE.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:ir.id,user:{id:ir.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 4..."},parent:"",latest_children:{},children_counts:{}});function _E({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:a,user:i}){const{mutate:s}=We.useMutation({mutationFn:e,onMutate:o=>t(l=>{const u=Ac({activity:gE(o),user:i});return Ga(u,l)}),onError:n,onSuccess:(o,l,u)=>{const d=Ac({activity:o,user:i});r.setQueryData(a,Ga(d,u,{replace:!0})),setTimeout(()=>{Ah(d.id,"activity")},0)}});return s}function kE({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=We.useMutation({mutationFn:e,onMutate:({activityId:a,content:i})=>t(s=>{const o=Nt(a,s);return o&&(o.content=i),s}),onError:n});return r}function FE({queryFns:{create:e,edit:t,like:n,list:r,remove:a,unlike:i,pin:s,unpin:o},queryKey:l,rankingMethod:u}){const d=We.useQueryClient(),h=ti(),m={queryClient:d,queryKey:l},p={mutationHandlers:{error:zo(m),mutate:qo(m)},user:h,...m},g=_E({...p,mutationFn:e}),f=kE({...p,mutationFn:t}),b=BE({...p,mutationFn:n}),v=SE({...p,mutationFn:a}),C=jE({...p,mutationFn:i}),F=TE({...p,mutationFn:s}),_=OE({...p,mutationFn:o}),{activities:w,...k}=AE({queryKey:l,queryFn:r,rankingMethod:u});return{activities:w,mutations:{create:g,edit:f,remove:v,like:b,unlike:C,pin:F,unpin:_},user:h,...k}}function BE({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:a}){const{mutate:i}=We.useMutation({mutationFn:e,onMutate:({activityId:s})=>t(o=>{const l=Nt(s,o);return l&&Za({activity:l}),o}),onError:n,onSuccess:(s,{activityId:o},l)=>{const u=Nt(o,l);u&&Za({activity:u,reaction:s}),r.setQueryData(a,l)}});return i}function AE({queryFn:e,queryKey:t,rankingMethod:n}){const{data:r,error:a,isLoading:i,hasNextPage:s,fetchNextPage:o}=We.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:Wo(r),error:a,isLoading:i,hasNextPage:s,fetchNextPage:o}}function TE({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:a}){const{mutate:i}=We.useMutation({mutationFn:e,onMutate:({activityId:s})=>t(o=>{const l=Nt(s,o);return l&&Ya({activity:l}),o}),onError:n,onSuccess:(s,{activityId:o},l)=>{const u=Nt(o,l);u&&Ya({activity:u,reaction:s}),r.setQueryData(a,l)}});return i}function SE({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=We.useMutation({mutationFn:e,onMutate:({activityId:a})=>t(i=>Bh(a,i)),onError:n});return r}function jE({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:a}=We.useMutation({mutationFn:e,onMutate:({activityId:i})=>t(s=>{const o=Nt(i,s);return o&&kh({activity:o,user:r}),s}),onError:n});return a}function OE({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:a}=We.useMutation({mutationFn:e,onMutate:({activityId:i})=>t(s=>{const o=Nt(i,s);return o&&Fh({activity:o,user:r}),s}),onError:n});return a}const PE=({basePath:e,parentId:t,isMember:n,isOwner:r,functions:{activities:a,mentions:i,join:s,leave:o,likes:l},profile:u})=>{const d=Lm(to.COMMUNITY_RANKING),h=ie.useIntl(),[m,p]=y.useState("community_feed_live"),[g,f]=y.useState([{id:"recent_with_pin",label:"recent"},{id:"community_feed_live",label:"popular"}]),{activities:b,error:v,fetchNextPage:C,hasNextPage:F,isLoading:_,mutations:{create:w,edit:k,remove:j,like:q,unlike:P,pin:z,unpin:R}}=FE({queryKey:[e,t,"activities",m],queryFns:a,rankingMethod:m});y.useEffect(()=>{d&&f(g.concat(d))},[d]);const[A,E]=y.useState(null),S=()=>{E(b.length),C()};return Th(),v?c.jsx(pn,{variant:"error",text:v.message}):c.jsxs("section",{children:[c.jsx(Vo,{isCard:!0,parentId:t,form:{content:{type:"post",slugs:{}},functions:{create:w,...i},meta:{isEditing:!1,isAutoFocused:!1,isPrepopulated:!1,showSuccessMessage:!1}},membershipRequiredToPost:{isMember:n,required:!0,join:s,leave:o,notMemberStateText:h.formatMessage({id:"community_joinToPost"})}}),c.jsx(nn,{className:"activities-feed-sorting-form",fields:[{id:"feed-sorting",label:h.formatMessage({id:"activitiesFeed_sorting_label"}),type:"select",options:g.map(({id:O,label:V})=>({id:O,label:h.formatMessage({id:`activitiesFeed_rankingMethod_${V}`})})),initialValue:m,functions:{onChange:O=>{p(O);const V=g.find(Q=>Q.id===O);if(!V)return;const H=new CustomEvent("ariaLive",{detail:{message:h.formatMessage({id:"community_sortSuccess"},{order:h.formatMessage({id:`activitiesFeed_rankingMethod_${V.label}`})})}});document.dispatchEvent(H)}},gtm:{context:"Community Sorting",event:"community-sorting-click"}}],button:{hideButton:!0},functions:{onCatch:()=>{},onFailure:()=>{},onSuccess:async()=>{},onCancel:()=>{}},id:"activities-feed-sorting-form"}),b==null?void 0:b.map((O,V)=>{var W,U,ne;const{id:H,own_reactions:Q,latest_reactions:ae,reaction_counts:D,mentioned_users:$,total_replies:X}=O,B=(((W=ae==null?void 0:ae.like)==null?void 0:W.length)||0)>0,T=(((U=Q==null?void 0:Q.like)==null?void 0:U.length)||0)>0,L=T?Q==null?void 0:Q.like[0].id:"",I=B?(ne=ae==null?void 0:ae.like)==null?void 0:ne.map(re=>{var le,ee,pe;return{id:(le=re==null?void 0:re.user)==null?void 0:le.id,name:(pe=(ee=re==null?void 0:re.user)==null?void 0:ee.data)==null?void 0:pe.name}}):!1;return c.jsx(y.Fragment,{children:c.jsx(Yr,{content:{type:"post",title:O==null?void 0:O.title,body:O==null?void 0:O.content,canLike:n,createdAt:(O==null?void 0:O.time)||"",slugs:{question:`${e}/${t}`,answer:H},slug:H,author:dr(O==null?void 0:O.actor),userLiked:T,likes:(D==null?void 0:D.like)||0,comments:X||0,peopleWhoLiked:I,mentions:$,pinned:(D==null?void 0:D.pin)&&(D==null?void 0:D.pin)>0||!1},links:{post:`${e}/${t}/${H}`,comments:`${e}/${t}/${H}`},gtmContext:"community",functions:{content:{createContent:()=>null,deleteContent:()=>j({activityId:H}),updateContent:(re,{body:le})=>k({activityId:H,content:le})},likes:{createLike:()=>q({activityId:H}),deleteLike:()=>P({activityId:H,reactionId:L}),listLikes:re=>l.list({activityId:H,...re})},comments:{openComments:()=>null},pins:{createPin:()=>z({activityId:H}),deletePin:()=>R({activityId:H,reactionId:ae==null?void 0:ae.pin[0].id})},mentions:i},isTruncated:!0,styling:{showShareLinkButton:!0},setFocus:V===A,userHasOwnerPermissions:r,badges:{showBadges:!0,scopes:[{scope:it.COMMUNITIES,area:t||""},{scope:it.PLATFORM,area:"all"}]},basePath:e,parentId:t})},H)}),!_&&c.jsx(Vr,{hasNextPage:F,loadNextPage:S,icon:{icon:"arrow-down",position:"right"},messages:{button:h.formatMessage({id:"loadMore_button"}),error:h.formatMessage({id:"loadMore_error"})}}),c.jsx(Ko,{form:u})]})},ME={next:"id_lt=67ef0342-6f6e-4807-beea-5a9184ec140c&limit=5",results:[{created_at:"2023-12-03T18:47:44.081716Z",updated_at:"2023-12-03T18:47:44.081716Z",id:"256b921e-ffe6-410d-b754-ac1aaee989ce",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester",badges:{communities:{"community-slug":["orange-badge","badge-with-heart"]}}}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 17..."},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 NE({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:a,user:i}){const{mutate:s}=We.useMutation({mutationFn:e,onMutate:o=>t(l=>{const u=Tc({reply:vE(o),user:i});return Ga(u,l,{replace:!1,append:(o==null?void 0:o.replyId)!==void 0})}),onError:n,onSuccess:(o,l,u)=>{const d=Tc({reply:o,user:i});r.setQueryData(a,Ga(d,u,{replace:!0,append:(l==null?void 0:l.replyId)!==void 0})),setTimeout(()=>{Ah(d.id,"reply")},0)}});return s}function RE({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=We.useMutation({mutationFn:e,onMutate:({replyId:a,content:i})=>t(s=>{const o=Nt(a,s);return o&&(o.data.content=i),s}),onError:n});return r}function Sh({queryFns:{create:e,edit:t,like:n,list:r,remove:a,unlike:i},queryKey:s}){const o=We.useQueryClient(),l=ti(),u={queryClient:o,queryKey:s},d={mutationHandlers:{error:zo(u),mutate:qo(u)},user:l,...u},h=NE({...d,mutationFn:e}),m=RE({...d,mutationFn:t}),p=IE({...d,mutationFn:n}),g=LE({...d,mutationFn:a}),f=zE({...d,mutationFn:i}),{replies:b,...v}=$E({queryKey:s,queryFn:r});return{replies:b,mutations:{create:h,edit:m,remove:g,like:p,unlike:f},user:l,...v}}function IE({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:a}){const{mutate:i}=We.useMutation({mutationFn:e,onMutate:({replyId:s})=>t(o=>{const l=Nt(s,o);return l&&Sc({reply:l}),o}),onError:n,onSuccess:(s,{replyId:o},l)=>{const u=Nt(o,l);u&&Sc({reply:u,reaction:s}),r.setQueryData(a,l)}});return i}function $E({queryFn:e,queryKey:t}){const{data:n,error:r,isLoading:a,hasNextPage:i,fetchNextPage:s}=We.useInfiniteQuery({queryKey:t,queryFn:e,initialPageParam:{next:""},getNextPageParam:o=>(o==null?void 0:o.next)||null});return{replies:Wo(n),error:r,isLoading:a,hasNextPage:i,fetchNextPage:s}}function LE({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=We.useMutation({mutationFn:e,onMutate:({replyId:a})=>t(i=>Bh(a,i)),onError:n});return r}function zE({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:a}=We.useMutation({mutationFn:e,onMutate:({replyId:i})=>t(s=>{const o=Nt(i,s);return o&&bE({reply:o,user:r}),s}),onError:n});return a}const qE=({basePath:e,parentId:t,activityId:n,replyId:r,isMember:a,functions:{reactions:i,mentions:s,likes:o}})=>{const l=ie.useIntl(),u=3,{replies:d,fetchNextPage:h,hasNextPage:m,isLoading:p,mutations:{create:g,edit:f,like:b,remove:v,unlike:C},user:F}=Sh({queryKey:[e,t,n,r,"replies"],queryFns:{...i,list:k=>i.list({...k,reactionId:r})}});Qs([p]);const[_,w]=y.useState(!0);return c.jsxs(c.Fragment,{children:[(d==null?void 0:d.length)>=u&&c.jsx(Fe,{className:"nested-replies-show-toggle",variant:"secondary",size:"small",icon:{icon:`arrow_corner-${_?"up_left":"down_right"}`,position:"left"},onClick:()=>w(!_),children:l.formatMessage({id:`discussion_thread_${_?"hide":"show"}`},{count:d==null?void 0:d.length})}),_&&c.jsx(Rh,{loadMore:{isLoading:p,hasNextPage:m,loadNextPage:()=>h()},form:{parentId:t,content:{type:"reply",slugs:{question:`${e}/${t}`,answer:n,reply:r}},functions:{create:(k,{body:j})=>g({activityId:n,replyId:r,content:j}),listMembers:s.listMembers,clickMentionFallback:s.clickMentionFallback},meta:{isEditing:!1,isAutoFocused:!0,isPrepopulated:!1,showSuccessMessage:!1}},children:d&&d.length>0?d==null?void 0:d.map(k=>{var ae,D,$,X,B,T,L;const{id:j,own_children:q,latest_children:P,children_counts:z,data:{mentioned_users:R}}=k,E=(((ae=q==null?void 0:q.like)==null?void 0:ae.length)||0)>0?(D=q==null?void 0:q.like)==null?void 0:D.find(I=>{var W;return((W=I==null?void 0:I.user)==null?void 0:W.id)===(F==null?void 0:F.id)}):!1,S=E?E==null?void 0:E.id:"",O=!!E,H=((($=P==null?void 0:P.like)==null?void 0:$.length)||0)>0?(X=P==null?void 0:P.like)==null?void 0:X.map(I=>{var W,U,ne;return{id:(W=I==null?void 0:I.user)==null?void 0:W.id,name:(ne=(U=I==null?void 0:I.user)==null?void 0:U.data)==null?void 0:ne.name}}):!1,Q=typeof k.data.content=="string"?(B=k==null?void 0:k.data)==null?void 0:B.content:((L=(T=k==null?void 0:k.data)==null?void 0:T.content)==null?void 0:L.text)||"";return c.jsx(Yr,{isCommunity:!0,content:{id:j,type:"reply",body:Q,canLike:a,createdAt:k==null?void 0:k.created_at,slugs:{question:`${e}/${t}`,answer:n,reply:k==null?void 0:k.parent},slug:"",author:dr(k==null?void 0:k.user),userLiked:O,likes:(z==null?void 0:z.like)||0,peopleWhoLiked:H,mentions:R},functions:{content:{createContent:()=>null,deleteContent:()=>v({replyId:j}),updateContent:(I,{body:W})=>f({replyId:j,content:W})},likes:{createLike:()=>b({replyId:j}),deleteLike:()=>C({replyId:j,reactionId:S}),listLikes:I=>o.list({replyId:j,...I})},comments:{},mentions:{listMembers:s.listMembers,clickMentionFallback:s.clickMentionFallback}},styling:{showShareLinkButton:!0},badges:{showBadges:!0,scopes:[{scope:it.COMMUNITIES,area:t||""},{scope:it.PLATFORM,area:"all"}]},basePath:e,parentId:t},j)}):null})]})};const jh=({basePath:e,parentId:t,activityId:n,activityTotalReplies:r,isMember:a,functions:{mentions:i,join:s,leave:o,likes:l,reactions:u},profile:d})=>{const h=ie.useIntl(),{replies:m,fetchNextPage:p,hasNextPage:g,isLoading:f,mutations:{create:b,edit:v,like:C,remove:F,unlike:_},user:w}=Sh({queryKey:[e,t,n,"replies"],queryFns:u}),k=()=>{q(m.length),p()},[j,q]=y.useState(null);return Qs([f]),Th(),c.jsxs("section",{className:"replies-feed",children:[c.jsx(Nh,{type:"comment",responses:r,isLoading:f}),c.jsx(Vo,{form:{content:{type:"reply",slugs:{}},functions:{create:(P,{body:z})=>b({activityId:n,content:z}),...i},meta:{isEditing:!1,isAutoFocused:!1,isPrepopulated:!1,showSuccessMessage:!1},placeholder:h.formatMessage({id:"discussion_responses_placeholder"})},parentId:t,membershipRequiredToPost:{isMember:a,required:!0,join:s,leave:o,notMemberStateText:h.formatMessage({id:"community_joinToPost"})}}),m==null?void 0:m.map((P,z)=>{var B,T,L,I,W,U,ne;const{id:R,own_children:A,latest_children:E,children_counts:S,data:{mentioned_users:O}}=P,H=(((B=A==null?void 0:A.like)==null?void 0:B.length)||0)>0?(T=A==null?void 0:A.like)==null?void 0:T.find(re=>{var le;return((le=re==null?void 0:re.user)==null?void 0:le.id)===(w==null?void 0:w.id)}):!1,Q=H?H==null?void 0:H.id:"",ae=!!H,$=(((L=E==null?void 0:E.like)==null?void 0:L.length)||0)>0?(I=E==null?void 0:E.like)==null?void 0:I.map(re=>{var le,ee,pe;return{id:(le=re==null?void 0:re.user)==null?void 0:le.id,name:(pe=(ee=re==null?void 0:re.user)==null?void 0:ee.data)==null?void 0:pe.name}}):!1,X=typeof P.data.content=="string"?(W=P==null?void 0:P.data)==null?void 0:W.content:((ne=(U=P==null?void 0:P.data)==null?void 0:U.content)==null?void 0:ne.text)||"";return c.jsx(Ch,{children:c.jsx(Yr,{isCommunity:!0,content:{id:R,type:"reply",body:X,canLike:a,createdAt:P==null?void 0:P.created_at,slugs:{question:`${e}/${t}`,answer:n,reply:R},slug:R,author:dr(P==null?void 0:P.user),userLiked:ae,likes:(S==null?void 0:S.like)||0,peopleWhoLiked:$,mentions:O},functions:{content:{createContent:()=>null,deleteContent:()=>F({replyId:R}),updateContent:(re,{body:le})=>v({replyId:R,content:le})},likes:{createLike:()=>C({replyId:R}),deleteLike:()=>_({replyId:R,reactionId:Q}),listLikes:l.list},comments:{},mentions:i},badges:{showBadges:!0,scopes:[{scope:it.COMMUNITIES,area:t||""},{scope:it.PLATFORM,area:"all"}]},children:c.jsx(qE,{basePath:e,parentId:t,activityId:n,replyId:R,isMember:a,functions:{reactions:u,mentions:i,likes:l}}),styling:{showShareLinkButton:!0},setFocus:z===j,basePath:e,parentId:t},R)},R)}),!f&&c.jsx(Vr,{hasNextPage:g,loadNextPage:k,icon:{icon:"arrow-down",position:"right"},messages:{button:h.formatMessage({id:"loadMore_button"}),error:h.formatMessage({id:"loadMore_error"})}}),c.jsx(Ko,{form:d})]})};function WE({queryFn:e,queryKey:t}){const{data:n,error:r,isLoading:a,hasNextPage:i,fetchNextPage:s,refetch:o}=We.useInfiniteQuery({queryKey:t,queryFn:e,initialPageParam:{next:""},getNextPageParam:d=>(d==null?void 0:d.next)||null}),l=Wo(n),u=`${l.length||0}${i?"+":""}`;return{likes:l,likesCount:u,error:r,isLoading:a,hasNextPage:i,fetchNextPage:s,refetch:o}}function UE({queryFns:{list:e},queryKey:t}){const{likes:n,...r}=WE({queryKey:t,queryFn:e});return{likes:n,...r}}function Oh({basePath:e,parentId:t,activityId:n,likeCount:r,functions:a}){const{likes:i,fetchNextPage:s,hasNextPage:o,refetch:l}=UE({queryKey:[e,t,n,"likes"],queryFns:a.likes});y.useEffect(()=>{l()},[l]);const u=i.map(({user:d})=>d).map(d=>d?dr(d):void 0).filter(d=>d&&typeof d!="string");return c.jsx("section",{className:"likes-feed",children:c.jsx(Dh,{members:{data:u,total:r},showHeader:!1,showPlaceholders:!0,communitySlug:t,hasNextPage:o&&u.length<r,loadNextPage:s})})}const Ph=({showModal:e=!0,activityId:t,functions:{onClose:n,likes:r},likeCount:a,className:i,basePath:s,parentId:o})=>{const l=ie.useIntl();return c.jsx(tn,{id:"likes-modal",title:l.formatMessage({id:"discussion_likes"},{number:a}),isOpen:e,functions:{onClose:n},className:K("profile-modal in-portal",i,{open:e}),maxWidth:600,children:c.jsx(Oh,{activityId:t,basePath:s,parentId:o,likeCount:a??0,functions:{likes:r}})})},HE=Object.freeze(Object.defineProperty({__proto__:null,default:Ph},Symbol.toStringTag,{value:"Module"})),ds=({children:e,class:t,...n})=>{const r={...n,class:K("subtle",t)};return c.jsx("blockquote",{...r,children:e})},VE=280,Ho=async(e,t,n,r=()=>Promise.resolve([]))=>{let a=t?Xn(e,typeof t=="number"?t:VE):e;a=a.trim();const i=`<br>
164
164
 
165
- `;return a.slice(0,i.length)===i&&(a=a.slice(i.length)),n?await Qc({text:a,template:"[@{{name}}](/profiles/{{id}})",mentions:n,listMembers:r}):a};const KE=3e3,ZE=({url:e,gtm:t={context:"ShareLink",event:"copy-link-click"}})=>{const n=ie.useIntl(),r="discussion_share_copy_link",[a,i]=y.useState({isOpen:!1,isCopied:!1});return c.jsxs("li",{className:"share-link-wrapper",children:[c.jsx(Ka,{className:"gtm-trackable",icon:{icon:"link_chain"},onMouseOver:()=>i({...a,isOpen:!0}),onFocus:()=>i({...a,isOpen:!0}),onMouseOut:()=>i({isOpen:!1,isCopied:!1}),onBlur:()=>i({isOpen:!1,isCopied:!1}),onClick:()=>{navigator.clipboard.writeText(e).then(()=>{i({isOpen:!0,isCopied:!0});const s=new CustomEvent("ariaLive",{detail:{message:n.formatMessage({id:`${r}_success`})}});document.dispatchEvent(s),setTimeout(()=>{i({isOpen:!1,isCopied:!1})},KE)})},"data-gtm-event-context":t.context,"data-gtm-event-type":t.event,screenreaderText:n.formatMessage({id:r})}),c.jsx(Mn,{className:K({copied:a.isCopied}),isOpen:a.isOpen,styling:{hasPointer:"bottom",extraPadding:!1},children:n.formatMessage({id:`${r}${a.isCopied?"_success":""}`})})]})},It="discussion_",YE=195;let va=null;const Yr=({element:e="div",content:t,userHasPermissions:n=!0,userHasOwnerPermissions:r=!1,isLoading:a=!1,originalAuthorId:i,forceHide:s={actionBar:!1,comments:!1,likes:!1},functions:o,links:l={},className:u,gtmContext:d="DiscussionAnswer",children:h,isTruncated:m=!1,styling:{showShareLinkButton:p=!1,showMoreMenuButton:g=!0}={},setFocus:f=!1,isCommunity:b=!1,badges:v,basePath:C,parentId:F})=>{var De,Le,Ue,G,oe,he,ge,Ee;const _=ie.useIntl(),w=y.useContext(st),k=y.useContext(fi),{createContent:j=async()=>{},deleteContent:q=async()=>{},updateContent:P=async()=>{}}=o.content||{},{createLike:z=()=>{},deleteLike:R=()=>{},listLikes:A=async()=>({})}=o.likes||{},{openComments:E=()=>{}}=o.comments||{},{listMembers:S=()=>Promise.resolve([]),clickMentionFallback:O=()=>{}}=o.mentions||{},{author:V,canLike:H,createdAt:Q,id:ae,likes:D=0,userLiked:$,comments:ee=0,mentions:B}=t,T=w&&w.id&&typeof V!="string"&&V.id&&V.id===w.id||!1,L=typeof H=="boolean"?H:!0,I=T&&(!t.createdAt||lm(t.createdAt,10,"seconds")),W=y.useRef(null),[U,ne]=y.useState({title:t&&t.body!==t.title&&t.title||"",body:t&&t.body||"",isEditing:!1,didEdit:t&&t.isEdited||!1,postBody:"",memberCustomMessage:(t==null?void 0:t.memberCustomMessage)||""}),[re,le]=y.useState(!1),[X,pe]=y.useState(I?"highlighted":"default"),[me,_e]=y.useState("");y.useEffect(()=>{const be=W.current;if(!(!be||X==="default"))return document.addEventListener(tt.DISCUSSION_FORM_SUBMITTED,Be),be.addEventListener("transitionend",Se),()=>{document.removeEventListener(tt.DISCUSSION_FORM_SUBMITTED,Be),be.removeEventListener("transitionend",Se)}},[]),y.useEffect(()=>{ne({...U,title:t&&t.title||"",body:t&&t.body||"",didEdit:t&&t.isEdited||!1})},[t.isEdited]),y.useEffect(()=>{(async()=>{const we=await Ho(U.body,m,B,S);ne({...U,postBody:we})})()},[U.body,B]);const Be=()=>{setTimeout(()=>{pe("fading")},1e3)},Se=({propertyName:be})=>{be==="background-color"&&pe(we=>(we==="default"&&(document.removeEventListener(tt.DISCUSSION_FORM_SUBMITTED,Be),W.current&&W.current.removeEventListener("transitionend",Se)),we==="fading"?"default":we))};if(a||!t||t.type==="answer"&&(!t.slugs||!t.slugs.question)||U.postBody===""&&t.title==="")return c.jsx(St,{className:"discussion-card"});const Ye=async({title:be,body:we})=>{be||(be=""),we||(we=""),_e("");try{if(!ps(be,U.title)||!ps(we,U.body)){const et=t.type==="question"?{title:we}:{title:be,body:we};await P(Ys(t.slugs),et)}ne({...U,title:be,body:we,isEditing:!1,didEdit:!0})}catch{_e(`${It}form_error`)}},Ke=()=>{if(k&&k.updateConversation){const be={showForm:!0},we=t.author;we&&we.id&&(b&&(be.prepopulateForm=`@{{${we.id}}}`),be.mentionData={id:we.id,name:we.name}),k.updateConversation(be)}setTimeout(()=>{var ht,Qe,yt;const we=`reply-form-${(t.type==="answer"?t.slug:((ht=t.slugs)==null?void 0:ht.reply)||((Qe=t.slugs)==null?void 0:Qe.answer)||((yt=t.slugs)==null?void 0:yt.question)||"").toLowerCase().slice(-15)}`,et=document.getElementById(we),Et=document.getElementById(`${we}-input`);Et&&Et.focus(),et&&et.scrollIntoView({behavior:"smooth"})},0)},je=async()=>{le(!1);try{await q(Ys(t.slugs))}catch{_e("delete-error")}},Oe=[{text:_.formatMessage({id:`${It}moreMenu_report`}),onClick:be=>{be.stopPropagation()},href:`mailto:community@apolitical.co?subject=${encodeURI(_.formatMessage({id:`${It}report_subject`}))}&body=${encodeURI(_.formatMessage({id:`${It}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&&T&&Oe.push({text:_.formatMessage({id:`${It}moreMenu_edit`}),onClick:()=>ne({...U,isEditing:!0}),icon:"pencil-paper",className:"gtm-trackable","data-gtm-event-context":d,"data-gtm-event-type":`edit-${t.type}-click`},{text:_.formatMessage({id:`${It}moreMenu_delete`}),onClick:be=>{be.preventDefault(),be.stopPropagation(),le(!0)},icon:"trash",className:"gtm-trackable","data-gtm-event-context":d,"data-gtm-event-type":`delete-${t.type}-click`,...Td(`delete-${t.slug}-modal`,re)}),r&&o.pins&&Oe.push({text:_.formatMessage({id:`${It}moreMenu_${t.pinned?"unpin":"pin"}`}),onClick:t.pinned?o.pins.deletePin:o.pins.createPin,icon:t.pinned?"unpin":"pin",className:"gtm-trackable","data-gtm-event-context":d,"data-gtm-event-type":`edit-${t.type}-click`}),f&&((De=W==null?void 0:W.current)==null||De.focus(),(Le=W==null?void 0:W.current)==null||Le.scrollIntoView({behavior:"smooth"})),y.createElement(e,{className:K("discussion-post",u,{[X]:!u||!u.includes("highlighted-text-box"),"has-link":l.post&&!U.isEditing,"is-pinned":(t==null?void 0:t.pinned)||!1}),ref:W,tabIndex:f?0:null,"data-testid":`discussion-${t.type}-thread`,"data-gtm-event-context":`${d}-post-click`,onClick:be=>{if(!l.post||U.isEditing)return;be.preventDefault(),be.stopPropagation(),va&&clearTimeout(va),va=setTimeout(()=>{window.location.href=l.post},150);const we=new CustomEvent(tt.DISCUSSION_POST_CLICKED,{detail:{link:l.post,timeout:va}});document.dispatchEvent(we)},children:c.jsxs(c.Fragment,{children:[c.jsxs("div",{id:ae||t.slug,className:K("discussion-card",t.type,{editing:U.isEditing,"has-link":l.post&&!U.isEditing}),children:[!U.isEditing&&c.jsxs("div",{className:"author-section",children:[c.jsx(Jt,{member:V,additionalContent:{createdAt:Q,didEdit:U.didEdit,customMessage:U.memberCustomMessage},className:typeof V!="string"&&V.id===i?"highlighted":"",styling:{additionalContentNewLine:!!U.memberCustomMessage},gtmContext:d,gtmType:"profile-click",badges:v}),t.pinned&&c.jsx(Qt,{variant:"naked",size:"xlarge",icon:"pin",children:c.jsx(Ie,{children:"Pinned Post"})})]}),U.isEditing?c.jsx(Zr,{id:`editing-${t.slug}`,content:{type:t.type,slugs:t.slugs},userHasPermissions:n,meta:{isLoading:a,isInWrapper:!0,hasTitleField:U.title!==""?{text:U.title}:!1,isEditing:{text:U.body},isPrepopulated:!1},isCommunity:b,maxLength:t.type==="question"?250:5e4,forceShow:{error:me!==""&&me!=="delete-error"?_.formatMessage({id:me},{action:_.formatMessage({id:`discussion_action_${t.type}`})}):!1},functions:{create:j,handleSaveEdit:Ye,handleCancel:()=>{_e(""),ne({...U,isEditing:!1})},listMembers:S,clickMentionFallback:O},gtmContext:`${d}Form`,data:{mentions:t.mentions}}):l.post?c.jsxs("a",{href:l.post,children:[(U==null?void 0:U.title)&&c.jsx("p",{className:"content-title",children:U==null?void 0:U.title}),U.postBody.length>YE?c.jsx(ad,{text:U.postBody,markdownOptions:{overrides:{a:Ds,blockquote:{component:ds}}}}):c.jsx(Bn,{options:{overrides:{a:Ds,blockquote:{component:ds}}},children:U.postBody})]}):c.jsxs(c.Fragment,{children:[(U==null?void 0:U.title)&&c.jsx("p",{className:"content-title",children:U==null?void 0:U.title}),c.jsx(Bn,{options:{wrapper:t.type==="question"?"h1":y.Fragment,forceWrapper:t.type==="question",forceInline:t.type==="question",forceBlock:t.type!=="question",overrides:{blockquote:{component:ds}}},children:U.postBody})]}),!U.isEditing&&!(s!=null&&s.actionBar)&&c.jsxs("ul",{className:K("actions text-medium",t.type),"data-testid":`${t.type}-actions`,children:[!s.likes&&c.jsx(wh,{element:"li",likes:D,isShort:!1,userLiked:$,content:{type:t.type,slugs:t.slugs,slug:t.slug},canLike:L,peopleWhoLiked:t.peopleWhoLiked,activityId:t.slug,functions:{createLike:z,deleteLike:R,listLikes:A},badges:v,basePath:C,parentId:F}),!s.comments&&(["question","post"].includes(t.type)||l.comments)&&c.jsx("li",{children:c.jsx(Ka,{onClick:be=>{be.preventDefault(),be.stopPropagation(),l.comments&&(window.location.href=l.comments),typeof E=="function"&&E()},icon:{icon:"speech-bubble_square"},"data-gtm-event-context":d,"data-gtm-event-type":`answer-${t.type}-click`,screenreaderText:_.formatMessage({id:`${It}comments_screenReader`},{count:ee}),children:_.formatMessage({id:`${It}comments`},{count:ee})})}),(t.type==="answer"||t.type==="reply")&&c.jsx("li",{children:c.jsx(Ka,{styling:{muted:!0},onClick:Ke,icon:{icon:"speech-bubble_square"},children:_.formatMessage({id:`${It}reply`})})}),p&&c.jsx(ZE,{url:(Ue=t.slugs)!=null&&Ue.reply?`${window.location.origin}${(G=t.slugs)==null?void 0:G.question}/${(oe=t.slugs)==null?void 0:oe.answer}#${(he=t.slugs)==null?void 0:he.reply}`:`${window.location.origin}${(ge=t.slugs)==null?void 0:ge.question}/${(Ee=t.slugs)==null?void 0:Ee.answer}`,gtm:{context:d,event:`copy-link-${t.type}-click`}}),g&&c.jsx(Sd,{element:"li",id:`more-${t.slug}`,options:Oe})]})]}),h,c.jsx(tn,{id:`delete-${t.slug}-modal`,isOpen:re,functions:{onOpen:()=>{},onClose:()=>le(!1)},forceShow:{error:me==="delete-error"?_.formatMessage({id:"discussion_delete_error"},{action:_.formatMessage({id:`discussion_action_${t.type}`})}):!1},title:_.formatMessage({id:"discussion_delete_title"},{action:_.formatMessage({id:`discussion_action_${t.type}`})}),buttons:[{variant:"secondary",onClick:()=>le(!1),children:_.formatMessage({id:"discussion_delete_cancel"})},{variant:"primary",className:"destructive",onClick:je,children:_.formatMessage({id:"discussion_delete_delete"})}],gtmContext:`${t.type.charAt(0).toUpperCase()}${t.type.slice(1)}:${t.slug}`,children:c.jsx(ie.FormattedMessage,{id:"discussion_delete_text",values:{p:be=>c.jsx("p",{children:be}),action:_.formatMessage({id:`discussion_action_${t.type}`})}})})]})})};const GE=y.lazy(()=>Promise.resolve().then(()=>o_)),QE=65,Mh=({forceShow:e,form:t,className:n})=>{const r=ie.useIntl(),a="discussionFormCard_",i="DiscardDraftModal",o=y.useContext(st)||"community",l=ri(o);l.name||(l.name=r.formatMessage({id:`member_${typeof o=="string"?o:"community"}`}));const{modal:u=!1}=e||{},[d,h]=y.useState({form:u||Xc("showPost")==="true"||!1,warning:!1}),[m,p]=y.useState({showCachedText:!1});y.useEffect(()=>{if(!m.showCachedText)return;(async()=>{const v=await Ho(m.title||m.body||"",QE,m.mentions);p(C=>({...C,prettifiedText:v}))})()},[m.showCachedText,m.title,m.body]);const g=b=>{if(!m.showCachedText||typeof d.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 C=b;C.preventDefault(),C.stopPropagation();const _=C.target.closest("a");v=_&&_.getAttribute("href")}h(C=>({...C,warning:v||!1}))};y.useEffect(()=>{if(!m.showCachedText){document.removeEventListener(tt.DISCUSSION_POST_CLICKED,g),document.removeEventListener(tt.MEMBER_CLICKED,g),document.removeEventListener("click",g);return}return document.addEventListener(tt.DISCUSSION_POST_CLICKED,g),document.addEventListener(tt.MEMBER_CLICKED,g),document.addEventListener("click",g),()=>{document.removeEventListener(tt.DISCUSSION_POST_CLICKED,g),document.removeEventListener(tt.MEMBER_CLICKED,g),document.removeEventListener("click",g)}},[m.showCachedText]),y.useEffect(()=>{const b=v=>{if(!(!m.showCachedText||d.warning!==!1))return v.preventDefault(),v.returnValue=""};return window.addEventListener("beforeunload",b,{capture:!0}),()=>{window.removeEventListener("beforeunload",b,{capture:!0})}},[m.showCachedText,d.warning]);let f=r.formatMessage({id:`${a}placeholder`});return m.showCachedText&&(m.title||m.body)&&(f=m.prettifiedText||f),c.jsxs(c.Fragment,{children:[c.jsxs("button",{className:K("discussion-form-card",n),onClick:b=>{b.preventDefault(),b.stopPropagation(),h(v=>({...v,form:!0}))},"data-testid":"discussion-form-card",children:[c.jsx(gn,{name:l.name,src:l.image,alt:""}),c.jsx(Bn,{className:K("input",{placeholder:!m.showCachedText}),element:"span",options:{forceInline:!0,overrides:{a:Ft,blockquote:Ft,br:Ft,em:Ft,li:Ft,ol:Ft,p:Ft,s:Ft,span:Ft,strong:Ft,ul:Ft}},children:f})]}),c.jsxs(lr,{children:[c.jsx(GE,{showModal:d.form,functions:{cacheText:p,onClose:()=>{h(b=>({...b,form:!1}))}},form:t,cachedText:m,className:"in-portal"}),c.jsx(tn,{id:t.id?`${t.id}-warning`:"discussion-form-card-warning",className:"in-portal",isOpen:d.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 d.warning=="string"&&(window.location.href=d.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:c.jsx("p",{children:r.formatMessage({id:`${a}overlay_text`})})})]})]})},JE=y.lazy(()=>Promise.resolve().then(()=>sE)),Vo=({isCard:e=!1,form:t,parentId:n,membershipRequiredToPost:{isMember:r,required:a,join:i,leave:s,notMemberStateText:o}})=>{if(a&&!r)return c.jsx(pn,{text:o,button:{breakpoints:{mobile:!0,901:!1},component:c.jsx(lo,{isShort:!0,functions:{join:i,leave:s}})}});const{content:l,functions:u,meta:d,...h}=t,m={content:{type:(l==null?void 0:l.type)||"reply",slugs:(l==null?void 0:l.slugs)||{}},functions:{...u,create:(u==null?void 0:u.create)||(()=>{})},parentId:n,meta:{...d,isEditing:(d==null?void 0:d.isEditing)||!1,isPrepopulated:!1,showSuccessMessage:!1},...h,id:`add-post-${h.id||""}`};return e?c.jsx(Mh,{form:m}):c.jsx(JE,{...m})},Ko=({form:e})=>{const t=y.useContext(st),n=ie.useIntl(),[r,a]=y.useState(!1),i=()=>{bm(t)||a(!0)};y.useEffect(()=>(document.addEventListener(tt.DISCUSSION_POST_ADDED,i),()=>{document.removeEventListener(tt.DISCUSSION_POST_ADDED,i)}));const s={};return["successMessage","title","text"].forEach(o=>{s[o]=n.formatMessage({id:`profileModalLauncher_${o}`})}),c.jsx(hi,{form:e,showModal:r,functions:{onClose:()=>{a(!1)}},content:s})};const fs="discussion_responses_",Nh=({type:e="answer",responses:t=0,isLoading:n=!1})=>{const r=ie.useIntl();return t=parseInt(t),c.jsxs("div",{className:"responses-heading",children:[c.jsx("h4",{children:r.formatMessage({id:`${fs}title`},{action:r.formatMessage({id:`${fs}${e}`}),count:t})}),!n&&t===0&&c.jsx("p",{children:jt(r.formatMessage,`${fs}empty`,e,e)})]})};const Rh=({loadMore:{isLoading:e,hasNextPage:t,loadNextPage:n}={isLoading:!1,hasNextPage:!1,loadNextPage:()=>{}},form:r,children:a})=>{const i=ie.useIntl(),s=y.useContext(fi),o=Da(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 c.jsxs("div",{className:K("thread-wrapper",{"empty-thread":!o}),children:[!Object.is(o,null)&&c.jsx("ul",{className:"thread",children:o}),!e&&c.jsx(Vr,{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&&c.jsx(Zr,{...r})]})};function XE({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=We.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 e_({queryFn:e,queryKey:t}){const{data:n,error:r,isLoading:a,isFetching:i}=We.useQuery({queryFn:e,queryKey:t});return{activity:n,error:r,isLoading:a,isFetching:i}}function t_({queryFns:{read:e,edit:t,like:n,unlike:r,pin:a,unpin:i},queryKey:s}){const o=We.useQueryClient(),l=ti(),u={queryClient:o,queryKey:s},d={mutationHandlers:{error:zo(u),mutate:qo(u)},user:l,...u},h=XE({...d,mutationFn:t}),m=n_({...d,mutationFn:n}),p=r_({...d,mutationFn:r}),g=a_({...d,mutationFn:a}),f=i_({...d,mutationFn:i}),{activity:b,...v}=e_({queryKey:s,queryFn:e});return{activity:b,mutations:{edit:h,like:m,unlike:p,pin:g,unpin:f},user:l,...v}}function n_({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:a}){const{mutate:i}=We.useMutation({mutationFn:e,onMutate:s=>t(o=>(o&&Za({activity:o}),o)),onError:n,onSuccess:(s,o,l)=>{l&&Za({activity:l,reaction:s}),r.setQueryData(a,l)}});return i}function r_({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:a}=We.useMutation({mutationFn:e,onMutate:i=>t(s=>(s&&kh({activity:s,user:r}),s)),onError:n});return a}function a_({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:a}){const{mutate:i}=We.useMutation({mutationFn:e,onMutate:s=>t(o=>(o&&Ya({activity:o}),o)),onError:n,onSuccess:(s,o,l)=>{l&&Ya({activity:l,reaction:s}),r.setQueryData(a,l)}});return i}function i_({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:a}=We.useMutation({mutationFn:e,onMutate:i=>(console.log("unpin"),t(s=>(s&&Fh({activity:s,user:r}),s))),onError:n});return a}const s_=({basePath:e,parentId:t,activityId:n,isMember:r,isOwner:a,functions:{activities:{remove:i,...s},likes:o,reactions:l,mentions:u,join:d,leave:h},profile:m})=>{var S,O,V,H,Q,ae;const p=ie.useIntl(),{activity:g,error:f,isLoading:b,mutations:{edit:v,like:C,unlike:F,pin:_,unpin:w}}=t_({queryFns:s,queryKey:[e,t,n]});if(b)return c.jsx(St,{style:{height:"400px"}});if(f||!g)return c.jsx(pn,{variant:"error",text:p.formatMessage({id:"activitySection_notFoundError"})});const{own_reactions:k,latest_reactions:j,mentioned_users:q}=g,P=(((S=j==null?void 0:j.like)==null?void 0:S.length)||0)>0,z=(((O=k==null?void 0:k.like)==null?void 0:O.length)||0)>0,R=z?k==null?void 0:k.like[0].id:"",A=P?(V=j==null?void 0:j.like)==null?void 0:V.map(D=>{var $,ee,B;return{id:($=D==null?void 0:D.user)==null?void 0:$.id,name:(B=(ee=D==null?void 0:D.user)==null?void 0:ee.data)==null?void 0:B.name}}):!1,E=g==null?void 0:g.actor;return c.jsxs("section",{className:"activity-section",children:[c.jsx(Yr,{className:"highlighted-text-box subtle",isCommunity:!0,content:{id:n,type:"post",title:g==null?void 0:g.title,body:g==null?void 0:g.content,canLike:r,createdAt:(g==null?void 0:g.time)||"",slugs:{question:`${e}/${t}`,answer:g==null?void 0:g.id},slug:n,author:dr(E),userLiked:z,likes:((H=g==null?void 0:g.reaction_counts)==null?void 0:H.like)||0,comments:(g==null?void 0:g.total_replies)||0,peopleWhoLiked:A,mentions:q,pinned:((Q=g==null?void 0:g.reaction_counts)==null?void 0:Q.pin)&&((ae=g==null?void 0:g.reaction_counts)==null?void 0:ae.pin)>0||!1},originalAuthorId:E==null?void 0:E.id,forceHide:{comments:!0},functions:{content:{createContent:()=>null,deleteContent:i,updateContent:(D,{title:$,body:ee})=>v({title:$,content:ee})},likes:{createLike:()=>C({activityId:n}),deleteLike:()=>F({activityId:n,reactionId:R}),listLikes:D=>o.list({activityId:n,...D})},comments:{openComments:()=>{}},pins:{createPin:()=>_({activityId:n}),deletePin:()=>{var D;return w({activityId:n,reactionId:(D=j==null?void 0:j.pin)==null?void 0:D[0].id})}},mentions:u},styling:{showShareLinkButton:!0},userHasOwnerPermissions:a,badges:{showBadges:!0,scopes:[{scope:it.COMMUNITIES,area:t||""},{scope:it.PLATFORM,area:"all"}]},basePath:e,parentId:t},n),c.jsx(jh,{basePath:e,parentId:t,activityId:n,activityTotalReplies:(g==null?void 0:g.total_replies)||0,isMember:r,functions:{reactions:l,likes:o,mentions:u,join:d,leave:h},profile:m})]})};const Ih=({showModal:e=!0,functions:t,form:n,cachedText:r,className:a})=>{const i=ie.useIntl(),s="discussionFormModal_",{onClose:o=()=>{},cacheText:l=()=>{}}=t,{data:u,meta:d,functions:h}=n,{title:m="",body:p="",mentions:g}=r||{},f="discussion-form-modal";return c.jsx(tn,{id:f,title:i.formatMessage({id:`${s}title`}),isOpen:e,functions:{onClose:()=>{(m!==""||p!=="")&&l(b=>({...b,showCachedText:!0})),o()}},className:K("discussion-form-modal",a),children:c.jsx(Zr,{...n,data:{...u,mentions:g||(u==null?void 0:u.mentions)},meta:{...d,isAutoFocused:!0,isInOverlay:`${f}-overlay`,hasTitleField:{text:m},isPrepopulated:{text:p||(d==null?void 0:d.isPrepopulated)!==!1&&(d==null?void 0:d.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 C=g||{};C[b]={created_at:"",updated_at:"",id:b,data:{name:v}},l(F=>({...F,mentions:C}))},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})}}})})},o_=Object.freeze(Object.defineProperty({__proto__:null,default:Ih},Symbol.toStringTag,{value:"Module"}));const u_=({className:e,showModal:t=!0,title:n,formTitle:r,formLabel:a,ctaMessage:i,showIcon:s,onClose:o,reportError:l=()=>{},sendInvites:u})=>{const d=ie.useIntl();return r||(r=d.formatMessage({id:"inviteModal_formTitle"})),a||(a=d.formatMessage({id:"inviteModal_formLabel"})),i||(i=d.formatMessage({id:"inviteModal_cta"})),c.jsx(tn,{id:"invite-user-modal",title:n,isOpen:t,showDivider:!1,showIcon:s,functions:{onClose:o},className:K("invite-modal",e,{success:!!n}),children:c.jsx(mh,{title:r,label:a,ctaMessage:i,onClose:o,sendInvites:u,reportError:l})})};const hi=({showModal:e=!0,content:{successMessage:t,title:n,text:r}={},functions:a,form:i,className:s})=>{const o=ie.useIntl(),[l,u]=y.useState(Xc("showProfile")==="true"||e);y.useEffect(()=>{u(e)},[e]);const{onClose:d=()=>{}}=a;return c.jsx(tn,{id:"profile-form-modal",title:t||n||o.formatMessage({id:"profileModal_title"}),isOpen:l,showDivider:!t,functions:{onClose:d},className:K("profile-modal",s,{success:!!t}),maxWidth:700,children:c.jsxs(c.Fragment,{children:[t&&n||r?c.jsxs("div",{className:"intro",children:[t&&n?c.jsx("h3",{children:n}):"",r?c.jsx("p",{children:r}):""]}):null,c.jsx(ph,{...i,meta:{shouldShowCancelButton:!1},functions:{...(i==null?void 0:i.functions)||{},onSuccess:async h=>{var m;try{(m=i==null?void 0:i.functions)!=null&&m.onSuccess&&await i.functions.onSuccess(h)}finally{d()}}}})]})})},l_=Object.freeze(Object.defineProperty({__proto__:null,default:hi},Symbol.toStringTag,{value:"Module"}));const c_=({members:e})=>{const[t,n]=y.useState(!1),r=a=>{const{fullName:i,jobTitle:s,organisation:o,photo:l}=a||{};return c.jsxs(c.Fragment,{children:[c.jsx(gn,{name:i,src:l}),c.jsx("p",{children:i}),c.jsx("small",{className:"text-medium",children:o?`${s}, ${o}`:s})]})};return c.jsxs("div",{className:"directory-wrapper",children:[c.jsx("ul",{className:"directory",children:e.map(a=>c.jsx("li",{children:c.jsx("button",{onClick:i=>{i.preventDefault(),i.stopPropagation(),n(a)},children:r(a)})},a.fullName))}),c.jsx(tn,{isOpen:t!==!1,children:t===!1?"":c.jsxs(c.Fragment,{children:[r(t),c.jsx(Bn,{children:t.text})]}),buttons:[{size:"small",variant:"tertiary",onClick:()=>n(!1),children:"Close"}],functions:{onClose:()=>n(!1)}})]})};const d_=({author:e,authorCite:t,content:n,member:r,className:a=""})=>c.jsxs("blockquote",{className:K("testimonial-block",a),children:[c.jsx(Wt,{className:"testimonial",children:n}),r?c.jsx(Jt,{member:r,styling:{size:"large"}}):c.jsxs(c.Fragment,{children:[e&&c.jsx("p",{className:K("author",{"text-small":!a.includes("new")}),children:e}),t&&c.jsx("p",{className:K("author-cite",{"text-small":!a.includes("new")}),children:c.jsx("cite",{children:t})})]})]}),f_=y.memo(d_);const h_=({items:e=[],selector:t="",className:n=""})=>{const r=ie.useIntl(),[a,i]=y.useState(e);return y.useEffect(()=>{if(e.length)return;let s="";Array(6).fill(0).forEach((u,d)=>{s+=`${d>0?", ":""}${t} h${d+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&&c.jsxs(Mt,{variant:"subtle",className:K("table-of-contents",n),children:[c.jsx("h2",{children:r.formatMessage({id:"tableOfContents"})}),c.jsx("nav",{children:c.jsx("ul",{children:a.map(({id:s,text:o})=>c.jsx("li",{children:c.jsx("a",{href:`#${s}`,children:o})},s))})})]})};const mi=({time:e,rangeTime:t,prependedText:n,appendedText:r,className:a=""})=>{const i=ie.useIntl(),s="timeToComplete_";if(!e||typeof e!="number")return null;const o=d=>{const h=d/60,m=Math.floor(h),p=(h-m)*60,g=Math.round(p),f=`${i.formatMessage({id:`${s}hours`},{time:m})}${m>0&&g>0?", ":""}${i.formatMessage({id:`${s}minutes`},{time:g})}`;return{text:`${m>0?`${i.formatMessage({id:`${s}hours_short`},{time:m})} `:""}${g>0?i.formatMessage({id:`${s}minutes_short`},{time:g}):""}`,ariaText:f}};let{text:l,ariaText:u}=o(e);if(t){const{text:d,ariaText:h}=o(e+t);l=i.formatMessage({id:`${s}range`},{early:l,late:d}),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}`),c.jsx("span",{className:K("time-to-complete",a),"aria-label":u,children:l})};const m_=({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",c.jsx(ur,{...n,className:K("banner",e),image:{...t,aspect:"banner"}})):null;const p_=["small","span","strong","em","p","h1","h2","h3","h4","h5","h6","blockquote","q"],g_=({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 d=["eyebrow","title","text"],h={eyebrow:"small",title:"h1",text:"p"},m={};d.forEach(b=>{if(!t[b]){m[b]=!1;return}if(!s[b]){if(typeof t[b]=="object"){m[b]=t[b];const{text:v,element:C}=t[b];if(C&&p_.includes(C.toLowerCase()))return;m[b]={text:v,element:h[b]};return}m[b]={text:t[b],element:h[b]}}});const p=o&&o.text&&o.link;return p&&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"})}),c.jsx(yn,{className:K("banner-section",r,a,e,{"has-image":n,"image-full-width":n&&u.imageFullWidth,"image-inline":n&&!u.imageFullWidth,"has-cta":p,"has-extra-spacing":r!=="subtle"&&a==="normal"&&m.eyebrow&&m.title}),children:c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"content-wrapper",children:[d.map(b=>{if(m[b]&&typeof m[b]=="object"){const{text:v,element:C=""}=m[b];return b==="text"?c.jsx(Bn,{overrideType:"text-only",className:"text",children:v},b):y.createElement(C,{key:b,className:b},v)}return null}),l,p&&c.jsx(Fe,{variant:n||["light","subtle"].includes(r)?"primary":"secondary",size:{mobile:"medium",768:"large"},href:o.link,...o.props,className:K({new:r==="subtle",[(g=o.props)==null?void 0:g.className]:(f=o.props)==null?void 0:f.className}),children:o.text})]}),n&&c.jsx(ur,{image:{...n,aspect:u.imageFullWidth?"banner":n.aspect||void 0}})]})})},v_=y.memo(g_);const b_=({image:e,variant:t="default",children:n,className:r=""})=>{const a={};return e&&(a["--image"]=`url(${e})`),c.jsx(yn,{className:K("custom-content-banner",t,r,{"has-image":e}),style:a,children:c.jsx("div",{className:"content-slim",children:n})})};const y_=({alignImage:e="left",className:t,content:n,image:r})=>{const a=typeof n=="string"?c.jsx(Bn,{children:n}):n;return c.jsxs(yn,{className:K("highlight-section",t),children:[r&&c.jsx("div",{className:K("highlight-container highlight-image",{[`highlight-image-${e}`]:e==="right"}),children:c.jsx(ur,{image:{...r,description:"",query:"q=85",aspect:"highlightSection"}})}),c.jsx("div",{className:K("highlight-container highlight-content-wrapper",{"no-image":!r}),children:c.jsx("div",{className:K("highlight-content",{"highlight-content-right":e==="left"}),children:r?a:c.jsx("div",{className:"content-default",children:a})})})]})},x_=y.memo(y_);const D_=({variant:e="primary",button:t=null,title:n,text:r,gtmContext:a})=>!n&&!r?null:c.jsxs("aside",{className:K("marketing-block",e),children:[n&&c.jsx("p",{className:"title",children:n}),r&&c.jsx("p",{children:r}),t&&c.jsx(Fe,{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})]}),C_=({type:e,data:t})=>{const n=ie.useIntl(),{answers:r,createdAt:a,dateHasPassed:i,isOngoingEvent:s,pill:o,readingTime:l,publishedDate:u,startDate:d}=t;if(e==="question"){const h=a&&bs(a);return c.jsxs("p",{className:"details answers","data-testid":"question-answers",children:[n.formatMessage({id:"card_answers"},{number:r}),a&&c.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(d&&!i||s)return c.jsx("p",{className:"details",children:s?n.formatMessage({id:"card_bootcamp"}):Xs(d)});if(o)return c.jsx(Qt,{variant:o==="free"?"subtle":"highlighted",className:o,"data-testid":"course-type",children:o});if(l||u){const h=u&&bs(u);return c.jsxs("ul",{className:"details",children:[l&&c.jsx("li",{"data-testid":"reading-time",children:n.formatMessage({id:"card_time_read"},{time:l})}),u&&c.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},w_={title:66,text:3e3,secondaryText:1e3,partner:34},Qa={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"}},E_=({data:e,cta:t,link:n,gtmContext:r})=>{var f,b;const a=ie.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:d,slug:h}=e,m=e.contentType;let p="";if((f=Qa[m])!=null&&f.gtmEvent&&(p=Qa[m].gtmEvent),l&&u)return n?c.jsx("a",{href:n,className:"details additional-link gtm-trackable","data-gtm-event-context":`${r}-CarouselCard`,"data-gtm-event-type":`${p}-click`,children:o||a.formatMessage({id:"card_watch"})}):null;if(m==="people")return n?c.jsx(Fe,{variant:"tertiary",size:"small",href:n,className:"gtm-trackable","data-gtm-event-context":`${r}-Card-Button`,"data-gtm-event-type":`${p}-click`,children:o||a.formatMessage({id:"card_cta_people"})}):null;const g=["communityPage","microcourse","event"];if(t&&t.onClick&&g.includes(m)&&d!=="premium"){const v=i.loading||i.registered||((b=e==null?void 0:e.members)==null?void 0:b.isMember),C=async F=>{if(F.preventDefault(),F.stopPropagation(),!(v||!t||!t.onClick)){s(_=>({..._,loading:!0}));try{const _=await t.onClick(e);s(_==="success"?()=>({registered:!0,loading:!1}):w=>({...w,loading:!1}))}catch{s(w=>({...w,loading:!1}))}}};return c.jsx("p",{className:K("cta-wrapper",{"has-member-section":e==null?void 0:e.members}),children:c.jsx(Fe,{onClick:C,className:"gtm-trackable",size:"small",styling:{fullWidth:!0},disabled:v,"data-gtm-event-context":`${r}Page-${m}: ${h}`,"data-gtm-event-type":`${r}-${m}-register-click`,"data-testid":"in-card-button",children:o||a.formatMessage({id:`card_cta_${m}${v?`_${i.loading?"loading":"done"}`:""}`})})})}return null};function __({buildMemberData:e,communitySlug:t}){const n=ie.useIntl(),r=y.useContext(st),[a,i]=y.useState({count:"...",isMember:!1,memberType:""});return y.useEffect(()=>{e(t,typeof(r==null?void 0:r.id)<"u").then(s=>{if(!s)return;const{membersCount:o,role:l="",pagination:u}=s;let d=0;o?d=o:u!=null&&u.total&&(d=u==null?void 0:u.total),i({count:d.toString(),isMember:!!l,memberType:l})})},[t,e]),c.jsxs("span",{className:"member-information",children:[a.isMember&&c.jsx(Qt,{size:"small",variant:"registered",icon:(a==null?void 0:a.memberType)==="owner"?"user":"tick",children:n.formatMessage({id:`card_member_type_${a.memberType}`})}),c.jsx("span",{className:"label member-count",children:n.formatMessage({id:"card_member_count"},{count:a.count})})]})}const Zo=({id:e="",className:t="",buildCardData:n,buildMemberData:r,card:a,cta:i,gtmContext:s="Carousel",handleCardClick:o,setFocus:l=!1})=>{var R,A;const u=ie.useIntl(),d=y.useContext(st),h=!!(d!=null&&d.id),m=y.useRef(null),[p,g]=y.useState({data:null,isLoading:!0});y.useEffect(()=>{n(a,h).then(E=>{g({data:E,isLoading:!1})}).catch(()=>g(E=>({...E,isLoading:!1})))},[a,h,n]);const{data:f,isLoading:b}=p;if(b||!f)return c.jsx(St,{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||!Qa[v])return c.jsx(St,{element:"li",className:"card-wrapper"});const{basePath:C="",className:F,length:_,gtmEvent:w}=Qa[v];let k=f.slug?`${C}${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")&&(k=f.slug);const j=E=>{k&&(E.preventDefault(),E.stopPropagation(),window.location.href=k)},q={...w_,..._};let P={className:"card"},z={};return k&&(z={href:k,className:"gtm-trackable","data-gtm-event-context":`${s}-CarouselCard`,"data-gtm-event-type":`${w}-click`,"data-testid":"link"},f.openInNewTab&&(z.target="_blank"),P={onClick:j,className:"card gtm-trackable","data-gtm-event-context":`${s}-CarouselCard`,"data-gtm-event-type":`${w}-click`}),l&&(P={...P,tabIndex:"0"},(R=m==null?void 0:m.current)==null||R.focus(),(A=m==null?void 0:m.current)==null||A.scrollIntoView({behavior:"smooth"})),c.jsx("li",{className:K("card-wrapper text-medium",F,t,{"has-link":k,"no-link":!k,"has-image":f.banner}),"data-testid":`${v}-card`,children:c.jsxs("div",{...P,ref:m,children:[c.jsx(td,{className:"card-label",contentType:v,customIcon:f.isPrivate?"lock-locked":f.customIcon,customLabel:f.customLabel}),v==="communityPage"&&(f==null?void 0:f.createdAt)&&cm(f==null?void 0:f.createdAt,60)&&c.jsx(Qt,{size:"small",variant:"information","data-testid":"new-community",children:u.formatMessage({id:"card_new"})}),f.startDate&&!f.isOngoingEvent&&c.jsx(Qt,{size:"small",variant:f.dateHasPassed?"default":"information","data-testid":"date",children:f.dateHasPassed?u.formatMessage({id:"card_ended"}):Yc(f.startDate)}),f.banner?c.jsxs("p",{className:"img",children:[f.registered&&c.jsx(Qt,{size:"small",variant:"registered",children:u.formatMessage({id:"card_registered"})}),c.jsx(ur,{image:{...f.banner,description:""}})]}):F==="people"?c.jsx(gn,{name:f.title||"",src:f.profile,"data-testid":"people-profile-picture"}):null,f.contributors&&c.jsx(io,{contributors:{data:f.contributors},styling:{size:"small",showGap:F!=="question",showText:!0},multipleText:["event","solutionArticle"].includes(v)?u.formatMessage({id:`card_contributors_${v}`}):void 0,"data-testid":"contributors"}),f.partner&&c.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}):Xn(f.partner[0],q.partner)}),["title","text","secondaryText"].map(E=>{const S=f[E];if(!S)return null;const O=Uc(E),V={key:E,className:O,"data-testid":O},H={wrapper:"p",forceWrapper:!0,forceInline:!0},Q=Xn(S,q[E]);return["title","text"].includes(E)&&k?(H.wrapper="a",c.jsx("p",{...V,children:c.jsx(Wt,{options:H,...z,children:Q})})):c.jsx(Wt,{options:H,...V,children:Q})}),a.contentType==="communityPage"&&(a.slug||f.slug)&&r&&c.jsx(__,{communitySlug:a.slug||f.slug,buildMemberData:r}),c.jsx(C_,{type:F||"",data:f}),c.jsx(E_,{data:f,cta:i,link:k||"",gtmContext:s})]})})};const $h=({cards:e,cardTypes:t,className:n="",...r})=>c.jsx("ul",{className:K("card-block",n),children:e.map((a,i)=>{const s=a.slug?`${a.slug}-${t[i]}`:`${t[i]}-${i}`;return c.jsx(Zo,{id:s,card:{...a,contentType:t[i]},setFocus:i===(r==null?void 0:r.focusCardIndex),...r},s)})}),k_=(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},F_=({id:e,title:t})=>{const n=ie.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:K("title",i,s,{"highlighted-title":i==="highlighted"}),children:c.jsxs(c.Fragment,{children:[r,o&&c.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 hs={fourCards:1024,threeCards:769,twoCards:480};let ba=null,ms=null;const B_=({id:e,cards:t,cardTypes:n,buildCardData:r,title:a,className:i,gtmContext:s,...o})=>{const l=ie.useIntl(),u="carousel_pagination_",[d,h]=y.useState({cardsPerPage:4,isLoading:!0}),{cardsPerPage:m,isLoading:p}=d,[g,f]=y.useState({currentPage:0,loadedPages:[0]}),{currentPage:b,loadedPages:v}=g,[C,F]=y.useState(""),_=t.length,w=Math.ceil(_/m),k=y.useRef(null),j=Pn(!0,!0,k==null?void 0:k.current);y.useEffect(()=>{let E=1;j&&(j>=hs.fourCards?E=4:j>=hs.threeCards?E=3:j>=hs.twoCards&&(E=2),E>_&&(E=_)),h(S=>({...S,cardsPerPage:E,isLoading:!1}))},[j,_]);const q=(E="next")=>{ms&&clearTimeout(ms);let S=b;if(typeof E=="string")if(E==="next")if(b<w-1)S=b+1;else return;else if(b>0)S=b-1;else return;else S=E;F(""),f(V=>({...V,currentPage:S,loadedPages:[...new Set([...v,S])]}));const O=()=>{const V=S*d.cardsPerPage,H=V+d.cardsPerPage;return t.slice(V,H).length};ms=setTimeout(()=>{F(l.formatMessage({id:`${u}ariaLive${typeof E=="string"?"":"_slide"}`},{direction:l.formatMessage({id:`${u}${typeof E=="string"?E:"next"}`}),slide:typeof E=="string"?1:E+1,count:O()}))},500)},P=E=>{ba=E.touches[0].clientX},z=E=>{if(ba===null)return;const S=E.touches[0].clientX,O=ba-S;O>5?q("next"):O<-5&&q("previous"),ba=null},R={"--width":`${j||0}px`,"--total-cards":_,"--cards-per-page":m,"--page":b};if(p)return c.jsx(ni,{layout:`carousel${a?"-with-title":""}`});const A=(E,S)=>{var V;let O=null;return(V=E==null?void 0:E.sys)!=null&&V.id?O=`card-${E.sys.id}`:E!=null&&E.slug?O=`card-${E.slug}`:[n[S],E.contentType].includes("customCard")&&(O=`card-${window.btoa(`${E.title} ${E.createdAt}`)}-${S}`),O};return c.jsxs("section",{ref:k,className:K("carousel-wrapper",i),"data-testid":"carousel",children:[c.jsx(F_,{id:e,title:a}),c.jsx("ul",{className:"carousel",onTouchStart:P,onTouchMove:z,style:R,"data-testid":"carousel-list",children:t.map((E,S)=>{let O=A(E,S);return O&&k_(S,m,b,v)?c.jsx(Zo,{id:O,card:{...E,contentType:n[S]},buildCardData:r,gtmContext:s,...o},O):(O=O||`${e}-card-${S}`,c.jsx(St,{element:"li",className:"card-wrapper","data-testid":"card-placeholder"},O))})}),w<=1?null:c.jsxs(c.Fragment,{children:[c.jsxs("ul",{className:"controls","data-testid":"carousel-controls",children:[c.jsx("li",{className:"arrow previous",children:c.jsx(Fe,{variant:"secondary",size:"large",icon:{icon:"chevron_left"},onClick:E=>{E.preventDefault(),E.stopPropagation(),q("previous")},screenreaderText:l.formatMessage({id:`${u}previousSlide`}),disabled:b<=0})}),[...Array(w)].map((E,S)=>c.jsx("li",{"data-testid":"carousel-controls-button",children:c.jsx("button",{className:K("page-indicator",{selected:S===b}),onClick:O=>{O.preventDefault(),O.stopPropagation(),q(S)},children:c.jsx(Ie,{showOnFocus:!1,children:l.formatMessage({id:`${u}slide`},{number:S+1,total:w})})})},`page-indicator-${S}`)),c.jsx("li",{className:"arrow next",children:c.jsx(Fe,{variant:"secondary",size:"large",icon:{icon:"chevron_right"},onClick:E=>{E.preventDefault(),E.stopPropagation(),q("next")},screenreaderText:l.formatMessage({id:`${u}nextSlide`}),disabled:b>=w-1})})]}),c.jsx(Ie,{"aria-live":C===""?"off":"polite",showOnFocus:!1,children:C})]})]})},A_=({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 d=i?window.btoa(i):`carousel-${u}`,h=u===e.length-1;return t?c.jsxs(y.Fragment,{children:[c.jsx(ni,{layout:`carousel${i?"-with-title":""}`,"data-testid":"carousel-placeholder"}),h?null:c.jsx(Ht,{})]},`placeholder-${d}`):c.jsxs(y.Fragment,{children:[c.jsx(B_,{cards:o,cardTypes:l,title:n!=null&&n.hidden?{}:{...n,text:i,link:s},...a}),h?null:c.jsx(Ht,{})]},`carousel-${d}`)});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=ie.useIntl();let u=a?n:r;u>99?u=100:u<1&&(u=0);const{highlightPercentage:d=!1}=s;return y.createElement(e,{className:K("course-progression",o,{"highlight-percentage":d,"has-circle-graph":i==="circle"}),children:c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"percentage",children:l.formatMessage({id:"courseProgression_done"},{percent:h=>c.jsx("strong",{children:h}),number:u})}),u<100&&a&&c.jsx(mi,{time:t,appendedText:l.formatMessage({id:"courseProgression_timeLeft"})}),c.jsx(ao,{progress:u,styling:{layout:i||"bar",size:i&&i==="circle"?"small":"default"}})]})})};const Lh=({element:e="span",sectionId:t,subsectionId:n,title:r,className:a=""})=>y.createElement(e,{className:K("lesson-name",a),"data-number":`${t}.${n}`,children:r});const zh=({size:e="default",completionTime:t,icon:n,optional:r,type:a,children:i})=>{const s=ie.useIntl(),o=Xa(`lessonType_${a}`)?s.formatMessage({id:`lessonType_${a}`}):Vc(a||"");return c.jsxs("small",{className:K("content-type",{[e]:e!=="default"}),children:[c.jsx("span",{className:K("type",n),children:o})," ",t>0&&!r&&c.jsx(mi,{time:t})," ",i?c.jsx("span",{className:"additional",children:i}):null]})};const S_=({course:{articles:e,canAccessCourse:t,description:n,hideTimes:r,isEnrolled:a,sectionId:i,sectionTime:s,slug:o,timeLeft:l,title:u},quizScores:d})=>{const h=ie.useIntl(),m="courseStructure_",p=u.toLowerCase().includes("course conclusion");return c.jsxs(ei,{className:"course-structure",label:c.jsxs(c.Fragment,{children:[c.jsxs("small",{children:[h.formatMessage({id:`${m}section${p?"_end":""}`},{number:i})," ",!r&&s>=0&&c.jsx("span",{className:"time",children:a&&l===0?h.formatMessage({id:`${m}time_completed`}):c.jsx(mi,{time:s,appendedText:a?h.formatMessage({id:`${m}time_left`}):""})})]}),c.jsx("h3",{children:u})]}),shouldAnimate:!0,children:[c.jsx("p",{children:n}),c.jsx("ol",{children:e&&e.length>0&&e.map(({completed:g,completionTime:f,contentType:b,icon:v,image:C,isIntroduction:F,optional:_,slug:w,subsectionId:k,title:j,type:q})=>{const P=a&&t||F,z={};return C&&(z.style={"--image":`url(${C})`}),c.jsx("li",{className:K({article:b===Cr.ARTICLE,discussion:b===Cr.DISCUSSION,quiz:b===Cr.QUIZ,completed:g&&b===Cr.ARTICLE,locked:!P}),...z,children:c.jsx(mn,{href:P?`/microcourses/en/${o}/${w}`:void 0,fallbackElement:"span",className:"inner",gtmContext:`MicrocourseOutline${Hc(j)}`,gtmType:"article-click",children:c.jsxs(c.Fragment,{children:[c.jsx(Lh,{sectionId:i,subsectionId:k,title:j,className:"course-title"})," ",c.jsx(zh,{completionTime:f,icon:v,optional:_,type:q,children:d&&d[w]&&c.jsx("span",{className:"quiz-score",children:`${d[w]}%`})})]})})},w)})})]})};const j_=({isComplete:e=!1,onClick:t,...n})=>{const r=ie.useIntl();return n["data-gtm-event-context"]||(n["data-gtm-event-context"]="LessonIntroduction"),c.jsx(Fe,{...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:K("mark-complete-button center gtm-trackable",{completed:e}),"data-gtm-event-type":"mark-as-complete",disabled:e,children:r.formatMessage({id:`markCompleteButton${e?"_completed":""}`})})},O_=({id:e,data:{jobTitle:t,name:n,organization:r,thumbnail:a}})=>({id:e,name:n,jobTitle:t,organization:r,image:{thumbnail:a}}),Oc=[{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 ya="notFoundError_",P_=()=>{const e=ie.useIntl(),t=[];return Oc.forEach((n,r)=>{n.title=e.formatMessage({id:`${ya}post_${r+1}`}),t.push("solutionArticle")}),c.jsxs(yh,{styling:{background:"bold",circle:"small",variant:"alt-2"},additionalContent:{appended:c.jsxs(yn,{children:[c.jsx($h,{cards:Oc,cardTypes:t,buildCardData:n=>new Promise((r,a)=>{r(n)})}),c.jsx(Fe,{href:"/solution-articles/",children:e.formatMessage({id:`${ya}cta`})})]})},reportError:()=>{},className:"not-found-error",children:[c.jsx("h1",{children:e.formatMessage({id:`${ya}title`})}),c.jsx("p",{children:e.formatMessage({id:`${ya}text`})})]})};exports.ASSETS_BUCKET=Ut;exports.ActivitiesFeed=PE;exports.ActivitySection=s_;exports.AddPost=Vo;exports.Badge=pd;exports.BadgeScope=it;exports.Badges=gd;exports.BadgesContext=eo;exports.BadgesProvider=od;exports.Banner=m_;exports.BannerSection=v_;exports.Breadcrumbs=Yp;exports.Buckets=km;exports.Button=Fe;exports.ButtonWrapper=or;exports.COURSE_CONTENT_TYPES=Cr;exports.CacheProvider=ud;exports.Card=Zo;exports.CardBlock=$h;exports.Carousel=A_;exports.CharacterLimit=fo;exports.CollapsibleSection=ei;exports.Columns=Od;exports.CommunityDetails=Zp;exports.ContactFooter=Qw;exports.ContactForm=hh;exports.ContentTypeLabel=td;exports.Contributors=io;exports.ConversationContext=fi;exports.CookieBanner=bh;exports.CourseProgression=T_;exports.CourseStructure=S_;exports.CustomContentBanner=b_;exports.CustomEvents=tt;exports.DELETED_USER_ID=Or;exports.Directory=c_;exports.DiscussionConversation=Ch;exports.DiscussionForm=Zr;exports.DiscussionFormCard=Mh;exports.DiscussionFormModal=Ih;exports.DiscussionLikes=wh;exports.DiscussionPost=Yr;exports.DiscussionThread=Rh;exports.Divider=Ht;exports.DownloadSection=Kw;exports.EMAILS=Un;exports.EditSection=Yw;exports.EmailHelperTextBox=Md;exports.EmptyStateBox=pn;exports.EnrichedUrl=Gp;exports.FeatureFlags=to;exports.Filters=Qp;exports.FlagsProvider=cd;exports.Footer=$o;exports.Form=nn;exports.Formatting=Y;exports.Fragment=Ft;exports.FullWidthSection=yn;exports.GET_STREAM_USER_PREFIX=vs;exports.GlobalProviders=zm;exports.Header=Lo;exports.HelperTextBox=rd;exports.HiddenFromScreenReaders=Ja;exports.HideShowTextBox=ad;exports.HighlightSection=x_;exports.HighlightedTextBox=Mt;exports.INVALID_TOKEN=Kc;exports.IconBulletedList=Am;exports.ImageContainer=Cm;exports.IntlProvider=dd;exports.InviteForm=mh;exports.InviteModal=u_;exports.JoinButton=lo;exports.LanguageContext=no;exports.LanguageSwitcher=Xp;exports.LessonName=Lh;exports.LessonType=zh;exports.LikesFeed=Oh;exports.LikesModal=Ph;exports.Link=mn;exports.LoadMore=Vr;exports.LoadingBlock=Hm;exports.LoadingPlaceholder=St;exports.LoadingState=ni;exports.Logo=co;exports.LogoSection=Gw;exports.MEMBERS_PER_PAGE=xh;exports.MENTION_REGEX=Zc;exports.MarkCompleteButton=j_;exports.MarkdownText=Bn;exports.MarketingBlock=D_;exports.Marks=qt;exports.Member=Jt;exports.MembersList=Dh;exports.Modal=so;exports.MoreMenu=Sd;exports.NUMBER_OF_COUNTRIES=om;exports.NUMBER_OF_USERS=sm;exports.NavigationMenu=jd;exports.NotFoundError=P_;exports.Overlay=tn;exports.OverlayContext=ro;exports.OverlayProvider=md;exports.PageHeading=id;exports.PageLayout=yh;exports.PasswordForm=Lw;exports.PasswordRules=Ld;exports.Pill=Qt;exports.Popover=ed;exports.Portal=lr;exports.ProfileForm=ph;exports.ProfileImageChange=fh;exports.ProfileModal=hi;exports.ProfileModalLauncher=Ko;exports.ProfilePicture=gn;exports.ProgressBar=ao;exports.ProgressTracker=Em;exports.Rating=bg;exports.RepliesFeed=jh;exports.ResponsesHeading=Nh;exports.ResponsiveImage=ur;exports.ReturnToNavButton=_m;exports.RichTextEditor=dh;exports.SearchForm=gh;exports.ShareLinks=ig;exports.SignupForm=Vw;exports.Span=Ds;exports.StatusBanner=Mr;exports.TableOfContents=h_;exports.Tabs=sg;exports.Tags=nE;exports.TestimonialBlock=f_;exports.TimeToComplete=mi;exports.Toggle=$w;exports.Tooltip=Mn;exports.TopLevelPage=Jw;exports.UUID_V4_REGEX=Pr;exports.UserContext=st;exports.UserProvider=fd;exports.VisuallyHidden=Ie;exports.addAriaProps=Td;exports.basicReducer=Hr;exports.camelCaseToDashCase=Uc;exports.checkIntlPathExists=Xa;exports.generateConditions=Ta;exports.generateCssIcon=um;exports.getAuthorData=dr;exports.getCharacterLimitProps=Pd;exports.getLongDate=Xs;exports.getMember=ri;exports.getPostBody=Ho;exports.getShortDate=Yc;exports.getValueLength=ai;exports.headerData=Ur;exports.mapGetStreamData=O_;exports.pageReady=Gc;exports.passwordValidator=ys;exports.repliesFeedMock=ME;exports.supportedLanguages=Ca;exports.toCamelCase=Hc;exports.toCapitalisedCase=im;exports.toSentenceCase=Vc;exports.transformSlugs=Ys;exports.useBadges=sd;exports.useCurrentPath=Ic;exports.useEffectAfterMount=er;exports.useElementWidth=Pn;exports.useOverlay=hd;exports.useScrollListener=zc;exports.useScrollToHash=Qs;exports.useTooltips=Js;exports.useUser=ti;
165
+ `;return a.slice(0,i.length)===i&&(a=a.slice(i.length)),n?await Qc({text:a,template:"[@{{name}}](/profiles/{{id}})",mentions:n,listMembers:r}):a};const KE=3e3,ZE=({url:e,gtm:t={context:"ShareLink",event:"copy-link-click"}})=>{const n=ie.useIntl(),r="discussion_share_copy_link",[a,i]=y.useState({isOpen:!1,isCopied:!1});return c.jsxs("li",{className:"share-link-wrapper",children:[c.jsx(Ka,{className:"gtm-trackable",icon:{icon:"link_chain"},onMouseOver:()=>i({...a,isOpen:!0}),onFocus:()=>i({...a,isOpen:!0}),onMouseOut:()=>i({isOpen:!1,isCopied:!1}),onBlur:()=>i({isOpen:!1,isCopied:!1}),onClick:()=>{navigator.clipboard.writeText(e).then(()=>{i({isOpen:!0,isCopied:!0});const s=new CustomEvent("ariaLive",{detail:{message:n.formatMessage({id:`${r}_success`})}});document.dispatchEvent(s),setTimeout(()=>{i({isOpen:!1,isCopied:!1})},KE)})},"data-gtm-event-context":t.context,"data-gtm-event-type":t.event,screenreaderText:n.formatMessage({id:r})}),c.jsx(Mn,{className:K({copied:a.isCopied}),isOpen:a.isOpen,styling:{hasPointer:"bottom",extraPadding:!1},children:n.formatMessage({id:`${r}${a.isCopied?"_success":""}`})})]})},It="discussion_",YE=195;let va=null;const Yr=({element:e="div",content:t,userHasPermissions:n=!0,userHasOwnerPermissions:r=!1,isLoading:a=!1,originalAuthorId:i,forceHide:s={actionBar:!1,comments:!1,likes:!1},functions:o,links:l={},className:u,gtmContext:d="DiscussionAnswer",children:h,isTruncated:m=!1,styling:{showShareLinkButton:p=!1,showMoreMenuButton:g=!0}={},setFocus:f=!1,isCommunity:b=!1,badges:v,basePath:C,parentId:F})=>{var De,Le,Ue,G,oe,he,ge,Ee;const _=ie.useIntl(),w=y.useContext(st),k=y.useContext(fi),{createContent:j=async()=>{},deleteContent:q=async()=>{},updateContent:P=async()=>{}}=o.content||{},{createLike:z=()=>{},deleteLike:R=()=>{},listLikes:A=async()=>({})}=o.likes||{},{openComments:E=()=>{}}=o.comments||{},{listMembers:S=()=>Promise.resolve([]),clickMentionFallback:O=()=>{}}=o.mentions||{},{author:V,canLike:H,createdAt:Q,id:ae,likes:D=0,userLiked:$,comments:X=0,mentions:B}=t,T=w&&w.id&&typeof V!="string"&&V.id&&V.id===w.id||!1,L=typeof H=="boolean"?H:!0,I=T&&(!t.createdAt||lm(t.createdAt,10,"seconds")),W=y.useRef(null),[U,ne]=y.useState({title:t&&t.body!==t.title&&t.title||"",body:t&&t.body||"",isEditing:!1,didEdit:t&&t.isEdited||!1,postBody:"",memberCustomMessage:(t==null?void 0:t.memberCustomMessage)||""}),[re,le]=y.useState(!1),[ee,pe]=y.useState(I?"highlighted":"default"),[me,_e]=y.useState("");y.useEffect(()=>{const be=W.current;if(!(!be||ee==="default"))return document.addEventListener(tt.DISCUSSION_FORM_SUBMITTED,Be),be.addEventListener("transitionend",Se),()=>{document.removeEventListener(tt.DISCUSSION_FORM_SUBMITTED,Be),be.removeEventListener("transitionend",Se)}},[]),y.useEffect(()=>{ne({...U,title:t&&t.title||"",body:t&&t.body||"",didEdit:t&&t.isEdited||!1})},[t.isEdited]),y.useEffect(()=>{(async()=>{const we=await Ho(U.body,m,B,S);ne({...U,postBody:we})})()},[U.body,B]);const Be=()=>{setTimeout(()=>{pe("fading")},1e3)},Se=({propertyName:be})=>{be==="background-color"&&pe(we=>(we==="default"&&(document.removeEventListener(tt.DISCUSSION_FORM_SUBMITTED,Be),W.current&&W.current.removeEventListener("transitionend",Se)),we==="fading"?"default":we))};if(a||!t||t.type==="answer"&&(!t.slugs||!t.slugs.question)||U.postBody===""&&t.title==="")return c.jsx(St,{className:"discussion-card"});const Ye=async({title:be,body:we})=>{be||(be=""),we||(we=""),_e("");try{if(!ps(be,U.title)||!ps(we,U.body)){const et=t.type==="question"?{title:we}:{title:be,body:we};await P(Ys(t.slugs),et)}ne({...U,title:be,body:we,isEditing:!1,didEdit:!0})}catch{_e(`${It}form_error`)}},Ke=()=>{if(k&&k.updateConversation){const be={showForm:!0},we=t.author;we&&we.id&&(b&&(be.prepopulateForm=`@{{${we.id}}}`),be.mentionData={id:we.id,name:we.name}),k.updateConversation(be)}setTimeout(()=>{var ht,Qe,yt;const we=`reply-form-${(t.type==="answer"?t.slug:((ht=t.slugs)==null?void 0:ht.reply)||((Qe=t.slugs)==null?void 0:Qe.answer)||((yt=t.slugs)==null?void 0:yt.question)||"").toLowerCase().slice(-15)}`,et=document.getElementById(we),Et=document.getElementById(`${we}-input`);Et&&Et.focus(),et&&et.scrollIntoView({behavior:"smooth"})},0)},je=async()=>{le(!1);try{await q(Ys(t.slugs))}catch{_e("delete-error")}},Oe=[{text:_.formatMessage({id:`${It}moreMenu_report`}),onClick:be=>{be.stopPropagation()},href:`mailto:community@apolitical.co?subject=${encodeURI(_.formatMessage({id:`${It}report_subject`}))}&body=${encodeURI(_.formatMessage({id:`${It}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&&T&&Oe.push({text:_.formatMessage({id:`${It}moreMenu_edit`}),onClick:()=>ne({...U,isEditing:!0}),icon:"pencil-paper",className:"gtm-trackable","data-gtm-event-context":d,"data-gtm-event-type":`edit-${t.type}-click`},{text:_.formatMessage({id:`${It}moreMenu_delete`}),onClick:be=>{be.preventDefault(),be.stopPropagation(),le(!0)},icon:"trash",className:"gtm-trackable","data-gtm-event-context":d,"data-gtm-event-type":`delete-${t.type}-click`,...Td(`delete-${t.slug}-modal`,re)}),r&&o.pins&&Oe.push({text:_.formatMessage({id:`${It}moreMenu_${t.pinned?"unpin":"pin"}`}),onClick:t.pinned?o.pins.deletePin:o.pins.createPin,icon:t.pinned?"unpin":"pin",className:"gtm-trackable","data-gtm-event-context":d,"data-gtm-event-type":`edit-${t.type}-click`}),f&&((De=W==null?void 0:W.current)==null||De.focus(),(Le=W==null?void 0:W.current)==null||Le.scrollIntoView({behavior:"smooth"})),y.createElement(e,{className:K("discussion-post",u,{[ee]:!u||!u.includes("highlighted-text-box"),"has-link":l.post&&!U.isEditing,"is-pinned":(t==null?void 0:t.pinned)||!1}),ref:W,tabIndex:f?0:null,"data-testid":`discussion-${t.type}-thread`,"data-gtm-event-context":`${d}-post-click`,onClick:be=>{if(!l.post||U.isEditing)return;be.preventDefault(),be.stopPropagation(),va&&clearTimeout(va),va=setTimeout(()=>{window.location.href=l.post},150);const we=new CustomEvent(tt.DISCUSSION_POST_CLICKED,{detail:{link:l.post,timeout:va}});document.dispatchEvent(we)},children:c.jsxs(c.Fragment,{children:[c.jsxs("div",{id:ae||t.slug,className:K("discussion-card",t.type,{editing:U.isEditing,"has-link":l.post&&!U.isEditing}),children:[!U.isEditing&&c.jsxs("div",{className:"author-section",children:[c.jsx(Jt,{member:V,additionalContent:{createdAt:Q,didEdit:U.didEdit,customMessage:U.memberCustomMessage},className:typeof V!="string"&&V.id===i?"highlighted":"",styling:{additionalContentNewLine:!!U.memberCustomMessage},gtmContext:d,gtmType:"profile-click",badges:v}),t.pinned&&c.jsx(Qt,{variant:"naked",size:"xlarge",icon:"pin",children:c.jsx(Ie,{children:"Pinned Post"})})]}),U.isEditing?c.jsx(Zr,{id:`editing-${t.slug}`,content:{type:t.type,slugs:t.slugs},userHasPermissions:n,meta:{isLoading:a,isInWrapper:!0,hasTitleField:U.title!==""?{text:U.title}:!1,isEditing:{text:U.body},isPrepopulated:!1},isCommunity:b,maxLength:t.type==="question"?250:5e4,forceShow:{error:me!==""&&me!=="delete-error"?_.formatMessage({id:me},{action:_.formatMessage({id:`discussion_action_${t.type}`})}):!1},functions:{create:j,handleSaveEdit:Ye,handleCancel:()=>{_e(""),ne({...U,isEditing:!1})},listMembers:S,clickMentionFallback:O},gtmContext:`${d}Form`,data:{mentions:t.mentions}}):l.post?c.jsxs("a",{href:l.post,children:[(U==null?void 0:U.title)&&c.jsx("p",{className:"content-title",children:U==null?void 0:U.title}),U.postBody.length>YE?c.jsx(ad,{text:U.postBody,markdownOptions:{overrides:{a:Ds,blockquote:{component:ds}}}}):c.jsx(Bn,{options:{overrides:{a:Ds,blockquote:{component:ds}}},children:U.postBody})]}):c.jsxs(c.Fragment,{children:[(U==null?void 0:U.title)&&c.jsx("p",{className:"content-title",children:U==null?void 0:U.title}),c.jsx(Bn,{options:{wrapper:t.type==="question"?"h1":y.Fragment,forceWrapper:t.type==="question",forceInline:t.type==="question",forceBlock:t.type!=="question",overrides:{blockquote:{component:ds}}},children:U.postBody})]}),!U.isEditing&&!(s!=null&&s.actionBar)&&c.jsxs("ul",{className:K("actions text-medium",t.type),"data-testid":`${t.type}-actions`,children:[!s.likes&&c.jsx(wh,{element:"li",likes:D,isShort:!1,userLiked:$,content:{type:t.type,slugs:t.slugs,slug:t.slug},canLike:L,peopleWhoLiked:t.peopleWhoLiked,activityId:t.slug,functions:{createLike:z,deleteLike:R,listLikes:A},badges:v,basePath:C,parentId:F}),!s.comments&&(["question","post"].includes(t.type)||l.comments)&&c.jsx("li",{children:c.jsx(Ka,{onClick:be=>{be.preventDefault(),be.stopPropagation(),l.comments&&(window.location.href=l.comments),typeof E=="function"&&E()},icon:{icon:"speech-bubble_square"},"data-gtm-event-context":d,"data-gtm-event-type":`answer-${t.type}-click`,screenreaderText:_.formatMessage({id:`${It}comments_screenReader`},{count:X}),children:_.formatMessage({id:`${It}comments`},{count:X})})}),(t.type==="answer"||t.type==="reply")&&c.jsx("li",{children:c.jsx(Ka,{styling:{muted:!0},onClick:Ke,icon:{icon:"speech-bubble_square"},children:_.formatMessage({id:`${It}reply`})})}),p&&c.jsx(ZE,{url:(Ue=t.slugs)!=null&&Ue.reply?`${window.location.origin}${(G=t.slugs)==null?void 0:G.question}/${(oe=t.slugs)==null?void 0:oe.answer}#${(he=t.slugs)==null?void 0:he.reply}`:`${window.location.origin}${(ge=t.slugs)==null?void 0:ge.question}/${(Ee=t.slugs)==null?void 0:Ee.answer}`,gtm:{context:d,event:`copy-link-${t.type}-click`}}),g&&c.jsx(Sd,{element:"li",id:`more-${t.slug}`,options:Oe})]})]}),h,c.jsx(tn,{id:`delete-${t.slug}-modal`,isOpen:re,functions:{onOpen:()=>{},onClose:()=>le(!1)},forceShow:{error:me==="delete-error"?_.formatMessage({id:"discussion_delete_error"},{action:_.formatMessage({id:`discussion_action_${t.type}`})}):!1},title:_.formatMessage({id:"discussion_delete_title"},{action:_.formatMessage({id:`discussion_action_${t.type}`})}),buttons:[{variant:"secondary",onClick:()=>le(!1),children:_.formatMessage({id:"discussion_delete_cancel"})},{variant:"primary",className:"destructive",onClick:je,children:_.formatMessage({id:"discussion_delete_delete"})}],gtmContext:`${t.type.charAt(0).toUpperCase()}${t.type.slice(1)}:${t.slug}`,children:c.jsx(ie.FormattedMessage,{id:"discussion_delete_text",values:{p:be=>c.jsx("p",{children:be}),action:_.formatMessage({id:`discussion_action_${t.type}`})}})})]})})};const GE=y.lazy(()=>Promise.resolve().then(()=>o_)),QE=65,Mh=({forceShow:e,form:t,className:n})=>{const r=ie.useIntl(),a="discussionFormCard_",i="DiscardDraftModal",o=y.useContext(st)||"community",l=ri(o);l.name||(l.name=r.formatMessage({id:`member_${typeof o=="string"?o:"community"}`}));const{modal:u=!1}=e||{},[d,h]=y.useState({form:u||Xc("showPost")==="true"||!1,warning:!1}),[m,p]=y.useState({showCachedText:!1});y.useEffect(()=>{if(!m.showCachedText)return;(async()=>{const v=await Ho(m.title||m.body||"",QE,m.mentions);p(C=>({...C,prettifiedText:v}))})()},[m.showCachedText,m.title,m.body]);const g=b=>{if(!m.showCachedText||typeof d.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 C=b;C.preventDefault(),C.stopPropagation();const _=C.target.closest("a");v=_&&_.getAttribute("href")}h(C=>({...C,warning:v||!1}))};y.useEffect(()=>{if(!m.showCachedText){document.removeEventListener(tt.DISCUSSION_POST_CLICKED,g),document.removeEventListener(tt.MEMBER_CLICKED,g),document.removeEventListener("click",g);return}return document.addEventListener(tt.DISCUSSION_POST_CLICKED,g),document.addEventListener(tt.MEMBER_CLICKED,g),document.addEventListener("click",g),()=>{document.removeEventListener(tt.DISCUSSION_POST_CLICKED,g),document.removeEventListener(tt.MEMBER_CLICKED,g),document.removeEventListener("click",g)}},[m.showCachedText]),y.useEffect(()=>{const b=v=>{if(!(!m.showCachedText||d.warning!==!1))return v.preventDefault(),v.returnValue=""};return window.addEventListener("beforeunload",b,{capture:!0}),()=>{window.removeEventListener("beforeunload",b,{capture:!0})}},[m.showCachedText,d.warning]);let f=r.formatMessage({id:`${a}placeholder`});return m.showCachedText&&(m.title||m.body)&&(f=m.prettifiedText||f),c.jsxs(c.Fragment,{children:[c.jsxs("button",{className:K("discussion-form-card",n),onClick:b=>{b.preventDefault(),b.stopPropagation(),h(v=>({...v,form:!0}))},"data-testid":"discussion-form-card",children:[c.jsx(gn,{name:l.name,src:l.image,alt:""}),c.jsx(Bn,{className:K("input",{placeholder:!m.showCachedText}),element:"span",options:{forceInline:!0,overrides:{a:Ft,blockquote:Ft,br:Ft,em:Ft,li:Ft,ol:Ft,p:Ft,s:Ft,span:Ft,strong:Ft,ul:Ft}},children:f})]}),c.jsxs(lr,{children:[c.jsx(GE,{showModal:d.form,functions:{cacheText:p,onClose:()=>{h(b=>({...b,form:!1}))}},form:t,cachedText:m,className:"in-portal"}),c.jsx(tn,{id:t.id?`${t.id}-warning`:"discussion-form-card-warning",className:"in-portal",isOpen:d.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 d.warning=="string"&&(window.location.href=d.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:c.jsx("p",{children:r.formatMessage({id:`${a}overlay_text`})})})]})]})},JE=y.lazy(()=>Promise.resolve().then(()=>sE)),Vo=({isCard:e=!1,form:t,parentId:n,membershipRequiredToPost:{isMember:r,required:a,join:i,leave:s,notMemberStateText:o}})=>{if(a&&!r)return c.jsx(pn,{text:o,button:{breakpoints:{mobile:!0,901:!1},component:c.jsx(lo,{isShort:!0,functions:{join:i,leave:s}})}});const{content:l,functions:u,meta:d,...h}=t,m={content:{type:(l==null?void 0:l.type)||"reply",slugs:(l==null?void 0:l.slugs)||{}},functions:{...u,create:(u==null?void 0:u.create)||(()=>{})},parentId:n,meta:{...d,isEditing:(d==null?void 0:d.isEditing)||!1,isPrepopulated:!1,showSuccessMessage:!1},...h,id:`add-post-${h.id||""}`};return e?c.jsx(Mh,{form:m}):c.jsx(JE,{...m})},Ko=({form:e})=>{const t=y.useContext(st),n=ie.useIntl(),[r,a]=y.useState(!1),i=()=>{bm(t)||a(!0)};y.useEffect(()=>(document.addEventListener(tt.DISCUSSION_POST_ADDED,i),()=>{document.removeEventListener(tt.DISCUSSION_POST_ADDED,i)}));const s={};return["successMessage","title","text"].forEach(o=>{s[o]=n.formatMessage({id:`profileModalLauncher_${o}`})}),c.jsx(hi,{form:e,showModal:r,functions:{onClose:()=>{a(!1)}},content:s})};const fs="discussion_responses_",Nh=({type:e="answer",responses:t=0,isLoading:n=!1})=>{const r=ie.useIntl();return t=parseInt(t),c.jsxs("div",{className:"responses-heading",children:[c.jsx("h4",{children:r.formatMessage({id:`${fs}title`},{action:r.formatMessage({id:`${fs}${e}`}),count:t})}),!n&&t===0&&c.jsx("p",{children:jt(r.formatMessage,`${fs}empty`,e,e)})]})};const Rh=({loadMore:{isLoading:e,hasNextPage:t,loadNextPage:n}={isLoading:!1,hasNextPage:!1,loadNextPage:()=>{}},form:r,children:a})=>{const i=ie.useIntl(),s=y.useContext(fi),o=Da(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 c.jsxs("div",{className:K("thread-wrapper",{"empty-thread":!o}),children:[!Object.is(o,null)&&c.jsx("ul",{className:"thread",children:o}),!e&&c.jsx(Vr,{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&&c.jsx(Zr,{...r})]})};function XE({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=We.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 e_({queryFn:e,queryKey:t}){const{data:n,error:r,isLoading:a,isFetching:i}=We.useQuery({queryFn:e,queryKey:t});return{activity:n,error:r,isLoading:a,isFetching:i}}function t_({queryFns:{read:e,edit:t,like:n,unlike:r,pin:a,unpin:i},queryKey:s}){const o=We.useQueryClient(),l=ti(),u={queryClient:o,queryKey:s},d={mutationHandlers:{error:zo(u),mutate:qo(u)},user:l,...u},h=XE({...d,mutationFn:t}),m=n_({...d,mutationFn:n}),p=r_({...d,mutationFn:r}),g=a_({...d,mutationFn:a}),f=i_({...d,mutationFn:i}),{activity:b,...v}=e_({queryKey:s,queryFn:e});return{activity:b,mutations:{edit:h,like:m,unlike:p,pin:g,unpin:f},user:l,...v}}function n_({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:a}){const{mutate:i}=We.useMutation({mutationFn:e,onMutate:s=>t(o=>(o&&Za({activity:o}),o)),onError:n,onSuccess:(s,o,l)=>{l&&Za({activity:l,reaction:s}),r.setQueryData(a,l)}});return i}function r_({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:a}=We.useMutation({mutationFn:e,onMutate:i=>t(s=>(s&&kh({activity:s,user:r}),s)),onError:n});return a}function a_({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:a}){const{mutate:i}=We.useMutation({mutationFn:e,onMutate:s=>t(o=>(o&&Ya({activity:o}),o)),onError:n,onSuccess:(s,o,l)=>{l&&Ya({activity:l,reaction:s}),r.setQueryData(a,l)}});return i}function i_({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:a}=We.useMutation({mutationFn:e,onMutate:i=>(console.log("unpin"),t(s=>(s&&Fh({activity:s,user:r}),s))),onError:n});return a}const s_=({basePath:e,parentId:t,activityId:n,isMember:r,isOwner:a,functions:{activities:{remove:i,...s},likes:o,reactions:l,mentions:u,join:d,leave:h},profile:m})=>{var S,O,V,H,Q,ae;const p=ie.useIntl(),{activity:g,error:f,isLoading:b,mutations:{edit:v,like:C,unlike:F,pin:_,unpin:w}}=t_({queryFns:s,queryKey:[e,t,n]});if(b)return c.jsx(St,{style:{height:"400px"}});if(f||!g)return c.jsx(pn,{variant:"error",text:p.formatMessage({id:"activitySection_notFoundError"})});const{own_reactions:k,latest_reactions:j,mentioned_users:q}=g,P=(((S=j==null?void 0:j.like)==null?void 0:S.length)||0)>0,z=(((O=k==null?void 0:k.like)==null?void 0:O.length)||0)>0,R=z?k==null?void 0:k.like[0].id:"",A=P?(V=j==null?void 0:j.like)==null?void 0:V.map(D=>{var $,X,B;return{id:($=D==null?void 0:D.user)==null?void 0:$.id,name:(B=(X=D==null?void 0:D.user)==null?void 0:X.data)==null?void 0:B.name}}):!1,E=g==null?void 0:g.actor;return c.jsxs("section",{className:"activity-section",children:[c.jsx(Yr,{className:"highlighted-text-box subtle",isCommunity:!0,content:{id:n,type:"post",title:g==null?void 0:g.title,body:g==null?void 0:g.content,canLike:r,createdAt:(g==null?void 0:g.time)||"",slugs:{question:`${e}/${t}`,answer:g==null?void 0:g.id},slug:n,author:dr(E),userLiked:z,likes:((H=g==null?void 0:g.reaction_counts)==null?void 0:H.like)||0,comments:(g==null?void 0:g.total_replies)||0,peopleWhoLiked:A,mentions:q,pinned:((Q=g==null?void 0:g.reaction_counts)==null?void 0:Q.pin)&&((ae=g==null?void 0:g.reaction_counts)==null?void 0:ae.pin)>0||!1},originalAuthorId:E==null?void 0:E.id,forceHide:{comments:!0},functions:{content:{createContent:()=>null,deleteContent:i,updateContent:(D,{title:$,body:X})=>v({title:$,content:X})},likes:{createLike:()=>C({activityId:n}),deleteLike:()=>F({activityId:n,reactionId:R}),listLikes:D=>o.list({activityId:n,...D})},comments:{openComments:()=>{}},pins:{createPin:()=>_({activityId:n}),deletePin:()=>{var D;return w({activityId:n,reactionId:(D=j==null?void 0:j.pin)==null?void 0:D[0].id})}},mentions:u},styling:{showShareLinkButton:!0},userHasOwnerPermissions:a,badges:{showBadges:!0,scopes:[{scope:it.COMMUNITIES,area:t||""},{scope:it.PLATFORM,area:"all"}]},basePath:e,parentId:t},n),c.jsx(jh,{basePath:e,parentId:t,activityId:n,activityTotalReplies:(g==null?void 0:g.total_replies)||0,isMember:r,functions:{reactions:l,likes:o,mentions:u,join:d,leave:h},profile:m})]})};const Ih=({showModal:e=!0,functions:t,form:n,cachedText:r,className:a})=>{const i=ie.useIntl(),s="discussionFormModal_",{onClose:o=()=>{},cacheText:l=()=>{}}=t,{data:u,meta:d,functions:h}=n,{title:m="",body:p="",mentions:g}=r||{},f="discussion-form-modal";return c.jsx(tn,{id:f,title:i.formatMessage({id:`${s}title`}),isOpen:e,functions:{onClose:()=>{(m!==""||p!=="")&&l(b=>({...b,showCachedText:!0})),o()}},className:K("discussion-form-modal",a),children:c.jsx(Zr,{...n,data:{...u,mentions:g||(u==null?void 0:u.mentions)},meta:{...d,isAutoFocused:!0,isInOverlay:`${f}-overlay`,hasTitleField:{text:m},isPrepopulated:{text:p||(d==null?void 0:d.isPrepopulated)!==!1&&(d==null?void 0:d.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 C=g||{};C[b]={created_at:"",updated_at:"",id:b,data:{name:v}},l(F=>({...F,mentions:C}))},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})}}})})},o_=Object.freeze(Object.defineProperty({__proto__:null,default:Ih},Symbol.toStringTag,{value:"Module"}));const u_=({className:e,showModal:t=!0,title:n,formTitle:r,formLabel:a,ctaMessage:i,showIcon:s,onClose:o,reportError:l=()=>{},sendInvites:u})=>{const d=ie.useIntl();return r||(r=d.formatMessage({id:"inviteModal_formTitle"})),a||(a=d.formatMessage({id:"inviteModal_formLabel"})),i||(i=d.formatMessage({id:"inviteModal_cta"})),c.jsx(tn,{id:"invite-user-modal",title:n,isOpen:t,showDivider:!1,showIcon:s,functions:{onClose:o},className:K("invite-modal",e,{success:!!n}),children:c.jsx(mh,{title:r,label:a,ctaMessage:i,onClose:o,sendInvites:u,reportError:l})})};const hi=({showModal:e=!0,content:{successMessage:t,title:n,text:r}={},functions:a,form:i,className:s})=>{const o=ie.useIntl(),[l,u]=y.useState(Xc("showProfile")==="true"||e);y.useEffect(()=>{u(e)},[e]);const{onClose:d=()=>{}}=a;return c.jsx(tn,{id:"profile-form-modal",title:t||n||o.formatMessage({id:"profileModal_title"}),isOpen:l,showDivider:!t,functions:{onClose:d},className:K("profile-modal",s,{success:!!t}),maxWidth:700,children:c.jsxs(c.Fragment,{children:[t&&n||r?c.jsxs("div",{className:"intro",children:[t&&n?c.jsx("h3",{children:n}):"",r?c.jsx("p",{children:r}):""]}):null,c.jsx(ph,{...i,meta:{shouldShowCancelButton:!1},functions:{...(i==null?void 0:i.functions)||{},onSuccess:async h=>{var m;try{(m=i==null?void 0:i.functions)!=null&&m.onSuccess&&await i.functions.onSuccess(h)}finally{d()}}}})]})})},l_=Object.freeze(Object.defineProperty({__proto__:null,default:hi},Symbol.toStringTag,{value:"Module"}));const c_=({members:e})=>{const[t,n]=y.useState(!1),r=a=>{const{fullName:i,jobTitle:s,organisation:o,photo:l}=a||{};return c.jsxs(c.Fragment,{children:[c.jsx(gn,{name:i,src:l}),c.jsx("p",{children:i}),c.jsx("small",{className:"text-medium",children:o?`${s}, ${o}`:s})]})};return c.jsxs("div",{className:"directory-wrapper",children:[c.jsx("ul",{className:"directory",children:e.map(a=>c.jsx("li",{children:c.jsx("button",{onClick:i=>{i.preventDefault(),i.stopPropagation(),n(a)},children:r(a)})},a.fullName))}),c.jsx(tn,{isOpen:t!==!1,children:t===!1?"":c.jsxs(c.Fragment,{children:[r(t),c.jsx(Bn,{children:t.text})]}),buttons:[{size:"small",variant:"tertiary",onClick:()=>n(!1),children:"Close"}],functions:{onClose:()=>n(!1)}})]})};const d_=({author:e,authorCite:t,content:n,member:r,className:a=""})=>c.jsxs("blockquote",{className:K("testimonial-block",a),children:[c.jsx(Wt,{className:"testimonial",children:n}),r?c.jsx(Jt,{member:r,styling:{size:"large"}}):c.jsxs(c.Fragment,{children:[e&&c.jsx("p",{className:K("author",{"text-small":!a.includes("new")}),children:e}),t&&c.jsx("p",{className:K("author-cite",{"text-small":!a.includes("new")}),children:c.jsx("cite",{children:t})})]})]}),f_=y.memo(d_);const h_=({items:e=[],selector:t="",className:n=""})=>{const r=ie.useIntl(),[a,i]=y.useState(e);return y.useEffect(()=>{if(e.length)return;let s="";Array(6).fill(0).forEach((u,d)=>{s+=`${d>0?", ":""}${t} h${d+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&&c.jsxs(Mt,{variant:"subtle",className:K("table-of-contents",n),children:[c.jsx("h2",{children:r.formatMessage({id:"tableOfContents"})}),c.jsx("nav",{children:c.jsx("ul",{children:a.map(({id:s,text:o})=>c.jsx("li",{children:c.jsx("a",{href:`#${s}`,children:o})},s))})})]})};const mi=({time:e,rangeTime:t,prependedText:n,appendedText:r,className:a=""})=>{const i=ie.useIntl(),s="timeToComplete_";if(!e||typeof e!="number")return null;const o=d=>{const h=d/60,m=Math.floor(h),p=(h-m)*60,g=Math.round(p),f=`${i.formatMessage({id:`${s}hours`},{time:m})}${m>0&&g>0?", ":""}${i.formatMessage({id:`${s}minutes`},{time:g})}`;return{text:`${m>0?`${i.formatMessage({id:`${s}hours_short`},{time:m})} `:""}${g>0?i.formatMessage({id:`${s}minutes_short`},{time:g}):""}`,ariaText:f}};let{text:l,ariaText:u}=o(e);if(t){const{text:d,ariaText:h}=o(e+t);l=i.formatMessage({id:`${s}range`},{early:l,late:d}),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}`),c.jsx("span",{className:K("time-to-complete",a),"aria-label":u,children:l})};const m_=({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",c.jsx(ur,{...n,className:K("banner",e),image:{...t,aspect:"banner"}})):null;const p_=["small","span","strong","em","p","h1","h2","h3","h4","h5","h6","blockquote","q"],g_=({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 d=["eyebrow","title","text"],h={eyebrow:"small",title:"h1",text:"p"},m={};d.forEach(b=>{if(!t[b]){m[b]=!1;return}if(!s[b]){if(typeof t[b]=="object"){m[b]=t[b];const{text:v,element:C}=t[b];if(C&&p_.includes(C.toLowerCase()))return;m[b]={text:v,element:h[b]};return}m[b]={text:t[b],element:h[b]}}});const p=o&&o.text&&o.link;return p&&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"})}),c.jsx(yn,{className:K("banner-section",r,a,e,{"has-image":n,"image-full-width":n&&u.imageFullWidth,"image-inline":n&&!u.imageFullWidth,"has-cta":p,"has-extra-spacing":r!=="subtle"&&a==="normal"&&m.eyebrow&&m.title}),children:c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"content-wrapper",children:[d.map(b=>{if(m[b]&&typeof m[b]=="object"){const{text:v,element:C=""}=m[b];return b==="text"?c.jsx(Bn,{overrideType:"text-only",className:"text",children:v},b):y.createElement(C,{key:b,className:b},v)}return null}),l,p&&c.jsx(Fe,{variant:n||["light","subtle"].includes(r)?"primary":"secondary",size:{mobile:"medium",768:"large"},href:o.link,...o.props,className:K({new:r==="subtle",[(g=o.props)==null?void 0:g.className]:(f=o.props)==null?void 0:f.className}),children:o.text})]}),n&&c.jsx(ur,{image:{...n,aspect:u.imageFullWidth?"banner":n.aspect||void 0}})]})})},v_=y.memo(g_);const b_=({image:e,variant:t="default",children:n,className:r=""})=>{const a={};return e&&(a["--image"]=`url(${e})`),c.jsx(yn,{className:K("custom-content-banner",t,r,{"has-image":e}),style:a,children:c.jsx("div",{className:"content-slim",children:n})})};const y_=({alignImage:e="left",className:t,content:n,image:r})=>{const a=typeof n=="string"?c.jsx(Bn,{children:n}):n;return c.jsxs(yn,{className:K("highlight-section",t),children:[r&&c.jsx("div",{className:K("highlight-container highlight-image",{[`highlight-image-${e}`]:e==="right"}),children:c.jsx(ur,{image:{...r,description:"",query:"q=85",aspect:"highlightSection"}})}),c.jsx("div",{className:K("highlight-container highlight-content-wrapper",{"no-image":!r}),children:c.jsx("div",{className:K("highlight-content",{"highlight-content-right":e==="left"}),children:r?a:c.jsx("div",{className:"content-default",children:a})})})]})},x_=y.memo(y_);const D_=({variant:e="primary",button:t=null,title:n,text:r,gtmContext:a})=>!n&&!r?null:c.jsxs("aside",{className:K("marketing-block",e),children:[n&&c.jsx("p",{className:"title",children:n}),r&&c.jsx("p",{children:r}),t&&c.jsx(Fe,{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})]}),C_=({type:e,data:t})=>{const n=ie.useIntl(),{answers:r,createdAt:a,dateHasPassed:i,isOngoingEvent:s,pill:o,readingTime:l,publishedDate:u,startDate:d}=t;if(e==="question"){const h=a&&bs(a);return c.jsxs("p",{className:"details answers","data-testid":"question-answers",children:[n.formatMessage({id:"card_answers"},{number:r}),a&&c.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(d&&!i||s)return c.jsx("p",{className:"details",children:s?n.formatMessage({id:"card_bootcamp"}):Xs(d)});if(o)return c.jsx(Qt,{variant:o==="free"?"subtle":"highlighted",className:o,"data-testid":"course-type",children:o});if(l||u){const h=u&&bs(u);return c.jsxs("ul",{className:"details",children:[l&&c.jsx("li",{"data-testid":"reading-time",children:n.formatMessage({id:"card_time_read"},{time:l})}),u&&c.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},w_={title:66,text:3e3,secondaryText:1e3,partner:34},Qa={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"}},E_=({data:e,cta:t,link:n,gtmContext:r})=>{var f,b;const a=ie.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:d,slug:h}=e,m=e.contentType;let p="";if((f=Qa[m])!=null&&f.gtmEvent&&(p=Qa[m].gtmEvent),l&&u)return n?c.jsx("a",{href:n,className:"details additional-link gtm-trackable","data-gtm-event-context":`${r}-CarouselCard`,"data-gtm-event-type":`${p}-click`,children:o||a.formatMessage({id:"card_watch"})}):null;if(m==="people")return n?c.jsx(Fe,{variant:"tertiary",size:"small",href:n,className:"gtm-trackable","data-gtm-event-context":`${r}-Card-Button`,"data-gtm-event-type":`${p}-click`,children:o||a.formatMessage({id:"card_cta_people"})}):null;const g=["communityPage","microcourse","event"];if(t&&t.onClick&&g.includes(m)&&d!=="premium"){const v=i.loading||i.registered||((b=e==null?void 0:e.members)==null?void 0:b.isMember),C=async F=>{if(F.preventDefault(),F.stopPropagation(),!(v||!t||!t.onClick)){s(_=>({..._,loading:!0}));try{const _=await t.onClick(e);s(_==="success"?()=>({registered:!0,loading:!1}):w=>({...w,loading:!1}))}catch{s(w=>({...w,loading:!1}))}}};return c.jsx("p",{className:K("cta-wrapper",{"has-member-section":e==null?void 0:e.members}),children:c.jsx(Fe,{onClick:C,className:"gtm-trackable",size:"small",styling:{fullWidth:!0},disabled:v,"data-gtm-event-context":`${r}Page-${m}: ${h}`,"data-gtm-event-type":`${r}-${m}-register-click`,"data-testid":"in-card-button",children:o||a.formatMessage({id:`card_cta_${m}${v?`_${i.loading?"loading":"done"}`:""}`})})})}return null};function __({buildMemberData:e,communitySlug:t}){const n=ie.useIntl(),r=y.useContext(st),[a,i]=y.useState({count:"...",isMember:!1,memberType:""});return y.useEffect(()=>{e(t,typeof(r==null?void 0:r.id)<"u").then(s=>{if(!s)return;const{membersCount:o,role:l="",pagination:u}=s;let d=0;o?d=o:u!=null&&u.total&&(d=u==null?void 0:u.total),i({count:d.toString(),isMember:!!l,memberType:l})})},[t,e]),c.jsxs("span",{className:"member-information",children:[a.isMember&&c.jsx(Qt,{size:"small",variant:"registered",icon:(a==null?void 0:a.memberType)==="owner"?"user":"tick",children:n.formatMessage({id:`card_member_type_${a.memberType}`})}),c.jsx("span",{className:"label member-count",children:n.formatMessage({id:"card_member_count"},{count:a.count})})]})}const Zo=({id:e="",className:t="",buildCardData:n,buildMemberData:r,card:a,cta:i,gtmContext:s="Carousel",handleCardClick:o,setFocus:l=!1})=>{var R,A;const u=ie.useIntl(),d=y.useContext(st),h=!!(d!=null&&d.id),m=y.useRef(null),[p,g]=y.useState({data:null,isLoading:!0});y.useEffect(()=>{n(a,h).then(E=>{g({data:E,isLoading:!1})}).catch(()=>g(E=>({...E,isLoading:!1})))},[a,h,n]);const{data:f,isLoading:b}=p;if(b||!f)return c.jsx(St,{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||!Qa[v])return c.jsx(St,{element:"li",className:"card-wrapper"});const{basePath:C="",className:F,length:_,gtmEvent:w}=Qa[v];let k=f.slug?`${C}${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")&&(k=f.slug);const j=E=>{k&&(E.preventDefault(),E.stopPropagation(),window.location.href=k)},q={...w_,..._};let P={className:"card"},z={};return k&&(z={href:k,className:"gtm-trackable","data-gtm-event-context":`${s}-CarouselCard`,"data-gtm-event-type":`${w}-click`,"data-testid":"link"},f.openInNewTab&&(z.target="_blank"),P={onClick:j,className:"card gtm-trackable","data-gtm-event-context":`${s}-CarouselCard`,"data-gtm-event-type":`${w}-click`}),l&&(P={...P,tabIndex:"0"},(R=m==null?void 0:m.current)==null||R.focus(),(A=m==null?void 0:m.current)==null||A.scrollIntoView({behavior:"smooth"})),c.jsx("li",{className:K("card-wrapper text-medium",F,t,{"has-link":k,"no-link":!k,"has-image":f.banner}),"data-testid":`${v}-card`,children:c.jsxs("div",{...P,ref:m,children:[c.jsx(td,{className:"card-label",contentType:v,customIcon:f.isPrivate?"lock-locked":f.customIcon,customLabel:f.customLabel}),v==="communityPage"&&(f==null?void 0:f.createdAt)&&cm(f==null?void 0:f.createdAt,60)&&c.jsx(Qt,{size:"small",variant:"information","data-testid":"new-community",children:u.formatMessage({id:"card_new"})}),f.startDate&&!f.isOngoingEvent&&c.jsx(Qt,{size:"small",variant:f.dateHasPassed?"default":"information","data-testid":"date",children:f.dateHasPassed?u.formatMessage({id:"card_ended"}):Yc(f.startDate)}),f.banner?c.jsxs("p",{className:"img",children:[f.registered&&c.jsx(Qt,{size:"small",variant:"registered",children:u.formatMessage({id:"card_registered"})}),c.jsx(ur,{image:{...f.banner,description:""}})]}):F==="people"?c.jsx(gn,{name:f.title||"",src:f.profile,"data-testid":"people-profile-picture"}):null,f.contributors&&c.jsx(io,{contributors:{data:f.contributors},styling:{size:"small",showGap:F!=="question",showText:!0},multipleText:["event","solutionArticle"].includes(v)?u.formatMessage({id:`card_contributors_${v}`}):void 0,"data-testid":"contributors"}),f.partner&&c.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}):Xn(f.partner[0],q.partner)}),["title","text","secondaryText"].map(E=>{const S=f[E];if(!S)return null;const O=Uc(E),V={key:E,className:O,"data-testid":O},H={wrapper:"p",forceWrapper:!0,forceInline:!0},Q=Xn(S,q[E]);return["title","text"].includes(E)&&k?(H.wrapper="a",c.jsx("p",{...V,children:c.jsx(Wt,{options:H,...z,children:Q})})):c.jsx(Wt,{options:H,...V,children:Q})}),a.contentType==="communityPage"&&(a.slug||f.slug)&&r&&c.jsx(__,{communitySlug:a.slug||f.slug,buildMemberData:r}),c.jsx(C_,{type:F||"",data:f}),c.jsx(E_,{data:f,cta:i,link:k||"",gtmContext:s})]})})};const $h=({cards:e,cardTypes:t,className:n="",...r})=>c.jsx("ul",{className:K("card-block",n),children:e.map((a,i)=>{const s=a.slug?`${a.slug}-${t[i]}`:`${t[i]}-${i}`;return c.jsx(Zo,{id:s,card:{...a,contentType:t[i]},setFocus:i===(r==null?void 0:r.focusCardIndex),...r},s)})}),k_=(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},F_=({id:e,title:t})=>{const n=ie.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:K("title",i,s,{"highlighted-title":i==="highlighted"}),children:c.jsxs(c.Fragment,{children:[r,o&&c.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 hs={fourCards:1024,threeCards:769,twoCards:480};let ba=null,ms=null;const B_=({id:e,cards:t,cardTypes:n,buildCardData:r,title:a,className:i,gtmContext:s,...o})=>{const l=ie.useIntl(),u="carousel_pagination_",[d,h]=y.useState({cardsPerPage:4,isLoading:!0}),{cardsPerPage:m,isLoading:p}=d,[g,f]=y.useState({currentPage:0,loadedPages:[0]}),{currentPage:b,loadedPages:v}=g,[C,F]=y.useState(""),_=t.length,w=Math.ceil(_/m),k=y.useRef(null),j=Pn(!0,!0,k==null?void 0:k.current);y.useEffect(()=>{let E=1;j&&(j>=hs.fourCards?E=4:j>=hs.threeCards?E=3:j>=hs.twoCards&&(E=2),E>_&&(E=_)),h(S=>({...S,cardsPerPage:E,isLoading:!1}))},[j,_]);const q=(E="next")=>{ms&&clearTimeout(ms);let S=b;if(typeof E=="string")if(E==="next")if(b<w-1)S=b+1;else return;else if(b>0)S=b-1;else return;else S=E;F(""),f(V=>({...V,currentPage:S,loadedPages:[...new Set([...v,S])]}));const O=()=>{const V=S*d.cardsPerPage,H=V+d.cardsPerPage;return t.slice(V,H).length};ms=setTimeout(()=>{F(l.formatMessage({id:`${u}ariaLive${typeof E=="string"?"":"_slide"}`},{direction:l.formatMessage({id:`${u}${typeof E=="string"?E:"next"}`}),slide:typeof E=="string"?1:E+1,count:O()}))},500)},P=E=>{ba=E.touches[0].clientX},z=E=>{if(ba===null)return;const S=E.touches[0].clientX,O=ba-S;O>5?q("next"):O<-5&&q("previous"),ba=null},R={"--width":`${j||0}px`,"--total-cards":_,"--cards-per-page":m,"--page":b};if(p)return c.jsx(ni,{layout:`carousel${a?"-with-title":""}`});const A=(E,S)=>{var V;let O=null;return(V=E==null?void 0:E.sys)!=null&&V.id?O=`card-${E.sys.id}`:E!=null&&E.slug?O=`card-${E.slug}`:[n[S],E.contentType].includes("customCard")&&(O=`card-${window.btoa(`${E.title} ${E.createdAt}`)}-${S}`),O};return c.jsxs("section",{ref:k,className:K("carousel-wrapper",i),"data-testid":"carousel",children:[c.jsx(F_,{id:e,title:a}),c.jsx("ul",{className:"carousel",onTouchStart:P,onTouchMove:z,style:R,"data-testid":"carousel-list",children:t.map((E,S)=>{let O=A(E,S);return O&&k_(S,m,b,v)?c.jsx(Zo,{id:O,card:{...E,contentType:n[S]},buildCardData:r,gtmContext:s,...o},O):(O=O||`${e}-card-${S}`,c.jsx(St,{element:"li",className:"card-wrapper","data-testid":"card-placeholder"},O))})}),w<=1?null:c.jsxs(c.Fragment,{children:[c.jsxs("ul",{className:"controls","data-testid":"carousel-controls",children:[c.jsx("li",{className:"arrow previous",children:c.jsx(Fe,{variant:"secondary",size:"large",icon:{icon:"chevron_left"},onClick:E=>{E.preventDefault(),E.stopPropagation(),q("previous")},screenreaderText:l.formatMessage({id:`${u}previousSlide`}),disabled:b<=0})}),[...Array(w)].map((E,S)=>c.jsx("li",{"data-testid":"carousel-controls-button",children:c.jsx("button",{className:K("page-indicator",{selected:S===b}),onClick:O=>{O.preventDefault(),O.stopPropagation(),q(S)},children:c.jsx(Ie,{showOnFocus:!1,children:l.formatMessage({id:`${u}slide`},{number:S+1,total:w})})})},`page-indicator-${S}`)),c.jsx("li",{className:"arrow next",children:c.jsx(Fe,{variant:"secondary",size:"large",icon:{icon:"chevron_right"},onClick:E=>{E.preventDefault(),E.stopPropagation(),q("next")},screenreaderText:l.formatMessage({id:`${u}nextSlide`}),disabled:b>=w-1})})]}),c.jsx(Ie,{"aria-live":C===""?"off":"polite",showOnFocus:!1,children:C})]})]})},A_=({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 d=i?window.btoa(i):`carousel-${u}`,h=u===e.length-1;return t?c.jsxs(y.Fragment,{children:[c.jsx(ni,{layout:`carousel${i?"-with-title":""}`,"data-testid":"carousel-placeholder"}),h?null:c.jsx(Ht,{})]},`placeholder-${d}`):c.jsxs(y.Fragment,{children:[c.jsx(B_,{cards:o,cardTypes:l,title:n!=null&&n.hidden?{}:{...n,text:i,link:s},...a}),h?null:c.jsx(Ht,{})]},`carousel-${d}`)});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=ie.useIntl();let u=a?n:r;u>99?u=100:u<1&&(u=0);const{highlightPercentage:d=!1}=s;return y.createElement(e,{className:K("course-progression",o,{"highlight-percentage":d,"has-circle-graph":i==="circle"}),children:c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"percentage",children:l.formatMessage({id:"courseProgression_done"},{percent:h=>c.jsx("strong",{children:h}),number:u})}),u<100&&a&&c.jsx(mi,{time:t,appendedText:l.formatMessage({id:"courseProgression_timeLeft"})}),c.jsx(ao,{progress:u,styling:{layout:i||"bar",size:i&&i==="circle"?"small":"default"}})]})})};const Lh=({element:e="span",sectionId:t,subsectionId:n,title:r,className:a=""})=>y.createElement(e,{className:K("lesson-name",a),"data-number":`${t}.${n}`,children:r});const zh=({size:e="default",completionTime:t,icon:n,optional:r,type:a,children:i})=>{const s=ie.useIntl(),o=Xa(`lessonType_${a}`)?s.formatMessage({id:`lessonType_${a}`}):Vc(a||"");return c.jsxs("small",{className:K("content-type",{[e]:e!=="default"}),children:[c.jsx("span",{className:K("type",n),children:o})," ",t>0&&!r&&c.jsx(mi,{time:t})," ",i?c.jsx("span",{className:"additional",children:i}):null]})};const S_=({course:{articles:e,canAccessCourse:t,description:n,hideTimes:r,isEnrolled:a,sectionId:i,sectionTime:s,slug:o,timeLeft:l,title:u},quizScores:d})=>{const h=ie.useIntl(),m="courseStructure_",p=u.toLowerCase().includes("course conclusion");return c.jsxs(ei,{className:"course-structure",label:c.jsxs(c.Fragment,{children:[c.jsxs("small",{children:[h.formatMessage({id:`${m}section${p?"_end":""}`},{number:i})," ",!r&&s>=0&&c.jsx("span",{className:"time",children:a&&l===0?h.formatMessage({id:`${m}time_completed`}):c.jsx(mi,{time:s,appendedText:a?h.formatMessage({id:`${m}time_left`}):""})})]}),c.jsx("h3",{children:u})]}),shouldAnimate:!0,children:[c.jsx("p",{children:n}),c.jsx("ol",{children:e&&e.length>0&&e.map(({completed:g,completionTime:f,contentType:b,icon:v,image:C,isIntroduction:F,optional:_,slug:w,subsectionId:k,title:j,type:q})=>{const P=a&&t||F,z={};return C&&(z.style={"--image":`url(${C})`}),c.jsx("li",{className:K({article:b===Cr.ARTICLE,discussion:b===Cr.DISCUSSION,quiz:b===Cr.QUIZ,completed:g&&b===Cr.ARTICLE,locked:!P}),...z,children:c.jsx(mn,{href:P?`/microcourses/en/${o}/${w}`:void 0,fallbackElement:"span",className:"inner",gtmContext:`MicrocourseOutline${Hc(j)}`,gtmType:"article-click",children:c.jsxs(c.Fragment,{children:[c.jsx(Lh,{sectionId:i,subsectionId:k,title:j,className:"course-title"})," ",c.jsx(zh,{completionTime:f,icon:v,optional:_,type:q,children:d&&d[w]&&c.jsx("span",{className:"quiz-score",children:`${d[w]}%`})})]})})},w)})})]})};const j_=({isComplete:e=!1,onClick:t,...n})=>{const r=ie.useIntl();return n["data-gtm-event-context"]||(n["data-gtm-event-context"]="LessonIntroduction"),c.jsx(Fe,{...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:K("mark-complete-button center gtm-trackable",{completed:e}),"data-gtm-event-type":"mark-as-complete",disabled:e,children:r.formatMessage({id:`markCompleteButton${e?"_completed":""}`})})},O_=({id:e,data:{jobTitle:t,name:n,organization:r,thumbnail:a}})=>({id:e,name:n,jobTitle:t,organization:r,image:{thumbnail:a}}),Oc=[{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 ya="notFoundError_",P_=()=>{const e=ie.useIntl(),t=[];return Oc.forEach((n,r)=>{n.title=e.formatMessage({id:`${ya}post_${r+1}`}),t.push("solutionArticle")}),c.jsxs(yh,{styling:{background:"bold",circle:"small",variant:"alt-2"},additionalContent:{appended:c.jsxs(yn,{children:[c.jsx($h,{cards:Oc,cardTypes:t,buildCardData:n=>new Promise((r,a)=>{r(n)})}),c.jsx(Fe,{href:"/solution-articles/",children:e.formatMessage({id:`${ya}cta`})})]})},reportError:()=>{},className:"not-found-error",children:[c.jsx("h1",{children:e.formatMessage({id:`${ya}title`})}),c.jsx("p",{children:e.formatMessage({id:`${ya}text`})})]})};exports.ASSETS_BUCKET=Ut;exports.ActivitiesFeed=PE;exports.ActivitySection=s_;exports.AddPost=Vo;exports.Badge=pd;exports.BadgeScope=it;exports.Badges=gd;exports.BadgesContext=eo;exports.BadgesProvider=od;exports.Banner=m_;exports.BannerSection=v_;exports.Breadcrumbs=Yp;exports.Buckets=km;exports.Button=Fe;exports.ButtonWrapper=or;exports.COURSE_CONTENT_TYPES=Cr;exports.CacheProvider=ud;exports.Card=Zo;exports.CardBlock=$h;exports.Carousel=A_;exports.CharacterLimit=fo;exports.CollapsibleSection=ei;exports.Columns=Od;exports.CommunityDetails=Zp;exports.ContactFooter=Qw;exports.ContactForm=hh;exports.ContentTypeLabel=td;exports.Contributors=io;exports.ConversationContext=fi;exports.CookieBanner=bh;exports.CourseProgression=T_;exports.CourseStructure=S_;exports.CustomContentBanner=b_;exports.CustomEvents=tt;exports.DELETED_USER_ID=Or;exports.Directory=c_;exports.DiscussionConversation=Ch;exports.DiscussionForm=Zr;exports.DiscussionFormCard=Mh;exports.DiscussionFormModal=Ih;exports.DiscussionLikes=wh;exports.DiscussionPost=Yr;exports.DiscussionThread=Rh;exports.Divider=Ht;exports.DownloadSection=Kw;exports.EMAILS=Un;exports.EditSection=Yw;exports.EmailHelperTextBox=Md;exports.EmptyStateBox=pn;exports.EnrichedUrl=Gp;exports.FeatureFlags=to;exports.Filters=Qp;exports.FlagsProvider=cd;exports.Footer=$o;exports.Form=nn;exports.Formatting=Y;exports.Fragment=Ft;exports.FullWidthSection=yn;exports.GET_STREAM_USER_PREFIX=vs;exports.GlobalProviders=zm;exports.Header=Lo;exports.HelperTextBox=rd;exports.HiddenFromScreenReaders=Ja;exports.HideShowTextBox=ad;exports.HighlightSection=x_;exports.HighlightedTextBox=Mt;exports.INVALID_TOKEN=Kc;exports.IconBulletedList=Am;exports.ImageContainer=Cm;exports.IntlProvider=dd;exports.InviteForm=mh;exports.InviteModal=u_;exports.JoinButton=lo;exports.LanguageContext=no;exports.LanguageSwitcher=Xp;exports.LessonName=Lh;exports.LessonType=zh;exports.LikesFeed=Oh;exports.LikesModal=Ph;exports.Link=mn;exports.LoadMore=Vr;exports.LoadingBlock=Hm;exports.LoadingPlaceholder=St;exports.LoadingState=ni;exports.Logo=co;exports.LogoSection=Gw;exports.MEMBERS_PER_PAGE=xh;exports.MENTION_REGEX=Zc;exports.MarkCompleteButton=j_;exports.MarkdownText=Bn;exports.MarketingBlock=D_;exports.Marks=qt;exports.Member=Jt;exports.MembersList=Dh;exports.Modal=so;exports.MoreMenu=Sd;exports.NUMBER_OF_COUNTRIES=om;exports.NUMBER_OF_USERS=sm;exports.NavigationMenu=jd;exports.NotFoundError=P_;exports.Overlay=tn;exports.OverlayContext=ro;exports.OverlayProvider=md;exports.PageHeading=id;exports.PageLayout=yh;exports.PasswordForm=Lw;exports.PasswordRules=Ld;exports.Pill=Qt;exports.Popover=ed;exports.Portal=lr;exports.ProfileForm=ph;exports.ProfileImageChange=fh;exports.ProfileModal=hi;exports.ProfileModalLauncher=Ko;exports.ProfilePicture=gn;exports.ProgressBar=ao;exports.ProgressTracker=Em;exports.Rating=bg;exports.RepliesFeed=jh;exports.ResponsesHeading=Nh;exports.ResponsiveImage=ur;exports.ReturnToNavButton=_m;exports.RichTextEditor=dh;exports.SearchForm=gh;exports.ShareLinks=ig;exports.SignupForm=Vw;exports.Span=Ds;exports.StatusBanner=Mr;exports.TableOfContents=h_;exports.Tabs=sg;exports.Tags=nE;exports.TestimonialBlock=f_;exports.TimeToComplete=mi;exports.Toggle=$w;exports.Tooltip=Mn;exports.TopLevelPage=Jw;exports.UUID_V4_REGEX=Pr;exports.UserContext=st;exports.UserProvider=fd;exports.VisuallyHidden=Ie;exports.addAriaProps=Td;exports.basicReducer=Hr;exports.camelCaseToDashCase=Uc;exports.checkIntlPathExists=Xa;exports.generateConditions=Ta;exports.generateCssIcon=um;exports.getAuthorData=dr;exports.getCharacterLimitProps=Pd;exports.getLongDate=Xs;exports.getMember=ri;exports.getPostBody=Ho;exports.getShortDate=Yc;exports.getValueLength=ai;exports.headerData=Ur;exports.mapGetStreamData=O_;exports.pageReady=Gc;exports.passwordValidator=ys;exports.repliesFeedMock=ME;exports.supportedLanguages=Ca;exports.toCamelCase=Hc;exports.toCapitalisedCase=im;exports.toSentenceCase=Vc;exports.transformSlugs=Ys;exports.useBadges=sd;exports.useCurrentPath=Ic;exports.useEffectAfterMount=er;exports.useElementWidth=Pn;exports.useOverlay=hd;exports.useScrollListener=zc;exports.useScrollToHash=Qs;exports.useTooltips=Js;exports.useUser=ti;